blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
63537ea03d6094b1bce93003d6787a647971ab47 | f806d792bf22bc8306a0926f7b2306c0b3dd4367 | /ACM Training/网络流24题/test.cpp | 27a12400b0ac5bf5bb8f687cc51b033caea2a322 | [
"MIT"
] | permissive | Wycers/Codelib | d7665476c810ddefd82dd758a4963f6b0e1b7ac1 | 7d54dce875a69bc998597abb1c2e2c814587c9b8 | refs/heads/master | 2023-03-05T13:57:44.371292 | 2022-09-22T02:23:17 | 2022-09-22T02:23:17 | 143,575,376 | 28 | 4 | MIT | 2023-03-04T22:05:33 | 2018-08-05T01:44:34 | VHDL | UTF-8 | C++ | false | false | 179 | cpp | #include <cstdio>
#include <cstring>
using namespace std;
int a[2];
int main()
{
memset(a, 0xff, sizeof(a));
printf("%d %d %d\n", a[0], a[1], 0xffffffff);
return 0;
} | [
"11711918@mail.sustc.edu.cn"
] | 11711918@mail.sustc.edu.cn |
17fe2a2d044561927a48edaad043a44566a63f02 | 7e1b1c5f2f3a40f6499b8d5d7b49bc722d2a1917 | /lib/Utils/Dumper.cpp | 47ecad3d48a90f2cee7d7fbd18221846f55531ef | [
"MIT"
] | permissive | joshbedo/hermes | b2d6b0f6c5abaeff94190a2f7b343c0772d9df14 | cda1b533fcda1da28800c05878d27b920364b57d | refs/heads/master | 2022-12-18T18:15:44.266618 | 2020-09-22T18:35:45 | 2020-09-22T18:37:18 | 297,771,133 | 1 | 0 | MIT | 2020-09-22T21:00:35 | 2020-09-22T21:00:34 | null | UTF-8 | C++ | false | false | 12,693 | cpp | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <cctype>
#include <string>
#include "llvh/ADT/DenseMap.h"
#include "llvh/ADT/DenseSet.h"
#include "llvh/ADT/SmallVector.h"
#include "llvh/Support/Casting.h"
#include "llvh/Support/ErrorHandling.h"
#include "llvh/Support/GraphWriter.h"
#include "llvh/Support/raw_ostream.h"
#include "hermes/AST/Context.h"
#include "hermes/FrontEndDefs/Builtins.h"
#include "hermes/IR/CFG.h"
#include "hermes/IR/IR.h"
#include "hermes/IR/IRVisitor.h"
#include "hermes/IR/Instrs.h"
#include "hermes/Support/OSCompat.h"
#include "hermes/Support/Statistic.h"
#include "hermes/Utils/Dumper.h"
using namespace hermes;
using hermes::oscompat::to_string;
using llvh::cast;
using llvh::dyn_cast;
using llvh::isa;
using llvh::raw_ostream;
namespace hermes {
std::string IRPrinter::escapeStr(StringRef name) {
std::string s = name.str();
std::string out;
out += getQuoteSign();
for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
unsigned char c = *i;
if (std::isprint(c) && c != '\\' && c != '"') {
out += c;
} else {
out += "\\\\";
switch (c) {
case '"':
out += "\\\"";
break;
case '\\':
out += "\\\\";
break;
case '\t':
out += 't';
break;
case '\r':
out += 'r';
break;
case '\n':
out += 'n';
break;
default:
char const *const hexdig = "0123456789ABCDEF";
out += 'x';
out += hexdig[c >> 4];
out += hexdig[c & 0xF];
}
}
}
out += getQuoteSign();
return out;
}
std::string IRPrinter::quoteStr(StringRef name) {
if (name.count(" ") || name.empty()) {
return getQuoteSign() + name.str() + getQuoteSign();
}
return name.str();
}
void InstructionNamer::clear() {
Counter = 0;
InstrMap.clear();
}
unsigned InstructionNamer::getNumber(Value *T) {
auto It = InstrMap.find(T);
if (It != InstrMap.end()) {
return It->second;
}
InstrMap[T] = Counter;
return Counter++;
}
void IRPrinter::printTypeLabel(Type T) {
// We don't print type annotations for unknown types.
if (T.isAnyType())
return;
os << " : " << T;
}
void IRPrinter::printValueLabel(Instruction *I, Value *V, unsigned opIndex) {
auto &ctx = I->getContext();
if (isa<CallBuiltinInst>(I) && opIndex == 0) {
os << "["
<< getBuiltinMethodName(cast<CallBuiltinInst>(I)->getBuiltinIndex())
<< "]";
} else if (auto LS = dyn_cast<LiteralString>(V)) {
os << escapeStr(ctx.toString(LS->getValue()));
} else if (auto LB = dyn_cast<LiteralBool>(V)) {
os << (LB->getValue() ? "true" : "false");
} else if (auto LN = dyn_cast<LiteralNumber>(V)) {
const auto Num = LN->getValue();
if (Num == 0 && std::signbit(Num)) {
// Ensure we output -0 correctly
os << "-0";
} else {
char buf[NUMBER_TO_STRING_BUF_SIZE];
numberToString(LN->getValue(), buf, sizeof(buf));
os << buf;
}
} else if (isa<LiteralNull>(V)) {
os << "null";
} else if (isa<LiteralUndefined>(V)) {
os << "undefined";
} else if (isa<GlobalObject>(V)) {
os << "globalObject";
} else if (isa<EmptySentinel>(V)) {
os << "empty";
} else if (isa<Instruction>(V)) {
os << "%" << InstNamer.getNumber(V);
} else if (isa<BasicBlock>(V)) {
os << "%BB" << BBNamer.getNumber(V);
} else if (auto L = dyn_cast<Label>(V)) {
auto Name = L->get();
os << "$" << quoteStr(ctx.toString(Name));
} else if (auto P = dyn_cast<Parameter>(V)) {
auto Name = P->getName();
os << "%" << ctx.toString(Name);
} else if (auto F = dyn_cast<Function>(V)) {
os << "%" << quoteStr(ctx.toString(F->getInternalName())) << "()";
} else if (auto VS = dyn_cast<VariableScope>(V)) {
os << "%" << quoteStr(ctx.toString(VS->getFunction()->getInternalName()))
<< "()";
} else if (auto VR = dyn_cast<Variable>(V)) {
os << "[" << quoteStr(ctx.toString(VR->getName()));
if (I->getParent()->getParent() != VR->getParent()->getFunction()) {
StringRef scopeName =
VR->getParent()->getFunction()->getInternalNameStr();
os << "@" << quoteStr(scopeName);
}
os << "]";
} else {
llvm_unreachable("Invalid value");
}
printTypeLabel(V->getType());
}
void IRPrinter::printFunctionHeader(Function *F) {
bool first = true;
auto &Ctx = F->getContext();
std::string defKindStr = F->getDefinitionKindStr(false);
os << defKindStr << " " << quoteStr(Ctx.toString(F->getInternalName()))
<< "(";
for (auto P : F->getParameters()) {
if (!first) {
os << ", ";
}
os << Ctx.toString(P->getName());
printTypeLabel(P->getType());
first = false;
}
os << ")";
printTypeLabel(F->getType());
}
void IRPrinter::printFunctionVariables(Function *F) {
bool first = true;
auto &Ctx = F->getContext();
os << "frame = [";
for (auto V : F->getFunctionScope()->getVariables()) {
if (!first) {
os << ", ";
}
os << Ctx.toString(V->getName());
printTypeLabel(V->getType());
first = false;
}
os << "]";
if (F->isGlobalScope()) {
bool first2 = true;
for (auto *GP : F->getParent()->getGlobalProperties()) {
if (!GP->isDeclared())
continue;
if (first2) {
os << ", globals = [";
} else {
os << ", ";
}
os << Ctx.toString(GP->getName()->getValue());
first2 = false;
}
if (!first2)
os << "]";
}
}
void IRPrinter::printInstructionDestination(Instruction *I) {
os << "%" << InstNamer.getNumber(I);
}
void IRPrinter::printInstruction(Instruction *I) {
printInstructionDestination(I);
os << " = ";
os << I->getName();
bool first = true;
if (auto *binop = dyn_cast<BinaryOperatorInst>(I)) {
os << " '" << binop->getOperatorStr() << "'";
first = false;
} else if (auto *cmpbr = dyn_cast<CompareBranchInst>(I)) {
os << " '" << cmpbr->getOperatorStr() << "'";
first = false;
} else if (auto *unop = dyn_cast<UnaryOperatorInst>(I)) {
os << " '" << unop->getOperatorStr() << "'";
first = false;
}
for (int i = 0, e = I->getNumOperands(); i < e; i++) {
os << (first ? " " : ", ");
printValueLabel(I, I->getOperand(i), i);
first = false;
}
auto codeGenOpts = I->getContext().getCodeGenerationSettings();
// Print the use list if there is any user for the instruction.
if (!codeGenOpts.dumpUseList || I->getUsers().empty())
return;
llvh::DenseSet<Instruction *> Visited;
os << " // users:";
for (auto &U : I->getUsers()) {
auto *II = cast<Instruction>(U);
assert(II && "Expecting user to be an Instruction");
if (Visited.find(II) != Visited.end())
continue;
Visited.insert(II);
os << " %" << InstNamer.getNumber(II);
}
}
void IRPrinter::printSourceLocation(SMLoc loc) {
SourceErrorManager::SourceCoords coords;
if (!sm_.findBufferLineAndLoc(loc, coords))
return;
os << sm_.getSourceUrl(coords.bufId) << ":" << coords.line << ":"
<< coords.col;
}
void IRPrinter::printSourceLocation(SMRange rng) {
SourceErrorManager::SourceCoords start, end;
if (!sm_.findBufferLineAndLoc(rng.Start, start) ||
!sm_.findBufferLineAndLoc(rng.End, end))
return;
os << "[" << sm_.getSourceUrl(start.bufId) << ":" << start.line << ":"
<< start.col << " ... " << sm_.getSourceUrl(end.bufId) << ":" << end.line
<< ":" << end.col << ")";
}
void IRPrinter::visitModule(const Module &M) {
// Use IRVisitor dispatch to visit each individual function.
for (auto &F : M)
visit(F);
}
void IRPrinter::visitFunction(const Function &F) {
auto *UF = const_cast<Function *>(&F);
os.indent(Indent);
BBNamer.clear();
InstNamer.clear();
// Number all instructions sequentially.
for (auto &BB : *UF)
for (auto &I : BB)
InstNamer.getNumber(&I);
printFunctionHeader(UF);
os << "\n";
printFunctionVariables(UF);
os << "\n";
auto codeGenOpts = F.getContext().getCodeGenerationSettings();
if (codeGenOpts.dumpSourceLocation) {
os << "source location: ";
printSourceLocation(F.getSourceRange());
os << "\n";
}
// Use IRVisitor dispatch to visit the basic blocks.
for (auto &BB : F) {
visit(BB);
}
os.indent(Indent);
os << "function_end"
<< "\n";
os << "\n";
}
void IRPrinter::visitBasicBlock(const BasicBlock &BB) {
auto *UBB = const_cast<BasicBlock *>(&BB);
os.indent(Indent);
os << "%BB" << BBNamer.getNumber(UBB) << ":\n";
Indent += 2;
// Use IRVisitor dispatch to visit the instructions.
for (auto &I : BB)
visit(I);
Indent -= 2;
}
void IRPrinter::visitInstruction(const Instruction &I) {
auto *UII = const_cast<Instruction *>(&I);
auto codeGenOpts = I.getContext().getCodeGenerationSettings();
if (codeGenOpts.dumpSourceLocation) {
os << "; ";
printSourceLocation(UII->getLocation());
os << "\n";
}
os.indent(Indent);
printInstruction(UII);
os << "\n";
}
} // namespace hermes
namespace {
/// This class prints Functions into dotty graphs. This struct inherits the
/// IRVisitor and reimplement the visitFunction and visitBasicBlock function.
struct DottyPrinter : public IRVisitor<DottyPrinter, void> {
llvh::raw_ostream &os;
llvh::SmallVector<std::pair<std::string, std::string>, 4> Edges;
IRPrinter Printer;
explicit DottyPrinter(Context &ctx, llvh::raw_ostream &ost, StringRef Title)
: os(ost), Printer(ctx, ost, /* escape output */ true) {
os << " digraph g {\n graph [ rankdir = \"TD\" ];\n";
os << "labelloc=\"t\"; ";
os << " node [ fontsize = \"16\" shape = \"record\" ]; edge [ ];\n";
}
~DottyPrinter() {
os << "\n";
// Print the edges between the blocks.
for (auto T : Edges) {
os << "" << T.first << " ->";
os << "" << T.second << ";\n";
}
os << "\n}\n";
}
/// Convert pointers into unique textual ids.
static std::string toString(BasicBlock *ptr) {
auto Num = (size_t)ptr;
return to_string(Num);
}
/// Reimplement the visitFunction in IRVisitor.
void visitFunction(const Function &F) {
os << "label=\"";
Printer.printFunctionHeader(const_cast<Function *>(&F));
os << "\";\n";
// Pre-assign every instruction a number, by doing this we avoid
// assigning non-consecutive numbers to consecutive instructions if we
// are dumping user list. Its also not a bad practice to initialize the
// InstNamer table before we dump all the instructions.
for (auto &BB : F) {
for (auto &II : BB) {
(void)Printer.InstNamer.getNumber(const_cast<Instruction *>(&II));
}
}
// Use IRVisitor dispatch to visit the basic blocks.
for (auto &BB : F) {
visit(BB);
}
}
/// Reimplement the visitBasicBlock in the IRVisitor.
/// Visit all of the basic blocks in the program and render them into dotty
/// records. Save edges between basic blocks and print them when we finish
/// visiting all of the blocks in the program.
void visitBasicBlock(const BasicBlock &V) {
auto *BB = const_cast<BasicBlock *>(&V);
os << "\"" << toString(BB) << "\"";
os << "[ label = \"{ ";
os << " { <self> | <head> \\<\\<%BB" << Printer.BBNamer.getNumber(BB)
<< "\\>\\> | } ";
int counter = 0;
// For each instruction in the basic block:
for (auto &I : *BB) {
counter++;
os << " | ";
// Print the instruction.
os << "<L" << counter << ">";
Printer.printInstruction(&I);
}
for (auto I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
auto From = toString(BB) + ":L" + to_string(counter);
Edges.push_back({From, toString(*I) + (*I == BB ? ":self" : ":head")});
}
// Emit the record:
os << "}\" shape = \"record\" ]; \n";
}
};
} // anonymous namespace
void hermes::viewGraph(Function *F) {
#ifndef NDEBUG
auto &Ctx = F->getContext();
StringRef Name = Ctx.toString(F->getInternalName());
int FD;
// Windows can't always handle long paths, so limit the length of the name.
std::string N = Name.str();
N = N.substr(0, std::min<std::size_t>(N.size(), 140));
std::string Filename = llvh::createGraphFilename(N, FD);
{
llvh::raw_fd_ostream O(FD, /*shouldClose=*/true);
if (FD == -1) {
llvh::errs() << "error opening file '" << Filename << "' for writing!\n";
return;
}
DottyPrinter D(F->getContext(), O, Name);
D.visitFunction(*F);
}
llvh::DisplayGraph(Filename);
llvh::errs() << " done. \n";
#endif
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
78c57aec47e8f8dda95804a5aa3b3b527de4b9e1 | c67adfb692d89114a3788cfdbd22c8745dd086f1 | /include/P12218319/cio/algorithms/ISPO.hpp | 20d4eb3127c81054103477cf6a77864af4d57027 | [
"Apache-2.0"
] | permissive | p12218319/CIO | f59bc638cd49dae61f30080ec07086009c9fb6a8 | b302fec4d1b3e0f6f18bf8b83a4229fadd5091c0 | refs/heads/master | 2021-01-10T05:59:51.655404 | 2016-02-24T21:07:51 | 2016-02-24T21:07:51 | 52,361,423 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,333 | hpp | /*
Copyright 2016 Adam Smith & Fabio Caraffini (Original Java version)
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.
email : p12218319@myemail.dmu.ac.uk
*/
#ifndef P12218319_CIO_ISPO_HPP
#define P12218319_CIO_ISPO_HPP
#include "Algorithm.hpp"
namespace P12218319 { namespace cio {
template<const uint32_t DIMENTIONS>
class P12218319_EXPORT_API ISPO : public Algorithm {
public:
FTrend P12218319_CALL operator()(const Problem<DIMENTIONS>& problem, const uint32_t maxEvaluations) const override {
// first, we need to define variables for storing the paramters of the algorithm
double A = mParams[0];
double P = mParams[1];
int B = static_cast<int>(mParams[2]));
int S = static_cast<int>(mParams[3]);
double E = mParams[4];
int PartLoop = static_cast<int>(mParams[5]);
//we always need an object FTrend (for storing the fitness trend), and variables for storing the dimesionality and the bounds of the problem
FTrend FT;
// particle (the solution)
double particle[DIMENTIONS];
double fParticle;
uint32_t i = 0;
// initial solution
if(initialSolution != null) {
particle = initialSolution;
fParticle = initialFitness;
}else {//random intitial guess
particle = generateRandomSolution();
fParticle = problem(particle);
++i;
}
//store the initital guess
FT.push_back(fParticle);
// temp variables
double L = 0.0;
double velocity = 0.0;
double oldfFParticle = fParticle;
double posOld;
//main loop
while(i < maxEvaluations){
for(uint32_t j = 0; j < DIMENTIONS && i < maxEvaluations; ++j){
// init learning factor
L = 0;
// for each part loop
for(uint32_t k = 0; k < PartLoop && i < maxEvaluations; k++) {
// old fitness value
oldfFParticle = fParticle;
// old particle position
posOld = particle[j];
// calculate velocity
velocity = A / std::pow(k + 1, P)*(-0.5 + rand()) + B*L;
// calculate new position
particle[j] += velocity;
particle[j] = std::min(std::max(particle[j], problem.mBounds[j][0]), problem.mBounds[j][1]);
// calculate new fitness
fParticle = problem(particle);
++i;//iteration couter has to be incremented
// estimate performance
if(oldfFParticle < fParticle) {
// adjust learning factor
if(L != 0) L /= S;
if(std::abs(L) < E) L = 0;
// use old position
particle[j] = posOld;
fParticle = oldfFParticle;
} else {
// use current velocity as learning factor
L = velocity;
}
if(i % DIMENTIONS == 0) FT.push_back(fParticle);
}
}
}
finalBest = particle; //save the final best
FT.push_back(fParticle);//add it to the txt file (row data)
return FT; //return the fitness trend
}
};
}}
#endif | [
"solairelibrary@mail.com"
] | solairelibrary@mail.com |
b2cc906cbfc07da3a8e0bd3177d663dfcda61ed4 | a72da64560f6a59f36efff557a5e5b6b762f1b8d | /mcput.cpp | 2259d7618343e69b6c1d61a3826bb1438f142d60 | [] | no_license | Nickalus/Project-4 | 726f66968a553e8679d6da95f3e5d9b9c1de1935 | 45b28f035c19a85b03e24fb18b263c80b56a670c | refs/heads/master | 2021-01-10T22:08:08.206094 | 2014-12-11T04:24:58 | 2014-12-11T04:24:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 422 | cpp | #include "StoreClient.hpp"
int main(int argc, char *argv[])
{
if(argc != 5)
{
std::cout << "Error! Not enough args!" << std::endl;
std::cout << "mcput MachineName <port> <Key> <filename>" << std::endl;
return -1;
}
StoreClient mcPut(std::string(argv[1]),
atoi(argv[2]),
atoi(argv[3]),
std::string(argv[4]));
mcPut.Init();
return mcPut.Run();
} | [
"NickYonts@Gmail.com"
] | NickYonts@Gmail.com |
acd48414d049e9892679ebf16bc71ca5dc635acc | 5809b53fc9920f0cce03d3352b3aae87a7412e3c | /programacion_2/archivos/archivos_secuenciales/Prof_domingo/datos_basicos.h | 6dc83d2af67e0dd8cfe4d4875da01f75e5581d41 | [] | no_license | valbornoz/PRs_ULA | 504e2b87c82c60c2ff188a3a11c08cc57c7e544d | f57fa9c213ad5b5de4febd428962736625664ef9 | refs/heads/master | 2022-11-14T15:00:44.826471 | 2020-06-22T19:10:43 | 2020-06-22T19:10:43 | 274,209,485 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,191 | h | // Ejemplo que muestra la especificación de una clase.
#include<iostream.h>
#include<string.h>
/**************************************************************/
// Especficación de la clase Persona con datos Básicos.........
/**************************************************************/
class persona {
char *nombre, *apellido, *cedula;
char *direccion;
/* definición de las funciones Miembros */
public: /* palabra reservada, de aquí en adelante todo es público */
persona(void);
persona(char *, char *, char *, char *, char *, char *, char *, char *);
void asigna_nombre(char *nombre_nuevo);
void asigna_apellido(char *apellido_nuevo);
void asigna_cedula(char *cedula_nueva);
void asigna_direccion(char *direccion_nueva);
const char * obtener_nombre( )const {return nombre;}
const char * obtener_cedula( ) const {return cedula;}
const char * obtener_apellido( )const {return apellido;}
const char * obtener_direccion( ) const {return direccion;}
friend void operator<<(ostream &s,const persona &p);
friend void operator>>(istream &e,persona &p);
int operator < (const persona &p);
persona& persona::operator=(persona &p);
~persona(void);
};
| [
"albornoz1995@gmail.com"
] | albornoz1995@gmail.com |
23f0da2cec5cca4b93a495588f4b73683c48f14f | 6e0eff95eb73ad35a987777e1801f04c27f862f5 | /libge/core_paint__make_widget.cpp | 707a3f9dae5bdbf0c4b5cd574f6680232a081463 | [] | no_license | mugisaku/gamebaby-20190707-frozen | 8ae1049694c68d2df43494bcb13ca01b6d35ca79 | 50356e3c9fc05adcc0d305932e89798a72c78bb1 | refs/heads/master | 2020-03-30T03:22:35.855826 | 2019-06-25T04:46:32 | 2019-06-25T04:46:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,132 | cpp | #include"libge/ge.hpp"
#include"libgbstd/windows/component.hpp"
namespace ge{
using namespace gbstd;
widget*
core_paint::
make_operation_widget() noexcept
{
auto undo_btn = new button(new label(u"Undo",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->m_core->undo();
}
});
auto copy_btn = new button(new label(u"Copy",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->take_copy();
}
});
auto rou_btn = new button(new label(u"Rotate ↑",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->shift_up(true);
}
});
auto rol_btn = new button(new label(u"Rotate ←",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->shift_left(true);
}
});
auto ror_btn = new button(new label(u"Rotate →",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->shift_right(true);
}
});
auto rod_btn = new button(new label(u"Rotate ↓",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->shift_down(true);
}
});
auto rvl_btn = new button(new label(u"Revolve →",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->revolve();
}
});
auto rvh_btn = new button(new label(u"Reverse -",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->reverse_horizontally();
}
});
auto rvv_btn = new button(new label(u"Reverse |",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->reverse_vertically();
}
});
auto mir_btn = new button(new label(u"Mirror |",colors::black),[](button_event evt){
if(evt.is_release())
{
evt->get_userdata<core_paint>()->mirror_vertically();
}
});
rou_btn->set_userdata(this);
rol_btn->set_userdata(this);
ror_btn->set_userdata(this);
rod_btn->set_userdata(this);
undo_btn->set_userdata(this);
copy_btn->set_userdata(this);
rvl_btn->set_userdata(this);
rvh_btn->set_userdata(this);
rvv_btn->set_userdata(this);
mir_btn->set_userdata(this);
auto ro_col = make_column({rou_btn,rol_btn,ror_btn,rod_btn});
auto ed_row = make_row( {undo_btn,copy_btn});
auto tr_col = make_column({rvl_btn,rvh_btn,rvv_btn,mir_btn});
auto row = make_row({ro_col,tr_col});
return make_column({row,ed_row});
}
widget*
core_paint::
make_tool_widget() noexcept
{
auto cb = [](checkbox_event evt){
auto& pai = *evt->get_common_userdata<core_paint>();
pai.cancel_drawing();
switch(evt->get_entry_number())
{
case(0): pai.change_mode_to_draw_dot();break;
case(1): pai.change_mode_to_draw_line();break;
case(2): pai.change_mode_to_draw_rectangle();break;
case(3): pai.change_mode_to_fill_rectangle();break;
case(4): pai.change_mode_to_fill_area();break;
case(5): pai.change_mode_to_select();break;
case(6): pai.change_mode_to_paste();break;
case(7): pai.change_mode_to_layer();break;
}
};
auto container = new widget;
auto first = new radio_button(u"draw dot",cb);
first->set_common_userdata(this);
first->check();
container->append_column_child(first);
container->append_column_child(new radio_button(*first,u"draw line") );
container->append_column_child(new radio_button(*first,u"draw rectangle"));
container->append_column_child(new radio_button(*first,u"fill rectangle"));
container->append_column_child(new radio_button(*first,u"fill area") );
container->append_column_child(new radio_button(*first,u"select") );
container->append_column_child(new radio_button(*first,u"paste") );
container->append_column_child(new radio_button(*first,u"layer") );
return container;
}
}
| [
"lentilspring@gmail.com"
] | lentilspring@gmail.com |
f4ce053cf89d5051fb2b2694c37f129db8bdf3a1 | 7612214d70a9fbcd912d104e37e0adef382e99dc | /src/agent/payload.h | 3dceac635327b8311dc57a7318170bc2343cebcb | [] | no_license | wenbinf/spi | 10de986b707a887ce906798078866f920bb70e51 | 97f14fa7c14e33d435954827512a287f15357b87 | refs/heads/master | 2021-01-18T07:14:12.763970 | 2016-09-28T05:41:02 | 2016-09-28T05:41:02 | 62,347,876 | 0 | 0 | null | 2016-06-30T23:14:39 | 2016-06-30T23:14:39 | null | UTF-8 | C++ | false | false | 3,449 | h | /*
* Copyright (c) 1996-2011 Barton P. Miller
*
* We provide the Paradyn Parallel Performance Tools (below
* described as "Paradyn") on an AS IS basis, and do not warrant its
* validity or performance. We reserve the right to update, modify,
* or discontinue this software at any time. We shall have no
* obligation to supply such updates or modifications or any other
* form of support to you.
*
* By your use of Paradyn, you understand and agree that we (or any
* other person or entity with proprietary rights in Paradyn) are
* under no obligation to provide either maintenance services,
* update services, notices of latent defects, or correction of
* defects for Paradyn.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SP_PAYLOAD_H_
#define SP_PAYLOAD_H_
#include "agent/patchapi/cfg.h"
#include "common/common.h"
// Wrappers for locking
#define SP_LOCK(func) do { \
int result = Lock(&g_propel_lock); \
if (result == SP_DEAD_LOCK) { \
sp_print("DEAD LOCK - skip #func for point %lx", \
pt->block()->last()); \
goto func##_EXIT; \
} \
} while (0)
#define SP_UNLOCK(func) do { \
func##_EXIT: \
Unlock(&g_propel_lock); \
} while (0)
namespace sp {
class SpContext;
class SpPoint;
// ------------------------
// Private things
// ------------------------
typedef void (*PayloadFunc_t)(ph::Point* pt);
typedef void* PayloadFunc;
struct ArgumentHandle {
ArgumentHandle();
~ArgumentHandle();
char* insert_buf(size_t s);
long offset;
long num;
std::vector<char*> bufs;
};
void wrapper_before(SpPoint* pt,
PayloadFunc_t before);
void wrapper_after(SpPoint* pt,
PayloadFunc_t before);
// ------------------------
// Public things
// ------------------------
// Only used in before_payload
AGENT_EXPORT void Propel(SpPoint* pt_);
AGENT_EXPORT void* PopArgument(SpPoint* pt,
ArgumentHandle* h,
size_t size);
// Implicitly call StartTracing()
AGENT_EXPORT bool IsIpcWrite(SpPoint*);
AGENT_EXPORT bool IsIpcRead(SpPoint*);
// Only used in after_payload
AGENT_EXPORT long ReturnValue(SpPoint* pt);
// Used in both payloads
AGENT_EXPORT SpFunction* Callee(SpPoint* pt);
AGENT_EXPORT char StartTracing(SpPoint* pt,
int fd);
AGENT_EXPORT bool IsInstrumentable(SpPoint* pt);
}
#endif /* SP_PAYLOAD_H_ */
| [
"wenbin@cs.wisc.edu"
] | wenbin@cs.wisc.edu |
29fe14c15fa085d937888e943193ced68ce9292e | 2f10f807d3307b83293a521da600c02623cdda82 | /deps/boost/win/debug/include/boost/geometry/algorithms/detail/distance/interface.hpp | 264d39b2c32f2fd1fdd95b791b3bc0787424f818 | [] | no_license | xpierrohk/dpt-rp1-cpp | 2ca4e377628363c3e9d41f88c8cbccc0fc2f1a1e | 643d053983fce3e6b099e2d3c9ab8387d0ea5a75 | refs/heads/master | 2021-05-23T08:19:48.823198 | 2019-07-26T17:35:28 | 2019-07-26T17:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 130 | hpp | version https://git-lfs.github.com/spec/v1
oid sha256:f6f5e2d5e882942511c7b54d16e255823a1e2e757f109199fd7afb0c0e392479
size 12254
| [
"YLiLarry@gmail.com"
] | YLiLarry@gmail.com |
f3547db5e3f3769d4c321372134659644ecb7142 | 1af49694004c6fbc31deada5618dae37255ce978 | /chrome/browser/chromeos/scanning/scanning_paths_provider_impl_unittest.cc | e08638706798876178dd4b7a6bebc6f8d579bff2 | [
"BSD-3-Clause"
] | permissive | sadrulhc/chromium | 59682b173a00269ed036eee5ebfa317ba3a770cc | a4b950c23db47a0fdd63549cccf9ac8acd8e2c41 | refs/heads/master | 2023-02-02T07:59:20.295144 | 2020-12-01T21:32:32 | 2020-12-01T21:32:32 | 317,678,056 | 3 | 0 | BSD-3-Clause | 2020-12-01T21:56:26 | 2020-12-01T21:56:25 | null | UTF-8 | C++ | false | false | 5,509 | cc | // 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/chromeos/scanning/scanning_paths_provider_impl.h"
#include <memory>
#include "base/bind.h"
#include "base/files/file_path.h"
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/drive/drivefs_test_support.h"
#include "chrome/browser/chromeos/file_manager/path_util.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/login/login_state/login_state.h"
#include "components/account_id/account_id.h"
#include "components/drive/drive_pref_names.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_web_ui.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace chromeos {
namespace {
constexpr char kRoot[] = "root";
} // namespace
class ScanningPathsProviderImplTest : public testing::Test {
public:
ScanningPathsProviderImplTest()
: task_environment_(content::BrowserTaskEnvironment::REAL_IO_THREAD),
profile_manager_(TestingBrowserProcess::GetGlobal()) {}
~ScanningPathsProviderImplTest() override = default;
void SetUp() override {
chromeos::LoginState::Initialize();
chromeos::DBusThreadManager::Initialize();
if (!network_portal_detector::IsInitialized()) {
network_portal_detector_ = new NetworkPortalDetectorTestImpl();
network_portal_detector::InitializeForTesting(network_portal_detector_);
}
ASSERT_TRUE(profile_manager_.SetUp());
profile_ = profile_manager_.CreateTestingProfile("profile1@gmail.com");
profile_->GetPrefs()->SetBoolean(drive::prefs::kDriveFsPinnedMigrated,
true);
user_manager_.AddUser(
AccountId::FromUserEmail(profile_->GetProfileUserName()));
web_contents_ = content::WebContents::Create(
content::WebContents::CreateParams(profile_));
web_ui_ = std::make_unique<content::TestWebUI>();
web_ui_->set_web_contents(web_contents_.get());
create_drive_integration_service_ = base::Bind(
&ScanningPathsProviderImplTest::CreateDriveIntegrationService,
base::Unretained(this));
service_factory_for_test_ = std::make_unique<
drive::DriveIntegrationServiceFactory::ScopedFactoryForTest>(
&create_drive_integration_service_);
drive::DriveIntegrationService* integration_service =
drive::DriveIntegrationServiceFactory::GetForProfile(profile_);
integration_service->OnMounted(drive_mount_point_);
drive_mount_point_ = integration_service->GetMountPointPath();
}
void TearDown() override {
chromeos::LoginState::Shutdown();
chromeos::DBusThreadManager::Shutdown();
}
protected:
drive::DriveIntegrationService* CreateDriveIntegrationService(
Profile* profile) {
return new drive::DriveIntegrationService(
profile, std::string(), profile->GetPath().Append("drivefs"),
fake_drivefs_helper_->CreateFakeDriveFsListenerFactory());
}
TestingProfile* profile_;
ScanningPathsProviderImpl scanning_paths_provider_;
std::unique_ptr<content::TestWebUI> web_ui_;
base::FilePath drive_mount_point_;
private:
chromeos::FakeChromeUserManager user_manager_;
NetworkPortalDetectorTestImpl* network_portal_detector_;
content::BrowserTaskEnvironment task_environment_;
TestingProfileManager profile_manager_;
std::unique_ptr<content::WebContents> web_contents_;
std::unique_ptr<drive::DriveIntegrationServiceFactory::ScopedFactoryForTest>
service_factory_for_test_;
drive::DriveIntegrationServiceFactory::FactoryCallback
create_drive_integration_service_;
std::unique_ptr<drive::FakeDriveFsHelper> fake_drivefs_helper_;
};
// Validates that sending the Google Drive root filepath returns 'My Drive'.
TEST_F(ScanningPathsProviderImplTest, MyDrivePath) {
EXPECT_EQ("directory", scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(), base::FilePath("/test/directory")));
EXPECT_EQ("Sub Folder",
scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(),
drive_mount_point_.Append(kRoot).Append("Sub Folder")));
EXPECT_EQ("My Drive", scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(), drive_mount_point_.Append(kRoot)));
}
// Validates that sending the MyFiles filepath returns 'My files'.
TEST_F(ScanningPathsProviderImplTest, MyFilesPath) {
base::FilePath my_files_path =
file_manager::util::GetMyFilesFolderForProfile(profile_);
EXPECT_EQ("directory", scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(), base::FilePath("/test/directory")));
EXPECT_EQ("Sub Folder",
scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(), my_files_path.Append("Sub Folder")));
EXPECT_EQ("My files", scanning_paths_provider_.GetBaseNameFromPath(
web_ui_.get(), my_files_path));
}
} // namespace chromeos.
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
2bb4d1875cd2651734c2a279434750d321568a96 | fb375827d6e1900ee83f423bfae3660ef0576123 | /release/modules/photo/opencv_perf_photo_pch_dephelp.cxx | 712885f35e0f9eba972656106b2ab97b33d89624 | [] | no_license | andresax/opencv_polimi | 6f8d92b1553fa2d38a37ba16edaaff646e6bd1d9 | c86c396c0c1e36b720f0b3f1250bbf1f5123c570 | refs/heads/master | 2020-04-08T04:25:45.999578 | 2012-11-23T18:39:49 | 2012-11-23T18:39:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 136 | cxx | #include "/home/rodrygojose/opencv_polimi/modules/photo/perf/perf_precomp.hpp"
int testfunction();
int testfunction()
{
return 0;
}
| [
"rodrygojose@gmail.com"
] | rodrygojose@gmail.com |
e845d4bbdee38b375607bbdb66f6c1ebf2c28b99 | 263f4af3a55035c6fbc57dee5c818aa8ce18926a | /src/main.cpp | ef89a7eea29770ce9cb167e2e63732e8bb5cb9d5 | [] | no_license | shm512/CG2014_1 | 0201fe72687040679351f8f79e48c52e9cf20c03 | 48f9340d0877c162325ebf4a04b556006a20b4aa | refs/heads/master | 2021-01-01T05:47:16.052150 | 2015-02-13T23:50:33 | 2015-02-13T23:50:33 | 30,781,327 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,266 | cpp | #include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <initializer_list>
#include <limits>
#include <vector>
#include <tuple>
#include <queue>
using namespace std;
#include "constants.h"
#include "io.h"
#include "matrix.h"
#include "preprocess.h"
#include "segmentation.h"
#include "object.h"
static inline Object
find_red_arrow(const vector<Object> &objects)
{
for (auto &obj : objects) {
if (!obj.is_noise() && obj.is_arrow() && obj.is_red()) {
return obj;
}
}
//we should never be here:
return *objects.begin();
}
//transform from signed polar coordinates to Cartesian coordinates
//with shift of coordinate system origin to (x0, y0)
//answer, r, x0 and y0 (but not phi!) supposed to be discrete
//sign of r means direction
static inline Coord
polar2cartesian_discr(int r, double phi, int x0, int y0)
{
uint x = x0 + int(round(r * cos(phi)));
uint y = y0 + int(round(r * sin(phi)));
return make_tuple(x, y);
}
//this function finds out the direction that arrow is showing
//and proceeding there till the end of the arrow
//return value: axis angle, direction sign (1 or -1) and first point out of arrow
//return value order: <angle, dir_sign, first_out_x, first_out_y>
// N.B. THIS FUNCTION WORKS PROPEPLY ONLY WHEN OBJECT IS ARROW WITH GREEN POINT!
tuple<double, int, uint, uint>
Object::get_arrow_direction()
{
double r = 0, phi = get_axis_of_inertia_angle();
uint x0, y0;
tie(x0, y0) = get_center_of_mass();
//checking positive direction:
uint x_pos = x0, y_pos = y0;
unsigned long long green_c_pos = 0;
for (r = 0; in_object(y_pos, x_pos); r++) {
green_c_pos += green_c_near(y_pos, x_pos); //count green pixels nearby
tie(x_pos, y_pos) = polar2cartesian_discr(r, phi, x0, y0);
}
//now checking negative direction:
uint x_neg = x0, y_neg = y0;
unsigned long long green_c_neg = 0;
for (r = 0; in_object(y_neg, x_neg); r--) {
green_c_neg += green_c_near(y_neg, x_neg); //count green pixels nearby
tie(x_neg, y_neg) = polar2cartesian_discr(r, phi, x0, y0);
}
//we need direction with more green:
if (green_c_pos > green_c_neg) {
return make_tuple(phi, 1, x_pos, y_pos);
} else {
return make_tuple(phi, -1, x_neg, y_neg);
}
}
tuple<vector<Rect>, Image>
find_treasure(const Image &in)
{
Image img = noise_reduction(in);
BinImage bin_img = binarize(img);
vector<Object> objects = image_segmentation(img, bin_img);
vector<Rect> path;
int dir_sign;
double phi;
uint x0, y0;
//going by arrows, starting at the red one:
Object cur_obj = find_red_arrow(objects);
do {
path.push_back(cur_obj.get_borders());
tie(phi, dir_sign, x0, y0) = cur_obj.get_arrow_direction();
uint x = x0, y = y0;
int r = 0;
//indices in objects = object.number - 2 = bin_img(point_of_object) - 2
//(0 and 1 for background and unmarked objects respectively)
while (!bin_img(y, x) || objects[bin_img(y, x) - 2].is_noise()) {
tie(x, y) = polar2cartesian_discr(r, phi, x0, y0);
img(y, x) = green;
r += dir_sign;
}
cur_obj = objects[bin_img(y, x) - 2];
} while (cur_obj.is_arrow() && cur_obj.is_white());
//finally, cur_obj is neither noise nor arrow => it is a treasure
path.push_back(cur_obj.get_borders());
cur_obj.draw_borders();
return make_tuple(path, img);
}
int
main(int argc, char *argv[])
{
if (argc != 4) {
cout << "Usage: " << endl << argv[0]
<< " <in_image.bmp> <out_image.bmp> <out_path.txt>" << endl;
return 0;
}
try {
Image src_image = load_image(argv[1]);
ofstream fout(argv[3]);
vector<Rect> path;
Image dst_image;
tie(path, dst_image) = find_treasure(src_image);
save_image(dst_image, argv[2]);
uint x, y, width, height;
for (const auto &obj : path) {
tie(x, y, width, height) = obj;
fout << x << " " << y << " " << width << " " << height << endl;
}
} catch (const string &s) {
cerr << "Error: " << s << endl;
return 1;
}
}
| [
"shm3512@yandex.ru"
] | shm3512@yandex.ru |
40d7a1700759c59ff5a8163628bd0e45ad2dede5 | 9a58f6b2de14443b02dfa086355be8478e887f51 | /GOSX Lite/source/Engine/FeatureManager/Features/Esp.h | eb885a912794b6ef51431da6b850cd9d9fc26e48 | [
"Apache-2.0"
] | permissive | mxwll1/GO-SX-Internal-Lite | 4564869859fc47e1d5eecc03a397f9cbb5f84249 | 63a1f5735c99ef6a24142c659158e1406e1a7328 | refs/heads/master | 2021-01-18T18:14:38.151199 | 2017-03-30T10:51:13 | 2017-03-30T10:51:13 | 86,851,954 | 13 | 7 | null | 2017-03-31T19:08:47 | 2017-03-31T19:08:47 | null | UTF-8 | C++ | false | false | 482 | h | //
// Esp.hpp
// GOSX Pro
//
// Created by Andre Kalisch on 20.02.17.
// Copyright © 2017 Andre Kalisch. All rights reserved.
//
#ifndef Esp_h
#define Esp_h
#include "SDK/SDK.h"
#include "Engine/DrawManager/draw.h"
class CEsp {
public:
CEsp(CDrawings* drawMngr);
void DrawESP();
void DrawCrossHair();
void DrawFOVCircle();
void DrawSilentFOVCircle();
void DrawScope();
void DrawBomb();
private:
CDrawings* DrawManager;
};
#endif /* Esp_h */
| [
"aka@rissc.com"
] | aka@rissc.com |
f5a911e7f1ad8a248faac42f2b9d7bc94ce6209e | 22b428f69d38cdb3443633beef87df24ce11ca19 | /encode/server_nvenc.cpp | b1b90993e7c6b2c80839aa52694a82134f4ef98b | [] | no_license | trippelc23/Embedded2 | 50b6b8b9712c9cf2136f993ab2557c076ece2093 | a61f90c172615877696a6777752afa6325cd7b77 | refs/heads/master | 2022-09-22T22:51:12.426377 | 2020-06-04T05:38:34 | 2020-06-04T05:38:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,609 | cpp | #include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <NvPipe.h>
// TODO fix issue of rebuilding from more than 1 packet
#define LISTEN_PORT 9001
#define IMG_HEIGHT 200
#define IMG_WIDTH 200
void setup_server_socket(int port, int &sock, sockaddr_in &address, int opt) {
int server_fd;
if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) {
printf("[!!] Error: unable to start socket\n");
exit(EXIT_FAILURE);
}
if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt))) {
printf("[!!] Error: setsockopt failed\n");
exit(EXIT_FAILURE);
}
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(LISTEN_PORT);
if (bind(server_fd, (sockaddr *) &address, sizeof(address)) < 0) {
printf("[!!] Error: unable to bind\n");
exit(EXIT_FAILURE);
}
if (listen(server_fd, 3) < 0) {
printf("[!!] Error: failed to listen\n");
exit(EXIT_FAILURE);
}
int addrlen = sizeof(address);
if ((sock = accept(server_fd, (sockaddr *) &address, (socklen_t *) &addrlen)) < 0) {
printf("[!!] Error: failed to accept connection\n");
exit(EXIT_FAILURE);
}
}
int main(int argc, char **argv) {
int sock;
sockaddr_in addr;
int opt = 1;
setup_server_socket(LISTEN_PORT, sock, addr, opt);
printf("Got connection\n");
uint32_t width = IMG_WIDTH, height = IMG_HEIGHT;
// Buffer to store image
std::vector<uint8_t> compressed_frame(width * height * 4);
// Create decoder
NvPipe *decoder = NvPipe_CreateDecoder(NVPIPE_RGBA32, NVPIPE_H264, width, height);
while (true) {
uint64_t compressedSize;
read(sock, &compressedSize, sizeof(uint64_t));
read(sock, compressed_frame.data(), compressedSize);
cv::Mat frame(width, height, CV_8UC4);
NvPipe_Decode(decoder, compressed_frame.data(), compressedSize, frame.data, width, height);
uint64_t raw_size = frame.cols * frame.rows * 4 * sizeof(uint8_t);
printf("Frame info:\n\tRaw size: %ld\n\tEncoded size: %ld\n\tEncode ratio: %f\%\n\n", raw_size, compressedSize, ((float)compressedSize/raw_size) * 100);
// Convert back for display
cv::cvtColor(frame, frame, cv::COLOR_RGBA2BGR);
cv::imshow("FRAME", frame);
if (cv::waitKey(1) == 27) {
printf("ESC pressed, closing\n");
break;
}
}
NvPipe_Destroy(decoder);
exit(EXIT_SUCCESS);
}
| [
"tanliyon@hotmail.com"
] | tanliyon@hotmail.com |
6a380249363d424db4666b2adb944ed92b725e99 | dd949f215d968f2ee69bf85571fd63e4f085a869 | /subarchitectures/vision.sa/branches/spring-school-2011-DEPRECATED/src/c++/vision/components/ObjectTracker/Tracker/include/Quaternion.h | 1be69d0ba1877a173817315d53bac72f0151440a | [] | no_license | marc-hanheide/cogx | a3fd395805f1b0ad7d713a05b9256312757b37a9 | cb9a9c9cdfeba02afac6a83d03b7c6bb778edb95 | refs/heads/master | 2022-03-16T23:36:21.951317 | 2013-12-10T23:49:07 | 2013-12-10T23:49:07 | 219,460,352 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,142 | h | //HEADER:
// Title: class Quaternion
// File: Quaternion.h
//
// Function: Header file for Quaternions for rotations in OpenGL
// From: http://gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation
//
// Author: Thomas Mörwald
// Date: 17.06.2009
// ----------------------------------------------------------------------------
#ifndef QUATERNION_H
#define QUATERNION_H
#include <math.h>
#include "mathlib.h"
#define FTOL 0.0001
#define PIOVER180 PI/180.0
namespace Tracking{
class Quaternion
{
private:
public:
float x,y,z,w;
Quaternion();
Quaternion(float x, float y, float z, float w);
void normalise();
Quaternion getConjugate();
Quaternion operator+ (const Quaternion &q2);
Quaternion operator* (const Quaternion &rq);
Quaternion operator* (const float f);
vec3 operator* (const vec3 &vec);
void fromAxis(const vec3 &v, float angle);
void fromEuler(float pitch, float yaw, float roll);
void fromMatrix(mat3 m);
void fromMatrix(mat4 m);
mat4 getMatrix4();
mat3 getMatrix3();
void getAxisAngle(vec3 &axis, double &angle);
};
} // namespace Tracker
#endif | [
"michaelz@9dca7cc1-ec4f-0410-aedc-c33437d64837"
] | michaelz@9dca7cc1-ec4f-0410-aedc-c33437d64837 |
a68bcdc8608bb323a3c0a8f44bd9c58b24eccc15 | 40896320a81f84c7404e7c0e0b93907d743c1d27 | /THE2/Foundry.h | 34936dc3a98fa3f8321aa4d6b3b4273bd0036ada | [] | no_license | fatihdeveli/CENG334-Intr-to-Operating-Systems-Assignments | b496bd8a5d56322c9fdde13d31e369c05d78eb79 | 5765e9e7155f28dc2f7249debef0168409ea7b87 | refs/heads/master | 2022-01-06T21:22:02.848388 | 2019-04-28T14:37:46 | 2019-04-28T14:37:46 | 175,494,458 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,152 | h | //
// Created by fatih on 21.04.2019.
//
#ifndef FOUNDRY_H
#define FOUNDRY_H
#include <semaphore.h>
extern "C" {
#include "writeOutput.h"
}
#define TIMEOUT 5
class Foundry {
public:
Foundry(unsigned int id, unsigned int interval, unsigned int capacity);
static void *foundry(void *args); // Foundry thread routine
void dropOre(OreType &oreType);
void signalDropOre();
unsigned int getId() const;
unsigned int getCapacity() const;
unsigned int getProducedIngotCount() const;
unsigned int getWaitingIronCount() const;
unsigned int getWaitingCoalCount() const;
pthread_t getThreadId() const;
bool isActive() const;
private:
unsigned int id, interval, capacity, producedIngotCount, waitingIronCount, waitingCoalCount;
pthread_t threadId;
bool active;
pthread_cond_t ironAndCoalReadyCV; // Condition variable to check the status of incoming ores.
pthread_mutex_t ironAndCoalCountMutex; // Mutex to protect waitingIronCount and waitingCoalCount
// from being modified by multiple threads at the same time.
void writeFoundryOutput(Action action);
};
#endif //FOUNDRY_H
| [
"fatih.develi@hotmail.com"
] | fatih.develi@hotmail.com |
b62b3a838d05ab6f0bdd3c813c12ff024a8d7823 | fbc0ef0534b516624238cbbf3af7a387d30e3ca5 | /ооп/ооп/Action.cpp | 3e6a7710c7a1c497582769143dc4c9bdd483bff6 | [] | no_license | orehovakatya/4sem | 90bbb84b8255bf32d1eff28651f034d92ece5687 | 970d7dcca249c06828ab445503f7b33901e48755 | refs/heads/master | 2021-01-19T08:54:50.623371 | 2017-06-05T17:22:42 | 2017-06-05T17:22:42 | 87,695,726 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 514 | cpp | #include "Action.h"
action_values modify_act(argument &arg)
{
return arg.modify_act;
}
char *load_act(argument arg)
{
return arg.load_act;
}
errors draw_prosessor(model &mod, My_drawing g)
{
return draw_model(mod, g);
}
errors change_points_prosessor(model &mod, argument arg)
{
return change_points(mod.p, modify_act(arg));
}
errors load_model_prosessor(model &mod, argument arg)
{
return load_model(mod, load_act(arg));
}
errors clear_all_prosessor(model &mod)
{
clear_model(mod);
return ERROR_NO;
} | [
"Екатерина Орехова"
] | Екатерина Орехова |
c403b09f0da8276ea13d5bd99d4d8ce91ee8d7ab | 833dc03ee2fd3e03a4b877435065cd86d7077132 | /CSC375/Program Assignments/prog02/prog02.cpp | bd2d9cedb704f4040e3da5c69bca61993228f5b0 | [] | no_license | popebob/collegefiles | a0c715b946a82c6863ffdbb10b4cbf58e6d57a82 | 843b186aee826dd6a586c115c0c1a58a234ea399 | refs/heads/master | 2020-03-09T01:47:34.861814 | 2018-06-13T15:56:26 | 2018-06-13T15:56:26 | 128,524,326 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,467 | cpp | /***********
Cody Adams
CSC375-01 prog02
Winter 2009
Dev-C++ 4.9.9.2
Compiled on Windows 7 x64 Build 7000
prog02.cpp -- UI source
***********/
#include <list>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include "change.cpp"
using namespace std;
//****************************int_main()**************************//
int main(int argc, char *argv[])
{
list<change> result; //list for storing change results
list<float> summary; //list for storing total cash doled out
result.clear();
float amount; //float file to allow work on dat from infile
ifstream infile;
infile.open ( argv[1] ); // open file
if ( ( infile.is_open() ) && ( argc > 1 ) ) // file opened, valid number
{ // of parameters
cout << endl << "Processing input file: " << argv[1] << ". Please wait..."
<< endl << endl;
while ( ! infile.eof() ) // read values
{
infile >> amount;
if ( amount == 0 ) //checking for whitespace at end of data
break; //not ignored by buffer (possibly platform-specific)
cout << "$" << amount << " is: ";
if ( amount > 999999 ) //preventing precision loss in display()
{
cout << "invalid input; must be in range: {1 to 999999}" << endl;
cout << "Skipping: " << amount << endl << endl;
}
else
{
float adjustedamount = floor( amount * 100 ); //adjust for precision
makechange(adjustedamount, result, summary); //in change.h/.cpp
}
amount = 0; //to allow check for whitespace
}
}
else // file not opened or
{ // not enough parameters
if (argc == 2) // bad file specified
cout << "Unable to open file: " << argv[1] << ". Quitting...";
else // not enough parameters
cout << "ERROR" << endl << "Invalid run-time parameter(s). " <<
"You typed:" << endl << "prog02 ";
return 0; // quit
}
print( summary );
return 0;
}
//****************************end*********************************//
| [
"coadams@umflint.edu"
] | coadams@umflint.edu |
1e5cc7f77b04d59116be0f1e121143b289d47776 | c6fc0c923576e3aafe5e38ad9d5436632376cb81 | /tutorial7/lud-openblas-cuda-v4/data/MatrixFactorData.h | 833c7a979c1eba01066fcdb5144c366512ecaae1 | [
"NIST-Software"
] | permissive | sowo/HTGS-Tutorials | d09d71219c9457dbf655c99c8766c81780592ada | bc1dc18b3f6ca91fb5d457f31430498cbf1d606e | refs/heads/master | 2020-07-17T13:56:29.158130 | 2019-04-12T21:06:24 | 2019-04-12T21:06:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 850 | h | //
// Created by tjb3 on 7/28/16.
//
#ifndef HTGS_TUTORIALS_MATRIXFACTORDATA_H
#define HTGS_TUTORIALS_MATRIXFACTORDATA_H
#include <htgs/api/IData.hpp>
#include "MatrixBlockData.h"
template <class T>
class MatrixFactorData : public htgs::IData
{
public:
MatrixFactorData(const std::shared_ptr<MatrixBlockData<T>> &triMatrix,
const std::shared_ptr<MatrixBlockData<T>> &unfactoredMatrix)
: unfactoredMatrix(unfactoredMatrix), triMatrix(triMatrix) {}
const std::shared_ptr<MatrixBlockData<T>> &getUnFactoredMatrix() const {
return unfactoredMatrix;
}
const std::shared_ptr<MatrixBlockData<T>> &getTriangleMatrix() const {
return triMatrix;
}
private:
std::shared_ptr<MatrixBlockData<T>> unfactoredMatrix;
std::shared_ptr<MatrixBlockData<T>> triMatrix;
};
#endif //HTGS_TUTORIALS_MATRIXFACTORDATA_H
| [
"timothy.blattner@nist.gov"
] | timothy.blattner@nist.gov |
4bc2aaf20c31a4cdba1f1f620f5959500216d13a | 73fe2df5d2ee3a4d4e4ab2c857f581c0a28124c5 | /piece.hpp | 4f85ef9c0eaf73a95810d739427836a0bc1f85d1 | [
"MIT"
] | permissive | austonst/music-gen | 2a4af9f33a1298cf05ee151389d5450dfee33f53 | bd3ea6d1c5388c98e3105d83e2822ed3cca311a1 | refs/heads/master | 2020-05-09T10:59:34.327068 | 2015-02-13T19:58:54 | 2015-02-13T19:58:54 | 18,116,211 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,632 | hpp | /*
-----Piece Class Header-----
Auston Sterling
austonst@gmail.com
The header file for the Piece class, representing an entire musical song.
*/
#ifndef _piece_h_
#define _piece_h_
#include "theme.hpp"
#include <string>
struct PieceSettings
{
//Default constructor, sets to minimum strictness
PieceSettings();
//Constructor to set up required fields and optionally strictness
//If no strictness specified, sets to minimum
PieceSettings(float inLength, midi::Instrument inInst, std::uint8_t strict = 1);
//Sets up values corresponding to a certain strictness
//Does not properly set length or instrument
void setStrictness(std::uint8_t strict);
//--- Strictness Independent Variables ---
//The overall (approximate) length of the piece in whole notes
std::uint32_t length;
//The instrument that will play the melody
midi::Instrument instrumentMel;
//--- Strictness Dependent Variables ---
//The strictness of the piece on a scale from 1-5
//1 will produce very random pieces, 5 will produce standard music sounding pieces
std::uint8_t strictness;
//Allow for motifs of length 1.5 measures
bool allowFractionalMotifs;
//Maximum number of mutations per motif is a function of stiffness
std::uint32_t maxMutations;
//The number of themes to generate is a function of stiffness
std::uint16_t numThemes;
};
class Piece
{
public:
//Constructors
Piece(const PieceSettings& set);
//General use functions
void generate(PieceSettings set);
void write(const std::string& filename) const;
private:
//The notes in the piece
midi::NoteTrack notes_;
};
#endif
| [
"austonst@gmail.com"
] | austonst@gmail.com |
c4bf828159d3b467737f63b16fb1c2ae6e59c514 | 5b169dab4172c58b94eb30007709027339725b3e | /g2o_frontend/mapper/graph_viewer/drawable_laser.h | e3d748504cb1324136bf6d531d2095e37d8c9e56 | [] | no_license | redheli/g2o_frontend | 29dff9b19d08e778ab7a758dab47f664afa73b93 | 2cef4895e050e60c2d2d17251ba48ff8fd6d4e61 | refs/heads/master | 2020-12-11T06:02:35.708806 | 2014-06-12T13:58:32 | 2014-06-12T13:58:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 573 | h | #ifndef DRAWABLE_LASER_H
#define DRAWABLE_LASER_H
#include "drawable.h"
#include "g2o_frontend/sensor_data/laser_robot_data.h"
#include <vector>
class DrawableLaser : public Drawable
{
public:
DrawableLaser();
DrawableLaser(LaserRobotData* laser_);
inline virtual void setLaser(LaserRobotData* laser_) { _laser = laser_; }
inline virtual LaserRobotData* laser() { return _laser; }
inline virtual const LaserRobotData* laser() const { return _laser; }
virtual void draw();
protected:
LaserRobotData* _laser;
};
#endif // DRAWABLE_LASER_H
| [
"greyzhan@greyzhan-N56VZ.(none)"
] | greyzhan@greyzhan-N56VZ.(none) |
fac89d666da4c4ebae6c30a659dd43e041f23dde | cb12e0eb5fbc5904df7dca160bd5005485af66ff | /xmrig-override/crypto/common/Algorithm.h | 359610a75506e2a94f99bf313b73489c507f7fe3 | [] | no_license | cryptoandcoffee/node-cryptonight-hashing | dc2be30ec96d51eb87f8707c5bdb4157e4b959f7 | 571042040ddf8242314f941fb668315bb73c23ab | refs/heads/master | 2023-02-22T03:02:57.488297 | 2021-01-22T15:44:59 | 2021-01-22T15:44:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,133 | h | /* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_ALGORITHM_H
#define XMRIG_ALGORITHM_H
#include <stdint.h>
#include <stddef.h>
#define XMRIG_ALGO_CN_GPU 1
#define XMRIG_ALGO_CN_LITE 1
#define XMRIG_ALGO_CN_HEAVY 1
#define XMRIG_ALGO_CN_PICO 1
#define XMRIG_ALGO_RANDOMX 1
#define XMRIG_ALGO_ARGON2 1
#define XMRIG_ALGO_ASTROBWT 1
namespace xmrig {
class Algorithm
{
public:
enum Id : int {
INVALID = -1,
CN_0, // "cn/0" CryptoNight (original).
CN_1, // "cn/1" CryptoNight variant 1 also known as Monero7 and CryptoNightV7.
CN_2, // "cn/2" CryptoNight variant 2.
CN_R, // "cn/r" CryptoNightR (Monero's variant 4).
CN_FAST, // "cn/fast" CryptoNight variant 1 with half iterations.
CN_HALF, // "cn/half" CryptoNight variant 2 with half iterations (Masari/Torque).
CN_XAO, // "cn/xao" CryptoNight variant 0 (modified, Alloy only).
CN_RTO, // "cn/rto" CryptoNight variant 1 (modified, Arto only).
CN_RWZ, // "cn/rwz" CryptoNight variant 2 with 3/4 iterations and reversed shuffle operation (Graft).
CN_ZLS, // "cn/zls" CryptoNight variant 2 with 3/4 iterations (Zelerius).
CN_DOUBLE, // "cn/double" CryptoNight variant 2 with double iterations (X-CASH).
CN_GPU, // "cn/gpu" CryptoNight-GPU (Ryo).
CN_LITE_0, // "cn-lite/0" CryptoNight-Lite variant 0.
CN_LITE_1, // "cn-lite/1" CryptoNight-Lite variant 1.
CN_HEAVY_0, // "cn-heavy/0" CryptoNight-Heavy (4 MB).
CN_HEAVY_TUBE, // "cn-heavy/tube" CryptoNight-Heavy (modified, TUBE only).
CN_HEAVY_XHV, // "cn-heavy/xhv" CryptoNight-Heavy (modified, Haven Protocol only).
CN_PICO_0, // "cn-pico" CryptoNight-Pico
CN_PICO_TLO, // "cn-pico/tlo" CryptoNight-Pico (TLO)
RX_0, // "rx/0" RandomX (reference configuration).
RX_WOW, // "rx/wow" RandomWOW (Wownero).
RX_LOKI, // "rx/loki" RandomXL (Loki).
RX_KEVA, // "rx/keva" RandomXL (Keva).
DEFYX, // "defyx" DefyX (Scala).
RX_ARQ, // "rx/arq" RandomARQ (Arqma).
RX_SFX, // "rx/sfx" RandomSFX (Safex Cash).
AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa).
AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ)
ASTROBWT_DERO, // "astrobwt" AstroBWT (Dero)
MAX
};
enum Family : int {
UNKNOWN,
CN,
CN_LITE,
CN_HEAVY,
CN_PICO,
RANDOM_X,
ARGON2,
ASTROBWT
};
inline Algorithm() {}
inline Algorithm(Id id) : m_id(id) {}
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
inline bool isValid() const { return m_id != INVALID; }
inline Family family() const { return family(m_id); }
inline Id id() const { return m_id; }
inline bool operator!=(Algorithm::Id id) const { return m_id != id; }
inline bool operator!=(const Algorithm &other) const { return !isEqual(other); }
inline bool operator==(Algorithm::Id id) const { return m_id == id; }
inline bool operator==(const Algorithm &other) const { return isEqual(other); }
inline operator Algorithm::Id() const { return m_id; }
static Family family(Id id);
private:
Id m_id = INVALID;
};
} /* namespace xmrig */
#endif /* XMRIG_ALGORITHM_H */
| [
"hkfoan@gmail.com"
] | hkfoan@gmail.com |
3e56e8436f68f6689b50b475e386e81e5de1ed1e | ac7b2a13b18aadc88d0d32ae1c691180f456bd43 | /firmware/common_libraries/WS2812B_STM32_Libmaple/src/WS2812B.cpp | f34be5e72cd5ad1fd7b8b833d378625a0b28ad84 | [] | no_license | coddingtonbear/maxwell | 9151b3e8ce67c878a50e4cfc2f2e931077afdfcc | fe8e781734fc8191973843a91d2690620f39644b | refs/heads/master | 2021-05-07T06:42:31.075228 | 2019-12-12T15:28:30 | 2019-12-12T15:28:30 | 111,770,265 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,968 | cpp | /*-----------------------------------------------------------------------------------------------
Arduino library to control WS2812B RGB Led strips using the Arduino STM32 LibMaple core
-----------------------------------------------------------------------------------------------
Note.
This library has only been tested on the WS2812B LED. It may not work with the older WS2812 or
other types of addressable RGB LED, becuase it relies on a division multiple of the 72Mhz clock
frequence on the STM32 SPI to generate the correct width T0H pulse, of 400ns +/- 150nS
SPI DIV32 gives a pulse width of 444nS which is well within spec for the WS2812B but
is probably too long for the WS2812 which needs a 350ns pulse for T0H
This WS2811B library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
See <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------------------------*/
#include "WS2812B.h"
#include "pins_arduino.h"
#include "wiring_private.h"
#include <SPI.h>
SPIClass LedSPI(1);
// Constructor when n is the number of LEDs in the strip
WS2812B::WS2812B(uint16_t number_of_leds) :
brightness(0), pixels(NULL)
{
updateLength(number_of_leds);
}
WS2812B::~WS2812B()
{
if(pixels)
{
free(pixels);
}
LedSPI.end();
}
void WS2812B::begin(void) {
if (!begun)
{
LedSPI.setClockDivider(WS2812B_SPI_DIVISOR);
LedSPI.begin();
begun = true;
}
}
void WS2812B::updateLength(uint16_t n)
{
if(doubleBuffer)
{
free(doubleBuffer);
}
numBytes = (n<<3) + n + 2; // 9 encoded bytes per pixel. 1 byte empty peamble to fix issue with SPI MOSI and on byte at the end to clear down MOSI
// Note. (n<<3) +n is a fast way of doing n*9
if((doubleBuffer = (uint8_t *)malloc(numBytes*2)))
{
numLEDs = n;
pixels = doubleBuffer;
// Only need to init the part of the double buffer which will be interacted with by the API e.g. setPixelColor
*pixels=0;//clear the preamble byte
*(pixels+numBytes-1)=0;// clear the post send cleardown byte.
clear();// Set the encoded data to all encoded zeros
}
else
{
numLEDs = numBytes = 0;
}
}
// Sends the current buffer to the leds
void WS2812B::show(void)
{
LedSPI.dmaSendAsync(pixels,numBytes);// Start the DMA transfer of the current pixel buffer to the LEDs and return immediately.
// Need to copy the last / current buffer to the other half of the double buffer as most API code does not rebuild the entire contents
// from scratch. Often just a few pixels are changed e.g in a chaser effect
if (pixels==doubleBuffer)
{
// pixels was using the first buffer
pixels = doubleBuffer+numBytes; // set pixels to second buffer
memcpy(pixels,doubleBuffer,numBytes);// copy first buffer to second buffer
}
else
{
// pixels was using the second buffer
pixels = doubleBuffer; // set pixels to first buffer
memcpy(pixels,doubleBuffer+numBytes,numBytes); // copy second buffer to first buffer
}
}
/*Sets a specific pixel to a specific r,g,b colour
* Because the pixels buffer contains the encoded bitstream, which is in triplets
* the lookup table need to be used to find the correct pattern for each byte in the 3 byte sequence.
*/
void WS2812B::setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b)
{
uint8_t *bptr = pixels + (n<<3) + n +1;
uint8_t *tPtr = (uint8_t *)encoderLookup + g*2 + g;// need to index 3 x g into the lookup
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
tPtr = (uint8_t *)encoderLookup + r*2 + r;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
tPtr = (uint8_t *)encoderLookup + b*2 + b;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
}
void WS2812B::setPixelColor(uint16_t n, uint32_t c)
{
uint8_t r,g,b;
if(brightness)
{
r = ((int)((uint8_t)(c >> 16)) * (int)brightness) >> 8;
g = ((int)((uint8_t)(c >> 8)) * (int)brightness) >> 8;
b = ((int)((uint8_t)c) * (int)brightness) >> 8;
}
else
{
r = (uint8_t)(c >> 16),
g = (uint8_t)(c >> 8),
b = (uint8_t)c;
}
uint8_t *bptr = pixels + (n<<3) + n +1;
uint8_t *tPtr = (uint8_t *)encoderLookup + g*2 + g;// need to index 3 x g into the lookup
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
tPtr = (uint8_t *)encoderLookup + r*2 + r;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
tPtr = (uint8_t *)encoderLookup + b*2 + b;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
}
// Convert separate R,G,B into packed 32-bit RGB color.
// Packed format is always RGB, regardless of LED strand color order.
uint32_t WS2812B::Color(uint8_t r, uint8_t g, uint8_t b) {
return ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
}
// Convert separate R,G,B,W into packed 32-bit WRGB color.
// Packed format is always WRGB, regardless of LED strand color order.
uint32_t WS2812B::Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w) {
return ((uint32_t)w << 24) | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
}
uint16_t WS2812B::numPixels(void) const {
return numLEDs;
}
// Adjust output brightness; 0=darkest (off), 255=brightest. This does
// NOT immediately affect what's currently displayed on the LEDs. The
// next call to show() will refresh the LEDs at this level. However,
// this process is potentially "lossy," especially when increasing
// brightness. The tight timing in the WS2811/WS2812 code means there
// aren't enough free cycles to perform this scaling on the fly as data
// is issued. So we make a pass through the existing color data in RAM
// and scale it (subsequent graphics commands also work at this
// brightness level). If there's a significant step up in brightness,
// the limited number of steps (quantization) in the old data will be
// quite visible in the re-scaled version. For a non-destructive
// change, you'll need to re-render the full strip data. C'est la vie.
void WS2812B::setBrightness(uint8_t b) {
// Stored brightness value is different than what's passed.
// This simplifies the actual scaling math later, allowing a fast
// 8x8-bit multiply and taking the MSB. 'brightness' is a uint8_t,
// adding 1 here may (intentionally) roll over...so 0 = max brightness
// (color values are interpreted literally; no scaling), 1 = min
// brightness (off), 255 = just below max brightness.
uint8_t newBrightness = b + 1;
if(newBrightness != brightness) { // Compare against prior value
// Brightness has changed -- re-scale existing data in RAM
uint8_t c,
*ptr = pixels,
oldBrightness = brightness - 1; // De-wrap old brightness value
uint16_t scale;
if(oldBrightness == 0) scale = 0; // Avoid /0
else if(b == 255) scale = 65535 / oldBrightness;
else scale = (((uint16_t)newBrightness << 8) - 1) / oldBrightness;
for(uint16_t i=0; i<numBytes; i++)
{
c = *ptr;
*ptr++ = (c * scale) >> 8;
}
brightness = newBrightness;
}
}
//Return the brightness value
uint8_t WS2812B::getBrightness(void) const {
return brightness - 1;
}
/*
* Sets the encoded pixel data to turn all the LEDs off.
*/
void WS2812B::clear()
{
uint8_t * bptr= pixels+1;// Note first byte in the buffer is a preable and is always zero. hence the +1
uint8_t *tPtr;
for(int i=0;i< (numLEDs *3);i++)
{
tPtr = (uint8_t *)encoderLookup;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
*bptr++ = *tPtr++;
}
}
| [
"me@adamcoddington.net"
] | me@adamcoddington.net |
d5dea1726c6f1641eda514a5af2c1ed1d31298f9 | d801fbfaf6efc761f31895e4ddc56165310efde8 | /src/MQTT.cpp | 0e554b2b4de9b58324d0a9e29038629752a3846e | [] | no_license | wwkkww1983/ULP_Temp_logger | 80262e75fd6d9b37fc0454c5dd0d4d5a22f48cc0 | 282dab87c7bb77e42f5d40fba38148e6796f5f87 | refs/heads/master | 2023-04-20T18:02:16.908745 | 2021-05-06T23:47:12 | 2021-05-06T23:47:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 922 | cpp | #include"MQTT.h"
WiFiClient client;
// Create mqtt port (client might be a wifi or gprs client)
PubSubClient mqtt(client);
void MQTT_setup(){
mqtt.setServer(BROKER, MQTT_PORT);
//mqtt.setCallback(MQTT_callback);
}
void MQTT_connect(){
while (!mqtt.connected()) {
if(mqtt.connect(MQTT_ID, MQTT_USER, MQTT_PASSWORD ))return;
else{
delay(500);
}
}
}
void MQTT_subscribe(){
mqtt.subscribe(TOPIC);
}
// Use this function in case the module is expected to receive data
// as well as send it. In such case, depending on the topic,
// you can do whatever you want.
void MQTT_callback(char* topic, byte* message, unsigned int len){
String recieved_msg = "";
for (int i = 0; i < len; i++) {
recieved_msg += (char)message[i];
}
}
void send_data(const char* buffer){
mqtt.publish(TOPIC, buffer); // Publish the data
mqtt.loop();
}
bool mqtt_state(){
return mqtt.connected();
}
| [
"radhisghaier33@gmail.com"
] | radhisghaier33@gmail.com |
1912ff9085acbf29242f26888b81d883a9fda5f1 | 150ce3406aee410b19cbda38ea9569b28ecfc6e9 | /replaceSpaces.cpp | 89cf194279c5980fc378deefd2d7596f42180412 | [] | no_license | ivamshky/CrackingCodingInterview-Practice | cc2c8e2f9ae8333660fa74fc8fd4bdedd845a485 | 8ad4e5880eec281a68929e479131c9983523ceb6 | refs/heads/master | 2021-08-07T03:03:39.570333 | 2017-11-07T11:02:07 | 2017-11-07T11:02:07 | 109,590,149 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 827 | cpp | #include <bits/stdc++.h>
using namespace std;
void replaceSpaces(char str[], int len){
int spaceCount = 0, newLen;
for(int i=0; i<len; ++i){
if(str[i]==' ')
spaceCount++;
}
newLen = len + 2*spaceCount;
str[newLen] = '\0';
newLen--;
// cout<<str<<endl;
for(int i = len-1; i>=0; --i){
if(str[i]!=' '){
str[newLen--] = str[i];
}
else{
str[newLen--] = '0';
str[newLen--] = '2';
str[newLen--] = '%';
}
}
// return str;
}
int main(){
string s;
getline(cin, s);
char str[s.length()+1];
strcpy (str, s.c_str());
cout<<str<<endl;
replaceSpaces(str, sizeof(str)/sizeof(char));
cout<<str<<endl;
return 0;
} | [
"ivamshky1117@gmail.com"
] | ivamshky1117@gmail.com |
d6c7a57edf11e7d8ce6849f0672f3f4b86080518 | 987924ee7a7a106083172378d1110e32f3260bec | /src/imputation/guide_opencl.cpp | 51c4c0bcba76a9e8eedf8fdee6ef972c0c12b61f | [] | no_license | gchen98/mendel-gpu | e8ef9c4387df4611ae72941ffd96559857cf333d | 2e6ac8afa3a0ca40c38925da561977f0bb1e7725 | HEAD | 2016-09-05T13:50:10.365078 | 2015-06-02T13:33:27 | 2015-06-02T13:33:27 | 32,549,440 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,318 | cpp | #include"../cl_constants.h"
#include"../io_manager.hpp"
#include"../mendel_gpu.hpp"
#ifdef USE_GPU
#include"../cl_templates.hpp"
#endif
void GuidedMendelGPU::prep_impute_genotypes_guide_opencl(){
if (run_gpu){
#ifdef USE_GPU
writeToBuffer(buffer_haplotypes, 1, &g_haplotypes, "buffer_haplotypes" );
writeToBuffer(buffer_extended_haplotypes, 1, &extended_haplotypes, "buffer_extended_haplotypes" );
writeToBuffer(buffer_extended_root_mapping, ref_haplotypes, extended_root_mapping, "buffer_extended_root_mapping" );
writeToBuffer(buffer_extended_frequency, ref_haplotypes, extended_frequency, "buffer_extended_frequency" );
#endif
}
}
void GuidedMendelGPU::impute_genotypes_guide_opencl(){
int c_snp_offset = g_center_snp_start;
int c_snp_start = g_center_snp_start - g_left_marker;
int c_snp_end = c_snp_start+g_flanking_snps;
bool debug_geno = false;
bool debug_dosage = c_snp_start==-50;
bool debug_posterior = false;
bool debug_pen = false;
cerr<<"Imputing from "<<c_snp_start<<" to "<<(c_snp_end-1)<<" with offset "<<c_snp_offset<<endl;
int max_geno = g_genotype_imputation?3:4;
if (run_gpu){
#ifdef USE_GPU
double start = clock();
int last_site = c_snp_end-c_snp_start;
writeToBuffer(buffer_center_snp_end, 1, &last_site, "buffer_center_snp_end" );
writeToBuffer(buffer_packedextendedhap, ref_haplotypes*packedextendedhap_len, packedextendedhap, "buffer_packedextendehap");
cerr<<"Launching impute geno with max site "<<last_site<<endl;
runKernel("kernel_impute_genotype_guide",kernel_impute_genotype_guide,g_people*BLOCK_WIDTH_IMPUTE_GUIDE,last_site,1,BLOCK_WIDTH_IMPUTE_GUIDE,1,1);
// READ GENOTYPE POSTERIORS
float subject_posterior_prob_block[g_people * g_flanking_snps * 4];
readFromBuffer(buffer_subject_posterior_prob_block, g_people*g_flanking_snps*4,subject_posterior_prob_block,"buffer_subject_posterior_prob_block");
int subject_geno_block[g_people*g_flanking_snps];
readFromBuffer(buffer_subject_genotype_block, g_people*g_flanking_snps,subject_geno_block,"buffer_subject_genotype_block");
float subject_dosage_block[g_people*g_flanking_snps];
readFromBuffer(buffer_subject_dosage_block, g_people*g_flanking_snps,subject_dosage_block,"buffer_subject_dosage_block");
for(int j=g_center_snp_start;j<=g_center_snp_end;++j){
int col = j-g_center_snp_start;
float posteriors[g_people*max_geno];
int genotypes[g_people];
float dosages[g_people];
for(int i=0;i<g_people;++i){
if (debug_posterior) cout<<"GPU_POSTERIOR:\t"<<j<<"\t"<<i;
for(int k=0;k<max_geno;++k){
posteriors[i*max_geno+k] =
subject_posterior_prob_block[i*g_flanking_snps*4+col*4+k];
if (debug_posterior) cout<<"\t"<<posteriors[i*max_geno+k];
}
if (debug_posterior) cout<<endl;
genotypes[i] = subject_geno_block[i*g_flanking_snps+col];
dosages[i] = subject_dosage_block[i*g_flanking_snps+col];
}
io_manager->writePosterior(max_geno,j,posteriors,g_people);
io_manager->writeGenotype(j,genotypes,g_people);
if (g_genotype_imputation){
io_manager->writeDosage(j,dosages,g_people);
float rsq = compute_rsq(dosages,1,0);
io_manager->writeQuality(j,rsq);
}
}
#endif
}
}
| [
"gchen98@gmail.com@7eb4e3fc-0c4b-6441-56c4-373da399108a"
] | gchen98@gmail.com@7eb4e3fc-0c4b-6441-56c4-373da399108a |
30c4268760355bfcae0e84733c9a2dea455a17f4 | 1b76e4a5a4006cfef120bee9c5abce865eb3cc8a | /src/mgl/clipper.cc | 8ba2dcff1360d9a31c76385a60f42eca5aae0f68 | [
"Apache-2.0"
] | permissive | hugomatic/extrudo | 70ef66a2756e4ecaa737fd90f0e81ceaea9f7b8b | fd9f14d5e7c6869f9e7e7f09787353b655f90f72 | refs/heads/master | 2016-09-05T14:21:47.770688 | 2015-05-21T17:38:12 | 2015-05-21T17:38:12 | 27,986,856 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 102,582 | cc | /*******************************************************************************
* *
* Author : Angus Johnson *
* Version : 4.7.4 *
* Date : 15 March 2012 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2012 *
* *
* License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. *
* http://www.boost.org/LICENSE_1_0.txt *
* *
* Attributions: *
* The code in this library is an extension of Bala Vatti's clipping algorithm: *
* "A generic solution to polygon clipping" *
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
* http://portal.acm.org/citation.cfm?id=129906 *
* *
* Computer graphics and geometric modeling: implementation and algorithms *
* By Max K. Agoston *
* Springer; 1 edition (January 4, 2005) *
* http://books.google.com/books?q=vatti+clipping+agoston *
* *
* See also: *
* "Polygon Offsetting by Computing Winding Numbers" *
* Paper no. DETC2005-85513 pp. 565-575 *
* ASME 2005 International Design Engineering Technical Conferences *
* and Computers and Information in Engineering Conference (IDETC/CIE2005) *
* September 24�28, 2005 , Long Beach, California, USA *
* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
* *
*******************************************************************************/
/*******************************************************************************
* *
* This is a translation of the Delphi Clipper library and the naming style *
* used has retained a Delphi flavour. *
* *
*******************************************************************************/
#include "clipper.h"
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <cstring>
#include <cstdlib>
#include <ostream>
namespace ClipperLib {
static long64 const loRange = 1518500249; //sqrt(2^63 -1)/2
static long64 const hiRange = 6521908912666391106LL; //sqrt(2^127 -1)/2
static double const pi = 3.141592653589793238;
enum Direction { dRightToLeft, dLeftToRight };
enum RangeTest { rtLo, rtHi, rtError };
#define HORIZONTAL (-1.0E+40)
#define TOLERANCE (1.0e-20)
#define NEAR_ZERO(val) (((val) > -TOLERANCE) && ((val) < TOLERANCE))
#define NEAR_EQUAL(a, b) NEAR_ZERO((a) - (b))
inline long64 Abs(long64 val)
{
if (val < 0) return -val; else return val;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Int128 class (enables safe math on signed 64bit integers)
// eg Int128 val1((long64)9223372036854775807); //ie 2^63 -1
// Int128 val2((long64)9223372036854775807);
// Int128 val3 = val1 * val2;
// val3.AsString => "85070591730234615847396907784232501249" (8.5e+37)
//------------------------------------------------------------------------------
class Int128
{
public:
Int128(long64 _lo = 0)
{
hi = 0;
if (_lo < 0) {
lo = -_lo;
Negate(*this);
} else
lo = _lo;
}
Int128(const Int128 &val): hi(val.hi), lo(val.lo){}
long64 operator = (const long64 &val)
{
hi = 0;
lo = Abs(val);
if (val < 0) Negate(*this);
return val;
}
bool operator == (const Int128 &val) const
{return (hi == val.hi && lo == val.lo);}
bool operator != (const Int128 &val) const { return !(*this == val);}
bool operator > (const Int128 &val) const
{
if (hi > val.hi) return true;
else if (hi < val.hi) return false;
else return ulong64(lo) > ulong64(val.lo);
}
bool operator < (const Int128 &val) const
{
if (hi < val.hi) return true;
else if (hi > val.hi) return false;
else return ulong64(lo) < ulong64(val.lo);
}
Int128& operator += (const Int128 &rhs)
{
hi += rhs.hi;
lo += rhs.lo;
if (ulong64(lo) < ulong64(rhs.lo)) hi++;
return *this;
}
Int128 operator + (const Int128 &rhs) const
{
Int128 result(*this);
result+= rhs;
return result;
}
Int128& operator -= (const Int128 &rhs)
{
Int128 tmp(rhs);
Negate(tmp);
*this += tmp;
return *this;
}
Int128 operator - (const Int128 &rhs) const
{
Int128 result(*this);
result-= rhs;
return result;
}
Int128 operator * (const Int128 &rhs) const {
if ( !(hi == 0 || hi == -1) || !(rhs.hi == 0 || rhs.hi == -1))
throw "Int128 operator*: overflow error";
bool negate = (hi < 0) != (rhs.hi < 0);
Int128 tmp(*this);
if (tmp.hi < 0) Negate(tmp);
ulong64 int1Hi = ulong64(tmp.lo) >> 32;
ulong64 int1Lo = ulong64(tmp.lo & 0xFFFFFFFF);
tmp = rhs;
if (tmp.hi < 0) Negate(tmp);
ulong64 int2Hi = ulong64(tmp.lo) >> 32;
ulong64 int2Lo = ulong64(tmp.lo & 0xFFFFFFFF);
//nb: see comments in clipper.pas
ulong64 a = int1Hi * int2Hi;
ulong64 b = int1Lo * int2Lo;
ulong64 c = int1Hi * int2Lo + int1Lo * int2Hi;
tmp.hi = long64(a + (c >> 32));
tmp.lo = long64(c << 32);
tmp.lo += long64(b);
if (ulong64(tmp.lo) < b) tmp.hi++;
if (negate) Negate(tmp);
return tmp;
}
Int128 operator/ (const Int128 &rhs) const
{
if (rhs.lo == 0 && rhs.hi == 0)
throw "Int128 operator/: divide by zero";
bool negate = (rhs.hi < 0) != (hi < 0);
Int128 result(*this), denom(rhs);
if (result.hi < 0) Negate(result);
if (denom.hi < 0) Negate(denom);
if (denom > result) return Int128(0); //result is only a fraction of 1
Negate(denom);
Int128 p(0);
for (int i = 0; i < 128; ++i)
{
p.hi = p.hi << 1;
if (p.lo < 0) p.hi++;
p.lo = long64(p.lo) << 1;
if (result.hi < 0) p.lo++;
result.hi = result.hi << 1;
if (result.lo < 0) result.hi++;
result.lo = long64(result.lo) << 1;
Int128 p2(p);
p += denom;
if (p.hi < 0) p = p2;
else result.lo++;
}
if (negate) Negate(result);
return result;
}
double AsDouble() const
{
const double shift64 = 18446744073709551616.0; //2^64
const double bit64 = 9223372036854775808.0;
if (hi < 0)
{
Int128 tmp(*this);
Negate(tmp);
if (tmp.lo < 0)
return (double)tmp.lo - bit64 - tmp.hi * shift64;
else
return -(double)tmp.lo - tmp.hi * shift64;
}
else if (lo < 0)
return -(double)lo + bit64 + hi * shift64;
else
return (double)lo + (double)hi * shift64;
}
//for bug testing ...
std::string AsString() const
{
std::string result;
unsigned char r = 0;
Int128 tmp(0), val(*this);
if (hi < 0) Negate(val);
result.resize(50);
std::string::size_type i = result.size() -1;
while (val.hi != 0 || val.lo != 0)
{
Div10(val, tmp, r);
result[i--] = char('0' + r);
val = tmp;
}
if (hi < 0) result[i--] = '-';
result.erase(0,i+1);
if (result.size() == 0) result = "0";
return result;
}
private:
long64 hi;
long64 lo;
static void Negate(Int128 &val)
{
if (val.lo == 0)
{
if( val.hi == 0) return;
val.lo = ~val.lo;
val.hi = ~val.hi +1;
}
else
{
val.lo = ~val.lo +1;
val.hi = ~val.hi;
}
}
//debugging only ...
void Div10(const Int128 val, Int128& result, unsigned char & remainder) const
{
remainder = 0;
result = 0;
for (int i = 63; i >= 0; --i)
{
if ((val.hi & ((long64)1 << i)) != 0)
remainder = char((remainder * 2) + 1); else
remainder *= char(2);
if (remainder >= 10)
{
result.hi += ((long64)1 << i);
remainder -= char(10);
}
}
for (int i = 63; i >= 0; --i)
{
if ((val.lo & ((long64)1 << i)) != 0)
remainder = char((remainder * 2) + 1); else
remainder *= char(2);
if (remainder >= 10)
{
result.lo += ((long64)1 << i);
remainder -= char(10);
}
}
}
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
RangeTest TestRange(const Polygon &pts)
{
RangeTest result = rtLo;
for (Polygon::size_type i = 0; i < pts.size(); ++i)
{
if (Abs(pts[i].X) > hiRange || Abs(pts[i].Y) > hiRange)
return rtError;
else if (Abs(pts[i].X) > loRange || Abs(pts[i].Y) > loRange)
result = rtHi;
}
return result;
}
//------------------------------------------------------------------------------
bool Orientation(const Polygon &poly)
{
int highI = (int)poly.size() -1;
if (highI < 2) return false;
bool UseFullInt64Range = false;
int j = 0, jplus, jminus;
for (int i = 0; i <= highI; ++i)
{
if (Abs(poly[i].X) > hiRange || Abs(poly[i].Y) > hiRange)
throw "Coordinate exceeds range bounds.";
if (Abs(poly[i].X) > loRange || Abs(poly[i].Y) > loRange)
UseFullInt64Range = true;
if (poly[i].Y < poly[j].Y) continue;
if ((poly[i].Y > poly[j].Y || poly[i].X < poly[j].X)) j = i;
};
if (j == highI) jplus = 0;
else jplus = j +1;
if (j == 0) jminus = highI;
else jminus = j -1;
IntPoint vec1, vec2;
//get cross product of vectors of the edges adjacent to highest point ...
vec1.X = poly[j].X - poly[jminus].X;
vec1.Y = poly[j].Y - poly[jminus].Y;
vec2.X = poly[jplus].X - poly[j].X;
vec2.Y = poly[jplus].Y - poly[j].Y;
if (UseFullInt64Range)
{
Int128 cross = Int128(vec1.X) * Int128(vec2.Y) -
Int128(vec2.X) * Int128(vec1.Y);
return cross > 0;
}
else
{
return (vec1.X * vec2.Y - vec2.X * vec1.Y) > 0;
}
}
//------------------------------------------------------------------------------
inline bool PointsEqual( const IntPoint &pt1, const IntPoint &pt2)
{
return ( pt1.X == pt2.X && pt1.Y == pt2.Y );
}
//------------------------------------------------------------------------------
bool Orientation(OutRec *outRec, bool UseFullInt64Range)
{
//first make sure bottomPt is correctly assigned ...
OutPt *opBottom = outRec->pts, *op = outRec->pts->next;
while (op != outRec->pts)
{
if (op->pt.Y >= opBottom->pt.Y)
{
if (op->pt.Y > opBottom->pt.Y || op->pt.X < opBottom->pt.X)
opBottom = op;
}
op = op->next;
}
outRec->bottomPt = opBottom;
opBottom->idx = outRec->idx;
op = opBottom;
//find vertices either side of bottomPt (skipping duplicate points) ....
OutPt *opPrev = op->prev;
OutPt *opNext = op->next;
while (op != opPrev && PointsEqual(op->pt, opPrev->pt))
opPrev = opPrev->prev;
while (op != opNext && PointsEqual(op->pt, opNext->pt))
opNext = opNext->next;
IntPoint ip1, ip2;
ip1.X = op->pt.X - opPrev->pt.X;
ip1.Y = op->pt.Y - opPrev->pt.Y;
ip2.X = opNext->pt.X - op->pt.X;
ip2.Y = opNext->pt.Y - op->pt.Y;
if (UseFullInt64Range)
return Int128(ip1.X) * Int128(ip2.Y) - Int128(ip2.X) * Int128(ip1.Y) > 0;
else
return (ip1.X * ip2.Y - ip2.X * ip1.Y) > 0;
}
//------------------------------------------------------------------------------
double Area(const Polygon &poly)
{
int highI = (int)poly.size() -1;
if (highI < 2) return 0;
bool UseFullInt64Range;
RangeTest rt = TestRange(poly);
switch (rt) {
case rtLo:
UseFullInt64Range = false;
break;
case rtHi:
UseFullInt64Range = true;
break;
default:
throw "Coordinate exceeds range bounds.";
}
if (UseFullInt64Range) {
Int128 a(0);
a = (Int128(poly[highI].X) * Int128(poly[0].Y)) -
Int128(poly[0].X) * Int128(poly[highI].Y);
for (int i = 0; i < highI; ++i)
a += Int128(poly[i].X) * Int128(poly[i+1].Y) -
Int128(poly[i+1].X) * Int128(poly[i].Y);
return a.AsDouble() / 2;
}
else
{
double a;
a = (double)poly[highI].X * poly[0].Y - (double)poly[0].X * poly[highI].Y;
for (int i = 0; i < highI; ++i)
a += (double)poly[i].X * poly[i+1].Y - (double)poly[i+1].X * poly[i].Y;
return a/2;
}
}
//------------------------------------------------------------------------------
bool PointIsVertex(const IntPoint &pt, OutPt *pp)
{
OutPt *pp2 = pp;
do
{
if (PointsEqual(pp2->pt, pt)) return true;
pp2 = pp2->next;
}
while (pp2 != pp);
return false;
}
//------------------------------------------------------------------------------
bool PointInPolygon(const IntPoint &pt, OutPt *pp, bool UseFullInt64Range)
{
OutPt *pp2 = pp;
bool result = false;
if (UseFullInt64Range) {
do
{
if ((((pp2->pt.Y <= pt.Y) && (pt.Y < pp2->prev->pt.Y)) ||
((pp2->prev->pt.Y <= pt.Y) && (pt.Y < pp2->pt.Y))) &&
Int128(pt.X - pp2->pt.X) < (Int128(pp2->prev->pt.X - pp2->pt.X) *
Int128(pt.Y - pp2->pt.Y)) / Int128(pp2->prev->pt.Y - pp2->pt.Y))
result = !result;
pp2 = pp2->next;
}
while (pp2 != pp);
}
else
{
do
{
if ((((pp2->pt.Y <= pt.Y) && (pt.Y < pp2->prev->pt.Y)) ||
((pp2->prev->pt.Y <= pt.Y) && (pt.Y < pp2->pt.Y))) &&
(pt.X < (pp2->prev->pt.X - pp2->pt.X) * (pt.Y - pp2->pt.Y) /
(pp2->prev->pt.Y - pp2->pt.Y) + pp2->pt.X )) result = !result;
pp2 = pp2->next;
}
while (pp2 != pp);
}
return result;
}
//------------------------------------------------------------------------------
bool SlopesEqual(TEdge &e1, TEdge &e2, bool UseFullInt64Range)
{
if (UseFullInt64Range)
return Int128(e1.ytop - e1.ybot) * Int128(e2.xtop - e2.xbot) ==
Int128(e1.xtop - e1.xbot) * Int128(e2.ytop - e2.ybot);
else return (e1.ytop - e1.ybot)*(e2.xtop - e2.xbot) ==
(e1.xtop - e1.xbot)*(e2.ytop - e2.ybot);
}
//------------------------------------------------------------------------------
bool SlopesEqual(const IntPoint pt1, const IntPoint pt2,
const IntPoint pt3, bool UseFullInt64Range)
{
if (UseFullInt64Range)
return Int128(pt1.Y-pt2.Y) * Int128(pt2.X-pt3.X) ==
Int128(pt1.X-pt2.X) * Int128(pt2.Y-pt3.Y);
else return (pt1.Y-pt2.Y)*(pt2.X-pt3.X) == (pt1.X-pt2.X)*(pt2.Y-pt3.Y);
}
//------------------------------------------------------------------------------
bool SlopesEqual(const IntPoint pt1, const IntPoint pt2,
const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range)
{
if (UseFullInt64Range)
return Int128(pt1.Y-pt2.Y) * Int128(pt3.X-pt4.X) ==
Int128(pt1.X-pt2.X) * Int128(pt3.Y-pt4.Y);
else return (pt1.Y-pt2.Y)*(pt3.X-pt4.X) == (pt1.X-pt2.X)*(pt3.Y-pt4.Y);
}
//------------------------------------------------------------------------------
double GetDx(const IntPoint pt1, const IntPoint pt2)
{
if (pt1.Y == pt2.Y) return HORIZONTAL;
else return
(double)(pt2.X - pt1.X) / (double)(pt2.Y - pt1.Y);
}
//---------------------------------------------------------------------------
void SetDx(TEdge &e)
{
if (e.ybot == e.ytop) e.dx = HORIZONTAL;
else e.dx =
(double)(e.xtop - e.xbot) / (double)(e.ytop - e.ybot);
}
//---------------------------------------------------------------------------
void SwapSides(TEdge &edge1, TEdge &edge2)
{
EdgeSide side = edge1.side;
edge1.side = edge2.side;
edge2.side = side;
}
//------------------------------------------------------------------------------
void SwapPolyIndexes(TEdge &edge1, TEdge &edge2)
{
int outIdx = edge1.outIdx;
edge1.outIdx = edge2.outIdx;
edge2.outIdx = outIdx;
}
//------------------------------------------------------------------------------
inline long64 Round(double val)
{
if ((val < 0)) return static_cast<long64>(val - 0.5);
else return static_cast<long64>(val + 0.5);
}
//------------------------------------------------------------------------------
long64 TopX(TEdge &edge, const long64 currentY)
{
if( currentY == edge.ytop ) return edge.xtop;
return edge.xbot + Round(edge.dx *(currentY - edge.ybot));
}
//------------------------------------------------------------------------------
long64 TopX(const IntPoint pt1, const IntPoint pt2, const long64 currentY)
{
//preconditions: pt1.Y <> pt2.Y and pt1.Y > pt2.Y
if (currentY >= pt1.Y) return pt1.X;
else if (currentY == pt2.Y) return pt2.X;
else if (pt1.X == pt2.X) return pt1.X;
else
{
double q = (double)(pt1.X-pt2.X)/(double)(pt1.Y-pt2.Y);
return Round(pt1.X + (currentY - pt1.Y) *q);
}
}
//------------------------------------------------------------------------------
bool IntersectPoint(TEdge &edge1, TEdge &edge2,
IntPoint &ip, bool UseFullInt64Range)
{
double b1, b2;
if (SlopesEqual(edge1, edge2, UseFullInt64Range)) return false;
else if (NEAR_ZERO(edge1.dx))
{
ip.X = edge1.xbot;
if (NEAR_EQUAL(edge2.dx, HORIZONTAL))
{
ip.Y = edge2.ybot;
} else
{
b2 = edge2.ybot - (edge2.xbot/edge2.dx);
ip.Y = Round(ip.X/edge2.dx + b2);
}
}
else if (NEAR_ZERO(edge2.dx))
{
ip.X = edge2.xbot;
if (NEAR_EQUAL(edge1.dx, HORIZONTAL))
{
ip.Y = edge1.ybot;
} else
{
b1 = edge1.ybot - (edge1.xbot/edge1.dx);
ip.Y = Round(ip.X/edge1.dx + b1);
}
} else
{
b1 = edge1.xbot - edge1.ybot * edge1.dx;
b2 = edge2.xbot - edge2.ybot * edge2.dx;
b2 = (b2-b1)/(edge1.dx - edge2.dx);
ip.Y = Round(b2);
ip.X = Round(edge1.dx * b2 + b1);
}
return
//can be *so close* to the top of one edge that the rounded Y equals one ytop ...
(ip.Y == edge1.ytop && ip.Y >= edge2.ytop && edge1.tmpX > edge2.tmpX) ||
(ip.Y == edge2.ytop && ip.Y >= edge1.ytop && edge1.tmpX > edge2.tmpX) ||
(ip.Y > edge1.ytop && ip.Y > edge2.ytop);
}
//------------------------------------------------------------------------------
void ReversePolyPtLinks(OutPt &pp)
{
OutPt *pp1, *pp2;
pp1 = &pp;
do {
pp2 = pp1->next;
pp1->next = pp1->prev;
pp1->prev = pp2;
pp1 = pp2;
} while( pp1 != &pp );
}
//------------------------------------------------------------------------------
void DisposeOutPts(OutPt*& pp)
{
if (pp == 0) return;
pp->prev->next = 0;
while( pp )
{
OutPt *tmpPp = pp;
pp = pp->next;
delete tmpPp ;
}
}
//------------------------------------------------------------------------------
void InitEdge(TEdge *e, TEdge *eNext,
TEdge *ePrev, const IntPoint &pt, PolyType polyType)
{
std::memset( e, 0, sizeof( TEdge ));
e->next = eNext;
e->prev = ePrev;
e->xcurr = pt.X;
e->ycurr = pt.Y;
if (e->ycurr >= e->next->ycurr)
{
e->xbot = e->xcurr;
e->ybot = e->ycurr;
e->xtop = e->next->xcurr;
e->ytop = e->next->ycurr;
e->windDelta = 1;
} else
{
e->xtop = e->xcurr;
e->ytop = e->ycurr;
e->xbot = e->next->xcurr;
e->ybot = e->next->ycurr;
e->windDelta = -1;
}
SetDx(*e);
e->polyType = polyType;
e->outIdx = -1;
}
//------------------------------------------------------------------------------
inline void SwapX(TEdge &e)
{
//swap horizontal edges' top and bottom x's so they follow the natural
//progression of the bounds - ie so their xbots will align with the
//adjoining lower edge. [Helpful in the ProcessHorizontal() method.]
e.xcurr = e.xtop;
e.xtop = e.xbot;
e.xbot = e.xcurr;
}
//------------------------------------------------------------------------------
void SwapPoints(IntPoint &pt1, IntPoint &pt2)
{
IntPoint tmp = pt1;
pt1 = pt2;
pt2 = tmp;
}
//------------------------------------------------------------------------------
bool GetOverlapSegment(IntPoint pt1a, IntPoint pt1b, IntPoint pt2a,
IntPoint pt2b, IntPoint &pt1, IntPoint &pt2)
{
//precondition: segments are colinear.
if ( pt1a.Y == pt1b.Y || Abs((pt1a.X - pt1b.X)/(pt1a.Y - pt1b.Y)) > 1 )
{
if (pt1a.X > pt1b.X) SwapPoints(pt1a, pt1b);
if (pt2a.X > pt2b.X) SwapPoints(pt2a, pt2b);
if (pt1a.X > pt2a.X) pt1 = pt1a; else pt1 = pt2a;
if (pt1b.X < pt2b.X) pt2 = pt1b; else pt2 = pt2b;
return pt1.X < pt2.X;
} else
{
if (pt1a.Y < pt1b.Y) SwapPoints(pt1a, pt1b);
if (pt2a.Y < pt2b.Y) SwapPoints(pt2a, pt2b);
if (pt1a.Y < pt2a.Y) pt1 = pt1a; else pt1 = pt2a;
if (pt1b.Y > pt2b.Y) pt2 = pt1b; else pt2 = pt2b;
return pt1.Y > pt2.Y;
}
}
//------------------------------------------------------------------------------
OutPt* PolygonBottom(OutPt* pp)
{
OutPt* p = pp->next;
OutPt* result = pp;
while (p != pp)
{
if (p->pt.Y > result->pt.Y) result = p;
else if (p->pt.Y == result->pt.Y && p->pt.X < result->pt.X) result = p;
p = p->next;
}
return result;
}
//------------------------------------------------------------------------------
bool FindSegment(OutPt* &pp, IntPoint &pt1, IntPoint &pt2)
{
//outPt1 & outPt2 => the overlap segment (if the function returns true)
if (!pp) return false;
OutPt* pp2 = pp;
IntPoint pt1a = pt1, pt2a = pt2;
do
{
if (SlopesEqual(pt1a, pt2a, pp->pt, pp->prev->pt, true) &&
SlopesEqual(pt1a, pt2a, pp->pt, true) &&
GetOverlapSegment(pt1a, pt2a, pp->pt, pp->prev->pt, pt1, pt2))
return true;
pp = pp->next;
}
while (pp != pp2);
return false;
}
//------------------------------------------------------------------------------
bool Pt3IsBetweenPt1AndPt2(const IntPoint pt1,
const IntPoint pt2, const IntPoint pt3)
{
if (PointsEqual(pt1, pt3) || PointsEqual(pt2, pt3)) return true;
else if (pt1.X != pt2.X) return (pt1.X < pt3.X) == (pt3.X < pt2.X);
else return (pt1.Y < pt3.Y) == (pt3.Y < pt2.Y);
}
//------------------------------------------------------------------------------
OutPt* InsertPolyPtBetween(OutPt* p1, OutPt* p2, const IntPoint pt)
{
if (p1 == p2) throw "JoinError";
OutPt* result = new OutPt;
result->pt = pt;
if (p2 == p1->next)
{
p1->next = result;
p2->prev = result;
result->next = p2;
result->prev = p1;
} else
{
p2->next = result;
p1->prev = result;
result->next = p1;
result->prev = p2;
}
return result;
}
//------------------------------------------------------------------------------
// ClipperBase class methods ...
//------------------------------------------------------------------------------
ClipperBase::ClipperBase() //constructor
{
m_MinimaList = 0;
m_CurrentLM = 0;
m_UseFullRange = true;
}
//------------------------------------------------------------------------------
ClipperBase::~ClipperBase() //destructor
{
Clear();
}
//------------------------------------------------------------------------------
bool ClipperBase::AddPolygon( const Polygon &pg, PolyType polyType)
{
int len = (int)pg.size();
if (len < 3) return false;
Polygon p(len);
p[0] = pg[0];
int j = 0;
long64 maxVal;
if (m_UseFullRange) maxVal = hiRange; else maxVal = loRange;
for (int i = 0; i < len; ++i)
{
if (Abs(pg[i].X) > maxVal || Abs(pg[i].Y) > maxVal)
{
if (m_UseFullRange)
throw "Coordinate exceeds range bounds";
maxVal = hiRange;
if (Abs(pg[i].X) > maxVal || Abs(pg[i].Y) > maxVal)
throw "Coordinate exceeds range bounds";
m_UseFullRange = true;
}
if (i == 0 || PointsEqual(p[j], pg[i])) continue;
else if (j > 0 && SlopesEqual(p[j-1], p[j], pg[i], m_UseFullRange))
{
if (PointsEqual(p[j-1], pg[i])) j--;
} else j++;
p[j] = pg[i];
}
if (j < 2) return false;
len = j+1;
for (;;)
{
//nb: test for point equality before testing slopes ...
if (PointsEqual(p[j], p[0])) j--;
else if (PointsEqual(p[0], p[1]) ||
SlopesEqual(p[j], p[0], p[1], m_UseFullRange))
p[0] = p[j--];
else if (SlopesEqual(p[j-1], p[j], p[0], m_UseFullRange)) j--;
else if (SlopesEqual(p[0], p[1], p[2], m_UseFullRange))
{
for (int i = 2; i <= j; ++i) p[i-1] = p[i];
j--;
}
//exit loop if nothing is changed or there are too few vertices ...
if (j == len-1 || j < 2) break;
len = j +1;
}
if (len < 3) return false;
//create a new edge array ...
TEdge *edges = new TEdge [len];
m_edges.push_back(edges);
//convert vertices to a double-linked-list of edges and initialize ...
edges[0].xcurr = p[0].X;
edges[0].ycurr = p[0].Y;
InitEdge(&edges[len-1], &edges[0], &edges[len-2], p[len-1], polyType);
for (int i = len-2; i > 0; --i)
InitEdge(&edges[i], &edges[i+1], &edges[i-1], p[i], polyType);
InitEdge(&edges[0], &edges[1], &edges[len-1], p[0], polyType);
//reset xcurr & ycurr and find 'eHighest' (given the Y axis coordinates
//increase downward so the 'highest' edge will have the smallest ytop) ...
TEdge *e = &edges[0];
TEdge *eHighest = e;
do
{
e->xcurr = e->xbot;
e->ycurr = e->ybot;
if (e->ytop < eHighest->ytop) eHighest = e;
e = e->next;
}
while ( e != &edges[0]);
//make sure eHighest is positioned so the following loop works safely ...
if (eHighest->windDelta > 0) eHighest = eHighest->next;
if (NEAR_EQUAL(eHighest->dx, HORIZONTAL)) eHighest = eHighest->next;
//finally insert each local minima ...
e = eHighest;
do {
e = AddBoundsToLML(e);
}
while( e != eHighest );
return true;
}
//------------------------------------------------------------------------------
void ClipperBase::InsertLocalMinima(LocalMinima *newLm)
{
if( ! m_MinimaList )
{
m_MinimaList = newLm;
}
else if( newLm->Y >= m_MinimaList->Y )
{
newLm->next = m_MinimaList;
m_MinimaList = newLm;
} else
{
LocalMinima* tmpLm = m_MinimaList;
while( tmpLm->next && ( newLm->Y < tmpLm->next->Y ) )
tmpLm = tmpLm->next;
newLm->next = tmpLm->next;
tmpLm->next = newLm;
}
}
//------------------------------------------------------------------------------
TEdge* ClipperBase::AddBoundsToLML(TEdge *e)
{
//Starting at the top of one bound we progress to the bottom where there's
//a local minima. We then go to the top of the next bound. These two bounds
//form the left and right (or right and left) bounds of the local minima.
e->nextInLML = 0;
e = e->next;
for (;;)
{
if (NEAR_EQUAL(e->dx, HORIZONTAL))
{
//nb: proceed through horizontals when approaching from their right,
// but break on horizontal minima if approaching from their left.
// This ensures 'local minima' are always on the left of horizontals.
if (e->next->ytop < e->ytop && e->next->xbot > e->prev->xbot) break;
if (e->xtop != e->prev->xbot) SwapX(*e);
e->nextInLML = e->prev;
}
else if (e->ycurr == e->prev->ycurr) break;
else e->nextInLML = e->prev;
e = e->next;
}
//e and e.prev are now at a local minima ...
LocalMinima* newLm = new LocalMinima;
newLm->next = 0;
newLm->Y = e->prev->ybot;
if ( NEAR_EQUAL(e->dx, HORIZONTAL) ) //horizontal edges never start a left bound
{
if (e->xbot != e->prev->xbot) SwapX(*e);
newLm->leftBound = e->prev;
newLm->rightBound = e;
} else if (e->dx < e->prev->dx)
{
newLm->leftBound = e->prev;
newLm->rightBound = e;
} else
{
newLm->leftBound = e;
newLm->rightBound = e->prev;
}
newLm->leftBound->side = esLeft;
newLm->rightBound->side = esRight;
InsertLocalMinima( newLm );
for (;;)
{
if ( e->next->ytop == e->ytop && !NEAR_EQUAL(e->next->dx, HORIZONTAL) ) break;
e->nextInLML = e->next;
e = e->next;
if ( NEAR_EQUAL(e->dx, HORIZONTAL) && e->xbot != e->prev->xtop) SwapX(*e);
}
return e->next;
}
//------------------------------------------------------------------------------
bool ClipperBase::AddPolygons(const Polygons &ppg, PolyType polyType)
{
bool result = true;
for (Polygons::size_type i = 0; i < ppg.size(); ++i)
if (AddPolygon(ppg[i], polyType)) result = false;
return result;
}
//------------------------------------------------------------------------------
void ClipperBase::Clear()
{
DisposeLocalMinimaList();
for (EdgeList::size_type i = 0; i < m_edges.size(); ++i) delete [] m_edges[i];
m_edges.clear();
m_UseFullRange = false;
}
//------------------------------------------------------------------------------
void ClipperBase::Reset()
{
m_CurrentLM = m_MinimaList;
if( !m_CurrentLM ) return; //ie nothing to process
//reset all edges ...
LocalMinima* lm = m_MinimaList;
while( lm )
{
TEdge* e = lm->leftBound;
while( e )
{
e->xcurr = e->xbot;
e->ycurr = e->ybot;
e->side = esLeft;
e->outIdx = -1;
e = e->nextInLML;
}
e = lm->rightBound;
while( e )
{
e->xcurr = e->xbot;
e->ycurr = e->ybot;
e->side = esRight;
e->outIdx = -1;
e = e->nextInLML;
}
lm = lm->next;
}
}
//------------------------------------------------------------------------------
void ClipperBase::DisposeLocalMinimaList()
{
while( m_MinimaList )
{
LocalMinima* tmpLm = m_MinimaList->next;
delete m_MinimaList;
m_MinimaList = tmpLm;
}
m_CurrentLM = 0;
}
//------------------------------------------------------------------------------
void ClipperBase::PopLocalMinima()
{
if( ! m_CurrentLM ) return;
m_CurrentLM = m_CurrentLM->next;
}
//------------------------------------------------------------------------------
IntRect ClipperBase::GetBounds()
{
IntRect result;
LocalMinima* lm = m_MinimaList;
if (!lm)
{
result.left = result.top = result.right = result.bottom = 0;
return result;
}
result.left = lm->leftBound->xbot;
result.top = lm->leftBound->ybot;
result.right = lm->leftBound->xbot;
result.bottom = lm->leftBound->ybot;
while (lm)
{
if (lm->leftBound->ybot > result.bottom)
result.bottom = lm->leftBound->ybot;
TEdge* e = lm->leftBound;
for (;;) {
TEdge* bottomE = e;
while (e->nextInLML)
{
if (e->xbot < result.left) result.left = e->xbot;
if (e->xbot > result.right) result.right = e->xbot;
e = e->nextInLML;
}
if (e->xbot < result.left) result.left = e->xbot;
if (e->xbot > result.right) result.right = e->xbot;
if (e->xtop < result.left) result.left = e->xtop;
if (e->xtop > result.right) result.right = e->xtop;
if (e->ytop < result.top) result.top = e->ytop;
if (bottomE == lm->leftBound) e = lm->rightBound;
else break;
}
lm = lm->next;
}
return result;
}
//------------------------------------------------------------------------------
// TClipper methods ...
//------------------------------------------------------------------------------
Clipper::Clipper() : ClipperBase() //constructor
{
m_Scanbeam = 0;
m_ActiveEdges = 0;
m_SortedEdges = 0;
m_IntersectNodes = 0;
m_ExecuteLocked = false;
m_UseFullRange = false;
m_ReverseOutput = false;
}
//------------------------------------------------------------------------------
Clipper::~Clipper() //destructor
{
Clear();
DisposeScanbeamList();
}
//------------------------------------------------------------------------------
void Clipper::Clear()
{
if (m_edges.size() == 0) return; //avoids problems with ClipperBase destructor
DisposeAllPolyPts();
ClipperBase::Clear();
}
//------------------------------------------------------------------------------
void Clipper::DisposeScanbeamList()
{
while ( m_Scanbeam ) {
Scanbeam* sb2 = m_Scanbeam->next;
delete m_Scanbeam;
m_Scanbeam = sb2;
}
}
//------------------------------------------------------------------------------
void Clipper::Reset()
{
ClipperBase::Reset();
m_Scanbeam = 0;
m_ActiveEdges = 0;
m_SortedEdges = 0;
DisposeAllPolyPts();
LocalMinima* lm = m_MinimaList;
while (lm)
{
InsertScanbeam(lm->Y);
InsertScanbeam(lm->leftBound->ytop);
lm = lm->next;
}
}
//------------------------------------------------------------------------------
bool Clipper::Execute(ClipType clipType, Polygons &solution,
PolyFillType subjFillType, PolyFillType clipFillType)
{
if( m_ExecuteLocked ) return false;
m_ExecuteLocked = true;
solution.resize(0);
m_SubjFillType = subjFillType;
m_ClipFillType = clipFillType;
m_ClipType = clipType;
bool succeeded = ExecuteInternal(false);
if (succeeded) BuildResult(solution);
m_ExecuteLocked = false;
return succeeded;
}
//------------------------------------------------------------------------------
bool Clipper::Execute(ClipType clipType, ExPolygons &solution,
PolyFillType subjFillType, PolyFillType clipFillType)
{
if( m_ExecuteLocked ) return false;
m_ExecuteLocked = true;
solution.resize(0);
m_SubjFillType = subjFillType;
m_ClipFillType = clipFillType;
m_ClipType = clipType;
bool succeeded = ExecuteInternal(true);
if (succeeded) BuildResultEx(solution);
m_ExecuteLocked = false;
return succeeded;
}
//------------------------------------------------------------------------------
bool PolySort(OutRec *or1, OutRec *or2)
{
if (or1 == or2) return false;
if (!or1->pts || !or2->pts)
{
if (or1->pts != or2->pts)
{
if (or1->pts) return true; else return false;
}
else return false;
}
int i1, i2;
if (or1->isHole)
i1 = or1->FirstLeft->idx; else
i1 = or1->idx;
if (or2->isHole)
i2 = or2->FirstLeft->idx; else
i2 = or2->idx;
int result = i1 - i2;
if (result == 0 && (or1->isHole != or2->isHole))
{
if (or1->isHole) return false;
else return true;
}
else return result < 0;
}
//------------------------------------------------------------------------------
OutRec* FindAppendLinkEnd(OutRec *outRec)
{
while (outRec->AppendLink) outRec = outRec->AppendLink;
return outRec;
}
//------------------------------------------------------------------------------
void Clipper::FixHoleLinkage(OutRec *outRec)
{
OutRec *tmp;
if (outRec->bottomPt)
tmp = m_PolyOuts[outRec->bottomPt->idx]->FirstLeft;
else
tmp = outRec->FirstLeft;
if (outRec == tmp) throw clipperException("HoleLinkage error");
if (tmp)
{
if (tmp->AppendLink) tmp = FindAppendLinkEnd(tmp);
if (tmp == outRec) tmp = 0;
else if (tmp->isHole)
{
FixHoleLinkage(tmp);
tmp = tmp->FirstLeft;
}
}
outRec->FirstLeft = tmp;
if (!tmp) outRec->isHole = false;
outRec->AppendLink = 0;
}
//------------------------------------------------------------------------------
bool Clipper::ExecuteInternal(bool fixHoleLinkages)
{
bool succeeded;
try {
Reset();
if (!m_CurrentLM ) return true;
long64 botY = PopScanbeam();
do {
InsertLocalMinimaIntoAEL(botY);
ClearHorzJoins();
ProcessHorizontals();
long64 topY = PopScanbeam();
succeeded = ProcessIntersections(botY, topY);
if (!succeeded) break;
ProcessEdgesAtTopOfScanbeam(topY);
botY = topY;
} while( m_Scanbeam );
}
catch(...) {
succeeded = false;
}
if (succeeded)
{
//tidy up output polygons and fix orientations where necessary ...
for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
{
OutRec *outRec = m_PolyOuts[i];
if (!outRec->pts) continue;
FixupOutPolygon(*outRec);
if (!outRec->pts) continue;
if (outRec->isHole && fixHoleLinkages) FixHoleLinkage(outRec);
if (outRec->isHole ==
(m_ReverseOutput ^ Orientation(outRec, m_UseFullRange)))
ReversePolyPtLinks(*outRec->pts);
}
JoinCommonEdges(fixHoleLinkages);
if (fixHoleLinkages)
std::sort(m_PolyOuts.begin(), m_PolyOuts.end(), PolySort);
}
ClearJoins();
ClearHorzJoins();
return succeeded;
}
//------------------------------------------------------------------------------
void Clipper::InsertScanbeam(const long64 Y)
{
if( !m_Scanbeam )
{
m_Scanbeam = new Scanbeam;
m_Scanbeam->next = 0;
m_Scanbeam->Y = Y;
}
else if( Y > m_Scanbeam->Y )
{
Scanbeam* newSb = new Scanbeam;
newSb->Y = Y;
newSb->next = m_Scanbeam;
m_Scanbeam = newSb;
} else
{
Scanbeam* sb2 = m_Scanbeam;
while( sb2->next && ( Y <= sb2->next->Y ) ) sb2 = sb2->next;
if( Y == sb2->Y ) return; //ie ignores duplicates
Scanbeam* newSb = new Scanbeam;
newSb->Y = Y;
newSb->next = sb2->next;
sb2->next = newSb;
}
}
//------------------------------------------------------------------------------
long64 Clipper::PopScanbeam()
{
long64 Y = m_Scanbeam->Y;
Scanbeam* sb2 = m_Scanbeam;
m_Scanbeam = m_Scanbeam->next;
delete sb2;
return Y;
}
//------------------------------------------------------------------------------
void Clipper::DisposeAllPolyPts(){
for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
DisposeOutRec(i);
m_PolyOuts.clear();
}
//------------------------------------------------------------------------------
void Clipper::DisposeOutRec(PolyOutList::size_type index, bool ignorePts)
{
OutRec *outRec = m_PolyOuts[index];
if (!ignorePts && outRec->pts) DisposeOutPts(outRec->pts);
delete outRec;
m_PolyOuts[index] = 0;
}
//------------------------------------------------------------------------------
void Clipper::SetWindingCount(TEdge &edge)
{
TEdge *e = edge.prevInAEL;
//find the edge of the same polytype that immediately preceeds 'edge' in AEL
while ( e && e->polyType != edge.polyType ) e = e->prevInAEL;
if ( !e )
{
edge.windCnt = edge.windDelta;
edge.windCnt2 = 0;
e = m_ActiveEdges; //ie get ready to calc windCnt2
} else if ( IsEvenOddFillType(edge) )
{
//EvenOdd filling ...
edge.windCnt = 1;
edge.windCnt2 = e->windCnt2;
e = e->nextInAEL; //ie get ready to calc windCnt2
} else
{
//nonZero, Positive or Negative filling ...
if ( e->windCnt * e->windDelta < 0 )
{
if (Abs(e->windCnt) > 1)
{
if (e->windDelta * edge.windDelta < 0) edge.windCnt = e->windCnt;
else edge.windCnt = e->windCnt + edge.windDelta;
} else
edge.windCnt = e->windCnt + e->windDelta + edge.windDelta;
} else
{
if ( Abs(e->windCnt) > 1 && e->windDelta * edge.windDelta < 0)
edge.windCnt = e->windCnt;
else if ( e->windCnt + edge.windDelta == 0 )
edge.windCnt = e->windCnt;
else edge.windCnt = e->windCnt + edge.windDelta;
}
edge.windCnt2 = e->windCnt2;
e = e->nextInAEL; //ie get ready to calc windCnt2
}
//update windCnt2 ...
if ( IsEvenOddAltFillType(edge) )
{
//EvenOdd filling ...
while ( e != &edge )
{
edge.windCnt2 = (edge.windCnt2 == 0) ? 1 : 0;
e = e->nextInAEL;
}
} else
{
//nonZero, Positive or Negative filling ...
while ( e != &edge )
{
edge.windCnt2 += e->windDelta;
e = e->nextInAEL;
}
}
}
//------------------------------------------------------------------------------
bool Clipper::IsEvenOddFillType(const TEdge& edge) const
{
if (edge.polyType == ptSubject)
return m_SubjFillType == pftEvenOdd; else
return m_ClipFillType == pftEvenOdd;
}
//------------------------------------------------------------------------------
bool Clipper::IsEvenOddAltFillType(const TEdge& edge) const
{
if (edge.polyType == ptSubject)
return m_ClipFillType == pftEvenOdd; else
return m_SubjFillType == pftEvenOdd;
}
//------------------------------------------------------------------------------
bool Clipper::IsContributing(const TEdge& edge) const
{
PolyFillType pft, pft2;
if (edge.polyType == ptSubject)
{
pft = m_SubjFillType;
pft2 = m_ClipFillType;
} else
{
pft = m_ClipFillType;
pft2 = m_SubjFillType;
}
switch(pft)
{
case pftEvenOdd:
case pftNonZero:
if (Abs(edge.windCnt) != 1) return false;
break;
case pftPositive:
if (edge.windCnt != 1) return false;
break;
default: //pftNegative
if (edge.windCnt != -1) return false;
}
switch(m_ClipType)
{
case ctIntersection:
switch(pft2)
{
case pftEvenOdd:
case pftNonZero:
return (edge.windCnt2 != 0);
case pftPositive:
return (edge.windCnt2 > 0);
default:
return (edge.windCnt2 < 0);
}
case ctUnion:
switch(pft2)
{
case pftEvenOdd:
case pftNonZero:
return (edge.windCnt2 == 0);
case pftPositive:
return (edge.windCnt2 <= 0);
default:
return (edge.windCnt2 >= 0);
}
case ctDifference:
if (edge.polyType == ptSubject)
switch(pft2)
{
case pftEvenOdd:
case pftNonZero:
return (edge.windCnt2 == 0);
case pftPositive:
return (edge.windCnt2 <= 0);
default:
return (edge.windCnt2 >= 0);
}
else
switch(pft2)
{
case pftEvenOdd:
case pftNonZero:
return (edge.windCnt2 != 0);
case pftPositive:
return (edge.windCnt2 > 0);
default:
return (edge.windCnt2 < 0);
}
default:
return true;
}
}
//------------------------------------------------------------------------------
void Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt)
{
TEdge *e, *prevE;
if( NEAR_EQUAL(e2->dx, HORIZONTAL) || ( e1->dx > e2->dx ) )
{
AddOutPt( e1, e2, pt );
e2->outIdx = e1->outIdx;
e1->side = esLeft;
e2->side = esRight;
e = e1;
if (e->prevInAEL == e2)
prevE = e2->prevInAEL;
else
prevE = e->prevInAEL;
} else
{
AddOutPt( e2, e1, pt );
e1->outIdx = e2->outIdx;
e1->side = esRight;
e2->side = esLeft;
e = e2;
if (e->prevInAEL == e1)
prevE = e1->prevInAEL;
else
prevE = e->prevInAEL;
}
if (prevE && prevE->outIdx >= 0 &&
(TopX(*prevE, pt.Y) == TopX(*e, pt.Y)) &&
SlopesEqual(*e, *prevE, m_UseFullRange))
AddJoin(e, prevE, -1, -1);
}
//------------------------------------------------------------------------------
void Clipper::AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt)
{
AddOutPt( e1, 0, pt );
if( e1->outIdx == e2->outIdx )
{
e1->outIdx = -1;
e2->outIdx = -1;
}
else
AppendPolygon( e1, e2 );
}
//------------------------------------------------------------------------------
void Clipper::AddEdgeToSEL(TEdge *edge)
{
//SEL pointers in PEdge are reused to build a list of horizontal edges.
//However, we don't need to worry about order with horizontal edge processing.
if( !m_SortedEdges )
{
m_SortedEdges = edge;
edge->prevInSEL = 0;
edge->nextInSEL = 0;
}
else
{
edge->nextInSEL = m_SortedEdges;
edge->prevInSEL = 0;
m_SortedEdges->prevInSEL = edge;
m_SortedEdges = edge;
}
}
//------------------------------------------------------------------------------
void Clipper::CopyAELToSEL()
{
TEdge* e = m_ActiveEdges;
m_SortedEdges = e;
if (!m_ActiveEdges) return;
m_SortedEdges->prevInSEL = 0;
e = e->nextInAEL;
while ( e )
{
e->prevInSEL = e->prevInAEL;
e->prevInSEL->nextInSEL = e;
e->nextInSEL = 0;
e = e->nextInAEL;
}
}
//------------------------------------------------------------------------------
void Clipper::AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx, int e2OutIdx)
{
JoinRec* jr = new JoinRec;
if (e1OutIdx >= 0)
jr->poly1Idx = e1OutIdx; else
jr->poly1Idx = e1->outIdx;
jr->pt1a = IntPoint(e1->xcurr, e1->ycurr);
jr->pt1b = IntPoint(e1->xtop, e1->ytop);
if (e2OutIdx >= 0)
jr->poly2Idx = e2OutIdx; else
jr->poly2Idx = e2->outIdx;
jr->pt2a = IntPoint(e2->xcurr, e2->ycurr);
jr->pt2b = IntPoint(e2->xtop, e2->ytop);
m_Joins.push_back(jr);
}
//------------------------------------------------------------------------------
void Clipper::ClearJoins()
{
for (JoinList::size_type i = 0; i < m_Joins.size(); i++)
delete m_Joins[i];
m_Joins.resize(0);
}
//------------------------------------------------------------------------------
void Clipper::AddHorzJoin(TEdge *e, int idx)
{
HorzJoinRec* hj = new HorzJoinRec;
hj->edge = e;
hj->savedIdx = idx;
m_HorizJoins.push_back(hj);
}
//------------------------------------------------------------------------------
void Clipper::ClearHorzJoins()
{
for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); i++)
delete m_HorizJoins[i];
m_HorizJoins.resize(0);
}
//------------------------------------------------------------------------------
void Clipper::InsertLocalMinimaIntoAEL( const long64 botY)
{
while( m_CurrentLM && ( m_CurrentLM->Y == botY ) )
{
TEdge* lb = m_CurrentLM->leftBound;
TEdge* rb = m_CurrentLM->rightBound;
InsertEdgeIntoAEL( lb );
InsertScanbeam( lb->ytop );
InsertEdgeIntoAEL( rb );
if (IsEvenOddFillType(*lb))
{
lb->windDelta = 1;
rb->windDelta = 1;
}
else
{
rb->windDelta = -lb->windDelta;
}
SetWindingCount( *lb );
rb->windCnt = lb->windCnt;
rb->windCnt2 = lb->windCnt2;
if( NEAR_EQUAL(rb->dx, HORIZONTAL) )
{
//nb: only rightbounds can have a horizontal bottom edge
AddEdgeToSEL( rb );
InsertScanbeam( rb->nextInLML->ytop );
}
else
InsertScanbeam( rb->ytop );
if( IsContributing(*lb) )
AddLocalMinPoly( lb, rb, IntPoint(lb->xcurr, m_CurrentLM->Y) );
//if any output polygons share an edge, they'll need joining later ...
if (rb->outIdx >= 0)
{
if (NEAR_EQUAL(rb->dx, HORIZONTAL))
{
for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); ++i)
{
IntPoint pt, pt2; //returned by GetOverlapSegment() but unused here.
HorzJoinRec* hj = m_HorizJoins[i];
//if horizontals rb and hj.edge overlap, flag for joining later ...
if (GetOverlapSegment(IntPoint(hj->edge->xbot, hj->edge->ybot),
IntPoint(hj->edge->xtop, hj->edge->ytop),
IntPoint(rb->xbot, rb->ybot),
IntPoint(rb->xtop, rb->ytop), pt, pt2))
AddJoin(hj->edge, rb, hj->savedIdx);
}
}
}
if( lb->nextInAEL != rb )
{
if (rb->outIdx >= 0 && rb->prevInAEL->outIdx >= 0 &&
SlopesEqual(*rb->prevInAEL, *rb, m_UseFullRange))
AddJoin(rb, rb->prevInAEL);
TEdge* e = lb->nextInAEL;
IntPoint pt = IntPoint(lb->xcurr, lb->ycurr);
while( e != rb )
{
if(!e) throw clipperException("InsertLocalMinimaIntoAEL: missing rightbound!");
//nb: For calculating winding counts etc, IntersectEdges() assumes
//that param1 will be to the right of param2 ABOVE the intersection ...
IntersectEdges( rb , e , pt , ipNone); //order important here
e = e->nextInAEL;
}
}
PopLocalMinima();
}
}
//------------------------------------------------------------------------------
void Clipper::DeleteFromAEL(TEdge *e)
{
TEdge* AelPrev = e->prevInAEL;
TEdge* AelNext = e->nextInAEL;
if( !AelPrev && !AelNext && (e != m_ActiveEdges) ) return; //already deleted
if( AelPrev ) AelPrev->nextInAEL = AelNext;
else m_ActiveEdges = AelNext;
if( AelNext ) AelNext->prevInAEL = AelPrev;
e->nextInAEL = 0;
e->prevInAEL = 0;
}
//------------------------------------------------------------------------------
void Clipper::DeleteFromSEL(TEdge *e)
{
TEdge* SelPrev = e->prevInSEL;
TEdge* SelNext = e->nextInSEL;
if( !SelPrev && !SelNext && (e != m_SortedEdges) ) return; //already deleted
if( SelPrev ) SelPrev->nextInSEL = SelNext;
else m_SortedEdges = SelNext;
if( SelNext ) SelNext->prevInSEL = SelPrev;
e->nextInSEL = 0;
e->prevInSEL = 0;
}
//------------------------------------------------------------------------------
void Clipper::IntersectEdges(TEdge *e1, TEdge *e2,
const IntPoint &pt, IntersectProtects protects)
{
//e1 will be to the left of e2 BELOW the intersection. Therefore e1 is before
//e2 in AEL except when e1 is being inserted at the intersection point ...
bool e1stops = !(ipLeft & protects) && !e1->nextInLML &&
e1->xtop == pt.X && e1->ytop == pt.Y;
bool e2stops = !(ipRight & protects) && !e2->nextInLML &&
e2->xtop == pt.X && e2->ytop == pt.Y;
bool e1Contributing = ( e1->outIdx >= 0 );
bool e2contributing = ( e2->outIdx >= 0 );
//update winding counts...
//assumes that e1 will be to the right of e2 ABOVE the intersection
if ( e1->polyType == e2->polyType )
{
if ( IsEvenOddFillType( *e1) )
{
int oldE1WindCnt = e1->windCnt;
e1->windCnt = e2->windCnt;
e2->windCnt = oldE1WindCnt;
} else
{
if (e1->windCnt + e2->windDelta == 0 ) e1->windCnt = -e1->windCnt;
else e1->windCnt += e2->windDelta;
if ( e2->windCnt - e1->windDelta == 0 ) e2->windCnt = -e2->windCnt;
else e2->windCnt -= e1->windDelta;
}
} else
{
if (!IsEvenOddFillType(*e2)) e1->windCnt2 += e2->windDelta;
else e1->windCnt2 = ( e1->windCnt2 == 0 ) ? 1 : 0;
if (!IsEvenOddFillType(*e1)) e2->windCnt2 -= e1->windDelta;
else e2->windCnt2 = ( e2->windCnt2 == 0 ) ? 1 : 0;
}
PolyFillType e1FillType, e2FillType, e1FillType2, e2FillType2;
if (e1->polyType == ptSubject)
{
e1FillType = m_SubjFillType;
e1FillType2 = m_ClipFillType;
} else
{
e1FillType = m_ClipFillType;
e1FillType2 = m_SubjFillType;
}
if (e2->polyType == ptSubject)
{
e2FillType = m_SubjFillType;
e2FillType2 = m_ClipFillType;
} else
{
e2FillType = m_ClipFillType;
e2FillType2 = m_SubjFillType;
}
long64 e1Wc, e2Wc;
switch (e1FillType)
{
case pftPositive: e1Wc = e1->windCnt; break;
case pftNegative: e1Wc = -e1->windCnt; break;
default: e1Wc = Abs(e1->windCnt);
}
switch(e2FillType)
{
case pftPositive: e2Wc = e2->windCnt; break;
case pftNegative: e2Wc = -e2->windCnt; break;
default: e2Wc = Abs(e2->windCnt);
}
if ( e1Contributing && e2contributing )
{
if ( e1stops || e2stops ||
(e1Wc != 0 && e1Wc != 1) || (e2Wc != 0 && e2Wc != 1) ||
(e1->polyType != e2->polyType && m_ClipType != ctXor) )
AddLocalMaxPoly(e1, e2, pt);
else
DoBothEdges( e1, e2, pt );
}
else if ( e1Contributing )
{
if ((e2Wc == 0 || e2Wc == 1) &&
(m_ClipType != ctIntersection ||
e2->polyType == ptSubject || (e2->windCnt2 != 0)))
DoEdge1(e1, e2, pt);
}
else if ( e2contributing )
{
if ((e1Wc == 0 || e1Wc == 1) &&
(m_ClipType != ctIntersection ||
e1->polyType == ptSubject || (e1->windCnt2 != 0)))
DoEdge2(e1, e2, pt);
}
else if ( (e1Wc == 0 || e1Wc == 1) &&
(e2Wc == 0 || e2Wc == 1) && !e1stops && !e2stops )
{
//neither edge is currently contributing ...
long64 e1Wc2, e2Wc2;
switch (e1FillType2)
{
case pftPositive: e1Wc2 = e1->windCnt2; break;
case pftNegative : e1Wc2 = -e1->windCnt2; break;
default: e1Wc2 = Abs(e1->windCnt2);
}
switch (e2FillType2)
{
case pftPositive: e2Wc2 = e2->windCnt2; break;
case pftNegative: e2Wc2 = -e2->windCnt2; break;
default: e2Wc2 = Abs(e2->windCnt2);
}
if (e1->polyType != e2->polyType)
AddLocalMinPoly(e1, e2, pt);
else if (e1Wc == 1 && e2Wc == 1)
switch( m_ClipType ) {
case ctIntersection:
if (e1Wc2 > 0 && e2Wc2 > 0)
AddLocalMinPoly(e1, e2, pt);
break;
case ctUnion:
if ( e1Wc2 <= 0 && e2Wc2 <= 0 )
AddLocalMinPoly(e1, e2, pt);
break;
case ctDifference:
if (((e1->polyType == ptClip) && (e1Wc2 > 0) && (e2Wc2 > 0)) ||
((e1->polyType == ptSubject) && (e1Wc2 <= 0) && (e2Wc2 <= 0)))
AddLocalMinPoly(e1, e2, pt);
break;
case ctXor:
AddLocalMinPoly(e1, e2, pt);
}
else
SwapSides( *e1, *e2 );
}
if( (e1stops != e2stops) &&
( (e1stops && (e1->outIdx >= 0)) || (e2stops && (e2->outIdx >= 0)) ) )
{
SwapSides( *e1, *e2 );
SwapPolyIndexes( *e1, *e2 );
}
//finally, delete any non-contributing maxima edges ...
if( e1stops ) DeleteFromAEL( e1 );
if( e2stops ) DeleteFromAEL( e2 );
}
//------------------------------------------------------------------------------
void Clipper::SetHoleState(TEdge *e, OutRec *outRec)
{
bool isHole = false;
TEdge *e2 = e->prevInAEL;
while (e2)
{
if (e2->outIdx >= 0)
{
isHole = !isHole;
if (! outRec->FirstLeft)
outRec->FirstLeft = m_PolyOuts[e2->outIdx];
}
e2 = e2->prevInAEL;
}
if (isHole) outRec->isHole = true;
}
//------------------------------------------------------------------------------
bool GetNextNonDupOutPt(OutPt* pp, OutPt*& next)
{
next = pp->next;
while (next != pp && PointsEqual(pp->pt, next->pt))
next = next->next;
return next != pp;
}
//------------------------------------------------------------------------------
bool GetPrevNonDupOutPt(OutPt* pp, OutPt*& prev)
{
prev = pp->prev;
while (prev != pp && PointsEqual(pp->pt, prev->pt))
prev = prev->prev;
return prev != pp;
}
//------------------------------------------------------------------------------
OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2)
{
//work out which polygon fragment has the correct hole state ...
OutPt *outPt1 = outRec1->bottomPt;
OutPt *outPt2 = outRec2->bottomPt;
if (outPt1->pt.Y > outPt2->pt.Y) return outRec1;
else if (outPt1->pt.Y < outPt2->pt.Y) return outRec2;
else if (outPt1->pt.X < outPt2->pt.X) return outRec1;
else if (outPt1->pt.X > outPt2->pt.X) return outRec2;
else if (outRec1->bottomE2 == 0) return outRec2;
else if (outRec2->bottomE2 == 0) return outRec1;
else
{
long64 y1 = std::max(outRec1->bottomE1->ybot, outRec1->bottomE2->ybot);
long64 y2 = std::max(outRec2->bottomE1->ybot, outRec2->bottomE2->ybot);
if (y2 == y1 || (y1 > outPt1->pt.Y && y2 > outPt1->pt.Y))
{
double dx1 = std::max(outRec1->bottomE1->dx, outRec1->bottomE2->dx);
double dx2 = std::max(outRec2->bottomE1->dx, outRec2->bottomE2->dx);
if (dx2 > dx1) return outRec2; else return outRec1;
}
else if (y2 > y1) return outRec2;
else return outRec1;
}
}
//------------------------------------------------------------------------------
void Clipper::AppendPolygon(TEdge *e1, TEdge *e2)
{
//get the start and ends of both output polygons ...
OutRec *outRec1 = m_PolyOuts[e1->outIdx];
OutRec *outRec2 = m_PolyOuts[e2->outIdx];
OutRec *holeStateRec = GetLowermostRec(outRec1, outRec2);
//fixup hole status ...
if (holeStateRec == outRec2)
outRec1->isHole = outRec2->isHole;
else
outRec2->isHole = outRec1->isHole;
OutPt* p1_lft = outRec1->pts;
OutPt* p1_rt = p1_lft->prev;
OutPt* p2_lft = outRec2->pts;
OutPt* p2_rt = p2_lft->prev;
EdgeSide side;
//join e2 poly onto e1 poly and delete pointers to e2 ...
if( e1->side == esLeft )
{
if( e2->side == esLeft )
{
//z y x a b c
ReversePolyPtLinks(*p2_lft);
p2_lft->next = p1_lft;
p1_lft->prev = p2_lft;
p1_rt->next = p2_rt;
p2_rt->prev = p1_rt;
outRec1->pts = p2_rt;
} else
{
//x y z a b c
p2_rt->next = p1_lft;
p1_lft->prev = p2_rt;
p2_lft->prev = p1_rt;
p1_rt->next = p2_lft;
outRec1->pts = p2_lft;
}
side = esLeft;
} else
{
if( e2->side == esRight )
{
//a b c z y x
ReversePolyPtLinks( *p2_lft );
p1_rt->next = p2_rt;
p2_rt->prev = p1_rt;
p2_lft->next = p1_lft;
p1_lft->prev = p2_lft;
} else
{
//a b c x y z
p1_rt->next = p2_lft;
p2_lft->prev = p1_rt;
p1_lft->prev = p2_rt;
p2_rt->next = p1_lft;
}
side = esRight;
}
if (holeStateRec == outRec2)
{
outRec1->bottomPt = outRec2->bottomPt;
outRec1->bottomPt->idx = outRec1->idx;
outRec1->bottomE1 = outRec2->bottomE1;
outRec1->bottomE2 = outRec2->bottomE2;
if (outRec2->FirstLeft != outRec1)
outRec1->FirstLeft = outRec2->FirstLeft;
}
outRec2->pts = 0;
outRec2->bottomPt = 0;
outRec2->AppendLink = outRec1;
int OKIdx = e1->outIdx;
int ObsoleteIdx = e2->outIdx;
e1->outIdx = -1; //nb: safe because we only get here via AddLocalMaxPoly
e2->outIdx = -1;
TEdge* e = m_ActiveEdges;
while( e )
{
if( e->outIdx == ObsoleteIdx )
{
e->outIdx = OKIdx;
e->side = side;
break;
}
e = e->nextInAEL;
}
for (JoinList::size_type i = 0; i < m_Joins.size(); ++i)
{
if (m_Joins[i]->poly1Idx == ObsoleteIdx) m_Joins[i]->poly1Idx = OKIdx;
if (m_Joins[i]->poly2Idx == ObsoleteIdx) m_Joins[i]->poly2Idx = OKIdx;
}
for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); ++i)
{
if (m_HorizJoins[i]->savedIdx == ObsoleteIdx)
m_HorizJoins[i]->savedIdx = OKIdx;
}
}
//------------------------------------------------------------------------------
OutRec* Clipper::CreateOutRec()
{
OutRec* result = new OutRec;
result->isHole = false;
result->FirstLeft = 0;
result->AppendLink = 0;
result->pts = 0;
result->bottomPt = 0;
return result;
}
//------------------------------------------------------------------------------
void Clipper::AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt)
{
bool ToFront = (e->side == esLeft);
if( e->outIdx < 0 )
{
OutRec *outRec = CreateOutRec();
m_PolyOuts.push_back(outRec);
outRec->idx = (int)m_PolyOuts.size()-1;
e->outIdx = outRec->idx;
OutPt* op = new OutPt;
outRec->pts = op;
outRec->bottomE1 = e;
outRec->bottomE2 = altE;
outRec->bottomPt = op;
op->pt = pt;
op->idx = outRec->idx;
op->next = op;
op->prev = op;
SetHoleState(e, outRec);
} else
{
OutRec *outRec = m_PolyOuts[e->outIdx];
OutPt* op = outRec->pts;
if ((ToFront && PointsEqual(pt, op->pt)) ||
(!ToFront && PointsEqual(pt, op->prev->pt))) return;
OutPt* op2 = new OutPt;
op2->pt = pt;
op2->idx = outRec->idx;
if (op2->pt.Y == outRec->bottomPt->pt.Y &&
op2->pt.X < outRec->bottomPt->pt.X)
{
outRec->bottomPt = op2;
outRec->bottomE1 = e;
outRec->bottomE2 = altE;
}
op2->next = op;
op2->prev = op->prev;
op2->prev->next = op2;
op->prev = op2;
if (ToFront) outRec->pts = op2;
}
}
//------------------------------------------------------------------------------
void Clipper::ProcessHorizontals()
{
TEdge* horzEdge = m_SortedEdges;
while( horzEdge )
{
DeleteFromSEL( horzEdge );
ProcessHorizontal( horzEdge );
horzEdge = m_SortedEdges;
}
}
//------------------------------------------------------------------------------
bool Clipper::IsTopHorz(const long64 XPos)
{
TEdge* e = m_SortedEdges;
while( e )
{
if( ( XPos >= std::min(e->xcurr, e->xtop) ) &&
( XPos <= std::max(e->xcurr, e->xtop) ) ) return false;
e = e->nextInSEL;
}
return true;
}
//------------------------------------------------------------------------------
bool IsMinima(TEdge *e)
{
return e && (e->prev->nextInLML != e) && (e->next->nextInLML != e);
}
//------------------------------------------------------------------------------
bool IsMaxima(TEdge *e, const long64 Y)
{
return e && e->ytop == Y && !e->nextInLML;
}
//------------------------------------------------------------------------------
bool IsIntermediate(TEdge *e, const long64 Y)
{
return e->ytop == Y && e->nextInLML;
}
//------------------------------------------------------------------------------
TEdge *GetMaximaPair(TEdge *e)
{
if( !IsMaxima(e->next, e->ytop) || e->next->xtop != e->xtop )
return e->prev; else
return e->next;
}
//------------------------------------------------------------------------------
void Clipper::SwapPositionsInAEL(TEdge *edge1, TEdge *edge2)
{
if( !edge1->nextInAEL && !edge1->prevInAEL ) return;
if( !edge2->nextInAEL && !edge2->prevInAEL ) return;
if( edge1->nextInAEL == edge2 )
{
TEdge* next = edge2->nextInAEL;
if( next ) next->prevInAEL = edge1;
TEdge* prev = edge1->prevInAEL;
if( prev ) prev->nextInAEL = edge2;
edge2->prevInAEL = prev;
edge2->nextInAEL = edge1;
edge1->prevInAEL = edge2;
edge1->nextInAEL = next;
}
else if( edge2->nextInAEL == edge1 )
{
TEdge* next = edge1->nextInAEL;
if( next ) next->prevInAEL = edge2;
TEdge* prev = edge2->prevInAEL;
if( prev ) prev->nextInAEL = edge1;
edge1->prevInAEL = prev;
edge1->nextInAEL = edge2;
edge2->prevInAEL = edge1;
edge2->nextInAEL = next;
}
else
{
TEdge* next = edge1->nextInAEL;
TEdge* prev = edge1->prevInAEL;
edge1->nextInAEL = edge2->nextInAEL;
if( edge1->nextInAEL ) edge1->nextInAEL->prevInAEL = edge1;
edge1->prevInAEL = edge2->prevInAEL;
if( edge1->prevInAEL ) edge1->prevInAEL->nextInAEL = edge1;
edge2->nextInAEL = next;
if( edge2->nextInAEL ) edge2->nextInAEL->prevInAEL = edge2;
edge2->prevInAEL = prev;
if( edge2->prevInAEL ) edge2->prevInAEL->nextInAEL = edge2;
}
if( !edge1->prevInAEL ) m_ActiveEdges = edge1;
else if( !edge2->prevInAEL ) m_ActiveEdges = edge2;
}
//------------------------------------------------------------------------------
void Clipper::SwapPositionsInSEL(TEdge *edge1, TEdge *edge2)
{
if( !( edge1->nextInSEL ) && !( edge1->prevInSEL ) ) return;
if( !( edge2->nextInSEL ) && !( edge2->prevInSEL ) ) return;
if( edge1->nextInSEL == edge2 )
{
TEdge* next = edge2->nextInSEL;
if( next ) next->prevInSEL = edge1;
TEdge* prev = edge1->prevInSEL;
if( prev ) prev->nextInSEL = edge2;
edge2->prevInSEL = prev;
edge2->nextInSEL = edge1;
edge1->prevInSEL = edge2;
edge1->nextInSEL = next;
}
else if( edge2->nextInSEL == edge1 )
{
TEdge* next = edge1->nextInSEL;
if( next ) next->prevInSEL = edge2;
TEdge* prev = edge2->prevInSEL;
if( prev ) prev->nextInSEL = edge1;
edge1->prevInSEL = prev;
edge1->nextInSEL = edge2;
edge2->prevInSEL = edge1;
edge2->nextInSEL = next;
}
else
{
TEdge* next = edge1->nextInSEL;
TEdge* prev = edge1->prevInSEL;
edge1->nextInSEL = edge2->nextInSEL;
if( edge1->nextInSEL ) edge1->nextInSEL->prevInSEL = edge1;
edge1->prevInSEL = edge2->prevInSEL;
if( edge1->prevInSEL ) edge1->prevInSEL->nextInSEL = edge1;
edge2->nextInSEL = next;
if( edge2->nextInSEL ) edge2->nextInSEL->prevInSEL = edge2;
edge2->prevInSEL = prev;
if( edge2->prevInSEL ) edge2->prevInSEL->nextInSEL = edge2;
}
if( !edge1->prevInSEL ) m_SortedEdges = edge1;
else if( !edge2->prevInSEL ) m_SortedEdges = edge2;
}
//------------------------------------------------------------------------------
TEdge* GetNextInAEL(TEdge *e, Direction dir)
{
if( dir == dLeftToRight ) return e->nextInAEL;
else return e->prevInAEL;
}
//------------------------------------------------------------------------------
void Clipper::ProcessHorizontal(TEdge *horzEdge)
{
Direction dir;
long64 horzLeft, horzRight;
if( horzEdge->xcurr < horzEdge->xtop )
{
horzLeft = horzEdge->xcurr;
horzRight = horzEdge->xtop;
dir = dLeftToRight;
} else
{
horzLeft = horzEdge->xtop;
horzRight = horzEdge->xcurr;
dir = dRightToLeft;
}
TEdge* eMaxPair;
if( horzEdge->nextInLML ) eMaxPair = 0;
else eMaxPair = GetMaximaPair(horzEdge);
TEdge* e = GetNextInAEL( horzEdge , dir );
while( e )
{
TEdge* eNext = GetNextInAEL( e, dir );
if (eMaxPair ||
((dir == dLeftToRight) && (e->xcurr < horzRight)) ||
((dir == dRightToLeft) && (e->xcurr > horzLeft)))
{
//ok, so far it looks like we're still in range of the horizontal edge
if ( e->xcurr == horzEdge->xtop && !eMaxPair )
{
if (SlopesEqual(*e, *horzEdge->nextInLML, m_UseFullRange))
{
//if output polygons share an edge, they'll need joining later ...
if (horzEdge->outIdx >= 0 && e->outIdx >= 0)
AddJoin(horzEdge->nextInLML, e, horzEdge->outIdx);
break; //we've reached the end of the horizontal line
}
else if (e->dx < horzEdge->nextInLML->dx)
//we really have got to the end of the intermediate horz edge so quit.
//nb: More -ve slopes follow more +ve slopes ABOVE the horizontal.
break;
}
if( e == eMaxPair )
{
//horzEdge is evidently a maxima horizontal and we've arrived at its end.
if (dir == dLeftToRight)
IntersectEdges(horzEdge, e, IntPoint(e->xcurr, horzEdge->ycurr), ipNone);
else
IntersectEdges(e, horzEdge, IntPoint(e->xcurr, horzEdge->ycurr), ipNone);
if (eMaxPair->outIdx >= 0) throw clipperException("ProcessHorizontal error");
return;
}
else if( NEAR_EQUAL(e->dx, HORIZONTAL) && !IsMinima(e) && !(e->xcurr > e->xtop) )
{
//An overlapping horizontal edge. Overlapping horizontal edges are
//processed as if layered with the current horizontal edge (horizEdge)
//being infinitesimally lower that the next (e). Therfore, we
//intersect with e only if e.xcurr is within the bounds of horzEdge ...
if( dir == dLeftToRight )
IntersectEdges( horzEdge , e, IntPoint(e->xcurr, horzEdge->ycurr),
(IsTopHorz( e->xcurr ))? ipLeft : ipBoth );
else
IntersectEdges( e, horzEdge, IntPoint(e->xcurr, horzEdge->ycurr),
(IsTopHorz( e->xcurr ))? ipRight : ipBoth );
}
else if( dir == dLeftToRight )
{
IntersectEdges( horzEdge, e, IntPoint(e->xcurr, horzEdge->ycurr),
(IsTopHorz( e->xcurr ))? ipLeft : ipBoth );
}
else
{
IntersectEdges( e, horzEdge, IntPoint(e->xcurr, horzEdge->ycurr),
(IsTopHorz( e->xcurr ))? ipRight : ipBoth );
}
SwapPositionsInAEL( horzEdge, e );
}
else if( (dir == dLeftToRight && e->xcurr > horzRight && m_SortedEdges) ||
(dir == dRightToLeft && e->xcurr < horzLeft && m_SortedEdges) ) break;
e = eNext;
} //end while
if( horzEdge->nextInLML )
{
if( horzEdge->outIdx >= 0 )
AddOutPt( horzEdge, 0, IntPoint(horzEdge->xtop, horzEdge->ytop));
UpdateEdgeIntoAEL( horzEdge );
}
else
{
if ( horzEdge->outIdx >= 0 )
IntersectEdges( horzEdge, eMaxPair,
IntPoint(horzEdge->xtop, horzEdge->ycurr), ipBoth);
if (eMaxPair->outIdx >= 0) throw clipperException("ProcessHorizontal error");
DeleteFromAEL(eMaxPair);
DeleteFromAEL(horzEdge);
}
}
//------------------------------------------------------------------------------
void Clipper::UpdateEdgeIntoAEL(TEdge *&e)
{
if( !e->nextInLML ) throw
clipperException("UpdateEdgeIntoAEL: invalid call");
TEdge* AelPrev = e->prevInAEL;
TEdge* AelNext = e->nextInAEL;
e->nextInLML->outIdx = e->outIdx;
if( AelPrev ) AelPrev->nextInAEL = e->nextInLML;
else m_ActiveEdges = e->nextInLML;
if( AelNext ) AelNext->prevInAEL = e->nextInLML;
e->nextInLML->side = e->side;
e->nextInLML->windDelta = e->windDelta;
e->nextInLML->windCnt = e->windCnt;
e->nextInLML->windCnt2 = e->windCnt2;
e = e->nextInLML;
e->prevInAEL = AelPrev;
e->nextInAEL = AelNext;
if( !NEAR_EQUAL(e->dx, HORIZONTAL) ) InsertScanbeam( e->ytop );
}
//------------------------------------------------------------------------------
bool Clipper::ProcessIntersections(const long64 botY, const long64 topY)
{
if( !m_ActiveEdges ) return true;
try {
BuildIntersectList(botY, topY);
if ( !m_IntersectNodes) return true;
if ( FixupIntersections() ) ProcessIntersectList();
else return false;
}
catch(...) {
m_SortedEdges = 0;
DisposeIntersectNodes();
throw clipperException("ProcessIntersections error");
}
return true;
}
//------------------------------------------------------------------------------
void Clipper::DisposeIntersectNodes()
{
while ( m_IntersectNodes )
{
IntersectNode* iNode = m_IntersectNodes->next;
delete m_IntersectNodes;
m_IntersectNodes = iNode;
}
}
//------------------------------------------------------------------------------
void Clipper::BuildIntersectList(const long64 botY, const long64 topY)
{
if ( !m_ActiveEdges ) return;
//prepare for sorting ...
TEdge* e = m_ActiveEdges;
e->tmpX = TopX( *e, topY );
m_SortedEdges = e;
m_SortedEdges->prevInSEL = 0;
e = e->nextInAEL;
while( e )
{
e->prevInSEL = e->prevInAEL;
e->prevInSEL->nextInSEL = e;
e->nextInSEL = 0;
e->tmpX = TopX( *e, topY );
e = e->nextInAEL;
}
//bubblesort ...
bool isModified = true;
while( isModified && m_SortedEdges )
{
isModified = false;
e = m_SortedEdges;
while( e->nextInSEL )
{
TEdge *eNext = e->nextInSEL;
IntPoint pt;
if(e->tmpX > eNext->tmpX &&
IntersectPoint(*e, *eNext, pt, m_UseFullRange))
{
if (pt.Y > botY)
{
pt.Y = botY;
pt.X = TopX(*e, pt.Y);
}
AddIntersectNode( e, eNext, pt );
SwapPositionsInSEL(e, eNext);
isModified = true;
}
else
e = eNext;
}
if( e->prevInSEL ) e->prevInSEL->nextInSEL = 0;
else break;
}
m_SortedEdges = 0;
}
//------------------------------------------------------------------------------
bool Process1Before2(IntersectNode &node1, IntersectNode &node2)
{
bool result;
if (node1.pt.Y == node2.pt.Y)
{
if (node1.edge1 == node2.edge1 || node1.edge2 == node2.edge1)
{
result = node2.pt.X > node1.pt.X;
if (node2.edge1->dx > 0) return !result; else return result;
}
else if (node1.edge1 == node2.edge2 || node1.edge2 == node2.edge2)
{
result = node2.pt.X > node1.pt.X;
if (node2.edge2->dx > 0) return !result; else return result;
}
else return node2.pt.X > node1.pt.X;
}
else return node1.pt.Y > node2.pt.Y;
}
//------------------------------------------------------------------------------
void Clipper::AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt)
{
IntersectNode* newNode = new IntersectNode;
newNode->edge1 = e1;
newNode->edge2 = e2;
newNode->pt = pt;
newNode->next = 0;
if( !m_IntersectNodes ) m_IntersectNodes = newNode;
else if( Process1Before2(*newNode, *m_IntersectNodes) )
{
newNode->next = m_IntersectNodes;
m_IntersectNodes = newNode;
}
else
{
IntersectNode* iNode = m_IntersectNodes;
while( iNode->next && Process1Before2(*iNode->next, *newNode) )
iNode = iNode->next;
newNode->next = iNode->next;
iNode->next = newNode;
}
}
//------------------------------------------------------------------------------
void Clipper::ProcessIntersectList()
{
while( m_IntersectNodes )
{
IntersectNode* iNode = m_IntersectNodes->next;
{
IntersectEdges( m_IntersectNodes->edge1 ,
m_IntersectNodes->edge2 , m_IntersectNodes->pt, ipBoth );
SwapPositionsInAEL( m_IntersectNodes->edge1 , m_IntersectNodes->edge2 );
}
delete m_IntersectNodes;
m_IntersectNodes = iNode;
}
}
//------------------------------------------------------------------------------
void Clipper::DoMaxima(TEdge *e, long64 topY)
{
TEdge* eMaxPair = GetMaximaPair(e);
long64 X = e->xtop;
TEdge* eNext = e->nextInAEL;
while( eNext != eMaxPair )
{
if (!eNext) throw clipperException("DoMaxima error");
IntersectEdges( e, eNext, IntPoint(X, topY), ipBoth );
eNext = eNext->nextInAEL;
}
if( e->outIdx < 0 && eMaxPair->outIdx < 0 )
{
DeleteFromAEL( e );
DeleteFromAEL( eMaxPair );
}
else if( e->outIdx >= 0 && eMaxPair->outIdx >= 0 )
{
IntersectEdges( e, eMaxPair, IntPoint(X, topY), ipNone );
}
else throw clipperException("DoMaxima error");
}
//------------------------------------------------------------------------------
void Clipper::ProcessEdgesAtTopOfScanbeam(const long64 topY)
{
TEdge* e = m_ActiveEdges;
while( e )
{
//1. process maxima, treating them as if they're 'bent' horizontal edges,
// but exclude maxima with horizontal edges. nb: e can't be a horizontal.
if( IsMaxima(e, topY) && !NEAR_EQUAL(GetMaximaPair(e)->dx, HORIZONTAL) )
{
//'e' might be removed from AEL, as may any following edges so ...
TEdge* ePrior = e->prevInAEL;
DoMaxima(e, topY);
if( !ePrior ) e = m_ActiveEdges;
else e = ePrior->nextInAEL;
}
else
{
//2. promote horizontal edges, otherwise update xcurr and ycurr ...
if( IsIntermediate(e, topY) && NEAR_EQUAL(e->nextInLML->dx, HORIZONTAL) )
{
if (e->outIdx >= 0)
{
AddOutPt(e, 0, IntPoint(e->xtop, e->ytop));
for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); ++i)
{
IntPoint pt, pt2;
HorzJoinRec* hj = m_HorizJoins[i];
if (GetOverlapSegment(IntPoint(hj->edge->xbot, hj->edge->ybot),
IntPoint(hj->edge->xtop, hj->edge->ytop),
IntPoint(e->nextInLML->xbot, e->nextInLML->ybot),
IntPoint(e->nextInLML->xtop, e->nextInLML->ytop), pt, pt2))
AddJoin(hj->edge, e->nextInLML, hj->savedIdx, e->outIdx);
}
AddHorzJoin(e->nextInLML, e->outIdx);
}
UpdateEdgeIntoAEL(e);
AddEdgeToSEL(e);
} else
{
//this just simplifies horizontal processing ...
e->xcurr = TopX( *e, topY );
e->ycurr = topY;
}
e = e->nextInAEL;
}
}
//3. Process horizontals at the top of the scanbeam ...
ProcessHorizontals();
//4. Promote intermediate vertices ...
e = m_ActiveEdges;
while( e )
{
if( IsIntermediate( e, topY ) )
{
if( e->outIdx >= 0 ) AddOutPt(e, 0, IntPoint(e->xtop,e->ytop));
UpdateEdgeIntoAEL(e);
//if output polygons share an edge, they'll need joining later ...
if (e->outIdx >= 0 && e->prevInAEL && e->prevInAEL->outIdx >= 0 &&
e->prevInAEL->xcurr == e->xbot && e->prevInAEL->ycurr == e->ybot &&
SlopesEqual(IntPoint(e->xbot,e->ybot), IntPoint(e->xtop, e->ytop),
IntPoint(e->xbot,e->ybot),
IntPoint(e->prevInAEL->xtop, e->prevInAEL->ytop), m_UseFullRange))
{
AddOutPt(e->prevInAEL, 0, IntPoint(e->xbot, e->ybot));
AddJoin(e, e->prevInAEL);
}
else if (e->outIdx >= 0 && e->nextInAEL && e->nextInAEL->outIdx >= 0 &&
e->nextInAEL->ycurr > e->nextInAEL->ytop &&
e->nextInAEL->ycurr < e->nextInAEL->ybot &&
e->nextInAEL->xcurr == e->xbot && e->nextInAEL->ycurr == e->ybot &&
SlopesEqual(IntPoint(e->xbot,e->ybot), IntPoint(e->xtop, e->ytop),
IntPoint(e->xbot,e->ybot),
IntPoint(e->nextInAEL->xtop, e->nextInAEL->ytop), m_UseFullRange))
{
AddOutPt(e->nextInAEL, 0, IntPoint(e->xbot, e->ybot));
AddJoin(e, e->nextInAEL);
}
}
e = e->nextInAEL;
}
}
//------------------------------------------------------------------------------
void Clipper::FixupOutPolygon(OutRec &outRec)
{
//FixupOutPolygon() - removes duplicate points and simplifies consecutive
//parallel edges by removing the middle vertex.
OutPt *lastOK = 0;
outRec.pts = outRec.bottomPt;
OutPt *pp = outRec.bottomPt;
for (;;)
{
if (pp->prev == pp || pp->prev == pp->next )
{
DisposeOutPts(pp);
outRec.pts = 0;
outRec.bottomPt = 0;
return;
}
//test for duplicate points and for same slope (cross-product) ...
if ( PointsEqual(pp->pt, pp->next->pt) ||
SlopesEqual(pp->prev->pt, pp->pt, pp->next->pt, m_UseFullRange) )
{
lastOK = 0;
OutPt *tmp = pp;
if (pp == outRec.bottomPt)
outRec.bottomPt = 0; //flags need for updating
pp->prev->next = pp->next;
pp->next->prev = pp->prev;
pp = pp->prev;
delete tmp;
}
else if (pp == lastOK) break;
else
{
if (!lastOK) lastOK = pp;
pp = pp->next;
}
}
if (!outRec.bottomPt) {
outRec.bottomPt = PolygonBottom(pp);
outRec.pts = outRec.bottomPt;
}
}
//------------------------------------------------------------------------------
void Clipper::BuildResult(Polygons &polys)
{
int k = 0;
polys.resize(m_PolyOuts.size());
for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
{
if (m_PolyOuts[i]->pts)
{
Polygon* pg = &polys[k];
pg->clear();
OutPt* p = m_PolyOuts[i]->pts;
do
{
pg->push_back(p->pt);
p = p->next;
} while (p != m_PolyOuts[i]->pts);
//make sure each polygon has at least 3 vertices ...
if (pg->size() < 3) pg->clear(); else k++;
}
}
polys.resize(k);
}
//------------------------------------------------------------------------------
void Clipper::BuildResultEx(ExPolygons &polys)
{
PolyOutList::size_type i = 0;
int k = 0;
polys.resize(0);
polys.reserve(m_PolyOuts.size());
while (i < m_PolyOuts.size() && m_PolyOuts[i]->pts)
{
ExPolygon epg;
OutPt* p = m_PolyOuts[i]->pts;
do {
epg.outer.push_back(p->pt);
p = p->next;
} while (p != m_PolyOuts[i]->pts);
i++;
//make sure polygons have at least 3 vertices ...
if (epg.outer.size() < 3) continue;
while (i < m_PolyOuts.size()
&& m_PolyOuts[i]->pts && m_PolyOuts[i]->isHole)
{
Polygon pg;
p = m_PolyOuts[i]->pts;
do {
pg.push_back(p->pt);
p = p->next;
} while (p != m_PolyOuts[i]->pts);
epg.holes.push_back(pg);
i++;
}
polys.push_back(epg);
k++;
}
polys.resize(k);
}
//------------------------------------------------------------------------------
void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2)
{
TEdge *e1 = int1.edge1;
TEdge *e2 = int1.edge2;
IntPoint p = int1.pt;
int1.edge1 = int2.edge1;
int1.edge2 = int2.edge2;
int1.pt = int2.pt;
int2.edge1 = e1;
int2.edge2 = e2;
int2.pt = p;
}
//------------------------------------------------------------------------------
bool Clipper::FixupIntersections()
{
if ( !m_IntersectNodes->next ) return true;
CopyAELToSEL();
IntersectNode *int1 = m_IntersectNodes;
IntersectNode *int2 = m_IntersectNodes->next;
while (int2)
{
TEdge *e1 = int1->edge1;
TEdge *e2;
if (e1->prevInSEL == int1->edge2) e2 = e1->prevInSEL;
else if (e1->nextInSEL == int1->edge2) e2 = e1->nextInSEL;
else
{
//The current intersection is out of order, so try and swap it with
//a subsequent intersection ...
while (int2)
{
if (int2->edge1->nextInSEL == int2->edge2 ||
int2->edge1->prevInSEL == int2->edge2) break;
else int2 = int2->next;
}
if ( !int2 ) return false; //oops!!!
//found an intersect node that can be swapped ...
SwapIntersectNodes(*int1, *int2);
e1 = int1->edge1;
e2 = int1->edge2;
}
SwapPositionsInSEL(e1, e2);
int1 = int1->next;
int2 = int1->next;
}
m_SortedEdges = 0;
//finally, check the last intersection too ...
return (int1->edge1->prevInSEL == int1->edge2 ||
int1->edge1->nextInSEL == int1->edge2);
}
//------------------------------------------------------------------------------
bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2)
{
if (e2.xcurr == e1.xcurr) return e2.dx > e1.dx;
else return e2.xcurr < e1.xcurr;
}
//------------------------------------------------------------------------------
void Clipper::InsertEdgeIntoAEL(TEdge *edge)
{
edge->prevInAEL = 0;
edge->nextInAEL = 0;
if( !m_ActiveEdges )
{
m_ActiveEdges = edge;
}
else if( E2InsertsBeforeE1(*m_ActiveEdges, *edge) )
{
edge->nextInAEL = m_ActiveEdges;
m_ActiveEdges->prevInAEL = edge;
m_ActiveEdges = edge;
} else
{
TEdge* e = m_ActiveEdges;
while( e->nextInAEL && !E2InsertsBeforeE1(*e->nextInAEL , *edge) )
e = e->nextInAEL;
edge->nextInAEL = e->nextInAEL;
if( e->nextInAEL ) e->nextInAEL->prevInAEL = edge;
edge->prevInAEL = e;
e->nextInAEL = edge;
}
}
//----------------------------------------------------------------------
void Clipper::DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt)
{
AddOutPt(edge1, edge2, pt);
SwapSides(*edge1, *edge2);
SwapPolyIndexes(*edge1, *edge2);
}
//----------------------------------------------------------------------
void Clipper::DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt)
{
AddOutPt(edge2, edge1, pt);
SwapSides(*edge1, *edge2);
SwapPolyIndexes(*edge1, *edge2);
}
//----------------------------------------------------------------------
void Clipper::DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt)
{
AddOutPt(edge1, edge2, pt);
AddOutPt(edge2, edge1, pt);
SwapSides( *edge1 , *edge2 );
SwapPolyIndexes( *edge1 , *edge2 );
}
//----------------------------------------------------------------------
void Clipper::CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2)
{
//when a polygon is split into 2 polygons, make sure any holes the original
//polygon contained link to the correct polygon ...
for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
{
OutRec *orec = m_PolyOuts[i];
if (orec->isHole && orec->bottomPt && orec->FirstLeft == outRec1 &&
!PointInPolygon(orec->bottomPt->pt, outRec1->pts, m_UseFullRange))
orec->FirstLeft = outRec2;
}
}
//----------------------------------------------------------------------
void Clipper::CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2)
{
//if a hole is owned by outRec2 then make it owned by outRec1 ...
for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
if (m_PolyOuts[i]->isHole && m_PolyOuts[i]->bottomPt &&
m_PolyOuts[i]->FirstLeft == outRec2)
m_PolyOuts[i]->FirstLeft = outRec1;
}
//----------------------------------------------------------------------
void Clipper::JoinCommonEdges(bool fixHoleLinkages)
{
for (JoinList::size_type i = 0; i < m_Joins.size(); i++)
{
JoinRec* j = m_Joins[i];
OutRec *outRec1 = m_PolyOuts[j->poly1Idx];
OutPt *pp1a = outRec1->pts;
OutRec *outRec2 = m_PolyOuts[j->poly2Idx];
OutPt *pp2a = outRec2->pts;
IntPoint pt1 = j->pt2a, pt2 = j->pt2b;
IntPoint pt3 = j->pt1a, pt4 = j->pt1b;
if (!FindSegment(pp1a, pt1, pt2)) continue;
if (j->poly1Idx == j->poly2Idx)
{
//we're searching the same polygon for overlapping segments so
//segment 2 mustn't be the same as segment 1 ...
pp2a = pp1a->next;
if (!FindSegment(pp2a, pt3, pt4) || (pp2a == pp1a)) continue;
}
else if (!FindSegment(pp2a, pt3, pt4)) continue;
if (!GetOverlapSegment(pt1, pt2, pt3, pt4, pt1, pt2)) continue;
OutPt *p1, *p2, *p3, *p4;
OutPt *prev = pp1a->prev;
//get p1 & p2 polypts - the overlap start & endpoints on poly1
if (PointsEqual(pp1a->pt, pt1)) p1 = pp1a;
else if (PointsEqual(prev->pt, pt1)) p1 = prev;
else p1 = InsertPolyPtBetween(pp1a, prev, pt1);
if (PointsEqual(pp1a->pt, pt2)) p2 = pp1a;
else if (PointsEqual(prev->pt, pt2)) p2 = prev;
else if ((p1 == pp1a) || (p1 == prev))
p2 = InsertPolyPtBetween(pp1a, prev, pt2);
else if (Pt3IsBetweenPt1AndPt2(pp1a->pt, p1->pt, pt2))
p2 = InsertPolyPtBetween(pp1a, p1, pt2); else
p2 = InsertPolyPtBetween(p1, prev, pt2);
//get p3 & p4 polypts - the overlap start & endpoints on poly2
prev = pp2a->prev;
if (PointsEqual(pp2a->pt, pt1)) p3 = pp2a;
else if (PointsEqual(prev->pt, pt1)) p3 = prev;
else p3 = InsertPolyPtBetween(pp2a, prev, pt1);
if (PointsEqual(pp2a->pt, pt2)) p4 = pp2a;
else if (PointsEqual(prev->pt, pt2)) p4 = prev;
else if ((p3 == pp2a) || (p3 == prev))
p4 = InsertPolyPtBetween(pp2a, prev, pt2);
else if (Pt3IsBetweenPt1AndPt2(pp2a->pt, p3->pt, pt2))
p4 = InsertPolyPtBetween(pp2a, p3, pt2); else
p4 = InsertPolyPtBetween(p3, prev, pt2);
//p1.pt == p3.pt and p2.pt == p4.pt so join p1 to p3 and p2 to p4 ...
if (p1->next == p2 && p3->prev == p4)
{
p1->next = p3;
p3->prev = p1;
p2->prev = p4;
p4->next = p2;
}
else if (p1->prev == p2 && p3->next == p4)
{
p1->prev = p3;
p3->next = p1;
p2->next = p4;
p4->prev = p2;
}
else
continue; //an orientation is probably wrong
if (j->poly2Idx == j->poly1Idx)
{
//instead of joining two polygons, we've just created a new one by
//splitting one polygon into two.
outRec1->pts = PolygonBottom(p1);
outRec1->bottomPt = outRec1->pts;
outRec1->bottomPt->idx = outRec1->idx;
outRec2 = CreateOutRec();
m_PolyOuts.push_back(outRec2);
outRec2->idx = (int)m_PolyOuts.size()-1;
j->poly2Idx = outRec2->idx;
outRec2->pts = PolygonBottom(p2);
outRec2->bottomPt = outRec2->pts;
outRec2->bottomPt->idx = outRec2->idx;
if (PointInPolygon(outRec2->pts->pt, outRec1->pts, m_UseFullRange))
{
//outRec2 is contained by outRec1 ...
outRec2->isHole = !outRec1->isHole;
outRec2->FirstLeft = outRec1;
if (outRec2->isHole == Orientation(outRec2, m_UseFullRange))
ReversePolyPtLinks(*outRec2->pts);
} else if (PointInPolygon(outRec1->pts->pt, outRec2->pts, m_UseFullRange))
{
//outRec1 is contained by outRec2 ...
outRec2->isHole = outRec1->isHole;
outRec1->isHole = !outRec2->isHole;
outRec2->FirstLeft = outRec1->FirstLeft;
outRec1->FirstLeft = outRec2;
if (outRec1->isHole == Orientation(outRec1, m_UseFullRange))
ReversePolyPtLinks(*outRec1->pts);
//make sure any contained holes now link to the correct polygon ...
if (fixHoleLinkages) CheckHoleLinkages1(outRec1, outRec2);
} else
{
outRec2->isHole = outRec1->isHole;
outRec2->FirstLeft = outRec1->FirstLeft;
//make sure any contained holes now link to the correct polygon ...
if (fixHoleLinkages) CheckHoleLinkages1(outRec1, outRec2);
}
//now fixup any subsequent joins that match this polygon
for (JoinList::size_type k = i+1; k < m_Joins.size(); k++)
{
JoinRec* j2 = m_Joins[k];
if (j2->poly1Idx == j->poly1Idx && PointIsVertex(j2->pt1a, p2))
j2->poly1Idx = j->poly2Idx;
if (j2->poly2Idx == j->poly1Idx && PointIsVertex(j2->pt2a, p2))
j2->poly2Idx = j->poly2Idx;
}
//now cleanup redundant edges too ...
FixupOutPolygon(*outRec1);
FixupOutPolygon(*outRec2);
} else
{
//joined 2 polygons together ...
//make sure any holes contained by outRec2 now link to outRec1 ...
if (fixHoleLinkages) CheckHoleLinkages2(outRec1, outRec2);
//now cleanup redundant edges too ...
FixupOutPolygon(*outRec1);
if (outRec1->pts)
outRec1->isHole = Orientation(outRec1, m_UseFullRange);
//delete the obsolete pointer ...
int OKIdx = outRec1->idx;
int ObsoleteIdx = outRec2->idx;
outRec2->pts = 0;
outRec2->bottomPt = 0;
outRec2->AppendLink = outRec1;
//now fixup any subsequent Joins that match this polygon
for (JoinList::size_type k = i+1; k < m_Joins.size(); k++)
{
JoinRec* j2 = m_Joins[k];
if (j2->poly1Idx == ObsoleteIdx) j2->poly1Idx = OKIdx;
if (j2->poly2Idx == ObsoleteIdx) j2->poly2Idx = OKIdx;
}
}
}
}
//------------------------------------------------------------------------------
void ReversePoints(Polygon& p)
{
std::reverse(p.begin(), p.end());
}
//------------------------------------------------------------------------------
void ReversePoints(Polygons& p)
{
for (Polygons::size_type i = 0; i < p.size(); ++i)
ReversePoints(p[i]);
}
//------------------------------------------------------------------------------
// OffsetPolygon functions ...
//------------------------------------------------------------------------------
struct DoublePoint
{
double X;
double Y;
DoublePoint(double x = 0, double y = 0) : X(x), Y(y) {}
};
//------------------------------------------------------------------------------
Polygon BuildArc(const IntPoint &pt,
const double a1, const double a2, const double r)
{
int steps = std::max(6, int(std::sqrt(std::fabs(r)) * std::fabs(a2 - a1)));
Polygon result(steps);
int n = steps - 1;
double da = (a2 - a1) / n;
double a = a1;
for (int i = 0; i <= n; ++i)
{
result[i].X = pt.X + Round(std::cos(a)*r);
result[i].Y = pt.Y + Round(std::sin(a)*r);
a += da;
}
return result;
}
//------------------------------------------------------------------------------
DoublePoint GetUnitNormal( const IntPoint &pt1, const IntPoint &pt2)
{
if(pt2.X == pt1.X && pt2.Y == pt1.Y)
return DoublePoint(0, 0);
double dx = (double)(pt2.X - pt1.X);
double dy = (double)(pt2.Y - pt1.Y);
double f = 1 *1.0/ std::sqrt( dx*dx + dy*dy );
dx *= f;
dy *= f;
return DoublePoint(dy, -dx);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
class PolyOffsetBuilder
{
private:
Polygons m_p;
Polygon* m_curr_poly;
std::vector<DoublePoint> normals;
double m_delta, m_RMin, m_R;
size_t m_i, m_j, m_k;
static const int buffLength = 128;
JoinType m_jointype;
public:
PolyOffsetBuilder(const Polygons& in_polys, Polygons& out_polys,
double delta, JoinType jointype, double MiterLimit)
{
//nb precondition - out_polys != ptsin_polys
if (NEAR_ZERO(delta))
{
out_polys = in_polys;
return;
}
this->m_p = in_polys;
this->m_delta = delta;
this->m_jointype = jointype;
if (MiterLimit <= 1) MiterLimit = 1;
m_RMin = 2/(MiterLimit*MiterLimit);
double deltaSq = delta*delta;
out_polys.clear();
out_polys.resize(in_polys.size());
for (m_i = 0; m_i < in_polys.size(); m_i++)
{
m_curr_poly = &out_polys[m_i];
size_t len = in_polys[m_i].size();
if (len > 1 && m_p[m_i][0].X == m_p[m_i][len - 1].X &&
m_p[m_i][0].Y == m_p[m_i][len-1].Y) len--;
//when 'shrinking' polygons - to minimize artefacts
//strip those polygons that have an area < pi * delta^2 ...
double a1 = Area(in_polys[m_i]);
if (delta < 0) { if (a1 > 0 && a1 < deltaSq *pi) len = 0; }
else if (a1 < 0 && -a1 < deltaSq *pi) len = 0; //holes have neg. area
if (len == 0 || (len < 3 && delta <= 0))
continue;
else if (len == 1)
{
Polygon arc;
arc = BuildArc(in_polys[m_i][len-1], 0, 2 * pi, delta);
out_polys[m_i] = arc;
continue;
}
//build normals ...
normals.clear();
normals.resize(len);
normals[len-1] = GetUnitNormal(in_polys[m_i][len-1], in_polys[m_i][0]);
for (m_j = 0; m_j < len -1; ++m_j)
normals[m_j] = GetUnitNormal(in_polys[m_i][m_j], in_polys[m_i][m_j+1]);
m_k = len -1;
for (m_j = 0; m_j < len; ++m_j)
{
switch (jointype)
{
case jtMiter:
{
m_R = 1 + (normals[m_j].X*normals[m_k].X +
normals[m_j].Y*normals[m_k].Y);
if (m_R >= m_RMin) DoMiter(); else DoSquare(MiterLimit);
break;
}
case jtSquare: DoSquare(); break;
case jtRound: DoRound(); break;
}
m_k = m_j;
}
}
//finally, clean up untidy corners using Clipper ...
Clipper clpr;
clpr.AddPolygons(out_polys, ptSubject);
if (delta > 0)
{
if (!clpr.Execute(ctUnion, out_polys, pftPositive, pftPositive))
out_polys.clear();
}
else
{
IntRect r = clpr.GetBounds();
Polygon outer(4);
outer[0] = IntPoint(r.left - 10, r.bottom + 10);
outer[1] = IntPoint(r.right + 10, r.bottom + 10);
outer[2] = IntPoint(r.right + 10, r.top - 10);
outer[3] = IntPoint(r.left - 10, r.top - 10);
clpr.AddPolygon(outer, ptSubject);
if (clpr.Execute(ctUnion, out_polys, pftNegative, pftNegative))
{
out_polys.erase(out_polys.begin());
ReversePoints(out_polys);
} else
out_polys.clear();
}
}
//------------------------------------------------------------------------------
private:
void AddPoint(const IntPoint& pt)
{
Polygon::size_type len = m_curr_poly->size();
if (len == m_curr_poly->capacity())
m_curr_poly->reserve(len + buffLength);
m_curr_poly->push_back(pt);
}
//------------------------------------------------------------------------------
void DoSquare(double mul = 1.0)
{
IntPoint pt1 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_k].X * m_delta),
(long64)Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta));
IntPoint pt2 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta),
(long64)Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta));
if ((normals[m_k].X * normals[m_j].Y - normals[m_j].X * normals[m_k].Y) * m_delta >= 0)
{
double a1 = std::atan2(normals[m_k].Y, normals[m_k].X);
double a2 = std::atan2(-normals[m_j].Y, -normals[m_j].X);
a1 = std::fabs(a2 - a1);
if (a1 > pi) a1 = pi * 2 - a1;
double dx = std::tan((pi - a1)/4) * std::fabs(m_delta * mul);
pt1 = IntPoint((long64)(pt1.X -normals[m_k].Y * dx),
(long64)(pt1.Y + normals[m_k].X * dx));
AddPoint(pt1);
pt2 = IntPoint((long64)(pt2.X + normals[m_j].Y * dx),
(long64)(pt2.Y -normals[m_j].X * dx));
AddPoint(pt2);
}
else
{
AddPoint(pt1);
AddPoint(m_p[m_i][m_j]);
AddPoint(pt2);
}
}
//------------------------------------------------------------------------------
void DoMiter()
{
if ((normals[m_k].X * normals[m_j].Y - normals[m_j].X * normals[m_k].Y) * m_delta >= 0)
{
double q = m_delta / m_R;
AddPoint(IntPoint((long64)Round(m_p[m_i][m_j].X +
(normals[m_k].X + normals[m_j].X) * q),
(long64)Round(m_p[m_i][m_j].Y + (normals[m_k].Y + normals[m_j].Y) * q)));
}
else
{
IntPoint pt1 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_k].X *
m_delta), (long64)Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta));
IntPoint pt2 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_j].X *
m_delta), (long64)Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta));
AddPoint(pt1);
AddPoint(m_p[m_i][m_j]);
AddPoint(pt2);
}
}
//------------------------------------------------------------------------------
void DoRound()
{
IntPoint pt1 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_k].X * m_delta),
(long64)Round(m_p[m_i][m_j].Y + normals[m_k].Y * m_delta));
IntPoint pt2 = IntPoint((long64)Round(m_p[m_i][m_j].X + normals[m_j].X * m_delta),
(long64)Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta));
AddPoint(pt1);
//round off reflex angles (ie > 180 deg) unless almost flat (ie < ~10deg).
if ((normals[m_k].X*normals[m_j].Y - normals[m_j].X*normals[m_k].Y) * m_delta >= 0)
{
if (normals[m_j].X * normals[m_k].X + normals[m_j].Y * normals[m_k].Y < 0.985)
{
double a1 = std::atan2(normals[m_k].Y, normals[m_k].X);
double a2 = std::atan2(normals[m_j].Y, normals[m_j].X);
if (m_delta > 0 && a2 < a1) a2 += pi *2;
else if (m_delta < 0 && a2 > a1) a2 -= pi *2;
Polygon arc = BuildArc(m_p[m_i][m_j], a1, a2, m_delta);
for (Polygon::size_type m = 0; m < arc.size(); m++)
AddPoint(arc[m]);
}
}
else
AddPoint(m_p[m_i][m_j]);
AddPoint(pt2);
}
//--------------------------------------------------------------------------
}; //end PolyOffsetBuilder
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
double delta, JoinType jointype, double MiterLimit)
{
if (&out_polys == &in_polys)
{
Polygons poly2(in_polys);
PolyOffsetBuilder(poly2, out_polys, delta, jointype, MiterLimit);
}
else PolyOffsetBuilder(in_polys, out_polys, delta, jointype, MiterLimit);
}
//------------------------------------------------------------------------------
void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys)
{
Clipper c;
c.AddPolygon(in_poly, ptSubject);
c.Execute(ctUnion, out_polys);
}
//------------------------------------------------------------------------------
void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys)
{
Clipper c;
c.AddPolygons(in_polys, ptSubject);
c.Execute(ctUnion, out_polys);
}
//------------------------------------------------------------------------------
void SimplifyPolygons(Polygons &polys)
{
SimplifyPolygons(polys, polys);
}
//------------------------------------------------------------------------------
std::ostream& operator <<(std::ostream &s, IntPoint& p)
{
s << p.X << ' ' << p.Y << "\n";
return s;
}
//------------------------------------------------------------------------------
std::ostream& operator <<(std::ostream &s, Polygon &p)
{
for (Polygon::size_type i = 0; i < p.size(); i++)
s << p[i];
s << "\n";
return s;
}
//------------------------------------------------------------------------------
std::ostream& operator <<(std::ostream &s, Polygons &p)
{
for (Polygons::size_type i = 0; i < p.size(); i++)
s << p[i];
s << "\n";
return s;
}
//------------------------------------------------------------------------------
} //ClipperLib namespace
| [
"hugo@hugomatic.ca"
] | hugo@hugomatic.ca |
4ac48ddd3f31dbf7846996e902980cf81212c074 | 209b44ca9f1ebab2fc4b189cee293fbea9c523f5 | /Model/Node.cpp | 77898915ffd947073d924dd01ccdba3078699c75 | [] | no_license | Sydothekido11/FixedNodes | c43eb6c47f0bf11675e926576b6351a6ef719fbc | d8fb7f5c88e9ee6ca3db697b29e142d79d06a29e | refs/heads/master | 2021-01-01T03:58:44.550175 | 2016-05-23T19:40:19 | 2016-05-23T19:40:19 | 57,071,817 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 630 | cpp | /*
* Node.cpp
*
* Created on: Jan 27, 2016
* Author: snem8901
*/
#include "Node.h"
//#include <iostream>
template <class Type>
Node<Type>::Node()
{
this->value=0;
this->pointers = nullptr;
}
template <class Type>
Node<Type>::Node(const Type& value)
{
this->value = value;
this->pointers = nullptr;
}
template <class Type>
Node<Type>::~Node()
{
}
template <class Type>
Type Node<Type> :: getValue()
{
return this->value;
}
template <class Type>
void Node<Type> :: setValue(const Type& value)
{
this->value = value;
}
template <class Type>
Node<Type> * Node<Type> :: getPointers()
{
return this->pointers;
}
| [
"snem8901@740s-pl-109.local"
] | snem8901@740s-pl-109.local |
f9151deca1adcb12b2ec383942e3bbc3067ca63b | b23cd20968179a67bb3b16a44e9ca19cb47fa0d8 | /lib/Target/Cpu0/Cpu0SEISelLowering.cpp | 8d3b8d2f25ad595d6b3bf8c29070e37f2e94d18f | [
"NCSA"
] | permissive | ttjost/llvm_rep | 1abadc8e81be8d974720472131fe0175a9c43aef | 5ace0c872c966333bbae0063337838cc48960ae5 | refs/heads/master | 2021-01-13T15:04:39.142676 | 2016-12-12T17:13:46 | 2016-12-12T17:13:46 | 76,277,936 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,197 | cpp | //===-- MipsSEISelLowering.cpp - MipsSE DAG Lowering Interface --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Subclass of MipsTargetLowering specialized for mips32/64.
//
//===----------------------------------------------------------------------===//
#include "Cpu0MachineFunction.h"
#include "Cpu0SEISelLowering.h"
#if CH >= CH3_1
#include "Cpu0RegisterInfo.h"
#include "Cpu0TargetMachine.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
using namespace llvm;
#define DEBUG_TYPE "cpu0-isel"
static cl::opt<bool>
EnableCpu0TailCalls("enable-cpu0-tail-calls", cl::Hidden,
cl::desc("CPU0: Enable tail calls."), cl::init(false));
Cpu0SETargetLowering::Cpu0SETargetLowering(Cpu0TargetMachine &TM,
const Cpu0Subtarget &STI)
: Cpu0TargetLowering(TM, STI) {
// Set up the register classes
addRegisterClass(MVT::i32, &Cpu0::CPURegsRegClass);
computeRegisterProperties();
}
const Cpu0TargetLowering *
llvm::createCpu0SETargetLowering(Cpu0TargetMachine &TM,
const Cpu0Subtarget &STI) {
return new Cpu0SETargetLowering(TM, STI);
}
#if CH >= CH9_1
bool Cpu0SETargetLowering::
isEligibleForTailCallOptimization(const Cpu0CC &Cpu0CCInfo,
unsigned NextStackOffset,
const Cpu0FunctionInfo& FI) const {
if (!EnableCpu0TailCalls)
return false;
// Return false if either the callee or caller has a byval argument.
if (Cpu0CCInfo.hasByValArg() || FI.hasByvalArg())
return false;
// Return true if the callee's argument area is no larger than the
// caller's.
return NextStackOffset <= FI.getIncomingArgSize();
}
#endif
#endif // #if CH >= CH3_1
| [
"tiagotrevisanjost@gmail.com"
] | tiagotrevisanjost@gmail.com |
d4994762ee37466eea705d59fb0d98e2e429f9b9 | f1f22bdcaed0d1a3081ed1a3d55f0b28aca03411 | /MidTerm_Test/Practice05/Practice05-2/p5-2.cpp | ecfb7ce4aa220318409caf256eb780c6def857d3 | [] | no_license | ITlearning/2019_CPP | 2bb7cb1657908a7b588396a05156fd80a4a3bda1 | 27daac0a802f0f567b7d76a9fd30c380a77f88e7 | refs/heads/master | 2022-03-12T07:13:56.960026 | 2019-11-26T15:46:54 | 2019-11-26T15:46:54 | 213,922,008 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 671 | cpp | #include <iostream>
using namespace std;
class ArrayUtility {
public:
static void intToDouble(int source[], double dest[], int size) {
for (int i = 0; i < size; i++) {
dest[i] = (double)source[i];
}
}
static void doubleToInt(double source[], int dest[], int size) {
for (int i = 0; i < size; i++) {
dest[i] = (int)source[i];
}
}
};
int main() {
int x[] = { 1,2,3,4,5 };
double y[5];
double z[] = { 9.9, 8.8, 7.7, 6.6, 5.6 };
ArrayUtility::intToDouble(x, y, 5);
for (int i = 0; i < 5; i++) {
cout << y[i] << ' ';
}
cout << endl;
ArrayUtility::doubleToInt(z, x, 5);
for (int i = 0; i < 5; i++) {
cout << x[i] << ' ';
}
cout << endl;
} | [
"yo7504@naver.com"
] | yo7504@naver.com |
60ecd0fc06b4eb3cbe9fa4b11f02bc5d8f67c5bb | 56dc83b864de250b0b0fde6892d934dae0900fb2 | /SevenSegementDisplay/BasicHttpClient/BasicHttpClient.ino | c15a95161225ca67df9845a9a9d34d2be6d26b53 | [] | no_license | timdows/AMD | 192b2aa4b4e481229d563487a4c41717d5f8c954 | 11577e2a7b0d93bd6745d99af430483e97ad3a50 | refs/heads/master | 2020-04-07T04:49:26.500401 | 2018-12-21T15:54:18 | 2018-12-21T15:54:18 | 41,149,960 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,478 | ino | /**
BasicHTTPClient.ino
Created on: 24.05.2015
*/
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#define USE_SERIAL Serial
ESP8266WiFiMulti WiFiMulti;
void setup() {
USE_SERIAL.begin(9600);
// USE_SERIAL.setDebugOutput(true);
USE_SERIAL.println();
USE_SERIAL.println();
USE_SERIAL.println();
for (uint8_t t = 4; t > 0; t--) {
USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
USE_SERIAL.flush();
delay(1000);
}
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("Timdows", "xxxxxx");
}
void loop() {
// wait for WiFi connection
if ((WiFiMulti.run() == WL_CONNECTED)) {
HTTPClient http;
USE_SERIAL.print("[HTTP] begin...\n");
// configure traged server and url
http.begin("http://xxxxx.timdows.com/xxxx/xxxxx"); //HTTP
USE_SERIAL.print("[HTTP] GET...\n");
// start connection and send HTTP header
int httpCode = http.GET();
// httpCode will be negative on error
if (httpCode > 0) {
// HTTP header has been send and Server response header has been handled
//USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);
// file found at server
if (httpCode == HTTP_CODE_OK) {
String payload = http.getString();
USE_SERIAL.println(payload);
}
} else {
USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
}
http.end();
}
delay(10000);
}
| [
"tim@inexpro.nl"
] | tim@inexpro.nl |
2ea93f97678fe6e50f42a7fed52fb8aa316e21a2 | af0ecafb5428bd556d49575da2a72f6f80d3d14b | /CodeJamCrawler/dataset/12_25470_35.cpp | 3cae889955865ff6933dccd9d9de1c149cf68caf | [] | no_license | gbrlas/AVSP | 0a2a08be5661c1b4a2238e875b6cdc88b4ee0997 | e259090bf282694676b2568023745f9ffb6d73fd | refs/heads/master | 2021-06-16T22:25:41.585830 | 2017-06-09T06:32:01 | 2017-06-09T06:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,579 | cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
#define openfile {freopen("B-large.in","r",stdin);freopen("a.out","w",stdout);}
#define debug 01
int n, s, p, te, t[105];
int f[105][105];
void init() {
memset(f,0,sizeof(f[0][0])*105*105);
f[0][1] = -999999999;
}
int analyze1(int x) {
x--;
int res = 0, k;
for (int i=0;i<=10;i++) {
for (int j=i-1;j<=i+1;j++) {
if (j<0) continue;
k = t[x]-i-j;
if (k<0) continue;
if (abs(k-i)<2&&abs(k-j)<2)
res = max(res,max(i,max(j,k)));
}
}
return res;
}
int analyze2(int x) {
x--;
int res = 0, k, cnt;
for (int i=0;i<=10;i++) {
for (int j=i-2;j<=i+2;j++) {
if (j<0) continue;
k = t[x]-i-j;
if (k<0) continue;
cnt = 0;
if (abs(k-i)>2) cnt++;
if (abs(k-j)>2) cnt++;
if (abs(i-j)>2) cnt++;
if (cnt==0)
res = max(res,max(i,max(j,k)));
}
}
return res;
}
void solve() {
int x;
for (int i=1;i<=n;i++)
for (int j=0;j<=min(i,s);j++) {
//th1
if (f[i-1][j]>=0) {
x = analyze1(i);
if (x>=p) f[i][j] = max(f[i][j],f[i-1][j]+1);
else f[i][j] = max(f[i][j],f[i-1][j]);
}
/******/
//th2
if (j==0) continue;
x = analyze2(i);
if (x>=p) f[i][j] = max(f[i][j],f[i-1][j-1]+1);
else f[i][j] = max(f[i][j],f[i-1][j-1]);
}
}
int main() {
if (debug) openfile;
scanf("%d",&te);
for (int i=0;i<te;i++) {
scanf("%d%d%d",&n,&s,&p);
for (int j=0;j<n;j++) scanf("%d",&t[j]);
init();
solve();
printf("Case #%d: %d\n",i+1,f[n][s]);
}
}
| [
"nikola.mrzljak@fer.hr"
] | nikola.mrzljak@fer.hr |
5d16a6dfe3267f965bbf629bd6e6cb8a5ab6e22e | cde9dc97b0fc3df945e2500a4b21deb9caf994cf | /rasteroperations/source/movingaverage.cpp | 6ebc8bc0df5a263ce5ec791830404f45873673af | [] | no_license | MartinSchouwenburg/ilwisobjects | 7bbe06a9c097472dea0496522465f59701782351 | ad59176c1eb79d56089abc009ea1622958d78fe4 | refs/heads/main | 2023-05-10T13:46:05.864706 | 2021-06-14T08:56:55 | 2021-06-14T08:56:55 | 373,075,845 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,602 | cpp | /*IlwisObjects is a framework for analysis, processing and visualization of remote sensing and gis data
Copyright (C) 2018 52n North
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.*/
#include <functional>
#include <future>
#include "kernel.h"
#include "raster.h"
#include "featurecoverage.h"
#include "feature.h"
#include "table.h"
#include "featureiterator.h"
#include "symboltable.h"
#include "ilwisoperation.h"
#include "georefimplementation.h"
#include "simpelgeoreference.h"
#include "cornersgeoreference.h"
#include "movingaverage.h"
using namespace Ilwis;
using namespace RasterOperations;
REGISTER_OPERATION(MovingAverage)
MovingAverage::MovingAverage()
{
}
MovingAverage::~MovingAverage()
{
}
MovingAverage::MovingAverage(quint64 metaid, const Ilwis::OperationExpression &expr) : OperationImplementation(metaid,expr)
{
}
Ilwis::OperationImplementation *MovingAverage::create(quint64 metaid, const Ilwis::OperationExpression &expr)
{
return new MovingAverage(metaid,expr);
}
bool MovingAverage::execute(ExecutionContext *ctx, SymbolTable &symTable)
{
if (_prepState == sNOTPREPARED)
if((_prepState = prepare(ctx,symTable)) != sPREPARED)
return false;
std::vector<Ilwis::Coordinate> cPoints;
std::vector<double> rAttrib;
long xsize = _inputgrf->size().xsize();
long ysize = _inputgrf->size().ysize();
double rMinDist = _limDist * 1.0e-10; // minimal distance taken into account
long iNrPoints = _inputfeatures->featureCount(itPOINT);
long iNrValidPnts = 0; // valid point counter
cPoints.resize(iNrPoints);
rAttrib.resize(iNrPoints);
bool needCoordinateTransformation = _inputgrf->coordinateSystem() != _inputfeatures->coordinateSystem();
for(auto feature : _inputfeatures){
if ( feature->geometryType() != itPOINT)
continue;
Coordinate crd(*feature->geometry()->getCoordinate());
if ( needCoordinateTransformation)
crd = _outputraster->coordinateSystem()->coord2coord(_inputfeatures->coordinateSystem(), crd);
if (crd.isValid()) {
double rVal = feature(_attribute).toDouble();
cPoints[iNrValidPnts] = crd;
rAttrib[iNrValidPnts] = rVal;
++iNrValidPnts;
}
}
PixelIterator pixiter(_outputraster);
Pixel pix;
double mmax = -1e308, mmin = 1e308;
for (long ypos = 0; ypos < ysize; ypos++) {
pix.y = ypos;
for (long xpos = 0; xpos < xsize; xpos++) {
pix.x = xpos;
if (pix.isValid() && pixiter.contains(pix)) {
Coordinate crdRC = _inputgrf->pixel2Coord(pix);
double rSumW = 0.0; // Sum Weight's
double rSumWtA = 0.0; // Sum of Weight times atrribute
for (long iPc = 0; iPc < iNrValidPnts; iPc++) {
double rDistance = crdRC.distance(cPoints[iPc]);
if (rDistance < rMinDist && _wft == wfEXACT ) {
rSumWtA = rAttrib[iPc]; // only 1 point exactly in center of estimated
rSumW = 1; // pixel contributes to its value
break; // no more points, even if they coincide with this first-found point
} else if (rDistance < _limDist) {
double rW;
if(_wft == wfEXACT) {
rW = rInvDist(rDistance);
} else {
rW = rLinDecr(rDistance);
}
rSumW += rW;
rSumWtA += rW * rAttrib[iPc];
}
}
double value;
if (rSumW == 0.0) {
value = rUNDEF;
} else {
value = rSumWtA / rSumW; // apply normalized weights
mmax = Ilwis::max(mmax, value);
mmin = Ilwis::min(mmin, value);
}
pixiter = pix;
*pixiter = value;
}
}
}
NumericRange *rng = new NumericRange(mmin, mmax, 0);
_outputraster->datadefRef().range(rng);
QVariant value;
value.setValue<IRasterCoverage>( _outputraster );
logOperation(_outputraster, _expression, { _inputfeatures , _inputgrf});
ctx->setOutput(symTable,value,_outputraster->name(), itRASTER, _outputraster->resource() );
return true;
}
Ilwis::OperationImplementation::State MovingAverage::prepare(ExecutionContext *ctx, const SymbolTable &st)
{
OperationImplementation::prepare(ctx,st);
QString features = _expression.parm(0).value();
QString outputName = _expression.parm(0,false).value();
if (!_inputfeatures.prepare(features, itFEATURE)) {
ERROR2(ERR_COULD_NOT_LOAD_2,features,"");
return sPREPAREFAILED;
}
_attribute = _expression.parm(1).value();
QString weightFunct = _expression.parm(2).value();
if ( weightFunct.toLower() == "invdist")
_wft = wfEXACT;
else if (weightFunct.toLower() == "linear")
_wft = wfNOTEXACT;
else {
ERROR1("Invalid weight function '%1'; should be Linear or InvDist", weightFunct);
return sPREPAREFAILED;
}
_exp = _expression.parm(3).value().toDouble();
_limDist = _expression.parm(4).value().toDouble();
if (_limDist == rUNDEF || _limDist < EPS10) {
ERROR1("Invalid limiting distance '%1'", _expression.parm(4).value());
return sPREPAREFAILED;
}
if ( _expression.parameterCount() == 6) { // the georef case
QString georefname = _expression.parm(5).value();
if (!_inputgrf.prepare(georefname, itGEOREF)) {
ERROR2(ERR_COULD_NOT_LOAD_2,georefname,"");
return sPREPAREFAILED;
}
} else if ( _expression.parameterCount() == 7) {
int xsize = _expression.parm(5).value().toInt();
int ysize = _expression.parm(6).value().toInt();
IGeoReference grf(outputName);
grf->create("corners");
grf->size(Size<>(xsize, ysize,1));
grf->coordinateSystem(_inputfeatures->coordinateSystem());
QSharedPointer< CornersGeoReference> spGrf = grf->as< CornersGeoReference>();
spGrf->internalEnvelope(_inputfeatures->envelope());
grf->compute();
_inputgrf = grf;
}
quint32 colIndex = _inputfeatures->attributeDefinitions().columnIndex(_attribute);
if (colIndex == iUNDEF) {
ERROR2(ERR_COLUMN_MISSING_2,_attribute,features);
return sPREPAREFAILED;
}
const DataDefinition & datadef = _inputfeatures->attributeDefinitions().columndefinitionRef(colIndex).datadef();
IDomain dom;
if (datadef.isValid())
dom = datadef.domain();
else
dom = IDomain("code=domain:value");
_outputraster.prepare();
if (outputName != sUNDEF)
_outputraster->name(outputName);
_outputraster->coordinateSystem(_inputgrf->coordinateSystem());
Envelope env = _inputgrf->coordinateSystem()->convertEnvelope(_inputfeatures->coordinateSystem(), _inputfeatures->envelope());
_outputraster->envelope(env);
_outputraster->georeference(_inputgrf);
std::vector<double> indexes = {0};
_outputraster->setDataDefintions(dom,indexes);
return sPREPARED;
}
double MovingAverage::rInvDist(double rDis)
{
if ((rDis < EPS20) || (rDis > _limDist))
return 0;
double rX = _limDist / rDis ; // reduced distance inverted
return std::pow(std::abs(rX), _exp) - 1; // w = (1/d)^n - 1
}
double MovingAverage::rLinDecr(double rDis)
{
if (rDis < EPS10)
return 1;
if (rDis > _limDist)
return 0;
double rX = rDis / _limDist; // reduced distance
return 1 - std::pow(std::abs(rX), _exp); // w = 1 - d^n
}
quint64 MovingAverage::createMetadata()
{
OperationResource operation({"ilwis://operations/movingaverage"});
operation.setLongName("Moving Average");
operation.setSyntax("movingaverage(inputpointmap,attribute,invDist | linear,exp,limDist,georef| xsize[,ysize])");
operation.setDescription(TR("The Moving average operation is a point interpolation which requires a point map as input and returns a raster map as output"));
operation.setInParameterCount({6,7});
operation.addInParameter(0,itPOINT, TR("input featurecoverage"),TR("input featurecoverage with any domain"));
operation.addInParameter(1,itSTRING,TR("attribute"),TR("The attribute of the featurecoverage whose values are interpolated"));
operation.addInParameter(2,itSTRING,TR("weight function"),TR("The method of weight function to be applied. Either Inverse Distance method or Linear distance method"));
operation.addInParameter(3,itDOUBLE, TR("weight exponent"),TR("value for weight exponent n to be used in the specified weight function (real value, usually a value close to 1.0)."));
operation.addInParameter(4,itDOUBLE,TR("Limiting distance"),TR("value for the limiting distance: points that are farther away from an output pixel than the limiting distance obtain weight zero"));
operation.addInParameter(5,itGEOREF | itINTEGER, TR("input georeference or x size"),TR("the parameter can either be a georeference or the x extent of the the to be created raster"));
operation.addInParameter(6,itINTEGER, TR("input y size"),TR("optional y size of the output raster. Only used of the previous parameter was an x size"));
operation.setOutParameterCount({1});
operation.addOutParameter(0,itRASTER, TR("output rastercoverage"), TR("output rastercoverage with the domain of the input map"));
operation.setKeywords("raster,point,interpolation");
operation.checkAlternateDefinition();
mastercatalog()->addItems({operation});
return operation.id();
}
| [
"m.l.schouwenburg@utwente.nl"
] | m.l.schouwenburg@utwente.nl |
17b3ca31cefdbbddb188c08ae5e8cbc9a57af78c | 4f37081ed62e44afa0b2465388a8adf9b5490b13 | /device/fido/ctap_make_credential_request.h | 09bb87c50c4bbcb2e07a10538c8e302eb1a22303 | [
"BSD-3-Clause"
] | permissive | zowhair/chromium | 05b9eed58a680941c3595d52c3c77b620ef2c3ac | d84d5ef83e401ec210fcb14a92803bf339e1ccce | refs/heads/master | 2023-03-04T23:15:10.914156 | 2018-03-15T11:27:44 | 2018-03-15T11:27:44 | 125,359,706 | 1 | 0 | null | 2018-03-15T11:50:44 | 2018-03-15T11:50:43 | null | UTF-8 | C++ | false | false | 2,888 | h | // Copyright 2017 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 DEVICE_FIDO_CTAP_MAKE_CREDENTIAL_REQUEST_H_
#define DEVICE_FIDO_CTAP_MAKE_CREDENTIAL_REQUEST_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "base/component_export.h"
#include "base/macros.h"
#include "base/optional.h"
#include "device/fido/public_key_credential_descriptor.h"
#include "device/fido/public_key_credential_params.h"
#include "device/fido/public_key_credential_rp_entity.h"
#include "device/fido/public_key_credential_user_entity.h"
namespace device {
// Object containing request parameters for AuthenticatorMakeCredential command
// as specified in
// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html
class COMPONENT_EXPORT(DEVICE_FIDO) CtapMakeCredentialRequest {
public:
CtapMakeCredentialRequest(
std::vector<uint8_t> client_data_hash,
PublicKeyCredentialRpEntity rp,
PublicKeyCredentialUserEntity user,
PublicKeyCredentialParams public_key_credential_params);
CtapMakeCredentialRequest(CtapMakeCredentialRequest&& that);
CtapMakeCredentialRequest& operator=(CtapMakeCredentialRequest&& that);
~CtapMakeCredentialRequest();
std::vector<uint8_t> EncodeAsCBOR() const;
CtapMakeCredentialRequest& SetUserVerificationRequired(
bool user_verfication_required);
CtapMakeCredentialRequest& SetResidentKeySupported(bool resident_key);
CtapMakeCredentialRequest& SetExcludeList(
std::vector<PublicKeyCredentialDescriptor> exclude_list);
CtapMakeCredentialRequest& SetPinAuth(std::vector<uint8_t> pin_auth);
CtapMakeCredentialRequest& SetPinProtocol(uint8_t pin_protocol);
const std::vector<uint8_t>& client_data_hash() const {
return client_data_hash_;
}
const PublicKeyCredentialRpEntity& rp() const { return rp_; }
const PublicKeyCredentialUserEntity user() const { return user_; }
const PublicKeyCredentialParams& public_key_credential_params() const {
return public_key_credential_params_;
}
bool user_verification_required() const {
return user_verification_required_;
}
bool resident_key_supported() const { return resident_key_supported_; }
private:
std::vector<uint8_t> client_data_hash_;
PublicKeyCredentialRpEntity rp_;
PublicKeyCredentialUserEntity user_;
PublicKeyCredentialParams public_key_credential_params_;
bool user_verification_required_ = false;
bool resident_key_supported_ = false;
base::Optional<std::vector<PublicKeyCredentialDescriptor>> exclude_list_;
base::Optional<std::vector<uint8_t>> pin_auth_;
base::Optional<uint8_t> pin_protocol_;
DISALLOW_COPY_AND_ASSIGN(CtapMakeCredentialRequest);
};
} // namespace device
#endif // DEVICE_FIDO_CTAP_MAKE_CREDENTIAL_REQUEST_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
c1fbbfa5b6c0457ffc85ccb9839fb9f42445c713 | 8fb9ae63c6a64d9f0789643405be4282c33c3a1b | /UVA/195 - Anagram_v2.cpp | 027dfff03f33b557fe502a1a35b4ded6ff652da2 | [] | no_license | RafikFarhad/Code_is_fun | 7c67b4d9c97d7e58ccf822214d1ba4fe51b88ba6 | 08fd1c53125deaaeb0d6aac8f9c2fd7c76a05e4d | refs/heads/master | 2021-07-25T13:32:48.839014 | 2021-01-10T00:23:34 | 2021-01-10T00:23:34 | 46,503,470 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,045 | cpp | /// RAFIK FARHAD
/// fb.com/rafikfarhad
/// SUST_CSE_13
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <algorithm>
#include <new>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#define MAX3(a, b, c) MAX(a , MAX(b,c))
#define MIN3(a, b, c) MIN(a , MIN(b,c))
#define sf scanf
#define ssf sscanf
#define pb push_back
#define PPP system("pause");
#define ppp system("pause");
#define ok cout << "OK" <<endl;
#define pf printf
#define PI 2*acos(0)
#define SIZE 10000000
using namespace std;
template <class T> T MAX(T a, T b)
{
return a>b?a:b;
}
template <class T> T MIN(T a, T b)
{
return a<b?a:b;
}
template <class T> void MyDebug(T x, T y)
{
cout << "Debugging: " << x << ", " << y << endl;
}
template <class T> void MyDebug(T x, T y, T z)
{
cout << "Debugging: " << x << ", " << y << ", " << z << endl;
}
int main()
{
// time_t t1=clock();
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
#ifndef ONLINE_JUDGE
freopen("195.inp","r",stdin);
#endif
/// MAIN
string a;
map <int , string> mp;
int t, len, i, j, k, ar[1000];
sf("%d ", &t);
while(t--)
{
cin >> a;
mp.clear();
len = a.size();
for(j=0; j<len; j++)
{
k = a[j];
if(k>='A' && k<='Z')
k = k*2;
else k = 131+((k-'a')*2);
mp[k] = a[j];
ar[j] = k;
}
for(j=0; j<len; j++)
cout << mp[ar[j]];
cout << endl;
while(next_permutation(ar, ar+len))
{
for(j=0; j<len; j++)
cout << mp[ar[j]];
cout << endl;
}
}
/// ENDD
// time_t t2=clock();
// cout << " My time: " <<(t2-t1) << endl;;
return 0;
}
| [
"rafikfarhad@gmail.com"
] | rafikfarhad@gmail.com |
058101afe14be88a3c060160242d11f23a27ffe3 | 4b895264eb78dfe5c77eb73bc805a6ccdcdb3e6a | /part4/test/Test.cc | c938134bef2dd5ce71b2bcee9cdcb53f02a85863 | [] | no_license | louis-xu-ustc/CMakeTutorial | 7965375bb5a98db7b18e7a2a2af9ed65e192ecbe | 6f296bdd8173ee190e802d0659cc37255ac73f6a | refs/heads/master | 2021-04-12T11:11:58.416838 | 2018-03-26T20:08:31 | 2018-03-26T20:08:31 | 126,872,833 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 85 | cc | #include "Library.h"
int main(int argc, char** argv)
{
print();
return 0;
}
| [
"yunpeng.xu@aptiv.com"
] | yunpeng.xu@aptiv.com |
acd474a2cb2efc1273034949b8af864ff12b6543 | 6a85c1c65a9f290ee49261aca29614f73a07bbab | /common/parser/bison_parser_common_test.cc | a981c3493d08d818d2991eb78e627ea1939cfaf1 | [
"Apache-2.0"
] | permissive | MinaToma/verible | 95c246643913e7340b0554773b366977f9bd5fc6 | 4323aa5260bc40c3315ce46ea29f77a5e6e4688b | refs/heads/master | 2023-01-10T13:11:20.641089 | 2020-11-12T16:00:39 | 2020-11-12T16:01:47 | 282,202,509 | 1 | 0 | Apache-2.0 | 2020-08-17T17:06:31 | 2020-07-24T11:29:43 | C++ | UTF-8 | C++ | false | false | 2,252 | cc | // Copyright 2017-2020 The Verible 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.
// Unit tests for bison_parser_common.
#include "common/parser/bison_parser_common.h"
#include <memory>
#include "gtest/gtest.h"
#include "absl/strings/string_view.h"
#include "common/lexer/lexer.h"
#include "common/lexer/token_stream_adapter.h"
#include "common/parser/parser_param.h"
#include "common/text/concrete_syntax_leaf.h"
#include "common/text/concrete_syntax_tree.h"
#include "common/text/symbol.h"
#include "common/text/token_info.h"
namespace verible {
namespace {
// MockLexer is just for testing, and returns a fixed token.
class MockLexer : public Lexer {
public:
MockLexer() : token_(13, "foo") {}
const TokenInfo& GetLastToken() const override { return token_; }
const TokenInfo& DoNextToken() override { return token_; }
void Restart(absl::string_view) override {}
bool TokenIsError(const TokenInfo&) const override { return false; }
private:
TokenInfo token_;
};
// Test that Lex fetches a token of the expected value.
TEST(BisonParserCommonTest, LexTest) {
MockLexer lexer;
auto generator = MakeTokenGenerator(&lexer);
ParserParam parser_param(&generator);
SymbolPtr value;
const int token_enum = verible::LexAdapter(&value, &parser_param);
const TokenInfo& t(parser_param.GetLastToken());
EXPECT_EQ(13, token_enum);
EXPECT_EQ(13, t.token_enum());
EXPECT_EQ(t.text(), "foo");
EXPECT_EQ(value->Kind(), SymbolKind::kLeaf);
const auto* value_ptr = down_cast<const SyntaxTreeLeaf*>(value.get());
ASSERT_NE(value_ptr, nullptr);
const TokenInfo& tref(value_ptr->get());
EXPECT_EQ(13, tref.token_enum());
EXPECT_EQ(tref.text(), "foo");
}
} // namespace
} // namespace verible
| [
"h.zeller@acm.org"
] | h.zeller@acm.org |
89de9e821ddb9ce86ab1c296e5b4545746e1514b | 85227ab940fd400fcd3373d792c597a57baecc31 | /mouse_event.cpp | aec5dd38804ea3e38034f7dfa2a9159026c15ef4 | [] | no_license | joke15/myTestCode | 3548837acbb26ee4082e84bf73ce591c171ec4b7 | 756e9b6f73c1c01c637f0503409a09a7d2861cf3 | refs/heads/master | 2023-01-04T00:13:11.155284 | 2020-10-29T07:17:21 | 2020-10-29T07:17:21 | 308,247,794 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,992 | cpp | // control_trigger.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <WinSock2.h>
#include <windows.h>
#include <wingdi.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define BUF_SIZE 256
#pragma comment(lib,"Ws2_32.lib")
//#pragma comment(lib,"Gdi32")
struct MouseEvent
{
unsigned __int32 type;
float x;
float y;
__int32 mouse_data;
};
struct KeyboardEvent
{
unsigned __int32 key;
bool key_down;
};
int srcleft_ = 0;
int srctop_ = 0;
int srcwidth_ = 0;
int srcheight_ = 0;
double GetMainScreenParam(int& width, int& height, double& iScaleX, double& iScaleY)
{
HDC hDDC = NULL;
HDC desktopDc = GetDC(NULL);
width = GetDeviceCaps(desktopDc, DESKTOPHORZRES);
height = GetDeviceCaps(desktopDc, DESKTOPVERTRES);
ReleaseDC(NULL, desktopDc);
int logicWidth = GetSystemMetrics(SM_CXSCREEN);
int logicHeight = GetSystemMetrics(SM_CYSCREEN);
iScaleX = 65535.0 / (width - 1);
iScaleY = 65535.0 / (height - 1);
double mainScale = width * 1.0 / logicWidth;
POINT pt;
pt.x = srcleft_ + 1;
pt.y = srctop_ + 1;
HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
MONITORINFOEX miex;
miex.cbSize = sizeof(miex);
GetMonitorInfo(hMonitor, &miex);
int cxLogical = (miex.rcMonitor.right - miex.rcMonitor.left);
int cyLogical = (miex.rcMonitor.bottom - miex.rcMonitor.top);
DEVMODE dm;
dm.dmSize = sizeof(dm);
dm.dmDriverExtra = 0;
EnumDisplaySettings(miex.szDevice, ENUM_CURRENT_SETTINGS, &dm);
int cxPhysical = dm.dmPelsWidth;
int cyPhysical = dm.dmPelsHeight;
double horzScale = ((double)cxPhysical / (double)cxLogical);
double vertScale = ((double)cyPhysical / (double)cyLogical);
double ret = mainScale / horzScale;
return ret;
}
void HandleMouseEvent(MouseEvent& item)
{
double iScaleX, iScaleY, iX, iY;
int iWidth, iHeight;
DWORD dwX, dwY;
int mainScreenWidth, mainScreenHeight;
double rate = GetMainScreenParam(mainScreenWidth, mainScreenHeight, iScaleX, iScaleY);
iWidth = srcwidth_ > 0 ? srcwidth_ : mainScreenWidth;
iHeight = srcheight_ > 0 ? srcheight_ : mainScreenHeight;
INPUT Input = { 0 };
iX = srcleft_ * iScaleX * rate + item.x * iWidth * iScaleX;
iY = srctop_ * iScaleY * rate + item.y * iHeight * iScaleY;
dwX = (DWORD)iX;
dwY = (DWORD)iY;
::ZeroMemory(&Input, sizeof(INPUT));
Input.type = INPUT_MOUSE;
Input.mi.dx = dwX;
Input.mi.dy = dwY;
switch (item.type)
{
case 10002:
case WM_LBUTTONDOWN:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN;
break;
}
case 10003:
case WM_LBUTTONUP:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTUP;
break;
}
case WM_MOUSEMOVE:
case 10001:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
break;
}
case WM_RBUTTONDOWN:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_RIGHTDOWN;
break;
}
case WM_RBUTTONUP:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_RIGHTUP;
break;
}
case WM_MBUTTONDOWN:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MIDDLEDOWN;
break;
}
case WM_MBUTTONUP:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MIDDLEUP;
break;
}
case WM_MOUSEWHEEL:
{
Input.mi.dwFlags = MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_WHEEL;
Input.mi.mouseData = item.mouse_data;
break;
}
default:
break;
}
if (::SendInput(1, &Input, sizeof(INPUT)))
{
printf("error\n");
std::cout << GetLastError();
}
}
// BYTE GetKeyCode(unsigned int keysym)
// {
// if ((keysym >= 32 && keysym <= 126) ||
// (keysym >= 160 && keysym <= 255))
// {
// SHORT s = VkKeyScan(keysym);
// BYTE vkCode = LOBYTE(s);
// return vkCode;
// }
// else
// {
// if (vkMap.find(keysym) == vkMap.end())
// {
// return keysym;
// }
// BYTE vkCode = vkMap[keysym];
// return vkCode;
// }
// }
// void HandleKeyboardEvent(KeyboardEvent &ev)
// {
// KEYBDINPUT kb = {0};
// INPUT input = {0};
// kb.wVk = static_cast<WORD>(Keymapper::instance().GetKeyCode(ev.key));
// if (!ev.key_down)
// {
// kb.dwFlags = KEYEVENTF_KEYUP;
// }
// input.type = INPUT_KEYBOARD;
// input.ki = kb;
// SendInput(1, &input, sizeof(input));
// if (ev.key == VK_RSHIFT || ev.key == VK_LSHIFT)
// {
// if (!ev.key_down)
// {
// INPUT input[2];
// ::ZeroMemory(input, sizeof(input));
// input[0].type = input[1].type = INPUT_KEYBOARD;
// input[0].ki.wVk = input[1].ki.wVk = ev.key;
// input[1].ki.dwFlags = KEYEVENTF_KEYUP; // THIS IS IMPORTANT
// ::SendInput(2, input, sizeof(INPUT));
// }
// }
// }
SOCKET Client;
BOOL Connection(char* lpszServerIp, int iServerPort);
void SendMsg(char* pszSend);// 发送数据
UINT Receive_Data(LPVOID lpVoid);//多线程接收数据
BOOL Connection(char* lpszServerIp, int iServerPort)
{
// 初始化 Winsock 库
WSADATA wsaData = { 0 };
::WSAStartup(MAKEWORD(2, 2), &wsaData);
// 创建流式套接字
Client = ::socket(AF_INET, SOCK_STREAM, 0);
if (INVALID_SOCKET == Client)
{
std::cout << "error1";
return FALSE;
}
// 设置服务端地址和端口信息
sockaddr_in addr = { 0 };
addr.sin_family = AF_INET;
addr.sin_port = ::htons(iServerPort);
addr.sin_addr.S_un.S_addr = ::inet_addr(lpszServerIp);
// 连接到服务器
if (0 != ::connect(Client, (sockaddr*)(&addr), sizeof(addr)))
{
std::cout << "error2";
return FALSE;
}
// 创建接收数据多线程
::CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Receive_Data, NULL, NULL, NULL);
return TRUE;
}
// 发送数据
void SendMsg(char* pszSend)
{
// 发送数据
::send(Client, pszSend, ::lstrlen(pszSend), 0);
printf("[我]%s\n", pszSend);
}
// 接收数据多线程
UINT Receive_Data(LPVOID lpVoid)
{
char szBuf[MAX_PATH] = { 0 };
while (TRUE)
{
// 接收数据
int iRet = ::recv(Client, szBuf, MAX_PATH, 0);
if (0 >= iRet)
{
continue;
}
printf("[她]%s\n", szBuf);
}
return 0;
}
int main()
{
char addr[] = "192.168.252.39";
if (FALSE == Connection(addr, 12488))
{
printf("Connection Error.\n");
}
printf("Connection OK.\n");
// 发送信息
char szSendBuf[MAX_PATH] = { 0 };
while (TRUE)
{
std::cin >> szSendBuf;
// 发送数据
SendMsg(szSendBuf);
}
return 0;
//初始化DLL
//WSADATA wsaData;
//WSAStartup(MAKEWORD(2, 2), &wsaData);
////创建套接字
//SOCKET sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
////向服务器发起请求
//sockaddr_in sockAddr;
//memset(&sockAddr, 0, sizeof(sockAddr)); //每个字节都用0填充
//sockAddr.sin_family = PF_INET;
//sockAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
//// sockAddr.sin_port = htons(12050);
//sockAddr.sin_port = htons(12488);
////connect(sock, (SOCKADDR*)&sockAddr, sizeof(SOCKADDR));
////{
//// char bufSend[BUF_SIZE] = { 0 };
//// sprintf_s(bufSend, "test");
//// send(sock, bufSend, BUF_SIZE, 0);
////}
//while (true)
//{
// //接收服务器传回的数据
// char bufRecv[BUF_SIZE] = { 0 };
// recv(sock, bufRecv, BUF_SIZE, 0);
// //输出接收到的数据
// printf("Message form server: %s\n", bufRecv);
// char* type = strtok(bufRecv, ",");
// char* x = strtok(NULL, ",");
// char* y = strtok(NULL, ",");
// int type1;
// float x1, y1;
// type1 = atoi(type);
// x1 = atof(x);
// y1 = atof(y);
// MouseEvent me;
// me.type = type1;
// me.x = x1;
// me.y = y1;
// me.mouse_data = 0;
// HandleMouseEvent(me);
//}
////关闭套接字
//closesocket(sock);
////终止使用 DLL
//WSACleanup();
//system("pause");
//return 0;
}
/*
build cmd
g++ mouse_event.cpp -l Gdi32 -l wsock32 -o mouse_event.exe
*/
// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单
// 入门使用技巧:
// 1. 使用解决方案资源管理器窗口添加/管理文件
// 2. 使用团队资源管理器窗口连接到源代码管理
// 3. 使用输出窗口查看生成输出和其他消息
// 4. 使用错误列表窗口查看错误
// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
| [
"lz231141@nd.com.cn"
] | lz231141@nd.com.cn |
1bcf41c5606a484f23390f213c2b74f3703ecc4d | 7817bb863b7ee98ff159991c9765327d63e297ed | /test/mock_io.cpp | 97e50e4569fd3c5c9a281cae5a82d5cc1b355a2c | [] | no_license | dynamatt/cup-pong-firmware | 2c78044acde0426f4e4d4c92615d13b66d901c4c | f901d2faa1f28fcf8fa4249b50947994f55bdf3d | refs/heads/master | 2023-07-25T10:54:28.061693 | 2023-07-15T04:25:53 | 2023-07-15T04:25:53 | 217,632,805 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 281 | cpp | #include "io.h"
uint16_t analogue_value;
uint8_t transmitter_enabled;
void IO_initialise() {
}
uint16_t IO_readReceiver() {
return analogue_value;
}
void IO_enableTransmitter() {
transmitter_enabled = 1;
}
void IO_disableTransmitter() {
transmitter_enabled = 0;
}
| [
"mattmwilliams89@gmail.com"
] | mattmwilliams89@gmail.com |
9c787d68ee5ca43d5f59a6a55b8f5ccfff8aacff | 85caa299cc7ddf32db9301ff99cd4c0281129e73 | /src/viewer/lsviewer/main.cpp | 137600127f8ec8b95af9ce64da16c59b96223602 | [] | no_license | mtao/MSc | f42f97e14341a9fe924d8e2f66e3f8ea4f77b3fe | d6f8220f35c4b44e45cfc73bc71c385303496117 | refs/heads/master | 2016-09-05T14:47:28.082342 | 2012-12-29T14:42:55 | 2012-12-29T14:42:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 393 | cpp | #include "window.h"
#include <QtGui>
#include <QGLWidget>
#include <iostream>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
LevelSetViewer viewer(":/shader");
//MeshViewer viewer("shader");
viewer.show();
if(argc>1)
{
std::cout << "Opening file: "<< argv[1] << std::endl;
viewer.openFile(argv[1]);
}
return app.exec();
}
| [
"mtao@dgp.toronto.edu"
] | mtao@dgp.toronto.edu |
e6bd27faf81547e7f46be13de98a068c01fe82af | 1ee13dc719329c88fe27000a4b74c83d891ac6ab | /lib/sched.cpp | 9d9e5334a22605021d3755802852e04dee4dfc17 | [] | no_license | moneytech/woot | 9be9e9bd44238198c26be32ef4ed970d59098817 | 7d0f505c66af58acb5d86d8421e97008875bac54 | refs/heads/master | 2020-09-28T09:03:33.426025 | 2019-02-23T13:43:28 | 2019-02-23T13:43:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 139 | cpp | #include <sched.h>
#include <thread.h>
int sched_yield()
{
Thread *ct = Thread::GetCurrent();
if(ct) ct->Yield();
return 0;
}
| [
"pvc.meheha@gmail.com"
] | pvc.meheha@gmail.com |
438cc7438ad86b6dd7bab628128454e049d11f06 | d4d020f8df79022278560631ab87f39fc1d4a8fd | /aws-cpp-sdk-quicksight/include/aws/quicksight/model/ListIAMPolicyAssignmentsResult.h | 83c5dbdcb14c5b6d492b7705bc2ed787eafae158 | [
"MIT",
"Apache-2.0",
"JSON"
] | permissive | Roy-Chou/aws-sdk-cpp | 98f107d04ec7b5de102eece03b405287b6777653 | 65da84d7f0b3ee37f8b4ca03ca06c7338367f073 | refs/heads/master | 2020-09-17T15:51:42.876187 | 2019-11-25T20:31:24 | 2019-11-25T20:31:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,312 | h | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/quicksight/QuickSight_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/quicksight/model/IAMPolicyAssignmentSummary.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace QuickSight
{
namespace Model
{
class AWS_QUICKSIGHT_API ListIAMPolicyAssignmentsResult
{
public:
ListIAMPolicyAssignmentsResult();
ListIAMPolicyAssignmentsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListIAMPolicyAssignmentsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline const Aws::Vector<IAMPolicyAssignmentSummary>& GetIAMPolicyAssignments() const{ return m_iAMPolicyAssignments; }
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline void SetIAMPolicyAssignments(const Aws::Vector<IAMPolicyAssignmentSummary>& value) { m_iAMPolicyAssignments = value; }
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline void SetIAMPolicyAssignments(Aws::Vector<IAMPolicyAssignmentSummary>&& value) { m_iAMPolicyAssignments = std::move(value); }
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithIAMPolicyAssignments(const Aws::Vector<IAMPolicyAssignmentSummary>& value) { SetIAMPolicyAssignments(value); return *this;}
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithIAMPolicyAssignments(Aws::Vector<IAMPolicyAssignmentSummary>&& value) { SetIAMPolicyAssignments(std::move(value)); return *this;}
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline ListIAMPolicyAssignmentsResult& AddIAMPolicyAssignments(const IAMPolicyAssignmentSummary& value) { m_iAMPolicyAssignments.push_back(value); return *this; }
/**
* <p>Information describing the IAM policy assignments.</p>
*/
inline ListIAMPolicyAssignmentsResult& AddIAMPolicyAssignments(IAMPolicyAssignmentSummary&& value) { m_iAMPolicyAssignments.push_back(std::move(value)); return *this; }
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline const Aws::String& GetNextToken() const{ return m_nextToken; }
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline void SetNextToken(const char* value) { m_nextToken.assign(value); }
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}
/**
* <p>The token for the next set of results, or null if there are no more
* results.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline const Aws::String& GetRequestId() const{ return m_requestId; }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(const Aws::String& value) { m_requestId = value; }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(Aws::String&& value) { m_requestId = std::move(value); }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline void SetRequestId(const char* value) { m_requestId.assign(value); }
/**
* <p>The AWS request ID for this operation.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithRequestId(const Aws::String& value) { SetRequestId(value); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithRequestId(Aws::String&& value) { SetRequestId(std::move(value)); return *this;}
/**
* <p>The AWS request ID for this operation.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithRequestId(const char* value) { SetRequestId(value); return *this;}
/**
* <p>The http status of the request.</p>
*/
inline int GetStatus() const{ return m_status; }
/**
* <p>The http status of the request.</p>
*/
inline void SetStatus(int value) { m_status = value; }
/**
* <p>The http status of the request.</p>
*/
inline ListIAMPolicyAssignmentsResult& WithStatus(int value) { SetStatus(value); return *this;}
private:
Aws::Vector<IAMPolicyAssignmentSummary> m_iAMPolicyAssignments;
Aws::String m_nextToken;
Aws::String m_requestId;
int m_status;
};
} // namespace Model
} // namespace QuickSight
} // namespace Aws
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
3bf340de47721d9b87d4bfb3c878b1204dfefa85 | e5ef3a75620a9abb270fc7602a17b0273d3c13ca | /Algorithms/dfs.cpp | d95ffabe5a525a58cd9a968be62515c9e35186bf | [] | no_license | Zyloc/Algorithm-and-library | 19197fab8f5ddc35b11daba5f4a5776f2a2da62c | 213034bfd013cc3c03e8cc5c4fe07111ddbfb021 | refs/heads/master | 2020-04-12T06:25:45.782093 | 2018-02-15T22:38:00 | 2018-02-15T22:38:00 | 60,200,527 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,664 | cpp | /*
* Satyam Swarnkar (Zyloc), Nit Silchar
*/
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <stack>
#include <iomanip>
#include <functional>
#include <limits.h>
#include <list>
using namespace std;
#define loop(i,start,end) for (int i=start;i<=end;i++)
#define pool(i,start,end) for(int i=start;i>=end;i--)
#define zyloc() lli t;cin>>t;while(t--)
#define vi(v) vector <long long int> v;
#define pb(n) push_back(n)
#define mp(a,b) make_pair(a,b)
#define fill(a,value) memset(a,value,sizeof(a))
#define MOD 1000000007
#define PI 3.14159265358979323846
#define MAX 1000002
#define vpi(v) vector <pair <long long int, long long int> > v
#define lli long long int
#define debug() cout<<"######"<<endl
class Graph{
lli V;
list <lli> *adj;
void DFSutil(lli vertex,bool visited[]);
public:
Graph(lli V);
void addEdge(lli from,lli to);
void DFS(lli start);
};
Graph::Graph(lli V){
this->V=V;
adj = new list<lli>[V];
}
void Graph::addEdge(lli from,lli to){
adj[from].pb(to);
}
void Graph::DFSutil(lli vertex,bool visited[]){
visited[vertex] = true;
cout<<vertex<<" ";
list<lli>::iterator it;
for(it=adj[vertex].begin();it!=adj[vertex].end();++it){
if (!visited[*it]){
DFSutil(*it,visited);
}
}
}
void Graph::DFS(lli start){
lli vertex;
bool visited[V];
memset(visited,false,sizeof(visited)/sizeof(bool));
Graph::DFSutil(start,visited);
}
int main(){
Graph g(4);
g.addEdge(0, 1);
g.addEdge(0, 2);
g.addEdge(1, 2);
g.addEdge(2, 0);
g.addEdge(2, 3);
g.addEdge(3, 3);
g.DFS(0);
return 0;
} | [
"sswarnkar13@gmail.com"
] | sswarnkar13@gmail.com |
9989f3780037d7c51ca0198f3ec870a779af1784 | dac5d10c7d53f766e496da8a9cfe06d6c20e29ae | /hdoj/1982.cpp | d105dd637081a5c1d600f10091f62ba29df88739 | [] | no_license | koalaink/hdoj | b2f8842cc7a1082f620f593d7480a94da6fe9b20 | b608f46736680c272e8870071c17c5ed82b50da9 | refs/heads/master | 2020-06-14T10:10:29.557015 | 2016-11-30T15:45:39 | 2016-11-30T15:45:39 | 75,200,182 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 704 | cpp | #include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main(){
int c,i,j,len,temp;
char p[10001];
cin>>c;
while(c--){
cin>>p;
len=strlen(p);
temp=0;
j=0;
for(i=0;i<len;i++){
if(p[i]>='0'&&p[i]<='9'){
temp=temp*10+p[i]-'0';
}else if(p[i]=='#'){
if(temp){
printf("%c",'A'+temp-1);
temp=0;
}
printf(" ");
}else if(p[i]=='-'){
printf("%c",'A'+temp-1);
temp=0;
}
}
if(temp) printf("%c",'A'+temp-1);
printf("\n");
}
} | [
"Huibin Dai"
] | Huibin Dai |
86a5eec5ba597415a54b9312d61bb331c9aa13ec | 779e6ee81c172ea9973e9145995b032ce99984de | /src/game/agent/combat/CombatComponentManager.cpp | 3f8d0baeaaa4db15ba811d1e58e7439ff2f392a1 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | zeeneddie/galavant | ef9ae8e1f42982154e07fe7e61b0d3725c1544ef | 3da5ee8cfe5f12f0d842f808d22aafc9493941db | refs/heads/master | 2020-04-13T01:43:19.965092 | 2017-11-26T04:06:29 | 2017-11-26T04:06:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,076 | cpp | #include "CombatComponentManager.hpp"
#include "game/agent/AgentComponentManager.hpp"
#include "util/Time.hpp"
namespace gv
{
ResourceDictionary<CombatActionDef> g_CombatActionDefDictionary;
CombatComponentManager g_CombatComponentManager;
CombatComponentManager::CombatComponentManager()
{
DebugName = "CombatComponentManager";
}
void CombatComponentManager::Initialize(CombatFxHandler* fxHandler)
{
FxHandler = fxHandler;
}
void CombatComponentManager::UnsubscribeEntitiesInternal(const EntityList& entities)
{
for (CombatantList::iterator it = Combatants.begin(); it != Combatants.end();)
{
Entity currentEntity = (*it).entity;
bool foundEntity = false;
for (const Entity& unsubscribeEntity : entities)
{
if (currentEntity == unsubscribeEntity)
{
it = Combatants.erase(it);
foundEntity = true;
break;
}
}
if (!foundEntity)
++it;
}
}
void CombatComponentManager::CreateCombatants(const EntityList& entities,
CombatantRefList& newCombatants)
{
// Only create combatants which aren't already subscribed
EntityList entitiesToSubscribe = entities;
EntityListRemoveNonUniqueEntitiesInSuspect(Subscribers, entitiesToSubscribe);
unsigned int endBeforeResize = Combatants.size();
Combatants.resize(Combatants.size() + entitiesToSubscribe.size());
int numEntitiesCreated = 0;
for (unsigned int i = endBeforeResize; i < Combatants.size(); i++)
{
Combatant* newCombatant = &Combatants[i];
newCombatant->entity = entitiesToSubscribe[numEntitiesCreated++];
newCombatants.push_back(newCombatant);
}
// We've already made sure all entities in the list are unique
EntityListAppendList(Subscribers, entitiesToSubscribe);
}
Combatant* CombatComponentManager::GetCombatant(Entity combatantEntity)
{
for (Combatant& combatant : Combatants)
{
if (combatant.entity == combatantEntity)
return &combatant;
}
return nullptr;
}
void CombatComponentManager::ActivateCombatAction(Entity combatant, CombatAction action)
{
if (FxHandler)
FxHandler->OnActivateCombatAction(combatant, action);
}
void CombatComponentManager::Update(float deltaSeconds)
{
TimeToNextUpdate -= deltaSeconds;
if (TimeToNextUpdate <= 0.f)
{
TimeToNextUpdate = 0.f;
for (Combatant& combatant : Combatants)
{
if (combatant.State == Combatant::CombatState::None)
continue;
if (!combatant.CurrentAction.Def)
continue;
if (combatant.CurrentAction.Def->Type != CombatActionDef::CombatActionType::None)
{
float actionEndTime =
combatant.CurrentAction.ActivateTime + combatant.CurrentAction.Def->Duration;
if (gv::GetGameplayTime() < actionEndTime)
{
combatant.CurrentAction = {nullptr, nullptr, 0.f};
}
}
}
}
}
void CombatComponentManager::DamageDealerHitEntity(Entity hitEntity)
{
for (Combatant& combatant : Combatants)
{
if (combatant.entity == hitEntity)
{
Need* bloodNeed = g_AgentComponentManager.GetAgentNeed(hitEntity, NeedType::Blood);
if (!bloodNeed)
break;
bloodNeed->Level -= 20.f;
break;
}
}
}
} | [
"macoymadson@gmail.com"
] | macoymadson@gmail.com |
643eba17149b6597d96b10d7be0f9ac67ceeb11a | ef86a581705727979c02bf8d2a7a9e69c537698b | /Room/victory.hpp | 1d05ae8e367c84f2fd45834b40008f71a61a4da3 | [] | no_license | victorkesten/Magical-Zenland | 6b769da1c901ebd51ba350523c240435a6d52fba | 2c2d1f96e16c58ae508be4e7d744f07e32041959 | refs/heads/master | 2021-01-17T17:24:46.545844 | 2016-09-29T13:53:28 | 2016-09-29T13:53:28 | 69,572,342 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 353 | hpp | #ifndef VICTORY_H
#define VICTORY_H
#include "room.hpp"
class Victory : public Room {
std::string output = "FF";
public:
Victory();
~Victory(){actors.clear();};
int temperature(int) override;
std::string description() override;
void changeDes(std::string) override;
void lootDescription() override;
bool unlockConditions() override;
};
#endif | [
"Kesten@Victors-MacBook-Pro.local"
] | Kesten@Victors-MacBook-Pro.local |
a65d7d6962637ddc0f25f7ba8dfb825db9b16cef | 8b4716c5b3620cd4742b3621a39b2c1c2969e2f5 | /dataobj/network_packet.h | 7a1b075fae681da5d9a9704d66b1b33fc35a442e | [] | no_license | z9999/simutrans | bf781a526cc4a8bce6617be8e7dedf6f8929a5b0 | 7a2a1074727b787c3075dd31f3e4fde251627478 | refs/heads/master | 2021-01-18T00:31:20.718859 | 2010-08-11T10:31:14 | 2010-08-11T10:31:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,128 | h | #ifndef _NETWORK_PACKET_H
#define _NETWORK_PACKET_H
#include "../simtypes.h"
#include "../utils/memory_rw.h"
#include "network.h"
#define MAX_PACKET_LEN (8192)
// static const do not work on all compilers/architectures
#define HEADER_SIZE (6) // the network sizes are given ...
class packet_t : public memory_rw_t {
private:
// the buffer
uint8 buf[MAX_PACKET_LEN];
// [2] version
uint16 version;
// [4] id
uint16 id;
bool error:1;
// who sent this packet
SOCKET sock;
void rdwr_header( uint16 &size );
// ready for sending
bool ready;
public:
packet_t() : memory_rw_t(buf+HEADER_SIZE,MAX_PACKET_LEN-HEADER_SIZE,true), version(NETWORK_VERSION), id(0), error(false), sock(INVALID_SOCKET), ready(false) {};
// read the packet from the socket
packet_t(SOCKET s);
void send(SOCKET s);
bool has_failed() const { return error || is_overflow();}
// can we understand the received packet?
bool check_version() const { return is_saving() || (version <= NETWORK_VERSION); }
uint16 get_id() const { return id; }
void set_id(uint16 id_) { id = id_; }
SOCKET get_sender() { return sock; }
};
#endif
| [
"dwachs@gmx.net"
] | dwachs@gmx.net |
59c8867393423c5e828d20188731560425743cda | 53671078d0f8bde2914e391bdc20c19c600fec8c | /services/inputflinger/InputCommonConverter.cpp | 8aee39fd0b59df66e4f25e3e1c89cc559218e96a | [
"LicenseRef-scancode-unicode",
"Apache-2.0"
] | permissive | SuperiorOS/android_frameworks_native | de45879d8c7564a9da64cd41238a1545077730e2 | 7e1bee5f27f011c9573cfcdbbe64dcc6a786a9ec | refs/heads/thirteen | 2023-06-25T20:24:44.848214 | 2022-11-15T10:44:22 | 2023-06-21T10:06:30 | 149,220,650 | 2 | 34 | NOASSERTION | 2023-02-23T01:10:58 | 2018-09-18T03:01:34 | C++ | UTF-8 | C++ | false | false | 20,069 | cpp | /*
* Copyright (C) 2022 The Android Open Source Project
*
* 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 "InputCommonConverter.h"
using namespace ::aidl::android::hardware::input;
namespace android {
static common::Source getSource(uint32_t source) {
static_assert(static_cast<common::Source>(AINPUT_SOURCE_UNKNOWN) == common::Source::UNKNOWN,
"SOURCE_UNKNOWN mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_KEYBOARD) == common::Source::KEYBOARD,
"SOURCE_KEYBOARD mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_DPAD) == common::Source::DPAD,
"SOURCE_DPAD mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_GAMEPAD) == common::Source::GAMEPAD,
"SOURCE_GAMEPAD mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCHSCREEN) ==
common::Source::TOUCHSCREEN,
"SOURCE_TOUCHSCREEN mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_MOUSE) == common::Source::MOUSE,
"SOURCE_MOUSE mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_STYLUS) == common::Source::STYLUS,
"SOURCE_STYLUS mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_BLUETOOTH_STYLUS) ==
common::Source::BLUETOOTH_STYLUS,
"SOURCE_BLUETOOTH_STYLUS mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_TRACKBALL) == common::Source::TRACKBALL,
"SOURCE_TRACKBALL mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_MOUSE_RELATIVE) ==
common::Source::MOUSE_RELATIVE,
"SOURCE_MOUSE_RELATIVE mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCHPAD) == common::Source::TOUCHPAD,
"SOURCE_TOUCHPAD mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_TOUCH_NAVIGATION) ==
common::Source::TOUCH_NAVIGATION,
"SOURCE_TOUCH_NAVIGATION mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_JOYSTICK) == common::Source::JOYSTICK,
"SOURCE_JOYSTICK mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_ROTARY_ENCODER) ==
common::Source::ROTARY_ENCODER,
"SOURCE_ROTARY_ENCODER mismatch");
static_assert(static_cast<common::Source>(AINPUT_SOURCE_HDMI) == common::Source::HDMI);
static_assert(static_cast<common::Source>(AINPUT_SOURCE_SENSOR) == common::Source::SENSOR);
static_assert(static_cast<common::Source>(AINPUT_SOURCE_ANY) == common::Source::ANY,
"SOURCE_ANY mismatch");
return static_cast<common::Source>(source);
}
static common::Action getAction(int32_t actionMasked) {
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_DOWN) == common::Action::DOWN,
"ACTION_DOWN mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_UP) == common::Action::UP,
"ACTION_UP mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_MOVE) == common::Action::MOVE,
"ACTION_MOVE mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_CANCEL) ==
common::Action::CANCEL,
"ACTION_CANCEL mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_OUTSIDE) ==
common::Action::OUTSIDE,
"ACTION_OUTSIDE mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_POINTER_DOWN) ==
common::Action::POINTER_DOWN,
"ACTION_POINTER_DOWN mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_POINTER_UP) ==
common::Action::POINTER_UP,
"ACTION_POINTER_UP mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_MOVE) ==
common::Action::HOVER_MOVE,
"ACTION_HOVER_MOVE mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_SCROLL) ==
common::Action::SCROLL,
"ACTION_SCROLL mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_ENTER) ==
common::Action::HOVER_ENTER,
"ACTION_HOVER_ENTER mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_HOVER_EXIT) ==
common::Action::HOVER_EXIT,
"ACTION_HOVER_EXIT mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_BUTTON_PRESS) ==
common::Action::BUTTON_PRESS,
"ACTION_BUTTON_PRESS mismatch");
static_assert(static_cast<common::Action>(AMOTION_EVENT_ACTION_BUTTON_RELEASE) ==
common::Action::BUTTON_RELEASE,
"ACTION_BUTTON_RELEASE mismatch");
return static_cast<common::Action>(actionMasked);
}
static common::Button getActionButton(int32_t actionButton) {
static_assert(static_cast<common::Button>(0) == common::Button::NONE, "BUTTON_NONE mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_PRIMARY) ==
common::Button::PRIMARY,
"BUTTON_PRIMARY mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_SECONDARY) ==
common::Button::SECONDARY,
"BUTTON_SECONDARY mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_TERTIARY) ==
common::Button::TERTIARY,
"BUTTON_TERTIARY mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_BACK) == common::Button::BACK,
"BUTTON_BACK mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_FORWARD) ==
common::Button::FORWARD,
"BUTTON_FORWARD mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_STYLUS_PRIMARY) ==
common::Button::STYLUS_PRIMARY,
"BUTTON_STYLUS_PRIMARY mismatch");
static_assert(static_cast<common::Button>(AMOTION_EVENT_BUTTON_STYLUS_SECONDARY) ==
common::Button::STYLUS_SECONDARY,
"BUTTON_STYLUS_SECONDARY mismatch");
return static_cast<common::Button>(actionButton);
}
static common::Flag getFlags(int32_t flags) {
static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED) ==
common::Flag::WINDOW_IS_OBSCURED);
static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_IS_GENERATED_GESTURE) ==
common::Flag::IS_GENERATED_GESTURE);
static_assert(static_cast<common::Flag>(AMOTION_EVENT_FLAG_TAINTED) == common::Flag::TAINTED);
return static_cast<common::Flag>(flags);
}
static common::PolicyFlag getPolicyFlags(int32_t flags) {
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_WAKE) == common::PolicyFlag::WAKE);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_VIRTUAL) ==
common::PolicyFlag::VIRTUAL);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_FUNCTION) ==
common::PolicyFlag::FUNCTION);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_GESTURE) ==
common::PolicyFlag::GESTURE);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_INJECTED) ==
common::PolicyFlag::INJECTED);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_TRUSTED) ==
common::PolicyFlag::TRUSTED);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_FILTERED) ==
common::PolicyFlag::FILTERED);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_DISABLE_KEY_REPEAT) ==
common::PolicyFlag::DISABLE_KEY_REPEAT);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_INTERACTIVE) ==
common::PolicyFlag::INTERACTIVE);
static_assert(static_cast<common::PolicyFlag>(POLICY_FLAG_PASS_TO_USER) ==
common::PolicyFlag::PASS_TO_USER);
return static_cast<common::PolicyFlag>(flags);
}
static common::EdgeFlag getEdgeFlags(int32_t flags) {
static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_NONE) ==
common::EdgeFlag::NONE);
static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_TOP) ==
common::EdgeFlag::TOP);
static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_BOTTOM) ==
common::EdgeFlag::BOTTOM);
static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_LEFT) ==
common::EdgeFlag::LEFT);
static_assert(static_cast<common::EdgeFlag>(AMOTION_EVENT_EDGE_FLAG_RIGHT) ==
common::EdgeFlag::RIGHT);
return static_cast<common::EdgeFlag>(flags);
}
static common::Meta getMetastate(int32_t state) {
static_assert(static_cast<common::Meta>(AMETA_NONE) == common::Meta::NONE);
static_assert(static_cast<common::Meta>(AMETA_ALT_ON) == common::Meta::ALT_ON);
static_assert(static_cast<common::Meta>(AMETA_ALT_LEFT_ON) == common::Meta::ALT_LEFT_ON);
static_assert(static_cast<common::Meta>(AMETA_ALT_RIGHT_ON) == common::Meta::ALT_RIGHT_ON);
static_assert(static_cast<common::Meta>(AMETA_SHIFT_ON) == common::Meta::SHIFT_ON);
static_assert(static_cast<common::Meta>(AMETA_SHIFT_LEFT_ON) == common::Meta::SHIFT_LEFT_ON);
static_assert(static_cast<common::Meta>(AMETA_SHIFT_RIGHT_ON) == common::Meta::SHIFT_RIGHT_ON);
static_assert(static_cast<common::Meta>(AMETA_SYM_ON) == common::Meta::SYM_ON);
static_assert(static_cast<common::Meta>(AMETA_FUNCTION_ON) == common::Meta::FUNCTION_ON);
static_assert(static_cast<common::Meta>(AMETA_CTRL_ON) == common::Meta::CTRL_ON);
static_assert(static_cast<common::Meta>(AMETA_CTRL_LEFT_ON) == common::Meta::CTRL_LEFT_ON);
static_assert(static_cast<common::Meta>(AMETA_CTRL_RIGHT_ON) == common::Meta::CTRL_RIGHT_ON);
static_assert(static_cast<common::Meta>(AMETA_META_ON) == common::Meta::META_ON);
static_assert(static_cast<common::Meta>(AMETA_META_LEFT_ON) == common::Meta::META_LEFT_ON);
static_assert(static_cast<common::Meta>(AMETA_META_RIGHT_ON) == common::Meta::META_RIGHT_ON);
static_assert(static_cast<common::Meta>(AMETA_CAPS_LOCK_ON) == common::Meta::CAPS_LOCK_ON);
static_assert(static_cast<common::Meta>(AMETA_NUM_LOCK_ON) == common::Meta::NUM_LOCK_ON);
static_assert(static_cast<common::Meta>(AMETA_SCROLL_LOCK_ON) == common::Meta::SCROLL_LOCK_ON);
return static_cast<common::Meta>(state);
}
static common::Button getButtonState(int32_t buttonState) {
// No need for static_assert here.
// The button values have already been asserted in getActionButton(..) above
return static_cast<common::Button>(buttonState);
}
static common::ToolType getToolType(int32_t toolType) {
static_assert(static_cast<common::ToolType>(AMOTION_EVENT_TOOL_TYPE_UNKNOWN) ==
common::ToolType::UNKNOWN);
static_assert(static_cast<common::ToolType>(AMOTION_EVENT_TOOL_TYPE_FINGER) ==
common::ToolType::FINGER);
static_assert(static_cast<common::ToolType>(AMOTION_EVENT_TOOL_TYPE_STYLUS) ==
common::ToolType::STYLUS);
static_assert(static_cast<common::ToolType>(AMOTION_EVENT_TOOL_TYPE_MOUSE) ==
common::ToolType::MOUSE);
static_assert(static_cast<common::ToolType>(AMOTION_EVENT_TOOL_TYPE_ERASER) ==
common::ToolType::ERASER);
return static_cast<common::ToolType>(toolType);
}
// MotionEvent axes asserts
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_X) == common::Axis::X);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_Y) == common::Axis::Y);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_PRESSURE) == common::Axis::PRESSURE);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_SIZE) == common::Axis::SIZE);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOUCH_MAJOR) ==
common::Axis::TOUCH_MAJOR);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOUCH_MINOR) ==
common::Axis::TOUCH_MINOR);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOOL_MAJOR) == common::Axis::TOOL_MAJOR);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TOOL_MINOR) == common::Axis::TOOL_MINOR);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_ORIENTATION) ==
common::Axis::ORIENTATION);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_VSCROLL) == common::Axis::VSCROLL);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HSCROLL) == common::Axis::HSCROLL);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_Z) == common::Axis::Z);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RX) == common::Axis::RX);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RY) == common::Axis::RY);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RZ) == common::Axis::RZ);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HAT_X) == common::Axis::HAT_X);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_HAT_Y) == common::Axis::HAT_Y);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_LTRIGGER) == common::Axis::LTRIGGER);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RTRIGGER) == common::Axis::RTRIGGER);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_THROTTLE) == common::Axis::THROTTLE);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RUDDER) == common::Axis::RUDDER);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_WHEEL) == common::Axis::WHEEL);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GAS) == common::Axis::GAS);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_BRAKE) == common::Axis::BRAKE);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_DISTANCE) == common::Axis::DISTANCE);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_TILT) == common::Axis::TILT);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_SCROLL) == common::Axis::SCROLL);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RELATIVE_X) == common::Axis::RELATIVE_X);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_RELATIVE_Y) == common::Axis::RELATIVE_Y);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_1) == common::Axis::GENERIC_1);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_2) == common::Axis::GENERIC_2);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_3) == common::Axis::GENERIC_3);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_4) == common::Axis::GENERIC_4);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_5) == common::Axis::GENERIC_5);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_6) == common::Axis::GENERIC_6);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_7) == common::Axis::GENERIC_7);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_8) == common::Axis::GENERIC_8);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_9) == common::Axis::GENERIC_9);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_10) == common::Axis::GENERIC_10);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_11) == common::Axis::GENERIC_11);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_12) == common::Axis::GENERIC_12);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_13) == common::Axis::GENERIC_13);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_14) == common::Axis::GENERIC_14);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_15) == common::Axis::GENERIC_15);
static_assert(static_cast<common::Axis>(AMOTION_EVENT_AXIS_GENERIC_16) == common::Axis::GENERIC_16);
static common::VideoFrame getHalVideoFrame(const TouchVideoFrame& frame) {
common::VideoFrame out;
out.width = frame.getWidth();
out.height = frame.getHeight();
std::vector<char16_t> unsignedData(frame.getData().begin(), frame.getData().end());
out.data = unsignedData;
struct timeval timestamp = frame.getTimestamp();
out.timestamp = seconds_to_nanoseconds(timestamp.tv_sec) +
microseconds_to_nanoseconds(timestamp.tv_usec);
return out;
}
static std::vector<common::VideoFrame> convertVideoFrames(
const std::vector<TouchVideoFrame>& frames) {
std::vector<common::VideoFrame> out;
for (const TouchVideoFrame& frame : frames) {
out.push_back(getHalVideoFrame(frame));
}
return out;
}
static void getHalPropertiesAndCoords(const NotifyMotionArgs& args,
std::vector<common::PointerProperties>& outPointerProperties,
std::vector<common::PointerCoords>& outPointerCoords) {
outPointerProperties.reserve(args.pointerCount);
outPointerCoords.reserve(args.pointerCount);
for (size_t i = 0; i < args.pointerCount; i++) {
common::PointerProperties properties;
properties.id = args.pointerProperties[i].id;
properties.toolType = getToolType(args.pointerProperties[i].toolType);
outPointerProperties.push_back(properties);
common::PointerCoords coords;
// OK to copy bits because we have static_assert for pointerCoords axes
coords.bits = args.pointerCoords[i].bits;
coords.values = std::vector<float>(args.pointerCoords[i].values,
args.pointerCoords[i].values +
BitSet64::count(args.pointerCoords[i].bits));
outPointerCoords.push_back(coords);
}
}
common::MotionEvent notifyMotionArgsToHalMotionEvent(const NotifyMotionArgs& args) {
common::MotionEvent event;
event.deviceId = args.deviceId;
event.source = getSource(args.source);
event.displayId = args.displayId;
event.downTime = args.downTime;
event.eventTime = args.eventTime;
event.deviceTimestamp = 0;
event.action = getAction(args.action & AMOTION_EVENT_ACTION_MASK);
event.actionIndex = MotionEvent::getActionIndex(args.action);
event.actionButton = getActionButton(args.actionButton);
event.flags = getFlags(args.flags);
event.policyFlags = getPolicyFlags(args.policyFlags);
event.edgeFlags = getEdgeFlags(args.edgeFlags);
event.metaState = getMetastate(args.metaState);
event.buttonState = getButtonState(args.buttonState);
event.xPrecision = args.xPrecision;
event.yPrecision = args.yPrecision;
std::vector<common::PointerProperties> pointerProperties;
std::vector<common::PointerCoords> pointerCoords;
getHalPropertiesAndCoords(args, /*out*/ pointerProperties, /*out*/ pointerCoords);
event.pointerProperties = pointerProperties;
event.pointerCoords = pointerCoords;
event.frames = convertVideoFrames(args.videoFrames);
return event;
}
} // namespace android
| [
"svv@google.com"
] | svv@google.com |
670096746f7daf4ed57fde9269bd861c6d3dbaf5 | bed9b382dd9b3fa047f4118cf0bc324406f1f940 | /src/Graphics/PathDrawable.hpp | 3a854ddda39a02b99c0fb9648640b041445a57da | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | scemino/engge | 7a1a8bb4a9226e324381d50cc2ea57d98e88447c | 641208858f4a8ffd152cda017d4317b609b8637f | refs/heads/master | 2022-11-10T06:07:32.812231 | 2022-11-06T20:04:04 | 2022-11-06T20:04:04 | 157,253,104 | 149 | 19 | MIT | 2020-11-28T10:30:50 | 2018-11-12T17:49:11 | C++ | UTF-8 | C++ | false | false | 525 | hpp | #pragma once
#include <vector>
#include <memory>
#include <glm/vec2.hpp>
#include <ngf/Graphics/Drawable.h>
#include <ngf/Graphics/RenderTarget.h>
#include <ngf/Graphics/RenderStates.h>
namespace ng {
class PathDrawable final : public ngf::Drawable {
public:
explicit PathDrawable(std::vector<glm::vec2> path);
[[nodiscard]] const std::vector<glm::vec2> &getPath() const { return m_path; }
void draw(ngf::RenderTarget &target, ngf::RenderStates states) const override;
private:
std::vector<glm::vec2> m_path;
};
}
| [
"scemino74@gmail.com"
] | scemino74@gmail.com |
cc0e768a680088f1ef823fc1353b04af4b8fc6e9 | cef80039db141221124ad4ebf1c33749858399f8 | /platform/shared/common/ThreadQueue.cpp | ae7acfcd0ef4b16da76d80837954603a6eaaa947 | [
"MIT"
] | permissive | stinie/rhodes | 84283a1f64bc1a11eec90e55e3892b5849613c11 | 3e0ad9794d8482c9a30f889d10c9e27820508808 | refs/heads/master | 2021-01-18T11:37:15.446564 | 2010-12-26T20:30:39 | 2010-12-26T20:30:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,439 | cpp | #include "ThreadQueue.h"
namespace rho {
namespace common {
CThreadQueue::CThreadQueue(common::IRhoClassFactory* factory) : CRhoThread(factory)
{
m_nPollInterval = QUEUE_POLL_INTERVAL_SECONDS;
m_bNoThreaded = false;
m_ptrFactory = factory;
}
CThreadQueue::~CThreadQueue(void)
{
}
void CThreadQueue::addQueueCommandInt(IQueueCommand* pCmd)
{
LOG(INFO) + "addCommand: " + pCmd->toString();
synchronized(m_mxStackCommands);
boolean bExist = false;
if ( isSkipDuplicateCmd() )
{
for ( int i = 0; i < (int)m_stackCommands.size(); i++ )
{
if ( m_stackCommands.get(i)->equals(*pCmd) )
{
LOG(INFO) + "Command already exists in queue. Skip it.";
bExist = true;
break;
}
}
}
if ( !bExist )
m_stackCommands.add(pCmd);
}
void CThreadQueue::addQueueCommand(IQueueCommand* pCmd)
{
addQueueCommandInt(pCmd);
if ( isNoThreadedMode() )
processCommands();
else
stopWait();
}
void CThreadQueue::run()
{
LOG(INFO) + "Starting main routine...";
int nLastPollInterval = getLastPollInterval();
while( !isStopping() )
{
unsigned int nWait = m_nPollInterval > 0 ? m_nPollInterval : QUEUE_POLL_INTERVAL_INFINITE;
if ( m_nPollInterval > 0 && nLastPollInterval > 0 )
{
int nWait2 = m_nPollInterval - nLastPollInterval;
if ( nWait2 <= 0 )
nWait = QUEUE_STARTUP_INTERVAL_SECONDS;
else
nWait = nWait2;
}
if ( nWait >= 0 && !isStopping() && isNoCommands() )
{
LOG(INFO) + "ThreadQueue blocked for " + nWait + " seconds...";
if ( wait(nWait) == 1 )
onTimeout();
}
nLastPollInterval = 0;
if ( !isStopping() )
processCommands();
}
LOG(INFO) + "Thread shutdown";
}
boolean CThreadQueue::isNoCommands()
{
boolean bEmpty = false;
synchronized(m_mxStackCommands)
{
bEmpty = m_stackCommands.isEmpty();
}
return bEmpty;
}
void CThreadQueue::processCommands()//throws Exception
{
while(!isStopping() && !isNoCommands())
{
common::CAutoPtr<IQueueCommand> pCmd = null;
{
synchronized(m_mxStackCommands);
pCmd = (IQueueCommand*)m_stackCommands.removeFirst();
}
processCommand(pCmd);
}
}
void CThreadQueue::setPollInterval(int nInterval)
{
m_nPollInterval = nInterval;
stopWait();
}
};
};
| [
"evgeny@rhomobile.com"
] | evgeny@rhomobile.com |
e18f331182293f363cd31b1de44ebc1981c4d297 | 6965579510d3ee38f2c8b67d2a3d24026677297e | /2019_autonomous_mobile_robot/src/uway_pointmaker/uway_main.cpp | b042853347bad18922f41282f46d5f81fc5c9f5e | [] | no_license | ku-robo/kuaro | 8fd7e36d50bdfcf161822267e6e1c52090c40ca2 | 36e7937b136a461d7f8238f64cf9555078582711 | refs/heads/master | 2020-07-29T06:02:06.829042 | 2019-09-20T02:52:13 | 2019-09-20T02:52:13 | 209,692,231 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,068 | cpp | /*-----------------------------------------------
* uway_main.cpp(読み方:うぇーぃ)
* <Last Update> H28/10/05
* <version> v1.0
*
* <MEMO>
* Shota Ushiro
*
* <10.05> way point作成ツール作成
* 最適化は行っていない各自でよろしく
* ---------------------------------------------*/
/*-----ヘッダー宣言-------------------------------*/
// ros include
#include <ros/ros.h>
#include <std_msgs/String.h>
#include <geometry_msgs/Twist.h>
#include <geometry_msgs/PointStamped.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/Quaternion.h>
#include <std_msgs/MultiArrayLayout.h>
#include <std_msgs/MultiArrayDimension.h>
#include <std_msgs/Int16MultiArray.h>
#include <std_msgs/Int16.h>
#include <tf/transform_datatypes.h>
#include <actionlib/client/simple_action_client.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
#include <tf/transform_datatypes.h>
#include <geometry_msgs/Point.h>
// C++ include
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <fstream>
#include <map>
#include <utility>
#include <string>
#include <string.h>
geometry_msgs::Quaternion rpy_qotation(double roll,double pitch,double yaw){
return tf::createQuaternionMsgFromRollPitchYaw(roll, pitch, yaw);
}
// other include
class U_WAY
{
private:
struct umap_point{
int x,y,flag;
};
struct vector2D{
double x;
double y;
};
std::string map_name;
double resolution;
std::vector<double> origin;
double map_width;
double map_height;
float click_width;
std::string output_file_name;
std::vector<umap_point> send_points;
umap_point now_point,ago_point;
ros::NodeHandle draw_node;
ros::Publisher draw_pub;
void points_pub();
void point_make();
void point_delete();
void point_move();
void point_select();
void point_start();
double point_line_dist(umap_point _A,umap_point _B,umap_point _P);
ros::NodeHandle start_node;
ros::Publisher start_pub;
int s_point;
public:
U_WAY();
~U_WAY();
void point_get_callback(const std_msgs::Int16MultiArray::ConstPtr& sub_msg);
bool load_file();
std::string load_file_name;
bool end_flag;
};
U_WAY::U_WAY(){
// param setting
double ori;
ros::NodeHandle uw_pt("~");
uw_pt.getParam("resolution", resolution);
uw_pt.getParam("origin", origin);
uw_pt.getParam("resolution", resolution);
uw_pt.param("click_width", click_width,30.f);
uw_pt.param("output_file_name", output_file_name, std::string("/home"));
uw_pt.param("load_file_name", load_file_name, std::string("/home"));
std::cout<<"resolution : " << resolution <<std::endl;
std::cout<<"origin : [" << origin[0] << "," << origin[1] << "," << origin[2]<<"]"<<std::endl;
std::cout<<"click_width : " << click_width <<std::endl;
std::cout<<"output_file_name : " << output_file_name <<std::endl;
std::cout<<"load_file_name : " << load_file_name <<std::endl;
map_width = 1.0;
map_height = 1.0;
draw_pub = draw_node.advertise<std_msgs::Int16MultiArray>("/draw_points", 100);
start_pub = start_node.advertise<std_msgs::Int16>("/u_start", 100);
end_flag = false;
s_point=-1;
}
U_WAY::~U_WAY(){
std::ofstream ofs;
ofs.open(output_file_name.c_str() , std::ios::out);//ファイルを新しくではなく追記するばあい
if (ofs.fail()){
std::cerr << "失敗" << std::endl;
return;
}
double x,y,z,yaw;
geometry_msgs::Quaternion q;
double next_x,next_y;
z = 0.0;
std::cout<<"send_points.size() : "<<send_points.size()<<std::endl;
for(unsigned int num = 0 ; num < send_points.size() ; num++){
x = (send_points[num].x * resolution) + origin[0];
y = ((map_height - send_points[num].y) * resolution) + origin[1];
if(num < send_points.size() - 1){
next_x = (send_points[num + 1].x * resolution) + origin[0];
next_y = ((map_height - send_points[num + 1].y) * resolution) + origin[1];
yaw = atan2(next_y - y,next_x - x );
q = rpy_qotation(0,0,yaw);
}
ofs << x <<","<< y <<","<< z <<","<< q.x <<","<< q.y <<","<< q.z <<","<< q.w << std::endl;
}
ofs.close();
}
bool U_WAY::load_file(){
if(load_file_name.c_str() != "" && map_height != 1.0 && map_width != 1.0){
std::ifstream ifs(load_file_name.c_str());
if(ifs.fail()){std::cerr<<"file open error.\n";return true;}
std::string str;
double x,y,z,qx,qy,qz,qw;
umap_point one;
while(getline(ifs,str)){
sscanf(str.data(),"%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x,&y,&z,&qx,&qy,&qz,&qw);
one.x = (int)((x - origin[0]) / resolution);
one.y = (int)(((y - origin[1]) / resolution) - map_height) * (-1);
one.flag = 0;
send_points.push_back(one);
}
points_pub();
ifs.close();
return true;
}
return false;
}
//線分と点の距離
double U_WAY::point_line_dist(umap_point _A,umap_point _B,umap_point _P){
vector2D a, b;
double r;
a.x = _B.x - _A.x;
a.y = _B.y - _A.y;
b.x = _P.x - _A.x;
b.y = _P.y - _A.y;
r = (a.x*b.x + a.y*b.y) / (a.x*a.x + a.y*a.y);
if( r<= 0 ){
return hypot(_A.x - _P.x ,_A.y - _P.y);
}else if( r>=1 ){
return hypot(_B.x - _P.x ,_B.y - _P.y);
}else{
vector2D result;
result.x = _A.x + r*a.x;
result.y = _A.y + r*a.y;
return hypot(result.x - _P.x ,result.y - _P.y);
}
}
void U_WAY::points_pub(){
std_msgs::Int16MultiArray array;
array.data.clear();
for(unsigned int num = 0; num < send_points.size(); num++){
array.data.push_back(send_points[num].flag);
array.data.push_back(send_points[num].x);
array.data.push_back(send_points[num].y);
}
draw_pub.publish(array);
}
void U_WAY::point_make(){
if(send_points.empty()){
send_points.push_back(now_point);
}else{
int sub = 0;
double dist = 99999.9;
int max_size = send_points.size() - 1;
for(unsigned int num = 0 ; num < max_size; num++){
if(point_line_dist(send_points[num] , send_points[num + 1] , now_point) < dist){
dist = point_line_dist(send_points[num] , send_points[num + 1] , now_point);
sub = num;
}
}
if(dist < click_width){
send_points.insert(send_points.begin() + sub + 1,now_point);
}else{
send_points.push_back(now_point);
}
}
}
void U_WAY::point_delete(){
if(send_points.empty())return;
double dist = 99999.9;
int sub = 0;
for(unsigned int num = 0 ; num < send_points.size() ; num++){
if(hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y) < dist){
dist = hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y);
sub = num;
}
}
if(dist < click_width){
send_points.erase(send_points.begin() + sub);
}
}
void U_WAY::point_move(){
if(send_points.empty())return;
double dist = 99999.9;
int sub = 0;
bool hit_flag = false;
for(unsigned int num = 0 ; num < send_points.size() ; num++){
if(hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y) < dist){
dist = hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y);
sub = num;
}
if(send_points[num].flag == 100){
hit_flag = true;
sub = num;
break;
}
}
if(hit_flag){
send_points[sub].flag = 0;
send_points[sub].x = now_point.x;
send_points[sub].y = now_point.y;
}else if(dist < click_width){
send_points[sub].flag = 100;
}
}
void U_WAY::point_select(){
if(send_points.empty())return;
double dist = 99999.9;
int sub = 0;
bool hit_flag = false;
for(unsigned int num = 0 ; num < send_points.size() ; num++){
if(hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y) < dist){
dist = hypot(now_point.x - send_points[num].x , now_point.y - send_points[num].y);
sub = num;
}
if(send_points[num].flag == 200){
s_point = -1;
send_points[num].flag = 0;
hit_flag = true;
}
}
if( dist < click_width){
send_points[sub].flag = 200;
s_point = sub;
}
}
void U_WAY::point_start(){
if(s_point < 0 ){
return;
}
std_msgs::Int16 pub_point;
pub_point.data = s_point;
start_pub.publish(pub_point);
}
void U_WAY::point_get_callback(const std_msgs::Int16MultiArray::ConstPtr& sub_msg){
if(sub_msg->data[0] == 0){
map_width = (double)sub_msg->data[1];
map_height = (double)sub_msg->data[2];
puts("==== param get ====");
return;
}
now_point.flag = sub_msg->data[0];
now_point.x = sub_msg->data[1];
now_point.y = sub_msg->data[2];
switch(sub_msg->data[0]){
case 1: // MAKE
point_make();
break;
case 2: // DELETE
point_delete();
break;
case 3: // MOVE
point_move();
break;
case 5: // SELECT
point_select();
break;
case 6: // START
point_start();
break;
case -1: // END
end_flag = true;
break;
}
points_pub();
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "uway_pointmaker");
// rosparam
U_WAY uway;
ros::NodeHandle lis_node;
ros::Subscriber point_sub = lis_node.subscribe("/click_point", 100, &U_WAY::point_get_callback,&uway);
puts("start");
ros::Rate loop_rate(5);
if(uway.load_file_name.c_str() != ""){
puts("File load ...");
while(ros::ok()){
if(uway.load_file())break;
ros::spinOnce();
loop_rate.sleep();
}
}
while (ros::ok())
{
if(uway.end_flag)break;
ros::spinOnce();
loop_rate.sleep();
}
return 0;
}
| [
"pch18@qq.com"
] | pch18@qq.com |
20b02b2a7c91b8b1c8267c28d84b88019e241157 | 46efaaff119423bd04b3cef06067114ff6c9bfbc | /TribesAscend_DX_TA/TribesAscend_DX_TA/DX.cpp | d4beedc5df371a3c54e6e956cf659ae7a16f2dc6 | [] | no_license | 0x54433323106/TribesAscendDX9_Source | fd66809d5d02c0024cdae879283a6dfe21a5aa50 | 84d002d33cf310e5c6ea9fb39fcc04df87e55a69 | refs/heads/master | 2023-02-06T00:45:59.994683 | 2020-11-21T22:12:29 | 2020-11-21T22:12:29 | 233,537,459 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 37,130 | cpp | #define VERSION 1.0.3
#include <iostream>
#include <map>
#include <string>
//#include <ctime>
#include "CustomTextureManager.h"
#include "DX.h"
#include "Files.h"
//#include "Memory.h"
#define USE_QUERY_TIMER
//#define USE_TIMEGETTIME_TIMER
#ifdef USE_TIMEGETTIME_TIMER
#include <windows.h>
#pragma comment(lib, "winmm.lib")
#endif
#define USE_IMGUI
#ifdef USE_IMGUI
#include "imgui.h"
#include "imgui_impl_dx9.h"
#include "imgui_impl_win32.h"
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam);
#endif
#define TEXTURE_STAGES 8
//#define DEV
#define RDEV
#define CONSOLE
//#define DANGER
#define NOTREADY
#define PRINT(x) std::cout << x << std::endl
#define P PRINT
//#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) std::cout << x << std::endl
#define DP DEBUG_PRINT
#endif
#define LOG
using namespace std;
#ifdef RDEV
bool b_developer = true;
#endif
//#define USE_DXCANVAS
#ifdef USE_DXCANVAS
#include "DXCanvas.h"
#endif
//#define USE_PRESENT_MID_HOOK
namespace DX {
class TreeNode {
vector<TreeNode*> children;
void* data = NULL;
public:
void addChild(TreeNode* node) { children.push_back(node); }
void setData(void* data) { this->data = data; }
} o_tree_root;
} // namespace DX
namespace DX {
JumpHook* endSceneJumpHook = NULL;
VMTHook* beginSceneVMTHook = NULL;
VMTHook* endSceneVMTHook = NULL;
VMTHook* resetVMTHook = NULL;
VMTHook* drawIndexedPrimitiveVMTHook = NULL;
VMTHook* drawPrimitiveVMTHook = NULL;
VMTHook* drawIndexedPrimitiveUPVMTHook = NULL;
VMTHook* setTextureVMTHook = NULL;
FullJumpHook* presentFullJumpHook = NULL;
} // namespace DX
namespace DX {
IDirect3DBaseTexture9* setTextureTexture[TEXTURE_STAGES] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
int i_textureStages = 0, i_textureStagesPrev = 0;
LPDIRECT3DTEXTURE9 transparentTexture = NULL;
bool b_isSniping = false;
bool b_isSnipingFlag = false;
bool b_draw = true;
bool b_showMenu = false;
bool b_disableZoomBars = false;
bool b_minimalLODTextures_DIP = false;
bool b_minimalLODTextures_ST = false;
// bool b_minimalLODTexturesStages_DIP[TEXTURE_STAGES] = { true, true, true,
// true, true, true, true, true };
bool b_minimalLODTexturesStages_DIP[TEXTURE_STAGES] = {true, true, true, true,
true, true, true, true};
int i_LODTexturesStages_DIP[TEXTURE_STAGES] = {-1, -1, -1, -1, -1, -1, -1, -1};
int i_LODTexturesStages_ST[TEXTURE_STAGES] = {-1, -1, -1, -1, -1, -1, -1, -1};
// bool b_minimalLODTexturesStages_DIP[TEXTURE_STAGES] = { true, true, false,
// true, false, true, true, true }; bool
// b_minimalLODTexturesStages_ST[TEXTURE_STAGES] = { true, true, false, false,
// false, true, true, true };
bool b_minimalLODTexturesStages_ST[TEXTURE_STAGES] = {true, true, false, false,
false, true, true, true};
bool b_textureReset = false;
int i_defaultLOD = 0;
int i_LODstart = 0;
int i_LODend = 100000;
bool b_preserveChainBullets = true;
bool b_keepWeaponsAndModels = false;
bool b_resetLOD = false;
bool b_resetLODflag = false;
int frameCount = 0;
bool b_limitFPS = false;
int i_fpsLimit = 200;
double d_fpsDelay = 1000.0 / i_fpsLimit;
unsigned long long i_previousFrameTime = 0;
LARGE_INTEGER li_previousFrameTime;
DWORD i_currentTIme = 0;
DWORD i_prevTime = 0;
int i_resx = 0;
int i_resy = 0;
// ------------
map<string, LPDIRECT3DTEXTURE9> m_loaded_textures_map;
map<string, string> m_file_name_to_absolute_path;
vector<string> v_loaded_textures_names;
int i_test_DIP_lower = 1e4;
int i_test_DIP_upper = 1e4;
} // namespace DX
namespace DX {
// void updateCanvas(void);
/*
void toggleDraw(void) {
b_draw = !b_draw;
}
*/
bool b_use_custom_textures = false;
LPDIRECT3DTEXTURE9 loadTexture(string path) {
LPDIRECT3DTEXTURE9 texture = NULL;
if (D3DXCreateTextureFromFileA(mainDevice, path.c_str(), &texture) ==
D3D_OK) {
return texture;
}
return NULL;
}
void loadTextures(void) {
m_loaded_textures_map.clear();
v_loaded_textures_names.clear();
v_loaded_textures_names.push_back(string("<Default>"));
v_loaded_textures_names.push_back(string("<None>"));
using namespace UsefulSnippets;
vector<Files::FileObject> v_texture_files =
Files::getFiles("textures", ".png");
vector<Files::FileObject> v_texture_files_jpg =
Files::getFiles("textures", ".jpg");
v_texture_files.insert(v_texture_files.end(), v_texture_files_jpg.begin(),
v_texture_files_jpg.end());
for (vector<Files::FileObject>::iterator i = v_texture_files.begin();
i != v_texture_files.end(); i++) {
string s_file_absolute_path = i->getAbsolutePath();
LPDIRECT3DTEXTURE9 texture = loadTexture(s_file_absolute_path);
if (texture) {
m_loaded_textures_map[i->getFileName()] = texture;
m_file_name_to_absolute_path[i->getFileName()] = s_file_absolute_path;
v_loaded_textures_names.push_back(i->getFileName());
}
}
for (map<string, LPDIRECT3DTEXTURE9>::iterator i =
m_loaded_textures_map.begin();
i != m_loaded_textures_map.end(); i++) {
cout << "Loaded texuture: " << i->first << " -> " << i->second << endl;
}
for (int j = 100; j < 1e4 + 1; j++) {
for (int i = 0; i < TEXTURE_STAGES; i++) {
o_custom_texture_staged_manager.addCustomTexture(j, i,
transparentTexture);
}
//cout << "Added " << j << " to manager." << endl;
}
}
} // namespace DX
namespace DX {
HWND hWnd;
WNDPROC oWndProc;
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
LPDIRECT3DDEVICE9 mainDevice = NULL;
bool hook(void) {
#ifdef CONSOLE
AllocConsole();
freopen("CONOUT$", "w", stdout);
printStartMessage();
#endif
bool res = createDevice();
while (!res) {
res = createDevice();
if (!res)
Sleep(100);
}
// QueryPerformanceCounter(&li_previousFrameTime);
li_previousFrameTime.QuadPart = 0;
#ifdef USE_TIMEGETTIME_TIMER
timeBeginPeriod(0);
#endif
return res;
}
bool createDevice(void) {
LPDIRECT3D9 pD3D = Direct3DCreate9(D3D_SDK_VERSION);
if (!pD3D)
return false;
hWnd = FindWindow(NULL, "Tribes: Ascend (32-bit, DX9)");
if (hWnd == NULL) {
return false;
}
//#ifdef USE_IMGUI
oWndProc = (WNDPROC)SetWindowLongPtr(hWnd, GWL_WNDPROC, (LONG_PTR)WndProc);
//#endif
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = hWnd;
LPDIRECT3DDEVICE9 device;
HRESULT res =
pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
if (FAILED(res))
return false;
DWORD endSceneAddress = VMTHook::getFunctionInstruction(device, 42);
endSceneJumpHook =
new JumpHook(endSceneAddress, (DWORD)endSceneGetDevice, pre);
pD3D->Release();
device->Release();
return true;
}
HRESULT __stdcall endSceneGetDevice(LPDIRECT3DDEVICE9 device) {
mainDevice = device;
endSceneJumpHook->unhook();
initHooks();
#ifdef USE_IMGUI
ImGui_setup();
#endif
D3DXCreateTextureFromFile(device, "grid.png", &transparentTexture);
loadTextures();
getResolution();
#ifdef USE_DXCANVAS
DX::Objects::f_defaultFont.create();
#endif
HRESULT res = ((endScene)endSceneJumpHook->getHookAddress())(device);
return res;
}
HRESULT __stdcall beginSceneHook(LPDIRECT3DDEVICE9 device) {
b_isSnipingFlag = false;
// b_isSniping = false;
if (b_resetLODflag) {
b_resetLOD = true;
b_resetLODflag = false;
}
HRESULT res = ((beginScene)beginSceneVMTHook->getOriginalFunction())(device);
return res;
}
HRESULT __stdcall endSceneHook(LPDIRECT3DDEVICE9 device) {
if (b_resetLOD) {
frameCount = (frameCount + 1) % 3;
if (frameCount == 0) {
b_resetLOD = false;
}
}
if (b_isSnipingFlag) {
b_isSniping = true;
} else {
b_isSniping = false;
}
// b_minimalLODTextures_DIP = false;
#ifdef USE_IMGUI
#ifndef USE_PRESENT_MID_HOOK
ImGui_render();
#endif
#endif
static unsigned long long currentTime = GetTickCount64();
static LARGE_INTEGER QPF;
QueryPerformanceFrequency(&QPF);
double timeElapsedTick = 0;
#ifdef USE_QUERY_TIMER
if (b_limitFPS) {
static LARGE_INTEGER QPC;
QueryPerformanceCounter(&QPC);
unsigned long long deltaCounter =
QPC.QuadPart - li_previousFrameTime.QuadPart;
timeElapsedTick = deltaCounter / (QPF.QuadPart * 1.0); // *1000;
while (timeElapsedTick < (d_fpsDelay / 1000)) {
// Sleep(1);
QueryPerformanceCounter(&QPC);
deltaCounter = QPC.QuadPart - li_previousFrameTime.QuadPart;
timeElapsedTick = deltaCounter / (QPF.QuadPart * 1.0);
// timeElapsedTick = ((QPC.QuadPart - li_previousFrameTime.QuadPart) /
// (QPF.QuadPart *1.0)) *1000;
}
li_previousFrameTime = QPC;
}
#endif
#ifdef USE_TIMEGETTIME_TIMER
if (b_limitFPS) {
i_currentTIme = timeGetTime();
DWORD timeElapsed = i_currentTIme - i_prevTime;
while (timeElapsed < d_fpsDelay) {
i_currentTIme = timeGetTime();
timeElapsed = i_currentTIme - i_prevTime;
}
i_prevTime = i_currentTIme;
}
#endif
#ifdef USE_DXCANVAS
if (DXCanvas.isReady()) {
DXCanvas.begin();
DXCanvas.setFont(&DX::Objects::f_defaultFont);
DXCanvas.setPos(0, 0);
DXCanvas.setColor(255, 255, 255, 255);
DXCanvas.drawText(L"TribesAscend_DX_TA_V1.0.1", 0, 0);
// DXCanvas.setType(Drawable::Type9);
DXCanvas.end();
}
#ifndef USE_PRESENT_MID_HOOK
updateCanvas();
#endif
#endif
// So calling font->DrawText for some reason resets
// the VMT of the device, so we need to rehook endScene
// Because the VMT is not reset by us, then hooked -> true
// so we need to disable the hooked check, or set hooked
// to false after font->DrawText
beginSceneVMTHook->hook();
endSceneVMTHook->hook();
drawIndexedPrimitiveVMTHook->hook();
drawPrimitiveVMTHook->hook();
drawIndexedPrimitiveUPVMTHook->hook();
resetVMTHook->hook();
setTextureVMTHook->hook();
HRESULT res = ((endScene)endSceneVMTHook->getOriginalFunction())(device);
return res;
}
HRESULT __stdcall resetHook(LPDIRECT3DDEVICE9 device,
D3DPRESENT_PARAMETERS* pPresentationParameters) {
// b_minimalLODTextures_DIP = false;
// b_minimalLODTextures_ST = false;
#ifdef USE_IMGUI
ImGui_ImplDX9_InvalidateDeviceObjects();
#endif
#ifdef USE_DXCANVAS
if (DX::Objects::f_defaultFont.getFont()) {
DX::Objects::f_defaultFont.getFont()->OnLostDevice();
}
#endif
HRESULT res = ((reset)resetVMTHook->getOriginalFunction())(
device, pPresentationParameters);
#ifdef USE_DXCANVAS
if (DX::Objects::f_defaultFont.getFont()) {
DX::Objects::f_defaultFont.getFont()->OnResetDevice();
DX::Objects::f_defaultFont.getFont()->Release();
DX::Objects::f_defaultFont.created = false;
DX::Objects::f_defaultFont.font = NULL;
DX::Objects::f_defaultFont.create();
getResolution();
DXCanvas.initialise();
DXCanvas.clear();
}
#endif
#ifdef USE_IMGUI
ImGui_ImplDX9_CreateDeviceObjects();
#endif
return res;
}
HRESULT __stdcall drawIndexedPrimitiveHook(LPDIRECT3DDEVICE9 device,
D3DPRIMITIVETYPE primType,
INT BaseVertexIndex,
UINT MinVertexIndex,
UINT NumVertices,
UINT startIndex,
UINT primCount) {
#ifdef DEBUG
cout << "drawIndexedPrimitiveHook" << endl;
#endif
// IDirect3DBaseTexture9* pTexture;
// bool b = device->GetTexture(0, &pTexture) == D3D_OK;
if (!b_draw) {
return D3D_OK;
}
// 11944->Phase
// 9658->BXT
if (NumVertices == 11944 || NumVertices == 9658) {
b_isSnipingFlag = true;
}
if (b_resetLOD && false) {
for (int i = 0; i <= TEXTURE_STAGES; i++) {
IDirect3DBaseTexture9* pTexture;
bool b = device->GetTexture(i, &pTexture) == D3D_OK;
if (!b || !pTexture) {
continue;
}
pTexture->SetLOD(0);
}
HRESULT res = ((drawIndexedPrimitive)
drawIndexedPrimitiveVMTHook->getOriginalFunction())(
device, primType, BaseVertexIndex, MinVertexIndex, NumVertices,
startIndex, primCount);
return res;
}
// i_textureStages /*TEXTURE_STAGES*/
if (b_minimalLODTextures_DIP && NumVertices >= i_LODstart &&
NumVertices <= i_LODend) {
for (int i = 0; i < /*i_textureStages*/ TEXTURE_STAGES; i++) {
if (!b_minimalLODTexturesStages_DIP[i])
continue;
if (b_preserveChainBullets) {
int stage = i;
if (stage == 4) {
// 3292 is turret with shield pack?
if (NumVertices < 205 || (NumVertices >= 3292 && NumVertices <= 3294))
continue;
}
if (stage == 2) {
if (NumVertices <= 70) {
// 50 is chain/disc
// 70 is eagle
continue;
}
}
if (i == 2 || i == 3 || i == 4) {
if (NumVertices < 150)
continue;
}
}
IDirect3DBaseTexture9* pTexture;
bool b = true;
if (b_minimalLODTextures_DIP && false) {
b = device->GetTexture(i, &pTexture) == D3D_OK; // DIP
} else {
pTexture = setTextureTexture[i]; // DIP+ST
}
if (!b || !pTexture) {
continue;
}
int lod = pTexture->GetLOD();
int level = pTexture->GetLevelCount();
if (i_LODTexturesStages_DIP[i] == -1 ||
i_LODTexturesStages_DIP[i] >= level) {
if (lod != level - 1) {
pTexture->SetLOD(level - 1);
} else {
}
} else {
if (lod != i_LODTexturesStages_DIP[i] &&
i_LODTexturesStages_DIP[i] < level - 1)
pTexture->SetLOD(i_LODTexturesStages_DIP[i]);
}
}
} else {
if (b_minimalLODTextures_DIP) {
// return D3D_OK;
}
}
if (i_test_DIP_lower <= NumVertices && i_test_DIP_upper >= NumVertices) {
for (int i = 0; i < /*i_textureStages*/ TEXTURE_STAGES; i++) {
device->SetTexture(i, transparentTexture);
}
}
if (b_use_custom_textures) {
CustomTextureStaged* o_custom_texture_staged =
o_custom_texture_staged_manager.tick(NumVertices);
if (o_custom_texture_staged) {
unsigned int** uipp_texture_custom_stages =
o_custom_texture_staged->getStagesTextures();
if (uipp_texture_custom_stages) {
// cout << "Custom texture applied. primCount = " << primCount << endl;
for (int i = 0; i < /*i_textureStages*/ TEXTURE_STAGES; i++) {
if (!o_custom_texture_staged->usingStage(i))
continue;
unsigned int* texture = uipp_texture_custom_stages[i];
if (true || texture)
device->SetTexture(i, (LPDIRECT3DTEXTURE9)texture);
}
}
}
}
HRESULT res = ((drawIndexedPrimitive)
drawIndexedPrimitiveVMTHook->getOriginalFunction())(
device, primType, BaseVertexIndex, MinVertexIndex, NumVertices,
startIndex, primCount);
return res;
}
HRESULT __stdcall drawPrimitiveHook(LPDIRECT3DDEVICE9 device,
D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex,
UINT PrimitiveCount) {
if (!b_draw) {
return D3D_OK;
}
if (b_disableZoomBars && PrimitiveCount == 2 && PrimitiveType == 5 &&
StartVertex == 0 /*&& !b_isSniping*/) {
bool stateSuccess = device->SetTexture(1, transparentTexture) == D3D_OK;
}
HRESULT res = ((drawPrimitive)drawPrimitiveVMTHook->getOriginalFunction())(
mainDevice, PrimitiveType, StartVertex, PrimitiveCount);
return res;
}
HRESULT __stdcall drawIndexedPrimitiveUPHook(LPDIRECT3DDEVICE9 device,
D3DPRIMITIVETYPE PrimitiveType,
UINT MinVertexIndex,
UINT NumVertices,
UINT PrimitiveCount,
CONST void* pIndexData,
D3DFORMAT IndexDataFormat,
CONST void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) {
if (!b_draw) {
return D3D_OK;
}
// bxt = 512
// phase = 822
if (NumVertices == 512 || (NumVertices >= 1991 && NumVertices <= 1991)) {
b_isSnipingFlag = true;
}
HRESULT res = ((drawIndexedPrimitiveUP)
drawIndexedPrimitiveUPVMTHook->getOriginalFunction())(
device, PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount,
pIndexData, IndexDataFormat, pVertexStreamZeroData,
VertexStreamZeroStride);
return res;
}
HRESULT __stdcall setTextureHook(LPDIRECT3DDEVICE9 device,
DWORD Stage,
IDirect3DBaseTexture9* pTexture) {
HRESULT res;
#ifdef DEBUG
cout << "setTextureHook: Stage = " << Stage << endl;
#endif
if (b_resetLOD) {
if (pTexture)
pTexture->SetLOD(0);
i_textureStages = 0;
i_textureStagesPrev = 0;
res = ((setTexture)(setTextureVMTHook->getOriginalFunction()))(
device, Stage, pTexture);
return res;
}
if (Stage <= i_textureStagesPrev && Stage < TEXTURE_STAGES) {
i_textureStages = i_textureStagesPrev;
}
if (Stage < TEXTURE_STAGES) {
i_textureStagesPrev = Stage;
}
if (Stage < TEXTURE_STAGES)
setTextureTexture[Stage] = pTexture;
if (b_minimalLODTextures_ST) {
if (pTexture) {
if (b_preserveChainBullets) {
if (!b_minimalLODTexturesStages_ST[Stage]) {
res = ((setTexture)(setTextureVMTHook->getOriginalFunction()))(
device, Stage, pTexture);
return res;
}
}
int lod = pTexture->GetLOD();
int level = pTexture->GetLevelCount();
if (frameCount == 0 &&
(Stage == 1 || Stage == 2 || Stage == 3 || Stage == 4) && false) {
pTexture->SetLOD(0);
} else {
if (i_LODTexturesStages_ST[Stage] == -1) {
if (lod != level - 1) {
pTexture->SetLOD(level - 1);
} else {
}
} else {
pTexture->SetLOD(i_LODTexturesStages_ST[Stage]);
}
}
}
}
res = ((setTexture)(setTextureVMTHook->getOriginalFunction()))(device, Stage,
pTexture);
return res;
}
void getResolution(void) {
D3DDEVICE_CREATION_PARAMETERS cparams;
RECT rect;
mainDevice->GetCreationParameters(&cparams);
GetClientRect(cparams.hFocusWindow, &rect);
i_resx = rect.right - rect.left;
i_resy = rect.bottom - rect.top;
// hud_pos = { i_resx / 2 , 4 * i_resy / 5 };
}
#ifdef USE_PRESENT_MID_HOOK
void __stdcall presentHook(LPDIRECT3DDEVICE9 device,
const RECT* pSourceRect,
const RECT* pDestRect,
HWND hDestWindowOverride,
const RGNDATA* pDirtyRegion) {
#ifdef USE_DXCANVAS
updateCanvas();
#endif
ImGui_render();
endSceneVMTHook->hook();
}
#endif
void initHooks(void) {
beginSceneVMTHook = new VMTHook(mainDevice, 41, (DWORD)beginSceneHook, pre);
endSceneVMTHook = new VMTHook(mainDevice, 42, (DWORD)endSceneHook, pre);
resetVMTHook = new VMTHook(mainDevice, 16, (DWORD)resetHook, pre);
drawIndexedPrimitiveVMTHook =
new VMTHook(mainDevice, 82, (DWORD)drawIndexedPrimitiveHook, pre);
drawPrimitiveVMTHook =
new VMTHook(mainDevice, 81, (DWORD)drawPrimitiveHook, pre);
drawIndexedPrimitiveUPVMTHook =
new VMTHook(mainDevice, 84, (DWORD)drawIndexedPrimitiveUPHook, pre);
setTextureVMTHook = new VMTHook(mainDevice, 65, (DWORD)setTextureHook, pre);
#ifdef USE_PRESENT_MID_HOOK
DWORD addr = JumpHook::firstNonJMPInstruction(
VMTHook::getFunctionInstruction(mainDevice, 17));
presentFullJumpHook =
new FullJumpHook(addr, 0x26, 0x2d, (DWORD)presentHook, 5);
#endif
}
} // namespace DX
#ifdef USE_IMGUI
namespace DX {
void ImGui_setup(void) {
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
(void)io;
io.WantCaptureMouse = true;
io.MouseDrawCursor = true;
ImGui_ImplWin32_Init(hWnd);
ImGui_ImplDX9_Init(mainDevice);
}
void ImGui_render(void) {
if (b_showMenu) {
ImGui_ImplDX9_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
// static bool b = true;
// ImGui::ShowDemoWindow(&b);
/*
static bool b = true;
if (true) {
::ImGui::ShowDemoWindow(&b);
}
*/
{
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
static float f = 0.0f;
static int counter = 0;
ImGui::Begin("TribesAscend_DX_TA##V1.0.3");
ImGui::BeginTabBar("TabBar", tab_bar_flags);
{
static char str[40] = "";
if (ImGui::BeginTabItem("Visuals")) {
#ifdef RDEV
ImGui::Checkbox("Developer mode", &b_developer);
ImGui::Separator();
#endif
ImGui::Checkbox("Disable zoom bars", &b_disableZoomBars);
ImGui::Separator();
if (ImGui::Checkbox("FPS limiting", &b_limitFPS)) {
// QueryPerformanceCounter(&li_previousFrameTime);
}
if (ImGui::SliderInt("FPS", &i_fpsLimit, 30, 1000)) {
d_fpsDelay = 1000.0 / i_fpsLimit;
// QueryPerformanceCounter(&li_previousFrameTime);
}
if (ImGui::CollapsingHeader("LOD changer (notexturestreaming)")) {
#ifdef DANGER
if (ImGui::CollapsingHeader(
"[DANGEROUS] DrawIndexedPrimitive method")) {
if (ImGui::Checkbox(
"Enable [WARNING - Causes freeze on alt+tab]##DIP",
&b_minimalLODTextures_DIP)) {
if (!b_minimalLODTextures_DIP) {
b_resetLODflag = true;
}
}
#ifdef RDEV
if (b_developer) {
static bool customizeStages = false;
if (ImGui::Checkbox("Edit stages##DIP", &customizeStages)) {
if (!customizeStages) {
for (int i = 0; i < TEXTURE_STAGES; i++) {
i_LODTexturesStages_DIP[i] = -1;
}
}
}
if (customizeStages) {
bool stageChanged = false;
for (int i = 0; i < TEXTURE_STAGES; i++) {
string s = to_string(i);
strcpy(str, "Stage ");
strcat(str, s.c_str());
strcat(str, "##DIP");
stageChanged =
stageChanged ||
(ImGui::Checkbox(str,
&b_minimalLODTexturesStages_DIP[i]) &&
b_minimalLODTextures_DIP);
ImGui::SameLine();
strcpy(str, "LOD value##DIP");
strcat(str, s.c_str());
ImGui::SliderInt(str, &i_LODTexturesStages_DIP[i], -1, 20);
}
if (stageChanged) {
b_resetLODflag = true;
}
}
}
#endif
}
#endif
if (/*ImGui::CollapsingHeader("DIP+ST method")*/ true) {
if (ImGui::Checkbox("Enable##DIPST", &b_minimalLODTextures_DIP)) {
if (!b_minimalLODTextures_DIP) {
b_resetLODflag = true;
}
}
#ifdef RDEV
if (b_developer) {
static bool customizeStages = false;
if (/*ImGui::Checkbox("Edit stages##DIPST", &customizeStages)*/
false) {
if (!customizeStages) {
for (int i = 0; i < TEXTURE_STAGES; i++) {
i_LODTexturesStages_DIP[i] = -1;
}
}
}
if (customizeStages || true) {
bool stageChanged = false;
for (int i = 0; i < TEXTURE_STAGES; i++) {
string s = to_string(i);
strcpy(str, "Stage ");
strcat(str, s.c_str());
strcat(str, "##DIP");
stageChanged =
stageChanged ||
(ImGui::Checkbox(str,
&b_minimalLODTexturesStages_DIP[i]) &&
b_minimalLODTextures_DIP);
ImGui::SameLine();
strcpy(str, "LOD value##DIPST");
strcat(str, s.c_str());
ImGui::SliderInt(str, &i_LODTexturesStages_DIP[i], -1, 20);
}
if (stageChanged) {
b_resetLODflag = true;
}
}
}
#endif
}
#ifdef USE_SETTEXTURE_LODMETHOD
if (ImGui::CollapsingHeader("SetTexture method")) {
if (ImGui::Checkbox("Enable##ST", &b_minimalLODTextures_ST)) {
if (!b_minimalLODTextures_ST) {
b_resetLODflag = true;
}
}
#ifdef RDEV
if (b_developer) {
static bool customizeStages = false;
if (ImGui::Checkbox("Edit stages##ST", &customizeStages)) {
if (!customizeStages) {
for (int i = 0; i < TEXTURE_STAGES; i++) {
i_LODTexturesStages_ST[i] = -1;
}
}
}
if (customizeStages) {
bool stageChanged = false;
for (int i = 0; i < TEXTURE_STAGES; i++) {
string s = to_string(i);
strcpy(str, "Stage ");
strcat(str, s.c_str());
strcat(str, "##ST");
stageChanged =
stageChanged ||
(ImGui::Checkbox(str,
&b_minimalLODTexturesStages_ST[i]) &&
b_minimalLODTextures_ST);
ImGui::SameLine();
strcpy(str, "LOD value##ST");
strcat(str, s.c_str());
ImGui::SliderInt(str, &i_LODTexturesStages_ST[i], -1, 20);
}
if (stageChanged) {
b_resetLODflag = true;
}
}
}
#endif
/*
if (ImGui::Checkbox("Apply to guns and player models",
&b_keepWeaponsAndModels)) { if (!b_keepWeaponsAndModels) {
b_minimalLODTexturesStages_ST[1] = false;
}
else {
b_minimalLODTexturesStages_ST[1] = true;
}
}
*/
}
// ImGui::Separator();
// ImGui::Checkbox("Preserve chain bullets (not squares)",
// &b_preserveChainBullets);
#endif
ImGui::Separator();
if (ImGui::Button("Reset LODs")) {
b_resetLODflag = true;
b_minimalLODTextures_ST = false;
b_minimalLODTextures_DIP = false;
}
#ifdef DEV
ImGui::Separator();
ImGui::SliderInt("NumVert Lower bound", &i_LODstart, 0, 5000);
ImGui::SliderInt("NumVert Upper bound", &i_LODend, 0, 20000);
#endif
#ifdef DEV
/*
ImGui::Separator();
for (int i = 0; i < TEXTURE_STAGES; i++) {
string s = to_string(i);
strcpy(str, "Stage ");
strcat(str, s.c_str());
ImGui::Checkbox(str, &b_minimalLODTexturesStages_ST[i]);
}
*/
#endif
}
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Skinning/Texture replacement")) {
ImGui::Checkbox("Use custom textures", &b_use_custom_textures);
static int i_texture_replacement_prim_count = 100;
static int i_texture_replacement_stage = 0;
ImGui::Text("DrawIndexed Primitive Count");
ImGui::SliderInt("##dippc", &i_texture_replacement_prim_count, 100,
1E5);
ImGui::Text("DrawIndexed Stage");
ImGui::SliderInt("##dips", &i_texture_replacement_stage, 0,
TEXTURE_STAGES - 1);
static int i_texture_combo_selected_index = 0;
if (ImGui::BeginCombo(
"Textures",
v_loaded_textures_names[i_texture_combo_selected_index]
.c_str(),
0)) {
for (int n = 0; n < v_loaded_textures_names.size(); n++) {
bool is_selected = (i_texture_combo_selected_index == n);
if (ImGui::Selectable(v_loaded_textures_names[n].c_str(),
is_selected)) {
i_texture_combo_selected_index = n;
if (n <= 1) {
if (n == 0) { // Default
// o_custom_texture_staged_manager.removeCustomTexture(
// i_texture_replacement_prim_count,
// i_texture_replacement_stage);
CustomTextureStaged* op_custom_texture_staged =
o_custom_texture_staged_manager.addCustomTexture(
i_texture_replacement_prim_count,
i_texture_replacement_stage, NULL);
op_custom_texture_staged->disableStage(
i_texture_replacement_stage);
} else if (n == 1) {
CustomTextureStaged* op_custom_texture_staged =
o_custom_texture_staged_manager.addCustomTexture(
i_texture_replacement_prim_count,
i_texture_replacement_stage, NULL);
}
} else {
map<string, LPDIRECT3DTEXTURE9>::iterator iter_texture =
m_loaded_textures_map.find(v_loaded_textures_names[n]);
// map<string, string>::iterator iter_absolute_path =
// m_file_name_to_absolute_path.find(v_loaded_textures_names[n]);
if (iter_texture != m_loaded_textures_map.end()) {
o_custom_texture_staged_manager.addCustomTexture(
i_texture_replacement_prim_count,
i_texture_replacement_stage, iter_texture->second,
v_loaded_textures_names[n]);
cout << "Applying texture (" << iter_texture->first << ", "
<< iter_texture->second << ") to "
<< i_texture_replacement_prim_count << ":"
<< i_texture_replacement_stage << endl;
} else {
cout
<< "Could not apply the texture as the texture was not "
"found."
<< endl;
}
}
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
if (ImGui::Button("Apply to all stages")) {
map<string, LPDIRECT3DTEXTURE9>::iterator iter_texture =
m_loaded_textures_map.find(
v_loaded_textures_names[i_texture_combo_selected_index]);
if (iter_texture != m_loaded_textures_map.end()) {
for (int i = 0; i < TEXTURE_STAGES; i++) {
o_custom_texture_staged_manager.addCustomTexture(
i_texture_replacement_prim_count, i, iter_texture->second);
cout << "Applying texture (" << iter_texture->first << ", "
<< iter_texture->second << ") to "
<< i_texture_replacement_prim_count << ":" << i << endl;
}
} else {
cout << "Could not apply the texture as the texture was not "
"found."
<< endl;
}
}
ImGui::Separator();
ImGui::SliderInt("NumVert Lower bound", &i_test_DIP_lower, 0, 1e4);
ImGui::SliderInt("NumVert Upper bound", &i_test_DIP_upper, 0, 1e4);
ImGui::Separator();
if (ImGui::Button("Save config")) {
o_custom_texture_staged_manager.save(string("custom_texture.txt"));
}
ImGui::EndTabItem();
}
/*
if (ImGui::BeginTabItem("Skinning/Texture replacement##1")) {
static bool disable_mouse_wheel = false;
static bool disable_menu = false;
ImGuiWindowFlags window_flags =
ImGuiWindowFlags_HorizontalScrollbar |
(disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0);
ImGui::BeginChild(
"Child1",
ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 260), false,
window_flags);
for (int i = 0; i < 100; i++) {
ImGui::Text("%04d: scrollable region", i);
}
ImGui::EndChild();
ImGui::SameLine();
// Child 2: rounded border
ImGuiWindowFlags window_flags_ =
(disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0) |
(disable_menu ? 0 : ImGuiWindowFlags_MenuBar);
ImGui::BeginChild("Child2", ImVec2(0, 260), true, window_flags_);
ImGui::Columns(1);
for (int i = 0; i < 100; i++) {
char buf[32];
sprintf(buf, "%03d", i);
ImGui::Button(buf, ImVec2(-1.0f, 0.0f));
}
ImGui::EndChild();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Themes")) {
static int style_idx = 1;
if (ImGui::Combo("Theme", &style_idx, "Classic\0Dark\0Light\0")) {
switch (style_idx) {
case 0:
ImGui::StyleColorsClassic();
break;
case 1:
ImGui::StyleColorsDark();
break;
case 2:
ImGui::StyleColorsLight();
break;
}
}
ImGui::EndTabItem();
}
*/
if (ImGui::BeginTabItem("Skinning/Texture replacement##2")) {
if (ImGui::TreeNode("Trees")) {
if (ImGui::TreeNode("Basic trees")) {
for (int i = 0; i < 5; i++)
if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i)) {
ImGui::Text("blah blah");
ImGui::SameLine();
if (ImGui::SmallButton("button")) {
};
ImGui::TreePop();
}
ImGui::TreePop();
}
ImGui::TreePop();
}
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::End();
}
ImGui::EndFrame();
/*
mainDevice->SetRenderState(D3DRS_ZENABLE, false);
mainDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
mainDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, false);
*/
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
}
}
} // namespace DX
#endif
namespace DX {
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
// if (::ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam));
#ifdef USE_IMGUI
ImGuiIO& io = ::ImGui::GetIO();
if (msg == WM_KEYUP) {
if (wParam == VK_INSERT) {
b_showMenu = !b_showMenu;
}
if (wParam == VK_F3) {
b_use_custom_textures = !b_use_custom_textures;
}
// if (wParam == VK_MENU) {
// b_minimalLODTextures_DIP = false;
// b_minimalLODTextures_ST = false;
//}
}
if (b_showMenu) {
ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam);
return true;
}
#endif
/*
if (b_showMenu && (io.WantCaptureMouse && (msg == WM_LBUTTONDOWN || msg ==
WM_LBUTTONUP || msg == WM_RBUTTONDOWN || msg == WM_RBUTTONUP || msg ==
WM_MBUTTONDOWN || msg == WM_MBUTTONUP || msg == WM_MOUSEWHEEL || msg ==
WM_MOUSEMOVE))) { return TRUE;
}
*/
return CallWindowProc(oWndProc, hWnd, msg, wParam, lParam);
}
void printStartMessage(void) {
P("Tribes Ascend DirectX Modding V1.0.3");
P("--------------------------------------");
// P("* Calling device->GetTexture in DrawIndexedPrimitive causes the Tribes
// process to hang in the xaudio2_7.dll module when the device is resetting
// (ALT+TAB)." " This can also occur in the setTexture hook function.");
P("In the event Tribes hangs, kill this console window.");
}
} // namespace DX | [
"59816964+0x54433323106@users.noreply.github.com"
] | 59816964+0x54433323106@users.noreply.github.com |
55a5884b84476086356d5a3c27bd578e696a7b02 | 3c7698d347a959ea2a1434eaf5c71f4e155d4612 | /shared/cs488-framework/CS488Window.cpp | 536bb109546b3c6cc5d1ec2953e2213f3428ed7e | [] | no_license | oxue/raytracer | b891c3435fc4d8dff2db656232a5c1356ad73494 | 9ab090d91aed8657ed9bb9e18546fd483064f4a9 | refs/heads/master | 2021-07-15T13:08:13.146030 | 2020-05-11T00:39:59 | 2020-05-11T00:39:59 | 138,846,771 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,976 | cpp | #include "CS488Window.hpp"
#include "cs488-framework/Exception.hpp"
#include "cs488-framework/OpenGLImport.hpp"
#include <sstream>
#include <iostream>
#include <cstdio>
#include <imgui/imgui.h>
#include <imgui_impl_glfw_gl3.h>
using namespace std;
//-- Forward Declarations:
extern "C" {
int gl3wInit(void);
}
static void renderImGui (int framebufferWidth, int framebufferHeight);
//-- Static member initialization:
string CS488Window::m_exec_dir = ".";
shared_ptr<CS488Window> CS488Window::m_instance = nullptr;
static void printGLInfo();
//----------------------------------------------------------------------------------------
// Constructor
CS488Window::CS488Window()
: m_window(nullptr),
m_monitor(nullptr),
m_windowTitle(),
m_windowWidth(0),
m_windowHeight(0),
m_framebufferWidth(0),
m_framebufferHeight(0),
m_paused(false),
m_fullScreen(false)
{
}
//----------------------------------------------------------------------------------------
// Destructor
CS488Window::~CS488Window() {
// Free all GLFW resources.
glfwTerminate();
}
//----------------------------------------------------------------------------------------
/*
* Error callback to be registered with GLFW.
*/
void CS488Window::errorCallback(
int error,
const char * description
) {
stringstream msg;
msg << "GLFW Error Code: " << error << "\n" <<
"GLFW Error Description: " << description << "\n";
cout << msg.str();
}
//----------------------------------------------------------------------------------------
/*
* Window resize event callback to be registered with GLFW.
*/
void CS488Window::windowResizeCallBack (
GLFWwindow * window,
int width,
int height
) {
getInstance()->CS488Window::windowResizeEvent(width, height);
getInstance()->windowResizeEvent(width, height);
}
//----------------------------------------------------------------------------------------
/*
* Key input event callback to be registered with GLFW.
*/
void CS488Window::keyInputCallBack (
GLFWwindow * window,
int key,
int scancode,
int action,
int mods
) {
if(!getInstance()->keyInputEvent(key, action, mods)) {
// Send event to parent class for processing.
getInstance()->CS488Window::keyInputEvent(key, action, mods);
}
}
//----------------------------------------------------------------------------------------
/*
* Mouse scroll event callback to be registered with GLFW.
*/
void CS488Window::mouseScrollCallBack (
GLFWwindow * window,
double xOffSet,
double yOffSet
) {
getInstance()->mouseScrollEvent(xOffSet, yOffSet);
}
//----------------------------------------------------------------------------------------
/*
* Mouse button event callback to be registered with GLFW.
*/
void CS488Window::mouseButtonCallBack (
GLFWwindow * window,
int button,
int actions,
int mods
) {
getInstance()->mouseButtonInputEvent(button, actions, mods);
}
//----------------------------------------------------------------------------------------
/*
* Mouse move event callback to be registered with GLFW.
*/
void CS488Window::mouseMoveCallBack (
GLFWwindow * window,
double xPos,
double yPos
) {
getInstance()->mouseMoveEvent(xPos, yPos);
}
//----------------------------------------------------------------------------------------
/*
* Cursor enter window event callback to be registered with GLFW.
*/
void CS488Window::cursorEnterWindowCallBack (
GLFWwindow * window,
int entered
) {
getInstance()->cursorEnterWindowEvent(entered);
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles window resize events.
*/
bool CS488Window::windowResizeEvent (
int width,
int height
) {
m_windowWidth = width;
m_windowHeight = height;
return false;
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles key input events.
*/
bool CS488Window::keyInputEvent (
int key,
int action,
int mods
) {
bool eventHandled(false);
if (action == GLFW_PRESS) {
if (key == GLFW_KEY_ESCAPE) {
glfwSetWindowShouldClose(m_window, GL_TRUE);
eventHandled = true;
} else if (key == GLFW_KEY_P) {
m_paused = !m_paused;
if(m_paused) {
static bool showPauseWindow(true);
ImGui::SetNextWindowPosCenter();
ImGui::SetNextWindowSize(ImVec2(m_framebufferWidth*0.5,
m_framebufferHeight*0.5));
ImGui::Begin("PAUSED", &showPauseWindow, ImVec2(m_framebufferWidth*0.5,
m_framebufferHeight*0.5), 0.1f, ImGuiWindowFlags_NoTitleBar);
ImGui::Text("Paused");
ImGui::Text("Press P to continue...");
ImGui::End();
renderImGui(m_framebufferWidth, m_framebufferHeight);
glfwSwapBuffers(m_window);
}
eventHandled = true;
}
}
return eventHandled;
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles mouse scroll events.
*/
bool CS488Window::mouseScrollEvent (
double xOffSet,
double yOffSet
) {
return false;
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles mouse button events.
*/
bool CS488Window::mouseButtonInputEvent (
int button,
int actions,
int mods
) {
return false;
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles mouse move events.
*/
bool CS488Window::mouseMoveEvent (
double xPos,
double yPos
) {
return false;
}
//----------------------------------------------------------------------------------------
/*
* Event handler. Handles mouse cursor entering window area events.
*/
bool CS488Window::cursorEnterWindowEvent (
int entered
) {
return false;
}
//----------------------------------------------------------------------------------------
void CS488Window::centerWindow() {
int windowWidth, windowHeight;
glfwGetWindowSize(m_window, &windowWidth, &windowHeight);
cout<<windowWidth<<endl;
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
if (monitor == NULL) {
return;
}
int x, y;
const GLFWvidmode *videoMode = glfwGetVideoMode(monitor);
x = videoMode->width;
y = videoMode->height;
x = (x - windowWidth) / 2;
y = (y - windowHeight) / 2;
glfwSetWindowPos(m_window, x, y);
}
//----------------------------------------------------------------------------------------
/*
* Register callbacks with GLFW, and associate events with the current GLFWwindow.
*/
void CS488Window::registerGlfwCallBacks() {
glfwSetKeyCallback(m_window, keyInputCallBack);
glfwSetWindowSizeCallback(m_window, windowResizeCallBack);
glfwSetScrollCallback(m_window, mouseScrollCallBack);
glfwSetMouseButtonCallback(m_window, mouseButtonCallBack);
glfwSetCursorPosCallback(m_window, mouseMoveCallBack);
glfwSetCursorEnterCallback(m_window, cursorEnterWindowCallBack);
}
//----------------------------------------------------------------------------------------
/*
* Returns the static instance of class CS488Window.
*/
shared_ptr<CS488Window> CS488Window::getInstance()
{
static CS488Window * instance = new CS488Window();
if (m_instance == nullptr) {
// Pass ownership of instance to shared_ptr.
m_instance = shared_ptr<CS488Window>(instance);
}
return m_instance;
}
//----------------------------------------------------------------------------------------
void CS488Window::launch (
int argc,
char **argv,
CS488Window *window,
int width,
int height,
const std::string& title,
float fps
) {
char * slash = strrchr( argv[0], '/' );
if( slash == nullptr ) {
m_exec_dir = ".";
} else {
m_exec_dir = string( argv[0], slash );
}
if( m_instance == nullptr ) {
m_instance = shared_ptr<CS488Window>(window);
m_instance->run( width, height, title, fps );
}
}
//----------------------------------------------------------------------------------------
static void renderImGui (
int framebufferWidth,
int framebufferHeight
) {
// Set viewport to full window size.
glViewport(0, 0, framebufferWidth, framebufferHeight);
ImGui::Render();
}
//----------------------------------------------------------------------------------------
void CS488Window::run (
int width,
int height,
const string &windowTitle,
float desiredFramesPerSecond
) {
m_windowTitle = windowTitle;
m_windowWidth = width;
m_windowHeight = height;
glfwSetErrorCallback(errorCallback);
if (glfwInit() == GL_FALSE) {
fprintf(stderr, "Call to glfwInit() failed.\n");
std::abort();
}
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_VISIBLE, GL_TRUE);
glfwWindowHint(GLFW_SAMPLES, 0);
glfwWindowHint(GLFW_RED_BITS, 8);
glfwWindowHint(GLFW_GREEN_BITS, 8);
glfwWindowHint(GLFW_BLUE_BITS, 8);
glfwWindowHint(GLFW_ALPHA_BITS, 8);
m_monitor = glfwGetPrimaryMonitor();
if (m_monitor == NULL) {
glfwTerminate();
fprintf(stderr, "Error retrieving primary monitor.\n");
std::abort();
}
m_window = glfwCreateWindow(width, height, windowTitle.c_str(), NULL, NULL);
if (m_window == NULL) {
glfwTerminate();
fprintf(stderr, "Call to glfwCreateWindow failed.\n");
std::abort();
}
// Get default framebuffer dimensions in order to support high-definition
// displays.
glfwGetFramebufferSize(m_window, &m_framebufferWidth, &m_framebufferHeight);
centerWindow();
glfwMakeContextCurrent(m_window);
gl3wInit();
#ifdef DEBUG_GL
printGLInfo();
#endif
glfwSetInputMode(m_window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
registerGlfwCallBacks();
// Setup ImGui binding. Tell the ImGui subsystem not to
// bother setting up its callbacks -- ours will do just fine here.
ImGui_ImplGlfwGL3_Init( m_window, false );
// Clear error buffer.
while(glGetError() != GL_NO_ERROR);
try {
// Wait until m_monitor refreshes before swapping front and back buffers.
// To prevent tearing artifacts.
glfwSwapInterval(1);
// Call client-defined startup code.
init();
// steady_clock::time_point frameStartTime;
// Main Program Loop:
while (!glfwWindowShouldClose(m_window)) {
glfwPollEvents();
ImGui_ImplGlfwGL3_NewFrame();
if (!m_paused) {
// Apply application-specific logic
appLogic();
guiLogic();
// Ask the derived class to do the actual OpenGL drawing.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
draw();
// In case of a window resize, get new framebuffer dimensions.
glfwGetFramebufferSize(m_window, &m_framebufferWidth,
&m_framebufferHeight);
// Draw any UI controls specified in guiLogic() by derived class.
renderImGui(m_framebufferWidth, m_framebufferHeight);
// Finally, blast everything to the screen.
glfwSwapBuffers(m_window);
}
}
} catch (const std::exception & e) {
std::cerr << "Exception Thrown: ";
std::cerr << e.what() << endl;
} catch (...) {
std::cerr << "Uncaught exception thrown! Terminating Program." << endl;
}
cleanup();
glfwDestroyWindow(m_window);
}
//----------------------------------------------------------------------------------------
void CS488Window::init() {
// Render only the front face of geometry.
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
// Setup depth testing
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glDepthRange(0.0f, 1.0f);
glEnable(GL_DEPTH_CLAMP);
glClearDepth(1.0f);
glClearColor(0.3, 0.5, 0.7, 1.0);
}
//----------------------------------------------------------------------------------------
void CS488Window::appLogic() {
}
//----------------------------------------------------------------------------------------
void CS488Window::draw() {
}
//----------------------------------------------------------------------------------------
void CS488Window::guiLogic() {
}
//----------------------------------------------------------------------------------------
void CS488Window::cleanup() {
}
//----------------------------------------------------------------------------------------
/*
* Used to print OpenGL version and supported extensions to standard output stream.
*/
static void printGLInfo() {
const GLubyte * renderer = glGetString( GL_RENDERER );
const GLubyte * vendor = glGetString( GL_VENDOR );
const GLubyte * version = glGetString( GL_VERSION );
const GLubyte * glsl_version = glGetString( GL_SHADING_LANGUAGE_VERSION );
GLint majorVersion, minorVersion;
glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
stringstream message;
if (vendor)
message << "GL Vendor : " << vendor << endl;
if (renderer)
message << "GL Renderer : " << renderer << endl;
if (version)
message << "GL Version : " << version << endl;
message << "GL Version : " << majorVersion << "." << minorVersion << endl
<< "GLSL Version : " << glsl_version << endl;
cout << message.str();
cout << "Supported Extensions: " << endl;
const GLubyte * extension;
GLint nExtensions;
glGetIntegerv(GL_NUM_EXTENSIONS, &nExtensions);
for (GLuint i = 0; i < nExtensions; ++i) {
extension = glGetStringi(GL_EXTENSIONS, i);
if (extension) {
cout << extension << endl;
}
}
}
//----------------------------------------------------------------------------------------
std::string CS488Window::getAssetFilePath(const char *base)
{
return m_exec_dir + "/Assets/" + base;
}
| [
"oliverxu@Olivers-MBP.lan"
] | oliverxu@Olivers-MBP.lan |
8104e4741bd357dc81c0afa6749f22a115e19bce | 4ef69f0044f45be4fbce54f7b7c0319e4c5ec53d | /include/cv/core/cmd/out/zpotf2.inl | bea9e82c9ba8d38097af011b8610ba84292e01a3 | [] | no_license | 15831944/cstd | c6c3996103953ceda7c06625ee1045127bf79ee8 | 53b7e5ba73cbdc9b5bbc61094a09bf3d5957f373 | refs/heads/master | 2021-09-15T13:44:37.937208 | 2018-06-02T10:14:16 | 2018-06-02T10:14:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 153 | inl | #ifndef __zpotf2__
#define __zpotf2__
#define c_b1 c_b1_zpotf2
#define c__1 c__1_zpotf2
#include "zpotf2.c"
#undef c_b1
#undef c__1
#endif // __zpotf2__
| [
"31720406@qq.com"
] | 31720406@qq.com |
4c370bb527d88f33a7160d4adf84a096e0279f94 | c01fa2cfc94c04c6b4f3aba019e1d2101695241b | /Exp005Motor/Exp005Motor.ino | d8d3826f3b6633ddf3f33c3ebce922edf108e58e | [] | no_license | preshathakkar/Arduino-Experiments | 1e5cff76c02308a9e54667642877bd73d2a45de3 | b7a57d797a0bb30e58912940e29bbb16573948aa | refs/heads/master | 2021-01-01T06:18:41.605841 | 2015-03-02T22:12:17 | 2015-03-02T22:12:17 | 31,566,170 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 424 | ino | int motorPin = 9;
void setup()
{
//Set the PWM Motor pin as an output
pinMode(motorPin, OUTPUT);
}
void loop()
{
//Increase Motor Speed from 0 -> 255
for (int i=0; i<=255; i++)
{
analogWrite(motorPin, i);
delay(10);
}
delay(500); //Hold it!
//Decrease Motor Speed from 255 -> 0
for(int i=255; i>=0; i--)
{
analogWrite(motorPin, i);
delay(10);
}
delay(500); //Hold it!
}
| [
"smilepresha@gmail.com"
] | smilepresha@gmail.com |
f9135c6d9f5980f60806e45f1760947269731b2a | 3c0e92dc6bf91c6a6c1b8c73d5da0b038c58e436 | /proxies/Pelican/include/comm/transport/ISocket.h | f540b03e2e45a6dc8e3f399c0aae473057091391 | [] | no_license | yebo92/mavwork | f9d47d84e952c9b9939216b09f50fa128131ab9e | a7bce5766874850528857f6fd96fce4152f5775a | refs/heads/master | 2022-06-10T18:27:52.428622 | 2013-06-06T16:25:14 | 2013-06-06T16:25:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,029 | h | /*
* Socket.h
*
* Created on: 27/04/2012
* Author: Ignacio Mellado-Bataller
*/
#ifndef SOCKET_H_
#define SOCKET_H_
#include "../../data/Buffer.h"
#include "../network/IAddress.h"
namespace Comm {
class ISocket {
public:
inline virtual ~ISocket() {}
// Implementations must provide this methods
virtual cvg_ulong read(IAddress &addr, void *inBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes = 0) = 0;
virtual cvg_ulong write(const IAddress &addr, const void *outBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes = 0) = 0;
virtual cvg_ulong peek(IAddress &addr, void *inBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes = 0) = 0;
virtual cvg_ulong read(void *inBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes) = 0;
virtual cvg_ulong write(const void *outBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes = 0) = 0;
virtual cvg_ulong peek(void *inBuffer, cvg_ulong lengthBytes, cvg_ulong offsetBytes) = 0;
virtual void setTimeouts(cvg_double readTimeout, cvg_double writeTimeout) = 0;
virtual void getTimeouts(cvg_double *readTimeout, cvg_double *writeTimeout) = 0;
// These methods return true if the address is valid; false, otherwise
virtual cvg_bool getLocalAddress(IAddress &addr) = 0;
virtual cvg_bool getRemoteAddress(IAddress &addr) = 0;
// Provided auxiliary methods
inline cvg_ulong read(IAddress &addr, Buffer &inBuffer) { return read(addr, &inBuffer, inBuffer.sizeBytes(), 0); }
inline cvg_ulong write(const IAddress &addr, const Buffer &outBuffer) { return write(addr, &outBuffer, outBuffer.sizeBytes(), 0); }
inline cvg_ulong peek(IAddress &addr, Buffer &inBuffer) { return peek(addr, &inBuffer, inBuffer.sizeBytes(), 0); }
inline cvg_ulong read(Buffer &inBuffer) { return read(&inBuffer, inBuffer.sizeBytes(), 0); }
inline cvg_ulong write(const Buffer &outBuffer) { return write(&outBuffer, outBuffer.sizeBytes(), 0); }
inline cvg_ulong peek(Buffer &inBuffer) { return peek(&inBuffer, inBuffer.sizeBytes(), 0); }
void *userData;
};
}
#endif /* SOCKET_H_ */
| [
"ignacio.mellado@gmail.com"
] | ignacio.mellado@gmail.com |
ee6aa32987bd21257543effee777780a142bb55e | 0308bd8baccff9a59c7ac931ec00d418486d9e15 | /algorithms/algorithms2/1547_공.cpp | f18ceb761b430ae089dcdd6ab6fc53b070c8ad68 | [] | no_license | nanenchanga53/BackJoonAlgorithems | 55d2b532a8d54ba2c014346880657643cfa27ce4 | 9ac62dc26f3021a39bca518d16285447179d8daa | refs/heads/master | 2021-06-03T13:47:13.697788 | 2021-02-19T06:08:24 | 2021-02-19T06:08:24 | 134,537,167 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 310 | cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int m,x,y;
int cup[4] = { 0,1,0,0 };
cin >> m;
while (m--)
{
cin >> x >> y;
swap(cup[x], cup[y]);
}
for (int i = 1; i <= 3; i++)
{
if (cup[i] == 1)
{
cout << i << endl;
break;
}
}
system("pause");
return 0;
}
| [
"nanenchanga53@mediasol.kr"
] | nanenchanga53@mediasol.kr |
9d180598695daf51e735734e0c3b75e4d2bb6e1b | 2aed63d9aa027419b797e56b508417789a604a8b | /injector2degHex/case_interPhaseChangeFoam_waxman/processor4/0.75/phi | 56fd968378e38645b28672b8c98ca87e0ef952d5 | [] | no_license | icl-rocketry/injectorCFDModelling | 70137f1c6574240c7202638c3713102a3e1e9fd8 | 96591cf2cf3cd4cbd64536d8ae47ed8080ed9016 | refs/heads/main | 2023-08-25T03:30:59.244137 | 2021-10-09T21:04:45 | 2021-10-09T21:04:45 | 322,369,673 | 3 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 117,878 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "0.75";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
oriented oriented;
internalField nonuniform List<scalar>
6434
(
1.85892e-10
-3.91998e-09
2.25198e-13
3.03935e-10
-6.67666e-09
2.16845e-13
-1.42653e-10
-2.68973e-09
1.94924e-13
-5.85033e-10
2.17581e-09
1.62654e-13
3.82147e-09
1.05408e-13
1.53819e-10
-4.0738e-09
1.49021e-13
4.78941e-11
-6.57075e-09
1.99084e-13
-3.69739e-10
-2.27209e-09
1.78423e-13
-6.29062e-10
2.43508e-09
1.09732e-13
3.19249e-09
4.34554e-14
1.48106e-10
-4.22189e-09
1.09608e-13
5.85787e-11
-6.48124e-09
2.09461e-13
-8.45694e-11
-2.12886e-09
1.90954e-13
-1.26189e-10
2.47678e-09
1.19872e-13
3.06645e-09
4.79572e-14
1.23022e-10
-4.34491e-09
1.02819e-13
6.95727e-12
-6.36521e-09
2.26519e-13
-1.38357e-10
-1.98349e-09
1.92783e-13
-1.33649e-10
2.47211e-09
1.12729e-13
2.93286e-09
3.75001e-14
1.05036e-10
-4.44991e-09
1.3741e-13
1.21843e-11
-6.27232e-09
2.54603e-13
-4.80566e-11
-1.92314e-09
2.05014e-13
-2.29142e-11
2.44707e-09
1.21477e-13
2.91003e-09
4.0025e-14
8.89266e-11
-4.53882e-09
1.86949e-13
-6.77896e-12
-6.17657e-09
2.6891e-13
-9.42566e-11
-1.83561e-09
2.02493e-13
-7.6088e-11
2.42897e-09
1.16506e-13
2.83398e-09
3.43212e-14
7.90025e-11
-4.61782e-09
2.24084e-13
-3.20583e-11
-6.06547e-09
2.75867e-13
-1.06797e-10
-1.76083e-09
2.02894e-13
-6.69201e-11
2.3892e-09
1.23453e-13
2.7672e-09
4.68824e-14
6.97809e-11
-4.68761e-09
2.1729e-13
-7.81642e-11
-5.91755e-09
2.71406e-13
-1.86051e-10
-1.65297e-09
1.9622e-13
-1.26828e-10
2.32999e-09
1.11386e-13
2.64041e-09
3.48646e-14
5.82522e-11
-4.74586e-09
1.82439e-13
-1.2046e-10
-5.73884e-09
2.79226e-13
-2.10071e-10
-1.56334e-09
2.05102e-13
-1.21714e-10
2.24162e-09
1.08967e-13
2.51872e-09
3.26816e-14
3.10264e-11
-4.77689e-09
1.37613e-13
-1.57974e-10
-5.54988e-09
2.87446e-13
-2.31122e-10
-1.49019e-09
2.08156e-13
-1.33263e-10
2.14369e-09
1.0288e-13
2.38541e-09
2.3445e-14
-1.50774e-11
-4.76181e-09
1.07961e-13
-1.73833e-10
-5.39113e-09
3.13594e-13
-1.91565e-10
-1.47247e-09
2.16857e-13
-9.6619e-11
2.04879e-09
1.19201e-13
2.28884e-09
3.69334e-14
-6.37346e-11
-4.69811e-09
1.11118e-13
-1.82996e-10
-5.27187e-09
3.44723e-13
-1.7891e-10
-1.47661e-09
2.27432e-13
-9.57803e-11
1.96569e-09
1.2107e-13
2.19306e-09
3.13233e-14
-9.34707e-11
-4.60462e-09
1.8106e-13
-1.97194e-10
-5.16809e-09
3.83511e-13
-1.85844e-10
-1.48793e-09
2.52463e-13
-1.03212e-10
1.88308e-09
1.25794e-13
2.08984e-09
3.09973e-14
-1.05923e-10
-4.4987e-09
3.02037e-13
-2.35536e-10
-5.03848e-09
4.0298e-13
-2.67146e-10
-1.45636e-09
2.57889e-13
-1.57421e-10
1.77328e-09
1.19521e-13
1.93231e-09
2.05607e-14
-1.06077e-10
-4.39262e-09
4.53648e-13
-2.94852e-10
-4.84977e-09
4.07203e-13
-3.61204e-10
-1.39005e-09
2.61515e-13
-2.20113e-10
1.63214e-09
1.28076e-13
1.71221e-09
3.57401e-14
-1.19377e-10
-4.27328e-09
5.62376e-13
-3.46016e-10
-4.62328e-09
3.88688e-13
-5.20586e-10
-1.21557e-09
2.51825e-13
-2.58522e-10
1.36991e-09
1.13648e-13
1.45357e-09
2.06195e-14
-8.36216e-11
-4.18963e-09
5.90189e-13
-3.01449e-10
-4.40558e-09
3.71381e-13
-5.10683e-10
-1.00637e-09
2.40949e-13
-1.59178e-10
1.01825e-09
1.08217e-13
1.29424e-09
1.57206e-14
-9.64792e-10
-4.39567e-09
6.11697e-13
-7.60905e-10
-4.65947e-09
3.6476e-13
-4.64383e-10
-1.30305e-09
1.91774e-13
-8.99273e-11
6.43641e-10
9.81874e-14
1.20418e-09
1.71814e-14
-1.47014e-09
-4.94417e-09
3.72971e-13
-1.14358e-09
-5.55215e-09
1.6842e-13
-1.81196e-10
-2.27667e-09
1.87482e-13
5.6815e-11
4.05443e-10
1.0051e-13
1.26094e-09
2.51611e-14
-1.45728e-09
-5.48257e-09
2.73134e-13
-9.23589e-10
-6.43785e-09
-6.05628e-13
-1.19143e-10
-3.23378e-09
3.42963e-13
-6.84708e-11
3.12795e-10
-4.59622e-15
1.19255e-09
4.12522e-14
-8.34157e-11
-5.63335e-09
2.26212e-12
-3.32672e-11
-6.68534e-09
-1.55559e-12
-1.86989e-11
-3.35646e-09
-9.71326e-13
-3.21904e-11
2.32773e-10
-4.34966e-14
1.15358e-09
2.82712e-14
-4.21536e-11
-5.59213e-09
3.6167e-13
-1.7807e-10
-6.54939e-09
2.99305e-13
-3.09527e-10
-3.22506e-09
1.77164e-13
-9.85942e-11
2.00288e-11
1.00931e-13
1.05201e-09
2.64376e-14
5.46e-12
-5.5976e-09
3.44387e-13
-1.19269e-10
-6.42462e-09
3.00686e-13
-1.34791e-10
-3.20955e-09
1.72946e-13
-3.32927e-11
-8.1432e-11
9.7665e-14
1.01875e-09
3.02139e-14
-3.36763e-11
-5.56393e-09
3.36869e-13
-1.85006e-10
-6.27327e-09
2.9915e-13
-2.13981e-10
-3.18059e-09
1.67974e-13
-8.77872e-11
-2.07578e-10
9.32996e-14
9.30993e-10
2.70739e-14
-5.81473e-11
-5.50579e-09
3.39545e-13
-1.85938e-10
-6.14543e-09
3.0124e-13
-1.80883e-10
-3.18565e-09
1.65368e-13
-7.82132e-11
-3.10217e-10
8.83726e-14
8.52794e-10
2.45551e-14
-8.07443e-11
-5.42506e-09
3.7627e-13
-2.09184e-10
-6.01696e-09
2.93045e-13
-2.11374e-10
-3.1835e-09
1.52671e-13
-1.02542e-10
-4.19056e-10
7.92011e-14
7.50223e-10
1.80344e-14
-9.64564e-11
-5.32862e-09
4.3989e-13
-2.20546e-10
-5.89286e-09
2.75334e-13
-2.15891e-10
-3.18817e-09
1.37898e-13
-1.0533e-10
-5.29592e-10
7.6333e-14
6.44918e-10
2.27941e-14
-1.08908e-10
-5.21973e-09
4.95385e-13
-2.30834e-10
-5.77094e-09
2.41599e-13
-2.24376e-10
-3.19466e-09
1.10635e-13
-1.1533e-10
-6.38646e-10
6.15459e-14
5.2957e-10
1.54912e-14
-1.14158e-10
-5.10558e-09
5.14443e-13
-2.30954e-10
-5.65414e-09
2.00197e-13
-2.36621e-10
-3.18899e-09
8.82052e-14
-1.13355e-10
-7.61903e-10
4.97997e-14
4.16219e-10
1.44731e-14
-1.02026e-10
-5.00356e-09
4.88928e-13
-2.24521e-10
-5.53166e-09
1.53159e-13
-2.33868e-10
-3.17963e-09
6.03958e-14
-1.28523e-10
-8.67258e-10
3.25747e-14
2.8766e-10
6.26324e-15
-1.11764e-10
-4.89183e-09
4.52513e-13
-2.17173e-10
-5.42624e-09
1.1453e-13
-3.24457e-10
-3.07233e-09
3.93386e-14
-9.18683e-11
-1.09981e-09
2.46423e-14
1.95797e-10
7.03093e-15
-1.62676e-11
-4.88438e-09
3.55576e-13
-1.45445e-10
-5.29708e-09
7.60273e-14
-1.22514e-10
-3.0953e-09
1.94024e-14
3.9066e-12
-1.22633e-09
1.30595e-15
1.99614e-10
-8.27109e-15
-1.29404e-09
-5.16109e-09
-8.93481e-12
-1.19365e-09
-5.63428e-09
-5.4353e-13
-7.34333e-10
-3.55458e-09
2.28536e-14
-4.07486e-10
-1.55317e-09
9.85947e-15
-2.07935e-10
-6.56951e-15
4.44145e-11
-5.30895e-14
-4.65059e-10
2.83325e-14
-2.58088e-10
6.59287e-15
5.44089e-11
1.11072e-14
4.29409e-14
-1.40315e-10
-8.77208e-12
1.07184e-16
-1.31459e-10
-8.85874e-12
1.313e-16
-1.22448e-10
-9.01275e-12
1.66604e-16
-1.13246e-10
-9.20431e-12
2.09481e-16
-1.03841e-10
-9.40625e-12
2.38305e-16
-9.42476e-11
-9.59329e-12
2.65424e-16
-8.45046e-11
-9.74381e-12
2.80712e-16
-7.46655e-11
-9.8393e-12
2.9565e-16
-6.48032e-11
-9.8633e-12
3.03295e-16
-5.49921e-11
-9.81127e-12
3.18356e-16
-4.53216e-11
-9.67119e-12
3.33419e-16
-3.58749e-11
-9.44691e-12
3.52178e-16
-2.67388e-11
-9.13644e-12
3.59644e-16
-1.79943e-11
-8.74486e-12
3.55364e-16
-9.71016e-12
-8.28424e-12
3.22113e-16
-1.95654e-12
-7.7538e-12
2.65055e-16
5.20724e-12
-7.16399e-12
1.85849e-16
1.17201e-11
-6.51301e-12
1.16209e-16
1.75161e-11
-5.79615e-12
6.99343e-17
2.25134e-11
-4.99758e-12
5.31157e-17
2.65941e-11
-4.08088e-12
4.81736e-17
2.95832e-11
-2.98929e-12
4.69281e-17
3.12125e-11
-1.62957e-12
5.14061e-17
3.10728e-11
1.39527e-13
6.89339e-17
2.85875e-11
2.48518e-12
8.83829e-17
2.30701e-11
5.51729e-12
9.57841e-17
1.43637e-11
8.70636e-12
7.98436e-17
4.55365e-12
9.80996e-12
5.18825e-17
4.55357e-12
1.68502e-17
-4.28826e-10
-3.19878e-11
6.51293e-16
-4.05032e-10
-3.26558e-11
6.90548e-16
-3.80488e-10
-3.35589e-11
7.44873e-16
-3.55107e-10
-3.45884e-11
8.06785e-16
-3.2887e-10
-3.56444e-11
8.51965e-16
-3.0183e-10
-3.66325e-11
8.9405e-16
-2.74104e-10
-3.7471e-11
9.21061e-16
-2.45853e-10
-3.80894e-11
9.50024e-16
-2.17295e-10
-3.84234e-11
9.75821e-16
-1.88652e-10
-3.84544e-11
1.01341e-15
-1.6019e-10
-3.81338e-11
1.05467e-15
-1.32163e-10
-3.74741e-11
1.09803e-15
-1.04835e-10
-3.64647e-11
1.11408e-15
-7.84585e-11
-3.51223e-11
1.08632e-15
-5.32505e-11
-3.3492e-11
9.825e-16
-2.94371e-11
-3.15676e-11
8.0411e-16
-7.21233e-12
-2.93889e-11
5.72657e-16
1.32228e-11
-2.69484e-11
3.64109e-16
3.16546e-11
-2.42281e-11
2.29683e-16
4.78256e-11
-2.11689e-11
1.78986e-16
6.13774e-11
-1.76329e-11
1.66017e-16
7.17962e-11
-1.34083e-11
1.59887e-16
7.83156e-11
-8.14935e-12
1.71189e-16
7.98049e-11
-1.34996e-12
2.17802e-16
7.47057e-11
7.58429e-12
2.71796e-16
6.13162e-11
1.89067e-11
2.88748e-16
3.92577e-11
3.07649e-11
2.40113e-16
1.38164e-11
3.52511e-11
1.54881e-16
1.83699e-11
5.1777e-17
-7.18783e-10
-6.61582e-11
1.18814e-15
-6.83216e-10
-6.82265e-11
1.2453e-15
-6.4602e-10
-7.07574e-11
1.31763e-15
-6.07084e-10
-7.35282e-11
1.39731e-15
-5.66399e-10
-7.63302e-11
1.4569e-15
-5.24066e-10
-7.89646e-11
1.51164e-15
-4.80281e-10
-8.12578e-11
1.55019e-15
-4.35312e-10
-8.30574e-11
1.5927e-15
-3.89515e-10
-8.42234e-11
1.63641e-15
-3.43254e-10
-8.47135e-11
1.69581e-15
-2.96972e-10
-8.44178e-11
1.76221e-15
-2.51086e-10
-8.33603e-11
1.82744e-15
-2.06039e-10
-8.15122e-11
1.85034e-15
-1.62257e-10
-7.89051e-11
1.79679e-15
-1.20114e-10
-7.56348e-11
1.62146e-15
-8.00004e-11
-7.16813e-11
1.32387e-15
-4.22585e-11
-6.71309e-11
9.44552e-16
-7.24239e-12
-6.19646e-11
6.02792e-16
2.46732e-11
-5.61438e-11
3.85333e-16
5.30466e-11
-4.95427e-11
3.02494e-16
7.72777e-11
-4.1864e-11
2.82084e-16
9.65275e-11
-3.26584e-11
2.70747e-16
1.09573e-10
-2.11951e-11
2.89408e-16
1.14648e-10
-6.42536e-12
3.64253e-16
1.09372e-10
1.28603e-11
4.50598e-16
9.12333e-11
3.70453e-11
4.78017e-16
5.96687e-11
6.23296e-11
3.96681e-16
2.20998e-11
7.28197e-11
2.56376e-16
4.04696e-11
8.70876e-17
-1.00361e-09
-1.07728e-10
1.70048e-15
-9.5955e-10
-1.12289e-10
1.77692e-15
-9.12746e-10
-1.17564e-10
1.86691e-15
-8.63085e-10
-1.23194e-10
1.96329e-15
-8.1058e-10
-1.28836e-10
2.03624e-15
-7.55385e-10
-1.34158e-10
2.10352e-15
-6.97774e-10
-1.3887e-10
2.15418e-15
-6.38117e-10
-1.42713e-10
2.2105e-15
-5.76899e-10
-1.45446e-10
2.27149e-15
-5.14617e-10
-1.46993e-10
2.35225e-15
-4.51876e-10
-1.47161e-10
2.44145e-15
-3.8925e-10
-1.45986e-10
2.5259e-15
-3.27355e-10
-1.43408e-10
2.55183e-15
-2.66788e-10
-1.39473e-10
2.47032e-15
-2.08079e-10
-1.34343e-10
2.2238e-15
-1.51789e-10
-1.27972e-10
1.81097e-15
-9.84129e-11
-1.20507e-10
1.29075e-15
-4.84684e-11
-1.11909e-10
8.2494e-16
-2.49918e-12
-1.02113e-10
5.31358e-16
3.88641e-11
-9.09063e-11
4.19592e-16
7.47812e-11
-7.77812e-11
3.9167e-16
1.04105e-10
-6.19822e-11
3.75357e-16
1.25196e-10
-4.22865e-11
4.01397e-16
1.35731e-10
-1.6961e-11
5.03867e-16
1.32637e-10
1.59548e-11
6.21774e-16
1.12721e-10
5.69612e-11
6.55034e-16
7.52051e-11
9.98454e-11
5.44423e-16
2.88231e-11
1.19201e-10
3.52869e-16
6.92927e-11
1.20309e-16
-1.27688e-09
-1.53335e-10
2.18136e-15
-1.2275e-09
-1.61673e-10
2.27612e-15
-1.1741e-09
-1.70977e-10
2.38298e-15
-1.11656e-09
-1.80734e-10
2.49512e-15
-1.05495e-09
-1.90449e-10
2.58061e-15
-9.89464e-10
-1.99642e-10
2.66013e-15
-9.20452e-10
-2.07884e-10
2.72245e-15
-8.48373e-10
-2.14789e-10
2.79352e-15
-7.73828e-10
-2.19996e-10
2.87107e-15
-6.97432e-10
-2.23387e-10
2.97215e-15
-6.19934e-10
-2.24662e-10
3.08159e-15
-5.42053e-10
-2.23866e-10
3.18158e-15
-4.64562e-10
-2.20899e-10
3.20639e-15
-3.88221e-10
-2.15817e-10
3.0938e-15
-3.13708e-10
-2.08855e-10
2.77604e-15
-2.41753e-10
-1.99929e-10
2.2538e-15
-1.73005e-10
-1.89254e-10
1.60405e-15
-1.08147e-10
-1.76767e-10
1.02545e-15
-4.78949e-11
-1.62366e-10
6.64957e-16
6.93044e-12
-1.45732e-10
5.27706e-16
5.5255e-11
-1.26106e-10
4.93055e-16
9.56418e-11
-1.02369e-10
4.72092e-16
1.26075e-10
-7.27203e-11
5.05452e-16
1.43744e-10
-3.46304e-11
6.31215e-16
1.44985e-10
1.4714e-11
7.79956e-16
1.26017e-10
7.5929e-11
8.19456e-16
8.57916e-11
1.40071e-10
6.80793e-16
3.37617e-11
1.71231e-10
4.39951e-16
1.03054e-10
1.50994e-16
-1.53275e-09
-2.00012e-10
2.62071e-15
-1.48092e-09
-2.13509e-10
2.73451e-15
-1.42369e-09
-2.28206e-10
2.85753e-15
-1.361e-09
-2.43429e-10
2.98409e-15
-1.29293e-09
-2.58525e-10
3.08138e-15
-1.21972e-09
-2.72846e-10
3.17266e-15
-1.14179e-09
-2.85813e-10
3.24641e-15
-1.05968e-09
-2.969e-10
3.33121e-15
-9.74079e-10
-3.05606e-10
3.42592e-15
-8.85697e-10
-3.11765e-10
3.54576e-15
-7.95413e-10
-3.1495e-10
3.67232e-15
-7.04064e-10
-3.15213e-10
3.78375e-15
-6.12565e-10
-3.12399e-10
3.80329e-15
-5.21818e-10
-3.06567e-10
3.65737e-15
-4.32639e-10
-2.98031e-10
3.26833e-15
-3.45918e-10
-2.86652e-10
2.64422e-15
-2.62449e-10
-2.72722e-10
1.87892e-15
-1.83079e-10
-2.56137e-10
1.20176e-15
-1.08693e-10
-2.36752e-10
7.842e-16
-4.02962e-11
-2.14129e-10
6.25382e-16
2.08129e-11
-1.87215e-10
5.84841e-16
7.29283e-11
-1.54485e-10
5.59518e-16
1.13697e-10
-1.13489e-10
6.00236e-16
1.39882e-10
-6.08155e-11
7.49476e-16
1.47314e-10
7.28157e-12
9.2335e-16
1.31693e-10
9.15497e-11
9.68436e-16
9.16426e-11
1.80122e-10
8.03836e-16
3.68964e-11
2.25976e-10
5.19122e-16
1.39951e-10
1.78322e-16
-1.76624e-09
-2.45305e-10
3.01506e-15
-1.71441e-09
-2.65353e-10
3.14615e-15
-1.65581e-09
-2.86806e-10
3.2834e-15
-1.59042e-09
-3.08832e-10
3.42295e-15
-1.51833e-09
-3.30611e-10
3.53087e-15
-1.43985e-09
-3.51323e-10
3.63349e-15
-1.35544e-09
-3.7023e-10
3.71859e-15
-1.26568e-09
-3.86654e-10
3.81708e-15
-1.17135e-09
-3.99942e-10
3.92784e-15
-1.07323e-09
-4.09875e-10
4.06453e-15
-9.72307e-10
-4.15883e-10
4.20527e-15
-8.695e-10
-4.18018e-10
4.32373e-15
-7.65843e-10
-4.16056e-10
4.33377e-15
-6.6236e-10
-4.10054e-10
4.15076e-15
-5.59985e-10
-4.00403e-10
3.69588e-15
-4.59747e-10
-3.86892e-10
2.97936e-15
-3.62579e-10
-3.69889e-10
2.11186e-15
-2.69476e-10
-3.4924e-10
1.35203e-15
-1.81486e-10
-3.24744e-10
8.87901e-16
-9.9787e-11
-2.95828e-10
7.11438e-16
-2.58884e-11
-2.61114e-10
6.65816e-16
3.82584e-11
-2.18632e-10
6.36891e-16
9.00004e-11
-1.65231e-10
6.84661e-16
1.25732e-10
-9.65469e-11
8.54534e-16
1.4085e-10
-7.83699e-12
1.05029e-15
1.30589e-10
1.0181e-10
1.10013e-15
9.31951e-11
2.17517e-10
9.12096e-16
3.83455e-11
2.80826e-10
5.88835e-16
1.78296e-10
2.02379e-16
-1.9736e-09
-2.87337e-10
3.35777e-15
-1.92371e-09
-3.15256e-10
3.50443e-15
-1.86576e-09
-3.44756e-10
3.65426e-15
-1.79975e-09
-3.74848e-10
3.80536e-15
-1.72582e-09
-4.04545e-10
3.92266e-15
-1.64429e-09
-4.32854e-10
4.03621e-15
-1.55565e-09
-4.5887e-10
4.13233e-15
-1.46053e-09
-4.81762e-10
4.2446e-15
-1.35977e-09
-5.00715e-10
4.36993e-15
-1.25419e-09
-5.15451e-10
4.52137e-15
-1.14483e-09
-5.25244e-10
4.67282e-15
-1.03271e-09
-5.30144e-10
4.79482e-15
-9.18917e-10
-5.29846e-10
4.79174e-15
-8.04587e-10
-5.24389e-10
4.57158e-15
-6.90743e-10
-5.14242e-10
4.05501e-15
-5.78533e-10
-4.99104e-10
3.25673e-15
-4.69006e-10
-4.79416e-10
2.30271e-15
-3.6329e-10
-4.54955e-10
1.47598e-15
-2.6258e-10
-4.25455e-10
9.75208e-16
-1.68212e-10
-3.90195e-10
7.85513e-16
-8.18881e-11
-3.47439e-10
7.35866e-16
-5.7773e-12
-2.94743e-10
7.03807e-16
5.72046e-11
-2.28214e-10
7.58246e-16
1.03134e-10
-1.42477e-10
9.45929e-16
1.27038e-10
-3.17411e-11
1.1595e-15
1.2373e-10
1.05119e-10
1.21366e-15
9.10383e-11
2.50208e-10
1.00525e-15
3.83152e-11
3.33548e-10
6.48422e-16
2.16611e-10
2.23053e-16
-2.1524e-09
-3.24803e-10
3.64737e-15
-2.10588e-09
-3.61782e-10
3.80586e-15
-2.05015e-09
-4.00493e-10
3.96574e-15
-1.98522e-09
-4.39789e-10
4.12649e-15
-1.91124e-09
-4.78519e-10
4.25254e-15
-1.82857e-09
-5.15517e-10
4.37627e-15
-1.73773e-09
-5.49717e-10
4.48301e-15
-1.63936e-09
-5.80127e-10
4.60834e-15
-1.53432e-09
-6.05769e-10
4.74708e-15
-1.42346e-09
-6.26305e-10
4.91112e-15
-1.30787e-09
-6.40844e-10
5.06986e-15
-1.18858e-09
-6.49429e-10
5.19173e-15
-1.06676e-09
-6.51661e-10
5.17355e-15
-9.43605e-10
-6.47553e-10
4.91706e-15
-8.20193e-10
-6.37649e-10
4.34504e-15
-6.97768e-10
-6.21533e-10
3.47633e-15
-5.77469e-10
-5.99714e-10
2.45209e-15
-4.60538e-10
-5.71885e-10
1.57375e-15
-3.48294e-10
-5.37701e-10
1.04679e-15
-2.42213e-10
-4.96275e-10
8.47349e-16
-1.44162e-10
-4.45491e-10
7.94322e-16
-5.65027e-11
-3.82403e-10
7.60168e-16
1.76257e-11
-3.02342e-10
8.20728e-16
7.40304e-11
-1.98882e-10
1.02358e-15
1.07422e-10
-6.51325e-11
1.25353e-15
1.12232e-10
1.00308e-10
1.30884e-15
8.58431e-11
2.76598e-10
1.08289e-15
3.70595e-11
3.82331e-10
6.9827e-16
2.53671e-10
2.40282e-16
-2.30156e-09
-3.56919e-10
3.8789e-15
-2.25937e-09
-4.03984e-10
4.04697e-15
-2.20697e-09
-4.52902e-10
4.21461e-15
-2.14439e-09
-5.02377e-10
4.38361e-15
-2.07181e-09
-5.51098e-10
4.51745e-15
-1.98959e-09
-5.9773e-10
4.65092e-15
-1.89826e-09
-6.41047e-10
4.76751e-15
-1.79848e-09
-6.79903e-10
4.90532e-15
-1.69111e-09
-7.13157e-10
5.05589e-15
-1.57699e-09
-7.40411e-10
5.23031e-15
-1.45724e-09
-7.60605e-10
5.39371e-15
-1.33289e-09
-7.73772e-10
5.51296e-15
-1.20514e-09
-7.7941e-10
5.47824e-15
-1.07521e-09
-7.77498e-10
5.18808e-15
-9.44208e-10
-7.68643e-10
4.56747e-15
-8.13447e-10
-7.52297e-10
3.64034e-15
-6.84128e-10
-7.29031e-10
2.56252e-15
-5.57579e-10
-6.98433e-10
1.64745e-15
-4.35219e-10
-6.60063e-10
1.10343e-15
-3.18636e-10
-6.12857e-10
8.97649e-16
-2.09839e-10
-5.54289e-10
8.41569e-16
-1.11348e-10
-4.80894e-10
8.06118e-16
-2.64881e-11
-3.87202e-10
8.72325e-16
4.03237e-11
-2.65694e-10
1.08747e-15
8.35305e-11
-1.08339e-10
1.33013e-15
9.722e-11
8.66184e-11
1.38618e-15
7.82996e-11
2.95518e-10
1.14544e-15
3.48475e-11
4.25783e-10
7.387e-16
2.88518e-10
2.53909e-16
-2.42132e-09
-3.83356e-10
4.05146e-15
-2.38397e-09
-4.41345e-10
4.2264e-15
-2.33559e-09
-5.01285e-10
4.40006e-15
-2.27625e-09
-5.61731e-10
4.57598e-15
-2.20613e-09
-6.2122e-10
4.71696e-15
-2.1256e-09
-6.78257e-10
4.85955e-15
-2.03519e-09
-7.31461e-10
4.98623e-15
-1.93554e-09
-7.79538e-10
5.1347e-15
-1.82753e-09
-8.21191e-10
5.29579e-15
-1.71196e-09
-8.55965e-10
5.47823e-15
-1.58994e-09
-8.82632e-10
5.64448e-15
-1.4625e-09
-9.01214e-10
5.7582e-15
-1.33081e-09
-9.111e-10
5.70742e-15
-1.19609e-09
-9.12224e-10
5.38695e-15
-1.05947e-09
-9.05251e-10
4.72451e-15
-9.22291e-10
-8.89485e-10
3.75361e-15
-7.8578e-10
-8.65541e-10
2.63743e-15
-6.51323e-10
-8.32889e-10
1.69897e-15
-5.20412e-10
-7.90977e-10
1.14572e-15
-3.94721e-10
-7.38546e-10
9.36503e-16
-2.76369e-10
-6.72642e-10
8.78317e-16
-1.68001e-10
-5.89263e-10
8.41475e-16
-7.30918e-11
-4.82111e-10
9.13317e-16
3.76316e-12
-3.42549e-10
1.13749e-15
5.67851e-11
-1.61362e-10
1.39059e-15
7.97468e-11
6.36567e-11
1.44665e-15
6.90646e-11
3.06201e-10
1.19381e-15
3.19387e-11
4.62908e-10
7.69353e-16
3.20457e-10
2.64504e-16
-2.51297e-09
-4.04143e-10
4.16519e-15
-2.48062e-09
-4.73706e-10
4.3449e-15
-2.43662e-09
-5.45292e-10
4.52306e-15
-2.38105e-09
-6.17315e-10
4.70498e-15
-2.3141e-09
-6.88164e-10
4.85197e-15
-2.23616e-09
-7.56192e-10
5.00337e-15
-2.14775e-09
-8.19874e-10
5.13893e-15
-2.0495e-09
-8.7778e-10
5.29727e-15
-1.94224e-09
-9.28464e-10
5.46724e-15
-1.82678e-09
-9.71421e-10
5.65575e-15
-1.70416e-09
-1.00526e-09
5.82359e-15
-1.57537e-09
-1.03e-09
5.93028e-15
-1.44157e-09
-1.0449e-09
5.86403e-15
-1.30395e-09
-1.04986e-09
5.51838e-15
-1.1636e-09
-1.04559e-09
4.8238e-15
-1.02186e-09
-1.03123e-09
3.82138e-15
-8.79974e-10
-1.00743e-09
2.68081e-15
-7.39349e-10
-9.73511e-10
1.73117e-15
-6.01521e-10
-9.28808e-10
1.1751e-15
-4.68219e-10
-8.71848e-10
9.65002e-16
-3.41637e-10
-7.99225e-10
9.05132e-16
-2.24516e-10
-7.06385e-10
8.67715e-16
-1.20438e-10
-5.86189e-10
9.44379e-16
-3.41357e-11
-4.28851e-10
1.17706e-15
2.84284e-11
-2.23926e-10
1.4342e-15
6.07449e-11
3.13402e-11
1.49223e-15
5.87233e-11
3.08222e-10
1.22901e-15
2.85651e-11
4.93066e-10
7.91759e-16
3.49022e-10
2.71904e-16
-2.57866e-09
-4.19576e-10
4.22232e-15
-2.55119e-09
-5.01185e-10
4.40522e-15
-2.51163e-09
-5.84863e-10
4.58662e-15
-2.46007e-09
-6.68886e-10
4.77342e-15
-2.39673e-09
-7.51503e-10
4.92643e-15
-2.32199e-09
-8.30926e-10
5.08549e-15
-2.23637e-09
-9.05501e-10
5.2286e-15
-2.14047e-09
-9.7367e-10
5.39646e-15
-2.0351e-09
-1.03385e-09
5.57296e-15
-1.92101e-09
-1.0855e-09
5.76598e-15
-1.79919e-09
-1.12708e-09
5.93404e-15
-1.6706e-09
-1.15859e-09
6.03324e-15
-1.53631e-09
-1.17919e-09
5.95383e-15
-1.39746e-09
-1.18872e-09
5.58828e-15
-1.25511e-09
-1.18793e-09
4.87089e-15
-1.11057e-09
-1.17578e-09
3.84919e-15
-9.65047e-10
-1.15295e-09
2.69672e-15
-8.19951e-10
-1.1186e-09
1.74615e-15
-6.7683e-10
-1.07193e-09
1.19277e-15
-5.37439e-10
-1.01124e-09
9.83541e-16
-4.04017e-10
-9.32647e-10
9.22423e-16
-2.79362e-10
-8.31041e-10
8.84837e-16
-1.67127e-10
-6.98424e-10
9.6591e-16
-7.21432e-11
-5.23835e-10
1.20423e-15
-5.16002e-13
-2.95553e-10
1.46434e-15
4.09896e-11
-1.01655e-11
1.52164e-15
4.77663e-11
3.01446e-10
1.25216e-15
2.4921e-11
5.15911e-10
8.06711e-16
3.73943e-10
2.77019e-16
-2.62111e-09
-4.30135e-10
4.22941e-15
-2.5982e-09
-5.24098e-10
4.41244e-15
-2.56292e-09
-6.20147e-10
4.59557e-15
-2.5154e-09
-7.16424e-10
4.78653e-15
-2.45585e-09
-8.11049e-10
4.94493e-15
-2.38467e-09
-9.02102e-10
5.1106e-15
-2.30236e-09
-9.87812e-10
5.26165e-15
-2.20951e-09
-1.06651e-09
5.43518e-15
-2.10688e-09
-1.1365e-09
5.61768e-15
-1.99517e-09
-1.19721e-09
5.81359e-15
-1.87532e-09
-1.24694e-09
5.9808e-15
-1.74818e-09
-1.28572e-09
6.0731e-15
-1.61479e-09
-1.31258e-09
5.98298e-15
-1.4762e-09
-1.32732e-09
5.60234e-15
-1.3334e-09
-1.33072e-09
4.87177e-15
-1.18764e-09
-1.32155e-09
3.84319e-15
-1.04008e-09
-1.3005e-09
2.69148e-15
-8.92105e-10
-1.26658e-09
1.74689e-15
-7.45245e-10
-1.2188e-09
1.20041e-15
-6.01249e-10
-1.15523e-09
9.93195e-16
-4.62373e-10
-1.07153e-09
9.31226e-16
-3.31433e-10
-9.61982e-10
8.94037e-16
-2.1212e-10
-8.17736e-10
9.7876e-16
-1.09324e-10
-6.26631e-10
1.2204e-15
-2.92557e-11
-3.75622e-10
1.48181e-15
2.10872e-11
-6.05085e-11
1.53648e-15
3.6579e-11
2.85954e-10
1.26437e-15
2.11586e-11
5.31332e-10
8.14723e-16
3.95101e-10
2.79776e-16
-2.64331e-09
-4.36405e-10
4.18848e-15
-2.62454e-09
-5.42885e-10
4.37127e-15
-2.59325e-09
-6.51438e-10
4.55546e-15
-2.54961e-09
-7.60076e-10
4.75025e-15
-2.49387e-09
-8.66795e-10
4.91236e-15
-2.4264e-09
-9.69559e-10
5.08452e-15
-2.34773e-09
-1.06649e-09
5.24091e-15
-2.25839e-09
-1.15584e-09
5.42043e-15
-2.15912e-09
-1.23579e-09
5.60705e-15
-2.05056e-09
-1.30576e-09
5.80443e-15
-1.93357e-09
-1.36394e-09
5.97015e-15
-1.80893e-09
-1.41035e-09
6.0568e-15
-1.67758e-09
-1.44394e-09
5.95859e-15
-1.54049e-09
-1.46442e-09
5.57047e-15
-1.39857e-09
-1.47263e-09
4.83534e-15
-1.25297e-09
-1.46715e-09
3.80843e-15
-1.1048e-09
-1.44866e-09
2.66661e-15
-9.55395e-10
-1.41598e-09
1.73541e-15
-8.06228e-10
-1.36797e-09
1.19888e-15
-6.59024e-10
-1.30243e-09
9.94943e-16
-5.16019e-10
-1.21453e-09
9.32603e-16
-3.80021e-10
-1.09798e-09
8.96014e-16
-2.54721e-10
-9.43036e-10
9.83443e-16
-1.45028e-10
-7.36323e-10
1.22657e-15
-5.72277e-11
-4.63423e-10
1.48811e-15
1.47662e-12
-1.19213e-10
1.54134e-15
2.54427e-11
2.61988e-10
1.26688e-15
1.73882e-11
5.39386e-10
8.16529e-16
4.12489e-10
2.8035e-16
-2.64839e-09
-4.39016e-10
4.10798e-15
-2.63323e-09
-5.58053e-10
4.28929e-15
-2.60556e-09
-6.79117e-10
4.47386e-15
-2.56555e-09
-8.00093e-10
4.6713e-15
-2.51349e-09
-9.18862e-10
4.83678e-15
-2.44976e-09
-1.03328e-09
5.01394e-15
-2.37486e-09
-1.14139e-09
5.17482e-15
-2.28933e-09
-1.24136e-09
5.35816e-15
-2.19384e-09
-1.33129e-09
5.54768e-15
-2.08898e-09
-1.41062e-09
5.74531e-15
-1.97553e-09
-1.4774e-09
5.90905e-15
-1.85419e-09
-1.53168e-09
5.99128e-15
-1.72579e-09
-1.57233e-09
5.88791e-15
-1.59122e-09
-1.599e-09
5.49724e-15
-1.45127e-09
-1.61257e-09
4.7656e-15
-1.30702e-09
-1.61141e-09
3.74974e-15
-1.15948e-09
-1.5962e-09
2.62644e-15
-1.0099e-09
-1.56556e-09
1.71488e-15
-8.59711e-10
-1.51816e-09
1.18983e-15
-7.10566e-10
-1.45158e-09
9.89998e-16
-5.64661e-10
-1.36044e-09
9.27709e-16
-4.24764e-10
-1.23788e-09
8.91734e-16
-2.9453e-10
-1.07327e-09
9.80787e-16
-1.78859e-10
-8.51995e-10
1.22368e-15
-8.40711e-11
-5.5821e-10
1.48162e-15
-1.75516e-11
-1.85733e-10
1.53443e-15
1.45437e-11
2.29893e-10
1.26057e-15
1.36819e-11
5.40247e-10
8.12871e-16
4.26171e-10
2.79087e-16
-2.63935e-09
-4.38597e-10
3.9936e-15
-2.62728e-09
-5.70127e-10
4.174e-15
-2.6028e-09
-7.03603e-10
4.35843e-15
-2.56612e-09
-8.36784e-10
4.55765e-15
-2.51754e-09
-9.67447e-10
4.72532e-15
-2.45746e-09
-1.09336e-09
4.90616e-15
-2.38637e-09
-1.21248e-09
5.07025e-15
-2.30478e-09
-1.32294e-09
5.25735e-15
-2.21333e-09
-1.42276e-09
5.4468e-15
-2.11254e-09
-1.5114e-09
5.64341e-15
-2.00311e-09
-1.58683e-09
5.80487e-15
-1.88566e-09
-1.64913e-09
5.88378e-15
-1.76093e-09
-1.69707e-09
5.77788e-15
-1.62966e-09
-1.73028e-09
5.39024e-15
-1.49258e-09
-1.74964e-09
4.66879e-15
-1.35064e-09
-1.75336e-09
3.67291e-15
-1.20476e-09
-1.74207e-09
2.57384e-15
-1.0561e-09
-1.71422e-09
1.68426e-15
-9.05986e-10
-1.66828e-09
1.1741e-15
-7.5602e-10
-1.60154e-09
9.78642e-16
-6.08318e-10
-1.50814e-09
9.16681e-16
-4.6558e-10
-1.38062e-09
8.81124e-16
-3.314e-10
-1.20745e-09
9.71639e-16
-2.10631e-10
-9.72765e-10
1.21251e-15
-1.09598e-10
-6.59243e-10
1.46617e-15
-3.58404e-11
-2.59491e-10
1.51641e-15
3.98775e-12
1.90064e-10
1.24646e-15
1.00789e-11
5.34156e-10
8.04227e-16
4.3625e-10
2.76169e-16
-2.61898e-09
-4.35739e-10
3.86233e-15
-2.6095e-09
-5.79614e-10
4.03653e-15
-2.5878e-09
-7.25313e-10
4.21785e-15
-2.55412e-09
-8.70479e-10
4.41698e-15
-2.50878e-09
-1.01279e-09
4.5854e-15
-2.45219e-09
-1.14993e-09
4.76855e-15
-2.38486e-09
-1.27982e-09
4.93434e-15
-2.30726e-09
-1.40053e-09
5.12217e-15
-2.21999e-09
-1.51006e-09
5.31164e-15
-2.12349e-09
-1.60788e-09
5.50614e-15
-2.01842e-09
-1.69191e-09
5.66499e-15
-1.90528e-09
-1.76226e-09
5.74158e-15
-1.78471e-09
-1.81764e-09
5.63568e-15
-1.65736e-09
-1.85764e-09
5.25609e-15
-1.52383e-09
-1.88317e-09
4.55035e-15
-1.38496e-09
-1.89223e-09
3.57884e-15
-1.24157e-09
-1.88546e-09
2.51146e-15
-1.09471e-09
-1.86108e-09
1.64786e-15
-9.4561e-10
-1.81738e-09
1.15304e-15
-7.95779e-10
-1.75137e-09
9.62161e-16
-6.47241e-10
-1.65668e-09
9.00474e-16
-5.02605e-10
-1.52525e-09
8.65595e-16
-3.65376e-10
-1.34468e-09
9.56692e-16
-2.40327e-10
-1.09781e-09
1.1941e-15
-1.3376e-10
-7.65811e-10
1.44228e-15
-5.33353e-11
-3.39915e-10
1.49108e-15
-6.19123e-12
1.4292e-10
1.22546e-15
6.59184e-12
5.21373e-10
7.91168e-16
4.42842e-10
2.71821e-16
-2.5898e-09
-4.30973e-10
3.71566e-15
-2.58245e-09
-5.86973e-10
3.88244e-15
-2.56313e-09
-7.44636e-10
4.059e-15
-2.53213e-09
-9.01491e-10
4.25654e-15
-2.48979e-09
-1.05513e-09
4.42428e-15
-2.43654e-09
-1.20317e-09
4.60819e-15
-2.37287e-09
-1.3435e-09
4.77436e-15
-2.29923e-09
-1.47416e-09
4.96177e-15
-2.21618e-09
-1.59313e-09
5.14945e-15
-2.12411e-09
-1.69994e-09
5.34091e-15
-2.02358e-09
-1.79245e-09
5.49652e-15
-1.91503e-09
-1.87081e-09
5.57113e-15
-1.79897e-09
-1.9337e-09
5.4677e-15
-1.67596e-09
-1.98066e-09
5.09829e-15
-1.54648e-09
-2.01264e-09
4.41496e-15
-1.41126e-09
-2.02746e-09
3.47428e-15
-1.271e-09
-2.02572e-09
2.44145e-15
-1.12664e-09
-2.00544e-09
1.60627e-15
-9.79313e-10
-1.96471e-09
1.12729e-15
-8.30409e-10
-1.90027e-09
9.4105e-16
-6.81849e-10
-1.80524e-09
8.7976e-16
-5.3613e-10
-1.67097e-09
8.45865e-16
-3.96643e-10
-1.48416e-09
9.36171e-16
-2.68055e-10
-1.2264e-09
1.1691e-15
-1.5661e-10
-8.77256e-10
1.41007e-15
-7.00622e-11
-4.26464e-10
1.45891e-15
-1.60065e-11
8.88642e-11
1.19912e-15
3.21389e-12
5.02152e-10
7.7494e-16
4.46055e-10
2.66183e-16
-2.55401e-09
-4.24757e-10
3.56213e-15
-2.54838e-09
-5.92604e-10
3.71859e-15
-2.53111e-09
-7.61912e-10
3.88863e-15
-2.50251e-09
-9.30104e-10
4.08298e-15
-2.46295e-09
-1.09469e-09
4.2487e-15
-2.41286e-09
-1.25325e-09
4.43192e-15
-2.35273e-09
-1.40363e-09
4.59703e-15
-2.283e-09
-1.54389e-09
4.78267e-15
-2.20415e-09
-1.67199e-09
4.96711e-15
-2.11655e-09
-1.78753e-09
5.1543e-15
-2.02066e-09
-1.88834e-09
5.30627e-15
-1.91684e-09
-1.97463e-09
5.37931e-15
-1.80552e-09
-2.04503e-09
5.27983e-15
-1.68712e-09
-2.09906e-09
4.92397e-15
-1.56203e-09
-2.13772e-09
4.26667e-15
-1.43087e-09
-2.15863e-09
3.3599e-15
-1.29421e-09
-2.16237e-09
2.36497e-15
-1.15289e-09
-2.14676e-09
1.56022e-15
-1.00792e-09
-2.10968e-09
1.09832e-15
-8.60579e-10
-2.04761e-09
9.16502e-16
-7.12664e-10
-1.95316e-09
8.55352e-16
-5.66548e-10
-1.81709e-09
8.2218e-16
-4.25483e-10
-1.62523e-09
9.10541e-16
-2.94009e-10
-1.35788e-09
1.13863e-15
-1.78279e-10
-9.92986e-10
1.37313e-15
-8.61046e-11
-5.18638e-10
1.42134e-15
-2.55075e-11
2.82668e-11
1.16743e-15
-9.73546e-14
4.76742e-10
7.55248e-16
4.45958e-10
2.59511e-16
-2.5135e-09
-4.17465e-10
3.40231e-15
-2.50928e-09
-5.96831e-10
3.54859e-15
-2.49378e-09
-7.77418e-10
3.7119e-15
-2.46735e-09
-9.56547e-10
3.90199e-15
-2.43037e-09
-1.13167e-09
4.06469e-15
-2.3833e-09
-1.30031e-09
4.24589e-15
-2.3266e-09
-1.46034e-09
4.4086e-15
-2.26068e-09
-1.6098e-09
4.59105e-15
-2.18599e-09
-1.74669e-09
4.77101e-15
-2.10284e-09
-1.87068e-09
4.95293e-15
-2.01162e-09
-1.97956e-09
5.10037e-15
-1.91259e-09
-2.07365e-09
5.1719e-15
-1.80609e-09
-2.15153e-09
5.07741e-15
-1.69246e-09
-2.2127e-09
4.7374e-15
-1.57197e-09
-2.2582e-09
4.107e-15
-1.44512e-09
-2.28548e-09
3.23919e-15
-1.31239e-09
-2.2951e-09
2.28351e-15
-1.17448e-09
-2.28467e-09
1.51099e-15
-1.0323e-09
-2.25186e-09
1.06597e-15
-8.87007e-10
-2.1929e-09
8.8875e-16
-7.40265e-10
-2.09991e-09
8.27756e-16
-5.94307e-10
-1.96305e-09
7.94932e-16
-4.52237e-10
-1.76729e-09
8.82886e-16
-3.18437e-10
-1.49168e-09
1.10333e-15
-1.98943e-10
-1.11248e-09
1.32956e-15
-1.01585e-10
-6.15997e-10
1.376e-15
-3.47715e-11
-3.85472e-11
1.13134e-15
-3.33119e-12
4.45302e-10
7.32686e-16
4.42627e-10
2.51856e-16
-2.4699e-09
-4.0938e-10
3.24748e-15
-2.46684e-09
-5.99898e-10
3.37948e-15
-2.4529e-09
-7.91359e-10
3.53421e-15
-2.42846e-09
-9.80994e-10
3.71902e-15
-2.39393e-09
-1.1662e-09
3.87765e-15
-2.34975e-09
-1.34449e-09
4.05554e-15
-2.29638e-09
-1.51372e-09
4.21419e-15
-2.23419e-09
-1.67198e-09
4.39254e-15
-2.16359e-09
-1.81731e-09
4.56677e-15
-2.08483e-09
-1.94943e-09
4.74235e-15
-1.99824e-09
-2.06617e-09
4.88464e-15
-1.90399e-09
-2.16789e-09
4.95417e-15
-1.80233e-09
-2.25318e-09
4.86508e-15
-1.69351e-09
-2.32153e-09
4.54237e-15
-1.57771e-09
-2.374e-09
3.94062e-15
-1.4553e-09
-2.40789e-09
3.11317e-15
-1.32668e-09
-2.42373e-09
2.20066e-15
-1.19242e-09
-2.41892e-09
1.46011e-15
-1.05332e-09
-2.39096e-09
1.03183e-15
-9.1042e-10
-2.33581e-09
8.58861e-16
-7.65246e-10
-2.24508e-09
7.98036e-16
-6.19884e-10
-2.10841e-09
7.65578e-16
-4.77272e-10
-1.90991e-09
8.51607e-16
-3.41618e-10
-1.62733e-09
1.06425e-15
-2.18808e-10
-1.23529e-09
1.28293e-15
-1.1665e-10
-7.18155e-10
1.32728e-15
-4.38929e-11
-1.11304e-10
1.09175e-15
-6.56649e-12
4.07975e-10
7.07789e-16
4.3606e-10
2.43391e-16
-2.42456e-09
-4.00699e-10
3.09285e-15
-2.4225e-09
-6.01967e-10
3.21245e-15
-2.40999e-09
-8.03869e-10
3.35923e-15
-2.38744e-09
-1.00355e-09
3.53841e-15
-2.35526e-09
-1.19838e-09
3.6922e-15
-2.3139e-09
-1.38585e-09
3.86569e-15
-2.26377e-09
-1.56385e-09
4.02014e-15
-2.20523e-09
-1.73051e-09
4.1922e-15
-2.13865e-09
-1.88391e-09
4.35951e-15
-2.0642e-09
-2.02387e-09
4.52754e-15
-1.98215e-09
-2.14822e-09
4.6637e-15
-1.8926e-09
-2.25743e-09
4.73084e-15
-1.79573e-09
-2.35006e-09
4.647e-15
-1.69168e-09
-2.42558e-09
4.34231e-15
-1.58054e-09
-2.48513e-09
3.77166e-15
-1.46261e-09
-2.52583e-09
2.98501e-15
-1.33815e-09
-2.54818e-09
2.11437e-15
-1.20766e-09
-2.54941e-09
1.40772e-15
-1.07181e-09
-2.52681e-09
9.96143e-16
-9.31524e-10
-2.47609e-09
8.27636e-16
-7.88193e-10
-2.38841e-09
7.66842e-16
-6.43751e-10
-2.25285e-09
7.34167e-16
-5.0096e-10
-2.0527e-09
8.17477e-16
-3.63836e-10
-1.76445e-09
1.02195e-15
-2.38087e-10
-1.36104e-09
1.23195e-15
-1.31455e-10
-8.24787e-10
1.27449e-15
-5.29743e-11
-1.89785e-10
1.04879e-15
-9.8384e-12
3.6484e-10
6.81239e-16
4.26222e-10
2.34258e-16
-2.37865e-09
-3.91529e-10
2.94523e-15
-2.3775e-09
-6.0312e-10
3.05196e-15
-2.36637e-09
-8.15007e-10
3.19105e-15
-2.34566e-09
-1.02427e-09
3.36398e-15
-2.3158e-09
-1.22825e-09
3.51229e-15
-2.2772e-09
-1.42444e-09
3.68028e-15
-2.23027e-09
-1.61078e-09
3.82908e-15
-2.17532e-09
-1.78546e-09
3.99402e-15
-2.11266e-09
-1.94658e-09
4.15359e-15
-2.04242e-09
-2.09409e-09
4.31293e-15
-1.9648e-09
-2.22585e-09
4.44193e-15
-1.87984e-09
-2.34239e-09
4.50542e-15
-1.78763e-09
-2.44227e-09
4.42674e-15
-1.68823e-09
-2.52499e-09
4.13858e-15
-1.58166e-09
-2.59169e-09
3.6001e-15
-1.46812e-09
-2.63937e-09
2.85452e-15
-1.3478e-09
-2.6685e-09
2.0288e-15
-1.22108e-09
-2.67612e-09
1.35451e-15
-1.08855e-09
-2.65935e-09
9.6004e-16
-9.50981e-10
-2.61366e-09
7.95513e-16
-8.0966e-10
-2.52974e-09
7.34664e-16
-6.6636e-10
-2.39615e-09
7.01968e-16
-5.2366e-10
-2.19539e-09
7.81742e-16
-3.85371e-10
-1.90274e-09
9.77123e-16
-2.56993e-10
-1.48942e-09
1.17675e-15
-1.46157e-10
-9.35624e-10
1.21941e-15
-6.21207e-11
-2.73821e-10
1.00361e-15
-1.31948e-11
3.15914e-10
6.54168e-16
4.13027e-10
2.24623e-16
-2.33316e-09
-3.81894e-10
2.80141e-15
-2.33293e-09
-6.03359e-10
2.90018e-15
-2.32318e-09
-8.24761e-10
3.03249e-15
-2.30432e-09
-1.04313e-09
3.1989e-15
-2.27678e-09
-1.25579e-09
3.34155e-15
-2.24094e-09
-1.46027e-09
3.50256e-15
-2.19718e-09
-1.65455e-09
3.64466e-15
-2.14576e-09
-1.83687e-09
3.80118e-15
-2.08694e-09
-2.00541e-09
3.95214e-15
-2.02081e-09
-2.16022e-09
4.10206e-15
-1.94748e-09
-2.29918e-09
4.22297e-15
-1.86694e-09
-2.42292e-09
4.28241e-15
-1.77921e-09
-2.53e-09
4.20753e-15
-1.68429e-09
-2.61991e-09
3.93587e-15
-1.58212e-09
-2.69385e-09
3.42843e-15
-1.47283e-09
-2.74867e-09
2.72419e-15
-1.35652e-09
-2.78481e-09
1.94211e-15
-1.23349e-09
-2.79915e-09
1.30088e-15
-1.10422e-09
-2.78863e-09
9.22894e-16
-9.69394e-10
-2.74848e-09
7.62567e-16
-8.30153e-10
-2.66898e-09
7.01549e-16
-6.88124e-10
-2.53818e-09
6.68559e-16
-5.45702e-10
-2.33781e-09
7.44578e-16
-4.06479e-10
-2.04197e-09
9.30406e-16
-2.75724e-10
-1.62017e-09
1.12062e-15
-1.60904e-10
-1.05044e-09
1.16166e-15
-7.14351e-11
-3.63291e-10
9.56645e-16
-1.66846e-11
2.61163e-10
6.23303e-16
3.96342e-10
2.14637e-16
-2.28892e-09
-3.71739e-10
2.67759e-15
-2.28968e-09
-6.02614e-10
2.76403e-15
-2.28138e-09
-8.3306e-10
2.88764e-15
-2.26445e-09
-1.06007e-09
3.04589e-15
-2.23928e-09
-1.28097e-09
3.18155e-15
-2.20623e-09
-1.49332e-09
3.33494e-15
-2.16563e-09
-1.69515e-09
3.46955e-15
-2.1177e-09
-1.88479e-09
3.61784e-15
-2.06264e-09
-2.06048e-09
3.75858e-15
-2.00047e-09
-2.22238e-09
3.89806e-15
-1.93127e-09
-2.36839e-09
4.00989e-15
-1.85496e-09
-2.49923e-09
4.06387e-15
-1.7715e-09
-2.61346e-09
3.99208e-15
-1.68084e-09
-2.71058e-09
3.73581e-15
-1.58284e-09
-2.79184e-09
3.25932e-15
-1.47758e-09
-2.85394e-09
2.59375e-15
-1.36509e-09
-2.8973e-09
1.85632e-15
-1.24558e-09
-2.91865e-09
1.24765e-15
-1.11945e-09
-2.91476e-09
8.86335e-16
-9.87291e-10
-2.88064e-09
7.29847e-16
-8.50117e-10
-2.80615e-09
6.68404e-16
-7.09407e-10
-2.67889e-09
6.34828e-16
-5.67375e-10
-2.47984e-09
7.0678e-16
-4.27386e-10
-2.18196e-09
8.82218e-16
-2.94451e-10
-1.75311e-09
1.06458e-15
-1.7583e-10
-1.16907e-09
1.10328e-15
-8.1013e-11
-4.58108e-10
9.08757e-16
-2.03563e-11
2.00507e-10
5.92548e-16
3.75986e-10
2.0465e-16
-2.24668e-09
-3.6094e-10
2.56672e-15
-2.24854e-09
-6.00754e-10
2.64265e-15
-2.24183e-09
-8.39774e-10
2.75709e-15
-2.22694e-09
-1.07497e-09
2.90639e-15
-2.20422e-09
-1.30369e-09
3.03391e-15
-2.17401e-09
-1.52353e-09
3.17893e-15
-2.13657e-09
-1.73259e-09
3.30609e-15
-2.09208e-09
-1.92928e-09
3.44466e-15
-2.04068e-09
-2.1119e-09
3.57489e-15
-1.98234e-09
-2.28071e-09
3.70331e-15
-1.91709e-09
-2.43365e-09
3.80532e-15
-1.84478e-09
-2.57153e-09
3.85281e-15
-1.76535e-09
-2.6929e-09
3.78284e-15
-1.67867e-09
-2.79727e-09
3.54086e-15
-1.58458e-09
-2.88592e-09
3.09208e-15
-1.48308e-09
-2.95544e-09
2.46845e-15
-1.37414e-09
-3.00624e-09
1.77177e-15
-1.25793e-09
-3.03486e-09
1.1952e-15
-1.13475e-09
-3.03794e-09
8.50119e-16
-1.00511e-09
-3.01028e-09
6.97197e-16
-8.6992e-10
-2.94135e-09
6.35365e-16
-7.3051e-10
-2.8183e-09
6.01121e-16
-5.88915e-10
-2.62144e-09
6.67842e-16
-4.48271e-10
-2.3226e-09
8.35637e-16
-3.13315e-10
-1.88806e-09
1.00611e-15
-1.91042e-10
-1.29134e-09
1.04513e-15
-9.09388e-11
-5.58211e-10
8.5986e-16
-2.42568e-11
1.33825e-10
5.61649e-16
3.51729e-10
1.93884e-16
-2.20704e-09
-3.49313e-10
2.47306e-15
-2.2102e-09
-5.97598e-10
2.53719e-15
-2.20524e-09
-8.44736e-10
2.64173e-15
-2.19253e-09
-1.0877e-09
2.78118e-15
-2.17237e-09
-1.32384e-09
2.90061e-15
-2.14505e-09
-1.55084e-09
3.03701e-15
-2.11078e-09
-1.76686e-09
3.15519e-15
-2.06968e-09
-1.97037e-09
3.28307e-15
-2.02184e-09
-2.15975e-09
3.40297e-15
-1.96717e-09
-2.33537e-09
3.51968e-15
-1.90565e-09
-2.49518e-09
3.61104e-15
-1.83711e-09
-2.64006e-09
3.6512e-15
-1.76142e-09
-2.7686e-09
3.58182e-15
-1.67843e-09
-2.88027e-09
3.35184e-15
-1.58792e-09
-2.97642e-09
2.93058e-15
-1.48986e-09
-3.0535e-09
2.3446e-15
-1.38419e-09
-3.11191e-09
1.68948e-15
-1.27099e-09
-3.14806e-09
1.14426e-15
-1.15052e-09
-3.15841e-09
8.15025e-16
-1.02321e-09
-3.13759e-09
6.6563e-16
-8.89847e-10
-3.07471e-09
6.03197e-16
-7.51657e-10
-2.9565e-09
5.68643e-16
-6.10495e-10
-2.7626e-09
6.30774e-16
-4.69264e-10
-2.46383e-09
7.88889e-16
-3.3241e-10
-2.02492e-09
9.4966e-16
-2.06618e-10
-1.41713e-09
9.84969e-16
-1.0128e-10
-6.63549e-10
8.11503e-16
-2.84293e-11
6.09742e-11
5.30624e-16
3.233e-10
1.83165e-16
-2.17053e-09
-3.36631e-10
2.38745e-15
-2.17521e-09
-5.92927e-10
2.44472e-15
-2.17219e-09
-8.47753e-10
2.54086e-15
-2.16181e-09
-1.09809e-09
2.67023e-15
-2.14432e-09
-1.34133e-09
2.78098e-15
-2.11995e-09
-1.57521e-09
2.90844e-15
-2.08885e-09
-1.79796e-09
3.0178e-15
-2.05108e-09
-2.00814e-09
3.13581e-15
-2.00667e-09
-2.20418e-09
3.24412e-15
-1.9555e-09
-2.38653e-09
3.34907e-15
-1.89749e-09
-2.55319e-09
3.42892e-15
-1.83244e-09
-2.70511e-09
3.46106e-15
-1.76019e-09
-2.84085e-09
3.39115e-15
-1.68055e-09
-2.95992e-09
3.17288e-15
-1.59329e-09
-3.06367e-09
2.77593e-15
-1.49834e-09
-3.14846e-09
2.22616e-15
-1.39558e-09
-3.21467e-09
1.60989e-15
-1.28508e-09
-3.25855e-09
1.09516e-15
-1.16704e-09
-3.27646e-09
7.80859e-16
-1.0418e-09
-3.26283e-09
6.34613e-16
-9.10084e-10
-3.20642e-09
5.7162e-16
-7.7299e-10
-3.09359e-09
5.36138e-16
-6.32212e-10
-2.90337e-09
5.95583e-16
-4.90427e-10
-2.60562e-09
7.42591e-16
-3.51779e-10
-2.16357e-09
8.9237e-16
-2.22596e-10
-1.54632e-09
9.26317e-16
-1.12084e-10
-7.74062e-10
7.63713e-16
-3.29121e-11
-1.8197e-11
5.00088e-16
2.90387e-10
1.7266e-16
-2.13757e-09
-3.22636e-10
2.32104e-15
-2.14399e-09
-5.8651e-10
2.36778e-15
-2.14312e-09
-8.48628e-10
2.4545e-15
-2.13523e-09
-1.10599e-09
2.57355e-15
-2.12051e-09
-1.35605e-09
2.67645e-15
-2.09913e-09
-1.59659e-09
2.79381e-15
-2.07117e-09
-1.82591e-09
2.89382e-15
-2.03664e-09
-2.04266e-09
3.00189e-15
-1.99553e-09
-2.24531e-09
3.09906e-15
-1.94765e-09
-2.4344e-09
3.19183e-15
-1.8929e-09
-2.60794e-09
3.26045e-15
-1.83106e-09
-2.76695e-09
3.28386e-15
-1.76192e-09
-2.90999e-09
3.21225e-15
-1.6853e-09
-3.03655e-09
3.00378e-15
-1.60092e-09
-3.14803e-09
2.63016e-15
-1.5087e-09
-3.24068e-09
2.11274e-15
-1.40851e-09
-3.31486e-09
1.53389e-15
-1.30037e-09
-3.36669e-09
1.04814e-15
-1.18443e-09
-3.3924e-09
7.48368e-16
-1.06099e-09
-3.38626e-09
6.0493e-16
-9.30705e-10
-3.33671e-09
5.41644e-16
-7.94551e-10
-3.22975e-09
5.05642e-16
-6.5408e-10
-3.04384e-09
5.60913e-16
-5.11751e-10
-2.74795e-09
6.97932e-16
-3.71402e-10
-2.30391e-09
8.38745e-16
-2.38968e-10
-1.67875e-09
8.6967e-16
-1.23367e-10
-8.89664e-10
7.17381e-16
-3.77361e-11
-1.03827e-10
4.70596e-16
2.52651e-10
1.62522e-16
-2.10848e-09
-3.07067e-10
2.2611e-15
-2.11688e-09
-5.78115e-10
2.30176e-15
-2.11833e-09
-8.47175e-10
2.38071e-15
-2.11305e-09
-1.11128e-09
2.49019e-15
-2.10118e-09
-1.36793e-09
2.58535e-15
-2.08279e-09
-1.61497e-09
2.69304e-15
-2.05793e-09
-1.85078e-09
2.78485e-15
-2.02652e-09
-2.07405e-09
2.88189e-15
-1.98853e-09
-2.28332e-09
2.96837e-15
-1.94372e-09
-2.4792e-09
3.04925e-15
-1.89197e-09
-2.6597e-09
3.10657e-15
-1.83302e-09
-2.82589e-09
3.1208e-15
-1.76667e-09
-2.97634e-09
3.04664e-15
-1.6927e-09
-3.11053e-09
2.84632e-15
-1.61084e-09
-3.22988e-09
2.4928e-15
-1.52099e-09
-3.33054e-09
2.0064e-15
-1.42299e-09
-3.41286e-09
1.46122e-15
-1.31685e-09
-3.47283e-09
1.00331e-15
-1.20269e-09
-3.50656e-09
7.17178e-16
-1.08077e-09
-3.50818e-09
5.76748e-16
-9.51669e-10
-3.46582e-09
5.12664e-16
-8.1628e-10
-3.36514e-09
4.76073e-16
-6.76019e-10
-3.1841e-09
5.27353e-16
-5.33144e-10
-2.89082e-09
6.54972e-16
-3.91189e-10
-2.44587e-09
7.86353e-16
-2.55665e-10
-1.81428e-09
8.15116e-16
-1.35113e-10
-1.01022e-09
6.71986e-16
-4.29216e-11
-1.96018e-10
4.41382e-16
2.0973e-10
1.5249e-16
-2.08344e-09
-2.89675e-10
2.21244e-15
-2.09402e-09
-5.67542e-10
2.24713e-15
-2.09795e-09
-8.43246e-10
2.31934e-15
-2.09538e-09
-1.11386e-09
2.4197e-15
-2.08637e-09
-1.37694e-09
2.50734e-15
-2.07094e-09
-1.63039e-09
2.60569e-15
-2.04907e-09
-1.87265e-09
2.68864e-15
-2.02064e-09
-2.10247e-09
2.77621e-15
-1.98556e-09
-2.31842e-09
2.85234e-15
-1.94358e-09
-2.52117e-09
2.9218e-15
-1.89454e-09
-2.70874e-09
2.96802e-15
-1.83817e-09
-2.88225e-09
2.97298e-15
-1.77426e-09
-3.04025e-09
2.89567e-15
-1.70259e-09
-3.18221e-09
2.7e-15
-1.62288e-09
-3.30958e-09
2.3654e-15
-1.53502e-09
-3.41841e-09
1.9086e-15
-1.43886e-09
-3.50902e-09
1.39555e-15
-1.33437e-09
-3.57731e-09
9.61325e-16
-1.22167e-09
-3.61926e-09
6.88068e-16
-1.10097e-09
-3.62888e-09
5.50441e-16
-9.72809e-10
-3.59398e-09
4.85601e-16
-8.38004e-10
-3.49994e-09
4.48315e-16
-6.97852e-10
-3.32425e-09
4.95797e-16
-5.54425e-10
-3.03425e-09
6.14486e-16
-4.10971e-10
-2.58932e-09
7.36648e-16
-2.72557e-10
-1.95269e-09
7.63484e-16
-1.47262e-10
-1.13551e-09
6.29065e-16
-4.84748e-11
-2.94805e-10
4.13899e-16
1.61255e-10
1.43067e-16
-2.06254e-09
-2.70252e-10
2.16732e-15
-2.07545e-09
-5.54634e-10
2.20212e-15
-2.08195e-09
-8.36749e-10
2.2694e-15
-2.08212e-09
-1.11371e-09
2.36146e-15
-2.07593e-09
-1.38312e-09
2.44197e-15
-2.06337e-09
-1.64295e-09
2.53135e-15
-2.04434e-09
-1.89168e-09
2.60648e-15
-2.01869e-09
-2.12811e-09
2.68485e-15
-1.98628e-09
-2.35084e-09
2.7511e-15
-1.94685e-09
-2.56059e-09
2.80996e-15
-1.90022e-09
-2.75538e-09
2.84558e-15
-1.84611e-09
-2.93636e-09
2.84159e-15
-1.7843e-09
-3.10206e-09
2.76061e-15
-1.71458e-09
-3.25194e-09
2.57038e-15
-1.63667e-09
-3.38749e-09
2.2511e-15
-1.55045e-09
-3.50463e-09
1.81951e-15
-1.45576e-09
-3.6037e-09
1.3351e-15
-1.3526e-09
-3.68048e-09
9.22378e-16
-1.24104e-09
-3.73082e-09
6.60528e-16
-1.12129e-09
-3.74863e-09
5.25401e-16
-9.93836e-10
-3.72144e-09
4.5994e-16
-8.59438e-10
-3.63434e-09
4.21936e-16
-7.19297e-10
-3.46439e-09
4.66172e-16
-5.75323e-10
-3.17822e-09
5.76615e-16
-4.30495e-10
-2.73415e-09
6.89854e-16
-2.89441e-10
-2.09374e-09
7.15292e-16
-1.59704e-10
-1.26525e-09
5.89111e-16
-5.43827e-11
-4.00126e-10
3.8835e-16
1.06872e-10
1.34195e-16
-2.04571e-09
-2.48648e-10
2.14634e-15
-2.06104e-09
-5.3931e-10
2.17338e-15
-2.07012e-09
-8.27666e-10
2.2327e-15
-2.07297e-09
-1.11087e-09
2.31503e-15
-2.06951e-09
-1.38657e-09
2.38911e-15
-2.05965e-09
-1.6528e-09
2.46959e-15
-2.04327e-09
-1.90807e-09
2.53805e-15
-2.02015e-09
-2.15122e-09
2.60728e-15
-1.99015e-09
-2.38086e-09
2.66475e-15
-1.95297e-09
-2.59776e-09
2.71375e-15
-1.90843e-09
-2.79992e-09
2.73996e-15
-1.85625e-09
-2.98853e-09
2.72737e-15
-1.79621e-09
-3.1621e-09
2.64252e-15
-1.7281e-09
-3.32006e-09
2.45599e-15
-1.65164e-09
-3.46393e-09
2.15007e-15
-1.56673e-09
-3.58955e-09
1.73972e-15
-1.47321e-09
-3.69722e-09
1.27909e-15
-1.37106e-09
-3.78262e-09
8.87028e-16
-1.26036e-09
-3.84153e-09
6.35255e-16
-1.1413e-09
-3.86769e-09
5.02605e-16
-1.01434e-09
-3.8484e-09
4.36675e-16
-8.80191e-10
-3.76849e-09
3.98326e-16
-7.39979e-10
-3.6046e-09
4.39368e-16
-5.95476e-10
-3.32273e-09
5.4226e-16
-4.49424e-10
-2.8802e-09
6.4648e-16
-3.06034e-10
-2.23714e-09
6.71375e-16
-1.72266e-10
-1.39902e-09
5.52344e-16
-6.06062e-11
-5.11785e-10
3.65281e-16
4.62657e-11
1.26172e-16
-2.03273e-09
-2.24802e-10
2.13609e-15
-2.05047e-09
-5.21576e-10
2.15653e-15
-2.06207e-09
-8.16071e-10
2.20745e-15
-2.06747e-09
-1.10547e-09
2.27976e-15
-2.06655e-09
-1.38749e-09
2.34665e-15
-2.05917e-09
-1.66017e-09
2.42005e-15
-2.04516e-09
-1.92209e-09
2.48205e-15
-2.0243e-09
-2.17208e-09
2.54366e-15
-1.99639e-09
-2.40879e-09
2.59337e-15
-1.96115e-09
-2.63299e-09
2.63372e-15
-1.91839e-09
-2.84269e-09
2.65107e-15
-1.86781e-09
-3.0391e-09
2.63097e-15
-1.80923e-09
-3.22069e-09
2.54229e-15
-1.74241e-09
-3.38689e-09
2.35826e-15
-1.6671e-09
-3.53924e-09
2.06297e-15
-1.58319e-09
-3.67346e-09
1.67217e-15
-1.49054e-09
-3.78987e-09
1.23027e-15
-1.38914e-09
-3.88403e-09
8.55316e-16
-1.27905e-09
-3.95162e-09
6.12808e-16
-1.16046e-09
-3.98628e-09
4.81485e-16
-1.03381e-09
-3.97506e-09
4.15432e-16
-8.99776e-10
-3.90252e-09
3.76905e-16
-7.59431e-10
-3.74495e-09
4.15323e-16
-6.14437e-10
-3.46772e-09
5.11638e-16
-4.67339e-10
-3.0273e-09
6.09756e-16
-3.21969e-10
-2.38251e-09
6.32348e-16
-1.84702e-10
-1.53629e-09
5.19716e-16
-6.70686e-11
-6.29418e-10
3.44027e-16
-2.0803e-11
1.18916e-16
-2.02325e-09
-1.98747e-10
2.142e-15
-2.04329e-09
-5.01538e-10
2.15185e-15
-2.05723e-09
-8.02133e-10
2.19334e-15
-2.06497e-09
-1.09774e-09
2.25596e-15
-2.06633e-09
-1.38613e-09
2.31677e-15
-2.06113e-09
-1.66536e-09
2.38257e-15
-2.04918e-09
-1.93404e-09
2.43892e-15
-2.03024e-09
-2.19101e-09
2.49385e-15
-2.0041e-09
-2.43494e-09
2.53712e-15
-1.97047e-09
-2.66661e-09
2.57002e-15
-1.92916e-09
-2.88401e-09
2.57969e-15
-1.87989e-09
-3.08837e-09
2.55299e-15
-1.82244e-09
-3.27813e-09
2.46061e-15
-1.75663e-09
-3.45272e-09
2.27814e-15
-1.68219e-09
-3.61367e-09
1.99073e-15
-1.59903e-09
-3.75662e-09
1.61377e-15
-1.50701e-09
-3.88188e-09
1.19023e-15
-1.40611e-09
-3.98492e-09
8.28976e-16
-1.29643e-09
-4.0613e-09
5.93985e-16
-1.17812e-09
-4.10458e-09
4.64338e-16
-1.05164e-09
-4.10154e-09
3.97788e-16
-9.17628e-10
-4.03653e-09
3.59077e-16
-7.77116e-10
-3.88546e-09
3.9536e-16
-6.31689e-10
-3.61315e-09
4.85938e-16
-4.83744e-10
-3.17525e-09
5.77188e-16
-3.36798e-10
-2.52945e-09
5.99447e-16
-1.96679e-10
-1.67641e-09
4.89837e-16
-7.36426e-11
-7.52454e-10
3.26127e-16
-9.44457e-11
1.12824e-16
-2.01676e-09
-1.70645e-10
2.14805e-15
-2.03889e-09
-4.79414e-10
2.15426e-15
-2.0549e-09
-7.86118e-10
2.18847e-15
-2.06467e-09
-1.08799e-09
2.24292e-15
-2.06797e-09
-1.38282e-09
2.29774e-15
-2.06461e-09
-1.66872e-09
2.35726e-15
-2.05436e-09
-1.94428e-09
2.4088e-15
-2.03698e-09
-2.20838e-09
2.45808e-15
-2.01227e-09
-2.45967e-09
2.49586e-15
-1.97992e-09
-2.69895e-09
2.52251e-15
-1.93974e-09
-2.92419e-09
2.52613e-15
-1.89146e-09
-3.13664e-09
2.49344e-15
-1.83489e-09
-3.33471e-09
2.39775e-15
-1.76981e-09
-3.5178e-09
2.21598e-15
-1.696e-09
-3.68747e-09
1.93572e-15
-1.61336e-09
-3.83926e-09
1.56915e-15
-1.52176e-09
-3.97348e-09
1.1589e-15
-1.4212e-09
-4.08547e-09
8.09014e-16
-1.31176e-09
-4.17075e-09
5.7983e-16
-1.19361e-09
-4.22273e-09
4.51277e-16
-1.06719e-09
-4.22797e-09
3.84213e-16
-9.33133e-10
-4.17059e-09
3.45076e-16
-7.92448e-10
-4.02614e-09
3.79867e-16
-6.46668e-10
-3.75893e-09
4.65713e-16
-4.98086e-10
-3.32383e-09
5.52609e-16
-3.49995e-10
-2.67754e-09
5.73921e-16
-2.0777e-10
-1.81863e-09
4.69739e-16
-8.01387e-11
-8.80085e-10
3.11494e-16
-1.74584e-10
1.07812e-16
-2.01253e-09
-1.40722e-10
2.17351e-15
-2.03646e-09
-4.55489e-10
2.16856e-15
-2.05422e-09
-7.68361e-10
2.19394e-15
-2.06564e-09
-1.07658e-09
2.23976e-15
-2.07049e-09
-1.37797e-09
2.28964e-15
-2.06856e-09
-1.67064e-09
2.34354e-15
-2.05963e-09
-1.95322e-09
2.39162e-15
-2.04344e-09
-2.22456e-09
2.43552e-15
-2.0198e-09
-2.48333e-09
2.4688e-15
-1.98839e-09
-2.73034e-09
2.4903e-15
-1.94905e-09
-2.96354e-09
2.48909e-15
-1.9015e-09
-3.18419e-09
2.45176e-15
-1.84554e-09
-3.39067e-09
2.3531e-15
-1.78098e-09
-3.58236e-09
2.17141e-15
-1.7076e-09
-3.76084e-09
1.89576e-15
-1.62531e-09
-3.92156e-09
1.53658e-15
-1.53398e-09
-4.06481e-09
1.13764e-15
-1.43361e-09
-4.18584e-09
7.96532e-16
-1.3243e-09
-4.28006e-09
5.72113e-16
-1.20622e-09
-4.34081e-09
4.4423e-16
-1.07979e-09
-4.3544e-09
3.76036e-16
-9.45669e-10
-4.30471e-09
3.36683e-16
-8.04832e-10
-4.16697e-09
3.69939e-16
-6.5879e-10
-3.90497e-09
4.51911e-16
-5.09779e-10
-3.47284e-09
5.3382e-16
-3.60957e-10
-2.82637e-09
5.53123e-16
-2.17412e-10
-1.96218e-09
4.53961e-16
-8.6293e-11
-1.0112e-09
3.00844e-16
-2.60877e-10
1.04101e-16
-2.00999e-09
-1.09408e-10
2.19527e-15
-2.03517e-09
-4.30309e-10
2.18569e-15
-2.0542e-09
-7.49337e-10
2.20516e-15
-2.06682e-09
-1.06396e-09
2.24426e-15
-2.0728e-09
-1.37199e-09
2.2898e-15
-2.07189e-09
-1.67154e-09
2.33927e-15
-2.06389e-09
-1.96122e-09
2.38425e-15
-2.04853e-09
-2.23991e-09
2.42418e-15
-2.02562e-09
-2.50625e-09
2.45408e-15
-1.99487e-09
-2.76108e-09
2.47191e-15
-1.9561e-09
-3.00233e-09
2.46713e-15
-1.90903e-09
-3.23125e-09
2.42626e-15
-1.85347e-09
-3.44623e-09
2.32571e-15
-1.78925e-09
-3.64659e-09
2.14354e-15
-1.71614e-09
-3.83395e-09
1.87058e-15
-1.63405e-09
-4.00365e-09
1.51851e-15
-1.54288e-09
-4.15598e-09
1.12808e-15
-1.44261e-09
-4.2861e-09
7.91688e-16
-1.33336e-09
-4.38932e-09
5.69308e-16
-1.21529e-09
-4.45888e-09
4.41394e-16
-1.08883e-09
-4.48085e-09
3.72984e-16
-9.54637e-10
-4.43891e-09
3.32674e-16
-8.13678e-10
-4.30793e-09
3.64294e-16
-6.67455e-10
-4.05119e-09
4.43345e-16
-5.18176e-10
-3.62212e-09
5.2274e-16
-3.68948e-10
-2.9756e-09
5.40405e-16
-2.24763e-10
-2.10636e-09
4.43609e-16
-9.16579e-11
-1.14431e-09
2.9395e-16
-3.52535e-10
1.02323e-16
-2.00657e-09
2.21748e-15
-2.03323e-09
2.20223e-15
-2.05352e-09
2.21763e-15
-2.06715e-09
2.25204e-15
-2.07396e-09
2.29567e-15
-2.07375e-09
2.34084e-15
-2.06633e-09
2.38384e-15
-2.05147e-09
2.42101e-15
-2.02899e-09
2.44898e-15
-1.9986e-09
2.46466e-15
-1.96012e-09
2.45784e-15
-1.9133e-09
2.41474e-15
-1.85795e-09
2.31292e-15
-1.79388e-09
2.13055e-15
-1.72088e-09
1.85934e-15
-1.63888e-09
1.51333e-15
-1.54775e-09
1.13304e-15
-1.44751e-09
7.94042e-16
-1.33826e-09
5.67314e-16
-1.22016e-09
4.39132e-16
-1.09365e-09
3.74568e-16
-9.59381e-10
3.34381e-16
-8.18323e-10
3.61153e-16
-6.71967e-10
4.39148e-16
-5.22512e-10
5.18604e-16
-3.73048e-10
5.35099e-16
-2.28566e-10
4.40132e-16
-9.51914e-11
2.90126e-16
1.01157e-16
1.85892e-10
-3.91998e-09
3.03935e-10
-6.67666e-09
-1.42654e-10
-2.68973e-09
-5.85033e-10
2.17581e-09
3.82147e-09
1.5382e-10
-4.0738e-09
4.7894e-11
-6.57075e-09
-3.69739e-10
-2.27209e-09
-6.29062e-10
2.43508e-09
3.1925e-09
1.48106e-10
-4.22189e-09
5.85786e-11
-6.48124e-09
-8.45696e-11
-2.12886e-09
-1.26189e-10
2.47678e-09
3.06645e-09
1.23022e-10
-4.34491e-09
6.95718e-12
-6.36521e-09
-1.38357e-10
-1.98349e-09
-1.33649e-10
2.47211e-09
2.93286e-09
1.05036e-10
-4.44991e-09
1.2184e-11
-6.27232e-09
-4.80569e-11
-1.92314e-09
-2.29144e-11
2.44708e-09
2.91003e-09
8.89263e-11
-4.53883e-09
-6.7791e-12
-6.17657e-09
-9.42568e-11
-1.83561e-09
-7.60882e-11
2.42897e-09
2.83398e-09
7.90027e-11
-4.61782e-09
-3.20585e-11
-6.06547e-09
-1.06797e-10
-1.76083e-09
-6.69203e-11
2.3892e-09
2.7672e-09
6.97806e-11
-4.68761e-09
-7.81643e-11
-5.91755e-09
-1.86051e-10
-1.65297e-09
-1.26828e-10
2.32999e-09
2.64041e-09
5.82524e-11
-4.74586e-09
-1.2046e-10
-5.73884e-09
-2.10071e-10
-1.56334e-09
-1.21714e-10
2.24162e-09
2.51872e-09
3.10262e-11
-4.77689e-09
-1.57974e-10
-5.54988e-09
-2.31122e-10
-1.49019e-09
-1.33263e-10
2.14369e-09
2.38541e-09
-1.50773e-11
-4.76181e-09
-1.73833e-10
-5.39113e-09
-1.91566e-10
-1.47247e-09
-9.66192e-11
2.04879e-09
2.28884e-09
-6.37348e-11
-4.69811e-09
-1.82996e-10
-5.27187e-09
-1.7891e-10
-1.47661e-09
-9.57805e-11
1.9657e-09
2.19306e-09
-9.34707e-11
-4.60462e-09
-1.97194e-10
-5.16809e-09
-1.85845e-10
-1.48793e-09
-1.03212e-10
1.88308e-09
2.08984e-09
-1.05924e-10
-4.4987e-09
-2.35537e-10
-5.03849e-09
-2.67146e-10
-1.45636e-09
-1.57421e-10
1.77328e-09
1.93232e-09
-1.06077e-10
-4.39263e-09
-2.94852e-10
-4.84977e-09
-3.61204e-10
-1.39005e-09
-2.20113e-10
1.63215e-09
1.71221e-09
-1.19377e-10
-4.27328e-09
-3.46016e-10
-4.62328e-09
-5.20586e-10
-1.21557e-09
-2.58522e-10
1.36991e-09
1.45358e-09
-8.36217e-11
-4.18963e-09
-3.01449e-10
-4.40558e-09
-5.10684e-10
-1.00637e-09
-1.59178e-10
1.01825e-09
1.29424e-09
-9.64794e-10
-4.39567e-09
-7.60906e-10
-4.65947e-09
-4.64383e-10
-1.30305e-09
-8.99273e-11
6.43641e-10
1.20418e-09
-1.47014e-09
-4.94417e-09
-1.14358e-09
-5.55215e-09
-1.81196e-10
-2.27667e-09
5.6815e-11
4.05443e-10
1.26094e-09
-1.45728e-09
-5.48258e-09
-9.23582e-10
-6.43785e-09
-1.19144e-10
-3.23378e-09
-6.84697e-11
3.12796e-10
1.19255e-09
-8.34359e-11
-5.63335e-09
-3.32495e-11
-6.68534e-09
-1.86899e-11
-3.35646e-09
-3.21897e-11
2.32773e-10
1.15358e-09
-4.21532e-11
-5.59213e-09
-1.78071e-10
-6.54939e-09
-3.09527e-10
-3.22506e-09
-9.85943e-11
2.00287e-11
1.05201e-09
5.45947e-12
-5.5976e-09
-1.1927e-10
-6.42463e-09
-1.34791e-10
-3.20955e-09
-3.32928e-11
-8.14321e-11
1.01875e-09
-3.3676e-11
-5.56393e-09
-1.85007e-10
-6.27327e-09
-2.13981e-10
-3.18059e-09
-8.77873e-11
-2.07578e-10
9.30993e-10
-5.81477e-11
-5.50579e-09
-1.85938e-10
-6.14543e-09
-1.80884e-10
-3.18565e-09
-7.82134e-11
-3.10217e-10
8.52795e-10
-8.07443e-11
-5.42506e-09
-2.09184e-10
-6.01697e-09
-2.11374e-10
-3.1835e-09
-1.02542e-10
-4.19056e-10
7.50223e-10
-9.64566e-11
-5.32862e-09
-2.20547e-10
-5.89286e-09
-2.15891e-10
-3.18817e-09
-1.0533e-10
-5.29592e-10
6.44918e-10
-1.08908e-10
-5.21974e-09
-2.30835e-10
-5.77094e-09
-2.24376e-10
-3.19466e-09
-1.1533e-10
-6.38646e-10
5.29571e-10
-1.14158e-10
-5.10558e-09
-2.30954e-10
-5.65414e-09
-2.36621e-10
-3.18899e-09
-1.13355e-10
-7.61903e-10
4.1622e-10
-1.02026e-10
-5.00357e-09
-2.24521e-10
-5.53166e-09
-2.33868e-10
-3.17963e-09
-1.28523e-10
-8.67259e-10
2.8766e-10
-1.11764e-10
-4.89183e-09
-2.17173e-10
-5.42624e-09
-3.24457e-10
-3.07233e-09
-9.18684e-11
-1.09981e-09
1.95797e-10
-1.62668e-11
-4.88438e-09
-1.45445e-10
-5.29709e-09
-1.22514e-10
-3.0953e-09
3.9067e-12
-1.22633e-09
1.99614e-10
-1.29393e-09
-5.16109e-09
-1.19365e-09
-5.63429e-09
-7.34333e-10
-3.55458e-09
-4.07486e-10
-1.55317e-09
-2.07935e-10
4.44144e-11
-4.65059e-10
-2.58087e-10
5.44092e-11
-1.40315e-10
-8.77208e-12
-1.31459e-10
-8.85874e-12
-1.22448e-10
-9.01275e-12
-1.13246e-10
-9.2043e-12
-1.03841e-10
-9.40625e-12
-9.42476e-11
-9.59329e-12
-8.45046e-11
-9.74381e-12
-7.46655e-11
-9.8393e-12
-6.48032e-11
-9.8633e-12
-5.49921e-11
-9.81127e-12
-4.53216e-11
-9.67119e-12
-3.58749e-11
-9.44691e-12
-2.67388e-11
-9.13644e-12
-1.79943e-11
-8.74486e-12
-9.71017e-12
-8.28424e-12
-1.95654e-12
-7.75378e-12
5.20722e-12
-7.16396e-12
1.17201e-11
-6.513e-12
1.75161e-11
-5.79615e-12
2.25134e-11
-4.99758e-12
2.6594e-11
-4.08087e-12
2.95832e-11
-2.98929e-12
3.12125e-11
-1.62956e-12
3.10728e-11
1.39532e-13
2.85875e-11
2.48519e-12
2.30701e-11
5.51729e-12
1.43637e-11
8.70635e-12
4.55365e-12
9.80997e-12
4.55357e-12
-4.28826e-10
-3.19878e-11
-4.05032e-10
-3.26558e-11
-3.80488e-10
-3.35589e-11
-3.55107e-10
-3.45885e-11
-3.2887e-10
-3.56445e-11
-3.0183e-10
-3.66325e-11
-2.74104e-10
-3.7471e-11
-2.45854e-10
-3.80894e-11
-2.17296e-10
-3.84234e-11
-1.88652e-10
-3.84544e-11
-1.6019e-10
-3.81338e-11
-1.32163e-10
-3.74742e-11
-1.04835e-10
-3.64647e-11
-7.84585e-11
-3.51223e-11
-5.32505e-11
-3.3492e-11
-2.9437e-11
-3.15675e-11
-7.21231e-12
-2.93888e-11
1.32228e-11
-2.69483e-11
3.16546e-11
-2.42281e-11
4.78256e-11
-2.11689e-11
6.13772e-11
-1.76328e-11
7.17963e-11
-1.34083e-11
7.83156e-11
-8.14935e-12
7.9805e-11
-1.34996e-12
7.47057e-11
7.58429e-12
6.13161e-11
1.89067e-11
3.92578e-11
3.07649e-11
1.38164e-11
3.52511e-11
1.83699e-11
-7.18783e-10
-6.61583e-11
-6.83216e-10
-6.82265e-11
-6.4602e-10
-7.07574e-11
-6.07084e-10
-7.35282e-11
-5.664e-10
-7.63302e-11
-5.24066e-10
-7.89646e-11
-4.80281e-10
-8.12578e-11
-4.35312e-10
-8.30574e-11
-3.89515e-10
-8.42234e-11
-3.43255e-10
-8.47135e-11
-2.96972e-10
-8.44178e-11
-2.51086e-10
-8.33603e-11
-2.06039e-10
-8.15123e-11
-1.62257e-10
-7.89051e-11
-1.20114e-10
-7.56348e-11
-8.00001e-11
-7.16812e-11
-4.22583e-11
-6.71307e-11
-7.2424e-12
-6.19645e-11
2.46732e-11
-5.61439e-11
5.30466e-11
-4.95427e-11
7.72774e-11
-4.18639e-11
9.65276e-11
-3.26583e-11
1.09573e-10
-2.11951e-11
1.14648e-10
-6.42536e-12
1.09372e-10
1.28603e-11
9.12331e-11
3.70452e-11
5.96687e-11
6.23296e-11
2.20998e-11
7.28197e-11
4.04697e-11
-1.00361e-09
-1.07728e-10
-9.59551e-10
-1.12289e-10
-9.12746e-10
-1.17565e-10
-8.63085e-10
-1.23194e-10
-8.10581e-10
-1.28836e-10
-7.55385e-10
-1.34158e-10
-6.97774e-10
-1.3887e-10
-6.38117e-10
-1.42713e-10
-5.76899e-10
-1.45446e-10
-5.14617e-10
-1.46993e-10
-4.51876e-10
-1.47162e-10
-3.8925e-10
-1.45986e-10
-3.27355e-10
-1.43408e-10
-2.66788e-10
-1.39473e-10
-2.08079e-10
-1.34343e-10
-1.51788e-10
-1.27972e-10
-9.84126e-11
-1.20506e-10
-4.84684e-11
-1.11909e-10
-2.49919e-12
-1.02113e-10
3.88641e-11
-9.09063e-11
7.47809e-11
-7.77811e-11
1.04105e-10
-6.19822e-11
1.25196e-10
-4.22865e-11
1.35731e-10
-1.6961e-11
1.32637e-10
1.59548e-11
1.1272e-10
5.69612e-11
7.52051e-11
9.98453e-11
2.88231e-11
1.19201e-10
6.92927e-11
-1.27689e-09
-1.53336e-10
-1.22751e-09
-1.61673e-10
-1.1741e-09
-1.70977e-10
-1.11656e-09
-1.80734e-10
-1.05495e-09
-1.9045e-10
-9.89464e-10
-1.99642e-10
-9.20452e-10
-2.07884e-10
-8.48373e-10
-2.14789e-10
-7.73829e-10
-2.19996e-10
-6.97432e-10
-2.23387e-10
-6.19934e-10
-2.24662e-10
-5.42053e-10
-2.23866e-10
-4.64562e-10
-2.20899e-10
-3.88221e-10
-2.15817e-10
-3.13708e-10
-2.08855e-10
-2.41752e-10
-1.99928e-10
-1.73004e-10
-1.89254e-10
-1.08147e-10
-1.76767e-10
-4.7895e-11
-1.62366e-10
6.93043e-12
-1.45732e-10
5.52548e-11
-1.26106e-10
9.56418e-11
-1.02369e-10
1.26075e-10
-7.27203e-11
1.43744e-10
-3.46304e-11
1.44985e-10
1.4714e-11
1.26017e-10
7.59289e-11
8.57916e-11
1.40071e-10
3.37617e-11
1.71231e-10
1.03054e-10
-1.53275e-09
-2.00012e-10
-1.48092e-09
-2.13509e-10
-1.42369e-09
-2.28206e-10
-1.361e-09
-2.43429e-10
-1.29293e-09
-2.58525e-10
-1.21972e-09
-2.72846e-10
-1.1418e-09
-2.85813e-10
-1.05968e-09
-2.969e-10
-9.74079e-10
-3.05606e-10
-8.85697e-10
-3.11765e-10
-7.95413e-10
-3.1495e-10
-7.04064e-10
-3.15213e-10
-6.12565e-10
-3.12399e-10
-5.21818e-10
-3.06567e-10
-4.3264e-10
-2.98031e-10
-3.45916e-10
-2.86652e-10
-2.62449e-10
-2.72721e-10
-1.83079e-10
-2.56137e-10
-1.08693e-10
-2.36752e-10
-4.02963e-11
-2.14129e-10
2.08128e-11
-1.87215e-10
7.29284e-11
-1.54485e-10
1.13697e-10
-1.13489e-10
1.39882e-10
-6.08155e-11
1.47314e-10
7.28157e-12
1.31693e-10
9.15495e-11
9.16426e-11
1.80122e-10
3.68964e-11
2.25977e-10
1.39951e-10
-1.76624e-09
-2.45305e-10
-1.71441e-09
-2.65353e-10
-1.65581e-09
-2.86806e-10
-1.59042e-09
-3.08832e-10
-1.51833e-09
-3.30611e-10
-1.43985e-09
-3.51323e-10
-1.35544e-09
-3.7023e-10
-1.26568e-09
-3.86654e-10
-1.17135e-09
-3.99943e-10
-1.07324e-09
-4.09876e-10
-9.72307e-10
-4.15883e-10
-8.695e-10
-4.18018e-10
-7.65843e-10
-4.16056e-10
-6.6236e-10
-4.10054e-10
-5.59985e-10
-4.00403e-10
-4.59746e-10
-3.86891e-10
-3.62578e-10
-3.69888e-10
-2.69476e-10
-3.49239e-10
-1.81486e-10
-3.24744e-10
-9.9787e-11
-2.95828e-10
-2.58883e-11
-2.61114e-10
3.82584e-11
-2.18632e-10
9.00004e-11
-1.65231e-10
1.25732e-10
-9.65469e-11
1.4085e-10
-7.83699e-12
1.30589e-10
1.0181e-10
9.31952e-11
2.17516e-10
3.83456e-11
2.80826e-10
1.78296e-10
-1.9736e-09
-2.87338e-10
-1.92371e-09
-3.15256e-10
-1.86576e-09
-3.44757e-10
-1.79975e-09
-3.74849e-10
-1.72582e-09
-4.04545e-10
-1.64429e-09
-4.32854e-10
-1.55565e-09
-4.58871e-10
-1.46054e-09
-4.81762e-10
-1.35977e-09
-5.00715e-10
-1.25419e-09
-5.15451e-10
-1.14483e-09
-5.25244e-10
-1.03271e-09
-5.30145e-10
-9.18917e-10
-5.29846e-10
-8.04587e-10
-5.24389e-10
-6.90743e-10
-5.14243e-10
-5.78531e-10
-4.99103e-10
-4.69004e-10
-4.79414e-10
-3.6329e-10
-4.54954e-10
-2.6258e-10
-4.25455e-10
-1.68213e-10
-3.90195e-10
-8.18879e-11
-3.47439e-10
-5.7773e-12
-2.94743e-10
5.72046e-11
-2.28214e-10
1.03134e-10
-1.42477e-10
1.27038e-10
-3.17411e-11
1.2373e-10
1.05118e-10
9.10383e-11
2.50208e-10
3.83152e-11
3.33548e-10
2.16611e-10
-2.1524e-09
-3.24803e-10
-2.10588e-09
-3.61782e-10
-2.05015e-09
-4.00493e-10
-1.98522e-09
-4.39789e-10
-1.91124e-09
-4.78519e-10
-1.82858e-09
-5.15517e-10
-1.73773e-09
-5.49717e-10
-1.63936e-09
-5.80127e-10
-1.53432e-09
-6.05769e-10
-1.42346e-09
-6.26305e-10
-1.30787e-09
-6.40844e-10
-1.18858e-09
-6.49429e-10
-1.06676e-09
-6.51661e-10
-9.43605e-10
-6.47554e-10
-8.20193e-10
-6.3765e-10
-6.97765e-10
-6.21532e-10
-5.77467e-10
-5.99712e-10
-4.60538e-10
-5.71884e-10
-3.48294e-10
-5.37701e-10
-2.42213e-10
-4.96275e-10
-1.44162e-10
-4.4549e-10
-5.65027e-11
-3.82402e-10
1.76257e-11
-3.02342e-10
7.40304e-11
-1.98882e-10
1.07422e-10
-6.51326e-11
1.12232e-10
1.00308e-10
8.58431e-11
2.76598e-10
3.70595e-11
3.82331e-10
2.53671e-10
-2.30157e-09
-3.5692e-10
-2.25937e-09
-4.03984e-10
-2.20697e-09
-4.52903e-10
-2.14439e-09
-5.02377e-10
-2.07181e-09
-5.51098e-10
-1.98959e-09
-5.97731e-10
-1.89827e-09
-6.41048e-10
-1.79848e-09
-6.79903e-10
-1.69111e-09
-7.13157e-10
-1.57699e-09
-7.40411e-10
-1.45724e-09
-7.60605e-10
-1.33289e-09
-7.73772e-10
-1.20515e-09
-7.7941e-10
-1.07521e-09
-7.77498e-10
-9.44208e-10
-7.68643e-10
-8.13444e-10
-7.52296e-10
-6.84126e-10
-7.29029e-10
-5.57579e-10
-6.98432e-10
-4.35219e-10
-6.60064e-10
-3.18636e-10
-6.12857e-10
-2.09838e-10
-5.54288e-10
-1.11348e-10
-4.80894e-10
-2.64881e-11
-3.87202e-10
4.03237e-11
-2.65694e-10
8.35305e-11
-1.0834e-10
9.72197e-11
8.66183e-11
7.82997e-11
2.95518e-10
3.48476e-11
4.25783e-10
2.88518e-10
-2.42132e-09
-3.83356e-10
-2.38397e-09
-4.41345e-10
-2.33559e-09
-5.01285e-10
-2.27625e-09
-5.61731e-10
-2.20613e-09
-6.2122e-10
-2.1256e-09
-6.78257e-10
-2.03519e-09
-7.31461e-10
-1.93555e-09
-7.79538e-10
-1.82753e-09
-8.21191e-10
-1.71196e-09
-8.55965e-10
-1.58994e-09
-8.82632e-10
-1.4625e-09
-9.01215e-10
-1.33081e-09
-9.111e-10
-1.19609e-09
-9.12224e-10
-1.05947e-09
-9.05251e-10
-9.22288e-10
-8.89483e-10
-7.85777e-10
-8.65538e-10
-6.51323e-10
-8.32887e-10
-5.20412e-10
-7.90977e-10
-3.94722e-10
-7.38547e-10
-2.76368e-10
-6.72642e-10
-1.68001e-10
-5.89262e-10
-7.30918e-11
-4.82111e-10
3.76315e-12
-3.42549e-10
5.67851e-11
-1.61362e-10
7.97466e-11
6.36566e-11
6.90646e-11
3.06201e-10
3.19387e-11
4.62909e-10
3.20457e-10
-2.51297e-09
-4.04143e-10
-2.48062e-09
-4.73706e-10
-2.43662e-09
-5.45293e-10
-2.38105e-09
-6.17315e-10
-2.3141e-09
-6.88164e-10
-2.23616e-09
-7.56192e-10
-2.14775e-09
-8.19875e-10
-2.0495e-09
-8.7778e-10
-1.94225e-09
-9.28464e-10
-1.82678e-09
-9.71421e-10
-1.70416e-09
-1.00526e-09
-1.57537e-09
-1.03e-09
-1.44157e-09
-1.0449e-09
-1.30395e-09
-1.04986e-09
-1.1636e-09
-1.04559e-09
-1.02186e-09
-1.03123e-09
-8.79971e-10
-1.00742e-09
-7.3935e-10
-9.7351e-10
-6.01521e-10
-9.28809e-10
-4.68219e-10
-8.71848e-10
-3.41637e-10
-7.99224e-10
-2.24516e-10
-7.06384e-10
-1.20438e-10
-5.86189e-10
-3.41357e-11
-4.28851e-10
2.84284e-11
-2.23926e-10
6.07447e-11
3.13402e-11
5.87233e-11
3.08222e-10
2.85651e-11
4.93067e-10
3.49022e-10
-2.57867e-09
-4.19576e-10
-2.55119e-09
-5.01186e-10
-2.51163e-09
-5.84864e-10
-2.46007e-09
-6.68886e-10
-2.39673e-09
-7.51504e-10
-2.32199e-09
-8.30927e-10
-2.23637e-09
-9.05501e-10
-2.14047e-09
-9.7367e-10
-2.0351e-09
-1.03385e-09
-1.92101e-09
-1.0855e-09
-1.79919e-09
-1.12708e-09
-1.6706e-09
-1.15859e-09
-1.53631e-09
-1.17919e-09
-1.39746e-09
-1.18872e-09
-1.25512e-09
-1.18793e-09
-1.11057e-09
-1.17578e-09
-9.65043e-10
-1.15294e-09
-8.19952e-10
-1.1186e-09
-6.7683e-10
-1.07193e-09
-5.37439e-10
-1.01124e-09
-4.04016e-10
-9.32646e-10
-2.79362e-10
-8.3104e-10
-1.67127e-10
-6.98424e-10
-7.21432e-11
-5.23835e-10
-5.1601e-13
-2.95553e-10
4.09895e-11
-1.01655e-11
4.77663e-11
3.01446e-10
2.4921e-11
5.15912e-10
3.73943e-10
-2.62111e-09
-4.30135e-10
-2.5982e-09
-5.24098e-10
-2.56292e-09
-6.20147e-10
-2.5154e-09
-7.16425e-10
-2.45585e-09
-8.11049e-10
-2.38467e-09
-9.02103e-10
-2.30236e-09
-9.87812e-10
-2.20951e-09
-1.06651e-09
-2.10688e-09
-1.1365e-09
-1.99517e-09
-1.19721e-09
-1.87532e-09
-1.24694e-09
-1.74819e-09
-1.28572e-09
-1.61479e-09
-1.31258e-09
-1.4762e-09
-1.32732e-09
-1.3334e-09
-1.33072e-09
-1.18763e-09
-1.32155e-09
-1.04008e-09
-1.3005e-09
-8.92106e-10
-1.26658e-09
-7.45245e-10
-1.2188e-09
-6.01249e-10
-1.15523e-09
-4.62371e-10
-1.07152e-09
-3.31433e-10
-9.6198e-10
-2.1212e-10
-8.17736e-10
-1.09324e-10
-6.26631e-10
-2.92557e-11
-3.75622e-10
2.10872e-11
-6.05085e-11
3.6579e-11
2.85954e-10
2.11586e-11
5.31332e-10
3.95101e-10
-2.64332e-09
-4.36405e-10
-2.62454e-09
-5.42885e-10
-2.59325e-09
-6.51438e-10
-2.54961e-09
-7.60076e-10
-2.49387e-09
-8.66796e-10
-2.4264e-09
-9.69559e-10
-2.34773e-09
-1.06649e-09
-2.2584e-09
-1.15584e-09
-2.15912e-09
-1.23579e-09
-2.05056e-09
-1.30576e-09
-1.93357e-09
-1.36394e-09
-1.80893e-09
-1.41035e-09
-1.67758e-09
-1.44394e-09
-1.54049e-09
-1.46442e-09
-1.39857e-09
-1.47263e-09
-1.25296e-09
-1.46715e-09
-1.1048e-09
-1.44866e-09
-9.55396e-10
-1.41598e-09
-8.06228e-10
-1.36797e-09
-6.59024e-10
-1.30243e-09
-5.16018e-10
-1.21453e-09
-3.80021e-10
-1.09798e-09
-2.54721e-10
-9.43036e-10
-1.45028e-10
-7.36324e-10
-5.72277e-11
-4.63423e-10
1.4766e-12
-1.19213e-10
2.54427e-11
2.61988e-10
1.73882e-11
5.39386e-10
4.1249e-10
-2.64839e-09
-4.39016e-10
-2.63323e-09
-5.58053e-10
-2.60556e-09
-6.79117e-10
-2.56556e-09
-8.00093e-10
-2.51349e-09
-9.18862e-10
-2.44976e-09
-1.03328e-09
-2.37486e-09
-1.14139e-09
-2.28933e-09
-1.24136e-09
-2.19384e-09
-1.33129e-09
-2.08898e-09
-1.41062e-09
-1.97553e-09
-1.4774e-09
-1.85419e-09
-1.53168e-09
-1.72579e-09
-1.57233e-09
-1.59122e-09
-1.599e-09
-1.45127e-09
-1.61257e-09
-1.30701e-09
-1.61141e-09
-1.15948e-09
-1.59619e-09
-1.0099e-09
-1.56556e-09
-8.59711e-10
-1.51816e-09
-7.10567e-10
-1.45158e-09
-5.6466e-10
-1.36044e-09
-4.24764e-10
-1.23788e-09
-2.9453e-10
-1.07327e-09
-1.78859e-10
-8.51995e-10
-8.40712e-11
-5.58211e-10
-1.75515e-11
-1.85733e-10
1.45437e-11
2.29892e-10
1.36819e-11
5.40248e-10
4.26171e-10
-2.63935e-09
-4.38597e-10
-2.62728e-09
-5.70128e-10
-2.6028e-09
-7.03603e-10
-2.56612e-09
-8.36785e-10
-2.51754e-09
-9.67448e-10
-2.45746e-09
-1.09336e-09
-2.38637e-09
-1.21248e-09
-2.30478e-09
-1.32294e-09
-2.21333e-09
-1.42276e-09
-2.11254e-09
-1.5114e-09
-2.00311e-09
-1.58683e-09
-1.88566e-09
-1.64913e-09
-1.76093e-09
-1.69707e-09
-1.62966e-09
-1.73028e-09
-1.49258e-09
-1.74964e-09
-1.35064e-09
-1.75335e-09
-1.20476e-09
-1.74207e-09
-1.0561e-09
-1.71422e-09
-9.05986e-10
-1.66828e-09
-7.5602e-10
-1.60154e-09
-6.08316e-10
-1.50814e-09
-4.6558e-10
-1.38062e-09
-3.31401e-10
-1.20745e-09
-2.10631e-10
-9.72765e-10
-1.09598e-10
-6.59243e-10
-3.58404e-11
-2.59491e-10
3.98774e-12
1.90064e-10
1.00789e-11
5.34156e-10
4.3625e-10
-2.61898e-09
-4.35739e-10
-2.6095e-09
-5.79614e-10
-2.5878e-09
-7.25313e-10
-2.55412e-09
-8.70479e-10
-2.50878e-09
-1.01279e-09
-2.4522e-09
-1.14993e-09
-2.38486e-09
-1.27982e-09
-2.30727e-09
-1.40053e-09
-2.21999e-09
-1.51006e-09
-2.1235e-09
-1.60788e-09
-2.01842e-09
-1.69191e-09
-1.90528e-09
-1.76226e-09
-1.78471e-09
-1.81764e-09
-1.65736e-09
-1.85764e-09
-1.52383e-09
-1.88317e-09
-1.38496e-09
-1.89223e-09
-1.24157e-09
-1.88546e-09
-1.09471e-09
-1.86108e-09
-9.45611e-10
-1.81738e-09
-7.95779e-10
-1.75137e-09
-6.47239e-10
-1.65668e-09
-5.02605e-10
-1.52525e-09
-3.65376e-10
-1.34468e-09
-2.40327e-10
-1.09781e-09
-1.3376e-10
-7.65811e-10
-5.33352e-11
-3.39915e-10
-6.19124e-12
1.4292e-10
6.59184e-12
5.21373e-10
4.42842e-10
-2.5898e-09
-4.30973e-10
-2.58245e-09
-5.86973e-10
-2.56313e-09
-7.44637e-10
-2.53213e-09
-9.01492e-10
-2.48979e-09
-1.05513e-09
-2.43654e-09
-1.20317e-09
-2.37287e-09
-1.3435e-09
-2.29923e-09
-1.47416e-09
-2.21618e-09
-1.59313e-09
-2.12411e-09
-1.69994e-09
-2.02358e-09
-1.79245e-09
-1.91503e-09
-1.87081e-09
-1.79897e-09
-1.9337e-09
-1.67596e-09
-1.98066e-09
-1.54648e-09
-2.01264e-09
-1.41125e-09
-2.02745e-09
-1.27099e-09
-2.02571e-09
-1.12664e-09
-2.00544e-09
-9.79313e-10
-1.96471e-09
-8.30409e-10
-1.90027e-09
-6.81847e-10
-1.80524e-09
-5.36131e-10
-1.67097e-09
-3.96643e-10
-1.48416e-09
-2.68055e-10
-1.2264e-09
-1.5661e-10
-8.77256e-10
-7.0062e-11
-4.26463e-10
-1.60065e-11
8.88642e-11
3.21388e-12
5.02153e-10
4.46056e-10
-2.55401e-09
-4.24758e-10
-2.54838e-09
-5.92604e-10
-2.53111e-09
-7.61913e-10
-2.50251e-09
-9.30104e-10
-2.46295e-09
-1.09469e-09
-2.41287e-09
-1.25325e-09
-2.35274e-09
-1.40363e-09
-2.283e-09
-1.54389e-09
-2.20415e-09
-1.67199e-09
-2.11655e-09
-1.78753e-09
-2.02067e-09
-1.88834e-09
-1.91684e-09
-1.97463e-09
-1.80552e-09
-2.04503e-09
-1.68712e-09
-2.09906e-09
-1.56203e-09
-2.13772e-09
-1.43086e-09
-2.15862e-09
-1.29421e-09
-2.16236e-09
-1.15289e-09
-2.14676e-09
-1.00792e-09
-2.10968e-09
-8.60579e-10
-2.04761e-09
-7.12662e-10
-1.95316e-09
-5.66548e-10
-1.81709e-09
-4.25484e-10
-1.62523e-09
-2.94009e-10
-1.35788e-09
-1.78279e-10
-9.92986e-10
-8.61045e-11
-5.18638e-10
-2.55075e-11
2.82669e-11
-9.73588e-14
4.76742e-10
4.45958e-10
-2.5135e-09
-4.17465e-10
-2.50928e-09
-5.96831e-10
-2.49378e-09
-7.77418e-10
-2.46735e-09
-9.56547e-10
-2.43038e-09
-1.13167e-09
-2.3833e-09
-1.30031e-09
-2.3266e-09
-1.46034e-09
-2.26068e-09
-1.6098e-09
-2.18599e-09
-1.74669e-09
-2.10284e-09
-1.87068e-09
-2.01162e-09
-1.97956e-09
-1.91259e-09
-2.07365e-09
-1.80609e-09
-2.15153e-09
-1.69246e-09
-2.2127e-09
-1.57197e-09
-2.2582e-09
-1.44512e-09
-2.28548e-09
-1.31239e-09
-2.29509e-09
-1.17448e-09
-2.28466e-09
-1.0323e-09
-2.25186e-09
-8.87007e-10
-2.19291e-09
-7.40263e-10
-2.0999e-09
-5.94308e-10
-1.96305e-09
-4.52237e-10
-1.76729e-09
-3.18438e-10
-1.49168e-09
-1.98943e-10
-1.11248e-09
-1.01585e-10
-6.15996e-10
-3.47715e-11
-3.8547e-11
-3.3312e-12
4.45302e-10
4.42627e-10
-2.4699e-09
-4.0938e-10
-2.46684e-09
-5.99898e-10
-2.4529e-09
-7.91359e-10
-2.42846e-09
-9.80995e-10
-2.39393e-09
-1.1662e-09
-2.34975e-09
-1.34449e-09
-2.29638e-09
-1.51372e-09
-2.23419e-09
-1.67199e-09
-2.16359e-09
-1.81731e-09
-2.08483e-09
-1.94943e-09
-1.99824e-09
-2.06617e-09
-1.90399e-09
-2.16789e-09
-1.80233e-09
-2.25318e-09
-1.69352e-09
-2.32153e-09
-1.57771e-09
-2.374e-09
-1.4553e-09
-2.40789e-09
-1.32667e-09
-2.42372e-09
-1.19242e-09
-2.41892e-09
-1.05332e-09
-2.39096e-09
-9.1042e-10
-2.33581e-09
-7.65244e-10
-2.24508e-09
-6.19884e-10
-2.10841e-09
-4.77272e-10
-1.90991e-09
-3.41618e-10
-1.62733e-09
-2.18808e-10
-1.23529e-09
-1.1665e-10
-7.18154e-10
-4.38929e-11
-1.11304e-10
-6.56649e-12
4.07976e-10
4.3606e-10
-2.42456e-09
-4.00699e-10
-2.4225e-09
-6.01968e-10
-2.40999e-09
-8.03869e-10
-2.38744e-09
-1.00355e-09
-2.35527e-09
-1.19838e-09
-2.3139e-09
-1.38585e-09
-2.26377e-09
-1.56385e-09
-2.20523e-09
-1.73051e-09
-2.13865e-09
-1.88391e-09
-2.0642e-09
-2.02387e-09
-1.98215e-09
-2.14822e-09
-1.8926e-09
-2.25743e-09
-1.79573e-09
-2.35006e-09
-1.69168e-09
-2.42558e-09
-1.58054e-09
-2.48513e-09
-1.4626e-09
-2.52583e-09
-1.33814e-09
-2.54817e-09
-1.20766e-09
-2.5494e-09
-1.07181e-09
-2.52681e-09
-9.31524e-10
-2.47609e-09
-7.88191e-10
-2.38841e-09
-6.43751e-10
-2.25285e-09
-5.0096e-10
-2.0527e-09
-3.63836e-10
-1.76446e-09
-2.38087e-10
-1.36104e-09
-1.31454e-10
-8.24787e-10
-5.29743e-11
-1.89785e-10
-9.83841e-12
3.6484e-10
4.26222e-10
-2.37865e-09
-3.91529e-10
-2.37751e-09
-6.03121e-10
-2.36637e-09
-8.15007e-10
-2.34567e-09
-1.02427e-09
-2.3158e-09
-1.22825e-09
-2.2772e-09
-1.42444e-09
-2.23027e-09
-1.61078e-09
-2.17532e-09
-1.78546e-09
-2.11266e-09
-1.94658e-09
-2.04242e-09
-2.09409e-09
-1.9648e-09
-2.22585e-09
-1.87984e-09
-2.34239e-09
-1.78763e-09
-2.44227e-09
-1.68823e-09
-2.52499e-09
-1.58166e-09
-2.59169e-09
-1.46812e-09
-2.63937e-09
-1.3478e-09
-2.66849e-09
-1.22108e-09
-2.67612e-09
-1.08855e-09
-2.65935e-09
-9.50981e-10
-2.61366e-09
-8.09658e-10
-2.52973e-09
-6.6636e-10
-2.39615e-09
-5.23661e-10
-2.19539e-09
-3.85371e-10
-1.90274e-09
-2.56993e-10
-1.48942e-09
-1.46156e-10
-9.35623e-10
-6.21208e-11
-2.73821e-10
-1.31948e-11
3.15914e-10
4.13027e-10
-2.33316e-09
-3.81894e-10
-2.33293e-09
-6.03359e-10
-2.32318e-09
-8.24762e-10
-2.30432e-09
-1.04313e-09
-2.27678e-09
-1.25579e-09
-2.24094e-09
-1.46027e-09
-2.19718e-09
-1.65455e-09
-2.14576e-09
-1.83687e-09
-2.08695e-09
-2.00541e-09
-2.02081e-09
-2.16022e-09
-1.94748e-09
-2.29918e-09
-1.86694e-09
-2.42292e-09
-1.77921e-09
-2.53e-09
-1.68429e-09
-2.61991e-09
-1.58212e-09
-2.69385e-09
-1.47283e-09
-2.74867e-09
-1.35652e-09
-2.7848e-09
-1.23349e-09
-2.79915e-09
-1.10422e-09
-2.78863e-09
-9.69394e-10
-2.74848e-09
-8.30151e-10
-2.66898e-09
-6.88124e-10
-2.53818e-09
-5.45703e-10
-2.33781e-09
-4.06479e-10
-2.04197e-09
-2.75724e-10
-1.62017e-09
-1.60904e-10
-1.05044e-09
-7.14351e-11
-3.6329e-10
-1.66846e-11
2.61163e-10
3.96342e-10
-2.28893e-09
-3.71739e-10
-2.28968e-09
-6.02614e-10
-2.28138e-09
-8.3306e-10
-2.26446e-09
-1.06007e-09
-2.23928e-09
-1.28097e-09
-2.20623e-09
-1.49332e-09
-2.16563e-09
-1.69515e-09
-2.1177e-09
-1.88479e-09
-2.06264e-09
-2.06048e-09
-2.00047e-09
-2.22238e-09
-1.93127e-09
-2.36839e-09
-1.85496e-09
-2.49923e-09
-1.7715e-09
-2.61346e-09
-1.68084e-09
-2.71058e-09
-1.58284e-09
-2.79184e-09
-1.47758e-09
-2.85393e-09
-1.36508e-09
-2.89729e-09
-1.24558e-09
-2.91865e-09
-1.11945e-09
-2.91476e-09
-9.87291e-10
-2.88064e-09
-8.50114e-10
-2.80615e-09
-7.09408e-10
-2.67889e-09
-5.67376e-10
-2.47985e-09
-4.27386e-10
-2.18196e-09
-2.94452e-10
-1.75311e-09
-1.75829e-10
-1.16907e-09
-8.1013e-11
-4.58107e-10
-2.03563e-11
2.00507e-10
3.75986e-10
-2.24668e-09
-3.6094e-10
-2.24854e-09
-6.00755e-10
-2.24183e-09
-8.39774e-10
-2.22694e-09
-1.07497e-09
-2.20423e-09
-1.30369e-09
-2.17401e-09
-1.52353e-09
-2.13657e-09
-1.73259e-09
-2.09208e-09
-1.92928e-09
-2.04068e-09
-2.1119e-09
-1.98234e-09
-2.28071e-09
-1.91709e-09
-2.43365e-09
-1.84478e-09
-2.57153e-09
-1.76535e-09
-2.6929e-09
-1.67867e-09
-2.79727e-09
-1.58458e-09
-2.88592e-09
-1.48307e-09
-2.95544e-09
-1.37413e-09
-3.00623e-09
-1.25793e-09
-3.03486e-09
-1.13475e-09
-3.03794e-09
-1.00511e-09
-3.01028e-09
-8.69918e-10
-2.94135e-09
-7.3051e-10
-2.8183e-09
-5.88915e-10
-2.62144e-09
-4.48271e-10
-2.3226e-09
-3.13315e-10
-1.88807e-09
-1.91041e-10
-1.29134e-09
-9.09389e-11
-5.5821e-10
-2.42568e-11
1.33825e-10
3.51729e-10
-2.20704e-09
-3.49314e-10
-2.2102e-09
-5.97598e-10
-2.20524e-09
-8.44736e-10
-2.19253e-09
-1.0877e-09
-2.17237e-09
-1.32385e-09
-2.14505e-09
-1.55084e-09
-2.11078e-09
-1.76686e-09
-2.06968e-09
-1.97037e-09
-2.02184e-09
-2.15975e-09
-1.96717e-09
-2.33537e-09
-1.90565e-09
-2.49518e-09
-1.83711e-09
-2.64006e-09
-1.76142e-09
-2.7686e-09
-1.67843e-09
-2.88027e-09
-1.58792e-09
-2.97642e-09
-1.48986e-09
-3.0535e-09
-1.38418e-09
-3.1119e-09
-1.27099e-09
-3.14805e-09
-1.15052e-09
-3.15841e-09
-1.02321e-09
-3.13759e-09
-8.89845e-10
-3.07471e-09
-7.51657e-10
-2.95649e-09
-6.10495e-10
-2.7626e-09
-4.69264e-10
-2.46383e-09
-3.3241e-10
-2.02492e-09
-2.06617e-10
-1.41713e-09
-1.0128e-10
-6.63548e-10
-2.84293e-11
6.09742e-11
3.233e-10
-2.17053e-09
-3.36631e-10
-2.17521e-09
-5.92927e-10
-2.17219e-09
-8.47754e-10
-2.16181e-09
-1.09809e-09
-2.14433e-09
-1.34133e-09
-2.11995e-09
-1.57521e-09
-2.08885e-09
-1.79796e-09
-2.05108e-09
-2.00814e-09
-2.00667e-09
-2.20418e-09
-1.9555e-09
-2.38653e-09
-1.89749e-09
-2.55319e-09
-1.83244e-09
-2.70511e-09
-1.76019e-09
-2.84085e-09
-1.68055e-09
-2.95992e-09
-1.59329e-09
-3.06367e-09
-1.49833e-09
-3.14846e-09
-1.39557e-09
-3.21466e-09
-1.28508e-09
-3.25855e-09
-1.16704e-09
-3.27646e-09
-1.0418e-09
-3.26283e-09
-9.10081e-10
-3.20642e-09
-7.7299e-10
-3.09359e-09
-6.32212e-10
-2.90338e-09
-4.90427e-10
-2.60562e-09
-3.51779e-10
-2.16357e-09
-2.22596e-10
-1.54631e-09
-1.12084e-10
-7.74061e-10
-3.29121e-11
-1.8197e-11
2.90388e-10
-2.13757e-09
-3.22636e-10
-2.14399e-09
-5.8651e-10
-2.14312e-09
-8.48628e-10
-2.13523e-09
-1.10599e-09
-2.12051e-09
-1.35605e-09
-2.09913e-09
-1.59659e-09
-2.07117e-09
-1.82592e-09
-2.03665e-09
-2.04266e-09
-1.99553e-09
-2.24531e-09
-1.94765e-09
-2.4344e-09
-1.89291e-09
-2.60794e-09
-1.83106e-09
-2.76695e-09
-1.76192e-09
-2.90999e-09
-1.6853e-09
-3.03655e-09
-1.60092e-09
-3.14803e-09
-1.5087e-09
-3.24068e-09
-1.4085e-09
-3.31485e-09
-1.30037e-09
-3.36669e-09
-1.18443e-09
-3.3924e-09
-1.06099e-09
-3.38626e-09
-9.30702e-10
-3.33671e-09
-7.94551e-10
-3.22974e-09
-6.5408e-10
-3.04385e-09
-5.11751e-10
-2.74795e-09
-3.71402e-10
-2.30392e-09
-2.38967e-10
-1.67875e-09
-1.23367e-10
-8.89663e-10
-3.77361e-11
-1.03827e-10
2.52651e-10
-2.10848e-09
-3.07067e-10
-2.11688e-09
-5.78116e-10
-2.11833e-09
-8.47175e-10
-2.11305e-09
-1.11128e-09
-2.10118e-09
-1.36793e-09
-2.08279e-09
-1.61497e-09
-2.05793e-09
-1.85078e-09
-2.02653e-09
-2.07405e-09
-1.98853e-09
-2.28332e-09
-1.94372e-09
-2.4792e-09
-1.89197e-09
-2.6597e-09
-1.83302e-09
-2.82589e-09
-1.76667e-09
-2.97634e-09
-1.6927e-09
-3.11053e-09
-1.61084e-09
-3.22988e-09
-1.52098e-09
-3.33054e-09
-1.42299e-09
-3.41284e-09
-1.31685e-09
-3.47283e-09
-1.20269e-09
-3.50656e-09
-1.08077e-09
-3.50818e-09
-9.51666e-10
-3.46581e-09
-8.1628e-10
-3.36513e-09
-6.76019e-10
-3.1841e-09
-5.33144e-10
-2.89082e-09
-3.91189e-10
-2.44587e-09
-2.55664e-10
-1.81427e-09
-1.35113e-10
-1.01022e-09
-4.29216e-11
-1.96018e-10
2.0973e-10
-2.08344e-09
-2.89676e-10
-2.09402e-09
-5.67542e-10
-2.09795e-09
-8.43246e-10
-2.09538e-09
-1.11386e-09
-2.08637e-09
-1.37694e-09
-2.07094e-09
-1.63039e-09
-2.04907e-09
-1.87265e-09
-2.02064e-09
-2.10247e-09
-1.98556e-09
-2.31842e-09
-1.94358e-09
-2.52117e-09
-1.89454e-09
-2.70874e-09
-1.83817e-09
-2.88226e-09
-1.77426e-09
-3.04025e-09
-1.70259e-09
-3.18221e-09
-1.62288e-09
-3.30958e-09
-1.53502e-09
-3.4184e-09
-1.43885e-09
-3.50901e-09
-1.33437e-09
-3.57731e-09
-1.22167e-09
-3.61927e-09
-1.10097e-09
-3.62888e-09
-9.72807e-10
-3.59398e-09
-8.38004e-10
-3.49994e-09
-6.97852e-10
-3.32425e-09
-5.54426e-10
-3.03425e-09
-4.10971e-10
-2.58932e-09
-2.72557e-10
-1.95269e-09
-1.47262e-10
-1.13551e-09
-4.84748e-11
-2.94805e-10
1.61255e-10
-2.06254e-09
-2.70252e-10
-2.07545e-09
-5.54635e-10
-2.08195e-09
-8.36749e-10
-2.08212e-09
-1.11371e-09
-2.07594e-09
-1.38312e-09
-2.06337e-09
-1.64295e-09
-2.04434e-09
-1.89168e-09
-2.01869e-09
-2.12811e-09
-1.98629e-09
-2.35084e-09
-1.94685e-09
-2.5606e-09
-1.90022e-09
-2.75538e-09
-1.84611e-09
-2.93636e-09
-1.78431e-09
-3.10206e-09
-1.71458e-09
-3.25194e-09
-1.63667e-09
-3.38749e-09
-1.55044e-09
-3.50463e-09
-1.45576e-09
-3.60369e-09
-1.3526e-09
-3.68047e-09
-1.24104e-09
-3.73083e-09
-1.12129e-09
-3.74863e-09
-9.93833e-10
-3.72143e-09
-8.59438e-10
-3.63434e-09
-7.19297e-10
-3.46439e-09
-5.75324e-10
-3.17822e-09
-4.30495e-10
-2.73415e-09
-2.89441e-10
-2.09374e-09
-1.59704e-10
-1.26525e-09
-5.43828e-11
-4.00126e-10
1.06872e-10
-2.04571e-09
-2.48648e-10
-2.06104e-09
-5.39311e-10
-2.07012e-09
-8.27666e-10
-2.07297e-09
-1.11087e-09
-2.06951e-09
-1.38658e-09
-2.05966e-09
-1.6528e-09
-2.04327e-09
-1.90807e-09
-2.02015e-09
-2.15122e-09
-1.99015e-09
-2.38086e-09
-1.95297e-09
-2.59776e-09
-1.90843e-09
-2.79993e-09
-1.85625e-09
-2.98853e-09
-1.79621e-09
-3.1621e-09
-1.7281e-09
-3.32006e-09
-1.65164e-09
-3.46394e-09
-1.56673e-09
-3.58954e-09
-1.47321e-09
-3.69721e-09
-1.37106e-09
-3.78262e-09
-1.26036e-09
-3.84153e-09
-1.1413e-09
-3.86769e-09
-1.01434e-09
-3.8484e-09
-8.80191e-10
-3.76849e-09
-7.39979e-10
-3.6046e-09
-5.95476e-10
-3.32273e-09
-4.49425e-10
-2.8802e-09
-3.06033e-10
-2.23713e-09
-1.72266e-10
-1.39902e-09
-6.06062e-11
-5.11786e-10
4.62657e-11
-2.03273e-09
-2.24802e-10
-2.05047e-09
-5.21577e-10
-2.06207e-09
-8.16071e-10
-2.06747e-09
-1.10547e-09
-2.06656e-09
-1.38749e-09
-2.05917e-09
-1.66017e-09
-2.04516e-09
-1.92209e-09
-2.0243e-09
-2.17208e-09
-1.99639e-09
-2.40879e-09
-1.96115e-09
-2.63299e-09
-1.91839e-09
-2.8427e-09
-1.86782e-09
-3.0391e-09
-1.80923e-09
-3.22069e-09
-1.74241e-09
-3.38689e-09
-1.6671e-09
-3.53924e-09
-1.58319e-09
-3.67345e-09
-1.49054e-09
-3.78985e-09
-1.38914e-09
-3.88402e-09
-1.27905e-09
-3.95162e-09
-1.16046e-09
-3.98628e-09
-1.0338e-09
-3.97505e-09
-8.99776e-10
-3.90252e-09
-7.59431e-10
-3.74495e-09
-6.14437e-10
-3.46772e-09
-4.67339e-10
-3.0273e-09
-3.21968e-10
-2.3825e-09
-1.84702e-10
-1.53628e-09
-6.70686e-11
-6.29418e-10
-2.0803e-11
-2.02325e-09
-1.98747e-10
-2.04329e-09
-5.01538e-10
-2.05723e-09
-8.02133e-10
-2.06497e-09
-1.09774e-09
-2.06633e-09
-1.38613e-09
-2.06113e-09
-1.66536e-09
-2.04919e-09
-1.93404e-09
-2.03024e-09
-2.19101e-09
-2.0041e-09
-2.43494e-09
-1.97047e-09
-2.66661e-09
-1.92916e-09
-2.88401e-09
-1.87989e-09
-3.08837e-09
-1.82244e-09
-3.27813e-09
-1.75663e-09
-3.45272e-09
-1.68219e-09
-3.61367e-09
-1.59902e-09
-3.75661e-09
-1.507e-09
-3.88187e-09
-1.40611e-09
-3.98491e-09
-1.29643e-09
-4.06131e-09
-1.17813e-09
-4.10458e-09
-1.05164e-09
-4.10154e-09
-9.17629e-10
-4.03653e-09
-7.77116e-10
-3.88546e-09
-6.3169e-10
-3.61315e-09
-4.83744e-10
-3.17525e-09
-3.36798e-10
-2.52945e-09
-1.96679e-10
-1.6764e-09
-7.36426e-11
-7.52454e-10
-9.44457e-11
-2.01676e-09
-1.70645e-10
-2.03889e-09
-4.79414e-10
-2.05491e-09
-7.86118e-10
-2.06467e-09
-1.08799e-09
-2.06797e-09
-1.38282e-09
-2.06461e-09
-1.66872e-09
-2.05436e-09
-1.94428e-09
-2.03698e-09
-2.20839e-09
-2.01227e-09
-2.45967e-09
-1.97992e-09
-2.69895e-09
-1.93974e-09
-2.9242e-09
-1.89146e-09
-3.13664e-09
-1.83489e-09
-3.33471e-09
-1.76981e-09
-3.5178e-09
-1.696e-09
-3.68747e-09
-1.61336e-09
-3.83926e-09
-1.52176e-09
-3.97347e-09
-1.4212e-09
-4.08547e-09
-1.31176e-09
-4.17075e-09
-1.19361e-09
-4.22273e-09
-1.06718e-09
-4.22797e-09
-9.33133e-10
-4.17058e-09
-7.92448e-10
-4.02614e-09
-6.46668e-10
-3.75893e-09
-4.98086e-10
-3.32383e-09
-3.49994e-10
-2.67754e-09
-2.0777e-10
-1.81863e-09
-8.01387e-11
-8.80085e-10
-1.74584e-10
-2.01253e-09
-1.40722e-10
-2.03646e-09
-4.55489e-10
-2.05422e-09
-7.68361e-10
-2.06564e-09
-1.07658e-09
-2.07049e-09
-1.37797e-09
-2.06856e-09
-1.67065e-09
-2.05963e-09
-1.95322e-09
-2.04344e-09
-2.22457e-09
-2.0198e-09
-2.48333e-09
-1.9884e-09
-2.73034e-09
-1.94905e-09
-2.96355e-09
-1.9015e-09
-3.18419e-09
-1.84554e-09
-3.39067e-09
-1.78098e-09
-3.58236e-09
-1.7076e-09
-3.76085e-09
-1.6253e-09
-3.92155e-09
-1.53397e-09
-4.06479e-09
-1.43361e-09
-4.18583e-09
-1.3243e-09
-4.28007e-09
-1.20622e-09
-4.34081e-09
-1.07979e-09
-4.35439e-09
-9.45669e-10
-4.30471e-09
-8.04832e-10
-4.16698e-09
-6.5879e-10
-3.90497e-09
-5.09779e-10
-3.47284e-09
-3.60957e-10
-2.82636e-09
-2.17412e-10
-1.96218e-09
-8.6293e-11
-1.0112e-09
-2.60878e-10
-2.00999e-09
-1.09408e-10
-2.03517e-09
-4.30309e-10
-2.0542e-09
-7.49338e-10
-2.06682e-09
-1.06396e-09
-2.0728e-09
-1.37199e-09
-2.07189e-09
-1.67154e-09
-2.06389e-09
-1.96122e-09
-2.04853e-09
-2.23991e-09
-2.02562e-09
-2.50625e-09
-1.99487e-09
-2.76108e-09
-1.9561e-09
-3.00233e-09
-1.90903e-09
-3.23125e-09
-1.85347e-09
-3.44623e-09
-1.78925e-09
-3.64659e-09
-1.71614e-09
-3.83395e-09
-1.63405e-09
-4.00364e-09
-1.54287e-09
-4.15597e-09
-1.44261e-09
-4.28609e-09
-1.33336e-09
-4.38932e-09
-1.21529e-09
-4.45888e-09
-1.08883e-09
-4.48085e-09
-9.54637e-10
-4.4389e-09
-8.13679e-10
-4.30793e-09
-6.67455e-10
-4.05119e-09
-5.18176e-10
-3.62212e-09
-3.68947e-10
-2.97559e-09
-2.24763e-10
-2.10636e-09
-9.16579e-11
-1.14431e-09
-3.52536e-10
-2.00657e-09
-2.03323e-09
-2.05352e-09
-2.06715e-09
-2.07396e-09
-2.07375e-09
-2.06633e-09
-2.05147e-09
-2.02899e-09
-1.9986e-09
-1.96012e-09
-1.9133e-09
-1.85795e-09
-1.79388e-09
-1.72088e-09
-1.63888e-09
-1.54775e-09
-1.44751e-09
-1.33826e-09
-1.22016e-09
-1.09365e-09
-9.59381e-10
-8.18323e-10
-6.71968e-10
-5.22512e-10
-3.73047e-10
-2.28566e-10
-9.51914e-11
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform List<scalar>
58
(
-7.74692e-11
-7.74693e-11
-4.03653e-10
-4.03653e-10
-7.29048e-10
-7.29049e-10
-1.05034e-09
-1.05034e-09
-1.36518e-09
-1.36518e-09
-1.67175e-09
-1.67175e-09
-1.96865e-09
-1.96865e-09
-2.25476e-09
-2.25476e-09
-2.52875e-09
-2.52875e-09
-2.79146e-09
-2.79147e-09
-3.04081e-09
-3.04081e-09
-3.27807e-09
-3.27807e-09
-3.50158e-09
-3.50158e-09
-3.71066e-09
-3.71067e-09
-3.90694e-09
-3.90694e-09
-4.08566e-09
-4.08565e-09
-4.24711e-09
-4.24709e-09
-4.38633e-09
-4.38633e-09
-4.49859e-09
-4.49859e-09
-4.57698e-09
-4.57698e-09
-4.60736e-09
-4.60736e-09
-4.57318e-09
-4.57317e-09
-4.44899e-09
-4.44899e-09
-4.19755e-09
-4.19755e-09
-3.77158e-09
-3.77158e-09
-3.12506e-09
-3.12506e-09
-2.25085e-09
-2.25084e-09
-1.27768e-09
-1.27768e-09
-4.47727e-10
-4.47727e-10
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar> 0();
}
walls
{
type calculated;
value uniform 0;
}
side1
{
type cyclic;
value nonuniform List<scalar>
1330
(
2.16132e-13
1.50283e-13
1.05553e-13
1.01932e-13
1.28259e-13
1.84439e-13
2.21953e-13
2.20533e-13
1.81461e-13
1.3804e-13
1.08516e-13
1.18906e-13
1.76532e-13
3.04167e-13
4.5332e-13
5.69861e-13
5.84444e-13
4.338e-13
3.67057e-13
2.85906e-13
-1.75283e-12
3.60812e-13
3.46276e-13
3.38956e-13
3.41104e-13
3.79539e-13
4.43688e-13
5.01146e-13
5.14801e-13
4.91951e-13
4.60618e-13
5.10896e-13
9.66893e-12
-7.26028e-14
1.88766e-13
2.0379e-13
2.13942e-13
2.34122e-13
2.44474e-13
2.59481e-13
2.66702e-13
2.76565e-13
2.7918e-13
2.97061e-13
3.15627e-13
3.44197e-13
3.71122e-13
4.04921e-13
4.21992e-13
4.23035e-13
4.00892e-13
3.75879e-13
5.4225e-13
1.28121e-12
2.17854e-12
2.9035e-13
2.91767e-13
2.9231e-13
2.89238e-13
2.86692e-13
2.71122e-13
2.42536e-13
1.99369e-13
1.55975e-13
1.1212e-13
8.12466e-14
6.34091e-13
3.73534e-14
1.51292e-13
1.7576e-13
1.70908e-13
1.80283e-13
1.78531e-13
1.89207e-13
1.93423e-13
2.03102e-13
1.99918e-13
2.09006e-13
2.20614e-13
2.38527e-13
2.46016e-13
2.67281e-13
2.73799e-13
2.72228e-13
2.49181e-13
2.2548e-13
1.90667e-13
4.03767e-14
1.37446e-12
1.74968e-13
1.74659e-13
1.71491e-13
1.65571e-13
1.60163e-13
1.41427e-13
1.19816e-13
8.53584e-14
5.85909e-14
3.52041e-14
2.59326e-14
1.04511e-14
3.59572e-14
8.97118e-14
1.18217e-13
9.81226e-14
1.02086e-13
9.49797e-14
1.02128e-13
9.69611e-14
1.09206e-13
1.1172e-13
1.19239e-13
1.07662e-13
1.14673e-13
1.22327e-13
1.41099e-13
1.39374e-13
1.51964e-13
1.43196e-13
1.34422e-13
1.17065e-13
2.35473e-13
2.74706e-13
9.64452e-14
8.85916e-14
8.32334e-14
8.20145e-14
8.24689e-14
7.12299e-14
6.42441e-14
4.78221e-14
3.49004e-14
1.64559e-14
2.10264e-14
8.18329e-15
7.61077e-15
-2.50413e-14
1.90255e-14
1.24029e-14
2.09279e-14
1.9405e-14
2.52037e-14
1.36692e-14
2.47193e-14
2.67582e-14
3.60343e-14
2.34684e-14
3.08361e-14
3.39022e-14
4.74126e-14
3.32348e-14
4.8635e-14
5.19188e-14
4.80978e-14
3.65295e-14
2.19344e-14
3.32757e-14
2.85784e-14
2.09069e-14
2.07057e-14
2.11294e-14
2.52829e-14
1.70963e-14
1.92352e-14
1.33142e-14
1.32418e-14
5.73919e-15
1.37835e-14
1.38174e-14
-4.05112e-14
2.53592e-16
3.41293e-16
4.19817e-16
4.98656e-16
5.7422e-16
6.46822e-16
7.11229e-16
7.65857e-16
8.05573e-16
8.29759e-16
8.36096e-16
8.23861e-16
7.92835e-16
7.41772e-16
6.74606e-16
5.91976e-16
4.97755e-16
3.87679e-16
2.69468e-16
1.44882e-16
2.88918e-17
-8.3536e-17
-1.84386e-16
-2.74858e-16
-3.54856e-16
-4.33098e-16
-5.04209e-16
-5.71127e-16
-6.27833e-16
-6.83467e-16
-7.29775e-16
-7.7183e-16
-8.04878e-16
-8.47227e-16
-8.89487e-16
-9.37427e-16
-9.77688e-16
-1.02713e-15
-1.06494e-15
-1.09175e-15
5.71679e-16
1.34776e-15
2.1053e-15
2.84538e-15
3.55433e-15
4.21799e-15
4.82143e-15
5.35389e-15
5.80579e-15
6.17271e-15
6.45383e-15
6.65134e-15
6.77023e-15
6.81676e-15
6.80076e-15
6.73058e-15
6.61555e-15
6.46063e-15
6.27663e-15
6.07158e-15
5.85585e-15
5.63361e-15
5.41415e-15
5.20085e-15
4.99793e-15
4.80195e-15
4.61739e-15
4.44491e-15
4.28896e-15
4.14631e-15
4.02164e-15
3.91284e-15
3.82011e-15
3.73378e-15
3.65688e-15
3.58722e-15
3.52845e-15
3.4734e-15
3.43016e-15
3.40011e-15
4.94319e-16
1.18623e-15
1.86134e-15
2.51956e-15
3.14897e-15
3.73672e-15
4.27062e-15
4.74069e-15
5.1391e-15
5.46173e-15
5.70724e-15
5.87734e-15
5.97615e-15
6.0095e-15
5.98534e-15
5.91118e-15
5.79528e-15
5.64492e-15
5.46873e-15
5.27433e-15
5.06972e-15
4.86087e-15
4.65379e-15
4.45224e-15
4.25947e-15
4.07572e-15
3.90362e-15
3.74413e-15
3.59893e-15
3.46788e-15
3.35237e-15
3.25118e-15
3.16376e-15
3.08616e-15
3.01841e-15
2.95892e-15
2.90782e-15
2.86218e-15
2.82526e-15
2.80018e-15
8.22239e-16
2.28944e-15
3.76111e-15
5.22259e-15
6.64248e-15
7.98884e-15
9.23158e-15
1.0346e-14
1.13137e-14
1.21236e-14
1.27717e-14
1.32612e-14
1.35996e-14
1.3799e-14
1.38759e-14
1.38469e-14
1.37287e-14
1.3538e-14
1.3291e-14
1.30026e-14
1.26866e-14
1.23546e-14
1.20167e-14
1.16813e-14
1.13551e-14
1.10431e-14
1.07498e-14
1.0479e-14
1.02336e-14
1.00153e-14
9.82571e-15
9.66451e-15
9.53054e-15
9.42197e-15
9.33622e-15
9.26927e-15
9.21742e-15
9.17703e-15
9.14604e-15
9.12436e-15
3.42305e-16
8.5756e-16
1.3501e-15
1.82017e-15
2.26019e-15
2.66304e-15
3.02236e-15
3.33301e-15
3.59085e-15
3.79407e-15
3.94204e-15
4.0364e-15
4.07909e-15
4.07422e-15
4.02791e-15
3.94453e-15
3.83035e-15
3.6916e-15
3.53437e-15
3.36449e-15
3.18743e-15
3.00793e-15
2.83005e-15
2.65697e-15
2.49073e-15
2.33396e-15
2.1879e-15
2.0525e-15
1.92912e-15
1.81652e-15
1.71578e-15
1.62647e-15
1.54776e-15
1.4786e-15
1.41973e-15
1.36782e-15
1.32341e-15
1.28557e-15
1.25592e-15
1.23597e-15
-4.11936e-17
-3.04678e-16
-6.37079e-16
-1.02397e-15
-1.44922e-15
-1.89493e-15
-2.34481e-15
-2.78307e-15
-3.19739e-15
-3.57865e-15
-3.92138e-15
-4.22334e-15
-4.48499e-15
-4.70878e-15
-4.89818e-15
-5.05745e-15
-5.19076e-15
-5.30235e-15
-5.39477e-15
-5.472e-15
-5.53516e-15
-5.58778e-15
-5.63154e-15
-5.66839e-15
-5.70042e-15
-5.72968e-15
-5.7578e-15
-5.78828e-15
-5.82123e-15
-5.85763e-15
-5.89931e-15
-5.94604e-15
-5.99787e-15
-6.05267e-15
-6.11009e-15
-6.16798e-15
-6.22395e-15
-6.27512e-15
-6.3158e-15
-6.33954e-15
4.58719e-16
1.30021e-15
2.13863e-15
2.96382e-15
3.76105e-15
4.51404e-15
5.20751e-15
5.82905e-15
6.36853e-15
6.81977e-15
7.17824e-15
7.44586e-15
7.62614e-15
7.72234e-15
7.74609e-15
7.70428e-15
7.60704e-15
7.46457e-15
7.28662e-15
7.08227e-15
6.86019e-15
6.62835e-15
6.39164e-15
6.15727e-15
5.92946e-15
5.71194e-15
5.50719e-15
5.31792e-15
5.14559e-15
4.99172e-15
4.85525e-15
4.73819e-15
4.63854e-15
4.55524e-15
4.48796e-15
4.4342e-15
4.3914e-15
4.3571e-15
4.33223e-15
4.31767e-15
4.64084e-17
-1.97373e-17
-1.69332e-16
-3.8925e-16
-6.6832e-16
-9.89753e-16
-1.33599e-15
-1.69269e-15
-2.0438e-15
-2.38059e-15
-2.69443e-15
-2.9812e-15
-3.23956e-15
-3.46858e-15
-3.67127e-15
-3.85015e-15
-4.0084e-15
-4.14749e-15
-4.27151e-15
-4.38268e-15
-4.48266e-15
-4.57316e-15
-4.65656e-15
-4.73468e-15
-4.80851e-15
-4.8816e-15
-4.95388e-15
-5.02675e-15
-5.10315e-15
-5.18215e-15
-5.26427e-15
-5.3493e-15
-5.43626e-15
-5.52314e-15
-5.60785e-15
-5.68845e-15
-5.76206e-15
-5.82521e-15
-5.87259e-15
-5.89932e-15
8.4292e-16
2.59197e-15
4.44642e-15
6.3715e-15
8.31975e-15
1.02405e-14
1.2084e-14
1.37995e-14
1.53535e-14
1.67123e-14
1.78616e-14
1.87934e-14
1.95104e-14
2.00226e-14
2.03466e-14
2.05031e-14
2.05152e-14
2.04069e-14
2.02029e-14
1.99204e-14
1.95842e-14
1.92117e-14
1.8819e-14
1.84207e-14
1.80293e-14
1.76544e-14
1.73056e-14
1.69892e-14
1.67105e-14
1.6473e-14
1.62784e-14
1.61264e-14
1.6015e-14
1.59388e-14
1.58945e-14
1.58743e-14
1.587e-14
1.58743e-14
1.58806e-14
1.58855e-14
7.32705e-17
3.05216e-17
-1.33801e-16
-4.04754e-16
-7.65217e-16
-1.19318e-15
-1.66773e-15
-2.16463e-15
-2.66107e-15
-3.1431e-15
-3.59569e-15
-4.01073e-15
-4.38454e-15
-4.71534e-15
-5.00449e-15
-5.25508e-15
-5.47121e-15
-5.65738e-15
-5.8185e-15
-5.95874e-15
-6.08284e-15
-6.19516e-15
-6.29669e-15
-6.39379e-15
-6.48848e-15
-6.58366e-15
-6.68159e-15
-6.7844e-15
-6.89285e-15
-7.0076e-15
-7.12844e-15
-7.25476e-15
-7.38252e-15
-7.51061e-15
-7.635e-15
-7.75186e-15
-7.85593e-15
-7.94266e-15
-8.00602e-15
-8.04094e-15
5.79132e-16
1.75472e-15
2.98832e-15
4.25745e-15
5.53397e-15
6.78488e-15
7.9809e-15
9.09089e-15
1.00933e-14
1.09693e-14
1.17071e-14
1.23014e-14
1.27548e-14
1.30724e-14
1.32655e-14
1.33474e-14
1.33325e-14
1.32362e-14
1.30738e-14
1.28597e-14
1.26076e-14
1.23292e-14
1.20359e-14
1.17374e-14
1.1442e-14
1.11567e-14
1.08867e-14
1.06384e-14
1.04146e-14
1.0218e-14
1.00499e-14
9.91005e-15
9.79893e-15
9.71385e-15
9.65248e-15
9.61056e-15
9.58299e-15
9.56657e-15
9.55788e-15
9.55489e-15
2.67251e-16
6.65303e-16
9.67933e-16
1.17701e-15
1.29693e-15
1.33632e-15
1.30492e-15
1.21469e-15
1.07887e-15
9.09697e-16
7.16075e-16
5.07192e-16
2.90146e-16
6.98968e-17
-1.46529e-16
-3.58336e-16
-5.66001e-16
-7.68943e-16
-9.66688e-16
-1.15985e-15
-1.34856e-15
-1.53314e-15
-1.71468e-15
-1.89341e-15
-2.07098e-15
-2.24699e-15
-2.42223e-15
-2.59668e-15
-2.77017e-15
-2.94241e-15
-3.11157e-15
-3.27601e-15
-3.43425e-15
-3.58348e-15
-3.72092e-15
-3.84371e-15
-3.94869e-15
-4.03258e-15
-4.09161e-15
-4.12269e-15
4.18138e-16
1.21456e-15
1.99684e-15
2.75362e-15
3.47046e-15
4.13433e-15
4.73401e-15
5.26075e-15
5.70872e-15
6.07471e-15
6.35881e-15
6.56405e-15
6.69452e-15
6.75661e-15
6.7575e-15
6.705e-15
6.60736e-15
6.47199e-15
6.30634e-15
6.11708e-15
5.91035e-15
5.69162e-15
5.46572e-15
5.23695e-15
5.00893e-15
4.78499e-15
4.56796e-15
4.36032e-15
4.16408e-15
3.98133e-15
3.81348e-15
3.66193e-15
3.52742e-15
3.41052e-15
3.31132e-15
3.22951e-15
3.16462e-15
3.11628e-15
3.08409e-15
3.06869e-15
4.98142e-16
1.58136e-15
2.75645e-15
3.99828e-15
5.273e-15
6.54626e-15
7.78474e-15
8.95184e-15
1.00236e-14
1.0976e-14
1.17982e-14
1.24827e-14
1.30271e-14
1.34404e-14
1.37281e-14
1.39044e-14
1.39822e-14
1.39754e-14
1.39007e-14
1.37693e-14
1.35949e-14
1.33896e-14
1.31642e-14
1.29298e-14
1.26932e-14
1.24625e-14
1.22434e-14
1.2043e-14
1.18615e-14
1.17053e-14
1.15753e-14
1.14746e-14
1.13969e-14
1.13442e-14
1.13128e-14
1.12978e-14
1.12948e-14
1.1299e-14
1.13057e-14
1.1312e-14
2.67107e-16
6.25413e-16
8.20945e-16
8.54801e-16
7.36359e-16
4.86553e-16
1.22481e-16
-3.25138e-16
-8.27195e-16
-1.36166e-15
-1.89999e-15
-2.42689e-15
-2.92733e-15
-3.39048e-15
-3.81381e-15
-4.1923e-15
-4.5275e-15
-4.82274e-15
-5.08334e-15
-5.31476e-15
-5.52065e-15
-5.70842e-15
-5.88536e-15
-6.05338e-15
-6.21832e-15
-6.38469e-15
-6.55152e-15
-6.72512e-15
-6.90548e-15
-7.09283e-15
-7.28331e-15
-7.4752e-15
-7.66777e-15
-7.85522e-15
-8.03209e-15
-8.19281e-15
-8.33404e-15
-8.44696e-15
-8.52726e-15
-8.57028e-15
2.81939e-16
8.17344e-16
1.32656e-15
1.79908e-15
2.22649e-15
2.60192e-15
2.91926e-15
3.17785e-15
3.37884e-15
3.52556e-15
3.62242e-15
3.67472e-15
3.6886e-15
3.67004e-15
3.62449e-15
3.55707e-15
3.47096e-15
3.37275e-15
3.26208e-15
3.14385e-15
3.01914e-15
2.89073e-15
2.75893e-15
2.62655e-15
2.49382e-15
2.36342e-15
2.23253e-15
2.10696e-15
1.98502e-15
1.86941e-15
1.76028e-15
1.65837e-15
1.56555e-15
1.48322e-15
1.41013e-15
1.3507e-15
1.30138e-15
1.2643e-15
1.23696e-15
1.22024e-15
2.14182e-16
5.61068e-16
8.38063e-16
1.04177e-15
1.17134e-15
1.22984e-15
1.22431e-15
1.16341e-15
1.05791e-15
9.19097e-16
7.57694e-16
5.83115e-16
4.04108e-16
2.24784e-16
5.13093e-17
-1.12496e-16
-2.66308e-16
-4.10475e-16
-5.45407e-16
-6.71578e-16
-7.90121e-16
-9.04504e-16
-1.01309e-15
-1.12029e-15
-1.22487e-15
-1.32904e-15
-1.43291e-15
-1.53726e-15
-1.64149e-15
-1.7459e-15
-1.84877e-15
-1.95154e-15
-2.0508e-15
-2.14251e-15
-2.22715e-15
-2.30331e-15
-2.36836e-15
-2.42176e-15
-2.46391e-15
-2.4956e-15
1.27584e-16
3.85843e-16
6.59669e-16
9.43536e-16
1.23033e-15
1.51182e-15
1.78131e-15
2.03285e-15
2.26241e-15
2.46598e-15
2.64222e-15
2.79005e-15
2.90991e-15
3.0033e-15
3.07212e-15
3.11772e-15
3.14553e-15
3.1553e-15
3.15061e-15
3.13446e-15
3.10892e-15
3.0757e-15
3.03763e-15
2.99651e-15
2.95419e-15
2.91166e-15
2.87062e-15
2.83184e-15
2.79628e-15
2.76482e-15
2.73814e-15
2.71647e-15
2.70011e-15
2.68878e-15
2.68237e-15
2.67924e-15
2.67769e-15
2.67533e-15
2.67027e-15
2.6633e-15
3.88178e-17
1.71315e-16
3.76783e-16
6.49858e-16
9.79589e-16
1.35254e-15
1.7543e-15
2.16907e-15
2.58358e-15
2.98384e-15
3.36097e-15
3.70673e-15
4.01606e-15
4.28608e-15
4.51672e-15
4.70916e-15
4.8658e-15
4.98991e-15
5.08612e-15
5.15785e-15
5.21072e-15
5.24793e-15
5.27392e-15
5.29185e-15
5.30636e-15
5.3189e-15
5.33289e-15
5.34968e-15
5.37098e-15
5.3977e-15
5.43059e-15
5.46902e-15
5.51278e-15
5.5598e-15
5.60865e-15
5.65624e-15
5.69932e-15
5.73208e-15
5.75288e-15
5.7651e-15
1.37418e-16
3.28513e-16
4.51744e-16
5.08747e-16
5.03532e-16
4.4203e-16
3.32852e-16
1.85563e-16
1.02755e-17
-1.80542e-16
-3.79889e-16
-5.80565e-16
-7.765e-16
-9.63506e-16
-1.1389e-15
-1.30167e-15
-1.45078e-15
-1.58722e-15
-1.71166e-15
-1.82596e-15
-1.93113e-15
-2.02917e-15
-2.12196e-15
-2.21082e-15
-2.29667e-15
-2.38128e-15
-2.46512e-15
-2.5499e-15
-2.63467e-15
-2.72054e-15
-2.80675e-15
-2.89272e-15
-2.97624e-15
-3.05636e-15
-3.13043e-15
-3.19789e-15
-3.25657e-15
-3.30688e-15
-3.34527e-15
-3.36477e-15
1.00221e-16
2.54579e-16
3.81864e-16
4.83396e-16
5.58688e-16
6.08601e-16
6.35243e-16
6.40832e-16
6.28932e-16
6.02585e-16
5.65315e-16
5.19563e-16
4.68294e-16
4.13174e-16
3.55761e-16
2.9706e-16
2.38052e-16
1.79083e-16
1.20542e-16
6.24909e-17
5.31624e-18
-5.10187e-17
-1.07024e-16
-1.62752e-16
-2.17878e-16
-2.72575e-16
-3.26715e-16
-3.80751e-16
-4.33864e-16
-4.86558e-16
-5.37562e-16
-5.86989e-16
-6.33412e-16
-6.76786e-16
-7.15605e-16
-7.50191e-16
-7.79929e-16
-8.05351e-16
-8.25583e-16
-8.39216e-16
-4.02125e-17
-7.53452e-17
-4.65468e-17
4.61962e-17
1.96294e-16
3.94438e-16
6.29807e-16
8.90999e-16
1.16682e-15
1.44682e-15
1.7226e-15
1.98592e-15
2.23206e-15
2.45693e-15
2.6586e-15
2.83547e-15
2.98965e-15
3.12195e-15
3.23418e-15
3.32926e-15
3.41013e-15
3.47823e-15
3.53752e-15
3.58957e-15
3.63777e-15
3.68365e-15
3.72921e-15
3.77469e-15
3.82278e-15
3.87253e-15
3.92567e-15
3.98118e-15
4.03884e-15
4.09651e-15
4.15347e-15
4.20658e-15
4.25385e-15
4.29011e-15
4.31403e-15
4.32286e-15
1.51062e-16
3.91569e-16
5.82963e-16
7.2659e-16
8.23088e-16
8.75036e-16
8.86965e-16
8.64341e-16
8.13427e-16
7.40282e-16
6.50879e-16
5.50235e-16
4.4288e-16
3.32037e-16
2.20388e-16
1.09478e-16
2.53634e-19
-1.05704e-16
-2.0887e-16
-3.09228e-16
-4.09143e-16
-5.06933e-16
-6.02987e-16
-6.9818e-16
-7.92467e-16
-8.86129e-16
-9.78315e-16
-1.07158e-15
-1.16534e-15
-1.25743e-15
-1.3472e-15
-1.4347e-15
-1.51802e-15
-1.59652e-15
-1.66829e-15
-1.73247e-15
-1.78753e-15
-1.83306e-15
-1.86635e-15
-1.88329e-15
7.85851e-17
2.23318e-16
3.63628e-16
4.98514e-16
6.28738e-16
7.47201e-16
8.5527e-16
9.51624e-16
1.03549e-15
1.10679e-15
1.16618e-15
1.21124e-15
1.24524e-15
1.26826e-15
1.28102e-15
1.28417e-15
1.27863e-15
1.26518e-15
1.24491e-15
1.21842e-15
1.18694e-15
1.15095e-15
1.11166e-15
1.07001e-15
1.02692e-15
9.83422e-16
9.37667e-16
8.92839e-16
8.49504e-16
8.07626e-16
7.68224e-16
7.31488e-16
6.98296e-16
6.6865e-16
6.43171e-16
6.21445e-16
6.03454e-16
5.88574e-16
5.78109e-16
5.72946e-16
9.81186e-17
2.83613e-16
4.62403e-16
6.30641e-16
7.87808e-16
9.31149e-16
1.05918e-15
1.17125e-15
1.2644e-15
1.34133e-15
1.4019e-15
1.44871e-15
1.4805e-15
1.49875e-15
1.50434e-15
1.50121e-15
1.48775e-15
1.46556e-15
1.43666e-15
1.39945e-15
1.35774e-15
1.30979e-15
1.25874e-15
1.20624e-15
1.15059e-15
1.09249e-15
1.03584e-15
9.77795e-16
9.22558e-16
8.67025e-16
8.15005e-16
7.66365e-16
7.22164e-16
6.8313e-16
6.47221e-16
6.17968e-16
5.92371e-16
5.73267e-16
5.59109e-16
5.5075e-16
1.33923e-16
3.83438e-16
6.11242e-16
8.18704e-16
1.00027e-15
1.15488e-15
1.2825e-15
1.3837e-15
1.46002e-15
1.51343e-15
1.54603e-15
1.55952e-15
1.55882e-15
1.54586e-15
1.5192e-15
1.48378e-15
1.44148e-15
1.3908e-15
1.33338e-15
1.26967e-15
1.2037e-15
1.13267e-15
1.05885e-15
9.81782e-16
9.0331e-16
8.22744e-16
7.4058e-16
6.60447e-16
5.80067e-16
5.00542e-16
4.23273e-16
3.48917e-16
2.7875e-16
2.13528e-16
1.54498e-16
1.02135e-16
5.69156e-17
2.28812e-17
-1.60503e-18
-1.47913e-17
-1.64454e-17
-2.34107e-17
-3.57109e-18
4.3055e-17
1.1298e-16
2.02136e-16
3.0591e-16
4.19047e-16
5.37247e-16
6.56133e-16
7.71935e-16
8.81726e-16
9.83314e-16
1.07528e-15
1.15686e-15
1.22799e-15
1.28894e-15
1.34038e-15
1.38251e-15
1.41729e-15
1.44576e-15
1.46896e-15
1.48898e-15
1.50652e-15
1.52304e-15
1.53954e-15
1.55789e-15
1.57799e-15
1.60121e-15
1.62783e-15
1.65931e-15
1.69464e-15
1.73373e-15
1.77618e-15
1.82043e-15
1.86695e-15
1.90633e-15
1.94213e-15
1.96949e-15
1.98192e-15
1.04653e-16
3.04913e-16
4.86493e-16
6.45306e-16
7.8095e-16
8.89298e-16
9.71483e-16
1.02945e-15
1.06526e-15
1.0818e-15
1.08313e-15
1.07128e-15
1.04886e-15
1.01838e-15
9.81708e-16
9.40127e-16
8.94832e-16
8.46593e-16
7.95072e-16
7.41304e-16
6.8534e-16
6.27089e-16
5.66389e-16
5.02391e-16
4.38868e-16
3.7205e-16
3.02529e-16
2.30796e-16
1.56582e-16
7.9847e-17
2.04795e-18
-7.73169e-17
-1.57596e-16
-2.38102e-16
-3.16268e-16
-3.91963e-16
-4.62031e-16
-5.24056e-16
-5.72213e-16
-5.96869e-16
1.87953e-17
5.23654e-17
8.24456e-17
1.11065e-16
1.37831e-16
1.62827e-16
1.85316e-16
2.05091e-16
2.22045e-16
2.36445e-16
2.48017e-16
2.57236e-16
2.63647e-16
2.67769e-16
2.69871e-16
2.70063e-16
2.68567e-16
2.65547e-16
2.61259e-16
2.55755e-16
2.4931e-16
2.42085e-16
2.3425e-16
2.25953e-16
2.17319e-16
2.0833e-16
2.00049e-16
1.91935e-16
1.84114e-16
1.76734e-16
1.70422e-16
1.64915e-16
1.60632e-16
1.57567e-16
1.56016e-16
1.55918e-16
1.5734e-16
1.60151e-16
1.63746e-16
1.69641e-16
)
;
}
side2
{
type cyclic;
value nonuniform List<scalar>
1330
(
-2.16132e-13
-1.50283e-13
-1.05553e-13
-1.01932e-13
-1.28259e-13
-1.84439e-13
-2.21953e-13
-2.20533e-13
-1.81461e-13
-1.3804e-13
-1.08516e-13
-1.18906e-13
-1.76532e-13
-3.04167e-13
-4.5332e-13
-5.69861e-13
-5.84444e-13
-4.338e-13
-3.67057e-13
-2.85906e-13
1.75283e-12
-3.60812e-13
-3.46276e-13
-3.38956e-13
-3.41104e-13
-3.79539e-13
-4.43688e-13
-5.01146e-13
-5.14801e-13
-4.91951e-13
-4.60618e-13
-5.10896e-13
-9.66893e-12
7.26028e-14
-1.86267e-13
-2.02538e-13
-2.12895e-13
-2.33444e-13
-2.44027e-13
-2.59154e-13
-2.66574e-13
-2.76684e-13
-2.79668e-13
-2.97945e-13
-3.16888e-13
-3.45668e-13
-3.72702e-13
-4.06594e-13
-4.23807e-13
-4.24699e-13
-4.01011e-13
-3.83043e-13
-5.55448e-13
-1.29448e-12
-2.17974e-12
-2.91492e-13
-2.92694e-13
-2.93679e-13
-2.90728e-13
-2.88331e-13
-2.72861e-13
-2.4434e-13
-2.01093e-13
-1.57439e-13
-1.13163e-13
-8.09166e-14
-6.47425e-13
-3.94907e-14
-1.50506e-13
-1.76169e-13
-1.71104e-13
-1.80654e-13
-1.78714e-13
-1.89465e-13
-1.9375e-13
-2.03631e-13
-2.00543e-13
-2.09673e-13
-2.21169e-13
-2.39022e-13
-2.46549e-13
-2.68052e-13
-2.74933e-13
-2.73869e-13
-2.51383e-13
-2.26875e-13
-1.91228e-13
-3.93655e-14
-1.37399e-12
-1.75649e-13
-1.75005e-13
-1.72068e-13
-1.66077e-13
-1.60754e-13
-1.42043e-13
-1.2047e-13
-8.60649e-14
-5.94005e-14
-3.62566e-14
-2.71483e-14
-1.15157e-14
-3.80867e-14
-8.69156e-14
-1.15871e-13
-9.77827e-14
-1.01651e-13
-9.49351e-14
-1.01846e-13
-9.6707e-14
-1.0869e-13
-1.11191e-13
-1.1862e-13
-1.07155e-13
-1.14153e-13
-1.21822e-13
-1.40384e-13
-1.38574e-13
-1.50847e-13
-1.43214e-13
-1.33346e-13
-1.16676e-13
-2.326e-13
-2.73661e-13
-9.52349e-14
-8.81563e-14
-8.25906e-14
-8.15052e-14
-8.18711e-14
-7.06434e-14
-6.36566e-14
-4.72409e-14
-3.45251e-14
-1.58517e-14
-2.22985e-14
-4.31978e-15
-9.50306e-15
2.36354e-14
-2.28193e-14
-1.36508e-14
-2.19604e-14
-1.96838e-14
-2.56718e-14
-1.4059e-14
-2.53428e-14
-2.72425e-14
-3.64306e-14
-2.35487e-14
-3.08573e-14
-3.41129e-14
-4.79323e-14
-3.4638e-14
-4.96989e-14
-5.49783e-14
-4.61163e-14
-3.40689e-14
-1.36748e-14
-3.02465e-14
-2.62632e-14
-2.00187e-14
-2.01458e-14
-2.08479e-14
-2.51573e-14
-1.70656e-14
-1.93869e-14
-1.34589e-14
-1.43686e-14
-5.42957e-15
-1.8127e-14
-8.13232e-15
3.50913e-14
-7.60203e-16
-1.86376e-15
-2.94094e-15
-3.99213e-15
-4.99565e-15
-5.93454e-15
-6.78692e-15
-7.53938e-15
-8.17811e-15
-8.70023e-15
-9.10512e-15
-9.39752e-15
-9.58554e-15
-9.67618e-15
-9.68604e-15
-9.62522e-15
-9.50837e-15
-9.33408e-15
-9.1213e-15
-8.87741e-15
-8.61938e-15
-8.34526e-15
-8.07459e-15
-7.80867e-15
-7.55992e-15
-7.31156e-15
-7.0777e-15
-6.85526e-15
-6.65821e-15
-6.47155e-15
-6.31182e-15
-6.17115e-15
-6.05778e-15
-5.94299e-15
-5.84224e-15
-5.74705e-15
-5.67433e-15
-5.59927e-15
-5.5462e-15
-5.50564e-15
-4.03181e-16
-8.37416e-16
-1.2549e-15
-1.66028e-15
-2.04637e-15
-2.40585e-15
-2.73003e-15
-3.01306e-15
-3.24871e-15
-3.43418e-15
-3.56859e-15
-3.65273e-15
-3.68908e-15
-3.68088e-15
-3.63417e-15
-3.55382e-15
-3.44559e-15
-3.31196e-15
-3.1605e-15
-2.99669e-15
-2.82819e-15
-2.65764e-15
-2.49202e-15
-2.33352e-15
-2.185e-15
-2.04318e-15
-1.91114e-15
-1.78886e-15
-1.67929e-15
-1.57926e-15
-1.49202e-15
-1.41548e-15
-1.34951e-15
-1.28615e-15
-1.2278e-15
-1.17273e-15
-1.12435e-15
-1.07729e-15
-1.0392e-15
-1.01342e-15
-4.20257e-16
-9.59668e-16
-1.48086e-15
-1.98576e-15
-2.46572e-15
-2.91129e-15
-3.31344e-15
-3.66476e-15
-3.95929e-15
-4.1939e-15
-4.36749e-15
-4.48134e-15
-4.53855e-15
-4.54363e-15
-4.50288e-15
-4.42215e-15
-4.30807e-15
-4.16646e-15
-4.00449e-15
-3.82855e-15
-3.64541e-15
-3.46008e-15
-3.27774e-15
-3.10141e-15
-2.93377e-15
-2.77474e-15
-2.62639e-15
-2.48932e-15
-2.36472e-15
-2.25222e-15
-2.15284e-15
-2.06529e-15
-1.98898e-15
-1.92028e-15
-1.8593e-15
-1.80466e-15
-1.75677e-15
-1.71335e-15
-1.67781e-15
-1.65384e-15
-1.41906e-17
2.04733e-16
4.5692e-16
7.35897e-16
1.03134e-15
1.3324e-15
1.62958e-15
1.91476e-15
2.18177e-15
2.42691e-15
2.64842e-15
2.84693e-15
3.02227e-15
3.17714e-15
3.31482e-15
3.43709e-15
3.54652e-15
3.64499e-15
3.73377e-15
3.81351e-15
3.88443e-15
3.94696e-15
4.00134e-15
4.04836e-15
4.08903e-15
4.12501e-15
4.1576e-15
4.18805e-15
4.2174e-15
4.24709e-15
4.27759e-15
4.30991e-15
4.34447e-15
4.38175e-15
4.4213e-15
4.46311e-15
4.50541e-15
4.54614e-15
4.58063e-15
4.60138e-15
-4.56571e-16
-1.21526e-15
-1.9611e-15
-2.68977e-15
-3.38735e-15
-4.03999e-15
-4.63501e-15
-5.16185e-15
-5.61218e-15
-5.98146e-15
-6.26778e-15
-6.47286e-15
-6.59976e-15
-6.65466e-15
-6.64629e-15
-6.58186e-15
-6.47055e-15
-6.32145e-15
-6.14335e-15
-5.94445e-15
-5.73245e-15
-5.51396e-15
-5.29472e-15
-5.07931e-15
-4.87095e-15
-4.67347e-15
-4.48903e-15
-4.31824e-15
-4.16328e-15
-4.0232e-15
-3.8997e-15
-3.79213e-15
-3.69986e-15
-3.62135e-15
-3.55704e-15
-3.50261e-15
-3.45782e-15
-3.42048e-15
-3.39147e-15
-3.37179e-15
-7.99981e-16
-2.35431e-15
-3.9455e-15
-5.54861e-15
-7.12685e-15
-8.64206e-15
-1.00595e-14
-1.13481e-14
-1.24842e-14
-1.34517e-14
-1.42429e-14
-1.48575e-14
-1.53023e-14
-1.55892e-14
-1.57338e-14
-1.57543e-14
-1.56695e-14
-1.5499e-14
-1.52598e-14
-1.49702e-14
-1.46441e-14
-1.42965e-14
-1.39388e-14
-1.35812e-14
-1.32322e-14
-1.28989e-14
-1.25876e-14
-1.23013e-14
-1.20451e-14
-1.18202e-14
-1.16285e-14
-1.14698e-14
-1.13433e-14
-1.12453e-14
-1.11737e-14
-1.11236e-14
-1.10891e-14
-1.10652e-14
-1.10482e-14
-1.10374e-14
-2.90776e-16
-7.6091e-16
-1.20029e-15
-1.60753e-15
-1.97912e-15
-2.31089e-15
-2.59959e-15
-2.84321e-15
-3.04031e-15
-3.19085e-15
-3.29409e-15
-3.35288e-15
-3.36931e-15
-3.34548e-15
-3.2874e-15
-3.19805e-15
-3.08255e-15
-2.94611e-15
-2.7936e-15
-2.63009e-15
-2.45993e-15
-2.28751e-15
-2.11493e-15
-1.94634e-15
-1.78361e-15
-1.62842e-15
-1.48157e-15
-1.34419e-15
-1.21665e-15
-1.0996e-15
-9.91768e-16
-8.95031e-16
-8.07839e-16
-7.30014e-16
-6.62202e-16
-6.03614e-16
-5.5379e-16
-5.12628e-16
-4.82394e-16
-4.64583e-16
-6.96418e-16
-2.09416e-15
-3.54502e-15
-5.02141e-15
-6.49108e-15
-7.92049e-15
-9.27106e-15
-1.05137e-14
-1.16218e-14
-1.25791e-14
-1.33739e-14
-1.4004e-14
-1.44721e-14
-1.47894e-14
-1.49677e-14
-1.50244e-14
-1.49733e-14
-1.48374e-14
-1.46316e-14
-1.43729e-14
-1.4076e-14
-1.37544e-14
-1.34204e-14
-1.30849e-14
-1.27566e-14
-1.24415e-14
-1.21474e-14
-1.18792e-14
-1.16384e-14
-1.14296e-14
-1.12533e-14
-1.11091e-14
-1.09955e-14
-1.09106e-14
-1.08501e-14
-1.08105e-14
-1.07852e-14
-1.07695e-14
-1.07599e-14
-1.07551e-14
8.13963e-17
4.6132e-16
9.80804e-16
1.61749e-15
2.34447e-15
3.13051e-15
3.94386e-15
4.74909e-15
5.52414e-15
6.24242e-15
6.89396e-15
7.46838e-15
7.96266e-15
8.37858e-15
8.72094e-15
8.99693e-15
9.21501e-15
9.38386e-15
9.51351e-15
9.60698e-15
9.67621e-15
9.72655e-15
9.76405e-15
9.79466e-15
9.82265e-15
9.85273e-15
9.88884e-15
9.9341e-15
9.99101e-15
1.00608e-14
1.0144e-14
1.02392e-14
1.03447e-14
1.04553e-14
1.05691e-14
1.06802e-14
1.0783e-14
1.08715e-14
1.09373e-14
1.09743e-14
-7.02359e-16
-2.15415e-15
-3.69402e-15
-5.29288e-15
-6.91129e-15
-8.50691e-15
-1.00407e-14
-1.14729e-14
-1.2769e-14
-1.39083e-14
-1.48724e-14
-1.56551e-14
-1.62585e-14
-1.66901e-14
-1.69632e-14
-1.70947e-14
-1.71035e-14
-1.70093e-14
-1.68313e-14
-1.65886e-14
-1.62982e-14
-1.59765e-14
-1.56349e-14
-1.52883e-14
-1.49466e-14
-1.46187e-14
-1.43119e-14
-1.40327e-14
-1.3784e-14
-1.35708e-14
-1.33934e-14
-1.32526e-14
-1.31449e-14
-1.30696e-14
-1.30212e-14
-1.29945e-14
-1.29824e-14
-1.29795e-14
-1.29805e-14
-1.29829e-14
-2.18927e-16
-5.0557e-16
-6.96277e-16
-7.97722e-16
-8.16085e-16
-7.63825e-16
-6.50485e-16
-4.92787e-16
-3.00942e-16
-8.68695e-17
1.36309e-16
3.61527e-16
5.86203e-16
8.05466e-16
1.01811e-15
1.22305e-15
1.41995e-15
1.60905e-15
1.79091e-15
1.9662e-15
2.13572e-15
2.3005e-15
2.46125e-15
2.61884e-15
2.77456e-15
2.92875e-15
3.0817e-15
3.23465e-15
3.38744e-15
3.53994e-15
3.6912e-15
3.83874e-15
3.98231e-15
4.11909e-15
4.24587e-15
4.36037e-15
4.45964e-15
4.53982e-15
4.59709e-15
4.62779e-15
-5.40957e-16
-1.65001e-15
-2.81401e-15
-4.0113e-15
-5.21429e-15
-6.39296e-15
-7.51877e-15
-8.56464e-15
-9.50861e-15
-1.03322e-14
-1.10276e-14
-1.15894e-14
-1.20188e-14
-1.23217e-14
-1.25074e-14
-1.25885e-14
-1.25787e-14
-1.24921e-14
-1.23434e-14
-1.21458e-14
-1.19113e-14
-1.16509e-14
-1.13753e-14
-1.1094e-14
-1.08137e-14
-1.0542e-14
-1.02844e-14
-1.00453e-14
-9.8283e-15
-9.63641e-15
-9.47083e-15
-9.33225e-15
-9.22037e-15
-9.13351e-15
-9.06919e-15
-9.02396e-15
-8.99392e-15
-8.97535e-15
-8.9656e-15
-8.96257e-15
-3.93338e-16
-1.12063e-15
-1.8156e-15
-2.46933e-15
-3.0709e-15
-3.61136e-15
-4.08426e-15
-4.48505e-15
-4.81179e-15
-5.06528e-15
-5.24759e-15
-5.36359e-15
-5.41822e-15
-5.41797e-15
-5.36949e-15
-5.27963e-15
-5.15531e-15
-5.00255e-15
-4.82724e-15
-4.63458e-15
-4.42924e-15
-4.21539e-15
-3.99661e-15
-3.77609e-15
-3.55654e-15
-3.34042e-15
-3.12984e-15
-2.92682e-15
-2.73292e-15
-2.54991e-15
-2.37944e-15
-2.22277e-15
-2.08107e-15
-1.9553e-15
-1.84625e-15
-1.75432e-15
-1.67992e-15
-1.62358e-15
-1.58541e-15
-1.56662e-15
-2.75024e-16
-6.66202e-16
-9.1587e-16
-1.02551e-15
-1.00401e-15
-8.63186e-16
-6.24425e-16
-3.08335e-16
6.44033e-17
4.66091e-16
8.83125e-16
1.29884e-15
1.69916e-15
2.07725e-15
2.42999e-15
2.75296e-15
3.04695e-15
3.31421e-15
3.55557e-15
3.77635e-15
3.98083e-15
4.17289e-15
4.35634e-15
4.53279e-15
4.70789e-15
4.8834e-15
5.0614e-15
5.24261e-15
5.42864e-15
5.61829e-15
5.81002e-15
5.99984e-15
6.18818e-15
6.36926e-15
6.53904e-15
6.69229e-15
6.8245e-15
6.93046e-15
7.00508e-15
7.04451e-15
-4.29103e-16
-1.39905e-15
-2.4829e-15
-3.65401e-15
-4.88175e-15
-6.12552e-15
-7.35149e-15
-8.52401e-15
-9.6116e-15
-1.05948e-14
-1.14561e-14
-1.21867e-14
-1.27855e-14
-1.32561e-14
-1.36046e-14
-1.38429e-14
-1.39836e-14
-1.40397e-14
-1.40256e-14
-1.39545e-14
-1.38411e-14
-1.36953e-14
-1.35262e-14
-1.33452e-14
-1.31611e-14
-1.29805e-14
-1.28108e-14
-1.26568e-14
-1.25226e-14
-1.241e-14
-1.23222e-14
-1.22598e-14
-1.22204e-14
-1.22024e-14
-1.22026e-14
-1.22162e-14
-1.22359e-14
-1.22581e-14
-1.22779e-14
-1.22905e-14
-2.62515e-16
-6.75226e-16
-9.80122e-16
-1.17388e-15
-1.25951e-15
-1.24453e-15
-1.13919e-15
-9.60511e-16
-7.25054e-16
-4.5028e-16
-1.52839e-16
1.526e-16
4.55037e-16
7.45597e-16
1.02052e-15
1.27582e-15
1.51092e-15
1.72471e-15
1.92125e-15
2.1017e-15
2.26911e-15
2.42612e-15
2.57586e-15
2.72051e-15
2.8626e-15
3.00351e-15
3.14704e-15
3.29114e-15
3.43752e-15
3.58515e-15
3.73354e-15
3.88141e-15
4.02572e-15
4.16296e-15
4.29217e-15
4.40603e-15
4.50477e-15
4.58328e-15
4.64125e-15
4.67492e-15
-2.05411e-16
-6.43413e-16
-1.11877e-15
-1.62048e-15
-2.13419e-15
-2.64547e-15
-3.14094e-15
-3.60764e-15
-4.03621e-15
-4.41913e-15
-4.75221e-15
-5.03384e-15
-5.26405e-15
-5.44289e-15
-5.57654e-15
-5.66787e-15
-5.72242e-15
-5.7449e-15
-5.74048e-15
-5.71495e-15
-5.6728e-15
-5.61603e-15
-5.55166e-15
-5.48008e-15
-5.4073e-15
-5.33488e-15
-5.26559e-15
-5.20126e-15
-5.14349e-15
-5.09382e-15
-5.05418e-15
-5.02133e-15
-4.99838e-15
-4.98583e-15
-4.98087e-15
-4.98062e-15
-4.98426e-15
-4.98763e-15
-4.98646e-15
-4.97689e-15
-1.1714e-16
-3.81297e-16
-6.87515e-16
-1.02874e-15
-1.39482e-15
-1.7736e-15
-2.15367e-15
-2.52403e-15
-2.8758e-15
-3.20039e-15
-3.49288e-15
-3.74925e-15
-3.96765e-15
-4.1487e-15
-4.2938e-15
-4.40444e-15
-4.487e-15
-4.54186e-15
-4.57382e-15
-4.58727e-15
-4.58553e-15
-4.57167e-15
-4.54966e-15
-4.52238e-15
-4.49274e-15
-4.4626e-15
-4.43438e-15
-4.40944e-15
-4.38912e-15
-4.37449e-15
-4.36629e-15
-4.36453e-15
-4.36915e-15
-4.37925e-15
-4.39401e-15
-4.41098e-15
-4.42745e-15
-4.43975e-15
-4.44492e-15
-4.4434e-15
-1.49939e-16
-3.45634e-16
-4.52651e-16
-4.73768e-16
-4.14113e-16
-2.82631e-16
-9.08537e-17
1.44418e-16
4.10424e-16
6.94228e-16
9.83598e-16
1.26846e-15
1.54072e-15
1.7954e-15
2.02892e-15
2.24066e-15
2.43009e-15
2.59893e-15
2.749e-15
2.8833e-15
3.00344e-15
3.11307e-15
3.21429e-15
3.31015e-15
3.40168e-15
3.49206e-15
3.58236e-15
3.67415e-15
3.76742e-15
3.86327e-15
3.96061e-15
4.059e-15
4.15595e-15
4.24955e-15
4.33806e-15
4.41885e-15
4.48955e-15
4.55e-15
4.59651e-15
4.62067e-15
-1.59471e-17
-8.50879e-17
-2.1006e-16
-3.87551e-16
-6.10479e-16
-8.69096e-16
-1.15289e-15
-1.45051e-15
-1.75162e-15
-2.04565e-15
-2.32539e-15
-2.58413e-15
-2.81838e-15
-3.02537e-15
-3.20419e-15
-3.35504e-15
-3.48009e-15
-3.58114e-15
-3.66134e-15
-3.7233e-15
-3.77072e-15
-3.80628e-15
-3.83271e-15
-3.85283e-15
-3.86971e-15
-3.88468e-15
-3.90037e-15
-3.91743e-15
-3.93765e-15
-3.96153e-15
-3.98917e-15
-4.02036e-15
-4.05542e-15
-4.09245e-15
-4.1315e-15
-4.16832e-15
-4.20168e-15
-4.22634e-15
-4.24185e-15
-4.25138e-15
-1.26305e-16
-3.12865e-16
-4.51811e-16
-5.45216e-16
-5.94158e-16
-6.01875e-16
-5.73446e-16
-5.14312e-16
-4.31397e-16
-3.30808e-16
-2.18992e-16
-1.00541e-16
1.97811e-17
1.37616e-16
2.5236e-16
3.62589e-16
4.67591e-16
5.67248e-16
6.61687e-16
7.51451e-16
8.36718e-16
9.18669e-16
9.98192e-16
1.07581e-15
1.15169e-15
1.22656e-15
1.3007e-15
1.37492e-15
1.44853e-15
1.52229e-15
1.59471e-15
1.66586e-15
1.73394e-15
1.79851e-15
1.85745e-15
1.9104e-15
1.956e-15
1.99454e-15
2.02469e-15
2.04381e-15
-9.24793e-17
-2.40299e-16
-3.67793e-16
-4.75544e-16
-5.62842e-16
-6.29901e-16
-6.77591e-16
-7.07387e-16
-7.21384e-16
-7.21787e-16
-7.11518e-16
-6.91709e-16
-6.65019e-16
-6.32469e-16
-5.95401e-16
-5.54563e-16
-5.11486e-16
-4.6616e-16
-4.18896e-16
-3.70428e-16
-3.21389e-16
-2.71182e-16
-2.20673e-16
-1.69371e-16
-1.1836e-16
-6.74835e-17
-1.70799e-17
3.33307e-17
8.20582e-17
1.30441e-16
1.76733e-16
2.21144e-16
2.62331e-16
3.00785e-16
3.34972e-16
3.65217e-16
3.90903e-16
4.13e-16
4.29795e-16
4.42038e-16
6.11061e-18
-2.18272e-18
-4.71212e-17
-1.28186e-16
-2.40821e-16
-3.79225e-16
-5.37104e-16
-7.0772e-16
-8.84668e-16
-1.06175e-15
-1.23391e-15
-1.39675e-15
-1.54736e-15
-1.68345e-15
-1.80413e-15
-1.90896e-15
-1.9982e-15
-2.07279e-15
-2.13457e-15
-2.18542e-15
-2.22442e-15
-2.25587e-15
-2.28154e-15
-2.30227e-15
-2.32027e-15
-2.33663e-15
-2.35374e-15
-2.36975e-15
-2.38589e-15
-2.40478e-15
-2.42632e-15
-2.45e-15
-2.47587e-15
-2.50277e-15
-2.53036e-15
-2.55655e-15
-2.57995e-15
-2.59765e-15
-2.60943e-15
-2.6162e-15
-8.96241e-17
-2.51413e-16
-4.03535e-16
-5.45071e-16
-6.77116e-16
-7.92975e-16
-8.94652e-16
-9.81553e-16
-1.05361e-15
-1.11149e-15
-1.1565e-15
-1.18679e-15
-1.20609e-15
-1.21484e-15
-1.21395e-15
-1.20425e-15
-1.18675e-15
-1.16214e-15
-1.13153e-15
-1.09546e-15
-1.05496e-15
-1.0105e-15
-9.63132e-16
-9.137e-16
-8.63037e-16
-8.11999e-16
-7.58812e-16
-7.06502e-16
-6.55641e-16
-6.06215e-16
-5.59228e-16
-5.14941e-16
-4.74361e-16
-4.37601e-16
-4.05369e-16
-3.77505e-16
-3.54191e-16
-3.35019e-16
-3.21621e-16
-3.14995e-16
-1.01063e-16
-2.9129e-16
-4.7356e-16
-6.44022e-16
-8.02268e-16
-9.4559e-16
-1.07266e-15
-1.18307e-15
-1.2739e-15
-1.34805e-15
-1.40559e-15
-1.44921e-15
-1.47778e-15
-1.49284e-15
-1.49532e-15
-1.48926e-15
-1.47302e-15
-1.44819e-15
-1.41685e-15
-1.37727e-15
-1.33333e-15
-1.28329e-15
-1.23021e-15
-1.1757e-15
-1.1181e-15
-1.05803e-15
-9.99459e-16
-9.39448e-16
-8.82207e-16
-8.24669e-16
-7.70615e-16
-7.19979e-16
-6.73784e-16
-6.32834e-16
-5.95131e-16
-5.64217e-16
-5.37203e-16
-5.1693e-16
-5.01955e-16
-4.93208e-16
-1.36633e-16
-3.90599e-16
-6.21839e-16
-8.31691e-16
-1.01468e-15
-1.16978e-15
-1.29706e-15
-1.39728e-15
-1.47207e-15
-1.52354e-15
-1.55393e-15
-1.56503e-15
-1.56185e-15
-1.54639e-15
-1.51735e-15
-1.47955e-15
-1.43502e-15
-1.38218e-15
-1.32272e-15
-1.25709e-15
-1.18925e-15
-1.11638e-15
-1.04076e-15
-9.61993e-16
-8.81752e-16
-7.99434e-16
-7.15505e-16
-6.33537e-16
-5.51314e-16
-4.69919e-16
-3.90724e-16
-3.1447e-16
-2.42401e-16
-1.75345e-16
-1.1456e-16
-6.05814e-17
-1.39197e-17
2.12788e-17
4.65645e-17
6.02136e-17
-1.35546e-16
-3.85863e-16
-6.11457e-16
-8.10739e-16
-9.81172e-16
-1.12179e-15
-1.23309e-15
-1.31606e-15
-1.37344e-15
-1.40796e-15
-1.42257e-15
-1.42028e-15
-1.40391e-15
-1.37598e-15
-1.33852e-15
-1.29339e-15
-1.24193e-15
-1.18521e-15
-1.12328e-15
-1.05761e-15
-9.88451e-16
-9.15993e-16
-8.41168e-16
-7.63762e-16
-6.84272e-16
-6.02789e-16
-5.20295e-16
-4.36356e-16
-3.51875e-16
-2.67185e-16
-1.83987e-16
-1.02185e-16
-2.29347e-17
5.21842e-17
1.2221e-16
1.83773e-16
2.41403e-16
2.87671e-16
3.20904e-16
3.39369e-16
-3.50558e-18
-1.53576e-17
-3.45048e-17
-6.40298e-17
-1.06061e-16
-1.56502e-16
-2.13863e-16
-2.759e-16
-3.39714e-16
-4.02991e-16
-4.64618e-16
-5.22221e-16
-5.74586e-16
-6.21234e-16
-6.6183e-16
-6.96248e-16
-7.24886e-16
-7.48231e-16
-7.66091e-16
-7.79933e-16
-7.90476e-16
-7.98357e-16
-8.0418e-16
-8.08173e-16
-8.14622e-16
-8.21032e-16
-8.28749e-16
-8.38938e-16
-8.51871e-16
-8.68051e-16
-8.8895e-16
-9.13905e-16
-9.43096e-16
-9.76289e-16
-1.01363e-15
-1.05332e-15
-1.09364e-15
-1.13179e-15
-1.16321e-15
-1.18016e-15
-2.10658e-17
-6.28919e-17
-1.02078e-16
-1.38982e-16
-1.7248e-16
-2.02303e-16
-2.27761e-16
-2.48831e-16
-2.65689e-16
-2.78915e-16
-2.88571e-16
-2.95352e-16
-2.99022e-16
-3.00284e-16
-2.99527e-16
-2.96913e-16
-2.92723e-16
-2.8711e-16
-2.80287e-16
-2.72318e-16
-2.63387e-16
-2.53556e-16
-2.42996e-16
-2.31745e-16
-2.19904e-16
-2.07296e-16
-1.94932e-16
-1.8218e-16
-1.69034e-16
-1.55562e-16
-1.42261e-16
-1.28776e-16
-1.15428e-16
-1.02106e-16
-8.91082e-17
-7.63874e-17
-6.42644e-17
-5.30003e-17
-4.21899e-17
-3.31722e-17
)
;
}
procBoundary4to3
{
type processor;
value nonuniform List<scalar> 10(3.73413e-09 6.55874e-09 3.1365e-09 -1.73311e-09 -4.40596e-09 3.73413e-09 6.55874e-09 3.1365e-09 -1.73311e-09 -4.40596e-09);
}
procBoundary4to5
{
type processor;
value nonuniform List<scalar>
90
(
-5.33387e-09
-5.96916e-09
-3.76168e-09
-1.86565e-09
-1.53212e-10
1.49085e-10
4.5204e-10
7.52951e-10
1.04518e-09
1.32249e-09
1.57942e-09
1.81153e-09
2.01563e-09
2.18986e-09
2.33368e-09
2.44776e-09
2.53376e-09
2.59409e-09
2.63166e-09
2.64958e-09
2.651e-09
2.63893e-09
2.61612e-09
2.58503e-09
2.54779e-09
2.50621e-09
2.46181e-09
2.41588e-09
2.36948e-09
2.32352e-09
2.27877e-09
2.23588e-09
2.19541e-09
2.15785e-09
2.12358e-09
2.09291e-09
2.06605e-09
2.04312e-09
2.02411e-09
2.00889e-09
1.9972e-09
1.98866e-09
1.98261e-09
1.97868e-09
1.97463e-09
-5.33387e-09
-5.96916e-09
-3.76168e-09
-1.86565e-09
-1.53212e-10
1.49085e-10
4.5204e-10
7.52952e-10
1.04518e-09
1.32249e-09
1.57942e-09
1.81153e-09
2.01563e-09
2.18986e-09
2.33368e-09
2.44776e-09
2.53376e-09
2.5941e-09
2.63166e-09
2.64958e-09
2.651e-09
2.63893e-09
2.61612e-09
2.58503e-09
2.54779e-09
2.50621e-09
2.46181e-09
2.41588e-09
2.36948e-09
2.32352e-09
2.27877e-09
2.23588e-09
2.19541e-09
2.15785e-09
2.12358e-09
2.09291e-09
2.06605e-09
2.04312e-09
2.02411e-09
2.00889e-09
1.9972e-09
1.98866e-09
1.98261e-09
1.97868e-09
1.97463e-09
)
;
}
}
// ************************************************************************* //
| [
"39316550+lucpaoli@users.noreply.github.com"
] | 39316550+lucpaoli@users.noreply.github.com | |
ed41d6fc234b3f28924a7b96ade704d965f6dc13 | f1a329fe1ec5ad7766b00e5509d7a3b9ff362700 | /src/currency_core/currency_format_utils.h | 5916212dd8a999bd370d21fa1fe69420158165d5 | [] | no_license | dave-andersen/boolberry | 259033078b9556dba2ad09a4cb2884426507aa66 | 3a5729522e1f8d7ba157435aad6fa4927a6f3d4c | refs/heads/master | 2020-12-25T01:17:16.404467 | 2014-10-19T11:53:45 | 2014-10-19T11:53:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,102 | h | // Copyright (c) 2012-2013 The Cryptonote developers
// Copyright (c) 2012-2013 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "currency_protocol/currency_protocol_defs.h"
#include "currency_core/currency_basic_impl.h"
#include "account.h"
#include "include_base_utils.h"
#include "crypto/crypto.h"
#include "crypto/hash.h"
#include "crypto/wild_keccak.h"
#define MAX_ALIAS_LEN 255
#define VALID_ALIAS_CHARS "0123456789abcdefghijklmnopqrstuvwxyz-."
namespace currency
{
struct tx_source_entry
{
typedef std::pair<uint64_t, crypto::public_key> output_entry;
std::vector<output_entry> outputs; //index + key
uint64_t real_output; //index in outputs vector of real output_entry
crypto::public_key real_out_tx_key; //incoming real tx public key
size_t real_output_in_tx_index; //index in transaction outputs vector
uint64_t amount; //money
};
struct tx_destination_entry
{
uint64_t amount; //money
account_public_address addr; //destination address
tx_destination_entry() : amount(0), addr(AUTO_VAL_INIT(addr)) { }
tx_destination_entry(uint64_t a, const account_public_address &ad) : amount(a), addr(ad) { }
};
struct alias_info_base
{
account_public_address m_address;
crypto::secret_key m_view_key;
crypto::signature m_sign; //is this field set no nonzero - that means update alias operation
std::string m_text_comment;
};
struct alias_info: public alias_info_base
{
std::string m_alias;
};
struct tx_extra_info
{
crypto::public_key m_tx_pub_key;
alias_info m_alias;
std::string m_user_data_blob;
};
//---------------------------------------------------------------
void get_transaction_prefix_hash(const transaction_prefix& tx, crypto::hash& h);
crypto::hash get_transaction_prefix_hash(const transaction_prefix& tx);
bool parse_and_validate_tx_from_blob(const blobdata& tx_blob, transaction& tx, crypto::hash& tx_hash, crypto::hash& tx_prefix_hash);
bool parse_and_validate_tx_from_blob(const blobdata& tx_blob, transaction& tx);
bool get_donation_accounts(account_keys &donation_acc, account_keys &royalty_acc);
bool construct_miner_tx(size_t height, size_t median_size, uint64_t already_generated_coins,
size_t current_block_size,
uint64_t fee,
const account_public_address &miner_address,
transaction& tx,
const blobdata& extra_nonce = blobdata(),
size_t max_outs = 11);
bool construct_miner_tx(size_t height, size_t median_size, uint64_t already_generated_coins,
uint64_t already_donated_coins,
size_t current_block_size,
uint64_t fee,
const account_public_address &miner_address,
const account_public_address &donation_address,
const account_public_address &royalty_address,
transaction& tx,
const blobdata& extra_nonce = blobdata(),
size_t max_outs = 11,
size_t amount_to_donate = 0,
const alias_info& alias = alias_info()
);
//---------------------------------------------------------------
bool construct_tx_out(const account_public_address& destination_addr, const crypto::secret_key& tx_sec_key, size_t output_index, uint64_t amount, transaction& tx, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED);
bool validate_alias_name(const std::string& al);
bool construct_tx(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, transaction& tx, uint64_t unlock_time, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED);
bool construct_tx(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, const std::vector<uint8_t>& extra, transaction& tx, uint64_t unlock_time, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED);
bool sign_update_alias(alias_info& ai, const crypto::public_key& pkey, const crypto::secret_key& skey);
bool make_tx_extra_alias_entry(std::string& buff, const alias_info& alinfo, bool make_buff_to_sign = false);
bool add_tx_extra_alias(transaction& tx, const alias_info& alinfo);
bool parse_and_validate_tx_extra(const transaction& tx, tx_extra_info& extra);
bool parse_and_validate_tx_extra(const transaction& tx, crypto::public_key& tx_pub_key);
crypto::public_key get_tx_pub_key_from_extra(const transaction& tx);
bool add_tx_pub_key_to_extra(transaction& tx, const crypto::public_key& tx_pub_key);
bool add_tx_extra_nonce(transaction& tx, const blobdata& extra_nonce);
bool is_out_to_acc(const account_keys& acc, const txout_to_key& out_key, const crypto::public_key& tx_pub_key, size_t output_index);
bool lookup_acc_outs(const account_keys& acc, const transaction& tx, const crypto::public_key& tx_pub_key, std::vector<size_t>& outs, uint64_t& money_transfered);
bool lookup_acc_outs(const account_keys& acc, const transaction& tx, std::vector<size_t>& outs, uint64_t& money_transfered);
bool get_tx_fee(const transaction& tx, uint64_t & fee);
uint64_t get_tx_fee(const transaction& tx);
bool generate_key_image_helper(const account_keys& ack, const crypto::public_key& tx_public_key, size_t real_output_index, keypair& in_ephemeral, crypto::key_image& ki);
void get_blob_hash(const blobdata& blob, crypto::hash& res);
crypto::hash get_blob_hash(const blobdata& blob);
std::string short_hash_str(const crypto::hash& h);
bool get_block_scratchpad_addendum(const block& b, std::vector<crypto::hash>& res);
bool get_scratchpad_patch(size_t global_start_entry, size_t local_start_entry, size_t local_end_entry, const std::vector<crypto::hash>& scratchpd, std::map<uint64_t, crypto::hash>& patch);
bool push_block_scratchpad_data(const block& b, std::vector<crypto::hash>& scratchpd);
bool push_block_scratchpad_data(size_t global_start_entry, const block& b, std::vector<crypto::hash>& scratchpd, std::map<uint64_t, crypto::hash>& patch);
bool pop_block_scratchpad_data(const block& b, std::vector<crypto::hash>& scratchpd);
bool apply_scratchpad_patch(std::vector<crypto::hash>& scratchpd, std::map<uint64_t, crypto::hash>& patch);
bool is_mixattr_applicable_for_fake_outs_counter(uint8_t mix_attr, uint64_t fake_attr_count);
crypto::hash get_transaction_hash(const transaction& t);
bool get_transaction_hash(const transaction& t, crypto::hash& res);
//bool get_transaction_hash(const transaction& t, crypto::hash& res, size_t& blob_size);
blobdata get_block_hashing_blob(const block& b);
bool get_block_hash(const block& b, crypto::hash& res);
crypto::hash get_block_hash(const block& b);
bool generate_genesis_block(block& bl);
bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b);
bool get_inputs_money_amount(const transaction& tx, uint64_t& money);
uint64_t get_outs_money_amount(const transaction& tx);
bool check_inputs_types_supported(const transaction& tx);
bool check_outs_valid(const transaction& tx);
blobdata get_block_hashing_blob(const block& b);
bool parse_amount(uint64_t& amount, const std::string& str_amount);
bool parse_payment_id_from_hex_str(const std::string& payment_id_str, crypto::hash& payment_id);
bool check_money_overflow(const transaction& tx);
bool check_outs_overflow(const transaction& tx);
bool check_inputs_overflow(const transaction& tx);
uint64_t get_block_height(const block& b);
std::vector<uint64_t> relative_output_offsets_to_absolute(const std::vector<uint64_t>& off);
std::vector<uint64_t> absolute_output_offsets_to_relative(const std::vector<uint64_t>& off);
std::string print_money(uint64_t amount);
std::string dump_scratchpad(const std::vector<crypto::hash>& scr);
std::string dump_patch(const std::map<uint64_t, crypto::hash>& patch);
bool addendum_to_hexstr(const std::vector<crypto::hash>& add, std::string& hex_buff);
bool hexstr_to_addendum(const std::string& hex_buff, std::vector<crypto::hash>& add);
bool set_payment_id_to_tx_extra(std::vector<uint8_t>& extra, const std::string& payment_id);
bool get_payment_id_from_tx_extra(const transaction& tx, std::string& payment_id);
crypto::hash get_blob_longhash(const blobdata& bd, uint64_t height, const std::vector<crypto::hash>& scratchpad);
crypto::hash get_blob_longhash_opt(const blobdata& bd, const std::vector<crypto::hash>& scratchpad);
void print_currency_details();
//---------------------------------------------------------------
template<class payment_id_type>
bool set_payment_id_to_tx_extra(std::vector<uint8_t>& extra, const payment_id_type& payment_id)
{
std::string payment_id_blob;
epee::string_tools::apped_pod_to_strbuff(payment_id_blob, payment_id);
return set_payment_id_to_tx_extra(extra, payment_id_blob);
}
//---------------------------------------------------------------
template<class payment_id_type>
bool get_payment_id_from_tx_extra(const transaction& tx, payment_id_type& payment_id)
{
std::string payment_id_blob;
if(!get_payment_id_from_tx_extra(tx, payment_id_blob))
return false;
if(payment_id_blob.size() != sizeof(payment_id_type))
return false;
payment_id = *reinterpret_cast<const payment_id_type*>(payment_id_blob.data());
return true;
}
//---------------------------------------------------------------
bool get_block_scratchpad_data(const block& b, std::string& res, uint64_t selector);
struct get_scratchpad_param
{
uint64_t selectors[4];
};
//---------------------------------------------------------------
template<typename callback_t>
bool make_scratchpad_from_selector(const get_scratchpad_param& prm, blobdata& bd, uint64_t height, callback_t get_blocks_accessor)
{
/*lets genesis block with mock scratchpad*/
if(!height)
{
bd = "GENESIS";
return true;
}
//lets get two transactions outs
uint64_t index_a = prm.selectors[0]%height;
uint64_t index_b = prm.selectors[1]%height;
block ba = AUTO_VAL_INIT(ba);
block bb = AUTO_VAL_INIT(bb);
bool r = get_blocks_accessor(index_a, ba);
CHECK_AND_ASSERT_MES(r, false, "Failed to get block \"a\" from block accessor, index=" << index_a);
r = get_blocks_accessor(index_a, bb);
CHECK_AND_ASSERT_MES(r, false, "Failed to get block \"b\" from block accessor, index=" << index_b);
r = get_block_scratchpad_data(ba, bd, prm.selectors[2]);
CHECK_AND_ASSERT_MES(r, false, "Failed to get_block_scratchpad_data for a, index=" << index_a);
r = get_block_scratchpad_data(bb, bd, prm.selectors[3]);
CHECK_AND_ASSERT_MES(r, false, "Failed to get_block_scratchpad_data for b, index=" << index_b);
return true;
}
//---------------------------------------------------------------
template<typename callback_t>
bool get_blob_longhash(const blobdata& bd, crypto::hash& res, uint64_t height, callback_t accessor)
{
crypto::wild_keccak_dbl<crypto::mul_f>(reinterpret_cast<const uint8_t*>(bd.data()), bd.size(), reinterpret_cast<uint8_t*>(&res), sizeof(res), [&](crypto::state_t_m& st, crypto::mixin_t& mix)
{
if(!height)
{
memset(&mix, 0, sizeof(mix));
return;
}
#define GET_H(index) accessor(st[index])
for(size_t i = 0; i!=6; i++)
{
*(crypto::hash*)&mix[i*4] = XOR_4(GET_H(i*4), GET_H(i*4+1), GET_H(i*4+2), GET_H(i*4+3));
}
});
return true;
}
//---------------------------------------------------------------
template<typename callback_t>
bool get_block_longhash(const block& b, crypto::hash& res, uint64_t height, callback_t accessor)
{
blobdata bd = get_block_hashing_blob(b);
return get_blob_longhash(bd, res, height, accessor);
}
//---------------------------------------------------------------
template<typename callback_t>
crypto::hash get_block_longhash(const block& b, uint64_t height, callback_t cb)
{
crypto::hash p = null_hash;
get_block_longhash(b, p, height, cb);
return p;
}
//---------------------------------------------------------------
template<class t_object>
bool t_serializable_object_to_blob(const t_object& to, blobdata& b_blob)
{
std::stringstream ss;
binary_archive<true> ba(ss);
bool r = ::serialization::serialize(ba, const_cast<t_object&>(to));
b_blob = ss.str();
return r;
}
//---------------------------------------------------------------
template<class t_object>
blobdata t_serializable_object_to_blob(const t_object& to)
{
blobdata b;
t_serializable_object_to_blob(to, b);
return b;
}
//---------------------------------------------------------------
template<class t_object>
bool get_object_hash(const t_object& o, crypto::hash& res)
{
get_blob_hash(t_serializable_object_to_blob(o), res);
return true;
}
//---------------------------------------------------------------
template<class t_object>
crypto::hash get_object_hash(const t_object& o)
{
crypto::hash h;
get_object_hash(o, h);
return h;
}
//---------------------------------------------------------------
template<class t_object>
size_t get_object_blobsize(const t_object& o)
{
blobdata b = t_serializable_object_to_blob(o);
return b.size();
}
//---------------------------------------------------------------
size_t get_object_blobsize(const transaction& t);
//---------------------------------------------------------------
template<class t_object>
bool get_object_hash(const t_object& o, crypto::hash& res, size_t& blob_size)
{
blobdata bl = t_serializable_object_to_blob(o);
blob_size = bl.size();
get_blob_hash(bl, res);
return true;
}
//---------------------------------------------------------------
template <typename T>
std::string obj_to_json_str(T& obj)
{
std::stringstream ss;
json_archive<true> ar(ss, true);
bool r = ::serialization::serialize(ar, obj);
CHECK_AND_ASSERT_MES(r, "", "obj_to_json_str failed: serialization::serialize returned false");
return ss.str();
}
//---------------------------------------------------------------
// 62387455827 -> 455827 + 7000000 + 80000000 + 300000000 + 2000000000 + 60000000000, where 455827 <= dust_threshold
template<typename chunk_handler_t, typename dust_handler_t>
void decompose_amount_into_digits(uint64_t amount, uint64_t dust_threshold, const chunk_handler_t& chunk_handler, const dust_handler_t& dust_handler)
{
if (0 == amount)
{
return;
}
bool is_dust_handled = false;
uint64_t dust = 0;
uint64_t order = 1;
while (0 != amount)
{
uint64_t chunk = (amount % 10) * order;
amount /= 10;
order *= 10;
if (dust + chunk <= dust_threshold)
{
dust += chunk;
}
else
{
if (!is_dust_handled && 0 != dust)
{
dust_handler(dust);
is_dust_handled = true;
}
if (0 != chunk)
{
chunk_handler(chunk);
}
}
}
if (!is_dust_handled && 0 != dust)
{
dust_handler(dust);
}
}
blobdata block_to_blob(const block& b);
bool block_to_blob(const block& b, blobdata& b_blob);
blobdata tx_to_blob(const transaction& b);
bool tx_to_blob(const transaction& b, blobdata& b_blob);
void get_tx_tree_hash(const std::vector<crypto::hash>& tx_hashes, crypto::hash& h);
crypto::hash get_tx_tree_hash(const std::vector<crypto::hash>& tx_hashes);
crypto::hash get_tx_tree_hash(const block& b);
#define CHECKED_GET_SPECIFIC_VARIANT(variant_var, specific_type, variable_name, fail_return_val) \
CHECK_AND_ASSERT_MES(variant_var.type() == typeid(specific_type), fail_return_val, "wrong variant type: " << variant_var.type().name() << ", expected " << typeid(specific_type).name()); \
specific_type& variable_name = boost::get<specific_type>(variant_var);
}
| [
"crypto.zoidberg@gmail.com"
] | crypto.zoidberg@gmail.com |
ffa0e06e71cf769a549d5ec6ee9abc5277a37eae | 9bbde5ca23415e230da40de1f1b4e11fb0f2154d | /rflib/ipc/RFProtocolFactory.cc | 11bfe2678b793e355d5fa66b52a391bdd5ae69ce | [] | no_license | rogerscristo/IPTables-RouteFlow | 2d9f6705c3cd0fb4471901c4092f9b8c0abc04ed | 10b5a83ac9d62ff590962730e8c0acd230e201eb | refs/heads/master | 2021-01-19T08:08:46.901507 | 2017-01-13T04:27:49 | 2017-01-13T04:27:49 | 21,546,882 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 870 | cc | #include "RFProtocolFactory.h"
IPCMessage* RFProtocolFactory::buildForType(int type) {
switch (type) {
case PORT_REGISTER:
return new PortRegister();
case PORT_CONFIG:
return new PortConfig();
case DATAPATH_PORT_REGISTER:
return new DatapathPortRegister();
case DATAPATH_DOWN:
return new DatapathDown();
case VIRTUAL_PLANE_MAP:
return new VirtualPlaneMap();
case DATA_PLANE_MAP:
return new DataPlaneMap();
case ROUTE_MOD:
return new RouteMod();
case SUSPECT_FLOW:
return new SuspectFlow();
case IPTABLES_REGISTER:
return new IptablesRegister();
case IPTABLES_REGISTER_DYNAMIC:
return new IptablesRegisterDynamic();
default:
return NULL;
}
}
| [
"krigisk@gmail.com"
] | krigisk@gmail.com |
1d59840b1a36bb7d984e947ba32623fca3201b4a | 401bfdd4c6426e9ca7e10dc76d363c9a96da1549 | /Element.h | dbd4ee81bdba25caf594ac8c206ae2cc2e0b14e3 | [] | no_license | aaronmsc/MoM | 38f56ad1043c0da5c618ca1b87609ed8b7d52036 | f53ff9bd957dbd635953d8be72cb329db173c4f5 | refs/heads/master | 2020-04-08T13:03:17.485336 | 2018-05-12T12:37:24 | 2018-05-12T12:37:24 | 159,373,138 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,339 | h | #ifndef _ELEMENT_H_
#define _ELEMENT_H_
#include <vector>
#include <armadillo>
#include "Typedef.h"
#include "EMOption.h"
#include "uniform_func.h"
namespace mom
{
class Port;
class Element
{
private:
// index of the element
int index;
// Coordinate of vertex of the element
std::vector<arma::vec3> element_vertex;
arma::vec3 center_point;
// if on port, pointer of the port
const Port *port;
std::vector<arma::vec3> gauss_points;
std::vector<real> gauss_weight;
std::vector<arma::vec3> diff_gauss_points;
std::vector<real> diff_gauss_weight;
static bool init_flag;
static double sym_gauss_weight_tet[9][100];
static double sym_gauss_coord_tet[9][4][100];
static int num_sym_gauss_nodes_tet[9];
static void GenerateWeightsAndCoordinatesForSymGaussianQuadrature();
public:
//Element();
Element(int index, const std::vector<arma::vec3> &element_vertex, const Port *port = nullptr);
~Element();
std::vector<bool> visited;
// Get the values of the member variables
int GetIndex() const;
void SetIndex(int SetIndex) { this->index = SetIndex; }
std::vector<arma::vec3> &GetVertex();
arma::vec3 GetCenter()const { return this->center_point; }
arma::vec3 GetCenter() { return this->center_point; }
void Show()
{
for (size_t i = 0; i < static_cast<int>(this->element_vertex.size()); i++) {
std::cout << "Vertex[" << i << "]: (" << element_vertex[i][0] << " , " << element_vertex[i][1] << " , " << element_vertex[i][2] << ")" << std::endl;
}
std::cout << std::endl;
}
const Port *GetPort() const;
void SetPort(const Port *port);
const std::vector<arma::vec3> &GetGaussPoint() const;
const std::vector<real> &GetGaussWeight() const;
const std::vector<arma::vec3> &GetDiffGaussPoint() const;
const std::vector<real> &GetDiffGaussWeight() const;
void convertLengthUnit(Unit from, Unit to);
arma::vec3 GetPointByParam(real u0, real u1, real u2) const;
arma::vec3 GetPointByParam(real u0, real u1, real u2, real u3) const;
};
}
#endif // _ELEMENT_H_INCLUDED_
| [
"dingxiaoqiyx@sina.com"
] | dingxiaoqiyx@sina.com |
c38d19bbb006b21f02b8eaa4c59b89baf155b4ea | c676bb921ca046f2216d1cd1011ca02136c93654 | /chess/GUI.cpp | 31c478b27a588486b5425cf8335bf3d6a8d9100f | [
"Apache-2.0"
] | permissive | Rexagon/chess | b25f9a4ca84d9b19dcca615d924a8f6b6511790f | fcb8933ec13263893ad12d06b29448db3bc0fc9b | refs/heads/master | 2021-01-15T08:13:27.123041 | 2017-09-02T18:38:00 | 2017-09-02T18:38:00 | 99,559,016 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 5,565 | cpp | #include "GUI.h"
#include <stack>
#include "Core.h"
GUI::GUI() :
m_current_focused_item(nullptr), m_current_hovered_item(nullptr), m_current_pressed_item(nullptr)
{
sf::Vector2u windowSize = Core::get_window()->getSize();
m_root_widget = create<Widget>();
m_root_widget->set_position(0.0f, 0.0f);
m_root_widget->set_size(static_cast<float>(windowSize.x), static_cast<float>(windowSize.y));
m_root_widget->set_layout(new Layout);
}
GUI::~GUI()
{
m_current_focused_item.reset();
m_current_hovered_item.reset();
m_current_pressed_item.reset();
m_root_widget.reset();
}
void GUI::update(const float dt)
{
std::shared_ptr<Widget> hovered_item;
std::stack<Widget*> widgets;
widgets.push(m_root_widget.get());
while (!widgets.empty()) {
Widget* widget = widgets.top();
widgets.pop();
if (widget != nullptr && widget->m_layout != nullptr) {
for (unsigned int i = 0; i < widget->m_layout->m_ordered_widgets.size(); ++i) {
auto& child = widget->m_layout->m_ordered_widgets[i];
if (i == 0) {
widget->m_layout->update();
}
if (child != nullptr) {
if (child->get_rect().contains(Input::get_mouse_position()) &&
child->is_visible())
{
hovered_item = child;
}
child->on_update(dt);
widgets.push(child.get());
}
}
}
}
hover_item(hovered_item);
// обработка нажатия
if (Input::get_mouse_down(MouseButton::Left) &&
m_current_hovered_item != nullptr && m_current_hovered_item->is_enabled())
{
// двигаем нажатый элемент наверх по Z
if (m_current_hovered_item->m_parent != nullptr && m_current_hovered_item->m_parent->m_layout != nullptr) {
int item_index = m_current_hovered_item->m_parent->m_layout->index_of(m_current_hovered_item);
if (item_index > -1) {
auto& orderedWidgets = m_current_hovered_item->get_parent()->m_layout->m_ordered_widgets;
std::rotate(orderedWidgets.begin() + item_index, orderedWidgets.begin() + item_index + 1, orderedWidgets.end());
}
}
press_item(m_current_hovered_item);
focus_item(m_current_pressed_item);
}
if (Input::get_mouse_up(MouseButton::Left) &&
m_current_pressed_item != nullptr)
{
press_item(nullptr);
}
if (Input::get_key_down(Key::Return)) {
press_item(m_current_focused_item);
}
else if (Input::get_key_up(Key::Return)) {
press_item(nullptr);
}
}
void GUI::handle_input(const sf::Event & event)
{
TextBox* current_textbox = nullptr;
if (m_current_focused_item != nullptr &&
m_current_focused_item->get_type() == WidgetType::TextBoxWidget)
{
current_textbox = reinterpret_cast<TextBox*>(m_current_focused_item.get());
}
switch (event.type) {
case sf::Event::KeyPressed:
if (current_textbox != nullptr &&
event.key.code >= Key::Left && event.key.code <= Key::Down)
{
current_textbox->handle_text_enter(event.key.code - 70); // 71-74 to ascii 1-4
}
break;
case sf::Event::TextEntered:
if (current_textbox != nullptr)
{
current_textbox->handle_text_enter(event.text.unicode);
}
break;
}
}
void GUI::draw()
{
std::stack<Widget*> widgets;
widgets.push(m_root_widget.get());
while (!widgets.empty()) {
Widget* widget = widgets.top();
widgets.pop();
if (widget != nullptr && widget->m_layout != nullptr) {
for (auto& child : widget->m_layout->m_ordered_widgets) {
if (child != nullptr) {
child->on_draw();
widgets.push(child.get());
}
}
}
}
}
std::shared_ptr<Widget> GUI::get_element(const vec2 & screen_position)
{
std::shared_ptr<Widget> hovered_item;
std::stack<Widget*> widgets;
widgets.push(m_root_widget.get());
while (!widgets.empty()) {
Widget* widget = widgets.top();
widgets.pop();
if (widget != nullptr && widget->m_layout != nullptr) {
for (auto& child : widget->m_layout->m_ordered_widgets) {
if (child != nullptr) {
if (child->get_rect().contains(Input::get_mouse_position()) &&
child->is_visible())
{
hovered_item = child;
}
widgets.push(child.get());
}
}
}
}
return hovered_item;
}
void GUI::prepare_deleting(Widget* widget)
{
if (widget == m_current_focused_item.get()) {
m_current_focused_item.reset();
}
if (widget == m_current_hovered_item.get()) {
m_current_hovered_item.reset();
}
if (widget == m_current_pressed_item.get()) {
m_current_pressed_item.reset();
}
}
void GUI::press_item(std::shared_ptr<Widget> item)
{
if (m_current_pressed_item == item) return;
if (m_current_pressed_item != nullptr) {
m_current_pressed_item->m_is_pressed = false;
m_current_pressed_item->trigger(Widget::Action::Release);
}
if (item != nullptr) {
item->m_is_pressed = true;
item->trigger(Widget::Action::Press);
}
m_current_pressed_item = item;
}
void GUI::focus_item(std::shared_ptr<Widget> item)
{
if (m_current_focused_item == item) return;
if (m_current_focused_item != nullptr) {
m_current_focused_item->trigger(Widget::Action::Unfocus);
m_current_focused_item->m_is_focused = false;
}
if (item != nullptr) {
item->trigger(Widget::Action::Focus);
item->m_is_focused = true;
}
m_current_focused_item = item;
}
void GUI::hover_item(std::shared_ptr<Widget> item)
{
if (m_current_hovered_item == item) return;
if (m_current_hovered_item != nullptr) {
m_current_hovered_item->trigger(Widget::Action::Unhover);
m_current_hovered_item->m_is_hovered = false;
}
if (item != nullptr) {
item->trigger(Widget::Action::Hover);
item->m_is_hovered = true;
}
m_current_hovered_item = item;
}
| [
"reide740@gmail.com"
] | reide740@gmail.com |
e6aa7c824d6496d5d9a1d65e64fa0c2c7bcf9d21 | 1302a788aa73d8da772c6431b083ddd76eef937f | /WORKING_DIRECTORY/frameworks/native/libs/gui/IGraphicBufferProducer.cpp | f4ba3bf15fb7f19d7d1106c71bd2c314048eb639 | [
"LicenseRef-scancode-unicode",
"Apache-2.0"
] | permissive | rockduan/androidN-android-7.1.1_r28 | b3c1bcb734225aa7813ab70639af60c06d658bf6 | 10bab435cd61ffa2e93a20c082624954c757999d | refs/heads/master | 2021-01-23T03:54:32.510867 | 2017-03-30T07:17:08 | 2017-03-30T07:17:08 | 86,135,431 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 30,244 | cpp | /*
* Copyright (C) 2010 The Android Open Source Project
*
* 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 <stdint.h>
#include <sys/types.h>
#include <utils/Errors.h>
#include <utils/NativeHandle.h>
#include <utils/RefBase.h>
#include <utils/Timers.h>
#include <utils/Vector.h>
#include <binder/Parcel.h>
#include <binder/IInterface.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/IProducerListener.h>
namespace android {
// ----------------------------------------------------------------------------
enum {
REQUEST_BUFFER = IBinder::FIRST_CALL_TRANSACTION,
DEQUEUE_BUFFER,
DETACH_BUFFER,
DETACH_NEXT_BUFFER,
ATTACH_BUFFER,
QUEUE_BUFFER,
CANCEL_BUFFER,
QUERY,
CONNECT,
DISCONNECT,
SET_SIDEBAND_STREAM,
ALLOCATE_BUFFERS,
ALLOW_ALLOCATION,
SET_GENERATION_NUMBER,
GET_CONSUMER_NAME,
SET_MAX_DEQUEUED_BUFFER_COUNT,
SET_ASYNC_MODE,
SET_SHARED_BUFFER_MODE,
SET_AUTO_REFRESH,
SET_DEQUEUE_TIMEOUT,
GET_LAST_QUEUED_BUFFER,
GET_FRAME_TIMESTAMPS,
GET_UNIQUE_ID
};
class BpGraphicBufferProducer : public BpInterface<IGraphicBufferProducer>
{
public:
BpGraphicBufferProducer(const sp<IBinder>& impl)
: BpInterface<IGraphicBufferProducer>(impl)
{
}
virtual ~BpGraphicBufferProducer();
virtual status_t requestBuffer(int bufferIdx, sp<GraphicBuffer>* buf) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(bufferIdx);
status_t result =remote()->transact(REQUEST_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
bool nonNull = reply.readInt32();
if (nonNull) {
*buf = new GraphicBuffer();
result = reply.read(**buf);
if(result != NO_ERROR) {
(*buf).clear();
return result;
}
}
result = reply.readInt32();
return result;
}
virtual status_t setMaxDequeuedBufferCount(int maxDequeuedBuffers) {
Parcel data, reply;
data.writeInterfaceToken(
IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(maxDequeuedBuffers);
status_t result = remote()->transact(SET_MAX_DEQUEUED_BUFFER_COUNT,
data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual status_t setAsyncMode(bool async) {
Parcel data, reply;
data.writeInterfaceToken(
IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(async);
status_t result = remote()->transact(SET_ASYNC_MODE,
data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence, uint32_t width,
uint32_t height, PixelFormat format, uint32_t usage) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeUint32(width);
data.writeUint32(height);
data.writeInt32(static_cast<int32_t>(format));
data.writeUint32(usage);
status_t result = remote()->transact(DEQUEUE_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
*buf = reply.readInt32();
bool nonNull = reply.readInt32();
if (nonNull) {
*fence = new Fence();
result = reply.read(**fence);
if (result != NO_ERROR) {
fence->clear();
return result;
}
}
result = reply.readInt32();
return result;
}
virtual status_t detachBuffer(int slot) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(slot);
status_t result = remote()->transact(DETACH_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual status_t detachNextBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence) {
if (outBuffer == NULL) {
ALOGE("detachNextBuffer: outBuffer must not be NULL");
return BAD_VALUE;
} else if (outFence == NULL) {
ALOGE("detachNextBuffer: outFence must not be NULL");
return BAD_VALUE;
}
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
status_t result = remote()->transact(DETACH_NEXT_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
if (result == NO_ERROR) {
bool nonNull = reply.readInt32();
if (nonNull) {
*outBuffer = new GraphicBuffer;
result = reply.read(**outBuffer);
if (result != NO_ERROR) {
outBuffer->clear();
return result;
}
}
nonNull = reply.readInt32();
if (nonNull) {
*outFence = new Fence;
result = reply.read(**outFence);
if (result != NO_ERROR) {
outBuffer->clear();
outFence->clear();
return result;
}
}
}
return result;
}
virtual status_t attachBuffer(int* slot, const sp<GraphicBuffer>& buffer) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.write(*buffer.get());
status_t result = remote()->transact(ATTACH_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
*slot = reply.readInt32();
result = reply.readInt32();
return result;
}
virtual status_t queueBuffer(int buf,
const QueueBufferInput& input, QueueBufferOutput* output) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(buf);
data.write(input);
status_t result = remote()->transact(QUEUE_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
memcpy(output, reply.readInplace(sizeof(*output)), sizeof(*output));
result = reply.readInt32();
return result;
}
virtual status_t cancelBuffer(int buf, const sp<Fence>& fence) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(buf);
data.write(*fence.get());
status_t result = remote()->transact(CANCEL_BUFFER, data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual int query(int what, int* value) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(what);
status_t result = remote()->transact(QUERY, data, &reply);
if (result != NO_ERROR) {
return result;
}
value[0] = reply.readInt32();
result = reply.readInt32();
return result;
}
virtual status_t connect(const sp<IProducerListener>& listener,
int api, bool producerControlledByApp, QueueBufferOutput* output) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
if (listener != NULL) {
data.writeInt32(1);
data.writeStrongBinder(IInterface::asBinder(listener));
} else {
data.writeInt32(0);
}
data.writeInt32(api);
data.writeInt32(producerControlledByApp);
status_t result = remote()->transact(CONNECT, data, &reply);
if (result != NO_ERROR) {
return result;
}
memcpy(output, reply.readInplace(sizeof(*output)), sizeof(*output));
result = reply.readInt32();
return result;
}
virtual status_t disconnect(int api, DisconnectMode mode) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(api);
data.writeInt32(static_cast<int32_t>(mode));
status_t result =remote()->transact(DISCONNECT, data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual status_t setSidebandStream(const sp<NativeHandle>& stream) {
Parcel data, reply;
status_t result;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
if (stream.get()) {
data.writeInt32(true);
data.writeNativeHandle(stream->handle());
} else {
data.writeInt32(false);
}
if ((result = remote()->transact(SET_SIDEBAND_STREAM, data, &reply)) == NO_ERROR) {
result = reply.readInt32();
}
return result;
}
virtual void allocateBuffers(uint32_t width, uint32_t height,
PixelFormat format, uint32_t usage) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeUint32(width);
data.writeUint32(height);
data.writeInt32(static_cast<int32_t>(format));
data.writeUint32(usage);
status_t result = remote()->transact(ALLOCATE_BUFFERS, data, &reply);
if (result != NO_ERROR) {
ALOGE("allocateBuffers failed to transact: %d", result);
}
}
virtual status_t allowAllocation(bool allow) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(static_cast<int32_t>(allow));
status_t result = remote()->transact(ALLOW_ALLOCATION, data, &reply);
if (result != NO_ERROR) {
return result;
}
result = reply.readInt32();
return result;
}
virtual status_t setGenerationNumber(uint32_t generationNumber) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeUint32(generationNumber);
status_t result = remote()->transact(SET_GENERATION_NUMBER, data, &reply);
if (result == NO_ERROR) {
result = reply.readInt32();
}
return result;
}
virtual String8 getConsumerName() const {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
status_t result = remote()->transact(GET_CONSUMER_NAME, data, &reply);
if (result != NO_ERROR) {
ALOGE("getConsumerName failed to transact: %d", result);
return String8("TransactFailed");
}
return reply.readString8();
}
virtual status_t setSharedBufferMode(bool sharedBufferMode) {
Parcel data, reply;
data.writeInterfaceToken(
IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(sharedBufferMode);
status_t result = remote()->transact(SET_SHARED_BUFFER_MODE, data,
&reply);
if (result == NO_ERROR) {
result = reply.readInt32();
}
return result;
}
virtual status_t setAutoRefresh(bool autoRefresh) {
Parcel data, reply;
data.writeInterfaceToken(
IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt32(autoRefresh);
status_t result = remote()->transact(SET_AUTO_REFRESH, data, &reply);
if (result == NO_ERROR) {
result = reply.readInt32();
}
return result;
}
virtual status_t setDequeueTimeout(nsecs_t timeout) {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
data.writeInt64(timeout);
status_t result = remote()->transact(SET_DEQUEUE_TIMEOUT, data, &reply);
if (result != NO_ERROR) {
ALOGE("setDequeueTimeout failed to transact: %d", result);
return result;
}
return reply.readInt32();
}
virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer,
sp<Fence>* outFence, float outTransformMatrix[16]) override {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
status_t result = remote()->transact(GET_LAST_QUEUED_BUFFER, data,
&reply);
if (result != NO_ERROR) {
ALOGE("getLastQueuedBuffer failed to transact: %d", result);
return result;
}
result = reply.readInt32();
if (result != NO_ERROR) {
return result;
}
bool hasBuffer = reply.readBool();
sp<GraphicBuffer> buffer;
if (hasBuffer) {
buffer = new GraphicBuffer();
result = reply.read(*buffer);
if (result == NO_ERROR) {
result = reply.read(outTransformMatrix, sizeof(float) * 16);
}
}
if (result != NO_ERROR) {
ALOGE("getLastQueuedBuffer failed to read buffer: %d", result);
return result;
}
sp<Fence> fence(new Fence);
result = reply.read(*fence);
if (result != NO_ERROR) {
ALOGE("getLastQueuedBuffer failed to read fence: %d", result);
return result;
}
*outBuffer = buffer;
*outFence = fence;
return result;
}
virtual bool getFrameTimestamps(uint64_t frameNumber,
FrameTimestamps* outTimestamps) const {
Parcel data, reply;
status_t result = data.writeInterfaceToken(
IGraphicBufferProducer::getInterfaceDescriptor());
if (result != NO_ERROR) {
ALOGE("getFrameTimestamps failed to write token: %d", result);
return false;
}
result = data.writeUint64(frameNumber);
if (result != NO_ERROR) {
ALOGE("getFrameTimestamps failed to write: %d", result);
return false;
}
result = remote()->transact(GET_FRAME_TIMESTAMPS, data, &reply);
if (result != NO_ERROR) {
ALOGE("getFrameTimestamps failed to transact: %d", result);
return false;
}
bool found = false;
result = reply.readBool(&found);
if (result != NO_ERROR) {
ALOGE("getFrameTimestamps failed to read: %d", result);
return false;
}
if (found) {
result = reply.read(*outTimestamps);
if (result != NO_ERROR) {
ALOGE("getFrameTimestamps failed to read timestamps: %d",
result);
return false;
}
}
return found;
}
virtual status_t getUniqueId(uint64_t* outId) const {
Parcel data, reply;
data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
status_t result = remote()->transact(GET_UNIQUE_ID, data, &reply);
if (result != NO_ERROR) {
ALOGE("getUniqueId failed to transact: %d", result);
}
status_t actualResult = NO_ERROR;
result = reply.readInt32(&actualResult);
if (result != NO_ERROR) {
return result;
}
result = reply.readUint64(outId);
if (result != NO_ERROR) {
return result;
}
return actualResult;
}
};
// Out-of-line virtual method definition to trigger vtable emission in this
// translation unit (see clang warning -Wweak-vtables)
BpGraphicBufferProducer::~BpGraphicBufferProducer() {}
IMPLEMENT_META_INTERFACE(GraphicBufferProducer, "android.gui.IGraphicBufferProducer");
// ----------------------------------------------------------------------
status_t BnGraphicBufferProducer::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case REQUEST_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int bufferIdx = data.readInt32();
sp<GraphicBuffer> buffer;
int result = requestBuffer(bufferIdx, &buffer);
reply->writeInt32(buffer != 0);
if (buffer != 0) {
reply->write(*buffer);
}
reply->writeInt32(result);
return NO_ERROR;
}
case SET_MAX_DEQUEUED_BUFFER_COUNT: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int maxDequeuedBuffers = data.readInt32();
int result = setMaxDequeuedBufferCount(maxDequeuedBuffers);
reply->writeInt32(result);
return NO_ERROR;
}
case SET_ASYNC_MODE: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
bool async = data.readInt32();
int result = setAsyncMode(async);
reply->writeInt32(result);
return NO_ERROR;
}
case DEQUEUE_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
uint32_t width = data.readUint32();
uint32_t height = data.readUint32();
PixelFormat format = static_cast<PixelFormat>(data.readInt32());
uint32_t usage = data.readUint32();
int buf = 0;
sp<Fence> fence;
int result = dequeueBuffer(&buf, &fence, width, height, format,
usage);
reply->writeInt32(buf);
reply->writeInt32(fence != NULL);
if (fence != NULL) {
reply->write(*fence);
}
reply->writeInt32(result);
return NO_ERROR;
}
case DETACH_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int slot = data.readInt32();
int result = detachBuffer(slot);
reply->writeInt32(result);
return NO_ERROR;
}
case DETACH_NEXT_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<GraphicBuffer> buffer;
sp<Fence> fence;
int32_t result = detachNextBuffer(&buffer, &fence);
reply->writeInt32(result);
if (result == NO_ERROR) {
reply->writeInt32(buffer != NULL);
if (buffer != NULL) {
reply->write(*buffer);
}
reply->writeInt32(fence != NULL);
if (fence != NULL) {
reply->write(*fence);
}
}
return NO_ERROR;
}
case ATTACH_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<GraphicBuffer> buffer = new GraphicBuffer();
status_t result = data.read(*buffer.get());
int slot = 0;
if (result == NO_ERROR) {
result = attachBuffer(&slot, buffer);
}
reply->writeInt32(slot);
reply->writeInt32(result);
return NO_ERROR;
}
case QUEUE_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int buf = data.readInt32();
QueueBufferInput input(data);
QueueBufferOutput* const output =
reinterpret_cast<QueueBufferOutput *>(
reply->writeInplace(sizeof(QueueBufferOutput)));
memset(output, 0, sizeof(QueueBufferOutput));
status_t result = queueBuffer(buf, input, output);
reply->writeInt32(result);
return NO_ERROR;
}
case CANCEL_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int buf = data.readInt32();
sp<Fence> fence = new Fence();
status_t result = data.read(*fence.get());
if (result == NO_ERROR) {
result = cancelBuffer(buf, fence);
}
reply->writeInt32(result);
return NO_ERROR;
}
case QUERY: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int value = 0;
int what = data.readInt32();
int res = query(what, &value);
reply->writeInt32(value);
reply->writeInt32(res);
return NO_ERROR;
}
case CONNECT: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<IProducerListener> listener;
if (data.readInt32() == 1) {
listener = IProducerListener::asInterface(data.readStrongBinder());
}
int api = data.readInt32();
bool producerControlledByApp = data.readInt32();
QueueBufferOutput* const output =
reinterpret_cast<QueueBufferOutput *>(
reply->writeInplace(sizeof(QueueBufferOutput)));
memset(output, 0, sizeof(QueueBufferOutput));
status_t res = connect(listener, api, producerControlledByApp, output);
reply->writeInt32(res);
return NO_ERROR;
}
case DISCONNECT: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
int api = data.readInt32();
DisconnectMode mode = static_cast<DisconnectMode>(data.readInt32());
status_t res = disconnect(api, mode);
reply->writeInt32(res);
return NO_ERROR;
}
case SET_SIDEBAND_STREAM: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<NativeHandle> stream;
if (data.readInt32()) {
stream = NativeHandle::create(data.readNativeHandle(), true);
}
status_t result = setSidebandStream(stream);
reply->writeInt32(result);
return NO_ERROR;
}
case ALLOCATE_BUFFERS: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
uint32_t width = data.readUint32();
uint32_t height = data.readUint32();
PixelFormat format = static_cast<PixelFormat>(data.readInt32());
uint32_t usage = data.readUint32();
allocateBuffers(width, height, format, usage);
return NO_ERROR;
}
case ALLOW_ALLOCATION: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
bool allow = static_cast<bool>(data.readInt32());
status_t result = allowAllocation(allow);
reply->writeInt32(result);
return NO_ERROR;
}
case SET_GENERATION_NUMBER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
uint32_t generationNumber = data.readUint32();
status_t result = setGenerationNumber(generationNumber);
reply->writeInt32(result);
return NO_ERROR;
}
case GET_CONSUMER_NAME: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
reply->writeString8(getConsumerName());
return NO_ERROR;
}
case SET_SHARED_BUFFER_MODE: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
bool sharedBufferMode = data.readInt32();
status_t result = setSharedBufferMode(sharedBufferMode);
reply->writeInt32(result);
return NO_ERROR;
}
case SET_AUTO_REFRESH: {
CHECK_INTERFACE(IGraphicBuffer, data, reply);
bool autoRefresh = data.readInt32();
status_t result = setAutoRefresh(autoRefresh);
reply->writeInt32(result);
return NO_ERROR;
}
case SET_DEQUEUE_TIMEOUT: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
nsecs_t timeout = data.readInt64();
status_t result = setDequeueTimeout(timeout);
reply->writeInt32(result);
return NO_ERROR;
}
case GET_LAST_QUEUED_BUFFER: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
sp<GraphicBuffer> buffer(nullptr);
sp<Fence> fence(Fence::NO_FENCE);
float transform[16] = {};
status_t result = getLastQueuedBuffer(&buffer, &fence, transform);
reply->writeInt32(result);
if (result != NO_ERROR) {
return result;
}
if (!buffer.get()) {
reply->writeBool(false);
} else {
reply->writeBool(true);
result = reply->write(*buffer);
if (result == NO_ERROR) {
reply->write(transform, sizeof(float) * 16);
}
}
if (result != NO_ERROR) {
ALOGE("getLastQueuedBuffer failed to write buffer: %d", result);
return result;
}
result = reply->write(*fence);
if (result != NO_ERROR) {
ALOGE("getLastQueuedBuffer failed to write fence: %d", result);
return result;
}
return NO_ERROR;
}
case GET_FRAME_TIMESTAMPS: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
uint64_t frameNumber = 0;
status_t result = data.readUint64(&frameNumber);
if (result != NO_ERROR) {
ALOGE("onTransact failed to read: %d", result);
return result;
}
FrameTimestamps timestamps;
bool found = getFrameTimestamps(frameNumber, ×tamps);
result = reply->writeBool(found);
if (result != NO_ERROR) {
ALOGE("onTransact failed to write: %d", result);
return result;
}
if (found) {
result = reply->write(timestamps);
if (result != NO_ERROR) {
ALOGE("onTransact failed to write timestamps: %d", result);
return result;
}
}
return NO_ERROR;
}
case GET_UNIQUE_ID: {
CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
uint64_t outId = 0;
status_t actualResult = getUniqueId(&outId);
status_t result = reply->writeInt32(actualResult);
if (result != NO_ERROR) {
return result;
}
result = reply->writeUint64(outId);
if (result != NO_ERROR) {
return result;
}
return NO_ERROR;
}
}
return BBinder::onTransact(code, data, reply, flags);
}
// ----------------------------------------------------------------------------
IGraphicBufferProducer::QueueBufferInput::QueueBufferInput(const Parcel& parcel) {
parcel.read(*this);
}
size_t IGraphicBufferProducer::QueueBufferInput::getFlattenedSize() const {
return sizeof(timestamp)
+ sizeof(isAutoTimestamp)
+ sizeof(dataSpace)
+ sizeof(crop)
+ sizeof(scalingMode)
+ sizeof(transform)
+ sizeof(stickyTransform)
+ fence->getFlattenedSize()
+ surfaceDamage.getFlattenedSize();
}
size_t IGraphicBufferProducer::QueueBufferInput::getFdCount() const {
return fence->getFdCount();
}
status_t IGraphicBufferProducer::QueueBufferInput::flatten(
void*& buffer, size_t& size, int*& fds, size_t& count) const
{
if (size < getFlattenedSize()) {
return NO_MEMORY;
}
FlattenableUtils::write(buffer, size, timestamp);
FlattenableUtils::write(buffer, size, isAutoTimestamp);
FlattenableUtils::write(buffer, size, dataSpace);
FlattenableUtils::write(buffer, size, crop);
FlattenableUtils::write(buffer, size, scalingMode);
FlattenableUtils::write(buffer, size, transform);
FlattenableUtils::write(buffer, size, stickyTransform);
status_t result = fence->flatten(buffer, size, fds, count);
if (result != NO_ERROR) {
return result;
}
return surfaceDamage.flatten(buffer, size);
}
status_t IGraphicBufferProducer::QueueBufferInput::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count)
{
size_t minNeeded =
sizeof(timestamp)
+ sizeof(isAutoTimestamp)
+ sizeof(dataSpace)
+ sizeof(crop)
+ sizeof(scalingMode)
+ sizeof(transform)
+ sizeof(stickyTransform);
if (size < minNeeded) {
return NO_MEMORY;
}
FlattenableUtils::read(buffer, size, timestamp);
FlattenableUtils::read(buffer, size, isAutoTimestamp);
FlattenableUtils::read(buffer, size, dataSpace);
FlattenableUtils::read(buffer, size, crop);
FlattenableUtils::read(buffer, size, scalingMode);
FlattenableUtils::read(buffer, size, transform);
FlattenableUtils::read(buffer, size, stickyTransform);
fence = new Fence();
status_t result = fence->unflatten(buffer, size, fds, count);
if (result != NO_ERROR) {
return result;
}
return surfaceDamage.unflatten(buffer, size);
}
}; // namespace android
| [
"duanliangsilence@gmail.com"
] | duanliangsilence@gmail.com |
f78cce8792186f83ae03deb1d52954910d5858ff | 349fe789ab1e4e46aae6812cf60ada9423c0b632 | /ComClasses/DLL/Devices/Viki/UkasVikiImpl.h | 88ce3811a7fef142d9b9c3aa8c56120c71bb9632 | [] | no_license | presscad/ERP | a6acdaeb97b3a53f776677c3a585ca860d4de980 | 18ecc6c8664ed7fc3f01397d587cce91fc3ac78b | refs/heads/master | 2020-08-22T05:24:15.449666 | 2019-07-12T12:59:13 | 2019-07-12T12:59:13 | 216,326,440 | 1 | 0 | null | 2019-10-20T07:52:26 | 2019-10-20T07:52:26 | null | UTF-8 | C++ | false | false | 3,301 | h | //---------------------------------------------------------------------------
#ifndef UkasVikiImplH
#define UkasVikiImplH
//---------------------------------------------------------------------------
#include "IFiskReg.h"
#include "UkasVikiFR.h"
//---------------------------------------------------------------
class __declspec(uuid(Global_CLSID_TkasVikiFRImpl)) TkasVikiFRImpl : public IFiskReg
{
public:
TkasVikiFRImpl();
~TkasVikiFRImpl();
TkasVikiFR * Object;
int NumRefs;
bool flDeleteObject;
void DeleteImpl(void);
//IUnknown
virtual int kanQueryInterface(REFIID id_interface,void ** ppv);
virtual int kanAddRef(void);
virtual int kanRelease(void);
//IMainInterface
virtual int get_CodeError(void);
virtual void set_CodeError(int CodeError);
virtual UnicodeString get_TextError(void);
virtual void set_TextError(UnicodeString TextError);
virtual int Init(IkanUnknown * i_main_object, IkanUnknown * i_owner_object);
virtual int Done(void);
//IFiskReg
virtual int get_Number(void);
virtual void set_Number(int Number);
virtual AnsiString get_Modul(void);
virtual void set_Modul(AnsiString Modul);
virtual UnicodeString get_Name(void);
virtual void set_Name(UnicodeString Name);
virtual bool get_Error(void);
virtual void set_Error(bool Error);
virtual UnicodeString get_TextErrorNoConnect(void);
virtual void set_TextErrorNoConnect(UnicodeString TextErrorNoConnect);
virtual bool get_ConnectFR(void);
virtual void set_ConnectFR(bool ConnectFR);
virtual int get_NumberCheck(void);
virtual void set_NumberCheck(int NumberCheck);
virtual int get_NumberKL(void);
virtual void set_NumberKL(int NumberKL);
virtual UnicodeString get_SerialNumberKKM(void);
virtual void set_SerialNumberKKM(UnicodeString SerialNumberKKM);
virtual UnicodeString get_RegNumberKKM(void);
virtual void set_RegNumberKKM(UnicodeString RegNumberKKM);
virtual UnicodeString get_ModelKKM(void);
virtual void set_ModelKKM(UnicodeString ModelKKM);
virtual bool InitDevice();
virtual bool Connect(int number_port, UnicodeString baud_rate, UnicodeString password);
virtual bool Disconnect(void);
virtual bool PrintString(UnicodeString str,int size_font, int girn, int alignment, bool ch_lenta, bool kontr_lenta, bool word_wrap);
virtual bool PrintFiscalCheck(double sum, int department,double oplata_nal,double oplata_bank_card,double oplata_plat_card,double oplata_credit_card,int operation);
virtual bool PrintNoFiscalCheck(double sum,int department,double oplata_nal,double oplata_bank_card,double oplata_plat_card,double oplata_credit_card,int operation);
virtual bool PrintXReport(void);
virtual bool PrintZReport(void);
virtual bool PrintPoOtdelamReport(void);
virtual bool Cut(int TypeCut);
virtual bool Vnesenie(double sum);
virtual bool Snatie(double sum);
virtual bool PrintLine(void);
virtual bool OpenNoFiscalCheck(void);
virtual bool CloseNoFiscalCheck(void);
virtual bool GetSostKKM(void);
virtual bool ProvVosmPrintCheck(void);
virtual TTime GetTime(void);
virtual TDate GetDate(void);
virtual bool SetTime(TTime time);
virtual bool SetDate(TDate date);
};
#define CLSID_TkasVikiFRImpl __uuidof(TkasVikiFRImpl)
#endif
| [
"sasha@kaserv.ru"
] | sasha@kaserv.ru |
b127c16797a8d4672b076972f9cf3f11974384a3 | d416cd1cfd09edcc797863d240e307e0d7020086 | /leetcode/add-and-search-word-data-structure-design/main.cpp | 16b1f886f5127b527ad476e970fef3dab34f09e5 | [] | no_license | pengchengla/ACM | b9f02ae94e928f767c4be22b0ec4d4142ca0325f | 31f7a745aaf715db7bbf1ebf843c2e713ba1271f | refs/heads/master | 2021-01-20T15:44:43.323452 | 2016-06-28T08:40:36 | 2016-06-28T08:40:36 | 60,081,887 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,793 | cpp | /*===============================================================
* Copyright (C) 2015 All rights reserved.
* 文件名称:main.cpp
* 创 建 者:pengcheng
* 创建日期:2015-07-03
* 描 述:
================================================================*/
#include <iostream>
using namespace std;
struct TrieNode{
char ch;
bool isWord;
TrieNode * next[26];
TrieNode(){}
TrieNode(char c){
ch=c;
isWord=false;
for(int i=0;i<26;i++) next[i]=NULL;
}
};
class WordDictionary {
public:
WordDictionary(){
root = new TrieNode();
}
// Adds a word into the data structure.
void addWord(string word) {
TrieNode * pNode = root;
for(int i=0;i<word.length();i++){
if(pNode->next[word[i]]) pNode = pNode->next[word[i]];
else{
pNode->next[word[i]] = new TrieNode(word[i]);
pNode = pNode->next[word[i]];
}
}
pNode->isWord = true;
}
// Returns if the word is in the data structure. A word could
// contain the dot character '.' to represent any one letter.
bool search(string word) {
return subsearch(root,word,0);
}
private:
bool subsearch(TrieNode * root,string word,int p){
if(p==word.length() && root->isWord) return true;
if(word[p]!='.'){
if(!root->next[word[p]]) return false;
root = root->next[word[p]];
p++;
}else{
bool flag = false;
p++;
for(int i=0;i<26;i++){
flag = subsearch(root->next[i],word,p);
if(flag) return true;
}
return false;
}
}
private:
TrieNode * root;
};
int main(){
return 0;
}
| [
"pengcheng@pc.local"
] | pengcheng@pc.local |
1ce90946d65f3ec4fd4ef9b3a32e75c17e7bd27f | cb67c0a4c1f76333794f423c6e0de053740ed284 | /message_sync/src/sync_thermal.cpp | 22cb165ad197bfb06267477aa229d8d047c932fc | [] | no_license | vxgu86/yd_monitor | 98d23ee61b8e28dfabe8cc4c5206e357b72b6b8e | 96b0d7e6b2a1082e2eb3ff769842df75654da6db | refs/heads/master | 2020-09-10T21:12:20.646137 | 2019-11-01T03:15:35 | 2019-11-01T03:15:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,853 | cpp | #include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include "sensor_msgs/CompressedImage.h"
#include "nav_msgs/Odometry.h"
#include "std_msgs/String.h"
#include "yidamsg/pointcloud_color.h"
#include "std_msgs/UInt8.h"
#include "boost/thread/thread.hpp"
#include "boost/bind.hpp"
#include "boost/thread/mutex.hpp"
#include <opencv2/opencv.hpp>
#include <cv_bridge/cv_bridge.h>
#include <vector>
#include <iostream>
#include "base64.h"
//#include <unistd.h>
#include <stdio.h>
#include <termios.h>
#include <keyboard/Key.h>
#include <boost/regex.hpp>
#include <boost/filesystem.hpp>
using namespace std;
class message_sync_ros_node
{
private:
ros::NodeHandle node_;
ros::Publisher rgb_pub;
typedef message_filters::sync_policies::ApproximateTime<nav_msgs::Odometry, sensor_msgs::CompressedImage, nav_msgs::Odometry> slamSyncPolicy;
message_filters::Subscriber<nav_msgs::Odometry> *odom_sub_;
message_filters::Subscriber<sensor_msgs::CompressedImage> *thermal_sub_;
message_filters::Subscriber<nav_msgs::Odometry> *yt_sub_;
message_filters::Synchronizer<slamSyncPolicy> *sync_;
std::string odom_topic;
std::string visible_topic;
std::string thermal_topic;
std::string yt_topic;
int count, scount;
bool is_record;
ofstream map_points;
std::string root_path;
std::string visible_path;
std::string thermal_path;
string visible_image_name;
string thermal_image_name;
public:
message_sync_ros_node();
~message_sync_ros_node();
void callback(const nav_msgs::Odometry::ConstPtr &odom_data, const sensor_msgs::CompressedImage::ConstPtr &thermal_image, const nav_msgs::Odometry::ConstPtr &yt_data);
void update();
};
message_sync_ros_node::message_sync_ros_node()
{
ros::param::get("/message_sync/odom_topic", odom_topic);
ros::param::get("/message_sync/visible_topic", visible_topic);
ros::param::get("/message_sync/thermal_topic", thermal_topic);
ros::param::get("/message_sync/yt_topic", yt_topic);
std::cout << "odom_topic:" << odom_topic << std::endl;
std::cout << "visible_topic:" << visible_topic << std::endl;
std::cout << "thermal_topic:" << thermal_topic << std::endl;
std::cout << "yt_topic:" << yt_topic << std::endl;
rgb_pub = node_.advertise<yidamsg::pointcloud_color>("/yd/pointcloud/vt", 10);
odom_sub_ = new message_filters::Subscriber<nav_msgs::Odometry>(node_, odom_topic, 1);
thermal_sub_ = new message_filters::Subscriber<sensor_msgs::CompressedImage>(node_, thermal_topic, 1);
yt_sub_ = new message_filters::Subscriber<nav_msgs::Odometry>(node_, yt_topic, 1);
sync_ = new message_filters::Synchronizer<slamSyncPolicy>(slamSyncPolicy(20), *odom_sub_, *thermal_sub_, *yt_sub_);
sync_->registerCallback(boost::bind(&message_sync_ros_node::callback, this, _1, _2, _3));
}
message_sync_ros_node::~message_sync_ros_node()
{
}
void message_sync_ros_node::update()
{
}
void message_sync_ros_node::callback(const nav_msgs::Odometry::ConstPtr &odom_data, const sensor_msgs::CompressedImage::ConstPtr &thermal_image, const nav_msgs::Odometry::ConstPtr &yt_data)
{
nav_msgs::Odometry current_pose;
current_pose = *odom_data;
sensor_msgs::CompressedImage t_img;
t_img = *thermal_image;
nav_msgs::Odometry yt_pose;
yt_pose = *yt_data;
yidamsg::pointcloud_color data;
vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);
compression_params.push_back(90);
data.t_format = t_img.format;
cv_bridge::CvImagePtr t_cv_ptr = cv_bridge::toCvCopy(t_img, sensor_msgs::image_encodings::BGR8);
cv::Mat t_m_img = t_cv_ptr->image;
vector<uchar> t_vecImg; //Mat 图片数据转换为vector<uchar>
imencode(".jpg", t_m_img, t_vecImg, compression_params);
string t_imgbase64 = base64_encode(t_vecImg.data(), t_vecImg.size()); //实现图片的base64编码
//赋值为字符串
data.t_data = t_imgbase64;
data.pos_x = current_pose.pose.pose.position.x;
data.pos_y = current_pose.pose.pose.position.y;
data.pos_z = current_pose.pose.pose.position.z;
data.qua_x = current_pose.pose.pose.orientation.x;
data.qua_y = current_pose.pose.pose.orientation.y;
data.qua_z = current_pose.pose.pose.orientation.z;
data.qua_w = current_pose.pose.pose.orientation.w;
data.horizontal = yt_pose.pose.pose.position.x;
data.vertical = yt_pose.pose.pose.position.z;
rgb_pub.publish(data);
if (is_record)
{
count = ros::Time::now().sec;
scount = ros::Time::now().nsec;
//start current frame
try
{
//save image
}
catch (runtime_error &ex)
{
fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what());
}
is_record = false;
}
std::cout
<< "callback +1 " << std::endl;
}
void callback1(const sensor_msgs::CompressedImage::ConstPtr &image1, const sensor_msgs::CompressedImage::ConstPtr &image2, const nav_msgs::Odometry::ConstPtr &data)
{
// Solve all of perception here...
std::cout << "sync message" << std::endl;
}
void callback2(const sensor_msgs::CompressedImage::ConstPtr &image1, const sensor_msgs::CompressedImage::ConstPtr &image2, const nav_msgs::Odometry::ConstPtr &odom_data, const std_msgs::String::ConstPtr &yuntai_data)
{
// Solve all of perception here...
std::cout << "sync message" << std::endl;
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "message_sync_node");
message_sync_ros_node node;
ROS_INFO("message_sync_node node started...");
ros::Rate rate(10);
while (ros::ok())
{
//node.update();
ros::spinOnce();
rate.sleep();
}
return 0;
}
| [
"1976954875@qq.com"
] | 1976954875@qq.com |
b038595068837e6cc579373f862eba94f137c742 | dda21f4378e37cf448d17b720da4a1c9eb2b24d7 | /SDK/SB_BP_Perk_Stoneshaper_Flesh_To_Stone_parameters.hpp | 3e40a5e52b8626935c985eded09df9fbae90d19c | [] | no_license | zH4x/SpellBreak-FULL-SDK | ef45d77b63494c8771554a5d0e017cc297d8dbca | cca46d4a13f0e8a56ab8ae0fae778dd389d3b404 | refs/heads/master | 2020-09-12T17:25:58.697408 | 2018-12-09T22:49:03 | 2018-12-09T22:49:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 404 | hpp | #pragma once
// SpellBreak By Respecter (0.15.340) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SB_BP_Perk_Stoneshaper_Flesh_To_Stone_classes.hpp"
namespace SpellSDK
{
//---------------------------------------------------------------------------
//Parameters
//---------------------------------------------------------------------------
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"45327951+realrespecter@users.noreply.github.com"
] | 45327951+realrespecter@users.noreply.github.com |
6e474a50077081ac182f6dd35e2e3a7b87403e4e | fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd | /components/download/public/download_params.h | 86a629c0fcd0a2c4353738073c564a2d5adc8f85 | [
"BSD-3-Clause"
] | permissive | wzyy2/chromium-browser | 2644b0daf58f8b3caee8a6c09a2b448b2dfe059c | eb905f00a0f7e141e8d6c89be8fb26192a88c4b7 | refs/heads/master | 2022-11-23T20:25:08.120045 | 2018-01-16T06:41:26 | 2018-01-16T06:41:26 | 117,618,467 | 3 | 2 | BSD-3-Clause | 2022-11-20T22:03:57 | 2018-01-16T02:09:10 | null | UTF-8 | C++ | false | false | 5,244 | h | // Copyright 2017 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 COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
#define COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
#include "base/callback.h"
#include "base/time/time.h"
#include "components/download/public/clients.h"
#include "net/http/http_request_headers.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "url/gurl.h"
namespace download {
// The parameters describing when to run a download. This allows the caller to
// specify restrictions on what impact this download will have on the device
// (battery, network conditions, priority, etc.).
struct SchedulingParams {
public:
enum class NetworkRequirements {
// The download can occur under all network conditions.
NONE = 0,
// The download should occur when the network isn't metered. However if the
// device does not provide that opportunity over a long period of time, the
// DownloadService may start allowing these downloads to run on metered
// networks as well.
OPTIMISTIC = 1,
// The download can occur only if the network isn't metered.
UNMETERED = 2,
// Last value of the enum.
COUNT = 3,
};
enum class BatteryRequirements {
// The download can occur under all battery scenarios. Note that the
// DownloadService may still not run this download under extremely low
// battery conditions.
BATTERY_INSENSITIVE = 0,
// The download can only occur when charging or in optimal battery
// conditions.
BATTERY_SENSITIVE = 1,
// Last value of the enum.
COUNT = 2,
};
enum class Priority {
// The lowest priority. Requires that the device is idle or Chrome is
// running. Gets paused or postponed during on-going navigation.
LOW = 0,
// The normal priority. Requires that the device is idle or Chrome is
// running. Gets paused or postponed during on-going navigation.
NORMAL = 1,
// The highest background priority. Does not require the device to be idle.
HIGH = 2,
// The highest priority. This will act (scheduling requirements aside) as a
// user-initiated download.
UI = 3,
// The default priority for all tasks unless overridden.
DEFAULT = NORMAL,
// Last value of the enum.
COUNT = 4,
};
SchedulingParams();
SchedulingParams(const SchedulingParams& other) = default;
~SchedulingParams() = default;
bool operator==(const SchedulingParams& rhs) const;
// Cancel the download after this time. Will cancel in-progress downloads.
// base::Time::Max() if not specified.
base::Time cancel_time;
// The suggested priority. Non-UI priorities may not be honored by the
// DownloadService based on internal criteria and settings.
Priority priority;
NetworkRequirements network_requirements;
BatteryRequirements battery_requirements;
};
// The parameters describing how to build the request when starting a download.
struct RequestParams {
public:
RequestParams();
RequestParams(const RequestParams& other) = default;
~RequestParams() = default;
GURL url;
// The request method ("GET" is the default value).
std::string method;
net::HttpRequestHeaders request_headers;
};
// The parameters that describe a download request made to the DownloadService.
// The |client| needs to be properly created and registered for this service for
// the download to be accepted.
struct DownloadParams {
enum StartResult {
// The download is accepted and persisted.
ACCEPTED,
// The DownloadService has too many downloads. Backoff and retry.
BACKOFF,
// The DownloadService has no knowledge of the DownloadClient associated
// with this request.
UNEXPECTED_CLIENT,
// Failed to create the download. The guid is already in use.
UNEXPECTED_GUID,
// The download was cancelled by the Client while it was being persisted.
CLIENT_CANCELLED,
// The DownloadService was unable to accept and persist this download due to
// an internal error like the underlying DB store failing to write to disk.
INTERNAL_ERROR,
// TODO(dtrainor): Add more error codes.
// The count of entries for the enum.
COUNT,
};
using StartCallback = base::Callback<void(const std::string&, StartResult)>;
DownloadParams();
DownloadParams(const DownloadParams& other);
~DownloadParams();
// The feature that is requesting this download.
DownloadClient client;
// A unique GUID that represents this download. See |base::GenerateGUID()|.
std::string guid;
// A callback that will be notified if this download has been accepted and
// persisted by the DownloadService.
StartCallback callback;
// The parameters that determine under what device conditions this download
// will occur.
SchedulingParams scheduling_params;
// The parameters that define the actual download request to make.
RequestParams request_params;
// Traffic annotation for the network request.
net::MutableNetworkTrafficAnnotationTag traffic_annotation;
};
} // namespace download
#endif // COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
| [
"jacob-chen@iotwrt.com"
] | jacob-chen@iotwrt.com |
00b66c4883bbf15802ef12210f4e6d15ba3e02ed | c45151f3520d303dede70fbf868c92afeb40a4bb | /src/qt/guiutil.h | 416e7b50ef0e0014cf8ab1c65b517c1fa178e1f5 | [
"MIT"
] | permissive | tronier/CO2Coin | 8c37a1c861914166cfc9880a774604d5c147a078 | 9534ce53c8e8544a1350e50466c0c24804e824ba | refs/heads/master | 2021-02-18T16:36:13.345705 | 2020-03-05T16:30:57 | 2020-03-05T16:30:57 | 245,207,460 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,292 | h | #ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
class SendCoinsRecipient;
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
/** Utility functions used by the Bitcoin Qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "co2coin:" URI into recipient object, return true on successful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
void SetBlackThemeQSS(QApplication& app);
} // namespace GUIUtil
#endif // GUIUTIL_H
| [
"info@co2coin.info"
] | info@co2coin.info |
050f3ec0733d300898950bcb2dcfe43968000ca9 | c024a8d406ab3556a8c5bf5d66256cf6ec5dc7d9 | /7/FindMaxEx/FindMaxEx.h | ef1fbacf5b4ce73c9949416b57518efbc39061eb | [] | no_license | sergeythrees/Object-Oriented-Programming | 1fa17b5606360b4b6ef1dd6e470f7426fef649b6 | 77e227a64cb2cf00f429c090bc16ca6ec8aefa36 | refs/heads/master | 2021-09-04T09:49:56.837506 | 2018-01-17T20:02:33 | 2018-01-17T20:02:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 392 | h | #pragma once
template<typename T, typename Less/* = typeid(bool operator<()))*/>
bool FindMaxEx(std::vector<T>const & arr, T & maxValue, Less const & less/* = less()*/)
{
if (arr.empty())
{
return false;
}
const T* lastMax = &arr.front();
for (size_t i = 0; i < arr.size(); ++i)
{
if (less(*lastMax, arr[i]))
{
lastMax = &arr[i];
}
}
maxValue = *lastMax;
return true;
} | [
"sergeythrees@gmail.com"
] | sergeythrees@gmail.com |
e7eef8cc284ae1cd507bcf09bae62c5bbe13aa31 | 70d468df1bb8b959a6964dbde0b7af56bc5a47f2 | /text_generator.cpp | 03f84c358cc46345d854e428ec98565a5b4e5e6b | [] | no_license | darkraven74/TextGenerator | e4bbc43266ab7ff7523b95c64686cd83605631fd | 341e7ee8411ff93b406bc920ba2e05b87a2b9f0c | refs/heads/master | 2016-08-11T13:26:36.915324 | 2015-12-09T10:52:14 | 2015-12-09T10:52:14 | 47,180,078 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,024 | cpp | //
// Created by darkraven on 01.12.15.
//
#include "text_generator.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
text_generator::text_generator(std::string input_file)
: words_number(0)
{
std::ifstream input_stream(input_file.c_str());
std::string line;
const char space_delimeter = ' ';
while (getline(input_stream, line)) {
std::istringstream line_stream(line);
std::string word;
while (getline(line_stream, word, space_delimeter)) {
word.erase(std::remove_if(word.begin(), word.end(),
[](char c)
{ return std::ispunct(c) || !std::isprint(c); }),
word.end());
if (word.length()) {
std::map<std::string, long long>::iterator it = words_frequency.find(word);
if (it != words_frequency.end()) {
it->second++;
}
else {
words_frequency.insert(std::pair<std::string, long long>(word, 1));
}
words_number++;
}
}
}
double cur_border = 0;
for (auto &map_entry : words_frequency) {
std::string word = map_entry.first;
long long frequency = map_entry.second;
double probability = ((double) frequency) / words_number;
words_probability.insert(std::pair<double, std::string>(cur_border + probability, word));
cur_border += probability;
}
}
std::vector<std::string> text_generator::generate(int output_size)
{
std::vector<std::string> answer;
std::random_device rd;
std::mt19937 generator(rd());
std::uniform_real_distribution<> distribution(0.0, 1.0);
for (int i = 0; i < output_size; i++) {
double random_value = distribution(generator);
auto iter = words_probability.lower_bound(random_value);
answer.push_back(iter->second);
}
return answer;
}
| [
"darkraven8@gmail.com"
] | darkraven8@gmail.com |
ee1340c3447cc6f89043ca42c2e5b844a7f9b1d4 | 5b0b4601d6c803b932b65234c6225cce18a53bf3 | /LeetCode121/main.cpp | 97fda43c367407cd09f89d3c2ec3676b1fa5682e | [] | no_license | PiggerZZM/leetcode-exercises | 376f5fe1fe8fe9ca357e33c8b702b14835623fc3 | 4687f927083412b2cc416450f114f11043cbcf79 | refs/heads/master | 2023-04-08T23:23:35.576513 | 2021-04-19T03:40:22 | 2021-04-19T03:40:22 | 273,419,993 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 433 | cpp | /*
author: PiggerZZM
date: 2020-6-19
language: cpp
*/
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
#include "LeetCode121-a.cpp"
#include "LeetCode121-b.cpp"
int main()
{
SolutionA s1;
vector<int> prices = {7,1,5,3,6,4};
int result = s1.maxProfit(prices);
printf("%d\n", result);
SolutionB s2;
result = s2.maxProfit(prices);
printf("%d\n", result);
return 0;
} | [
"442823793@qq.com"
] | 442823793@qq.com |
c41374ca474e1e65d012aea82365fbb861db22e5 | cba65f37aacd6af9993ac9f858daa31cd46458ed | /app/text/append_line.cpp | 548d36d6945cb03b97afb0e795272c9c68d313fe | [
"MIT"
] | permissive | valeryami/ladybag2 | 537aeeae3efab062ee35ec643768af39716d5451 | 918f3986aa060b4740632732c85acaf96322ad0c | refs/heads/main | 2023-05-30T16:48:33.809396 | 2021-06-09T22:29:02 | 2021-06-09T22:29:02 | 375,489,954 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,036 | cpp | /**
* append_line.cpp -- функции для добавления строк
*
* Copyright (c) 2021, Alexander Borodin <aborod@petrsu.ru>
*
*
* This code is licensed under a MIT-style license.
*/
#include "_text.h"
/**
* Добавляет одну строку к тексту
* @param txt текст
* @param contents новая строка
* @returns none
*/
void append_line(text txt, std::string contents)
{
/* Добавляем в конец листа новую строку */
txt->lines->push_back(contents);
/* Указатель курсора ставим на последнюю строку (берём итератор на последнюю строку) */
txt->cursor->line = txt->lines->end();
/* Ставим курсор на последнюю позицию в строке */
txt->cursor->position = contents.length();
/* Увеличиваем количество строк в листе на единицу */
txt->length++;
}
| [
"vmiheeva@cs.petrsu.ru"
] | vmiheeva@cs.petrsu.ru |
f4c428fbef3f8064729cb8bb064169b2e4db0d26 | 4f56c5cb99b2b0834e4d06d19a753061ba1c0c6f | /tablemodel.h | 5ba2268d3cb79f5e755daabb5f0b3fa6c8a9d8f7 | [] | no_license | IvanSchcitov/QT_interface | 8badd2ecd40dd3e481dc0a4a528782d90458ae40 | f2b499dfc7d602687987409dc77a6350d664aee7 | refs/heads/master | 2021-05-12T15:08:29.998776 | 2018-02-09T08:38:01 | 2018-02-09T08:38:01 | 116,777,348 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 843 | h | #ifndef TABLEMODEL_H
#define TABLEMODEL_H
#include <QAbstractTableModel>
#include "treeitem.hpp"
class TableModel : public QAbstractTableModel
{
Q_OBJECT
public:
TableModel(TreeItem* treeItem);
int rowCount(const QModelIndex &parent = QModelIndex()) const override ;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
void delString(QModelIndex index);
void addString(QModelIndex index);
private:
int rows;
QList<QString> sData;
QList<int> iData;
QList<float> fData;
TreeItem *treeIt;
};
#endif // TABLEMODEL_H
| [
"iovin87@mail.ru"
] | iovin87@mail.ru |
b2459f7bd7cd3fd15f942fec6e6558d472a6cc8d | 0ba5369d6b79227c77879db5a67e5703d04dd34b | /Programmers/lv2/repeat_binary_transformation.cpp | fe41ed66f320264775cdc587a753ec7b3d8d98cb | [] | no_license | ParkHaeChan/DataStructureAndAlgorithmCPP | cfac1545478ef158842d28f1e959af756c52b717 | 5f99e37012ea95a41637ea09d8c6df6dfd2aec36 | refs/heads/main | 2023-08-30T14:17:37.988524 | 2021-11-01T12:51:35 | 2021-11-01T12:51:35 | 379,231,411 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,863 | cpp | /*
이진 변환 반복하기
https://programmers.co.kr/learn/courses/30/lessons/70129
문제 설명
0과 1로 이루어진 어떤 문자열 x에 대한 이진 변환을 다음과 같이 정의합니다.
x의 모든 0을 제거합니다.
x의 길이를 c라고 하면, x를 "c를 2진법으로 표현한 문자열"로 바꿉니다.
예를 들어, x = "0111010"이라면, x에 이진 변환을 가하면 x = "0111010" -> "1111" -> "100" 이 됩니다.
?:
0과 1로 이루어진 문자열 s가 매개변수로 주어집니다.
s가 "1"이 될 때까지 계속해서 s에 이진 변환을 가했을 때,
이진 변환의 횟수와 변환 과정에서 제거된 모든 0의 개수를 각각 배열에 담아 return 하도록 solution 함수를 완성해주세요.
!!!:
s의 길이는 1 이상 150,000 이하입니다.
s에는 '1'이 최소 하나 이상 포함되어 있습니다.
*/
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(string s) {
vector<int> answer;
int deleted_zeros = 0;
for(int t = 1; true; ++t)
{
int del_zero = 0;
// x의 모든 0을 제거합니다.
for(int i=0; i<s.size(); ++i)
if(s[i] == '0')
del_zero++;
// x의 길이를 c라고 하면, x를 "c를 2진법으로 표현한 문자열"로 바꿉니다.
int c = s.size() - del_zero;
if(c == 1)
{
deleted_zeros += del_zero;
answer = {t, deleted_zeros};
break;
}
string temp = "";
while(c != 0)
{
temp += to_string(c%2);
c /= 2;
}
reverse(temp.begin(), temp.end());
s = temp;
deleted_zeros += del_zero;
}
return answer;
}
int main()
{
string s = "110010101001";
solution(s);
return 0;
} | [
"lucidsun92@gmail.com"
] | lucidsun92@gmail.com |
32d4e9f17b5e27381bfe3594cbb23b86650748fc | 360080a32b5d14ebcb58b7848313582819e3307f | /heros2048/proj.wp8/2048heros.h | bc3b7c17cbc7fb6c5aec9d454d6c1fc6d65c0ed7 | [] | no_license | tjh83/MyProject | a6e04966112780eac24bc4dd5e586203f66d7aac | 6d941273bf8e98f0e413dce0ba1de99620e2c985 | refs/heads/master | 2018-12-29T01:34:48.468814 | 2015-03-17T02:24:44 | 2015-03-17T02:24:44 | 32,364,144 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,718 | h | #pragma once
#include "../Classes/AppDelegate.h"
ref class 2048heros sealed : public Windows::ApplicationModel::Core::IFrameworkView
{
public:
2048heros();
// IFrameworkView Methods.
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
virtual void Load(Platform::String^ entryPoint);
virtual void Run();
virtual void Uninitialize();
protected:
// Event Handlers.
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args);
private:
// The AppDelegate for the Cocos2D app
AppDelegate app;
};
ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
{
public:
virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
}; | [
"tjh8306@gmail.com"
] | tjh8306@gmail.com |
48ef4008961d5ff2cbf415a2d16da64a0a19541f | 40cd81f397721cd1dad6590cef00f16ab94b53ba | /MPA5/commands.hpp | 18ed5354c4d65241d4b278770b7d67d76c2e3f53 | [] | no_license | ohhskar-school/cmsc-123 | c16b543fe394d11635a4628c6e9d9fed8c1693be | f32b323c1b9065fbd238af1943e18b4a694e3e6a | refs/heads/master | 2022-03-20T15:00:33.784720 | 2019-12-18T06:37:55 | 2019-12-18T06:37:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 429 | hpp | #ifndef MPA5_COMMANDS
#define MPA5_COMMANDS
#include "commands/append.hpp"
#include "commands/cd.hpp"
#include "commands/command.hpp"
#include "commands/cp.hpp"
#include "commands/ls.hpp"
#include "commands/mkdir.hpp"
#include "commands/mv.hpp"
#include "commands/rm.hpp"
#include "commands/rmdir.hpp"
#include "commands/rn.hpp"
#include "commands/show.hpp"
#include "commands/touch.hpp"
#include "commands/whereis.hpp"
#endif
| [
"oscarvianvalles@gmail.com"
] | oscarvianvalles@gmail.com |
7eba5956a7541ade3824b9bf234659bca0fd2077 | 411ab7c07e92cc575ce6044927fe842114ad1b8b | /parts/ IAudioProvider.h | e612da30ebc3de7308e6fe83d0a7c9c64c3a4060 | [] | no_license | zeplaz/symecodev | 5a1df6322bba351bb5ea3c8c29f2577307f8a1b5 | 1894303fa17c97b9799144fa9792e4b0f1973b05 | refs/heads/master | 2021-09-29T03:45:47.587611 | 2018-11-23T16:52:20 | 2018-11-23T16:52:20 | 154,870,745 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 350 | h | #pragma once
//#include "stdafx.h"
#include <string.h>
class IAudioProvider
{
public:
virtual ~IAudioProvider() {}
virtual void PlaySound(std::string filename) = 0;
virtual void PlaySong(std::string filename, bool looping) = 0;
virtual void StopAllSounds() = 0;
virtual bool IsSoundPlaying() = 0;
virtual bool IsSongPlaying() = 0;
};
| [
"life.in.the.vivid.dream@gmail.com"
] | life.in.the.vivid.dream@gmail.com |
b36b446eef3243db8e2b8ddfbad3a74f591cb462 | 9b8708ad7ffb5d344eba46451cabc3da8c0b645b | /Moteur/Vulkan/memoryblock.h | 69bf9d22250cc0f83a25aec05d9b4580fc7049fc | [] | no_license | VisualPi/GameEngine | 8830037305ff2268866f0e2c254e6f74901dd18d | 03c60c571ab3a95b8eaf2c560aa3e4c9486a77c3 | refs/heads/master | 2021-07-08T18:13:28.459930 | 2017-10-08T12:05:05 | 2017-10-08T12:05:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 467 | h | #pragma once
#include "device.h"
int findMemoryType(uint32_t memoryTypeBits,
vk::PhysicalDeviceMemoryProperties const &properties,
bool shouldBeDeviceLocal);
struct MemoryBlock {
vk::DeviceMemory memory;
vk::DeviceSize offset{ 0 };
vk::DeviceSize size{ 0 };
bool free = false;
void *ptr = nullptr; // Useless if it is a GPU allocation
bool operator ==(MemoryBlock const &block);
};
std::ostream &operator<<(std::ostream &os, const MemoryBlock &block);
| [
"antoine.morrier@outlook.fr"
] | antoine.morrier@outlook.fr |
bd03fa0a9901e72a2f1cff63b6ca18d7b026e67c | 48e9625fcc35e6bf790aa5d881151906280a3554 | /Sources/Elastos/Runtime/Core/marshal/android_linux/mshproc.cpp | 09f44abb9e7578ae2dfdfd8f5f563c59a0f63a9b | [
"Apache-2.0"
] | permissive | suchto/ElastosRT | f3d7e163d61fe25517846add777690891aa5da2f | 8a542a1d70aebee3dbc31341b7e36d8526258849 | refs/heads/master | 2021-01-22T20:07:56.627811 | 2017-03-17T02:37:51 | 2017-03-17T02:37:51 | 85,281,630 | 4 | 2 | null | 2017-03-17T07:08:49 | 2017-03-17T07:08:49 | null | UTF-8 | C++ | false | false | 34,577 | cpp | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// 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 <stdio.h>
#include <marshal_ipc.h>
#define ROUND8(n) (((n)+7)&~7) // round up to multiple of 8 bytes
namespace Elastos {
namespace IPC {
ECode Proxy_ProcessMsh_BufferSize(
/* [in] */ const CIMethodInfo* methodInfo,
/* [in] */ UInt32* args,
/* [out] */ UInt32* retInSize,
/* [out] */ UInt32* retOutSize)
{
UInt32 uSize = 0;
UInt32 inSize = 0;
UInt32 outSize = 0;
Int32 paramNum = methodInfo->mParamNum;
const CIBaseType* params = methodInfo->mParams;
for (Int32 n = 0; n < paramNum; n++) {
if (BT_IS_OUT(params[n])) { // [out]
outSize += sizeof(UInt32); // for pointer
switch (BT_TYPE(params[n])) {
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
uSize = sizeof(UInt32);
break;
case BT_TYPE_PUINT64:
uSize = sizeof(UInt64);
break;
case BT_TYPE_PEMUID:
uSize = sizeof(EMuid);
break;
case BT_TYPE_PEGUID:
uSize = sizeof(EMuid) + sizeof(char*) \
+ 80 * sizeof(char);
break;
case BT_TYPE_PSTRUCT :
uSize = sizeof(UInt32) * BT_TYPE_SIZE(params[n]);
break;
case BT_TYPE_PSTRING:
uSize = sizeof(String);
break;
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_ARRAYOF:
uSize = sizeof(PCARQUINTET);
break;
case BT_TYPE_PINTERFACE:
uSize = sizeof(InterfacePack);
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid [in, out] type(%08x), param index: %d.\n",
params[n], n));
assert(0);
return E_INVALID_ARGUMENT;
}
if (*args) {
outSize += uSize;
}
// else: null pointer do not contain data.
}
if (BT_IS_IN(params[n])) { // [in]
switch (BT_TYPE(params[n])) {
case BT_TYPE_UINT8:
case BT_TYPE_UINT16:
case BT_TYPE_UINT32:
inSize += sizeof(UInt32);
args++;
break;
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
if (*args) {
inSize += sizeof(UInt32) * 2;
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_UINT64:
#ifdef _mips
// Adjust for 64bits align on mips
if (!(n % 2)) {
inSize += 4;
args += 1;
}
#endif
#if defined(_arm) && defined(__GNUC__) && (__GNUC__ >= 4)
args = (UInt32*)ROUND8((Int32)args);
#endif
inSize += sizeof(UInt64) + 1; //+1 for 8-byte alignment
args += 2;
break;
case BT_TYPE_PUINT64:
if (*args) {
inSize += sizeof(UInt32) + sizeof(UInt64);
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_EGUID:
inSize += sizeof(EMuid) + sizeof(char*) \
+ 80 * sizeof(char);
args += sizeof(EMuid) / 4 + sizeof(char*) / 4;
break;
case BT_TYPE_EMUID:
inSize += sizeof(EMuid);
args += sizeof(EMuid) / 4;
break;
case BT_TYPE_PSTRUCT:
case BT_TYPE_STRUCT:
if (*args) {
inSize += sizeof(UInt32) + sizeof(UInt32) * BT_TYPE_SIZE(params[n]);
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_PEGUID:
if (*args) {
inSize += sizeof(UInt32) + sizeof(EMuid)
+ 80 * sizeof(char)
+ sizeof(wchar_t*);
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_PEMUID:
if (*args) {
inSize += sizeof(UInt32) + sizeof(EMuid);
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_STRING:
if (*args) {
UInt32 nBufLen = (strlen((char *)(*args)) + 1)
* sizeof(char);
inSize += sizeof(UInt32) + sizeof(UInt32) +
MSH_ALIGN_4(nBufLen);
}
else {
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_INTERFACE:
if (*args) {
inSize += sizeof(InterfacePack);
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
case BT_TYPE_PINTERFACE:
if (*args) {
if (*(UInt32 *)(*args)) {
inSize += sizeof(InterfacePack);
}
else {
inSize += sizeof(UInt32);
}
}
inSize += sizeof(UInt32); // for pointer
args++;
break;
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_ARRAYOF:
if (*args) {
if (CarQuintetFlag_Type_IObject
!= (((PCARQUINTET)*args)->mFlags
& CarQuintetFlag_TypeMask)) {
inSize += MSH_ALIGN_4(sizeof(UInt32) \
+ sizeof(CarQuintet) \
+ ((PCARQUINTET)*args)->mSize);
}
else {
inSize += MSH_ALIGN_4(sizeof(UInt32) \
+ sizeof(CarQuintet));
Int32 used = ((PCARQUINTET)*args)->mUsed
/ sizeof(IInterface *);
Int32* int32Buf = (Int32*)((PCARQUINTET)*args)->mBuf;
uint_t uUsedSize = 0;
for (Int32 i = 0; i < used; i++) {
if (int32Buf[i]) {
uUsedSize += sizeof(InterfacePack);
}
else { // null pointer
uUsedSize += sizeof(UInt32);
}
}
inSize += MAX((MemorySize)uUsedSize, \
MSH_ALIGN_4(((PCARQUINTET)*args)->mSize));
}
}
else { // null pointer
inSize += sizeof(UInt32);
}
args++;
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid [in, out] type(%08x), param index: %d.\n",
params[n], n));
assert(0);
return E_INVALID_ARGUMENT;
}
}
else { // [out]
if (((BT_TYPE(params[n]) == BT_TYPE_BUFFEROF) ||
(BT_TYPE(params[n]) == BT_TYPE_ARRAYOF) ||
(BT_TYPE(params[n]) == BT_TYPE_STRINGBUF)) && *args) {
inSize += sizeof(UInt32); // for size only
}
args++;
inSize += sizeof(UInt32);
}
}
*retInSize = inSize;
*retOutSize = outSize;
return NOERROR;
}
ECode Proxy_ProcessMsh_In(
/* [in] */ const CIMethodInfo* methodInfo,
/* [in] */ UInt32* args,
/* [in, out] */ IParcel* parcel)
{
Int32 paramNum = methodInfo->mParamNum;
const CIBaseType* params = methodInfo->mParams;
for (Int32 n = 0; n < paramNum; n++) {
if (BT_IS_IN(params[n])) { // [in] or [in, out]
switch (BT_TYPE(params[n])) {
case BT_TYPE_UINT8:
case BT_TYPE_UINT16:
case BT_TYPE_UINT32:
parcel->WriteInt32((Int32)*args);
args++;
break;
case BT_TYPE_UINT64:
#ifdef _mips
// Adjust for 64bits align on mips
if (!(n % 2)) args += 1;
#endif
#if defined(_arm) && defined(__GNUC__) && (__GNUC__ >= 4)
args = (UInt32*)ROUND8((Int32)args);
#endif
parcel->WriteInt64((Int64)(*(UInt64 *)args));
args += 2;
break;
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
case BT_TYPE_PUINT64:
assert(0);
args++;
break;
case BT_TYPE_STRUCT:
case BT_TYPE_PSTRUCT:
parcel->WriteStruct(*args, BT_TYPE_SIZE(params[n]) * 4);
args++;
break;
case BT_TYPE_EMUID:
parcel->WriteEMuid(*(EMuid *)args);
args += sizeof(EMuid) / 4;
break;
case BT_TYPE_EGUID:
parcel->WriteEGuid(*(EGuid *)args);
args += sizeof(EGuid) / 4;
break;
case BT_TYPE_ARRAYOF:
parcel->WriteArrayOf((Handle32)*args);
args++;
break;
case BT_TYPE_STRING:
parcel->WriteString(**(String**)args);
args++;
break;
case BT_TYPE_INTERFACE:{
ECode ec = parcel->WriteInterfacePtr((IInterface *)*args);
if (FAILED(ec)) {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: marshal interface, ec = %x, param index: %d\n", ec, n));
return ec;
}
args++;
break;
}
case BT_TYPE_PEMUID:
case BT_TYPE_PEGUID:
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_PINTERFACE:
assert(0);
args++;
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid [in, out] type(%08x), param index: %d.\n",
params[n], n));
assert(0);
return E_INVALID_ARGUMENT;
}
}
else { // [out]
if (*args) parcel->WriteInt32(MSH_NOT_NULL);
else parcel->WriteInt32(MSH_NULL);
if (((BT_TYPE(params[n]) == BT_TYPE_BUFFEROF) ||
(BT_TYPE(params[n]) == BT_TYPE_ARRAYOF) ||
(BT_TYPE(params[n]) == BT_TYPE_STRINGBUF)) && !BT_IS_CALLEE(params[n]) && *args) {
parcel->WriteInt32(((PCARQUINTET)*args)->mSize);
}
args++;
}
}
return NOERROR;
}
ECode Proxy_ProcessUnmsh_Out(
/* [in] */ const CIMethodInfo* methodInfo,
/* [in] */ IParcel* parcel,
/* [in] */ UInt32 dataSize,
/* [in, out] */ UInt32* args)
{
Int32 paramNum = methodInfo->mParamNum;
const CIBaseType* params = methodInfo->mParams;
for (Int32 n = 0; n < paramNum; n++) {
if (BT_IS_OUT(params[n])) { // [out] or [in, out]
if (*args) {
Int32 pointValue;
parcel->ReadInt32(&pointValue);
if (pointValue != (Int32)MSH_NOT_NULL) {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: param conflict in proxy's unmarshal, param index: %d.\n", n));
return E_INVALID_ARGUMENT;
}
switch (BT_TYPE(params[n])) {
case BT_TYPE_PUINT8:
parcel->ReadByte((Byte*)*args);
break;
case BT_TYPE_PUINT16:
parcel->ReadInt16((Int16*)*args);
break;
case BT_TYPE_PUINT32:
parcel->ReadInt32((Int32*)*args);
break;
case BT_TYPE_PUINT64:
parcel->ReadInt64((Int64*)*args);
break;
case BT_TYPE_PSTRUCT:
parcel->ReadStruct((Handle32*)*args);
break;
case BT_TYPE_PEMUID:
parcel->ReadEMuid((EMuid*)*args);
break;
case BT_TYPE_PEGUID:
parcel->ReadEGuid((EGuid*)*args);
break;
case BT_TYPE_PSTRING:
parcel->ReadString((String*)*args);
break;
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_ARRAYOF:
if (!BT_IS_CALLEE(params[n])) {
PCARQUINTET p;
parcel->ReadArrayOf((Handle32*)&p);
PCARQUINTET qArg = (PCARQUINTET)*args;
qArg->mUsed = p->mUsed;
memcpy(qArg->mBuf, p->mBuf, p->mSize);
_CarQuintet_Release(p);
}
else {
parcel->ReadArrayOf((Handle32*)*args);
}
break;
case BT_TYPE_PINTERFACE:
parcel->ReadInterfacePtr((Handle32*)*args);
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid param type(%08x), param index: %d\n", params[n], n));
assert(0);
return E_INVALID_ARGUMENT;
}
}
else {
Int32 pointValue;
parcel->ReadInt32(&pointValue);
if (pointValue != MSH_NULL) {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: param conflict in proxy's unmarshal, param index: %d.\n", n));
return E_INVALID_ARGUMENT;
}
}
args++;
}
else { // [in]
switch (BT_TYPE(params[n])) {
case BT_TYPE_UINT64:
#ifdef _mips
// Adjust for 64bits align on mips
if (!(n % 2)) {
args += 1;
}
#endif
#if defined(_arm) && defined(__GNUC__) && (__GNUC__ >= 4)
args = (UInt32*)ROUND8((Int32)args);
#endif
args += 2;
break;
case BT_TYPE_EMUID:
args += sizeof(EMuid) / 4;
break;
case BT_TYPE_EGUID:
args += sizeof(EMuid) / 4 + sizeof(char*) /4;
break;
default:
args++;
break;
}
}
}
return NOERROR;
}
ECode Stub_ProcessUnmsh_In(
/* [in] */ const CIMethodInfo* methodInfo,
/* [in] */ IParcel* parcel,
/* [in, out] */ UInt32* outBuffer,
/* [in, out] */ UInt32* args)
{
if (outBuffer) {
outBuffer = (UInt32 *)((MarshalHeader *)outBuffer + 1);
}
Int32 paramNum = methodInfo->mParamNum;
const CIBaseType* params = methodInfo->mParams;
for (Int32 n = 0; n < paramNum; n++) {
if (BT_IS_OUT(params[n])) { // [out] or [in, out]
assert(outBuffer);
Int32 pointValue;
parcel->ReadInt32(&pointValue);
if (pointValue == (Int32)MSH_NOT_NULL) {
*outBuffer = MSH_NOT_NULL;
outBuffer++;
switch (BT_TYPE(params[n])) { // [out]
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
*args = (UInt32)outBuffer;
outBuffer++;
break;
case BT_TYPE_PUINT64:
*args = (UInt32)outBuffer;
outBuffer += 2;
break;
case BT_TYPE_PEGUID:
*args = (UInt32)outBuffer;
outBuffer += sizeof(EMuid) / 4;
*outBuffer = (UInt32)(outBuffer + 1);
outBuffer += sizeof(char*) / 4
+ 80 * sizeof(char) / 4;
break;
case BT_TYPE_PEMUID:
*args = (UInt32)outBuffer;
outBuffer += sizeof(EMuid) / 4;
break;
case BT_TYPE_PSTRUCT:
*args = (UInt32)outBuffer;
outBuffer += BT_TYPE_SIZE(params[n]);
break;
case BT_TYPE_PSTRING:
*args = (UInt32)outBuffer;
new((void*)outBuffer) String();
outBuffer += sizeof(String) / 4;
break;
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_ARRAYOF:
if (!BT_IS_CALLEE(params[n])) {
Int32 size;
parcel->ReadInt32(&size);
*outBuffer = (UInt32)malloc(sizeof(CarQuintet));
*(PCARQUINTET*)args = (PCARQUINTET)*outBuffer;
((PCARQUINTET)*args)->mSize = size;
((PCARQUINTET)*args)->mBuf = malloc(size);
}
else {
*outBuffer = 0;
*args = (UInt32)outBuffer;
}
outBuffer++;
break;
case BT_TYPE_PINTERFACE:
*outBuffer = 0;
*args = (UInt32)outBuffer;
outBuffer += sizeof(InterfacePack) / 4;
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid param type(%08x) in UnMsh_in, param index: %d.\n",
params[n], n));
return E_INVALID_ARGUMENT;
}
}
else if (pointValue == MSH_NULL) {
*outBuffer = MSH_NULL;
outBuffer++;
*args = 0;
}
else {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid pointer value in unmarshal in, param index: %d.\n", n));
return E_INVALID_ARGUMENT;
}
args++;
}
else if (BT_IS_IN(params[n])) { // [in]
switch (BT_TYPE(params[n])) {
case BT_TYPE_UINT8:
case BT_TYPE_UINT16:
case BT_TYPE_UINT32:
parcel->ReadInt32((Int32*)args);
args++;
break;
case BT_TYPE_UINT64:
#ifdef _mips
// Adjust for 64bits align on mips
if (!(n % 2)) {
args += 1;
}
#endif
#if defined(_arm) && defined(__GNUC__) && (__GNUC__ >= 4)
args = (UInt32*)ROUND8((Int32)args);
#endif
parcel->ReadInt64((Int64*)args);
args += 2;
break;
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
case BT_TYPE_PUINT64:
assert(0);
args++;
break;
case BT_TYPE_EMUID:
parcel->ReadEMuid((EMuid*)args);
args += sizeof(EMuid) / 4;
break;
case BT_TYPE_EGUID:
parcel->ReadEGuid((EGuid*)args);
args += (sizeof(EGuid) +
MSH_ALIGN_4(strlen(((EGuid*)args)->mUunm) + 1)) / 4;
break;
case BT_TYPE_STRUCT:
case BT_TYPE_PEMUID:
case BT_TYPE_PEGUID:
case BT_TYPE_PSTRUCT:
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
assert(0);
args++;
break;
case BT_TYPE_ARRAYOF:
parcel->ReadArrayOf((Handle32*)args);
args++;
break;
case BT_TYPE_STRING: {
String str;
parcel->ReadString(&str);
*(String**)args = new String(str);
args++;
break;
}
case BT_TYPE_INTERFACE: {
ECode ec = parcel->ReadInterfacePtr((Handle32*)args);
if (FAILED(ec)) {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: unmsh interface, ec = %x\n", ec));
return ec;
}
args++;
break;
}
case BT_TYPE_PINTERFACE:
assert(0);
args++;
break;
default:
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid param type(%08x), param index: %d\n", params[n], n));
return E_INVALID_ARGUMENT;
}
}
else {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: Invalid param type(%08x), param index: %d\n", params[n], n));
return E_INVALID_ARGUMENT;
}
}
return NOERROR;
}
ECode Stub_ProcessMsh_Out(
/* [in] */ const CIMethodInfo* methodInfo,
/* [in] */ UInt32* args,
/* [in] */ UInt32* outBuffer,
/* [in] */ Boolean onlyReleaseIn,
/* [in, out] */ IParcel* parcel)
{
Int32 paramNum = methodInfo->mParamNum;
const CIBaseType* params = methodInfo->mParams;
// skip the Out Marshal Header;
if (outBuffer) {
outBuffer = (UInt32 *)((MarshalHeader *)outBuffer + 1);
}
for (Int32 n = 0; n < paramNum; n++) {
if (BT_IS_OUT(params[n])) { // [out] or [in, out]
args++;
if (onlyReleaseIn)
continue;
if (*outBuffer != MSH_NULL) {
assert(*outBuffer == MSH_NOT_NULL);
parcel->WriteInt32(MSH_NOT_NULL);
outBuffer++;
switch (BT_TYPE(params[n])) {
case BT_TYPE_PUINT64:
parcel->WriteInt64(*(Int64*)outBuffer);
outBuffer += 2;
break;
case BT_TYPE_PSTRING:
if (*outBuffer) {
String* p = (String*)outBuffer;
parcel->WriteString(*p);
p->~String();
}
else {
parcel->WriteInt32(MSH_NULL);
}
outBuffer += sizeof(String) / 4;
break;
case BT_TYPE_STRINGBUF:
assert(0);
outBuffer++;
break;
case BT_TYPE_BUFFEROF:
assert(0);
break;
case BT_TYPE_ARRAYOF:
{
parcel->WriteArrayOf((Handle32)*outBuffer);
PCARQUINTET p = (PCARQUINTET)*outBuffer;
if (p != NULL) {
if (!BT_IS_CALLEE(params[n])) {
if (CarQuintetFlag_Type_IObject == (p->mFlags
& CarQuintetFlag_TypeMask)) {
int used = ((PCARQUINTET)*args)->mUsed
/ sizeof(IInterface *);
int *buf = (int*)((PCARQUINTET)*args)->mBuf;
for (int i = 0; i < used; i++) {
if (buf[i]) {
((IInterface *)buf[i])->Release();
buf[i] = 0;
}
}
}
else if (CarQuintetFlag_Type_String == (p->mFlags
& CarQuintetFlag_TypeMask)) {
int size = ((PCARQUINTET)*args)->mSize
/ sizeof(String);
String *buf = (String*)((PCARQUINTET)*args)->mBuf;
for (int i = 0; i < size; i++) {
if (!buf[i].IsNull()) {
buf[i] = NULL;
}
}
}
free(p->mBuf);
free(p);
}
else {
if (CarQuintetFlag_Type_IObject == (p->mFlags
& CarQuintetFlag_TypeMask)) {
((ArrayOf<IInterface*>*)p)->Release();
}
else if (CarQuintetFlag_Type_String == (p->mFlags
& CarQuintetFlag_TypeMask)) {
((ArrayOf<String>*)p)->Release();
}
}
}
outBuffer++;
}
break;
case BT_TYPE_PEMUID:
parcel->WriteEMuid(*(EMuid*)outBuffer);
outBuffer += sizeof(EMuid) / 4;
break;
case BT_TYPE_PSTRUCT:
parcel->WriteStruct((Handle32)outBuffer, BT_TYPE_SIZE(params[n]) * 4);
outBuffer += BT_TYPE_SIZE(params[n]);
break;
case BT_TYPE_PEGUID:
parcel->WriteEGuid(*(EGuid*)outBuffer);
outBuffer += sizeof(EMuid) / 4 + sizeof(char*) / 4 \
+ 80 * sizeof(char) / 4;
break;
case BT_TYPE_PINTERFACE: {
IInterface* object = (IInterface *)*outBuffer;
ECode ec = parcel->WriteInterfacePtr(object);
if (FAILED(ec)) {
MARSHAL_DBGOUT(MSHDBG_ERROR, ALOGE(
"MshProc: marshal interface, ec = %x, param index: %d\n", ec, n));
return ec;
}
if (NULL != object) object->Release();
outBuffer += sizeof(InterfacePack) / 4;
break;
}
default:
parcel->WriteInt32(*(Int32*)outBuffer);
outBuffer++;
break;
}
}
else {
assert(*outBuffer == MSH_NULL);
parcel->WriteInt32(MSH_NULL);
outBuffer++;
}
}
else { // BT_IS_IN
switch (BT_TYPE(params[n])) {
case BT_TYPE_UINT64:
#ifdef _mips
// Adjust for 64bits align on mips
if (!(n % 2)) args += 1;
#endif
#if defined(_arm) && defined(__GNUC__) && (__GNUC__ >= 4)
args = (UInt32*)ROUND8((Int32)args);
#endif
args += 2;
break;
case BT_TYPE_PUINT8:
case BT_TYPE_PUINT16:
case BT_TYPE_PUINT32:
free(*(Int32**)args);
args++;
break;
case BT_TYPE_PUINT64:
free(*(Int64**)args);
args++;
break;
case BT_TYPE_STRING: {
String* p = *(String**)args;
delete p;
args++;
break;
}
case BT_TYPE_EMUID:
args += sizeof(EMuid) / 4;
break;
case BT_TYPE_EGUID:
args += sizeof(EMuid) / 4 + sizeof(char*) / 4;
break;
case BT_TYPE_PEGUID:
free(*(EGuid**)args);
args++;
break;
case BT_TYPE_PINTERFACE:
if (*args && *(UInt32 *)(*args)) {
((IInterface *)*(UInt32 *)*args)->Release();
}
args++;
break;
case BT_TYPE_INTERFACE:
if (*args) {
((IInterface *)*args)->Release();
}
args++;
break;
case BT_TYPE_STRINGBUF:
case BT_TYPE_BUFFEROF:
case BT_TYPE_ARRAYOF:
if (*args) {
if (CarQuintetFlag_Type_IObject
== (((PCARQUINTET)*args)->mFlags
& CarQuintetFlag_TypeMask)) {
int used = ((PCARQUINTET)*args)->mUsed
/ sizeof(IInterface *);
int *pBuf = (int*)((PCARQUINTET)*args)->mBuf;
for (int i = 0; i < used; i++) {
if (pBuf[i]) {
((IInterface *)pBuf[i])->Release();
pBuf[i] = 0;
}
}
}
else if (CarQuintetFlag_Type_String
== (((PCARQUINTET)*args)->mFlags
& CarQuintetFlag_TypeMask)) {
int size = ((PCARQUINTET)*args)->mSize
/ sizeof(String);
String *pBuf = (String*)((PCARQUINTET)*args)->mBuf;
for (int i = 0; i < size; i++) {
if (!pBuf[i].IsNull()) {
pBuf[i] = NULL;
}
}
}
_CarQuintet_Release((PCARQUINTET)*args);
}
args++;
break;
default:
args++;
break;
}
}
}
return NOERROR;
}
} // namespace IPC
} // namespace Elastos
| [
"cao.jing@kortide.com"
] | cao.jing@kortide.com |
55f740b4af693862b478affa648a024bd6c484be | 2f10f807d3307b83293a521da600c02623cdda82 | /deps/boost/win/debug/include/boost/function_types/detail/pp_retag_default_cc/master.hpp | a2437fc20ea51c681697b8c3232f4352395b0a69 | [] | no_license | xpierrohk/dpt-rp1-cpp | 2ca4e377628363c3e9d41f88c8cbccc0fc2f1a1e | 643d053983fce3e6b099e2d3c9ab8387d0ea5a75 | refs/heads/master | 2021-05-23T08:19:48.823198 | 2019-07-26T17:35:28 | 2019-07-26T17:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | hpp | version https://git-lfs.github.com/spec/v1
oid sha256:424b7fdc622b828f068d504d4ae307f45a871bf83efd3cc7d6696ae5dcad85c6
size 3116
| [
"YLiLarry@gmail.com"
] | YLiLarry@gmail.com |
716b3ff876a21dcd8f70ed7e584363e9093c0a36 | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/inetsrv/iis/svcs/cmp/easp/comp/src/compobj.h | 6450935dc126500ea3295b65afc0946128864fe1 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,274 | h | // CompObj.h : Declaration of the CASPEncryption
#include "resource.h" // main symbols
#include <asptlb.h>
/////////////////////////////////////////////////////////////////////////////
// easpcomp
class CASPEncryption :
public CComDualImpl<IASPEncryption, &IID_IASPEncryption, &LIBID_EASPCOMPLib>,
public ISupportErrorInfo,
public CComObjectRoot,
public CComCoClass<CASPEncryption,&CLSID_CASPEncryption>
{
public:
CASPEncryption();
~CASPEncryption();
BEGIN_COM_MAP(CASPEncryption)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IASPEncryption)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
//DECLARE_NOT_AGGREGATABLE(CASPEncryption)
// Remove the comment from the line above if you don't want your object to
// support aggregation. The default is to support it
DECLARE_REGISTRY(CASPEncryption,
_T("IIS.ASPEncryption.1"),
_T("IIS.ASPEncryption"),
IDS_EASPCOMP_DESC,
THREADFLAGS_BOTH)
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// IASPEncryption
public:
STDMETHOD(OnStartPage)(IUnknown* pUnk);
STDMETHOD(OnEndPage)();
STDMETHOD(EncryptInplace)(
BSTR bstrPassword,
BSTR bstrPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(EncryptCopy)(
BSTR bstrPassword,
BSTR bstrFromPage,
BSTR bstrToPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(TestEncrypted)(
BSTR bstrPassword,
BSTR bstrPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(IsEncrypted)(
BSTR bstrPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(VerifyPassword)(
BSTR bstrPassword,
BSTR bstrPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(DecryptInplace)(
BSTR bstrPassword,
BSTR bstrPage,
VARIANT_BOOL *pfRetVal);
STDMETHOD(DecryptCopy)(
BSTR bstrPassword,
BSTR bstrFromPage,
BSTR bstrToPage,
VARIANT_BOOL *pfRetVal);
private:
HRESULT MapVirtualPath(BSTR bstrPath, CComBSTR &bstrFile);
HRESULT ReportError(HRESULT hr, DWORD dwErr);
HRESULT ReportError(DWORD dwErr);
HRESULT ReportError(HRESULT hr);
BOOL m_fOnPage; // TRUE after OnStartPage() called
CComPtr<IServer> m_piServer; // Server Object (for path translation)
};
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
0af24b765e2ce96666b44f335af52da727687157 | 6fea8d35315dbf883055bbe7123ea84bad35cec0 | /src/qt/plutusstrings.cpp | 98be594550f99654055ad1716ed83f994bc6b817 | [
"MIT"
] | permissive | PlutusCapital/core | caef5b3710bda17e062837ad6e4653c78065c318 | 9a02ab820245afdb2b3ab4bea621a78bfef37590 | refs/heads/master | 2023-01-04T01:36:55.766312 | 2020-10-29T09:11:15 | 2020-10-29T09:11:15 | 227,622,200 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 32,453 | cpp |
#include <QtGlobal>
// Automatically generated by extract_strings.py
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif
static const char UNUSED *plutus_strings[] = {
QT_TRANSLATE_NOOP("plutus-core", " mints deleted\n"),
QT_TRANSLATE_NOOP("plutus-core", " mints updated, "),
QT_TRANSLATE_NOOP("plutus-core", " unconfirmed transactions removed\n"),
QT_TRANSLATE_NOOP("plutus-core", ""
"(1 = keep tx meta data e.g. account owner and payment request information, 2 "
"= drop tx meta data)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Allow JSON-RPC connections from specified source. Valid for <ip> are a "
"single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or "
"a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Bind to given address and always listen on it. Use [host]:port notation for "
"IPv6"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Bind to given address and whitelist peers connecting to it. Use [host]:port "
"notation for IPv6"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Bind to given address to listen for JSON-RPC connections. Use [host]:port "
"notation for IPv6. This option can be specified multiple times (default: "
"bind to all interfaces)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Calculated accumulator checkpoint is not what is recorded by block index"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Cannot obtain a lock on data directory %s. PLUTUS Core is probably already "
"running."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Change automatic finalized budget voting behavior. mode=auto: Vote for only "
"exact finalized budget match to my generated budget. (string, default: auto)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Continuously rate-limit free transactions to <n>*1000 bytes per minute "
"(default:%u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Create new files with system default permissions, instead of umask 077 (only "
"effective with disabled wallet functionality)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Delete all wallet transactions and only recover those parts of the "
"blockchain through -rescan on startup"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Delete all zerocoin spends and mints that have been recorded to the "
"blockchain database and reindex them (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Disable all PLUTUS specific functionality (Masternodes, Zerocoin, SwiftX, "
"Budgeting) (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Distributed under the MIT software license, see the accompanying file "
"COPYING or <http://www.opensource.org/licenses/mit-license.php>."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable SwiftX, show confirmations for locked transactions (bool, default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable automatic Zerocoin minting from specific addresses (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable automatic wallet backups triggered after each zPLT minting (0-1, "
"default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable or disable staking functionality for PLT inputs (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable or disable staking functionality for zPLT inputs (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enable spork administration functionality with the appropriate private key."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Enter regression test mode, which uses a special chain in which blocks can "
"be solved instantly."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: Listening for incoming connections failed (listen returned error %s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: The transaction is larger than the maximum allowed transaction size!"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: The transaction was rejected! This might happen if some of the coins "
"in your wallet were already spent, such as if you used a copy of wallet.dat "
"and coins were spent in the copy but not marked as spent here."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: This transaction requires a transaction fee of at least %s because of "
"its amount, complexity, or use of recently received funds!"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: Unsupported argument -checklevel found. Checklevel must be level 4."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Error: Unsupported argument -socks found. Setting SOCKS version isn't "
"possible anymore, only SOCKS5 proxies are supported."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Execute command when a relevant alert is received or we see a really long "
"fork (%s in cmd is replaced by message)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Execute command when a wallet transaction changes (%s in cmd is replaced by "
"TxID)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Execute command when the best block changes (%s in cmd is replaced by block "
"hash)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Execute command when the best block changes and its size is over (%s in cmd "
"is replaced by block hash, %d with the block size)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Failed to find coin set amongst held coins with less than maxNumber of Spends"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Fees (in PLT/Kb) smaller than this are considered zero fee for relaying "
"(default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Fees (in PLT/Kb) smaller than this are considered zero fee for transaction "
"creation (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Flush database activity from memory pool to disk log every <n> megabytes "
"(default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"If paytxfee is not set, include enough fee so transactions begin "
"confirmation on average within n blocks (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"In rare cases, a spend with 7 coins exceeds our maximum allowable "
"transaction size, please retry spend using 6 or less coins"),
QT_TRANSLATE_NOOP("plutus-core", ""
"In this mode -genproclimit controls how many blocks are generated "
"immediately."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Insufficient or insufficient confirmed funds, you might need to wait a few "
"minutes and try again."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay "
"fee of %s to prevent stuck transactions)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Keep the specified amount available for spending at all times (default: 0)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Log transaction priority and fee per kB when mining blocks (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Maintain a full transaction index, used by the getrawtransaction rpc call "
"(default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Maximum average size of an index occurrence in the block spam filter "
"(default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Maximum size of data in data carrier transactions we relay and mine "
"(default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Maximum size of the list of indexes in the block spam filter (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Maximum total fees to use in a single wallet transaction, setting too low "
"may abort large transactions (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Number of seconds to keep misbehaving peers from reconnecting (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Obfuscation uses exact denominated amounts to send funds, you might simply "
"need to anonymize some more coins."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Output debugging information (default: %u, supplying <category> is optional)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Preferred Denomination for automatically minted Zerocoin "
"(1/5/10/50/100/500/1000/5000), 0 for no preference. default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Query for peer addresses via DNS lookup, if low on addresses (default: 1 "
"unless -connect)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Randomize credentials for every proxy connection. This enables Tor stream "
"isolation (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Require high priority for relaying free or low-fee transactions (default:%u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Send trace/debug info to console instead of debug.log file (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Set the number of included blocks to precompute per cycle. (minimum: %d) "
"(maximum: %d) (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Set the number of script verification threads (%u to %d, 0 = auto, <0 = "
"leave that many cores free, default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Set the number of threads for coin generation if enabled (-1 = all cores, "
"default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Show N confirmations for a successfully locked transaction (0-9999, default: "
"%u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Specify custom backup path to add a copy of any automatic zPLT backup. If "
"set as dir, every backup generates a timestamped file. If set as file, will "
"rewrite to that file every backup. If backuppath is set as well, 4 backups "
"will happen"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Specify custom backup path to add a copy of any wallet backup. If set as "
"dir, every backup generates a timestamped file. If set as file, will rewrite "
"to that file every backup."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Support filtering of blocks and transaction with bloom filters (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"SwiftX requires inputs with at least 6 confirmations, you might need to wait "
"a few minutes and try again."),
QT_TRANSLATE_NOOP("plutus-core", ""
"The block database contains a block which appears to be from the future. "
"This may be due to your computer's date and time being set incorrectly. Only "
"rebuild the block database if you are sure that your computer's date and "
"time are correct"),
QT_TRANSLATE_NOOP("plutus-core", ""
"This is a pre-release test build - use at your own risk - do not use for "
"staking or merchant applications!"),
QT_TRANSLATE_NOOP("plutus-core", ""
"This product includes software developed by the OpenSSL Project for use in "
"the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software "
"written by Eric Young and UPnP software written by Thomas Bernard."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Total length of network version string (%i) exceeds maximum length (%i). "
"Reduce the number or size of uacomments."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Unable to bind to %s on this computer. PLUTUS Core is probably already running."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Unable to locate enough Obfuscation denominated funds for this transaction."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Unable to locate enough Obfuscation non-denominated funds for this "
"transaction that are not equal 10000 PLT."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Unable to locate enough funds for this transaction that are not equal 10000 "
"PLT."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: "
"%s)"),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: -maxtxfee is set very high! Fees this large could be paid on a "
"single transaction."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: -paytxfee is set very high! This is the transaction fee you will "
"pay if you send a transaction."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: Please check that your computer's date and time are correct! If "
"your clock is wrong PLUTUS Core will not work properly."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: The network does not appear to fully agree! Some miners appear to "
"be experiencing issues."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: We do not appear to fully agree with our peers! You may need to "
"upgrade, or other nodes may need to upgrade."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: error reading wallet.dat! All keys read correctly, but transaction "
"data or address book entries might be missing or incorrect."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as "
"wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect "
"you should restore from a backup."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Whitelist peers connecting from the given netmask or IP address. Can be "
"specified multiple times."),
QT_TRANSLATE_NOOP("plutus-core", ""
"Whitelisted peers cannot be DoS banned and their transactions are always "
"relayed, even if they are already in the mempool, useful e.g. for a gateway"),
QT_TRANSLATE_NOOP("plutus-core", ""
"You must specify a masternodeprivkey in the configuration. Please see "
"documentation for help."),
QT_TRANSLATE_NOOP("plutus-core", "(51472 could be used only on mainnet)"),
QT_TRANSLATE_NOOP("plutus-core", "(default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "(default: 1)"),
QT_TRANSLATE_NOOP("plutus-core", "(must be 51472 for mainnet)"),
QT_TRANSLATE_NOOP("plutus-core", "<category> can be:"),
QT_TRANSLATE_NOOP("plutus-core", "Accept command line and JSON-RPC commands"),
QT_TRANSLATE_NOOP("plutus-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"),
QT_TRANSLATE_NOOP("plutus-core", "Accept public REST requests (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Add a node to connect to and attempt to keep the connection open"),
QT_TRANSLATE_NOOP("plutus-core", "Adding Wrapped Serials supply..."),
QT_TRANSLATE_NOOP("plutus-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
QT_TRANSLATE_NOOP("plutus-core", "Always query for peer addresses via DNS lookup (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Append comment to the user agent string"),
QT_TRANSLATE_NOOP("plutus-core", "Attempt to force blockchain corruption recovery"),
QT_TRANSLATE_NOOP("plutus-core", "Attempt to recover private keys from a corrupt wallet.dat"),
QT_TRANSLATE_NOOP("plutus-core", "Automatically create Tor hidden service (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Block creation options:"),
QT_TRANSLATE_NOOP("plutus-core", "Calculating missing accumulators..."),
QT_TRANSLATE_NOOP("plutus-core", "Cannot create public spend input"),
QT_TRANSLATE_NOOP("plutus-core", "Cannot downgrade wallet"),
QT_TRANSLATE_NOOP("plutus-core", "Cannot resolve -bind address: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Cannot resolve -externalip address: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Cannot resolve -whitebind address: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Cannot write default address"),
QT_TRANSLATE_NOOP("plutus-core", "CoinSpend: Accumulator witness does not verify"),
QT_TRANSLATE_NOOP("plutus-core", "CoinSpend: failed check"),
QT_TRANSLATE_NOOP("plutus-core", "Connect only to the specified node(s)"),
QT_TRANSLATE_NOOP("plutus-core", "Connect through SOCKS5 proxy"),
QT_TRANSLATE_NOOP("plutus-core", "Connect to a node to retrieve peer addresses, and disconnect"),
QT_TRANSLATE_NOOP("plutus-core", "Connection options:"),
QT_TRANSLATE_NOOP("plutus-core", "Copyright (C) 2009-%i The Bitcoin Core Developers"),
QT_TRANSLATE_NOOP("plutus-core", "Copyright (C) 2014-%i The Dash Core Developers"),
QT_TRANSLATE_NOOP("plutus-core", "Copyright (C) 2015-%i The PLUTUS Core Developers"),
QT_TRANSLATE_NOOP("plutus-core", "Corrupted block database detected"),
QT_TRANSLATE_NOOP("plutus-core", "Could not parse masternode.conf"),
QT_TRANSLATE_NOOP("plutus-core", "Couldn't generate the accumulator witness"),
QT_TRANSLATE_NOOP("plutus-core", "Debugging/Testing options:"),
QT_TRANSLATE_NOOP("plutus-core", "Delete blockchain folders and resync from scratch"),
QT_TRANSLATE_NOOP("plutus-core", "Disable OS notifications for incoming transactions (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Disable safemode, override a real safe mode event (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Discover own IP address (default: 1 when listening and no -externalip)"),
QT_TRANSLATE_NOOP("plutus-core", "Display the stake modifier calculations in the debug.log file."),
QT_TRANSLATE_NOOP("plutus-core", "Display verbose coin stake messages in the debug.log file."),
QT_TRANSLATE_NOOP("plutus-core", "Do not load the wallet and disable wallet RPC calls"),
QT_TRANSLATE_NOOP("plutus-core", "Do you want to rebuild the block database now?"),
QT_TRANSLATE_NOOP("plutus-core", "Done loading"),
QT_TRANSLATE_NOOP("plutus-core", "Enable automatic Zerocoin minting (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Enable precomputation of zPLT spends and stakes (0-1, default %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish hash block in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish hash transaction (locked via SwiftX) in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish hash transaction in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish raw block in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish raw transaction (locked via SwiftX) in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable publish raw transaction in <address>"),
QT_TRANSLATE_NOOP("plutus-core", "Enable staking functionality (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Enable the client to act as a masternode (0-1, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Error initializing block database"),
QT_TRANSLATE_NOOP("plutus-core", "Error initializing wallet database environment %s!"),
QT_TRANSLATE_NOOP("plutus-core", "Error loading block database"),
QT_TRANSLATE_NOOP("plutus-core", "Error loading wallet.dat"),
QT_TRANSLATE_NOOP("plutus-core", "Error loading wallet.dat: Wallet corrupted"),
QT_TRANSLATE_NOOP("plutus-core", "Error loading wallet.dat: Wallet requires newer version of PLUTUS Core"),
QT_TRANSLATE_NOOP("plutus-core", "Error opening block database"),
QT_TRANSLATE_NOOP("plutus-core", "Error reading from database, shutting down."),
QT_TRANSLATE_NOOP("plutus-core", "Error recovering public key."),
QT_TRANSLATE_NOOP("plutus-core", "Error writing zerocoinDB to disk"),
QT_TRANSLATE_NOOP("plutus-core", "Error"),
QT_TRANSLATE_NOOP("plutus-core", "Error: A fatal internal error occured, see debug.log for details"),
QT_TRANSLATE_NOOP("plutus-core", "Error: A fatal internal error occurred, see debug.log for details"),
QT_TRANSLATE_NOOP("plutus-core", "Error: Disk space is low!"),
QT_TRANSLATE_NOOP("plutus-core", "Error: No valid utxo!"),
QT_TRANSLATE_NOOP("plutus-core", "Error: Unsupported argument -tor found, use -onion."),
QT_TRANSLATE_NOOP("plutus-core", "Error: Wallet locked, unable to create transaction!"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to calculate accumulator checkpoint"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to create mint"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to find Zerocoins in wallet.dat"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to listen on any port. Use -listen=0 if you want this."),
QT_TRANSLATE_NOOP("plutus-core", "Failed to parse host:port string"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to parse public spend"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to read block"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to select a zerocoin"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to wipe zerocoinDB"),
QT_TRANSLATE_NOOP("plutus-core", "Failed to write coin serial number into wallet"),
QT_TRANSLATE_NOOP("plutus-core", "Fee (in PLT/kB) to add to transactions you send (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Force safe mode (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Generate coins (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "How many blocks to check at startup (default: %u, 0 = all)"),
QT_TRANSLATE_NOOP("plutus-core", "If <category> is not supplied, output all debugging information."),
QT_TRANSLATE_NOOP("plutus-core", "Importing..."),
QT_TRANSLATE_NOOP("plutus-core", "Imports blocks from external blk000??.dat file"),
QT_TRANSLATE_NOOP("plutus-core", "Include IP addresses in debug output (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Incorrect or no genesis block found. Wrong datadir for network?"),
QT_TRANSLATE_NOOP("plutus-core", "Information"),
QT_TRANSLATE_NOOP("plutus-core", "Initialization sanity check failed. PLUTUS Core is shutting down."),
QT_TRANSLATE_NOOP("plutus-core", "Insufficient funds"),
QT_TRANSLATE_NOOP("plutus-core", "Insufficient funds."),
QT_TRANSLATE_NOOP("plutus-core", "Invalid -onion address or hostname: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -maxtxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -minrelaytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -mintxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -paytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount for -reservebalance=<amount>"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid amount"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid masternodeprivkey. Please see documenation."),
QT_TRANSLATE_NOOP("plutus-core", "Invalid netmask specified in -whitelist: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid port detected in masternode.conf"),
QT_TRANSLATE_NOOP("plutus-core", "Invalid private key."),
QT_TRANSLATE_NOOP("plutus-core", "Keep at most <n> unconnectable transactions in memory (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Limit size of signature cache to <n> entries (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Line: %d"),
QT_TRANSLATE_NOOP("plutus-core", "Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Listen for connections on <port> (default: %u or testnet: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Loading addresses..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading block index..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading budget cache..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading masternode cache..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading masternode payment cache..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading sporks..."),
QT_TRANSLATE_NOOP("plutus-core", "Loading wallet... (%3.2f %%)"),
QT_TRANSLATE_NOOP("plutus-core", "Loading wallet..."),
QT_TRANSLATE_NOOP("plutus-core", "Location of the auth cookie (default: data dir)"),
QT_TRANSLATE_NOOP("plutus-core", "Lock masternodes from masternode configuration file (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Lookup(): Invalid -proxy address or hostname: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Maintain at most <n> connections to peers (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Masternode options:"),
QT_TRANSLATE_NOOP("plutus-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Mint did not make it into blockchain"),
QT_TRANSLATE_NOOP("plutus-core", "Need address because change is not exact"),
QT_TRANSLATE_NOOP("plutus-core", "Need to specify a port with -whitebind: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Node relay options:"),
QT_TRANSLATE_NOOP("plutus-core", "Not enough file descriptors available."),
QT_TRANSLATE_NOOP("plutus-core", "Number of automatic wallet backups (default: 10)"),
QT_TRANSLATE_NOOP("plutus-core", "Number of custom location backups to retain (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Only accept block chain matching built-in checkpoints (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Only connect to nodes in network <net> (ipv4, ipv6 or onion)"),
QT_TRANSLATE_NOOP("plutus-core", "Options:"),
QT_TRANSLATE_NOOP("plutus-core", "Password for JSON-RPC connections"),
QT_TRANSLATE_NOOP("plutus-core", "Percentage of automatically minted Zerocoin (1-100, default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Preparing for resync..."),
QT_TRANSLATE_NOOP("plutus-core", "Prepend debug output with timestamp (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Print version and exit"),
QT_TRANSLATE_NOOP("plutus-core", "Pubcoin not found in mint tx"),
QT_TRANSLATE_NOOP("plutus-core", "RPC server options:"),
QT_TRANSLATE_NOOP("plutus-core", "Randomly drop 1 of every <n> network messages"),
QT_TRANSLATE_NOOP("plutus-core", "Randomly fuzz 1 of every <n> network messages"),
QT_TRANSLATE_NOOP("plutus-core", "Rebuild block chain index from current blk000??.dat files"),
QT_TRANSLATE_NOOP("plutus-core", "Recalculating PLT supply..."),
QT_TRANSLATE_NOOP("plutus-core", "Recalculating minted ZPLT..."),
QT_TRANSLATE_NOOP("plutus-core", "Recalculating spent ZPLT..."),
QT_TRANSLATE_NOOP("plutus-core", "Receive and display P2P network alerts (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Reindex the PLT and zPLT money supply statistics"),
QT_TRANSLATE_NOOP("plutus-core", "Reindex the accumulator database"),
QT_TRANSLATE_NOOP("plutus-core", "Reindexing zerocoin database..."),
QT_TRANSLATE_NOOP("plutus-core", "Reindexing zerocoin failed"),
QT_TRANSLATE_NOOP("plutus-core", "Relay and mine data carrier transactions (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Relay non-P2SH multisig (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Rescan the block chain for missing wallet transactions"),
QT_TRANSLATE_NOOP("plutus-core", "Rescanning..."),
QT_TRANSLATE_NOOP("plutus-core", "ResetMintZerocoin finished: "),
QT_TRANSLATE_NOOP("plutus-core", "ResetSpentZerocoin finished: "),
QT_TRANSLATE_NOOP("plutus-core", "Run a thread to flush wallet periodically (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Run in the background as a daemon and accept commands"),
QT_TRANSLATE_NOOP("plutus-core", "Selected coins value is less than payment target"),
QT_TRANSLATE_NOOP("plutus-core", "Send transactions as zero-fee transactions if possible (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Session timed out."),
QT_TRANSLATE_NOOP("plutus-core", "Set database cache size in megabytes (%d to %d, default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Set external address:port to get to this masternode (example: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Set key pool size to <n> (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Set maximum block size in bytes (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Set minimum block size in bytes (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Set the Maximum reorg depth (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Set the masternode private key"),
QT_TRANSLATE_NOOP("plutus-core", "Set the number of threads to service RPC calls (default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Show all debugging options (usage: --help -help-debug)"),
QT_TRANSLATE_NOOP("plutus-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"),
QT_TRANSLATE_NOOP("plutus-core", "Signing failed."),
QT_TRANSLATE_NOOP("plutus-core", "Signing timed out."),
QT_TRANSLATE_NOOP("plutus-core", "Signing transaction failed"),
QT_TRANSLATE_NOOP("plutus-core", "Specify configuration file (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Specify connection timeout in milliseconds (minimum: 1, default: %d)"),
QT_TRANSLATE_NOOP("plutus-core", "Specify data directory"),
QT_TRANSLATE_NOOP("plutus-core", "Specify masternode configuration file (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Specify pid file (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Specify wallet file (within data directory)"),
QT_TRANSLATE_NOOP("plutus-core", "Specify your own public address"),
QT_TRANSLATE_NOOP("plutus-core", "Spend Valid"),
QT_TRANSLATE_NOOP("plutus-core", "Spend unconfirmed change when sending transactions (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Staking options:"),
QT_TRANSLATE_NOOP("plutus-core", "Stop running after importing blocks from disk (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Support the zerocoin light node protocol (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "SwiftX options:"),
QT_TRANSLATE_NOOP("plutus-core", "Synchronization failed"),
QT_TRANSLATE_NOOP("plutus-core", "Synchronization finished"),
QT_TRANSLATE_NOOP("plutus-core", "Synchronization pending..."),
QT_TRANSLATE_NOOP("plutus-core", "Synchronizing budgets..."),
QT_TRANSLATE_NOOP("plutus-core", "Synchronizing masternode winners..."),
QT_TRANSLATE_NOOP("plutus-core", "Synchronizing masternodes..."),
QT_TRANSLATE_NOOP("plutus-core", "Synchronizing sporks..."),
QT_TRANSLATE_NOOP("plutus-core", "Syncing zPLT wallet..."),
QT_TRANSLATE_NOOP("plutus-core", "The coin spend has been used"),
QT_TRANSLATE_NOOP("plutus-core", "The transaction did not verify"),
QT_TRANSLATE_NOOP("plutus-core", "This help message"),
QT_TRANSLATE_NOOP("plutus-core", "This is experimental software."),
QT_TRANSLATE_NOOP("plutus-core", "This is intended for regression testing tools and app development."),
QT_TRANSLATE_NOOP("plutus-core", "Threshold for disconnecting misbehaving peers (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Too many spends needed"),
QT_TRANSLATE_NOOP("plutus-core", "Tor control port password (default: empty)"),
QT_TRANSLATE_NOOP("plutus-core", "Tor control port to use if onion listening enabled (default: %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction Created"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction Mint Started"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction amount too small"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction amounts must be positive"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction too large for fee policy"),
QT_TRANSLATE_NOOP("plutus-core", "Transaction too large"),
QT_TRANSLATE_NOOP("plutus-core", "Trying to spend an already spent serial #, try again."),
QT_TRANSLATE_NOOP("plutus-core", "Unable to bind to %s on this computer (bind returned error %s)"),
QT_TRANSLATE_NOOP("plutus-core", "Unable to find transaction containing mint %s"),
QT_TRANSLATE_NOOP("plutus-core", "Unable to find transaction containing mint, txHash: %s"),
QT_TRANSLATE_NOOP("plutus-core", "Unable to sign spork message, wrong key?"),
QT_TRANSLATE_NOOP("plutus-core", "Unable to start HTTP server. See debug log for details."),
QT_TRANSLATE_NOOP("plutus-core", "Unknown network specified in -onlynet: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "Upgrade wallet to latest format"),
QT_TRANSLATE_NOOP("plutus-core", "Use UPnP to map the listening port (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Use UPnP to map the listening port (default: 1 when listening)"),
QT_TRANSLATE_NOOP("plutus-core", "Use a custom max chain reorganization depth (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Use block spam filter (default: %u)"),
QT_TRANSLATE_NOOP("plutus-core", "Use the test network"),
QT_TRANSLATE_NOOP("plutus-core", "User Agent comment (%s) contains unsafe characters."),
QT_TRANSLATE_NOOP("plutus-core", "Username for JSON-RPC connections"),
QT_TRANSLATE_NOOP("plutus-core", "Value is below the smallest available denomination (= 1) of zPLT"),
QT_TRANSLATE_NOOP("plutus-core", "Verifying blocks..."),
QT_TRANSLATE_NOOP("plutus-core", "Verifying wallet..."),
QT_TRANSLATE_NOOP("plutus-core", "Wallet %s resides outside data directory %s"),
QT_TRANSLATE_NOOP("plutus-core", "Wallet needed to be rewritten: restart PLUTUS Core to complete"),
QT_TRANSLATE_NOOP("plutus-core", "Wallet options:"),
QT_TRANSLATE_NOOP("plutus-core", "Wallet window title"),
QT_TRANSLATE_NOOP("plutus-core", "Warning"),
QT_TRANSLATE_NOOP("plutus-core", "Warning: This version is obsolete, upgrade required!"),
QT_TRANSLATE_NOOP("plutus-core", "Warning: Unsupported argument -benchmark ignored, use -debug=bench."),
QT_TRANSLATE_NOOP("plutus-core", "Warning: Unsupported argument -debugnet ignored, use -debug=net."),
QT_TRANSLATE_NOOP("plutus-core", "You don't have enough Zerocoins in your wallet"),
QT_TRANSLATE_NOOP("plutus-core", "You need to rebuild the database using -reindex to change -txindex"),
QT_TRANSLATE_NOOP("plutus-core", "Zapping all transactions from wallet..."),
QT_TRANSLATE_NOOP("plutus-core", "ZeroMQ notification options:"),
QT_TRANSLATE_NOOP("plutus-core", "Zerocoin options:"),
QT_TRANSLATE_NOOP("plutus-core", "could not get lock on cs_spendcache"),
QT_TRANSLATE_NOOP("plutus-core", "isValid(): Invalid -proxy address or hostname: '%s'"),
QT_TRANSLATE_NOOP("plutus-core", "on startup"),
QT_TRANSLATE_NOOP("plutus-core", "wallet.dat corrupt, salvage failed"),
};
| [
"sbohare@techracers.io"
] | sbohare@techracers.io |
26e6b7c962208e766a96fb9e1fd9d7e04305e2bb | e85fdbbea321fbe0ac699d92ab452c515f97d1e9 | /matchI.cpp | e3962752ce4c350c2b27196bf63f947544919e15 | [] | no_license | fanliyong007/acmhomeworks | 3c212b2c74ab43ad16e7fe277093e4df49b3dd27 | 718c3aee1c8c621e2a8699cbf378ddf178b88c63 | refs/heads/master | 2021-01-22T19:58:54.871018 | 2019-09-24T04:57:19 | 2019-09-24T04:57:19 | 85,262,548 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,147 | cpp | #include<iostream>
using namespace std;
int main()
{
string s1, s2;
while(cin>>s1>>s2)
{
int len1 = s1.length();
int len2 = s2.length();
bool flag = false;
if(len2>len1)
{
cout << "no" << endl;
continue;
}
for (int i = 0; i < len1;i++)
{
if(s1[i]==s2[0])
{
if(i+len2<=len1)
{
if(s1.substr(i,len2).compare(s2)==0)
{
flag = true;
break;
}
}
else
{
if(s1.substr(i,len1).compare(s2.substr(0,len1-i))==0)
{
if(s1.substr(0,len2-(len1-i)).compare(s2.substr(len1-i,len2))==0)
{
flag = true;
break;
}
}
}
}
}
flag == true ? cout << "yes" << endl : cout << "no" << endl;
}
return 0;
} | [
"fanliyong007@hotmail.com"
] | fanliyong007@hotmail.com |
bc38ea2ca87f4d18f6fd28f3b7e658cac74f611f | 46c22c9d51a1f469c9920cb4064590a278ca09f3 | /Wearable Electronics/Day 5/Jump Shoes 2/Jump_shoes2.ino | 8fda761a071c4a5011a47f7bc4489cb6d947f3f3 | [] | no_license | saransh44/SteamWorks-Projects | 3f1bb34dd0ee20a36d6de25c7d1497c404712fa1 | 4ca66d06303cce0f81b974268889e309d74fbb34 | refs/heads/master | 2020-04-17T17:14:07.538010 | 2019-01-21T10:43:32 | 2019-01-21T10:43:32 | 166,774,758 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 792 | ino | #include <Adafruit_CircuitPlayground.h>
#include <Wire.h>
#include <SPI.h>
float x, y, z; //values to measure acceleration in 3 dimensions
float total = 0.0;
void setup() {
CircuitPlayground.begin();
Serial.begin(9600);
}
void loop() {
getAcc(); //collect magnitude of acceleration
if (total > 30) { //IF the acceleration is greater than the acceleration due to gravity, turn pixel red
redSpark();
}
else if (total < 30.0 && total > 25.0) {
violetSpark();
//greenSpark();
}
else if (total < 25.0 && total > 20.0) {
blueSpark();
//greenSpark();
}
else if (total < 20.0 && total > 15.0) {
tealSpark();
}
else if (total < 10.0) {
greenSpark();
}
else {
amberSpark();
}
delay(250);
CircuitPlayground.strip.clear();
}
| [
"saranshgupta32@gmail.com"
] | saranshgupta32@gmail.com |
35a2a1dec777a9afbdf45c64e72a8fa247565c3e | 6f4887d435b9420c7c1ac20c9b618bbdfe16464c | /also/pomosh rayke.cpp | 6001c4e5cd37414bbcc096c7511c9511adf896e2 | [] | no_license | beloofficial/Dev-C | 4af8b69e58b07543a062360d9b17b0024759f0e2 | 64471bf2a2da7d3bf40f15445e397112648c189f | refs/heads/master | 2022-01-10T22:36:33.601075 | 2019-05-04T09:18:59 | 2019-05-04T09:18:59 | 184,855,569 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 197 | cpp | #include<iostream>
using namespace std;
int main()
{double a,n;
cin>>n;
for(a=1;a<=n;a++)
{ if(2*a*a+a-2395==0)cout<<a;
}
system("pause");
return 0;
}
| [
"amantay.or@gmail.com"
] | amantay.or@gmail.com |
e88367e797a60874cba5841d9c306ceb51cb80fb | c54a93c3356de22f32bf5c6e92f051391046734a | /platform_release/adobe/future/widgets/headers/visible_change_queue.hpp | d617cf0aa8a1c4992aa50624dd03fa5f44b18ff3 | [] | no_license | tfiner/adobe_asl | 8d2eb6ae715b29217e411001b946914ff23b5f59 | d7d1c2af5e0cf15fa8a170bb8d725dc935796c8a | refs/heads/master | 2020-12-24T15:49:13.250941 | 2012-07-23T05:49:27 | 2012-07-23T05:49:27 | 4,744,424 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,418 | hpp | /*
Copyright 2005-2007 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
*/
/****************************************************************************************************/
#ifndef ADOBE_VISIBLE_CHANGE_QUEUE_HPP
#define ADOBE_VISIBLE_CHANGE_QUEUE_HPP
/****************************************************************************************************/
#include <vector>
#include <adobe/eve.hpp>
#include <adobe/future/behavior.hpp>
#include <adobe/name.hpp>
/****************************************************************************************************/
namespace adobe {
/*************************************************************************************************/
/*
REVISIT (sparent) : As a current "hack" for handling the drawing order of widgets when optional
panels come and go we are going to define a dpq of callbacks which need to be shown or hidden
and the window will handle the logic. Still need to figure out the right place to put this.
*/
struct visible_change_queue_t
{
visible_change_queue_t(eve_t& eve) :
root_m(false),
hide_queue_m(root_m.insert_behavior(true)),
eve_eval_token_m(root_m.insert(boost::bind(&eve_t::evaluate, boost::ref(eve), eve_t::evaluate_nested, 0, 0))),
show_queue_m(root_m.insert_behavior(true)),
force_m(false)
{ }
behavior_t root_m;
behavior_t::behavior_token_t hide_queue_m;
behavior_t::verb_token_t eve_eval_token_m;
behavior_t::behavior_token_t show_queue_m;
bool force_m; // force an update irrespective of the show/hide queues being empty
void update()
{
if (force_m || hide_queue_m->empty() == false || show_queue_m->empty() == false)
root_m();
force_m = false;
}
};
/****************************************************************************************************/
typedef std::vector<name_t> touch_set_t;
/****************************************************************************************************/
} // namespace adobe
/****************************************************************************************************/
#endif
/****************************************************************************************************/
| [
"github@tfiner.fastmail.fm"
] | github@tfiner.fastmail.fm |
5e18111f28e0192c8ab35493666a6feb34144660 | 7f6fe18cf018aafec8fa737dfe363d5d5a283805 | /ntk/storage/directory.h | b638832dc32cf97ddf552a517e8d2fc4ee14694b | [] | no_license | snori/ntk | 4db91d8a8fc836ca9a0dc2bc41b1ce767010d5ba | 86d1a32c4ad831e791ca29f5e7f9e055334e8fe7 | refs/heads/master | 2020-05-18T05:28:49.149912 | 2009-08-04T16:47:12 | 2009-08-04T16:47:12 | 268,861 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,836 | h | /******************************************************************************
The NTK Library
Copyright (C) 1998-2003 Noritaka Suzuki
$Id: directory.h,v 1.6 2003/11/11 12:07:09 nsuzuki Exp $
******************************************************************************/
#pragma once
#ifndef __NTK_STORAGE_DIRECTORY_H__
#define __NTK_STORAGE_DIRECTORY_H__
#ifndef __NTK_WINDOWS_WINDOWS_H__
#include <ntk/windows/windows.h>
#endif
#ifndef __NTK_DEFS_H__
#include <ntk/defs.h>
#endif
#ifndef __NTK_STORAGE_NODE_H__
#include <ntk/storage/node.h>
#endif
#ifndef __NTK_STORAGE_ENTRYLIST_H__
#include <ntk/storage/entrylist.h>
#endif
#ifndef __NTK_SUPPORT_STATUS__
#include <ntk/support/status.h>
#endif
namespace ntk {
class File;
class FILE;
class SymLink;
class Directory : public Node, public EntryList {
public:
//
// methods
//
NtkExport Directory();
NtkExport Directory(const String& path);
NtkExport Directory(const Directory& dir, const String& path);
NtkExport Directory(const Directory& val);
NtkExport Directory& operator=(const Directory& rhs);
NtkExport virtual ~Directory();
status_t set_to(const String& path) {return Node::set_to(path);}
status_t set_to(const Directory& dir, const String& path) {return Node::set_to(dir, path);}
NtkExport status_t create_file(const String& path, File* file, bool fail_if_exists = false);
NtkExport status_t create_file(const String& path, FILE* file, bool fail_if_exists = false);
NtkExport status_t create_directory(const String& path, Directory* dir);
NtkExport status_t create_sym_link(const String& path, const String& link_to_path, SymLink* sym_link);
NtkExport Entry find_entry(const String& path, bool traverse = false, status_t* status = NULL);
NtkExport status_t find_entry(const String& path, Entry* entry, bool traverse = false);
NtkExport virtual status_t get_next_entry(Entry* entry, bool traverse = false);
NtkExport virtual status_t get_next_ref(Entry::Ref* entry_ref);
NtkExport virtual status_t rewind();
//
// accessors and manipulators
//
NtkExport virtual int count_entries() const;
NtkExport bool is_root_directory() const;
private:
//
// data
//
HANDLE m_hfind;
};// class Directory
NtkExport status_t create_directory(const String& path, int mode = 0);
//NtkExport status_t find_directory(
NtkExport Directory current_directory(status_t* status = NULL);
#ifdef NTK_TYPEDEF_LOWERCASE_ONLY_TYPE_NAME
typedef Directory directory_t;
#endif
} namespace Ntk = ntk;
#ifdef NTK_TYPEDEF_TYPES_AS_GLOBAL_TYPE
#ifdef NTK_TYPEDEF_GLOBAL_NCLASS
typedef ntk::Directory NDirectory;
#endif
#ifdef NTK_TYPEDEF_LOWERCASE_ONLY_TYPE_NAME
typedef ntk::Directory ntk_directory;
#endif
#endif
#endif//EOH
| [
"nrtkszk@gmail.com"
] | nrtkszk@gmail.com |
6c2c399b659c765791532f5f2c22d6e3116bd57c | 7e88587fb56d494adf0f0d35ba414d4bdfc81664 | /LAWA-lite/iris2/my/compressionlaplace1d.h | ff1f36181f580267c1cbcee5598385ff51768a9f | [] | no_license | iris-haecker/LAWA | 8c488652b64db299299dd72fa7fb0a0e3baf4d83 | a79c6b70e4558935da34a04da62bdb4af2da08af | refs/heads/master | 2021-01-25T04:57:43.279709 | 2013-09-18T10:31:05 | 2013-09-18T10:31:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 597 | h | #ifndef IRIS2_MY_COMPRESSIONLAPLACE1D_H
#define IRIS2_MY_COMPRESSIONLAPLACE1D_H 1
#include <iris2/my/laplace1d.h>
namespace lawa {
template <typename T>
struct CompressionLaplace1D
{
const Laplace1D<T> &A;
short s_tilde, jmin, jmax;
CompressionLaplace1D(const Laplace1D<T> &A);
void
setParameters(const IndexSet<Index1D> &LambdaRow);
IndexSet<Index1D>
SparsityPattern(const Index1D &lambda_col,
const IndexSet<Index1D> &LambdaRow,
int J=-1);
};
} // namespace lawa
#endif // IRIS2_MY_COMPRESSIONLAPLACE1D_H | [
"iris.haecker@uni-ulm.de"
] | iris.haecker@uni-ulm.de |
636a762985769cb174b2a3e9ea6bd4f988b0217c | a210bc73428084c04b07c19b705eb1e2baffb9d4 | /71A. Way Too Long Words/71A. Way Too Long Words.cpp | a5135abd9c433114a9410db065a38e3950ce14db | [] | no_license | imanmousaei/CodeForces | 15067e49cf41bc4f34fd691a8267c79dea785962 | 1add0c41353e75b75f867304640b717aff60df49 | refs/heads/master | 2021-07-06T14:38:02.445337 | 2020-08-04T15:37:58 | 2020-08-04T15:37:58 | 137,961,173 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 949 | cpp | /**
Coder : Iman Mousaei
Accepted
**/
#include <bits/stdc++.h>
#define ___ ios_base::sync_with_stdio(false);
using namespace std;
typedef long long ll;
const ll LLINF = LLONG_MAX - 7;
const int INF = INT_MAX - 7;
const int MAX = 100 + 7;
const int MOD = 1e9 + 7;
string s[MAX],answer[MAX];
string i2s(int a)
{
stringstream ss;
ss << a;
string str = ss.str();
return str;
}
bool is_long(string str)
{
if(str.length()>10)
return true;
return false;
}
string abbr(string str)
{
int n = str.length();
string ans = "";
ans += str[0];
ans += i2s(n-2);
ans += str[n-1];
return ans;
}
int main()
{
int n;
cin >> n;
for(int i=0;i<n;i++)
{
cin >> s[i];
if( is_long(s[i]) )
answer[i] = abbr(s[i]);
else
answer[i] = s[i];
}
for(int i=0;i<n;i++)
{
cout << answer[i] << endl;
}
return EXIT_SUCCESS;
}
| [
"imanmousaei1379@gmail.com"
] | imanmousaei1379@gmail.com |
825100dec0a67cfa7ff5a2cf8c88394e222a8dc2 | 11c74b57455ce2454849fbe9a73a2e0d2a3542d2 | /contests/2020多校联合训练/杭电/题解/杭电多校5_题解_数据_标程/杭电多校5_题解_数据_标程/多校标程/1007.cpp | 5e84265aaad797c8a9fe0ae2886ef3580bc068ee | [] | no_license | heyuhhh/ACM | 4fe0239b7f55a62db5bc47aaf086e187134fb7e6 | e1ea34686b41a6c5b3f395dd9c76472220e9db5d | refs/heads/master | 2021-06-25T03:59:51.580876 | 2021-04-27T07:22:51 | 2021-04-27T07:22:51 | 223,877,467 | 9 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,051 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair <ll,ll> pii;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rept(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=x;i>=y;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define fi first
#define se second
#define mes(a,b) memset(a,b,sizeof a)
#define mp make_pair
#define dd(x) cout<<#x<<"="<<x<<" "
#define de(x) cout<<#x<<"="<<x<<"\n"
#define debug() cout<<"I love Miyamizu Mitsuha forever.\n"
const int inf=0x3f3f3f3f;
const int maxn=2e5+5;
int n,k;
ll dp[maxn][3];
vector<pii> v[maxn];
ll ans=0;
pii val[maxn];
ll prefix[maxn],suffix[maxn];
bool comp(const pii &s1,const pii &s2)
{
return s1.fi>s2.fi||(s1.fi==s2.fi&&s1.se>s2.se);
}
ll getinit(int n)
{
sort(val+1,val+1+n,comp);
prefix[0]=0;
rept(i,1,n) prefix[i]=max(prefix[i-1],val[i].se-val[i].fi);
suffix[n+1]=0;
for(int i=n;i>=1;i--) suffix[i]=max(suffix[i+1],val[i].se);
}
ll getval(int n,int cnt)
{
if(cnt<=0) return 0;
ll sum=0,ans=0;
rept(i,1,min(n,cnt))
{
sum+=val[i].fi;
}
if(n<=cnt) return sum+prefix[n];
ans=max(ans,sum+prefix[cnt]);
ans=max(ans,sum-val[cnt].fi+suffix[cnt+1]);
return ans;
}
void dfs(int id,int f)
{
int cnt=0;
rep(i,0,v[id].size())
if(v[id][i].fi!=f) dfs(v[id][i].fi,id);
rep(i,0,v[id].size())
{
if(v[id][i].fi!=f)
{
cnt++;
val[cnt].fi=dp[v[id][i].fi][0]+v[id][i].se;
val[cnt].se=dp[v[id][i].fi][1]+v[id][i].se;
}
}
getinit(cnt);
dp[id][0]=dp[id][1]=0;
rept(i,1,cnt) dp[id][1]+=val[i].fi;
rept(i,1,min(cnt,k-1)) dp[id][0]+=val[i].fi;
dp[id][1]=max(dp[id][1],getval(cnt,k-1));
ans=max(ans,getval(cnt,k));
ans=max(ans,dp[id][1]);
}
void test()
{
ans=0;
cin>>n>>k;
rept(i,1,n) v[i].clear();
rep(i,1,n)
{
int a,b,d;
cin>>a>>b>>d;
v[a].pb(mp(b,d));
v[b].pb(mp(a,d));
}
if(k==0)
{
cout<<"0\n";
return ;
}
dfs(1,-1);
cout<<ans<<"\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int q;
cin>>q;
while(q--) test();
return 0;
} | [
"2468861298@qq.com"
] | 2468861298@qq.com |
4cb999eba24d861489fb5ab531427246094553c8 | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/base/efiutil/efilib/inc/ifssys.hxx | 7472d909ff54aae4f07f6e1ebcf94efe97a4e73d | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,702 | hxx | /*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
ifssys.hxx
Abstract:
This module contains the definition for the IFS_SYSTEM class.
The IFS_SYSTEM class is an abstract class which offers an
interface for communicating with the underlying operating system
on specific IFS issues.
--*/
#if ! defined( _IFS_SYSTEM_ )
#define _IFS_SYSTEM_
#include "drive.hxx"
#if defined ( _AUTOCHECK_ ) || defined( _EFICHECK_ )
#define IFSUTIL_EXPORT
#elif defined ( _IFSUTIL_MEMBER_ )
#define IFSUTIL_EXPORT __declspec(dllexport)
#else
#define IFSUTIL_EXPORT __declspec(dllimport)
#endif
DECLARE_CLASS( CANNED_SECURITY );
DECLARE_CLASS( WSTRING );
DECLARE_CLASS( BIG_INT );
DECLARE_CLASS( IFS_SYSTEM );
class IFS_SYSTEM {
public:
STATIC
IFSUTIL_EXPORT
BOOLEAN
QueryNtfsVersion(
OUT PUCHAR Major,
OUT PUCHAR Minor,
IN PLOG_IO_DP_DRIVE Drive,
IN PVOID BootSectorData
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
QueryFileSystemName(
IN PCWSTRING NtDriveName,
OUT PWSTRING FileSystemName,
OUT PNTSTATUS ErrorCode DEFAULT NULL,
OUT PWSTRING FileSystemNameAndVersion DEFAULT NULL
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
DosDriveNameToNtDriveName(
IN PCWSTRING DosDriveName,
OUT PWSTRING NtDriveName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
NtDriveNameToDosDriveName(
IN PCWSTRING NtDriveName,
OUT PWSTRING DosDriveName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
QueryFreeDiskSpace(
IN PCWSTRING DosDriveName,
OUT PBIG_INT BytesFree
);
STATIC
IFSUTIL_EXPORT
VOID
QueryNtfsTime(
OUT PLARGE_INTEGER NtfsTime
);
STATIC
VOID
Reboot(
IN BOOLEAN PowerOff DEFAULT FALSE
);
STATIC
IFSUTIL_EXPORT
PCANNED_SECURITY
GetCannedSecurity(
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
EnableFileSystem(
IN PCWSTRING FileSystemName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
IsFileSystemEnabled(
IN PCWSTRING FileSystemName,
OUT PBOOLEAN Error DEFAULT NULL
);
STATIC
IFSUTIL_EXPORT
ULONG
QueryPageSize(
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
QueryCanonicalNtDriveName(
IN PCWSTRING NtDriveName,
OUT PWSTRING CanonicalNtDriveName
);
STATIC
BOOLEAN
QueryNtSystemDriveName(
OUT PWSTRING NtSystemDriveName
);
STATIC
BOOLEAN
QuerySystemEnvironmentVariableValue(
IN PWSTRING VariableName,
IN ULONG ValueBufferLength,
OUT PVOID ValueBuffer,
OUT PUSHORT ValueLength
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
IsArcSystemPartition(
IN PCWSTRING NtDriveName,
OUT PBOOLEAN Error
);
STATIC
BOOLEAN
IsThisFat(
IN BIG_INT Sectors,
IN PVOID BootSectorData
);
STATIC
BOOLEAN
IsThisFat32(
IN BIG_INT Sectors,
IN PVOID BootSectorData
);
STATIC
BOOLEAN
IsThisHpfs(
IN BIG_INT Sectors,
IN PVOID BootSectorData,
IN PULONG SuperBlock,
IN PULONG SpareBlock
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
IsThisNtfs(
IN BIG_INT Sectors,
IN ULONG SectorSize,
IN PVOID BootSectorData
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
FileSetAttributes(
IN PCWSTRING FileName,
IN ULONG NewFileAttributes,
OUT PULONG OldAttributes
);
STATIC
BOOLEAN
FileSetAttributes(
IN HANDLE FileHandle,
IN ULONG NewFileAttributes,
OUT PULONG OldAttributes
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
WriteToFile(
IN PCWSTRING QualifiedFileName,
IN PVOID Data,
IN ULONG DataLength,
IN BOOLEAN Append
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
EnableVolumeCompression(
IN PCWSTRING NtDriveName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
EnableVolumeUpgrade(
IN PCWSTRING NtDriveName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
DismountVolume(
IN PCWSTRING NtDriveName
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
CheckValidSecurityDescriptor(
IN ULONG Length,
IN PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor
);
STATIC
IFSUTIL_EXPORT
BOOLEAN
IsVolumeDirty(
IN PWSTRING NtDriveName,
OUT PBOOLEAN Result
);
private:
STATIC PCANNED_SECURITY _CannedSecurity;
};
#endif // _IFS_SYSTEM_
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
75672954f7873b8bf580b064795b3a11bb159730 | cb1b800db9c2475b1f342fd892af869e1e5ab41d | /robogym_ws/devel/.private/moveit_msgs/include/moveit_msgs/JointLimits.h | e2a188392d344bbc2c761d22c48a8428125c7275 | [] | no_license | klekkala/robogym_moveit | c64cb49f9fe11d5dbd2b10816708e323f772a4f6 | d5cdb3c177b719dd8366e0e1c741c5fd5e97521a | refs/heads/main | 2023-04-23T23:45:52.593518 | 2021-05-17T06:34:57 | 2021-05-17T06:34:57 | 365,917,056 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,995 | h | // Generated by gencpp from file moveit_msgs/JointLimits.msg
// DO NOT EDIT!
#ifndef MOVEIT_MSGS_MESSAGE_JOINTLIMITS_H
#define MOVEIT_MSGS_MESSAGE_JOINTLIMITS_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
namespace moveit_msgs
{
template <class ContainerAllocator>
struct JointLimits_
{
typedef JointLimits_<ContainerAllocator> Type;
JointLimits_()
: joint_name()
, has_position_limits(false)
, min_position(0.0)
, max_position(0.0)
, has_velocity_limits(false)
, max_velocity(0.0)
, has_acceleration_limits(false)
, max_acceleration(0.0) {
}
JointLimits_(const ContainerAllocator& _alloc)
: joint_name(_alloc)
, has_position_limits(false)
, min_position(0.0)
, max_position(0.0)
, has_velocity_limits(false)
, max_velocity(0.0)
, has_acceleration_limits(false)
, max_acceleration(0.0) {
(void)_alloc;
}
typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _joint_name_type;
_joint_name_type joint_name;
typedef uint8_t _has_position_limits_type;
_has_position_limits_type has_position_limits;
typedef double _min_position_type;
_min_position_type min_position;
typedef double _max_position_type;
_max_position_type max_position;
typedef uint8_t _has_velocity_limits_type;
_has_velocity_limits_type has_velocity_limits;
typedef double _max_velocity_type;
_max_velocity_type max_velocity;
typedef uint8_t _has_acceleration_limits_type;
_has_acceleration_limits_type has_acceleration_limits;
typedef double _max_acceleration_type;
_max_acceleration_type max_acceleration;
typedef boost::shared_ptr< ::moveit_msgs::JointLimits_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::moveit_msgs::JointLimits_<ContainerAllocator> const> ConstPtr;
}; // struct JointLimits_
typedef ::moveit_msgs::JointLimits_<std::allocator<void> > JointLimits;
typedef boost::shared_ptr< ::moveit_msgs::JointLimits > JointLimitsPtr;
typedef boost::shared_ptr< ::moveit_msgs::JointLimits const> JointLimitsConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::moveit_msgs::JointLimits_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::moveit_msgs::JointLimits_<ContainerAllocator> >::stream(s, "", v);
return s;
}
template<typename ContainerAllocator1, typename ContainerAllocator2>
bool operator==(const ::moveit_msgs::JointLimits_<ContainerAllocator1> & lhs, const ::moveit_msgs::JointLimits_<ContainerAllocator2> & rhs)
{
return lhs.joint_name == rhs.joint_name &&
lhs.has_position_limits == rhs.has_position_limits &&
lhs.min_position == rhs.min_position &&
lhs.max_position == rhs.max_position &&
lhs.has_velocity_limits == rhs.has_velocity_limits &&
lhs.max_velocity == rhs.max_velocity &&
lhs.has_acceleration_limits == rhs.has_acceleration_limits &&
lhs.max_acceleration == rhs.max_acceleration;
}
template<typename ContainerAllocator1, typename ContainerAllocator2>
bool operator!=(const ::moveit_msgs::JointLimits_<ContainerAllocator1> & lhs, const ::moveit_msgs::JointLimits_<ContainerAllocator2> & rhs)
{
return !(lhs == rhs);
}
} // namespace moveit_msgs
namespace ros
{
namespace message_traits
{
template <class ContainerAllocator>
struct IsFixedSize< ::moveit_msgs::JointLimits_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::moveit_msgs::JointLimits_<ContainerAllocator> const>
: FalseType
{ };
template <class ContainerAllocator>
struct IsMessage< ::moveit_msgs::JointLimits_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::moveit_msgs::JointLimits_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::moveit_msgs::JointLimits_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::moveit_msgs::JointLimits_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::moveit_msgs::JointLimits_<ContainerAllocator> >
{
static const char* value()
{
return "8ca618c7329ea46142cbc864a2efe856";
}
static const char* value(const ::moveit_msgs::JointLimits_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0x8ca618c7329ea461ULL;
static const uint64_t static_value2 = 0x42cbc864a2efe856ULL;
};
template<class ContainerAllocator>
struct DataType< ::moveit_msgs::JointLimits_<ContainerAllocator> >
{
static const char* value()
{
return "moveit_msgs/JointLimits";
}
static const char* value(const ::moveit_msgs::JointLimits_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::moveit_msgs::JointLimits_<ContainerAllocator> >
{
static const char* value()
{
return "# This message contains information about limits of a particular joint (or control dimension)\n"
"string joint_name\n"
"\n"
"# true if the joint has position limits\n"
"bool has_position_limits\n"
"\n"
"# min and max position limits\n"
"float64 min_position\n"
"float64 max_position\n"
"\n"
"# true if joint has velocity limits\n"
"bool has_velocity_limits\n"
"\n"
"# max velocity limit\n"
"float64 max_velocity\n"
"# min_velocity is assumed to be -max_velocity\n"
"\n"
"# true if joint has acceleration limits\n"
"bool has_acceleration_limits\n"
"# max acceleration limit\n"
"float64 max_acceleration\n"
"# min_acceleration is assumed to be -max_acceleration\n"
;
}
static const char* value(const ::moveit_msgs::JointLimits_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::moveit_msgs::JointLimits_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.joint_name);
stream.next(m.has_position_limits);
stream.next(m.min_position);
stream.next(m.max_position);
stream.next(m.has_velocity_limits);
stream.next(m.max_velocity);
stream.next(m.has_acceleration_limits);
stream.next(m.max_acceleration);
}
ROS_DECLARE_ALLINONE_SERIALIZER
}; // struct JointLimits_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::moveit_msgs::JointLimits_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::moveit_msgs::JointLimits_<ContainerAllocator>& v)
{
s << indent << "joint_name: ";
Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.joint_name);
s << indent << "has_position_limits: ";
Printer<uint8_t>::stream(s, indent + " ", v.has_position_limits);
s << indent << "min_position: ";
Printer<double>::stream(s, indent + " ", v.min_position);
s << indent << "max_position: ";
Printer<double>::stream(s, indent + " ", v.max_position);
s << indent << "has_velocity_limits: ";
Printer<uint8_t>::stream(s, indent + " ", v.has_velocity_limits);
s << indent << "max_velocity: ";
Printer<double>::stream(s, indent + " ", v.max_velocity);
s << indent << "has_acceleration_limits: ";
Printer<uint8_t>::stream(s, indent + " ", v.has_acceleration_limits);
s << indent << "max_acceleration: ";
Printer<double>::stream(s, indent + " ", v.max_acceleration);
}
};
} // namespace message_operations
} // namespace ros
#endif // MOVEIT_MSGS_MESSAGE_JOINTLIMITS_H
| [
"haomengz@usc.edu"
] | haomengz@usc.edu |
70924403fa05516ef837c81536d5ff4ee73e14ae | dcc9e001d4b4a2d04c7adc212e10157d7cc054ce | /SFML_Asteroids/SFML_Asteroids/Main.cpp | 10684a8011a48c56bc6e845f91339765a037e375 | [] | no_license | UchihaKite/SFML_HI_Prototype | 0ffa801e228715d67cec9fd917083d061e4e4bac | d4c6ecffba3c0eea48e275ec2a2894bd6e01fecb | refs/heads/master | 2021-10-23T21:14:03.810859 | 2019-03-20T03:38:29 | 2019-03-20T03:38:29 | 155,454,906 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,550 | cpp | #include "Engine.h"
#include "StarParticleSystem.h"
#include <iostream>
// Declare the Resoltuion of the Game
sf::Vector2i g_Resolution(sf::VideoMode::getDesktopMode().width / 2, sf::VideoMode::getDesktopMode().height / 2);
int main()
{
// Create the Window
sf::RenderWindow s_Window(sf::VideoMode(g_Resolution.x, g_Resolution.y), "Asteroids!");
s_Window.setFramerateLimit(60);
std::shared_ptr<SoundManager> sp_SoundManager = std::make_shared<SoundManager>();
sp_SoundManager->LoadSoundBuffers();
sp_SoundManager->SetLoop(BACKGROUND_SONG, true);
std::shared_ptr<TextureManager> sp_TextureManager = std::make_shared<TextureManager>();
sp_TextureManager->LoadTextures();
int NumPlayers = 0;
std::shared_ptr<int> sp_NumPlayers = std::make_shared<int>(NumPlayers);
// Hide the Mouse Cursor
s_Window.setMouseCursorVisible(false);
// Background Music for the Game
// Use the SoundManager
sp_SoundManager->PlaySound(BACKGROUND_SONG);
// Delcare Instance of the Engine
Engine s_Engine(sp_SoundManager, sp_TextureManager, sp_NumPlayers);
sf::Image s_StarImage;
s_StarImage.create(g_Resolution.x, g_Resolution.y, sf::Color::Black);
/*
Do not use the TextureContainer if you are using a "sf::Image"
variable to initialize your Texture variable
*/
sf::Texture s_StarTexture;
s_StarTexture.loadFromImage(s_StarImage);
s_StarTexture.setSmooth(false);
sf::Sprite s_StarSprite;
s_StarSprite.setTexture(s_StarTexture);
s_StarSprite.setPosition(0.0f, 0.0f);
Starfield s_BackgroundStars(&s_Window);
// Declare a Clock in Order to Obtain the DeltaTime
sf::Clock s_Clock;
while (s_Window.isOpen())
{
// Store the Time Between Frames
sf::Time s_Time = s_Clock.restart();
// Store that Time, As Seconds, into a Float
float s_DeltaTimeAsSeconds = s_Time.asSeconds();
sf::Event s_Event;
while (s_Window.pollEvent(s_Event))
{
if (s_Event.type == sf::Event::KeyPressed)
{
if (s_Event.key.code == sf::Keyboard::Escape)
{
s_Window.close(); // Press "ESC" to Close the Window/Game
}
}
if (s_Event.type == sf::Event::Closed)
{
s_Window.close(); // Click the "X" to Close the Window/Game
}
}
s_Window.clear();
s_StarTexture.loadFromImage(s_StarImage);
s_BackgroundStars.Update(&s_Window, s_DeltaTimeAsSeconds);
s_BackgroundStars.Draw(s_StarTexture);
s_Window.draw(s_StarSprite);
s_Engine.Update(&s_Window, s_DeltaTimeAsSeconds); // Update all Internals before Drawing Anything
s_Engine.Draw(&s_Window); // Draw all Internals
s_Window.display();
}
return 0;
} | [
"UchihaKite@gmail.com"
] | UchihaKite@gmail.com |
785cdec90c2e67b9d52375ad0831926fd5aee4ca | fd87c754b7474e2f415b95e16dd6da431e4e488b | /test.cpp | cf6c33127cc97e5b18ab6545f7789df1f733489a | [] | no_license | takaryu0916/test | c11a6bceaf90776b1254aa8befb1bf9e49824218 | d85ebc2e1f201629e836ccf56bbfbba16357e4ce | refs/heads/master | 2020-04-02T05:35:14.210842 | 2018-10-22T04:52:02 | 2018-10-22T04:52:02 | 154,090,015 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 71 | cpp | #include <stdio.h>
void test()
{
printf("hello world");
return 0;
} | [
"takaryu0916@gmail.com"
] | takaryu0916@gmail.com |
416dac24b0e08967bedcc1475ff4e7a51aa946ea | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /third_party/blink/renderer/core/css/rule_feature_set.cc | 5deeff346cc1073f664ac11b79820712e9105ce0 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"MIT",
"Apache-2.0"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | C++ | false | false | 49,802 | cc | /*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
* Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All
* rights reserved.
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
* Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
* (http://www.torchmobile.com/)
* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "third_party/blink/renderer/core/css/rule_feature_set.h"
#include <bitset>
#include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
#include "third_party/blink/renderer/core/css/css_function_value.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
#include "third_party/blink/renderer/core/css/css_selector.h"
#include "third_party/blink/renderer/core/css/css_selector_list.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/invalidation/invalidation_set.h"
#include "third_party/blink/renderer/core/css/rule_set.h"
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
namespace {
bool SupportsInvalidation(CSSSelector::MatchType match) {
switch (match) {
case CSSSelector::kTag:
case CSSSelector::kId:
case CSSSelector::kClass:
case CSSSelector::kAttributeExact:
case CSSSelector::kAttributeSet:
case CSSSelector::kAttributeHyphen:
case CSSSelector::kAttributeList:
case CSSSelector::kAttributeContain:
case CSSSelector::kAttributeBegin:
case CSSSelector::kAttributeEnd:
return true;
case CSSSelector::kUnknown:
case CSSSelector::kPagePseudoClass:
// These should not appear in StyleRule selectors.
NOTREACHED();
return false;
default:
// New match type added. Figure out if it needs a subtree invalidation or
// not.
NOTREACHED();
return false;
}
}
bool SupportsInvalidation(CSSSelector::PseudoType type) {
switch (type) {
case CSSSelector::kPseudoEmpty:
case CSSSelector::kPseudoFirstChild:
case CSSSelector::kPseudoFirstOfType:
case CSSSelector::kPseudoLastChild:
case CSSSelector::kPseudoLastOfType:
case CSSSelector::kPseudoOnlyChild:
case CSSSelector::kPseudoOnlyOfType:
case CSSSelector::kPseudoNthChild:
case CSSSelector::kPseudoNthOfType:
case CSSSelector::kPseudoNthLastChild:
case CSSSelector::kPseudoNthLastOfType:
case CSSSelector::kPseudoPart:
case CSSSelector::kPseudoLink:
case CSSSelector::kPseudoVisited:
case CSSSelector::kPseudoAny:
case CSSSelector::kPseudoWebkitAnyLink:
case CSSSelector::kPseudoAnyLink:
case CSSSelector::kPseudoAutofill:
case CSSSelector::kPseudoAutofillPreviewed:
case CSSSelector::kPseudoAutofillSelected:
case CSSSelector::kPseudoHover:
case CSSSelector::kPseudoDrag:
case CSSSelector::kPseudoFocus:
case CSSSelector::kPseudoFocusVisible:
case CSSSelector::kPseudoFocusWithin:
case CSSSelector::kPseudoActive:
case CSSSelector::kPseudoChecked:
case CSSSelector::kPseudoEnabled:
case CSSSelector::kPseudoFullPageMedia:
case CSSSelector::kPseudoDefault:
case CSSSelector::kPseudoDisabled:
case CSSSelector::kPseudoOptional:
case CSSSelector::kPseudoPlaceholderShown:
case CSSSelector::kPseudoRequired:
case CSSSelector::kPseudoReadOnly:
case CSSSelector::kPseudoReadWrite:
case CSSSelector::kPseudoValid:
case CSSSelector::kPseudoInvalid:
case CSSSelector::kPseudoIndeterminate:
case CSSSelector::kPseudoTarget:
case CSSSelector::kPseudoBefore:
case CSSSelector::kPseudoAfter:
case CSSSelector::kPseudoBackdrop:
case CSSSelector::kPseudoLang:
case CSSSelector::kPseudoNot:
case CSSSelector::kPseudoPlaceholder:
case CSSSelector::kPseudoResizer:
case CSSSelector::kPseudoRoot:
case CSSSelector::kPseudoScope:
case CSSSelector::kPseudoScrollbar:
case CSSSelector::kPseudoScrollbarButton:
case CSSSelector::kPseudoScrollbarCorner:
case CSSSelector::kPseudoScrollbarThumb:
case CSSSelector::kPseudoScrollbarTrack:
case CSSSelector::kPseudoScrollbarTrackPiece:
case CSSSelector::kPseudoWindowInactive:
case CSSSelector::kPseudoSelection:
case CSSSelector::kPseudoCornerPresent:
case CSSSelector::kPseudoDecrement:
case CSSSelector::kPseudoIncrement:
case CSSSelector::kPseudoHorizontal:
case CSSSelector::kPseudoVertical:
case CSSSelector::kPseudoStart:
case CSSSelector::kPseudoEnd:
case CSSSelector::kPseudoDoubleButton:
case CSSSelector::kPseudoSingleButton:
case CSSSelector::kPseudoNoButton:
case CSSSelector::kPseudoFullScreen:
case CSSSelector::kPseudoFullScreenAncestor:
case CSSSelector::kPseudoFullscreen:
case CSSSelector::kPseudoPictureInPicture:
case CSSSelector::kPseudoInRange:
case CSSSelector::kPseudoOutOfRange:
case CSSSelector::kPseudoWebKitCustomElement:
case CSSSelector::kPseudoBlinkInternalElement:
case CSSSelector::kPseudoCue:
case CSSSelector::kPseudoFutureCue:
case CSSSelector::kPseudoPastCue:
case CSSSelector::kPseudoUnresolved:
case CSSSelector::kPseudoDefined:
case CSSSelector::kPseudoContent:
case CSSSelector::kPseudoHost:
case CSSSelector::kPseudoShadow:
case CSSSelector::kPseudoSpatialNavigationFocus:
case CSSSelector::kPseudoSpatialNavigationInterest:
case CSSSelector::kPseudoIsHtml:
case CSSSelector::kPseudoListBox:
case CSSSelector::kPseudoHostHasAppearance:
case CSSSelector::kPseudoSlotted:
case CSSSelector::kPseudoVideoPersistent:
case CSSSelector::kPseudoVideoPersistentAncestor:
return true;
case CSSSelector::kPseudoIs:
case CSSSelector::kPseudoWhere:
case CSSSelector::kPseudoUnknown:
case CSSSelector::kPseudoLeftPage:
case CSSSelector::kPseudoRightPage:
case CSSSelector::kPseudoFirstPage:
// These should not appear in StyleRule selectors.
NOTREACHED();
return false;
default:
// New pseudo type added. Figure out if it needs a subtree invalidation or
// not.
NOTREACHED();
return false;
}
}
bool SupportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo) {
return pseudo == CSSSelector::kPseudoAny ||
pseudo == CSSSelector::kPseudoCue ||
pseudo == CSSSelector::kPseudoHost ||
pseudo == CSSSelector::kPseudoHostContext ||
pseudo == CSSSelector::kPseudoNot ||
pseudo == CSSSelector::kPseudoSlotted;
}
bool RequiresSubtreeInvalidation(const CSSSelector& selector) {
if (selector.Match() != CSSSelector::kPseudoElement &&
selector.Match() != CSSSelector::kPseudoClass) {
DCHECK(SupportsInvalidation(selector.Match()));
return false;
}
switch (selector.GetPseudoType()) {
case CSSSelector::kPseudoFirstLine:
case CSSSelector::kPseudoFirstLetter:
// FIXME: Most pseudo classes/elements above can be supported and moved
// to assertSupportedPseudo(). Move on a case-by-case basis. If they
// require subtree invalidation, document why.
case CSSSelector::kPseudoHostContext:
// :host-context matches a shadow host, yet the simple selectors inside
// :host-context matches an ancestor of the shadow host.
return true;
default:
DCHECK(SupportsInvalidation(selector.GetPseudoType()));
return false;
}
}
// Creates a copy of an InvalidationSet by combining an empty InvalidationSet
// (of the same type) with the specified InvalidationSet.
//
// See also InvalidationSet::Combine.
scoped_refptr<InvalidationSet> CopyInvalidationSet(
const InvalidationSet& invalidation_set) {
if (invalidation_set.IsSiblingInvalidationSet()) {
scoped_refptr<InvalidationSet> copy =
SiblingInvalidationSet::Create(nullptr);
copy->Combine(invalidation_set);
return copy;
}
if (invalidation_set.IsSelfInvalidationSet()) {
scoped_refptr<InvalidationSet> copy = DescendantInvalidationSet::Create();
copy->SetInvalidatesSelf();
return copy;
}
scoped_refptr<InvalidationSet> copy = DescendantInvalidationSet::Create();
copy->Combine(invalidation_set);
return copy;
}
} // anonymous namespace
InvalidationSet& RuleFeatureSet::EnsureMutableInvalidationSet(
scoped_refptr<InvalidationSet>& invalidation_set,
InvalidationType type,
PositionType position) {
if (invalidation_set && invalidation_set->IsSelfInvalidationSet()) {
if (type == InvalidationType::kInvalidateDescendants &&
position == kSubject)
return *invalidation_set;
// If we are retrieving the invalidation set for a simple selector in a non-
// rightmost compound, it means we plan to add features to the set. If so,
// create a DescendantInvalidationSet we are allowed to modify.
//
// Note that we also construct a DescendantInvalidationSet instead of using
// the SelfInvalidationSet() when we create a SiblingInvalidationSet. We may
// be able to let SiblingInvalidationSets reference the singleton set for
// descendants as well. TODO(futhark@chromium.org)
invalidation_set = CopyInvalidationSet(*invalidation_set);
DCHECK(invalidation_set->HasOneRef());
}
if (!invalidation_set) {
if (type == InvalidationType::kInvalidateDescendants) {
if (position == kSubject)
invalidation_set = InvalidationSet::SelfInvalidationSet();
else
invalidation_set = DescendantInvalidationSet::Create();
} else {
invalidation_set = SiblingInvalidationSet::Create(nullptr);
}
return *invalidation_set;
}
// If the currently stored invalidation_set is shared with other
// RuleFeatureSets (for example), we must copy it before modifying it.
if (!invalidation_set->HasOneRef()) {
invalidation_set = CopyInvalidationSet(*invalidation_set);
DCHECK(invalidation_set->HasOneRef());
}
if (invalidation_set->GetType() == type)
return *invalidation_set;
if (type == InvalidationType::kInvalidateDescendants)
return To<SiblingInvalidationSet>(*invalidation_set).EnsureDescendants();
scoped_refptr<InvalidationSet> descendants = invalidation_set;
invalidation_set = SiblingInvalidationSet::Create(
To<DescendantInvalidationSet>(descendants.get()));
return *invalidation_set;
}
InvalidationSet& RuleFeatureSet::EnsureInvalidationSet(InvalidationSetMap& map,
const AtomicString& key,
InvalidationType type,
PositionType position) {
scoped_refptr<InvalidationSet>& invalidation_set =
map.insert(key, nullptr).stored_value->value;
return EnsureMutableInvalidationSet(invalidation_set, type, position);
}
InvalidationSet& RuleFeatureSet::EnsureInvalidationSet(
PseudoTypeInvalidationSetMap& map,
CSSSelector::PseudoType key,
InvalidationType type,
PositionType position) {
scoped_refptr<InvalidationSet>& invalidation_set =
map.insert(key, nullptr).stored_value->value;
return EnsureMutableInvalidationSet(invalidation_set, type, position);
}
void RuleFeatureSet::AddInvalidationSet(
InvalidationSetMap& map,
const AtomicString& key,
scoped_refptr<InvalidationSet> invalidation_set) {
DCHECK(invalidation_set);
scoped_refptr<InvalidationSet>& slot =
map.insert(key, nullptr).stored_value->value;
if (!slot) {
slot = invalidation_set;
} else {
EnsureInvalidationSet(
map, key, invalidation_set->GetType(),
invalidation_set->IsSelfInvalidationSet() ? kSubject : kAncestor)
.Combine(*invalidation_set);
}
}
void RuleFeatureSet::AddInvalidationSet(
PseudoTypeInvalidationSetMap& map,
CSSSelector::PseudoType key,
scoped_refptr<InvalidationSet> invalidation_set) {
DCHECK(invalidation_set);
scoped_refptr<InvalidationSet>& slot =
map.insert(key, nullptr).stored_value->value;
if (!slot) {
slot = invalidation_set;
} else {
EnsureInvalidationSet(
map, key, invalidation_set->GetType(),
invalidation_set->IsSelfInvalidationSet() ? kSubject : kAncestor)
.Combine(*invalidation_set);
}
}
void ExtractInvalidationSets(InvalidationSet* invalidation_set,
DescendantInvalidationSet*& descendants,
SiblingInvalidationSet*& siblings) {
CHECK(invalidation_set->IsAlive());
if (auto* descendant =
DynamicTo<DescendantInvalidationSet>(invalidation_set)) {
descendants = descendant;
siblings = nullptr;
return;
}
siblings = To<SiblingInvalidationSet>(invalidation_set);
descendants = siblings->Descendants();
}
RuleFeatureSet::RuleFeatureSet() : is_alive_(true) {}
RuleFeatureSet::~RuleFeatureSet() {
CHECK(is_alive_);
metadata_.Clear();
class_invalidation_sets_.clear();
attribute_invalidation_sets_.clear();
id_invalidation_sets_.clear();
pseudo_invalidation_sets_.clear();
universal_sibling_invalidation_set_ = nullptr;
nth_invalidation_set_ = nullptr;
is_alive_ = false;
}
ALWAYS_INLINE InvalidationSet& RuleFeatureSet::EnsureClassInvalidationSet(
const AtomicString& class_name,
InvalidationType type,
PositionType position) {
CHECK(!class_name.IsEmpty());
return EnsureInvalidationSet(class_invalidation_sets_, class_name, type,
position);
}
ALWAYS_INLINE InvalidationSet& RuleFeatureSet::EnsureAttributeInvalidationSet(
const AtomicString& attribute_name,
InvalidationType type,
PositionType position) {
CHECK(!attribute_name.IsEmpty());
return EnsureInvalidationSet(attribute_invalidation_sets_, attribute_name,
type, position);
}
ALWAYS_INLINE InvalidationSet& RuleFeatureSet::EnsureIdInvalidationSet(
const AtomicString& id,
InvalidationType type,
PositionType position) {
CHECK(!id.IsEmpty());
return EnsureInvalidationSet(id_invalidation_sets_, id, type, position);
}
ALWAYS_INLINE InvalidationSet& RuleFeatureSet::EnsurePseudoInvalidationSet(
CSSSelector::PseudoType pseudo_type,
InvalidationType type,
PositionType position) {
CHECK_NE(pseudo_type, CSSSelector::kPseudoUnknown);
return EnsureInvalidationSet(pseudo_invalidation_sets_, pseudo_type, type,
position);
}
void RuleFeatureSet::UpdateFeaturesFromCombinator(
const CSSSelector& last_in_compound,
const CSSSelector* last_compound_in_adjacent_chain,
InvalidationSetFeatures& last_compound_in_adjacent_chain_features,
InvalidationSetFeatures*& sibling_features,
InvalidationSetFeatures& descendant_features) {
if (last_in_compound.IsAdjacentSelector()) {
if (!sibling_features) {
sibling_features = &last_compound_in_adjacent_chain_features;
if (last_compound_in_adjacent_chain) {
ExtractInvalidationSetFeaturesFromCompound(
*last_compound_in_adjacent_chain,
last_compound_in_adjacent_chain_features, kAncestor);
if (!last_compound_in_adjacent_chain_features.HasFeatures()) {
last_compound_in_adjacent_chain_features.invalidation_flags
.SetWholeSubtreeInvalid(true);
}
}
}
if (sibling_features->max_direct_adjacent_selectors == UINT_MAX)
return;
if (last_in_compound.Relation() == CSSSelector::kDirectAdjacent)
++sibling_features->max_direct_adjacent_selectors;
else
sibling_features->max_direct_adjacent_selectors = UINT_MAX;
return;
}
if (sibling_features &&
last_compound_in_adjacent_chain_features.max_direct_adjacent_selectors)
last_compound_in_adjacent_chain_features = InvalidationSetFeatures();
sibling_features = nullptr;
if (last_in_compound.IsShadowSelector())
descendant_features.invalidation_flags.SetTreeBoundaryCrossing(true);
if (last_in_compound.Relation() == CSSSelector::kShadowSlot ||
last_in_compound.RelationIsAffectedByPseudoContent())
descendant_features.invalidation_flags.SetInsertionPointCrossing(true);
if (last_in_compound.RelationIsAffectedByPseudoContent())
descendant_features.content_pseudo_crossing = true;
}
void RuleFeatureSet::ExtractInvalidationSetFeaturesFromSimpleSelector(
const CSSSelector& selector,
InvalidationSetFeatures& features) {
if (selector.Match() == CSSSelector::kTag &&
selector.TagQName().LocalName() != CSSSelector::UniversalSelectorAtom()) {
features.NarrowToTag(selector.TagQName().LocalName());
return;
}
if (selector.Match() == CSSSelector::kId) {
features.NarrowToId(selector.Value());
return;
}
if (selector.Match() == CSSSelector::kClass) {
features.NarrowToClass(selector.Value());
return;
}
if (selector.IsAttributeSelector()) {
features.NarrowToAttribute(selector.Attribute().LocalName());
return;
}
switch (selector.GetPseudoType()) {
case CSSSelector::kPseudoWebKitCustomElement:
case CSSSelector::kPseudoBlinkInternalElement:
features.invalidation_flags.SetInvalidateCustomPseudo(true);
return;
case CSSSelector::kPseudoSlotted:
features.invalidation_flags.SetInvalidatesSlotted(true);
return;
case CSSSelector::kPseudoPart:
features.invalidation_flags.SetInvalidatesParts(true);
features.invalidation_flags.SetTreeBoundaryCrossing(true);
return;
default:
return;
}
}
InvalidationSet* RuleFeatureSet::InvalidationSetForSimpleSelector(
const CSSSelector& selector,
InvalidationType type,
PositionType position) {
if (selector.Match() == CSSSelector::kClass)
return &EnsureClassInvalidationSet(selector.Value(), type, position);
if (selector.IsAttributeSelector()) {
return &EnsureAttributeInvalidationSet(selector.Attribute().LocalName(),
type, position);
}
if (selector.Match() == CSSSelector::kId)
return &EnsureIdInvalidationSet(selector.Value(), type, position);
if (selector.Match() == CSSSelector::kPseudoClass) {
switch (selector.GetPseudoType()) {
case CSSSelector::kPseudoEmpty:
case CSSSelector::kPseudoFirstChild:
case CSSSelector::kPseudoLastChild:
case CSSSelector::kPseudoOnlyChild:
case CSSSelector::kPseudoLink:
case CSSSelector::kPseudoVisited:
case CSSSelector::kPseudoWebkitAnyLink:
case CSSSelector::kPseudoAnyLink:
case CSSSelector::kPseudoAutofill:
case CSSSelector::kPseudoAutofillPreviewed:
case CSSSelector::kPseudoAutofillSelected:
case CSSSelector::kPseudoHover:
case CSSSelector::kPseudoDrag:
case CSSSelector::kPseudoFocus:
case CSSSelector::kPseudoFocusVisible:
case CSSSelector::kPseudoFocusWithin:
case CSSSelector::kPseudoActive:
case CSSSelector::kPseudoChecked:
case CSSSelector::kPseudoEnabled:
case CSSSelector::kPseudoDefault:
case CSSSelector::kPseudoDisabled:
case CSSSelector::kPseudoOptional:
case CSSSelector::kPseudoPlaceholderShown:
case CSSSelector::kPseudoRequired:
case CSSSelector::kPseudoReadOnly:
case CSSSelector::kPseudoReadWrite:
case CSSSelector::kPseudoValid:
case CSSSelector::kPseudoInvalid:
case CSSSelector::kPseudoIndeterminate:
case CSSSelector::kPseudoTarget:
case CSSSelector::kPseudoLang:
case CSSSelector::kPseudoFullScreen:
case CSSSelector::kPseudoFullScreenAncestor:
case CSSSelector::kPseudoFullscreen:
case CSSSelector::kPseudoPictureInPicture:
case CSSSelector::kPseudoInRange:
case CSSSelector::kPseudoOutOfRange:
case CSSSelector::kPseudoUnresolved:
case CSSSelector::kPseudoDefined:
case CSSSelector::kPseudoVideoPersistent:
case CSSSelector::kPseudoVideoPersistentAncestor:
case CSSSelector::kPseudoSpatialNavigationInterest:
return &EnsurePseudoInvalidationSet(selector.GetPseudoType(), type,
position);
case CSSSelector::kPseudoFirstOfType:
case CSSSelector::kPseudoLastOfType:
case CSSSelector::kPseudoOnlyOfType:
case CSSSelector::kPseudoNthChild:
case CSSSelector::kPseudoNthOfType:
case CSSSelector::kPseudoNthLastChild:
case CSSSelector::kPseudoNthLastOfType:
return &EnsureNthInvalidationSet();
case CSSSelector::kPseudoPart:
default:
break;
}
}
return nullptr;
}
void RuleFeatureSet::UpdateInvalidationSets(const RuleData* rule_data) {
// Given a rule, update the descendant invalidation sets for the features
// found in its selector. The first step is to extract the features from the
// rightmost compound selector (extractInvalidationSetFeaturesFromCompound).
// Secondly, add those features to the invalidation sets for the features
// found in the other compound selectors (addFeaturesToInvalidationSets). If
// we find a feature in the right-most compound selector that requires a
// subtree recalc, nextCompound will be the rightmost compound and we will
// addFeaturesToInvalidationSets for that one as well.
InvalidationSetFeatures features;
InvalidationSetFeatures* sibling_features = nullptr;
const CSSSelector* last_in_compound =
ExtractInvalidationSetFeaturesFromCompound(rule_data->Selector(),
features, kSubject);
if (features.invalidation_flags.WholeSubtreeInvalid())
features.has_features_for_rule_set_invalidation = false;
else if (!features.HasFeatures())
features.invalidation_flags.SetWholeSubtreeInvalid(true);
if (features.has_nth_pseudo)
AddFeaturesToInvalidationSet(EnsureNthInvalidationSet(), features);
const CSSSelector* next_compound = last_in_compound
? last_in_compound->TagHistory()
: &rule_data->Selector();
if (!next_compound) {
UpdateRuleSetInvalidation(features);
return;
}
if (last_in_compound) {
UpdateFeaturesFromCombinator(*last_in_compound, nullptr, features,
sibling_features, features);
}
AddFeaturesToInvalidationSets(*next_compound, sibling_features, features);
UpdateRuleSetInvalidation(features);
}
void RuleFeatureSet::UpdateRuleSetInvalidation(
const InvalidationSetFeatures& features) {
if (features.has_features_for_rule_set_invalidation)
return;
if (features.invalidation_flags.WholeSubtreeInvalid() ||
(!features.invalidation_flags.InvalidateCustomPseudo() &&
features.tag_names.IsEmpty())) {
metadata_.needs_full_recalc_for_rule_set_invalidation = true;
return;
}
EnsureTypeRuleInvalidationSet();
if (features.invalidation_flags.InvalidateCustomPseudo()) {
type_rule_invalidation_set_->SetCustomPseudoInvalid();
type_rule_invalidation_set_->SetTreeBoundaryCrossing();
}
for (auto tag_name : features.tag_names)
type_rule_invalidation_set_->AddTagName(tag_name);
}
RuleFeatureSet::FeatureInvalidationType
RuleFeatureSet::ExtractInvalidationSetFeaturesFromSelectorList(
const CSSSelector& simple_selector,
InvalidationSetFeatures& features,
PositionType position) {
const CSSSelectorList* selector_list = simple_selector.SelectorList();
if (!selector_list)
return kNormalInvalidation;
DCHECK(SupportsInvalidationWithSelectorList(simple_selector.GetPseudoType()));
const CSSSelector* sub_selector = selector_list->First();
bool all_sub_selectors_have_features = true;
InvalidationSetFeatures any_features;
for (; sub_selector; sub_selector = CSSSelectorList::Next(*sub_selector)) {
InvalidationSetFeatures compound_features;
if (!ExtractInvalidationSetFeaturesFromCompound(
*sub_selector, compound_features, position,
simple_selector.GetPseudoType())) {
// A null selector return means the sub-selector contained a
// selector which requiresSubtreeInvalidation().
DCHECK(compound_features.invalidation_flags.WholeSubtreeInvalid());
features.invalidation_flags.SetWholeSubtreeInvalid(true);
return kRequiresSubtreeInvalidation;
}
if (compound_features.has_nth_pseudo)
features.has_nth_pseudo = true;
if (!all_sub_selectors_have_features)
continue;
if (compound_features.HasFeatures())
any_features.Add(compound_features);
else
all_sub_selectors_have_features = false;
}
// Don't add any features if one of the sub-selectors of does not contain
// any invalidation set features. E.g. :-webkit-any(*, span).
if (all_sub_selectors_have_features)
features.NarrowToFeatures(any_features);
return kNormalInvalidation;
}
const CSSSelector* RuleFeatureSet::ExtractInvalidationSetFeaturesFromCompound(
const CSSSelector& compound,
InvalidationSetFeatures& features,
PositionType position,
CSSSelector::PseudoType pseudo) {
// Extract invalidation set features and return a pointer to the the last
// simple selector of the compound, or nullptr if one of the selectors
// requiresSubtreeInvalidation().
const CSSSelector* simple_selector = &compound;
for (;; simple_selector = simple_selector->TagHistory()) {
// Fall back to use subtree invalidations, even for features in the
// rightmost compound selector. Returning nullptr here will make
// addFeaturesToInvalidationSets start marking invalidation sets for
// subtree recalc for features in the rightmost compound selector.
if (RequiresSubtreeInvalidation(*simple_selector)) {
features.invalidation_flags.SetWholeSubtreeInvalid(true);
return nullptr;
}
// When inside a :not(), we should not use the found features for
// invalidation because we should invalidate elements _without_ that
// feature. On the other hand, we should still have invalidation sets
// for the features since we are able to detect when they change.
// That is, ".a" should not have ".b" in its invalidation set for
// ".a :not(.b)", but there should be an invalidation set for ".a" in
// ":not(.a) .b".
if (pseudo != CSSSelector::kPseudoNot) {
ExtractInvalidationSetFeaturesFromSimpleSelector(*simple_selector,
features);
}
// Initialize the entry in the invalidation set map for self-
// invalidation, if supported.
if (InvalidationSet* invalidation_set = InvalidationSetForSimpleSelector(
*simple_selector, InvalidationType::kInvalidateDescendants,
position)) {
if (invalidation_set == nth_invalidation_set_)
features.has_nth_pseudo = true;
else if (position == kSubject)
invalidation_set->SetInvalidatesSelf();
}
if (ExtractInvalidationSetFeaturesFromSelectorList(*simple_selector,
features, position) ==
kRequiresSubtreeInvalidation) {
DCHECK(features.invalidation_flags.WholeSubtreeInvalid());
return nullptr;
}
if (features.invalidation_flags.InvalidatesParts())
metadata_.invalidates_parts = true;
if (!simple_selector->TagHistory() ||
simple_selector->Relation() != CSSSelector::kSubSelector) {
features.has_features_for_rule_set_invalidation =
features.HasIdClassOrAttribute();
return simple_selector;
}
}
}
// Add features extracted from the rightmost compound selector to descendant
// invalidation sets for features found in other compound selectors.
//
// We use descendant invalidation for descendants, sibling invalidation for
// siblings and their subtrees.
//
// As we encounter a descendant type of combinator, the features only need to be
// checked against descendants in the same subtree only. features.adjacent is
// set to false, and we start adding features to the descendant invalidation
// set.
void RuleFeatureSet::AddFeaturesToInvalidationSet(
InvalidationSet& invalidation_set,
const InvalidationSetFeatures& features) {
if (features.invalidation_flags.TreeBoundaryCrossing())
invalidation_set.SetTreeBoundaryCrossing();
if (features.invalidation_flags.InsertionPointCrossing())
invalidation_set.SetInsertionPointCrossing();
if (features.invalidation_flags.InvalidatesSlotted())
invalidation_set.SetInvalidatesSlotted();
if (features.invalidation_flags.WholeSubtreeInvalid())
invalidation_set.SetWholeSubtreeInvalid();
if (features.invalidation_flags.InvalidatesParts())
invalidation_set.SetInvalidatesParts();
if (features.content_pseudo_crossing ||
features.invalidation_flags.WholeSubtreeInvalid())
return;
for (const auto& id : features.ids)
invalidation_set.AddId(id);
for (const auto& tag_name : features.tag_names)
invalidation_set.AddTagName(tag_name);
for (const auto& class_name : features.classes)
invalidation_set.AddClass(class_name);
for (const auto& attribute : features.attributes)
invalidation_set.AddAttribute(attribute);
if (features.invalidation_flags.InvalidateCustomPseudo())
invalidation_set.SetCustomPseudoInvalid();
}
void RuleFeatureSet::AddFeaturesToInvalidationSetsForSelectorList(
const CSSSelector& simple_selector,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) {
if (!simple_selector.SelectorList())
return;
DCHECK(SupportsInvalidationWithSelectorList(simple_selector.GetPseudoType()));
bool had_features_for_rule_set_invalidation =
descendant_features.has_features_for_rule_set_invalidation;
bool selector_list_contains_universal =
simple_selector.GetPseudoType() == CSSSelector::kPseudoNot ||
simple_selector.GetPseudoType() == CSSSelector::kPseudoHostContext;
for (const CSSSelector* sub_selector =
simple_selector.SelectorList()->First();
sub_selector; sub_selector = CSSSelectorList::Next(*sub_selector)) {
descendant_features.has_features_for_rule_set_invalidation = false;
AddFeaturesToInvalidationSetsForCompoundSelector(
*sub_selector, sibling_features, descendant_features);
if (!descendant_features.has_features_for_rule_set_invalidation)
selector_list_contains_universal = true;
}
descendant_features.has_features_for_rule_set_invalidation =
had_features_for_rule_set_invalidation ||
!selector_list_contains_universal;
}
void RuleFeatureSet::AddFeaturesToInvalidationSetsForSimpleSelector(
const CSSSelector& simple_selector,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) {
if (InvalidationSet* invalidation_set = InvalidationSetForSimpleSelector(
simple_selector,
sibling_features ? InvalidationType::kInvalidateSiblings
: InvalidationType::kInvalidateDescendants,
kAncestor)) {
if (!sibling_features || invalidation_set == nth_invalidation_set_) {
AddFeaturesToInvalidationSet(*invalidation_set, descendant_features);
return;
}
auto* sibling_invalidation_set =
To<SiblingInvalidationSet>(invalidation_set);
sibling_invalidation_set->UpdateMaxDirectAdjacentSelectors(
sibling_features->max_direct_adjacent_selectors);
AddFeaturesToInvalidationSet(*invalidation_set, *sibling_features);
if (sibling_features == &descendant_features) {
sibling_invalidation_set->SetInvalidatesSelf();
} else {
AddFeaturesToInvalidationSet(
sibling_invalidation_set->EnsureSiblingDescendants(),
descendant_features);
}
return;
}
if (simple_selector.IsHostPseudoClass())
descendant_features.invalidation_flags.SetTreeBoundaryCrossing(true);
if (simple_selector.IsV0InsertionPointCrossing())
descendant_features.invalidation_flags.SetInsertionPointCrossing(true);
if (simple_selector.GetPseudoType() == CSSSelector::kPseudoPart)
descendant_features.invalidation_flags.SetInvalidatesParts(true);
AddFeaturesToInvalidationSetsForSelectorList(
simple_selector, sibling_features, descendant_features);
}
const CSSSelector*
RuleFeatureSet::AddFeaturesToInvalidationSetsForCompoundSelector(
const CSSSelector& compound,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) {
bool compound_has_id_class_or_attribute = false;
const CSSSelector* simple_selector = &compound;
for (; simple_selector; simple_selector = simple_selector->TagHistory()) {
AddFeaturesToInvalidationSetsForSimpleSelector(
*simple_selector, sibling_features, descendant_features);
if (simple_selector->IsIdClassOrAttributeSelector())
compound_has_id_class_or_attribute = true;
if (simple_selector->Relation() != CSSSelector::kSubSelector)
break;
if (!simple_selector->TagHistory())
break;
}
if (compound_has_id_class_or_attribute) {
descendant_features.has_features_for_rule_set_invalidation = true;
} else if (sibling_features) {
AddFeaturesToUniversalSiblingInvalidationSet(*sibling_features,
descendant_features);
}
return simple_selector;
}
void RuleFeatureSet::AddFeaturesToInvalidationSets(
const CSSSelector& selector,
InvalidationSetFeatures* sibling_features,
InvalidationSetFeatures& descendant_features) {
// selector is the selector immediately to the left of the rightmost
// combinator. descendantFeatures has the features of the rightmost compound
// selector.
InvalidationSetFeatures last_compound_in_sibling_chain_features;
const CSSSelector* compound = &selector;
while (compound) {
const CSSSelector* last_in_compound =
AddFeaturesToInvalidationSetsForCompoundSelector(
*compound, sibling_features, descendant_features);
DCHECK(last_in_compound);
UpdateFeaturesFromCombinator(*last_in_compound, compound,
last_compound_in_sibling_chain_features,
sibling_features, descendant_features);
compound = last_in_compound->TagHistory();
}
}
RuleFeatureSet::SelectorPreMatch RuleFeatureSet::CollectFeaturesFromRuleData(
const RuleData* rule_data) {
CHECK(is_alive_);
FeatureMetadata metadata;
if (CollectFeaturesFromSelector(rule_data->Selector(), metadata) ==
kSelectorNeverMatches)
return kSelectorNeverMatches;
metadata_.Add(metadata);
UpdateInvalidationSets(rule_data);
return kSelectorMayMatch;
}
RuleFeatureSet::SelectorPreMatch RuleFeatureSet::CollectFeaturesFromSelector(
const CSSSelector& selector,
RuleFeatureSet::FeatureMetadata& metadata) {
unsigned max_direct_adjacent_selectors = 0;
CSSSelector::RelationType relation = CSSSelector::kDescendant;
bool found_host_pseudo = false;
for (const CSSSelector* current = &selector; current;
current = current->TagHistory()) {
switch (current->GetPseudoType()) {
case CSSSelector::kPseudoFirstLine:
metadata.uses_first_line_rules = true;
break;
case CSSSelector::kPseudoWindowInactive:
metadata.uses_window_inactive_selector = true;
break;
case CSSSelector::kPseudoHost:
case CSSSelector::kPseudoHostContext:
if (!found_host_pseudo && relation == CSSSelector::kSubSelector)
return kSelectorNeverMatches;
if (!current->IsLastInTagHistory() &&
current->TagHistory()->Match() != CSSSelector::kPseudoElement &&
!current->TagHistory()->IsHostPseudoClass()) {
return kSelectorNeverMatches;
}
found_host_pseudo = true;
FALLTHROUGH;
default:
if (const CSSSelectorList* selector_list = current->SelectorList()) {
for (const CSSSelector* sub_selector = selector_list->First();
sub_selector;
sub_selector = CSSSelectorList::Next(*sub_selector))
CollectFeaturesFromSelector(*sub_selector, metadata);
}
break;
}
relation = current->Relation();
if (found_host_pseudo && relation != CSSSelector::kSubSelector)
return kSelectorNeverMatches;
if (relation == CSSSelector::kDirectAdjacent) {
max_direct_adjacent_selectors++;
} else if (max_direct_adjacent_selectors &&
((relation != CSSSelector::kSubSelector) ||
current->IsLastInTagHistory())) {
if (max_direct_adjacent_selectors >
metadata.max_direct_adjacent_selectors)
metadata.max_direct_adjacent_selectors = max_direct_adjacent_selectors;
max_direct_adjacent_selectors = 0;
}
}
DCHECK(!max_direct_adjacent_selectors);
return kSelectorMayMatch;
}
void RuleFeatureSet::FeatureMetadata::Add(const FeatureMetadata& other) {
uses_first_line_rules |= other.uses_first_line_rules;
uses_window_inactive_selector |= other.uses_window_inactive_selector;
max_direct_adjacent_selectors = std::max(max_direct_adjacent_selectors,
other.max_direct_adjacent_selectors);
}
void RuleFeatureSet::FeatureMetadata::Clear() {
uses_first_line_rules = false;
uses_window_inactive_selector = false;
needs_full_recalc_for_rule_set_invalidation = false;
max_direct_adjacent_selectors = 0;
invalidates_parts = false;
}
void RuleFeatureSet::Add(const RuleFeatureSet& other) {
CHECK(is_alive_);
CHECK(other.is_alive_);
CHECK_NE(&other, this);
for (const auto& entry : other.class_invalidation_sets_)
AddInvalidationSet(class_invalidation_sets_, entry.key, entry.value);
for (const auto& entry : other.attribute_invalidation_sets_)
AddInvalidationSet(attribute_invalidation_sets_, entry.key, entry.value);
for (const auto& entry : other.id_invalidation_sets_)
AddInvalidationSet(id_invalidation_sets_, entry.key, entry.value);
for (const auto& entry : other.pseudo_invalidation_sets_) {
auto key = static_cast<CSSSelector::PseudoType>(entry.key);
AddInvalidationSet(pseudo_invalidation_sets_, key, entry.value);
}
if (other.universal_sibling_invalidation_set_) {
EnsureUniversalSiblingInvalidationSet().Combine(
*other.universal_sibling_invalidation_set_);
}
if (other.nth_invalidation_set_)
EnsureNthInvalidationSet().Combine(*other.nth_invalidation_set_);
if (other.metadata_.invalidates_parts)
metadata_.invalidates_parts = true;
metadata_.Add(other.metadata_);
viewport_dependent_media_query_results_.AppendVector(
other.viewport_dependent_media_query_results_);
device_dependent_media_query_results_.AppendVector(
other.device_dependent_media_query_results_);
}
void RuleFeatureSet::Clear() {
CHECK(is_alive_);
metadata_.Clear();
class_invalidation_sets_.clear();
attribute_invalidation_sets_.clear();
id_invalidation_sets_.clear();
pseudo_invalidation_sets_.clear();
universal_sibling_invalidation_set_ = nullptr;
nth_invalidation_set_ = nullptr;
viewport_dependent_media_query_results_.clear();
device_dependent_media_query_results_.clear();
}
void RuleFeatureSet::CollectInvalidationSetsForClass(
InvalidationLists& invalidation_lists,
Element& element,
const AtomicString& class_name) const {
InvalidationSetMap::const_iterator it =
class_invalidation_sets_.find(class_name);
if (it == class_invalidation_sets_.end())
return;
DescendantInvalidationSet* descendants;
SiblingInvalidationSet* siblings;
ExtractInvalidationSets(it->value.get(), descendants, siblings);
if (descendants) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *descendants, ClassChange,
class_name);
invalidation_lists.descendants.push_back(descendants);
}
if (siblings) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *siblings, ClassChange,
class_name);
invalidation_lists.siblings.push_back(siblings);
}
}
void RuleFeatureSet::CollectSiblingInvalidationSetForClass(
InvalidationLists& invalidation_lists,
Element& element,
const AtomicString& class_name,
unsigned min_direct_adjacent) const {
InvalidationSetMap::const_iterator it =
class_invalidation_sets_.find(class_name);
if (it == class_invalidation_sets_.end())
return;
auto* sibling_set = DynamicTo<SiblingInvalidationSet>(it->value.get());
if (!sibling_set)
return;
if (sibling_set->MaxDirectAdjacentSelectors() < min_direct_adjacent)
return;
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *sibling_set, ClassChange,
class_name);
invalidation_lists.siblings.push_back(sibling_set);
}
void RuleFeatureSet::CollectInvalidationSetsForId(
InvalidationLists& invalidation_lists,
Element& element,
const AtomicString& id) const {
InvalidationSetMap::const_iterator it = id_invalidation_sets_.find(id);
if (it == id_invalidation_sets_.end())
return;
DescendantInvalidationSet* descendants;
SiblingInvalidationSet* siblings;
ExtractInvalidationSets(it->value.get(), descendants, siblings);
if (descendants) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *descendants, IdChange, id);
invalidation_lists.descendants.push_back(descendants);
}
if (siblings) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *siblings, IdChange, id);
invalidation_lists.siblings.push_back(siblings);
}
}
void RuleFeatureSet::CollectSiblingInvalidationSetForId(
InvalidationLists& invalidation_lists,
Element& element,
const AtomicString& id,
unsigned min_direct_adjacent) const {
InvalidationSetMap::const_iterator it = id_invalidation_sets_.find(id);
if (it == id_invalidation_sets_.end())
return;
auto* sibling_set = DynamicTo<SiblingInvalidationSet>(it->value.get());
if (!sibling_set)
return;
if (sibling_set->MaxDirectAdjacentSelectors() < min_direct_adjacent)
return;
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *sibling_set, IdChange, id);
invalidation_lists.siblings.push_back(sibling_set);
}
void RuleFeatureSet::CollectInvalidationSetsForAttribute(
InvalidationLists& invalidation_lists,
Element& element,
const QualifiedName& attribute_name) const {
InvalidationSetMap::const_iterator it =
attribute_invalidation_sets_.find(attribute_name.LocalName());
if (it == attribute_invalidation_sets_.end())
return;
DescendantInvalidationSet* descendants;
SiblingInvalidationSet* siblings;
ExtractInvalidationSets(it->value.get(), descendants, siblings);
if (descendants) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *descendants, AttributeChange,
attribute_name);
invalidation_lists.descendants.push_back(descendants);
}
if (siblings) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *siblings, AttributeChange,
attribute_name);
invalidation_lists.siblings.push_back(siblings);
}
}
void RuleFeatureSet::CollectSiblingInvalidationSetForAttribute(
InvalidationLists& invalidation_lists,
Element& element,
const QualifiedName& attribute_name,
unsigned min_direct_adjacent) const {
InvalidationSetMap::const_iterator it =
attribute_invalidation_sets_.find(attribute_name.LocalName());
if (it == attribute_invalidation_sets_.end())
return;
auto* sibling_set = DynamicTo<SiblingInvalidationSet>(it->value.get());
if (!sibling_set)
return;
if (sibling_set->MaxDirectAdjacentSelectors() < min_direct_adjacent)
return;
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *sibling_set, AttributeChange,
attribute_name);
invalidation_lists.siblings.push_back(sibling_set);
}
void RuleFeatureSet::CollectInvalidationSetsForPseudoClass(
InvalidationLists& invalidation_lists,
Element& element,
CSSSelector::PseudoType pseudo) const {
PseudoTypeInvalidationSetMap::const_iterator it =
pseudo_invalidation_sets_.find(pseudo);
if (it == pseudo_invalidation_sets_.end())
return;
DescendantInvalidationSet* descendants;
SiblingInvalidationSet* siblings;
ExtractInvalidationSets(it->value.get(), descendants, siblings);
if (descendants) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *descendants, PseudoChange,
pseudo);
invalidation_lists.descendants.push_back(descendants);
}
if (siblings) {
TRACE_SCHEDULE_STYLE_INVALIDATION(element, *siblings, PseudoChange, pseudo);
invalidation_lists.siblings.push_back(siblings);
}
}
void RuleFeatureSet::CollectUniversalSiblingInvalidationSet(
InvalidationLists& invalidation_lists,
unsigned min_direct_adjacent) const {
if (universal_sibling_invalidation_set_ &&
universal_sibling_invalidation_set_->MaxDirectAdjacentSelectors() >=
min_direct_adjacent)
invalidation_lists.siblings.push_back(universal_sibling_invalidation_set_);
}
SiblingInvalidationSet&
RuleFeatureSet::EnsureUniversalSiblingInvalidationSet() {
if (!universal_sibling_invalidation_set_) {
universal_sibling_invalidation_set_ =
SiblingInvalidationSet::Create(nullptr);
}
return *universal_sibling_invalidation_set_;
}
void RuleFeatureSet::CollectNthInvalidationSet(
InvalidationLists& invalidation_lists) const {
if (nth_invalidation_set_)
invalidation_lists.descendants.push_back(nth_invalidation_set_);
}
DescendantInvalidationSet& RuleFeatureSet::EnsureNthInvalidationSet() {
if (!nth_invalidation_set_)
nth_invalidation_set_ = DescendantInvalidationSet::Create();
return *nth_invalidation_set_;
}
void RuleFeatureSet::CollectPartInvalidationSet(
InvalidationLists& invalidation_lists) const {
if (metadata_.invalidates_parts) {
invalidation_lists.descendants.push_back(
InvalidationSet::PartInvalidationSet());
}
}
void RuleFeatureSet::CollectTypeRuleInvalidationSet(
InvalidationLists& invalidation_lists,
ContainerNode& root_node) const {
if (type_rule_invalidation_set_) {
invalidation_lists.descendants.push_back(type_rule_invalidation_set_);
TRACE_SCHEDULE_STYLE_INVALIDATION(root_node, *type_rule_invalidation_set_,
RuleSetInvalidation);
}
}
DescendantInvalidationSet& RuleFeatureSet::EnsureTypeRuleInvalidationSet() {
if (!type_rule_invalidation_set_)
type_rule_invalidation_set_ = DescendantInvalidationSet::Create();
return *type_rule_invalidation_set_;
}
void RuleFeatureSet::AddFeaturesToUniversalSiblingInvalidationSet(
const InvalidationSetFeatures& sibling_features,
const InvalidationSetFeatures& descendant_features) {
SiblingInvalidationSet& universal_set =
EnsureUniversalSiblingInvalidationSet();
AddFeaturesToInvalidationSet(universal_set, sibling_features);
universal_set.UpdateMaxDirectAdjacentSelectors(
sibling_features.max_direct_adjacent_selectors);
if (&sibling_features == &descendant_features) {
universal_set.SetInvalidatesSelf();
} else {
AddFeaturesToInvalidationSet(universal_set.EnsureSiblingDescendants(),
descendant_features);
}
}
void RuleFeatureSet::InvalidationSetFeatures::Add(
const InvalidationSetFeatures& other) {
classes.AppendVector(other.classes);
attributes.AppendVector(other.attributes);
ids.AppendVector(other.ids);
tag_names.AppendVector(other.tag_names);
max_direct_adjacent_selectors = std::max(max_direct_adjacent_selectors,
other.max_direct_adjacent_selectors);
invalidation_flags.Merge(other.invalidation_flags);
content_pseudo_crossing |= other.content_pseudo_crossing;
has_nth_pseudo |= other.has_nth_pseudo;
}
void RuleFeatureSet::InvalidationSetFeatures::NarrowToFeatures(
const InvalidationSetFeatures& other) {
unsigned size = Size();
unsigned other_size = other.Size();
if (size == 0 || (1 <= other_size && other_size < size)) {
ClearFeatures();
Add(other);
}
}
bool RuleFeatureSet::InvalidationSetFeatures::HasFeatures() const {
return !classes.IsEmpty() || !attributes.IsEmpty() || !ids.IsEmpty() ||
!tag_names.IsEmpty() || invalidation_flags.InvalidateCustomPseudo() ||
invalidation_flags.InvalidatesParts();
}
bool RuleFeatureSet::InvalidationSetFeatures::HasIdClassOrAttribute() const {
return !classes.IsEmpty() || !attributes.IsEmpty() || !ids.IsEmpty();
}
} // namespace blink
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
b69f70cff52ccc646beb9179d0ef1fed974a75d0 | e5d7314e57789b78b80f5aa9367ba1c0c6cd59b1 | /chapter4/arrayone.cpp | c30f41420de558e1a76752ba9b9b293d47dd4c54 | [] | no_license | dga1t/cpp-primer-practice | 1b36da26922433647ac1396a3d6ffead88ad0178 | 8f68b71b16297f8c8d490d811ddc62dc4b3bbe2b | refs/heads/master | 2023-05-29T03:44:40.098175 | 2021-06-06T12:33:50 | 2021-06-06T12:33:50 | 321,054,667 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 668 | cpp | #include <iostream>
int main()
{
using namespace std;
int yams[3];
yams[0] = 7;
yams[1] = 8;
yams[2] = 6;
int yamcosts[6] = {20, 30, 5};
cout << "Total yams = ";
cout << yams[0] + yams[1] + yams[2] << endl;
cout << "The package with " << yams[1] << " yams costs ";
cout << yamcosts[1] << " cents per yam. \n";
int total = yams[0] * yamcosts[0] + yams[1] * yamcosts[1];
total = total + yams[2] * yamcosts[2];
cout << "The total yam expense is " << total << " cents.\n";
cout << "\nSize of yams array = " << sizeof yams;
cout << " bytes.\n";
cout << "Size of one element = " << sizeof yams[0];
cout << " bytes.\n";
return 0;
} | [
"dpsmnsk@gmail.com"
] | dpsmnsk@gmail.com |
450f647da1dae28d0e6478da6c852cb75a01ca24 | 43231c1fd76651dda337c8484fa07d808663866b | /examples-repo/Ampel/Template/IDE-Host/Ampel/Ampel/Ampel.cpp | adda237420d4f9f3a7604a69d5e933a2f0b9a092 | [] | no_license | speedbyte/EasyLabHelper | 6636abdd25e1a0d139fa834b033b6e7337afc9a7 | a51bd68c7fc78f72a215e3005df55e4b3851768f | refs/heads/master | 2020-06-01T05:20:54.692605 | 2018-02-05T12:10:53 | 2018-02-05T12:10:53 | 190,654,589 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 162 | cpp | // Ampel.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
| [
"vagrawal@hs-esslingen.de"
] | vagrawal@hs-esslingen.de |
f4386c65e991cfa439e7e3c118a82865f394b72e | 248e9951f171425a21d30f4f9789b4780aef83a7 | /src/test/denialofservice_tests.cpp | 1739a43d0b8e9708399ed1bd4c4bafe9693e3160 | [
"MIT"
] | permissive | bitcoinrtx/BitcoinRTX-V0.1 | 8dd4f2b79e40d1eba39a1dc8e27bffe5c34785d4 | defcb5024837d0a17152d1304e6de3fb338436f5 | refs/heads/master | 2023-03-12T11:16:08.751490 | 2021-03-06T20:05:56 | 2021-03-06T20:05:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,022 | cpp | //
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// Unit tests for denial-of-service detection/prevention code
#include <banman.h>
#include <chainparams.h>
#include <net.h>
#include <net_processing.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <script/standard.h>
#include <serialize.h>
#include <util/memory.h>
#include <util/system.h>
#include <util/time.h>
#include <validation.h>
#include <test/setup_common.h>
#include <stdint.h>
#include <boost/test/unit_test.hpp>
struct CConnmanTest : public CConnman {
using CConnman::CConnman;
void AddNode(CNode& node)
{
LOCK(cs_vNodes);
vNodes.push_back(&node);
}
void ClearNodes()
{
LOCK(cs_vNodes);
for (CNode* node : vNodes) {
delete node;
}
vNodes.clear();
}
};
// Tests these internal-to-net_processing.cpp methods:
extern bool AddOrphanTx(const CTransactionRef& tx, NodeId peer);
extern void EraseOrphansFor(NodeId peer);
extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans);
extern void Misbehaving(NodeId nodeid, int howmuch, const std::string& message="");
struct COrphanTx {
CTransactionRef tx;
NodeId fromPeer;
int64_t nTimeExpire;
};
extern CCriticalSection g_cs_orphans;
extern std::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY(g_cs_orphans);
static CService ip(uint32_t i)
{
struct in_addr s;
s.s_addr = i;
return CService(CNetAddr(s), Params().GetDefaultPort());
}
static NodeId id = 0;
void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds);
BOOST_FIXTURE_TEST_SUITE(denialofservice_tests, TestingSetup)
// Test eviction of an outbound peer whose chain never advances
// Mock a node connection, and use mocktime to simulate a peer
// which never sends any headers messages. PeerLogic should
// decide to evict that outbound peer, after the appropriate timeouts.
// Note that we protect 4 outbound nodes from being subject to
// this logic; this test takes advantage of that protection only
// being applied to nodes which send headers with sufficient
// work.
BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
{
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, scheduler, false);
// Mock an outbound peer
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", /*fInboundIn=*/ false);
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode1);
dummyNode1.nVersion = 1;
dummyNode1.fSuccessfullyConnected = true;
// This test requires that we have a chain with non-zero work.
{
LOCK(cs_main);
BOOST_CHECK(::ChainActive().Tip() != nullptr);
BOOST_CHECK(::ChainActive().Tip()->nChainWork > 0);
}
// Test starts here
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in getheaders
}
{
LOCK2(cs_main, dummyNode1.cs_vSend);
BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);
dummyNode1.vSendMsg.clear();
}
int64_t nStartTime = GetTime();
// Wait 21 minutes
SetMockTime(nStartTime+21*60);
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in getheaders
}
{
LOCK2(cs_main, dummyNode1.cs_vSend);
BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);
}
// Wait 3 more minutes
SetMockTime(nStartTime+24*60);
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1)); // should result in disconnect
}
BOOST_CHECK(dummyNode1.fDisconnect == true);
SetMockTime(0);
bool dummy;
peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);
}
static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerLogicValidation &peerLogic, CConnmanTest* connman)
{
CAddress addr(ip(g_insecure_rand_ctx.randbits(32)), NODE_NONE);
vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), "", /*fInboundIn=*/ false));
CNode &node = *vNodes.back();
node.SetSendVersion(PROTOCOL_VERSION);
peerLogic.InitializeNode(&node);
node.nVersion = 1;
node.fSuccessfullyConnected = true;
connman->AddNode(node);
}
BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
{
auto connman = MakeUnique<CConnmanTest>(0x1337, 0x1337);
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), nullptr, scheduler, false);
const Consensus::Params& consensusParams = Params().GetConsensus();
constexpr int max_outbound_full_relay = 8;
CConnman::Options options;
options.nMaxConnections = 125;
options.m_max_outbound_full_relay = max_outbound_full_relay;
options.nMaxFeeler = 1;
connman->Init(options);
std::vector<CNode *> vNodes;
// Mock some outbound peers
for (int i=0; i<max_outbound_full_relay; ++i) {
AddRandomOutboundPeer(vNodes, *peerLogic, connman.get());
}
peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
// No nodes should be marked for disconnection while we have no extra peers
for (const CNode *node : vNodes) {
BOOST_CHECK(node->fDisconnect == false);
}
SetMockTime(GetTime() + 3*consensusParams.nPowTargetSpacing + 1);
// Now tip should definitely be stale, and we should look for an extra
// outbound peer
peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
BOOST_CHECK(connman->GetTryNewOutboundPeer());
// Still no peers should be marked for disconnection
for (const CNode *node : vNodes) {
BOOST_CHECK(node->fDisconnect == false);
}
// If we add one more peer, something should get marked for eviction
// on the next check (since we're mocking the time to be in the future, the
// required time connected check should be satisfied).
AddRandomOutboundPeer(vNodes, *peerLogic, connman.get());
peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
for (int i=0; i<max_outbound_full_relay; ++i) {
BOOST_CHECK(vNodes[i]->fDisconnect == false);
}
// Last added node should get marked for eviction
BOOST_CHECK(vNodes.back()->fDisconnect == true);
vNodes.back()->fDisconnect = false;
// Update the last announced block time for the last
// peer, and check that the next newest node gets evicted.
UpdateLastBlockAnnounceTime(vNodes.back()->GetId(), GetTime());
peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);
for (int i=0; i<max_outbound_full_relay-1; ++i) {
BOOST_CHECK(vNodes[i]->fDisconnect == false);
}
BOOST_CHECK(vNodes[max_outbound_full_relay-1]->fDisconnect == true);
BOOST_CHECK(vNodes.back()->fDisconnect == false);
bool dummy;
for (const CNode *node : vNodes) {
peerLogic->FinalizeNode(node->GetId(), dummy);
}
connman->ClearNodes();
}
BOOST_AUTO_TEST_CASE(DoS_banning)
{
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME);
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
banman->ClearBanned();
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", true);
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode1);
dummyNode1.nVersion = 1;
dummyNode1.fSuccessfullyConnected = true;
{
LOCK(cs_main);
Misbehaving(dummyNode1.GetId(), 100); // Should get banned
}
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1));
}
BOOST_CHECK(banman->IsBanned(addr1));
BOOST_CHECK(!banman->IsBanned(ip(0xa0b0c001|0x0000ff00))); // Different IP, not banned
CAddress addr2(ip(0xa0b0c002), NODE_NONE);
CNode dummyNode2(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr2, 1, 1, CAddress(), "", true);
dummyNode2.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode2);
dummyNode2.nVersion = 1;
dummyNode2.fSuccessfullyConnected = true;
{
LOCK(cs_main);
Misbehaving(dummyNode2.GetId(), 50);
}
{
LOCK2(cs_main, dummyNode2.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode2));
}
BOOST_CHECK(!banman->IsBanned(addr2)); // 2 not banned yet...
BOOST_CHECK(banman->IsBanned(addr1)); // ... but 1 still should be
{
LOCK(cs_main);
Misbehaving(dummyNode2.GetId(), 50);
}
{
LOCK2(cs_main, dummyNode2.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode2));
}
BOOST_CHECK(banman->IsBanned(addr2));
bool dummy;
peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);
peerLogic->FinalizeNode(dummyNode2.GetId(), dummy);
}
BOOST_AUTO_TEST_CASE(DoS_banscore)
{
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME);
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
banman->ClearBanned();
gArgs.ForceSetArg("-banscore", "111"); // because 11 is my favorite number
CAddress addr1(ip(0xa0b0c001), NODE_NONE);
CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 3, 1, CAddress(), "", true);
dummyNode1.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode1);
dummyNode1.nVersion = 1;
dummyNode1.fSuccessfullyConnected = true;
{
LOCK(cs_main);
Misbehaving(dummyNode1.GetId(), 100);
}
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1));
}
BOOST_CHECK(!banman->IsBanned(addr1));
{
LOCK(cs_main);
Misbehaving(dummyNode1.GetId(), 10);
}
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1));
}
BOOST_CHECK(!banman->IsBanned(addr1));
{
LOCK(cs_main);
Misbehaving(dummyNode1.GetId(), 1);
}
{
LOCK2(cs_main, dummyNode1.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode1));
}
BOOST_CHECK(banman->IsBanned(addr1));
gArgs.ForceSetArg("-banscore", std::to_string(DEFAULT_BANSCORE_THRESHOLD));
bool dummy;
peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);
}
BOOST_AUTO_TEST_CASE(DoS_bantime)
{
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME);
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
banman->ClearBanned();
int64_t nStartTime = GetTime();
SetMockTime(nStartTime); // Overrides future calls to GetTime()
CAddress addr(ip(0xa0b0c001), NODE_NONE);
CNode dummyNode(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr, 4, 4, CAddress(), "", true);
dummyNode.SetSendVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode);
dummyNode.nVersion = 1;
dummyNode.fSuccessfullyConnected = true;
{
LOCK(cs_main);
Misbehaving(dummyNode.GetId(), 100);
}
{
LOCK2(cs_main, dummyNode.cs_sendProcessing);
BOOST_CHECK(peerLogic->SendMessages(&dummyNode));
}
BOOST_CHECK(banman->IsBanned(addr));
SetMockTime(nStartTime+60*60);
BOOST_CHECK(banman->IsBanned(addr));
SetMockTime(nStartTime+60*60*24+1);
BOOST_CHECK(!banman->IsBanned(addr));
bool dummy;
peerLogic->FinalizeNode(dummyNode.GetId(), dummy);
}
static CTransactionRef RandomOrphan()
{
std::map<uint256, COrphanTx>::iterator it;
LOCK2(cs_main, g_cs_orphans);
it = mapOrphanTransactions.lower_bound(InsecureRand256());
if (it == mapOrphanTransactions.end())
it = mapOrphanTransactions.begin();
return it->second.tx;
}
BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
{
CKey key;
key.MakeNewKey(true);
FillableSigningProvider keystore;
BOOST_CHECK(keystore.AddKey(key));
// 50 orphan transactions:
for (int i = 0; i < 50; i++)
{
CMutableTransaction tx;
tx.vin.resize(1);
tx.vin[0].prevout.n = 0;
tx.vin[0].prevout.hash = InsecureRand256();
tx.vin[0].scriptSig << OP_1;
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
AddOrphanTx(MakeTransactionRef(tx), i);
}
// ... and 50 that depend on other orphans:
for (int i = 0; i < 50; i++)
{
CTransactionRef txPrev = RandomOrphan();
CMutableTransaction tx;
tx.vin.resize(1);
tx.vin[0].prevout.n = 0;
tx.vin[0].prevout.hash = txPrev->GetHash();
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
BOOST_CHECK(SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL));
AddOrphanTx(MakeTransactionRef(tx), i);
}
// This really-big orphan should be ignored:
for (int i = 0; i < 10; i++)
{
CTransactionRef txPrev = RandomOrphan();
CMutableTransaction tx;
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey = GetScriptForDestination(PKHash(key.GetPubKey()));
tx.vin.resize(2777);
for (unsigned int j = 0; j < tx.vin.size(); j++)
{
tx.vin[j].prevout.n = j;
tx.vin[j].prevout.hash = txPrev->GetHash();
}
BOOST_CHECK(SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL));
// Re-use same signature for other inputs
// (they don't have to be valid for this test)
for (unsigned int j = 1; j < tx.vin.size(); j++)
tx.vin[j].scriptSig = tx.vin[0].scriptSig;
BOOST_CHECK(!AddOrphanTx(MakeTransactionRef(tx), i));
}
LOCK2(cs_main, g_cs_orphans);
// Test EraseOrphansFor:
for (NodeId i = 0; i < 3; i++)
{
size_t sizeBefore = mapOrphanTransactions.size();
EraseOrphansFor(i);
BOOST_CHECK(mapOrphanTransactions.size() < sizeBefore);
}
// Test LimitOrphanTxSize() function:
LimitOrphanTxSize(40);
BOOST_CHECK(mapOrphanTransactions.size() <= 40);
LimitOrphanTxSize(10);
BOOST_CHECK(mapOrphanTransactions.size() <= 10);
LimitOrphanTxSize(0);
BOOST_CHECK(mapOrphanTransactions.empty());
}
BOOST_AUTO_TEST_SUITE_END()
| [
"kunal@coinrecoil.com"
] | kunal@coinrecoil.com |
0d84e427986c0dad43fd9786b46055c73dbd67f6 | 2cb0747238376e3f6a9347d31f2469d1d767452f | /shadows and particles/common/controls.cpp | c45c788c652931e0b906b6cb3fa0342d033cfac9 | [] | no_license | Smorgasfjord/VikingGame | 0a2ca4484f223fa3a924b0ffaaeb24081fb50b60 | d9985e9c0885b3ee39a51d2eb2d2ca9d3adba758 | refs/heads/master | 2021-03-13T00:06:42.662797 | 2014-06-11T15:30:43 | 2014-06-11T15:30:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,644 | cpp | // Include GLFW
#include </home/nclarke/Desktop/deps/glfw/include/GLFW/glfw3.h>
extern GLFWwindow* window; // The "extern" keyword here is to access the variable "window" declared in tutorialXXX.cpp. This is a hack to keep the tutorials simple. Please avoid this.
// Include GLM
#include </home/nclarke/Desktop/deps/glm/include/glm/glm.hpp>
#include </home/nclarke/Desktop/deps/glm/include/glm/gtc/matrix_transform.hpp>
using namespace glm;
#include "controls.hpp"
glm::mat4 ViewMatrix;
glm::mat4 ProjectionMatrix;
glm::mat4 getProjectionMatrix(){
return ProjectionMatrix;
}
// Initial position : on +Z
glm::vec3 position = glm::vec3( 15, 0, 0 );
// Initial horizontal angle : toward -Z
float horizontalAngle = 8.14f;
// Initial vertical angle : none
float verticalAngle = 3.0f;
// Initial Field of View
float initialFoV = 45.0f;
glm::vec3 direction = glm::vec3(0.0,0.0,0.0);
float speed = 3.0f; // 3 units / second
float mouseSpeed = 0.0005f;
glm::mat4 getViewMatrix(){
// printf("position: (%lf, %lf, %lf)\n", position.x, position.y, position.z);
// printf("direction: (%lf, %lf, %lf)\n", direction.x, direction.y, direction.z);
// printf("horizontalAngle: (%lf)\n", horizontalAngle);
// printf("verticalAngle: (%lf)\n", verticalAngle);
return ViewMatrix;
}
void computeMatricesFromInputs(){
// glfwGetTime is called only once, the first time this function is called
static double lastTime = glfwGetTime();
// Compute time difference between current and last frame
double currentTime = glfwGetTime();
float deltaTime = float(currentTime - lastTime);
// Get mouse position
double xpos, ypos;
glfwGetCursorPos(window, &xpos, &ypos);
// Reset mouse position
glfwSetCursorPos(window, 1024/2, 768/2);
// new Orientation
horizontalAngle += mouseSpeed * float(1024/2 - xpos );
verticalAngle += mouseSpeed * float( 768/2 - ypos );
//Spherical coordinates to Cartesian coordinates conversion
direction = vec3(cos(verticalAngle) * sin(horizontalAngle), sin(verticalAngle),cos(verticalAngle) * cos(horizontalAngle));
// Right vector
glm::vec3 right =
glm::vec3(sin(horizontalAngle - 3.14f/2.0f),0,cos(horizontalAngle - 3.14f/2.0f));
// Up vector
glm::vec3 up = glm::cross( right, direction );
// forward really really fast
if (glfwGetKey( window, GLFW_KEY_UP ) == GLFW_PRESS){
position += direction * deltaTime * speed;
}
// backward really really fast
if (glfwGetKey( window, GLFW_KEY_8 ) == GLFW_PRESS){
position -= direction * deltaTime * 10.0f * speed;
}
// forward really really fast
if (glfwGetKey( window, GLFW_KEY_9 ) == GLFW_PRESS){
position += direction * deltaTime * 10.0f * speed;
}
// backward
if (glfwGetKey( window, GLFW_KEY_DOWN ) == GLFW_PRESS){
position -= direction * deltaTime * speed;
}
// right
if (glfwGetKey( window, GLFW_KEY_RIGHT ) == GLFW_PRESS){
position += right * deltaTime * speed;
}
// left
if (glfwGetKey( window, GLFW_KEY_LEFT ) == GLFW_PRESS){
position -= right * deltaTime * speed;
}
float FoV = initialFoV;// - 5 * glfwGetMouseWheel();
ProjectionMatrix = glm::perspective(FoV, 4.0f / 3.0f, 0.1f, 100.0f);
// Camera matrix
ViewMatrix = glm::lookAt(position, position+direction,up);
lastTime = currentTime;
}
| [
"nclarke@calpoly.edu"
] | nclarke@calpoly.edu |
45e161aa58bfa973500d594823bbd4d60f243e16 | 9af5ce5f7128d6ec19aa6ebcfa9770260aa17b4d | /HTN_Plugin/Source/HTN_Plugin/Private/JSHOP2_Experiments/SimpleFPS/JSHOP2_ExperimenterSimpleFPS.cpp | 9c596181e76d1385b39a764bc32016f7ca9acd2e | [
"MIT"
] | permissive | ChairGraveyard/HTN_Plan_Reuse | efae07d5ca30de4f3e4c563adc8e5c5e07252c6a | acdf5e6f808f50b98a4be4da653a7c27b6e713df | refs/heads/master | 2020-12-22T20:01:55.117181 | 2016-03-31T12:34:32 | 2016-03-31T12:34:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,497 | cpp | #include "HTN_PluginPrivatePCH.h"
#include "HTNPlanner/HTNPlanner.h"
#include "HTNPlanner/HTNPlannerComponent.h"
#include "HTNPlanner/TaskNetwork.h"
#include "JSHOP2_Experiments/DataCollector.h"
#include "JSHOP2_Experiments/SimpleFPS/HTNWorldState_SimpleFPS.h"
#include "JSHOP2_Experiments/SimpleFPS/SimpleFPSObject.h"
#include "JSHOP2_Experiments/SimpleFPS/JSHOP2_ExperimenterSimpleFPS.h"
#include "JSHOP2_Experiments/SimpleFPS/Tasks/HTNTask_BehaveSimpleFPS.h"
AJSHOP2_ExperimenterSimpleFPS::AJSHOP2_ExperimenterSimpleFPS(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
NumberOfAreas = 10;
NumberOfPointsOfInterest = 100;
ProbabilityConnected = 0.6f;
ProbabilityInjured = 0.7f;
ProbabilityLighted = 0.1f;
ProbabilityLoaded = 0.4f;
ProbabilityNightVision = 0.2f;
ProbabilityOpen = 0.6f;
ProbabilityGun = 0.25f;
ProbabilityKnife = 0.25f;
ProbabilityMedikit = 0.25f;
bGenerateRealisticMaps = true;
bPrintJSHOP2Format = false;
bInitializationSeedSet = false;
InitialWorldState = nullptr;
}
UHTNPlanner* AJSHOP2_ExperimenterSimpleFPS::GeneratePlanner()
{
UHTNPlanner* Planner = NewObject<UHTNPlanner>(this);
Planner->bIgnoreTaskCosts = bIgnoreCosts;
Planner->bDepthFirstSearch = bDepthFirstSearch;
Planner->bExecutePlan = false;
Planner->bLoop = bLoop;
Planner->MaxSearchTime = MaxSearchTime;
Planner->EmptyWorldState = TSharedPtr<FHTNWorldState>(new FHTNWorldState_SimpleFPS());
// create our Task Network
TSharedPtr<FHTNTaskInstance> TaskNetwork = HTNComp->InstantiateNetwork(UTaskNetwork::StaticClass());
// create our behave task
TSharedPtr<FHTNTaskInstance> BehaveTask = HTNComp->InstantiateTask(UHTNTask_BehaveSimpleFPS::StaticClass());
(Cast<UTaskNetwork>(TaskNetwork->Task))->AddTaskOrSubNetwork(BehaveTask, TaskNetwork->GetMemory());
Planner->TaskNetworkInstance = TaskNetwork;
return Planner;
}
int32 AJSHOP2_ExperimenterSimpleFPS::GetNumAreas() const
{
return NumberOfAreas;
}
void AJSHOP2_ExperimenterSimpleFPS::InitializeWorldState(FHTNWorldState_SimpleFPS* WorldState)
{
if(!bInitializationSeedSet)
{
//InitializationSeed = 23468;
//InitializationSeed = 8072;
//InitializationSeed = 11780;
//InitializationSeed = 8417;
//InitializationSeed = 26149;
//InitializationSeed = 23666;
//InitializationSeed = 25594;
//InitializationSeed = 10937;
//InitializationSeed = 26149;
//InitializationSeed = 27207;
//InitializationSeed = 13123;
InitializationSeed = FMath::Rand();
bInitializationSeedSet = true;
HTNComp->DataCollector->SetWorldStateSeed(InitializationSeed);
}
FRandomStream RandStream(InitializationSeed);
if(!InitialWorldState.IsValid())
{
UE_LOG(LogHTNPlanner, Warning, TEXT("Generating problem with seed = %d"), InitializationSeed);
if(bGenerateRealisticMaps)
{
// for realistic maps, we require (5 + 3x) rooms, where x is a nonnegative integer
if(NumberOfAreas < 5)
{
NumberOfAreas = 5;
}
else
{
int32 Remainder = NumberOfAreas - 5;
NumberOfAreas += ((3 - (Remainder % 3)) % 3);
}
}
// initialize our world state
InitialWorldState = MakeShareable<FHTNWorldState_SimpleFPS>(new FHTNWorldState_SimpleFPS());
InitialWorldState->SetConstData(MakeShareable<FHTNWorldState_SimpleFPS_ConstData>(new FHTNWorldState_SimpleFPS_ConstData()));
InitialWorldState->SetPreferredWeaponChoice(0);
// initialize NPC-related properties
InitialWorldState->NPCNearbyPOI = nullptr;
InitialWorldState->NPCArea = bGenerateRealisticMaps ? 0 : RandStream.RandRange(0, NumberOfAreas - 1);
InitialWorldState->bNPCAware = false;
InitialWorldState->bNPCCovered = false;
InitialWorldState->bNPCInjured = (RandStream.FRandRange(0.f, 1.f) <= ProbabilityInjured);
// initialize player
int32 PlayerArea = bGenerateRealisticMaps ? NumberOfAreas - 1 : RandStream.RandRange(0, NumberOfAreas - 1);
InitialWorldState->CreatePlayer(PlayerArea, "p");
// initialize areas, control boxes, waypoints and keycards
const int32 LARGE_DISTANCE = 10000;
TArray<TArray<int32>> DistanceMatrix;
DistanceMatrix.Reserve(NumberOfAreas);
for(int32 Row = 0; Row < NumberOfAreas; ++Row)
{
DistanceMatrix.Add(TArray<int32>());
TArray<int32>& DistanceRow = DistanceMatrix[Row];
DistanceRow.Reserve(NumberOfAreas);
for(int32 Col = 0; Col < NumberOfAreas; ++Col)
{
DistanceRow.Add(LARGE_DISTANCE);
}
}
if(bGenerateRealisticMaps)
{
int32 NumRoomsCreated = 0;
// start with first room
InitialWorldState->CreateArea((RandStream.FRandRange(0.f, 1.f) <= ProbabilityLighted),
FString::Printf(TEXT("area%d"), 0));
InitialWorldState->CreateControlBox(0, FString::Printf(TEXT("control-box%d"), 0));
DistanceMatrix[0][0] = 0;
++NumRoomsCreated;
// create 4 rooms around the first
for(int32 Idx = 1; Idx < 5; ++Idx)
{
InitialWorldState->CreateArea((RandStream.FRandRange(0.f, 1.f) <= ProbabilityLighted),
FString::Printf(TEXT("area%d"), Idx));
InitialWorldState->CreateControlBox(Idx, FString::Printf(TEXT("control-box%d"), Idx));
DistanceMatrix[Idx][Idx] = 0;
// connect new room to the first room
DistanceMatrix[0][Idx] = 1;
DistanceMatrix[Idx][0] = 1;
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityOpen)
{
// door starts open
InitialWorldState->CreateWaypoint(0, Idx, true, -1, FString::Printf(TEXT("door%d-%d"), 0, Idx));
}
else
{
// door starts closed, so also need a keycard (spawn keycard in one of the previously generated rooms)
FSimpleFPSObject* Keycard = InitialWorldState->CreateKeycard(RandStream.RandRange(0, NumRoomsCreated - 1),
FString::Printf(TEXT("keycard%d-%d"), 0, Idx));
InitialWorldState->CreateWaypoint(0, Idx, false, Keycard->Index, FString::Printf(TEXT("door%d-%d"), 0, Idx));
}
++NumRoomsCreated;
}
// the outer 4 rooms will be the first rooms in our fringe
TArray<int32> Fringe;
Fringe.Add(1);
Fringe.Add(2);
Fringe.Add(3);
Fringe.Add(4);
// generate new rooms in groups of 3 by always picking one room out of the fringe and connecting it to 3 new rooms
while(NumRoomsCreated < NumberOfAreas)
{
int32 FringeIdx = RandStream.RandRange(0, Fringe.Num() - 1);
int32 ExistingArea = Fringe[FringeIdx];
Fringe.RemoveAtSwap(FringeIdx);
for(int32 Idx = 0; Idx < 3; ++Idx)
{
int32 AreaIdx = NumRoomsCreated + Idx;
InitialWorldState->CreateArea((RandStream.FRandRange(0.f, 1.f) <= ProbabilityLighted),
FString::Printf(TEXT("area%d"), AreaIdx));
InitialWorldState->CreateControlBox(AreaIdx, FString::Printf(TEXT("control-box%d"), AreaIdx));
DistanceMatrix[AreaIdx][AreaIdx] = 0;
// connect new room to the existing room
DistanceMatrix[ExistingArea][AreaIdx] = 1;
DistanceMatrix[AreaIdx][ExistingArea] = 1;
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityOpen)
{
// door starts open
InitialWorldState->CreateWaypoint(ExistingArea, AreaIdx, true, -1,
FString::Printf(TEXT("door%d-%d"), ExistingArea, AreaIdx));
}
else
{
// door starts closed, so also need a keycard (spawn keycard in one of the previously generated rooms)
FSimpleFPSObject* Keycard = InitialWorldState->CreateKeycard(RandStream.RandRange(0, NumRoomsCreated - 1),
FString::Printf(TEXT("keycard%d-%d"),
ExistingArea, AreaIdx));
InitialWorldState->CreateWaypoint(ExistingArea, AreaIdx, false, Keycard->Index,
FString::Printf(TEXT("door%d-%d"), ExistingArea, AreaIdx));
}
// add newly generated room to the fringe
Fringe.Add(AreaIdx);
}
NumRoomsCreated += 3;
}
// finally, also create some random connections elsewhere so we have a few cycles in the graph
for(int32 Idx1 = 0; Idx1 < NumberOfAreas; ++Idx1)
{
for(int32 Idx2 = 0; Idx2 < Idx1; ++Idx2)
{
if(DistanceMatrix[Idx1][Idx2] <= 1)
{
continue; // these 2 areas are already connected
}
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityConnected)
{
// create an extra connection here
DistanceMatrix[Idx1][Idx2] = 1;
DistanceMatrix[Idx2][Idx1] = 1;
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityOpen)
{
// door starts open
InitialWorldState->CreateWaypoint(Idx1, Idx2, true, -1, FString::Printf(TEXT("door%d-%d"), Idx1, Idx2));
}
else
{
// door starts closed, so also need a keycard
FSimpleFPSObject* Keycard = InitialWorldState->CreateKeycard(RandStream.RandRange(0, NumberOfAreas - 1),
FString::Printf(TEXT("keycard%d-%d"),
Idx1, Idx2));
InitialWorldState->CreateWaypoint(Idx1, Idx2, false, Keycard->Index,
FString::Printf(TEXT("door%d-%d"), Idx1, Idx2));
}
}
}
}
}
else
{
// generate map completely randomly
for(int32 Idx1 = 0; Idx1 < NumberOfAreas; ++Idx1)
{
InitialWorldState->CreateArea((RandStream.FRandRange(0.f, 1.f) <= ProbabilityLighted),
FString::Printf(TEXT("area%d"), Idx1));
InitialWorldState->CreateControlBox(Idx1, FString::Printf(TEXT("control-box%d"), Idx1));
DistanceMatrix[Idx1][Idx1] = 0;
for(int32 Idx2 = 0; Idx2 < Idx1; ++Idx2)
{
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityConnected)
{
// connect this pair of areas by creating a Waypoint
DistanceMatrix[Idx1][Idx2] = 1;
DistanceMatrix[Idx2][Idx1] = 1;
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityOpen)
{
// door starts open
InitialWorldState->CreateWaypoint(Idx1, Idx2, true, -1, FString::Printf(TEXT("door%d-%d"), Idx1, Idx2));
}
else
{
// door starts closed, so also need a keycard
FSimpleFPSObject* Keycard = InitialWorldState->CreateKeycard(RandStream.RandRange(0, NumberOfAreas - 1),
FString::Printf(TEXT("keycard%d-%d"),
Idx1, Idx2));
InitialWorldState->CreateWaypoint(Idx1, Idx2, false, Keycard->Index,
FString::Printf(TEXT("door%d-%d"), Idx1, Idx2));
}
}
}
}
}
// finalize computation of distance matrix
for(int32 Idx1 = 0; Idx1 < NumberOfAreas; ++Idx1)
{
for(int32 Idx2 = 0; Idx2 < NumberOfAreas; ++Idx2)
{
for(int32 Idx3 = 0; Idx3 < NumberOfAreas; ++Idx3)
{
DistanceMatrix[Idx2][Idx3] = FMath::Min(DistanceMatrix[Idx2][Idx3],
DistanceMatrix[Idx2][Idx1] + DistanceMatrix[Idx1][Idx3]);
}
}
}
for(int32 Idx1 = 0; Idx1 < NumberOfAreas; ++Idx1)
{
for(int32 Idx2 = 0; Idx2 < NumberOfAreas; ++Idx2)
{
DistanceMatrix[Idx1][Idx2] = DistanceMatrix[Idx2][Idx1];
}
}
// initialize guns (+ ammo), knives, medikits and cover points
int32 LastAmmoIndex = 0;
int32 LastGunIndex = 0;
int32 LastKnifeIndex = 0;
int32 LastMedikitIndex = 0;
int32 LastCoverPointIndex = 0;
for(int32 Idx = 0; Idx < NumberOfPointsOfInterest; ++Idx)
{
float RandomNumber = RandStream.FRandRange(0.f, 1.f);
if(RandomNumber <= ProbabilityGun)
{
// we're adding a gun
bool bLoaded = false;
int32 AmmoIndex = -1;
if(RandStream.FRandRange(0.f, 1.f) <= ProbabilityLoaded)
{
// gun is already loaded
bLoaded = true;
}
else
{
// also need matching ammo
FSimpleFPSObject* Ammo = InitialWorldState->CreateAmmo(RandStream.RandRange(0, NumberOfAreas - 1),
FString::Printf(TEXT("ammogun%d"), LastAmmoIndex++));
AmmoIndex = Ammo->Index;
}
InitialWorldState->CreateGun(RandStream.RandRange(0, NumberOfAreas - 1), bLoaded, AmmoIndex,
(RandStream.FRandRange(0.f, 1.f) <= ProbabilityNightVision), FString::Printf(TEXT("gun%d"), LastGunIndex++));
}
else if(RandomNumber <= ProbabilityGun + ProbabilityKnife)
{
// we're adding a knife
InitialWorldState->CreateKnife(RandStream.RandRange(0, NumberOfAreas - 1), FString::Printf(TEXT("knife%d"), LastKnifeIndex++));
}
else if(RandomNumber <= ProbabilityGun + ProbabilityKnife + ProbabilityMedikit)
{
// we're adding a medikit
InitialWorldState->CreateMedikit(RandStream.RandRange(0, NumberOfAreas - 1), FString::Printf(TEXT("firstaid%d"), LastMedikitIndex++));
}
else
{
// we're adding a cover point
InitialWorldState->CreateCoverPoint(RandStream.RandRange(0, NumberOfAreas - 1), FString::Printf(TEXT("coverpoint%d"), LastCoverPointIndex++));
}
}
InitialWorldState->SetDistanceMatrix(DistanceMatrix);
InitialWorldState->SetExecutionMode(true); // by default set execution mode to true, meaning we'll assume perfect information
// create a string describing the problem we've generated in JSHOP2 formalism
FString Problem = "(defproblem problem simplefps\n";
Problem += " (\n";
Problem += " (npc-unaware)\n";
Problem += FString::Printf(TEXT(" (npc-at area%d)\n"), InitialWorldState->NPCArea);
Problem += " (npc-not-close-to-point)\n";
Problem += " (npc-uncovered)\n";
Problem += (InitialWorldState->bNPCInjured) ? " (npc-injured)\n" : " (npc-full-health)\n";
Problem += " (player p)\n";
Problem += FString::Printf(TEXT(" (point-of-interest p area%d)\n"), PlayerArea);
for(int32 Area = 0; Area < NumberOfAreas; ++Area)
{
if(InitialWorldState->AreaData[Area].bLighted)
{
Problem += FString::Printf(TEXT(" (lighted area%d)\n"), Area);
}
else
{
Problem += FString::Printf(TEXT(" (dark area%d)\n"), Area);
}
Problem += FString::Printf(TEXT(" (point-of-interest control-box%d area%d)\n"), Area, Area);
Problem += FString::Printf(TEXT(" (control-box control-box%d)\n"), Area);
}
for(const FSimpleFPSObject* Waypoint : InitialWorldState->GetWaypoints())
{
const FSimpleFPSWaypointData& WaypointData = InitialWorldState->WaypointData[Waypoint->Index];
int32 Area1 = WaypointData.Area1;
int32 Area2 = WaypointData.Area2;
Problem += FString::Printf(TEXT(" (waypoint door%d-%d)\n"), Area1, Area2);
Problem += FString::Printf(TEXT(" (point-of-interest door%d-%d area%d)\n"), Area1, Area2, Area1);
Problem += FString::Printf(TEXT(" (point-of-interest door%d-%d area%d)\n"), Area1, Area2, Area2);
Problem += FString::Printf(TEXT(" (connected area%d area%d door%d-%d)\n"), Area1, Area2, Area1, Area2);
Problem += FString::Printf(TEXT(" (connected area%d area%d door%d-%d)\n"), Area2, Area1, Area1, Area2);
if(WaypointData.bOpen)
{
Problem += FString::Printf(TEXT(" (open door%d-%d)\n"), Area1, Area2);
}
else
{
Problem += FString::Printf(TEXT(" (closed door%d-%d)\n"), Area1, Area2);
const FSimpleFPSKeycardData& KeycardData = InitialWorldState->KeycardData[WaypointData.KeycardIndex];
Problem += FString::Printf(TEXT(" (point-of-interest keycard%d-%d area%d)\n"), Area1, Area2, KeycardData.Area);
Problem += FString::Printf(TEXT(" (item keycard%d-%d)\n"), Area1, Area2);
Problem += FString::Printf(TEXT(" (keycard keycard%d-%d door%d-%d)\n"), Area1, Area2, Area1, Area2);
}
}
for(const FSimpleFPSObject* Gun : InitialWorldState->GetGuns())
{
const FSimpleFPSGunData& GunData = InitialWorldState->GunData[Gun->Index];
Problem += FString::Printf(TEXT(" (point-of-interest %s area%d)\n"), *Gun->ObjectName, GunData.Area);
Problem += FString::Printf(TEXT(" (item %s)\n"), *Gun->ObjectName);
Problem += FString::Printf(TEXT(" (gun %s)\n"), *Gun->ObjectName);
if(GunData.bHasNightVision)
{
Problem += FString::Printf(TEXT(" (has-nightvision %s)\n"), *Gun->ObjectName);
}
if(GunData.bLoaded)
{
Problem += FString::Printf(TEXT(" (loaded %s)\n"), *Gun->ObjectName);
}
else
{
Problem += FString::Printf(TEXT(" (unloaded %s)\n"), *Gun->ObjectName);
FSimpleFPSObject* Ammo = InitialWorldState->GetAmmo()[GunData.Ammo];
const FSimpleFPSAmmoData& AmmoData = InitialWorldState->AmmoData[GunData.Ammo];
Problem += FString::Printf(TEXT(" (point-of-interest %s area%d)\n"), *Ammo->ObjectName, AmmoData.Area);
Problem += FString::Printf(TEXT(" (item %s)\n"), *Ammo->ObjectName);
Problem += FString::Printf(TEXT(" (ammo %s %s)\n"), *Ammo->ObjectName, *Gun->ObjectName);
}
}
for(const FSimpleFPSObject* Knife : InitialWorldState->GetKnives())
{
const FSimpleFPSKnifeData& KnifeData = InitialWorldState->KnifeData[Knife->Index];
Problem += FString::Printf(TEXT(" (point-of-interest %s area%d)\n"), *Knife->ObjectName, KnifeData.Area);
Problem += FString::Printf(TEXT(" (item %s)\n"), *Knife->ObjectName);
Problem += FString::Printf(TEXT(" (knife %s)\n"), *Knife->ObjectName);
}
for(const FSimpleFPSObject* Medikit : InitialWorldState->GetMedikits())
{
const FSimpleFPSMedikitData& MedikitData = InitialWorldState->MedikitData[Medikit->Index];
Problem += FString::Printf(TEXT(" (point-of-interest %s area%d)\n"), *Medikit->ObjectName, MedikitData.Area);
Problem += FString::Printf(TEXT(" (item %s)\n"), *Medikit->ObjectName);
Problem += FString::Printf(TEXT(" (medikit %s)\n"), *Medikit->ObjectName);
}
for(const FSimpleFPSObject* CoverPoint : InitialWorldState->GetCoverPoints())
{
const FSimpleFPSCoverPointData& CoverPointData = InitialWorldState->CoverPointData[CoverPoint->Index];
Problem += FString::Printf(TEXT(" (point-of-interest %s area%d)\n"), *CoverPoint->ObjectName, CoverPointData.Area);
Problem += FString::Printf(TEXT(" (cover-point %s)\n"), *CoverPoint->ObjectName);
}
for(int32 Row = 0; Row < NumberOfAreas; ++Row)
{
for(int32 Col = 0; Col < NumberOfAreas; ++Col)
{
if(DistanceMatrix[Row][Col] < LARGE_DISTANCE)
{
Problem += FString::Printf(TEXT(" (distance area%d area%d %d)\n"), Row, Col, DistanceMatrix[Row][Col]);
}
else
{
Problem += FString::Printf(TEXT(" (unreachable area%d area%d)\n"), Row, Col);
}
}
}
Problem += " )\n";
Problem += " ((behave)))";
if(bPrintJSHOP2Format)
{
UE_LOG(LogTemp, Warning, TEXT("Generated SimpleFPS problem in JSHOP2 format (seed = %d):"), InitializationSeed);
UE_LOG(LogTemp, Warning, TEXT("%s"), *Problem);
}
// cache our world state's const data
WorldStateConstData = InitialWorldState->GetConstData();
}
if(CurrentWorldState.IsValid())
{
WorldState->CopyFrom((const FHTNWorldState_SimpleFPS*)CurrentWorldState.Get());
}
else
{
CurrentWorldState = InitialWorldState->Copy();
WorldState->CopyFrom(InitialWorldState.Get());
}
} | [
"d.soemers@gmail.com"
] | d.soemers@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.