max_stars_count
int64 301
224k
| text
stringlengths 6
1.05M
| token_count
int64 3
727k
|
---|---|---|
2,338 | <filename>libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate.pass.cpp
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <algorithm>
// template<ForwardIterator Iter, Callable Generator>
// requires OutputIterator<Iter, Generator::result_type>
// && CopyConstructible<Generator>
// constexpr void // constexpr after c++17
// generate(Iter first, Iter last, Generator gen);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
struct gen_test
{
TEST_CONSTEXPR int operator()() const {return 1;}
};
#if TEST_STD_VER > 17
TEST_CONSTEXPR bool test_constexpr() {
int ia[] = {0, 1, 2, 3, 4};
std::generate(std::begin(ia), std::end(ia), gen_test());
return std::all_of(std::begin(ia), std::end(ia), [](int x) { return x == 1; })
;
}
#endif
template <class Iter>
void
test()
{
const unsigned n = 4;
int ia[n] = {0};
std::generate(Iter(ia), Iter(ia+n), gen_test());
assert(ia[0] == 1);
assert(ia[1] == 1);
assert(ia[2] == 1);
assert(ia[3] == 1);
}
int main(int, char**)
{
test<forward_iterator<int*> >();
test<bidirectional_iterator<int*> >();
test<random_access_iterator<int*> >();
test<int*>();
#if TEST_STD_VER > 17
static_assert(test_constexpr());
#endif
return 0;
}
| 614 |
348 | <filename>docs/data/leg-t1/024/02401138.json<gh_stars>100-1000
{"nom":"Coulounieix-Chamiers","circ":"1ère circonscription","dpt":"Dordogne","inscrits":6197,"abs":3079,"votants":3118,"blancs":48,"nuls":31,"exp":3039,"res":[{"nuance":"REM","nom":"<NAME>","voix":1099},{"nuance":"FI","nom":"<NAME>","voix":581},{"nuance":"FN","nom":"Mme <NAME>","voix":372},{"nuance":"SOC","nom":"M. <NAME>","voix":364},{"nuance":"LR","nom":"<NAME>","voix":363},{"nuance":"COM","nom":"M. <NAME>","voix":146},{"nuance":"ECO","nom":"M. <NAME>","voix":62},{"nuance":"EXG","nom":"Mme <NAME>","voix":24},{"nuance":"DVD","nom":"<NAME>","voix":18},{"nuance":"DIV","nom":"<NAME>","voix":10}]} | 269 |
835 | package com.zzhoujay.markdown.style;
import android.annotation.TargetApi;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Build;
import android.text.style.ReplacementSpan;
import com.zzhoujay.markdown.util.NumberKit;
/**
* Created by zhou on 16-7-3.
* 列表Span
*/
public class MarkDownInnerBulletSpan extends ReplacementSpan {
private static final int BULLET_RADIUS = 6;
private static final int tab = 40;
private static final int gap = 40;
private final int mColor;
private final String index;
private int margin;
private int level;
private static Path circleBulletPath = null;
private static Path rectBulletPath = null;
public MarkDownInnerBulletSpan(int level, int mColor, int index) {
this.mColor = mColor;
this.level = level;
if (index > 0) {
if (level == 1) {
this.index = NumberKit.toRomanNumerals(index) + '.';
} else if (level >= 2) {
this.index = NumberKit.toABC(index - 1) + '.';
} else {
this.index = index + ".";
}
} else {
this.index = null;
}
}
@Override
public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) {
if (index == null) {
margin = tab + (gap + BULLET_RADIUS * 2) * (level + 1);
} else {
margin = (int) (tab + (gap + paint.measureText(index)) * (level + 1));
}
return (int) (margin + paint.measureText(text, start, end));
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint) {
int oldcolor = paint.getColor();
paint.setColor(mColor);
// draw bullet
if (index != null) {
canvas.drawText(index, x + tab, y, paint);
} else {
Paint.Style style = paint.getStyle();
if (level == 1) {
paint.setStyle(Paint.Style.STROKE);
} else {
paint.setStyle(Paint.Style.FILL);
}
if (canvas.isHardwareAccelerated()) {
Path path;
if (level >= 2) {
if (rectBulletPath == null) {
rectBulletPath = new Path();
float w = 1.2f * BULLET_RADIUS;
rectBulletPath.addRect(-w, -w, w, w, Path.Direction.CW);
}
path = rectBulletPath;
} else {
if (circleBulletPath == null) {
circleBulletPath = new Path();
// Bullet is slightly better to avoid aliasing artifacts on mdpi devices.
circleBulletPath.addCircle(0.0f, 0.0f, 1.2f * BULLET_RADIUS, Path.Direction.CW);
}
path = circleBulletPath;
}
canvas.save();
canvas.translate(x + margin - gap, (top + bottom) / 2.0f);
canvas.drawPath(path, paint);
canvas.restore();
} else {
canvas.drawCircle(x + margin - gap, (top + bottom) / 2.0f, BULLET_RADIUS, paint);
}
paint.setStyle(style);
}
// drawText
canvas.drawText(text, start, end, x + margin, y, paint);
paint.setColor(oldcolor);
}
}
| 1,775 |
2,542 | // ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
namespace TXRStatefulServiceBase
{
class StatefulServiceBase
: public IFabricStatefulServiceReplica
, Common::ComUnknownBase
{
BEGIN_COM_INTERFACE_LIST(StatefulServiceBase)
COM_INTERFACE_ITEM(IID_IUnknown, IFabricStatefulServiceReplica)
COM_INTERFACE_ITEM(IID_IFabricStatefulServiceReplica, IFabricStatefulServiceReplica)
END_COM_INTERFACE_LIST()
// IFabricStatefulServiceReplica methods
public:
virtual HRESULT STDMETHODCALLTYPE BeginOpen(
/* [in] */ FABRIC_REPLICA_OPEN_MODE openMode,
/* [in] */ IFabricStatefulServicePartition *partition,
/* [in] */ IFabricAsyncOperationCallback *callback,
/* [retval][out] */ IFabricAsyncOperationContext **context);
virtual HRESULT STDMETHODCALLTYPE EndOpen(
/* [in] */ IFabricAsyncOperationContext *context,
/* [retval][out] */ IFabricReplicator **replicationEngine);
virtual HRESULT STDMETHODCALLTYPE BeginChangeRole(
/* [in] */ FABRIC_REPLICA_ROLE newRole,
/* [in] */ IFabricAsyncOperationCallback *callback,
/* [retval][out] */ IFabricAsyncOperationContext **context);
virtual HRESULT STDMETHODCALLTYPE EndChangeRole(
/* [in] */ IFabricAsyncOperationContext *context,
/* [retval][out] */ IFabricStringResult **serviceEndpoint);
virtual HRESULT STDMETHODCALLTYPE BeginClose(
/* [in] */ IFabricAsyncOperationCallback *callback,
/* [retval][out] */ IFabricAsyncOperationContext **context);
virtual HRESULT STDMETHODCALLTYPE EndClose(
/* [in] */ IFabricAsyncOperationContext *context);
virtual void STDMETHODCALLTYPE Abort();
protected:
StatefulServiceBase(
__in ULONG httpListeningPort,
__in FABRIC_PARTITION_ID partitionId,
__in FABRIC_REPLICA_ID replicaId,
__in Common::ComponentRootSPtr const & root);
// Uses default http endpoint resource. Name is a const defined in Helpers::ServiceHttpEndpointResourceName in Helpers.cpp
StatefulServiceBase(
__in FABRIC_PARTITION_ID partitionId,
__in FABRIC_REPLICA_ID replicaId,
__in Common::ComponentRootSPtr const & root);
virtual ~StatefulServiceBase();
__declspec(property(get = get_ReplicaId)) FABRIC_REPLICA_ID ReplicaId;
FABRIC_REPLICA_ID get_ReplicaId() const
{
return replicaId_;
}
__declspec(property(get = get_PartitionId)) FABRIC_PARTITION_ID PartitionId;
FABRIC_PARTITION_ID get_PartitionId() const
{
return partitionId_;
}
__declspec(property(get = get_TxReplicator)) TxnReplicator::ITransactionalReplicator::SPtr TxReplicator;
__declspec(noinline)
TxnReplicator::ITransactionalReplicator::SPtr get_TxReplicator() const
{
return txReplicatorSPtr_;
}
__declspec(property(get = get_Role)) FABRIC_REPLICA_ROLE Role;
FABRIC_REPLICA_ROLE get_Role() const
{
return role_;
}
__declspec(property(get = get_KtlSystem)) KtlSystem * KtlSystemValue;
KtlSystem * get_KtlSystem() const
{
return ktlSystem_;
}
virtual Common::ComPointer<IFabricStateProvider2Factory> GetStateProviderFactory() = 0;
virtual Common::ComPointer<IFabricDataLossHandler> GetDataLossHandler() = 0;
virtual Common::ErrorCode OnHttpPostRequest(Common::ByteBufferUPtr && body, Common::ByteBufferUPtr & responseBody) = 0;
virtual void OnChangeRole(
/* [in] */ FABRIC_REPLICA_ROLE newRole,
/* [in] */ IFabricAsyncOperationCallback *callback,
/* [retval][out] */ IFabricAsyncOperationContext **context);
private:
LONGLONG const instanceId_;
Common::ComponentRootSPtr const root_;
FABRIC_REPLICA_ID const replicaId_;
FABRIC_PARTITION_ID const partitionId_;
std::wstring const httpListenAddress_;
std::wstring const changeRoleEndpoint_;
FABRIC_REPLICA_ROLE role_;
HttpServer::IHttpServerSPtr httpServerSPtr_;
Common::ComPointer<IFabricStatefulServicePartition> partition_;
Common::ComPointer<IFabricPrimaryReplicator> primaryReplicator_;
TxnReplicator::ITransactionalReplicator::SPtr txReplicatorSPtr_;
KtlSystem * ktlSystem_;
};
typedef Common::ComPointer<StatefulServiceBase> StatefulServiceBaseCPtr;
}
| 2,043 |
664 | /*
* Copyright 2013-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.contract.verifier.builder;
import org.assertj.core.api.BDDAssertions;
import org.junit.Test;
public class BlockBuilderTests {
@Test
public void should_add_ending_if_no_special_char_is_at_the_end() {
BlockBuilder blockBuilder = blockBuilder();
blockBuilder.append("foo").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo;");
blockBuilder = blockBuilder();
blockBuilder.append("foo\n").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo;\n");
blockBuilder = blockBuilder();
blockBuilder.append(
"DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()))\n")
.addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo(
"DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));\n");
}
@Test
public void should_not_add_ending_if_no_char_is_at_the_end() {
BlockBuilder blockBuilder = blockBuilder();
blockBuilder.append("foo;").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo;");
blockBuilder = blockBuilder();
blockBuilder.append("foo {").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo {");
blockBuilder = blockBuilder();
blockBuilder.append("foo {\n").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo {\n");
blockBuilder = blockBuilder();
blockBuilder.append("foo;\n").addEndingIfNotPresent();
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo;\n");
}
@Test
public void should_add_space_if_ends_with_a_text() {
BlockBuilder blockBuilder = blockBuilder();
blockBuilder.append("foo").addAtTheEndIfEndsWithAChar(" ");
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo ");
}
@Test
public void should_not_add_space_if_does_not_end_with_a_text() {
BlockBuilder blockBuilder = blockBuilder();
blockBuilder.append("foo\n").addAtTheEndIfEndsWithAChar(" ");
BDDAssertions.then(blockBuilder.toString()).isEqualTo("foo\n");
}
private BlockBuilder blockBuilder() {
BlockBuilder blockBuilder = new BlockBuilder("\t");
blockBuilder.setupLineEnding(";");
return blockBuilder;
}
} | 977 |
751 | <gh_stars>100-1000
/*
* Copyright (c) 2021 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef included_ip_sas_h
#define included_ip_sas_h
#include <stdbool.h>
#include <vnet/ip/ip6_packet.h>
#include <vnet/ip/ip4_packet.h>
bool ip6_sas_by_sw_if_index (u32 sw_if_index, const ip6_address_t *dst,
ip6_address_t *src);
bool ip4_sas_by_sw_if_index (u32 sw_if_index, const ip4_address_t *dst,
ip4_address_t *src);
bool ip6_sas (u32 table_id, u32 sw_if_index, const ip6_address_t *dst,
ip6_address_t *src);
bool ip4_sas (u32 table_id, u32 sw_if_index, const ip4_address_t *dst,
ip4_address_t *src);
#endif
| 445 |
4,036 |
#include "includefirsttarget.h" // has it's own include guard
#ifndef INCLUDEFIRST_H
#define INCLUDEFIRST_H
// GOOD: this header file has an include guard.
void includeFirstFunction();
#endif // INCLUDEFIRST_H
| 78 |
348 | <gh_stars>100-1000
{"nom":"Brassy","circ":"4ème circonscription","dpt":"Somme","inscrits":61,"abs":36,"votants":25,"blancs":0,"nuls":0,"exp":25,"res":[{"nuance":"REM","nom":"<NAME>","voix":14},{"nuance":"FN","nom":"<NAME>","voix":11}]} | 97 |
437 | <gh_stars>100-1000
package com.fasterxml.jackson.dataformat.xml.lists;
import java.util.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonTypeInfo.*;
import com.fasterxml.jackson.dataformat.xml.*;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
/**
* @author pgelinas
*/
public class PolymorphicList97Test extends XmlTestBase
{
@JsonTypeInfo(property = "type", use = Id.NAME)
public static abstract class Foo {
@JacksonXmlProperty(isAttribute = true)
public String data;
}
@JsonTypeName("good")
public static class FooGood extends Foo {
public String bar;
}
@JsonTypeName("bad")
public static class FooBad extends Foo {
@JacksonXmlElementWrapper(useWrapping = false)
public List<String> bar;
}
@Test
public void testGood() throws Exception {
XmlMapper mapper = new XmlMapper();
mapper.registerSubtypes(FooGood.class);
String xml = "<Foo type=\"good\" data=\"dummy\"><bar>FOOBAR</bar></Foo>";
Foo fooRead = mapper.readValue(xml, Foo.class);
assertThat(fooRead, instanceOf(FooGood.class));
xml = "<Foo data=\"dummy\" type=\"good\" ><bar>FOOBAR</bar></Foo>";
fooRead = mapper.readValue(xml, Foo.class);
assertThat(fooRead, instanceOf(FooGood.class));
}
@Test
public void testBad() throws Exception {
XmlMapper mapper = new XmlMapper();
mapper.registerSubtypes(FooBad.class);
String xml = "<Foo type=\"bad\" data=\"dummy\"><bar><bar>FOOBAR</bar></bar></Foo>";
Foo fooRead = mapper.readValue(xml, Foo.class);
assertThat(fooRead, instanceOf(FooBad.class));
xml = "<Foo data=\"dummy\" type=\"bad\"><bar><bar>FOOBAR</bar></bar></Foo>";
fooRead = mapper.readValue(xml, Foo.class);
assertThat(fooRead, instanceOf(FooBad.class));
}
}
| 836 |
429 | <reponame>fqliao/MP-SPDZ<gh_stars>100-1000
/*
* semi-party.cpp
*
*/
#include "Math/gfp.h"
#include "Protocols/SemiShare.h"
#include "Tools/SwitchableOutput.h"
#include "GC/SemiPrep.h"
#include "Processor/FieldMachine.hpp"
#include "Semi.hpp"
#include "GC/ShareSecret.hpp"
#include "Math/gfp.hpp"
int main(int argc, const char** argv)
{
ez::ezOptionParser opt;
DishonestMajorityFieldMachine<SemiShare>(argc, argv, opt);
}
| 188 |
965 | CArray<CPoint, CPoint> myArray;
// Add elements to the array.
for (int i = 0; i < 10; i++)
{
myArray.Add(CPoint(i, 2 * i));
}
// Modify all the points in the array.
for (int i = 0; i <= myArray.GetUpperBound(); i++)
{
myArray[i].x = 0;
} | 104 |
5,908 | package org.testcontainers.junit;
import org.junit.Test;
import org.testcontainers.containers.SeleniumUtils;
import java.io.IOException;
import java.util.jar.Manifest;
import static org.rnorth.visibleassertions.VisibleAssertions.*;
/**
* Created by <NAME>
*/
public class SeleniumUtilsTest {
@Test
public void detectSeleniumVersionUnder3() throws IOException {
checkSeleniumVersionDetected("manifests/MANIFEST-2.45.0.MF", "2.45.0");
}
@Test
public void detectSeleniumVersionUpper3() throws IOException {
checkSeleniumVersionDetected("manifests/MANIFEST-3.5.2.MF", "3.5.2");
}
/**
* Check if Selenium Version detected is the correct one.
* @param urlManifest : manifest file
* @throws IOException
*/
private void checkSeleniumVersionDetected(String urlManifest, String expectedVersion) throws IOException {
Manifest manifest = new Manifest();
manifest.read(this.getClass().getClassLoader().getResourceAsStream(urlManifest));
String seleniumVersion = SeleniumUtils.getSeleniumVersionFromManifest(manifest);
assertEquals("Check if Selenium Version detected is the correct one.", expectedVersion, seleniumVersion);
}
}
| 424 |
1,958 | package com.freetymekiyan.algorithms.level.medium;
import org.junit.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class WordSearchTest {
@DataProvider(name = "examples")
public Object[][] getExamples() {
char[][] board = {
{'A', 'B', 'C', 'E'},
{'S', 'F', 'C', 'S'},
{'A', 'D', 'E', 'E'}
};
return new Object[][]{
new Object[]{board, "ABCCED", true},
new Object[]{board, "SEE", true},
new Object[]{board, "ABCB", false}
};
}
@Test(dataProvider = "examples")
public void testExist(char[][] board, String word, boolean expected) {
WordSearch w = new WordSearch();
Assert.assertEquals(w.exist(board, word), expected);
}
@Test(dataProvider = "examples")
public void testExist2(char[][] board, String word, boolean expected) {
WordSearch w = new WordSearch();
Assert.assertEquals(w.exist2(board, word), expected);
}
} | 485 |
7,062 | <gh_stars>1000+
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*-
// Copyright (c) 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// ---
// Author: <NAME> (<EMAIL>)
// When you are porting perftools to a new compiler or architecture
// (win64 vs win32) for instance, you'll need to change the mangled
// symbol names for operator new and friends at the top of
// patch_functions.cc. This file helps you do that.
//
// It does this by defining these functions with the proper signature.
// All you need to do is compile this file and the run dumpbin on it.
// (See http://msdn.microsoft.com/en-us/library/5x49w699.aspx for more
// on dumpbin). To do this in MSVC, use the MSVC commandline shell:
// http://msdn.microsoft.com/en-us/library/ms235639(VS.80).aspx)
//
// The run:
// cl /c get_mangled_names.cc
// dumpbin /symbols get_mangled_names.obj
//
// It will print out the mangled (and associated unmangled) names of
// the 8 symbols you need to put at the top of patch_functions.cc
#include <sys/types.h> // for size_t
#include <new> // for nothrow_t
static char m; // some dummy memory so new doesn't return NULL.
void* operator new(size_t size) { return &m; }
void operator delete(void* p) throw() { }
void* operator new[](size_t size) { return &m; }
void operator delete[](void* p) throw() { }
void* operator new(size_t size, const std::nothrow_t&) throw() { return &m; }
void operator delete(void* p, const std::nothrow_t&) throw() { }
void* operator new[](size_t size, const std::nothrow_t&) throw() { return &m; }
void operator delete[](void* p, const std::nothrow_t&) throw() { }
| 973 |
1,191 | <reponame>macCesar/titanium_mobile<gh_stars>1000+
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
package org.appcelerator.kroll;
import android.util.Log;
public class KrollLogging
{
public static final int TRACE = 1;
public static final int DEBUG = 2;
public static final int INFO = 3;
public static final int NOTICE = 4;
public static final int WARN = 5;
public static final int ERROR = 6;
public static final int CRITICAL = 7;
public static final int FATAL = 8;
private static final KrollLogging instance = new KrollLogging("TiAPI");
private String tag;
private LogListener listener;
public static KrollLogging getDefault()
{
return instance;
}
public static void logWithDefaultLogger(int severity, String msg)
{
getDefault().internalLog(severity, msg);
}
public interface LogListener {
void onLog(int severity, String msg);
}
private KrollLogging(String tag)
{
this.tag = tag;
}
public void setLogListener(LogListener listener)
{
this.listener = listener;
}
public void debug(String... args)
{
internalLog(DEBUG, combineLogMessages(args));
}
public void info(String... args)
{
internalLog(INFO, combineLogMessages(args));
}
public void warn(String... args)
{
internalLog(WARN, combineLogMessages(args));
}
public void error(String... args)
{
internalLog(ERROR, combineLogMessages(args));
}
public void trace(String... args)
{
internalLog(TRACE, combineLogMessages(args));
}
public void notice(String... args)
{
internalLog(NOTICE, combineLogMessages(args));
}
public void critical(String... args)
{
internalLog(CRITICAL, combineLogMessages(args));
}
public void fatal(String... args)
{
internalLog(FATAL, combineLogMessages(args));
}
public void log(String level, String... args)
{
String ulevel = level.toUpperCase();
String msg = combineLogMessages(args);
int severity = INFO;
if ("TRACE".equals(ulevel)) {
severity = TRACE;
} else if ("DEBUG".equals(ulevel)) {
severity = DEBUG;
} else if ("INFO".equals(ulevel)) {
severity = INFO;
} else if ("NOTICE".equals(ulevel)) {
severity = NOTICE;
} else if ("WARN".equals(ulevel)) {
severity = WARN;
} else if ("ERROR".equals(ulevel)) {
severity = ERROR;
} else if ("CRITICAL".equals(ulevel)) {
severity = CRITICAL;
} else if ("FATAL".equals(ulevel)) {
severity = FATAL;
} else {
msg = "[" + level + "] " + msg;
}
internalLog(severity, msg);
}
private String combineLogMessages(String... args)
{
// Do not continue if given a null/empty array.
if ((args == null) || (args.length <= 0)) {
return "";
}
// If array only contains 1 element, then we don't need to do below join operation.
if (args.length == 1) {
return (args[0] != null) ? args[0] : "";
}
// Join array of strings, separated by spaces.
StringBuilder stringBuilder = new StringBuilder();
for (String nextArg : args) {
if (stringBuilder.length() > 0) {
stringBuilder.append(' ');
}
stringBuilder.append(nextArg);
}
return stringBuilder.toString();
}
private void internalLog(int severity, String msg)
{
if (severity == TRACE) {
Log.v(tag, msg);
} else if (severity < INFO) {
Log.d(tag, msg);
} else if (severity < WARN) {
Log.i(tag, msg);
} else if (severity == WARN) {
Log.w(tag, msg);
} else {
Log.e(tag, msg);
}
if (listener != null) {
listener.onLog(severity, msg);
}
}
}
| 1,305 |
892 | {
"schema_version": "1.2.0",
"id": "GHSA-rj8x-cp5p-j26r",
"modified": "2022-05-12T00:01:26Z",
"published": "2022-05-12T00:01:26Z",
"aliases": [
"CVE-2021-3611"
],
"details": "A stack overflow vulnerability was found in the Intel HD Audio device (intel-hda) of QEMU. A malicious guest could use this flaw to crash the QEMU process on the host, resulting in a denial of service condition. The highest threat from this vulnerability is to system availability. This flaw affects QEMU versions prior to 7.0.0.",
"severity": [
],
"affected": [
],
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3611"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1973784"
},
{
"type": "WEB",
"url": "https://gitlab.com/qemu-project/qemu/-/issues/542"
}
],
"database_specific": {
"cwe_ids": [
],
"severity": null,
"github_reviewed": false
}
} | 429 |
781 | <gh_stars>100-1000
// file: source/core/memory_virtual.c
////////////////////////////////////////////////////////////////
//
// Virtual Memory
//
//
ZPL_BEGIN_C_DECLS
zpl_virtual_memory zpl_vm(void *data, zpl_isize size) {
zpl_virtual_memory vm;
vm.data = data;
vm.size = size;
return vm;
}
#if defined(ZPL_SYSTEM_WINDOWS)
zpl_virtual_memory zpl_vm_alloc(void *addr, zpl_isize size) {
zpl_virtual_memory vm;
ZPL_ASSERT(size > 0);
vm.data = VirtualAlloc(addr, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
vm.size = size;
return vm;
}
zpl_b32 zpl_vm_free(zpl_virtual_memory vm) {
MEMORY_BASIC_INFORMATION info;
while (vm.size > 0) {
if (VirtualQuery(vm.data, &info, zpl_size_of(info)) == 0) return false;
if (info.BaseAddress != vm.data || info.AllocationBase != vm.data || info.State != MEM_COMMIT ||
info.RegionSize > cast(zpl_usize) vm.size) {
return false;
}
if (VirtualFree(vm.data, 0, MEM_RELEASE) == 0) return false;
vm.data = zpl_pointer_add(vm.data, info.RegionSize);
vm.size -= info.RegionSize;
}
return true;
}
zpl_virtual_memory zpl_vm_trim(zpl_virtual_memory vm, zpl_isize lead_size, zpl_isize size) {
zpl_virtual_memory new_vm = { 0 };
void *ptr;
ZPL_ASSERT(vm.size >= lead_size + size);
ptr = zpl_pointer_add(vm.data, lead_size);
zpl_vm_free(vm);
new_vm = zpl_vm_alloc(ptr, size);
if (new_vm.data == ptr) return new_vm;
if (new_vm.data) zpl_vm_free(new_vm);
return new_vm;
}
zpl_b32 zpl_vm_purge(zpl_virtual_memory vm) {
VirtualAlloc(vm.data, vm.size, MEM_RESET, PAGE_READWRITE);
// NOTE: Can this really fail?
return true;
}
zpl_isize zpl_virtual_memory_page_size(zpl_isize *alignment_out) {
SYSTEM_INFO info;
GetSystemInfo(&info);
if (alignment_out) *alignment_out = info.dwAllocationGranularity;
return info.dwPageSize;
}
#else
# include <sys/mman.h>
# ifndef MAP_ANONYMOUS
# define MAP_ANONYMOUS MAP_ANON
# endif
zpl_virtual_memory zpl_vm_alloc(void *addr, zpl_isize size) {
zpl_virtual_memory vm;
ZPL_ASSERT(size > 0);
vm.data = mmap(addr, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
vm.size = size;
return vm;
}
zpl_b32 zpl_vm_free(zpl_virtual_memory vm) {
munmap(vm.data, vm.size);
return true;
}
zpl_virtual_memory zpl_vm_trim(zpl_virtual_memory vm, zpl_isize lead_size, zpl_isize size) {
void *ptr;
zpl_isize trail_size;
ZPL_ASSERT(vm.size >= lead_size + size);
ptr = zpl_pointer_add(vm.data, lead_size);
trail_size = vm.size - lead_size - size;
if (lead_size != 0) zpl_vm_free(zpl_vm(vm.data, lead_size));
if (trail_size != 0) zpl_vm_free(zpl_vm(ptr, trail_size));
return zpl_vm(ptr, size);
}
zpl_b32 zpl_vm_purge(zpl_virtual_memory vm) {
int err = madvise(vm.data, vm.size, MADV_DONTNEED);
return err != 0;
}
zpl_isize zpl_virtual_memory_page_size(zpl_isize *alignment_out) {
// TODO: Is this always true?
zpl_isize result = cast(zpl_isize) sysconf(_SC_PAGE_SIZE);
if (alignment_out) *alignment_out = result;
return result;
}
#endif
ZPL_END_C_DECLS
| 1,717 |
1,299 | /*
* 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.tika.detect;
import java.util.Collection;
import javax.imageio.spi.ServiceRegistry;
import org.apache.tika.config.ServiceLoader;
/**
* A composite encoding detector based on all the {@link EncodingDetector} implementations
* available through the {@link ServiceRegistry service provider mechanism}. Those
* loaded via the service provider mechanism are ordered by how they appear in the
* file, if there is a single service file. If multiple, there is no guarantee of order.
* <p>
* <p>
* If you need to control the order of the Detectors, you should instead
* construct your own {@link CompositeDetector} and pass in the list
* of Detectors in the required order.
*
* @since Apache Tika 1.15
*/
public class DefaultEncodingDetector extends CompositeEncodingDetector {
public DefaultEncodingDetector() {
this(new ServiceLoader(DefaultEncodingDetector.class.getClassLoader()));
}
public DefaultEncodingDetector(ServiceLoader loader) {
super(loader.loadServiceProviders(EncodingDetector.class));
}
public DefaultEncodingDetector(ServiceLoader loader,
Collection<Class<? extends EncodingDetector>>
excludeEncodingDetectors) {
super(loader.loadServiceProviders(EncodingDetector.class), excludeEncodingDetectors);
}
}
| 643 |
859 | <reponame>Ivoz/cleo<gh_stars>100-1000
from enum import Enum
from typing import TYPE_CHECKING
from typing import Iterable
from typing import Optional
from typing import Union
from cleo._utils import strip_tags
from cleo.formatters.formatter import Formatter
if TYPE_CHECKING:
from .section_output import SectionOutput
class Verbosity(Enum):
QUIET: int = 16
NORMAL: int = 32
VERBOSE: int = 64
VERY_VERBOSE: int = 128
DEBUG: int = 256
class Type(Enum):
NORMAL: int = 1
RAW: int = 2
PLAIN: int = 4
class Output:
def __init__(
self,
verbosity: Verbosity = Verbosity.NORMAL,
decorated: bool = False,
formatter: Optional[Formatter] = None,
) -> None:
self._verbosity: Verbosity = verbosity
if formatter is None:
formatter = Formatter()
self._formatter = formatter
self._formatter.decorated(decorated)
self._section_outputs = []
@property
def formatter(self) -> Formatter:
return self._formatter
@property
def verbosity(self) -> Verbosity:
return self._verbosity
def set_formatter(self, formatter: Formatter) -> None:
self._formatter = formatter
def is_decorated(self) -> bool:
return self._formatter.is_decorated()
def decorated(self, decorated: bool = True) -> None:
self._formatter.decorated(decorated)
def supports_utf8(self) -> bool:
"""
Returns whether the stream supports the UTF-8 encoding.
"""
return True
def set_verbosity(self, verbosity: Verbosity) -> None:
self._verbosity = verbosity
def is_quiet(self) -> bool:
return self._verbosity == Verbosity.QUIET
def is_verbose(self) -> bool:
return self._verbosity.value >= Verbosity.VERBOSE.value
def is_very_verbose(self) -> bool:
return self._verbosity.value >= Verbosity.VERY_VERBOSE.value
def is_debug(self) -> bool:
return self._verbosity == Verbosity.DEBUG
def write_line(
self,
messages: Union[str, Iterable[str]],
verbosity: Verbosity = Verbosity.NORMAL,
type: Type = Type.NORMAL,
) -> None:
self.write(messages, new_line=True, verbosity=verbosity, type=type)
def write(
self,
messages: Union[str, Iterable[str]],
new_line: bool = False,
verbosity: Verbosity = Verbosity.NORMAL,
type: Type = Type.NORMAL,
) -> None:
if isinstance(messages, str):
messages = [messages]
if verbosity.value > self.verbosity.value:
return
for message in messages:
if type == Type.NORMAL:
message = self._formatter.format(message)
elif type == Type.PLAIN:
message = strip_tags(self._formatter.format(message))
self._write(message, new_line=new_line)
def flush(self) -> None:
pass
def remove_format(self, text: str) -> str:
return self.formatter.remove_format(text)
def section(self) -> "SectionOutput":
raise NotImplementedError()
def _write(self, message: str, new_line: bool = False) -> None:
raise NotImplementedError()
| 1,351 |
589 | <filename>inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/ci/sensor/method/impl/ApacheClientExchangeHandlerSensorConfig.java<gh_stars>100-1000
package rocks.inspectit.shared.cs.ci.sensor.method.impl;
import javax.xml.bind.annotation.XmlRootElement;
import rocks.inspectit.shared.all.instrumentation.config.PriorityEnum;
import rocks.inspectit.shared.cs.ci.sensor.method.AbstractMethodSensorConfig;
/**
* The configuration for the
* {@link rocks.inspectit.agent.java.sensor.method.async.http.ApacheClientExchangeHandlerSensor}
* class.
*
* @author <NAME>
* @author <NAME>
*
*/
@XmlRootElement(name = "apache-client-exchange-handler-sensor")
public final class ApacheClientExchangeHandlerSensorConfig extends AbstractMethodSensorConfig {
/**
* Sensor name.
*/
private static final String SENSOR_NAME = "Apache Client Exchange Handler Sensor";
/**
* Implementing class name.
*/
public static final String CLASS_NAME = "rocks.inspectit.agent.java.sensor.method.async.http.ApacheClientExchangeHandlerSensor";
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return SENSOR_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public String getClassName() {
return CLASS_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public PriorityEnum getPriority() {
return PriorityEnum.NORMAL;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isAdvanced() {
return true;
}
}
| 500 |
522 | <filename>src/algs/model/network/OptimizedFlowNetwork.java
package algs.model.network;
import java.util.Iterator;
import algs.model.list.DoubleLinkedList;
/**
* Store information regarding the graph in a two-dimensional matrix.
* <p>
* This optimized implementation computes the Ford-Fulkerson algorithm
* entirely using arrays. The improved efficiency can be benchmarked by
* comparing its performance with the {@link FordFulkerson} implementation.
* @author <NAME>
*/
public class OptimizedFlowNetwork {
/** Number of vertices. */
int n;
/** source & target. */
int source;
int sink;
/** Contains all capacities. */
int[][] capacity;
/** Contain all flows. */
int[][] flow;
/** Upon completion of findAugmentingPath, contains the predecessor information. */
int[] previous;
/** Visited during augmenting path search. */
int[] visited;
final int QUEUE_SIZE = 1000;
int queue[] = new int[QUEUE_SIZE];
/** Declares a path in the augmenting path follows a forward edge. */
public static final boolean FORWARD = true;
/** Declares a path in the augmenting path follows a backward edge. */
public static final boolean BACKWARD = false;
/**
* Construct an instance of the FlowNetwork problem using optimized array
* structure to solve problem.
* <p>
* We use the same input representation so we can properly compare the performance
* of this implementation.
*
* @param numVertices the number of vertices in the Flow Network
* @param srcIndex the index of the source vertex
* @param sinkIndex the index of the sink vertex
* @param edges an iterator of EdgeInfo objects representing edge capacities
*
* @see FlowNetwork#FlowNetwork(int, int, int)
*/
public OptimizedFlowNetwork (int numVertices, int srcIndex, int sinkIndex, Iterator<EdgeInfo> edges) {
n = numVertices;
capacity = new int[n][n];
flow = new int[n][n];
previous = new int[n];
visited = new int [n];
source = srcIndex;
sink = sinkIndex;
// Note that initially, the flow is set to zero. Pull info from input.
while (edges.hasNext()) {
EdgeInfo ei = edges.next();
capacity[ei.start][ei.end] = ei.capacity;
}
}
/**
* Compute the Maximal flow for the given flow network.
* <p>
* The results of the computation are stored within the network object. Specifically,
* the final labeling of vertices computes the set S of nodes which is disjoint from
* the unlabeled vertices which form the set T. Together, S and T represent the disjoint
* split of the graph into two sets whose connecting edges for the min-cut, in other words,
* the forward edges from S to T all have flow values which equal their capacity. Thus no
* additional augmentations are possible.
*
* @param source the index of the source vertex
* @param sink the index of the sink vertex
* @return integer representing the maximal flow
*/
public int compute (int source, int sink) {
int maxFlow = 0;
while (findAugmentingPath(source, sink)) {
maxFlow += processPath(source, sink);
}
return maxFlow;
}
/**
* Augments the flows within the network along the path found from source to sink.
* <p>
* Walking backwards from the sink vertex to the source vertex, this updates the flow
* values for the edges in the augmenting path.
* <p>
* Note that the available units in the sinkIndex are used as the additive value (for
* forward edges) and the subtractive value (for backward edges).
*
* @param source source index of the augmenting path
* @param sink sink index of the augmenting path
*/
protected int processPath(int source, int sink) {
int v = sink;
// Determine the amount by which we can increment the flow. Equal to minimum
// over the computed path from sink to source.
int increment = Integer.MAX_VALUE;
while (previous[v] != -1) {
int unit = capacity[previous[v]][v] - flow[previous[v]][v];
if (unit < increment) {
increment = unit;
}
v = previous[v];
}
// push minimal increment over the path
v = sink;
while (previous[v] != -1) {
flow[previous[v]][v] += increment; // forward edges.
flow[v][previous[v]] -= increment; // don't forget back edges
v = previous[v];
}
return increment;
}
public DoubleLinkedList<EdgeInfo> getMinCut() {
DoubleLinkedList<EdgeInfo> dl = new DoubleLinkedList<EdgeInfo>();
// All edges from a vertex that is labeled to one that is not labeled belong in the min cut.
for (int u = 0; u < n; u++) {
if (visited[u] != 0) {
// labeled u. Find unlabeled 'v'. (FORWARD EDGE)
for (int v = 0; v < n; v++) {
if (u == v) { continue; }
if (visited[v] != 0) { continue; }
// v not visited. See if edge from u to v
if (flow[u][v] > 0) {
dl.insert(new EdgeInfo (u, v, capacity[u][v]));
}
}
}
}
return dl;
}
/**
* Locate an augmenting path in the Flow Network from the source vertex
* to the sink.
* <p>
* Path is stored within the vertices[] array by traversing in reverse order
* from the sinkIndex.
* <p>
* Assume path always fits within queue size of length QUEUE_SIZE
*
* @param source index of source vertex
* @param sink index of sink vertex
* @return true if an augmented path was located; false otherwise.
*/
public boolean findAugmentingPath (int source, int sink) {
// clear visiting status. 0=clear, 1=actively in queue, 2=visited
for (int i = 0 ; i < n; i++) { visited[i] = 0; }
// create circular queue to process search elements
queue[0] = source;
int head = 0, tail = 1;
previous[source] = -1; // make sure we terminate here.
visited[source] = 1; // visited.
while (head != tail) {
int u = queue[head]; head = (head + 1) % QUEUE_SIZE;
visited[u] = 2;
// find all unvisited vertices connected to u by edges.
for (int v = 0; v < n; v++) {
if (v == u) continue; // can't visit self.
if (visited[v] != 0) continue; // has already been visited.
if (capacity[u][v] > flow[u][v]) {
queue[tail] = v; tail = (tail + 1) % QUEUE_SIZE;
visited[v] = 1;
previous[v] = u;
}
}
}
return visited[sink] != 0; // did we make it to the sink?
}
public int getSink() {
return sink;
}
public int getSource() {
return source;
}
/** Useful for debugging. */
public String toString () {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (j == i) continue;
if (capacity[i][j] > 0) {
sb.append (i + " -> " + j + "[" + capacity[i][j] + "]").append('\n');
}
}
}
return sb.toString();
}
}
| 2,378 |
451 | <reponame>Shlpeng/Qualitis<gh_stars>100-1000
/*
* Copyright 2019 WeBank
*
* 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.webank.wedatasphere.qualitis.rule.service.impl;
import com.webank.wedatasphere.qualitis.dao.UserDao;
import com.webank.wedatasphere.qualitis.entity.User;
import com.webank.wedatasphere.qualitis.project.dao.ProjectDao;
import com.webank.wedatasphere.qualitis.project.request.AddProjectRequest;
import com.webank.wedatasphere.qualitis.project.response.ProjectDetailResponse;
import com.webank.wedatasphere.qualitis.rule.adapter.AutoArgumentAdapter;
import com.webank.wedatasphere.qualitis.rule.constant.CheckTemplateEnum;
import com.webank.wedatasphere.qualitis.rule.constant.RuleTypeEnum;
import com.webank.wedatasphere.qualitis.rule.dao.AlarmConfigDao;
import com.webank.wedatasphere.qualitis.rule.dao.RuleDataSourceDao;
import com.webank.wedatasphere.qualitis.rule.dao.RuleDataSourceMappingDao;
import com.webank.wedatasphere.qualitis.rule.dao.RuleGroupDao;
import com.webank.wedatasphere.qualitis.rule.dao.RuleTemplateDao;
import com.webank.wedatasphere.qualitis.rule.dao.RuleVariableDao;
import com.webank.wedatasphere.qualitis.rule.request.*;
import com.webank.wedatasphere.qualitis.rule.response.RuleDetailResponse;
import com.webank.wedatasphere.qualitis.rule.response.RuleNodeResponse;
import com.webank.wedatasphere.qualitis.rule.service.*;
import com.webank.wedatasphere.qualitis.rule.util.TemplateMidTableUtil;
import com.webank.wedatasphere.qualitis.rule.util.TemplateStatisticsUtil;
import com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException;
import com.webank.wedatasphere.qualitis.project.entity.Project;
import com.webank.wedatasphere.qualitis.project.service.ProjectService;
import com.webank.wedatasphere.qualitis.response.GeneralResponse;
import com.webank.wedatasphere.qualitis.rule.constant.InputActionStepEnum;
import com.webank.wedatasphere.qualitis.rule.constant.StatisticsValueTypeEnum;
import com.webank.wedatasphere.qualitis.rule.dao.RuleDao;
import com.webank.wedatasphere.qualitis.rule.entity.*;
import com.webank.wedatasphere.qualitis.rule.response.RuleResponse;
import com.webank.wedatasphere.qualitis.service.UserService;
import java.io.IOException;
import javax.management.relation.RoleNotFoundException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author howeye
*/
@Service
public class RuleServiceImpl implements RuleService {
@Autowired
private RuleDao ruleDao;
@Autowired
private RuleTemplateService ruleTemplateService;
@Autowired
private RuleTemplateDao ruleTemplateDao;
@Autowired
private TemplateStatisticsInputMetaService templateStatisticsInputMetaService;
@Autowired
private TemplateMidTableInputMetaService templateMidTableInputMetaService;
@Autowired
private TemplateOutputMetaService templateOutputMetaService;
@Autowired
private RuleVariableService ruleVariableService;
@Autowired
private RuleVariableDao ruleVariableDao;
@Autowired
private AlarmConfigService alarmConfigService;
@Autowired
private AlarmConfigDao alarmConfigDao;
@Autowired
private RuleDataSourceService ruleDataSourceService;
@Autowired
private RuleDataSourceDao ruleDataSourceDao;
@Autowired
private RuleDataSourceMappingDao ruleDataSourceMappingDao;
@Autowired
private ProjectService projectService;
@Autowired
private AutoArgumentAdapter autoArgumentAdapter;
@Autowired
private RuleGroupDao ruleGroupDao;
@Autowired
private ProjectDao projectDao;
@Autowired
private UserDao userDao;
@Autowired
private UserService userService;
private static final Logger LOGGER = LoggerFactory.getLogger(RuleServiceImpl.class);
private HttpServletRequest httpServletRequest;
public RuleServiceImpl(@Context HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
@Override
@Transactional(rollbackFor = {RuntimeException.class, UnExpectedRequestException.class}, propagation = Propagation.REQUIRED)
public GeneralResponse<RuleResponse> addRule(AddRuleRequest request) throws UnExpectedRequestException {
// Check Arguments
AddRuleRequest.checkRequest(request, false);
// Check existence of rule template
Template templateInDb = ruleTemplateService.checkRuleTemplate(request.getRuleTemplateId());
// Check datasource size
checkDataSourceNumber(templateInDb, request.getDatasource());
// Check if cluster supported
checkDataSourceClusterLimit(request.getDatasource());
// Check Arguments size
checkRuleArgumentSize(request.getTemplateArgumentRequests(), templateInDb);
// Check existence of project
Project projectInDb = projectService.checkProjectExistence(request.getProjectId());
// Check existence of rule name
checkRuleName(request.getRuleName(), projectInDb, null);
RuleGroup ruleGroup;
if (request.getRuleGroupId() != null) {
ruleGroup = ruleGroupDao.findById(request.getRuleGroupId());
if (ruleGroup == null) {
throw new UnExpectedRequestException(String.format("Rule Group: %s {&DOES_NOT_EXIST}", request.getRuleGroupId()));
}
} else {
ruleGroup = ruleGroupDao.saveRuleGroup(
new RuleGroup("Group_" + UUID.randomUUID().toString().replace("-", ""), projectInDb.getId()));
}
// Create and save rule
Rule newRule = new Rule();
newRule.setTemplate(templateInDb);
newRule.setRuleTemplateName(templateInDb.getName());
newRule.setName(request.getRuleName());
newRule.setAlarm(request.getAlarm());
newRule.setProject(projectInDb);
newRule.setRuleType(RuleTypeEnum.SINGLE_TEMPLATE_RULE.getCode());
newRule.setRuleGroup(ruleGroup);
newRule.setAbortOnFailure(request.getAbortOnFailure());
Rule savedRule = ruleDao.saveRule(newRule);
LOGGER.info("Succeed to save rule, rule_id: {}", savedRule.getId());
// Save alarm_config,ruleVariable and ruleDataSource
// Generate rule variable and save
LOGGER.info("Start to generate and save rule_variable.");
List<RuleVariable> ruleVariables = autoAdaptArgumentAndGetRuleVariable(templateInDb, request.getDatasource(),
request.getTemplateArgumentRequests(), savedRule);
List<RuleVariable> savedRuleVariables = ruleVariableService.saveRuleVariable(ruleVariables);
LOGGER.info("Succeed to save rule_variables, rule_variables: {}", savedRuleVariables);
List<AlarmConfig> savedAlarmConfigs = new ArrayList<>();
if (request.getAlarm()) {
savedAlarmConfigs = alarmConfigService.checkAndSaveAlarmVariable(request.getAlarmVariable(), savedRule);
LOGGER.info("Succeed to save alarm_configs, alarm_configs: {}", savedAlarmConfigs);
}
List<RuleDataSource> savedRuleDataSource = ruleDataSourceService.checkAndSaveRuleDataSource(request.getDatasource(), savedRule);
LOGGER.info("Succeed to save rule_dataSources, rule_dataSources: {}", savedRuleDataSource);
savedRule.setRuleVariables(new HashSet<>(savedRuleVariables));
savedRule.setAlarmConfigs(new HashSet<>(savedAlarmConfigs));
savedRule.setRuleDataSources(new HashSet<>(savedRuleDataSource));
RuleResponse response = new RuleResponse(savedRule);
LOGGER.info("Succeed to add rule, rule_id: {}", response.getRuleId());
return new GeneralResponse<>("200", "{&ADD_RULE_SUCCESSFULLY}", response);
}
@Override
@Transactional(rollbackFor = {RuntimeException.class, UnExpectedRequestException.class})
public GeneralResponse<?> deleteRule(DeleteRuleRequest request) throws UnExpectedRequestException {
// Check Arguments
DeleteRuleRequest.checkRequest(request);
// Check existence of rule
Rule ruleInDb = ruleDao.findById(request.getRuleId());
if (ruleInDb == null || !ruleInDb.getRuleType().equals(RuleTypeEnum.SINGLE_TEMPLATE_RULE.getCode())) {
throw new UnExpectedRequestException("Rule id [" + request.getRuleId() + "]) {&IS_NOT_A_RULE_WITH_TEMPLATE}");
}
projectService.checkProjectExistence(ruleInDb.getProject().getId());
return deleteRuleReal(ruleInDb);
}
@Override
public GeneralResponse<?> deleteRuleReal(Rule rule) {
// Delete rule
ruleDao.deleteRule(rule);
LOGGER.info("Succeed to delete rule. rule_id: {}", rule.getId());
return new GeneralResponse<>("200", "{&DELETE_RULE_SUCCESSFULLY}", null);
}
@Override
@Transactional(rollbackFor = {RuntimeException.class, UnExpectedRequestException.class})
public GeneralResponse<RuleResponse> modifyRuleDetail(ModifyRuleRequest request) throws UnExpectedRequestException {
// Check Arguments
ModifyRuleRequest.checkRequest(request);
// Check existence of rule
Rule ruleInDb = ruleDao.findById(request.getRuleId());
if (ruleInDb == null) {
throw new UnExpectedRequestException("rule_id [" + request.getRuleId() + "] {&DOES_NOT_EXIST}");
}
projectService.checkProjectExistence(ruleInDb.getProject().getId());
if (!ruleInDb.getRuleType().equals(RuleTypeEnum.SINGLE_TEMPLATE_RULE.getCode())) {
throw new UnExpectedRequestException("rule(id: [" + request.getRuleId() + "]) {&IS_NOT_A_RULE_WITH_TEMPLATE}");
}
LOGGER.info("Succeed to find rule. rule_id: {}", ruleInDb.getId());
// Set rule arguments and save
// Check existence of rule template
Template templateInDb = ruleTemplateService.checkRuleTemplate(request.getRuleTemplateId());
// Check datasource size
checkDataSourceNumber(templateInDb, request.getDatasource());
// Check cluster name supported
checkDataSourceClusterLimit(request.getDatasource());
// Check arguments size
checkRuleArgumentSize(request.getTemplateArgumentRequests(), templateInDb);
// Check existence of rule
checkRuleName(request.getRuleName(), ruleInDb.getProject(), ruleInDb.getId());
ruleInDb.setTemplate(templateInDb);
ruleInDb.setName(request.getRuleName());
ruleInDb.setAlarm(request.getAlarm());
ruleInDb.setAbortOnFailure(request.getAbortOnFailure());
ruleInDb.setRuleTemplateName(templateInDb.getName());
// Delete all alarm_config,rule_variable,rule_datasource
alarmConfigService.deleteByRule(ruleInDb);
LOGGER.info("Succeed to delete all alarm_config. rule_id: {}", ruleInDb.getId());
ruleVariableService.deleteByRule(ruleInDb);
LOGGER.info("Succeed to delete all rule_variable. rule_id: {}", ruleInDb.getId());
ruleDataSourceService.deleteByRule(ruleInDb);
LOGGER.info("Succeed to delete all rule_dataSources. rule_id: {}", ruleInDb.getId());
Rule savedRule = ruleDao.saveRule(ruleInDb);
LOGGER.info("Succeed to save rule. rule_id: {}", savedRule.getId());
// Save alarm_config,ruleVariable和ruleDataSource
List<RuleVariable> ruleVariables = autoAdaptArgumentAndGetRuleVariable(templateInDb, request.getDatasource(),
request.getTemplateArgumentRequests(), savedRule);
List<RuleVariable> savedRuleVariables = ruleVariableService.saveRuleVariable(ruleVariables);
LOGGER.info("Succeed to save rule_variable, rule_variable: {}", savedRuleVariables);
List<AlarmConfig> savedAlarmConfigs = new ArrayList<>();
if (request.getAlarm()) {
savedAlarmConfigs = alarmConfigService.checkAndSaveAlarmVariable(request.getAlarmVariable(), savedRule);
LOGGER.info("Succeed to save alarm_configs, alarm_configs: {}", savedAlarmConfigs);
}
List<RuleDataSource> savedRuleDataSource = ruleDataSourceService.checkAndSaveRuleDataSource(request.getDatasource(), savedRule);
LOGGER.info("Succeed to save rule_dataSources, rule_dataSources: {}", savedRuleDataSource);
savedRule.setRuleVariables(new HashSet<>(savedRuleVariables));
savedRule.setAlarmConfigs(new HashSet<>(savedAlarmConfigs));
savedRule.setRuleDataSources(new HashSet<>(savedRuleDataSource));
RuleResponse response = new RuleResponse(savedRule);
LOGGER.info("Succeed to modify rule. response: {}", response);
return new GeneralResponse<>("200", "{&MODIFY_RULE_SUCCESSFULLY}", response);
}
@Override
public GeneralResponse<RuleDetailResponse> getRuleDetail(Long ruleId) throws UnExpectedRequestException {
// Check existence of rule
Rule ruleInDb = ruleDao.findById(ruleId);
if (ruleInDb == null) {
throw new UnExpectedRequestException("rule_id [" + ruleId + "] {&DOES_NOT_EXIST}");
}
if (!ruleInDb.getRuleType().equals(RuleTypeEnum.SINGLE_TEMPLATE_RULE.getCode())) {
throw new UnExpectedRequestException("rule(id: [" + ruleId + "]) {&IS_NOT_A_RULE_WITH_TEMPLATE}");
}
LOGGER.info("Succeed to find rule. rule_id: {}", ruleInDb.getId());
RuleDetailResponse response = new RuleDetailResponse(ruleInDb);
LOGGER.info("Succeed to get rule detail. rule_id: {}", ruleId);
return new GeneralResponse<>("200", "{&GET_RULE_DETAIL_SUCCESSFULLY}", response);
}
@Override
public GeneralResponse<RuleNodeResponse> exportRuleByGroupId(Long ruleGroupId) throws UnExpectedRequestException {
// Check existence of ruleGroup
RuleGroup ruleGroup = ruleGroupDao.findById(ruleGroupId);
if (ruleGroup == null) {
throw new UnExpectedRequestException("ruleGroupId [" + ruleGroupId + "] {&DOES_NOT_EXIST}");
}
LOGGER.info("Succeed to find rule. ruleGroupId: {}", ruleGroup.getId());
RuleNodeResponse response = new RuleNodeResponse();
try {
List<Rule> rulesInDb = ruleDao.findByRuleGroup(ruleGroup);
ruleToNodeResponse(rulesInDb.get(0), response);
} catch (IOException e) {
LOGGER.error("Failed to export rule because of JSON opeartions. Exception is {}", e);
return new GeneralResponse<>("500", "{&FAILED_TO_EXPORT_RULE}", response);
}
LOGGER.info("Succeed to export rule detail. Rule info: {}", response.toString());
return new GeneralResponse<>("200", "{&EXPORT_RULE_SUCCESSFULLY}", response);
}
@Override
@Transactional(rollbackFor = {RuntimeException.class, UnExpectedRequestException.class}, propagation = Propagation.REQUIRED)
public GeneralResponse<RuleResponse> importRule(RuleNodeRequest ruleNodeRequest) throws UnExpectedRequestException {
ObjectMapper objectMapper = new ObjectMapper();
try {
Rule rule = objectMapper.readValue(ruleNodeRequest.getRuleObject(), Rule.class);
Template template = objectMapper.readValue(ruleNodeRequest.getTemplateObject(), Template.class);
RuleGroup ruleGroup = objectMapper.readValue(ruleNodeRequest.getRuleGroupObject(), RuleGroup.class);
Set<RuleDataSource> ruleDataSources = objectMapper.readValue(ruleNodeRequest.getRuleDataSourcesObject(),
new TypeReference<Set<RuleDataSource>>() {});
Set<RuleDataSourceMapping> ruleDataSourceMappings = objectMapper.readValue(ruleNodeRequest.getRuleDataSourceMappingsObject(),
new TypeReference<Set<RuleDataSourceMapping>>() {});
Set<AlarmConfig> alarmConfigs = objectMapper.readValue(ruleNodeRequest.getAlarmConfigsObject(), new TypeReference<Set<AlarmConfig>>() {});
Set<RuleVariable> ruleVariables = objectMapper.readValue(ruleNodeRequest.getRuleVariablesObject(), new TypeReference<Set<RuleVariable>>() {});
RuleResponse ruleResponse = new RuleResponse();
// Find project in produce center.
Project projectInDb = projectDao.findById(Long.parseLong(ruleNodeRequest.getNewProjectId()));
if (projectInDb == null) {
AddProjectRequest addProjectRequest = new AddProjectRequest();
addProjectRequest.setProjectName(ruleNodeRequest.getProjectName());
addProjectRequest.setDescription("This is a auto created project for new qualitis node.");
String userName = ruleNodeRequest.getUserName();
addProjectRequest.setUsername(userName);
User currentUser = userDao.findByUsername(userName);
if (currentUser == null) {
userService.autoAddUser(userName);
}
GeneralResponse<ProjectDetailResponse> response = projectService.addProject(addProjectRequest, userDao.findByUsername(userName).getId());
if ("200".equals(response.getCode())) {
ruleResponse.setNewProjectId(response.getData().getProjectDetail().getProjectId().toString());
projectInDb = projectDao.findById(response.getData().getProjectDetail().getProjectId());
} else {
throw new UnExpectedRequestException("Project id :["+ ruleNodeRequest.getNewProjectId() + "] {&DOES_NOT_EXIST}");
}
}
Rule ruleInDb = ruleDao.findByProjectAndRuleName(projectInDb, rule.getName());
if (ruleInDb != null) {
// Update basic rule info.
ruleInDb.setAlarm(rule.getAlarm());
ruleInDb.setAbortOnFailure(rule.getAbortOnFailure());
ruleInDb.setFromContent(rule.getFromContent());
ruleInDb.setWhereContent(rule.getWhereContent());
ruleInDb.setRuleType(rule.getRuleType());
ruleInDb.setRuleTemplateName(template.getName());
ruleInDb.setOutputName(rule.getOutputName());
ruleInDb.setFunctionType(rule.getFunctionType());
ruleInDb.setFunctionContent(rule.getFunctionContent());
Template templateInDb = ruleTemplateService.checkRuleTemplate(ruleInDb.getTemplate().getId());
if (RuleTypeEnum.CUSTOM_RULE.getCode().equals(rule.getRuleType())) {
ruleTemplateService.deleteCustomTemplate(ruleInDb.getTemplate());
Template savedTemplate = ruleTemplateDao.saveTemplate(template);
Set<TemplateStatisticsInputMeta> templateStatisticsInputMetas = templateStatisticsInputMetaService.getAndSaveTemplateStatisticsInputMeta(
rule.getOutputName(), rule.getFunctionType(), rule.getFunctionContent(), savedTemplate.getSaveMidTable(), savedTemplate);
savedTemplate.setStatisticAction(templateStatisticsInputMetas);
Set<TemplateOutputMeta> templateOutputMetaSet = templateOutputMetaService.getAndSaveTemplateOutputMeta(rule.getOutputName(),
rule.getFunctionType(), savedTemplate.getSaveMidTable(), savedTemplate);
savedTemplate.setTemplateOutputMetas(templateOutputMetaSet);
ruleInDb.setTemplate(savedTemplate);
} else {
ruleInDb.setTemplate(templateInDb);
}
alarmConfigService.deleteByRule(ruleInDb);
LOGGER.info("Succeed to delete all alarm_config. rule_id: {}", ruleInDb.getId());
if (! RuleTypeEnum.CUSTOM_RULE.getCode().equals(ruleInDb.getRuleType())) {
ruleVariableService.deleteByRule(ruleInDb);
}
LOGGER.info("Succeed to delete all rule_variable. rule_id: {}", ruleInDb.getId());
ruleDataSourceService.deleteByRule(ruleInDb);
LOGGER.info("Succeed to delete all rule_dataSources. rule_id: {}", ruleInDb.getId());
Rule updateRule = ruleDao.saveRule(ruleInDb);
ruleResponse.setRuleGroupId(updateRule.getRuleGroup().getId());
List<RuleDataSource> ruleDataSourceList = new ArrayList<>();
for (RuleDataSource ruleDataSource : ruleDataSources) {
ruleDataSource.setProjectId(Long.parseLong(ruleNodeRequest.getNewProjectId()));
ruleDataSource.setRule(updateRule);
ruleDataSourceList.add(ruleDataSource);
}
List<AlarmConfig> alarmConfigList = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigs) {
alarmConfig.setRule(updateRule);
alarmConfigList.add(alarmConfig);
}
List<RuleVariable> ruleVariablesList = new ArrayList<>();
for (RuleVariable ruleVariable : ruleVariables) {
ruleVariable.setRule(updateRule);
ruleVariablesList.add(ruleVariable);
}
if (RuleTypeEnum.CUSTOM_RULE.getCode().equals(updateRule.getRuleType())) {
List<AlarmConfig> newAlarmConfigs = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigList) {
// Check existence of templateOutputMeta
TemplateOutputMeta templateOutputMetaInDb = updateRule.getTemplate().getTemplateOutputMetas().iterator().next();
// Generate alarmConfig and save
AlarmConfig newAlarmConfig = new AlarmConfig();
newAlarmConfig.setRule(updateRule);
newAlarmConfig.setTemplateOutputMeta(templateOutputMetaInDb);
newAlarmConfig.setCheckTemplate(alarmConfig.getCheckTemplate());
newAlarmConfig.setThreshold(alarmConfig.getThreshold());
if (alarmConfig.getCheckTemplate().equals(CheckTemplateEnum.FIXED_VALUE.getCode())) {
newAlarmConfig.setCompareType(alarmConfig.getCompareType());
}
newAlarmConfigs.add(newAlarmConfig);
}
updateRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(newAlarmConfigs)));
updateRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
} else {
updateRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(alarmConfigList)));
updateRule.setRuleVariables(new HashSet<>(ruleVariableDao.saveAllRuleVariable(ruleVariablesList)));
updateRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
for (RuleDataSourceMapping ruleDataSourceMapping : ruleDataSourceMappings) {
ruleDataSourceMapping.setRule(updateRule);
ruleDataSourceMappingDao.saveRuleDataSourceMapping(ruleDataSourceMapping);
}
Rule childRule = updateRule.getChildRule();
if (childRule != null) {
LOGGER.info("Start to import updated child rule.");
Rule childRuleObject = objectMapper.readValue(ruleNodeRequest.getChildRuleObject(), Rule.class);
Template childTemplateObject = objectMapper.readValue(ruleNodeRequest.getChildTemplateObject(), Template.class);
childRule.setAlarm(childRuleObject.getAlarm());
childRule.setAbortOnFailure(childRuleObject.getAbortOnFailure());
childRule.setFromContent(childRuleObject.getFromContent());
childRule.setWhereContent(childRuleObject.getWhereContent());
childRule.setRuleType(childRuleObject.getRuleType());
childRule.setRuleTemplateName(childTemplateObject.getName());
childRule.setOutputName(childRuleObject.getOutputName());
childRule.setFunctionType(childRuleObject.getFunctionType());
childRule.setFunctionContent(childRuleObject.getFunctionContent());
Set<RuleDataSource> childRuleDataSources = objectMapper.readValue(ruleNodeRequest.getChildRuleDataSourcesObject(),
new TypeReference<Set<RuleDataSource>>() {});
Set<RuleDataSourceMapping> childRuleDataSourceMappings = objectMapper.readValue(ruleNodeRequest.getChildRuleDataSourceMappingsObject(),
new TypeReference<Set<RuleDataSourceMapping>>() {});
Set<AlarmConfig> childAlarmConfigs = objectMapper.readValue(ruleNodeRequest.getChildAlarmConfigsObject(), new TypeReference<Set<AlarmConfig>>() {});
Set<RuleVariable> childRuleVariables = objectMapper.readValue(ruleNodeRequest.getChildRuleVariablesObject(), new TypeReference<Set<RuleVariable>>() {});
Template childTemplateInDb = ruleTemplateService.checkRuleTemplate(childTemplateObject.getId());
if (childTemplateInDb == null) {
throw new UnExpectedRequestException("Child template id :[" + childTemplateObject.getId() + "] {&DOES_NOT_EXIST}");
}
importChildRule(updateRule, childRule, ruleNodeRequest.getNewProjectId(), childTemplateInDb, projectInDb, childRuleDataSources, childRuleDataSourceMappings,
childAlarmConfigs, childRuleVariables, true);
LOGGER.info("Success to import updated child rule.");
}
}
} else {
rule.setProject(projectInDb);
ruleGroup.setProjectId(projectInDb.getId());
// For rule group persistence.
List<Rule> rules = new ArrayList<>(1);
if (RuleTypeEnum.CUSTOM_RULE.getCode().equals(rule.getRuleType())) {
Template saveTemplate = ruleTemplateDao.saveTemplate(template);
Set<TemplateStatisticsInputMeta> templateStatisticsInputMetas = templateStatisticsInputMetaService.getAndSaveTemplateStatisticsInputMeta(
rule.getOutputName(), rule.getFunctionType(), rule.getFunctionContent(), saveTemplate.getSaveMidTable(), saveTemplate);
saveTemplate.setStatisticAction(templateStatisticsInputMetas);
Set<TemplateOutputMeta> templateOutputMetaSet = templateOutputMetaService.getAndSaveTemplateOutputMeta(rule.getOutputName(),
rule.getFunctionType(), saveTemplate.getSaveMidTable(), saveTemplate);
saveTemplate.setTemplateOutputMetas(templateOutputMetaSet);
rule.setTemplate(saveTemplate);
} else {
rule.setTemplate(template);
}
Rule savedRule = ruleDao.saveRule(rule);
rules.add(savedRule);
ruleGroup.setRules(rules);
RuleGroup ruleGroupInDb = ruleGroupDao.saveRuleGroup(ruleGroup);
savedRule.setRuleGroup(ruleGroupInDb);
ruleResponse.setRuleGroupId(savedRule.getRuleGroup().getId());
List<AlarmConfig> alarmConfigList = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigs) {
alarmConfig.setRule(savedRule);
alarmConfigList.add(alarmConfig);
}
List<RuleVariable> ruleVariablesList = new ArrayList<>();
for (RuleVariable ruleVariable : ruleVariables) {
ruleVariable.setRule(savedRule);
ruleVariablesList.add(ruleVariable);
}
List<RuleDataSource> ruleDataSourceList = new ArrayList<>();
for (RuleDataSource ruleDataSource : ruleDataSources) {
ruleDataSource.setProjectId(Long.parseLong(ruleNodeRequest.getNewProjectId()));
ruleDataSource.setRule(savedRule);
ruleDataSourceList.add(ruleDataSource);
}
if (RuleTypeEnum.CUSTOM_RULE.getCode().equals(savedRule.getRuleType())) {
List<AlarmConfig> newAlarmConfigs = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigList) {
// Check existence of templateOutputMeta
TemplateOutputMeta templateOutputMetaInDb = savedRule.getTemplate().getTemplateOutputMetas().iterator().next();
// Generate alarmConfig and save
AlarmConfig newAlarmConfig = new AlarmConfig();
newAlarmConfig.setRule(savedRule);
newAlarmConfig.setTemplateOutputMeta(templateOutputMetaInDb);
newAlarmConfig.setCheckTemplate(alarmConfig.getCheckTemplate());
newAlarmConfig.setThreshold(alarmConfig.getThreshold());
if (alarmConfig.getCheckTemplate().equals(CheckTemplateEnum.FIXED_VALUE.getCode())) {
newAlarmConfig.setCompareType(alarmConfig.getCompareType());
}
newAlarmConfigs.add(newAlarmConfig);
}
savedRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(newAlarmConfigs)));
savedRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
} else {
savedRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(alarmConfigList)));
savedRule.setRuleVariables(new HashSet<>(ruleVariableDao.saveAllRuleVariable(ruleVariablesList)));
savedRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
for (RuleDataSourceMapping ruleDataSourceMapping : ruleDataSourceMappings) {
ruleDataSourceMapping.setRule(savedRule);
ruleDataSourceMappingDao.saveRuleDataSourceMapping(ruleDataSourceMapping);
}
if (ruleNodeRequest.getChildRuleObject() != null) {
Rule childRule = objectMapper.readValue(ruleNodeRequest.getChildRuleObject(), Rule.class);
if (childRule != null) {
LOGGER.info("Start to import child rule.");
Template childTemplate = objectMapper.readValue(ruleNodeRequest.getChildTemplateObject(), Template.class);
Set<RuleDataSource> childRuleDataSources = objectMapper.readValue(ruleNodeRequest.getChildRuleDataSourcesObject(),
new TypeReference<Set<RuleDataSource>>() {});
Set<RuleDataSourceMapping> childRuleDataSourceMappings = objectMapper.readValue(ruleNodeRequest.getChildRuleDataSourceMappingsObject(),
new TypeReference<Set<RuleDataSourceMapping>>() {});
Set<AlarmConfig> childAlarmConfigs = objectMapper.readValue(ruleNodeRequest.getChildAlarmConfigsObject(), new TypeReference<Set<AlarmConfig>>() {});
Set<RuleVariable> childRuleVariables = objectMapper.readValue(ruleNodeRequest.getChildRuleVariablesObject(), new TypeReference<Set<RuleVariable>>() {});
importChildRule(savedRule, childRule, ruleNodeRequest.getNewProjectId(), childTemplate, projectInDb, childRuleDataSources, childRuleDataSourceMappings,
childAlarmConfigs, childRuleVariables, false);
LOGGER.info("Success to import child rule.");
}
}
}
}
return new GeneralResponse<>("200", "{&IMPORT_RULE_SUCCESSFULLY}", ruleResponse);
} catch (IOException | RoleNotFoundException e) {
LOGGER.error("Fail to set rule because of json opeartions. Exception is {}", e);
}
return new GeneralResponse<>("500", "{&FAILED_TO_IMPORT_RULE}", null);
}
private void importChildRule(Rule parentRule, Rule rule, String newProjectId, Template template, Project projectInDb, Set<RuleDataSource> ruleDataSources,
Set<RuleDataSourceMapping> ruleDataSourceMappings, Set<AlarmConfig> alarmConfigs, Set<RuleVariable> ruleVariables, boolean modify) throws UnExpectedRequestException {
if (modify) {
alarmConfigService.deleteByRule(rule);
LOGGER.info("Succeed to delete all alarm_config of child rule. rule_id: {}", rule.getId());
ruleVariableService.deleteByRule(rule);
LOGGER.info("Succeed to delete all rule_variable of child rule. rule_id: {}", rule.getId());
ruleDataSourceService.deleteByRule(rule);
LOGGER.info("Succeed to delete all rule_dataSources of child rule. rule_id: {}", rule.getId());
Rule updateRule = ruleDao.saveRule(rule);
List<RuleDataSource> ruleDataSourceList = new ArrayList<>();
for (RuleDataSource ruleDataSource : ruleDataSources) {
ruleDataSource.setProjectId(Long.parseLong(newProjectId));
ruleDataSource.setRule(updateRule);
ruleDataSourceList.add(ruleDataSource);
}
List<AlarmConfig> alarmConfigList = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigs) {
alarmConfig.setRule(updateRule);
alarmConfigList.add(alarmConfig);
}
List<RuleVariable> ruleVariablesList = new ArrayList<>();
for (RuleVariable ruleVariable : ruleVariables) {
ruleVariable.setRule(updateRule);
ruleVariablesList.add(ruleVariable);
}
updateRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(alarmConfigList)));
updateRule.setRuleVariables(new HashSet<>(ruleVariableDao.saveAllRuleVariable(ruleVariablesList)));
updateRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
for (RuleDataSourceMapping ruleDataSourceMapping : ruleDataSourceMappings) {
ruleDataSourceMapping.setRule(updateRule);
ruleDataSourceMappingDao.saveRuleDataSourceMapping(ruleDataSourceMapping);
}
updateRule.setParentRule(parentRule);
parentRule.setChildRule(updateRule);
} else {
rule.setProject(projectInDb);
rule.setTemplate(template);
Rule savedRule = ruleDao.saveRule(rule);
List<AlarmConfig> alarmConfigList = new ArrayList<>();
for (AlarmConfig alarmConfig : alarmConfigs) {
alarmConfig.setRule(savedRule);
alarmConfigList.add(alarmConfig);
}
List<RuleVariable> ruleVariablesList = new ArrayList<>();
for (RuleVariable ruleVariable : ruleVariables) {
ruleVariable.setRule(savedRule);
ruleVariablesList.add(ruleVariable);
}
List<RuleDataSource> ruleDataSourceList = new ArrayList<>();
for (RuleDataSource ruleDataSource : ruleDataSources) {
ruleDataSource.setProjectId(Long.parseLong(newProjectId));
ruleDataSource.setRule(savedRule);
ruleDataSourceList.add(ruleDataSource);
}
savedRule.setAlarmConfigs(new HashSet<>(alarmConfigDao.saveAllAlarmConfig(alarmConfigList)));
savedRule.setRuleVariables(new HashSet<>(ruleVariableDao.saveAllRuleVariable(ruleVariablesList)));
savedRule.setRuleDataSources(new HashSet<>(ruleDataSourceDao.saveAllRuleDataSource(ruleDataSourceList)));
for (RuleDataSourceMapping ruleDataSourceMapping : ruleDataSourceMappings) {
ruleDataSourceMapping.setRule(savedRule);
ruleDataSourceMappingDao.saveRuleDataSourceMapping(ruleDataSourceMapping);
}
savedRule.setParentRule(parentRule);
parentRule.setChildRule(savedRule);
}
}
@Override
public void checkRuleName(String ruleName, Project project, Long ruleId) throws UnExpectedRequestException {
List<Rule> rules = ruleDao.findByProject(project);
for (Rule rule : rules) {
if (rule.getName().equals(ruleName)) {
if (ruleId != null && !rule.getId().equals(ruleId)) {
throw new UnExpectedRequestException("rule_name {&ALREADY_EXIST}");
}
if (ruleId == null) {
throw new UnExpectedRequestException("rule_name {&ALREADY_EXIST}");
}
}
}
}
@Override
public void checkRuleOfTemplate(Template templateInDb) throws UnExpectedRequestException {
List<Rule> rules = ruleDao.findByTemplate(templateInDb);
if (rules != null && !rules.isEmpty()) {
throw new UnExpectedRequestException("{&CANNOT_DELETE_TEMPLATE}");
}
}
/**
* Check argument size and if arguments left
* @param requests
* @param template
*/
private void checkRuleArgumentSize(List<TemplateArgumentRequest> requests, Template template) throws UnExpectedRequestException {
List<Long> midTableArgumentId = template.getTemplateMidTableInputMetas().stream().filter(t -> TemplateMidTableUtil.shouldResponse(t))
.map(TemplateMidTableInputMeta::getId).collect(Collectors.toList());
List<Long> statisticsArgumentId = template.getStatisticAction().stream().filter(t -> TemplateStatisticsUtil.shouldResponse(t))
.map(TemplateStatisticsInputMeta::getId).collect(Collectors.toList());
if (requests.size() != midTableArgumentId.size() + statisticsArgumentId.size()) {
throw new UnExpectedRequestException("{&THE_SIZE_OF_TEMPLATE_ARGUMENT_REQUEST_IS_NOT_CORRECT}");
}
List<Long> requestId = requests.stream().map(TemplateArgumentRequest::getArgumentId).collect(Collectors.toList());
for (Long id : midTableArgumentId) {
if (!requestId.contains(id)) {
throw new UnExpectedRequestException("{&MISSING_ARGUMENT_ID_OF_MID_TABLE_ACTION}: [" + id + "]");
}
}
for (Long id : statisticsArgumentId) {
if (!requestId.contains(id)) {
throw new UnExpectedRequestException("{&MISSING_ARGUMENT_ID_OF_STATISTICS_ACTION}: [" + id + "]");
}
}
}
/**
* Auto adapt arguments and generate rule variables
* @param template
* @param dataSourceRequests
* @param templateArgumentRequests
* @param rule
* @return
*/
private List<RuleVariable> autoAdaptArgumentAndGetRuleVariable(Template template, List<DataSourceRequest> dataSourceRequests,
List<TemplateArgumentRequest> templateArgumentRequests, Rule rule) throws UnExpectedRequestException {
List<RuleVariable> ruleVariables = new ArrayList<>();
// Find related value by template type
for (TemplateMidTableInputMeta templateMidTableInputMeta : template.getTemplateMidTableInputMetas()){
if (dataSourceRequests.size() != 1) {
throw new UnExpectedRequestException("{&ONLY_SINGLE_DATASOURCE_CAN_BE_AUTO_ADAPTED}");
}
DataSourceRequest dataSourceRequest = dataSourceRequests.get(0);
Map<String, String> autoAdaptValue = autoArgumentAdapter.getAdaptValue(templateMidTableInputMeta, dataSourceRequest, templateArgumentRequests);
ruleVariables.add(new RuleVariable(rule, InputActionStepEnum.TEMPLATE_INPUT_META.getCode(), templateMidTableInputMeta,
null, autoAdaptValue));
}
for (TemplateStatisticsInputMeta templateStatisticsInputMeta : template.getStatisticAction()) {
// FIELD
if (templateStatisticsInputMeta.getValueType().equals(StatisticsValueTypeEnum.FIELD.getCode())) {
TemplateArgumentRequest request = findRequest(templateArgumentRequests, templateStatisticsInputMeta);
// Check Arguments
TemplateArgumentRequest.checkRequest(request);
ruleVariables.add(new RuleVariable(rule, InputActionStepEnum.STATISTICS_ARG.getCode(), null,
templateStatisticsInputMeta, request.getArgumentValue(), null, null, null));
}
}
return ruleVariables;
}
private void checkDataSourceNumber(Template template, List<DataSourceRequest> requests) throws UnExpectedRequestException {
// Check cluster, database, table, field num of template
Integer clusterNum = template.getClusterNum();
Integer dbNum = template.getDbNum();
Integer tableNum = template.getTableNum();
Integer fieldNum = template.getFieldNum();
Integer requestClusterNum = 0;
Integer requestDbNum = 0;
Integer requestTableNum = 0;
Integer requestFieldNum = 0;
for (DataSourceRequest request : requests) {
requestClusterNum++;
requestDbNum++;
requestTableNum++;
requestFieldNum += request.getColNames().size();
}
if (clusterNum != -1 && !clusterNum.equals(requestClusterNum)) {
throw new UnExpectedRequestException(String.format("{&TEMPLATE_NAME}:%s,{&ONLY_CONFIG}%d {&CLUSTER_NUMS_BUT_NOW_HAS_CONFIG_NUM_IS}:%d", template.getName(), clusterNum, requestClusterNum));
}
if (dbNum != -1 && !dbNum.equals(requestDbNum)) {
throw new UnExpectedRequestException(String.format("{&TEMPLATE_NAME}:%s,{&ONLY_CONFIG}%d {&DATABASE_NUMS_BUT_NOW_HAS_CONFIG_NUM_IS}:%d", template.getName(), dbNum, requestDbNum));
}
if (tableNum != -1 && !tableNum.equals(requestTableNum)) {
throw new UnExpectedRequestException(String.format("{&TEMPLATE_NAME}:%s,{&ONLY_CONFIG}%d {&TABLE_NUMS_BUT_NOW_HAS_CONFIG_NUM_IS}:%d", template.getName(), tableNum, requestTableNum));
}
if (fieldNum != -1 && !fieldNum.equals(requestFieldNum)) {
throw new UnExpectedRequestException(String.format("{&TEMPLATE_NAME}:%s,{&ONLY_CONFIG}%d {&COLUMN_NUMS_BUT_NOW_HAS_CONFIG_NUM_IS}:%d", template.getName(), fieldNum, requestFieldNum));
}
}
/**
* Check cluster name supported
* @param datasource
* @throws UnExpectedRequestException
*/
private void checkDataSourceClusterLimit(List<DataSourceRequest> datasource) throws UnExpectedRequestException {
if (datasource == null || datasource.isEmpty()) {
return;
}
Set<String> submittedClusterNames = new HashSet<>();
for (DataSourceRequest request : datasource) {
submittedClusterNames.add(request.getClusterName());
}
ruleDataSourceService.checkDataSourceClusterSupport(submittedClusterNames);
}
private TemplateArgumentRequest findRequest(List<TemplateArgumentRequest> requests, TemplateMidTableInputMeta templateMidTableInputMeta) throws UnExpectedRequestException {
Long id = templateMidTableInputMeta.getId();
Integer actionStep = InputActionStepEnum.TEMPLATE_INPUT_META.getCode();
return findRequest(requests, id, actionStep);
}
private TemplateArgumentRequest findRequest(List<TemplateArgumentRequest> requests, TemplateStatisticsInputMeta templateStatisticsInputMeta) throws UnExpectedRequestException {
Long id = templateStatisticsInputMeta.getId();
Integer actionStep = InputActionStepEnum.STATISTICS_ARG.getCode();
return findRequest(requests, id, actionStep);
}
private TemplateArgumentRequest findRequest(List<TemplateArgumentRequest> requests, Long id, Integer actionStep) throws UnExpectedRequestException {
List<TemplateArgumentRequest> request = requests.stream().filter(r -> r.getArgumentStep().equals(actionStep) && r.getArgumentId().equals(id)).collect(Collectors.toList());
if (request.size() != 1) {
throw new UnExpectedRequestException("{&CAN_NOT_FIND_SUITABLE_REQUEST}");
}
TemplateArgumentRequest.checkRequest(request.get(0));
return request.get(0);
}
private void ruleToNodeResponse(Rule rule, RuleNodeResponse response) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
// Project info.
response.setProjectId(objectMapper.writeValueAsString(rule.getProject().getId()));
response.setProjectName(objectMapper.writeValueAsString(rule.getProject().getName()));
// Rule, template, rule group.
response.setRuleObject(objectMapper.writeValueAsString(rule));
response.setTemplateObject(objectMapper.writeValueAsString(rule.getTemplate()));
response.setRuleGroupObject(objectMapper.writeValueAsString(rule.getRuleGroup()));
// Rule data source.
response.setRuleDataSourcesObject(objectMapper.writerWithType(new TypeReference<Set<RuleDataSource>>() {})
.writeValueAsString(rule.getRuleDataSources()));
response.setRuleDataSourceMappingsObject(objectMapper.writerWithType(new TypeReference<Set<RuleDataSourceMapping>>() {})
.writeValueAsString(rule.getRuleDataSourceMappings()));
// Rule check meta info.
response.setAlarmConfigsObject(objectMapper.writerWithType(new TypeReference<Set<AlarmConfig>>() {}).writeValueAsString(rule.getAlarmConfigs()));
response.setRuleVariablesObject(objectMapper.writerWithType(new TypeReference<Set<RuleVariable>>() {}).writeValueAsString(rule.getRuleVariables()));
// Template check meta info.
response.setTemplateTemplateMidTableInputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateMidTableInputMeta>>() {})
.writeValueAsString(rule.getTemplate().getTemplateMidTableInputMetas()));
response.setTemplateTemplateStatisticsInputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateStatisticsInputMeta>>() { })
.writeValueAsString(rule.getTemplate().getStatisticAction()));
response.setTemplateTemplateOutputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateOutputMeta>>() {})
.writeValueAsString(rule.getTemplate().getTemplateOutputMetas()));
// Child rule
if (rule.getChildRule() != null) {
response.setChildRuleObject(objectMapper.writeValueAsString(rule.getChildRule()));
response.setChildTemplateObject(objectMapper.writeValueAsString(rule.getChildRule().getTemplate()));
// Rule data source.
response.setChildRuleDataSourcesObject(objectMapper.writerWithType(new TypeReference<Set<RuleDataSource>>() {})
.writeValueAsString(rule.getChildRule().getRuleDataSources()));
response.setChildRuleDataSourceMappingsObject(objectMapper.writerWithType(new TypeReference<Set<RuleDataSourceMapping>>() {})
.writeValueAsString(rule.getChildRule().getRuleDataSourceMappings()));
// Rule check meta info.
response.setChildAlarmConfigsObject(objectMapper.writerWithType(new TypeReference<Set<AlarmConfig>>() {}).writeValueAsString(rule.getChildRule().getAlarmConfigs()));
response.setChildRuleVariablesObject(objectMapper.writerWithType(new TypeReference<Set<RuleVariable>>() {}).writeValueAsString(rule.getChildRule().getRuleVariables()));
// Template check meta info.
response.setChildTemplateTemplateMidTableInputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateMidTableInputMeta>>() {})
.writeValueAsString(rule.getChildRule().getTemplate().getTemplateMidTableInputMetas()));
response.setChildTemplateTemplateStatisticsInputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateStatisticsInputMeta>>() { })
.writeValueAsString(rule.getChildRule().getTemplate().getStatisticAction()));
response.setChildTemplateTemplateOutputMetaObject(objectMapper.writerWithType(new TypeReference<Set<TemplateOutputMeta>>() {})
.writeValueAsString(rule.getChildRule().getTemplate().getTemplateOutputMetas()));
}
}
}
| 20,342 |
376 | #pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//Event System Interface
namespace EvsysChannel{ ///<Channel
using Addr = Register::Address<0x42000404,0xf080fef0,0x00000000,unsigned>;
///Channel Selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> channel{};
///Software Event
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> swevt{};
///Event Generator Selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> evgen{};
///Path Selection
enum class PathVal {
synchronous=0x00000000, ///<Synchronous path
resynchronized=0x00000001, ///<Resynchronized path
asynchronous=0x00000002, ///<Asynchronous path
};
constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,24),Register::ReadWriteAccess,PathVal> path{};
namespace PathValC{
constexpr Register::FieldValue<decltype(path)::Type,PathVal::synchronous> synchronous{};
constexpr Register::FieldValue<decltype(path)::Type,PathVal::resynchronized> resynchronized{};
constexpr Register::FieldValue<decltype(path)::Type,PathVal::asynchronous> asynchronous{};
}
///Edge Detection Selection
enum class EdgselVal {
noEvtOutput=0x00000000, ///<No event output when using the resynchronized or synchronous path
risingEdge=0x00000001, ///<Event detection only on the rising edge of the signal from the event generator when using the resynchronized or synchronous path
fallingEdge=0x00000002, ///<Event detection only on the falling edge of the signal from the event generator when using the resynchronized or synchronous path
bothEdges=0x00000003, ///<Event detection on rising and falling edges of the signal from the event generator when using the resynchronized or synchronous path
};
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,26),Register::ReadWriteAccess,EdgselVal> edgsel{};
namespace EdgselValC{
constexpr Register::FieldValue<decltype(edgsel)::Type,EdgselVal::noEvtOutput> noEvtOutput{};
constexpr Register::FieldValue<decltype(edgsel)::Type,EdgselVal::risingEdge> risingEdge{};
constexpr Register::FieldValue<decltype(edgsel)::Type,EdgselVal::fallingEdge> fallingEdge{};
constexpr Register::FieldValue<decltype(edgsel)::Type,EdgselVal::bothEdges> bothEdges{};
}
}
namespace EvsysChstatus{ ///<Channel Status
using Addr = Register::Address<0x4200040c,0xf0f00000,0x00000000,unsigned>;
///Channel 0 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy0{};
///Channel 1 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy1{};
///Channel 2 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy2{};
///Channel 3 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy3{};
///Channel 4 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy4{};
///Channel 5 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy5{};
///Channel 6 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy6{};
///Channel 7 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy7{};
///Channel 0 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy0{};
///Channel 1 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy1{};
///Channel 2 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy2{};
///Channel 3 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy3{};
///Channel 4 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy4{};
///Channel 5 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy5{};
///Channel 6 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy6{};
///Channel 7 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy7{};
///Channel 8 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy8{};
///Channel 9 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,17),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy9{};
///Channel 10 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,18),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy10{};
///Channel 11 User Ready
constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> usrrdy11{};
///Channel 8 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,24),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy8{};
///Channel 9 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy9{};
///Channel 10 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(26,26),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy10{};
///Channel 11 Busy
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,27),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> chbusy11{};
}
namespace EvsysCtrl{ ///<Control
using Addr = Register::Address<0x42000400,0xffffffee,0x00000000,unsigned char>;
///Software Reset
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::Access<Register::AccessType::writeOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> swrst{};
///Generic Clock Requests
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> gclkreq{};
}
namespace EvsysIntenclr{ ///<Interrupt Enable Clear
using Addr = Register::Address<0x42000410,0xf0f00000,0x00000000,unsigned>;
///Channel 0 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> ovr0{};
///Channel 1 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> ovr1{};
///Channel 2 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> ovr2{};
///Channel 3 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> ovr3{};
///Channel 4 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> ovr4{};
///Channel 5 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> ovr5{};
///Channel 6 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> ovr6{};
///Channel 7 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ovr7{};
///Channel 0 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> evd0{};
///Channel 1 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> evd1{};
///Channel 2 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> evd2{};
///Channel 3 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> evd3{};
///Channel 4 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> evd4{};
///Channel 5 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> evd5{};
///Channel 6 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> evd6{};
///Channel 7 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> evd7{};
///Channel 8 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,unsigned> ovr8{};
///Channel 9 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,17),Register::ReadWriteAccess,unsigned> ovr9{};
///Channel 10 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,18),Register::ReadWriteAccess,unsigned> ovr10{};
///Channel 11 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,unsigned> ovr11{};
///Channel 8 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,24),Register::ReadWriteAccess,unsigned> evd8{};
///Channel 9 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::ReadWriteAccess,unsigned> evd9{};
///Channel 10 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(26,26),Register::ReadWriteAccess,unsigned> evd10{};
///Channel 11 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,27),Register::ReadWriteAccess,unsigned> evd11{};
}
namespace EvsysIntenset{ ///<Interrupt Enable Set
using Addr = Register::Address<0x42000414,0xf0f00000,0x00000000,unsigned>;
///Channel 0 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> ovr0{};
///Channel 1 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> ovr1{};
///Channel 2 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> ovr2{};
///Channel 3 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> ovr3{};
///Channel 4 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> ovr4{};
///Channel 5 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> ovr5{};
///Channel 6 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> ovr6{};
///Channel 7 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ovr7{};
///Channel 0 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> evd0{};
///Channel 1 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> evd1{};
///Channel 2 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> evd2{};
///Channel 3 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> evd3{};
///Channel 4 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> evd4{};
///Channel 5 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> evd5{};
///Channel 6 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> evd6{};
///Channel 7 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> evd7{};
///Channel 8 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,unsigned> ovr8{};
///Channel 9 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,17),Register::ReadWriteAccess,unsigned> ovr9{};
///Channel 10 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,18),Register::ReadWriteAccess,unsigned> ovr10{};
///Channel 11 Overrun Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,unsigned> ovr11{};
///Channel 8 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,24),Register::ReadWriteAccess,unsigned> evd8{};
///Channel 9 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::ReadWriteAccess,unsigned> evd9{};
///Channel 10 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(26,26),Register::ReadWriteAccess,unsigned> evd10{};
///Channel 11 Event Detection Interrupt Enable
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,27),Register::ReadWriteAccess,unsigned> evd11{};
}
namespace EvsysIntflag{ ///<Interrupt Flag Status and Clear
using Addr = Register::Address<0x42000418,0xf0f00000,0x00000000,unsigned>;
///Channel 0 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> ovr0{};
///Channel 1 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> ovr1{};
///Channel 2 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> ovr2{};
///Channel 3 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> ovr3{};
///Channel 4 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> ovr4{};
///Channel 5 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> ovr5{};
///Channel 6 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> ovr6{};
///Channel 7 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> ovr7{};
///Channel 0 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> evd0{};
///Channel 1 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> evd1{};
///Channel 2 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> evd2{};
///Channel 3 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> evd3{};
///Channel 4 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> evd4{};
///Channel 5 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> evd5{};
///Channel 6 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,14),Register::ReadWriteAccess,unsigned> evd6{};
///Channel 7 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,unsigned> evd7{};
///Channel 8 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,unsigned> ovr8{};
///Channel 9 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(17,17),Register::ReadWriteAccess,unsigned> ovr9{};
///Channel 10 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,18),Register::ReadWriteAccess,unsigned> ovr10{};
///Channel 11 Overrun
constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,unsigned> ovr11{};
///Channel 8 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(24,24),Register::ReadWriteAccess,unsigned> evd8{};
///Channel 9 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::ReadWriteAccess,unsigned> evd9{};
///Channel 10 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(26,26),Register::ReadWriteAccess,unsigned> evd10{};
///Channel 11 Event Detection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,27),Register::ReadWriteAccess,unsigned> evd11{};
}
namespace EvsysUser{ ///<User Multiplexer
using Addr = Register::Address<0x42000408,0xffffe0e0,0x00000000,unsigned>;
///User Multiplexer Selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,0),Register::ReadWriteAccess,unsigned> user{};
///Channel Event Selection
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,8),Register::ReadWriteAccess,unsigned> channel{};
}
}
| 7,638 |
1,178 | # Copyright 2020 Makani Technologies 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
#
# 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.
"""Coordinate hardware targets for software testing.
This module provides server-side coordination of test fixture hardware for
running software tests. Client test_runner.py inserts test request records
into the 'test' and 'node' database tables to request access to a particular
hardware configuration. The server compares this information with the
'target' table records (which lists available hardware) and then associates
a target record to a node record.
"""
import logging
import sys
import time
import gflags
from makani.lib.python.embedded import hardware_db
from makani.lib.python.embedded import relay_device
import yaml
logging.basicConfig(level=logging.INFO,
format='[%(levelname)s] %(message)s')
class RelayManager(object):
"""An interface for controlling the relays of each target."""
def __init__(self, hardware_db_instance):
self._db = hardware_db_instance
self._relays = {}
def AddRelay(self, relay_module_id, relay_module):
"""Add a relay to the RelayManager.
Adds a relay to the internal dict _relays and runs GetMask() instance to
ensure that the relay states in the underlying module are consistent with
the physical state. GetMask is necessary or else a PowerOn call to a relay
may do nothing (whereas that device is expected to be reset) if that relay
was left on from a previous run.
Args:
relay_module_id: Integer represending the id of the relay module being
added to the database table RelayModules.
relay_module: Dict representation of a relay_module containing keys:
['Device', 'Channels', 'Type'] where the 'Type' value must be a valid
class found in the relay_device python module.
"""
always_on_bitmask = self._AlwaysOnBitmask(relay_module_id)
modify_bitmask = (((1 << relay_module['Channels']) - 1) ^
always_on_bitmask)
class_instantiater = getattr(relay_device, relay_module['Type'])
self._relays[relay_module_id] = class_instantiater(
device=relay_module['Device'],
channels=relay_module['Channels'],
mask=modify_bitmask,
default=always_on_bitmask)
# Update relay states in case some were left on.
self._relays[relay_module_id].GetMask()
def _GetRelay(self, target_id):
target = self._db.SelectTargets(target_id=target_id)
assert len(target) == 1, 'Invalid target match count.'
port = target[0]['RelayPort']
assert port >= 0, 'Invalid port number!'
return (target[0]['RelayModuleId'], target[0]['RelayPort'])
def _SetRelayMask(self, relay_id, mask):
self._relays[relay_id].SetMask(mask)
def _AlwaysOnBitmask(self, relay_module_id):
results = self._db.SelectTargets(relay_module_id=relay_module_id)
return sum([result['RelayAlwaysOn'] << result['RelayPort'] for
result in results])
def PowerOn(self, target_id):
relay_id, relay_port = self._GetRelay(target_id)
return self._relays[relay_id].PowerOn(relay_port)
def PowerOff(self, target_id):
relay_id, relay_port = self._GetRelay(target_id)
return self._relays[relay_id].PowerOff(relay_port)
def Update(self):
# Select all targets with a valid RelayModuleId and RelayPort.
targets = [t for t in self._db.SelectTargets() if t['RelayModuleId'] is not
None and t['RelayPort'] >= 0]
# Iterate over each RelayModuleId.
for relay_id in set([t['RelayModuleId'] for t in targets]):
bitmask = 0
busy_targets = self._db.SelectTargets(relay_module_id=relay_id,
busy=True)
ports = [1 << t['RelayPort'] for t in busy_targets if
t['RelayModuleId'] == relay_id]
bitmask = sum(ports)
bitmask |= self._AlwaysOnBitmask(relay_module_id=relay_id)
self._SetRelayMask(relay_id, bitmask)
class TestFixture(object):
"""Coordinate hardware targets for software testing."""
def __init__(self, database):
self._db = hardware_db.HardwareDatabase(database)
self._db.InitTables()
self._relay = RelayManager(self._db)
def LoadHardware(self, yaml_file):
"""Load hardware target configuration file into database."""
relays = {} # A dict to temporarily store RelayModuleId mapping.
self._db.InitTables()
def GetRelayId(relay_dict):
for key, value in relays.iteritems():
if value == relay_dict:
return key
raise ValueError('{} not found in dictionary.'.format(relay_dict))
with open(yaml_file, 'r') as f:
yaml_file = yaml.full_load(f)
for r in yaml_file.get('relay_modules', []):
relay_config = hardware_db.TranslateYamlStyleToSqlStyle(r)
relay_id = self._db.Insert('RelayModules', relay_config)
self._relay.AddRelay(relay_id, relay_config)
relays[relay_id] = relay_config
for t in yaml_file.get('targets', []):
target_config = hardware_db.TranslateYamlStyleToSqlStyle(t)
relay_config = hardware_db.TranslateYamlStyleToSqlStyle(
target_config['RelayModule'])
target_config['RelayModuleId'] = GetRelayId(relay_config)
del target_config['RelayModule'] # This key does not exist in the db,
# it is a yaml duplicated relay.
self._db.InsertTarget(target_config)
def GetCandidateTargets(self, test):
return [self._db.SelectTargetIdsByTest(node) for node in test]
def GetPossibleTargets(self, avail_targets, candidates):
avail = set(avail_targets)
return [list(set(c) & avail) for c in candidates]
def IsTestPossible(self, avail_targets, candidates):
return [] not in self.GetPossibleTargets(avail_targets, candidates)
def SelectTestTargets(self, avail_targets, candidates, other=None):
"""Select targets to associate with a test.
Args:
avail_targets: A list of available target ids.
candidates: A list of lists specifying the candidate targets (all targets
matching hardware requirements) for each node.
other: A list of lists specifying the candidate targets for another test
that must run concurrently.
Returns:
A list of targets to schedule.
"""
if avail_targets and candidates:
# Perform a depth first search through each node in test to identify the
# first possible target combination.
for target in set(avail_targets) & set(candidates[0]):
targets = [target]
remaining = set(avail_targets) - set(targets)
# Handle each node in test recursively.
targets.extend(self.SelectTestTargets(remaining, candidates[1:], other))
if len(targets) == len(candidates):
# If we schedule this test, can the other test still run?
remaining -= set(targets)
if not other or self.SelectTestTargets(remaining, other):
return targets
return []
def ScheduleTest(self, candidates, test, pending):
"""Schedule a test for execution.
Args:
candidates: A list of lists specifying the candidate targets (all targets
matching hardware requirements) for each node.
test: A list of node test descriptors.
pending: A list of target candidates corresponding to tests that are
pending.
Returns:
True when scheduled.
"""
# Determine hardware available for test.
avail_targets = self._db.SelectTargetIds(busy=False)
# The current implementation only considers if this test blocks the
# first pending test.
if pending:
pending = pending[0]
# Filter nodes that prevent the first pending test from running.
pending = [p for p in self.GetPossibleTargets(avail_targets, pending) if p]
targets = self.SelectTestTargets(avail_targets, candidates, pending)
# Can execute this test now?
if targets:
for target_id, node in zip(targets, test):
target = self._db.SelectTargets(target_id=target_id)[0]
logging.info('Assign node [test=%d node=%d]', node['TestId'],
node['TestNodeId'], extra={'TargetId': target['TargetId']})
self._relay.PowerOn(target['TargetId'])
self._db.StartTestNode(node['TestNodeId'], target_id)
return bool(targets)
def SchedulePendingTests(self):
"""Poll database for pending tests, then attempt to schedule each test."""
pending = []
all_targets = self._db.SelectTargetIds()
for test in self._db.SelectTests(running=False):
# Compute candidate targets for each node in a given test.
candidates = self.GetCandidateTargets(test)
# Can perform the given test with available targets?
if not self.IsTestPossible(all_targets, candidates):
logging.warning('Test %s not possible with available hardware.', test,
extra={'TargetId': -1})
self._db.DeleteTestNodes(test)
elif not self.ScheduleTest(candidates, test, pending):
pending.append(candidates)
def Iterate(self):
# Perform garbage collection first to free up any staled nodes.
self._db.GarbageCollection()
self._relay.Update()
# Schedule new tests.
self.SchedulePendingTests()
def Run(self, yaml_file):
self.LoadHardware(yaml_file)
while True:
self.Iterate()
time.sleep(1.0)
def ParseFlags(argv):
"""Define and parse gflags parameters."""
gflags.DEFINE_string('database', 'hardware.db',
'Full path to shared hardware database file.')
gflags.DEFINE_string('config', None,
'Full path to test fixture hardware configuration file.')
gflags.MarkFlagAsRequired('config')
return gflags.FLAGS(argv)
def main(argv):
try:
argv = ParseFlags(argv)
except gflags.FlagsError, e:
print '%s\\nUsage: %s ARGS\\n%s' % (e, sys.argv[0], gflags.FLAGS)
sys.exit(1)
fixture = TestFixture(database=gflags.FLAGS.database)
fixture.Run(yaml_file=gflags.FLAGS.config)
if __name__ == '__main__':
main(sys.argv)
| 3,906 |
1,162 | <gh_stars>1000+
{
"type": "service_account",
"project_id": "dummy-project",
"private_key_id": "1b74fe23959e7ebc0735590ebced3b6a7057ded0",
"private_key": "-----<KEY>",
"client_email": "<EMAIL>",
"client_id": "103785715584895261604",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dummy-project.iam.gserviceaccount.com"
}
| 243 |
1,760 | <filename>third_party/protobuf/python/google/protobuf/pyext/repeated_composite_container.cc<gh_stars>1000+
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: <EMAIL> (<NAME>)
// Author: <EMAIL> (<NAME>)
#include <google/protobuf/pyext/repeated_composite_container.h>
#include <memory>
#ifndef _SHARED_PTR_H
#include <google/protobuf/stubs/shared_ptr.h>
#endif
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/dynamic_message.h>
#include <google/protobuf/message.h>
#include <google/protobuf/pyext/descriptor.h>
#include <google/protobuf/pyext/descriptor_pool.h>
#include <google/protobuf/pyext/message.h>
#include <google/protobuf/pyext/scoped_pyobject_ptr.h>
#if PY_MAJOR_VERSION >= 3
#define PyInt_Check PyLong_Check
#define PyInt_AsLong PyLong_AsLong
#define PyInt_FromLong PyLong_FromLong
#endif
namespace google {
namespace protobuf {
namespace python {
namespace repeated_composite_container {
// TODO(tibell): We might also want to check:
// GOOGLE_CHECK_NOTNULL((self)->owner.get());
#define GOOGLE_CHECK_ATTACHED(self) \
do { \
GOOGLE_CHECK_NOTNULL((self)->message); \
GOOGLE_CHECK_NOTNULL((self)->parent_field_descriptor); \
} while (0);
#define GOOGLE_CHECK_RELEASED(self) \
do { \
GOOGLE_CHECK((self)->owner.get() == NULL); \
GOOGLE_CHECK((self)->message == NULL); \
GOOGLE_CHECK((self)->parent_field_descriptor == NULL); \
GOOGLE_CHECK((self)->parent == NULL); \
} while (0);
// ---------------------------------------------------------------------
// len()
static Py_ssize_t Length(RepeatedCompositeContainer* self) {
Message* message = self->message;
if (message != NULL) {
return message->GetReflection()->FieldSize(*message,
self->parent_field_descriptor);
} else {
// The container has been released (i.e. by a call to Clear() or
// ClearField() on the parent) and thus there's no message.
return PyList_GET_SIZE(self->child_messages);
}
}
// Returns 0 if successful; returns -1 and sets an exception if
// unsuccessful.
static int UpdateChildMessages(RepeatedCompositeContainer* self) {
if (self->message == NULL)
return 0;
// A MergeFrom on a parent message could have caused extra messages to be
// added in the underlying protobuf so add them to our list. They can never
// be removed in such a way so there's no need to worry about that.
Py_ssize_t message_length = Length(self);
Py_ssize_t child_length = PyList_GET_SIZE(self->child_messages);
Message* message = self->message;
const Reflection* reflection = message->GetReflection();
for (Py_ssize_t i = child_length; i < message_length; ++i) {
const Message& sub_message = reflection->GetRepeatedMessage(
*(self->message), self->parent_field_descriptor, i);
CMessage* cmsg = cmessage::NewEmptyMessage(self->child_message_class);
ScopedPyObjectPtr py_cmsg(reinterpret_cast<PyObject*>(cmsg));
if (cmsg == NULL) {
return -1;
}
cmsg->owner = self->owner;
cmsg->message = const_cast<Message*>(&sub_message);
cmsg->parent = self->parent;
if (PyList_Append(self->child_messages, py_cmsg.get()) < 0) {
return -1;
}
}
return 0;
}
// ---------------------------------------------------------------------
// add()
static PyObject* AddToAttached(RepeatedCompositeContainer* self,
PyObject* args,
PyObject* kwargs) {
GOOGLE_CHECK_ATTACHED(self);
if (UpdateChildMessages(self) < 0) {
return NULL;
}
if (cmessage::AssureWritable(self->parent) == -1)
return NULL;
Message* message = self->message;
Message* sub_message =
message->GetReflection()->AddMessage(message,
self->parent_field_descriptor);
CMessage* cmsg = cmessage::NewEmptyMessage(self->child_message_class);
if (cmsg == NULL)
return NULL;
cmsg->owner = self->owner;
cmsg->message = sub_message;
cmsg->parent = self->parent;
if (cmessage::InitAttributes(cmsg, kwargs) < 0) {
Py_DECREF(cmsg);
return NULL;
}
PyObject* py_cmsg = reinterpret_cast<PyObject*>(cmsg);
if (PyList_Append(self->child_messages, py_cmsg) < 0) {
Py_DECREF(py_cmsg);
return NULL;
}
return py_cmsg;
}
static PyObject* AddToReleased(RepeatedCompositeContainer* self,
PyObject* args,
PyObject* kwargs) {
GOOGLE_CHECK_RELEASED(self);
// Create a new Message detached from the rest.
PyObject* py_cmsg = PyEval_CallObjectWithKeywords(
self->child_message_class->AsPyObject(), NULL, kwargs);
if (py_cmsg == NULL)
return NULL;
if (PyList_Append(self->child_messages, py_cmsg) < 0) {
Py_DECREF(py_cmsg);
return NULL;
}
return py_cmsg;
}
PyObject* Add(RepeatedCompositeContainer* self,
PyObject* args,
PyObject* kwargs) {
if (self->message == NULL)
return AddToReleased(self, args, kwargs);
else
return AddToAttached(self, args, kwargs);
}
// ---------------------------------------------------------------------
// extend()
PyObject* Extend(RepeatedCompositeContainer* self, PyObject* value) {
cmessage::AssureWritable(self->parent);
if (UpdateChildMessages(self) < 0) {
return NULL;
}
ScopedPyObjectPtr iter(PyObject_GetIter(value));
if (iter == NULL) {
PyErr_SetString(PyExc_TypeError, "Value must be iterable");
return NULL;
}
ScopedPyObjectPtr next;
while ((next.reset(PyIter_Next(iter.get()))) != NULL) {
if (!PyObject_TypeCheck(next.get(), &CMessage_Type)) {
PyErr_SetString(PyExc_TypeError, "Not a cmessage");
return NULL;
}
ScopedPyObjectPtr new_message(Add(self, NULL, NULL));
if (new_message == NULL) {
return NULL;
}
CMessage* new_cmessage = reinterpret_cast<CMessage*>(new_message.get());
if (ScopedPyObjectPtr(cmessage::MergeFrom(new_cmessage, next.get())) ==
NULL) {
return NULL;
}
}
if (PyErr_Occurred()) {
return NULL;
}
Py_RETURN_NONE;
}
PyObject* MergeFrom(RepeatedCompositeContainer* self, PyObject* other) {
if (UpdateChildMessages(self) < 0) {
return NULL;
}
return Extend(self, other);
}
PyObject* Subscript(RepeatedCompositeContainer* self, PyObject* slice) {
if (UpdateChildMessages(self) < 0) {
return NULL;
}
// Just forward the call to the subscript-handling function of the
// list containing the child messages.
return PyObject_GetItem(self->child_messages, slice);
}
int AssignSubscript(RepeatedCompositeContainer* self,
PyObject* slice,
PyObject* value) {
if (UpdateChildMessages(self) < 0) {
return -1;
}
if (value != NULL) {
PyErr_SetString(PyExc_TypeError, "does not support assignment");
return -1;
}
// Delete from the underlying Message, if any.
if (self->parent != NULL) {
if (cmessage::InternalDeleteRepeatedField(self->parent,
self->parent_field_descriptor,
slice,
self->child_messages) < 0) {
return -1;
}
} else {
Py_ssize_t from;
Py_ssize_t to;
Py_ssize_t step;
Py_ssize_t length = Length(self);
Py_ssize_t slicelength;
if (PySlice_Check(slice)) {
#if PY_MAJOR_VERSION >= 3
if (PySlice_GetIndicesEx(slice,
#else
if (PySlice_GetIndicesEx(reinterpret_cast<PySliceObject*>(slice),
#endif
length, &from, &to, &step, &slicelength) == -1) {
return -1;
}
return PySequence_DelSlice(self->child_messages, from, to);
} else if (PyInt_Check(slice) || PyLong_Check(slice)) {
from = to = PyLong_AsLong(slice);
if (from < 0) {
from = to = length + from;
}
return PySequence_DelItem(self->child_messages, from);
}
}
return 0;
}
static PyObject* Remove(RepeatedCompositeContainer* self, PyObject* value) {
if (UpdateChildMessages(self) < 0) {
return NULL;
}
Py_ssize_t index = PySequence_Index(self->child_messages, value);
if (index == -1) {
return NULL;
}
ScopedPyObjectPtr py_index(PyLong_FromLong(index));
if (AssignSubscript(self, py_index.get(), NULL) < 0) {
return NULL;
}
Py_RETURN_NONE;
}
static PyObject* RichCompare(RepeatedCompositeContainer* self,
PyObject* other,
int opid) {
if (UpdateChildMessages(self) < 0) {
return NULL;
}
if (!PyObject_TypeCheck(other, &RepeatedCompositeContainer_Type)) {
PyErr_SetString(PyExc_TypeError,
"Can only compare repeated composite fields "
"against other repeated composite fields.");
return NULL;
}
if (opid == Py_EQ || opid == Py_NE) {
// TODO(anuraag): Don't make new lists just for this...
ScopedPyObjectPtr full_slice(PySlice_New(NULL, NULL, NULL));
if (full_slice == NULL) {
return NULL;
}
ScopedPyObjectPtr list(Subscript(self, full_slice.get()));
if (list == NULL) {
return NULL;
}
ScopedPyObjectPtr other_list(
Subscript(reinterpret_cast<RepeatedCompositeContainer*>(other),
full_slice.get()));
if (other_list == NULL) {
return NULL;
}
return PyObject_RichCompare(list.get(), other_list.get(), opid);
} else {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
}
// ---------------------------------------------------------------------
// sort()
static void ReorderAttached(RepeatedCompositeContainer* self) {
Message* message = self->message;
const Reflection* reflection = message->GetReflection();
const FieldDescriptor* descriptor = self->parent_field_descriptor;
const Py_ssize_t length = Length(self);
// Since Python protobuf objects are never arena-allocated, adding and
// removing message pointers to the underlying array is just updating
// pointers.
for (Py_ssize_t i = 0; i < length; ++i)
reflection->ReleaseLast(message, descriptor);
for (Py_ssize_t i = 0; i < length; ++i) {
CMessage* py_cmsg = reinterpret_cast<CMessage*>(
PyList_GET_ITEM(self->child_messages, i));
reflection->AddAllocatedMessage(message, descriptor, py_cmsg->message);
}
}
// Returns 0 if successful; returns -1 and sets an exception if
// unsuccessful.
static int SortPythonMessages(RepeatedCompositeContainer* self,
PyObject* args,
PyObject* kwds) {
ScopedPyObjectPtr m(PyObject_GetAttrString(self->child_messages, "sort"));
if (m == NULL)
return -1;
if (PyObject_Call(m.get(), args, kwds) == NULL)
return -1;
if (self->message != NULL) {
ReorderAttached(self);
}
return 0;
}
static PyObject* Sort(RepeatedCompositeContainer* self,
PyObject* args,
PyObject* kwds) {
// Support the old sort_function argument for backwards
// compatibility.
if (kwds != NULL) {
PyObject* sort_func = PyDict_GetItemString(kwds, "sort_function");
if (sort_func != NULL) {
// Must set before deleting as sort_func is a borrowed reference
// and kwds might be the only thing keeping it alive.
PyDict_SetItemString(kwds, "cmp", sort_func);
PyDict_DelItemString(kwds, "sort_function");
}
}
if (UpdateChildMessages(self) < 0) {
return NULL;
}
if (SortPythonMessages(self, args, kwds) < 0) {
return NULL;
}
Py_RETURN_NONE;
}
// ---------------------------------------------------------------------
static PyObject* Item(RepeatedCompositeContainer* self, Py_ssize_t index) {
if (UpdateChildMessages(self) < 0) {
return NULL;
}
Py_ssize_t length = Length(self);
if (index < 0) {
index = length + index;
}
PyObject* item = PyList_GetItem(self->child_messages, index);
if (item == NULL) {
return NULL;
}
Py_INCREF(item);
return item;
}
static PyObject* Pop(RepeatedCompositeContainer* self,
PyObject* args) {
Py_ssize_t index = -1;
if (!PyArg_ParseTuple(args, "|n", &index)) {
return NULL;
}
PyObject* item = Item(self, index);
if (item == NULL) {
PyErr_Format(PyExc_IndexError,
"list index (%zd) out of range",
index);
return NULL;
}
ScopedPyObjectPtr py_index(PyLong_FromSsize_t(index));
if (AssignSubscript(self, py_index.get(), NULL) < 0) {
return NULL;
}
return item;
}
// Release field of parent message and transfer the ownership to target.
void ReleaseLastTo(CMessage* parent,
const FieldDescriptor* field,
CMessage* target) {
GOOGLE_CHECK_NOTNULL(parent);
GOOGLE_CHECK_NOTNULL(field);
GOOGLE_CHECK_NOTNULL(target);
shared_ptr<Message> released_message(
parent->message->GetReflection()->ReleaseLast(parent->message, field));
// TODO(tibell): Deal with proto1.
target->parent = NULL;
target->parent_field_descriptor = NULL;
target->message = released_message.get();
target->read_only = false;
cmessage::SetOwner(target, released_message);
}
// Called to release a container using
// ClearField('container_field_name') on the parent.
int Release(RepeatedCompositeContainer* self) {
if (UpdateChildMessages(self) < 0) {
PyErr_WriteUnraisable(PyBytes_FromString("Failed to update released "
"messages"));
return -1;
}
Message* message = self->message;
const FieldDescriptor* field = self->parent_field_descriptor;
// The reflection API only lets us release the last message in a
// repeated field. Therefore we iterate through the children
// starting with the last one.
const Py_ssize_t size = PyList_GET_SIZE(self->child_messages);
GOOGLE_DCHECK_EQ(size, message->GetReflection()->FieldSize(*message, field));
for (Py_ssize_t i = size - 1; i >= 0; --i) {
CMessage* child_cmessage = reinterpret_cast<CMessage*>(
PyList_GET_ITEM(self->child_messages, i));
ReleaseLastTo(self->parent, field, child_cmessage);
}
// Detach from containing message.
self->parent = NULL;
self->parent_field_descriptor = NULL;
self->message = NULL;
self->owner.reset();
return 0;
}
int SetOwner(RepeatedCompositeContainer* self,
const shared_ptr<Message>& new_owner) {
GOOGLE_CHECK_ATTACHED(self);
self->owner = new_owner;
const Py_ssize_t n = PyList_GET_SIZE(self->child_messages);
for (Py_ssize_t i = 0; i < n; ++i) {
PyObject* msg = PyList_GET_ITEM(self->child_messages, i);
if (cmessage::SetOwner(reinterpret_cast<CMessage*>(msg), new_owner) == -1) {
return -1;
}
}
return 0;
}
// The private constructor of RepeatedCompositeContainer objects.
PyObject *NewContainer(
CMessage* parent,
const FieldDescriptor* parent_field_descriptor,
CMessageClass* concrete_class) {
if (!CheckFieldBelongsToMessage(parent_field_descriptor, parent->message)) {
return NULL;
}
RepeatedCompositeContainer* self =
reinterpret_cast<RepeatedCompositeContainer*>(
PyType_GenericAlloc(&RepeatedCompositeContainer_Type, 0));
if (self == NULL) {
return NULL;
}
self->message = parent->message;
self->parent = parent;
self->parent_field_descriptor = parent_field_descriptor;
self->owner = parent->owner;
Py_INCREF(concrete_class);
self->child_message_class = concrete_class;
self->child_messages = PyList_New(0);
return reinterpret_cast<PyObject*>(self);
}
static void Dealloc(RepeatedCompositeContainer* self) {
Py_CLEAR(self->child_messages);
Py_CLEAR(self->child_message_class);
// TODO(tibell): Do we need to call delete on these objects to make
// sure their destructors are called?
self->owner.reset();
Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self));
}
static PySequenceMethods SqMethods = {
(lenfunc)Length, /* sq_length */
0, /* sq_concat */
0, /* sq_repeat */
(ssizeargfunc)Item /* sq_item */
};
static PyMappingMethods MpMethods = {
(lenfunc)Length, /* mp_length */
(binaryfunc)Subscript, /* mp_subscript */
(objobjargproc)AssignSubscript,/* mp_ass_subscript */
};
static PyMethodDef Methods[] = {
{ "add", (PyCFunction) Add, METH_VARARGS | METH_KEYWORDS,
"Adds an object to the repeated container." },
{ "extend", (PyCFunction) Extend, METH_O,
"Adds objects to the repeated container." },
{ "pop", (PyCFunction)Pop, METH_VARARGS,
"Removes an object from the repeated container and returns it." },
{ "remove", (PyCFunction) Remove, METH_O,
"Removes an object from the repeated container." },
{ "sort", (PyCFunction) Sort, METH_VARARGS | METH_KEYWORDS,
"Sorts the repeated container." },
{ "MergeFrom", (PyCFunction) MergeFrom, METH_O,
"Adds objects to the repeated container." },
{ NULL, NULL }
};
} // namespace repeated_composite_container
PyTypeObject RepeatedCompositeContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
FULL_MODULE_NAME ".RepeatedCompositeContainer", // tp_name
sizeof(RepeatedCompositeContainer), // tp_basicsize
0, // tp_itemsize
(destructor)repeated_composite_container::Dealloc, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
0, // tp_compare
0, // tp_repr
0, // tp_as_number
&repeated_composite_container::SqMethods, // tp_as_sequence
&repeated_composite_container::MpMethods, // tp_as_mapping
PyObject_HashNotImplemented, // tp_hash
0, // tp_call
0, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_DEFAULT, // tp_flags
"A Repeated scalar container", // tp_doc
0, // tp_traverse
0, // tp_clear
(richcmpfunc)repeated_composite_container::RichCompare, // tp_richcompare
0, // tp_weaklistoffset
0, // tp_iter
0, // tp_iternext
repeated_composite_container::Methods, // tp_methods
0, // tp_members
0, // tp_getset
0, // tp_base
0, // tp_dict
0, // tp_descr_get
0, // tp_descr_set
0, // tp_dictoffset
0, // tp_init
};
} // namespace python
} // namespace protobuf
} // namespace google
| 8,753 |
3,793 | /*
Copyright 2009 - 2021 NoahFrame(NoahGameFrame)
File creator: lvsheng.huang
This source file is part of NoahGameFrame/NoahFrame.
NoahGameFrame/NoahFrame is open-source software and you can redistribute it and/or modify
it under the terms of the License; besides, anyone who use this file/software must include this copyright announcement.
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 "NFNetPlugin.h"
#include "NFNetModule.h"
#include "NFNetClientModule.h"
#include "NFHttpClientModule.h"
#include "NFHttpServerModule.h"
#include "NFWSModule.h"
#include "NFUDPModule.h"
#include "NFComm/NFPluginModule/NFIPluginManager.h"
#ifdef NF_DYNAMIC_PLUGIN
NF_EXPORT void DllStartPlugin(NFIPluginManager* pm)
{
CREATE_PLUGIN(pm, NFNetPlugin)
};
NF_EXPORT void DllStopPlugin(NFIPluginManager* pm)
{
DESTROY_PLUGIN(pm, NFNetPlugin)
};
#endif
//////////////////////////////////////////////////////////////////////////
const int NFNetPlugin::GetPluginVersion()
{
return 0;
}
const std::string NFNetPlugin::GetPluginName()
{
return GET_CLASS_NAME(NFNetPlugin);
}
void NFNetPlugin::Install()
{
REGISTER_MODULE(pPluginManager, NFINetModule, NFNetModule)
REGISTER_MODULE(pPluginManager, NFIWSModule, NFWSModule)
REGISTER_MODULE(pPluginManager, NFIHttpServerModule, NFHttpServerModule)
REGISTER_MODULE(pPluginManager, NFINetClientModule, NFNetClientModule)
REGISTER_MODULE(pPluginManager, NFIHttpClientModule, NFHttpClientModule)
//REGISTER_MODULE(pPluginManager, NFIUDPModule, NFUDPModule)
}
void NFNetPlugin::Uninstall()
{
//UNREGISTER_MODULE(pPluginManager, NFIUDPModule, NFUDPModule)
UNREGISTER_MODULE(pPluginManager, NFIHttpClientModule, NFHttpClientModule)
UNREGISTER_MODULE(pPluginManager, NFINetClientModule, NFNetClientModule)
UNREGISTER_MODULE(pPluginManager, NFIHttpServerModule, NFHttpServerModule)
UNREGISTER_MODULE(pPluginManager, NFIWSModule, NFWSModule)
UNREGISTER_MODULE(pPluginManager, NFINetModule, NFNetModule)
} | 810 |
421 | <filename>samples/snippets/cpp/VS_Snippets_CLR_System/system.Double.ToString/cpp/tostring1.cpp
// ToStringCPP.cpp : main project file.
// <Snippet4>
using namespace System;
using namespace System::Globalization;
int main(array<System::String ^> ^args)
{
double value = 16325.62901;
String^ specifier;
CultureInfo^ culture;
// Use standard numeric format specifiers.
specifier = "G";
culture = CultureInfo::CreateSpecificCulture("eu-ES");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 16325,62901
Console::WriteLine(value.ToString(specifier, CultureInfo::InvariantCulture));
// Displays: 16325.62901
specifier = "C";
culture = CultureInfo::CreateSpecificCulture("en-US");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: $16,325.63
culture = CultureInfo::CreateSpecificCulture("en-GB");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: £16,325.63
specifier = "E04";
culture = CultureInfo::CreateSpecificCulture("sv-SE");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 1,6326E+004
culture = CultureInfo::CreateSpecificCulture("en-NZ");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 1.6326E+004
specifier = "F";
culture = CultureInfo::CreateSpecificCulture("fr-FR");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 16325,63
culture = CultureInfo::CreateSpecificCulture("en-CA");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 16325.63
specifier = "N";
culture = CultureInfo::CreateSpecificCulture("es-ES");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 16.325,63
culture = CultureInfo::CreateSpecificCulture("fr-CA");
Console::WriteLine(value.ToString(specifier, culture));
// Displays: 16 325,63
specifier = "P";
culture = CultureInfo::InvariantCulture;
Console::WriteLine((value/10000).ToString(specifier, culture));
// Displays: 163.26 %
culture = CultureInfo::CreateSpecificCulture("ar-EG");
Console::WriteLine((value/10000).ToString(specifier, culture));
// Displays: 163.256 %
return 0;
}
// </Snippet4> | 867 |
14,668 | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/public/cpp/ambient/ambient_client.h"
#include "base/check_op.h"
namespace ash {
namespace {
AmbientClient* g_ambient_client = nullptr;
} // namespace
// static
AmbientClient* AmbientClient::Get() {
return g_ambient_client;
}
AmbientClient::AmbientClient() {
DCHECK(!g_ambient_client);
g_ambient_client = this;
}
AmbientClient::~AmbientClient() {
DCHECK_EQ(g_ambient_client, this);
g_ambient_client = nullptr;
}
} // namespace ash
| 223 |
373 | <reponame>heatd/edk2-platforms<filename>Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/Register/PchRegsPsf.h
/** @file
Register definition for PSF component
Conventions:
Prefixes:
Definitions beginning with "R_" are registers
Definitions beginning with "B_" are bits within registers
Definitions beginning with "V_" are meaningful values within the bits
Definitions beginning with "S_" are register sizes
Definitions beginning with "N_" are the bit position
In general, PCH registers are denoted by "_PCH_" in register names
Registers / bits that are different between PCH generations are denoted by
_PCH_[generation_name]_" in register/bit names.
Registers / bits that are specific to PCH-H denoted by "_H_" in register/bit names.
Registers / bits that are specific to PCH-LP denoted by "_LP_" in register/bit names.
e.g., "_PCH_H_", "_PCH_LP_"
Registers / bits names without _H_ or _LP_ apply for both H and LP.
Registers / bits that are different between SKUs are denoted by "_[SKU_name]"
at the end of the register/bit names
Registers / bits of new devices introduced in a PCH generation will be just named
as "_PCH_" without [generation_name] inserted.
@copyright
Copyright 2014 - 2021 Intel Corporation. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _PCH_REGS_PSF_H_
#define _PCH_REGS_PSF_H_
//
// Private chipset regsiter (Memory space) offset definition
// The PCR register defines is used for PCR MMIO programming and PCH SBI programming as well.
//
//
// PSFx segment registers
//
#define R_PCH_PCR_PSF_GLOBAL_CONFIG 0x4000 ///< PSF Segment Global Configuration Register
#define B_PCH_PCR_PSF_GLOBAL_CONFIG_ENTCG BIT4
#define B_PCH_PCR_PSF_GLOBAL_CONFIG_ENLCG BIT3
#define R_PCH_PCR_PSF_ROOTSPACE_CONFIG_RS0 0x4014 ///< PSF Segment Rootspace Configuration Register
#define B_PCH_PCR_PSF_ROOTSPACE_CONFIG_RS0_ENADDRP2P BIT1
#define B_PCH_PCR_PSF_ROOTSPACE_CONFIG_RS0_VTDEN BIT0
#define R_PCH_PCR_PSF_PORT_CONFIG_PG0_PORT0 0x4020 ///< PSF Segment Port Configuration Register
#define S_PCH_PSF_DEV_GNTCNT_RELOAD_DGCR 4
#define S_PCH_PSF_TARGET_GNTCNT_RELOAD 4
#define B_PCH_PSF_DEV_GNTCNT_RELOAD_DGCR_GNT_CNT_RELOAD 0x1F
#define B_PCH_PSF_TARGET_GNTCNT_RELOAD_GNT_CNT_RELOAD 0x1F
//
// PSFx PCRs definitions
//
#define R_PCH_PCR_PSFX_T0_SHDW_BAR0 0 ///< PCI BAR0
#define R_PCH_PCR_PSFX_T0_SHDW_BAR1 0x04 ///< PCI BAR1
#define R_PCH_PCR_PSFX_T0_SHDW_BAR2 0x08 ///< PCI BAR2
#define R_PCH_PCR_PSFX_T0_SHDW_BAR3 0x0C ///< PCI BAR3
#define R_PCH_PCR_PSFX_T0_SHDW_BAR4 0x10 ///< PCI BAR4
#define R_PCH_PSFX_PCR_T0_SHDW_PCIEN 0x1C ///< PCI configuration space enable bits
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR0DIS BIT16 ///< Disable BAR0
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR1DIS BIT17 ///< Disable BAR1
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR2DIS BIT18 ///< Disable BAR2
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR3DIS BIT19 ///< Disable BAR3
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR4DIS BIT20 ///< Disable BAR4
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_BAR5DIS BIT21 ///< Disable BAR5
#define B_PCH_PSFX_PCR_T0_SHDW_PCIEN_FUNDIS BIT8 ///< Function disable
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_MEMEN BIT1 ///< Memory decoding enable
#define B_PCH_PCR_PSFX_T0_SHDW_PCIEN_IOEN BIT0 ///< IO decoding enable
#define R_PCH_PCR_PSFX_T0_SHDW_PMCSR 0x20 ///< PCI power management configuration
#define B_PCH_PCR_PSFX_T0_SHDW_PMCSR_PWRST (BIT1 | BIT0) ///< Power status
#define R_PCH_PCR_PSFX_T0_SHDW_CFG_DIS 0x38 ///< PCI configuration disable
#define B_PCH_PCR_PSFX_T0_SHDW_CFG_DIS_CFGDIS BIT0 ///< config disable
#define R_PCH_PCR_PSFX_T1_SHDW_PCIEN 0x3C ///< PCI configuration space enable bits
#define B_PCH_PSFX_PCR_T1_SHDW_PCIEN_FUNDIS BIT8 ///< Function disable
#define B_PCH_PCR_PSFX_T1_SHDW_PCIEN_MEMEN BIT1 ///< Memory decoding enable
#define B_PCH_PCR_PSFX_T1_SHDW_PCIEN_IOEN BIT0 ///< IO decoding enable
#define B_PCH_PCR_PSFX_TX_AGENT_FUNCTION_CONFIG_DEVICE 0x01F0 ///< device number
#define N_PCH_PCR_PSFX_TX_AGENT_FUNCTION_CONFIG_DEVICE 4
#define B_PCH_PCR_PSFX_TX_AGENT_FUNCTION_CONFIG_FUNCTION (BIT3 | BIT2 | BIT1) ///< function number
#define N_PCH_PCR_PSFX_TX_AGENT_FUNCTION_CONFIG_FUNCTION 1
#define V_PCH_LP_PCR_PSFX_PSF_MC_AGENT_MCAST_TGT_P2SB 0x38A00
#define V_PCH_H_PCR_PSFX_PSF_MC_AGENT_MCAST_TGT_P2SB 0x38B00
//
// PSF1 PCRs
//
// PSF1 PCH-LP Specific Base Address
#define R_PCH_LP_PCR_PSF1_T0_SHDW_GBE_REG_BASE 0x0200 ///< D31F6 PSF base address (GBE)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_CAM_REG_BASE 0x0300 ///< D20F3 PSF base address (CAM)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_CSE_WLAN_REG_BASE 0x0500 ///< D22F7 PSF base address (CSME: WLAN)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_HECI3_REG_BASE 0x0700 ///< D22F4 PSF base address (CSME: HECI3)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_HECI2_REG_BASE 0x0800 ///< D22F1 PSF base address (CSME: HECI2)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_CSE_UMA_REG_BASE 0x0900 ///< D18F3 PSF base address (CSME: CSE UMA)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_HECI1_REG_BASE 0x0A00 ///< D22F0 PSF base address (CSME: HECI1)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_KT_REG_BASE 0x0B00 ///< D22F3 PSF base address (CSME: KT)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_IDER_REG_BASE 0x0C00 ///< D22F2 PSF base address (CSME: IDER)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_CLINK_REG_BASE 0x0D00 ///< D18F1 PSF base address (CSME: CLINK)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_PMT_REG_BASE 0x0E00 ///< D18F2 PSF base address (CSME: PMT)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_KVM_REG_BASE 0x0F00 ///< D18F0 PSF base address (CSME: KVM)
#define R_PCH_LP_PCR_PSF1_T0_SHDW_SATA_REG_BASE 0x1000 ///< PCH-LP D23F0 PSF base address (SATA)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE12_REG_BASE 0x2000 ///< PCH-LP D29F3 PSF base address (PCIE PORT 12)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE11_REG_BASE 0x2100 ///< PCH-LP D29F2 PSF base address (PCIE PORT 11)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE10_REG_BASE 0x2200 ///< PCH-LP D29F1 PSF base address (PCIE PORT 10)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE09_REG_BASE 0x2300 ///< PCH-LP D29F0 PSF base address (PCIE PORT 09)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE08_REG_BASE 0x2400 ///< PCH-LP D28F7 PSF base address (PCIE PORT 08)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE07_REG_BASE 0x2500 ///< PCH-LP D28F6 PSF base address (PCIE PORT 07)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE06_REG_BASE 0x2600 ///< PCH-LP D28F5 PSF base address (PCIE PORT 06)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE05_REG_BASE 0x2700 ///< PCH-LP D28F4 PSF base address (PCIE PORT 05)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE04_REG_BASE 0x2800 ///< PCH-LP D28F3 PSF base address (PCIE PORT 04)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE03_REG_BASE 0x2900 ///< PCH-LP D28F2 PSF base address (PCIE PORT 03)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE02_REG_BASE 0x2A00 ///< PCH-LP D28F1 PSF base address (PCIE PORT 02)
#define R_PCH_LP_PCR_PSF1_T1_SHDW_PCIE01_REG_BASE 0x2B00 ///< PCH-LP D28F0 PSF base address (PCIE PORT 01)
// PSF1 PCH-H Specific Base Address
#define R_PCH_H_PCR_PSF1_T0_SHDW_CSE_WLAN_REG_BASE 0x0200 ///< D22F7 PSF base address (CSME: WLAN)
#define R_PCH_H_PCR_PSF1_T0_SHDW_HECI3_REG_BASE 0x0300 ///< SPT-H D22F4 PSF base address (CSME: HECI3)
#define R_PCH_H_PCR_PSF1_T0_SHDW_HECI2_REG_BASE 0x0400 ///< SPT-H D22F1 PSF base address (CSME: HECI2)
#define R_PCH_H_PCR_PSF1_T0_SHDW_CSE_UMA_REG_BASE 0x0500 ///< D18F3 PSF base address (CSME: CSE UMA)
#define R_PCH_H_PCR_PSF1_T0_SHDW_HECI1_REG_BASE 0x0600 ///< SPT-H D22F0 PSF base address (CSME: HECI1)
#define R_PCH_H_PCR_PSF1_T0_SHDW_KT_REG_BASE 0x0700 ///< SPT-H D22F3 PSF base address (CSME: KT)
#define R_PCH_H_PCR_PSF1_T0_SHDW_IDER_REG_BASE 0x0800 ///< SPT-H D22F2 PSF base address (CSME: IDER)
#define R_PCH_H_PCR_PSF1_T0_SHDW_PMT_REG_BASE 0x0900 ///< D18F2 PSF base address (CSME: PMT)
#define R_PCH_H_PCR_PSF1_T0_SHDW_IEPMT_REG_BASE 0x0A00 ///< D16F5 PSF base address (CSME: IEPMT)
#define R_PCH_H_PCR_PSF1_T0_SHDW_SATA_REG_BASE 0x0B00 ///< D23F0 PSF base address (SATA)
#define R_PCH_H_PCR_PSF1_T0_SHDW_sSATA_REG_BASE 0x0C00 ///< D17F5 PSF base address (sSATA)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE20_REG_BASE 0x2000 ///< PCH-H D27F3 PSF base address (PCIE PORT 20)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE19_REG_BASE 0x2100 ///< PCH-H D27F2 PSF base address (PCIE PORT 19)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE18_REG_BASE 0x2200 ///< PCH-H D27F1 PSF base address (PCIE PORT 18)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE17_REG_BASE 0x2300 ///< PCH-H D27F0 PSF base address (PCIE PORT 17)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE16_REG_BASE 0x2400 ///< PCH-H D29F7 PSF base address (PCIE PORT 16)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE15_REG_BASE 0x2500 ///< PCH-H D29F6 PSF base address (PCIE PORT 15)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE14_REG_BASE 0x2600 ///< PCH-H D29F5 PSF base address (PCIE PORT 14)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE13_REG_BASE 0x2700 ///< PCH-H D29F4 PSF base address (PCIE PORT 13)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE12_REG_BASE 0x2800 ///< PCH-H D29F3 PSF base address (PCIE PORT 10)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE11_REG_BASE 0x2900 ///< PCH-H D29F2 PSF base address (PCIE PORT 11)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE10_REG_BASE 0x2A00 ///< PCH-H D29F1 PSF base address (PCIE PORT 10)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE09_REG_BASE 0x2B00 ///< PCH-H D29F0 PSF base address (PCIE PORT 09)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE08_REG_BASE 0x2C00 ///< PCH-H D28F7 PSF base address (PCIE PORT 08)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE07_REG_BASE 0x2D00 ///< PCH-H D28F6 PSF base address (PCIE PORT 07)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE06_REG_BASE 0x2E00 ///< PCH-H D28F5 PSF base address (PCIE PORT 06)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE05_REG_BASE 0x2F00 ///< PCH-H D28F4 PSF base address (PCIE PORT 05)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE04_REG_BASE 0x3000 ///< PCH-H D28F3 PSF base address (PCIE PORT 04)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE03_REG_BASE 0x3100 ///< PCH-H D28F2 PSF base address (PCIE PORT 03)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE02_REG_BASE 0x3200 ///< PCH-H D28F1 PSF base address (PCIE PORT 02)
#define R_PCH_H_PCR_PSF1_T1_SHDW_PCIE01_REG_BASE 0x3300 ///< PCH-H D28F0 PSF base address (PCIE PORT 01)
// Other PSF1 PCRs definition
#define R_PCH_H_PCR_PSF1_T0_SHDW_SATA_VS_CAP_VR_RS0_D23_F0_OFFSET16 0x1024
#define R_PCH_H_PCR_PSF1_T0_SHDW_SATA_MMIOPI_VR_RS0_D23_F0_OFFSET16 0x1030
#define R_PCH_H_PCR_PSF1_PSF_PORT_CONFIG_PG1_PORT7 0x4040 ///< PSF Port Configuration Register
#define R_PCH_LP_PCR_PSF1_PSF_PORT_CONFIG_PG1_PORT7 0x403C ///< PSF Port Configuration Register
#define R_PCH_LP_PCR_PSF1_PSF_MC_CONTROL_MCAST0_EOI 0x4050 ///< Multicast Control Register
#define R_PCH_LP_PCR_PSF1_PSF_MC_AGENT_MCAST0_TGT0_EOI 0x4060 ///< Destination ID
#define R_PCH_H_PCR_PSF1_PSF_MC_CONTROL_MCAST0_EOI 0x4054 ///< Multicast Control Register
#define R_PCH_H_PCR_PSF1_PSF_MC_AGENT_MCAST0_TGT0_EOI 0x406C ///< Destination ID
//PSF 1 Multicast Message Configuration
#define R_PCH_PCR_PSF1_RC_OWNER_RS0 0x4008 ///< Destination ID
#define B_PCH_PCR_PSF1_TARGET_CHANNELID 0xFF
#define B_PCH_PCR_PSF1_TARGET_PORTID 0x7F00
#define N_PCH_PCR_PSF1_TARGET_PORTID 8
#define B_PCH_PCR_PSF1_TARGET_PORTGROUPID BIT15
#define N_PCH_PCR_PSF1_TARGET_PORTGROUPID 15
#define B_PCH_PCR_PSF1_TARGET_PSFID 0xFF0000
#define N_PCH_PCR_PSF1_TARGET_PSFID 16
#define B_PCH_PCR_PSF1_TARGET_CHANMAP BIT31
#define V_PCH_PCR_PSF1_RC_OWNER_RS0_CHANNELID 0
#define V_PCH_PCR_PSF1_RC_OWNER_RS0_PORTID 10
#define V_PCH_PCR_PSF1_RC_OWNER_RS0_PORTGROUPID_DOWNSTREAM 1
#define V_PCH_PCR_PSF1_RC_OWNER_RS0_PSFID_PMT 0
#define V_PCH_PCR_PSF1_RC_OWNER_RS0_PSFID_PSF1 1
#define R_PCH_LP_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGT0_MCTP1 0x409C ///< Destination ID
#define R_PCH_H_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGT0_MCTP1 0x40D0 ///< Destination ID
#define R_PCH_H_PCR_PSF5_PSF_MC_AGENT_MCAST0_RS0_TGT0_MCTP0 0x404C ///< Destination ID
#define R_PCH_H_PCR_PSF6_PSF_MC_AGENT_MCAST0_RS0_TGT0_MCTP0 0x4050 ///< Destination ID
#define V_PCH_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGTX_MCTP1_PORTGROUPID_UPSTREAM 0
#define V_PCH_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGTX_MCTP1_PORTGROUPID_DOWNSTREAM 1
#define V_PCH_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGTX_MCTP1_PSFID_PSF1 1
#define R_PCH_H_PCR_PSF1_PSF_MC_CONTROL_MCAST1_RS0_MCTP1 0x4060 ///< Multicast Control Register
#define R_PCH_LP_PCR_PSF1_PSF_MC_CONTROL_MCAST1_RS0_MCTP1 0x4058 ///< Multicast Control Register
#define R_PCH_H_PCR_PSF5_PSF_MC_CONTROL_MCAST0_RS0_MCTP0 0x4040 ///< Multicast Control Register
#define R_PCH_H_PCR_PSF6_PSF_MC_CONTROL_MCAST0_RS0_MCTP0 0x4044 ///< Multicast Control Register
#define B_PCH_PCR_PSF1_PSF_MC_CONTROL_MCAST1_RS0_MCTP1_MULTCEN BIT0
#define B_PCH_PCR_PSF1_PSF_MC_CONTROL_MCAST1_RS0_MCTP1_NUMMC 0xFE
#define N_PCH_PCR_PSF1_PSF_MC_CONTROL_MCAST1_RS0_MCTP1_NUMMC 1
#define V_PCH_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGTX_MCTP1_CHANNELID_DMI 0
#define V_PCH_PCR_PSF1_PSF_MC_AGENT_MCAST1_RS0_TGTX_MCTP1_PORTID_DMI 0
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_VR_RS0_D23_F0 0x4240 ///< VR
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_PMT_RS0_D18_F2 0x4248 ///< PMT
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_PTIO_RS0_D22_F2 0x424C ///< PTIO
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_PTIO_RS0_D22_F3 0x4250 ///< PTIO
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D22_F0 0x4254 ///< CSE
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D18_F3 0x4258 ///< CSE
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D22_F1 0x425C ///< CSE
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D22_F4 0x4260 ///< CSE
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D22_F7 0x4264 ///< CSE
#define R_PCH_PCR_PSF1_T0_AGENT_FUNCTION_CONFIG_CSE_RS0_D18_F4 0x4268 ///< CSE
#define B_PCH_PCR_PSFX_TX_AGENT_FUNCTION_CONFIG_IFR BIT0 ///< IFR
#define R_PCH_PCR_PSF1_RS_IFR 0x42C0 ///< This register can be used to reset all functions in a particular Root Space simultaneously
//
// controls the PCI configuration header of a PCI function
//
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F0 0x4198 ///< SPA
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F1 0x419C ///< SPA
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F2 0x41A0 ///< SPA
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F3 0x41A4 ///< SPA
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F4 0x41A8 ///< SPB
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F5 0x41AC ///< SPB
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F6 0x41B0 ///< SPB
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F7 0x41B4 ///< SPB
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F0 0x41B8 ///< SPC
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F1 0x41BC ///< SPC
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F2 0x41C0 ///< SPC
#define R_PCH_LP_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F3 0x41C4 ///< SPC
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F0 0x426C ///< SPA
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F1 0x4270 ///< SPA
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F2 0x4274 ///< SPA
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPA_D28_F3 0x4278 ///< SPA
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F4 0x427C ///< SPB
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F5 0x4280 ///< SPB
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F6 0x4284 ///< SPB
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPB_D28_F7 0x4288 ///< SPB
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F0 0x428C ///< SPC
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F1 0x4290 ///< SPC
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F2 0x4294 ///< SPC
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPC_D29_F3 0x4298 ///< SPC
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPD_D29_F4 0x429C ///< SPD
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPD_D29_F5 0x42A0 ///< SPD
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPD_D29_F6 0x42A4 ///< SPD
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPD_D29_F7 0x42A8 ///< SPD
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPE_D27_F0 0x42AC ///< SPE
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPE_D27_F1 0x42B0 ///< SPE
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPE_D27_F2 0x42B4 ///< SPE
#define R_PCH_H_PCR_PSF1_T1_AGENT_FUNCTION_CONFIG_SPE_D27_F3 0x42B8 ///< SPE
//
// PSF1 grant count registers
//
#define R_PCH_LP_PSF1_DEV_GNTCNT_RELOAD_DGCR0 0x41CC
#define R_PCH_LP_PSF1_TARGET_GNTCNT_RELOAD_PG1_TGT0 0x45D0
#define R_PCH_H_PSF1_DEV_GNTCNT_RELOAD_DGCR0 0x42C0
#define R_PCH_H_PSF1_TARGET_GNTCNT_RELOAD_PG1_TGT0 0x47AC
//
// PSF2 PCRs (PID:PSF2)
//
#define R_PCH_PCR_PSF2_T0_SHDW_TRH_REG_BASE 0x0100 ///< D20F2 PSF base address (Thermal). // LP&H
// PSF2 PCH-LP Specific Base Address
#define R_PCH_LP_PCR_PSF2_T0_SHDW_UFS_REG_BASE 0x0200 ///< D30F7 PSF base address (SCC: UFS)
#define R_PCH_LP_PCR_PSF2_T0_SHDW_SDCARD_REG_BASE 0x0300 ///< D30F6 PSF base address (SCC: SDCard)
#define R_PCH_LP_PCR_PSF2_T0_SHDW_SDIO_REG_BASE 0x0400 ///< D30F5 PSF base address (SCC: SDIO)
#define R_PCH_LP_PCR_PSF2_T0_SHDW_EMMC_REG_BASE 0x0500 ///< D30F4 PSF base address (SCC: eMMC)
#define R_PCH_LP_PCR_PSF2_T0_SHDW_OTG_REG_BASE 0x0600 ///< D20F1 PSF base address (USB device controller: OTG)
#define R_PCH_LP_PCR_PSF2_T0_SHDW_XHCI_REG_BASE 0x0700 ///< D20F0 PSF base address (XHCI)
// PSF2 PCH-H Specific Base Address
#define R_PCH_H_PCR_PSF2_T0_SHDW_OTG_REG_BASE 0x0200 ///< D20F1 PSF base address (USB device controller: OTG)
#define R_PCH_H_PCR_PSF2_T0_SHDW_XHCI_REG_BASE 0x0300 ///< D20F0 PSF base address (XHCI)
//
// PSF3 PCRs (PID:PSF3)
//
#define R_PCH_PCR_PSF3_T0_SHDW_HECI3_REG_BASE 0x0100 ///< D16F4 PSF base address (IE: HECI3)
#define R_PCH_PCR_PSF3_T0_SHDW_HECI2_REG_BASE 0x0200 ///< D16F1 PSF base address (IE: HECI2)
#define R_PCH_PCR_PSF3_T0_SHDW_HECI1_REG_BASE 0x0400 ///< D16F0 PSF base address (IE: HECI1)
#define R_PCH_PCR_PSF3_T0_SHDW_KT_REG_BASE 0x0500 ///< D16F3 PSF base address (IE: KT)
#define R_PCH_PCR_PSF3_T0_SHDW_IDER_REG_BASE 0x0600 ///< D16F2 PSF base address (IE: IDER)
#define R_PCH_PCR_PSF3_T0_SHDW_P2SB_REG_BASE 0x0700 ///< D31F1 PSF base address (P2SB)
#define R_PCH_PCR_PSF3_T0_SHDW_TRACE_HUB_ACPI_REG_BASE 0x0800 ///< D20F4 PSF base address (TraceHub ACPI)
#define R_PCH_PCR_PSF3_T0_SHDW_TRACE_HUB_REG_BASE 0x0900 ///< D31F7 PSF base address (TraceHub PCI)
#define R_PCH_PCR_PSF3_T0_SHDW_LPC_REG_BASE 0x0A00 ///< D31F0 PSF base address (LPC)
#define R_PCH_PCR_PSF3_T0_SHDW_SMBUS_REG_BASE 0x0B00 ///< D31F4 PSF base address (SMBUS)
#define R_PCH_PCR_PSF3_T0_SHDW_PMC_REG_BASE 0x0E00 ///< D31F2 PSF base address (PMC)
#define R_PCH_PCR_PSF3_T0_SHDW_SPI_SPI_REG_BASE 0x1300 ///< D31F5 PSF base address (SPI SPI)
#define R_PCH_H_PCR_PSF3_T0_SHDW_GBE_REG_BASE 0x1600 ///< D31F6 PSF base address (GBE)
#define R_PCH_PCR_PSF3_T0_SHDW_AUD_REG_BASE 0x1800 ///< D31F3 PSF base address (HDA, ADSP)
#define R_PCH_PCR_PSF3_T0_SHDW_AUD_PCIEN 0x181C ///< D31F3 PCI Configuration space enable bits (HDA, ADSP)
#define R_PCH_PCR_PSF3_T0_SHDW_MROM1_REG_BASE 0x1A00 ///< D17F1 PSF base address (MROM1)
#define B_PCH_PCR_PSF3_T0_SHDW_AUD_PCIEN_FUNDIS BIT8 ///< D31F3 Function Disable
#define R_PCH_PSF3_T0_SHDW_AUD_RS1_D24_F0_BASE 0x1700 ///< RS1D24F0 PSF base address (HDA)
#define R_PCH_PCR_PSF3_T0_AGENT_FUNCTION_CONFIG_GBE_RS0_D31_F6 0x40F8 ///< GBE
#define R_PCH_PCR_PSF3_PSF_MC_CONTROL_MCAST0_EOI 0x4058 ///< Multicast Control Register
#define R_PCH_PCR_PSF3_PSF_MC_AGENT_MCAST0_TGT0_EOI 0x4064 ///< Destination ID
#endif
| 15,011 |
1,269 | <reponame>chiclaim/kotlin-study
package lambda;
/**
* desc:
* <p>
* Created by Chiclaim on 2018/12/31
*/
public class FunctionalInterface {
public static void main(String[]args){
Button button = new Button();
button.setOnClickListener(new Button.OnClickListener() {
@Override
public void click() {
System.out.println("click 1");
}
});
button.setOnClickListener(new Button.OnClickListener() {
@Override
public void click() {
System.out.println("click 2");
}
});
}
}
| 288 |
323 | <filename>vnpy/api/xtp/generator/xtp_td_source_on.cpp
void onDisconnected(int extra, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onDisconnected, extra, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onError(const dict &error) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onError, error);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onOrderEvent(const dict &data, const dict &error, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onOrderEvent, data, error, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onTradeEvent(const dict &data, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onTradeEvent, data, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onCancelOrderError(const dict &data, const dict &error, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onCancelOrderError, data, error, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryOrder(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryOrder, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryTrade(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryTrade, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryPosition(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryPosition, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryAsset(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryAsset, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryStructuredFund(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryStructuredFund, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryFundTransfer(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryFundTransfer, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onFundTransfer(const dict &data, const dict &error, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onFundTransfer, data, error, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryETF(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryETF, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryETFBasket(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryETFBasket, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryIPOInfoList(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryIPOInfoList, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryIPOQuotaInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryIPOQuotaInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryOptionAuctionInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryOptionAuctionInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onCreditCashRepay(const dict &data, const dict &error, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onCreditCashRepay, data, error, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditCashRepayInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditCashRepayInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditFundInfo(const dict &data, const dict &error, int reqid, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditFundInfo, data, error, reqid, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditDebtInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditDebtInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditTickerDebtInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditTickerDebtInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditAssetDebtInfo(const dict &data, const dict &error, int reqid, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditAssetDebtInfo, data, error, reqid, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditTickerAssignInfo(const dict &data, const dict &error, int reqid, bool last, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditTickerAssignInfo, data, error, reqid, last, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
void onQueryCreditExcessStock(const dict &data, const dict &error, int reqid, int extra) override
{
try
{
PYBIND11_OVERLOAD(void, TdApi, onQueryCreditExcessStock, data, error, reqid, extra);
}
catch (const error_already_set &e)
{
cout << e.what() << endl;
}
};
| 2,711 |
3,269 | <filename>C++/minimum-number-of-removals-to-make-mountain-array.cpp<gh_stars>1000+
// Time: O(nlogn)
// Space: O(n)
class Solution {
public:
int minimumMountainRemovals(vector<int>& nums) {
vector<int> left_lis_len(size(nums));
vector<int> lis;
for (int i = 0; i + 1 < size(nums); ++i) {
auto it = lower_bound(begin(lis), end(lis), nums[i]);
left_lis_len[i] = distance(begin(lis), it);
if (it == end(lis)) {
lis.emplace_back(nums[i]);
} else {
*it = nums[i];
}
}
lis.clear();
int max_len = 0;
for (int i = size(nums) - 1; i > 0; --i) {
auto it = lower_bound(begin(lis), end(lis), nums[i]);
max_len = max(max_len, left_lis_len[i] + int(distance(begin(lis), it)));
if (it == end(lis)) {
lis.emplace_back(nums[i]);
} else {
*it = nums[i];
}
}
return size(nums) - (1 + max_len);
}
};
| 590 |
521 | #ifndef FOO
#error FOO is not defined
#endif
#define XSTR(x) STR(x)
#define STR(x) #x
#pragma message "The value of __TIME__: " XSTR(__TIME__)
#define STATIC_ASSERT( condition, name )\
typedef char assert_failed_ ## name [ (condition) ? 1 : -1 ];
void foo() {
STATIC_ASSERT(__TIME__ == "redacted", time_must_be_redacted);
}
// Should return "redacted"
const char *getBuildTime(void) {
return __TIME__;
}
| 163 |
560 | <filename>app/src/main/java/me/zhanghai/android/douya/util/GsonHelper.java<gh_stars>100-1000
/*
* Copyright (c) 2015 <NAME> <<EMAIL>>
* All Rights Reserved.
*/
package me.zhanghai.android.douya.util;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import java.lang.reflect.Type;
import me.zhanghai.android.douya.network.api.info.frodo.TimelineItem;
import me.zhanghai.android.douya.network.api.info.frodo.Broadcast;
import me.zhanghai.android.douya.network.api.info.frodo.CollectableItem;
import me.zhanghai.android.douya.network.api.info.frodo.CompleteCollectableItem;
import me.zhanghai.android.douya.network.api.info.frodo.Notification;
public class GsonHelper {
public static final Gson GSON;
public static final Gson GSON_NETWORK;
static {
GsonBuilder builder = new GsonBuilder()
.serializeNulls()
.registerTypeAdapter(int.class, new IntegerDeserializer())
.registerTypeAdapter(Integer.class, new IntegerDeserializer())
.registerTypeAdapter(long.class, new LongDeserializer())
.registerTypeAdapter(Long.class, new LongDeserializer())
.registerTypeAdapter(float.class, new FloatDeserializer())
.registerTypeAdapter(Float.class, new FloatDeserializer())
.registerTypeAdapter(double.class, new DoubleDeserializer())
.registerTypeAdapter(Double.class, new DoubleDeserializer())
.registerTypeAdapter(CollectableItem.class, new CollectableItem.Deserializer())
.registerTypeAdapter(CompleteCollectableItem.class,
new CompleteCollectableItem.Deserializer());
GSON = builder.create();
builder
.registerTypeAdapter(Notification.class, new Notification.Deserializer())
.registerTypeAdapter(Broadcast.class, new Broadcast.Deserializer());
GSON_NETWORK = builder.create();
}
private GsonHelper() {}
private static class IntegerDeserializer implements JsonDeserializer<Integer> {
@Override
public Integer deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context) throws JsonParseException {
if (json.isJsonNull()) {
return null;
} else if (json.isJsonPrimitive()) {
JsonPrimitive jsonPrimitive = (JsonPrimitive) json;
if (jsonPrimitive.isString() && jsonPrimitive.getAsString().isEmpty()) {
return null;
}
}
return json.getAsInt();
}
}
private static class LongDeserializer implements JsonDeserializer<Long> {
@Override
public Long deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context) throws JsonParseException {
if (json.isJsonNull()) {
return null;
} else if (json.isJsonPrimitive()) {
JsonPrimitive jsonPrimitive = (JsonPrimitive) json;
if (jsonPrimitive.isString() && jsonPrimitive.getAsString().isEmpty()) {
return null;
}
}
return json.getAsLong();
}
}
private static class FloatDeserializer implements JsonDeserializer<Float> {
@Override
public Float deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context) throws JsonParseException {
if (json.isJsonNull()) {
return null;
} else if (json.isJsonPrimitive()) {
JsonPrimitive jsonPrimitive = (JsonPrimitive) json;
if (jsonPrimitive.isString() && jsonPrimitive.getAsString().isEmpty()) {
return null;
}
}
return json.getAsFloat();
}
}
private static class DoubleDeserializer implements JsonDeserializer<Double> {
@Override
public Double deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context) throws JsonParseException {
if (json.isJsonNull()) {
return null;
} else if (json.isJsonPrimitive()) {
JsonPrimitive jsonPrimitive = (JsonPrimitive) json;
if (jsonPrimitive.isString() && jsonPrimitive.getAsString().isEmpty()) {
return null;
}
}
return json.getAsDouble();
}
}
}
| 2,182 |
473 | /*
Copyright (c) 2009-2016, <NAME>
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include <El.hpp>
// NOTE: This definition is nearly identical to StandardProxy but is
// meant to demonstrate how to manually build and use a pivot proxy
template<typename Field>
class Proxy
{
private:
El::Int numPower_, numOversample_;
public:
Proxy( El::Int numPower=1, El::Int numOversample=10 )
: numPower_(numPower), numOversample_(numOversample)
{ }
void operator()
( const El::Matrix<Field>& A,
El::Permutation& Omega,
El::Int numPivots,
bool smallestFirst=false ) const
{
const El::Int m = A.Height();
// Generate a Gaussian random matrix
El::Matrix<Field> G;
El::Gaussian( G, numPivots+numOversample_, m );
// Form G (A A^H)^q A = G A (A^H A)^2
El::Matrix<Field> Y, Z;
El::Gemm( El::NORMAL, El::NORMAL, Field(1), G, A, Y );
for( El::Int powerIter=0; powerIter<numPower_; ++powerIter )
{
El::Gemm( El::NORMAL, El::ADJOINT, Field(1), Y, A, Z );
El::Gemm( El::NORMAL, El::NORMAL, Field(1), Z, A, Y );
}
El::QRCtrl<El::Base<Field>> ctrl;
ctrl.boundRank = true;
ctrl.maxRank = numPivots;
ctrl.smallestFirst = smallestFirst;
El::Matrix<Field> householderScalars;
El::Matrix<El::Base<Field>> signature;
El::QR( Y, householderScalars, signature, Omega, ctrl );
}
void operator()
( const El::AbstractDistMatrix<Field>& APre,
El::DistPermutation& Omega,
El::Int numPivots,
bool smallestFirst=false ) const
{
const El::Int m = APre.Height();
const El::Grid& grid = APre.Grid();
El::DistMatrixReadProxy<Field,Field,El::MC,El::MR> AProxy( APre );
auto& A = AProxy.GetLocked();
// Generate a Gaussian random matrix
El::DistMatrix<Field> G(grid);
El::Gaussian( G, numPivots+numOversample_, m );
// Form G (A A^H)^q A = G A (A^H A)^2
El::DistMatrix<Field> Y(grid), Z(grid);
El::Gemm( El::NORMAL, El::NORMAL, Field(1), G, A, Y );
for( El::Int powerIter=0; powerIter<numPower_; ++powerIter )
{
El::Gemm( El::NORMAL, El::ADJOINT, Field(1), Y, A, Z );
El::Gemm( El::NORMAL, El::NORMAL, Field(1), Z, A, Y );
}
El::QRCtrl<El::Base<Field>> ctrl;
ctrl.boundRank = true;
ctrl.maxRank = numPivots;
ctrl.smallestFirst = smallestFirst;
El::DistMatrix<Field,El::MD,El::STAR> householderScalars(grid);
El::DistMatrix<El::Base<Field>,El::MD,El::STAR> signature(grid);
El::QR( Y, householderScalars, signature, Omega, ctrl );
}
};
int main( int argc, char* argv[] )
{
El::Environment env( argc, argv );
El::mpi::Comm comm = El::mpi::COMM_WORLD;
const int commRank = El::mpi::Rank(comm);
try
{
const El::Int n = El::Input("--n","matrix size",1000);
const El::Int nb = El::Input("--nb","blocksize",64);
//const double phi = El::Input("--phi","Kahan parameter",0.5);
const bool panelPiv = El::Input("--panelPiv","panel pivoting?",false);
const El::Int oversample =
El::Input("--oversample","oversample factor",10);
const El::Int numPower =
El::Input("--numPower","# of power iterations",1);
const bool smallestFirst =
El::Input("--smallestFirst","smallest norms first?",false);
const bool print = El::Input("--print","print matrices?",false);
El::ProcessInput();
El::PrintInputReport();
El::SetBlocksize( nb );
const El::Grid grid(comm);
El::DistMatrix<double> A(grid);
//El::Kahan( A, n, phi );
El::Uniform( A, n, n );
auto ACopy = A;
if( print )
El::Print( A, "A" );
El::Timer timer;
if( commRank == 0 )
timer.Start();
El::DistMatrix<double> householderScalars(grid), signature(grid);
El::DistPermutation Omega(grid);
Proxy<double> prox(numPower,oversample);
El::qr::ProxyHouseholder
( A, householderScalars, signature, Omega, prox, panelPiv,
smallestFirst );
if( commRank == 0 )
El::Output("Proxy QR time: ",timer.Stop()," seconds");
if( print )
{
El::Print( A, "QR" );
El::Print( householderScalars, "householderScalars" );
El::Print( signature, "signature" );
El::DistMatrix<El::Int> OmegaFull(grid);
Omega.ExplicitMatrix( OmegaFull );
El::Print( OmegaFull, "Omega" );
}
El::DistMatrix<double> diagR(grid);
El::GetDiagonal( A, diagR );
El::Print( diagR, "diag(R)" );
A = ACopy;
if( commRank == 0 )
timer.Start();
El::QRCtrl<double> ctrl;
ctrl.smallestFirst = smallestFirst;
El::QR( A, householderScalars, signature, Omega, ctrl );
if( commRank == 0 )
El::Output("Businger-Golub time: ",timer.Stop()," seconds");
if( print )
{
El::Print( A, "QR" );
El::Print( householderScalars, "householderScalars" );
El::Print( signature, "signature" );
El::DistMatrix<El::Int> OmegaFull;
Omega.ExplicitMatrix( OmegaFull );
El::Print( OmegaFull, "Omega" );
}
El::GetDiagonal( A, diagR );
El::Print( diagR, "diag(R)" );
A = ACopy;
if( commRank == 0 )
timer.Start();
El::QR( A, householderScalars, signature );
if( commRank == 0 )
El::Output("Standard QR time: ",timer.Stop()," seconds");
if( print )
{
El::Print( A, "QR" );
El::Print( householderScalars, "householderScalars" );
El::Print( signature, "signature" );
}
El::GetDiagonal( A, diagR );
El::Print( diagR, "diag(R)" );
}
catch( std::exception& e ) { El::ReportException(e); }
return 0;
}
| 2,989 |
2,023 | <reponame>tdiprima/code
#!/usr/bin/env python
# win32shutdown.py
import win32api
import win32con
import win32netcon
import win32security
import win32wnet
def shutdown(host=None, user=None, passwrd=None, msg=None, timeout=0, force=1,
reboot=0):
""" Shuts down a remote computer, requires NT-BASED OS. """
# Create an initial connection if a username & password is given.
connected = 0
if user and passwrd:
try:
win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_ANY, None,
''.join([r'\\', host]), None, user,
passwrd)
# Don't fail on error, it might just work without the connection.
except:
pass
else:
connected = 1
# We need the remote shutdown or shutdown privileges.
p1 = win32security.LookupPrivilegeValue(host, win32con.SE_SHUTDOWN_NAME)
p2 = win32security.LookupPrivilegeValue(host,
win32con.SE_REMOTE_SHUTDOWN_NAME)
newstate = [(p1, win32con.SE_PRIVILEGE_ENABLED),
(p2, win32con.SE_PRIVILEGE_ENABLED)]
# Grab the token and adjust its privileges.
htoken = win32security.OpenProcessToken(win32api.GetCurrentProcess(),
win32con.TOKEN_ALL_ACCESS)
win32security.AdjustTokenPrivileges(htoken, False, newstate)
win32api.InitiateSystemShutdown(host, msg, timeout, force, reboot)
# Release the previous connection.
if connected:
win32wnet.WNetCancelConnection2(''.join([r'\\', host]), 0, 0)
if __name__ == '__main__':
# Immediate shutdown.
shutdown('salespc1', 'admin', 'secret', None, 0)
# Delayed shutdown 30 secs.
shutdown('salespc1', 'admin', 'secret', 'Maintenance Shutdown', 30)
# Reboot
shutdown('salespc1', 'admin', 'secret', None, 0, reboot=1)
# Shutdown the local pc
shutdown(None, 'admin', 'secret', None, 0)
| 893 |
1,847 | <reponame>tufeigunchu/orbit<gh_stars>1000+
// Copyright (c) 2021 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_GL_ACCESSIBLE_TRIANGLE_TOGGLE_H_
#define ORBIT_GL_ACCESSIBLE_TRIANGLE_TOGGLE_H_
#include "AccessibleCaptureViewElement.h"
#include "CaptureViewElement.h"
#include "Track.h"
class TriangleToggle;
namespace orbit_gl {
/*
* Accessibility implementation for (a track's) triangle toggle. The `TriangleToggle` is a visible
* child of the track. It will be thus on the same level as the virtual elements for the tab and the
* content (see `AccessibleTrack`).
*/
class AccessibleTriangleToggle : public AccessibleCaptureViewElement {
public:
explicit AccessibleTriangleToggle(TriangleToggle* triangle_toggle);
[[nodiscard]] int AccessibleChildCount() const override { return 0; };
[[nodiscard]] const AccessibleInterface* AccessibleChild(int /*index*/) const override {
return nullptr;
}
[[nodiscard]] std::string AccessibleName() const override { return "TriangleToggle"; }
[[nodiscard]] orbit_accessibility::AccessibilityRole AccessibleRole() const override {
return orbit_accessibility::AccessibilityRole::Button;
}
[[nodiscard]] orbit_accessibility::AccessibilityState AccessibleState() const override;
private:
TriangleToggle* triangle_toggle_;
};
} // namespace orbit_gl
#endif // ORBIT_GL_ACCESSIBLE_TRIANGLE_TOGGLE_H_
| 463 |
1,457 | <gh_stars>1000+
package org.kairosdb.core.http.rest;
import ch.qos.logback.classic.Level;
import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Resources;
import com.google.gson.GsonBuilder;
import org.junit.Before;
import org.junit.Test;
import org.kairosdb.core.KairosFeatureProcessor;
import org.kairosdb.core.aggregator.TestAggregatorFactory;
import org.kairosdb.core.datastore.KairosDatastore;
import org.kairosdb.core.exception.KairosDBException;
import org.kairosdb.core.groupby.TestGroupByFactory;
import org.kairosdb.core.http.rest.json.ErrorResponse;
import org.kairosdb.core.http.rest.json.QueryParser;
import org.kairosdb.core.http.rest.json.RollupResponse;
import org.kairosdb.core.http.rest.json.TestQueryPluginFactory;
import org.kairosdb.rollup.RollUpException;
import org.kairosdb.rollup.RollUpTasksStore;
import org.kairosdb.rollup.RollupTask;
import org.kairosdb.rollup.RollupTaskStatusStore;
import org.kairosdb.util.LoggingUtils;
import org.mockito.ArgumentCaptor;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static javax.ws.rs.core.Response.Status.*;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
public class RollUpResourceTest
{
private static final String BEAN_VALIDATION_ERROR = "bean validation error";
private static final String CONTEXT = "context";
private static final String INTERNAL_EXCEPTION_MESSAGE = "Internal Exception";
private RollUpResource resource;
private RollUpTasksStore mockStore;
private RollupTaskStatusStore mockStatusStore;
private QueryParser mockQueryParser;
private QueryParser queryParser;
private KairosDatastore mockDatastore;
@Before
public void setup() throws KairosDBException
{
mockDatastore = mock(KairosDatastore.class);
mockStore = mock(RollUpTasksStore.class);
mockQueryParser = mock(QueryParser.class);
mockStatusStore = mock(RollupTaskStatusStore.class);
queryParser = new QueryParser(new KairosFeatureProcessor(new TestAggregatorFactory(), new TestGroupByFactory()),
new TestQueryPluginFactory());
resource = new RollUpResource(mockQueryParser, mockStore, mockStatusStore, mockDatastore);
}
@Test(expected = NullPointerException.class)
public void testCreate_nullJsonInvalid()
{
resource.create(null);
}
@Test(expected = IllegalArgumentException.class)
public void testCreate_emptyJsonInvalid()
{
resource.create("");
}
@Test
public void testCreate_parseError() throws IOException, QueryException
{
when(mockQueryParser.parseRollupTask(anyString())).thenThrow(createBeanException());
Response response = resource.create("thejson");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(BAD_REQUEST.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(getBeanValidationMessage()));
}
@Test
public void testCreate_internalError() throws IOException, QueryException
{
Level previousLogLevel = LoggingUtils.setLogLevel(Level.OFF);
try
{
when(mockQueryParser.parseRollupTask(anyString())).thenThrow(createQueryException());
Response response = resource.create("thejson");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(INTERNAL_SERVER_ERROR.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(INTERNAL_EXCEPTION_MESSAGE));
}
finally
{
LoggingUtils.setLogLevel(previousLogLevel);
}
}
@Test
public void testCreate() throws IOException, QueryException
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
String json = Resources.toString(Resources.getResource("rolluptask1.json"), Charsets.UTF_8);
RollupTask task = queryParser.parseRollupTask(json);
Response response = resource.create(json);
assertThat(response.getStatus(), equalTo(OK.getStatusCode()));
assertRollupResponse((String) response.getEntity(), task);
}
@Test
public void testList() throws IOException, QueryException, RollUpException
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
List<RollupTask> tasks = mockTasks(Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8));
Response response = resource.list();
List<RollupTask> responseTasks = queryParser.parseRollupTasks((String) response.getEntity());
assertThat(response.getStatus(), equalTo(OK.getStatusCode()));
assertThat(responseTasks, containsInAnyOrder(tasks.toArray()));
}
@Test
public void testList_internalError() throws RollUpException
{
Level previousLogLevel = LoggingUtils.setLogLevel(Level.OFF);
try
{
when(mockStore.read()).thenThrow(createRollupException());
Response response = resource.list();
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(INTERNAL_SERVER_ERROR.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(INTERNAL_EXCEPTION_MESSAGE));
}
finally
{
LoggingUtils.setLogLevel(previousLogLevel);
}
}
@Test(expected = NullPointerException.class)
public void testGet_nullIdInvalid()
{
resource.get(null);
}
@Test(expected = IllegalArgumentException.class)
public void testGet_emptyIdInvalid()
{
resource.get("");
}
@Test
public void testGet() throws IOException, QueryException, RollUpException
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
String json = Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8);
List<RollupTask> tasks = mockTasks(json);
Response response = resource.get(tasks.get(1).getId());
RollupTask responseTask = queryParser.parseRollupTask((String) response.getEntity());
assertThat(response.getStatus(), equalTo(OK.getStatusCode()));
assertThat(responseTask, equalTo(tasks.get(1)));
}
@Test
public void testGet_taskDoesNotExist() throws IOException, QueryException, RollUpException
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
String json = Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8);
mockTasks(json);
Response response = resource.get("bogus");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(NOT_FOUND.getStatusCode()));
assertThat(errorResponse.getErrors().get(0), equalTo("Resource not found for id bogus"));
}
@Test
public void testGet_internalError() throws RollUpException
{
Level previousLogLevel = LoggingUtils.setLogLevel(Level.OFF);
try
{
when(mockStore.read(anyString())).thenThrow(createRollupException());
Response response = resource.get("1");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(INTERNAL_SERVER_ERROR.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(INTERNAL_EXCEPTION_MESSAGE));
}
finally
{
LoggingUtils.setLogLevel(previousLogLevel);
}
}
@Test(expected = NullPointerException.class)
public void testDelete_nullIdInvalid()
{
resource.delete(null);
}
@Test(expected = IllegalArgumentException.class)
public void testDelete_emptyIdInvalid()
{
resource.delete("");
}
@Test
public void testDelete() throws IOException, QueryException, RollUpException
{
String json = Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8);
List<RollupTask> tasks = mockTasks(json);
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
Response response = resource.delete(tasks.get(0).getId());
assertThat(response.getStatus(), equalTo(NO_CONTENT.getStatusCode()));
assertNull(response.getEntity());
}
@Test
public void testDelete_internalError() throws IOException, QueryException, RollUpException
{
Level previousLogLevel = LoggingUtils.setLogLevel(Level.OFF);
try
{
String json = Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8);
List<RollupTask> tasks = mockTasks(json);
doThrow(createRollupException()).when(mockStore).remove(anyString());
Response response = resource.delete(tasks.get(0).getId());
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(INTERNAL_SERVER_ERROR.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(INTERNAL_EXCEPTION_MESSAGE));
}
finally
{
LoggingUtils.setLogLevel(previousLogLevel);
}
}
@Test
public void testDelete_resourceNotExists() throws RollUpException
{
when(mockStore.read()).thenReturn(ImmutableMap.of());
Response response = resource.delete("1");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(NOT_FOUND.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo("Resource not found for id 1"));
}
@Test(expected = NullPointerException.class)
public void testUpdate_nullIdInvalid()
{
resource.update(null, "json");
}
@Test(expected = IllegalArgumentException.class)
public void testUpdate_emptyIdInvalid()
{
resource.update("", "json");
}
@Test(expected = NullPointerException.class)
public void testUpdate_nullJsonInvalid()
{
resource.update("id", null);
}
@Test(expected = IllegalArgumentException.class)
public void testUpdate_emptyJsonInvalid()
{
resource.update("id", "");
}
@Test
public void testUpdate() throws IOException, QueryException, RollUpException
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
String json = Resources.toString(Resources.getResource("rolluptasksExisting.json"), Charsets.UTF_8);
List<RollupTask> tasks = mockTasks(json);
// Replace task 1 with task 2
Response response = resource.update(tasks.get(0).getId(), tasks.get(1).getJson());
@SuppressWarnings("unchecked")
Class<ArrayList<RollupTask>> listClass = (Class<ArrayList<RollupTask>>) (Class) ArrayList.class;
ArgumentCaptor<ArrayList<RollupTask>> captor = ArgumentCaptor.forClass(listClass);
verify(mockStore, times(1)).write(captor.capture());
List<RollupTask> modifiedTasks = captor.getValue();
assertThat(response.getStatus(), equalTo(OK.getStatusCode()));
assertThat(modifiedTasks.size(), equalTo(1));
RollupTask modifiedTask = modifiedTasks.get(0);
assertThat(modifiedTask.getId(), equalTo(tasks.get(0).getId()));
assertThat(modifiedTask.getName(), equalTo(tasks.get(1).getName()));
assertThat(response.getStatus(), equalTo(200));
assertRollupResponse((String)response.getEntity(), modifiedTasks.get(0));
// since the id is stored in the json, verify that the id has not changed
assertThat(new GsonBuilder().create().fromJson(modifiedTask.getJson(), RollupTask.class).getId(), equalTo(tasks.get(0).getId()));
}
@Test
@SuppressWarnings("unchecked")
public void testUpdate_internalError() throws IOException, QueryException, RollUpException
{
Level previousLogLevel = LoggingUtils.setLogLevel(Level.OFF);
try
{
resource = new RollUpResource(queryParser, mockStore, mockStatusStore, mockDatastore);
String json = Resources.toString(Resources.getResource("rolluptasks.json"), Charsets.UTF_8);
List<RollupTask> tasks = mockTasks(json);
//noinspection unchecked
doThrow(createRollupException()).when(mockStore).write(any());
Response response = resource.update(tasks.get(0).getId(), tasks.get(0).getJson());
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(INTERNAL_SERVER_ERROR.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo(INTERNAL_EXCEPTION_MESSAGE));
}
finally{
LoggingUtils.setLogLevel(previousLogLevel);
}
}
@Test
public void testUpdate_resourceNotExists() throws RollUpException
{
when(mockStore.read()).thenReturn(ImmutableMap.of());
Response response = resource.update("1", "json");
ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
assertThat(response.getStatus(), equalTo(NOT_FOUND.getStatusCode()));
assertThat(errorResponse.getErrors().size(), equalTo(1));
assertThat(errorResponse.getErrors().get(0), equalTo("Resource not found for id 1"));
}
private String getBeanValidationMessage()
{
return CONTEXT + " " + BEAN_VALIDATION_ERROR;
}
private BeanValidationException createBeanException()
{
return new BeanValidationException(new QueryParser.SimpleConstraintViolation(CONTEXT, BEAN_VALIDATION_ERROR), "");
}
private Exception createQueryException()
{
return new QueryException(INTERNAL_EXCEPTION_MESSAGE);
}
private Exception createRollupException()
{
return new RollUpException(INTERNAL_EXCEPTION_MESSAGE);
}
private void assertRollupResponse(String expected, RollupTask actual)
{
RollupResponse rollupResponse = new GsonBuilder().create().fromJson(expected, RollupResponse.class);
assertThat(rollupResponse.getId(), not(isEmptyOrNullString()));
assertThat(rollupResponse.getName(), equalTo(actual.getName()));
assertThat(rollupResponse.getAttributes().get("url"), equalTo(RollUpResource.RESOURCE_URL + rollupResponse.getId()));
}
private List<RollupTask> mockTasks(String json)
throws BeanValidationException, QueryException, RollUpException
{
List<RollupTask> tasks = queryParser.parseRollupTasks(json);
Map<String, RollupTask> taskMap = new HashMap<>();
for (RollupTask task : tasks) {
taskMap.put(task.getId(), task);
}
when(mockStore.read()).thenReturn(taskMap);
for (RollupTask task : tasks) {
when(mockStore.read(task.getId())).thenReturn(task);
}
return tasks;
}
} | 4,849 |
1,821 | <filename>util-validator/src/main/java/com/twitter/util/validation/constraints/UUID.java
package com.twitter.util.validation.constraints;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.twitter.util.validation.constraints.UUID.List;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Documented
@Constraint(validatedBy = {})
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Repeatable(List.class)
public @interface UUID {
/** Every constraint annotation must define a message element of type String. */
String message() default "{com.twitter.util.validation.constraints.UUID.message}";
/**
* Every constraint annotation must define a groups element that specifies the processing groups
* with which the constraint declaration is associated.
*/
Class<?>[] groups() default {};
/**
* Constraint annotations must define a payload element that specifies the payload with which
* the constraint declaration is associated. *
*/
Class<? extends Payload>[] payload() default {};
/**
* Defines several {@code @UUID} annotations on the same element.
*/
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Documented
public @interface List {
UUID[] value();
}
}
| 564 |
1,311 | // SPDX-FileCopyrightText: 2021 <NAME>
// SPDX-License-Identifier: MIT
#include <Jolt.h>
#include <TriangleGrouper/TriangleGrouperClosestCentroid.h>
#include <Geometry/MortonCode.h>
namespace JPH {
void TriangleGrouperClosestCentroid::Group(const VertexList &inVertices, const IndexedTriangleList &inTriangles, int inGroupSize, vector<uint> &outGroupedTriangleIndices)
{
const uint triangle_count = (uint)inTriangles.size();
const uint num_batches = (triangle_count + inGroupSize - 1) / inGroupSize;
vector<Vec3> centroids;
centroids.resize(triangle_count);
outGroupedTriangleIndices.resize(triangle_count);
for (uint t = 0; t < triangle_count; ++t)
{
// Store centroid
centroids[t] = inTriangles[t].GetCentroid(inVertices);
// Initialize sort table
outGroupedTriangleIndices[t] = t;
}
vector<uint>::iterator triangles_end = outGroupedTriangleIndices.end();
// Sort per batch
for (uint b = 0; b < num_batches - 1; ++b)
{
// Get iterators
vector<uint>::iterator batch_begin = outGroupedTriangleIndices.begin() + b * inGroupSize;
vector<uint>::iterator batch_end = batch_begin + inGroupSize;
vector<uint>::iterator batch_begin_plus_1 = batch_begin + 1;
vector<uint>::iterator batch_end_minus_1 = batch_end - 1;
// Find triangle with centroid with lowest X coordinate
vector<uint>::iterator lowest_iter = batch_begin;
float lowest_val = centroids[*lowest_iter].GetX();
for (vector<uint>::iterator other = batch_begin; other != triangles_end; ++other)
{
float val = centroids[*other].GetX();
if (val < lowest_val)
{
lowest_iter = other;
lowest_val = val;
}
}
// Make this triangle the first in a new batch
swap(*batch_begin, *lowest_iter);
Vec3 first_centroid = centroids[*batch_begin];
// Sort remaining triangles in batch on distance to first triangle
sort(batch_begin_plus_1, batch_end,
[&first_centroid, ¢roids](uint inLHS, uint inRHS) -> bool
{
return (centroids[inLHS] - first_centroid).LengthSq() < (centroids[inRHS] - first_centroid).LengthSq();
});
// Loop over remaining triangles
float furthest_dist = (centroids[*batch_end_minus_1] - first_centroid).LengthSq();
for (vector<uint>::iterator other = batch_end; other != triangles_end; ++other)
{
// Check if this triangle is closer than the furthest triangle in the batch
float dist = (centroids[*other] - first_centroid).LengthSq();
if (dist < furthest_dist)
{
// Replace furthest triangle
uint other_val = *other;
*other = *batch_end_minus_1;
// Find first element that is bigger than this one and insert the current item before it
vector<uint>::iterator upper = upper_bound(batch_begin_plus_1, batch_end, dist,
[&first_centroid, ¢roids](float inLHS, uint inRHS) -> bool
{
return inLHS < (centroids[inRHS] - first_centroid).LengthSq();
});
copy_backward(upper, batch_end_minus_1, batch_end);
*upper = other_val;
// Calculate new furthest distance
furthest_dist = (centroids[*batch_end_minus_1] - first_centroid).LengthSq();
}
}
}
}
} // JPH | 1,181 |
369 | #define SOKOL_IMPL
#include "sokol_app.h"
void use_app_impl() {
sapp_run({ });
}
| 43 |
679 | /**************************************************************
*
* 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.
*
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
#include "dp_script.hrc"
#include "dp_lib_container.h"
#include "dp_backend.h"
#include "dp_ucb.h"
#include "rtl/uri.hxx"
#include "ucbhelper/content.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "cppuhelper/implbase1.hxx"
#include "comphelper/servicedecl.hxx"
#include "svl/inettype.hxx"
#include "com/sun/star/util/XUpdatable.hpp"
#include "com/sun/star/script/XLibraryContainer3.hpp"
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <memory>
#include "dp_scriptbackenddb.hxx"
using namespace ::dp_misc;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using ::rtl::OUString;
namespace css = ::com::sun::star;
namespace dp_registry {
namespace backend {
namespace script {
namespace {
typedef ::cppu::ImplInheritanceHelper1<
::dp_registry::backend::PackageRegistryBackend, util::XUpdatable > t_helper;
//==============================================================================
class BackendImpl : public t_helper
{
class PackageImpl : public ::dp_registry::backend::Package
{
BackendImpl * getMyBackend() const;
const OUString m_scriptURL;
const OUString m_dialogURL;
OUString m_dialogName;
// Package
virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
::osl::ResettableMutexGuard & guard,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
public:
PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
OUString const & url,
Reference<XCommandEnvironment> const &xCmdEnv,
OUString const & scriptURL, OUString const & dialogURL,
bool bRemoved, OUString const & identifier);
};
friend class PackageImpl;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv );
void addDataToDb(OUString const & url);
bool hasActiveEntry(OUString const & url);
void revokeEntryFromDb(OUString const & url);
const Reference<deployment::XPackageTypeInfo> m_xBasicLibTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xDialogLibTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
std::auto_ptr<ScriptBackendDb> m_backendDb;
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
// XUpdatable
virtual void SAL_CALL update() throw (RuntimeException);
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
throw (deployment::DeploymentException,
uno::RuntimeException);
};
//______________________________________________________________________________
BackendImpl::PackageImpl::PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
OUString const & url,
Reference<XCommandEnvironment> const &xCmdEnv,
OUString const & scriptURL, OUString const & dialogURL, bool bRemoved,
OUString const & identifier)
: Package( myBackend.get(), url,
OUString(), OUString(), // will be late-initialized
scriptURL.getLength() > 0 ? myBackend->m_xBasicLibTypeInfo
: myBackend->m_xDialogLibTypeInfo, bRemoved, identifier),
m_scriptURL( scriptURL ),
m_dialogURL( dialogURL )
{
// name, displayName:
if (dialogURL.getLength() > 0) {
m_dialogName = LibraryContainer::get_libname(
dialogURL, xCmdEnv, myBackend->getComponentContext() );
}
if (scriptURL.getLength() > 0) {
m_name = LibraryContainer::get_libname(
scriptURL, xCmdEnv, myBackend->getComponentContext() );
}
else
m_name = m_dialogName;
m_displayName = m_name;
}
//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext )
: t_helper( args, xComponentContext ),
m_xBasicLibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.basic-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_BASIC_LIB),
RID_IMG_SCRIPTLIB, RID_IMG_SCRIPTLIB_HC ) ),
m_xDialogLibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.dialog-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_DIALOG_LIB),
RID_IMG_DIALOGLIB, RID_IMG_DIALOGLIB_HC ) ),
m_typeInfos( 2 )
{
m_typeInfos[ 0 ] = m_xBasicLibTypeInfo;
m_typeInfos[ 1 ] = m_xDialogLibTypeInfo;
OSL_ASSERT( ! transientMode() );
if (!transientMode())
{
OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml"));
m_backendDb.reset(
new ScriptBackendDb(getComponentContext(), dbFile));
}
}
void BackendImpl::addDataToDb(OUString const & url)
{
if (m_backendDb.get())
m_backendDb->addEntry(url);
}
bool BackendImpl::hasActiveEntry(OUString const & url)
{
if (m_backendDb.get())
return m_backendDb->hasActiveEntry(url);
return false;
}
// XUpdatable
//______________________________________________________________________________
void BackendImpl::update() throw (RuntimeException)
{
// Nothing to do here after fixing i70283!?
}
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
BackendImpl::getSupportedPackageTypes() throw (RuntimeException)
{
return m_typeInfos;
}
void BackendImpl::revokeEntryFromDb(OUString const & url)
{
if (m_backendDb.get())
m_backendDb->revokeEntry(url);
}
void BackendImpl::packageRemoved(OUString const & url, OUString const & /*mediaType*/)
throw (deployment::DeploymentException,
uno::RuntimeException)
{
if (m_backendDb.get())
m_backendDb->removeEntry(url);
}
// PackageRegistryBackend
//______________________________________________________________________________
Reference<deployment::XPackage> BackendImpl::bindPackage_(
OUString const & url, OUString const & mediaType_,
sal_Bool bRemoved, OUString const & identifier,
Reference<XCommandEnvironment> const & xCmdEnv )
{
OUString mediaType( mediaType_ );
if (mediaType.getLength() == 0)
{
// detect media-type:
::ucbhelper::Content ucbContent;
if (create_ucb_content( &ucbContent, url, xCmdEnv ) &&
ucbContent.isFolder())
{
// probe for script.xlb:
if (create_ucb_content(
0, makeURL( url, OUSTR("script.xlb") ),
xCmdEnv, false /* no throw */ ))
mediaType = OUSTR("application/vnd.sun.star.basic-library");
// probe for dialog.xlb:
else if (create_ucb_content(
0, makeURL( url, OUSTR("dialog.xlb") ),
xCmdEnv, false /* no throw */ ))
mediaType = OUSTR("application/vnd.sun.star.dialog-library");
}
if (mediaType.getLength() == 0)
throw lang::IllegalArgumentException(
StrCannotDetectMediaType::get() + url,
static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
}
String type, subType;
INetContentTypeParameterList params;
if (INetContentTypes::parse( mediaType, type, subType, ¶ms ))
{
if (type.EqualsIgnoreCaseAscii("application"))
{
OUString dialogURL( makeURL( url, OUSTR("dialog.xlb") ) );
if (! create_ucb_content(
0, dialogURL, xCmdEnv, false /* no throw */ )) {
dialogURL = OUString();
}
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.basic-library"))
{
OUString scriptURL( makeURL( url, OUSTR("script.xlb")));
if (! create_ucb_content(
0, scriptURL, xCmdEnv, false /* no throw */ )) {
scriptURL = OUString();
}
return new PackageImpl(
this, url, xCmdEnv, scriptURL,
dialogURL, bRemoved, identifier);
}
else if (subType.EqualsIgnoreCaseAscii(
"vnd.sun.star.dialog-library")) {
return new PackageImpl(
this, url, xCmdEnv,
OUString() /* no script lib */,
dialogURL,
bRemoved, identifier);
}
}
}
throw lang::IllegalArgumentException(
StrUnsupportedMediaType::get() + mediaType,
static_cast<OWeakObject *>(this),
static_cast<sal_Int16>(-1) );
}
//##############################################################################
// Package
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
if (NULL == pBackend)
{
//May throw a DisposedException
check();
//We should never get here...
throw RuntimeException(
OUSTR("Failed to get the BackendImpl"),
static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
}
return pBackend;
}
//______________________________________________________________________________
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
::osl::ResettableMutexGuard &,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
(void)xCmdEnv;
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
bool registered = that->hasActiveEntry(getURL());
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>( registered, false /* IsAmbiguous */ ) );
}
//______________________________________________________________________________
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
bool startup,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
(void)xCmdEnv;
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
Reference<XComponentContext> const & xComponentContext = that->getComponentContext();
bool bScript = (m_scriptURL.getLength() > 0);
Reference<css::script::XLibraryContainer3> xScriptLibs;
bool bDialog = (m_dialogURL.getLength() > 0);
Reference<css::script::XLibraryContainer3> xDialogLibs;
bool bRunning = office_is_running();
if( bRunning )
{
if( bScript )
{
xScriptLibs.set(
xComponentContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.script.ApplicationScriptLibraryContainer"),
xComponentContext ), UNO_QUERY_THROW );
}
if( bDialog )
{
xDialogLibs.set(
xComponentContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.script.ApplicationDialogLibraryContainer"),
xComponentContext ), UNO_QUERY_THROW );
}
}
bool bRegistered = getMyBackend()->hasActiveEntry(getURL());
if( !doRegisterPackage )
{
//We cannot just call removeLibrary(name) because this could remove a
//script which was added by an extension in a different repository. For
//example, extension foo is contained in the bundled repository and then
//the user adds it it to the user repository. The extension manager will
//then register the new script and revoke the script from the bundled
//extension. removeLibrary(name) would now remove the script from the
//user repository. That is, the script of the newly added user extension does
//not work anymore. Therefore we must check if the currently active
//script comes in fact from the currently processed extension.
if (bRegistered)
{
//we also prevent and live deployment at startup
if (!isRemoved() && !startup)
{
if (bScript && xScriptLibs.is() && xScriptLibs->hasByName(m_name))
{
const OUString sScriptUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
if (sScriptUrl.equals(m_scriptURL))
xScriptLibs->removeLibrary(m_name);
}
if (bDialog && xDialogLibs.is() && xDialogLibs->hasByName(m_dialogName))
{
const OUString sDialogUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
if (sDialogUrl.equals(m_dialogURL))
xDialogLibs->removeLibrary(m_dialogName);
}
}
getMyBackend()->revokeEntryFromDb(getURL());
return;
}
}
if (bRegistered)
return; // Already registered
// Update LibraryContainer
bool bScriptSuccess = false;
const bool bReadOnly = false;
bool bDialogSuccess = false;
if (!startup)
{
//If there is a bundled extension, and the user installes the same extension
//then the script from the bundled extension must be removed. If this does not work
//then live deployment does not work for scripts.
if (bScript && xScriptLibs.is())
{
bool bCanAdd = true;
if (xScriptLibs->hasByName(m_name))
{
const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(m_name);
//We assume here that library names in extensions are unique, which may not be the case
//ToDo: If the script exist in another extension, then both extensions must have the
//same id
if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
|| sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
|| sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
{
xScriptLibs->removeLibrary(m_name);
bCanAdd = true;
}
else
{
bCanAdd = false;
}
}
if (bCanAdd)
{
xScriptLibs->createLibraryLink( m_name, m_scriptURL, bReadOnly );
bScriptSuccess = xScriptLibs->hasByName( m_name );
}
}
if (bDialog && xDialogLibs.is())
{
bool bCanAdd = true;
if (xDialogLibs->hasByName(m_dialogName))
{
const OUString sOriginalUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName);
//We assume here that library names in extensions are unique, which may not be the case
//ToDo: If the script exist in another extension, then both extensions must have the
//same id
if (sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE"))
|| sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE"))
|| sOriginalUrl.match(OUSTR("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")))
{
xDialogLibs->removeLibrary(m_dialogName);
bCanAdd = true;
}
else
{
bCanAdd = false;
}
}
if (bCanAdd)
{
xDialogLibs->createLibraryLink( m_dialogName, m_dialogURL, bReadOnly );
bDialogSuccess = xDialogLibs->hasByName(m_dialogName);
}
}
}
bool bSuccess = bScript || bDialog; // Something must have happened
if( bRunning && !startup)
if( (bScript && !bScriptSuccess) || (bDialog && !bDialogSuccess) )
bSuccess = false;
if (bSuccess)
getMyBackend()->addDataToDb(getURL());
}
} // anon namespace
namespace sdecl = comphelper::service_decl;
sdecl::class_<BackendImpl, sdecl::with_args<true> > serviceBI;
extern sdecl::ServiceDecl const serviceDecl(
serviceBI,
"com.sun.star.comp.deployment.script.PackageRegistryBackend",
BACKEND_SERVICE_NAME );
} // namespace script
} // namespace backend
} // namespace dp_registry
| 7,970 |
20,995 | // Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_STACKS_H_
#define V8_WASM_STACKS_H_
#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif // !V8_ENABLE_WEBASSEMBLY
#include "src/base/build_config.h"
#include "src/common/globals.h"
#include "src/execution/isolate.h"
#include "src/utils/allocation.h"
namespace v8 {
namespace internal {
namespace wasm {
struct JumpBuffer {
void* sp;
void* fp;
void* stack_limit;
// TODO(thibaudm/fgm): Add general-purpose registers.
};
constexpr int kJmpBufSpOffset = offsetof(JumpBuffer, sp);
constexpr int kJmpBufFpOffset = offsetof(JumpBuffer, fp);
constexpr int kJmpBufStackLimitOffset = offsetof(JumpBuffer, stack_limit);
class StackMemory {
public:
static StackMemory* New() { return new StackMemory(); }
// Returns a non-owning view of the current stack.
static StackMemory* GetCurrentStackView(Isolate* isolate) {
byte* limit =
*reinterpret_cast<byte**>(isolate->stack_guard()->address_of_jslimit());
return new StackMemory(limit);
}
~StackMemory() {
PageAllocator* allocator = GetPlatformPageAllocator();
if (owned_) allocator->DecommitPages(limit_, size_);
}
void* limit() { return limit_; }
void* base() { return limit_ + size_; }
// Track external memory usage for Managed<StackMemory> objects.
size_t owned_size() { return sizeof(StackMemory) + (owned_ ? size_ : 0); }
private:
// This constructor allocates a new stack segment.
StackMemory() : owned_(true) {
PageAllocator* allocator = GetPlatformPageAllocator();
size_ = allocator->AllocatePageSize();
// TODO(thibaudm): Leave space for runtime functions.
limit_ = static_cast<byte*>(allocator->AllocatePages(
nullptr, size_, size_, PageAllocator::kReadWrite));
}
// Overload to represent a view of the libc stack.
explicit StackMemory(byte* limit) : limit_(limit), size_(0), owned_(false) {}
byte* limit_;
size_t size_;
bool owned_;
};
} // namespace wasm
} // namespace internal
} // namespace v8
#endif // V8_WASM_STACKS_H_
| 779 |
6,700 | import pathlib
import platform
import shutil
import tempfile
import unittest
import pykka
from mopidy import core
from mopidy.m3u.backend import M3UBackend
from mopidy.models import Playlist, Track
from tests import dummy_audio, path_to_data_dir
from tests.m3u import generate_song
class M3UPlaylistsProviderTest(unittest.TestCase):
backend_class = M3UBackend
config = {
"m3u": {
"enabled": True,
"base_dir": None,
"default_encoding": "latin-1",
"default_extension": ".m3u",
"playlists_dir": path_to_data_dir(""),
}
}
def setUp(self): # noqa: N802
self.config["m3u"]["playlists_dir"] = pathlib.Path(tempfile.mkdtemp())
self.playlists_dir = self.config["m3u"]["playlists_dir"]
self.base_dir = self.config["m3u"]["base_dir"] or self.playlists_dir
audio = dummy_audio.create_proxy()
backend = M3UBackend.start(config=self.config, audio=audio).proxy()
self.core = core.Core(backends=[backend])
def tearDown(self): # noqa: N802
pykka.ActorRegistry.stop_all()
if self.playlists_dir.exists():
shutil.rmtree(str(self.playlists_dir))
def test_created_playlist_is_persisted(self):
uri = "m3u:test.m3u"
path = self.playlists_dir / "test.m3u"
assert not path.exists()
playlist = self.core.playlists.create("test")
assert "test" == playlist.name
assert uri == playlist.uri
assert path.exists()
def test_create_sanitizes_playlist_name(self):
playlist = self.core.playlists.create(" ../../test FOO baR ")
assert "..|..|test FOO baR" == playlist.name
path = self.playlists_dir / "..|..|test FOO baR.m3u"
assert self.playlists_dir == path.parent
assert path.exists()
def test_saved_playlist_is_persisted(self):
uri1 = "m3u:test1.m3u"
uri2 = "m3u:test2.m3u"
path1 = self.playlists_dir / "test1.m3u"
path2 = self.playlists_dir / "test2.m3u"
playlist = self.core.playlists.create("test1")
assert "test1" == playlist.name
assert uri1 == playlist.uri
assert path1.exists()
assert not path2.exists()
playlist = self.core.playlists.save(playlist.replace(name="test2"))
assert "test2" == playlist.name
assert uri2 == playlist.uri
assert not path1.exists()
assert path2.exists()
def test_deleted_playlist_is_removed(self):
uri = "m3u:test.m3u"
path = self.playlists_dir / "test.m3u"
assert not path.exists()
playlist = self.core.playlists.create("test")
assert "test" == playlist.name
assert uri == playlist.uri
assert path.exists()
success = self.core.playlists.delete(playlist.uri)
assert success
assert not path.exists()
def test_delete_on_path_outside_playlist_dir_returns_none(self):
success = self.core.playlists.delete("m3u:///etc/passwd")
assert not success
def test_playlist_contents_is_written_to_disk(self):
track = Track(uri=generate_song(1))
playlist = self.core.playlists.create("test")
playlist = self.core.playlists.save(playlist.replace(tracks=[track]))
path = self.playlists_dir / "test.m3u"
contents = path.read_text()
assert track.uri == contents.strip()
def test_extended_playlist_contents_is_written_to_disk(self):
track = Track(uri=generate_song(1), name="Test", length=60000)
playlist = self.core.playlists.create("test")
playlist = self.core.playlists.save(playlist.replace(tracks=[track]))
path = self.playlists_dir / "test.m3u"
m3u = path.read_text().splitlines()
assert ["#EXTM3U", "#EXTINF:-1,Test", track.uri] == m3u
def test_latin1_playlist_contents_is_written_to_disk(self):
track = Track(uri=generate_song(1), name="Test\x9f", length=60000)
playlist = self.core.playlists.create("test")
playlist = self.core.playlists.save(playlist.replace(tracks=[track]))
path = self.playlists_dir / "test.m3u"
m3u = path.read_bytes().splitlines()
track_uri = track.uri
if not isinstance(track_uri, bytes):
track_uri = track.uri.encode()
assert [b"#EXTM3U", b"#EXTINF:-1,Test\x9f", track_uri] == m3u
def test_utf8_playlist_contents_is_replaced_and_written_to_disk(self):
track = Track(uri=generate_song(1), name="Test\u07b4", length=60000)
playlist = self.core.playlists.create("test")
playlist = self.core.playlists.save(playlist.replace(tracks=[track]))
path = self.playlists_dir / "test.m3u"
m3u = path.read_bytes().splitlines()
track_uri = track.uri
if not isinstance(track_uri, bytes):
track_uri = track.uri.encode()
assert [b"#EXTM3U", b"#EXTINF:-1,Test?", track_uri] == m3u
def test_playlists_are_loaded_at_startup(self):
track = Track(uri="dummy:track:path2")
playlist = self.core.playlists.create("test")
playlist = playlist.replace(tracks=[track])
playlist = self.core.playlists.save(playlist)
assert len(self.core.playlists.as_list()) == 1
result = self.core.playlists.lookup(playlist.uri)
assert playlist.uri == result.uri
assert playlist.name == result.name
assert track.uri == result.tracks[0].uri
@unittest.skipIf(
platform.system() == "Darwin",
'macOS 10.13 raises IOError "Illegal byte sequence" on open.',
)
def test_load_playlist_with_nonfilesystem_encoding_of_filename(self):
playlist_name = "øæå.m3u".encode("latin-1")
playlist_name = playlist_name.decode(errors="surrogateescape")
path = self.playlists_dir / playlist_name
path.write_bytes(b"#EXTM3U\n")
self.core.playlists.refresh()
assert len(self.core.playlists.as_list()) == 1
result = self.core.playlists.as_list()
assert "���" == result[0].name
@unittest.SkipTest
def test_playlists_dir_is_created(self):
pass
def test_create_returns_playlist_with_name_set(self):
playlist = self.core.playlists.create("test")
assert playlist.name == "test"
def test_create_returns_playlist_with_uri_set(self):
playlist = self.core.playlists.create("test")
assert playlist.uri
def test_create_adds_playlist_to_playlists_collection(self):
playlist = self.core.playlists.create("test")
playlists = self.core.playlists.as_list()
assert playlist.uri in [ref.uri for ref in playlists]
def test_as_list_empty_to_start_with(self):
assert len(self.core.playlists.as_list()) == 0
def test_as_list_ignores_non_playlists(self):
path = self.playlists_dir / "test.foo"
path.touch()
assert path.exists()
self.core.playlists.refresh()
assert len(self.core.playlists.as_list()) == 0
def test_delete_non_existant_playlist(self):
self.core.playlists.delete("m3u:unknown")
def test_delete_playlist_removes_it_from_the_collection(self):
playlist = self.core.playlists.create("test")
assert playlist == self.core.playlists.lookup(playlist.uri)
self.core.playlists.delete(playlist.uri)
assert self.core.playlists.lookup(playlist.uri) is None
def test_delete_playlist_without_file(self):
playlist = self.core.playlists.create("test")
assert playlist == self.core.playlists.lookup(playlist.uri)
path = self.playlists_dir / "test.m3u"
assert path.exists()
path.unlink()
assert not path.exists()
self.core.playlists.delete(playlist.uri)
assert self.core.playlists.lookup(playlist.uri) is None
def test_lookup_finds_playlist_by_uri(self):
original_playlist = self.core.playlists.create("test")
looked_up_playlist = self.core.playlists.lookup(original_playlist.uri)
assert original_playlist == looked_up_playlist
def test_lookup_on_path_outside_playlist_dir_returns_none(self):
result = self.core.playlists.lookup("m3u:///etc/passwd")
assert result is None
def test_refresh(self):
playlist = self.core.playlists.create("test")
assert playlist == self.core.playlists.lookup(playlist.uri)
self.core.playlists.refresh()
assert playlist == self.core.playlists.lookup(playlist.uri)
def test_save_replaces_existing_playlist_with_updated_playlist(self):
playlist1 = self.core.playlists.create("test1")
assert playlist1 == self.core.playlists.lookup(playlist1.uri)
playlist2 = playlist1.replace(name="test2")
playlist2 = self.core.playlists.save(playlist2)
assert self.core.playlists.lookup(playlist1.uri) is None
assert playlist2 == self.core.playlists.lookup(playlist2.uri)
def test_create_replaces_existing_playlist_with_updated_playlist(self):
track = Track(uri=generate_song(1))
playlist1 = self.core.playlists.create("test")
playlist1 = self.core.playlists.save(playlist1.replace(tracks=[track]))
assert playlist1 == self.core.playlists.lookup(playlist1.uri)
playlist2 = self.core.playlists.create("test")
assert playlist1.uri == playlist2.uri
assert playlist1 != self.core.playlists.lookup(playlist1.uri)
assert playlist2 == self.core.playlists.lookup(playlist1.uri)
def test_save_playlist_with_new_uri(self):
uri = "m3u:test.m3u"
self.core.playlists.save(Playlist(uri=uri))
path = self.playlists_dir / "test.m3u"
assert path.exists()
def test_save_on_path_outside_playlist_dir_returns_none(self):
result = self.core.playlists.save(Playlist(uri="m3u:///tmp/test.m3u"))
assert result is None
def test_playlist_with_unknown_track(self):
track = Track(uri="file:///dev/null")
playlist = self.core.playlists.create("test")
playlist = playlist.replace(tracks=[track])
playlist = self.core.playlists.save(playlist)
assert len(self.core.playlists.as_list()) == 1
result = self.core.playlists.lookup("m3u:test.m3u")
assert "m3u:test.m3u" == result.uri
assert playlist.name == result.name
assert track.uri == result.tracks[0].uri
def test_playlist_with_absolute_path(self):
track = Track(uri="/tmp/test.mp3")
filepath = pathlib.Path("/tmp/test.mp3")
playlist = self.core.playlists.create("test")
playlist = playlist.replace(tracks=[track])
playlist = self.core.playlists.save(playlist)
assert len(self.core.playlists.as_list()) == 1
result = self.core.playlists.lookup("m3u:test.m3u")
assert "m3u:test.m3u" == result.uri
assert playlist.name == result.name
assert filepath.as_uri() == result.tracks[0].uri
def test_playlist_with_relative_path(self):
track = Track(uri="test.mp3")
filepath = self.base_dir / "test.mp3"
playlist = self.core.playlists.create("test")
playlist = playlist.replace(tracks=[track])
playlist = self.core.playlists.save(playlist)
assert len(self.core.playlists.as_list()) == 1
result = self.core.playlists.lookup("m3u:test.m3u")
assert "m3u:test.m3u" == result.uri
assert playlist.name == result.name
assert filepath.as_uri() == result.tracks[0].uri
def test_playlist_sort_order(self):
def check_order(playlists, names):
assert names == [playlist.name for playlist in playlists]
self.core.playlists.create("c")
self.core.playlists.create("a")
self.core.playlists.create("b")
check_order(self.core.playlists.as_list(), ["a", "b", "c"])
self.core.playlists.refresh()
check_order(self.core.playlists.as_list(), ["a", "b", "c"])
playlist = self.core.playlists.lookup("m3u:a.m3u")
playlist = playlist.replace(name="d")
playlist = self.core.playlists.save(playlist)
check_order(self.core.playlists.as_list(), ["b", "c", "d"])
self.core.playlists.delete("m3u:c.m3u")
check_order(self.core.playlists.as_list(), ["b", "d"])
def test_get_items_returns_item_refs(self):
track = Track(uri="dummy:a", name="A", length=60000)
playlist = self.core.playlists.create("test")
playlist = self.core.playlists.save(playlist.replace(tracks=[track]))
item_refs = self.core.playlists.get_items(playlist.uri)
assert len(item_refs) == 1
assert item_refs[0].type == "track"
assert item_refs[0].uri == "dummy:a"
assert item_refs[0].name == "A"
def test_get_items_of_unknown_playlist_returns_none(self):
item_refs = self.core.playlists.get_items("dummy:unknown")
assert item_refs is None
def test_get_items_from_file_outside_playlist_dir_returns_none(self):
item_refs = self.core.playlists.get_items("m3u:///etc/passwd")
assert item_refs is None
class M3UPlaylistsProviderBaseDirectoryTest(M3UPlaylistsProviderTest):
def setUp(self): # noqa: N802
self.config["m3u"]["base_dir"] = pathlib.Path(tempfile.mkdtemp())
super().setUp()
| 5,797 |
369 | <filename>FreeRTOSv10.4.1/FreeRTOS/Demo/CORTEX_M4_ATSAM4L_Atmel_Studio/src/asf/sam/boards/sam4l_ek/init.c
/**
* \file
*
* \brief SAM4L-EK Board init.
*
* This file contains board initialization function.
*
* Copyright (c) 2012 - 2013 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#include "compiler.h"
#include "sam4l_ek.h"
#include "conf_board.h"
#include "ioport.h"
#include "board.h"
/**
* \addtogroup sam4l_ek_group
* @{
*/
/**
* \brief Set peripheral mode for one single IOPORT pin.
* It will configure port mode and disable pin mode (but enable peripheral).
* \param pin IOPORT pin to configure
* \param mode Mode masks to configure for the specified pin (\ref ioport_modes)
*/
#define ioport_set_pin_peripheral_mode(pin, mode) \
do {\
ioport_set_pin_mode(pin, mode);\
ioport_disable_pin(pin);\
} while (0)
void board_init(void)
{
// Initialize IOPORTs
ioport_init();
// Put all pins to default state (input & pull-up)
uint32_t pin;
for (pin = PIN_PA00; pin <= PIN_PC31; pin ++) {
// Skip output pins to configure later
if (pin == LED0_GPIO || pin == LCD_BL_GPIO
#ifdef CONF_BOARD_RS485
|| pin == RS485_USART_CTS_PIN
#endif
/* PA02 is not configured as it is driven by hardware
configuration */
|| pin == PIN_PA02) {
continue;
}
ioport_set_pin_dir(pin, IOPORT_DIR_INPUT);
ioport_set_pin_mode(pin, IOPORT_MODE_PULLUP);
}
/* Configure the pins connected to LEDs as output and set their
* default initial state to high (LEDs off).
*/
ioport_set_pin_dir(LED0_GPIO, IOPORT_DIR_OUTPUT);
ioport_set_pin_level(LED0_GPIO, LED0_INACTIVE_LEVEL);
#ifdef CONF_BOARD_EIC
// Set push button as external interrupt pin
ioport_set_pin_peripheral_mode(GPIO_PUSH_BUTTON_EIC_PIN,
GPIO_PUSH_BUTTON_EIC_PIN_MUX);
ioport_set_pin_peripheral_mode(GPIO_UNIT_TEST_EIC_PIN,
GPIO_UNIT_TEST_EIC_PIN_MUX);
#else
// Push button as input: already done, it's the default pin state
#endif
#if (defined CONF_BOARD_BL)
// Configure LCD backlight
ioport_set_pin_dir(LCD_BL_GPIO, IOPORT_DIR_OUTPUT);
ioport_set_pin_level(LCD_BL_GPIO, LCD_BL_INACTIVE_LEVEL);
#endif
#if (defined CONF_BOARD_USB_PORT)
ioport_set_pin_peripheral_mode(PIN_PA25A_USBC_DM, MUX_PA25A_USBC_DM);
ioport_set_pin_peripheral_mode(PIN_PA26A_USBC_DP, MUX_PA26A_USBC_DP);
# if defined(CONF_BOARD_USB_VBUS_DETECT)
# if defined(USB_VBUS_EIC)
ioport_set_pin_peripheral_mode(USB_VBUS_EIC,
USB_VBUS_EIC_MUX|USB_VBUS_FLAGS);
# elif defined(USB_VBUS_PIN)
ioport_set_pin_dir(USB_VBUS_PIN, IOPORT_DIR_INPUT);
# else
# warning USB_VBUS pin not defined
# endif
# endif
# if defined(CONF_BOARD_USB_ID_DETECT)
# if defined(USB_ID_EIC)
ioport_set_pin_peripheral_mode(USB_ID_EIC,
USB_ID_EIC_MUX|USB_ID_FLAGS);
# elif defined(USB_ID_PIN)
ioport_set_pin_dir(USB_ID_PIN, IOPORT_DIR_INPUT);
# else
# warning USB_ID pin not defined
# endif
# endif
# if defined(CONF_BOARD_USB_VBUS_CONTROL)
# if defined(USB_VBOF_PIN)
ioport_set_pin_dir(USB_VBOF_PIN, IOPORT_DIR_OUTPUT);
ioport_set_pin_level(USB_VBOF_PIN, USB_VBOF_INACTIVE_LEVEL);
# else
# warning USB_VBOF pin not defined
# endif
# if defined(CONF_BOARD_USB_VBUS_ERR_DETECT)
# if defined(USB_VBERR_EIC)
ioport_set_pin_peripheral_mode(USB_VBERR_EIC,
USB_VBERR_EIC_MUX|USB_VBERR_FLAGS);
# elif defined(USB_VBERR_PIN)
ioport_set_pin_dir(USB_VBERR_PIN, IOPORT_DIR_INPUT);
# else
# warning USB_VBERR pin not defined
# endif
# endif
# endif /* !(defined CONF_BOARD_USB_NO_VBUS_CONTROL) */
#endif /* (defined CONF_BOARD_USB_PORT) */
#if defined (CONF_BOARD_COM_PORT)
ioport_set_pin_peripheral_mode(COM_PORT_RX_PIN, COM_PORT_RX_MUX);
ioport_set_pin_peripheral_mode(COM_PORT_TX_PIN, COM_PORT_TX_MUX);
#endif
#if defined (CONF_BOARD_BM_USART)
ioport_set_pin_peripheral_mode(BM_USART_RX_PIN, BM_USART_RX_MUX);
ioport_set_pin_peripheral_mode(BM_USART_TX_PIN, BM_USART_TX_MUX);
#endif
#ifdef CONF_BOARD_SPI
ioport_set_pin_peripheral_mode(PIN_PC04A_SPI_MISO, MUX_PC04A_SPI_MISO);
ioport_set_pin_peripheral_mode(PIN_PC05A_SPI_MOSI, MUX_PC05A_SPI_MOSI);
ioport_set_pin_peripheral_mode(PIN_PC06A_SPI_SCK, MUX_PC06A_SPI_SCK);
#ifdef CONF_BOARD_SPI_NPCS0
ioport_set_pin_peripheral_mode(PIN_PA02B_SPI_NPCS0,
MUX_PA02B_SPI_NPCS0);
#endif
#ifdef CONF_BOARD_SPI_NPCS2
ioport_set_pin_peripheral_mode(PIN_PC00A_SPI_NPCS2,
MUX_PC00A_SPI_NPCS2);
#endif
#ifdef CONF_BOARD_SPI_NPCS3
ioport_set_pin_peripheral_mode(PIN_PC01A_SPI_NPCS3,
MUX_PC01A_SPI_NPCS3);
#endif
#endif
#ifdef CONF_BOARD_RS485
ioport_set_pin_peripheral_mode(RS485_USART_RX_PIN, RS485_USART_RX_MUX);
ioport_set_pin_peripheral_mode(RS485_USART_TX_PIN, RS485_USART_TX_MUX);
ioport_set_pin_peripheral_mode(RS485_USART_RTS_PIN,
RS485_USART_RTS_MUX);
ioport_set_pin_dir(RS485_USART_CTS_PIN, IOPORT_DIR_OUTPUT);
ioport_set_pin_level(RS485_USART_CTS_PIN, IOPORT_PIN_LEVEL_LOW);
#endif
#ifdef CONF_BOARD_TWIMS1
ioport_set_pin_peripheral_mode(TWIMS1_TWI_SCL_PIN, TWIMS1_TWI_SCL_MUX);
ioport_set_pin_peripheral_mode(TWIMS1_TWI_SDA_PIN, TWIMS1_TWI_SDA_MUX);
#endif
#ifdef CONF_BOARD_USART0
ioport_set_pin_peripheral_mode(USART0_RX_PIN, USART0_RX_MUX);
ioport_set_pin_peripheral_mode(USART0_TX_PIN, USART0_TX_MUX);
#endif
#ifdef CONF_BOARD_DACC_VOUT
ioport_set_pin_peripheral_mode(DACC_VOUT_PIN, DACC_VOUT_MUX);
#endif
#ifdef CONF_BOARD_ACIFC
ioport_set_pin_peripheral_mode(PIN_PA06E_ACIFC_ACAN0, MUX_PA06E_ACIFC_ACAN0);
ioport_set_pin_peripheral_mode(PIN_PA07E_ACIFC_ACAP0, MUX_PA07E_ACIFC_ACAP0);
#endif
#ifdef CONF_BOARD_ABDACB_PORT
ioport_set_pin_peripheral_mode(ABDACB_AUDIO0_PIN, ABDACB_AUDIO0_MUX);
ioport_set_pin_peripheral_mode(ABDACB_AUDIO1_PIN, ABDACB_AUDIO1_MUX);
#endif
}
/**
* @}
*/
| 3,216 |
361 | package li.cil.oc2.common.entity;
import li.cil.oc2.common.util.RegistryUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.function.Function;
public final class Entities {
private static final DeferredRegister<EntityType<?>> ENTITIES = RegistryUtils.create(ForgeRegistries.ENTITIES);
///////////////////////////////////////////////////////////////////
public static final RegistryObject<EntityType<RobotEntity>> ROBOT = register("robot", RobotEntity::new, EntityClassification.MISC, b -> b.sized(14f / 16f, 14f / 16f).fireImmune().noSummon());
///////////////////////////////////////////////////////////////////
public static void initialize() {
}
///////////////////////////////////////////////////////////////////
private static <T extends Entity> RegistryObject<EntityType<T>> register(final String name, final EntityType.IFactory<T> factory, final EntityClassification classification, final Function<EntityType.Builder<T>, EntityType.Builder<T>> customizer) {
return ENTITIES.register(name, () -> customizer.apply(EntityType.Builder.of(factory, classification)).build(name));
}
}
| 367 |
305 | //===-- ThreadMinidump.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "ThreadMinidump.h"
#include "ProcessMinidump.h"
#include "RegisterContextMinidump_ARM.h"
#include "RegisterContextMinidump_ARM64.h"
#include "RegisterContextMinidump_x86_32.h"
#include "RegisterContextMinidump_x86_64.h"
#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
#include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Unwind.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Log.h"
#include <memory>
using namespace lldb;
using namespace lldb_private;
using namespace minidump;
ThreadMinidump::ThreadMinidump(Process &process, const minidump::Thread &td,
llvm::ArrayRef<uint8_t> gpregset_data)
: Thread(process, td.ThreadId), m_thread_reg_ctx_sp(),
m_gpregset_data(gpregset_data) {}
ThreadMinidump::~ThreadMinidump() {}
void ThreadMinidump::RefreshStateAfterStop() {}
RegisterContextSP ThreadMinidump::GetRegisterContext() {
if (!m_reg_context_sp) {
m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
}
return m_reg_context_sp;
}
RegisterContextSP
ThreadMinidump::CreateRegisterContextForFrame(StackFrame *frame) {
RegisterContextSP reg_ctx_sp;
uint32_t concrete_frame_idx = 0;
if (frame)
concrete_frame_idx = frame->GetConcreteFrameIndex();
if (concrete_frame_idx == 0) {
if (m_thread_reg_ctx_sp)
return m_thread_reg_ctx_sp;
ProcessMinidump *process =
static_cast<ProcessMinidump *>(GetProcess().get());
ArchSpec arch = process->GetArchitecture();
RegisterInfoInterface *reg_interface = nullptr;
// TODO write other register contexts and add them here
switch (arch.GetMachine()) {
case llvm::Triple::x86: {
reg_interface = new RegisterContextLinux_i386(arch);
lldb::DataBufferSP buf =
ConvertMinidumpContext_x86_32(m_gpregset_data, reg_interface);
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 4);
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86_64>(
*this, reg_interface, gpregset,
llvm::ArrayRef<lldb_private::CoreNote>());
break;
}
case llvm::Triple::x86_64: {
reg_interface = new RegisterContextLinux_x86_64(arch);
lldb::DataBufferSP buf =
ConvertMinidumpContext_x86_64(m_gpregset_data, reg_interface);
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 8);
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_x86_64>(
*this, reg_interface, gpregset,
llvm::ArrayRef<lldb_private::CoreNote>());
break;
}
case llvm::Triple::aarch64: {
DataExtractor data(m_gpregset_data.data(), m_gpregset_data.size(),
lldb::eByteOrderLittle, 8);
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextMinidump_ARM64>(*this, data);
break;
}
case llvm::Triple::arm: {
DataExtractor data(m_gpregset_data.data(), m_gpregset_data.size(),
lldb::eByteOrderLittle, 8);
const bool apple = arch.GetTriple().getVendor() == llvm::Triple::Apple;
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextMinidump_ARM>(*this, data, apple);
break;
}
default:
break;
}
reg_ctx_sp = m_thread_reg_ctx_sp;
} else if (m_unwinder_up) {
reg_ctx_sp = m_unwinder_up->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
}
bool ThreadMinidump::CalculateStopInfo() { return false; }
| 1,631 |
1,799 | package io.cucumber.plugin.event;
import org.apiguardian.api.API;
import java.time.Instant;
@API(status = API.Status.STABLE)
public interface Event {
/**
* Returns instant from epoch.
*
* @return time instant in Instant
* @see Instant#now()
*/
Instant getInstant();
}
| 121 |
696 | /*
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.product.deposit;
import static com.opengamma.strata.basics.currency.Currency.GBP;
import static com.opengamma.strata.basics.date.BusinessDayConventions.MODIFIED_FOLLOWING;
import static com.opengamma.strata.basics.date.DayCounts.ACT_365F;
import static com.opengamma.strata.basics.date.HolidayCalendarIds.GBLO;
import static com.opengamma.strata.basics.index.IborIndices.GBP_LIBOR_3M;
import static com.opengamma.strata.basics.index.IborIndices.GBP_LIBOR_6M;
import static com.opengamma.strata.collect.TestHelper.assertSerialization;
import static com.opengamma.strata.collect.TestHelper.coverBeanEquals;
import static com.opengamma.strata.collect.TestHelper.coverImmutableBean;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import java.time.LocalDate;
import org.junit.jupiter.api.Test;
import com.opengamma.strata.basics.ReferenceData;
import com.opengamma.strata.basics.date.BusinessDayAdjustment;
import com.opengamma.strata.basics.date.DaysAdjustment;
import com.opengamma.strata.product.common.BuySell;
import com.opengamma.strata.product.rate.IborRateComputation;
/**
* Test {@link IborFixingDeposit}.
*/
public class IborFixingDepositTest {
private static final ReferenceData REF_DATA = ReferenceData.standard();
private static final BuySell SELL = BuySell.SELL;
private static final LocalDate START_DATE = LocalDate.of(2015, 1, 19);
private static final LocalDate END_DATE = LocalDate.of(2015, 7, 19);
private static final double NOTIONAL = 100000000d;
private static final double RATE = 0.0250;
private static final BusinessDayAdjustment BDA_MOD_FOLLOW = BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO);
private static final DaysAdjustment DAY_ADJ = DaysAdjustment.ofBusinessDays(1, GBLO);
//-------------------------------------------------------------------------
@Test
public void test_builder_full() {
IborFixingDeposit test = IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.currency(GBP)
.startDate(START_DATE)
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.fixingDateOffset(DAY_ADJ)
.dayCount(ACT_365F)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build();
assertThat(test.getBusinessDayAdjustment().get()).isEqualTo(BDA_MOD_FOLLOW);
assertThat(test.getBuySell()).isEqualTo(SELL);
assertThat(test.getFixingDateOffset()).isEqualTo(DAY_ADJ);
assertThat(test.getNotional()).isEqualTo(NOTIONAL);
assertThat(test.getCurrency()).isEqualTo(GBP);
assertThat(test.getDayCount()).isEqualTo(ACT_365F);
assertThat(test.getStartDate()).isEqualTo(START_DATE);
assertThat(test.getEndDate()).isEqualTo(END_DATE);
assertThat(test.getIndex()).isEqualTo(GBP_LIBOR_6M);
assertThat(test.getFixedRate()).isEqualTo(RATE);
assertThat(test.isCrossCurrency()).isFalse();
assertThat(test.allPaymentCurrencies()).containsOnly(GBP);
assertThat(test.allCurrencies()).containsOnly(GBP);
}
@Test
public void test_builder_minimum() {
IborFixingDeposit test = IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.startDate(START_DATE)
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build();
assertThat(test.getBusinessDayAdjustment().get()).isEqualTo(BDA_MOD_FOLLOW);
assertThat(test.getBuySell()).isEqualTo(SELL);
assertThat(test.getFixingDateOffset()).isEqualTo(GBP_LIBOR_6M.getFixingDateOffset());
assertThat(test.getNotional()).isEqualTo(NOTIONAL);
assertThat(test.getCurrency()).isEqualTo(GBP);
assertThat(test.getDayCount()).isEqualTo(ACT_365F);
assertThat(test.getStartDate()).isEqualTo(START_DATE);
assertThat(test.getEndDate()).isEqualTo(END_DATE);
assertThat(test.getIndex()).isEqualTo(GBP_LIBOR_6M);
assertThat(test.getFixedRate()).isEqualTo(RATE);
}
@Test
public void test_builder_wrongDates() {
assertThatIllegalArgumentException()
.isThrownBy(() -> IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.startDate(LocalDate.of(2015, 9, 19))
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build());
}
//-------------------------------------------------------------------------
@Test
public void test_resolve() {
IborFixingDeposit base = IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.startDate(START_DATE)
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build();
ResolvedIborFixingDeposit test = base.resolve(REF_DATA);
LocalDate expectedEndDate = BDA_MOD_FOLLOW.adjust(END_DATE, REF_DATA);
double expectedYearFraction = ACT_365F.yearFraction(START_DATE, expectedEndDate);
IborRateComputation expectedObservation = IborRateComputation.of(
GBP_LIBOR_6M, GBP_LIBOR_6M.getFixingDateOffset().adjust(START_DATE, REF_DATA), REF_DATA);
assertThat(test.getCurrency()).isEqualTo(GBP);
assertThat(test.getStartDate()).isEqualTo(START_DATE);
assertThat(test.getEndDate()).isEqualTo(expectedEndDate);
assertThat(test.getFloatingRate()).isEqualTo(expectedObservation);
assertThat(test.getNotional()).isEqualTo(-NOTIONAL);
assertThat(test.getFixedRate()).isEqualTo(RATE);
assertThat(test.getYearFraction()).isEqualTo(expectedYearFraction);
}
//-------------------------------------------------------------------------
@Test
public void coverage() {
IborFixingDeposit test1 = IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.startDate(START_DATE)
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build();
coverImmutableBean(test1);
IborFixingDeposit test2 = IborFixingDeposit.builder()
.buySell(BuySell.BUY)
.notional(NOTIONAL)
.startDate(LocalDate.of(2015, 1, 19))
.endDate(LocalDate.of(2015, 4, 19))
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_3M)
.fixedRate(0.015)
.build();
coverBeanEquals(test1, test2);
}
@Test
public void test_serialization() {
IborFixingDeposit test = IborFixingDeposit.builder()
.buySell(SELL)
.notional(NOTIONAL)
.startDate(START_DATE)
.endDate(END_DATE)
.businessDayAdjustment(BDA_MOD_FOLLOW)
.index(GBP_LIBOR_6M)
.fixedRate(RATE)
.build();
assertSerialization(test);
}
}
| 2,930 |
1,514 | <reponame>shubhangi013/owtf
"""
owtf.api.handlers.plugin
~~~~~~~~~~~~~~~~~~~~~~~~
"""
import collections
from owtf.api.handlers.base import APIRequestHandler
from owtf.constants import MAPPINGS
from owtf.lib import exceptions
from owtf.lib.exceptions import APIError
from owtf.managers.plugin import get_all_plugin_dicts, get_types_for_plugin_group
from owtf.managers.poutput import delete_all_poutput, get_all_poutputs, update_poutput
from owtf.models.test_group import TestGroup
from owtf.api.handlers.jwtauth import jwtauth
__all__ = ["PluginNameOutput", "PluginDataHandler", "PluginOutputHandler"]
@jwtauth
class PluginDataHandler(APIRequestHandler):
"""Get completed plugin output data from the DB."""
SUPPORTED_METHODS = ["GET"]
# TODO: Creation of user plugins
def get(self, plugin_group=None, plugin_type=None, plugin_code=None):
"""Get plugin data based on user filter data.
**Example request**:
.. sourcecode:: http
GET /api/v1/plugins/?group=web&group=network HTTP/1.1
Accept: application/json, text/javascript, */*
X-Requested-With: XMLHttpRequest
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Type: application/json
{
"status": "success",
"data": [
{
"file": "[email protected]",
"code": "OWTF-CM-006",
"group": "web",
"attr": null,
"title": "Old Backup And Unreferenced Files",
"key": "external@OWTF-CM-006",
"descrip": "Plugin to assist manual testing",
"min_time": null,
"type": "external",
"name": "Old_Backup_and_Unreferenced_Files"
},
{
"file": "[email protected]",
"code": "OWTF-CM-006",
"group": "web",
"attr": null,
"title": "Old Backup And Unreferenced Files",
"key": "passive@OWTF-CM-006",
"descrip": "Google Hacking for juicy files",
"min_time": null,
"type": "passive",
"name": "Old_Backup_and_Unreferenced_Files"
}
]
}
"""
try:
filter_data = dict(self.request.arguments)
if not plugin_group: # Check if plugin_group is present in url
self.success(get_all_plugin_dicts(self.session, filter_data))
if plugin_group and (not plugin_type) and (not plugin_code):
filter_data.update({"group": plugin_group})
self.success(get_all_plugin_dicts(self.session, filter_data))
if plugin_group and plugin_type and (not plugin_code):
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in selected plugin group")
filter_data.update({"type": plugin_type, "group": plugin_group})
self.success(get_all_plugin_dicts(self.session, filter_data))
if plugin_group and plugin_type and plugin_code:
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in selected plugin group")
filter_data.update({"type": plugin_type, "group": plugin_group, "code": plugin_code})
# This combination will be unique, so have to return a dict
results = get_all_plugin_dicts(self.session, filter_data)
if results:
self.success(results[0])
else:
raise APIError(500, "Cannot get any plugin dict")
except exceptions.InvalidTargetReference:
raise APIError(400, "Invalid target provided.")
@jwtauth
class PluginNameOutput(APIRequestHandler):
"""Get the scan results for a target."""
SUPPORTED_METHODS = ["GET"]
def get(self, target_id=None):
"""Retrieve scan results for a target.
**Example request**:
.. sourcecode:: http
GET /api/v1/targets/2/poutput/names/ HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
{
"status": "success",
"data": {
"OWTF-AT-004": {
"data": [
{
"status": "Successful",
"owtf_rank": -1,
"plugin_group": "web",
"start_time": "01/04/2018-14:05",
"target_id": 2,
"run_time": "0s, 1ms",
"user_rank": -1,
"plugin_key": "external@OWTF-AT-004",
"id": 5,
"plugin_code": "OWTF-AT-004",
"user_notes": null,
"output_path": null,
"end_time": "01/04/2018-14:05",
"error": null,
"plugin_type": "external"
}
],
"details": {
"priority": 99,
"code": "OWTF-AT-004",
"group": "web",
"mappings": {
"OWASP_V3": [
"OWASP-AT-004",
"Brute Force Testing"
],
"OWASP_V4": [
"OTG-AUTHN-003",
"Testing for Weak lock out mechanism"
],
"CWE": [
"CWE-16",
"Configuration - Brute force"
],
"NIST": [
"IA-6",
"Authenticator Feedback - Brute force"
],
"OWASP_TOP_10": [
"A5",
"Security Misconfiguration - Brute force"
]
},
"hint": "Brute Force",
"url": "https://www.owasp.org/index.php/Testing_for_Brute_Force_(OWASP-AT-004)",
"descrip": "Testing for Brute Force"
}
},
}
}
"""
try:
filter_data = dict(self.request.arguments)
results = get_all_poutputs(self.session, filter_data, target_id=int(target_id), inc_output=False)
# Get test groups as well, for names and info links
groups = {}
for group in TestGroup.get_all(self.session):
group["mappings"] = MAPPINGS.get(group["code"], {})
groups[group["code"]] = group
dict_to_return = {}
for item in results:
if item["plugin_code"] in dict_to_return:
dict_to_return[item["plugin_code"]]["data"].append(item)
else:
ini_list = []
ini_list.append(item)
dict_to_return[item["plugin_code"]] = {}
dict_to_return[item["plugin_code"]]["data"] = ini_list
dict_to_return[item["plugin_code"]]["details"] = groups[item["plugin_code"]]
dict_to_return = collections.OrderedDict(sorted(dict_to_return.items()))
if results:
self.success(dict_to_return)
else:
raise APIError(500, "Cannot fetch plugin outputs")
except exceptions.InvalidTargetReference:
raise APIError(400, "Invalid target provided")
except exceptions.InvalidParameterType:
raise APIError(400, "Invalid parameter type provided")
@jwtauth
class PluginOutputHandler(APIRequestHandler):
"""Filter plugin output data."""
SUPPORTED_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"]
def get(self, target_id=None, plugin_group=None, plugin_type=None, plugin_code=None):
"""Get the plugin output based on query filter params.
**Example request**:
.. sourcecode:: http
GET /api/v1/targets/2/poutput/?plugin_code=OWTF-AJ-001 HTTP/1.1
X-Requested-With: XMLHttpRequest
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"data": [
{
"status": "Successful",
"owtf_rank": -1,
"plugin_group": "web",
"start_time": "01/04/2018-14:06",
"target_id": 2,
"run_time": "0s, 1ms",
"user_rank": -1,
"plugin_key": "external@OWTF-AJ-001",
"id": 27,
"plugin_code": "OWTF-AJ-001",
"user_notes": null,
"output_path": null,
"end_time": "01/04/2018-14:06",
"error": null,
"output": "Intended to show helpful info in the future",
"plugin_type": "external"
}
]
}
"""
try:
filter_data = dict(self.request.arguments)
if plugin_group and (not plugin_type):
filter_data.update({"plugin_group": plugin_group})
if plugin_type and plugin_group and (not plugin_code):
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in selected plugin group")
filter_data.update({"plugin_type": plugin_type, "plugin_group": plugin_group})
if plugin_type and plugin_group and plugin_code:
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in selected plugin group")
filter_data.update(
{"plugin_type": plugin_type, "plugin_group": plugin_group, "plugin_code": plugin_code}
)
results = get_all_poutputs(self.session, filter_data, target_id=int(target_id), inc_output=True)
if results:
self.success(results)
else:
raise APIError(500, "Cannot fetch plugin outputs")
except exceptions.InvalidTargetReference:
raise APIError(400, "Invalid target reference provided")
except exceptions.InvalidParameterType:
raise APIError(400, "Invalid parameter type provided")
def post(self, target_url):
raise APIError(405)
def put(self):
raise APIError(405)
def patch(self, target_id=None, plugin_group=None, plugin_type=None, plugin_code=None):
"""Modify plugin output data like ranking, severity, notes, etc.
**Example request**:
.. sourcecode:: http
PATCH /api/v1/targets/2/poutput/web/external/OWTF-CM-008 HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
user_rank=0
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: application/json
{
"status": "success",
"data": null
}
"""
try:
if (not target_id) or (not plugin_group) or (not plugin_type) or (not plugin_code):
raise APIError(400, "Missing requirement arguments")
else:
patch_data = dict(self.request.arguments)
update_poutput(self.session, plugin_group, plugin_type, plugin_code, patch_data, target_id=target_id)
self.success(None)
except exceptions.InvalidTargetReference:
raise APIError(400, "Invalid target reference provided")
except exceptions.InvalidParameterType:
raise APIError(400, "Invalid parameter type provided")
def delete(self, target_id=None, plugin_group=None, plugin_type=None, plugin_code=None):
"""Delete a plugin output.
**Example request**:
.. sourcecode:: http
DELETE /api/v1/targets/2/poutput/web/external/OWTF-AJ-001 HTTP/1.1
X-Requested-With: XMLHttpRequest
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"data": null
}
"""
try:
filter_data = dict(self.request.arguments)
if not plugin_group: # First check if plugin_group is present in url
delete_all_poutput(self.session, filter_data, target_id=int(target_id))
if plugin_group and (not plugin_type):
filter_data.update({"plugin_group": plugin_group})
delete_all_poutput(self.session, filter_data, target_id=int(target_id))
if plugin_type and plugin_group and (not plugin_code):
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in the selected plugin group")
filter_data.update({"plugin_type": plugin_type, "plugin_group": plugin_group})
delete_all_poutput(self.session, filter_data, target_id=int(target_id))
if plugin_type and plugin_group and plugin_code:
if plugin_type not in get_types_for_plugin_group(self.session, plugin_group):
raise APIError(422, "Plugin type not found in the selected plugin group")
filter_data.update(
{"plugin_type": plugin_type, "plugin_group": plugin_group, "plugin_code": plugin_code}
)
delete_all_poutput(self.session, filter_data, target_id=int(target_id))
self.success(None)
except exceptions.InvalidTargetReference:
raise APIError(400, "Invalid target reference provided")
except exceptions.InvalidParameterType:
raise APIError(400, "Invalid parameter type provided")
| 8,385 |
1,473 | /*
* Copyright 2018 NAVER Corp.
*
* 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.navercorp.pinpoint.hbase.manager.task;
import com.navercorp.pinpoint.hbase.schema.service.HbaseSchemaService;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import java.util.List;
import java.util.Objects;
/**
* @author <NAME>
*/
public class ResetTask implements HbaseSchemaManagerTask {
private final Logger logger = LogManager.getLogger(this.getClass());
private final HbaseSchemaService hbaseSchemaService;
private final String namespace;
public ResetTask(HbaseSchemaService hbaseSchemaService, String namespace) {
this.hbaseSchemaService = Objects.requireNonNull(hbaseSchemaService, "hbaseSchemaService");
this.namespace = namespace;
}
@Override
public void run(List<String> arguments) {
logger.info("Running hbase schema manager reset task.");
logger.info("Namespace : {}", namespace);
boolean resetSuccess = hbaseSchemaService.reset(namespace);
if (resetSuccess) {
logger.info("Hbase schema change logs reset.");
} else {
logger.info("Hbase schema change logs not reset. Make sure schema management is initialized first.");
}
}
}
| 584 |
345 | <reponame>ddc/XivAlexander
#pragma once
namespace App {
namespace Network {
class SocketHook;
}
}
namespace App::Feature {
class AnimationLockLatencyHandler {
struct Implementation;
std::unique_ptr<Implementation> m_pImpl;
public:
AnimationLockLatencyHandler(Network::SocketHook* socketHook);
~AnimationLockLatencyHandler();
};
}
| 121 |
303 | #ifndef SHUMATECHLOGO_BMP_H
#define SHUMATECHLOGO_BMP_H
static unsigned char ShumaTechLogo_bmp[] = {
0x42, 0x4d, 0x36, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45,
0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1b, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x11, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x15, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x16, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x13, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x16, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x29, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
0x00, 0x2d, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x32, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x2b, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x21, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00,
0x00, 0x13, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x34, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00,
0x00, 0x2e, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x37, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x13, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
0x00, 0x4b, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00,
0x00, 0x60, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00,
0x00, 0x51, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00,
0x00, 0x17, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00,
0x00, 0x5d, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x15, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
0x00, 0x2b, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
0x00, 0x48, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00,
0x00, 0x39, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x15, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x4e, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00,
0x00, 0x13, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x2c, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00,
0x00, 0x5d, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x2e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00,
0x00, 0x6b, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00,
0x00, 0x3b, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00,
0x00, 0x4e, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00,
0x00, 0x67, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00,
0x00, 0x69, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00,
0x00, 0x55, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x1b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x78, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
0x00, 0x4b, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
0x00, 0x3c, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0xb1, 0xb1,
0xb1, 0x38, 0xc2, 0xc2, 0xc2, 0x7a, 0xcd, 0xcd, 0xcd, 0xb0, 0xde, 0xde,
0xde, 0xd2, 0xee, 0xee, 0xee, 0xe8, 0xf9, 0xf9, 0xf9, 0xf6, 0xfd, 0xfd,
0xfd, 0xfd, 0xfb, 0xfb, 0xfb, 0xf8, 0xf6, 0xf6, 0xf6, 0xea, 0xe4, 0xe4,
0xe4, 0xcb, 0xb9, 0xb9, 0xb9, 0x9e, 0x39, 0x39, 0x39, 0x6a, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00,
0x00, 0x12, 0xfd, 0xfd, 0xfd, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00,
0x00, 0x2b, 0x00, 0x00, 0x00, 0x2e, 0xa2, 0xa2, 0xa2, 0x84, 0xde, 0xde,
0xde, 0xd3, 0xf6, 0xf6, 0xf6, 0xf3, 0xfd, 0xfd, 0xfd, 0xfd, 0xf9, 0xf9,
0xf9, 0xf4, 0xe5, 0xe5, 0xe5, 0xcf, 0x8f, 0x8f, 0x8f, 0x87, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x4e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00,
0x00, 0x2b, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x62, 0xe7, 0xe7, 0xe7, 0xe2, 0xff, 0xff,
0xff, 0xff, 0x99, 0x99, 0x99, 0x94, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x63, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x27, 0xad, 0xad, 0xad, 0x77, 0xff, 0xff, 0xff, 0xff, 0xea, 0xea,
0xea, 0xe3, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x21, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x87, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x2f, 0x2a, 0x2a, 0x2a, 0x55, 0xaa, 0xaa,
0xaa, 0xa8, 0xdf, 0xdf, 0xdf, 0xda, 0xf6, 0xf6, 0xf6, 0xf4, 0xfd, 0xfd,
0xfd, 0xfe, 0xfb, 0xfb, 0xfb, 0xf8, 0xf1, 0xf1, 0xf1, 0xe0, 0xd9, 0xd9,
0xd9, 0xb6, 0x9b, 0x9b, 0x9b, 0x7d, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x34, 0x00, 0x00, 0x00, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xf8, 0xbc, 0xbc,
0xbc, 0xa8, 0x06, 0x06, 0x06, 0x74, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00,
0x00, 0x73, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x18, 0xfb, 0xfb, 0xfb, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00,
0x00, 0x32, 0xdb, 0xdb, 0xdb, 0xac, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0xca,
0xca, 0xa9, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00,
0x00, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x67, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00,
0x00, 0x4c, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x66, 0x9e, 0x9e, 0x9e, 0xa6, 0xff, 0xff,
0xff, 0xff, 0xe4, 0xe4, 0xe4, 0xd1, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00,
0x00, 0x6e, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
0x00, 0x4c, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00,
0x00, 0x4c, 0xdd, 0xdd, 0xdd, 0xce, 0xff, 0xff, 0xff, 0xff, 0xa6, 0xa6,
0xa6, 0xb0, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8c, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x25, 0x9a, 0x9a, 0x9a, 0x77, 0xf6, 0xf6, 0xf6, 0xf1, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xed, 0xe9, 0xe9,
0xe9, 0xa7, 0xcc, 0xcc, 0xcc, 0x6b, 0x9b, 0x9b, 0x9b, 0x36, 0x51, 0x51,
0x51, 0x19, 0x55, 0x55, 0x55, 0x15, 0xc9, 0xc9, 0xc9, 0x30, 0xed, 0xed,
0xed, 0x74, 0xfc, 0xfc, 0xfc, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xd2, 0xd2, 0xd2, 0xca, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00,
0x00, 0x82, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x1e, 0xf9, 0xf9, 0xf9, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0x00, 0x00,
0x00, 0x63, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00,
0x00, 0x25, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x4a, 0xa4, 0xa4,
0xa4, 0x6e, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfd, 0xfd, 0xfc, 0xad, 0xad,
0xad, 0xad, 0x40, 0x40, 0x40, 0x63, 0x13, 0x13, 0x13, 0x35, 0x90, 0x90,
0x90, 0x35, 0xee, 0xee, 0xee, 0x89, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff,
0xff, 0xff, 0x87, 0x87, 0x87, 0x82, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00,
0x00, 0x65, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x49, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00,
0x00, 0x69, 0x00, 0x00, 0x00, 0x56, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x67, 0x1d, 0x1d, 0x1d, 0x6f, 0xfa, 0xfa,
0xfa, 0xf7, 0xfd, 0xfd, 0xfd, 0xfe, 0x49, 0x49, 0x49, 0x6b, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x69, 0x32, 0x32,
0x32, 0x7e, 0xfd, 0xfd, 0xfd, 0xfd, 0xfc, 0xfc, 0xfc, 0xfe, 0x2f, 0x2f,
0x2f, 0x82, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00,
0x00, 0x2d, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x16, 0xb3, 0xb3,
0xb3, 0x6c, 0xfd, 0xfd, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xf4,
0xf4, 0xf1, 0xbe, 0xbe, 0xbe, 0xa2, 0x86, 0x86, 0x86, 0x57, 0x47, 0x47,
0x47, 0x27, 0x37, 0x37, 0x37, 0x17, 0xc2, 0xc2, 0xc2, 0x2e, 0xea, 0xea,
0xea, 0x64, 0xf9, 0xf9, 0xf9, 0xaf, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x47, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfd, 0xfd,
0xfd, 0xc1, 0xf0, 0xf0, 0xf0, 0x56, 0x36, 0x36, 0x36, 0x0e, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x06, 0x93, 0x93, 0x93, 0x1a, 0xf8, 0xf8, 0xf8, 0xd0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x85, 0x85, 0x85, 0xb1, 0x00, 0x00,
0x00, 0x8b, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00,
0x00, 0x22, 0xf8, 0xf8, 0xf8, 0xff, 0xfd, 0xfd, 0xfd, 0xff, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00,
0x00, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6d, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x4b, 0xe4, 0xe4,
0xe4, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xbe, 0xbe, 0xb5, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x08, 0xf3, 0xf3, 0xf3, 0x97, 0xff, 0xff,
0xff, 0xff, 0xdf, 0xdf, 0xdf, 0xc4, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x69, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x6b, 0x2c, 0x2c, 0x2c, 0x67, 0xfd, 0xfd,
0xfd, 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, 0x1f, 0x1f, 0x1f, 0x82, 0x00, 0x00,
0x00, 0x79, 0x00, 0x00, 0x00, 0x65, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x66, 0xd5, 0xd5,
0xd5, 0xb8, 0xff, 0xff, 0xff, 0xff, 0xc6, 0xc6, 0xc6, 0xa3, 0x00, 0x00,
0x00, 0x69, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00,
0x00, 0x7a, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x70, 0xa4, 0xa4,
0xa4, 0xb9, 0xff, 0xff, 0xff, 0xff, 0xd3, 0xd3, 0xd3, 0xdd, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x0c, 0x76, 0x76, 0x76, 0x2b, 0xfa, 0xfa,
0xfa, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xdf, 0xdf, 0xd8, 0x2d, 0x2d,
0x2d, 0x65, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00,
0x00, 0x55, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00,
0x00, 0x21, 0x00, 0x00, 0x00, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x43, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x15, 0xa6, 0xa6, 0xa6, 0x56, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xdc, 0xdc, 0xe4, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00,
0x00, 0x22, 0xf8, 0xf8, 0xf8, 0xff, 0xfd, 0xfd, 0xfd, 0xff, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00,
0x00, 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x7a, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x4e, 0xf7, 0xf7,
0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0x5e, 0x5e, 0x5e, 0x7f, 0x00, 0x00,
0x00, 0x63, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x04, 0xdc, 0xdc, 0xdc, 0x3b, 0xff, 0xff,
0xff, 0xff, 0xf5, 0xf5, 0xf5, 0xe8, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6e, 0x00, 0x00, 0x00, 0x6f, 0x9a, 0x9a, 0x9a, 0x9e, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x89, 0x89, 0x89, 0xab, 0x00, 0x00,
0x00, 0x7a, 0x00, 0x00, 0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x66, 0x77, 0x77,
0x77, 0x6d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0x83, 0x83, 0xac, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x12, 0xe3, 0xe3, 0xe3, 0x8c, 0xff, 0xff,
0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xe8, 0x19, 0x19, 0x19, 0x6e, 0x00, 0x00,
0x00, 0x4e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00,
0x00, 0x6b, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00,
0x00, 0x44, 0x00, 0x00, 0x00, 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x45, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x21, 0x00, 0x00, 0x00, 0x2f, 0x18, 0x18, 0x18, 0x49, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xfb, 0x00, 0x00,
0x00, 0x89, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00,
0x00, 0x1e, 0xf9, 0xf9, 0xf9, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0x00, 0x00,
0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x86, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x4f, 0xfc, 0xfc,
0xfc, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x18, 0x18, 0x18, 0x69, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x04, 0x8b, 0x8b, 0x8b, 0x16, 0xff, 0xff,
0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xf8, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6f, 0x00, 0x00, 0x00, 0x75, 0xd8, 0xd8, 0xd8, 0xd3, 0xff, 0xff,
0xff, 0xff, 0xf9, 0xf9, 0xf9, 0xf8, 0xd1, 0xd1, 0xd1, 0xd1, 0x00, 0x00,
0x00, 0x6f, 0x00, 0x00, 0x00, 0x69, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00,
0x00, 0x46, 0xf5, 0xf5, 0xf5, 0xd5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf8, 0xf8, 0xf8, 0xf7, 0x13, 0x13, 0x13, 0x76, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x26, 0x00, 0x00, 0x00, 0x17, 0xf7, 0xf7, 0xf7, 0xd0, 0xff, 0xff,
0xff, 0xff, 0x9c, 0x9c, 0x9c, 0x9c, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x4a, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x63, 0x00, 0x00, 0x00, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x59, 0x55, 0x55, 0x55, 0x87, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xfa, 0xfa, 0xfb, 0x00, 0x00,
0x00, 0x79, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x18, 0xfb, 0xfb, 0xfb, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0x00, 0x00,
0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x70, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x86, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00, 0x00, 0x4f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x72, 0x19, 0x19, 0x19, 0x82, 0xfb, 0xfb, 0xfb, 0xfb, 0xe7, 0xe7,
0xe7, 0xe4, 0xca, 0xca, 0xca, 0xc6, 0xfa, 0xfa, 0xfa, 0xf8, 0x14, 0x14,
0x14, 0x64, 0x00, 0x00, 0x00, 0x63, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00,
0x00, 0x45, 0xd0, 0xd0, 0xd0, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xe3,
0xe3, 0xb8, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x49, 0xda, 0xda, 0xda, 0xbc, 0xff, 0xff,
0xff, 0xff, 0xc8, 0xc8, 0xc8, 0xc8, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x71, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x26, 0x00, 0x00, 0x00, 0x16, 0xfc, 0xfc, 0xfc, 0xf4, 0xff, 0xff,
0xff, 0xff, 0x3c, 0x3c, 0x3c, 0x6e, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x4e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00,
0x00, 0x80, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x63, 0x00, 0x00, 0x00, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x72, 0x42, 0x42, 0x42, 0x92, 0xe3, 0xe3, 0xe3, 0xe9, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe2, 0xe2, 0xe2, 0xe3, 0x00, 0x00,
0x00, 0x5d, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00,
0x00, 0x13, 0xfd, 0xfd, 0xfd, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x7a, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x4e, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x76, 0x82, 0x82, 0x82, 0xae, 0xff, 0xff, 0xff, 0xff, 0xac, 0xac,
0xac, 0xb9, 0x84, 0x84, 0x84, 0x92, 0xff, 0xff, 0xff, 0xff, 0x95, 0x95,
0x95, 0x83, 0x00, 0x00, 0x00, 0x5b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x46, 0x49, 0x49, 0x49, 0x2d, 0xfd, 0xfd, 0xfd, 0xf4, 0xfd, 0xfd,
0xfd, 0xf7, 0x2e, 0x2e, 0x2e, 0x53, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00,
0x00, 0x61, 0x24, 0x24, 0x24, 0x61, 0xfa, 0xfa, 0xfa, 0xf9, 0xff, 0xff,
0xff, 0xff, 0x6e, 0x6e, 0x6e, 0x92, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x11, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff,
0xff, 0xff, 0x0e, 0x0e, 0x0e, 0x5b, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x45, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x29, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x7a, 0x5f, 0x5f, 0x5f, 0xa1, 0xc4, 0xc4,
0xc4, 0xd5, 0xfc, 0xfc, 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa1, 0xa1, 0xa1, 0x94, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x0e, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x6d, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x4c, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x7a, 0xc9, 0xc9, 0xc9, 0xda, 0xff, 0xff, 0xff, 0xff, 0x4d, 0x4d,
0x4d, 0x8e, 0x12, 0x12, 0x12, 0x5f, 0xfb, 0xfb, 0xfb, 0xf6, 0xdd, 0xdd,
0xdd, 0xb6, 0x00, 0x00, 0x00, 0x52, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x21, 0xf3, 0xf3, 0xf3, 0xa1, 0xff, 0xff,
0xff, 0xff, 0xbe, 0xbe, 0xbe, 0x8b, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
0x00, 0x6a, 0x9d, 0x9d, 0x9d, 0xa7, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0,
0xf0, 0xee, 0x02, 0x02, 0x02, 0x6b, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00,
0x00, 0x27, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x0c, 0xfd, 0xfd, 0xfd, 0xf0, 0xff, 0xff,
0xff, 0xff, 0x3e, 0x3e, 0x3e, 0x5e, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x43, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x4a, 0x00, 0x00, 0x00, 0x67, 0x44, 0x44, 0x44, 0x91, 0xa9, 0xa9,
0xa9, 0xc5, 0xea, 0xea, 0xea, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xb4, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,
0x00, 0x1d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00,
0x00, 0x25, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x4a, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x11, 0x11,
0x11, 0x83, 0xf8, 0xf8, 0xf8, 0xfa, 0xe7, 0xe7, 0xe7, 0xee, 0x00, 0x00,
0x00, 0x74, 0x00, 0x00, 0x00, 0x4f, 0xe7, 0xe7, 0xe7, 0xbb, 0xfa, 0xfa,
0xfa, 0xef, 0x0a, 0x0a, 0x0a, 0x48, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x20, 0xd1, 0xd1, 0xd1, 0x3e, 0xff, 0xff,
0xff, 0xff, 0xf2, 0xf2, 0xf2, 0xd4, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00,
0x00, 0x6e, 0xe1, 0xe1, 0xe1, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xaf,
0xaf, 0xc0, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x1d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x67, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
0x00, 0x26, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x16, 0x00, 0x00, 0x00, 0x0f, 0xf9, 0xf9, 0xf9, 0xc6, 0xff, 0xff,
0xff, 0xff, 0xad, 0xad, 0xad, 0x80, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00,
0x00, 0x25, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00,
0x00, 0x23, 0x00, 0x00, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00,
0x00, 0x47, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x24, 0x03, 0x03, 0x03, 0x47, 0x86, 0x86,
0x86, 0x9b, 0xdb, 0xdb, 0xdb, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xf7, 0xf7, 0xea, 0xc2, 0xc2,
0xc2, 0x7b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x47, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00,
0x00, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7c, 0x7c,
0x7c, 0xa6, 0xff, 0xff, 0xff, 0xff, 0xaa, 0xaa, 0xaa, 0xc8, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x43, 0xc7, 0xc7, 0xc7, 0x72, 0xff, 0xff,
0xff, 0xff, 0x96, 0x96, 0x96, 0x6b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x72, 0x00, 0x00,
0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x0c, 0xfb, 0xfb,
0xfb, 0xd0, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x6f, 0x6f, 0x65, 0x55, 0x55,
0x55, 0x84, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x44, 0x44,
0x44, 0x8e, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00,
0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x68, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00,
0x00, 0x43, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x1a, 0xec, 0xec, 0xec, 0x7a, 0xff, 0xff,
0xff, 0xff, 0xf5, 0xf5, 0xf5, 0xd6, 0x0d, 0x0d, 0x0d, 0x4a, 0x00, 0x00,
0x00, 0x5e, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x40, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x14, 0x7c, 0x7c, 0x7c, 0x52, 0xe7, 0xe7, 0xe7, 0xdd, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xfb, 0xfb, 0xf6, 0xe7, 0xe7,
0xe7, 0xb7, 0xc3, 0xc3, 0xc3, 0x66, 0x22, 0x22, 0x22, 0x1e, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00,
0x00, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcd, 0xcd,
0xcd, 0xcc, 0xff, 0xff, 0xff, 0xff, 0x58, 0x58, 0x58, 0x95, 0x00, 0x00,
0x00, 0x5a, 0x00, 0x00, 0x00, 0x34, 0x5b, 0x5b, 0x5b, 0x27, 0xfd, 0xfd,
0xfd, 0xfa, 0xdf, 0xdf, 0xdf, 0xa3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0xf3, 0xf3,
0xf3, 0x6c, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xdb, 0xdb, 0xa5, 0xc6, 0xc6,
0xc6, 0xb6, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe3, 0x00, 0x00,
0x00, 0x6a, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00,
0x00, 0x6d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x25, 0x6e, 0x6e, 0x6e, 0x1e, 0xfd, 0xfd,
0xfd, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xe6, 0xe6, 0xb1, 0x11, 0x11,
0x11, 0x4a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
0x00, 0x64, 0x02, 0x02, 0x02, 0x63, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00,
0x00, 0x44, 0x00, 0x00, 0x00, 0x2e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0xa2, 0xa2,
0xa2, 0x3a, 0xfa, 0xfa, 0xfa, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xfc, 0xe0, 0xe0,
0xe0, 0xc7, 0xb7, 0xb7, 0xb7, 0x76, 0x3c, 0x3c, 0x3c, 0x26, 0x00, 0x00,
0x00, 0x14, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x2f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00,
0x00, 0x44, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xf9,
0xf9, 0xf5, 0xf2, 0xf2, 0xf2, 0xec, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00,
0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x10, 0xf9, 0xf9,
0xf9, 0xbb, 0xfa, 0xfa, 0xfa, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00,
0x00, 0x2e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0xb8, 0xb8,
0xb8, 0x12, 0xfd, 0xfd, 0xfd, 0xf4, 0xfb, 0xfb, 0xfb, 0xed, 0xf9, 0xf9,
0xf9, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xa8, 0xa8, 0xa8, 0xa0, 0x00, 0x00,
0x00, 0x4c, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x4d, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x10, 0xe8, 0xe8,
0xe8, 0x43, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xf5,
0xf5, 0xd7, 0xb1, 0xb1, 0xb1, 0x80, 0x43, 0x43, 0x43, 0x5e, 0x0e, 0x0e,
0x0e, 0x59, 0x2e, 0x2e, 0x2e, 0x69, 0x75, 0x75, 0x75, 0x86, 0xbe, 0xbe,
0xbe, 0xb1, 0xf3, 0xf3, 0xf3, 0xea, 0x00, 0x00, 0x00, 0x4e, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x26, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0xf2, 0xf2,
0xf2, 0xb1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xfd,
0xfd, 0xfe, 0xb4, 0xb4, 0xb4, 0xca, 0x36, 0x36, 0x36, 0x71, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x1b, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00,
0x00, 0x24, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00,
0x00, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xda, 0xda, 0xda, 0xa7, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
0x00, 0x23, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x08, 0xf5, 0xf5,
0xf5, 0x6a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00,
0x00, 0x1a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x02, 0xfa, 0xfa, 0xfa, 0x9d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xfd, 0xfd, 0xfd, 0xfa, 0x45, 0x45, 0x45, 0x42, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0a, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x8e, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
0x00, 0x21, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x05, 0xfd, 0xfd, 0xfd, 0xff, 0xfd, 0xfd, 0xfd, 0xff, 0xfd, 0xfd,
0xfd, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x04, 0xf2, 0xf2, 0xf2, 0x3d, 0xfd, 0xfd, 0xfd, 0xe1, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,
0x00, 0x22, 0x00, 0x00, 0x00, 0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0xfc, 0xfc,
0xfc, 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x93, 0x93,
0x93, 0xb9, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00,
0x00, 0x14, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0b, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xc7, 0xc7, 0xc7, 0x4e, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0xea, 0xea,
0xea, 0x19, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0xf5, 0xf5, 0xf5, 0x35, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xf6, 0xf6, 0xf6, 0xb4, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
0x00, 0x11, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x11, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x90, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00,
0x00, 0x26, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x00, 0x0b, 0xf6, 0xf6, 0xf6, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0xf8, 0xf8,
0xf8, 0xff, 0xf9, 0xf9, 0xf9, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xfd, 0xfd,
0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0xd0, 0xd0, 0xd0, 0x0b, 0xf5, 0xf5,
0xf5, 0x6b, 0xfa, 0xfa, 0xfa, 0xbc, 0xfd, 0xfd, 0xfd, 0xea, 0xff, 0xff,
0xff, 0xfc, 0xfd, 0xfd, 0xfd, 0xf7, 0xfa, 0xfa, 0xfa, 0xdc, 0xf1, 0xf1,
0xf1, 0xae, 0xdc, 0xdc, 0xdc, 0x6e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0xff, 0xff,
0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x15, 0x15,
0x15, 0x80, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x4d, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00,
0x00, 0x23, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00,
0x00, 0x2e, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x12, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x25, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x96, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfc, 0xfc,
0xfc, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2b, 0x2b,
0x2b, 0x70, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00,
0x00, 0x65, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
0x00, 0x47, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x2a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
0x00, 0x41, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x47, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x9b, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00,
0x00, 0x56, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00,
0x00, 0x42, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00,
0x00, 0x38, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xf9, 0xf9,
0xf9, 0x95, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc2, 0xc2,
0xc2, 0x9d, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00,
0x00, 0x6c, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00,
0x00, 0x64, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00,
0x00, 0x69, 0x68, 0x68, 0x68, 0x89, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x47, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x65, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x96, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00,
0x00, 0x6d, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe9, 0xe9,
0xe9, 0x18, 0xfd, 0xfd, 0xfd, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xfe, 0xdb, 0xdb, 0xdb, 0xae, 0x7d, 0x7d, 0x7d, 0x74, 0x27, 0x27,
0x27, 0x61, 0x08, 0x08, 0x08, 0x5f, 0x24, 0x24, 0x24, 0x68, 0x5d, 0x5d,
0x5d, 0x7e, 0x96, 0x96, 0x96, 0x99, 0xcc, 0xcc, 0xcc, 0xbf, 0xf3, 0xf3,
0xf3, 0xeb, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00,
0x00, 0x37, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x77, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00,
0x00, 0x66, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00,
0x00, 0x62, 0x00, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00,
0x00, 0x52, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xed, 0xed, 0xed, 0x2b, 0xfd, 0xfd, 0xfd, 0xd2, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00,
0x00, 0x1e, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x37, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
0x00, 0x0a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x99, 0x99, 0x99, 0x05, 0xf6, 0xf6,
0xf6, 0x56, 0xf8, 0xf8, 0xf8, 0xa9, 0xfc, 0xfc, 0xfc, 0xd9, 0xfd, 0xfd,
0xfd, 0xf2, 0xff, 0xff, 0xff, 0xfc, 0xfd, 0xfd, 0xfd, 0xf7, 0xfb, 0xfb,
0xfb, 0xe8, 0xf7, 0xf7, 0xf7, 0xd1, 0xf0, 0xf0, 0xf0, 0xaf, 0xe6, 0xe6,
0xe6, 0x86, 0xcf, 0xcf, 0xcf, 0x56, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x19, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif
| 70,949 |
679 | /**************************************************************
*
* 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.
*
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_scfilt.hxx"
#include "namebuff.hxx"
#include <tools/urlobj.hxx>
#include <string.h>
#include "rangenam.hxx"
#include "document.hxx"
#include "compiler.hxx"
#include "scextopt.hxx"
#include "root.hxx"
#include "tokstack.hxx"
#include "xltools.hxx"
#include "xiroot.hxx"
sal_uInt32 StringHashEntry::MakeHashCode( const String& r )
{
register sal_uInt32 n = 0;
const sal_Unicode* pAkt = r.GetBuffer();
register sal_Unicode cAkt = *pAkt;
while( cAkt )
{
n *= 70;
n += ( sal_uInt32 ) cAkt;
pAkt++;
cAkt = *pAkt;
}
return n;
}
NameBuffer::~NameBuffer()
{
register StringHashEntry* pDel = ( StringHashEntry* ) List::First();
while( pDel )
{
delete pDel;
pDel = ( StringHashEntry* ) List::Next();
}
}
//void NameBuffer::operator <<( const SpString &rNewString )
void NameBuffer::operator <<( const String &rNewString )
{
DBG_ASSERT( Count() + nBase < 0xFFFF,
"*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" );
List::Insert( new StringHashEntry( rNewString ), LIST_APPEND );
}
#ifdef DBG_UTIL
sal_uInt16 nShrCnt;
#endif
size_t ShrfmlaBuffer::ScAddressHashFunc::operator() (const ScAddress &addr) const
{
// Use something simple, it is just a hash.
return static_cast< sal_uInt16 >( addr.Row() ) | (static_cast< sal_uInt8 >( addr.Col() ) << 16);
}
const size_t nBase = 16384; // Range~ und Shared~ Dingens mit jeweils der Haelfte Ids
ShrfmlaBuffer::ShrfmlaBuffer( RootData* pRD ) :
ExcRoot( pRD ),
mnCurrIdx (nBase)
{
#ifdef DBG_UTIL
nShrCnt = 0;
#endif
}
ShrfmlaBuffer::~ShrfmlaBuffer()
{
}
void ShrfmlaBuffer::Clear()
{
index_hash.clear();
// do not clear index_list, index calculation depends on complete list size...
// do not change mnCurrIdx
}
void ShrfmlaBuffer::Store( const ScRange& rRange, const ScTokenArray& rToken )
{
String aName( CreateName( rRange.aStart ) );
DBG_ASSERT( mnCurrIdx <= 0xFFFF, "*ShrfmlaBuffer::Store(): Gleich wird mir schlecht...!" );
ScRangeData* pData = new ScRangeData( pExcRoot->pIR->GetDocPtr(), aName, rToken, rRange.aStart, RT_SHARED );
const ScAddress& rMaxPos = pExcRoot->pIR->GetMaxPos();
pData->SetMaxCol(rMaxPos.Col());
pData->SetMaxRow(rMaxPos.Row());
pData->SetIndex( static_cast< sal_uInt16 >( mnCurrIdx ) );
pExcRoot->pIR->GetNamedRanges().Insert( pData );
index_hash[rRange.aStart] = static_cast< sal_uInt16 >( mnCurrIdx );
index_list.push_front (rRange);
++mnCurrIdx;
}
sal_uInt16 ShrfmlaBuffer::Find( const ScAddress & aAddr ) const
{
ShrfmlaHash::const_iterator hash = index_hash.find (aAddr);
if (hash != index_hash.end())
return hash->second;
// It was not hashed on the top left corner ? do a brute force search
unsigned int ind = nBase;
for (ShrfmlaList::const_iterator ptr = index_list.end(); ptr != index_list.begin() ; ind++)
if ((--ptr)->In (aAddr))
return static_cast< sal_uInt16 >( ind );
return static_cast< sal_uInt16 >( mnCurrIdx );
}
#define SHRFMLA_BASENAME "SHARED_FORMULA_"
String ShrfmlaBuffer::CreateName( const ScRange& r )
{
String aName( RTL_CONSTASCII_USTRINGPARAM( SHRFMLA_BASENAME ) );
aName += String::CreateFromInt32( r.aStart.Col() );
aName.Append( '_' );
aName += String::CreateFromInt32( r.aStart.Row() );
aName.Append( '_' );
aName += String::CreateFromInt32( r.aEnd.Col() );
aName.Append( '_' );
aName += String::CreateFromInt32( r.aEnd.Row() );
aName.Append( '_' );
aName += String::CreateFromInt32( r.aStart.Tab() );
return aName;
}
ExtSheetBuffer::~ExtSheetBuffer()
{
Cont *pAkt = ( Cont * ) List::First();
while( pAkt )
{
delete pAkt;
pAkt = ( Cont * ) List::Next();
}
}
sal_Int16 ExtSheetBuffer::Add( const String& rFPAN, const String& rTN, const sal_Bool bSWB )
{
List::Insert( new Cont( rFPAN, rTN, bSWB ), LIST_APPEND );
// return 1-based index of EXTERNSHEET
return static_cast< sal_Int16 >( List::Count() );
}
sal_Bool ExtSheetBuffer::GetScTabIndex( sal_uInt16 nExcIndex, sal_uInt16& rScIndex )
{
DBG_ASSERT( nExcIndex,
"*ExtSheetBuffer::GetScTabIndex(): Sheet-Index == 0!" );
nExcIndex--;
Cont* pCur = ( Cont * ) List::GetObject( nExcIndex );
sal_uInt16& rTabNum = pCur->nTabNum;
if( pCur )
{
if( rTabNum < 0xFFFD )
{
rScIndex = rTabNum;
return sal_True;
}
if( rTabNum == 0xFFFF )
{// neue Tabelle erzeugen
SCTAB nNewTabNum;
if( pCur->bSWB )
{// Tabelle ist im selben Workbook!
if( pExcRoot->pIR->GetDoc().GetTable( pCur->aTab, nNewTabNum ) )
{
rScIndex = rTabNum = static_cast<sal_uInt16>(nNewTabNum);
return sal_True;
}
else
rTabNum = 0xFFFD;
}
else if( pExcRoot->pIR->GetDocShell() )
{// Tabelle ist 'echt' extern
if( pExcRoot->pIR->GetExtDocOptions().GetDocSettings().mnLinkCnt == 0 )
{
String aURL( ScGlobal::GetAbsDocName( pCur->aFile,
pExcRoot->pIR->GetDocShell() ) );
String aTabName( ScGlobal::GetDocTabName( aURL, pCur->aTab ) );
if( pExcRoot->pIR->GetDoc().LinkExternalTab( nNewTabNum, aTabName, aURL, pCur->aTab ) )
{
rScIndex = rTabNum = static_cast<sal_uInt16>(nNewTabNum);
return sal_True;
}
else
rTabNum = 0xFFFE; // Tabelle einmal nicht angelegt -> wird
// wohl auch nicht mehr gehen...
}
else
rTabNum = 0xFFFE;
}
}
}
return sal_False;
}
sal_Bool ExtSheetBuffer::IsLink( const sal_uInt16 nExcIndex ) const
{
DBG_ASSERT( nExcIndex > 0, "*ExtSheetBuffer::IsLink(): Index muss >0 sein!" );
Cont* pRet = ( Cont * ) List::GetObject( nExcIndex - 1 );
if( pRet )
return pRet->bLink;
else
return sal_False;
}
sal_Bool ExtSheetBuffer::GetLink( const sal_uInt16 nExcIndex, String& rAppl, String& rDoc ) const
{
DBG_ASSERT( nExcIndex > 0, "*ExtSheetBuffer::GetLink(): Index muss >0 sein!" );
Cont* pRet = ( Cont * ) List::GetObject( nExcIndex - 1 );
if( pRet )
{
rAppl = pRet->aFile;
rDoc = pRet->aTab;
return sal_True;
}
else
return sal_False;
}
void ExtSheetBuffer::Reset( void )
{
Cont *pAkt = ( Cont * ) List::First();
while( pAkt )
{
delete pAkt;
pAkt = ( Cont * ) List::Next();
}
List::Clear();
}
sal_Bool ExtName::IsDDE( void ) const
{
return ( nFlags & 0x0001 ) != 0;
}
sal_Bool ExtName::IsOLE( void ) const
{
return ( nFlags & 0x0002 ) != 0;
}
ExtNameBuff::ExtNameBuff( const XclImpRoot& rRoot ) :
XclImpRoot( rRoot )
{
}
void ExtNameBuff::AddDDE( const String& rName, sal_Int16 nRefIdx )
{
ExtName aNew( rName, 0x0001 );
maExtNames[ nRefIdx ].push_back( aNew );
}
void ExtNameBuff::AddOLE( const String& rName, sal_Int16 nRefIdx, sal_uInt32 nStorageId )
{
ExtName aNew( rName, 0x0002 );
aNew.nStorageId = nStorageId;
maExtNames[ nRefIdx ].push_back( aNew );
}
void ExtNameBuff::AddName( const String& rName, sal_Int16 nRefIdx )
{
ExtName aNew( GetScAddInName( rName ), 0x0004 );
maExtNames[ nRefIdx ].push_back( aNew );
}
const ExtName* ExtNameBuff::GetNameByIndex( sal_Int16 nRefIdx, sal_uInt16 nNameIdx ) const
{
DBG_ASSERT( nNameIdx > 0, "ExtNameBuff::GetNameByIndex() - invalid name index" );
ExtNameMap::const_iterator aIt = maExtNames.find( nRefIdx );
return ((aIt != maExtNames.end()) && (0 < nNameIdx) && (nNameIdx <= aIt->second.size())) ? &aIt->second[ nNameIdx - 1 ] : 0;
}
void ExtNameBuff::Reset( void )
{
maExtNames.clear();
}
| 3,521 |
8,315 | package com.airbnb.epoxy;
/** Helper to store relevant information about a model that we need to determine if it changed. */
class ModelState {
long id;
int hashCode;
int position;
EpoxyModel<?> model;
/**
* A link to the item with the same id in the other list when diffing two lists. This will be null
* if the item doesn't exist, in the case of insertions or removals. This is an optimization to
* prevent having to look up the matching pair in a hash map every time.
*/
ModelState pair;
/**
* How many movement operations have been applied to this item in order to update its position. As
* we find more item movements we need to update the position of affected items in the list in
* order to correctly calculate the next movement. Instead of iterating through all items in the
* list every time a movement operation happens we keep track of how many of these operations have
* been applied to an item, and apply all new operations in order when we need to get this item's
* up to date position.
*/
int lastMoveOp;
static ModelState build(EpoxyModel<?> model, int position, boolean immutableModel) {
ModelState state = new ModelState();
state.lastMoveOp = 0;
state.pair = null;
state.id = model.id();
state.position = position;
if (immutableModel) {
state.model = model;
} else {
state.hashCode = model.hashCode();
}
return state;
}
/**
* Used for an item inserted into the new list when we need to track moves that effect the
* inserted item in the old list.
*/
void pairWithSelf() {
if (pair != null) {
throw new IllegalStateException("Already paired.");
}
pair = new ModelState();
pair.lastMoveOp = 0;
pair.id = id;
pair.position = position;
pair.hashCode = hashCode;
pair.pair = this;
pair.model = model;
}
@Override
public String toString() {
return "ModelState{"
+ "id=" + id
+ ", model=" + model
+ ", hashCode=" + hashCode
+ ", position=" + position
+ ", pair=" + pair
+ ", lastMoveOp=" + lastMoveOp
+ '}';
}
}
| 706 |
319 | import unittest
from jbrowse_selenium import JBrowseTest
from selenium.webdriver.support.wait import WebDriverWait
class JasmineTest( JBrowseTest, unittest.TestCase ):
def baseURL( self ):
if not self.base_url:
superbase = super( JasmineTest, self ).baseURL()
self.base_url = superbase.replace('index.html','tests/js_tests/index.html')
return self.base_url
def setUp( self ):
super( JasmineTest, self ).setUp()
def test_jasmine( self ):
WebDriverWait(self, 30*self.time_dilation).until(lambda self: self.does_element_exist('.symbolSummary') and not self.does_element_exist('.symbolSummary .pending'))
self.assert_no_element('.failingAlert')
self.assert_no_js_errors()
| 299 |
1,444 |
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledArtifactPermanent;
/**
*
* @author Loki
*/
public final class Esperzoa extends CardImpl {
public Esperzoa (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{2}{U}");
this.subtype.add(SubType.JELLYFISH);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
//Flying
this.addAbility(FlyingAbility.getInstance());
//At the beginning of your upkeep, return an artifact you control to its owner's hand.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(new FilterControlledArtifactPermanent()), TargetController.YOU, false));
}
public Esperzoa (final Esperzoa card) {
super(card);
}
@Override
public Esperzoa copy() {
return new Esperzoa(this);
}
}
| 490 |
1,056 | <filename>ide/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestRepository.java
/*
* 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.netbeans.modules.bugtracking.api;
import java.awt.Image;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.event.ChangeListener;
import org.netbeans.modules.bugtracking.TestRepository;
import org.netbeans.modules.bugtracking.spi.RepositoryController;
import org.netbeans.modules.bugtracking.spi.RepositoryInfo;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
/**
*
* @author tomas
*/
public class APITestRepository extends TestRepository {
static final String ID = "apirepo";
static final String DISPLAY_NAME = "apirepo display name";
static final String URL = "http://test.api/repo";
static final String TOOLTIP = "apirepo tooltip";
static final Image ICON = ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/repository.png", true);
private RepositoryInfo info;
private APITestRepositoryController controller;
private List<APITestQuery> queries;
private HashMap<String, APITestIssue> issues;
APITestIssue newIssue;
APITestQuery newQuery;
boolean canAttachFiles = false;
public APITestRepository(RepositoryInfo info) {
this.info = info;
}
public APITestRepository(String id) {
this(id, APITestConnector.ID_CONNECTOR);
}
public APITestRepository(String id, String cid) {
this.info = new RepositoryInfo(id, cid, URL, DISPLAY_NAME, TOOLTIP, null, null, null, null);
}
@Override
public RepositoryInfo getInfo() {
return info;
}
@Override
public Image getIcon() {
return ICON;
}
@Override
public synchronized Collection<APITestIssue> getIssues(String... ids) {
if(issues == null) {
issues = new HashMap<String, APITestIssue>();
}
List<APITestIssue> ret = new LinkedList<APITestIssue>();
for (String id : ids) {
APITestIssue i = issues.get(id);
if(i == null) {
i = new APITestIssue(id, this);
issues.put(id, i);
}
ret.add(i);
}
return ret;
}
@Override
public APITestRepositoryController getController() {
if(controller == null) {
controller = new APITestRepositoryController();
}
return controller;
}
@Override
public APITestQuery createQuery() {
newQuery = new APITestQuery(null, this);
return newQuery;
}
@Override
public APITestIssue createIssue() {
newIssue = new APITestIssue(null, this, true);
return newIssue;
}
@Override
public APITestIssue createIssue(String summary, String description) {
newIssue = new APITestIssue(null, this, true, summary, description);
return newIssue;
}
@Override
public Collection<APITestQuery> getQueries() {
if(queries == null) {
queries = Arrays.asList(new APITestQuery[] {new APITestQuery(APITestQuery.FIRST_QUERY_NAME, this), new APITestQuery(APITestQuery.SECOND_QUERY_NAME, this)});
}
return queries;
}
@Override
public synchronized Collection<APITestIssue> simpleSearch(String criteria) {
if(issues == null) {
issues = new HashMap<String, APITestIssue>();
}
List<APITestIssue> ret = new LinkedList<APITestIssue>();
APITestIssue i = issues.get(criteria);
if(i != null) {
ret.add(i);
}
return ret;
}
@Override
public boolean canAttachFile() {
return canAttachFiles;
}
private final PropertyChangeSupport support = new PropertyChangeSupport(this);
@Override
public void removePropertyChangeListener(PropertyChangeListener listener) {
support.removePropertyChangeListener(listener);
}
@Override
public void addPropertyChangeListener(PropertyChangeListener listener) {
support.addPropertyChangeListener(listener);
}
void fireQueryChangeEvent() {
support.firePropertyChange(new PropertyChangeEvent(this, Repository.EVENT_QUERY_LIST_CHANGED, null, null));
}
void fireAttributesChangeEvent() {
support.firePropertyChange(new PropertyChangeEvent(this, Repository.EVENT_ATTRIBUTES_CHANGED, null, null));
}
class APITestRepositoryController implements RepositoryController {
String name;
String url;
public APITestRepositoryController() {
this.name = info.getDisplayName();
this.url = info.getUrl();
}
@Override
public JComponent getComponent() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public HelpCtx getHelpCtx() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public boolean isValid() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void populate() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public String getErrorMessage() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void applyChanges() {
info = new RepositoryInfo(
info.getID(),
info.getConnectorId(),
url,
name,
info.getTooltip(),
null, null, null, null);
}
@Override
public void addChangeListener(ChangeListener l) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void removeChangeListener(ChangeListener l) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public void setDisplayName(String name) {
this.name = name;
}
public void setURL(String url) {
this.url = url;
}
@Override
public void cancelChanges() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
}
| 3,038 |
339 | {
"id": "avg_execution_time_vs_task_id",
"title": "Average Task Completion Times By User",
"type": "gadget",
"category": "Subscribers",
"thumbnail": "store://gadget/avg_execution_time_vs_task_id/index.png",
"settings": {
"personalize": true
},
"data": {
"url": "store://gadget/avg_execution_time_vs_task_id/index.xml"
},
"description": "BPS analytics graphs",
"listen": {
"channel5": {
"type": "user_id",
"description": "Listening to user id"
}
}
} | 212 |
14,668 | <reponame>zealoussnow/chromium
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ash/login/saml/in_session_password_sync_manager_factory.h"
#include "ash/constants/ash_features.h"
#include "chrome/browser/ash/login/saml/in_session_password_sync_manager.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_context.h"
namespace ash {
// static
InSessionPasswordSyncManagerFactory*
InSessionPasswordSyncManagerFactory::GetInstance() {
return base::Singleton<InSessionPasswordSyncManagerFactory>::get();
}
// static
InSessionPasswordSyncManager*
InSessionPasswordSyncManagerFactory::GetForProfile(Profile* profile) {
if (!features::IsSamlReauthenticationOnLockscreenEnabled())
return nullptr;
return static_cast<InSessionPasswordSyncManager*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
InSessionPasswordSyncManagerFactory::InSessionPasswordSyncManagerFactory()
: BrowserContextKeyedServiceFactory(
"InSessionPasswordSyncManager",
BrowserContextDependencyManager::GetInstance()) {}
InSessionPasswordSyncManagerFactory::~InSessionPasswordSyncManagerFactory() =
default;
KeyedService* InSessionPasswordSyncManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = static_cast<Profile*>(context);
// InSessionPasswordSyncManager should be created for the primary user only.
if (!ProfileHelper::IsPrimaryProfile(profile)) {
return nullptr;
}
return new InSessionPasswordSyncManager(profile);
}
} // namespace ash
| 596 |
1,752 | <gh_stars>1000+
package cn.myperf4j.base.metric.exporter.log.influxdb;
import cn.myperf4j.base.metric.JvmBufferPoolMetrics;
import cn.myperf4j.base.metric.formatter.JvmBufferPoolMetricsFormatter;
import cn.myperf4j.base.metric.formatter.influxdb.InfluxJvmBufferPoolMetricsFormatter;
import cn.myperf4j.base.metric.exporter.log.AbstractLogJvmBufferPoolMetricsExporter;
import java.util.Collections;
/**
* Created by LinShunkang on 2018/8/25
*/
public class InfluxLogJvmBufferPoolMetricsExporter extends AbstractLogJvmBufferPoolMetricsExporter {
private static final JvmBufferPoolMetricsFormatter METRICS_FORMATTER = new InfluxJvmBufferPoolMetricsFormatter();
@Override
public void process(JvmBufferPoolMetrics metrics, long processId, long startMillis, long stopMillis) {
logger.log(METRICS_FORMATTER.format(Collections.singletonList(metrics), startMillis, stopMillis));
}
}
| 325 |
852 | #include "FWCore/Framework/interface/MakerMacros.h"
#include "CalibFormats/SiStripObjects/test/plugins/testSiStripHashedDetId.h"
DEFINE_FWK_MODULE(testSiStripHashedDetId);
| 68 |
6,514 | <filename>blade-auth/src/main/java/org/springblade/auth/granter/SocialTokenGranter.java
/**
* Copyright (c) 2018-2028, <NAME> 庄骞 (<EMAIL>).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.springblade.auth.granter;
import lombok.AllArgsConstructor;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.request.AuthRequest;
import org.springblade.auth.utils.TokenUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.social.props.SocialProperties;
import org.springblade.core.social.utils.SocialUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.WebUtil;
import org.springblade.system.user.entity.UserInfo;
import org.springblade.system.user.entity.UserOauth;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
* SocialTokenGranter
*
* @author Chill
*/
@Component
@AllArgsConstructor
public class SocialTokenGranter implements ITokenGranter {
public static final String GRANT_TYPE = "social";
private static final Integer AUTH_SUCCESS_CODE = 2000;
private final IUserClient userClient;
private final SocialProperties socialProperties;
@Override
public UserInfo grant(TokenParameter tokenParameter) {
HttpServletRequest request = WebUtil.getRequest();
String tenantId = Func.toStr(request.getHeader(TokenUtil.TENANT_HEADER_KEY), TokenUtil.DEFAULT_TENANT_ID);
// 开放平台来源
String sourceParameter = request.getParameter("source");
// 匹配是否有别名定义
String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter);
// 开放平台授权码
String code = request.getParameter("code");
// 开放平台状态吗
String state = request.getParameter("state");
// 获取开放平台授权数据
AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties);
AuthCallback authCallback = new AuthCallback();
authCallback.setCode(code);
authCallback.setState(state);
AuthResponse authResponse = authRequest.login(authCallback);
AuthUser authUser;
if (authResponse.getCode() == AUTH_SUCCESS_CODE) {
authUser = (AuthUser) authResponse.getData();
} else {
throw new ServiceException("social grant failure, auth response is not success");
}
// 组装数据
UserOauth userOauth = Objects.requireNonNull(BeanUtil.copy(authUser, UserOauth.class));
userOauth.setSource(authUser.getSource());
userOauth.setTenantId(tenantId);
userOauth.setUuid(authUser.getUuid());
// 远程调用,获取认证信息
R<UserInfo> result = userClient.userAuthInfo(userOauth);
return result.getData();
}
}
| 1,174 |
2,577 | <reponame>mdsarfarazalam840/camunda-bpm-platform<filename>engine/src/test/java/org/camunda/bpm/engine/test/api/authorization/batch/creation/HistoricProcessInstanceDeletionBatchAuthorizationTest.java
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; 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.camunda.bpm.engine.test.api.authorization.batch.creation;
import static org.camunda.bpm.engine.test.api.authorization.util.AuthorizationScenario.scenario;
import static org.camunda.bpm.engine.test.api.authorization.util.AuthorizationSpec.grant;
import java.util.Collection;
import java.util.List;
import org.camunda.bpm.engine.ProcessEngineConfiguration;
import org.camunda.bpm.engine.authorization.BatchPermissions;
import org.camunda.bpm.engine.authorization.Permissions;
import org.camunda.bpm.engine.authorization.Resources;
import org.camunda.bpm.engine.test.RequiredHistoryLevel;
import org.camunda.bpm.engine.test.api.authorization.util.AuthorizationScenario;
import org.camunda.bpm.engine.test.api.authorization.util.AuthorizationTestRule;
import org.junit.Test;
import org.junit.runners.Parameterized;
public class HistoricProcessInstanceDeletionBatchAuthorizationTest extends BatchCreationAuthorizationTest {
@Parameterized.Parameters(name = "Scenario {index}")
public static Collection<AuthorizationScenario[]> scenarios() {
return AuthorizationTestRule.asParameters(
scenario()
.withoutAuthorizations()
.failsDueToRequired(
grant(Resources.BATCH, "batchId", "userId", Permissions.CREATE),
grant(Resources.BATCH, "batchId", "userId", BatchPermissions.CREATE_BATCH_DELETE_FINISHED_PROCESS_INSTANCES)
),
scenario()
.withAuthorizations(
grant(Resources.BATCH, "batchId", "userId", Permissions.CREATE)
),
scenario()
.withAuthorizations(
grant(Resources.BATCH, "batchId", "userId", BatchPermissions.CREATE_BATCH_DELETE_FINISHED_PROCESS_INSTANCES)
).succeeds()
);
}
@Test
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_AUDIT)
public void testBatchHistoricProcessInstanceDeletion() {
List<String> historicProcessInstances = setupHistory();
//given
authRule
.init(scenario)
.withUser("userId")
.bindResource("batchId", "*")
.start();
// when
historyService.deleteHistoricProcessInstancesAsync(historicProcessInstances, TEST_REASON);
// then
authRule.assertScenario(scenario);
}
}
| 1,194 |
1,085 | /*
* Copyright (C) 2017-2019 Dremio Corporation
*
* 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.dremio.exec.expr.fn;
import org.apache.arrow.vector.types.pojo.ArrowType.Decimal;
import com.dremio.common.expression.LogicalExpression;
import com.dremio.common.expression.ValueExpressions.IntExpression;
import com.dremio.common.expression.ValueExpressions.LongExpression;
public class DerivationShortcuts {
public static int prec(LogicalExpression e){
return e.getCompleteType().getType(Decimal.class).getPrecision();
}
public static int scale(LogicalExpression e){
return e.getCompleteType().getType(Decimal.class).getScale();
}
public static int val(LogicalExpression e){
if(e instanceof IntExpression){
return ((IntExpression) e).getInt();
}else if(e instanceof LongExpression ){
return (int) ((LongExpression) e).getLong();
} else {
throw new IllegalStateException("Tried to retrieve constant value from non constant expression " + e);
}
}
}
| 462 |
572 | {".class": "MypyFile", "_fullname": "exemplo_2", "is_partial_stub_package": false, "is_stub": false, "names": {".class": "SymbolTable", "Optional": {".class": "SymbolTableNode", "cross_ref": "typing.Optional", "kind": "Gdef"}, "Union": {".class": "SymbolTableNode", "cross_ref": "typing.Union", "kind": "Gdef"}, "__doc__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "exemplo_2.__doc__", "name": "__doc__", "type": "builtins.str"}}, "__file__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "exemplo_2.__file__", "name": "__file__", "type": "builtins.str"}}, "__name__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "exemplo_2.__name__", "name": "__name__", "type": "builtins.str"}}, "__package__": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "Var", "flags": [], "fullname": "exemplo_2.__package__", "name": "__package__", "type": "builtins.str"}}, "soma": {".class": "SymbolTableNode", "kind": "Gdef", "node": {".class": "FuncDef", "arg_kinds": [0, 0], "arg_names": ["x", "y"], "flags": [], "fullname": "exemplo_2.soma", "name": "soma", "type": {".class": "CallableType", "arg_kinds": [0, 0], "arg_names": ["x", "y"], "arg_types": [{".class": "UnionType", "items": ["builtins.str", "builtins.float"]}, "builtins.float"], "bound_args": [], "def_extras": {"first_arg": null}, "fallback": "builtins.function", "implicit": false, "is_ellipsis_args": false, "name": "soma", "ret_type": {".class": "UnionType", "items": ["builtins.float", {".class": "NoneTyp"}]}, "variables": []}}}}, "path": "exemplo_2.py"} | 650 |
1,592 | <reponame>DavisVaughan/xtensor
/***************************************************************************
* Copyright (c) <NAME>, <NAME> and <NAME> *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
****************************************************************************/
#include "test_common_macros.hpp"
#include <iostream>
#include <nlohmann/json.hpp>
#include "xtensor/xarray.hpp"
#include "xtensor/xmime.hpp"
namespace xt
{
TEST(xmime, xarray_two_d)
{
xarray<double> e{{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12}};
nlohmann::json ser = mime_bundle_repr_impl(e);
nlohmann::json ref = {{"text/html", "<table style='border-style:solid;border-width:1px;'><tbody><tr><td style='font-family:monospace;' title='(0, 0)'><pre> 1.</pre></td><td style='font-family:monospace;' title='(0, 1)'><pre> 2.</pre></td><td style='font-family:monospace;' title='(0, 2)'><pre> 3.</pre></td><td style='font-family:monospace;' title='(0, 3)'><pre> 4.</pre></td></tr><tr><td style='font-family:monospace;' title='(1, 0)'><pre> 5.</pre></td><td style='font-family:monospace;' title='(1, 1)'><pre> 6.</pre></td><td style='font-family:monospace;' title='(1, 2)'><pre> 7.</pre></td><td style='font-family:monospace;' title='(1, 3)'><pre> 8.</pre></td></tr><tr><td style='font-family:monospace;' title='(2, 0)'><pre> 9.</pre></td><td style='font-family:monospace;' title='(2, 1)'><pre> 10.</pre></td><td style='font-family:monospace;' title='(2, 2)'><pre> 11.</pre></td><td style='font-family:monospace;' title='(2, 3)'><pre> 12.</pre></td></tr></tbody></table>"}};
EXPECT_EQ(ser, ref);
}
}
| 949 |
5,169 | <filename>Specs/7/c/a/FrameworkTesting/0.0.7/FrameworkTesting.podspec.json
{
"name": "FrameworkTesting",
"version": "0.0.7",
"summary": "A testing framework",
"description": "A testing framework about resource, internal Cocoapods usage, strings, etc...",
"homepage": "https://github.com/ngo275",
"license": "MIT",
"authors": {
"ngo275": "<EMAIL>"
},
"social_media_url": "https://twitter.com/ngo275",
"platforms": {
"ios": "12.0"
},
"swift_versions": "5.1",
"source": {
"git": "https://github.com/ngo275/FrameworkTesting.git",
"tag": "0.0.7"
},
"source_files": "OriginalFramework/**/*.{swift,m,h}",
"public_header_files": "OriginalFramework/**/*.h",
"frameworks": [
"UIKit",
"Foundation"
],
"vendored_frameworks": "OriginalFramework/HDWallet.framework",
"resources": "OriginalFramework/**/*.{lproj,storyboard}",
"swift_version": "5.1"
}
| 360 |
416 | package org.simpleflatmapper.converter.impl;
import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.converter.ContextualConverter;
public class CharSequenceShortConverter implements ContextualConverter<CharSequence, Short> {
@Override
public Short convert(CharSequence in, Context context) throws Exception {
if (in == null) return null;
return Short.valueOf(in.toString());
}
public String toString() {
return "CharSequenceToShort";
}
}
| 174 |
324 | /*
* 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.jclouds.openstack.trove.v1.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Map;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseJson;
import com.google.common.base.Function;
import com.google.inject.Inject;
/**
* This parses the password
*/
public class ParsePasswordFromRootedInstance implements Function<HttpResponse, String> {
private final ParseJson<Map<String, Map<String, String>>> json;
@Inject
ParsePasswordFromRootedInstance(ParseJson<Map<String, Map<String, String>>> json) {
this.json = checkNotNull(json, "json");
}
/**
* Extracts the user password from the json response
*/
public String apply(HttpResponse from) {
Map<String, Map<String, String>> result = json.apply(from);
if (result.get("user") == null)
return null;
return result.get("user").get("password");
}
}
| 517 |
815 | <reponame>MhmudAlpurd/IC-pytorchlite
// Copyright (c) 2020 Facebook, Inc. and its affiliates.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
package org.pytorch.demo.objectdetection;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import org.pytorch.IValue;
import org.pytorch.LiteModuleLoader;
import org.pytorch.Module;
import org.pytorch.Tensor;
import org.pytorch.torchvision.TensorImageUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity implements Runnable {
private int mImageIndex = 0;
private String[] mTestImages = {"test1.png", "test2.jpg", "test3.png"};
private ImageView mImageView;
private ResultView mResultView;
private Button mButtonDetect;
private ProgressBar mProgressBar;
private Bitmap mBitmap = null;
private Module mModule = null;
private float mImgScaleX, mImgScaleY, mIvScaleX, mIvScaleY, mStartX, mStartY;
public static String assetFilePath(Context context, String assetName) throws IOException {
File file = new File(context.getFilesDir(), assetName);
if (file.exists() && file.length() > 0) {
return file.getAbsolutePath();
}
try (InputStream is = context.getAssets().open(assetName)) {
try (OutputStream os = new FileOutputStream(file)) {
byte[] buffer = new byte[4 * 1024];
int read;
while ((read = is.read(buffer)) != -1) {
os.write(buffer, 0, read);
}
os.flush();
}
return file.getAbsolutePath();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, 1);
}
setContentView(R.layout.activity_main);
try {
mBitmap = BitmapFactory.decodeStream(getAssets().open(mTestImages[mImageIndex]));
} catch (IOException e) {
Log.e("Object Detection", "Error reading assets", e);
finish();
}
mImageView = findViewById(R.id.imageView);
mImageView.setImageBitmap(mBitmap);
mResultView = findViewById(R.id.resultView);
mResultView.setVisibility(View.INVISIBLE);
final Button buttonTest = findViewById(R.id.testButton);
buttonTest.setText(("Test Image 1/3"));
buttonTest.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mResultView.setVisibility(View.INVISIBLE);
mImageIndex = (mImageIndex + 1) % mTestImages.length;
buttonTest.setText(String.format("Text Image %d/%d", mImageIndex + 1, mTestImages.length));
try {
mBitmap = BitmapFactory.decodeStream(getAssets().open(mTestImages[mImageIndex]));
mImageView.setImageBitmap(mBitmap);
} catch (IOException e) {
Log.e("Object Detection", "Error reading assets", e);
finish();
}
}
});
final Button buttonSelect = findViewById(R.id.selectButton);
buttonSelect.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mResultView.setVisibility(View.INVISIBLE);
final CharSequence[] options = { "Choose from Photos", "Take Picture", "Cancel" };
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("New Test Image");
builder.setItems(options, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
if (options[item].equals("Take Picture")) {
Intent takePicture = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(takePicture, 0);
}
else if (options[item].equals("Choose from Photos")) {
Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(pickPhoto , 1);
}
else if (options[item].equals("Cancel")) {
dialog.dismiss();
}
}
});
builder.show();
}
});
final Button buttonLive = findViewById(R.id.liveButton);
buttonLive.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final Intent intent = new Intent(MainActivity.this, ObjectDetectionActivity.class);
startActivity(intent);
}
});
mButtonDetect = findViewById(R.id.detectButton);
mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
mButtonDetect.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mButtonDetect.setEnabled(false);
mProgressBar.setVisibility(ProgressBar.VISIBLE);
mButtonDetect.setText(getString(R.string.run_model));
mImgScaleX = (float)mBitmap.getWidth() / PrePostProcessor.mInputWidth;
mImgScaleY = (float)mBitmap.getHeight() / PrePostProcessor.mInputHeight;
mIvScaleX = (mBitmap.getWidth() > mBitmap.getHeight() ? (float)mImageView.getWidth() / mBitmap.getWidth() : (float)mImageView.getHeight() / mBitmap.getHeight());
mIvScaleY = (mBitmap.getHeight() > mBitmap.getWidth() ? (float)mImageView.getHeight() / mBitmap.getHeight() : (float)mImageView.getWidth() / mBitmap.getWidth());
mStartX = (mImageView.getWidth() - mIvScaleX * mBitmap.getWidth())/2;
mStartY = (mImageView.getHeight() - mIvScaleY * mBitmap.getHeight())/2;
Thread thread = new Thread(MainActivity.this);
thread.start();
}
});
try {
mModule = LiteModuleLoader.load(MainActivity.assetFilePath(getApplicationContext(), "yolov5s.torchscript.ptl"));
BufferedReader br = new BufferedReader(new InputStreamReader(getAssets().open("classes.txt")));
String line;
List<String> classes = new ArrayList<>();
while ((line = br.readLine()) != null) {
classes.add(line);
}
PrePostProcessor.mClasses = new String[classes.size()];
classes.toArray(PrePostProcessor.mClasses);
} catch (IOException e) {
Log.e("Object Detection", "Error reading assets", e);
finish();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_CANCELED) {
switch (requestCode) {
case 0:
if (resultCode == RESULT_OK && data != null) {
mBitmap = (Bitmap) data.getExtras().get("data");
Matrix matrix = new Matrix();
matrix.postRotate(90.0f);
mBitmap = Bitmap.createBitmap(mBitmap, 0, 0, mBitmap.getWidth(), mBitmap.getHeight(), matrix, true);
mImageView.setImageBitmap(mBitmap);
}
break;
case 1:
if (resultCode == RESULT_OK && data != null) {
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
if (selectedImage != null) {
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
if (cursor != null) {
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
mBitmap = BitmapFactory.decodeFile(picturePath);
Matrix matrix = new Matrix();
matrix.postRotate(90.0f);
mBitmap = Bitmap.createBitmap(mBitmap, 0, 0, mBitmap.getWidth(), mBitmap.getHeight(), matrix, true);
mImageView.setImageBitmap(mBitmap);
cursor.close();
}
}
}
break;
}
}
}
@Override
public void run() {
Bitmap resizedBitmap = Bitmap.createScaledBitmap(mBitmap, PrePostProcessor.mInputWidth, PrePostProcessor.mInputHeight, true);
final Tensor inputTensor = TensorImageUtils.bitmapToFloat32Tensor(resizedBitmap, PrePostProcessor.NO_MEAN_RGB, PrePostProcessor.NO_STD_RGB);
IValue[] outputTuple = mModule.forward(IValue.from(inputTensor)).toTuple();
final Tensor outputTensor = outputTuple[0].toTensor();
final float[] outputs = outputTensor.getDataAsFloatArray();
final ArrayList<Result> results = PrePostProcessor.outputsToNMSPredictions(outputs, mImgScaleX, mImgScaleY, mIvScaleX, mIvScaleY, mStartX, mStartY);
runOnUiThread(() -> {
mButtonDetect.setEnabled(true);
mButtonDetect.setText(getString(R.string.detect));
mProgressBar.setVisibility(ProgressBar.INVISIBLE);
mResultView.setResults(results);
mResultView.invalidate();
mResultView.setVisibility(View.VISIBLE);
});
}
}
| 5,285 |
660 | package quick.pager.shop.param.goods;
public class GoodsPageParam {
}
| 24 |
328 | package com.poiji.deserialize.model.byid;
import com.poiji.annotation.ExcelCell;
/**
* Created by hakan on 07/08/2018
*/
public class Sample {
@ExcelCell(0)
private String month;
@ExcelCell(1)
private Double amount;
@ExcelCell(2)
private String other;
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
@Override
public String toString() {
return "Sample{" +
"month='" + month + '\'' +
", amount=" + amount +
", other='" + other + '\'' +
'}';
}
}
| 415 |
852 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
TrackerSimHitsBlock = cms.PSet(
TrackerSimHits = cms.PSet(
# Smallest charged particle pT for which SimHit's are saved (GeV/c)
pTmin = cms.untracked.double(0.2),
# Save SimHit's only for the first loop
firstLoop = cms.untracked.bool(True)
)
)
#
# Modify for running in Run 2
#
from Configuration.Eras.Modifier_run2_common_cff import run2_common
run2_common.toModify( TrackerSimHitsBlock.TrackerSimHits, pTmin = 0.1 )
| 215 |
819 | #define DR_WAV_IMPLEMENTATION
#include "../../dr_wav.h"
#include <sndfile.h>
#include "../common/dr_common.c"
dr_handle g_libsndfile = NULL;
typedef SNDFILE* (* pfn_sf_open_virtual)(SF_VIRTUAL_IO* sfvirtual, int mode, SF_INFO* sfinfo, void* user_data);
typedef int (* pfn_sf_close) (SNDFILE* sndfile);
typedef sf_count_t (* pfn_sf_readf_short) (SNDFILE *sndfile, short *ptr, sf_count_t frames);
typedef sf_count_t (* pfn_sf_readf_int) (SNDFILE *sndfile, int *ptr, sf_count_t frames);
typedef sf_count_t (* pfn_sf_readf_float) (SNDFILE *sndfile, float *ptr, sf_count_t frames);
typedef sf_count_t (* pfn_sf_readf_double)(SNDFILE *sndfile, double *ptr, sf_count_t frames);
typedef sf_count_t (* pfn_sf_seek) (SNDFILE *sndfile, sf_count_t frames, int whence);
pfn_sf_open_virtual libsndfile__sf_open_virtual;
pfn_sf_close libsndfile__sf_close;
pfn_sf_readf_short libsndfile__sf_readf_short;
pfn_sf_readf_int libsndfile__sf_readf_int;
pfn_sf_readf_float libsndfile__sf_readf_float;
pfn_sf_readf_double libsndfile__sf_readf_double;
pfn_sf_seek libsndfile__sf_seek;
drwav_result libsndfile_init_api()
{
unsigned int i;
const char* pFileNames[] = {
#if defined(_WIN32)
#if defined(_WIN64)
"libsndfile-1-x64.dll",
#else
"libsndfile-1-x86.dll",
#endif
"libsndfile-1.dll"
#else
"libsndfile-1.so",
"libsndfile.so.1"
#endif
};
if (g_libsndfile != NULL) {
return DRWAV_INVALID_OPERATION; /* Already initialized. */
}
for (i = 0; i < sizeof(pFileNames)/sizeof(pFileNames[0]); i += 1) {
g_libsndfile = dr_dlopen(pFileNames[i]);
if (g_libsndfile != NULL) {
break;
}
}
if (g_libsndfile == NULL) {
return DRWAV_ERROR; /* Unable to load libsndfile-1.so/dll. */
}
libsndfile__sf_open_virtual = (pfn_sf_open_virtual)dr_dlsym(g_libsndfile, "sf_open_virtual");
libsndfile__sf_close = (pfn_sf_close) dr_dlsym(g_libsndfile, "sf_close");
libsndfile__sf_readf_short = (pfn_sf_readf_short) dr_dlsym(g_libsndfile, "sf_readf_short");
libsndfile__sf_readf_int = (pfn_sf_readf_int) dr_dlsym(g_libsndfile, "sf_readf_int");
libsndfile__sf_readf_float = (pfn_sf_readf_float) dr_dlsym(g_libsndfile, "sf_readf_float");
libsndfile__sf_readf_double = (pfn_sf_readf_double)dr_dlsym(g_libsndfile, "sf_readf_double");
libsndfile__sf_seek = (pfn_sf_seek) dr_dlsym(g_libsndfile, "sf_seek");
return DRWAV_SUCCESS;
}
void libsndfile_uninit_api()
{
if (g_libsndfile == NULL) {
return; /* Invalid operation. Not initialized. */
}
dr_dlclose(g_libsndfile);
g_libsndfile = NULL;
}
typedef struct
{
SNDFILE* pHandle;
SF_INFO info;
drwav_uint8* pFileData;
size_t fileSizeInBytes;
size_t fileReadPos;
} libsndfile;
sf_count_t libsndfile__on_filelen(void *user_data)
{
libsndfile* pSndFile = (libsndfile*)user_data;
return (sf_count_t)pSndFile->fileSizeInBytes;
}
sf_count_t libsndfile__on_seek(sf_count_t offset, int whence, void *user_data)
{
libsndfile* pSndFile = (libsndfile*)user_data;
switch (whence)
{
case SF_SEEK_SET:
{
pSndFile->fileReadPos = (size_t)offset;
} break;
case SF_SEEK_CUR:
{
pSndFile->fileReadPos += (size_t)offset;
} break;
case SF_SEEK_END:
{
pSndFile->fileReadPos = pSndFile->fileSizeInBytes - (size_t)offset;
} break;
}
return (sf_count_t)pSndFile->fileReadPos;
}
sf_count_t libsndfile__on_read(void *ptr, sf_count_t count, void *user_data)
{
libsndfile* pSndFile = (libsndfile*)user_data;
DRWAV_COPY_MEMORY(ptr, pSndFile->pFileData + pSndFile->fileReadPos, (size_t)count);
pSndFile->fileReadPos += (size_t)count;
return count;
}
sf_count_t libsndfile__on_write(const void *ptr, sf_count_t count, void *user_data)
{
/* We're not doing anything with writing. */
(void)ptr;
(void)count;
(void)user_data;
return 0;
}
sf_count_t libsndfile__on_tell(void *user_data)
{
libsndfile* pSndFile = (libsndfile*)user_data;
return (sf_count_t)pSndFile->fileReadPos;
}
drwav_result libsndfile_init_file(const char* pFilePath, libsndfile* pSndFile)
{
SF_VIRTUAL_IO callbacks;
if (pFilePath == NULL || pSndFile == NULL) {
return DRWAV_INVALID_ARGS;
}
DRWAV_ZERO_MEMORY(pSndFile, sizeof(*pSndFile));
/* We use libsndfile's virtual IO technique because we want to load from memory to make speed benchmarking fairer. */
pSndFile->pFileData = (drwav_uint8*)dr_open_and_read_file(pFilePath, &pSndFile->fileSizeInBytes);
if (pSndFile->pFileData == NULL) {
return DRWAV_ERROR; /* Failed to open the file. */
}
DRWAV_ZERO_MEMORY(&callbacks, sizeof(callbacks));
callbacks.get_filelen = libsndfile__on_filelen;
callbacks.seek = libsndfile__on_seek;
callbacks.read = libsndfile__on_read;
callbacks.write = libsndfile__on_write;
callbacks.tell = libsndfile__on_tell;
pSndFile->pHandle = libsndfile__sf_open_virtual(&callbacks, SFM_READ, &pSndFile->info, pSndFile);
if (pSndFile->pHandle == NULL) {
free(pSndFile->pFileData);
return DRWAV_ERROR;
}
return DRWAV_SUCCESS;
}
void libsndfile_uninit(libsndfile* pSndFile)
{
if (pSndFile == NULL) {
return;
}
libsndfile__sf_close(pSndFile->pHandle);
free(pSndFile->pFileData);
}
drwav_uint64 libsndfile_read_pcm_frames_s16(libsndfile* pSndFile, drwav_uint64 framesToRead, drwav_int16* pBufferOut)
{
if (pSndFile == NULL || pBufferOut == NULL) {
return 0;
}
/* Unfortunately it looks like libsndfile does not return correct integral values when the source file is floating point. */
if ((pSndFile->info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT) {
/* Read as float and convert. */
drwav_uint64 totalFramesRead = 0;
while (totalFramesRead < framesToRead) {
float temp[4096];
drwav_uint64 framesRemaining = framesToRead - totalFramesRead;
drwav_uint64 framesReadThisIteration;
drwav_uint64 framesToReadThisIteration = sizeof(temp)/sizeof(temp[0]) / pSndFile->info.channels;
if (framesToReadThisIteration > framesRemaining) {
framesToReadThisIteration = framesRemaining;
}
framesReadThisIteration = libsndfile__sf_readf_float(pSndFile->pHandle, temp, (sf_count_t)framesToReadThisIteration);
drwav_f32_to_s16(pBufferOut, temp, (size_t)(framesReadThisIteration*pSndFile->info.channels));
totalFramesRead += framesReadThisIteration;
pBufferOut += framesReadThisIteration*pSndFile->info.channels;
/* If we read less frames than we requested we've reached the end of the file. */
if (framesReadThisIteration < framesToReadThisIteration) {
break;
}
}
return totalFramesRead;
} else if ((pSndFile->info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_DOUBLE) {
/* Read as double and convert. */
drwav_uint64 totalFramesRead = 0;
while (totalFramesRead < framesToRead) {
double temp[4096];
drwav_uint64 framesRemaining = framesToRead - totalFramesRead;
drwav_uint64 framesReadThisIteration;
drwav_uint64 framesToReadThisIteration = sizeof(temp)/sizeof(temp[0]) / pSndFile->info.channels;
if (framesToReadThisIteration > framesRemaining) {
framesToReadThisIteration = framesRemaining;
}
framesReadThisIteration = libsndfile__sf_readf_double(pSndFile->pHandle, temp, (sf_count_t)framesToReadThisIteration);
drwav_f64_to_s16(pBufferOut, temp, (size_t)(framesReadThisIteration*pSndFile->info.channels));
totalFramesRead += framesReadThisIteration;
pBufferOut += framesReadThisIteration*pSndFile->info.channels;
/* If we read less frames than we requested we've reached the end of the file. */
if (framesReadThisIteration < framesToReadThisIteration) {
break;
}
}
return totalFramesRead;
} else {
return libsndfile__sf_readf_short(pSndFile->pHandle, pBufferOut, framesToRead);
}
}
drwav_uint64 libsndfile_read_pcm_frames_f32(libsndfile* pSndFile, drwav_uint64 framesToRead, float* pBufferOut)
{
if (pSndFile == NULL || pBufferOut == NULL) {
return 0;
}
return libsndfile__sf_readf_float(pSndFile->pHandle, pBufferOut, framesToRead);
}
drwav_uint64 libsndfile_read_pcm_frames_s32(libsndfile* pSndFile, drwav_uint64 framesToRead, drwav_int32* pBufferOut)
{
if (pSndFile == NULL || pBufferOut == NULL) {
return 0;
}
/* Unfortunately it looks like libsndfile does not return correct integral values when the source file is floating point. */
if ((pSndFile->info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT) {
/* Read and float and convert. */
drwav_uint64 totalFramesRead = 0;
while (totalFramesRead < framesToRead) {
float temp[4096];
drwav_uint64 framesRemaining = framesToRead - totalFramesRead;
drwav_uint64 framesReadThisIteration;
drwav_uint64 framesToReadThisIteration = sizeof(temp)/sizeof(temp[0]) / pSndFile->info.channels;
if (framesToReadThisIteration > framesRemaining) {
framesToReadThisIteration = framesRemaining;
}
framesReadThisIteration = libsndfile__sf_readf_float(pSndFile->pHandle, temp, (sf_count_t)framesToReadThisIteration);
drwav_f32_to_s32(pBufferOut, temp, (size_t)(framesReadThisIteration*pSndFile->info.channels));
totalFramesRead += framesReadThisIteration;
pBufferOut += framesReadThisIteration*pSndFile->info.channels;
/* If we read less frames than we requested we've reached the end of the file. */
if (framesReadThisIteration < framesToReadThisIteration) {
break;
}
}
return totalFramesRead;
} else if ((pSndFile->info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_DOUBLE) {
/* Read and double and convert. */
drwav_uint64 totalFramesRead = 0;
while (totalFramesRead < framesToRead) {
double temp[4096];
drwav_uint64 framesRemaining = framesToRead - totalFramesRead;
drwav_uint64 framesReadThisIteration;
drwav_uint64 framesToReadThisIteration = sizeof(temp)/sizeof(temp[0]) / pSndFile->info.channels;
if (framesToReadThisIteration > framesRemaining) {
framesToReadThisIteration = framesRemaining;
}
framesReadThisIteration = libsndfile__sf_readf_double(pSndFile->pHandle, temp, (sf_count_t)framesToReadThisIteration);
drwav_f64_to_s32(pBufferOut, temp, (size_t)(framesReadThisIteration*pSndFile->info.channels));
totalFramesRead += framesReadThisIteration;
pBufferOut += framesReadThisIteration*pSndFile->info.channels;
/* If we read less frames than we requested we've reached the end of the file. */
if (framesReadThisIteration < framesToReadThisIteration) {
break;
}
}
return totalFramesRead;
} else {
return libsndfile__sf_readf_int(pSndFile->pHandle, pBufferOut, framesToRead);
}
}
drwav_bool32 libsndfile_seek_to_pcm_frame(libsndfile* pSndFile, drwav_uint64 targetPCMFrameIndex)
{
if (pSndFile == NULL) {
return DRWAV_FALSE;
}
return libsndfile__sf_seek(pSndFile->pHandle, (sf_count_t)targetPCMFrameIndex, SF_SEEK_SET) == (sf_count_t)targetPCMFrameIndex;
}
| 5,470 |
575 | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_AUDIO_MIXER_SERVICE_AUDIO_SOCKET_SERVICE_H_
#define CHROMECAST_MEDIA_AUDIO_MIXER_SERVICE_AUDIO_SOCKET_SERVICE_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
namespace base {
class SequencedTaskRunner;
} // namespace base
namespace net {
class ServerSocket;
class StreamSocket;
} // namespace net
namespace chromecast {
namespace media {
// Listens to a server socket and passes accepted sockets to a delegate. It
// is used for creating socket connections to pass audio data between processes.
// Must be created and used on an IO thread.
class AudioSocketService {
public:
class Delegate {
public:
// Handles a newly accepted |socket|.
virtual void HandleAcceptedSocket(
std::unique_ptr<net::StreamSocket> socket) = 0;
protected:
virtual ~Delegate() = default;
};
AudioSocketService(const std::string& endpoint,
int port,
int max_accept_loop,
Delegate* delegate);
~AudioSocketService();
// Starts accepting incoming connections.
void Accept();
// Creates a connection to an AudioSocketService instance. The |endpoint| is
// used on systems that support Unix domain sockets; otherwise, the |port| is
// used to make a TCP connection.
static std::unique_ptr<net::StreamSocket> Connect(const std::string& endpoint,
int port);
private:
void OnAccept(int result);
bool HandleAcceptResult(int result);
const int max_accept_loop_;
Delegate* const delegate_; // Not owned.
scoped_refptr<base::SequencedTaskRunner> task_runner_;
std::unique_ptr<net::ServerSocket> listen_socket_;
std::unique_ptr<net::StreamSocket> accepted_socket_;
DISALLOW_COPY_AND_ASSIGN(AudioSocketService);
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_AUDIO_MIXER_SERVICE_AUDIO_SOCKET_SERVICE_H_
| 750 |
852 | <gh_stars>100-1000
#ifndef DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H
#define DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
#include "DQM/SiStripCommissioningClients/interface/CommissioningHistograms.h"
#include "OnlineDB/SiStripConfigDb/interface/SiStripConfigDb.h"
#include "boost/range/iterator_range.hpp"
#include <string>
#include <map>
#include <cstdint>
class SiStripConfigDb;
class SiStripFedCabling;
class TrackerTopology;
class CommissioningHistosUsingDb : public virtual CommissioningHistograms {
// ---------- public interface ----------
public:
CommissioningHistosUsingDb(SiStripConfigDb* const,
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken,
sistrip::RunType = sistrip::UNDEFINED_RUN_TYPE);
~CommissioningHistosUsingDb() override;
void configure(const edm::ParameterSet&, const edm::EventSetup&) override;
void uploadToConfigDb();
bool doUploadAnal() const;
bool doUploadConf() const;
void doUploadAnal(bool);
void doUploadConf(bool);
// ---------- protected methods ----------
protected:
void buildDetInfo();
virtual void addDcuDetIds();
virtual void uploadConfigurations() { ; }
void uploadAnalyses();
virtual void createAnalyses(SiStripConfigDb::AnalysisDescriptionsV&);
virtual void create(SiStripConfigDb::AnalysisDescriptionsV&, Analysis) { ; }
SiStripConfigDb* const db() const;
SiStripFedCabling* const cabling() const;
class DetInfo {
public:
uint32_t dcuId_;
uint32_t detId_;
uint16_t pairs_;
DetInfo() : dcuId_(sistrip::invalid32_), detId_(sistrip::invalid32_), pairs_(sistrip::invalid_) { ; }
};
std::pair<std::string, DetInfo> detInfo(const SiStripFecKey&);
bool deviceIsPresent(const SiStripFecKey&);
// ---------- private member data ----------
private:
CommissioningHistosUsingDb();
sistrip::RunType runType_;
SiStripConfigDb* db_;
SiStripFedCabling* cabling_;
typedef std::map<uint32_t, DetInfo> DetInfos;
std::map<std::string, DetInfos> detInfo_;
bool uploadAnal_;
bool uploadConf_;
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
};
inline void CommissioningHistosUsingDb::doUploadConf(bool upload) { uploadConf_ = upload; }
inline void CommissioningHistosUsingDb::doUploadAnal(bool upload) { uploadAnal_ = upload; }
inline bool CommissioningHistosUsingDb::doUploadAnal() const { return uploadAnal_; }
inline bool CommissioningHistosUsingDb::doUploadConf() const { return uploadConf_; }
inline SiStripConfigDb* const CommissioningHistosUsingDb::db() const { return db_; }
inline SiStripFedCabling* const CommissioningHistosUsingDb::cabling() const { return cabling_; }
#endif // DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H
| 1,015 |
700 | from skidl import SKIDL, TEMPLATE, Part, Pin, SchLib
SKIDL_lib_version = '0.0.1'
supertex = SchLib(tool=SKIDL).add_parts(*[
Part(name='CL220K4-G',dest=TEMPLATE,tool=SKIDL,keywords='Constant Current LED Driver IC',description='Temperature Compensated Constant Current LED IC, D-PAK',ref_prefix='U',num_units=1,fplist=['TO-252*', 'DPAK*'],do_erc=True,pins=[
Pin(num='1',name='VA',do_erc=True),
Pin(num='2',name='VB',do_erc=True)]),
Part(name='CL220N5-G',dest=TEMPLATE,tool=SKIDL,keywords='Constant Current LED Driver IC',description='Temperature Compensated Constant Current LED IC, TO-220',ref_prefix='U',num_units=1,fplist=['TO-220*'],do_erc=True,pins=[
Pin(num='1',name='VA',do_erc=True),
Pin(num='2',name='VB',do_erc=True)]),
Part(name='HV100K5-G',dest=TEMPLATE,tool=SKIDL,keywords='Hot-Swap Current Limiter',description='Hot-Swap Current Limiter Controller, SOT223',ref_prefix='U',num_units=1,fplist=['SOT-223*'],do_erc=True,aliases=['HV101K5-G'],pins=[
Pin(num='1',name='VPP',func=Pin.PWRIN,do_erc=True),
Pin(num='2',name='VNN',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='GATE',func=Pin.OUTPUT,do_erc=True)]),
Part(name='HV9921N8-G',dest=TEMPLATE,tool=SKIDL,keywords='CC LED Driver High Voltage',description='3pin Constant Current 30mA LED Driver, SOT89',ref_prefix='U',num_units=1,fplist=['SOT*'],do_erc=True,aliases=['HV9922N8-G', 'HV9923N8-G'],pins=[
Pin(num='1',name='D',func=Pin.PASSIVE,do_erc=True),
Pin(num='2',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='VDD',func=Pin.OUTPUT,do_erc=True)]),
Part(name='HV9925SG-G',dest=TEMPLATE,tool=SKIDL,keywords='Programmable Current LED Lamp Driver High Voltage',description='Programmable Current LED Lamp Driver, SO8 w/Heat Slug',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[
Pin(num='1',name='Rs',func=Pin.OUTPUT,do_erc=True),
Pin(num='2',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='PWMD',do_erc=True),
Pin(num='4',name='VDD',func=Pin.PWROUT,do_erc=True),
Pin(num='6',name='D',do_erc=True),
Pin(num='7',name='D',do_erc=True),
Pin(num='8',name='D',do_erc=True)]),
Part(name='HV9930LG-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck-Boost LED Lamp Driver High Voltage',description='Boost-Buck LED Lamp Driver, SO8',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[
Pin(num='1',name='VIN',do_erc=True),
Pin(num='2',name='CS1',do_erc=True),
Pin(num='3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='GATE',func=Pin.OUTPUT,do_erc=True),
Pin(num='5',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='VDD',func=Pin.PWROUT,do_erc=True),
Pin(num='7',name='CS2',do_erc=True),
Pin(num='8',name='REF',do_erc=True)]),
Part(name='HV9931LG-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck-Boost LED Lamp Driver High Voltage PFC',description='PFC Boost-Buck LED Lamp Driver, SO8',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[
Pin(num='1',name='VIN',do_erc=True),
Pin(num='2',name='CS1',do_erc=True),
Pin(num='3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='GATE',func=Pin.OUTPUT,do_erc=True),
Pin(num='5',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='VDD',func=Pin.PWROUT,do_erc=True),
Pin(num='7',name='CS2',do_erc=True),
Pin(num='8',name='REF',do_erc=True)]),
Part(name='HV9961LG-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck LED Lamp Driver High Voltage Average CC',description='Buck LED Lamp Driver Average-Mode Constant Current, SO8',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[
Pin(num='1',name='VIN',do_erc=True),
Pin(num='2',name='CS',do_erc=True),
Pin(num='3',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='GATE',func=Pin.OUTPUT,do_erc=True),
Pin(num='5',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='VDD',func=Pin.PWROUT,do_erc=True),
Pin(num='7',name='LD',do_erc=True),
Pin(num='8',name='RT',do_erc=True)]),
Part(name='HV9961NG-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck LED Lamp Driver High Voltage Average CC',description='Buck LED Lamp Driver Average-Mode Constant Current, SO16',ref_prefix='U',num_units=1,fplist=['SO*', 'SOIC*'],do_erc=True,pins=[
Pin(num='1',name='VIN',do_erc=True),
Pin(num='4',name='CS',do_erc=True),
Pin(num='5',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='GATE',func=Pin.OUTPUT,do_erc=True),
Pin(num='9',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='12',name='VDD',func=Pin.PWROUT,do_erc=True),
Pin(num='13',name='LD',do_erc=True),
Pin(num='14',name='RT',do_erc=True)]),
Part(name='HV9967BK7-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck LED Lamp Driver Low Voltage Average CC',description='Buck LED Lamp Driver Average-Mode Constant Current, DFN8 (3x3mm)',ref_prefix='U',num_units=1,fplist=['DFN*'],do_erc=True,pins=[
Pin(num='1',name='SW',func=Pin.OUTPUT,do_erc=True),
Pin(num='2',name='Rs',do_erc=True),
Pin(num='3',name='PGND',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='RT',do_erc=True),
Pin(num='7',name='AGND',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='VDD',func=Pin.PWROUT,do_erc=True)]),
Part(name='HV9967BMG-G',dest=TEMPLATE,tool=SKIDL,keywords='Buck LED Lamp Driver Low Voltage Average CC',description='Buck LED Lamp Driver Average-Mode Constant Current, MSOP8',ref_prefix='U',num_units=1,fplist=['MSOP*'],do_erc=True,pins=[
Pin(num='1',name='SW',func=Pin.OUTPUT,do_erc=True),
Pin(num='2',name='Rs',do_erc=True),
Pin(num='3',name='PGND',func=Pin.PWRIN,do_erc=True),
Pin(num='4',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='6',name='RT',do_erc=True),
Pin(num='7',name='AGND',func=Pin.PWRIN,do_erc=True),
Pin(num='8',name='VDD',func=Pin.PWROUT,do_erc=True)]),
Part(name='HV9972LG-G',dest=TEMPLATE,tool=SKIDL,keywords='Isolated LED Lamp Driver High Voltage CC',description='Isolated LED Lamp Driver Constant Current, SO8',ref_prefix='U',num_units=1,fplist=['SOIC*', 'SO*'],do_erc=True,pins=[
Pin(num='1',name='BIAS',do_erc=True),
Pin(num='2',name='VIN',func=Pin.PWRIN,do_erc=True),
Pin(num='3',name='VD',do_erc=True),
Pin(num='4',name='PWMD',func=Pin.OUTPUT,do_erc=True),
Pin(num='5',name='CS',do_erc=True),
Pin(num='6',name='GND',func=Pin.PWRIN,do_erc=True),
Pin(num='7',name='GATE',func=Pin.OUTPUT,do_erc=True),
Pin(num='8',name='VDD',func=Pin.PWROUT,do_erc=True)]),
Part(name='LR8K4-G',dest=TEMPLATE,tool=SKIDL,keywords='High-Voltage Regulator Adjustable Positive',description='30mA 450V High-Voltage Linear Regulator (Adjustable), TO-252 (D-PAK)',ref_prefix='U',num_units=1,fplist=['TO-252*', 'DPAK*'],do_erc=True,pins=[
Pin(num='1',name='IN',do_erc=True),
Pin(num='2',name='OUT',func=Pin.PWROUT,do_erc=True),
Pin(num='3',name='ADJ',do_erc=True)]),
Part(name='LR8N3-G',dest=TEMPLATE,tool=SKIDL,keywords='High-Voltage Regulator Adjustable Positive',description='30mA 450V High-Voltage Linear Regulator (Adjustable), TO-92',ref_prefix='U',num_units=1,fplist=['TO-92*'],do_erc=True,pins=[
Pin(num='1',name='IN',do_erc=True),
Pin(num='2',name='OUT',func=Pin.PWROUT,do_erc=True),
Pin(num='3',name='ADJ',do_erc=True)]),
Part(name='LR8N8-G',dest=TEMPLATE,tool=SKIDL,keywords='High-Voltage Regulator Adjustable Positive',description='30mA 450V High-Voltage Linear Regulator (Adjustable), SOT-89',ref_prefix='U',num_units=1,fplist=['SOT*'],do_erc=True,pins=[
Pin(num='1',name='IN',do_erc=True),
Pin(num='2',name='OUT',func=Pin.PWROUT,do_erc=True),
Pin(num='3',name='ADJ',do_erc=True)])])
| 4,185 |
897 | <reponame>Khushboo85277/NeoAlgo
'''
A program that returns the count of perfect squares less than or equal to a given number.
It also displays those numbers which are perfect squares within the range of that number.
The number should be greater than or equal to 1
'''
#importing math function as it will be used for square root
import math
#count function
def countsq(n):
c=0
for i in range(1,n+1):
x=int(math.sqrt(i))
#Checks whether the number is perfect square or not
if((x*x)==i):
c=c+1
print(i)
return c
#Driver's code
def main():
n1=int(input("Enter a number"))
c1=countsq(n1)
print("The number of perfect squares are",c1)
if __name__=="__main__":
main()
'''
Time Complexity:O(n)
Space Complexity:O(1)
Input/Output
Enter a number 55
1
4
9
16
25
36
49
The number of perfect squares are 7
'''
| 378 |
828 | /*
* Copyright 2008-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.hasor.dataway.service;
import com.alibaba.fastjson.JSON;
import net.hasor.dataway.config.DatawayUtils;
import net.hasor.utils.ResourcesUtils;
import net.hasor.utils.StringUtils;
import net.hasor.utils.io.FilenameUtils;
import net.hasor.utils.io.IOUtils;
import net.hasor.utils.io.output.ByteArrayOutputStream;
import net.hasor.web.Invoker;
import net.hasor.web.InvokerChain;
import net.hasor.web.InvokerFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 负责UI界面资源的请求响应。
* @author 赵永春 (<EMAIL>)
* @version : 2020-03-20
*/
public class InterfaceUiFilter implements InvokerFilter {
protected static Logger logger = LoggerFactory.getLogger(InterfaceUiFilter.class);
public static final String resourceBaseUri = "/META-INF/hasor-framework/dataway-ui/";
private String resourceIndexUri = null;
private final String uiBaseUri;
private final String uiAdminBaseUri;
private final Map<String, Integer> resourceSize;
public InterfaceUiFilter(String uiBaseUri) {
this.uiBaseUri = uiBaseUri;
this.uiAdminBaseUri = fixUrl(uiBaseUri + "/api/");
this.resourceIndexUri = fixUrl(uiBaseUri + "/index.html");
this.resourceSize = new ConcurrentHashMap<>();
}
private static String fixUrl(String url) {
return url.replaceAll("/+", "/");
}
@Override
public Object doInvoke(Invoker invoker, InvokerChain chain) throws Throwable {
HttpServletRequest httpRequest = invoker.getHttpRequest();
HttpServletResponse httpResponse = invoker.getHttpResponse();
String requestURI = invoker.getRequestPath();
setupInner(invoker);
if (requestURI.startsWith(this.uiAdminBaseUri)) {
try {
DatawayUtils.resetLocalTime();
return chain.doNext(invoker);
} catch (Exception e) {
logger.error(e.getMessage(), e);
Object objectMap = DatawayUtils.exceptionToResult(e).getResult();
PrintWriter writer = httpResponse.getWriter();
writer.write(JSON.toJSONString(objectMap));
writer.flush();
return objectMap;
}
}
// 处理预请求OPTIONS
String httpMethod = httpRequest.getMethod().toUpperCase().trim();
if (httpMethod.equals("OPTIONS")) {
httpResponse.setStatus(HttpServletResponse.SC_OK);
return httpResponse;
}
//
// 处理 index.html
if (this.uiBaseUri.equalsIgnoreCase(requestURI)) {
requestURI = resourceIndexUri;
}
if (requestURI.equalsIgnoreCase(resourceIndexUri)) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (InputStream inputStream = ResourcesUtils.getResourceAsStream(fixUrl(resourceBaseUri + "/index.html"))) {
IOUtils.copy(inputStream, outputStream);
}
//
String htmlBody = new String(outputStream.toByteArray());
httpResponse.setContentType(invoker.getMimeType("html"));
httpResponse.setContentLength(htmlBody.length());
PrintWriter writer = httpResponse.getWriter();
writer.write(htmlBody);
writer.flush();
return null;
}
// 其它资源
if (requestURI.startsWith(this.uiBaseUri)) {
String extension = FilenameUtils.getExtension(requestURI);
String mimeType = invoker.getMimeType(extension);
if (StringUtils.isNotBlank(mimeType)) {
httpResponse.setContentType(mimeType);
}
httpResponse.setHeader("Cache-control", "public, max-age=2592000");
//
String resourceName = fixUrl(resourceBaseUri + requestURI.substring(this.uiBaseUri.length()));
try (OutputStream outputStream = httpResponse.getOutputStream()) {
// .准备输出流
OutputStream output = null;
Integer size = this.resourceSize.get(resourceName);
if (size == null) {
output = new ByteArrayOutputStream();
} else {
output = outputStream;
httpResponse.setContentLength(size);
}
// .把数据写入流
try (InputStream inputStream = ResourcesUtils.getResourceAsStream(resourceName)) {
if (inputStream == null) {
httpResponse.sendError(404, "not found " + requestURI);
return null;
}
IOUtils.copy(inputStream, output);
} catch (Exception e) {
logger.error("load " + resourceName + " failed -> " + e.getMessage(), e);
}
// .如果是第一次,那么缓存资源长度。然后拷贝到真的流中
if (size == null) {
byte[] byteArray = ((ByteArrayOutputStream) output).toByteArray();
size = byteArray.length;
this.resourceSize.put(resourceName, size);
outputStream.write(byteArray);
}
outputStream.flush();
}
return null;
}
//
return chain.doNext(invoker);
}
public static void setupInner(Invoker invoker) {
HttpServletRequest httpRequest = invoker.getHttpRequest();
HttpServletResponse httpResponse = invoker.getHttpResponse();
//
String originString = httpRequest.getHeader("Origin");
if (StringUtils.isNotBlank(originString)) {
httpResponse.setHeader("Access-Control-Allow-Origin", originString);
httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
} else {
httpResponse.setHeader("Access-Control-Allow-Origin", "*");
}
httpResponse.addHeader("Access-Control-Allow-Methods", "*");
httpResponse.addHeader("Access-Control-Allow-Headers", "Content-Type,X-InterfaceUI-Info");
httpResponse.addHeader("Access-Control-Expose-Headers", "X-InterfaceUI-ContextType");
httpResponse.addHeader("Access-Control-Max-Age", "3600");
}
} | 3,264 |
678 | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSObject.h"
@class NSString, UIImage;
@protocol ShortVideoBarDelegate <NSObject>
- (void)onCameraResign;
- (void)onSightPictureTaken:(UIImage *)arg1 withFrontCamera:(_Bool)arg2;
- (void)onShortVideoTaken:(NSString *)arg1 thumbImg:(UIImage *)arg2 sentImmediately:(_Bool)arg3 isMuted:(_Bool)arg4;
- (void)onShortVideoToolBtnClick:(int)arg1;
@optional
- (NSString *)chatUserNameForSightStatistics;
- (void)onStopRecord;
- (void)onStartRecord;
- (void)onDeactiveAnimStart:(double)arg1;
- (void)onPanelDrag:(double)arg1;
- (void)onDeactiveAnimEnd;
@end
| 270 |
1,556 | import sys
sys.path.append("")
from micropython import const
import time, machine
import uasyncio as asyncio
import aioble
import bluetooth
import random
TIMEOUT_MS = 5000
_L2CAP_PSM = const(22)
_L2CAP_MTU = const(512)
_PAYLOAD_LEN = const(_L2CAP_MTU)
_NUM_PAYLOADS = const(20)
_RANDOM_SEED = 22
# Acting in peripheral role.
async def instance0_task():
multitest.globals(BDADDR=aioble.config("mac"))
multitest.next()
connection = await aioble.advertise(
20_000, adv_data=b"\x02\x01\x06\x04\xffMPY", timeout_ms=TIMEOUT_MS
)
channel = await connection.l2cap_accept(_L2CAP_PSM, _L2CAP_MTU, timeout_ms=TIMEOUT_MS)
random.seed(_RANDOM_SEED)
buf = bytearray(_PAYLOAD_LEN)
for i in range(_NUM_PAYLOADS):
for j in range(_PAYLOAD_LEN):
buf[j] = random.randint(0, 255)
await channel.send(buf)
await channel.flush()
await asyncio.sleep_ms(500)
await channel.disconnect()
# Disconnect the central.
await connection.disconnect()
def instance0():
try:
asyncio.run(instance0_task())
finally:
aioble.stop()
# Acting in central role.
async def instance1_task():
multitest.next()
device = aioble.Device(*BDADDR)
connection = await device.connect(timeout_ms=TIMEOUT_MS)
await asyncio.sleep_ms(500)
channel = await connection.l2cap_connect(_L2CAP_PSM, _L2CAP_MTU, timeout_ms=TIMEOUT_MS)
random.seed(_RANDOM_SEED)
buf = bytearray(_PAYLOAD_LEN)
recv_bytes, recv_correct = 0, 0
expected_bytes = _PAYLOAD_LEN * _NUM_PAYLOADS
ticks_first_byte = 0
while recv_bytes < expected_bytes:
n = await channel.recvinto(buf)
if not ticks_first_byte:
ticks_first_byte = time.ticks_ms()
recv_bytes += n
for i in range(n):
if buf[i] == random.randint(0, 255):
recv_correct += 1
ticks_end = time.ticks_ms()
total_ticks = time.ticks_diff(ticks_end, ticks_first_byte)
print(
"Received {}/{} bytes in {} ms. {} B/s".format(
recv_bytes, recv_correct, total_ticks, recv_bytes * 1000 // total_ticks
)
)
# Wait for the peripheral to disconnect us.
await connection.disconnected(timeout_ms=20000)
def instance1():
try:
asyncio.run(instance1_task())
finally:
aioble.stop()
| 1,051 |
1,198 | /*
Copyright 2017-2019 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.
*/
#ifndef LULLABY_TESTS_UTIL_FAKE_FLATBUFFER_UNION_H_
#define LULLABY_TESTS_UTIL_FAKE_FLATBUFFER_UNION_H_
#include <limits>
#include <unordered_map>
#include <vector>
#include "flatbuffers/flatbuffers.h"
#include "ion/base/logging.h"
#include "lullaby/util/typeid.h"
namespace lull {
namespace testing {
// This class allows a user to represent a union of flatbuffer / def types in
// code without specifying the types ahead of time in a .fbs file.
//
// Normally this is accomplished by code generated by flatc and the .fbs file
// is required to provide the schema (list of flatbuffer types).
//
// The FakeFlatbufferUnion maintains a global "active" union, which is used by
// clients to back their types.
//
// Usage:
// FakeFlatbuffersUnion* fb_union =
// FakeFlatbufferUnion::Create<NameDefT, MyProjectSpecificDefT>();
// const char **comp_names = fb_union->GetTypeNames();
// CHECK(comp_names == {"NameDefT", "MyProjectSpecificDefT", nullptr});
// CHECK(FakeFlatbufferUnion::TypeToDefId<NameDefT>::value == 0);
//
// FakeFlatbufferUnion::SetActive(fb_union);
// CHECK(FakeFlatbufferUnion::TypeToDefId<NameDefT>::value == 1);
//
// FakeFlatbufferUnion::ClearActive();
// delete fb_union;
class FakeFlatbufferUnion {
public:
// Integer DefId which is used by the flatbuffers implementation.
using DefId = uint8_t;
// This helper template allows mapping directly from a def type to its
// integral DefId when placed in the active union. The value will be 0 for
// any types that are not valid in the active union.
template <typename T>
struct TypeToDefId {
static DefId value;
};
// Create a union with a specific set of types.
// The union should be made active with SetActive() below in order to be fully
// usable.
template <typename... Types>
static std::unique_ptr<FakeFlatbufferUnion> Create();
// Mark the given union as the active one.
//
// Note: Generates a fatal error if another union is already active.
static void SetActive(const FakeFlatbufferUnion* fake_union);
// Clears the given active union and resets it to nullptr.
static void ClearActive();
// Gets the current active union.
static const FakeFlatbufferUnion* GetActive() { return s_fake_union_; }
// Gets a nullptr-terminated list of type names for the currently active
// union.
// If no union is currently active, a default list of typenames will be
// returned, corresponding to an empty union.
static const char** GetActiveTypeNames();
// Gets a nullptr-terminated list of the names of all types that were
// registered in this map.
//
// The first entry in the names list is always the string "NONE", representing
// the lack of a type.
// The names are unqualified.
// The names are listed in the order that they were registered.
//
// The const_cast is necessary for conformance to the flatbuffers API.
const char** GetTypeNames() const {
return const_cast<const char**>(type_names_.data());
}
// Gets the number of registered type names, not including the terminating
// nullptr.
//
// This will always be at least 1 due to the first list entry for "NONE".
size_t GetTypeNamesCount() const { return type_names_.size() - 1; }
// Gets the TypeId corresponding to the given integer DefId in this type map.
// Returns 0 if the DefId is not valid in this type map.
TypeId GetTypeId(DefId type) const;
// Gets the integer DefId type corresponding to the given TypeId when it
// is placed in this type map. Returns 0 if the TypeID is not valid in this
// type map.
DefId GetDefId(TypeId type) const;
private:
using TypeNameList = std::vector<const char*>;
using TypeIdList = std::vector<TypeId>;
using TypeToDefMappingList = std::vector<DefId*>;
using ReverseTypeMap = std::unordered_map<TypeId, DefId>;
// Only Create<>() should be able to construct instances of this type.
FakeFlatbufferUnion() {}
template <typename... Types>
void RegisterTypes();
template <typename Type, typename... RemainingTypes>
void RegisterTypeAndRecurse();
void RegisterType(const char* fully_qualified_type_name, const TypeId type_id,
DefId* type_to_def_mapping = nullptr);
void OnActivate() const;
void OnDeactivate() const;
static const FakeFlatbufferUnion* s_fake_union_;
static const char* s_default_type_names_[2];
TypeNameList type_names_;
TypeIdList type_ids_;
TypeToDefMappingList type_to_def_mappings_;
ReverseTypeMap reverse_type_map_;
};
template <typename T>
FakeFlatbufferUnion::DefId FakeFlatbufferUnion::TypeToDefId<T>::value = 0;
template <typename... Types>
std::unique_ptr<FakeFlatbufferUnion> FakeFlatbufferUnion::Create() {
FakeFlatbufferUnion* type_map = new FakeFlatbufferUnion();
type_map->RegisterType("NONE", 0); // Always include the "NONE" type.
type_map->RegisterTypes<Types...>();
return std::unique_ptr<FakeFlatbufferUnion>(type_map);
}
template <typename... Types>
void FakeFlatbufferUnion::RegisterTypes() {
RegisterTypeAndRecurse<Types...>();
}
template <>
inline void FakeFlatbufferUnion::RegisterTypes() {
// Finished recursively registering types, so add the required nullptr to the
// names list now.
type_names_.emplace_back(nullptr);
}
template <typename Type, typename... RemainingTypes>
void FakeFlatbufferUnion::RegisterTypeAndRecurse() {
const char* type_name = Type::FlatBufferType::GetFullyQualifiedName();
const TypeId type_id = lull::GetTypeId<Type>();
DefId* type_to_def_mapping =
&TypeToDefId<typename Type::FlatBufferType>::value;
RegisterType(type_name, type_id, type_to_def_mapping);
RegisterTypes<RemainingTypes...>();
}
} // namespace testing
} // namespace lull
#endif // LULLABY_TESTS_UTIL_FAKE_FLATBUFFER_UNION_H_
| 1,962 |
1,656 | <reponame>HashZhang/spring-cloud-sleuth
/*
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.sleuth.instrument.task;
import java.util.Iterator;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.sleuth.exporter.FinishedSpan;
import org.springframework.cloud.sleuth.test.TestSpanHandler;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import static org.assertj.core.api.BDDAssertions.then;
@ContextConfiguration(classes = SpringCloudTaskIntegrationTests.TestConfig.class)
@TestPropertySource(properties = { "spring.application.name=MyApplication", "spring.sleuth.tx.enabled=false" })
public abstract class SpringCloudTaskIntegrationTests {
@Autowired
TestSpanHandler spans;
@Test
public void should_pass_tracing_information_when_using_spring_cloud_task() {
Set<String> traceIds = this.spans.reportedSpans().stream().map(FinishedSpan::getTraceId)
.collect(Collectors.toSet());
then(traceIds).as("There's one traceid").hasSize(1);
Set<String> spanIds = this.spans.reportedSpans().stream().map(FinishedSpan::getSpanId)
.collect(Collectors.toSet());
then(spanIds).as("There are 3 spans").hasSize(3);
Iterator<FinishedSpan> spanIterator = this.spans.reportedSpans().iterator();
FinishedSpan first = spanIterator.next();
FinishedSpan second = spanIterator.next();
FinishedSpan third = spanIterator.next();
then(first.getName()).isEqualTo("myApplicationRunner");
then(second.getName()).isEqualTo("myCommandLineRunner");
then(third.getName()).isEqualTo("MyApplication");
}
@Configuration(proxyBeanMethods = false)
@EnableAutoConfiguration
@EnableTask
public static class TestConfig {
@Bean
MyCommandLineRunner myCommandLineRunner() {
return new MyCommandLineRunner();
}
@Bean
MyApplicationRunner myApplicationRunner() {
return new MyApplicationRunner();
}
}
static class MyCommandLineRunner implements CommandLineRunner {
private static final Log log = LogFactory.getLog(MyCommandLineRunner.class);
@Override
public void run(String... args) throws Exception {
log.info("Ran MyCommandLineRunner");
}
}
static class MyApplicationRunner implements ApplicationRunner {
private static final Log log = LogFactory.getLog(MyApplicationRunner.class);
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("Ran MyApplicationRunner");
}
}
}
| 1,102 |
986 | #include "portaudiocpp/Exception.hxx"
namespace portaudio
{
// -----------------------------------------------------------------------------------
// PaException:
// -----------------------------------------------------------------------------------
//////
/// Wraps a PortAudio error into a PortAudioCpp PaException.
//////
PaException::PaException(PaError error) : error_(error)
{
}
// -----------------------------------------------------------------------------------
//////
/// Alias for paErrorText(), to have std::exception compliance.
//////
const char *PaException::what() const throw()
{
return paErrorText();
}
// -----------------------------------------------------------------------------------
//////
/// Returns the PortAudio error code (PaError).
//////
PaError PaException::paError() const
{
return error_;
}
//////
/// Returns the error as a (zero-terminated) text string.
//////
const char *PaException::paErrorText() const
{
return Pa_GetErrorText(error_);
}
//////
/// Returns true is the error is a HostApi error.
//////
bool PaException::isHostApiError() const
{
return (error_ == paUnanticipatedHostError);
}
//////
/// Returns the last HostApi error (which is the current one if
/// isHostApiError() returns true) as an error code.
//////
long PaException::lastHostApiError() const
{
return Pa_GetLastHostErrorInfo()->errorCode;
}
//////
/// Returns the last HostApi error (which is the current one if
/// isHostApiError() returns true) as a (zero-terminated) text
/// string, if it's available.
//////
const char *PaException::lastHostApiErrorText() const
{
return Pa_GetLastHostErrorInfo()->errorText;
}
// -----------------------------------------------------------------------------------
bool PaException::operator==(const PaException &rhs) const
{
return (error_ == rhs.error_);
}
bool PaException::operator!=(const PaException &rhs) const
{
return !(*this == rhs);
}
// -----------------------------------------------------------------------------------
// PaCppException:
// -----------------------------------------------------------------------------------
PaCppException::PaCppException(ExceptionSpecifier specifier) : specifier_(specifier)
{
}
const char *PaCppException::what() const throw()
{
switch (specifier_)
{
case UNABLE_TO_ADAPT_DEVICE:
{
return "Unable to adapt the given device to the specified host api specific device extension";
}
}
return "Unknown exception";
}
PaCppException::ExceptionSpecifier PaCppException::specifier() const
{
return specifier_;
}
bool PaCppException::operator==(const PaCppException &rhs) const
{
return (specifier_ == rhs.specifier_);
}
bool PaCppException::operator!=(const PaCppException &rhs) const
{
return !(*this == rhs);
}
// -----------------------------------------------------------------------------------
} // namespace portaudio
| 842 |
5,169 | <filename>Specs/PPiFlatSegmentedControl/1.3/PPiFlatSegmentedControl.podspec.json
{
"name": "PPiFlatSegmentedControl",
"version": "1.3",
"platforms": {
"ios": "5.0"
},
"license": "MIT",
"summary": "Flat UISegmentedControl for flat designs.",
"homepage": "https://github.com/pepibumur/PPiFlatSegmentedControl",
"authors": {
"<NAME>": "<EMAIL>"
},
"source": {
"git": "https://github.com/pepibumur/PPiFlatSegmentedControl.git",
"tag": "1.3"
},
"description": "\n PPiFlatSegmentedControl is an UI Control developed avoiding original UISegmentedControl to get interesting features related with the flat design. It's linked with AwesomeFont library in order to add icons to segments\n",
"requires_arc": true,
"source_files": "Control/*.{h,m}",
"frameworks": "QuartzCore",
"public_header_files": "Control/*.h"
}
| 311 |
3,066 | <gh_stars>1000+
/*
* Licensed to Crate.io GmbH ("Crate") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership. Crate 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.
*
* However, if you have executed another commercial license agreement
* with Crate these terms will supersede the license and you may use the
* software solely pursuant to the terms of the relevant commercial agreement.
*/
package io.crate.protocols.postgres;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.concurrent.CompletableFuture;
import org.junit.Test;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
public class DelayableWriteChannelTest {
@Test
public void test_delayed_writes_are_released_on_close() throws Exception {
var channel = new DelayableWriteChannel(new EmbeddedChannel());
var future = new CompletableFuture<>();
channel.delayWritesUntil(future);
ByteBuf buffer = Unpooled.buffer();
channel.write(buffer);
channel.close();
assertThat(buffer.refCnt(), is(0));
}
}
| 532 |
429 | /* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: drpc_test.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "drpc_test.pb-c.h"
void hello__hello__init
(Hello__Hello *message)
{
static const Hello__Hello init_value = HELLO__HELLO__INIT;
*message = init_value;
}
size_t hello__hello__get_packed_size
(const Hello__Hello *message)
{
assert(message->base.descriptor == &hello__hello__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t hello__hello__pack
(const Hello__Hello *message,
uint8_t *out)
{
assert(message->base.descriptor == &hello__hello__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t hello__hello__pack_to_buffer
(const Hello__Hello *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &hello__hello__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Hello__Hello *
hello__hello__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Hello__Hello *)
protobuf_c_message_unpack (&hello__hello__descriptor,
allocator, len, data);
}
void hello__hello__free_unpacked
(Hello__Hello *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &hello__hello__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void hello__hello_response__init
(Hello__HelloResponse *message)
{
static const Hello__HelloResponse init_value = HELLO__HELLO_RESPONSE__INIT;
*message = init_value;
}
size_t hello__hello_response__get_packed_size
(const Hello__HelloResponse *message)
{
assert(message->base.descriptor == &hello__hello_response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t hello__hello_response__pack
(const Hello__HelloResponse *message,
uint8_t *out)
{
assert(message->base.descriptor == &hello__hello_response__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t hello__hello_response__pack_to_buffer
(const Hello__HelloResponse *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &hello__hello_response__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Hello__HelloResponse *
hello__hello_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Hello__HelloResponse *)
protobuf_c_message_unpack (&hello__hello_response__descriptor,
allocator, len, data);
}
void hello__hello_response__free_unpacked
(Hello__HelloResponse *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &hello__hello_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor hello__hello__field_descriptors[1] =
{
{
"name",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Hello__Hello, name),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned hello__hello__field_indices_by_name[] = {
0, /* field[0] = name */
};
static const ProtobufCIntRange hello__hello__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor hello__hello__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"hello.Hello",
"Hello",
"Hello__Hello",
"hello",
sizeof(Hello__Hello),
1,
hello__hello__field_descriptors,
hello__hello__field_indices_by_name,
1, hello__hello__number_ranges,
(ProtobufCMessageInit) hello__hello__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor hello__hello_response__field_descriptors[1] =
{
{
"greeting",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Hello__HelloResponse, greeting),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned hello__hello_response__field_indices_by_name[] = {
0, /* field[0] = greeting */
};
static const ProtobufCIntRange hello__hello_response__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor hello__hello_response__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"hello.HelloResponse",
"HelloResponse",
"Hello__HelloResponse",
"hello",
sizeof(Hello__HelloResponse),
1,
hello__hello_response__field_descriptors,
hello__hello_response__field_indices_by_name,
1, hello__hello_response__number_ranges,
(ProtobufCMessageInit) hello__hello_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue hello__module__enum_values_by_number[1] =
{
{ "HELLO", "HELLO__MODULE__HELLO", 0 },
};
static const ProtobufCIntRange hello__module__value_ranges[] = {
{0, 0},{0, 1}
};
static const ProtobufCEnumValueIndex hello__module__enum_values_by_name[1] =
{
{ "HELLO", 0 },
};
const ProtobufCEnumDescriptor hello__module__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"hello.Module",
"Module",
"Hello__Module",
"hello",
1,
hello__module__enum_values_by_number,
1,
hello__module__enum_values_by_name,
1,
hello__module__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
static const ProtobufCEnumValue hello__function__enum_values_by_number[1] =
{
{ "GREETING", "HELLO__FUNCTION__GREETING", 0 },
};
static const ProtobufCIntRange hello__function__value_ranges[] = {
{0, 0},{0, 1}
};
static const ProtobufCEnumValueIndex hello__function__enum_values_by_name[1] =
{
{ "GREETING", 0 },
};
const ProtobufCEnumDescriptor hello__function__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"hello.Function",
"Function",
"Hello__Function",
"hello",
1,
hello__function__enum_values_by_number,
1,
hello__function__enum_values_by_name,
1,
hello__function__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
| 2,979 |
428 | <reponame>cping/LGame
/**
* Copyright 2008 - 2015 The Loon Game Engine Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* @project loon
* @author cping
* @email:<EMAIL>
* @version 0.5
*/
package loon.gwtref.gen;
import java.io.PrintWriter;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gwt.core.ext.BadPropertyValueException;
import com.google.gwt.core.ext.ConfigurationProperty;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.typeinfo.*;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
import com.google.gwt.user.rebind.SourceWriter;
@SuppressWarnings("rawtypes")
public class ReflectionCacheSourceCreator {
private static final List<String> PRIMITIVE_TYPES = Collections
.unmodifiableList(Arrays.asList("char", "int", "long", "byte",
"short", "float", "double", "boolean"));
final TreeLogger logger;
final GeneratorContext context;
final JClassType type;
final String simpleName;
final String packageName;
SourceWriter sw;
final StringBuffer source = new StringBuffer();
final List<JType> types = new ArrayList<JType>();
final List<SetterGetterStub> setterGetterStubs = new ArrayList<SetterGetterStub>();
final List<MethodStub> methodStubs = new ArrayList<MethodStub>();
final Map<String, String> parameterName2ParameterInstantiation = new HashMap<String, String>();
final Map<String, Integer> typeNames2typeIds = new HashMap<String, Integer>();
int nextTypeId;
int nextSetterGetterId;
int nextInvokableId;
class SetterGetterStub {
int getter;
int setter;
String name;
String enclosingType;
String type;
boolean isStatic;
boolean isFinal;
boolean unused;
}
class MethodStub {
String enclosingType;
String returnType;
List<String> parameterTypes = new ArrayList<String>();
String jnsi;
int methodId;
boolean isStatic;
boolean isAbstract;
boolean isFinal;
boolean isNative;
boolean isConstructor;
boolean isMethod;
boolean isPublic;
String name;
boolean unused;
}
public ReflectionCacheSourceCreator(TreeLogger logger,
GeneratorContext context, JClassType type) {
this.logger = logger;
this.context = context;
this.type = type;
this.packageName = type.getPackage().getName();
this.simpleName = type.getSimpleSourceName() + "Generated";
logger.log(Type.INFO, type.getQualifiedSourceName());
}
public String create() {
ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(
packageName, simpleName);
composer.addImplementedInterface("loon.gwtref.client.IReflectionCache");
imports(composer);
PrintWriter printWriter = context.tryCreate(logger, packageName,
simpleName);
if (printWriter == null) {
return packageName + "." + simpleName;
}
sw = composer.createSourceWriter(context, printWriter);
generateLookups();
forNameC();
newArrayC();
getArrayLengthT();
getArrayElementT();
setArrayElementT();
getF();
setF();
invokeM();
sw.commit(logger);
createProxy(type);
return packageName + "." + simpleName;
}
private void createProxy(JClassType type) {
ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(
type.getPackage().getName(), type.getSimpleSourceName()
+ "Proxy");
PrintWriter printWriter = context.tryCreate(logger, packageName,
simpleName);
if (printWriter == null) {
return;
}
SourceWriter writer = composer.createSourceWriter(context, printWriter);
writer.commit(logger);
}
private void generateLookups() {
TypeOracle typeOracle = context.getTypeOracle();
JPackage[] packages = typeOracle.getPackages();
for (JPackage p : packages) {
for (JClassType t : p.getTypes()) {
gatherTypes(t.getErasedType(), types);
}
}
try {
ConfigurationProperty prop = context.getPropertyOracle()
.getConfigurationProperty("loon.reflect.include");
for (String s : prop.getValues()) {
JClassType type = typeOracle.findType(s);
if (type != null)
gatherTypes(type.getErasedType(), types);
}
} catch (BadPropertyValueException e) {
}
gatherTypes(typeOracle.findType("java.util.List").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.util.ArrayList").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.util.HashMap").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.util.Map").getErasedType(), types);
gatherTypes(typeOracle.findType("java.lang.String").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Boolean").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Byte").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Long").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Character").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Short").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Integer").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Float").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.CharSequence")
.getErasedType(), types);
gatherTypes(typeOracle.findType("java.lang.Double").getErasedType(),
types);
gatherTypes(typeOracle.findType("java.lang.Object").getErasedType(),
types);
Collections.sort(types, new Comparator<JType>() {
public int compare(JType o1, JType o2) {
return o1.getQualifiedSourceName().compareTo(
o2.getQualifiedSourceName());
}
});
for (JType t : types) {
p(createTypeGenerator(t));
}
parameterInitialization();
Collections.sort(setterGetterStubs, new Comparator<SetterGetterStub>() {
@Override
public int compare(SetterGetterStub o1, SetterGetterStub o2) {
return new Integer(o1.setter).compareTo(o2.setter);
}
});
for (SetterGetterStub stub : setterGetterStubs) {
String stubSource = generateSetterGetterStub(stub);
if (stubSource.equals(""))
stub.unused = true;
p(stubSource);
}
Collections.sort(methodStubs, new Comparator<MethodStub>() {
@Override
public int compare(MethodStub o1, MethodStub o2) {
return new Integer(o1.methodId).compareTo(o2.methodId);
}
});
for (MethodStub stub : methodStubs) {
String stubSource = generateMethodStub(stub);
if (stubSource.equals(""))
stub.unused = true;
p(stubSource);
}
logger.log(Type.INFO, types.size() + " types reflected");
}
private void out(String message, int nesting) {
for (int i = 0; i < nesting; i++)
System.out.print(" ");
System.out.println(message);
}
int nesting = 0;
private void gatherTypes(JType type, List<JType> types) {
nesting++;
if (type == null) {
nesting--;
return;
}
if (type.getQualifiedSourceName().contains("-")) {
nesting--;
return;
}
if (!isVisible(type)) {
nesting--;
return;
}
boolean keep = false;
String name = type.getQualifiedSourceName();
try {
ConfigurationProperty prop;
keep |= !name.contains(".");
prop = context.getPropertyOracle().getConfigurationProperty(
"loon.reflect.include");
for (String s : prop.getValues())
keep |= name.contains(s);
prop = context.getPropertyOracle().getConfigurationProperty(
"loon.reflect.exclude");
for (String s : prop.getValues())
keep &= !name.equals(s);
} catch (BadPropertyValueException e) {
e.printStackTrace();
}
if (!keep) {
nesting--;
return;
}
if (types.contains(type.getErasedType())) {
nesting--;
return;
}
types.add(type.getErasedType());
out(type.getErasedType().getQualifiedSourceName(), nesting);
if (type instanceof JPrimitiveType) {
nesting--;
return;
} else {
JClassType c = (JClassType) type;
JField[] fields = c.getFields();
if (fields != null) {
for (JField field : fields) {
gatherTypes(field.getType().getErasedType(), types);
}
}
gatherTypes(c.getSuperclass(), types);
JClassType[] interfaces = c.getImplementedInterfaces();
if (interfaces != null) {
for (JClassType i : interfaces) {
gatherTypes(i.getErasedType(), types);
}
}
JMethod[] methods = c.getMethods();
if (methods != null) {
for (JMethod m : methods) {
gatherTypes(m.getReturnType().getErasedType(), types);
if (m.getParameterTypes() != null) {
for (JType p : m.getParameterTypes()) {
gatherTypes(p.getErasedType(), types);
}
}
}
}
JClassType[] inner = c.getNestedTypes();
if (inner != null) {
for (JClassType i : inner) {
gatherTypes(i.getErasedType(), types);
}
}
}
nesting--;
}
private String generateMethodStub(MethodStub stub) {
buffer.setLength(0);
if (stub.enclosingType == null) {
logger.log(Type.INFO, "method '" + stub.name
+ "' of invisible class is not invokable");
return "";
}
if ((stub.enclosingType.startsWith("java") && !stub.enclosingType
.startsWith("java.util"))
|| stub.enclosingType.contains("google")) {
logger.log(Type.INFO, "not emitting code for accessing method "
+ stub.name + " in class '" + stub.enclosingType
+ ", either in java.* or GWT related class");
return "";
}
if (stub.enclosingType.contains("[]")) {
logger.log(Type.INFO, "method '" + stub.name + "' of class '"
+ stub.enclosingType
+ "' is not invokable because the class is an array type");
return "";
}
for (int i = 0; i < stub.parameterTypes.size(); i++) {
String paramType = stub.parameterTypes.get(i);
if (paramType == null) {
logger.log(
Type.INFO,
"method '"
+ stub.name
+ "' of class '"
+ stub.enclosingType
+ "' is not invokable because one of its argument types is not visible");
return "";
} else if (paramType.startsWith("long")
|| paramType.contains("java.lang.Long")) {
logger.log(Type.INFO, "method '" + stub.name + "' of class '"
+ stub.enclosingType
+ " has long parameter, prohibited in JSNI");
return "";
} else {
stub.parameterTypes.set(i, paramType.replace(".class", ""));
}
}
if (stub.returnType == null) {
logger.log(
Type.INFO,
"method '"
+ stub.name
+ "' of class '"
+ stub.enclosingType
+ "' is not invokable because its return type is not visible");
return "";
}
if (stub.returnType.startsWith("long")
|| stub.returnType.contains("java.lang.Long")) {
logger.log(Type.INFO, "method '" + stub.name + "' of class '"
+ stub.enclosingType
+ " has long return type, prohibited in JSNI");
return "";
}
stub.enclosingType = stub.enclosingType.replace(".class", "");
stub.returnType = stub.returnType.replace(".class", "");
if (stub.isMethod) {
boolean isVoid = stub.returnType.equals("void");
pbn("private native " + (isVoid ? "Object" : stub.returnType)
+ " m" + stub.methodId + "(");
if (!stub.isStatic)
pbn(stub.enclosingType + " obj"
+ (stub.parameterTypes.size() > 0 ? ", " : ""));
int i = 0;
for (String paramType : stub.parameterTypes) {
pbn(paramType + " p" + i
+ (i < stub.parameterTypes.size() - 1 ? "," : ""));
i++;
}
pbn(") /*-{");
if (!isVoid)
pbn("return ");
if (stub.isStatic)
pbn("@" + stub.enclosingType + "::" + stub.name + "("
+ stub.jnsi + ")(");
else
pbn("obj.@" + stub.enclosingType + "::" + stub.name + "("
+ stub.jnsi + ")(");
for (i = 0; i < stub.parameterTypes.size(); i++) {
pbn("p" + i + (i < stub.parameterTypes.size() - 1 ? ", " : ""));
}
pbn(");");
if (isVoid)
pbn("return null;");
pbn("}-*/;");
} else {
pbn("private static " + stub.returnType + " m" + stub.methodId
+ "(");
int i = 0;
for (String paramType : stub.parameterTypes) {
pbn(paramType + " p" + i
+ (i < stub.parameterTypes.size() - 1 ? "," : ""));
i++;
}
pbn(") {");
pbn("return new " + stub.returnType + "(");
for (i = 0; i < stub.parameterTypes.size(); i++) {
pbn("p" + i + (i < stub.parameterTypes.size() - 1 ? ", " : ""));
}
pbn(")");
if (!stub.isPublic) {
pbn("{}");
}
pbn(";");
pbn("}");
}
return buffer.toString();
}
private String generateSetterGetterStub(SetterGetterStub stub) {
buffer.setLength(0);
if (stub.enclosingType == null || stub.type == null) {
logger.log(Type.INFO, "field '" + stub.name + "' in class '"
+ stub.enclosingType + "' is not accessible as its type '"
+ stub.type + "' is not public");
return "";
}
if (stub.enclosingType.startsWith("java")
|| stub.enclosingType.contains("google")) {
logger.log(Type.INFO, "not emitting code for accessing field "
+ stub.name + " in class '" + stub.enclosingType
+ ", either in java.* or GWT related class");
return "";
}
if (stub.type.startsWith("long")
|| stub.type.contains("java.lang.Long")) {
logger.log(Type.INFO, "not emitting code for accessing field "
+ stub.name + " in class '" + stub.enclosingType
+ " as its of type long which can't be used with JSNI");
return "";
}
stub.enclosingType = stub.enclosingType.replace(".class", "");
stub.type = stub.type.replace(".class", "");
pbn("private native " + stub.type + " g" + stub.getter + "("
+ stub.enclosingType + " obj) /*-{");
if (stub.isStatic)
pbn("return @" + stub.enclosingType + "::" + stub.name + ";");
else
pbn("return obj.@" + stub.enclosingType + "::" + stub.name + ";");
pb("}-*/;");
if (!stub.isFinal) {
pbn("private native void s" + stub.setter + "("
+ stub.enclosingType + " obj, " + stub.type
+ " value) /*-{");
if (stub.isStatic)
pbn("@" + stub.enclosingType + "::" + stub.name + " = value");
else
pbn("obj.@" + stub.enclosingType + "::" + stub.name
+ " = value;");
pb("}-*/;");
}
return buffer.toString();
}
private boolean isVisible(JType type) {
if (type == null)
return false;
if (type instanceof JClassType) {
if (type instanceof JArrayType) {
JType componentType = ((JArrayType) type).getComponentType();
while (componentType instanceof JArrayType) {
componentType = ((JArrayType) componentType)
.getComponentType();
}
if (componentType instanceof JClassType) {
return ((JClassType) componentType).isPublic();
}
} else {
return ((JClassType) type).isPublic();
}
}
return true;
}
private String createTypeGenerator(JType t) {
buffer.setLength(0);
int id = nextTypeId++;
typeNames2typeIds.put(t.getErasedType().getQualifiedSourceName(), id);
JClassType c = t.isClass();
String name = t.getErasedType().getQualifiedSourceName();
String superClass = null;
if (c != null && (isVisible(c.getSuperclass()))) {
superClass = c.getSuperclass().getErasedType()
.getQualifiedSourceName()
+ ".class";
}
String interfaces = null;
String assignables = null;
if (c != null && c.getFlattenedSupertypeHierarchy() != null) {
assignables = "new HashSet<Class>(Arrays.asList(";
boolean used = false;
for (JType i : c.getFlattenedSupertypeHierarchy()) {
if (!isVisible(i)
|| i.equals(t)
|| "java.lang.Object".equals(i.getErasedType()
.getQualifiedSourceName()))
continue;
if (used)
assignables += ", ";
assignables += i.getErasedType().getQualifiedSourceName()
+ ".class";
used = true;
}
if (used)
assignables += "))";
else
assignables = null;
}
if (c == null) {
c = t.isInterface();
}
if (c != null && c.getImplementedInterfaces() != null) {
interfaces = "new HashSet<Class>(Arrays.asList(";
boolean used = false;
for (JType i : c.getImplementedInterfaces()) {
if (!isVisible(i) || i.equals(t))
continue;
if (used)
interfaces += ", ";
interfaces += i.getErasedType().getQualifiedSourceName()
+ ".class";
used = true;
}
if (used)
interfaces += "))";
else
interfaces = null;
}
String varName = "c" + id;
pb("private static Type " + varName + ";");
pb("private static Type " + varName + "() {");
pb("if(" + varName + "!=null) return " + varName + ";");
pb(varName + " = new Type(\"" + name + "\", " + id + ", " + name
+ ".class, " + superClass + ", " + assignables + ", "
+ interfaces + ");");
if (c != null) {
if (c.isEnum() != null)
pb(varName + ".isEnum = true;");
if (c.isArray() != null)
pb(varName + ".isArray = true;");
if (c.isMemberType())
pb(varName + ".isMemberClass = true;");
if (c.isInterface() != null) {
pb(varName + ".isInterface = true;");
} else {
pb(varName + ".isStatic = " + c.isStatic() + ";");
pb(varName + ".isAbstract = " + c.isAbstract() + ";");
}
if (c.getFields() != null && c.getFields().length > 0) {
pb(varName + ".fields = new Field[] {");
for (JField f : c.getFields()) {
String enclosingType = getType(c);
String fieldType = getType(f.getType());
int setterGetter = nextSetterGetterId++;
String elementType = getElementTypes(f);
String annotations = getAnnotations(f
.getDeclaredAnnotations());
pb(" new Field(\"" + f.getName() + "\", "
+ enclosingType + ", " + fieldType + ", "
+ f.isFinal() + ", " + f.isDefaultAccess() + ", "
+ f.isPrivate() + ", " + f.isProtected() + ", "
+ f.isPublic() + ", " + f.isStatic() + ", "
+ f.isTransient() + ", " + f.isVolatile() + ", "
+ setterGetter + ", " + setterGetter + ", "
+ elementType + ", " + annotations + "), ");
SetterGetterStub stub = new SetterGetterStub();
stub.name = f.getName();
stub.enclosingType = enclosingType;
stub.type = fieldType;
stub.isStatic = f.isStatic();
stub.isFinal = f.isFinal();
if (enclosingType != null && fieldType != null) {
stub.getter = setterGetter;
stub.setter = setterGetter;
}
setterGetterStubs.add(stub);
}
pb("};");
}
createTypeInvokables(c, varName, "Method", c.getMethods());
if (c.isPublic() && !c.isAbstract()
&& (c.getEnclosingType() == null || c.isStatic())) {
createTypeInvokables(c, varName, "Constructor",
c.getConstructors());
} else {
logger.log(Type.INFO, c.getName()
+ " can't be instantiated. Constructors not generated");
}
if (c.isArray() != null) {
pb(varName + ".componentType = "
+ getType(c.isArray().getComponentType()) + ";");
}
if (c.isEnum() != null) {
JEnumConstant[] enumConstants = c.isEnum().getEnumConstants();
if (enumConstants != null) {
pb(varName + ".enumConstants = new Object["
+ enumConstants.length + "];");
for (int i = 0; i < enumConstants.length; i++) {
pb(varName + ".enumConstants[" + i + "] = "
+ c.getErasedType().getQualifiedSourceName()
+ "." + enumConstants[i].getName() + ";");
}
}
}
Annotation[] annotations = c.getDeclaredAnnotations();
if (annotations != null && annotations.length > 0) {
pb(varName + ".annotations = " + getAnnotations(annotations)
+ ";");
}
} else if (t.isAnnotation() != null) {
pb(varName + ".isAnnotation = true;");
} else {
pb(varName + ".isPrimitive = true;");
}
pb("return " + varName + ";");
pb("}");
return buffer.toString();
}
private void parameterInitialization() {
p("private static final Parameter[] EMPTY_PARAMETERS = new Parameter[0];");
for (Map.Entry<String, String> e : parameterName2ParameterInstantiation
.entrySet()) {
p("private static Parameter " + e.getKey() + ";");
p("private static Parameter " + e.getKey() + "() {");
p(" if (" + e.getKey() + " != null) return " + e.getKey() + ";");
p(" return " + e.getKey() + " = " + e.getValue() + ";");
p("}");
}
}
private void createTypeInvokables(JClassType c, String varName,
String methodType, JAbstractMethod[] methodTypes) {
if (methodTypes != null && methodTypes.length > 0) {
pb(varName + "." + methodType.toLowerCase() + "s = new "
+ methodType + "[] {");
for (JAbstractMethod m : methodTypes) {
MethodStub stub = new MethodStub();
stub.isPublic = m.isPublic();
stub.enclosingType = getType(c);
if (m.isMethod() != null) {
stub.isMethod = true;
stub.returnType = getType(m.isMethod().getReturnType());
stub.isStatic = m.isMethod().isStatic();
stub.isAbstract = m.isMethod().isAbstract();
stub.isNative = m.isMethod().isAbstract();
stub.isFinal = m.isMethod().isFinal();
} else {
if (m.isPrivate() || m.isDefaultAccess()) {
logger.log(Type.INFO,
"Skipping non-visible constructor for class "
+ c.getName());
continue;
}
if (m.getEnclosingType().isFinal() && !m.isPublic()) {
logger.log(Type.INFO,
"Skipping non-public constructor for final class"
+ c.getName());
continue;
}
stub.isConstructor = true;
stub.returnType = stub.enclosingType;
}
stub.jnsi = "";
stub.methodId = nextInvokableId++;
stub.name = m.getName();
methodStubs.add(stub);
pbn(" new " + methodType + "(\"" + m.getName() + "\", ");
pbn(stub.enclosingType + ", ");
pbn(stub.returnType + ", ");
if (m.getParameters() != null && m.getParameters().length > 0) {
pbn("new Parameter[] {");
for (JParameter p : m.getParameters()) {
stub.parameterTypes.add(getType(p.getType()));
stub.jnsi += p.getType().getErasedType()
.getJNISignature();
String paramName = (p.getName() + "__" + p.getType()
.getErasedType().getJNISignature()).replaceAll(
"[/;\\[\\]]", "_");
String paramInstantiation = "new Parameter(\""
+ p.getName() + "\", " + getType(p.getType())
+ ", \"" + p.getType().getJNISignature()
+ "\")";
parameterName2ParameterInstantiation.put(paramName,
paramInstantiation);
pbn(paramName + "(), ");
}
pbn("}, ");
} else {
pbn("EMPTY_PARAMETERS,");
}
pb(stub.isAbstract + ", " + stub.isFinal + ", " + stub.isStatic
+ ", " + m.isDefaultAccess() + ", " + m.isPrivate()
+ ", " + m.isProtected() + ", " + m.isPublic() + ", "
+ stub.isNative + ", " + m.isVarArgs() + ", "
+ stub.isMethod + ", " + stub.isConstructor + ", "
+ stub.methodId + ","
+ getAnnotations(m.getDeclaredAnnotations()) + "),");
}
pb("};");
}
}
private String getElementTypes(JField f) {
StringBuilder b = new StringBuilder();
JParameterizedType params = f.getType().isParameterized();
if (params != null) {
JClassType[] typeArgs = params.getTypeArgs();
b.append("new Class[] {");
for (JClassType typeArg : typeArgs) {
if (typeArg.isWildcard() != null)
b.append("null");
else if (!isVisible(typeArg))
b.append("null");
else if (typeArg.isClassOrInterface() != null)
b.append(
typeArg.isClassOrInterface()
.getQualifiedSourceName()).append(".class");
else if (typeArg.isParameterized() != null)
b.append(typeArg.isParameterized().getQualifiedBinaryName())
.append(".class");
else
b.append("null");
b.append(", ");
}
b.append("}");
return b.toString();
}
return "null";
}
private String getAnnotations(Annotation[] annotations) {
if (annotations != null && annotations.length > 0) {
int numValidAnnotations = 0;
final Class<?>[] ignoredAnnotations = { Deprecated.class,
Retention.class };
StringBuilder b = new StringBuilder();
b.append("new java.lang.annotation.Annotation[] {");
for (Annotation annotation : annotations) {
Class<?> type = annotation.annotationType();
boolean ignoredType = false;
for (int i = 0; !ignoredType && i < ignoredAnnotations.length; i++) {
ignoredType = ignoredAnnotations[i].equals(type);
}
if (ignoredType) {
continue;
}
Retention retention = type.getAnnotation(Retention.class);
if (retention == null
|| retention.value() != RetentionPolicy.RUNTIME) {
continue;
}
numValidAnnotations++;
b.append(" new ").append(type.getCanonicalName())
.append("() {");
Method[] methods = type.getDeclaredMethods();
for (Method method : methods) {
Class<?> returnType = method.getReturnType();
b.append(" @Override public");
b.append(" ").append(returnType.getCanonicalName());
b.append(" ").append(method.getName())
.append("() { return");
if (returnType.isArray()) {
b.append(" new ").append(returnType.getCanonicalName())
.append(" {");
}
Object invokeResult = null;
try {
invokeResult = method.invoke(annotation);
} catch (IllegalAccessException e) {
logger.log(Type.ERROR,
"Error invoking annotation method.");
} catch (InvocationTargetException e) {
logger.log(Type.ERROR,
"Error invoking annotation method.");
}
if (invokeResult != null) {
if (returnType.equals(String[].class)) {
// String[]
for (String s : (String[]) invokeResult) {
b.append(" \"").append(s).append("\",");
}
} else if (returnType.equals(String.class)) {
// String
b.append(" \"").append((String) invokeResult)
.append("\"");
} else if (returnType.equals(Class[].class)) {
// Class[]
for (Class c : (Class[]) invokeResult) {
b.append(" ").append(c.getCanonicalName())
.append(".class,");
}
} else if (returnType.equals(Class.class)) {
// Class
b.append(" ")
.append(((Class) invokeResult)
.getCanonicalName())
.append(".class");
} else if (returnType.isArray()
&& returnType.getComponentType().isEnum()) {
// enum[]
String enumTypeName = returnType.getComponentType()
.getCanonicalName();
int length = Array.getLength(invokeResult);
for (int i = 0; i < length; i++) {
Object e = Array.get(invokeResult, i);
b.append(" ").append(enumTypeName).append(".")
.append(e.toString()).append(",");
}
} else if (returnType.isEnum()) {
// enum
b.append(" ").append(returnType.getCanonicalName())
.append(".")
.append(invokeResult.toString());
} else if (returnType.isArray()
&& returnType.getComponentType().isPrimitive()) {
// primitive []
Class<?> primitiveType = returnType
.getComponentType();
int length = Array.getLength(invokeResult);
for (int i = 0; i < length; i++) {
Object n = Array.get(invokeResult, i);
b.append(" ").append(n.toString());
if (primitiveType.equals(float.class)) {
b.append("f");
}
b.append(",");
}
} else if (returnType.isPrimitive()) {
// primitive
b.append(" ").append(invokeResult.toString());
if (returnType.equals(float.class)) {
b.append("f");
}
} else {
logger.log(Type.ERROR,
"Return type not supported (or not yet implemented).");
}
}
if (returnType.isArray()) {
b.append(" }");
}
b.append("; ");
b.append("}");
}
b.append(" @Override public Class<? extends java.lang.annotation.Annotation> annotationType() { return ");
b.append(type.getCanonicalName());
b.append(".class; }");
b.append("}, ");
}
b.append("}");
return (numValidAnnotations > 0) ? b.toString() : "null";
}
return "null";
}
private String getType(JType type) {
if (!isVisible(type))
return null;
return type.getErasedType().getQualifiedSourceName() + ".class";
}
private void imports(ClassSourceFileComposerFactory composer) {
composer.addImport("java.security.AccessControlException");
composer.addImport("java.util.*");
composer.addImport("loon.gwtref.client.*");
}
private void invokeM() {
p("public Object invoke(Method m, Object obj, Object[] params) {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("m.methodId");
int subN = 0;
int nDispatch = 0;
for (MethodStub stub : methodStubs) {
if (stub.enclosingType == null)
continue;
if (stub.enclosingType.contains("[]"))
continue;
if (stub.returnType == null)
continue;
if (stub.unused)
continue;
boolean paramsOk = true;
for (String paramType : stub.parameterTypes) {
if (paramType == null) {
paramsOk = false;
break;
}
}
if (!paramsOk)
continue;
buffer.setLength(0);
pbn("return m" + stub.methodId + "(");
addParameters(stub);
pbn(");");
pc.add(stub.methodId, buffer.toString());
nDispatch++;
if (nDispatch > 1000) {
pc.print();
pc = new SwitchedCodeBlock("m.methodId");
subN++;
p(" return invoke" + subN + "(m, obj, params);");
p("}");
p("public Object invoke" + subN
+ "(Method m, Object obj, Object[] params) {");
nDispatch = 0;
}
}
pc.print();
p(" throw new IllegalArgumentException(\"Missing method-stub \" + m.methodId + \" for method \" + m.name);");
p("}");
}
private void addParameters(MethodStub stub) {
if (!stub.isStatic && !stub.isConstructor)
pbn("(" + stub.enclosingType + ")obj"
+ (stub.parameterTypes.size() > 0 ? "," : ""));
for (int i = 0; i < stub.parameterTypes.size(); i++) {
pbn(cast(stub.parameterTypes.get(i), "params[" + i + "]")
+ (i < stub.parameterTypes.size() - 1 ? ", " : ""));
}
}
private String cast(String paramType, String arg) {
if (paramType.equals("byte") || paramType.equals("short")
|| paramType.equals("int") || paramType.equals("long")
|| paramType.equals("float") || paramType.equals("double")) {
return "((Number)" + arg + ")." + paramType + "Value()";
} else if (paramType.equals("boolean")) {
return "((Boolean)" + arg + ")." + paramType + "Value()";
} else if (paramType.equals("char")) {
return "((Character)" + arg + ")." + paramType + "Value()";
} else {
return "((" + paramType + ")" + arg + ")";
}
}
private void setF() {
p("public void set(Field field, Object obj, Object value) throws IllegalAccessException {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("field.setter");
for (SetterGetterStub stub : setterGetterStubs) {
if (stub.enclosingType == null || stub.type == null || stub.isFinal
|| stub.unused)
continue;
pc.add(stub.setter,
"s" + stub.setter + "(" + cast(stub.enclosingType, "obj")
+ ", " + cast(stub.type, "value") + "); return;");
}
pc.print();
p(" throw new IllegalArgumentException(\"Missing setter-stub \" + field.setter + \" for field \" + field.name);");
p("}");
}
private void getF() {
p("public Object get(Field field, Object obj) throws IllegalAccessException {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("field.getter");
for (SetterGetterStub stub : setterGetterStubs) {
if (stub.enclosingType == null || stub.type == null || stub.unused)
continue;
pc.add(stub.getter,
"return g" + stub.getter + "("
+ cast(stub.enclosingType, "obj") + ");");
}
pc.print();
p(" throw new IllegalArgumentException(\"Missing getter-stub \" + field.getter + \" for field \" + field.name);");
p("}");
}
private void setArrayElementT() {
p("public void setArrayElement(Type type, Object obj, int i, Object value) {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("type.id");
for (String s : PRIMITIVE_TYPES) {
if (!typeNames2typeIds.containsKey(s + "[]"))
continue;
pc.add(typeNames2typeIds.get(s + "[]"), "((" + s + "[])obj)[i] = "
+ cast(s, "value") + "; return;");
}
pc.print();
p(" ((Object[])obj)[i] = value;");
p("}");
}
private void getArrayElementT() {
p("public Object getArrayElement(Type type, Object obj, int i) {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("type.id");
for (String s : PRIMITIVE_TYPES) {
if (!typeNames2typeIds.containsKey(s + "[]"))
continue;
pc.add(typeNames2typeIds.get(s + "[]"), "return ((" + s
+ "[])obj)[i];");
}
pc.print();
p(" return ((Object[])obj)[i];");
p("}");
}
private void getArrayLengthT() {
p("public int getArrayLength(Type type, Object obj) {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("type.id");
for (String s : PRIMITIVE_TYPES) {
if (!typeNames2typeIds.containsKey(s + "[]"))
continue;
pc.add(typeNames2typeIds.get(s + "[]"), "return ((" + s
+ "[])obj).length;");
}
pc.print();
p(" return ((Object[])obj).length;");
p("}");
}
private void newArrayC() {
p("public Object newArray (Type t, int size) {");
p(" if (t != null) {");
SwitchedCodeBlock pc = new SwitchedCodeBlock("t.id");
for (JType type : types) {
if (type.getQualifiedSourceName().equals("void"))
continue;
if (type.getQualifiedSourceName().endsWith("Void"))
continue;
String arrayType = type.getErasedType().getQualifiedSourceName()
+ "[size]";
if (arrayType.contains("[]")) {
arrayType = type.getErasedType().getQualifiedSourceName();
arrayType = arrayType.replaceFirst("\\[\\]", "[size]") + "[]";
}
pc.add(typeNames2typeIds.get(type.getQualifiedSourceName()),
"return new " + arrayType + ";");
}
pc.print();
p(" }");
p(" throw new RuntimeException(\"Couldn't create array\");");
p("}");
}
private void forNameC() {
p("public Type forName(String name) {");
p(" int hashCode = name.hashCode();");
int i = 0;
SwitchedCodeBlockByString cb = new SwitchedCodeBlockByString(
"hashCode", "name");
for (String typeName : typeNames2typeIds.keySet()) {
cb.add(typeName, "return c" + typeNames2typeIds.get(typeName)
+ "();");
i++;
if (i % 1000 == 0) {
cb.print();
cb = new SwitchedCodeBlockByString("hashCode", "name");
p(" return forName" + i + "(name, hashCode);");
p("}");
p("private Type forName" + i
+ ("(String name, int hashCode) {"));
}
}
cb.print();
p(" return null;");
p("}");
}
void p(String line) {
sw.println(line);
source.append(line);
source.append("\n");
}
void pn(String line) {
sw.print(line);
source.append(line);
}
StringBuffer buffer = new StringBuffer();
void pb(String line) {
buffer.append(line);
buffer.append("\n");
}
private void pbn(String line) {
buffer.append(line);
}
class SwitchedCodeBlock {
private List<KeyedCodeBlock> blocks = new ArrayList<KeyedCodeBlock>();
private final String switchStatement;
SwitchedCodeBlock(String switchStatement) {
this.switchStatement = switchStatement;
}
void add(int key, String codeBlock) {
KeyedCodeBlock b = new KeyedCodeBlock();
b.key = key;
b.codeBlock = codeBlock;
blocks.add(b);
}
void print() {
if (blocks.isEmpty())
return;
p(" switch(" + switchStatement + ") {");
for (KeyedCodeBlock b : blocks) {
p(" case " + b.key + ": " + b.codeBlock);
}
p("}");
}
class KeyedCodeBlock {
int key;
String codeBlock;
}
}
class SwitchedCodeBlockByString {
private Map<String, List<KeyedCodeBlock>> blocks = new HashMap<String, List<KeyedCodeBlock>>();
private final String switchStatement;
private final String expectedValue;
SwitchedCodeBlockByString(String switchStatement, String expectedValue) {
this.switchStatement = switchStatement;
this.expectedValue = expectedValue;
}
void add(String key, String codeBlock) {
KeyedCodeBlock b = new KeyedCodeBlock();
b.key = key;
b.codeBlock = codeBlock;
List<KeyedCodeBlock> blockList = blocks.get(key);
if (blockList == null) {
blockList = new ArrayList<KeyedCodeBlock>();
blocks.put(key, blockList);
}
blockList.add(b);
}
void print() {
if (blocks.isEmpty())
return;
p(" switch(" + switchStatement + ") {");
for (String key : blocks.keySet()) {
p(" case " + key.hashCode() + ": ");
for (KeyedCodeBlock block : blocks.get(key)) {
p(" if(" + expectedValue + ".equals(\"" + block.key
+ "\"))" + block.codeBlock);
p(" break;");
}
}
p("}");
}
class KeyedCodeBlock {
String key;
String codeBlock;
}
}
}
| 15,513 |
400 | <filename>lab8/src/6/include/os_constant.h
#ifndef OS_CONSTANT_H
#define OS_CONSTANT_H
#define IDT_START_ADDRESS 0xc0008880
#define CODE_SELECTOR 0x20
#define STACK_SELECTOR 0x10
#define MAX_PROGRAM_NAME 16
#define MAX_PROGRAM_AMOUNT 16
#define MEMORY_SIZE_ADDRESS 0xc0007c00
#define PAGE_SIZE 4096
#define BITMAP_START_ADDRESS 0xc0010000
#define PAGE_DIRECTORY 0x100000
#define KERNEL_VIRTUAL_START 0xc0100000
#define MAX_SYSTEM_CALL 256
#define USER_CODE_LOW 0x0000ffff
#define USER_CODE_HIGH 0x00cff800
#define USER_DATA_LOW 0x0000ffff
#define USER_DATA_HIGH 0x00cff200
#define USER_STACK_LOW 0x00000000
#define USER_STACK_HIGH 0x0040f600
#define USER_VADDR_START 0x8048000
#endif | 307 |
8,586 | <filename>src/meta/processors/admin/ListSnapshotsProcessor.h
/* Copyright (c) 2019 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License.
*/
#ifndef META_LISTSNAPSHOTSPROCESSOR_H_
#define META_LISTSNAPSHOTSPROCESSOR_H_
#include "meta/processors/BaseProcessor.h"
namespace nebula {
namespace meta {
class ListSnapshotsProcessor : public BaseProcessor<cpp2::ListSnapshotsResp> {
public:
static ListSnapshotsProcessor* instance(kvstore::KVStore* kvstore) {
return new ListSnapshotsProcessor(kvstore);
}
void process(const cpp2::ListSnapshotsReq& req);
private:
explicit ListSnapshotsProcessor(kvstore::KVStore* kvstore)
: BaseProcessor<cpp2::ListSnapshotsResp>(kvstore) {}
};
} // namespace meta
} // namespace nebula
#endif // META_LISTSNAPSHOTSPROCESSOR_H_
| 301 |
1,755 | /*=========================================================================
Program: Visualization Toolkit
Module: TestOrientedGlyphContour.cxx
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
//
// This example tests the vtkHandleWidget with a 2D representation
// First include the required header files for the VTK classes we are using.
#include "vtkSmartPointer.h"
#include "vtkActor2D.h"
#include "vtkBoundedPlanePointPlacer.h"
#include "vtkCamera.h"
#include "vtkCommand.h"
#include "vtkContourWidget.h"
#include "vtkCoordinate.h"
#include "vtkEvent.h"
#include "vtkImageActor.h"
#include "vtkImageData.h"
#include "vtkImageMapper3D.h"
#include "vtkImageShiftScale.h"
#include "vtkOrientedGlyphContourRepresentation.h"
#include "vtkPlane.h"
#include "vtkProperty.h"
#include "vtkProperty2D.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkTestUtilities.h"
#include "vtkTesting.h"
#include "vtkVolume16Reader.h"
#include "vtkWidgetEvent.h"
#include "vtkWidgetEventTranslator.h"
int TestOrientedGlyphContour(int argc, char* argv[])
{
char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/headsq/quarter");
vtkSmartPointer<vtkVolume16Reader> v16 = vtkSmartPointer<vtkVolume16Reader>::New();
v16->SetDataDimensions(64, 64);
v16->SetDataByteOrderToLittleEndian();
v16->SetImageRange(1, 93);
v16->SetDataSpacing(3.2, 3.2, 1.5);
v16->SetFilePrefix(fname);
v16->ReleaseDataFlagOn();
v16->SetDataMask(0x7fff);
v16->Update();
delete[] fname;
double range[2];
v16->GetOutput()->GetScalarRange(range);
vtkSmartPointer<vtkImageShiftScale> shifter = vtkSmartPointer<vtkImageShiftScale>::New();
shifter->SetShift(-1.0 * range[0]);
shifter->SetScale(255.0 / (range[1] - range[0]));
shifter->SetOutputScalarTypeToUnsignedChar();
shifter->SetInputConnection(v16->GetOutputPort());
shifter->ReleaseDataFlagOff();
shifter->Update();
vtkSmartPointer<vtkImageActor> imageActor = vtkSmartPointer<vtkImageActor>::New();
imageActor->GetMapper()->SetInputConnection(shifter->GetOutputPort());
imageActor->VisibilityOn();
imageActor->SetDisplayExtent(0, 63, 0, 63, 46, 46);
imageActor->InterpolateOn();
// Create the RenderWindow, Renderer and both Actors
//
vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();
renWin->AddRenderer(ren1);
vtkSmartPointer<vtkRenderWindowInteractor> iren =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
iren->SetRenderWindow(renWin);
// Add the actors to the renderer, set the background and size
//
ren1->SetBackground(0.1, 0.2, 0.4);
ren1->AddActor(imageActor);
renWin->SetSize(600, 600);
// render the image
//
ren1->GetActiveCamera()->SetPosition(0, 0, 0);
ren1->GetActiveCamera()->SetFocalPoint(0, 0, 1);
ren1->GetActiveCamera()->SetViewUp(0, 1, 0);
ren1->ResetCamera();
renWin->Render();
double bounds[6];
imageActor->GetBounds(bounds);
vtkSmartPointer<vtkPlane> p1 = vtkSmartPointer<vtkPlane>::New();
p1->SetOrigin(bounds[0], bounds[2], bounds[4]);
p1->SetNormal(1.0, 0.0, 0.0);
vtkSmartPointer<vtkPlane> p2 = vtkSmartPointer<vtkPlane>::New();
p2->SetOrigin(bounds[0], bounds[2], bounds[4]);
p2->SetNormal(0.0, 1.0, 0.0);
vtkSmartPointer<vtkPlane> p3 = vtkSmartPointer<vtkPlane>::New();
p3->SetOrigin(bounds[1], bounds[3], bounds[5]);
p3->SetNormal(-1.0, 0.0, 0.0);
vtkSmartPointer<vtkPlane> p4 = vtkSmartPointer<vtkPlane>::New();
p4->SetOrigin(bounds[1], bounds[3], bounds[5]);
p4->SetNormal(0.0, -1.0, 0.0);
vtkSmartPointer<vtkOrientedGlyphContourRepresentation> contourRep =
vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New();
vtkSmartPointer<vtkContourWidget> contourWidget = vtkSmartPointer<vtkContourWidget>::New();
vtkSmartPointer<vtkBoundedPlanePointPlacer> placer =
vtkSmartPointer<vtkBoundedPlanePointPlacer>::New();
contourWidget->SetInteractor(iren);
contourWidget->SetRepresentation(contourRep);
// Change bindings.
vtkWidgetEventTranslator* eventTranslator = contourWidget->GetEventTranslator();
eventTranslator->RemoveTranslation(vtkCommand::RightButtonPressEvent);
eventTranslator->SetTranslation(
vtkCommand::KeyPressEvent, vtkEvent::NoModifier, 103, 0, "g", vtkWidgetEvent::AddFinalPoint);
eventTranslator->SetTranslation(vtkCommand::RightButtonPressEvent, vtkWidgetEvent::Translate);
contourWidget->On();
contourRep->SetPointPlacer(placer);
// contourRep->AlwaysOnTopOn();
placer->SetProjectionNormalToZAxis();
placer->SetProjectionPosition(imageActor->GetCenter()[2]);
placer->AddBoundingPlane(p1);
placer->AddBoundingPlane(p2);
placer->AddBoundingPlane(p3);
placer->AddBoundingPlane(p4);
iren->Initialize();
renWin->Render();
int retVal = vtkTesting::InteractorEventLoop(argc, argv, iren);
return retVal;
}
| 1,937 |
515 | # Copyright (c) 2016-2020, <NAME>
# License: MIT License
import pytest
import logging
import ezdxf
from ezdxf.entities.image import ImageDef, Image
logger = logging.getLogger("ezdxf")
@pytest.fixture(scope="module")
def doc():
return ezdxf.new("R2000")
@pytest.fixture(scope="module")
def image_def(doc):
return ImageDef.from_text(IMAGE_DEF, doc)
def test_set_raster_variables():
doc = ezdxf.new("R2000")
assert "ACAD_IMAGE_VARS" not in doc.rootdict
doc.set_raster_variables(frame=0, quality=1, units="m")
raster_vars = doc.rootdict["ACAD_IMAGE_VARS"]
assert raster_vars.dxftype() == "RASTERVARIABLES"
assert raster_vars.dxf.frame == 0
assert raster_vars.dxf.quality == 1
assert raster_vars.dxf.units == 3 # m
assert "ACAD_IMAGE_VARS" in doc.rootdict
doc.set_raster_variables(frame=1, quality=0, units="km")
raster_vars = doc.rootdict["ACAD_IMAGE_VARS"]
assert raster_vars.dxftype() == "RASTERVARIABLES"
assert raster_vars.dxf.frame == 1
assert raster_vars.dxf.quality == 0
assert raster_vars.dxf.units == 4 # km
def test_imagedef_attribs(image_def):
assert "IMAGEDEF" == image_def.dxftype()
assert 0 == image_def.dxf.class_version
assert "mycat.jpg" == image_def.dxf.filename
assert (640.0, 360.0) == image_def.dxf.image_size
assert (0.01, 0.01) == image_def.dxf.pixel_size
assert 1 == image_def.dxf.loaded
assert 0 == image_def.dxf.resolution_units
@pytest.fixture(scope="module")
def image(doc):
return Image.from_text(IMAGE, doc)
def test_image_dxf_attribs(image):
assert "IMAGE" == image.dxftype()
assert (0.0, 0.0, 0.0) == image.dxf.insert
assert (0.01, 0.0, 0.0) == image.dxf.u_pixel
assert (0.0, 0.01, 0.0) == image.dxf.v_pixel
assert (640.0, 360.0) == image.dxf.image_size
assert 7 == image.dxf.flags
assert 0 == image.dxf.clipping
assert 50 == image.dxf.brightness
assert 50 == image.dxf.contrast
assert 0 == image.dxf.fade
assert "DEAD" == image.dxf.image_def_reactor_handle
assert 1 == image.dxf.clipping_boundary_type
assert 2 == image.dxf.count_boundary_points
x, y, *_ = image.dxf.image_size
assert [(-0.5, -0.5), (x - 0.5, y - 0.5)] == image.boundary_path
def test_boundary_path(image):
assert [(-0.5, -0.5), (639.5, 359.5)] == image.boundary_path
def test_reset_boundary_path(image):
image.reset_boundary_path()
assert 2 == image.dxf.count_boundary_points
assert image.get_flag_state(image.USE_CLIPPING_BOUNDARY) is False
assert image.dxf.clipping == 0
x, y, *_ = image.dxf.image_size
assert [(-0.5, -0.5), (x - 0.5, y - 0.5)] == image.boundary_path
def test_set_boundary_path(image):
image.set_boundary_path(
[(0, 0), (640, 180), (320, 360)]
) # 3 vertices triangle
assert 4 == image.dxf.count_boundary_points
assert 2 == image.dxf.clipping_boundary_type
# auto close
assert [(0, 0), (640, 180), (320, 360), (0, 0)] == image.boundary_path
assert image.dxf.clipping == 1
assert image.get_flag_state(image.USE_CLIPPING_BOUNDARY) is True
def test_post_load_hook_creates_image_def_reactor(doc):
image_def = doc.add_image_def("test.jpg", (1, 1))
msp = doc.modelspace()
image = msp.add_image(image_def, (0, 0), (1, 1))
old_reactor_handle = image.dxf.image_def_reactor_handle
# Hack to unlink Image from ImageDefReactor!
image.dxf.image_def_reactor_handle = None
command = image.post_load_hook(doc)
assert command is not None, "must return a fixer as callable object"
command() # execute fix
handle = image.dxf.image_def_reactor_handle
reactor = doc.entitydb[handle]
assert handle is not None, "must have a ImageDefReactor"
assert handle != old_reactor_handle, "must have a new ImageDefReactor"
assert (
handle in image_def.reactors
), "ImageDef must be linked to ImageDefReactor"
assert (
reactor.dxf.image_handle == image.dxf.handle
), "ImageDefReactor must be linked to Image"
def test_exception_while_fixing_image_def_reactor(doc):
from io import StringIO
stream = StringIO()
logging_handler = logging.StreamHandler(stream)
logger.addHandler(logging_handler)
image_def = doc.add_image_def("test.jpg", (1, 1))
msp = doc.modelspace()
image = msp.add_image(image_def, (0, 0), (1, 1))
# Hack to unlink Image from ImageDefReactor!
image.dxf.image_def_reactor_handle = None
command = image.post_load_hook(doc)
# Sabotage execution:
image.doc = None
try:
command()
msg = stream.getvalue()
finally:
logger.removeHandler(logging_handler)
assert image.is_alive is False, "Exception while fixing must destroy IMAGE"
assert "AttributeError" in msg
# Example logging message:
# ------------------------
# An exception occurred while executing fixing command for IMAGE(#30), destroying entity.
# Traceback (most recent call last):
# File "D:\Source\ezdxf.git\src\ezdxf\entities\image.py", line 173, in _fix_missing_image_def_reactor
# self._create_image_def_reactor()
# File "D:\Source\ezdxf.git\src\ezdxf\entities\image.py", line 186, in _create_image_def_reactor
# image_def_reactor = self.doc.objects.add_image_def_reactor(
# AttributeError: 'NoneType' object has no attribute 'objects'
def test_post_load_hook_destroys_image_without_valid_image_def(doc):
image_def = doc.add_image_def("test.jpg", (1, 1))
msp = doc.modelspace()
image = msp.add_image(image_def, (0, 0), (1, 1))
# Hack to unlink Image from ImageDef!
image.dxf.image_def_handle = None
image.post_load_hook(doc)
assert (
image.is_alive is False
), "Image with invalid ImageDef must be destroyed"
@pytest.fixture
def new_doc():
return ezdxf.new("R2000")
def test_new_image_def(new_doc):
rootdict = new_doc.rootdict
assert "ACAD_IMAGE_DICT" not in rootdict
imagedef = new_doc.add_image_def("mycat.jpg", size_in_pixel=(640, 360))
# check internals image_def_owner -> ACAD_IMAGE_DICT
image_dict = rootdict["ACAD_IMAGE_DICT"]
assert imagedef.dxf.owner == image_dict.dxf.handle
assert "mycat.jpg" == imagedef.dxf.filename
assert (640.0, 360.0) == imagedef.dxf.image_size
# rest are default values
assert (0.01, 0.01) == imagedef.dxf.pixel_size
assert 1 == imagedef.dxf.loaded
assert 0 == imagedef.dxf.resolution_units
def test_create_and_delete_image(new_doc):
msp = new_doc.modelspace()
image_def = new_doc.add_image_def("mycat.jpg", size_in_pixel=(640, 360))
image = msp.add_image(
image_def=image_def, insert=(0, 0), size_in_units=(3.2, 1.8)
)
assert (0, 0, 0) == image.dxf.insert
assert (0.005, 0, 0) == image.dxf.u_pixel
assert (0.0, 0.005, 0) == image.dxf.v_pixel
assert (640, 360) == image.dxf.image_size
assert image_def.dxf.handle == image.dxf.image_def_handle
assert 3 == image.dxf.flags
assert 0 == image.dxf.clipping
assert 2 == image.dxf.count_boundary_points
x, y = image.dxf.image_size.vec2
assert [(-0.5, -0.5), (x - 0.5, y - 0.5)] == image.boundary_path
image_def2 = image.image_def
assert image_def.dxf.handle, image_def2.dxf.handle
# does image def reactor exists
reactor_handle = image.dxf.image_def_reactor_handle
assert reactor_handle in new_doc.objects
reactor = new_doc.entitydb[reactor_handle]
assert (
image.dxf.handle == reactor.dxf.owner
), "IMAGE is not owner of IMAGEDEF_REACTOR"
assert (
image.dxf.handle == reactor.dxf.image_handle
), "IMAGEDEF_REACTOR does not point to IMAGE"
assert (
reactor_handle in image_def2.get_reactors()
), "Reactor handle not in IMAGE_DEF reactors."
# delete image
msp.delete_entity(image)
new_doc.entitydb.purge()
assert reactor.is_alive is False
assert (
reactor_handle not in new_doc.objects
), "IMAGEDEF_REACTOR not deleted for objects section"
assert (
reactor_handle not in new_doc.entitydb
), "IMAGEDEF_REACTOR not deleted for entity database"
assert (
reactor_handle not in image_def2.get_reactors()
), "Reactor handle not deleted from IMAGE_DEF reactors."
def create_image(doc):
msp = doc.modelspace()
image_def = doc.add_image_def("mycat.jpg", size_in_pixel=(640, 360))
image = msp.add_image(
image_def=image_def, insert=(0, 0), size_in_units=(3.2, 1.8)
)
image.boundary_path = [(0, 0), (1, 1), (2, 2), (3, 3)]
return image_def, image
def test_create_and_copy_image(new_doc):
msp = new_doc.modelspace()
entitydb = new_doc.entitydb
image_def, image = create_image(new_doc)
reactor_handle = image.dxf.image_def_reactor_handle
copy = image.copy()
msp.add_entity(copy)
reactor_handle_of_copy = copy.dxf.image_def_reactor_handle
# Each image has it's own ImageDefReactor
assert (
reactor_handle in entitydb
), "ImageDefReactor of source image not stored in EntityDB."
assert (
reactor_handle_of_copy in entitydb
), "ImageDefReactor of copy not stored in EntityDB."
assert (
reactor_handle != reactor_handle_of_copy
), "Source image and copy must not have the same ImageDefReactor."
# Both images are linked to same ImageDef object.
assert (
reactor_handle in image_def.reactors
), "ImageDefReactor of source image not stored in ImageDef object."
assert (
reactor_handle_of_copy in image_def.reactors
), "ImageDefReactor of copied image not stored in ImageDef object."
assert (
image.boundary_path == copy.boundary_path
), "Invalid copy of boundary path."
assert (
image.boundary_path is not copy.boundary_path
), "Copied image needs an independent copy of the boundary path."
def test_moving_to_another_layout(new_doc):
msp = new_doc.modelspace()
image_def, image = create_image(new_doc)
old_reactor_handle = image.dxf.image_def_reactor_handle
blk = new_doc.blocks.new("TEST")
msp.move_to_layout(image, blk)
# Moving between layouts should not alter the ImageDefReactor
assert (
image.dxf.image_def_reactor_handle == old_reactor_handle
), "Moved image got a new ImageDefReactor without necessity."
def test_copying_to_another_layout(new_doc):
image_def, image = create_image(new_doc)
old_reactor_handle = image.dxf.image_def_reactor_handle
blk = new_doc.blocks.new("TEST")
copy = new_doc.entitydb.duplicate_entity(image)
# duplicate_entity() binds entity to document and triggers the
# post_bind_hook() to create a new ImageDefReactor:
copy_reactor_handle = copy.dxf.image_def_reactor_handle
assert (
copy_reactor_handle != "0"
), "Image copy did not get a new ImageDefReactor"
assert (
copy_reactor_handle != old_reactor_handle
), "Image copy has the same ImageDefReactor as the source image."
blk.add_entity(copy)
# unlinking an image, does not remove the ImageDefReactor
blk.unlink_entity(copy)
assert (
copy.dxf.image_def_reactor_handle == copy_reactor_handle
), "Removed ImageDefReactor from unlinked image."
# Keep reactor if adding an image with existing ImageDefReactor
blk.add_entity(copy)
assert (
copy.dxf.image_def_reactor_handle == copy_reactor_handle
), "Relinked image got new ImageDefReactor without necessity."
IMAGE_DEF = """ 0
IMAGEDEF
5
DEAD
330
DEAD
100
AcDbRasterImageDef
90
0
1
mycat.jpg
10
640.0
20
360.0
11
0.01
21
0.01
280
1
281
0
"""
IMAGE = """ 0
IMAGE
5
1DF
330
1F
100
AcDbEntity
8
0
100
AcDbRasterImage
90
0
10
0.0
20
0.0
30
0.0
11
0.01
21
0.0
31
0.0
12
0.0
22
0.01
32
0.0
13
640.0
23
360.0
340
DEAD
70
7
280
0
281
50
282
50
283
0
360
DEAD
71
1
91
2
14
-.5
24
-.5
14
639.5
24
359.5
"""
| 4,928 |
471 | <reponame>akashkj/commcare-hq<gh_stars>100-1000
from collections import namedtuple
from datetime import date, datetime, timedelta
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.db.models import Q
from django.urls import reverse
from django.utils.functional import cached_property
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from couchdbkit import ResourceNotFound
from memoized import memoized
from couchexport.export import SCALAR_NEVER_WAS
from dimagi.utils.dates import safe_strftime
from dimagi.utils.parsing import string_to_utc_datetime
from phonelog.models import UserErrorEntry
from corehq import toggles
from corehq.apps.app_manager.dbaccessors import (
get_app,
get_brief_apps_in_domain,
)
from corehq.apps.es import UserES, filters
from corehq.apps.es.aggregations import DateHistogram
from corehq.apps.hqwebapp.decorators import use_nvd3
from corehq.apps.locations.models import SQLLocation
from corehq.apps.locations.permissions import location_safe
from corehq.apps.reports.datatables import DataTablesColumn, DataTablesHeader
from corehq.apps.reports.exceptions import BadRequestError
from corehq.apps.reports.filters.select import SelectApplicationFilter
from corehq.apps.reports.filters.users import ExpandedMobileWorkerFilter
from corehq.apps.reports.generic import (
GenericTabularReport,
GetParamsMixin,
PaginatedReportMixin,
)
from corehq.apps.reports.standard import (
ProjectReport,
ProjectReportParametersMixin,
)
from corehq.apps.reports.util import format_datatables_data
from corehq.apps.users.util import user_display_string
from corehq.const import USER_DATE_FORMAT
from corehq.util.quickcache import quickcache
class DeploymentsReport(GenericTabularReport, ProjectReport, ProjectReportParametersMixin):
"""
Base class for all deployments reports
"""
@location_safe
class ApplicationStatusReport(GetParamsMixin, PaginatedReportMixin, DeploymentsReport):
name = ugettext_lazy("Application Status")
slug = "app_status"
emailable = True
exportable = True
exportable_all = True
ajax_pagination = True
fields = [
'corehq.apps.reports.filters.users.ExpandedMobileWorkerFilter',
'corehq.apps.reports.filters.select.SelectApplicationFilter'
]
primary_sort_prop = None
@property
def _columns(self):
selected_app_info = "selected app version {app_id}".format(
app_id=self.selected_app_id
) if self.selected_app_id else "for last built app"
return [
DataTablesColumn(_("Username"),
prop_name='username.exact',
sql_col='user_dim__username'),
DataTablesColumn(_("Last Submission"),
prop_name='reporting_metadata.last_submissions.submission_date',
alt_prop_name='reporting_metadata.last_submission_for_user.submission_date',
sql_col='last_form_submission_date'),
DataTablesColumn(_("Last Sync"),
prop_name='reporting_metadata.last_syncs.sync_date',
alt_prop_name='reporting_metadata.last_sync_for_user.sync_date',
sql_col='last_sync_log_date'),
DataTablesColumn(_("Application"),
help_text=_("The name of the application from the user's last request."),
sortable=False),
DataTablesColumn(_("Application Version"),
help_text=_("The application version from the user's last request."),
prop_name='reporting_metadata.last_builds.build_version',
alt_prop_name='reporting_metadata.last_build_for_user.build_version',
sql_col='last_form_app_build_version'),
DataTablesColumn(_("CommCare Version"),
help_text=_("""The CommCare version from the user's last request"""),
prop_name='reporting_metadata.last_submissions.commcare_version',
alt_prop_name='reporting_metadata.last_submission_for_user.commcare_version',
sql_col='last_form_app_commcare_version'),
DataTablesColumn(_("Number of unsent forms in user's phone"),
help_text=_("The number of unsent forms in users' phones for {app_info}".format(
app_info=selected_app_info
)),
sortable=False),
]
@property
def headers(self):
columns = self._columns
if self.show_build_profile:
columns.append(
DataTablesColumn(_("Build Profile"),
help_text=_("The build profile from the user's last hearbeat request."),
sortable=False)
)
headers = DataTablesHeader(*columns)
headers.custom_sort = [[1, 'desc']]
return headers
@cached_property
def show_build_profile(self):
return toggles.SHOW_BUILD_PROFILE_IN_APPLICATION_STATUS.enabled(self.domain)
@property
def default_sort(self):
if self.selected_app_id:
self.primary_sort_prop = 'reporting_metadata.last_submissions.submission_date'
return {
self.primary_sort_prop: {
'order': 'desc',
'nested_filter': {
'term': {
self.sort_filter: self.selected_app_id
}
}
}
}
else:
self.primary_sort_prop = 'reporting_metadata.last_submission_for_user.submission_date'
return {'reporting_metadata.last_submission_for_user.submission_date': 'desc'}
@property
def sort_base(self):
return '.'.join(self.primary_sort_prop.split('.')[:2])
@property
def sort_filter(self):
return self.sort_base + '.app_id'
def get_sorting_block(self):
sort_prop_name = 'prop_name' if self.selected_app_id else 'alt_prop_name'
res = []
#the NUMBER of cols sorting
sort_cols = int(self.request.GET.get('iSortingCols', 0))
if sort_cols > 0:
for x in range(sort_cols):
col_key = 'iSortCol_%d' % x
sort_dir = self.request.GET['sSortDir_%d' % x]
col_id = int(self.request.GET[col_key])
col = self.headers.header[col_id]
sort_prop = getattr(col, sort_prop_name) or col.prop_name
if x == 0:
self.primary_sort_prop = sort_prop
if self.selected_app_id:
sort_dict = {
sort_prop: {
"order": sort_dir,
"nested_filter": {
"term": {
self.sort_filter: self.selected_app_id
}
}
}
}
sort_prop_path = sort_prop.split('.')
if sort_prop_path[-1] == 'exact':
sort_prop_path.pop()
sort_prop_path.pop()
if sort_prop_path:
sort_dict[sort_prop]['nested_path'] = '.'.join(sort_prop_path)
else:
sort_dict = {sort_prop: sort_dir}
res.append(sort_dict)
if len(res) == 0 and self.default_sort is not None:
res.append(self.default_sort)
return res
@property
@memoized
def selected_app_id(self):
return self.request_params.get(SelectApplicationFilter.slug, None)
@quickcache(['app_id'], timeout=60 * 60)
def _get_app_details(self, app_id):
try:
app = get_app(self.domain, app_id)
except ResourceNotFound:
return {}
return {
'name': app.name,
'build_profiles': {
profile_id: profile.name for profile_id, profile in app.build_profiles.items()
}
}
def get_app_name(self, app_id):
return self._get_app_details(app_id).get('name')
def get_data_for_app(self, options, app_id):
try:
return list(filter(lambda option: option['app_id'] == app_id, options))[0]
except IndexError:
return {}
@memoized
def user_query(self, pagination=True):
mobile_user_and_group_slugs = set(
# Cater for old ReportConfigs
self.request.GET.getlist('location_restricted_mobile_worker') +
self.request.GET.getlist(ExpandedMobileWorkerFilter.slug)
)
user_query = ExpandedMobileWorkerFilter.user_es_query(
self.domain,
mobile_user_and_group_slugs,
self.request.couch_user,
)
user_query = (user_query
.set_sorting_block(self.get_sorting_block()))
if pagination:
user_query = (user_query
.size(self.pagination.count)
.start(self.pagination.start))
if self.selected_app_id:
# adding nested filter for reporting_metadata.last_submissions.app_id
# and reporting_metadata.last_syncs.app_id when app is selected
last_submission_filter = filters.nested('reporting_metadata.last_submissions',
filters.term('reporting_metadata.last_submissions.app_id',
self.selected_app_id)
)
last_sync_filter = filters.nested('reporting_metadata.last_syncs',
filters.term("reporting_metadata.last_syncs.app_id",
self.selected_app_id)
)
user_query = user_query.OR(last_submission_filter,
last_sync_filter
)
return user_query
def get_location_columns(self, grouped_ancestor_locs):
from corehq.apps.locations.models import LocationType
location_types = LocationType.objects.by_domain(self.domain)
all_user_locations = grouped_ancestor_locs.values()
all_user_loc_types = {loc.location_type_id for user_locs in all_user_locations for loc in user_locs}
required_loc_columns = [loc_type for loc_type in location_types if loc_type.id in all_user_loc_types]
return required_loc_columns
def user_locations(self, ancestors, location_types):
ancestors_by_type_id = {loc.location_type_id: loc.name for loc in ancestors}
return [
ancestors_by_type_id.get(location_type.id, '---')
for location_type in location_types
]
def get_bulk_ancestors(self, location_ids):
"""
Returns the grouped ancestors for the location ids passed in the
dictionary of following pattern
{location_id_1: [self, parent, parent_of_parent,.,.,.,],
location_id_2: [self, parent, parent_of_parent,.,.,.,],
}
:param domain: domain for which locations is to be pulled out
:param location_ids: locations ids whose ancestors needs to be find
:param kwargs: extra parameters
:return: dict
"""
where = Q(domain=self.domain, location_id__in=location_ids)
location_ancestors = SQLLocation.objects.get_ancestors(where)
location_by_id = {location.location_id: location for location in location_ancestors}
location_by_pk = {location.id: location for location in location_ancestors}
grouped_location = {}
for location_id in location_ids:
location_parents = []
current_location = location_by_id[location_id].id if location_id in location_by_id else None
while current_location is not None:
location_parents.append(location_by_pk[current_location])
current_location = location_by_pk[current_location].parent_id
grouped_location[location_id] = location_parents
return grouped_location
def include_location_data(self):
toggle = toggles.LOCATION_COLUMNS_APP_STATUS_REPORT
return (
(
toggle.enabled(self.request.domain, toggles.NAMESPACE_DOMAIN)
and self.rendered_as in ['export']
)
)
def process_rows(self, users, fmt_for_export=False):
rows = []
users = list(users)
if self.include_location_data():
location_ids = {user['location_id'] for user in users if user['location_id']}
grouped_ancestor_locs = self.get_bulk_ancestors(location_ids)
self.required_loc_columns = self.get_location_columns(grouped_ancestor_locs)
for user in users:
last_build = last_seen = last_sub = last_sync = last_sync_date = app_name = commcare_version = None
last_build_profile_name = device = device_app_meta = num_unsent_forms = None
is_commcare_user = user.get('doc_type') == 'CommCareUser'
build_version = _("Unknown")
devices = user.get('devices', None)
if devices:
device = max(devices, key=lambda dev: dev['last_used'])
reporting_metadata = user.get('reporting_metadata', {})
if self.selected_app_id:
last_submissions = reporting_metadata.get('last_submissions')
if last_submissions:
last_sub = self.get_data_for_app(last_submissions, self.selected_app_id)
last_syncs = reporting_metadata.get('last_syncs')
if last_syncs:
last_sync = self.get_data_for_app(last_syncs, self.selected_app_id)
if last_sync is None:
last_sync = self.get_data_for_app(last_syncs, None)
last_builds = reporting_metadata.get('last_builds')
if last_builds:
last_build = self.get_data_for_app(last_builds, self.selected_app_id)
if device and is_commcare_user:
device_app_meta = self.get_data_for_app(device.get('app_meta'), self.selected_app_id)
else:
last_sub = reporting_metadata.get('last_submission_for_user', {})
last_sync = reporting_metadata.get('last_sync_for_user', {})
last_build = reporting_metadata.get('last_build_for_user', {})
if last_build.get('app_id') and device and device.get('app_meta'):
device_app_meta = self.get_data_for_app(device.get('app_meta'), last_build.get('app_id'))
if last_sub and last_sub.get('commcare_version'):
commcare_version = _get_commcare_version(last_sub.get('commcare_version'))
else:
if device and device.get('commcare_version', None):
commcare_version = _get_commcare_version(device['commcare_version'])
if last_sub and last_sub.get('submission_date'):
last_seen = string_to_utc_datetime(last_sub['submission_date'])
if last_sync and last_sync.get('sync_date'):
last_sync_date = string_to_utc_datetime(last_sync['sync_date'])
if device_app_meta:
num_unsent_forms = device_app_meta.get('num_unsent_forms')
if last_build:
build_version = last_build.get('build_version') or build_version
if last_build.get('app_id'):
app_name = self.get_app_name(last_build['app_id'])
if self.show_build_profile:
last_build_profile_id = last_build.get('build_profile_id')
if last_build_profile_id:
last_build_profile_name = _("Unknown")
build_profiles = self._get_app_details(last_build['app_id']).get('build_profiles', {})
if last_build_profile_id in build_profiles:
last_build_profile_name = build_profiles[last_build_profile_id]
row_data = [
user_display_string(user.get('username', ''),
user.get('first_name', ''),
user.get('last_name', '')),
_fmt_date(last_seen, fmt_for_export), _fmt_date(last_sync_date, fmt_for_export),
app_name or "---", build_version, commcare_version or '---',
num_unsent_forms if num_unsent_forms is not None else "---",
]
if self.show_build_profile:
row_data.append(last_build_profile_name)
if self.include_location_data():
location_data = self.user_locations(grouped_ancestor_locs.get(user['location_id'], []),
self.required_loc_columns)
row_data = location_data + row_data
rows.append(row_data)
return rows
def process_facts(self, app_status_facts, fmt_for_export=False):
rows = []
for fact in app_status_facts:
rows.append([
user_display_string(fact.user_dim.username,
fact.user_dim.first_name,
fact.user_dim.last_name),
_fmt_date(fact.last_form_submission_date, fmt_for_export),
_fmt_date(fact.last_sync_log_date, fmt_for_export),
getattr(fact.app_dim, 'name', '---'),
fact.last_form_app_build_version,
fact.last_form_app_commcare_version
])
return rows
def get_sql_sort(self):
res = None
#the NUMBER of cols sorting
sort_cols = int(self.request.GET.get('iSortingCols', 0))
if sort_cols > 0:
for x in range(sort_cols):
col_key = 'iSortCol_%d' % x
sort_dir = self.request.GET['sSortDir_%d' % x]
col_id = int(self.request.GET[col_key])
col = self.headers.header[col_id]
if col.sql_col is not None:
res = col.sql_col
if sort_dir not in ('desc', 'asc'):
raise BadRequestError(
('unexcpected sort direction: {}. '
'sort direction must be asc or desc'.format(sort_dir))
)
if sort_dir == 'desc':
res = '-{}'.format(res)
break
if res is None:
res = '-last_form_submission_date'
return res
@property
def total_records(self):
if self._total_records:
return self._total_records
else:
return 0
@property
def rows(self):
users = self.user_query().run()
self._total_records = users.total
return self.process_rows(users.hits)
def get_user_ids(self):
mobile_user_and_group_slugs = set(
# Cater for old ReportConfigs
self.request.GET.getlist('location_restricted_mobile_worker') +
self.request.GET.getlist(ExpandedMobileWorkerFilter.slug)
)
user_ids = ExpandedMobileWorkerFilter.user_es_query(
self.domain,
mobile_user_and_group_slugs,
self.request.couch_user,
).values_list('_id', flat=True)
return user_ids
@property
def get_all_rows(self):
users = self.user_query(False).scroll()
self._total_records = self.user_query(False).count()
return self.process_rows(users, True)
@property
def export_table(self):
def _fmt_timestamp(timestamp):
if timestamp is not None and timestamp >= 0:
return safe_strftime(date.fromtimestamp(timestamp), USER_DATE_FORMAT)
return SCALAR_NEVER_WAS
result = super(ApplicationStatusReport, self).export_table
table = list(result[0][1])
location_colums = []
if self.include_location_data():
location_colums = ['{} Name'.format(loc_col.name.title()) for loc_col in self.required_loc_columns]
table[0] = location_colums + table[0]
for row in table[1:]:
# Last submission
row[len(location_colums) + 1] = _fmt_timestamp(row[len(location_colums) + 1])
# Last sync
row[len(location_colums) + 2] = _fmt_timestamp(row[len(location_colums) + 2])
result[0][1] = table
return result
def _get_commcare_version(app_version_info):
commcare_version = (
'CommCare {}'.format(app_version_info)
if app_version_info
else _("Unknown CommCare Version")
)
return commcare_version
def _choose_latest_version(*app_versions):
"""
Chooses the latest version from a list of AppVersion objects - choosing the first one passed
in with the highest version number.
"""
usable_versions = [_f for _f in app_versions if _f]
if usable_versions:
return sorted(usable_versions, key=lambda v: v.build_version)[-1]
def _get_sort_key(date):
if not date:
return -1
else:
return int(date.strftime("%s"))
def _fmt_date(date, include_sort_key=True):
def _timedelta_class(delta):
return _bootstrap_class(delta, timedelta(days=7), timedelta(days=3))
if not date:
text = format_html('<span class="label label-default">{}</span>', _("Never"))
else:
text = format_html(
'<span class="{cls}">{text}</span>',
cls=_timedelta_class(datetime.utcnow() - date),
text=_(_naturaltime_with_hover(date)),
)
if include_sort_key:
return format_datatables_data(text, _get_sort_key(date))
else:
return text
def _naturaltime_with_hover(date):
return format_html('<span title="{}">{}</span>', date, naturaltime(date) or '---')
def _bootstrap_class(obj, severe, warn):
"""
gets a bootstrap class for an object comparing to thresholds.
assumes bigger is worse and default is good.
"""
if obj > severe:
return "label label-danger"
elif obj > warn:
return "label label-warning"
else:
return "label label-success"
class ApplicationErrorReport(GenericTabularReport, ProjectReport):
name = ugettext_lazy("Application Error Report")
slug = "application_error"
ajax_pagination = True
sortable = False
fields = ['corehq.apps.reports.filters.select.SelectApplicationFilter']
# Filter parameters to pull from the URL
model_fields_to_url_params = [
('app_id', SelectApplicationFilter.slug),
('version_number', 'version_number'),
]
@classmethod
def show_in_navigation(cls, domain=None, project=None, user=None):
return user and toggles.APPLICATION_ERROR_REPORT.enabled(user.username)
@property
def shared_pagination_GET_params(self):
shared_params = super(ApplicationErrorReport, self).shared_pagination_GET_params
shared_params.extend([
{'name': param, 'value': self.request.GET.get(param, None)}
for model_field, param in self.model_fields_to_url_params
])
return shared_params
@property
def headers(self):
return DataTablesHeader(
DataTablesColumn(_("User")),
DataTablesColumn(_("Expression")),
DataTablesColumn(_("Message")),
DataTablesColumn(_("Session")),
DataTablesColumn(_("Application")),
DataTablesColumn(_("App version")),
DataTablesColumn(_("Date")),
)
@property
@memoized
def _queryset(self):
qs = UserErrorEntry.objects.filter(domain=self.domain)
for model_field, url_param in self.model_fields_to_url_params:
value = self.request.GET.get(url_param, None)
if value:
qs = qs.filter(**{model_field: value})
return qs
@property
def total_records(self):
return self._queryset.count()
@property
@memoized
def _apps_by_id(self):
def link(app):
return '<a href="{}">{}</a>'.format(
reverse('view_app', args=[self.domain, app.get_id]),
app.name,
)
return {
app.get_id: link(app)
for app in get_brief_apps_in_domain(self.domain)
}
def _ids_to_users(self, user_ids):
users = (UserES()
.domain(self.domain)
.user_ids(user_ids)
.values('_id', 'username', 'first_name', 'last_name'))
return {
u['_id']: user_display_string(u['username'], u['first_name'], u['last_name'])
for u in users
}
@property
def rows(self):
start = self.pagination.start
end = start + self.pagination.count
errors = self._queryset.order_by('-date')[start:end]
users = self._ids_to_users({e.user_id for e in errors if e.user_id})
for error in errors:
yield [
users.get(error.user_id, error.user_id),
error.expr,
error.msg,
error.session,
self._apps_by_id.get(error.app_id, error.app_id),
error.version_number,
str(error.date),
]
@location_safe
class AggregateUserStatusReport(ProjectReport, ProjectReportParametersMixin):
slug = 'aggregate_user_status'
report_template_path = "reports/async/aggregate_user_status.html"
name = ugettext_lazy("Aggregate User Status")
description = ugettext_lazy("See the last activity of your project's users in aggregate.")
fields = [
'corehq.apps.reports.filters.users.ExpandedMobileWorkerFilter',
]
exportable = False
emailable = False
@use_nvd3
def decorator_dispatcher(self, request, *args, **kwargs):
super(AggregateUserStatusReport, self).decorator_dispatcher(request, *args, **kwargs)
@memoized
def user_query(self):
# partially inspired by ApplicationStatusReport.user_query
mobile_user_and_group_slugs = set(
self.request.GET.getlist(ExpandedMobileWorkerFilter.slug)
) or set(['t__0']) # default to all mobile workers on initial load
user_query = ExpandedMobileWorkerFilter.user_es_query(
self.domain,
mobile_user_and_group_slugs,
self.request.couch_user,
)
user_query = user_query.size(0)
user_query = user_query.aggregations([
DateHistogram('last_submission', 'reporting_metadata.last_submission_for_user.submission_date', '1d'),
DateHistogram('last_sync', 'reporting_metadata.last_sync_for_user.sync_date', '1d')
])
return user_query
@property
def template_context(self):
class SeriesData(namedtuple('SeriesData', 'id title chart_color bucket_series help')):
"""
Utility class containing everything needed to render the chart in a template.
"""
def get_chart_data_series(self):
return {
'key': _('Count of Users'),
'values': self.bucket_series.data_series,
'color': self.chart_color,
}
def get_chart_percent_series(self):
return {
'key': _('Percent of Users'),
'values': self.bucket_series.percent_series,
'color': self.chart_color,
}
def get_buckets(self):
return self.bucket_series.get_summary_data()
class BucketSeries(namedtuple('Bucket', 'data_series total_series total user_count')):
@property
@memoized
def percent_series(self):
return [
{
'series': 0,
'x': row['x'],
'y': self._pct(row['y'], self.user_count)
}
for row in self.total_series
]
def get_summary_data(self):
def _readable_pct_from_total(total_series, index):
return '{0:.0f}%'.format(total_series[index - 1]['y'])
return [
[_readable_pct_from_total(self.percent_series, 3), _('in the last 3 days')],
[_readable_pct_from_total(self.percent_series, 7), _('in the last week')],
[_readable_pct_from_total(self.percent_series, 30), _('in the last 30 days')],
[_readable_pct_from_total(self.percent_series, 60), _('in the last 60 days')],
]
@property
def total_percent(self):
return '{0:.0f}%'.format(self._pct(self.total, self.user_count))
@staticmethod
def _pct(val, total):
return (100. * float(val) / float(total)) if total else 0
query = self.user_query().run()
aggregations = query.aggregations
last_submission_buckets = aggregations[0].raw_buckets
last_sync_buckets = aggregations[1].raw_buckets
total_users = query.total
def _buckets_to_series(buckets, user_count):
# start with N days of empty data
# add bucket info to the data series
# add last bucket
days_of_history = 60
vals = {
i: 0 for i in range(days_of_history)
}
extra = total = running_total = 0
today = datetime.today().date()
for bucket_val in buckets:
bucket_date = datetime.fromtimestamp(bucket_val['key'] / 1000.0).date()
delta_days = (today - bucket_date).days
val = bucket_val['doc_count']
if delta_days in vals:
vals[delta_days] += val
else:
extra += val
total += val
daily_series = []
running_total_series = []
for i in range(days_of_history):
running_total += vals[i]
daily_series.append(
{
'series': 0,
'x': '{}'.format(today - timedelta(days=i)),
'y': vals[i]
}
)
running_total_series.append(
{
'series': 0,
'x': '{}'.format(today - timedelta(days=i)),
'y': running_total
}
)
# catchall / last row
daily_series.append(
{
'series': 0,
'x': 'more than {} days ago'.format(days_of_history),
'y': extra,
}
)
running_total_series.append(
{
'series': 0,
'x': 'more than {} days ago'.format(days_of_history),
'y': running_total + extra,
}
)
return BucketSeries(daily_series, running_total_series, total, user_count)
submission_series = SeriesData(
id='submission',
title=_('Users who have Submitted'),
chart_color='#004abf',
bucket_series=_buckets_to_series(last_submission_buckets, total_users),
help=_(
"<strong>Aggregate Percents</strong> shows the percent of users who have submitted "
"<em>since</em> a certain date.<br><br>"
"<strong>Daily Counts</strong> shows the count of users whose <em>last submission was on</em> "
"that particular day."
)
)
sync_series = SeriesData(
id='sync',
title=_('Users who have Synced'),
chart_color='#f58220',
bucket_series=_buckets_to_series(last_sync_buckets, total_users),
help=_(
"<strong>Aggregate Percents</strong> shows the percent of users who have synced "
"<em>since</em> a certain date.<br><br>"
"<strong>Daily Counts</strong> shows the count of users whose <em>last sync was on</em> "
"that particular day."
)
)
context = super().template_context
context.update({
'submission_series': submission_series,
'sync_series': sync_series,
'total_users': total_users,
})
return context
| 16,495 |
4,262 | /*
* 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.camel.component.ssh;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.DSAPublicKeySpec;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.security.spec.ECPublicKeySpec;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.RSAPublicKeySpec;
import org.apache.sshd.common.cipher.ECCurves;
import org.bouncycastle.jcajce.spec.OpenSSHPublicKeySpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
public class SSHPublicKeyHolder {
private static final String SSH_RSA = "ssh-rsa";
private static final String SSH_DSS = "ssh-dss";
private static final String SSH_ECDSA_PREFIX = "ecdsa-sha2-";
// ssh-keygen ... -b 256 -t ecdsa
private static final String SSH_ECDSA = SSH_ECDSA_PREFIX + "nistp256";
// ssh-keygen ... -b 384 -t ecdsa
private static final String SSH_ECDSA_384 = SSH_ECDSA_PREFIX + "nistp384";
// ssh-keygen ... -b 521 -t ecdsa # yes - "521", not "512"
private static final String SSH_ECDSA_521 = SSH_ECDSA_PREFIX + "nistp521";
// ssh-keygen ... -t ed25519
private static final String SSH_ED25519 = "ssh-ed25519";
private String keyType;
/* RSA key parts */
private BigInteger e;
private BigInteger m;
/* DSA key parts */
private BigInteger p;
private BigInteger q;
private BigInteger g;
private BigInteger y;
/* EC key parts */
private String curveName;
private ECPoint ecPoint;
private ECParameterSpec ecParams;
/* EdDSA key parts */
private final ByteArrayOutputStream edKeyEncoded = new ByteArrayOutputStream();
public String getKeyType() {
return keyType;
}
public void setKeyType(String keyType) {
this.keyType = keyType;
}
public BigInteger getE() {
return e;
}
public void setE(BigInteger e) {
this.e = e;
}
public BigInteger getM() {
return m;
}
public void setM(BigInteger m) {
this.m = m;
}
public BigInteger getG() {
return g;
}
public void setG(BigInteger g) {
this.g = g;
}
public BigInteger getP() {
return p;
}
public void setP(BigInteger p) {
this.p = p;
}
public BigInteger getQ() {
return q;
}
public void setQ(BigInteger q) {
this.q = q;
}
public BigInteger getY() {
return y;
}
public void setY(BigInteger y) {
this.y = y;
}
public void push(byte[] keyPart) {
if (keyType == null) {
this.keyType = new String(keyPart, StandardCharsets.UTF_8);
if (SSH_ED25519.equals(keyType)) {
encode(edKeyEncoded, keyType);
}
return;
}
if (SSH_RSA.equals(keyType)) {
if (e == null) {
this.e = new BigInteger(keyPart);
return;
}
if (m == null) {
this.m = new BigInteger(keyPart);
return;
}
}
if (SSH_DSS.equals(keyType)) {
if (p == null) {
this.p = new BigInteger(keyPart);
return;
}
if (q == null) {
this.q = new BigInteger(keyPart);
return;
}
if (g == null) {
this.g = new BigInteger(keyPart);
return;
}
if (y == null) {
this.y = new BigInteger(keyPart);
return;
}
}
if (keyType.equals(SSH_ED25519)) {
// https://tools.ietf.org/html/rfc8709
// https://tools.ietf.org/html/rfc8032#section-5.2.5
encode(edKeyEncoded, keyPart);
return;
}
if (keyType.startsWith(SSH_ECDSA_PREFIX)) {
// https://tools.ietf.org/html/rfc5656#section-3.1
// see org.apache.sshd.common.util.buffer.keys.ECBufferPublicKeyParser.getRawECKey
if (curveName == null) {
curveName = new String(keyPart, StandardCharsets.UTF_8);
return;
}
if (ecPoint == null) {
ecParams = ECCurves.fromKeyType(keyType).getParameters();
ecPoint = ECCurves.octetStringToEcPoint(keyPart);
}
}
}
public PublicKey toPublicKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
PublicKey returnValue = null;
if (SSH_RSA.equals(keyType)) {
RSAPublicKeySpec dsaPublicKeySpec = new RSAPublicKeySpec(m, e);
KeyFactory factory = KeyFactory.getInstance("RSA");
returnValue = factory.generatePublic(dsaPublicKeySpec);
}
if (SSH_DSS.equals(keyType)) {
DSAPublicKeySpec dsaPublicKeySpec = new DSAPublicKeySpec(y, p, q, g);
KeyFactory factory = KeyFactory.getInstance("DSA");
returnValue = factory.generatePublic(dsaPublicKeySpec);
}
if (SSH_ED25519.equals(keyType)) {
OpenSSHPublicKeySpec ed25519PublicKeySpec = new OpenSSHPublicKeySpec(edKeyEncoded.toByteArray());
KeyFactory factory = KeyFactory.getInstance("ED25519", new BouncyCastleProvider());
returnValue = factory.generatePublic(ed25519PublicKeySpec);
}
if (keyType.startsWith(SSH_ECDSA_PREFIX)) {
ECPublicKeySpec spec = new ECPublicKeySpec(ecPoint, ecParams);
KeyFactory factory = KeyFactory.getInstance("EC");
returnValue = factory.generatePublic(spec);
}
return returnValue;
}
private void encode(ByteArrayOutputStream target, byte[] value) {
byte[] result = new byte[4 + value.length];
result[0] = (byte) ((value.length & 0xFF) << 24);
result[1] = (byte) ((value.length & 0xFF) << 16);
result[2] = (byte) ((value.length & 0xFF) << 8);
result[3] = (byte) (value.length & 0xFF);
System.arraycopy(value, 0, result, 4, value.length);
try {
target.write(result);
} catch (IOException ignored) {
}
}
private void encode(ByteArrayOutputStream target, String v) {
byte[] value = v.getBytes(StandardCharsets.UTF_8);
encode(target, value);
}
}
| 3,230 |
1,694 | <reponame>CrackerCat/iWeChat
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>.
//
#import <objc/NSObject.h>
@class NSString;
@interface TemplateWeappOPWrap : NSObject
{
unsigned int _weappVersion;
unsigned int _weappState;
NSString *_username;
NSString *_path;
NSString *_appID;
NSString *_iconUrl;
NSString *_nickname;
NSString *_imageUrl;
}
@property(retain, nonatomic) NSString *imageUrl; // @synthesize imageUrl=_imageUrl;
@property(retain, nonatomic) NSString *nickname; // @synthesize nickname=_nickname;
@property(retain, nonatomic) NSString *iconUrl; // @synthesize iconUrl=_iconUrl;
@property(retain, nonatomic) NSString *appID; // @synthesize appID=_appID;
@property(nonatomic) unsigned int weappState; // @synthesize weappState=_weappState;
@property(nonatomic) unsigned int weappVersion; // @synthesize weappVersion=_weappVersion;
@property(retain, nonatomic) NSString *path; // @synthesize path=_path;
@property(retain, nonatomic) NSString *username; // @synthesize username=_username;
- (void).cxx_destruct;
@end
| 441 |
2,350 | import unreal_engine as ue
from unreal_engine.classes import SceneCaptureComponent2D
from unreal_engine.enums import ESceneCaptureSource
class Sight:
def __init__(self):
self.what_i_am_seeing = ue.create_transient_texture_render_target2d(512, 512)
def pre_initialize_components(self):
# add a new root component (a SceneCaptureComponent2D one)
self.scene_capturer = self.uobject.add_actor_root_component(SceneCaptureComponent2D, 'Scene Capture')
# use the previously created texture as the render target
self.scene_capturer.TextureTarget = self.what_i_am_seeing
# store pixels as linear colors (non HDR)
self.scene_capturer.CaptureSource = ESceneCaptureSource.SCS_FinalColorLDR
def begin_play(self):
# get a reference to the pawn currently controlled by the player
mannequin = self.uobject.get_player_pawn()
# attach myself to the 'head' bone of the mannequin Mesh component
self.uobject.attach_to_component(mannequin.Mesh, 'head') | 364 |
14,668 | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/chrome_cleaner/zip_archiver/test_zip_archiver_util.h"
#include <limits>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/contrib/minizip/unzip.h"
namespace chrome_cleaner {
namespace {
const char kTestContent[] = "Hello World";
const base::Time::Exploded kTestFileTime = {
// Year
2018,
// Month
1,
// Day of week
1,
// Day of month
1,
// Hour
2,
// Minute
3,
// Second
5,
// Millisecond
0,
};
// The zip should be encrypted and use UTF-8 encoding.
const uint16_t kExpectedZipFlag = 0x1 | (0x1 << 11);
const int64_t kReadBufferSize = 4096;
// The |day_of_week| in |base::Time::Exploded| won't be set correctly.
// TODO(veranika): This is copied from
// https://cs.chromium.org/chromium/src/chrome/browser/resources/chromeos/zip_archiver/cpp/volume_archive_minizip.cc.
// It would be better to move it to //base.
base::Time::Exploded ExplodeDosTime(const uint32_t dos_time) {
base::Time::Exploded time_part;
uint32_t remain_part = dos_time;
// 0-4bits, second divied by 2.
time_part.second = (remain_part & 0x1F) * 2;
remain_part >>= 5;
// 5-10bits, minute (0–59).
time_part.minute = remain_part & 0x3F;
remain_part >>= 6;
// 11-15bits, hour (0–23 on a 24-hour clock).
time_part.hour = remain_part & 0x1F;
remain_part >>= 5;
// 16-20bits, day of the month (1-31).
time_part.day_of_month = remain_part & 0x1F;
remain_part >>= 5;
// 21-24bits, month (1-23).
time_part.month = remain_part & 0xF;
remain_part >>= 4;
// 25-31bits, year offset from 1980.
time_part.year = (remain_part & 0x7F) + 1980;
return time_part;
}
} // namespace
ZipArchiverTestFile::ZipArchiverTestFile() : initialized_(false) {}
ZipArchiverTestFile::~ZipArchiverTestFile() = default;
void ZipArchiverTestFile::Initialize() {
// Can not be reinitialized.
CHECK(!initialized_);
initialized_ = true;
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(
base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &src_file_path_));
ASSERT_EQ(static_cast<size_t>(base::WriteFile(src_file_path_, kTestContent,
strlen(kTestContent))),
strlen(kTestContent));
// Set a fixed timestamp, so the modified time will be identical in every
// test.
base::Time file_time;
ASSERT_TRUE(base::Time::FromLocalExploded(kTestFileTime, &file_time));
ASSERT_TRUE(base::TouchFile(src_file_path_, file_time, file_time));
}
const base::FilePath& ZipArchiverTestFile::GetSourceFilePath() const {
return src_file_path_;
}
const base::FilePath& ZipArchiverTestFile::GetTempDirPath() const {
return temp_dir_.GetPath();
}
void ZipArchiverTestFile::ExpectValidZipFile(
const base::FilePath& zip_file_path,
const std::string& filename_in_zip,
const std::string& password) {
unzFile unzip_object = unzOpen64(zip_file_path.AsUTF8Unsafe().c_str());
ASSERT_NE(unzip_object, nullptr);
EXPECT_EQ(unzLocateFile(unzip_object, filename_in_zip.c_str(),
/*iCaseSensitivity=*/1),
UNZ_OK);
unz_file_info64 file_info;
const size_t filename_length = strlen(filename_in_zip.c_str());
std::vector<char> filename(filename_length + 1);
ASSERT_GT(std::numeric_limits<Cr_z_uLong>::max(), filename.size());
EXPECT_EQ(unzGetCurrentFileInfo64(
unzip_object, &file_info, filename.data(),
static_cast<Cr_z_uLong>(filename.size()),
/*extraField=*/nullptr, /*extraFieldBufferSize=*/0,
/*szComment=*/nullptr, /*commentBufferSize=*/0),
UNZ_OK);
EXPECT_EQ(file_info.flag & kExpectedZipFlag, kExpectedZipFlag);
// The compression method should be STORE(0).
EXPECT_EQ(file_info.compression_method, 0UL);
EXPECT_EQ(file_info.uncompressed_size, strlen(kTestContent));
EXPECT_EQ(file_info.size_filename, filename_in_zip.size());
EXPECT_STREQ(filename.data(), filename_in_zip.c_str());
base::Time::Exploded file_time = ExplodeDosTime(file_info.dosDate);
EXPECT_EQ(file_time.year, kTestFileTime.year);
EXPECT_EQ(file_time.month, kTestFileTime.month);
EXPECT_EQ(file_time.day_of_month, kTestFileTime.day_of_month);
EXPECT_EQ(file_time.hour, kTestFileTime.hour);
EXPECT_EQ(file_time.minute, kTestFileTime.minute);
// Dos time has a resolution of 2 seconds.
EXPECT_EQ(file_time.second, (kTestFileTime.second / 2) * 2);
EXPECT_EQ(unzOpenCurrentFilePassword(unzip_object, password.c_str()), UNZ_OK);
const size_t content_length = strlen(kTestContent);
std::vector<char> content;
uint8_t read_buffer[kReadBufferSize];
while (true) {
int read_size =
unzReadCurrentFile(unzip_object, read_buffer, kReadBufferSize);
EXPECT_GE(read_size, 0);
if (read_size == 0) {
break;
}
content.insert(content.end(), read_buffer, read_buffer + read_size);
if (content.size() > content_length) {
break;
}
}
EXPECT_EQ(content.size(), content_length);
EXPECT_EQ(std::string(content.begin(), content.end()), kTestContent);
EXPECT_EQ(unzCloseCurrentFile(unzip_object), UNZ_OK);
ASSERT_EQ(unzClose(unzip_object), UNZ_OK);
}
} // namespace chrome_cleaner
| 2,170 |
4,772 | package example.repo;
import example.model.Customer307;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
public interface Customer307Repository extends CrudRepository<Customer307, Long> {
List<Customer307> findByLastName(String lastName);
}
| 83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.