hexsha
stringlengths
40
40
size
int64
19
11.4M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
270
max_stars_repo_name
stringlengths
5
110
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
270
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
270
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
19
11.4M
avg_line_length
float64
1.93
229k
max_line_length
int64
12
688k
alphanum_fraction
float64
0.07
0.99
matches
listlengths
1
10
a67b02002c3221b8e892df4ae03f42d753b4cd7c
37,937
cpp
C++
PhysX_3.4/Source/SimulationController/src/cloth/ScClothCore.cpp
RyanTorant/simple-physx
a065a9c734c134074c63c80a9109a398b22d040c
[ "Unlicense" ]
1
2019-12-09T16:03:55.000Z
2019-12-09T16:03:55.000Z
PhysX_3.4/Source/SimulationController/src/cloth/ScClothCore.cpp
RyanTorant/simple-physx
a065a9c734c134074c63c80a9109a398b22d040c
[ "Unlicense" ]
null
null
null
PhysX_3.4/Source/SimulationController/src/cloth/ScClothCore.cpp
RyanTorant/simple-physx
a065a9c734c134074c63c80a9109a398b22d040c
[ "Unlicense" ]
null
null
null
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "ScClothCore.h" #if PX_USE_CLOTH_API using namespace physx; using namespace cloth; #include "PxClothParticleData.h" #include "PxClothTypes.h" #include "ScClothFabricCore.h" #include "ScClothSim.h" #include "ScPhysics.h" #include "ScScene.h" #include "Types.h" #include "Range.h" #include "Factory.h" #include "Cloth.h" #include "Fabric.h" #include "PsHash.h" namespace { template <typename D, typename S> PX_FORCE_INLINE cloth::Range<D> createRange(S begin, PxU32 size) { D* start = reinterpret_cast<D*>(begin); D* end = start + size; return cloth::Range<D>(start, end); } } bool Sc::DefaultClothInterCollisionFilter(void* cloth0, void* cloth1) { PX_ASSERT(cloth0); PX_ASSERT(cloth1); Sc::ClothCore* scCloth0 = static_cast<Sc::ClothCore*>(cloth0); Sc::ClothCore* scCloth1 = static_cast<Sc::ClothCore*>(cloth1); const Sc::Scene& scene = scCloth0->getSim()->getScene(); PX_ASSERT(&scCloth1->getSim()->getScene() == &scene); PxSimulationFilterShader shader = scene.getFilterShaderFast(); PxPairFlags pairFlags; PxFilterFlags filterFlags = shader( PxFilterObjectType::eCLOTH, scCloth0->getSimulationFilterData(), PxFilterObjectType::eCLOTH, scCloth1->getSimulationFilterData(), pairFlags, scene.getFilterShaderDataFast(), scene.getFilterShaderDataSizeFast()); if (filterFlags&PxFilterFlag::eCALLBACK) { // create unique pair id from cloth core ptrs const PxU32 pairId = shdfnd::hash(shdfnd::Pair<Sc::ClothCore*, Sc::ClothCore*>(scCloth0, scCloth1)); filterFlags = scene.getFilterCallbackFast()->pairFound(pairId, PxFilterObjectType::eCLOTH, scCloth0->getSimulationFilterData(), scCloth0->getPxCloth(), NULL, PxFilterObjectType::eCLOTH, scCloth1->getSimulationFilterData(), scCloth1->getPxCloth(), NULL, pairFlags); } if (filterFlags&PxFilterFlag::eKILL || filterFlags&PxFilterFlag::eSUPPRESS) return false; return true; } Sc::ClothCore::ClothCore(const PxTransform& globalPose, Sc::ClothFabricCore& fabric, const PxClothParticle* particles, PxClothFlags flags) : ActorCore(PxActorType::eCLOTH, PxActorFlag::eVISUALIZATION, PX_DEFAULT_CLIENT, 0, 0), mExternalAcceleration(0.0f), mFabric(&fabric), mBulkData(NULL), mClothFlags(flags), mContactOffset(0.0f), mRestOffset(0.0f), mNumUserSpheres(0), mNumUserCapsules(0), mNumUserPlanes(0), mNumUserConvexes(0), mNumUserTriangles(0) { initLowLevel(globalPose, particles); } Sc::ClothCore::~ClothCore() { PX_ASSERT(getSim() == NULL); if (mPhaseConfigs) PX_FREE(mPhaseConfigs); cloth::Fabric* fabric = &mLowLevelCloth->getFabric(); PX_DELETE(mLowLevelCloth); // If a cloth fabric gets deleted while the simulation is running, the fabric has to be delayed destroyed but // ScClothFabric is then gone already. So we delete here in this case. It would work automatically if the fabric // deleted itself on refCount 0 but doing it the way below keeps the LL interface independent. if (fabric->getRefCount() == 0) PX_DELETE(fabric); } void Sc::ClothCore::initLowLevel(const PxTransform& globalPose, const PxClothParticle* particles) { PX_ASSERT(mFabric); PxU32 nbPhases = mFabric->getNbPhases(); mPhaseConfigs = reinterpret_cast<cloth::PhaseConfig*>(PX_ALLOC(nbPhases * sizeof(cloth::PhaseConfig), "cloth::PhaseConfig")); if (mPhaseConfigs) { for(PxU16 i=0; i < nbPhases; i++) { cloth::PhaseConfig config(i); PX_PLACEMENT_NEW(mPhaseConfigs + i, cloth::PhaseConfig)(config); } // Create the low level object cloth::Range<const PxVec4> particlesRange = createRange<const PxVec4>(particles, mFabric->getNbParticles()); //!!!CL todo: error processing if creation fails mLowLevelCloth = Sc::Physics::getInstance().getLowLevelClothFactory().createCloth(particlesRange, mFabric->getLowLevelFabric()); if (mLowLevelCloth) { setGlobalPose(globalPose); cloth::Range<const cloth::PhaseConfig> phaseConfigRange = createRange<const cloth::PhaseConfig>(mPhaseConfigs, nbPhases); mLowLevelCloth->setPhaseConfig(phaseConfigRange); mLowLevelCloth->enableContinuousCollision(mClothFlags & PxClothFlag::eSWEPT_CONTACT); mLowLevelCloth->setUserData(this); wakeUp(Physics::sWakeCounterOnCreation); } } } // PX_SERIALIZATION void Sc::ClothCore::updateBulkData(ClothBulkData& bulkData) { cloth::MappedRange<const PxVec4> particles = cloth::readCurrentParticles(*mLowLevelCloth); bulkData.mParticles.resize(getNbParticles(), PxClothParticle(PxVec3(0.0f), 0.0f)); PxMemCopy(bulkData.mParticles.begin(), particles.begin(), particles.size() * sizeof(PxVec4)); if (getNbVirtualParticles()) { // could avoid a lot of the construction overhead inside // resize() if Array supported insertRange() instead bulkData.mVpData.resize(getNbVirtualParticles()*4); bulkData.mVpWeightData.resize(getNbVirtualParticleWeights(), PxVec3(0.0f)); getVirtualParticles(bulkData.mVpData.begin()); getVirtualParticleWeights(bulkData.mVpWeightData.begin()); } if (getNbCollisionSpheres() || getNbCollisionConvexes() || getNbCollisionTriangles()) { bulkData.mCollisionSpheres.resize(getNbCollisionSpheres()); bulkData.mCollisionPairs.resize(getNbCollisionCapsules()*2); bulkData.mCollisionPlanes.resize(getNbCollisionPlanes()); bulkData.mConvexMasks.resize(getNbCollisionConvexes()); bulkData.mCollisionTriangles.resize(getNbCollisionTriangles()); getCollisionData(bulkData.mCollisionSpheres.begin(), bulkData.mCollisionPairs.begin(), bulkData.mCollisionPlanes.begin(), bulkData.mConvexMasks.begin(), bulkData.mCollisionTriangles.begin()); } if (mLowLevelCloth->getNumMotionConstraints()) { bulkData.mConstraints.resize(mLowLevelCloth->getNumMotionConstraints(), PxClothParticleMotionConstraint(PxVec3(0.0f), 0.0f)); getMotionConstraints(bulkData.mConstraints.begin()); } if (mLowLevelCloth->getNumSeparationConstraints()) { bulkData.mSeparationConstraints.resize(mLowLevelCloth->getNumSeparationConstraints(), PxClothParticleSeparationConstraint(PxVec3(0.0f), 0.0f)); getSeparationConstraints(bulkData.mSeparationConstraints.begin()); } if (mLowLevelCloth->getNumParticleAccelerations()) { bulkData.mParticleAccelerations.resize(mLowLevelCloth->getNumParticleAccelerations()); getParticleAccelerations(bulkData.mParticleAccelerations.begin()); } if(mLowLevelCloth->getNumSelfCollisionIndices()) { bulkData.mSelfCollisionIndices.resize(mLowLevelCloth->getNumSelfCollisionIndices()); getSelfCollisionIndices(bulkData.mSelfCollisionIndices.begin()); } if (mLowLevelCloth->getNumRestPositions()) { bulkData.mRestPositions.resize(mLowLevelCloth->getNumRestPositions(), PxVec4(0.0f)); getRestPositions(bulkData.mRestPositions.begin()); } bulkData.mTetherConstraintScale = mLowLevelCloth->getTetherConstraintScale(); bulkData.mTetherConstraintStiffness = mLowLevelCloth->getTetherConstraintStiffness(); bulkData.mMotionConstraintScale = mLowLevelCloth->getMotionConstraintScale(); bulkData.mMotionConstraintBias = mLowLevelCloth->getMotionConstraintBias(); bulkData.mMotionConstraintStiffness = mLowLevelCloth->getMotionConstraintStiffness(); bulkData.mAcceleration = getExternalAcceleration(); bulkData.mDamping = mLowLevelCloth->getDamping(); bulkData.mFriction = mLowLevelCloth->getFriction(); bulkData.mCollisionMassScale = mLowLevelCloth->getCollisionMassScale(); bulkData.mLinearDrag = mLowLevelCloth->getLinearDrag(); bulkData.mAngularDrag = mLowLevelCloth->getAngularDrag(); bulkData.mLinearInertia = mLowLevelCloth->getLinearInertia(); bulkData.mAngularInertia = mLowLevelCloth->getAngularInertia(); bulkData.mCentrifugalInertia = mLowLevelCloth->getCentrifugalInertia(); bulkData.mSolverFrequency = mLowLevelCloth->getSolverFrequency(); bulkData.mStiffnessFrequency = mLowLevelCloth->getStiffnessFrequency(); bulkData.mSelfCollisionDistance = mLowLevelCloth->getSelfCollisionDistance(); bulkData.mSelfCollisionStiffness = mLowLevelCloth->getSelfCollisionStiffness(); bulkData.mGlobalPose = getGlobalPose(); bulkData.mSleepThreshold = mLowLevelCloth->getSleepThreshold(); bulkData.mWakeCounter = getWakeCounter(); bulkData.mWindVelocity = getWindVelocity(); bulkData.mDragCoefficient = getDragCoefficient(); bulkData.mLiftCoefficient = getLiftCoefficient(); } void Sc::ClothCore::resolveReferences(Sc::ClothFabricCore& fabric) { PX_ASSERT(mBulkData); mFabric = &fabric; // at this point we have all our bulk data and a reference // to the Sc::ClothFabricCore object so we can go ahead // and create the low level cloth object initLowLevel(mBulkData->mGlobalPose, mBulkData->mParticles.begin()); mLowLevelCloth->setSpheres(createRange<PxVec4>(mBulkData->mCollisionSpheres.begin(), mBulkData->mCollisionSpheres.size()), 0, 0); mLowLevelCloth->setCapsules(createRange<PxU32>(mBulkData->mCollisionPairs.begin(), mBulkData->mCollisionPairs.size()/2), 0, 0); mLowLevelCloth->setPlanes(createRange<PxVec4>(mBulkData->mCollisionPlanes.begin(), mBulkData->mCollisionPlanes.size()), 0, 0); mLowLevelCloth->setConvexes(createRange<PxU32>(mBulkData->mConvexMasks.begin(), mBulkData->mConvexMasks.size()), 0, 0); mLowLevelCloth->setTriangles(createRange<PxVec3>(mBulkData->mCollisionTriangles.begin(), mBulkData->mCollisionTriangles.size()*3), 0, 0); // update virtual particles if (mBulkData->mVpData.size()) setVirtualParticles(mBulkData->mVpData.size()/4, mBulkData->mVpData.begin(), mBulkData->mVpWeightData.size(), mBulkData->mVpWeightData.begin()); // update motion constraints if (mBulkData->mConstraints.size()) setMotionConstraints(mBulkData->mConstraints.begin()); // update separation constraints if (mBulkData->mSeparationConstraints.size()) setSeparationConstraints(mBulkData->mSeparationConstraints.begin()); // update particle accelerations if (mBulkData->mParticleAccelerations.size()) setParticleAccelerations(mBulkData->mParticleAccelerations.begin()); if (mBulkData->mSelfCollisionIndices.size()) { setSelfCollisionIndices(mBulkData->mSelfCollisionIndices.begin(), mBulkData->mSelfCollisionIndices.size()); } // update rest positions if (mBulkData->mRestPositions.size()) setRestPositions(mBulkData->mRestPositions.begin()); mLowLevelCloth->setTetherConstraintScale(mBulkData->mTetherConstraintScale); mLowLevelCloth->setTetherConstraintStiffness(mBulkData->mTetherConstraintStiffness); mLowLevelCloth->setMotionConstraintScaleBias(mBulkData->mMotionConstraintScale, mBulkData->mMotionConstraintBias); mLowLevelCloth->setMotionConstraintStiffness(mBulkData->mMotionConstraintStiffness); setExternalAcceleration(mBulkData->mAcceleration); mLowLevelCloth->setDamping(mBulkData->mDamping); mLowLevelCloth->setFriction(mBulkData->mFriction); mLowLevelCloth->setCollisionMassScale(mBulkData->mCollisionMassScale); mLowLevelCloth->setLinearDrag(mBulkData->mLinearDrag); mLowLevelCloth->setAngularDrag(mBulkData->mAngularDrag); mLowLevelCloth->setLinearInertia(mBulkData->mLinearInertia); mLowLevelCloth->setAngularInertia(mBulkData->mAngularInertia); mLowLevelCloth->setCentrifugalInertia(mBulkData->mCentrifugalInertia); mLowLevelCloth->setSolverFrequency(mBulkData->mSolverFrequency); mLowLevelCloth->setStiffnessFrequency(mBulkData->mStiffnessFrequency); mLowLevelCloth->setSelfCollisionDistance(mBulkData->mSelfCollisionDistance); mLowLevelCloth->setSelfCollisionStiffness(mBulkData->mSelfCollisionStiffness); mLowLevelCloth->setSleepThreshold(mBulkData->mSleepThreshold); setWakeCounter(mBulkData->mWakeCounter); mLowLevelCloth->setWindVelocity(mBulkData->mWindVelocity); mLowLevelCloth->setDragCoefficient(mBulkData->mDragCoefficient); mLowLevelCloth->setLiftCoefficient(mBulkData->mLiftCoefficient); mBulkData = NULL; } void Sc::ClothBulkData::exportExtraData(PxSerializationContext& context) { Cm::exportArray(mParticles, context); Cm::exportArray(mVpData, context); Cm::exportArray(mVpWeightData, context); Cm::exportArray(mCollisionSpheres, context); Cm::exportArray(mCollisionPairs, context); Cm::exportArray(mCollisionPlanes, context); Cm::exportArray(mConvexMasks, context); Cm::exportArray(mCollisionTriangles, context); Cm::exportArray(mConstraints, context); Cm::exportArray(mSeparationConstraints, context); Cm::exportArray(mParticleAccelerations, context); Cm::exportArray(mRestPositions, context); } void Sc::ClothBulkData::importExtraData(PxDeserializationContext& context) { Cm::importArray(mParticles, context); Cm::importArray(mVpData, context); Cm::importArray(mVpWeightData, context); Cm::importArray(mCollisionSpheres, context); Cm::importArray(mCollisionPairs, context); Cm::importArray(mCollisionPlanes, context); Cm::importArray(mConvexMasks, context); Cm::importArray(mCollisionTriangles, context); Cm::importArray(mConstraints, context); Cm::importArray(mSeparationConstraints, context); Cm::importArray(mParticleAccelerations, context); Cm::importArray(mRestPositions, context); } void Sc::ClothCore::exportExtraData(PxSerializationContext& stream) { PX_ALLOCA(buf, ClothBulkData, 1); Cm::markSerializedMem(buf, sizeof(ClothBulkData)); ClothBulkData* bulkData = PX_PLACEMENT_NEW(buf, ClothBulkData); updateBulkData(*bulkData); stream.writeData(bulkData, sizeof(ClothBulkData)); bulkData->exportExtraData(stream); bulkData->~ClothBulkData(); } void Sc::ClothCore::importExtraData(PxDeserializationContext& context) { mBulkData = context.readExtraData<ClothBulkData>(); mBulkData->importExtraData(context); } //~PX_SERIALIZATION void Sc::ClothCore::setParticles(const PxClothParticle* currentParticles, const PxClothParticle* previousParticles) { if (currentParticles) { cloth::MappedRange<PxVec4> particlesRange = mLowLevelCloth->getCurrentParticles(); if(reinterpret_cast<const PxClothParticle*>(particlesRange.begin()) != currentParticles) PxMemCopy(particlesRange.begin(), currentParticles, particlesRange.size() * sizeof(PxVec4)); } if (previousParticles) { cloth::MappedRange<PxVec4> particlesRange = mLowLevelCloth->getPreviousParticles(); if(reinterpret_cast<const PxClothParticle*>(particlesRange.begin()) != previousParticles) PxMemCopy(particlesRange.begin(), previousParticles, particlesRange.size() * sizeof(PxVec4)); } } PxU32 Sc::ClothCore::getNbParticles() const { return mLowLevelCloth->getNumParticles(); } void Sc::ClothCore::setMotionConstraints(const PxClothParticleMotionConstraint* motionConstraints) { if(motionConstraints) { cloth::Range<PxVec4> motionConstraintsRange = mLowLevelCloth->getMotionConstraints(); PxMemCopy(motionConstraintsRange.begin(), motionConstraints, PxU32(motionConstraintsRange.size() * sizeof(PxClothParticleMotionConstraint))); } else { mLowLevelCloth->clearMotionConstraints(); } } bool Sc::ClothCore::getMotionConstraints(PxClothParticleMotionConstraint* motionConstraintsBuffer) const { PxU32 nbConstraints = mLowLevelCloth->getNumMotionConstraints(); if (nbConstraints) { PxVec4* constrData = reinterpret_cast<PxVec4*>(motionConstraintsBuffer); cloth::Range<PxVec4> constrRange = createRange<PxVec4>(constrData, nbConstraints); mLowLevelCloth->getFactory().extractMotionConstraints(*mLowLevelCloth, constrRange); return true; } else return false; } PxU32 Sc::ClothCore::getNbMotionConstraints() const { return mLowLevelCloth->getNumMotionConstraints(); } void Sc::ClothCore::setMotionConstraintConfig(const PxClothMotionConstraintConfig& config) { mLowLevelCloth->setMotionConstraintScaleBias(config.scale, config.bias); mLowLevelCloth->setMotionConstraintStiffness(config.stiffness); } PxClothMotionConstraintConfig Sc::ClothCore::getMotionConstraintConfig() const { PxClothMotionConstraintConfig result; result.scale = mLowLevelCloth->getMotionConstraintScale(); result.bias = mLowLevelCloth->getMotionConstraintBias(); result.stiffness = mLowLevelCloth->getMotionConstraintStiffness(); return result; } void Sc::ClothCore::setSeparationConstraints(const PxClothParticleSeparationConstraint* separationConstraints) { if (separationConstraints) { cloth::Range<PxVec4> separationConstraintsRange = mLowLevelCloth->getSeparationConstraints(); PxMemCopy(separationConstraintsRange.begin(), separationConstraints, PxU32(separationConstraintsRange.size() * sizeof(PxClothParticleSeparationConstraint))); } else { mLowLevelCloth->clearSeparationConstraints(); } } bool Sc::ClothCore::getSeparationConstraints(PxClothParticleSeparationConstraint* separationConstraintsBuffer) const { PxU32 nbConstraints = mLowLevelCloth->getNumSeparationConstraints(); if (nbConstraints) { PxVec4* constrData = reinterpret_cast<PxVec4*>(separationConstraintsBuffer); cloth::Range<PxVec4> constrRange = createRange<PxVec4>(constrData, nbConstraints); mLowLevelCloth->getFactory().extractSeparationConstraints(*mLowLevelCloth, constrRange); return true; } else return false; } PxU32 Sc::ClothCore::getNbSeparationConstraints() const { return mLowLevelCloth->getNumSeparationConstraints(); } void Sc::ClothCore::clearInterpolation() { return mLowLevelCloth->clearInterpolation(); } void Sc::ClothCore::setParticleAccelerations(const PxVec4* particleAccelerations) { if(particleAccelerations) { cloth::Range<PxVec4> accelerationsRange = mLowLevelCloth->getParticleAccelerations(); PxMemCopy(accelerationsRange.begin(), particleAccelerations, accelerationsRange.size() * sizeof(PxVec4)); } else { mLowLevelCloth->clearParticleAccelerations(); } } bool Sc::ClothCore::getParticleAccelerations(PxVec4* particleAccelerationBuffer) const { PxU32 nbAccelerations = mLowLevelCloth->getNumParticleAccelerations(); if (nbAccelerations) { PxVec4* accelData = reinterpret_cast<PxVec4*>(particleAccelerationBuffer); cloth::Range<PxVec4> accelRange = createRange<PxVec4>(accelData, nbAccelerations); mLowLevelCloth->getFactory().extractParticleAccelerations(*mLowLevelCloth, accelRange); return true; } else return false; } PxU32 Sc::ClothCore::getNbParticleAccelerations() const { return mLowLevelCloth->getNumParticleAccelerations(); } void Sc::ClothCore::addCollisionSphere(const PxClothCollisionSphere& sphere) { const PxVec4* data = reinterpret_cast<const PxVec4*>(&sphere); mLowLevelCloth->setSpheres(createRange<const PxVec4>(data, 1), mNumUserSpheres, mNumUserSpheres); ++mNumUserSpheres; } void Sc::ClothCore::removeCollisionSphere(PxU32 index) { PxU32 numCapsules = mLowLevelCloth->getNumCapsules(); mLowLevelCloth->setSpheres(cloth::Range<const PxVec4>(), index, index+1); mNumUserCapsules -= numCapsules - mLowLevelCloth->getNumCapsules(); --mNumUserSpheres; } void Sc::ClothCore::setCollisionSpheres(const PxClothCollisionSphere* spheresBuffer, PxU32 count) { const PxVec4* data = reinterpret_cast<const PxVec4*>(spheresBuffer); PxU32 numCapsules = mLowLevelCloth->getNumCapsules(); mLowLevelCloth->setSpheres(createRange<const PxVec4>(data, count), 0, mNumUserSpheres); mNumUserCapsules -= numCapsules - mLowLevelCloth->getNumCapsules(); mNumUserSpheres = count; } PxU32 Sc::ClothCore::getNbCollisionSpheres() const { return mLowLevelCloth->getNumSpheres(); } void Sc::ClothCore::getCollisionData(PxClothCollisionSphere* spheresBuffer, PxU32* capsulesBuffer, PxClothCollisionPlane* planesBuffer, PxU32* convexesBuffer, PxClothCollisionTriangle* trianglesBuffer) const { PxVec4* sphereData = reinterpret_cast<PxVec4*>(spheresBuffer); cloth::Range<PxVec4> sphereRange = createRange<PxVec4>(sphereData, sphereData ? mLowLevelCloth->getNumSpheres() : 0); uint32_t* capsuleData = reinterpret_cast<uint32_t*>(capsulesBuffer); cloth::Range<uint32_t> capsuleRange = createRange<uint32_t>(capsuleData, capsuleData ? 2*mLowLevelCloth->getNumCapsules() : 0); PxVec4* planeData = reinterpret_cast<PxVec4*>(planesBuffer); cloth::Range<PxVec4> planeRange = createRange<PxVec4>(planeData, planeData ? mLowLevelCloth->getNumPlanes() : 0); uint32_t* convexData = reinterpret_cast<uint32_t*>(convexesBuffer); cloth::Range<uint32_t> convexRange = createRange<uint32_t>(convexData, convexData ? mLowLevelCloth->getNumConvexes() : 0); PxVec3* triangleData = reinterpret_cast<PxVec3*>(trianglesBuffer); cloth::Range<PxVec3> triangleRange = createRange<PxVec3>(triangleData, triangleData ? mLowLevelCloth->getNumTriangles() * 3 : 0); mLowLevelCloth->getFactory().extractCollisionData(*mLowLevelCloth, sphereRange, capsuleRange, planeRange, convexRange, triangleRange); } void Sc::ClothCore::addCollisionCapsule(PxU32 first, PxU32 second) { PxU32 indices[2] = { first, second }; mLowLevelCloth->setCapsules(createRange<const PxU32>(indices, 2), mNumUserCapsules, mNumUserCapsules); ++mNumUserCapsules; } void Sc::ClothCore::removeCollisionCapsule(PxU32 index) { mLowLevelCloth->setCapsules(cloth::Range<const PxU32>(), index, index+1); --mNumUserCapsules; } PxU32 Sc::ClothCore::getNbCollisionCapsules() const { return mLowLevelCloth->getNumCapsules(); } void Sc::ClothCore::addCollisionTriangle(const PxClothCollisionTriangle& triangle) { mLowLevelCloth->setTriangles(createRange<const PxVec3>(&triangle, 3), mNumUserTriangles, mNumUserTriangles); ++mNumUserTriangles; } void Sc::ClothCore::removeCollisionTriangle(PxU32 index) { mLowLevelCloth->setTriangles(cloth::Range<const PxVec3>(), index, index+1); --mNumUserTriangles; } void Sc::ClothCore::setCollisionTriangles(const PxClothCollisionTriangle* trianglesBuffer, PxU32 count) { mLowLevelCloth->setTriangles(createRange<const PxVec3>(trianglesBuffer, count*3), 0, mNumUserTriangles); mNumUserTriangles = count; } PxU32 Sc::ClothCore::getNbCollisionTriangles() const { return mLowLevelCloth->getNumTriangles(); } void Sc::ClothCore::addCollisionPlane(const PxClothCollisionPlane& plane) { mLowLevelCloth->setPlanes(createRange<const PxVec4>(&plane, 1), mNumUserPlanes, mNumUserPlanes); ++mNumUserPlanes; } void Sc::ClothCore::removeCollisionPlane(PxU32 index) { PxU32 numConvexes = mLowLevelCloth->getNumConvexes(); mLowLevelCloth->setPlanes(cloth::Range<const PxVec4>(), index, index+1); mNumUserConvexes -= numConvexes - mLowLevelCloth->getNumConvexes(); --mNumUserPlanes; } void Sc::ClothCore::setCollisionPlanes(const PxClothCollisionPlane* planesBuffer, PxU32 count) { PxU32 numConvexes = mLowLevelCloth->getNumConvexes(); mLowLevelCloth->setPlanes(createRange<const PxVec4>(planesBuffer, count), 0, mNumUserPlanes); mNumUserConvexes -= numConvexes - mLowLevelCloth->getNumConvexes(); mNumUserPlanes = count; } PxU32 Sc::ClothCore::getNbCollisionPlanes() const { return mLowLevelCloth->getNumPlanes(); } void Sc::ClothCore::addCollisionConvex(PxU32 mask) { mLowLevelCloth->setConvexes(createRange<const PxU32>(&mask, 1), mNumUserConvexes, mNumUserConvexes); ++mNumUserConvexes; } void Sc::ClothCore::removeCollisionConvex(PxU32 index) { mLowLevelCloth->setConvexes(cloth::Range<const PxU32>(), index, index+1); --mNumUserConvexes; } PxU32 Sc::ClothCore::getNbCollisionConvexes() const { return mLowLevelCloth->getNumConvexes(); } void Sc::ClothCore::setVirtualParticles(PxU32 numParticles, const PxU32* indices, PxU32 numWeights, const PxVec3* weights) { cloth::Range<const PxU32[4]> vertexAndWeightIndicesRange = createRange<const PxU32[4]>(indices, numParticles); cloth::Range<const PxVec3> weightTableRange = createRange<const PxVec3>(weights, numWeights); mLowLevelCloth->setVirtualParticles(vertexAndWeightIndicesRange, weightTableRange); } PxU32 Sc::ClothCore::getNbVirtualParticles() const { return mLowLevelCloth->getNumVirtualParticles(); } void Sc::ClothCore::getVirtualParticles(PxU32* indicesBuffer) const { PxU32 numVParticles = PxU32(mLowLevelCloth->getNumVirtualParticles()); PxU32 (*data)[4] = reinterpret_cast<PxU32(*)[4]>(indicesBuffer); cloth::Range<PxU32[4]> vParticleRange(data, data + numVParticles); cloth::Range<PxVec3> weightTableRange; mLowLevelCloth->getFactory().extractVirtualParticles(*mLowLevelCloth, vParticleRange, weightTableRange); } PxU32 Sc::ClothCore::getNbVirtualParticleWeights() const { return mLowLevelCloth->getNumVirtualParticleWeights(); } void Sc::ClothCore::getVirtualParticleWeights(PxVec3* weightsBuffer) const { PxU32 numWeights = PxU32(mLowLevelCloth->getNumVirtualParticleWeights()); cloth::Range<PxU32[4]> indicesRange; cloth::Range<PxVec3> weightsRange(weightsBuffer, weightsBuffer + numWeights); mLowLevelCloth->getFactory().extractVirtualParticles(*mLowLevelCloth, indicesRange, weightsRange); } PxTransform Sc::ClothCore::getGlobalPose() const { PxTransform pose(mLowLevelCloth->getTranslation(), mLowLevelCloth->getRotation()); return pose; } void Sc::ClothCore::setGlobalPose(const PxTransform& pose) { mLowLevelCloth->setTranslation(pose.p); mLowLevelCloth->setRotation(pose.q); mLowLevelCloth->clearInertia(); } PxVec3 Sc::ClothCore::getLinearInertiaScale() const { return mLowLevelCloth->getLinearInertia(); } void Sc::ClothCore::setLinearInertiaScale(PxVec3 scale) { mLowLevelCloth->setLinearInertia(scale); } PxVec3 Sc::ClothCore::getAngularInertiaScale() const { return mLowLevelCloth->getAngularInertia(); } void Sc::ClothCore::setAngularInertiaScale(PxVec3 scale) { mLowLevelCloth->setAngularInertia(scale); } PxVec3 Sc::ClothCore::getCentrifugalInertiaScale() const { return mLowLevelCloth->getCentrifugalInertia(); } void Sc::ClothCore::setCentrifugalInertiaScale(PxVec3 scale) { mLowLevelCloth->setCentrifugalInertia(scale); } void Sc::ClothCore::setTargetPose(const PxTransform& pose) { //!!!CL todo: behavior for free-standing cloth? mLowLevelCloth->setTranslation(pose.p); mLowLevelCloth->setRotation(pose.q); } void Sc::ClothCore::setExternalAcceleration(PxVec3 acceleration) { mExternalAcceleration = acceleration; } PxVec3 Sc::ClothCore::getExternalAcceleration() const { return mExternalAcceleration; } void Sc::ClothCore::setDampingCoefficient(PxVec3 dampingCoefficient) { mLowLevelCloth->setDamping(dampingCoefficient); } PxVec3 Sc::ClothCore::getDampingCoefficient() const { return mLowLevelCloth->getDamping(); } void Sc::ClothCore::setFrictionCoefficient(PxReal frictionCoefficient) { mLowLevelCloth->setFriction(frictionCoefficient); } PxReal Sc::ClothCore::getFrictionCoefficient() const { return mLowLevelCloth->getFriction(); } void Sc::ClothCore::setLinearDragCoefficient(PxVec3 dragCoefficient) { mLowLevelCloth->setLinearDrag(dragCoefficient); } PxVec3 Sc::ClothCore::getLinearDragCoefficient() const { return mLowLevelCloth->getLinearDrag(); } void Sc::ClothCore::setAngularDragCoefficient(PxVec3 dragCoefficient) { mLowLevelCloth->setAngularDrag(dragCoefficient); } PxVec3 Sc::ClothCore::getAngularDragCoefficient() const { return mLowLevelCloth->getAngularDrag(); } void Sc::ClothCore::setCollisionMassScale(PxReal scalingCoefficient) { mLowLevelCloth->setCollisionMassScale(scalingCoefficient); } PxReal Sc::ClothCore::getCollisionMassScale() const { return mLowLevelCloth->getCollisionMassScale(); } void Sc::ClothCore::setSelfCollisionDistance(PxReal distance) { mLowLevelCloth->setSelfCollisionDistance(distance); } PxReal Sc::ClothCore::getSelfCollisionDistance() const { return mLowLevelCloth->getSelfCollisionDistance(); } void Sc::ClothCore::setSelfCollisionStiffness(PxReal stiffness) { mLowLevelCloth->setSelfCollisionStiffness(stiffness); } PxReal Sc::ClothCore::getSelfCollisionStiffness() const { return mLowLevelCloth->getSelfCollisionStiffness(); } void Sc::ClothCore::setSelfCollisionIndices(const PxU32* indices, PxU32 nbIndices) { mLowLevelCloth->setSelfCollisionIndices( cloth::Range<const PxU32>(indices, indices + nbIndices)); } bool Sc::ClothCore::getSelfCollisionIndices(PxU32* indices) const { PxU32 nbIndices = mLowLevelCloth->getNumSelfCollisionIndices(); mLowLevelCloth->getFactory().extractSelfCollisionIndices( *mLowLevelCloth, cloth::Range<PxU32>(indices, indices + nbIndices)); return !!nbIndices; } PxU32 Sc::ClothCore::getNbSelfCollisionIndices() const { return mLowLevelCloth->getNumSelfCollisionIndices(); } void Sc::ClothCore::setRestPositions(const PxVec4* restPositions) { PxU32 size = restPositions ? mLowLevelCloth->getNumParticles() : 0; mLowLevelCloth->setRestPositions(cloth::Range<const PxVec4>(restPositions, restPositions + size)); } bool Sc::ClothCore::getRestPositions(PxVec4* restPositions) const { PxU32 size = mLowLevelCloth->getNumRestPositions(); mLowLevelCloth->getFactory().extractRestPositions(*mLowLevelCloth, cloth::Range<PxVec4>(restPositions, restPositions + size)); return true; } PxU32 Sc::ClothCore::getNbRestPositions() const { return mLowLevelCloth->getNumRestPositions(); } void Sc::ClothCore::setSolverFrequency(PxReal solverFreq) { mLowLevelCloth->setSolverFrequency(solverFreq); } PxReal Sc::ClothCore::getSolverFrequency() const { return mLowLevelCloth->getSolverFrequency(); } void Sc::ClothCore::setStiffnessFrequency(PxReal frequency) { mLowLevelCloth->setStiffnessFrequency(frequency); } PxReal Sc::ClothCore::getStiffnessFrequency() const { return mLowLevelCloth->getStiffnessFrequency(); } void physx::Sc::ClothCore::setStretchConfig(PxClothFabricPhaseType::Enum type, const PxClothStretchConfig& config) { cloth::PhaseConfig pc; pc.mStiffness = config.stiffness; pc.mStiffnessMultiplier = config.stiffnessMultiplier; pc.mStretchLimit = config.stretchLimit; pc.mCompressionLimit = config.compressionLimit; PxU32 nbPhases = mFabric->getNbPhases(); for(PxU32 i=0; i < nbPhases; i++) { // update phase config copies (but preserve existing phase index) if (mFabric->getPhaseType(i) == type) { mPhaseConfigs[i].mStiffness = config.stiffness; mPhaseConfigs[i].mStiffnessMultiplier = config.stiffnessMultiplier; mPhaseConfigs[i].mCompressionLimit = config.compressionLimit; mPhaseConfigs[i].mStretchLimit = config.stretchLimit; } } // set to low level cloth::Range<const cloth::PhaseConfig> phaseConfigRange = createRange<const cloth::PhaseConfig>(mPhaseConfigs, nbPhases); mLowLevelCloth->setPhaseConfig(phaseConfigRange); } void Sc::ClothCore::setTetherConfig(const PxClothTetherConfig& config) { mLowLevelCloth->setTetherConstraintScale(config.stretchLimit); mLowLevelCloth->setTetherConstraintStiffness(config.stiffness); } PxClothStretchConfig Sc::ClothCore::getStretchConfig(PxClothFabricPhaseType::Enum type) const { cloth::PhaseConfig pc; PxU32 nbPhases = mFabric->getNbPhases(); for(PxU32 i=0; i < nbPhases; i++) { if (mFabric->getPhaseType(i) == type) { pc = mPhaseConfigs[i]; break; } } return PxClothStretchConfig(pc.mStiffness, pc.mStiffnessMultiplier, pc.mCompressionLimit, pc.mStretchLimit); } PxClothTetherConfig Sc::ClothCore::getTetherConfig() const { return PxClothTetherConfig( mLowLevelCloth->getTetherConstraintStiffness(), mLowLevelCloth->getTetherConstraintScale()); } void Sc::ClothCore::setClothFlags(PxClothFlags flags) { PxClothFlags diff = mClothFlags ^ flags; mClothFlags = flags; if((diff & ~flags) & PxClothFlag::eSCENE_COLLISION) getSim()->clearCollisionShapes(); if(diff & PxClothFlag::eSWEPT_CONTACT) mLowLevelCloth->enableContinuousCollision(flags.isSet(PxClothFlag::eSWEPT_CONTACT)); if((diff & PxClothFlag::eCUDA) && getSim()) getSim()->reinsert(); } PxClothFlags Sc::ClothCore::getClothFlags() const { return mClothFlags; } void Sc::ClothCore::setWindVelocity(PxVec3 value) { mLowLevelCloth->setWindVelocity(value); } PxVec3 Sc::ClothCore::getWindVelocity() const { return mLowLevelCloth->getWindVelocity(); } void Sc::ClothCore::setDragCoefficient(PxReal value) { mLowLevelCloth->setDragCoefficient(value); } PxReal Sc::ClothCore::getDragCoefficient() const { return mLowLevelCloth->getDragCoefficient(); } void Sc::ClothCore::setLiftCoefficient(PxReal value) { mLowLevelCloth->setLiftCoefficient(value); } PxReal Sc::ClothCore::getLiftCoefficient() const { return mLowLevelCloth->getLiftCoefficient(); } bool Sc::ClothCore::isSleeping() const { return mLowLevelCloth->isAsleep(); } PxReal Sc::ClothCore::getSleepLinearVelocity() const { return mLowLevelCloth->getSleepThreshold(); } void Sc::ClothCore::setSleepLinearVelocity(PxReal threshold) { mLowLevelCloth->setSleepThreshold(threshold); // does wake the cloth up automatically } void Sc::ClothCore::setWakeCounter(PxReal wakeCounterValue) { if(wakeCounterValue > PX_MAX_U32 / 1000) return mLowLevelCloth->setSleepTestInterval(PX_MAX_U32); PxU32 intervalsToSleep = PxU32(wakeCounterValue * 1000); // test at least 5 times until sleep, or 5 times per second PxU32 testInterval = PxMax(1u, PxMin(intervalsToSleep / 5, 200u)); PxU32 afterCount = intervalsToSleep / testInterval; bool wasSleeping = mLowLevelCloth->isAsleep(); // does wake the cloth up automatically mLowLevelCloth->setSleepTestInterval(testInterval); mLowLevelCloth->setSleepAfterCount(afterCount); // setWakeCounter(0) should not change the sleep state, put back to sleep if (wasSleeping && wakeCounterValue == 0.0f) mLowLevelCloth->putToSleep(); } PxReal Sc::ClothCore::getWakeCounter() const { PxU32 testInterval = mLowLevelCloth->getSleepTestInterval(); if(testInterval == PX_MAX_U32) return PX_MAX_REAL; PxU32 afterCount = mLowLevelCloth->getSleepAfterCount(); PxU32 passCount = mLowLevelCloth->getSleepPassCount(); if (passCount >= afterCount) return 0.0f; return (afterCount - passCount) * testInterval / 1000.0f; } void Sc::ClothCore::wakeUp(PxReal wakeCounter) { setWakeCounter(wakeCounter); } void Sc::ClothCore::putToSleep() { mLowLevelCloth->putToSleep(); } void Sc::ClothCore::getParticleData(PxClothParticleData& data) { if(data.getDataAccessFlags() & PxDataAccessFlag::eDEVICE) { cloth::GpuParticles particles = mLowLevelCloth->getGpuParticles(); data.particles = reinterpret_cast<PxClothParticle*>(particles.mCurrent); data.previousParticles = reinterpret_cast<PxClothParticle*>(particles.mPrevious); } else { mLowLevelCloth->lockParticles(); // When eWRITABLE flag is set, write happens during PxClothParticleData::unlock() data.particles = reinterpret_cast<PxClothParticle*>(const_cast<PxVec4*>( cloth::readCurrentParticles(*mLowLevelCloth).begin())); data.previousParticles = reinterpret_cast<PxClothParticle*>(const_cast<PxVec4*>( cloth::readPreviousParticles(*mLowLevelCloth).begin())); } } void Sc::ClothCore::unlockParticleData() { mLowLevelCloth->unlockParticles(); } PxReal Sc::ClothCore::getPreviousTimeStep() const { return mLowLevelCloth->getPreviousIterationDt(); } PxBounds3 Sc::ClothCore::getWorldBounds() const { const PxVec3& center = reinterpret_cast<const PxVec3&>(mLowLevelCloth->getBoundingBoxCenter()); const PxVec3& extent = reinterpret_cast<const PxVec3&>(mLowLevelCloth->getBoundingBoxScale()); PxBounds3 localBounds = PxBounds3::centerExtents(center, extent); PX_ASSERT(!localBounds.isEmpty()); return PxBounds3::transformFast(getGlobalPose(), localBounds); } void Sc::ClothCore::setSimulationFilterData(const PxFilterData& data) { mFilterData = data; } PxFilterData Sc::ClothCore::getSimulationFilterData() const { return mFilterData; } void Sc::ClothCore::setContactOffset(PxReal offset) { mContactOffset = offset; } PxReal Sc::ClothCore::getContactOffset() const { return mContactOffset; } void Sc::ClothCore::setRestOffset(PxReal offset) { mRestOffset = offset; } PxReal Sc::ClothCore::getRestOffset() const { return mRestOffset; } Sc::ClothSim* Sc::ClothCore::getSim() const { return static_cast<ClothSim*>(Sc::ActorCore::getSim()); } PxCloth* Sc::ClothCore::getPxCloth() { return gOffsetTable.convertScCloth2Px(this); } void Sc::ClothCore::onOriginShift(const PxVec3& shift) { mLowLevelCloth->teleport(-shift); } void Sc::ClothCore::switchCloth(cloth::Cloth* cl) { cloth::Fabric* fabric = &mLowLevelCloth->getFabric(); cloth::Factory::Platform platform = mLowLevelCloth->getFactory().getPlatform(); PX_DELETE(mLowLevelCloth); mLowLevelCloth = cl; // delete fabric if referenced by no lowlevel Cloth or ClothFabricCore. if (0 == fabric->getRefCount()) { if(platform != cloth::Factory::CPU) mFabric->setLowLevelGpuFabric(NULL); PX_DELETE(fabric); } if(cl->getFactory().getPlatform() != cloth::Factory::CPU) mFabric->setLowLevelGpuFabric(&cl->getFabric()); } #endif // PX_USE_CLOTH_API
32.676141
145
0.788808
[ "object" ]
a67e00a955390b04338326d58b9ee9cdac309b0f
1,660
cpp
C++
Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkModule.cpp
BreakerOfThings/o3de
f4c59f868c726470ec910623facd836047d059c3
[ "Apache-2.0", "MIT" ]
1
2022-03-28T08:06:58.000Z
2022-03-28T08:06:58.000Z
Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkModule.cpp
BreakerOfThings/o3de
f4c59f868c726470ec910623facd836047d059c3
[ "Apache-2.0", "MIT" ]
null
null
null
Gems/Atom/Tools/AtomToolsFramework/Code/Source/AtomToolsFrameworkModule.cpp
BreakerOfThings/o3de
f4c59f868c726470ec910623facd836047d059c3
[ "Apache-2.0", "MIT" ]
null
null
null
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include <AtomToolsFrameworkModule.h> #include <AtomToolsFrameworkSystemComponent.h> #include <Window/AtomToolsMainWindowSystemComponent.h> #include <PerformanceMonitor/PerformanceMonitorSystemComponent.h> #include <PreviewRenderer/PreviewRendererSystemComponent.h> namespace AtomToolsFramework { AtomToolsFrameworkModule::AtomToolsFrameworkModule() { m_descriptors.insert(m_descriptors.end(), { AtomToolsFrameworkSystemComponent::CreateDescriptor(), AtomToolsMainWindowSystemComponent::CreateDescriptor(), PerformanceMonitorSystemComponent::CreateDescriptor(), PreviewRendererSystemComponent::CreateDescriptor(), }); } AZ::ComponentTypeList AtomToolsFrameworkModule::GetRequiredSystemComponents() const { return AZ::ComponentTypeList{ azrtti_typeid<AtomToolsFrameworkSystemComponent>(), azrtti_typeid<AtomToolsMainWindowSystemComponent>(), azrtti_typeid<PerformanceMonitorSystemComponent>(), azrtti_typeid<PreviewRendererSystemComponent>(), }; } } #if !defined(AtomToolsFramework_EDITOR) // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM // The first parameter should be GemName_GemIdLower // The second should be the fully qualified name of the class above AZ_DECLARE_MODULE_CLASS(Gem_AtomToolsFramework, AtomToolsFramework::AtomToolsFrameworkModule) #endif
37.727273
100
0.748193
[ "3d" ]
a67e529828f0e96d0224204f1fd3311a86ac219b
5,766
cc
C++
nofx/nofx_ofAppRunner/main.cc
sepehr-laal/nofx
7abc9da3d4fc0f5b72c6b3d591a08cf44d00277e
[ "MIT" ]
null
null
null
nofx/nofx_ofAppRunner/main.cc
sepehr-laal/nofx
7abc9da3d4fc0f5b72c6b3d591a08cf44d00277e
[ "MIT" ]
null
null
null
nofx/nofx_ofAppRunner/main.cc
sepehr-laal/nofx
7abc9da3d4fc0f5b72c6b3d591a08cf44d00277e
[ "MIT" ]
null
null
null
#include "globals.h" #include "nofx_dependencies.h" #include "nofx_ofDoesHWOrientation.h" #include "nofx_ofExit.h" #include "nofx_ofGetAppPtr.h" #include "nofx_ofGetFrameNum.h" #include "nofx_ofGetFrameRate.h" #include "nofx_ofGetHeight.h" #include "nofx_ofGetLastFrameTime.h" #include "nofx_ofGetOrientation.h" #include "nofx_ofGetScreenHeight.h" #include "nofx_ofGetScreenWidth.h" #include "nofx_ofGetTargetFrameRate.h" #include "nofx_ofGetWidth.h" #include "nofx_ofGetWindowHeight.h" #include "nofx_ofGetWindowMode.h" #include "nofx_ofGetWindowPositionX.h" #include "nofx_ofGetWindowPositionY.h" #include "nofx_ofGetWindowPtr.h" #include "nofx_ofGetWindowRect.h" #include "nofx_ofGetWindowSize.h" #include "nofx_ofGetWindowWidth.h" #include "nofx_ofHideCursor.h" #include "nofx_ofRunApp.h" #include "nofx_ofSetAppPtr.h" #include "nofx_ofSetFrameRate.h" #include "nofx_ofSetFullscreen.h" #include "nofx_ofSetOrientation.h" #include "nofx_ofSetVerticalSync.h" #include "nofx_ofSetWindowPosition.h" #include "nofx_ofSetWindowShape.h" #include "nofx_ofSetWindowTitle.h" #include "nofx_ofSetupOpenGL.h" #include "nofx_ofShowCursor.h" #include "nofx_ofSleepMillis.h" #include "nofx_ofToggleFullscreen.h" namespace nofx { namespace AppRunner { using namespace v8; void Initialize(v8::Handle<Object> target, v8::Handle<Value> unused, v8::Handle<Context> context) { target->Set(NanNew<v8::String>("dependencies"), NanNew<v8::FunctionTemplate>(nofx_dependencies)->GetFunction()); target->Set(NanNew<v8::String>("ofDoesHWOrientation"), NanNew<v8::FunctionTemplate>(nofx_ofDoesHWOrientation)->GetFunction()); target->Set(NanNew<v8::String>("ofExit"), NanNew<v8::FunctionTemplate>(nofx_ofExit)->GetFunction()); target->Set(NanNew<v8::String>("ofGetAppPtr"), NanNew<v8::FunctionTemplate>(nofx_ofGetAppPtr)->GetFunction()); target->Set(NanNew<v8::String>("ofGetFrameNum"), NanNew<v8::FunctionTemplate>(nofx_ofGetFrameNum)->GetFunction()); target->Set(NanNew<v8::String>("ofGetFrameRate"), NanNew<v8::FunctionTemplate>(nofx_ofGetFrameRate)->GetFunction()); target->Set(NanNew<v8::String>("ofGetHeight"), NanNew<v8::FunctionTemplate>(nofx_ofGetHeight)->GetFunction()); target->Set(NanNew<v8::String>("ofGetLastFrameTime"), NanNew<v8::FunctionTemplate>(nofx_ofGetLastFrameTime)->GetFunction()); target->Set(NanNew<v8::String>("ofGetOrientation"), NanNew<v8::FunctionTemplate>(nofx_ofGetOrientation)->GetFunction()); target->Set(NanNew<v8::String>("ofGetScreenHeight"), NanNew<v8::FunctionTemplate>(nofx_ofGetScreenHeight)->GetFunction()); target->Set(NanNew<v8::String>("ofGetScreenWidth"), NanNew<v8::FunctionTemplate>(nofx_ofGetScreenWidth)->GetFunction()); target->Set(NanNew<v8::String>("ofGetTargetFrameRate"), NanNew<v8::FunctionTemplate>(nofx_ofGetTargetFrameRate)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWidth"), NanNew<v8::FunctionTemplate>(nofx_ofGetWidth)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowHeight"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowHeight)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowMode"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowMode)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowPositionX"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowPositionX)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowPositionY"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowPositionY)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowPtr"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowPtr)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowRect"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowRect)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowSize"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowSize)->GetFunction()); target->Set(NanNew<v8::String>("ofGetWindowWidth"), NanNew<v8::FunctionTemplate>(nofx_ofGetWindowWidth)->GetFunction()); target->Set(NanNew<v8::String>("ofHideCursor"), NanNew<v8::FunctionTemplate>(nofx_ofHideCursor)->GetFunction()); target->Set(NanNew<v8::String>("ofRunApp"), NanNew<v8::FunctionTemplate>(nofx_ofRunApp)->GetFunction()); target->Set(NanNew<v8::String>("ofSetAppPtr"), NanNew<v8::FunctionTemplate>(nofx_ofSetAppPtr)->GetFunction()); target->Set(NanNew<v8::String>("ofSetFrameRate"), NanNew<v8::FunctionTemplate>(nofx_ofSetFrameRate)->GetFunction()); target->Set(NanNew<v8::String>("ofSetFullscreen"), NanNew<v8::FunctionTemplate>(nofx_ofSetFullscreen)->GetFunction()); target->Set(NanNew<v8::String>("ofSetOrientation"), NanNew<v8::FunctionTemplate>(nofx_ofSetOrientation)->GetFunction()); target->Set(NanNew<v8::String>("ofSetVerticalSync"), NanNew<v8::FunctionTemplate>(nofx_ofSetVerticalSync)->GetFunction()); target->Set(NanNew<v8::String>("ofSetWindowPosition"), NanNew<v8::FunctionTemplate>(nofx_ofSetWindowPosition)->GetFunction()); target->Set(NanNew<v8::String>("ofSetWindowShape"), NanNew<v8::FunctionTemplate>(nofx_ofSetWindowShape)->GetFunction()); target->Set(NanNew<v8::String>("ofSetWindowTitle"), NanNew<v8::FunctionTemplate>(nofx_ofSetWindowTitle)->GetFunction()); target->Set(NanNew<v8::String>("ofSetupOpenGL"), NanNew<v8::FunctionTemplate>(nofx_ofSetupOpenGL)->GetFunction()); target->Set(NanNew<v8::String>("ofShowCursor"), NanNew<v8::FunctionTemplate>(nofx_ofShowCursor)->GetFunction()); target->Set(NanNew<v8::String>("ofSleepMillis"), NanNew<v8::FunctionTemplate>(nofx_ofSleepMillis)->GetFunction()); target->Set(NanNew<v8::String>("ofToggleFullscreen"), NanNew<v8::FunctionTemplate>(nofx_ofToggleFullscreen)->GetFunction()); } //!Initialize } //!namespace AppRunner } //!namespace nofx NODE_MODULE_CONTEXT_AWARE(nofx_ofAppRunner, nofx::AppRunner::Initialize)
64.066667
131
0.771245
[ "object" ]
a67fcd798efacb9c6d6f32ee241aa2afa2640050
5,374
hpp
C++
cpp/src/samchon/protocol/Invoke.hpp
wydingez/truck-packer
c59d2ec322b08ac9ba773616a886a575d2af6461
[ "BSD-3-Clause" ]
111
2016-04-08T14:10:15.000Z
2020-12-21T12:25:10.000Z
cpp/src/samchon/protocol/Invoke.hpp
wydingez/truck-packer
c59d2ec322b08ac9ba773616a886a575d2af6461
[ "BSD-3-Clause" ]
16
2016-05-27T05:41:56.000Z
2020-06-23T14:55:00.000Z
cpp/src/samchon/protocol/Invoke.hpp
wydingez/truck-packer
c59d2ec322b08ac9ba773616a886a575d2af6461
[ "BSD-3-Clause" ]
49
2016-10-27T09:45:35.000Z
2020-12-21T12:25:13.000Z
#pragma once #include <samchon/protocol/SharedEntityArray.hpp> # include <samchon/protocol/InvokeParameter.hpp> namespace samchon { namespace protocol { /** * @brief Standard message of network I/O * * @details * <p> Invoke is a class used in network I/O in protocol package of Samchon Framework. </p> * * <p> The Invoke message has an XML structure like the result screen of provided example in below. * We can enjoy lots of benefits by the normalized and standardized message structure used in * network I/O. </p> * * <p> The greatest advantage is that we can make any type of network system, even how the system * is enourmously complicated. As network communication message is standardized, we only need to * concentrate on logical relationships between network systems. We can handle each network system * like a object (class) in OOD. And those relationships can be easily designed by using design * pattern. </p> * * <p> In Samchon Framework, you can make any type of network system with basic 3 + 1 componenets * (IProtocol, Server and IClient + ServerConnector), by implemens or inherits them, like designing * classes of S/W architecture. </p> * * ![Basic Components](http://samchon.github.io/framework/images/design/cpp_class_diagram/protocol_invoke.png) * * @see {@link IProtocol} * @handbook [Protocol - Standard Message](https://github.com/samchon/framework/wiki/CPP-Protocol-Standard_Message) * @author Jeongho Nam <http://samchon.org> */ class Invoke : public SharedEntityArray<InvokeParameter> { private: typedef SharedEntityArray<InvokeParameter> super; protected: /** * @brief Represent who listens, often be a function name */ std::string listener; public: /* -------------------------------------------------------------------- CONSTRUCTORS -------------------------------------------------------------------- */ Invoke() : super() { }; /** * @brief Construct from a listener * * @param listener Represents who listens the Invoke message. Almost same with Function name */ Invoke(const std::string &listener) { this->listener = listener; }; virtual ~Invoke() = default; virtual void construct(std::shared_ptr<library::XML> xml) override { listener = xml->getProperty("listener"); super::construct(xml); }; protected: virtual auto createChild(std::shared_ptr<library::XML>) -> InvokeParameter* override { return new InvokeParameter(); }; /* -------------------------------------------------------------------- VARIADIC CONSTRUCTORS -------------------------------------------------------------------- */ public: /** * @brief Construct from arguments * * @tparam _Ty Type of an argument which represents a parameter * @tparam _Args Left varadic template arguments' types * * @details * <p> Creates Invoke and InvokeParameter(s) at the same time by varadic template method. </p> * <p> By the varadic template constructor, you can't specify name of each InvokeParameter, but * specify type and value of each InvokeParameter. If you try to record the Invoke to Database, * the name of InvokeParameter will be <i>NULL</i>.</p> * * @note * <p> By the varadic template constructor, name of InovkeParameter(s) will be omitted. Because * of name, an identifier of an InvokeParameter, is omitted, you can't access to InvokeParameter * by Invoke::has() or Invoke::get(). </p> * * @param listener A string represents who listens the Invoke message. Almost same with name of a function. * @param val A value to be a parameter of Invoke * @param args Left arguments to be parameters of Invoke * */ template <typename T, typename ... _Args> Invoke(const std::string &listener, const T &val, const _Args& ... args) : Invoke(listener) { construct_by_vardic_template(val); construct_by_vardic_template(args...); }; template <typename T> Invoke(const std::string &listener, const T &val) : Invoke(listener) { construct_by_vardic_template(val); }; private: template <typename T, typename ... _Args> void construct_by_vardic_template(const T &val, const _Args& ... args) { construct_by_vardic_template(val); construct_by_vardic_template(args...); }; template <typename T> void construct_by_vardic_template(const T &val) { emplace_back(new InvokeParameter("", val)); }; public: /* ----------------------------------------------------------------------- GETTERS ----------------------------------------------------------------------- */ /** * @brief Get listener */ auto getListener() const -> std::string { return listener; }; /** * @brief Set listener */ void setListener(const std::string &val) { listener = val; }; /* ----------------------------------------------------------------------- EXPORTERS ----------------------------------------------------------------------- */ virtual auto TAG() const->std::string override { return "invoke"; }; virtual auto CHILD_TAG() const->std::string override { return "parameter"; }; virtual auto toXML() const->std::shared_ptr<library::XML> override { std::shared_ptr<library::XML> &xml = super::toXML(); xml->setProperty("listener", listener); return xml; }; }; }; };
30.534091
117
0.615929
[ "object" ]
a68bb64c58d1badd99e250147cea7f7b47ed3071
1,092
cpp
C++
DP/knapsackwithduplicateterms/recursive.cpp
UltraProton/Placement-Prepration
cc70f174c4410c254ce0469737a884fffdc81164
[ "MIT" ]
null
null
null
DP/knapsackwithduplicateterms/recursive.cpp
UltraProton/Placement-Prepration
cc70f174c4410c254ce0469737a884fffdc81164
[ "MIT" ]
3
2020-05-08T18:02:51.000Z
2020-05-09T08:37:35.000Z
DP/knapsackwithduplicateterms/recursive.cpp
UltraProton/PlacementPrep
cc70f174c4410c254ce0469737a884fffdc81164
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; int knapsack(vector<int> &values, vector<int> &weights, int W, int curr_idx); int main(int argc, char const *argv[]) { /* code */ int t=0,n=0,w=0; int i=0; vector<int> values; vector<int> weights; cin>>t; while (t>0) { cin>>n; cin>>w; values= vector<int>(n,0); weights= vector<int>(n,0); i=0; while(i<n){ cin>>values[i]; i++; } i=0; while(i<n){ cin>>weights[i]; i++; } cout<<knapsack(values,weights,w,n-1); t--; } return 0; } int knapsack(vector<int> &values, vector<int> &weights, int W, int curr_idx){ if(W<=0 || curr_idx<=0){ return 0; } if(weights[curr_idx]>W){ return knapsack(values,weights,W,curr_idx-1); } if(weights[curr_idx]<=W){ return max(values[curr_idx] + knapsack(values, weights, W- weights[curr_idx], curr_idx), (knapsack(values,weights,W,curr_idx-1))); } }
17.333333
97
0.5
[ "vector" ]
a68d501268aa7538240c0510221d848702132efc
4,468
cpp
C++
krust-tests/krust-test-simple.cpp
ahcox/krust
c4c349b3432d086466a13aef61ab220d8c43bcbb
[ "MIT" ]
4
2016-05-09T08:22:52.000Z
2019-12-07T16:19:50.000Z
krust-tests/krust-test-simple.cpp
ahcox/krust
c4c349b3432d086466a13aef61ab220d8c43bcbb
[ "MIT" ]
null
null
null
krust-tests/krust-test-simple.cpp
ahcox/krust
c4c349b3432d086466a13aef61ab220d8c43bcbb
[ "MIT" ]
null
null
null
#define CATCH_CONFIG_MAIN #include "catch.hpp" /* ----------------------------------------------------------------------------- * Test of the RefObject class. */ #include "krust/public-api/ref-object.h" namespace { namespace kr = Krust; struct TestRefObect : public kr::RefObject { TestRefObect(bool& destroyed) : mDestroyed(destroyed) {} ~TestRefObect() { mDestroyed = true; } bool& mDestroyed; }; template<typename FutureContainer> void wait_all(FutureContainer& futures) { for(const auto& fut : futures){ fut.wait(); } } } TEST_CASE("RefObject", "[simple]") { bool destroyed = false; TestRefObect* obj = new TestRefObect(destroyed); REQUIRE(destroyed == false); constexpr int count = 99; for (int i = 0; i < count; ++i) { obj->Inc(); REQUIRE(obj->Count() == i + 1); } REQUIRE(destroyed == false); for (size_t i = obj->Count(); i > 1; --i) { obj->Dec(); REQUIRE(obj->Count() == i - 1); } REQUIRE(destroyed == false); obj->Dec(); REQUIRE(destroyed == true); } /// Slam a refcounted object from lots of threads at the same time. #include <future> TEST_CASE("RefObjectAsync", "[simple]") { bool destroyed = false; TestRefObect* obj = new TestRefObect(destroyed); REQUIRE(destroyed == false); constexpr int count = 99; constexpr int inner_count = 500000; std::vector<std::future<void>> futures; for (int i = 0; i < count; ++i) { futures.push_back(std::async(std::launch::async, [obj](){ for(unsigned j = 0; j < inner_count; ++j){ obj->Inc(); } })); obj->Inc(); } wait_all(futures); REQUIRE(obj->Count() == count * inner_count + count); REQUIRE(destroyed == false); obj->Inc(); futures.clear(); for (int i = 0; i < count; ++i) { futures.push_back(std::async(std::launch::async, [obj](){ for(unsigned j = 0; j < inner_count; ++j){ obj->Dec(); } })); obj->Dec(); } wait_all(futures); REQUIRE(obj->Count() == 1); REQUIRE(destroyed == false); obj->Dec(); REQUIRE(destroyed == true); } // Interleave incs and decs from multiple threads TEST_CASE("RefObjectAsyncJumbled", "[simple]") { bool destroyed = false; TestRefObect* obj = new TestRefObect(destroyed); REQUIRE(destroyed == false); constexpr int count = 99; constexpr int inner_count = 500000; // Prime the counts so we have a buffer to play with: for (int i = 0; i < count * inner_count; ++i) { obj->Inc(); } // Launch battling incing and decing threads: std::vector<std::future<void>> futures; for (int i = 0; i < count; ++i) { futures.push_back(std::async(std::launch::async, [obj](){ for(unsigned j = 0; j < inner_count; ++j){ obj->Inc(); } })); futures.push_back(std::async(std::launch::async, [obj](){ for(unsigned j = 0; j < inner_count; ++j){ obj->Dec(); } })); } wait_all(futures); REQUIRE(obj->Count() == count * inner_count); REQUIRE(destroyed == false); } /* ----------------------------------------------------------------------------- * Test of the keep-alive set class. */ #include "krust/internal/keep-alive-set.h" TEST_CASE("KeepAliveSet", "[simple]") { namespace kr = Krust; struct TestRefObect : public kr::RefObject { TestRefObect(size_t& count) : count(count) { ++count; } ~TestRefObect() { --count; } size_t& count; }; constexpr unsigned numObjects = 10000; size_t liveObjects = 0; SECTION(" Adding without duplicates ") { { kr::KeepAliveSet keepalives; for (unsigned i = 0; i < numObjects; ++i) { TestRefObect* tro = new TestRefObect(liveObjects); keepalives.Add(*tro); } REQUIRE(keepalives.Size() == numObjects); REQUIRE(liveObjects == numObjects); } REQUIRE(liveObjects == 0); } SECTION(" Adding with duplicates ") { { kr::KeepAliveSet keepalives2; std::vector<kr::IntrusivePointer<TestRefObect>> objects; for (unsigned i = 0; i < numObjects; ++i) { objects.push_back(new TestRefObect(liveObjects)); } for (unsigned dup = 0; dup < 3; ++dup) { for (auto ptr : objects) { keepalives2.Add(*ptr); } } REQUIRE(keepalives2.Size() == numObjects); REQUIRE(liveObjects == numObjects); objects.clear(); REQUIRE(liveObjects == numObjects); } REQUIRE(liveObjects == 0); } }
24.822222
80
0.576992
[ "object", "vector" ]
a6920d62f0f78cd6ec32a322f06cb8daa44c0486
2,035
cpp
C++
src/main.cpp
szynka12/deiimos
9cab00bc869d9d672cbd24271812ae7643317377
[ "MIT" ]
null
null
null
src/main.cpp
szynka12/deiimos
9cab00bc869d9d672cbd24271812ae7643317377
[ "MIT" ]
null
null
null
src/main.cpp
szynka12/deiimos
9cab00bc869d9d672cbd24271812ae7643317377
[ "MIT" ]
null
null
null
#include "ManifoldFactory.h" #include "MeshReader.h" #include "TopologyInfo.h" #include "XmlHandler.h" #include "XmlNode.h" #include "merge.h" #include "mesh.h" #include "msgstream.h" #include "tinyxml2.h" #include <array> #include <chrono> #include <iostream> #include <tuple> #include <type_traits> #include <typeinfo> #include <utility> // template < class T, std::size_t... I > // using testA = std::tuple< std::array< T, I >... >; // // using test = testA< int, std::make_index_sequence< 2 >{} >; // template < size_t... ints > // auto get_t( std::integer_sequence< size_t, ints... > int_seq ) // { // return testA< int, ints... >( ); // } template < class T > std::string type_name( ) { typedef typename std::remove_reference< T >::type TR; std::unique_ptr< char, void ( * )( void* ) > own( #ifndef _MSC_VER abi::__cxa_demangle( typeid( TR ).name( ), nullptr, nullptr, nullptr ), #else nullptr, #endif std::free ); std::string r = own != nullptr ? own.get( ) : typeid( TR ).name( ); if ( std::is_const< TR >::value ) r += " const"; if ( std::is_volatile< TR >::value ) r += " volatile"; if ( std::is_lvalue_reference< T >::value ) r += "&"; else if ( std::is_rvalue_reference< T >::value ) r += "&&"; return r; } int main( ) { deiimos::set_verbosity( 3 ); dealii::Triangulation< 3, 3 > output_tria; deiimos::io::XmlHandler safe_doc( "../data/configs/simple_mesh.xml" ); safe_doc.load( ); deiimos::mesh::MeshReader< 3, 3 > m( output_tria ); m.read_verts( safe_doc ); m.read_cells( safe_doc ); m.read_manifolds( safe_doc ); m.generate_meshes( ); m.generate_topology_data( ); m.combine_meshes( ); m.clear_meshes( ); dealii::print_mesh_info( output_tria, "test_1_1" ); auto t = deiimos::mesh::get_topology_info< 3, 3, 3 >( ); std::cout << type_name< decltype( t ) >( ) << '\n'; // static_assert( std::is_same< decltype( b ), testA< int, 1 > >::value, "" // ); return 0; }
25.4375
79
0.600983
[ "mesh" ]
a692b9f3f9081d48782a8774e96172a7e717ed22
5,308
cpp
C++
Source Code/src/OrchestrationServer.cpp
devcoons/orchestration-api
d5dd2790b2c5d1f1b28aefed7028de55934e8a44
[ "MIT" ]
1
2021-12-15T07:51:36.000Z
2021-12-15T07:51:36.000Z
Source Code/src/OrchestrationServer.cpp
devcoons/orchestration-api
d5dd2790b2c5d1f1b28aefed7028de55934e8a44
[ "MIT" ]
null
null
null
Source Code/src/OrchestrationServer.cpp
devcoons/orchestration-api
d5dd2790b2c5d1f1b28aefed7028de55934e8a44
[ "MIT" ]
null
null
null
#include "OrchestrationServer.h" namespace Orchestration { Server::Server() { active = true; setpriority(PRIO_PROCESS, getpid(), -20); globalPolicy = GlobalPolicyType::Free; policyGoal = 0; } Server::~Server() { } void Server::initialize() { mux.lock(); applications = std::vector<std::unique_ptr<ShmObject<AppContainer>>>(); semaphores = std::vector<sem_t*>(); mux.unlock(); } void Server::beginServer(int port,int portStsService) { long refreshRate = 25000; appService.Start(port,this); stdService.Start(portStsService,this); stsService.start(StatsDevice::Juno); } void Server::execute() { int i; double offsetDecreasing=0; std::chrono::steady_clock::time_point begin; std::chrono::steady_clock::time_point end; auto deltaTime = std::chrono::milliseconds(50); while (true) { i = 0; mux.lock(); if(active == false) break; begin = std::chrono::steady_clock::now(); for (auto app = applications.begin(); app != applications.end();) { if ((*app)->sharedMemoryPtr->state == ApplicationState::DeregisterApplication) { std::cout << "Application :" << (*app)->sharedMemoryPtr->processID << " Deregistration Requested. [Removing shared pointer]" << std::endl; (*app)->Delete(); applications.erase(applications.begin() + i); semaphores.erase(semaphores.begin() + i); } else if ((*app)->sharedMemoryPtr->state == ApplicationState::Stop) { std::cout << "Application :" << (*app)->sharedMemoryPtr->processID << " Stop Requested. [Removing shared pointer]" << std::endl; kill((*app)->sharedMemoryPtr->processID, SIGKILL); (*app)->Delete(); applications.erase(applications.begin() + i); semaphores.erase(semaphores.begin() + i); } else if ((*app)->numberOfProcesses() <2) { std::cout << "Application :" << (*app)->sharedMemoryPtr->processID << " Unexpected Closed. [Removing shared pointer]" << std::endl; (*app)->Delete(); applications.erase(applications.begin() + i); semaphores.erase(semaphores.begin() + i); } else if ((*app)->sharedMemoryPtr->state == ApplicationState::Pause) { ImplementationManager *ptr = (ImplementationManager*)shmat((*app)->sharedMemoryPtr->kernelManagers.sharedMemoryID, 0, 0); if ((*app)->sharedMemoryPtr->getCurrentProfiling() == true) { ptr[(*app)->sharedMemoryPtr->selectedKernelManager].decreaseProfiling(); } else if ((*app)->sharedMemoryPtr->getNextProfiling() == true) { (*app)->sharedMemoryPtr->selectedKernelManager+=1; ptr[(*app)->sharedMemoryPtr->selectedKernelManager].decreaseProfiling(); } else { switch((*app)->sharedMemoryPtr->policy) { case IndividualPolicyType::Balanced: IndividualPolicies::Balanced((*app)->sharedMemoryPtr,ptr); break; case IndividualPolicyType::Performance: IndividualPolicies::Performance((*app)->sharedMemoryPtr,ptr); break; case IndividualPolicyType::Restricted: IndividualPolicies::Restricted((*app)->sharedMemoryPtr,ptr); break; } switch(globalPolicy) { case GlobalPolicyType::Free: GlobalPolicies::Free((*app)->sharedMemoryPtr,ptr,&stsService,policyGoal); break; case GlobalPolicyType::PowerBalancing: GlobalPolicies::PowerBalancing((*app)->sharedMemoryPtr,ptr,&stsService,policyGoal); break; case GlobalPolicyType::CurrentBalancing: GlobalPolicies::CurrentBalancing((*app)->sharedMemoryPtr,ptr,&stsService,policyGoal); break; case GlobalPolicyType::UtilizationBalancing: GlobalPolicies::UtilizationBalancing((*app)->sharedMemoryPtr,ptr,&stsService,policyGoal); break; } if((*app)->sharedMemoryPtr->tracker.getOffsetGoalMs()!=0) { offsetDecreasing = (*app)->sharedMemoryPtr->tracker.getOffsetGoalMs()/((*app)->sharedMemoryPtr->priority+25); if((*app)->sharedMemoryPtr->tracker.getOffsetGoalMs()>0) { offsetDecreasing = offsetDecreasing < 5 ? 5 : offsetDecreasing; offsetDecreasing = (*app)->sharedMemoryPtr->tracker.getOffsetGoalMs() - offsetDecreasing < 0 ? 0 : (*app)->sharedMemoryPtr->tracker.getOffsetGoalMs() - offsetDecreasing; } else { offsetDecreasing = offsetDecreasing > -5 ? -5 : offsetDecreasing; offsetDecreasing = (*app)->sharedMemoryPtr->tracker.getOffsetGoalMs() - offsetDecreasing > 0 ? 0 : (*app)->sharedMemoryPtr->tracker.getOffsetGoalMs() - offsetDecreasing; } (*app)->sharedMemoryPtr->tracker.setOffsetGoalMs(offsetDecreasing); } } shmdt(ptr); (*app)->sharedMemoryPtr->state = ApplicationState::Execute; sem_post(semaphores.at(i)); ++i; ++app; } else { ++i; ++app; } } end = std::chrono::steady_clock::now(); mux.unlock(); deltaTime = std::chrono::duration_cast<std::chrono::milliseconds>(end - begin); deltaTime = std::chrono::milliseconds(50) - deltaTime > std::chrono::milliseconds(10) ? std::chrono::milliseconds(50) - deltaTime : std::chrono::milliseconds(10); std::this_thread::sleep_for(deltaTime); } } }
34.69281
187
0.64318
[ "vector" ]
a69d6448e4dc44d9077eebc3f878348ac873a730
1,255
cpp
C++
Graphs/dfs.cpp
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
16
2021-10-03T11:15:49.000Z
2021-10-31T04:40:24.000Z
Graphs/dfs.cpp
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
232
2021-10-02T14:51:43.000Z
2021-11-14T08:23:27.000Z
Graphs/dfs.cpp
Rohit01-pro/All_Program_helper
86b75ecc4ecb095f11e46e6f80c660e27dd22f27
[ "MIT" ]
166
2021-10-02T13:56:34.000Z
2021-10-31T17:56:34.000Z
#include<bits/stdc++.h> using namespace std; class Solution { public: // Function to return a list containing the DFS traversal of the graph. void dfs_helper(int node,vector <int> adj[],vector <int> &vis,vector <int> &ans){ ans.push_back(node); vis[node]=1; for(auto it : adj[node]) { if(!vis[it]) { dfs_helper(it,adj,vis,ans); } } } vector<int> dfsOfGraph(int v, vector<int> adj[]) { // Code here vector <int> ans; vector <int> vis(v+1,0); for(int i=0;i<v;i++) { if(!vis[i]) dfs_helper(i,adj,vis,ans); } return ans; } }; // { Driver Code Starts. int main(){ int tc; cin >> tc; while(tc--){ int V, E; cin >> V >> E; vector<int> adj[V]; for(int i = 0; i < E; i++) { int u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } // string s1; // cin>>s1; Solution obj; vector<int>ans=obj.dfsOfGraph(V, adj); for(int i=0;i<ans.size();i++){ cout<<ans[i]<<" "; } cout<<endl; } return 0; } // } Driver Code Ends
22.410714
86
0.45259
[ "vector" ]
a6a17207056994aa7b4ebb80fad1576622769332
51,106
cc
C++
client/p4ml_manager.cc
ATP-NSDI/switchML
576795c1197549116be215e54288e1ef2ec0dfd5
[ "MIT" ]
17
2021-02-25T02:30:50.000Z
2022-03-07T14:25:35.000Z
client/p4ml_manager.cc
ATP-NSDI/switchML
576795c1197549116be215e54288e1ef2ec0dfd5
[ "MIT" ]
null
null
null
client/p4ml_manager.cc
ATP-NSDI/switchML
576795c1197549116be215e54288e1ef2ec0dfd5
[ "MIT" ]
2
2021-02-26T02:21:32.000Z
2021-11-13T09:36:37.000Z
#include "p4ml_manager.h" #define CC_ENABLE false #define LOSS_RECOVERY_ENABLE false #define LOSS_RECOVERY_LOG true uint32_t P4mlManager::host; uint8_t P4mlManager::num_worker; uint16_t P4mlManager::appID; uint64_t P4mlManager::p4mlKey; int P4mlManager::max_agtr_size_per_thread = 0; int P4mlManager::_num_thread; std::chrono::time_point<std::chrono::system_clock> P4mlManager::start; ThreadInfo** P4mlManager::threadInfoQueue; DMAcontext** P4mlManager::dmaContextQueue; std::thread** P4mlManager::threadQueue; std::queue<Job*> *P4mlManager::jobQueue; std::queue<PacketObject> *P4mlManager::pendingQueue; uint64_t* P4mlManager::weightQueue; std::queue<uint64_t> P4mlManager::finishQueue; WindowManager* P4mlManager::window_manager; uint16_t* P4mlManager::hash_map; int finish_thread = 0; int loop_times[56] = {0}; int random_array[20][1024000] = {0}; bool isLoss[20][1024001] = {0}; bool isSeen[20][1024001] = {0}; int forwardCounter[20] = {0}; float mean[1000]; float median[1000]; bool P4mlManager::isForceForward = false; int P4mlManager::forwardFrequency; float P4mlManager::forwardRate; std::mutex P4mlManager::_P4MLKey_mutex; std::mutex P4mlManager::_print_mutex; std::mutex P4mlManager::_queuePush_mutex; std::chrono::high_resolution_clock::time_point recv_time; P4mlManager::P4mlManager(uint32_t host, int num_worker, int appID) { srand(time(NULL)); this->host = host; this->p4mlKey = 0; this->appID = (uint16_t) appID; this->num_worker = (uint8_t) num_worker; } void P4mlManager::updateModel(agghdr *p4ml_header, int32_t *data) { uint16_t *p_seq = &p4ml_header->seq_num; uint32_t *tensor_len = &p4ml_header->len_tensor; int32_t *p_model = p4ml_header->vector; uint32_t offset = (*p_seq - 1) * MAX_ENTRIES_PER_PACKET; if (offset < *tensor_len) { if (offset + MAX_ENTRIES_PER_PACKET > *tensor_len) memcpy(data + offset, p_model, sizeof(int32_t) * (*tensor_len % MAX_ENTRIES_PER_PACKET)); else memcpy(data + offset, p_model, sizeof(int32_t) * MAX_ENTRIES_PER_PACKET); } } uint64_t P4mlManager::GetNewKey() { std::lock_guard<std::mutex> lock(_P4MLKey_mutex); return p4mlKey++; } int64_t P4mlManager::GetFinishKey() { if (!finishQueue.empty()) { std::lock_guard<std::mutex> lock(_queuePush_mutex); uint64_t tmp_key = finishQueue.front(); finishQueue.pop(); // printf("return completed task %d to outside\n", tmp_key); return tmp_key; } else { return -1; } } void P4mlManager::SetForceForward(float forward_rate) { isForceForward = true; forwardRate = forward_rate; if (forward_rate == 0.75) { forwardFrequency = 4; printf("\n No 0.75 supported, exit.\n"); exit(1); } else { forwardFrequency = 1 / forward_rate; printf("\nSet force forward, frequency = %d\n\n", forwardFrequency); } } void P4mlManager::SetMaxAgtrSizePerThread(int agtr) { max_agtr_size_per_thread = agtr; printf("\nSet max_agtr_size_per_thread to %d...\n\n", agtr); } void P4mlManager::main_receive_packet_loop(DMAcontext *dma_context, int32_t *data, int my_id) { int msgs_completed; int total_resent = 0; std::queue<int> resent_queue; std::queue<int> trigger_queue; std::queue<int> loss_queue; int total_loss = 0; int total_dup_packet = 0; int total_last_tensor_packet = 0; int this_pos_to_send = max_agtr_size_per_thread; int resend_pos_to_send = dma_context->my_send_queue_length / 2; int total_packet = window_manager[my_id].total_ACK; int rand_index = 0; int window = max_agtr_size_per_thread; /* Loss simulation */ int loss = 0; int resend_loss = 0; int timeout_loss = 0; int send_pointer = max_agtr_size_per_thread; int last_pending_front = 0; int pending_front_stuck_time = 0; bool resend_waiting = false; // int packet_processing_time_count = 0; // int packet_processing_time[35000]; // float total_time = 0.0; memset(&isLoss[my_id], 0, sizeof(bool) * 32001); loop_times[my_id]++; int finish_window_seq = max_agtr_size_per_thread; Rogue rogue(max_agtr_size_per_thread); if(loop_times[my_id] % 1000 == 0) fprintf(stderr, "loop_times[ %d ] %d finished\n", my_id, loop_times[my_id]); // if(loop_times[my_id] %100 == 0) { // for (int i = 0; i < _num_thread; i++) // while (loop_times[i] < loop_times[my_id] - 50) { // usleep(1); // } // } char *send_region = (char *)dma_context->send_region; while (window_manager[my_id].last_ACK < window_manager[my_id].total_ACK) { cqe_snapshot_t cur_snapshot; // printf("window_manager[my_id].last_ACK: %d \n", window_manager[my_id].last_ACK); // struct ibv_wc wc_recv[POLLING_SIZE * 2]; msgs_completed = 0; std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); while(1) { snapshot_cqe(&dma_context->mp_cqe_arr[dma_context->cqe_idx], cur_snapshot); const size_t delta = get_cycle_delta(dma_context->prev_snapshot, cur_snapshot); // msgs_completed = ibv_poll_cq(dma_context->receive_cq, POLLING_SIZE * 2, wc_recv); std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(t2 - t1); if (!(delta == 0 || delta >= kAppNumRingEntries)) { msgs_completed = delta; // printf("[%d] msgs_completed:%d, break\n", my_id, msgs_completed); recv_time = std::chrono::high_resolution_clock::now(); break; } // printf("msgs_completed: %d, %f\n", msgs_completed, time_span.count()); // printf("[%d] loop, msgs_completed:%d, dma_context->total_received:%d, time_span:%f\n", my_id, msgs_completed, dma_context->total_received, time_span); if (LOSS_RECOVERY_ENABLE) { if(time_span.count() > 0.05 && msgs_completed == 0) { uint16_t timeout_seq = window_manager[my_id].last_ACK + 1; if (LOSS_RECOVERY_LOG) printf("[thread %d] Timeout, send %d\n", my_id, timeout_seq); // exit(1); int offset = (timeout_seq - 1) * MAX_ENTRIES_PER_PACKET; uint16_t switch_agtr_pos = threadInfoQueue[my_id]->agtr_start_pos + ((timeout_seq - 1) % max_agtr_size_per_thread); if (timeout_seq <= total_packet) { // if(my_id == 0) // printf("Seq %d trigger %d Resend!\n", p4ml_header->seq_num, timeout_seq); // set Terminated if last packet if (timeout_seq != total_packet) { // for packet which integer < 32 /* Packet Loss simulation */ rand_index++; if (random_array[my_id][rand_index] < timeout_loss) { total_loss++; rand_index++; // printf("[Timeout] %d loss.\n", timeout_seq); isLoss[my_id][timeout_seq] = true; loss_queue.push(timeout_seq); } else { if (offset + MAX_ENTRIES_PER_PACKET > jobQueue[my_id].front()->len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (jobQueue[my_id].front()->len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &timeout_seq, tmp, false, true); } else { make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &timeout_seq, data + offset, false, true); } } } else { // for packet which integer < 32 if (offset + MAX_ENTRIES_PER_PACKET > jobQueue[my_id].front()->len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (jobQueue[my_id].front()->len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &timeout_seq, tmp, true, true); } else { make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &timeout_seq, data + offset, true, true); } } // p4ml_header_print(p4ml_header, "RESEND TRIGGER"); send_packet(dma_context, P4ML_LAYER_SIZE, resend_pos_to_send); resend_pos_to_send++; total_resent++; if (resend_pos_to_send == dma_context->my_send_queue_length - 1) resend_pos_to_send = dma_context->my_send_queue_length / 2 + 1; resent_queue.push(timeout_seq); trigger_queue.push(timeout_seq); } t1 = std::chrono::high_resolution_clock::now(); } } if(time_span.count() > 20.0 && msgs_completed == 0 && dma_context->total_received > 0) { fprintf(stderr, "Timeout happened this thread thread_id=%d, total_received=%d, total_sent=%d, total_loss=%d, total_resent=%d, last_ACK=%d, total_dup_recv=%d, total_last_tensor_packet_recv=%d, loop_time=%d\n", \ my_id, dma_context->total_received, dma_context->total_sent, total_loss, total_resent, window_manager[my_id].last_ACK, total_dup_packet, total_last_tensor_packet, loop_times[my_id]); fprintf(stderr, "%d is simulate loss packet [%d]\n", window_manager[my_id].last_ACK + 1, isLoss[my_id][window_manager[my_id].last_ACK+1]); printf("\nLoss\n"); for (int i = 0 ; i < 32001; i++) if (isLoss[my_id][i]) printf("%d ", i); printf("\nResend\n"); while (!resent_queue.empty()) { printf("%d[%d] ", resent_queue.front(), trigger_queue.front()); resent_queue.pop(); trigger_queue.pop(); } printf("\nPendingQueue\n"); while (!pendingQueue[my_id].empty()) { printf("%d ", pendingQueue[my_id].front().p4ml_header->seq_num); pendingQueue[my_id].pop(); } printf("\nlast_ACK: %d \n", window_manager[my_id].last_ACK); for(int i=0; i< _num_thread; i++) fprintf(stderr, "Timeout happened thread_id=%d, total_received=%d, total_sent=%d, loop_time=%d\n", i, dmaContextQueue[i]->total_received, dmaContextQueue[i]->total_sent, loop_times[i]); exit(-1); } } /* circle alignment */ if (this_pos_to_send + max_agtr_size_per_thread + max_agtr_size_per_thread > dma_context->my_send_queue_length / 2) this_pos_to_send = 0; int to_be_sent = 0; dma_context->total_received += msgs_completed; // printf("msgs_completed: %d, dma_context->total_received: %d\n", msgs_completed, dma_context->total_received); for (int msg = 0; msg < msgs_completed; msg++) { // std::chrono::high_resolution_clock::time_point packet_start = std::chrono::high_resolution_clock::now(); uint8_t* buf = &dma_context->mp_recv_ring[dma_context->ring_head * kAppRingMbufSize]; agghdr *p4ml_header = reinterpret_cast<agghdr*>(buf + IP_ETH_UDP_HEADER_SIZE); // p4ml_header_print_h(p4ml_header, "RECEIVE"); p4ml_header_ntoh_without_data(p4ml_header); bool is_resend_packet = p4ml_header->flag & 0x04; bool is_ecn_mark_packet = p4ml_header->flag & 0x08; // If that is resend packet from last tensor, ignore it if (p4ml_header->key != jobQueue[my_id].front()->key) { total_last_tensor_packet++; dma_context->total_received--; dma_context->ring_head = (dma_context->ring_head + 1) % kAppNumRingEntries; dma_context->nb_rx_rolling++; if (dma_context->nb_rx_rolling == kAppStridesPerWQE) { dma_context->nb_rx_rolling = 0; int ret = dma_context->mp_wq_family->recv_burst(dma_context->mp_wq, &dma_context->mp_sge[dma_context->sge_idx], 1); rt_assert(ret == 0); dma_context->sge_idx = (dma_context->sge_idx + 1) % kAppRQDepth; } continue; } // If that is duplicate resend packet, ignore it if (window_manager[my_id].isACKed[p4ml_header->seq_num] && is_resend_packet) { total_dup_packet++; dma_context->total_received--; dma_context->ring_head = (dma_context->ring_head + 1) % kAppNumRingEntries; dma_context->nb_rx_rolling++; if (dma_context->nb_rx_rolling == kAppStridesPerWQE) { dma_context->nb_rx_rolling = 0; int ret = dma_context->mp_wq_family->recv_burst(dma_context->mp_wq, &dma_context->mp_sge[dma_context->sge_idx], 1); rt_assert(ret == 0); dma_context->sge_idx = (dma_context->sge_idx + 1) % kAppRQDepth; } continue; } // printf("packet %d receive\n", p4ml_header->seq_num); /* Receive Normal Packet */ if (!window_manager[my_id].isACKed[p4ml_header->seq_num]) { dma_context->receive_time[p4ml_header->seq_num] = recv_time; /* Update Model */ for (int i = 0; i < MAX_ENTRIES_PER_PACKET; i++) p4ml_header->vector[i] = ntohl(p4ml_header->vector[i]); updateModel(p4ml_header, data); /* Update Window */ if (window_manager[my_id].UpdateWindow(&p4ml_header->seq_num)) { resend_waiting = false; } /* If not Ready for next Seq sending, Enqueue */ bool isEnqueue = false; uint16_t next_seq_num = p4ml_header->seq_num + window; int next_offset = (next_seq_num - 1) * MAX_ENTRIES_PER_PACKET; // printf("next_seq_num: %d\n", next_seq_num); if (next_seq_num > window_manager[my_id].last_ACK + window) { // printf("%d: next seq_num: %d enqueue! [%d ~ %d] \n", p4ml_header->seq_num, next_seq_num, window_manager[my_id].last_ACK, window_manager[my_id].last_ACK + window); agghdr* enqueue_header = (agghdr*) malloc(sizeof(agghdr)); memcpy(enqueue_header, p4ml_header, sizeof(agghdr)); PacketObject pending_obj = { .p4ml_header = enqueue_header, // .wc_recv_id = wc_recv_id }; isEnqueue = true; pendingQueue[my_id].push(pending_obj); // } } /* Send Next Packet */ if (next_seq_num <= total_packet && next_seq_num <= window_manager[my_id].last_ACK + window && next_seq_num > send_pointer) { // printf("next_seq_num: %d, send_pointer: %d\n", next_seq_num, send_pointer); bool ForceForward = false; if (isForceForward) { if (forwardCounter[my_id] == forwardFrequency) { ForceForward = true; forwardCounter[my_id] = 0; } else { forwardCounter[my_id]++; } } int packet_to_process = abs(next_seq_num - send_pointer); // printf("packet to process: %d\n", packet_to_process); // send more packet if window change for (int i = packet_to_process - 1; i >= 0; i--) { uint16_t process_next_seq_num = next_seq_num - i; // printf("[%d] next_seq_num: %d, send_pointer: %d\n", p4ml_header->seq_num, process_next_seq_num, send_pointer); uint16_t switch_agtr_pos = threadInfoQueue[my_id]->agtr_start_pos + ((process_next_seq_num - 1) % max_agtr_size_per_thread); // set Terminated if last packet /* We don't loss Terminate packet here */ if (process_next_seq_num != total_packet) { /* Packet Loss simulation */ rand_index++; if (random_array[my_id][rand_index] < loss) { // if (process_next_seq_num == 477 || process_next_seq_num == 478) { total_loss++; rand_index++; // printf("%d loss.\n", process_next_seq_num); isLoss[my_id][process_next_seq_num] = true; to_be_sent--; loss_queue.push(process_next_seq_num); } else { // for packet which integer < 32 if (next_offset + MAX_ENTRIES_PER_PACKET > p4ml_header->len_tensor) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + next_offset, sizeof(int32_t) * (p4ml_header->len_tensor % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &p4ml_header->key, &p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, tmp, false, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &p4ml_header->key, &p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, data + next_offset, false, ForceForward); } } } else { // for packet which integer < 32 if (next_offset + MAX_ENTRIES_PER_PACKET > p4ml_header->len_tensor) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + next_offset, sizeof(int32_t) * (p4ml_header->len_tensor % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &p4ml_header->key, &p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, tmp, true, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &p4ml_header->key, &p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, data + next_offset, true, ForceForward); } } to_be_sent++; } send_pointer = next_seq_num; // printf("send_pointer: %d\n", send_pointer); } int i = 0; /* Check If packet in Pending Queue is Ready to send */ while (!pendingQueue[my_id].empty()) { // printf("p4ml_header->seq_num: %d\n", p4ml_header->seq_num); PacketObject pendingObj = pendingQueue[my_id].front(); i++; agghdr* pending_p4ml_header = pendingObj.p4ml_header; if (window_manager[my_id].last_ACK < pending_p4ml_header->seq_num) { // printf("%d Get %d from pending queue and window_manager[my_id].last_ACK = %d, quit\n", p4ml_header->seq_num, pending_p4ml_header->seq_num, window_manager[my_id].last_ACK); break; } uint16_t next_seq_num = pending_p4ml_header->seq_num + window; int next_offset = (next_seq_num - 1) * MAX_ENTRIES_PER_PACKET; // printf("[pending] org: %d, next_number: %d\n", pending_p4ml_header->seq_num, next_seq_num); if (next_seq_num <= window_manager[my_id].last_ACK + window && next_seq_num > send_pointer) { bool ForceForward = false; if (isForceForward) { if (forwardCounter[my_id] == forwardFrequency) { ForceForward = true; forwardCounter[my_id] = 0; } else { forwardCounter[my_id]++; } } /* Copy to Send Region */ if (next_seq_num <= total_packet) { int packet_to_process = abs(next_seq_num - send_pointer); // printf("[pending] packet to process: %d\n", packet_to_process); for (int i = packet_to_process - 1; i >= 0; i--) { uint16_t process_next_seq_num = next_seq_num - i; // printf("[Pending] seq_num trigger %d send next seq_num: %d\n", p4ml_header->seq_num, next_seq_num); uint16_t switch_agtr_pos = threadInfoQueue[my_id]->agtr_start_pos + ((process_next_seq_num - 1) % max_agtr_size_per_thread); // set Terminated if last packet if (process_next_seq_num != total_packet) { /* Packet Loss simulation */ rand_index++; if (random_array[my_id][rand_index] < loss) { total_loss++; rand_index++; // printf("[Pending] %d loss.\n", process_next_seq_num); isLoss[my_id][process_next_seq_num] = true; to_be_sent--; loss_queue.push(process_next_seq_num); } else { // for packet which integer < 32 if (next_offset + MAX_ENTRIES_PER_PACKET > pending_p4ml_header->len_tensor) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + next_offset, sizeof(int32_t) * (pending_p4ml_header->len_tensor % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &pending_p4ml_header->key, &pending_p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, tmp, false, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &pending_p4ml_header->key, &pending_p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, data + next_offset, false, ForceForward); } } } else { // for packet which integer < 32 if (next_offset + MAX_ENTRIES_PER_PACKET > pending_p4ml_header->len_tensor) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + next_offset, sizeof(int32_t) * (pending_p4ml_header->len_tensor % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &pending_p4ml_header->key, &pending_p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, tmp, true, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + (this_pos_to_send + to_be_sent) * P4ML_LAYER_SIZE, &pending_p4ml_header->key, &pending_p4ml_header->len_tensor, &host, &num_worker, &appID, &switch_agtr_pos, &process_next_seq_num, data + next_offset, true, ForceForward); } } to_be_sent++; } send_pointer = next_seq_num; // printf("[pending] send_pointer: %d\n", send_pointer); } // printf("%d: next seq_num: %d dequeue! [%d ~ %d] \n", pending_p4ml_header->seq_num, next_seq_num, window_manager[my_id].last_ACK, window_manager[my_id].last_ACK + window); free(pending_p4ml_header); pendingQueue[my_id].pop(); } else { // printf("%d: next seq_num: %d dequeue! [%d ~ %d] \n", pending_p4ml_header->seq_num, next_seq_num, window_manager[my_id].last_ACK, window_manager[my_id].last_ACK + window); free(pending_p4ml_header); pendingQueue[my_id].pop(); } } /* If force forward is configurated, expect will not packet loss */ if (!isForceForward && LOSS_RECOVERY_ENABLE) { if (!resend_waiting) { // printf("resend_processed\n"); uint16_t resend_seq = 0; if (!pendingQueue[my_id].empty()) { PacketObject pendingObj = pendingQueue[my_id].front(); agghdr* pending_p4ml_header = pendingObj.p4ml_header; // printf("%d, %d\n", pending_p4ml_header->seq_num, window_manager[my_id].last_ACK + 1); if (window_manager[my_id].last_ACK < pending_p4ml_header->seq_num) { resend_seq = window_manager[my_id].last_ACK + 1; } } bool isResendLoss = false; if (resend_seq) { resend_waiting = true; int offset = (resend_seq - 1) * MAX_ENTRIES_PER_PACKET; uint16_t switch_agtr_pos = hash_map[threadInfoQueue[my_id]->agtr_start_pos + ((resend_seq - 1) % max_agtr_size_per_thread)]; if (resend_seq <= total_packet) { if (LOSS_RECOVERY_LOG) printf("[Thread %d] Seq %d trigger %d Resend!\n", my_id, p4ml_header->seq_num, resend_seq); // exit(1); // set Terminated if last packet if (resend_seq != total_packet) { // for packet which integer < 32 /* Packet Loss simulation */ rand_index++; if (random_array[my_id][rand_index] < resend_loss) { total_loss++; rand_index++; // printf("[Resend] %d loss.\n", resend_seq); isLoss[my_id][resend_seq] = true; loss_queue.push(resend_seq); isResendLoss = true; } else { if (offset + MAX_ENTRIES_PER_PACKET > jobQueue[my_id].front()->len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (jobQueue[my_id].front()->len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &resend_seq, tmp, false, true); } else { make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &resend_seq, data + offset, false, true); } } } else { // for packet which integer < 32 if (offset + MAX_ENTRIES_PER_PACKET > jobQueue[my_id].front()->len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (jobQueue[my_id].front()->len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &resend_seq, tmp, true, true); } else { make_p4ml_layer_and_copy_to(send_region + (resend_pos_to_send * P4ML_LAYER_SIZE), &jobQueue[my_id].front()->key, &jobQueue[my_id].front()->len, &host, &num_worker, &appID, &switch_agtr_pos, &resend_seq, data + offset, true, true); } } // p4ml_header_print(p4ml_header, "RESEND TRIGGER"); if (!isResendLoss) { // int stop; // scanf("%d", &stop); send_packet(dma_context, P4ML_LAYER_SIZE, resend_pos_to_send); resend_pos_to_send++; total_resent++; if (resend_pos_to_send == dma_context->my_send_queue_length - 1) resend_pos_to_send = dma_context->my_send_queue_length / 2 + 1; } resent_queue.push(resend_seq); trigger_queue.push(p4ml_header->seq_num); // if (!isLoss[my_id][resend_seq]) { // printf("%d Not suppose to be lost\n", resend_seq); // printf("\nLoss\n"); // for (int i = 0 ; i < 32000; i++) // if (isLoss[my_id][i]) // printf("%d ", i); // printf("\nResend\n"); // while (!resent_queue.empty()) { // printf("%d[%d] ", resent_queue.front(), trigger_queue.front()); // resent_queue.pop(); // trigger_queue.pop(); // } // printf("\nPendingQueue\n"); // while (!pendingQueue[my_id].empty()) { // printf("%d ", pendingQueue[my_id].front().p4ml_header->seq_num); // pendingQueue[my_id].pop(); // } // printf("\n"); // printf("last_ACK: %d\n", window_manager[my_id].last_ACK); // exit(1); // } } } } } if (CC_ENABLE) { if (p4ml_header->seq_num == finish_window_seq) { // if (is_ecn_mark_packet) // printf("ECN mark found, adjust window.\n"); // rogue.packets_acked(time_in_us); // int new_window = rogue.cc_avoid(); int new_window = rogue.adjustWindow(is_ecn_mark_packet); // if (my_id == 0 && new_window != 100) // printf("new_window: %d\n", new_window); if (send_pointer + new_window > window_manager[my_id].total_ACK) window = window_manager[my_id].total_ACK - send_pointer; else window = new_window; //TODO: ADJUST WINDOW finish_window_seq += window; } } } dma_context->ring_head = (dma_context->ring_head + 1) % kAppNumRingEntries; dma_context->nb_rx_rolling++; if (dma_context->nb_rx_rolling == kAppStridesPerWQE) { dma_context->nb_rx_rolling = 0; int ret = dma_context->mp_wq_family->recv_burst(dma_context->mp_wq, &dma_context->mp_sge[dma_context->sge_idx], 1); rt_assert(ret == 0); dma_context->sge_idx = (dma_context->sge_idx + 1) % kAppRQDepth; } // std::chrono::high_resolution_clock::time_point packet_end = std::chrono::high_resolution_clock::now(); // std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(packet_end - packet_start); // double time = time_span.count(); // packet_processing_time[packet_processing_time_count] = time; // packet_processing_time_count++; // total_time += time; // if (packet_processing_time_count == 32000) { // std::sort(packet_processing_time, packet_processing_time+32000); // float mean = total_time/32000.0; // float median = packet_processing_time[16000]; // printf("mean:%.10f, madian: %.10f.\n", mean, median); // } } dma_context->prev_snapshot = cur_snapshot; dma_context->cqe_idx = (dma_context->cqe_idx + 1) % kAppRecvCQDepth; if (msgs_completed < 0) { printf("Polling error\n"); exit(1); } if (msgs_completed > 0 && to_be_sent) { send_packet(dma_context, P4ML_LAYER_SIZE * to_be_sent, this_pos_to_send); this_pos_to_send += to_be_sent; } } // if (my_id == 0) { // printf("packet_processing_time_count: %d\n", packet_processing_time_count); // for (int i = 0; i < packet_processing_time_count; i++) // printf("%d\n", packet_processing_time[i]); // // if (packet_processing_time_count == 32000) { // // std::sort(packet_processing_time, packet_processing_time+32000); // // float mean = total_time/32000.0; // // float median = packet_processing_time[16000]; // // printf("mean:%.10f, madian: %.10f.\n", mean, median); // // } // } dma_context->total_sent = 0; dma_context->total_received = 0; if (!pendingQueue[my_id].empty()){ printf("PENDING QUEUE NOT EMPTY AFTER DONE.\n"); while (!pendingQueue[my_id].empty()) { printf("%d ", pendingQueue[my_id].front().p4ml_header->seq_num); pendingQueue[my_id].pop(); } printf("pendingQueue[my_id].size: %zu\n", pendingQueue[my_id].size()); exit(1); } // printf("\nLoss\n"); // for (int i = 0 ; i < 32000; i++) // if (isLoss[my_id][i]) // printf("%d ", i); // printf("\nResend\n"); // while (!resent_queue.empty()) { // printf("%d[%d] ", resent_queue.front(), trigger_queue.front()); // resent_queue.pop(); // trigger_queue.pop(); // } // printf("\nPendingQueue\n"); // while (!pendingQueue[my_id].empty()) { // printf("%d ", pendingQueue[my_id].front().p4ml_header->seq_num); // pendingQueue[my_id].pop(); // } // printf("\n"); // if (my_id == 0) // fprintf(stderr, "[Finish log] thread_id=%d, total_received=%d, total_sent=%d, total_loss=%d, total_resent=%d, last_ACK=%d, total_dup_recv=%d, total_last_tensor_packet_recv=%d\n", \ my_id, dma_context->total_received, dma_context->total_sent, total_loss, total_resent, window_manager[my_id].last_ACK, total_dup_packet, total_last_tensor_packet); } void P4mlManager::PushPull(uint64_t key, char *data, int len, int cmd) { Job* job = new Job { .key = key, .data = (int32_t*) data, .len = (uint32_t) len, .cmd = cmd }; /* Load Balance */ uint64_t smallestWeight = weightQueue[0]; int queueToGo = 0; for (int i = 1; i < _num_thread; i++) { if (weightQueue[i] < smallestWeight) { smallestWeight = weightQueue[i]; queueToGo = i; } } /* If someone overflow, all minus the smallest one */ if (weightQueue[queueToGo] > UINT64_MAX - len) for (int i = 0; i < _num_thread; i++) weightQueue[i] = weightQueue[i] - weightQueue[queueToGo]; weightQueue[queueToGo] += len; // printf("% "PRIu64" \n", weightQueue[queueToGo]); // printf("Job %d Get, Send to Queue %d.\n", key, queueToGo); jobQueue[queueToGo].push(job); } void P4mlManager::init_threadPool(int num_thread) { _num_thread = num_thread; // max_agtr_size_per_thread = MAX_AGTR_COUNT / num_thread; /* Let fix each thread use 800 agtr */ if (!max_agtr_size_per_thread) max_agtr_size_per_thread = 100; printf("max_agtr_size_per_thread: %d\n", max_agtr_size_per_thread); threadInfoQueue = new ThreadInfo*[num_thread]; dmaContextQueue = new DMAcontext*[num_thread]; weightQueue = new uint64_t[num_thread](); threadQueue = new std::thread*[num_thread]; jobQueue = new std::queue<Job*>[num_thread]; pendingQueue = new std::queue<PacketObject>[num_thread]; window_manager = new WindowManager[num_thread]; hash_map = new uint16_t[num_thread * max_agtr_size_per_thread]; printf("Genereating random numbers...\n"); for (int i = 0; i < num_thread; i++) for (int j = 0; j < 1024000; j++) random_array[i][j] = rand() % 10000; // Start from zero for (int i = 0; i < num_thread * max_agtr_size_per_thread; i++) hash_map[i] = hash_by(i, appID); struct ibv_device **dev_list; struct ibv_device *ib_dev; dev_list = ibv_get_device_list(NULL); if (!dev_list) { perror("Failed to get devices list"); exit(1); } ib_dev = dev_list[1]; if (!ib_dev) { fprintf(stderr, "IB device not found\n"); exit(1); } for (int i = 0; i < num_thread; i++) { threadInfoQueue[i] = new ThreadInfo { .thread_id = i, .agtr_start_pos = max_agtr_size_per_thread * i, }; dmaContextQueue[i] = DMA_create(ib_dev, max_agtr_size_per_thread, i); threadQueue[i] = new std::thread(Start, i); window_manager[i].isACKed = new bool[MAX_TENSOR_SIZE / MAX_ENTRIES_PER_PACKET + 1]; dmaContextQueue[i]->isMarkTimeStamp = false; dmaContextQueue[i]->isSent = new bool[MAX_TENSOR_SIZE / MAX_ENTRIES_PER_PACKET + 1]; dmaContextQueue[i]->send_time = new std::chrono::high_resolution_clock::time_point[MAX_TENSOR_SIZE / MAX_ENTRIES_PER_PACKET + 1]; dmaContextQueue[i]->receive_time = new std::chrono::high_resolution_clock::time_point[MAX_TENSOR_SIZE / MAX_ENTRIES_PER_PACKET + 1]; } printf("using: %s\n", ibv_get_device_name(ib_dev)); } void P4mlManager::Start(int thread_id) { bindingCPU(thread_id + 16); ThreadInfo *thread_info = threadInfoQueue[thread_id]; DMAcontext *dma_context = dmaContextQueue[thread_id]; int agtr_size = max_agtr_size_per_thread; int my_id = thread_id; int agtr_start_pos = thread_info->agtr_start_pos; char *send_region = (char *)dma_context->send_region; while (1) { if (!jobQueue[thread_id].empty()) { Job* job = jobQueue[thread_id].front(); uint64_t key = job->key; int32_t* data = job->data; uint32_t tensor_len = job->len; // fprintf(stderr, "%lld: thread_id=%d, tensor_len=%d, agg_size=%d\n", key, thread_id, tensor_len, agtr_size); int total_packet = ceil((float)tensor_len / MAX_ENTRIES_PER_PACKET); window_manager[thread_id].Reset(total_packet); memset(dma_context->isSent, 0, sizeof(bool) * window_manager[my_id].total_ACK + 1); for (int i = 0; i < tensor_len; i++) data[i] = htonl(data[i]); // SEQ number start from 1 uint16_t seq_num = 0; int num_first_time_sending; if (max_agtr_size_per_thread * MAX_ENTRIES_PER_PACKET > tensor_len) num_first_time_sending = ceil((float)tensor_len / MAX_ENTRIES_PER_PACKET); else num_first_time_sending = max_agtr_size_per_thread; // the first round sending for (int i = 0; i < num_first_time_sending; i++) { // usleep(rand() % 10 + 1); seq_num++; int offset = (seq_num - 1) * MAX_ENTRIES_PER_PACKET; uint16_t switch_agtr_pos = hash_map[agtr_start_pos + i]; // This thread have first time sending if (seq_num <= total_packet) { bool ForceForward = false; if (isForceForward) { if (forwardRate == 0.75) { if (!(seq_num % forwardFrequency == 0)) { ForceForward = true; } } else { if (seq_num % forwardFrequency == 0) { ForceForward = true; } } } // set Terminated if last packet if (seq_num != total_packet) { // for packet which integer < 32 if (offset + MAX_ENTRIES_PER_PACKET > tensor_len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (tensor_len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + P4ML_LAYER_SIZE * i, &key, &tensor_len, &host, &num_worker, &appID, &switch_agtr_pos, &seq_num, tmp, false, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + P4ML_LAYER_SIZE * i, &key, &tensor_len, &host, &num_worker, &appID, &switch_agtr_pos, &seq_num, data + offset, false, ForceForward); } } else { // for packet which integer < 32 if (offset + MAX_ENTRIES_PER_PACKET > tensor_len) { int32_t *tmp = new int32_t[MAX_ENTRIES_PER_PACKET](); memcpy(tmp, data + offset, sizeof(int32_t) * (tensor_len % MAX_ENTRIES_PER_PACKET)); make_p4ml_layer_and_copy_to(send_region + P4ML_LAYER_SIZE * i, &key, &tensor_len, &host, &num_worker, &appID, &switch_agtr_pos, &seq_num, tmp, true, ForceForward); } else { make_p4ml_layer_and_copy_to(send_region + P4ML_LAYER_SIZE * i, &key, &tensor_len, &host, &num_worker, &appID, &switch_agtr_pos, &seq_num, data + offset, true, ForceForward); } } } else { } } for(int j = 0;j < num_first_time_sending; j++){ send_packet(dma_context, P4ML_LAYER_SIZE, j); } // send_packet(dma_context, P4ML_LAYER_SIZE * num_first_time_sending, 0); main_receive_packet_loop(dma_context, data, my_id); // for (int i = 0; i < tensor_len / 32; i++) { // printf("%d: ", i); // for (int j = 0; j < 32; j++) { // printf("%d ", data[i*32 + j]); // } // printf("\n"); // } /* For Per Packet */ // if (thread_id == 0) { // // printf("######################## %d ##########################\n", loop_times[my_id]); // // // printf("Last 32 int: \n"); // // // // for (int i = tensor_len - 32; i < tensor_len; i++) // for (int i = 0; i < tensor_len; i++) // printf("%d ", data[i]); // // // printf("\n"); // double total_time = 0.0; // double time[32001] = {0.0}; // double min_value = 100000.0; // if (thread_id == 0) { // for (int i = 1; i <= total_packet; i++) { // std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(dma_context->receive_time[i] - dma_context->send_time[i]); // time[i] = time_span.count(); // printf("%d: %lf\n", i, time[i]); // total_time += time[i]; // if (time[i] < min_value) // min_value = time[i]; // // if (isLoss[my_id][i]) // // printf(" [Loss Packet]\n"); // // else // // printf("\n"); // // // printf("totaltime: %lf\n", total_time); // } // std::sort(time+1, time+32001); // // // printf("\n###################################################\n"); // // // for (int i = 1; i <= total_packet; i++) { // // // printf("%lf ", time[i]); // // // } // // // printf("\n"); // mean[loop_times[my_id]] = total_time/32000.0; // median[loop_times[my_id]] = time[16000]; // printf("mean: %lf, median: %lf, min_value: %lf\n", total_time/32000.0, time[16000], min_value); // } // if (loop_times[my_id] == 1000) // printf("median: %lf\n", median[500]); // } /* For Throughput */ // if (thread_id == 0) { // printf("######################## %d ##########################\n", loop_times[my_id]); // // // printf("Last 32 int: \n"); // // // // for (int i = tensor_len - 32; i < tensor_len; i++) // // // for (int i = 0; i < tensor_len; i++) // // // printf("%d ", data[i]); // // // printf("\n"); // double total_time = 0.0; // double time[32001] = {0.0}; // for (int i = 1; i <= total_packet; i++) { // std::chrono::duration<double> time_span = std::chrono::duration_cast<std::chrono::duration<double>>(window_manager[my_id].receive_time[i] - start_time); // time[i] = time_span.count(); // printf("%d: %lf, Throughput: %lf", i, time[i], ((float)P4ML_PACKET_SIZE * i / 1024 / 1024 / 1024 * 8) / time[i]); // total_time += time[i]; // if (isLoss[my_id][i]) // printf(" [Loss Packet]\n"); // else // printf("\n"); // // printf("totaltime: %lf\n", total_time); // } // std::sort(time+1, time+32001); // printf("\n###################################################\n"); // // for (int i = 1; i <= total_packet; i++) { // // printf("%lf ", time[i]); // // } // printf("\n"); // printf("mean: %lf, median: %lf\n", total_time/32000.0, time[16000]); // } jobQueue[thread_id].pop(); { std::lock_guard<std::mutex> lock(_queuePush_mutex); // printf("%d to Finish Queue\n", key); finishQueue.push(key); } } usleep(1); } }
52.686598
308
0.511838
[ "vector", "model" ]
a6a3685f50a0706bb131d4437d630a555392b7a4
580
cpp
C++
Problemset/unique-number-of-occurrences/unique-number-of-occurrences.cpp
Singularity0909/LeetCode
d46fb1c8ed9b16339d46d5c37f69d44e5c178954
[ "MIT" ]
1
2020-10-06T01:06:45.000Z
2020-10-06T01:06:45.000Z
Problemset/unique-number-of-occurrences/unique-number-of-occurrences.cpp
Singularity0909/LeetCode
d46fb1c8ed9b16339d46d5c37f69d44e5c178954
[ "MIT" ]
null
null
null
Problemset/unique-number-of-occurrences/unique-number-of-occurrences.cpp
Singularity0909/LeetCode
d46fb1c8ed9b16339d46d5c37f69d44e5c178954
[ "MIT" ]
1
2021-11-17T13:52:51.000Z
2021-11-17T13:52:51.000Z
// @Title: 独一无二的出现次数 (Unique Number of Occurrences) // @Author: Singularity0909 // @Date: 2020-10-28 00:04:14 // @Runtime: 4 ms // @Memory: 8.5 MB class Solution { public: bool uniqueOccurrences(vector<int>& arr) { unordered_map<int, int> mp; for (int x : arr) { ++mp[x]; } unordered_set<int> st; for (auto& each : mp) { if (st.find(each.second) == st.end()) { st.insert(each.second); } else { return false; } } return true; } };
21.481481
51
0.484483
[ "vector" ]
a6a71267838b8dbff8e199947b626571e6264d7b
5,927
cpp
C++
src/MaterialManager.cpp
gchunev/Dice4D
f96db406204fdca0155d26db856b66a2afd4e664
[ "MIT" ]
1
2019-05-22T08:53:46.000Z
2019-05-22T08:53:46.000Z
src/MaterialManager.cpp
gchunev/Dice4D
f96db406204fdca0155d26db856b66a2afd4e664
[ "MIT" ]
null
null
null
src/MaterialManager.cpp
gchunev/Dice4D
f96db406204fdca0155d26db856b66a2afd4e664
[ "MIT" ]
null
null
null
#include "MaterialManager.h" #include "GraphicsUtils.h" #include <rapidxml/rapidxml.hpp> #include <iostream> #include <fstream> #include <vector> using namespace rapidxml; MaterialManager* MaterialManager::m_pInstance = NULL; MaterialManager* MaterialManager::GetInstance() { if (!m_pInstance) m_pInstance = new MaterialManager; return m_pInstance; } MaterialManager::MaterialManager() { InitShaderDefs(); }; MaterialManager::~MaterialManager() { DeleteShaders(); }; void MaterialManager::InitShaderDefs() { m_materialMap[std::string("")] = std::string("shader_basic.xml"); //Default Material m_materialMap[std::string("Simple-material")] = std::string("shader_basic.xml"); m_materialMap[std::string("Texts-material")] = std::string("shader_texts.xml"); m_materialMap[std::string("Volumetric-material")] = std::string("shader_volume_renderer.xml"); } void MaterialManager::DeleteShaders() { std::map<std::string, int>::iterator sit; for (sit = m_shaderMap.begin(); sit != m_shaderMap.end(); sit++) { ctx.glDeleteProgram(sit->second); } m_shaderMap.clear(); } void MaterialManager::ReloadShaders() { DeleteShaders(); LoadShaders(m_shaderPath); } ///////////////////////////////////////////////////// // Class Interface: ///////////////////////////////////////////////////// bool MaterialManager::LoadShaders(const std::string& path) { m_shaderPath = path; std::map<std::string, std::string>::iterator it; std::map<std::string, int>::iterator sit; if (m_shaderMap.size() > 0) { printf("Shaders have already been loaded with this manager\n"); return false; } for (it = m_materialMap.begin(); it != m_materialMap.end(); it++) { sit = m_shaderMap.find(it->second); if (sit == m_shaderMap.end()) { std::string shaderPath = path + it->second; int programObject = CreateShader(shaderPath); if (programObject != -1) { m_shaderMap[it->second] = programObject; } else { DeleteShaders(); return false; } } } return true; } int MaterialManager::GetShaderByName(std::string& shaderName) { int shader; std::map<std::string, int>::iterator sit; sit = m_shaderMap.find(shaderName); if (sit != m_shaderMap.end()) { shader = sit->second; } else { //printf("No compiled shader matches: %s\n Falling back to default shader\n", shaderName.c_str()); shader = m_shaderMap[""]; } return shader; } int MaterialManager::GetShaderByMaterialName(const std::string& materialName) { int shader; std::map<std::string, std::string>::iterator it; it = m_materialMap.find(materialName); if (it != m_materialMap.end()) { shader = GetShaderByName(it->second); } else { printf("No predefined material matches: %s\n Falling back to default material\n", materialName.c_str()); shader = GetShaderByName(m_materialMap[std::string("")]); } return shader; } ///////////////////////////////////////////////////// // Helper Routines: ///////////////////////////////////////////////////// /// // Initialize the shader and program object // int MaterialManager::CreateShader(std::string& shaderPath) { xml_document<> shaderDoc; xml_node<> * root_node; std::ifstream theFile; theFile.open(shaderPath.c_str()); bool isOpen = theFile.is_open(); if (isOpen) { printf("Reading Shader: %s\n", shaderPath.c_str()); } else { printf("Failed to Read Shader: %s\n", shaderPath.c_str()); } std::vector<char> buffer((std::istreambuf_iterator<char>(theFile)), std::istreambuf_iterator<char>()); buffer.push_back('\0'); theFile.close(); shaderDoc.parse<0>(&buffer[0]); root_node = shaderDoc.first_node("shader"); xml_node<> * vshader_node = root_node->first_node("vshader"); const char* vShaderStr = vshader_node->first_node(NULL)->value(); std::string vShaderSource(vShaderStr); xml_node<> * fshader_node = root_node->first_node("fshader"); const char* fShaderStr = fshader_node->first_node(NULL)->value(); std::string fShaderSource(fShaderStr); GLuint vertexShader; GLuint fragmentShader; GLuint programObject; GLint linked; // Load the vertex/fragment shaders vertexShader = LoadShader(GL_VERTEX_SHADER, (const char *)vShaderSource.c_str()); fragmentShader = LoadShader(GL_FRAGMENT_SHADER, (const char *)fShaderSource.c_str()); // Create the program object programObject = ctx.glCreateProgram(); if (programObject == 0) return -1; ctx.glAttachShader(programObject, vertexShader); ctx.glAttachShader(programObject, fragmentShader); // Link the program ctx.glLinkProgram(programObject); // Check the link status ctx.glGetProgramiv(programObject, GL_LINK_STATUS, &linked); if (!linked) { GLint infoLen = 0; ctx.glGetProgramiv(programObject, GL_INFO_LOG_LENGTH, &infoLen); if (infoLen > 1) { char* infoLog = (char *)malloc(sizeof(char) * infoLen); ctx.glGetProgramInfoLog(programObject, infoLen, NULL, infoLog); printf("Error linking program:\n%s\n", infoLog); free(infoLog); } ctx.glDeleteProgram(programObject); return -1; } return programObject; } /// // Create a shader object, load the shader source, and // compile the shader. // GLuint MaterialManager::LoadShader(GLenum type, const char *shaderSrc) { GLuint shader; GLint compiled; // Create the shader object shader = ctx.glCreateShader(type); if (shader == 0) return 0; // Load the shader source ctx.glShaderSource(shader, 1, &shaderSrc, NULL); // Compile the shader ctx.glCompileShader(shader); // Check the compile status ctx.glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); if (!compiled) { GLint infoLen = 0; ctx.glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); if (infoLen > 1) { char* infoLog = (char *)malloc(sizeof(char) * infoLen); GLsizei len; ctx.glGetShaderInfoLog(shader, infoLen, &len, infoLog); printf("Error compiling shader:\n%s\n", infoLog); free(infoLog); } ctx.glDeleteShader(shader); return 0; } return shader; }
22.033457
127
0.681964
[ "object", "vector" ]
16f6a784c5d09d5eff23d81b3e38994baf9c4a6f
12,140
cpp
C++
src/main.cpp
moldyn/MSMPathfinder
7eee889415427a550312d3fd1bd7238fe542a6e3
[ "MIT" ]
3
2020-12-10T13:22:20.000Z
2021-04-23T12:05:07.000Z
src/main.cpp
biocheming/MSMPathfinder
7eee889415427a550312d3fd1bd7238fe542a6e3
[ "MIT" ]
null
null
null
src/main.cpp
biocheming/MSMPathfinder
7eee889415427a550312d3fd1bd7238fe542a6e3
[ "MIT" ]
1
2021-07-13T10:39:50.000Z
2021-07-13T10:39:50.000Z
#include <iostream> #include <fstream> #include "main.hpp" #include "paths.hpp" #include "pathfinder.hpp" #include "transition_matrix.hpp" #include <string> #include <vector> #include <cmath> #include <chrono> //#include <exception> #include <boost/program_options.hpp> //#include <omp.h> //! check if states in A are legit bool check_states(const std::vector<State> A, const std::string str_A, const std::vector<State> B, const std::string str_B, const std::vector<State> C, const std::string str_C, const State no_of_states) { return (check_states_A(A, str_A, B, str_B, C, str_C, no_of_states) & check_states_A(B, str_B, A, str_A, C, str_C, no_of_states) & check_states_A(C, str_C, A, str_A, B, str_B, no_of_states)); } bool check_states_A(const std::vector<State> A, const std::string str_A, const std::vector<State> B, const std::string str_B, const std::vector<State> C, const std::string str_C, const State no_of_states) { // check if all values are legal and unique for (auto &state : A) { // because of State (unsigned int) < 0 is not possible if (state >= no_of_states) { std::cout << " ERROR: state " << int(state)+1 << " in " << str_A << " is larger/smaller than matrix" << std::endl; return false; } // check if A has overlap with B or C if (std::count(B.begin(), B.end(), state)) { std::cout << " ERROR: state " << state+1 << " is in " << str_A << " and " << str_B << std::endl; return false; } if (std::count(C.begin(), C.end(), state)) { std::cout << " ERROR: state " << state+1 << " is in " << str_A << " and " << str_C << std::endl; return false; } } auto it_A = std::adjacent_find(A.begin(), A.end()); if (!(it_A == A.end())) { std::cout << " ERROR: state " << int(*it_A)+1 << " in " << str_A << " is not unique" << std::endl; return false; } return true; } //! MAIN ROUTINE int main(int argc, char* argv[]){ namespace b_po = boost::program_options; std::string version_number = "v0.9"; // generate header string std::string leading_whitespace(25 - (22 + version_number.size())/2, ' '); std::ostringstream header_ostring; header_ostring << "\n" << leading_whitespace << "~~~ MSMPathfinder " + version_number + " ~~~\n"; if (argc > 2) { std::string leading_whitespace2nd(25 - (4 + strlen(argv[1]))/2, ' '); header_ostring << leading_whitespace2nd << "~ " << argv[1] << " ~\n"; } std::string clustering_copyright = header_ostring.str() + "" "MSMPathfinder " + version_number + ": a framework for calculating pathways from states \n" "A={a_1, a2_,...} to states B={b_1, b2_,...} based on the provided Markov\n" "state model.\n" "Copyright (c) 2019, Daniel Nagel\n\n" ; std::string general_help = clustering_copyright + "modes:\n" " paths: propagate transition matrix and weight results\n" " mcmc: run many short markov chain monte carlo (mcmc) and weight them\n" " mcmcsingle: run a single very long markov chain monte carlo (mcmc)\n" "\n" "usage:\n" " msmpathfinder MODE --option1 --option2 ...\n" "\n" "for a list of available options per mode, run with '-h' option, e.g.\n" " msmpathfinder paths -h\n" ; Mode mode; if (argc <= 2) { std::cerr << general_help; return EXIT_FAILURE; } else { std::string str_mode(argv[1]); if (str_mode.compare("paths") == 0) { mode = PATHS; } else if (str_mode.compare("mcmc") == 0) { mode = MCMC; } else if (str_mode.compare("mcmcsingle") == 0) { mode = MCMCSINGLE; }else { std::cerr << "\nerror: unrecognized mode '" << str_mode << "'\n\n"; std::cerr << general_help; return EXIT_FAILURE; } } b_po::variables_map args; // header string for mode specific help std::string help_header = clustering_copyright + std::string(argv[1]) + ": \n"; switch(mode){ case PATHS: help_header += "This program calculates the pathway distribution directly\n" "from the transition matrix." "\nThis method is suitable for up to 100 states.\n"; break; case MCMC: help_header += "This program estimates the pathway distribution by running\n" "multiple short markov chain monte carlo method runs."; break; case MCMCSINGLE: help_header += "This program estimates the pathway distribution by running\n" "a single long markov chain monte carlo method run."; break; default: std::cerr << " ERROR: unknown mode. this should never happen." << std::endl; return EXIT_FAILURE; } help_header += "\nTo keep the number of pathways feasible, loops are cut, so\n" " 1->2->5->3->2->7 => 1->2->7\n" "If multiple (nested) loops are found always the longest is\n" "cut first.\n\noptions"; // parsing options b_po::options_description desc (help_header); desc.add_options() ("help,h", b_po::bool_switch()->default_value(false), "show this help.") ("input-file,i", b_po::value<std::string>()->required(), "input (required): transition matrix (multi-column ASCII, row normalized).") ("states-from,f", b_po::value<std::vector<State>>()->multitoken()->required(), "parameter: list of states (one-indexed) where pathways starts from.") ("states-to,t", b_po::value<std::vector<State>>()->multitoken()->required(), "parameter: list of states (one-indexed) where pathways ends.") ("states-forbidden", b_po::value<std::vector<State>>()->multitoken(), "parameter: list of states (one-indexed) which pathways should not enter.") ("steps", b_po::value<std::size_t>(), "parameter: number of steps which a transition can be maximal long.") ("threshold", b_po::value<std::size_t>()->default_value(100000), "parameter: maximal number of different pathways which are stored, -1 for all (default: 100000).") ; // add mode specific options switch(mode){ case PATHS: desc.add_options() ("precision,p", b_po::value<double>()->required(), "parameter: threshold up to which all paths are taken into account for the path search.") ; break; case MCMC: desc.add_options() ("iterations", b_po::value<std::size_t>()->required(), "parameter: number of iterations per state") ; break; case MCMCSINGLE: desc.add_options() ("total-steps", b_po::value<std::size_t>()->required(), "parameter: number of total steps the mcmc is generated") ; break; default: std::cerr << " ERROR: unknown mode. this should never happen." << std::endl; return EXIT_FAILURE; } // add optional and default options desc.add_options() // optional ("output,o", b_po::value<std::string>(), "output (optional): save pathways to file.") // defaults ("keep-diag", b_po::bool_switch()->default_value(false), "flag (optional): omits setting T_ii->0.") ("nthreads,n", b_po::value<int>()->default_value(0), "number of OpenMP threads. default: 0; i.e. use OMP_NUM_THREADS env-variable.") ("verbose,v", b_po::bool_switch()->default_value(false), "verbose mode: print runtime information to STDOUT.") ; // try to parse arguments try { b_po::store(b_po::parse_command_line(argc, argv, desc), args); if (args["help"].as<bool>()) { std::cout << desc << std::endl; std::exit(EXIT_SUCCESS); } b_po::notify(args); } catch (std::exception& e) { std::cerr << "\nerror parsing arguments:\n " << e.what() << std::endl; std::cerr << "\nuse --help/-h for further usage information.\n" << std::endl; // std::cerr << desc << std::endl; std::exit(EXIT_FAILURE); } catch (...) { // This should never be reached! std::cerr << "\nunhandled error occured.\n" << std::endl; } // SET NUMBER OF THREADS // omp_set_num_threads(6); // get parsed input std::string output; if (args.count("output")) { output = args["output"].as<std::string>(); } else { output = "not specified! only first 50 pathways are printed on console"; } std::string file_name = args["input-file"].as<std::string>(); std::vector<State> A = args["states-from"].as<std::vector<State>>(); std::vector<State> B = args["states-to"].as<std::vector<State>>(); std::vector<State> C; if (args.count("states-forbidden")) { C = args["states-forbidden"].as<std::vector<State>>(); } // shift one-based states to zero based for (auto &val : A) { val -= 1; } for (auto &val : B) { val -= 1; } if (args.count("states-forbidden")) { for(auto &val : C) { val -= 1; } } // sort states std::sort(A.begin(), A.end()); std::sort(B.begin(), B.end()); std::sort(C.begin(), C.end()); bool keep_diag = args["keep-diag"].as<bool>(); // print header std::cout << "\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" << " ~~~ Markov State Model PATHFINDER ~~~\n" << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" << "\n~~~ Input parameters:\n" << " output: " << output << "\n" << std::endl; // read transition matrix from file // TODO: remove steps and iterations values to input default values std::size_t steps = 0; if (args.count("steps")) { steps = args["steps"].as<std::size_t>(); } double cut_off = 0.; if (args.count("precision")) { cut_off = args["precision"].as<double>(); } std::size_t iterations = 0; if (args.count("iterations")) { iterations = args["iterations"].as<std::size_t>(); } std::size_t total_steps = 0; if (args.count("total-steps")) { total_steps = args["total-steps"].as<std::size_t>(); } if (!(args.count("output"))) { output = ""; } std::size_t threshold = args["threshold"].as<std::size_t>(); // generate transition matrix Transition_matrix T(file_name, keep_diag); // check states bool legit_states = check_states(A, "states-from", B, "states-to", C, "states-forbidden", T.get_no_of_states()); if (legit_states) { std::cout << " from: "; for (auto &val : A) { std::cout << val+1 << " "; } std::cout << "\n to: "; for (auto &val : B) { std::cout << val+1 << " "; } if (args.count("states-forbidden")) { std::cout << "\n forbidden: "; for (auto &val : C) { std::cout << val+1 << " "; } } std::cout << std::endl; } else { std::cout << " ERROR: Bad selection of states." << std::endl; std::exit(EXIT_FAILURE); } // call main routine run_paths(mode, A, B, C, cut_off, steps, iterations, total_steps, T, output, threshold, argc, argv); }
37.353846
107
0.529984
[ "vector", "model" ]
16fc46bb14186dbbe3311b62557534bd556b08ef
2,586
cpp
C++
COJ/TobbyAndPrimoshkasII.cpp
aajjbb/contest-files
b8842681b96017063a7baeac52ae1318bf59d74d
[ "Apache-2.0" ]
1
2018-08-28T19:58:40.000Z
2018-08-28T19:58:40.000Z
COJ/TobbyAndPrimoshkasII.cpp
aajjbb/contest-files
b8842681b96017063a7baeac52ae1318bf59d74d
[ "Apache-2.0" ]
2
2017-04-16T00:48:05.000Z
2017-08-03T20:12:26.000Z
COJ/TobbyAndPrimoshkasII.cpp
aajjbb/contest-files
b8842681b96017063a7baeac52ae1318bf59d74d
[ "Apache-2.0" ]
4
2016-03-04T19:42:00.000Z
2018-01-08T11:42:00.000Z
#include <bits/stdc++.h> template<typename T> T gcd(T a, T b) { if(!b) return a; return gcd(b, a % b); } template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); } template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; } template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; } int in() { int x; scanf("%d", &x); return x; } using namespace std; typedef long long Int; typedef unsigned uint; const int MAXN = 500005; int N, Q, cnt; int ini[MAXN], fin[MAXN]; vector<int> graph[MAXN]; int tree[4 * MAXN]; int lazy[4 * MAXN]; void propagate(int node, int l, int r) { if (lazy[node]) { // printf("propa %d %d %d => %d\n", node, l, r, tree[node]); tree[node] = (r - l + 1) - tree[node]; if (l != r) { lazy[2 * node] ^= 1; lazy[2 * node + 1] ^= 1; } } lazy[node] = 0; } int query(int node, int l, int r, int bound_l, int bound_r) { propagate(node, l, r); // printf("query %d %d %d = %d %d\n", node, l, r, bound_l, bound_r); if (l > r || l > bound_r || r < bound_l) { return 0; } else if (l >= bound_l && r <= bound_r) { return tree[node]; } else { int m = (l + r) / 2; int q1 = query(2 * node, l, m, bound_l, bound_r); int q2 = query(2 * node + 1, m + 1, r, bound_l, bound_r); return q1 + q2; } } void update(int node, int l, int r, int bound_l, int bound_r) { // printf("update %d %d %d = %d %d\n", node, l, r, bound_l, bound_r); propagate(node, l, r); if (l > r || l > bound_r || r < bound_l) { return; } else if (l >= bound_l && r <= bound_r) { lazy[node] ^= 1; propagate(node, l, r); } else { int m = (l + r) / 2; update(2 * node, l, m, bound_l, bound_r); update(2 * node + 1, m + 1, r, bound_l, bound_r); tree[node] = tree[2 * node] + tree[2 * node + 1]; } } void dfs(int node, int p) { ini[node] = cnt++; for (int i = 0; i < (int) graph[node].size(); i++) { int next = graph[node][i]; if (next != p) { dfs(next, node); } } fin[node] = cnt - 1; } int main(void) { for ( ; scanf("%d%d", &N, &Q) == 2; ) { for (int i = 0; i < MAXN; i++) { graph[i].clear(); ini[i] = fin[i] = -1; } memset(tree, 0, sizeof(tree)); memset(lazy, 0, sizeof(lazy)); int A, B; for (int i = 0; i < N - 1; i++) { scanf("%d%d", &A, &B); graph[A].push_back(B); } cnt = 0; dfs(0, -1); for (int i = 0; i < Q; i++) { scanf("%d%d", &A, &B); /// printf("q = %d %d %d\n", A, ini[B], fin[B]); if (A == 0) { update(1, 0, N -1, ini[B], fin[B]); } else { printf("%d\n", query(1, 0, N - 1, ini[B], fin[B])); } } } return 0; }
22.293103
70
0.506574
[ "vector" ]
16ff6a617b30a9d85f9ed2a59ee9b935da4e5e6a
992
cpp
C++
string/manacher-palindrome.cpp
Nilesh-Das/mustdogfg
bb39fe6eb9dd4964f97a7ab6d4e65e4c3994fc3f
[ "MIT" ]
null
null
null
string/manacher-palindrome.cpp
Nilesh-Das/mustdogfg
bb39fe6eb9dd4964f97a7ab6d4e65e4c3994fc3f
[ "MIT" ]
null
null
null
string/manacher-palindrome.cpp
Nilesh-Das/mustdogfg
bb39fe6eb9dd4964f97a7ab6d4e65e4c3994fc3f
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <string> using namespace std; void manacher(string s) { // no of odd length palindrome with center i vector<int> d1(n); for (int i = 0, l = 0, r = -1; i < n; i++) { int k = (i > r) ? 1 : min(d1[l + r - i], r - i + 1); while (0 <= i - k && i + k < n && s[i - k] == s[i + k]) { k++; } d1[i] = k--; if (i + k > r) { l = i - k; r = i + k; } } // no of even length palindrome with center i vector<int> d2(n); for (int i = 0, l = 0, r = -1; i < n; i++) { int k = (i > r) ? 0 : min(d2[l + r - i + 1], r - i + 1); while (0 <= i - k - 1 && i + k < n && s[i - k - 1] == s[i + k]) { k++; } d2[i] = k--; if (i + k > r) { l = i - k - 1; r = i + k ; } } } int main() { int t; cin >> t; while(t--) { string s; manacher(s); } }
23.619048
73
0.345766
[ "vector" ]
e5012f1dee9167880b40b5d150449da2adfac196
6,853
cpp
C++
test/Simulator/Simulator.cpp
golomb1/CIoTA-Collaborative-IoT-Anomaly-detection-via-Blockchain
7704e5d22f09783250ec3b448ef4d5d24bbaf8af
[ "MIT" ]
14
2018-12-18T07:49:11.000Z
2021-12-17T10:06:02.000Z
test/Simulator/Simulator.cpp
golomb1/CIoTA-Collaborative-IoT-Anomaly-detection-via-Blockchain
7704e5d22f09783250ec3b448ef4d5d24bbaf8af
[ "MIT" ]
2
2019-01-28T18:11:43.000Z
2020-11-11T08:23:10.000Z
test/Simulator/Simulator.cpp
golomb1/CIoTA-Collaborative-IoT-Anomaly-detection-via-Blockchain
7704e5d22f09783250ec3b448ef4d5d24bbaf8af
[ "MIT" ]
7
2018-08-31T15:59:58.000Z
2021-11-03T02:11:02.000Z
// // Created by golombt on 25/12/2017. // #include <random> #include "Simulator.h" #include "../TestSuite1/CIoTA/CIoTA_TestApplication.h" #include "MockJumpTableSource.h" void cleanPackets() { SimulatorFileDescriptorWrapper::packets.clear(); for (auto p : SimulatorFileDescriptorWrapper::lastReceivedPacket) { SimulatorFileDescriptorWrapper::lastReceivedPacket[p.first] = 0; } } SimulatorPack *runInstance(size_t numOfDevices, unsigned long i, EmptySHA256CryptoLibraryTest *library) { auto pid = static_cast<pid_t>(i); auto mask = static_cast<uint64_t>((~0) ^ 0x000000FF); size_t windows = 1000; uint64_t start = 0x00010000; uint64_t end = 0x0001a000; uint32_t threshold = 50; size_t pConsensus = 0; auto *server = new SimulatorFileDescriptorWrapper(static_cast<size_t>(i + 1)); auto* emptyModel = new JumpTracer(server, windows, mask, start, end, threshold); auto *utilities = new JumpTracerUtilities(pid, pConsensus, numOfDevices, 5, emptyModel, simulateSource); std::string from = std::string("Id") + std::to_string(i + 1); auto* fromBuffer = new MemBuffer(from.data(), from.size()); fromBuffer->appendValue(0, 1); auto *app = new CIoTA::CIoTABlockchainApplication<JumpTracer, SHA256_OUTPUT_SIZE>(fromBuffer, 20, numOfDevices, nullptr, library, utilities); auto* compress = new MockCompressionLibrary(); auto* agent = new CIoTA::Agent<JumpTracer, SHA256_OUTPUT_SIZE>(9999, 512, 256, compress , server, 5, 5, app); agent->run(); return new SimulatorPack{server, emptyModel, utilities, fromBuffer, app, agent, compress}; } void Simulator::serialSimulation(size_t numberOfDevices) { using namespace std::chrono_literals; auto *library = new EmptySHA256CryptoLibraryTest(); globalNumberOfDevices = numberOfDevices; SimulatorFileDescriptorWrapper::globalCounter = numberOfDevices; std::vector<SimulatorPack*> agents; std::cout << "\tStart agents\n"; for (unsigned long i = 0; i < numberOfDevices; i++) { agents.push_back(runInstance(numberOfDevices, i, library)); std::cout << "\t\tAgent " << i << " running\n"; std::this_thread::sleep_for(20s); agents.at(i)->agnet->stop(); std::cout << "\t\tAgent " << i << " stopped\n"; // assert the models. const std::map<CodeAddress, std::map<CodeAddress, uint64_t>> &table = agents.at(i)->utilities->getTable(); for (auto row : table) { ASSERT(row.second.size(), 1); } cleanPackets(); } std::cout << "\tStart communication\n"; agents.at(0)->agnet->shareIntelligence(); for (int k = 1; k >= 0; k--) { for (auto i = static_cast<unsigned long>(k); i < numberOfDevices; i++) { agents.at(i)->agnet->run(); std::cout << "\t\tAgent " << i << " running\n"; std::this_thread::sleep_for(20s); agents.at(i)->agnet->stop(); std::cout << "\t\tAgent " << i << " stopped\n"; cleanPackets(); agents.at(i)->agnet->shareIntelligence(); } } for (unsigned long i = 0; i < numberOfDevices; i++) { const std::map<CodeAddress, std::map<CodeAddress, uint64_t>> &table = agents.at(i)->utilities->getTable(); bool found = false; for (const auto &row : table) { found |= (row.second.size() == numberOfDevices); } ASSERT(found, true); } shuffleFlag = true; std::cout << "\tStart shuffle\n"; for (unsigned long i = 0; i < numberOfDevices; i++) { agents.at(i)->agnet->run(); std::cout << "\t\tAgent " << i << " running\n"; std::this_thread::sleep_for(20s); agents.at(i)->agnet->stop(); std::cout << "\t\tAgent " << i << " stopped\n"; cleanPackets(); agents.at(i)->agnet->shareIntelligence(); } ASSERT(SimulatorFileDescriptorWrapper::globalCounter, numberOfDevices); attackFlag = true; std::cout << "\tStart attack\n"; for (unsigned long i = 0; i < numberOfDevices; i++) { agents.at(i)->agnet->run(); std::cout << "\t\tAgent " << i << " running\n"; std::this_thread::sleep_for(20s); agents.at(i)->agnet->stop(); std::cout << "\t\tAgent " << i << " stopped\n"; cleanPackets(); agents.at(i)->agnet->shareIntelligence(); } ASSERT(SimulatorFileDescriptorWrapper::globalCounter, 0); std::cout << "\tFinish\n"; for(auto *agent : agents){ delete(agent->agnet); delete(agent->app); delete(agent->id); delete(agent->server); delete(agent->tracer); delete(agent->utilities); delete(agent->compress); delete(agent); } delete library; } void Simulator::asynchronousSimulation(size_t numberOfDevices) { using namespace std::chrono_literals; auto *library = new EmptySHA256CryptoLibraryTest(); globalNumberOfDevices = numberOfDevices; SimulatorFileDescriptorWrapper::globalCounter = numberOfDevices; std::vector<SimulatorPack *> agents; std::cout << "\tStart agents\n"; for (unsigned long i = 0; i < numberOfDevices; i++) { agents.push_back(runInstance(numberOfDevices, i, library)); std::cout << "\t\tAgent " << i << " running\n"; } for (int i = 0; i < 18; i++) { std::this_thread::sleep_for(20s); cleanPackets(); } std::cout << "\tTest communication\n"; for (unsigned long i = 0; i < numberOfDevices; i++) { const std::map<CodeAddress, std::map<CodeAddress, uint64_t>> &table = agents.at(i)->utilities->getTable(); bool found = false; for (const auto &row : table) { found |= (row.second.size() == numberOfDevices); } ASSERT(found, true); } shuffleFlag = true; std::cout << "\tStart shuffle\n"; std::this_thread::sleep_for(30s); ASSERT(SimulatorFileDescriptorWrapper::globalCounter, numberOfDevices); attackFlag = true; std::cout << "\tStart attack\n"; std::this_thread::sleep_for(30s); ASSERT(SimulatorFileDescriptorWrapper::globalCounter, 0); std::cout << "\tFinish\n"; for (auto *agent : agents) { agent->agnet->stop(); delete (agent->agnet); delete (agent->app); delete (agent->id); delete (agent->server); delete (agent->tracer); delete (agent->utilities); delete (agent->compress); delete (agent); } delete library; }
35.879581
116
0.584562
[ "vector" ]
e502ab999529117b664c4f67f67aca8042d37b59
105,477
cpp
C++
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/src/linguist/linguist/mainwindow.cpp
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
null
null
null
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/src/linguist/linguist/mainwindow.cpp
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
null
null
null
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/src/linguist/linguist/mainwindow.cpp
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
null
null
null
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Linguist of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ /* TRANSLATOR MainWindow This is the application's main window. */ #include "mainwindow.h" #include "batchtranslationdialog.h" #include "errorsview.h" #include "finddialog.h" #include "formpreviewview.h" #include "globals.h" #include "messageeditor.h" #include "messagemodel.h" #include "phrasebookbox.h" #include "phrasemodel.h" #include "phraseview.h" #include "printout.h" #include "sourcecodeview.h" #include "statistics.h" #include "translatedialog.h" #include "translationsettingsdialog.h" #include <QAction> #include <QApplication> #include <QBitmap> #include <QCloseEvent> #include <QDebug> #include <QDesktopWidget> #include <QDockWidget> #include <QFile> #include <QFileDialog> #include <QFileInfo> #include <QHeaderView> #include <QInputDialog> #include <QItemDelegate> #include <QLabel> #include <QLayout> #include <QLibraryInfo> #include <QMenu> #include <QMenuBar> #include <QMessageBox> #include <QMimeData> #include <QPrintDialog> #include <QPrinter> #include <QProcess> #include <QRegExp> #include <QSettings> #include <QSortFilterProxyModel> #include <QStackedWidget> #include <QStatusBar> #include <QTextStream> #include <QToolBar> #include <QUrl> #include <QWhatsThis> #include <ctype.h> QT_BEGIN_NAMESPACE static const int MessageMS = 2500; enum Ending { End_None, End_FullStop, End_Interrobang, End_Colon, End_Ellipsis }; static bool hasFormPreview(const QString &fileName) { return fileName.endsWith(QLatin1String(".ui")) || fileName.endsWith(QLatin1String(".jui")); } static QString leadingWhitespace(const QString &str) { int i = 0; for (; i < str.size(); i++) { if (!str[i].isSpace()) { break; } } return str.left(i); } static QString trailingWhitespace(const QString &str) { int i = str.size(); while (--i >= 0) { if (!str[i].isSpace()) { break; } } return str.mid(i + 1); } static Ending ending(QString str, QLocale::Language lang) { str = str.simplified(); if (str.isEmpty()) return End_None; switch (str.at(str.length() - 1).unicode()) { case 0x002e: // full stop if (str.endsWith(QLatin1String("..."))) return End_Ellipsis; else return End_FullStop; case 0x0589: // armenian full stop case 0x06d4: // arabic full stop case 0x3002: // ideographic full stop return End_FullStop; case 0x0021: // exclamation mark case 0x003f: // question mark case 0x00a1: // inverted exclamation mark case 0x00bf: // inverted question mark case 0x01c3: // latin letter retroflex click case 0x037e: // greek question mark case 0x061f: // arabic question mark case 0x203c: // double exclamation mark case 0x203d: // interrobang case 0x2048: // question exclamation mark case 0x2049: // exclamation question mark case 0x2762: // heavy exclamation mark ornament case 0xff01: // full width exclamation mark case 0xff1f: // full width question mark return End_Interrobang; case 0x003b: // greek 'compatibility' questionmark return lang == QLocale::Greek ? End_Interrobang : End_None; case 0x003a: // colon case 0xff1a: // full width colon return End_Colon; case 0x2026: // horizontal ellipsis return End_Ellipsis; default: return End_None; } } class ContextItemDelegate : public QItemDelegate { public: ContextItemDelegate(QObject *parent, MultiDataModel *model) : QItemDelegate(parent), m_dataModel(model) {} void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { const QAbstractItemModel *model = index.model(); Q_ASSERT(model); if (!model->parent(index).isValid()) { if (index.column() - 1 == m_dataModel->modelCount()) { QStyleOptionViewItem opt = option; opt.font.setBold(true); QItemDelegate::paint(painter, opt, index); return; } } QItemDelegate::paint(painter, option, index); } private: MultiDataModel *m_dataModel; }; static const QVariant &pxObsolete() { static const QVariant v = QVariant::fromValue(QPixmap(QLatin1String(":/images/s_check_obsolete.png"))); return v; } class SortedMessagesModel : public QSortFilterProxyModel { public: SortedMessagesModel(QObject *parent, MultiDataModel *model) : QSortFilterProxyModel(parent), m_dataModel(model) {} QVariant headerData(int section, Qt::Orientation orientation, int role) const { if (role == Qt::DisplayRole && orientation == Qt::Horizontal) switch (section - m_dataModel->modelCount()) { case 0: return QString(); case 1: return MainWindow::tr("Source text"); case 2: return MainWindow::tr("Index"); } if (role == Qt::DecorationRole && orientation == Qt::Horizontal && section - 1 < m_dataModel->modelCount()) return pxObsolete(); return QVariant(); } private: MultiDataModel *m_dataModel; }; class SortedContextsModel : public QSortFilterProxyModel { public: SortedContextsModel(QObject *parent, MultiDataModel *model) : QSortFilterProxyModel(parent), m_dataModel(model) {} QVariant headerData(int section, Qt::Orientation orientation, int role) const { if (role == Qt::DisplayRole && orientation == Qt::Horizontal) switch (section - m_dataModel->modelCount()) { case 0: return QString(); case 1: return MainWindow::tr("Context"); case 2: return MainWindow::tr("Items"); case 3: return MainWindow::tr("Index"); } if (role == Qt::DecorationRole && orientation == Qt::Horizontal && section - 1 < m_dataModel->modelCount()) return pxObsolete(); return QVariant(); } private: MultiDataModel *m_dataModel; }; class FocusWatcher : public QObject { public: FocusWatcher(MessageEditor *msgedit, QObject *parent) : QObject(parent), m_messageEditor(msgedit) {} protected: bool eventFilter(QObject *object, QEvent *event); private: MessageEditor *m_messageEditor; }; bool FocusWatcher::eventFilter(QObject *, QEvent *event) { if (event->type() == QEvent::FocusIn) m_messageEditor->setEditorFocus(-1); return false; } MainWindow::MainWindow() : QMainWindow(0, Qt::Window), m_assistantProcess(0), m_printer(0), m_findMatchCase(Qt::CaseInsensitive), m_findIgnoreAccelerators(true), m_findSkipObsolete(false), m_findWhere(DataModel::NoLocation), m_translationSettingsDialog(0), m_settingCurrentMessage(false), m_fileActiveModel(-1), m_editActiveModel(-1), m_statistics(0) { setUnifiedTitleAndToolBarOnMac(true); m_ui.setupUi(this); #if !defined(Q_OS_OSX) && !defined(Q_OS_WIN) setWindowIcon(QPixmap(QLatin1String(":/images/appicon.png") )); #endif m_dataModel = new MultiDataModel(this); m_messageModel = new MessageModel(this, m_dataModel); // Set up the context dock widget m_contextDock = new QDockWidget(this); m_contextDock->setObjectName(QLatin1String("ContextDockWidget")); m_contextDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_contextDock->setFeatures(QDockWidget::AllDockWidgetFeatures); m_contextDock->setWindowTitle(tr("Context")); m_contextDock->setAcceptDrops(true); m_contextDock->installEventFilter(this); m_sortedContextsModel = new SortedContextsModel(this, m_dataModel); m_sortedContextsModel->setSortRole(MessageModel::SortRole); m_sortedContextsModel->setSortCaseSensitivity(Qt::CaseInsensitive); m_sortedContextsModel->setSourceModel(m_messageModel); m_contextView = new QTreeView(this); m_contextView->setRootIsDecorated(false); m_contextView->setItemsExpandable(false); m_contextView->setUniformRowHeights(true); m_contextView->setAlternatingRowColors(true); m_contextView->setAllColumnsShowFocus(true); m_contextView->setItemDelegate(new ContextItemDelegate(this, m_dataModel)); m_contextView->setSortingEnabled(true); m_contextView->setWhatsThis(tr("This panel lists the source contexts.")); m_contextView->setModel(m_sortedContextsModel); m_contextView->header()->setSectionsMovable(false); m_contextView->setColumnHidden(0, true); m_contextView->header()->setStretchLastSection(false); m_contextDock->setWidget(m_contextView); // Set up the messages dock widget m_messagesDock = new QDockWidget(this); m_messagesDock->setObjectName(QLatin1String("StringsDockWidget")); m_messagesDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_messagesDock->setFeatures(QDockWidget::AllDockWidgetFeatures); m_messagesDock->setWindowTitle(tr("Strings")); m_messagesDock->setAcceptDrops(true); m_messagesDock->installEventFilter(this); m_sortedMessagesModel = new SortedMessagesModel(this, m_dataModel); m_sortedMessagesModel->setSortRole(MessageModel::SortRole); m_sortedMessagesModel->setSortCaseSensitivity(Qt::CaseInsensitive); m_sortedMessagesModel->setSortLocaleAware(true); m_sortedMessagesModel->setSourceModel(m_messageModel); m_messageView = new QTreeView(m_messagesDock); m_messageView->setSortingEnabled(true); m_messageView->setRootIsDecorated(false); m_messageView->setUniformRowHeights(true); m_messageView->setAllColumnsShowFocus(true); m_messageView->setItemsExpandable(false); m_messageView->setModel(m_sortedMessagesModel); m_messageView->header()->setSectionsMovable(false); m_messageView->setColumnHidden(0, true); m_messagesDock->setWidget(m_messageView); // Set up main message view m_messageEditor = new MessageEditor(m_dataModel, this); m_messageEditor->setAcceptDrops(true); m_messageEditor->installEventFilter(this); // We can't call setCentralWidget(m_messageEditor), since it is already called in m_ui.setupUi() QBoxLayout *lout = new QBoxLayout(QBoxLayout::TopToBottom, m_ui.centralwidget); lout->addWidget(m_messageEditor); lout->setMargin(0); m_ui.centralwidget->setLayout(lout); // Set up the phrases & guesses dock widget m_phrasesDock = new QDockWidget(this); m_phrasesDock->setObjectName(QLatin1String("PhrasesDockwidget")); m_phrasesDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_phrasesDock->setFeatures(QDockWidget::AllDockWidgetFeatures); m_phrasesDock->setWindowTitle(tr("Phrases and guesses")); m_phraseView = new PhraseView(m_dataModel, &m_phraseDict, this); m_phrasesDock->setWidget(m_phraseView); // Set up source code and form preview dock widget m_sourceAndFormDock = new QDockWidget(this); m_sourceAndFormDock->setObjectName(QLatin1String("SourceAndFormDock")); m_sourceAndFormDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_sourceAndFormDock->setFeatures(QDockWidget::AllDockWidgetFeatures); m_sourceAndFormDock->setWindowTitle(tr("Sources and Forms")); m_sourceAndFormView = new QStackedWidget(this); m_sourceAndFormDock->setWidget(m_sourceAndFormView); //connect(m_sourceAndDock, SIGNAL(visibilityChanged(bool)), // m_sourceCodeView, SLOT(setActivated(bool))); m_formPreviewView = new FormPreviewView(0, m_dataModel); m_sourceCodeView = new SourceCodeView(0); m_sourceAndFormView->addWidget(m_sourceCodeView); m_sourceAndFormView->addWidget(m_formPreviewView); // Set up errors dock widget m_errorsDock = new QDockWidget(this); m_errorsDock->setObjectName(QLatin1String("ErrorsDockWidget")); m_errorsDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_errorsDock->setFeatures(QDockWidget::AllDockWidgetFeatures); m_errorsDock->setWindowTitle(tr("Warnings")); m_errorsView = new ErrorsView(m_dataModel, this); m_errorsDock->setWidget(m_errorsView); // Arrange dock widgets setDockNestingEnabled(true); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); addDockWidget(Qt::LeftDockWidgetArea, m_contextDock); addDockWidget(Qt::TopDockWidgetArea, m_messagesDock); addDockWidget(Qt::BottomDockWidgetArea, m_phrasesDock); addDockWidget(Qt::TopDockWidgetArea, m_sourceAndFormDock); addDockWidget(Qt::BottomDockWidgetArea, m_errorsDock); //tabifyDockWidget(m_errorsDock, m_sourceAndFormDock); //tabifyDockWidget(m_sourceCodeDock, m_phrasesDock); // Allow phrases doc to intercept guesses shortcuts m_messageEditor->installEventFilter(m_phraseView); // Set up shortcuts for the dock widgets QShortcut *contextShortcut = new QShortcut(QKeySequence(Qt::Key_F6), this); connect(contextShortcut, SIGNAL(activated()), this, SLOT(showContextDock())); QShortcut *messagesShortcut = new QShortcut(QKeySequence(Qt::Key_F7), this); connect(messagesShortcut, SIGNAL(activated()), this, SLOT(showMessagesDock())); QShortcut *errorsShortcut = new QShortcut(QKeySequence(Qt::Key_F8), this); connect(errorsShortcut, SIGNAL(activated()), this, SLOT(showErrorDock())); QShortcut *sourceCodeShortcut = new QShortcut(QKeySequence(Qt::Key_F9), this); connect(sourceCodeShortcut, SIGNAL(activated()), this, SLOT(showSourceCodeDock())); QShortcut *phrasesShortcut = new QShortcut(QKeySequence(Qt::Key_F10), this); connect(phrasesShortcut, SIGNAL(activated()), this, SLOT(showPhrasesDock())); connect(m_phraseView, SIGNAL(phraseSelected(int,QString)), m_messageEditor, SLOT(setTranslation(int,QString))); connect(m_contextView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(selectedContextChanged(QModelIndex,QModelIndex))); connect(m_messageView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(selectedMessageChanged(QModelIndex,QModelIndex))); connect(m_contextView->selectionModel(), SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)), SLOT(updateLatestModel(QModelIndex))); connect(m_messageView->selectionModel(), SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)), SLOT(updateLatestModel(QModelIndex))); connect(m_messageEditor, SIGNAL(activeModelChanged(int)), SLOT(updateActiveModel(int))); m_translateDialog = new TranslateDialog(this); m_batchTranslateDialog = new BatchTranslationDialog(m_dataModel, this); m_findDialog = new FindDialog(this); setupMenuBar(); setupToolBars(); m_progressLabel = new QLabel(); statusBar()->addPermanentWidget(m_progressLabel); m_modifiedLabel = new QLabel(tr(" MOD ", "status bar: file(s) modified")); statusBar()->addPermanentWidget(m_modifiedLabel); modelCountChanged(); initViewHeaders(); resetSorting(); connect(m_dataModel, SIGNAL(modifiedChanged(bool)), this, SLOT(setWindowModified(bool))); connect(m_dataModel, SIGNAL(modifiedChanged(bool)), m_modifiedLabel, SLOT(setVisible(bool))); connect(m_dataModel, SIGNAL(multiContextDataChanged(MultiDataIndex)), SLOT(updateProgress())); connect(m_dataModel, SIGNAL(messageDataChanged(MultiDataIndex)), SLOT(maybeUpdateStatistics(MultiDataIndex))); connect(m_dataModel, SIGNAL(translationChanged(MultiDataIndex)), SLOT(translationChanged(MultiDataIndex))); connect(m_dataModel, SIGNAL(languageChanged(int)), SLOT(updatePhraseDict(int))); setWindowModified(m_dataModel->isModified()); m_modifiedLabel->setVisible(m_dataModel->isModified()); connect(m_messageView, SIGNAL(clicked(QModelIndex)), this, SLOT(toggleFinished(QModelIndex))); connect(m_messageView, SIGNAL(activated(QModelIndex)), m_messageEditor, SLOT(setEditorFocus())); connect(m_contextView, SIGNAL(activated(QModelIndex)), m_messageView, SLOT(setFocus())); connect(m_messageEditor, SIGNAL(translationChanged(QStringList)), this, SLOT(updateTranslation(QStringList))); connect(m_messageEditor, SIGNAL(translatorCommentChanged(QString)), this, SLOT(updateTranslatorComment(QString))); connect(m_findDialog, SIGNAL(findNext(QString,DataModel::FindLocation,bool,bool,bool)), this, SLOT(findNext(QString,DataModel::FindLocation,bool,bool,bool))); connect(m_translateDialog, SIGNAL(requestMatchUpdate(bool&)), SLOT(updateTranslateHit(bool&))); connect(m_translateDialog, SIGNAL(activated(int)), SLOT(translate(int))); QSize as(qApp->desktop()->size()); as -= QSize(30, 30); resize(QSize(1000, 800).boundedTo(as)); show(); readConfig(); m_statistics = 0; connect(m_ui.actionLengthVariants, SIGNAL(toggled(bool)), m_messageEditor, SLOT(setLengthVariants(bool))); m_messageEditor->setLengthVariants(m_ui.actionLengthVariants->isChecked()); m_messageEditor->setVisualizeWhitespace(m_ui.actionVisualizeWhitespace->isChecked()); m_focusWatcher = new FocusWatcher(m_messageEditor, this); m_contextView->installEventFilter(m_focusWatcher); m_messageView->installEventFilter(m_focusWatcher); m_messageEditor->installEventFilter(m_focusWatcher); m_sourceAndFormView->installEventFilter(m_focusWatcher); m_phraseView->installEventFilter(m_focusWatcher); m_errorsView->installEventFilter(m_focusWatcher); } MainWindow::~MainWindow() { writeConfig(); if (m_assistantProcess && m_assistantProcess->state() == QProcess::Running) { m_assistantProcess->terminate(); m_assistantProcess->waitForFinished(3000); } qDeleteAll(m_phraseBooks); delete m_dataModel; delete m_statistics; delete m_printer; } void MainWindow::initViewHeaders() { m_contextView->header()->setSectionResizeMode(1, QHeaderView::Stretch); m_contextView->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); m_messageView->setColumnHidden(2, true); // last visible column auto-stretches } void MainWindow::modelCountChanged() { int mc = m_dataModel->modelCount(); for (int i = 0; i < mc; ++i) { m_contextView->header()->setSectionResizeMode(i + 1, QHeaderView::Fixed); m_contextView->header()->resizeSection(i + 1, 24); m_messageView->header()->setSectionResizeMode(i + 1, QHeaderView::Fixed); m_messageView->header()->resizeSection(i + 1, 24); } if (!mc) { selectedMessageChanged(QModelIndex(), QModelIndex()); updateLatestModel(-1); } else { if (!m_contextView->currentIndex().isValid()) { // Ensure that something is selected m_contextView->setCurrentIndex(m_sortedContextsModel->index(0, 0)); } else { // Plug holes that turn up in the selection due to inserting columns m_contextView->selectionModel()->select(m_contextView->currentIndex(), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows); m_messageView->selectionModel()->select(m_messageView->currentIndex(), QItemSelectionModel::SelectCurrent|QItemSelectionModel::Rows); } // Field insertions/removals are automatic, but not the re-fill m_messageEditor->showMessage(m_currentIndex); if (mc == 1) updateLatestModel(0); else if (m_currentIndex.model() >= mc) updateLatestModel(mc - 1); } m_contextView->setUpdatesEnabled(true); m_messageView->setUpdatesEnabled(true); updateProgress(); updateCaption(); m_ui.actionFind->setEnabled(m_dataModel->contextCount() > 0); m_ui.actionFindNext->setEnabled(false); m_formPreviewView->setSourceContext(-1, 0); } struct OpenedFile { OpenedFile(DataModel *_dataModel, bool _readWrite, bool _langGuessed) { dataModel = _dataModel; readWrite = _readWrite; langGuessed = _langGuessed; } DataModel *dataModel; bool readWrite; bool langGuessed; }; bool MainWindow::openFiles(const QStringList &names, bool globalReadWrite) { if (names.isEmpty()) return false; bool waitCursor = false; statusBar()->showMessage(tr("Loading...")); qApp->processEvents(); QList<OpenedFile> opened; bool closeOld = false; foreach (QString name, names) { if (!waitCursor) { QApplication::setOverrideCursor(Qt::WaitCursor); waitCursor = true; } bool readWrite = globalReadWrite; if (name.startsWith(QLatin1Char('='))) { name.remove(0, 1); readWrite = false; } QFileInfo fi(name); if (fi.exists()) // Make the loader error out instead of reading stdin name = fi.canonicalFilePath(); if (m_dataModel->isFileLoaded(name) >= 0) continue; bool langGuessed; DataModel *dm = new DataModel(m_dataModel); if (!dm->load(name, &langGuessed, this)) { delete dm; continue; } if (opened.isEmpty()) { if (!m_dataModel->isWellMergeable(dm)) { QApplication::restoreOverrideCursor(); waitCursor = false; switch (QMessageBox::information(this, tr("Loading File - Qt Linguist"), tr("The file '%1' does not seem to be related to the currently open file(s) '%2'.\n\n" "Close the open file(s) first?") .arg(DataModel::prettifyPlainFileName(name), m_dataModel->condensedSrcFileNames(true)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape)) { case QMessageBox::Cancel: delete dm; return false; case QMessageBox::Yes: closeOld = true; break; case QMessageBox::No: break; } } } else { if (!opened.first().dataModel->isWellMergeable(dm)) { QApplication::restoreOverrideCursor(); waitCursor = false; switch (QMessageBox::information(this, tr("Loading File - Qt Linguist"), tr("The file '%1' does not seem to be related to the file '%2'" " which is being loaded as well.\n\n" "Skip loading the first named file?") .arg(DataModel::prettifyPlainFileName(name), opened.first().dataModel->srcFileName(true)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape)) { case QMessageBox::Cancel: delete dm; foreach (const OpenedFile &op, opened) delete op.dataModel; return false; case QMessageBox::Yes: delete dm; continue; case QMessageBox::No: break; } } } opened.append(OpenedFile(dm, readWrite, langGuessed)); } if (closeOld) { if (waitCursor) { QApplication::restoreOverrideCursor(); waitCursor = false; } if (!closeAll()) { foreach (const OpenedFile &op, opened) delete op.dataModel; return false; } } foreach (const OpenedFile &op, opened) { if (op.langGuessed) { if (waitCursor) { QApplication::restoreOverrideCursor(); waitCursor = false; } if (!m_translationSettingsDialog) m_translationSettingsDialog = new TranslationSettingsDialog(this); m_translationSettingsDialog->setDataModel(op.dataModel); m_translationSettingsDialog->exec(); } } if (!waitCursor) QApplication::setOverrideCursor(Qt::WaitCursor); m_contextView->setUpdatesEnabled(false); m_messageView->setUpdatesEnabled(false); int totalCount = 0; foreach (const OpenedFile &op, opened) { m_phraseDict.append(QHash<QString, QList<Phrase *> >()); m_dataModel->append(op.dataModel, op.readWrite); if (op.readWrite) updatePhraseDictInternal(m_phraseDict.size() - 1); totalCount += op.dataModel->messageCount(); } statusBar()->showMessage(tr("%n translation unit(s) loaded.", 0, totalCount), MessageMS); modelCountChanged(); recentFiles().addFiles(m_dataModel->srcFileNames()); revalidate(); QApplication::restoreOverrideCursor(); return true; } RecentFiles &MainWindow::recentFiles() { static RecentFiles recentFiles(10); return recentFiles; } void MainWindow::open() { openFiles(pickTranslationFiles()); } void MainWindow::openAux() { openFiles(pickTranslationFiles(), false); } void MainWindow::closeFile() { int model = m_currentIndex.model(); if (model >= 0 && maybeSave(model)) { m_phraseDict.removeAt(model); m_contextView->setUpdatesEnabled(false); m_messageView->setUpdatesEnabled(false); m_dataModel->close(model); modelCountChanged(); } } bool MainWindow::closeAll() { if (maybeSaveAll()) { m_phraseDict.clear(); m_contextView->setUpdatesEnabled(false); m_messageView->setUpdatesEnabled(false); m_dataModel->closeAll(); modelCountChanged(); initViewHeaders(); recentFiles().closeGroup(); return true; } return false; } static QString fileFilters(bool allFirst) { static const QString pattern(QLatin1String("%1 (*.%2);;")); QStringList allExtensions; QString filter; foreach (const Translator::FileFormat &format, Translator::registeredFileFormats()) { if (format.fileType == Translator::FileFormat::TranslationSource && format.priority >= 0) { filter.append(pattern.arg(format.description(), format.extension)); allExtensions.append(QLatin1String("*.") + format.extension); } } QString allFilter = QObject::tr("Translation files (%1);;").arg(allExtensions.join(QLatin1Char(' '))); if (allFirst) filter.prepend(allFilter); else filter.append(allFilter); filter.append(QObject::tr("All files (*)")); return filter; } QStringList MainWindow::pickTranslationFiles() { QString dir; if (!recentFiles().isEmpty()) dir = QFileInfo(recentFiles().lastOpenedFile()).path(); QString varFilt; if (m_dataModel->modelCount()) { QFileInfo mainFile(m_dataModel->srcFileName(0)); QString mainFileBase = mainFile.baseName(); int pos = mainFileBase.indexOf(QLatin1Char('_')); if (pos > 0) varFilt = tr("Related files (%1);;") .arg(mainFileBase.left(pos) + QLatin1String("_*.") + mainFile.completeSuffix()); } return QFileDialog::getOpenFileNames(this, tr("Open Translation Files"), dir, varFilt + fileFilters(true)); } void MainWindow::saveInternal(int model) { QApplication::setOverrideCursor(Qt::WaitCursor); if (m_dataModel->save(model, this)) { updateCaption(); statusBar()->showMessage(tr("File saved."), MessageMS); } QApplication::restoreOverrideCursor(); } void MainWindow::saveAll() { for (int i = 0; i < m_dataModel->modelCount(); ++i) if (m_dataModel->isModelWritable(i)) saveInternal(i); recentFiles().closeGroup(); } void MainWindow::save() { if (m_currentIndex.model() < 0) return; saveInternal(m_currentIndex.model()); } void MainWindow::saveAs() { if (m_currentIndex.model() < 0) return; QString newFilename = QFileDialog::getSaveFileName(this, QString(), m_dataModel->srcFileName(m_currentIndex.model()), fileFilters(false)); if (!newFilename.isEmpty()) { if (m_dataModel->saveAs(m_currentIndex.model(), newFilename, this)) { updateCaption(); statusBar()->showMessage(tr("File saved."), MessageMS); recentFiles().addFiles(m_dataModel->srcFileNames()); } } } void MainWindow::releaseAs() { if (m_currentIndex.model() < 0) return; QFileInfo oldFile(m_dataModel->srcFileName(m_currentIndex.model())); QString newFilename = oldFile.path() + QLatin1String("/") + oldFile.completeBaseName() + QLatin1String(".qm"); newFilename = QFileDialog::getSaveFileName(this, tr("Release"), newFilename, tr("Qt message files for released applications (*.qm)\nAll files (*)")); if (!newFilename.isEmpty()) { if (m_dataModel->release(m_currentIndex.model(), newFilename, false, false, SaveEverything, this)) statusBar()->showMessage(tr("File created."), MessageMS); } } void MainWindow::releaseInternal(int model) { QFileInfo oldFile(m_dataModel->srcFileName(model)); QString newFilename = oldFile.path() + QLatin1Char('/') + oldFile.completeBaseName() + QLatin1String(".qm"); if (!newFilename.isEmpty()) { if (m_dataModel->release(model, newFilename, false, false, SaveEverything, this)) statusBar()->showMessage(tr("File created."), MessageMS); } } // No-question void MainWindow::release() { if (m_currentIndex.model() < 0) return; releaseInternal(m_currentIndex.model()); } void MainWindow::releaseAll() { for (int i = 0; i < m_dataModel->modelCount(); ++i) if (m_dataModel->isModelWritable(i)) releaseInternal(i); } QPrinter *MainWindow::printer() { if (!m_printer) m_printer = new QPrinter; return m_printer; } void MainWindow::print() { int pageNum = 0; QPrintDialog dlg(printer(), this); if (dlg.exec()) { QApplication::setOverrideCursor(Qt::WaitCursor); printer()->setDocName(m_dataModel->condensedSrcFileNames(true)); statusBar()->showMessage(tr("Printing...")); PrintOut pout(printer()); for (int i = 0; i < m_dataModel->contextCount(); ++i) { MultiContextItem *mc = m_dataModel->multiContextItem(i); pout.vskip(); pout.setRule(PrintOut::ThickRule); pout.setGuide(mc->context()); pout.addBox(100, tr("Context: %1").arg(mc->context()), PrintOut::Strong); pout.flushLine(); pout.addBox(4); pout.addBox(92, mc->comment(), PrintOut::Emphasis); pout.flushLine(); pout.setRule(PrintOut::ThickRule); for (int j = 0; j < mc->messageCount(); ++j) { pout.setRule(PrintOut::ThinRule); bool printedSrc = false; QString comment; for (int k = 0; k < m_dataModel->modelCount(); ++k) { if (const MessageItem *m = mc->messageItem(k, j)) { if (!printedSrc) { pout.addBox(40, m->text()); pout.addBox(4); comment = m->comment(); printedSrc = true; } else { pout.addBox(44); // Maybe put the name of the translation here } if (m->message().isPlural() && m_dataModel->language(k) != QLocale::C) { QStringList transls = m->translations(); pout.addBox(40, transls.join(QLatin1Char('\n'))); } else { pout.addBox(40, m->translation()); } pout.addBox(4); QString type; switch (m->message().type()) { case TranslatorMessage::Finished: type = tr("finished"); break; case TranslatorMessage::Unfinished: type = m->danger() ? tr("unresolved") : QLatin1String("unfinished"); break; case TranslatorMessage::Obsolete: case TranslatorMessage::Vanished: type = tr("obsolete"); break; } pout.addBox(12, type, PrintOut::Normal, Qt::AlignRight); pout.flushLine(); } } if (!comment.isEmpty()) { pout.addBox(4); pout.addBox(92, comment, PrintOut::Emphasis); pout.flushLine(true); } if (pout.pageNum() != pageNum) { pageNum = pout.pageNum(); statusBar()->showMessage(tr("Printing... (page %1)") .arg(pageNum)); } } } pout.flushLine(true); QApplication::restoreOverrideCursor(); statusBar()->showMessage(tr("Printing completed"), MessageMS); } else { statusBar()->showMessage(tr("Printing aborted"), MessageMS); } } bool MainWindow::searchItem(DataModel::FindLocation where, const QString &searchWhat) { if ((m_findWhere & where) == 0) return false; QString text = searchWhat; if (m_findIgnoreAccelerators) // FIXME: This removes too much. The proper solution might be too slow, though. text.remove(QLatin1Char('&')); int foundOffset = text.indexOf(m_findText, 0, m_findMatchCase); return foundOffset >= 0; } void MainWindow::findAgain() { if (m_dataModel->contextCount() == 0) return; const QModelIndex &startIndex = m_messageView->currentIndex(); QModelIndex index = nextMessage(startIndex); while (index.isValid()) { QModelIndex realIndex = m_sortedMessagesModel->mapToSource(index); MultiDataIndex dataIndex = m_messageModel->dataIndex(realIndex, -1); bool hadMessage = false; for (int i = 0; i < m_dataModel->modelCount(); ++i) { if (MessageItem *m = m_dataModel->messageItem(dataIndex, i)) { if (m_findSkipObsolete && m->isObsolete()) continue; bool found = true; do { if (!hadMessage) { if (searchItem(DataModel::SourceText, m->text())) break; if (searchItem(DataModel::SourceText, m->pluralText())) break; if (searchItem(DataModel::Comments, m->comment())) break; if (searchItem(DataModel::Comments, m->extraComment())) break; } foreach (const QString &trans, m->translations()) if (searchItem(DataModel::Translations, trans)) goto didfind; if (searchItem(DataModel::Comments, m->translatorComment())) break; found = false; // did not find the search string in this message } while (0); if (found) { didfind: setCurrentMessage(realIndex, i); // determine whether the search wrapped const QModelIndex &c1 = m_sortedContextsModel->mapFromSource( m_sortedMessagesModel->mapToSource(startIndex)).parent(); const QModelIndex &c2 = m_sortedContextsModel->mapFromSource(realIndex).parent(); const QModelIndex &m = m_sortedMessagesModel->mapFromSource(realIndex); if (c2.row() < c1.row() || (c1.row() == c2.row() && m.row() <= startIndex.row())) statusBar()->showMessage(tr("Search wrapped."), MessageMS); m_findDialog->hide(); return; } hadMessage = true; } } // since we don't search startIndex at the beginning, only now we have searched everything if (index == startIndex) break; index = nextMessage(index); } qApp->beep(); QMessageBox::warning(m_findDialog, tr("Qt Linguist"), tr("Cannot find the string '%1'.").arg(m_findText)); } void MainWindow::showBatchTranslateDialog() { m_messageModel->blockSignals(true); m_batchTranslateDialog->setPhraseBooks(m_phraseBooks, m_currentIndex.model()); if (m_batchTranslateDialog->exec() != QDialog::Accepted) m_messageModel->blockSignals(false); // else signal finished() calls refreshItemViews() } void MainWindow::showTranslateDialog() { m_latestCaseSensitivity = -1; QModelIndex idx = m_messageView->currentIndex(); QModelIndex idx2 = m_sortedMessagesModel->index(idx.row(), m_currentIndex.model() + 1, idx.parent()); m_messageView->setCurrentIndex(idx2); QString fn = QFileInfo(m_dataModel->srcFileName(m_currentIndex.model())).baseName(); m_translateDialog->setWindowTitle(tr("Search And Translate in '%1' - Qt Linguist").arg(fn)); m_translateDialog->exec(); } void MainWindow::updateTranslateHit(bool &hit) { MessageItem *m; hit = (m = m_dataModel->messageItem(m_currentIndex)) && !m->isObsolete() && m->compare(m_translateDialog->findText(), false, m_translateDialog->caseSensitivity()); } void MainWindow::translate(int mode) { QString findText = m_translateDialog->findText(); QString replaceText = m_translateDialog->replaceText(); bool markFinished = m_translateDialog->markFinished(); Qt::CaseSensitivity caseSensitivity = m_translateDialog->caseSensitivity(); int translatedCount = 0; if (mode == TranslateDialog::TranslateAll) { for (MultiDataModelIterator it(m_dataModel, m_currentIndex.model()); it.isValid(); ++it) { MessageItem *m = it.current(); if (m && !m->isObsolete() && m->compare(findText, false, caseSensitivity)) { if (!translatedCount) m_messageModel->blockSignals(true); m_dataModel->setTranslation(it, replaceText); m_dataModel->setFinished(it, markFinished); ++translatedCount; } } if (translatedCount) { refreshItemViews(); QMessageBox::warning(m_translateDialog, tr("Translate - Qt Linguist"), tr("Translated %n entry(s)", 0, translatedCount)); } } else { if (mode == TranslateDialog::Translate) { m_dataModel->setTranslation(m_currentIndex, replaceText); m_dataModel->setFinished(m_currentIndex, markFinished); } if (findText != m_latestFindText || caseSensitivity != m_latestCaseSensitivity) { m_latestFindText = findText; m_latestCaseSensitivity = caseSensitivity; m_remainingCount = m_dataModel->messageCount(); m_hitCount = 0; } QModelIndex index = m_messageView->currentIndex(); int prevRemained = m_remainingCount; forever { if (--m_remainingCount <= 0) { if (!m_hitCount) break; m_remainingCount = m_dataModel->messageCount() - 1; if (QMessageBox::question(m_translateDialog, tr("Translate - Qt Linguist"), tr("No more occurrences of '%1'. Start over?").arg(findText), QMessageBox::Yes|QMessageBox::No) != QMessageBox::Yes) return; m_remainingCount -= prevRemained; } index = nextMessage(index); QModelIndex realIndex = m_sortedMessagesModel->mapToSource(index); MultiDataIndex dataIndex = m_messageModel->dataIndex(realIndex, m_currentIndex.model()); if (MessageItem *m = m_dataModel->messageItem(dataIndex)) { if (!m->isObsolete() && m->compare(findText, false, caseSensitivity)) { setCurrentMessage(realIndex, m_currentIndex.model()); ++translatedCount; ++m_hitCount; break; } } } } if (!translatedCount) { qApp->beep(); QMessageBox::warning(m_translateDialog, tr("Translate - Qt Linguist"), tr("Cannot find the string '%1'.").arg(findText)); } } void MainWindow::newPhraseBook() { QString name = QFileDialog::getSaveFileName(this, tr("Create New Phrase Book"), m_phraseBookDir, tr("Qt phrase books (*.qph)\nAll files (*)")); if (!name.isEmpty()) { PhraseBook pb; if (!m_translationSettingsDialog) m_translationSettingsDialog = new TranslationSettingsDialog(this); m_translationSettingsDialog->setPhraseBook(&pb); if (!m_translationSettingsDialog->exec()) return; m_phraseBookDir = QFileInfo(name).absolutePath(); if (savePhraseBook(&name, pb)) { if (openPhraseBook(name)) statusBar()->showMessage(tr("Phrase book created."), MessageMS); } } } bool MainWindow::isPhraseBookOpen(const QString &name) { foreach(const PhraseBook *pb, m_phraseBooks) { if (pb->fileName() == name) return true; } return false; } void MainWindow::openPhraseBook() { QString name = QFileDialog::getOpenFileName(this, tr("Open Phrase Book"), m_phraseBookDir, tr("Qt phrase books (*.qph);;All files (*)")); if (!name.isEmpty()) { m_phraseBookDir = QFileInfo(name).absolutePath(); if (!isPhraseBookOpen(name)) { if (PhraseBook *phraseBook = openPhraseBook(name)) { int n = phraseBook->phrases().count(); statusBar()->showMessage(tr("%n phrase(s) loaded.", 0, n), MessageMS); } } } } void MainWindow::closePhraseBook(QAction *action) { PhraseBook *pb = m_phraseBookMenu[PhraseCloseMenu].value(action); if (!maybeSavePhraseBook(pb)) return; m_phraseBookMenu[PhraseCloseMenu].remove(action); m_ui.menuClosePhraseBook->removeAction(action); QAction *act = m_phraseBookMenu[PhraseEditMenu].key(pb); m_phraseBookMenu[PhraseEditMenu].remove(act); m_ui.menuEditPhraseBook->removeAction(act); act = m_phraseBookMenu[PhrasePrintMenu].key(pb); m_ui.menuPrintPhraseBook->removeAction(act); m_phraseBooks.removeOne(pb); disconnect(pb, SIGNAL(listChanged()), this, SLOT(updatePhraseDicts())); updatePhraseDicts(); delete pb; updatePhraseBookActions(); } void MainWindow::editPhraseBook(QAction *action) { PhraseBook *pb = m_phraseBookMenu[PhraseEditMenu].value(action); PhraseBookBox box(pb, this); box.exec(); updatePhraseDicts(); } void MainWindow::printPhraseBook(QAction *action) { PhraseBook *phraseBook = m_phraseBookMenu[PhrasePrintMenu].value(action); int pageNum = 0; QPrintDialog dlg(printer(), this); if (dlg.exec()) { printer()->setDocName(phraseBook->fileName()); statusBar()->showMessage(tr("Printing...")); PrintOut pout(printer()); pout.setRule(PrintOut::ThinRule); foreach (const Phrase *p, phraseBook->phrases()) { pout.setGuide(p->source()); pout.addBox(29, p->source()); pout.addBox(4); pout.addBox(29, p->target()); pout.addBox(4); pout.addBox(34, p->definition(), PrintOut::Emphasis); if (pout.pageNum() != pageNum) { pageNum = pout.pageNum(); statusBar()->showMessage(tr("Printing... (page %1)") .arg(pageNum)); } pout.setRule(PrintOut::NoRule); pout.flushLine(true); } pout.flushLine(true); statusBar()->showMessage(tr("Printing completed"), MessageMS); } else { statusBar()->showMessage(tr("Printing aborted"), MessageMS); } } void MainWindow::addToPhraseBook() { MessageItem *currentMessage = m_dataModel->messageItem(m_currentIndex); Phrase *phrase = new Phrase(currentMessage->text(), currentMessage->translation(), QString()); QStringList phraseBookList; QHash<QString, PhraseBook *> phraseBookHash; foreach (PhraseBook *pb, m_phraseBooks) { if (pb->language() != QLocale::C && m_dataModel->language(m_currentIndex.model()) != QLocale::C) { if (pb->language() != m_dataModel->language(m_currentIndex.model())) continue; if (pb->country() == m_dataModel->model(m_currentIndex.model())->country()) phraseBookList.prepend(pb->friendlyPhraseBookName()); else phraseBookList.append(pb->friendlyPhraseBookName()); } else { phraseBookList.append(pb->friendlyPhraseBookName()); } phraseBookHash.insert(pb->friendlyPhraseBookName(), pb); } if (phraseBookList.isEmpty()) { QMessageBox::warning(this, tr("Add to phrase book"), tr("No appropriate phrasebook found.")); } else if (phraseBookList.size() == 1) { if (QMessageBox::information(this, tr("Add to phrase book"), tr("Adding entry to phrasebook %1").arg(phraseBookList.at(0)), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok) == QMessageBox::Ok) phraseBookHash.value(phraseBookList.at(0))->append(phrase); } else { bool okPressed = false; QString selection = QInputDialog::getItem(this, tr("Add to phrase book"), tr("Select phrase book to add to"), phraseBookList, 0, false, &okPressed); if (okPressed) phraseBookHash.value(selection)->append(phrase); } } void MainWindow::resetSorting() { m_contextView->sortByColumn(-1, Qt::AscendingOrder); m_messageView->sortByColumn(-1, Qt::AscendingOrder); } void MainWindow::manual() { if (!m_assistantProcess) m_assistantProcess = new QProcess(); if (m_assistantProcess->state() != QProcess::Running) { QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); #if !defined(Q_OS_MAC) app += QLatin1String("assistant"); #else app += QLatin1String("Assistant.app/Contents/MacOS/Assistant"); #endif m_assistantProcess->start(app, QStringList() << QLatin1String("-enableRemoteControl")); if (!m_assistantProcess->waitForStarted()) { QMessageBox::critical(this, tr("Qt Linguist"), tr("Unable to launch Qt Assistant (%1)").arg(app)); return; } } QTextStream str(m_assistantProcess); str << QLatin1String("SetSource qthelp://org.qt-project.linguist.") << (QT_VERSION >> 16) << ((QT_VERSION >> 8) & 0xFF) << (QT_VERSION & 0xFF) << QLatin1String("/qtlinguist/qtlinguist-index.html") << QLatin1Char('\n') << endl; } void MainWindow::about() { QMessageBox box(this); box.setTextFormat(Qt::RichText); QString version = tr("Version %1"); version = version.arg(QLatin1String(QT_VERSION_STR)); box.setText(tr("<center><img src=\":/images/splash.png\"/></img><p>%1</p></center>" "<p>Qt Linguist is a tool for adding translations to Qt " "applications.</p>" "<p>Copyright (C) %2 The Qt Company Ltd." ).arg(version, QStringLiteral("2018"))); box.setWindowTitle(QApplication::translate("AboutDialog", "Qt Linguist")); box.setIcon(QMessageBox::NoIcon); box.exec(); } void MainWindow::aboutQt() { QMessageBox::aboutQt(this, tr("Qt Linguist")); } void MainWindow::setupPhrase() { bool enabled = !m_phraseBooks.isEmpty(); m_ui.menuClosePhraseBook->setEnabled(enabled); m_ui.menuEditPhraseBook->setEnabled(enabled); m_ui.menuPrintPhraseBook->setEnabled(enabled); } void MainWindow::closeEvent(QCloseEvent *e) { if (maybeSaveAll() && maybeSavePhraseBooks()) e->accept(); else e->ignore(); } bool MainWindow::maybeSaveAll() { if (!m_dataModel->isModified()) return true; switch (QMessageBox::information(this, tr("Qt Linguist"), tr("Do you want to save the modified files?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape)) { case QMessageBox::Cancel: return false; case QMessageBox::Yes: saveAll(); return !m_dataModel->isModified(); case QMessageBox::No: break; } return true; } bool MainWindow::maybeSave(int model) { if (!m_dataModel->isModified(model)) return true; switch (QMessageBox::information(this, tr("Qt Linguist"), tr("Do you want to save '%1'?").arg(m_dataModel->srcFileName(model, true)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape)) { case QMessageBox::Cancel: return false; case QMessageBox::Yes: saveInternal(model); return !m_dataModel->isModified(model); case QMessageBox::No: break; } return true; } void MainWindow::updateCaption() { QString cap; bool enable = false; bool enableRw = false; for (int i = 0; i < m_dataModel->modelCount(); ++i) { enable = true; if (m_dataModel->isModelWritable(i)) { enableRw = true; break; } } m_ui.actionSaveAll->setEnabled(enableRw); m_ui.actionReleaseAll->setEnabled(enableRw); m_ui.actionCloseAll->setEnabled(enable); m_ui.actionPrint->setEnabled(enable); m_ui.actionAccelerators->setEnabled(enable); m_ui.actionSurroundingWhitespace->setEnabled(enable); m_ui.actionEndingPunctuation->setEnabled(enable); m_ui.actionPhraseMatches->setEnabled(enable); m_ui.actionPlaceMarkerMatches->setEnabled(enable); m_ui.actionResetSorting->setEnabled(enable); updateActiveModel(m_messageEditor->activeModel()); // Ensure that the action labels get updated m_fileActiveModel = m_editActiveModel = -2; if (!enable) cap = tr("Qt Linguist[*]"); else cap = tr("%1[*] - Qt Linguist").arg(m_dataModel->condensedSrcFileNames(true)); setWindowTitle(cap); } void MainWindow::selectedContextChanged(const QModelIndex &sortedIndex, const QModelIndex &oldIndex) { if (sortedIndex.isValid()) { if (m_settingCurrentMessage) return; // Avoid playing ping-pong with the current message QModelIndex sourceIndex = m_sortedContextsModel->mapToSource(sortedIndex); if (m_messageModel->parent(currentMessageIndex()).row() == sourceIndex.row()) return; QModelIndex contextIndex = setMessageViewRoot(sourceIndex); const QModelIndex &firstChild = m_sortedMessagesModel->index(0, sourceIndex.column(), contextIndex); m_messageView->setCurrentIndex(firstChild); } else if (oldIndex.isValid()) { m_contextView->setCurrentIndex(oldIndex); } } /* * Updates the message displayed in the message editor and related actions. */ void MainWindow::selectedMessageChanged(const QModelIndex &sortedIndex, const QModelIndex &oldIndex) { // Keep a valid selection whenever possible if (!sortedIndex.isValid() && oldIndex.isValid()) { m_messageView->setCurrentIndex(oldIndex); return; } int model = -1; MessageItem *m = 0; QModelIndex index = m_sortedMessagesModel->mapToSource(sortedIndex); if (index.isValid()) { model = (index.column() && (index.column() - 1 < m_dataModel->modelCount())) ? index.column() - 1 : m_currentIndex.model(); m_currentIndex = m_messageModel->dataIndex(index, model); m_messageEditor->showMessage(m_currentIndex); if (model >= 0 && (m = m_dataModel->messageItem(m_currentIndex))) { if (m_dataModel->isModelWritable(model) && !m->isObsolete()) m_phraseView->setSourceText(m_currentIndex.model(), m->text()); else m_phraseView->setSourceText(-1, QString()); } else { if (model < 0) { model = m_dataModel->multiContextItem(m_currentIndex.context()) ->firstNonobsoleteMessageIndex(m_currentIndex.message()); if (model >= 0) m = m_dataModel->messageItem(m_currentIndex, model); } m_phraseView->setSourceText(-1, QString()); } m_errorsView->setEnabled(m != 0); updateDanger(m_currentIndex, true); } else { m_currentIndex = MultiDataIndex(); m_messageEditor->showNothing(); m_phraseView->setSourceText(-1, QString()); } updateSourceView(model, m); updatePhraseBookActions(); m_ui.actionSelectAll->setEnabled(index.isValid()); } void MainWindow::translationChanged(const MultiDataIndex &index) { // We get that as a result of batch translation or search & translate, // so the current model is known to match. if (index != m_currentIndex) return; m_messageEditor->showMessage(index); updateDanger(index, true); MessageItem *m = m_dataModel->messageItem(index); if (hasFormPreview(m->fileName())) m_formPreviewView->setSourceContext(index.model(), m); } // This and the following function operate directly on the messageitem, // so the model does not emit modification notifications. void MainWindow::updateTranslation(const QStringList &translations) { MessageItem *m = m_dataModel->messageItem(m_currentIndex); if (!m) return; if (translations == m->translations()) return; m->setTranslations(translations); if (!m->fileName().isEmpty() && hasFormPreview(m->fileName())) m_formPreviewView->setSourceContext(m_currentIndex.model(), m); updateDanger(m_currentIndex, true); if (m->isFinished()) m_dataModel->setFinished(m_currentIndex, false); else m_dataModel->setModified(m_currentIndex.model(), true); } void MainWindow::updateTranslatorComment(const QString &comment) { MessageItem *m = m_dataModel->messageItem(m_currentIndex); if (!m) return; if (comment == m->translatorComment()) return; m->setTranslatorComment(comment); m_dataModel->setModified(m_currentIndex.model(), true); } void MainWindow::refreshItemViews() { m_messageModel->blockSignals(false); m_contextView->update(); m_messageView->update(); setWindowModified(m_dataModel->isModified()); m_modifiedLabel->setVisible(m_dataModel->isModified()); updateStatistics(); } void MainWindow::doneAndNext() { int model = m_messageEditor->activeModel(); if (model >= 0 && m_dataModel->isModelWritable(model)) m_dataModel->setFinished(m_currentIndex, true); if (!m_messageEditor->focusNextUnfinished()) nextUnfinished(); } void MainWindow::toggleFinished(const QModelIndex &index) { if (!index.isValid() || index.column() - 1 >= m_dataModel->modelCount() || !m_dataModel->isModelWritable(index.column() - 1) || index.parent() == QModelIndex()) return; QModelIndex item = m_sortedMessagesModel->mapToSource(index); MultiDataIndex dataIndex = m_messageModel->dataIndex(item); MessageItem *m = m_dataModel->messageItem(dataIndex); if (!m || m->message().type() == TranslatorMessage::Obsolete || m->message().type() == TranslatorMessage::Vanished) return; m_dataModel->setFinished(dataIndex, !m->isFinished()); } /* * Receives a context index in the sorted messages model and returns the next * logical context index in the same model, based on the sort order of the * contexts in the sorted contexts model. */ QModelIndex MainWindow::nextContext(const QModelIndex &index) const { QModelIndex sortedContextIndex = m_sortedContextsModel->mapFromSource( m_sortedMessagesModel->mapToSource(index)); int nextRow = sortedContextIndex.row() + 1; if (nextRow >= m_sortedContextsModel->rowCount()) nextRow = 0; sortedContextIndex = m_sortedContextsModel->index(nextRow, index.column()); return m_sortedMessagesModel->mapFromSource( m_sortedContextsModel->mapToSource(sortedContextIndex)); } /* * See nextContext. */ QModelIndex MainWindow::prevContext(const QModelIndex &index) const { QModelIndex sortedContextIndex = m_sortedContextsModel->mapFromSource( m_sortedMessagesModel->mapToSource(index)); int prevRow = sortedContextIndex.row() - 1; if (prevRow < 0) prevRow = m_sortedContextsModel->rowCount() - 1; sortedContextIndex = m_sortedContextsModel->index(prevRow, index.column()); return m_sortedMessagesModel->mapFromSource( m_sortedContextsModel->mapToSource(sortedContextIndex)); } QModelIndex MainWindow::nextMessage(const QModelIndex &currentIndex, bool checkUnfinished) const { QModelIndex idx = currentIndex.isValid() ? currentIndex : m_sortedMessagesModel->index(0, 0); do { int row = 0; QModelIndex par = idx.parent(); if (par.isValid()) { row = idx.row() + 1; } else { // In case we are located on a top-level node par = idx; } if (row >= m_sortedMessagesModel->rowCount(par)) { par = nextContext(par); row = 0; } idx = m_sortedMessagesModel->index(row, idx.column(), par); if (!checkUnfinished) return idx; QModelIndex item = m_sortedMessagesModel->mapToSource(idx); MultiDataIndex index = m_messageModel->dataIndex(item, -1); if (m_dataModel->multiMessageItem(index)->isUnfinished()) return idx; } while (idx != currentIndex); return QModelIndex(); } QModelIndex MainWindow::prevMessage(const QModelIndex &currentIndex, bool checkUnfinished) const { QModelIndex idx = currentIndex.isValid() ? currentIndex : m_sortedMessagesModel->index(0, 0); do { int row = idx.row() - 1; QModelIndex par = idx.parent(); if (!par.isValid()) { // In case we are located on a top-level node par = idx; row = -1; } if (row < 0) { par = prevContext(par); row = m_sortedMessagesModel->rowCount(par) - 1; } idx = m_sortedMessagesModel->index(row, idx.column(), par); if (!checkUnfinished) return idx; QModelIndex item = m_sortedMessagesModel->mapToSource(idx); MultiDataIndex index = m_messageModel->dataIndex(item, -1); if (m_dataModel->multiMessageItem(index)->isUnfinished()) return idx; } while (idx != currentIndex); return QModelIndex(); } void MainWindow::nextUnfinished() { if (m_ui.actionNextUnfinished->isEnabled()) { if (!next(true)) { // If no Unfinished message is left, the user has finished the job. We // congratulate on a job well done with this ringing bell. statusBar()->showMessage(tr("No untranslated translation units left."), MessageMS); qApp->beep(); } } } void MainWindow::prevUnfinished() { if (m_ui.actionNextUnfinished->isEnabled()) { if (!prev(true)) { // If no Unfinished message is left, the user has finished the job. We // congratulate on a job well done with this ringing bell. statusBar()->showMessage(tr("No untranslated translation units left."), MessageMS); qApp->beep(); } } } void MainWindow::prev() { prev(false); } void MainWindow::next() { next(false); } bool MainWindow::prev(bool checkUnfinished) { QModelIndex index = prevMessage(m_messageView->currentIndex(), checkUnfinished); if (index.isValid()) setCurrentMessage(m_sortedMessagesModel->mapToSource(index)); if (checkUnfinished) m_messageEditor->setUnfinishedEditorFocus(); else m_messageEditor->setEditorFocus(); return index.isValid(); } bool MainWindow::next(bool checkUnfinished) { QModelIndex index = nextMessage(m_messageView->currentIndex(), checkUnfinished); if (index.isValid()) setCurrentMessage(m_sortedMessagesModel->mapToSource(index)); if (checkUnfinished) m_messageEditor->setUnfinishedEditorFocus(); else m_messageEditor->setEditorFocus(); return index.isValid(); } void MainWindow::findNext(const QString &text, DataModel::FindLocation where, bool matchCase, bool ignoreAccelerators, bool skipObsolete) { if (text.isEmpty()) return; m_findText = text; m_findWhere = where; m_findMatchCase = matchCase ? Qt::CaseSensitive : Qt::CaseInsensitive; m_findIgnoreAccelerators = ignoreAccelerators; m_findSkipObsolete = skipObsolete; m_ui.actionFindNext->setEnabled(true); findAgain(); } void MainWindow::revalidate() { for (MultiDataModelIterator it(m_dataModel, -1); it.isValid(); ++it) updateDanger(it, false); if (m_currentIndex.isValid()) updateDanger(m_currentIndex, true); } QString MainWindow::friendlyString(const QString& str) { QString f = str.toLower(); f.replace(QRegExp(QString(QLatin1String("[.,:;!?()-]"))), QString(QLatin1String(" "))); f.remove(QLatin1Char('&')); return f.simplified(); } void MainWindow::setupMenuBar() { const bool hasThemeIcons = !QApplication::platformName().compare(QStringLiteral("xcb"), Qt::CaseInsensitive); if (hasThemeIcons) { // There are no fallback icons for these m_ui.menuRecentlyOpenedFiles->setIcon(QIcon::fromTheme(QStringLiteral("document-open-recent"))); m_ui.actionCloseAll->setIcon(QIcon::fromTheme(QStringLiteral("window-close"))); m_ui.actionExit->setIcon(QIcon::fromTheme(QStringLiteral("application-exit"))); m_ui.actionSelectAll->setIcon(QIcon::fromTheme(QStringLiteral("edit-select-all"))); } // Prefer theme icons when available for these actions const QString prefix = QApplication::platformName().compare(QStringLiteral("cocoa"), Qt::CaseInsensitive) ? QStringLiteral(":/images/win") : QStringLiteral(":/images/mac"); m_ui.actionOpen->setIcon(QIcon::fromTheme(QStringLiteral("document-open"), QIcon(prefix + QStringLiteral("/fileopen.png")))); m_ui.actionOpenAux->setIcon(QIcon::fromTheme(QStringLiteral("document-open"), QIcon(prefix + QStringLiteral("/fileopen.png")))); m_ui.actionSave->setIcon(QIcon::fromTheme(QStringLiteral("document-save"), QIcon(prefix + QStringLiteral("/filesave.png")))); m_ui.actionSaveAll->setIcon(QIcon::fromTheme(QStringLiteral("document-save"), QIcon(prefix + QStringLiteral("/filesave.png")))); m_ui.actionPrint->setIcon(QIcon::fromTheme(QStringLiteral("document-print"), QIcon(prefix + QStringLiteral("/print.png")))); m_ui.actionRedo->setIcon(QIcon::fromTheme(QStringLiteral("edit-redo"), QIcon(prefix + QStringLiteral("/redo.png")))); m_ui.actionUndo->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo"), QIcon(prefix + QStringLiteral("/undo.png")))); m_ui.actionCut->setIcon(QIcon::fromTheme(QStringLiteral("edit-cut"), QIcon(prefix + QStringLiteral("/editcut.png")))); m_ui.actionCopy->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy"), QIcon(prefix + QStringLiteral("/editcopy.png")))); m_ui.actionPaste->setIcon(QIcon::fromTheme(QStringLiteral("edit-paste"), QIcon(prefix + QStringLiteral("/editpaste.png")))); m_ui.actionFind->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"), QIcon(prefix + QStringLiteral("/searchfind.png")))); // No well defined theme icons for these actions m_ui.actionAccelerators->setIcon(QIcon(prefix + QStringLiteral("/accelerator.png"))); m_ui.actionOpenPhraseBook->setIcon(QIcon(prefix + QStringLiteral("/book.png"))); m_ui.actionDoneAndNext->setIcon(QIcon(prefix + QStringLiteral("/doneandnext.png"))); m_ui.actionNext->setIcon(QIcon(prefix + QStringLiteral("/next.png"))); m_ui.actionNextUnfinished->setIcon(QIcon(prefix + QStringLiteral("/nextunfinished.png"))); m_ui.actionPhraseMatches->setIcon(QIcon(prefix + QStringLiteral("/phrase.png"))); m_ui.actionSurroundingWhitespace->setIcon(QIcon(prefix + QStringLiteral("/surroundingwhitespace.png"))); m_ui.actionEndingPunctuation->setIcon(QIcon(prefix + QStringLiteral("/punctuation.png"))); m_ui.actionPrev->setIcon(QIcon(prefix + QStringLiteral("/prev.png"))); m_ui.actionPrevUnfinished->setIcon(QIcon(prefix + QStringLiteral("/prevunfinished.png"))); m_ui.actionPlaceMarkerMatches->setIcon(QIcon(prefix + QStringLiteral("/validateplacemarkers.png"))); m_ui.actionWhatsThis->setIcon(QIcon(prefix + QStringLiteral("/whatsthis.png"))); // File menu connect(m_ui.menuFile, SIGNAL(aboutToShow()), SLOT(fileAboutToShow())); connect(m_ui.actionOpen, SIGNAL(triggered()), this, SLOT(open())); connect(m_ui.actionOpenAux, SIGNAL(triggered()), this, SLOT(openAux())); connect(m_ui.actionSaveAll, SIGNAL(triggered()), this, SLOT(saveAll())); connect(m_ui.actionSave, SIGNAL(triggered()), this, SLOT(save())); connect(m_ui.actionSaveAs, SIGNAL(triggered()), this, SLOT(saveAs())); connect(m_ui.actionReleaseAll, SIGNAL(triggered()), this, SLOT(releaseAll())); connect(m_ui.actionRelease, SIGNAL(triggered()), this, SLOT(release())); connect(m_ui.actionReleaseAs, SIGNAL(triggered()), this, SLOT(releaseAs())); connect(m_ui.actionPrint, SIGNAL(triggered()), this, SLOT(print())); connect(m_ui.actionClose, SIGNAL(triggered()), this, SLOT(closeFile())); connect(m_ui.actionCloseAll, SIGNAL(triggered()), this, SLOT(closeAll())); connect(m_ui.actionExit, SIGNAL(triggered()), this, SLOT(close())); // Edit menu connect(m_ui.menuEdit, SIGNAL(aboutToShow()), SLOT(editAboutToShow())); connect(m_ui.actionUndo, SIGNAL(triggered()), m_messageEditor, SLOT(undo())); connect(m_messageEditor, SIGNAL(undoAvailable(bool)), m_ui.actionUndo, SLOT(setEnabled(bool))); connect(m_ui.actionRedo, SIGNAL(triggered()), m_messageEditor, SLOT(redo())); connect(m_messageEditor, SIGNAL(redoAvailable(bool)), m_ui.actionRedo, SLOT(setEnabled(bool))); connect(m_ui.actionCopy, SIGNAL(triggered()), m_messageEditor, SLOT(copy())); connect(m_messageEditor, SIGNAL(copyAvailable(bool)), m_ui.actionCopy, SLOT(setEnabled(bool))); connect(m_messageEditor, SIGNAL(cutAvailable(bool)), m_ui.actionCut, SLOT(setEnabled(bool))); connect(m_ui.actionCut, SIGNAL(triggered()), m_messageEditor, SLOT(cut())); connect(m_messageEditor, SIGNAL(pasteAvailable(bool)), m_ui.actionPaste, SLOT(setEnabled(bool))); connect(m_ui.actionPaste, SIGNAL(triggered()), m_messageEditor, SLOT(paste())); connect(m_ui.actionSelectAll, SIGNAL(triggered()), m_messageEditor, SLOT(selectAll())); connect(m_ui.actionFind, SIGNAL(triggered()), m_findDialog, SLOT(find())); connect(m_ui.actionFindNext, SIGNAL(triggered()), this, SLOT(findAgain())); connect(m_ui.actionSearchAndTranslate, SIGNAL(triggered()), this, SLOT(showTranslateDialog())); connect(m_ui.actionBatchTranslation, SIGNAL(triggered()), this, SLOT(showBatchTranslateDialog())); connect(m_ui.actionTranslationFileSettings, SIGNAL(triggered()), this, SLOT(showTranslationSettings())); connect(m_batchTranslateDialog, SIGNAL(finished()), SLOT(refreshItemViews())); // Translation menu // when updating the accelerators, remember the status bar connect(m_ui.actionPrevUnfinished, SIGNAL(triggered()), this, SLOT(prevUnfinished())); connect(m_ui.actionNextUnfinished, SIGNAL(triggered()), this, SLOT(nextUnfinished())); connect(m_ui.actionNext, SIGNAL(triggered()), this, SLOT(next())); connect(m_ui.actionPrev, SIGNAL(triggered()), this, SLOT(prev())); connect(m_ui.actionDoneAndNext, SIGNAL(triggered()), this, SLOT(doneAndNext())); connect(m_ui.actionBeginFromSource, SIGNAL(triggered()), m_messageEditor, SLOT(beginFromSource())); connect(m_messageEditor, SIGNAL(beginFromSourceAvailable(bool)), m_ui.actionBeginFromSource, SLOT(setEnabled(bool))); // Phrasebook menu connect(m_ui.actionNewPhraseBook, SIGNAL(triggered()), this, SLOT(newPhraseBook())); connect(m_ui.actionOpenPhraseBook, SIGNAL(triggered()), this, SLOT(openPhraseBook())); connect(m_ui.menuClosePhraseBook, SIGNAL(triggered(QAction*)), this, SLOT(closePhraseBook(QAction*))); connect(m_ui.menuEditPhraseBook, SIGNAL(triggered(QAction*)), this, SLOT(editPhraseBook(QAction*))); connect(m_ui.menuPrintPhraseBook, SIGNAL(triggered(QAction*)), this, SLOT(printPhraseBook(QAction*))); connect(m_ui.actionAddToPhraseBook, SIGNAL(triggered()), this, SLOT(addToPhraseBook())); // Validation menu connect(m_ui.actionAccelerators, SIGNAL(triggered()), this, SLOT(revalidate())); connect(m_ui.actionSurroundingWhitespace, SIGNAL(triggered()), this, SLOT(revalidate())); connect(m_ui.actionEndingPunctuation, SIGNAL(triggered()), this, SLOT(revalidate())); connect(m_ui.actionPhraseMatches, SIGNAL(triggered()), this, SLOT(revalidate())); connect(m_ui.actionPlaceMarkerMatches, SIGNAL(triggered()), this, SLOT(revalidate())); // View menu connect(m_ui.actionResetSorting, SIGNAL(triggered()), this, SLOT(resetSorting())); connect(m_ui.actionDisplayGuesses, SIGNAL(triggered()), m_phraseView, SLOT(toggleGuessing())); connect(m_ui.actionStatistics, SIGNAL(triggered()), this, SLOT(toggleStatistics())); connect(m_ui.actionVisualizeWhitespace, SIGNAL(triggered()), this, SLOT(toggleVisualizeWhitespace())); connect(m_ui.menuView, SIGNAL(aboutToShow()), this, SLOT(updateViewMenu())); connect(m_ui.actionIncreaseZoom, SIGNAL(triggered()), m_messageEditor, SLOT(increaseFontSize())); connect(m_ui.actionDecreaseZoom, SIGNAL(triggered()), m_messageEditor, SLOT(decreaseFontSize())); connect(m_ui.actionResetZoomToDefault, SIGNAL(triggered()), m_messageEditor, SLOT(resetFontSize())); m_ui.menuViewViews->addAction(m_contextDock->toggleViewAction()); m_ui.menuViewViews->addAction(m_messagesDock->toggleViewAction()); m_ui.menuViewViews->addAction(m_phrasesDock->toggleViewAction()); m_ui.menuViewViews->addAction(m_sourceAndFormDock->toggleViewAction()); m_ui.menuViewViews->addAction(m_errorsDock->toggleViewAction()); #if defined(Q_OS_MAC) // Window menu QMenu *windowMenu = new QMenu(tr("&Window"), this); menuBar()->insertMenu(m_ui.menuHelp->menuAction(), windowMenu); windowMenu->addAction(tr("Minimize"), this, SLOT(showMinimized()), QKeySequence(tr("Ctrl+M"))); #endif // Help connect(m_ui.actionManual, SIGNAL(triggered()), this, SLOT(manual())); connect(m_ui.actionAbout, SIGNAL(triggered()), this, SLOT(about())); connect(m_ui.actionAboutQt, SIGNAL(triggered()), this, SLOT(aboutQt())); connect(m_ui.actionWhatsThis, SIGNAL(triggered()), this, SLOT(onWhatsThis())); connect(m_ui.menuRecentlyOpenedFiles, SIGNAL(triggered(QAction*)), this, SLOT(recentFileActivated(QAction*))); m_ui.actionManual->setWhatsThis(tr("Display the manual for %1.").arg(tr("Qt Linguist"))); m_ui.actionAbout->setWhatsThis(tr("Display information about %1.").arg(tr("Qt Linguist"))); m_ui.actionDoneAndNext->setShortcuts(QList<QKeySequence>() << QKeySequence(QLatin1String("Ctrl+Return")) << QKeySequence(QLatin1String("Ctrl+Enter"))); // Disable the Close/Edit/Print phrasebook menuitems if they are not loaded connect(m_ui.menuPhrases, SIGNAL(aboutToShow()), this, SLOT(setupPhrase())); connect(m_ui.menuRecentlyOpenedFiles, SIGNAL(aboutToShow()), SLOT(setupRecentFilesMenu())); } void MainWindow::updateActiveModel(int model) { if (model >= 0) updateLatestModel(model); } // Arriving here implies that the messageEditor does not have focus void MainWindow::updateLatestModel(const QModelIndex &index) { if (index.column() && (index.column() - 1 < m_dataModel->modelCount())) updateLatestModel(index.column() - 1); } void MainWindow::updateLatestModel(int model) { m_currentIndex = MultiDataIndex(model, m_currentIndex.context(), m_currentIndex.message()); bool enable = false; bool enableRw = false; MessageItem *item = 0; if (model >= 0) { enable = true; if (m_dataModel->isModelWritable(model)) enableRw = true; if (m_currentIndex.isValid()) { if ((item = m_dataModel->messageItem(m_currentIndex))) { if (enableRw && !item->isObsolete()) m_phraseView->setSourceText(model, item->text()); else m_phraseView->setSourceText(-1, QString()); } else { m_phraseView->setSourceText(-1, QString()); } } } updateSourceView(model, item); m_ui.actionSave->setEnabled(enableRw); m_ui.actionSaveAs->setEnabled(enableRw); m_ui.actionRelease->setEnabled(enableRw); m_ui.actionReleaseAs->setEnabled(enableRw); m_ui.actionClose->setEnabled(enable); m_ui.actionTranslationFileSettings->setEnabled(enableRw); m_ui.actionSearchAndTranslate->setEnabled(enableRw); // cut & paste - edit only updatePhraseBookActions(); updateStatistics(); } void MainWindow::updateSourceView(int model, MessageItem *item) { if (item && !item->fileName().isEmpty()) { if (hasFormPreview(item->fileName())) { m_sourceAndFormView->setCurrentWidget(m_formPreviewView); m_formPreviewView->setSourceContext(model, item); } else { m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); QDir dir = QFileInfo(m_dataModel->srcFileName(model)).dir(); QString fileName = QDir::cleanPath(dir.absoluteFilePath(item->fileName())); m_sourceCodeView->setSourceContext(fileName, item->lineNumber()); } } else { m_sourceAndFormView->setCurrentWidget(m_sourceCodeView); m_sourceCodeView->setSourceContext(QString(), 0); } } // Note for *AboutToShow: Due to the delayed nature, only actions without shortcuts // and representations outside the menu may be setEnabled()/setVisible() here. void MainWindow::fileAboutToShow() { if (m_fileActiveModel != m_currentIndex.model()) { // We rename the actions so the shortcuts need not be reassigned. bool en; if (m_dataModel->modelCount() > 1) { if (m_currentIndex.model() >= 0) { QString fn = QFileInfo(m_dataModel->srcFileName(m_currentIndex.model())).baseName(); m_ui.actionSave->setText(tr("&Save '%1'").arg(fn)); m_ui.actionSaveAs->setText(tr("Save '%1' &As...").arg(fn)); m_ui.actionRelease->setText(tr("Release '%1'").arg(fn)); m_ui.actionReleaseAs->setText(tr("Release '%1' As...").arg(fn)); m_ui.actionClose->setText(tr("&Close '%1'").arg(fn)); } else { m_ui.actionSave->setText(tr("&Save")); m_ui.actionSaveAs->setText(tr("Save &As...")); m_ui.actionRelease->setText(tr("Release")); m_ui.actionReleaseAs->setText(tr("Release As...")); m_ui.actionClose->setText(tr("&Close")); } m_ui.actionSaveAll->setText(tr("Save All")); m_ui.actionReleaseAll->setText(tr("&Release All")); m_ui.actionCloseAll->setText(tr("Close All")); en = true; } else { m_ui.actionSaveAs->setText(tr("Save &As...")); m_ui.actionReleaseAs->setText(tr("Release As...")); m_ui.actionSaveAll->setText(tr("&Save")); m_ui.actionReleaseAll->setText(tr("&Release")); m_ui.actionCloseAll->setText(tr("&Close")); en = false; } m_ui.actionSave->setVisible(en); m_ui.actionRelease->setVisible(en); m_ui.actionClose->setVisible(en); m_fileActiveModel = m_currentIndex.model(); } } void MainWindow::editAboutToShow() { if (m_editActiveModel != m_currentIndex.model()) { if (m_currentIndex.model() >= 0 && m_dataModel->modelCount() > 1) { QString fn = QFileInfo(m_dataModel->srcFileName(m_currentIndex.model())).baseName(); m_ui.actionTranslationFileSettings->setText(tr("Translation File &Settings for '%1'...").arg(fn)); m_ui.actionBatchTranslation->setText(tr("&Batch Translation of '%1'...").arg(fn)); m_ui.actionSearchAndTranslate->setText(tr("Search And &Translate in '%1'...").arg(fn)); } else { m_ui.actionTranslationFileSettings->setText(tr("Translation File &Settings...")); m_ui.actionBatchTranslation->setText(tr("&Batch Translation...")); m_ui.actionSearchAndTranslate->setText(tr("Search And &Translate...")); } m_editActiveModel = m_currentIndex.model(); } } void MainWindow::updateViewMenu() { bool check = m_statistics ? m_statistics->isVisible() : false; m_ui.actionStatistics->setChecked(check); } void MainWindow::showContextDock() { m_contextDock->show(); m_contextDock->raise(); } void MainWindow::showMessagesDock() { m_messagesDock->show(); m_messagesDock->raise(); } void MainWindow::showPhrasesDock() { m_phrasesDock->show(); m_phrasesDock->raise(); } void MainWindow::showSourceCodeDock() { m_sourceAndFormDock->show(); m_sourceAndFormDock->raise(); } void MainWindow::showErrorDock() { m_errorsDock->show(); m_errorsDock->raise(); } void MainWindow::onWhatsThis() { QWhatsThis::enterWhatsThisMode(); } void MainWindow::setupToolBars() { QToolBar *filet = new QToolBar(this); filet->setObjectName(QLatin1String("FileToolbar")); filet->setWindowTitle(tr("File")); this->addToolBar(filet); m_ui.menuToolbars->addAction(filet->toggleViewAction()); QToolBar *editt = new QToolBar(this); editt->setVisible(false); editt->setObjectName(QLatin1String("EditToolbar")); editt->setWindowTitle(tr("Edit")); this->addToolBar(editt); m_ui.menuToolbars->addAction(editt->toggleViewAction()); QToolBar *translationst = new QToolBar(this); translationst->setObjectName(QLatin1String("TranslationToolbar")); translationst->setWindowTitle(tr("Translation")); this->addToolBar(translationst); m_ui.menuToolbars->addAction(translationst->toggleViewAction()); QToolBar *validationt = new QToolBar(this); validationt->setObjectName(QLatin1String("ValidationToolbar")); validationt->setWindowTitle(tr("Validation")); this->addToolBar(validationt); m_ui.menuToolbars->addAction(validationt->toggleViewAction()); QToolBar *helpt = new QToolBar(this); helpt->setVisible(false); helpt->setObjectName(QLatin1String("HelpToolbar")); helpt->setWindowTitle(tr("Help")); this->addToolBar(helpt); m_ui.menuToolbars->addAction(helpt->toggleViewAction()); filet->addAction(m_ui.actionOpen); filet->addAction(m_ui.actionSaveAll); filet->addAction(m_ui.actionPrint); filet->addSeparator(); filet->addAction(m_ui.actionOpenPhraseBook); editt->addAction(m_ui.actionUndo); editt->addAction(m_ui.actionRedo); editt->addSeparator(); editt->addAction(m_ui.actionCut); editt->addAction(m_ui.actionCopy); editt->addAction(m_ui.actionPaste); editt->addSeparator(); editt->addAction(m_ui.actionFind); translationst->addAction(m_ui.actionPrev); translationst->addAction(m_ui.actionNext); translationst->addAction(m_ui.actionPrevUnfinished); translationst->addAction(m_ui.actionNextUnfinished); translationst->addAction(m_ui.actionDoneAndNext); validationt->addAction(m_ui.actionAccelerators); validationt->addAction(m_ui.actionSurroundingWhitespace); validationt->addAction(m_ui.actionEndingPunctuation); validationt->addAction(m_ui.actionPhraseMatches); validationt->addAction(m_ui.actionPlaceMarkerMatches); helpt->addAction(m_ui.actionWhatsThis); } QModelIndex MainWindow::setMessageViewRoot(const QModelIndex &index) { const QModelIndex &sortedContextIndex = m_sortedMessagesModel->mapFromSource(index); const QModelIndex &trueContextIndex = m_sortedMessagesModel->index(sortedContextIndex.row(), 0); if (m_messageView->rootIndex() != trueContextIndex) m_messageView->setRootIndex(trueContextIndex); return trueContextIndex; } /* * Updates the selected entries in the context and message views. */ void MainWindow::setCurrentMessage(const QModelIndex &index) { const QModelIndex &contextIndex = m_messageModel->parent(index); if (!contextIndex.isValid()) return; const QModelIndex &trueIndex = m_messageModel->index(contextIndex.row(), index.column(), QModelIndex()); m_settingCurrentMessage = true; m_contextView->setCurrentIndex(m_sortedContextsModel->mapFromSource(trueIndex)); m_settingCurrentMessage = false; setMessageViewRoot(contextIndex); m_messageView->setCurrentIndex(m_sortedMessagesModel->mapFromSource(index)); } void MainWindow::setCurrentMessage(const QModelIndex &index, int model) { const QModelIndex &theIndex = m_messageModel->index(index.row(), model + 1, index.parent()); setCurrentMessage(theIndex); m_messageEditor->setEditorFocus(model); } QModelIndex MainWindow::currentContextIndex() const { return m_sortedContextsModel->mapToSource(m_contextView->currentIndex()); } QModelIndex MainWindow::currentMessageIndex() const { return m_sortedMessagesModel->mapToSource(m_messageView->currentIndex()); } PhraseBook *MainWindow::openPhraseBook(const QString& name) { PhraseBook *pb = new PhraseBook(); bool langGuessed; if (!pb->load(name, &langGuessed)) { QMessageBox::warning(this, tr("Qt Linguist"), tr("Cannot read from phrase book '%1'.").arg(name)); delete pb; return 0; } if (langGuessed) { if (!m_translationSettingsDialog) m_translationSettingsDialog = new TranslationSettingsDialog(this); m_translationSettingsDialog->setPhraseBook(pb); m_translationSettingsDialog->exec(); } m_phraseBooks.append(pb); QAction *a = m_ui.menuClosePhraseBook->addAction(pb->friendlyPhraseBookName()); m_phraseBookMenu[PhraseCloseMenu].insert(a, pb); a->setWhatsThis(tr("Close this phrase book.")); a = m_ui.menuEditPhraseBook->addAction(pb->friendlyPhraseBookName()); m_phraseBookMenu[PhraseEditMenu].insert(a, pb); a->setWhatsThis(tr("Enables you to add, modify, or delete" " entries in this phrase book.")); a = m_ui.menuPrintPhraseBook->addAction(pb->friendlyPhraseBookName()); m_phraseBookMenu[PhrasePrintMenu].insert(a, pb); a->setWhatsThis(tr("Print the entries in this phrase book.")); connect(pb, SIGNAL(listChanged()), this, SLOT(updatePhraseDicts())); updatePhraseDicts(); updatePhraseBookActions(); return pb; } bool MainWindow::savePhraseBook(QString *name, PhraseBook &pb) { if (!name->contains(QLatin1Char('.'))) *name += QLatin1String(".qph"); if (!pb.save(*name)) { QMessageBox::warning(this, tr("Qt Linguist"), tr("Cannot create phrase book '%1'.").arg(*name)); return false; } return true; } bool MainWindow::maybeSavePhraseBook(PhraseBook *pb) { if (pb->isModified()) switch (QMessageBox::information(this, tr("Qt Linguist"), tr("Do you want to save phrase book '%1'?").arg(pb->friendlyPhraseBookName()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape)) { case QMessageBox::Cancel: return false; case QMessageBox::Yes: if (!pb->save(pb->fileName())) return false; break; case QMessageBox::No: break; } return true; } bool MainWindow::maybeSavePhraseBooks() { foreach(PhraseBook *phraseBook, m_phraseBooks) if (!maybeSavePhraseBook(phraseBook)) return false; return true; } void MainWindow::updateProgress() { int numEditable = m_dataModel->getNumEditable(); int numFinished = m_dataModel->getNumFinished(); if (!m_dataModel->modelCount()) m_progressLabel->setText(QString(QLatin1String(" "))); else m_progressLabel->setText(QString(QLatin1String(" %1/%2 ")) .arg(numFinished).arg(numEditable)); bool enable = numFinished != numEditable; m_ui.actionPrevUnfinished->setEnabled(enable); m_ui.actionNextUnfinished->setEnabled(enable); m_ui.actionDoneAndNext->setEnabled(enable); m_ui.actionPrev->setEnabled(m_dataModel->contextCount() > 0); m_ui.actionNext->setEnabled(m_dataModel->contextCount() > 0); } void MainWindow::updatePhraseBookActions() { bool phraseBookLoaded = (m_currentIndex.model() >= 0) && !m_phraseBooks.isEmpty(); m_ui.actionBatchTranslation->setEnabled(m_dataModel->contextCount() > 0 && phraseBookLoaded && m_dataModel->isModelWritable(m_currentIndex.model())); m_ui.actionAddToPhraseBook->setEnabled(currentMessageIndex().isValid() && phraseBookLoaded); } void MainWindow::updatePhraseDictInternal(int model) { QHash<QString, QList<Phrase *> > &pd = m_phraseDict[model]; pd.clear(); foreach (PhraseBook *pb, m_phraseBooks) { bool before; if (pb->language() != QLocale::C && m_dataModel->language(model) != QLocale::C) { if (pb->language() != m_dataModel->language(model)) continue; before = (pb->country() == m_dataModel->model(model)->country()); } else { before = false; } foreach (Phrase *p, pb->phrases()) { QString f = friendlyString(p->source()); if (f.length() > 0) { f = f.split(QLatin1Char(' ')).first(); if (!pd.contains(f)) { pd.insert(f, QList<Phrase *>()); } if (before) pd[f].prepend(p); else pd[f].append(p); } } } } void MainWindow::updatePhraseDict(int model) { updatePhraseDictInternal(model); m_phraseView->update(); } void MainWindow::updatePhraseDicts() { for (int i = 0; i < m_phraseDict.size(); ++i) if (!m_dataModel->isModelWritable(i)) m_phraseDict[i].clear(); else updatePhraseDictInternal(i); revalidate(); m_phraseView->update(); } static bool haveMnemonic(const QString &str) { for (const ushort *p = (ushort *)str.constData();; ) { // Assume null-termination ushort c = *p++; if (!c) break; if (c == '&') { c = *p++; if (!c) return false; // "Nobody" ever really uses these alt-space, and they are highly annoying // because we get a lot of false positives. if (c != '&' && c != ' ' && QChar(c).isPrint()) { const ushort *pp = p; for (; *p < 256 && isalpha(*p); p++) ; if (pp == p || *p != ';') return true; // This looks like a HTML &entity;, so ignore it. As a HTML string // won't contain accels anyway, we can stop scanning here. break; } } } return false; } void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose) { MultiDataIndex curIdx = index; m_errorsView->clear(); QString source; for (int mi = 0; mi < m_dataModel->modelCount(); ++mi) { if (!m_dataModel->isModelWritable(mi)) continue; curIdx.setModel(mi); MessageItem *m = m_dataModel->messageItem(curIdx); if (!m || m->isObsolete()) continue; bool danger = false; if (m->message().isTranslated()) { if (source.isEmpty()) { source = m->pluralText(); if (source.isEmpty()) source = m->text(); } QStringList translations = m->translations(); // Truncated variants are permitted to be "denormalized" for (int i = 0; i < translations.count(); ++i) { int sep = translations.at(i).indexOf(QChar(Translator::BinaryVariantSeparator)); if (sep >= 0) translations[i].truncate(sep); } if (m_ui.actionAccelerators->isChecked()) { bool sk = haveMnemonic(source); bool tk = true; for (int i = 0; i < translations.count() && tk; ++i) { tk &= haveMnemonic(translations[i]); } if (!sk && tk) { if (verbose) m_errorsView->addError(mi, ErrorsView::SuperfluousAccelerator); danger = true; } else if (sk && !tk) { if (verbose) m_errorsView->addError(mi, ErrorsView::MissingAccelerator); danger = true; } } if (m_ui.actionSurroundingWhitespace->isChecked()) { bool whitespaceok = true; for (int i = 0; i < translations.count() && whitespaceok; ++i) { whitespaceok &= (leadingWhitespace(source) == leadingWhitespace(translations[i])); whitespaceok &= (trailingWhitespace(source) == trailingWhitespace(translations[i])); } if (!whitespaceok) { if (verbose) m_errorsView->addError(mi, ErrorsView::SurroundingWhitespaceDiffers); danger = true; } } if (m_ui.actionEndingPunctuation->isChecked()) { bool endingok = true; for (int i = 0; i < translations.count() && endingok; ++i) { endingok &= (ending(source, m_dataModel->sourceLanguage(mi)) == ending(translations[i], m_dataModel->language(mi))); } if (!endingok) { if (verbose) m_errorsView->addError(mi, ErrorsView::PunctuationDiffers); danger = true; } } if (m_ui.actionPhraseMatches->isChecked()) { QString fsource = friendlyString(source); QString ftranslation = friendlyString(translations.first()); QStringList lookupWords = fsource.split(QLatin1Char(' ')); bool phraseFound; foreach (const QString &s, lookupWords) { if (m_phraseDict[mi].contains(s)) { phraseFound = true; foreach (const Phrase *p, m_phraseDict[mi].value(s)) { if (fsource == friendlyString(p->source())) { if (ftranslation.indexOf(friendlyString(p->target())) >= 0) { phraseFound = true; break; } else { phraseFound = false; } } } if (!phraseFound) { if (verbose) m_errorsView->addError(mi, ErrorsView::IgnoredPhrasebook, s); danger = true; } } } } if (m_ui.actionPlaceMarkerMatches->isChecked()) { // Stores the occurrence count of the place markers in the map placeMarkerIndexes. // i.e. the occurrence count of %1 is stored at placeMarkerIndexes[1], // count of %2 is stored at placeMarkerIndexes[2] etc. // In the first pass, it counts all place markers in the sourcetext. // In the second pass it (de)counts all place markers in the translation. // When finished, all elements should have returned to a count of 0, // if not there is a mismatch // between place markers in the source text and the translation text. QHash<int, int> placeMarkerIndexes; QString translation; int numTranslations = translations.count(); for (int pass = 0; pass < numTranslations + 1; ++pass) { const QChar *uc_begin = source.unicode(); const QChar *uc_end = uc_begin + source.length(); if (pass >= 1) { translation = translations[pass - 1]; uc_begin = translation.unicode(); uc_end = uc_begin + translation.length(); } const QChar *c = uc_begin; while (c < uc_end) { if (c->unicode() == '%') { const QChar *escape_start = ++c; while (c->isDigit()) ++c; const QChar *escape_end = c; bool ok = true; int markerIndex = QString::fromRawData( escape_start, escape_end - escape_start).toInt(&ok); if (ok) placeMarkerIndexes[markerIndex] += (pass == 0 ? numTranslations : -1); } ++c; } } foreach (int i, placeMarkerIndexes) { if (i != 0) { if (verbose) m_errorsView->addError(mi, ErrorsView::PlaceMarkersDiffer); danger = true; break; } } // Piggy-backed on the general place markers, we check the plural count marker. if (m->message().isPlural()) { for (int i = 0; i < numTranslations; ++i) if (m_dataModel->model(mi)->countRefNeeds().at(i) && !(translations[i].contains(QLatin1String("%n")) || translations[i].contains(QLatin1String("%Ln")))) { if (verbose) m_errorsView->addError(mi, ErrorsView::NumerusMarkerMissing); danger = true; break; } } } } if (danger != m->danger()) m_dataModel->setDanger(curIdx, danger); } if (verbose) statusBar()->showMessage(m_errorsView->firstError()); } void MainWindow::readConfig() { QSettings config; QRect r(pos(), size()); restoreGeometry(config.value(settingPath("Geometry/WindowGeometry")).toByteArray()); restoreState(config.value(settingPath("MainWindowState")).toByteArray()); m_ui.actionAccelerators->setChecked( config.value(settingPath("Validators/Accelerator"), true).toBool()); m_ui.actionSurroundingWhitespace->setChecked( config.value(settingPath("Validators/SurroundingWhitespace"), true).toBool()); m_ui.actionEndingPunctuation->setChecked( config.value(settingPath("Validators/EndingPunctuation"), true).toBool()); m_ui.actionPhraseMatches->setChecked( config.value(settingPath("Validators/PhraseMatch"), true).toBool()); m_ui.actionPlaceMarkerMatches->setChecked( config.value(settingPath("Validators/PlaceMarkers"), true).toBool()); m_ui.actionLengthVariants->setChecked( config.value(settingPath("Options/LengthVariants"), false).toBool()); m_ui.actionVisualizeWhitespace->setChecked( config.value(settingPath("Options/VisualizeWhitespace"), true).toBool()); m_messageEditor->setFontSize( config.value(settingPath("Options/EditorFontsize"), font().pointSize()).toReal()); recentFiles().readConfig(); int size = config.beginReadArray(settingPath("OpenedPhraseBooks")); for (int i = 0; i < size; ++i) { config.setArrayIndex(i); openPhraseBook(config.value(QLatin1String("FileName")).toString()); } config.endArray(); } void MainWindow::writeConfig() { QSettings config; config.setValue(settingPath("Geometry/WindowGeometry"), saveGeometry()); config.setValue(settingPath("Validators/Accelerator"), m_ui.actionAccelerators->isChecked()); config.setValue(settingPath("Validators/SurroundingWhitespace"), m_ui.actionSurroundingWhitespace->isChecked()); config.setValue(settingPath("Validators/EndingPunctuation"), m_ui.actionEndingPunctuation->isChecked()); config.setValue(settingPath("Validators/PhraseMatch"), m_ui.actionPhraseMatches->isChecked()); config.setValue(settingPath("Validators/PlaceMarkers"), m_ui.actionPlaceMarkerMatches->isChecked()); config.setValue(settingPath("Options/LengthVariants"), m_ui.actionLengthVariants->isChecked()); config.setValue(settingPath("Options/VisualizeWhitespace"), m_ui.actionVisualizeWhitespace->isChecked()); config.setValue(settingPath("MainWindowState"), saveState()); recentFiles().writeConfig(); config.setValue(settingPath("Options/EditorFontsize"), m_messageEditor->fontSize()); config.beginWriteArray(settingPath("OpenedPhraseBooks"), m_phraseBooks.size()); for (int i = 0; i < m_phraseBooks.size(); ++i) { config.setArrayIndex(i); config.setValue(QLatin1String("FileName"), m_phraseBooks.at(i)->fileName()); } config.endArray(); } void MainWindow::setupRecentFilesMenu() { m_ui.menuRecentlyOpenedFiles->clear(); foreach (const QStringList &strList, recentFiles().filesLists()) if (strList.size() == 1) { const QString &str = strList.first(); m_ui.menuRecentlyOpenedFiles->addAction( DataModel::prettifyFileName(str))->setData(str); } else { QMenu *menu = m_ui.menuRecentlyOpenedFiles->addMenu( MultiDataModel::condenseFileNames( MultiDataModel::prettifyFileNames(strList))); menu->addAction(tr("All"))->setData(strList); foreach (const QString &str, strList) menu->addAction(DataModel::prettifyFileName(str))->setData(str); } } void MainWindow::recentFileActivated(QAction *action) { openFiles(action->data().toStringList()); } void MainWindow::toggleStatistics() { if (m_ui.actionStatistics->isChecked()) { if (!m_statistics) { m_statistics = new Statistics(this); connect(m_dataModel, SIGNAL(statsChanged(int,int,int,int,int,int)), m_statistics, SLOT(updateStats(int,int,int,int,int,int))); } m_statistics->show(); updateStatistics(); } else if (m_statistics) { m_statistics->close(); } } void MainWindow::toggleVisualizeWhitespace() { m_messageEditor->setVisualizeWhitespace(m_ui.actionVisualizeWhitespace->isChecked()); } void MainWindow::maybeUpdateStatistics(const MultiDataIndex &index) { if (index.model() == m_currentIndex.model()) updateStatistics(); } void MainWindow::updateStatistics() { // don't call this if stats dialog is not open // because this can be slow... if (!m_statistics || !m_statistics->isVisible() || m_currentIndex.model() < 0) return; m_dataModel->model(m_currentIndex.model())->updateStatistics(); } void MainWindow::showTranslationSettings(int model) { if (!m_translationSettingsDialog) m_translationSettingsDialog = new TranslationSettingsDialog(this); m_translationSettingsDialog->setDataModel(m_dataModel->model(model)); m_translationSettingsDialog->exec(); } void MainWindow::showTranslationSettings() { showTranslationSettings(m_currentIndex.model()); } bool MainWindow::eventFilter(QObject *object, QEvent *event) { if (event->type() == QEvent::DragEnter) { QDragEnterEvent *e = static_cast<QDragEnterEvent*>(event); if (e->mimeData()->hasFormat(QLatin1String("text/uri-list"))) { e->acceptProposedAction(); return true; } } else if (event->type() == QEvent::Drop) { QDropEvent *e = static_cast<QDropEvent*>(event); if (!e->mimeData()->hasFormat(QLatin1String("text/uri-list"))) return false; QStringList urls; foreach (QUrl url, e->mimeData()->urls()) if (!url.toLocalFile().isEmpty()) urls << url.toLocalFile(); if (!urls.isEmpty()) openFiles(urls); e->acceptProposedAction(); return true; } else if (event->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent *>(event); if (ke->key() == Qt::Key_Escape) { if (object == m_messageEditor) m_messageView->setFocus(); else if (object == m_messagesDock) m_contextView->setFocus(); } else if ((ke->key() == Qt::Key_Plus || ke->key() == Qt::Key_Equal) && (ke->modifiers() & Qt::ControlModifier)) { m_messageEditor->increaseFontSize(); } else if (ke->key() == Qt::Key_Minus && (ke->modifiers() & Qt::ControlModifier)) { m_messageEditor->decreaseFontSize(); } } else if (event->type() == QEvent::Wheel) { QWheelEvent *we = static_cast<QWheelEvent *>(event); if (we->modifiers() & Qt::ControlModifier) { if (we->delta() > 0) m_messageEditor->increaseFontSize(); else m_messageEditor->decreaseFontSize(); } } return false; } QT_END_NAMESPACE
37.95502
121
0.627407
[ "geometry", "object", "model" ]
e50908bffe3ba7fb244fa5e82c7f437a5b86ac9b
1,106
cpp
C++
test/cmdLineArgs/src/cmdLineArgsApp.cpp
nselikoff/Cinder
54590aabdc3d74b0b078d43590dfad89e50e9c94
[ "BSD-2-Clause" ]
3,494
2015-01-02T08:42:09.000Z
2022-03-31T14:16:23.000Z
test/cmdLineArgs/src/cmdLineArgsApp.cpp
nselikoff/Cinder
54590aabdc3d74b0b078d43590dfad89e50e9c94
[ "BSD-2-Clause" ]
1,284
2015-01-02T07:31:47.000Z
2022-03-30T02:06:43.000Z
test/cmdLineArgs/src/cmdLineArgsApp.cpp
nselikoff/Cinder
54590aabdc3d74b0b078d43590dfad89e50e9c94
[ "BSD-2-Clause" ]
780
2015-01-02T22:14:29.000Z
2022-03-30T00:16:56.000Z
#include "cinder/app/App.h" #include "cinder/app/RendererGl.h" #include "cinder/gl/gl.h" #include "cinder/Utilities.h" using namespace ci; using namespace ci::app; using namespace std; // We'll create a new Cinder Application by deriving from the App class class cmdLineArgsApp : public App { public: void setup(); void draw(); static void prepareSettings( App::Settings *settings ) { getArgs() = settings->getCommandLineArgs(); } static vector<string>& getArgs() { static vector<string> args; return args; } }; void cmdLineArgsApp::setup() { console() << "Arguments: " << std::endl; for( vector<string>::const_iterator argIt = getArgs().begin(); argIt != getArgs().end(); ++argIt ) console() << " " << *argIt << std::endl; } void cmdLineArgsApp::draw() { if( getArgs().size() >= 4 ) gl::clear( Color( fromString<float>( getArgs()[1] ), fromString<float>( getArgs()[2] ), fromString<float>( getArgs()[3] ) ) ); else gl::clear( Color( 0, 0, 0 ) ); } // This line tells Cinder to actually create the application CINDER_APP( cmdLineArgsApp, RendererGl, &cmdLineArgsApp::prepareSettings )
29.891892
128
0.687161
[ "vector" ]
e50a78fe6ef543aea6afadec9066c317ff07818e
1,599
hh
C++
Engine/spcCore/entity/entity.hh
marcellfischbach/SpiceEngine
e25e1e4145b7afaea9179bb8e33e4d184bd407c4
[ "BSD-3-Clause" ]
null
null
null
Engine/spcCore/entity/entity.hh
marcellfischbach/SpiceEngine
e25e1e4145b7afaea9179bb8e33e4d184bd407c4
[ "BSD-3-Clause" ]
1
2021-09-09T12:51:56.000Z
2021-09-09T12:51:56.000Z
Engine/spcCore/entity/entity.hh
marcellfischbach/SpiceEngine
e25e1e4145b7afaea9179bb8e33e4d184bd407c4
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include <spcCore/coreexport.hh> #include <spcCore/class.hh> #include <spcCore/types.hh> #include <string> #include <vector> namespace spc { class World; class EntityState; class SpatialState; SPC_CLASS() class SPC_CORE_API Entity : public SPC_SUPER(iObject) { SPC_CLASS_GEN_OBJECT; public: Entity(const std::string &name = std::string("")); virtual ~Entity(); void SetName(const std::string &name); const std::string &GetName() const; void SetWorld(World * world); World* GetWorld(); const World* GetWorld() const; bool Attach(Entity * entity, SpatialState *parentState = nullptr); bool Detach(Entity * entity); Entity* GetParent(); const Entity* GetParent() const; Size GetNumberOfChildren() const; Entity* GetChild(Size idx); const Entity* GetChild(Size idx) const; bool Attach(EntityState* entityState); bool Detach(EntityState* entityState); void SetRoot(SpatialState *rootState); SpatialState*GetRoot(); const SpatialState*GetRoot() const; /** * @name Lifecycle * @{ */ /** * @} */ /** * Don't use directly will be called by the entity states * @param entityState */ void RegisterEntityState(EntityState* entityState); void DeregisterEntityState(EntityState* entityState); private: SpatialState *GetAbsolutRoot(); SpatialState *GetAbsolutParentRoot(); std::string m_name; SpatialState* m_rootState; std::vector<EntityState*> m_states; std::vector<EntityState*> m_updateStates; Entity* m_parent; std::vector<Entity*> m_children; World* m_world; }; }
19.035714
68
0.698562
[ "vector" ]
e50b556d880c198548ae1e1d5a8ac9dc75e0bf29
72,870
cpp
C++
src/engine.cpp
hrxcodes/cbftp
bf2784007dcc4cc42775a2d40157c51b80383f81
[ "MIT" ]
8
2019-04-30T00:37:00.000Z
2022-02-03T13:35:31.000Z
src/engine.cpp
Xtravaganz/cbftp
31a3465e2cd539f6cf35a5d9a0bb9c5c2f639cd5
[ "MIT" ]
2
2019-11-19T12:46:13.000Z
2019-12-20T22:13:57.000Z
src/engine.cpp
Xtravaganz/cbftp
31a3465e2cd539f6cf35a5d9a0bb9c5c2f639cd5
[ "MIT" ]
9
2020-01-15T02:38:36.000Z
2022-02-15T20:05:20.000Z
#include "engine.h" #include <cassert> #include <cstdlib> #include <fstream> #include <set> #include <tuple> #include <unordered_set> #include "core/workmanager.h" #include "core/tickpoke.h" #include "scoreboard.h" #include "scoreboardelement.h" #include "globalcontext.h" #include "sitelogic.h" #include "site.h" #include "filelist.h" #include "file.h" #include "path.h" #include "sitelogicmanager.h" #include "transfermanager.h" #include "race.h" #include "siterace.h" #include "skiplist.h" #include "eventlog.h" #include "sitemanager.h" #include "sitetransferjob.h" #include "transferjob.h" #include "pendingtransfer.h" #include "localstorage.h" #include "localfilelist.h" #include "transferstatus.h" #include "util.h" #include "preparedrace.h" #include "sitetransferjob.h" #include "sectionmanager.h" #include "transferprotocol.h" #define POKEINTERVAL 1000 #define STATICTIMEFORCOMPLETION 5000 #define DIROBSERVETIME 20000 #define SFVDIROBSERVETIME 5000 #define NFO_PRIO_AFTER_SEC 15 #define RETRY_CONNECT_UNTIL_SEC 15 #define MAX_PERCENTAGE_FOR_INCOMPLETE_DELETE 95 namespace { enum EngineTickMessages { TICK_MSG_TICKER, }; PrioType getPrioType(File * f) { if (f->getExtension().compare("sfv") == 0) { return PrioType::PRIO; } else if (f->getExtension().compare("nfo") == 0) { return PrioType::PRIO_LATER; } return PrioType::NORMAL; } struct AddSite { AddSite(const std::string& name, const std::shared_ptr<SiteLogic>& sl, bool downloadonly) : name(name), sl(sl), downloadonly(downloadonly) {} std::string name; std::shared_ptr<SiteLogic> sl; bool downloadonly; }; } Engine::Engine() : scoreboard(std::make_shared<ScoreBoard>()), failboard(std::make_shared<ScoreBoard>()), maxavgspeed(1024), pokeregistered(false), nextid(1), maxpointsfilesize(2000), maxpointsavgspeed(3000), maxpointspriority(2500), maxpointspercentageowned(2000), maxpointslowprogress(2000), preparedraceexpirytime(120), startnextpreparedtimeout(300), startnextprepared(false), nextpreparedtimeremaining(0), forcescoreboard(false) { } Engine::~Engine() { } std::shared_ptr<Race> Engine::newSpreadJob(int profile, const std::string& release, const std::string& section, const std::list<std::string>& sites, bool reset, const std::list<std::string>& dlonlysites) { if (release.empty()) { global->getEventLog()->log("Engine", "Spread job skipped due to missing release name."); return std::shared_ptr<Race>(); } if (section.empty()) { global->getEventLog()->log("Engine", "Spread job skipped due to missing section name."); return std::shared_ptr<Race>(); } Section * sectionptr = global->getSectionManager()->getSection(section); if (!sectionptr) { global->getEventLog()->log("Engine", "Spread job skipped due to undefined section: " + section); return std::shared_ptr<Race>(); } std::shared_ptr<Race> race; if (profile == SPREAD_PREPARE && startnextprepared) { startnextprepared = false; profile = SPREAD_RACE; } bool append = false; for (std::list<std::shared_ptr<Race> >::iterator it = allraces.begin(); it != allraces.end(); it++) { if ((*it)->getName() == release && (*it)->getSection() == section) { race = *it; append = true; break; } } if (release.find("/") != std::string::npos) { global->getEventLog()->log("Engine", "Spread job skipped due to invalid target: " + release); return std::shared_ptr<Race>(); } if (!race) { race = std::make_shared<Race>(nextid++, static_cast<SpreadProfile>(profile), release, section); } std::list<AddSite> addsites; bool globalskipped = sectionptr->getSkipList().check(release, true, false).action == SKIPLIST_DENY; std::list<std::string> skippedsites; std::unordered_map<std::string, bool> allsites; // sitename, download-only for (const std::string& site : sites) { allsites[site] = false; } for (const std::string& site : dlonlysites) { allsites[site] = true; } for (const std::pair<std::string, bool>& site : allsites) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(site.first); if (!sl) { global->getEventLog()->log("Engine", "Trying to use a nonexisting site: " + site.first); continue; } if (sl->getSite()->getDisabled()) { global->getEventLog()->log("Engine", "Skipping disabled site: " + site.first); continue; } bool downloadonly = site.second || (sl->getSite()->isAffiliated(race->getGroup()) && profile != SPREAD_DISTRIBUTE); if (downloadonly && sl->getSite()->getAllowDownload() == SiteAllowTransfer::SITE_ALLOW_TRANSFER_NO) { global->getEventLog()->log("Engine", "Skipping site because of download-only mode and download disabled: " + site.first); continue; } if (!sl->getSite()->hasSection(section)) { global->getEventLog()->log("Engine", "Trying to use an undefined section: " + section + " on " + site.first); continue; } SkipListMatch match = sl->getSite()->getSkipList().check((sl->getSite()->getSectionPath(section) / race->getName()).toString(), true, false, &sectionptr->getSkipList()); if (match.action == SKIPLIST_DENY && !downloadonly) { skippedsites.push_back(sl->getSite()->getName()); continue; } if (append && !!race->getSiteRace(site.first)) { continue; } addsites.emplace_back(site.first, sl, downloadonly); } if (!addsites.empty()) { for (const std::string & skipsite : skippedsites) { global->getEventLog()->log("Engine", "Skipping site " + skipsite + " due to skiplist match: " + release); continue; } } else if (globalskipped) { global->getEventLog()->log("Engine", "Spread job skipped due to skiplist match: " + release); return std::shared_ptr<Race>(); } bool noupload = true; bool nodownload = true; for (const AddSite& site : addsites) { if (site.sl->getSite()->getAllowUpload() == SITE_ALLOW_TRANSFER_YES && !site.downloadonly) { noupload = false; } if (site.sl->getSite()->getAllowDownload() == SITE_ALLOW_TRANSFER_YES || (site.sl->getSite()->getAllowDownload() == SITE_ALLOW_DOWNLOAD_MATCH_ONLY && site.downloadonly)) { nodownload = false; } } if (!append && (noupload || nodownload) && profile != SPREAD_DISTRIBUTE) { global->getEventLog()->log("Engine", "Ignoring attempt to spread " + release + " in " + section + " since no transfers would be performed."); return std::shared_ptr<Race>(); } if (addsites.size() < 2 && !append) { global->getEventLog()->log("Engine", "Ignoring attempt to spread " + release + " in " + section + " on less than 2 sites."); return std::shared_ptr<Race>(); } if (addsites.size() > 0 || append) { checkStartPoke(); if (profile == SPREAD_PREPARE) { global->getEventLog()->log("Engine", "Preparing spread job: " + section + "/" + release + " on " + std::to_string((int)addsites.size()) + " sites."); std::list<std::pair<std::string, bool>> preparesites; for (const AddSite& site : addsites) { preparesites.emplace_back(site.name, site.downloadonly); } preparedraces.push_back(std::make_shared<PreparedRace>(race->getId(), release, section, preparesites, reset, preparedraceexpirytime)); for (const AddSite& site : addsites) { site.sl->activateAll(); } return std::shared_ptr<Race>(); } bool readdtocurrent = true; if (append) { for (std::list<std::shared_ptr<Race> >::iterator it = currentraces.begin(); it != currentraces.end(); it++) { if (*it == race) { readdtocurrent = false; break; } } if (readdtocurrent) { global->getEventLog()->log("Engine", "Reactivating spread job: " + section + "/" + release); race->setUndone(); for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it = race->begin(); it != race->end(); it++) { it->second->activateAll(); } } if (reset) { resetRace(race, true); } } for (const AddSite& site : addsites) { addSiteToRace(race, site.name, site.downloadonly); } if (!append) { currentraces.push_back(race); allraces.push_back(race); dropped = 0; global->getEventLog()->log("Engine", "Starting spread job: " + section + "/" + release + " on " + std::to_string((int)addsites.size()) + " sites."); sectionptr->addJob(); global->getStatistics()->addSpreadJob(); } else { if (addsites.size()) { global->getEventLog()->log("Engine", "Appending to spread job: " + section + "/" + release + " with " + std::to_string((int)addsites.size()) + " site" + (addsites.size() > 1 ? "s" : "") + "."); } if (readdtocurrent) { currentraces.push_back(race); removeFromFinished(race); } } setSpeedScale(); preSeedPotentialData(race); } return race; } std::shared_ptr<Race> Engine::newRace(const std::string& release, const std::string& section, const std::list<std::string>& sites, bool reset, const std::list<std::string>& dlonlysites) { return newSpreadJob(SPREAD_RACE, release, section, sites, reset, dlonlysites); } std::shared_ptr<Race> Engine::newDistribute(const std::string& release, const std::string& section, const std::list<std::string>& sites, bool reset, const std::list<std::string>& dlonlysites) { return newSpreadJob(SPREAD_DISTRIBUTE, release, section, sites, reset, dlonlysites); } bool Engine::prepareRace(const std::string & release, const std::string& section, const std::list<std::string>& sites, bool reset, const std::list<std::string>& dlonlysites) { size_t preparedbefore = preparedraces.size(); std::shared_ptr<Race> race = newSpreadJob(SPREAD_PREPARE, release, section, sites, reset, dlonlysites); return preparedraces.size() > preparedbefore || race; } void Engine::startPreparedRace(unsigned int id) { for (std::list<std::shared_ptr<PreparedRace> >::iterator it = preparedraces.begin(); it != preparedraces.end(); it++) { if ((*it)->getId() == id) { std::list<std::string> sites; std::list<std::string> dlonlysites; for (const std::pair<std::string, bool>& site : (*it)->getSites()) { if (site.second) { dlonlysites.push_back(site.first); } else { sites.push_back(site.first); } } newRace((*it)->getRelease(), (*it)->getSection(), sites, (*it)->getReset(), dlonlysites); preparedraces.erase(it); return; } } } void Engine::deletePreparedRace(unsigned int id) { for (std::list<std::shared_ptr<PreparedRace> >::iterator it = preparedraces.begin(); it != preparedraces.end(); it++) { if ((*it)->getId() == id) { preparedraces.erase(it); return; } } } void Engine::startLatestPreparedRace() { if (preparedraces.size()) { std::shared_ptr<PreparedRace> preparedrace = preparedraces.back(); startPreparedRace(preparedraces.back()->getId()); } } void Engine::toggleStartNextPreparedRace() { if (!startnextprepared) { startnextprepared = true; nextpreparedtimeremaining = getNextPreparedRaceStarterTimeout() * 1000; checkStartPoke(); global->getEventLog()->log("Engine", "Enabling next prepared spread job starter"); } else { startnextprepared = false; global->getEventLog()->log("Engine", "Disabling next prepared spread job starter"); } } bool Engine::getNextPreparedRaceStarterEnabled() const { return startnextprepared; } int Engine::getNextPreparedRaceStarterTimeout() const { return startnextpreparedtimeout; } int Engine::getNextPreparedRaceStarterTimeRemaining() const { return nextpreparedtimeremaining / 1000; } unsigned int Engine::newTransferJobDownload(const std::string & srcsite, const std::shared_ptr<FileList>& srcfilelist, const std::string & file, const Path & dstpath) { return newTransferJobDownload(srcsite, srcfilelist, file, dstpath, file); } unsigned int Engine::newTransferJobUpload(const Path & srcpath, const std::string & file, const std::string & dstsite, const std::shared_ptr<FileList>& dstfilelist) { return newTransferJobUpload(srcpath, file, dstsite, dstfilelist, file); } unsigned int Engine::newTransferJobFXP(const std::string & srcsite, const std::shared_ptr<FileList>& srcfilelist, const std::string & dstsite, const std::shared_ptr<FileList>& dstfilelist, const std::string & file) { return newTransferJobFXP(srcsite, srcfilelist, file, dstsite, dstfilelist, file); } unsigned int Engine::newTransferJobDownload(const std::string & srcsite, const std::shared_ptr<FileList>& srcfilelist, const std::string & srcfile, const Path & dstpath, const std::string & dstfile) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(srcsite); if (!sl) { global->getEventLog()->log("Engine", "Bad site name: " + srcsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, sl, srcfilelist, srcfile, dstpath, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting download job: " + srcfile + " from " + srcsite); sl->addTransferJob(tj->getSrcTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } unsigned int Engine::newTransferJobDownload(const std::string & srcsite, const Path & srcpath, const std::string & srcfile, const Path & dstpath, const std::string & dstfile) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(srcsite); if (!sl) { global->getEventLog()->log("Engine", "Bad site name: " + srcsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, sl, srcpath, srcfile, dstpath, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting download job: " + srcfile + " from " + srcsite); sl->addTransferJob(tj->getSrcTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } unsigned int Engine::newTransferJobUpload(const Path & srcpath, const std::string & srcfile, const std::string & dstsite, const std::shared_ptr<FileList>& dstfilelist, const std::string & dstfile) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(dstsite); if (!sl) { global->getEventLog()->log("Engine", "Bad site name: " + dstsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, srcpath, srcfile, sl, dstfilelist, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting upload job: " + srcfile + " to " + dstsite); sl->addTransferJob(tj->getDstTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } unsigned int Engine::newTransferJobUpload(const Path & srcpath, const std::string & srcfile, const std::string & dstsite, const Path & dstpath, const std::string & dstfile) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(dstsite); if (!sl) { global->getEventLog()->log("Engine", "Bad site name: " + dstsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, srcpath, srcfile, sl, dstpath, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting upload job: " + srcfile + " to " + dstsite); sl->addTransferJob(tj->getDstTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } unsigned int Engine::newTransferJobFXP(const std::string & srcsite, const std::shared_ptr<FileList>& srcfilelist, const std::string & srcfile, const std::string & dstsite, const std::shared_ptr<FileList>& dstfilelist, const std::string & dstfile) { const std::shared_ptr<SiteLogic> slsrc = global->getSiteLogicManager()->getSiteLogic(srcsite); const std::shared_ptr<SiteLogic> sldst = global->getSiteLogicManager()->getSiteLogic(dstsite); if (!slsrc) { global->getEventLog()->log("Engine", "Bad site name: " + srcsite); return 0; } if (!sldst) { global->getEventLog()->log("Engine", "Bad site name: " + dstsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, slsrc, srcfilelist, srcfile, sldst, dstfilelist, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting FXP job: " + srcfile + " - " + srcsite + " -> " + dstsite); slsrc->addTransferJob(tj->getSrcTransferJob()); sldst->addTransferJob(tj->getDstTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } unsigned int Engine::newTransferJobFXP(const std::string & srcsite, const Path & srcpath, const std::string & srcfile, const std::string & dstsite, const Path & dstpath, const std::string & dstfile) { const std::shared_ptr<SiteLogic> slsrc = global->getSiteLogicManager()->getSiteLogic(srcsite); const std::shared_ptr<SiteLogic> sldst = global->getSiteLogicManager()->getSiteLogic(dstsite); if (!slsrc) { global->getEventLog()->log("Engine", "Bad site name: " + srcsite); return 0; } if (!sldst) { global->getEventLog()->log("Engine", "Bad site name: " + dstsite); return 0; } if (srcfile.empty() || dstfile.empty()) { global->getEventLog()->log("Engine", "Bad file name."); return 0; } unsigned int id = nextid++; std::shared_ptr<TransferJob> tj = std::make_shared<TransferJob>(id, slsrc, srcpath, srcfile, sldst, dstpath, dstfile); alltransferjobs.push_back(tj); currenttransferjobs.push_back(tj); global->getEventLog()->log("Engine", "Starting FXP job: " + srcfile + " - " + srcsite + " -> " + dstsite); slsrc->addTransferJob(tj->getSrcTransferJob()); sldst->addTransferJob(tj->getDstTransferJob()); checkStartPoke(); global->getStatistics()->addTransferJob(); return id; } void Engine::removeSiteFromRace(const std::shared_ptr<Race> & race, const std::string & site) { if (!!race) { std::shared_ptr<SiteRace> sr = race->getSiteRace(site); if (!!sr) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(site); race->removeSite(sr); wipeFromScoreBoard(sr); if (!!sl) { sl->abortRace(sr); } } } } void Engine::removeSiteFromRaceDeleteFiles(const std::shared_ptr<Race> & race, const std::string & site, bool allfiles, bool deleteoncomplete) { if (!!race) { std::shared_ptr<SiteRace> sr = race->getSiteRace(site); if (!!sr) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(site); race->removeSite(sr); wipeFromScoreBoard(sr); if (!!sl) { if (deleteoncomplete || isIncompleteEnoughForDelete(race, sr)) { sl->requestDelete(nullptr, sr->getPath(), true, false, allfiles); } sl->abortRace(sr); } } } } void Engine::abortRace(const std::shared_ptr<Race> & race) { if (!!race && !race->isDone()) { race->abort(); for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it = race->begin(); it != race->end(); it++) { it->second->abortRace(it->first); wipeFromScoreBoard(it->first); } currentraces.remove(race); finishedraces.push_back(race); global->getEventLog()->log("Engine", "Spread job aborted: " + race->getName()); } } void Engine::resetRace(const std::shared_ptr<Race> & race, bool hard) { if (!!race) { race->reset(); for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it = race->begin(); it != race->end(); it++) { wipeFromScoreBoard(it->first); if (hard) { it->first->hardReset(); } else { it->first->softReset(); } it->second->resetRace(it->first); } bool current = false; for (std::list<std::shared_ptr<Race> >::iterator it = currentraces.begin(); it != currentraces.end(); it++) { if (*it == race) { current = true; break; } } if (!current) { currentraces.push_back(race); removeFromFinished(race); } checkStartPoke(); global->getEventLog()->log("Engine", "Spread job reset: " + race->getName()); } } void Engine::wipeFromScoreBoard(const std::shared_ptr<SiteRace> & sr) { std::unordered_map<std::string, std::shared_ptr<FileList>>::const_iterator it; for (it = sr->fileListsBegin(); it != sr->fileListsEnd(); it++) { scoreboard->wipe(it->second); failboard->wipe(it->second); } } bool Engine::waitingInScoreBoard(const std::shared_ptr<Race> & race) const { std::vector<ScoreBoardElement *>::iterator it; for (it = scoreboard->begin(); it != scoreboard->end(); ++it) { ScoreBoardElement * sbe = *it; if (sbe->getRace() != race) { continue; } if (transferExpectedSoon(sbe)) { return true; } } return false; } void Engine::restoreFromFailed(const std::shared_ptr<Race>& race) { std::vector<ScoreBoardElement*>::iterator it; std::list<std::tuple<std::string, std::shared_ptr<FileList>, std::shared_ptr<FileList>>> removelist; for (it = failboard->begin(); it != failboard->end(); ++it) { ScoreBoardElement* sbe = *it; if (sbe->getRace() == race) { scoreboard->update(sbe); removelist.emplace_back(sbe->fileName(), sbe->getSourceFileList(), sbe->getDestinationFileList()); } } for (const std::tuple<std::string, std::shared_ptr<FileList>, std::shared_ptr<FileList>>& elem : removelist) { failboard->remove(std::get<0>(elem), std::get<1>(elem), std::get<2>(elem)); } scoreboard->sort(); scoreboard->shuffleEquals(); } void Engine::removeFromFinished(const std::shared_ptr<Race> & race) { for (std::list<std::shared_ptr<Race>>::iterator it = --finishedraces.end(); it != --finishedraces.begin(); it--) { if (*it == race) { finishedraces.erase(it); break; } } } void Engine::clearSkipListCaches() { for (const std::shared_ptr<Site> & site : skiplistcachesites) { site->getSkipList().wipeCache(); } for (const std::string & section : skiplistcachesections) { Section * sec = global->getSectionManager()->getSection(section); if (sec) { sec->getSkipList().wipeCache(); } } global->getSkipList()->wipeCache(); skiplistcachesites.clear(); skiplistcachesections.clear(); } bool Engine::transferExpectedSoon(ScoreBoardElement * sbe) const { const std::string & filename = sbe->fileName(); if (sbe->getDestinationSiteRace()->getStatus() != RaceStatus::RUNNING) { return false; } if (!sbe->getSource()->getCurrLogins() || !sbe->getDestination()->getCurrLogins()) { return false; } if (sbe->wasAttempted()) { return false; } if (!sbe->getSourceFileList()->contains(filename)) { return false; } if (sbe->getDestinationFileList()->contains(filename)) { return false; } return true; } void Engine::deleteOnAllSites(const std::shared_ptr<Race> & race, bool allfiles, bool deleteoncomplete) { std::list<std::shared_ptr<Site> > sites; for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it = race->begin(); it != race->end(); it++) { if (deleteoncomplete || isIncompleteEnoughForDelete(race, it->first)) { sites.push_back(it->second->getSite()); } } deleteOnSites(race, sites, allfiles); } bool Engine::isIncompleteEnoughForDelete(const std::shared_ptr<Race> & race, const std::shared_ptr<SiteRace> & siterace) const { return siterace->getStatus() != RaceStatus::DONE && (!race->estimatedTotalSize() || (siterace->getTotalFileSize() * 100) / race->estimatedTotalSize() < MAX_PERCENTAGE_FOR_INCOMPLETE_DELETE); } void Engine::deleteOnSites(const std::shared_ptr<Race> & race, std::list<std::shared_ptr<Site> > delsites, bool allfiles) { if (!!race) { if (race->getStatus() == RaceStatus::RUNNING) { abortRace(race); } std::string sites; for (std::list<std::shared_ptr<Site> >::const_iterator it = delsites.begin(); it != delsites.end(); it++) { if (!*it) { continue; } std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic((*it)->getName()); if (!sl) { continue; } std::shared_ptr<SiteRace> sr = race->getSiteRace((*it)->getName()); if (!sr) { global->getEventLog()->log("Engine", "Site " + (*it)->getName() + " is not in spread job: " + race->getName()); continue; } const Path & path = sr->getPath(); sl->requestDelete(nullptr, path, true, false, allfiles); sites += (*it)->getName() + ","; } if (sites.length() > 0) { sites = sites.substr(0, sites.length() - 1); global->getEventLog()->log("Engine", std::string("Attempting delete of ") + (allfiles ? "all" : "own") + " files in " + race->getName() + " on: " + sites); } } } void Engine::abortTransferJob(const std::shared_ptr<TransferJob>& tj) { tj->abort(); currenttransferjobs.remove(tj); global->getEventLog()->log("Engine", "Transfer job aborted: " + tj->getSrcFileName()); } void Engine::resetTransferJob(const std::shared_ptr<TransferJob>& tj) { tj->reset(); bool current = false; for (const std::shared_ptr<TransferJob>& currenttj : currenttransferjobs) { if (currenttj == tj) { current = true; break; } } if (!current) { currenttransferjobs.push_back(tj); } if (tj->getSrc()) { tj->getSrc()->activateOne(); } if (tj->getDst()) { tj->getDst()->activateOne(); } checkStartPoke(); global->getEventLog()->log("Engine", "Transfer job reset: " + tj->getSrcFileName()); } void Engine::jobFileListRefreshed(SiteLogic * sls, const std::shared_ptr<CommandOwner> & commandowner, const std::shared_ptr<FileList>& fl) { switch (commandowner->classType()) { case COMMANDOWNER_SITERACE: { std::shared_ptr<SiteRace> sr = std::static_pointer_cast<SiteRace>(commandowner); if (sr->isDone()) { break; } std::shared_ptr<Race> race = sr->getRace(); bool addedtoboard = false; std::unordered_map<std::string, std::shared_ptr<FileList>>::const_iterator it; std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(sls); if (!sl) { break; } for (it = sr->fileListsBegin(); it != sr->fileListsEnd(); it++) { const std::shared_ptr<FileList>& itfl = it->second; if (!itfl->inScoreBoard() && itfl->getState() != FileListState::FAILED && (itfl == fl || itfl->getState() == FileListState::NONEXISTENT)) { addedtoboard = true; addToScoreBoard(itfl, sr, sl); } } if (fl->getScoreBoardUpdateState() == UpdateState::CHANGED) { spreadjobfilelistschanged[fl] = std::make_pair(sr, sl); } if (!global->getWorkManager()->overload() || forcescoreboard) { forcescoreboard = false; updateScoreBoard(); checkIfRaceComplete(sl, race); } else { if (addedtoboard) { scoreboard->sort(); scoreboard->shuffleEquals(); } ++dropped; } break; } case COMMANDOWNER_TRANSFERJOB: { std::shared_ptr<TransferJob> tj = getTransferJob(commandowner->getId()); refreshPendingTransferList(tj); break; } } } bool Engine::transferJobActionRequest(const std::shared_ptr<SiteTransferJob> & stj) { std::shared_ptr<TransferJob> tj = getTransferJob(stj->getTransferJob()->getId()); if (tj->getType() == TRANSFERJOB_FXP && stj->otherWantsList()) { stj->getOtherSiteLogic()->haveConnectedActivate(1); return false; } std::unordered_map<std::shared_ptr<TransferJob>, std::list<PendingTransfer> >::iterator it = pendingtransfers.find(tj); if (it == pendingtransfers.end()) { pendingtransfers[tj] = std::list<PendingTransfer>(); it = pendingtransfers.find(tj); } refreshPendingTransferList(tj); if (it->second.size() == 0) { bool action = tj->refreshOrAlmostDone(); if (tj->getType() == TRANSFERJOB_FXP && stj->otherWantsList()) { stj->getOtherSiteLogic()->haveConnectedActivate(1); return false; } return action; } tj->clearRefreshLists(); bool started = false; while (!it->second.empty() && !started) { PendingTransfer pt = it->second.front(); switch (pt.type()) { case PENDINGTRANSFER_DOWNLOAD: { if (!pt.getSrc()->downloadSlotAvailable(TransferType::TRANSFERJOB)) { return false; } std::shared_ptr<TransferStatus> ts = global->getTransferManager()->suggestDownload(pt.getSrcFileName(), pt.getSrc(), pt.getSrcFileList(), pt.getLocalFileList(), tj->getSrcTransferJob()); if (!!ts) { tj->addTransfer(ts); started = true; } break; } case PENDINGTRANSFER_UPLOAD: { if (!pt.getDst()->uploadSlotAvailable()) return false; std::shared_ptr<TransferStatus> ts = global->getTransferManager()->suggestUpload(pt.getSrcFileName(), pt.getLocalFileList(), pt.getDst(), pt.getDstFileList(), tj->getDstTransferJob()); if (!!ts) { tj->addTransfer(ts); started = true; } break; } case PENDINGTRANSFER_FXP: { if (!pt.getSrc()->downloadSlotAvailable(TransferType::TRANSFERJOB)) { return false; } if (!pt.getDst()->uploadSlotAvailable()) { return false; } if (pt.getDst() == pt.getSrc() && pt.getDst()->slotsAvailable() < 2) { pt.getDst()->haveConnectedActivate(2); return false; } std::shared_ptr<TransferStatus> ts = global->getTransferManager()->suggestTransfer(pt.getSrcFileName(), pt.getSrc(), pt.getSrcFileList(), pt.getDst(), pt.getDstFileList(), tj->getSrcTransferJob(), tj->getDstTransferJob()); if (!!ts) { tj->addTransfer(ts); started = true; } break; } } } if (tj->getStatus() == TRANSFERJOB_QUEUED) { tj->start(); } return true; } void Engine::raceActionRequest() { issueOptimalTransfers(); } void Engine::estimateRaceSizes() { for (std::list<std::shared_ptr<Race> >::iterator itr = currentraces.begin(); itr != currentraces.end(); itr++) { estimateRaceSize(*itr, true); } } void Engine::estimateRaceSize(const std::shared_ptr<Race> & race, bool forceupdate) { for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator its = race->begin(); its != race->end(); its++) { const std::shared_ptr<SiteRace> & srs = its->first; const SkipList & siteskiplist = its->second->getSite()->getSkipList(); const SkipList & sectionskiplist = race->getSectionSkipList(); std::unordered_map<std::string, std::shared_ptr<FileList>>::const_iterator itfl; for (itfl = srs->fileListsBegin(); itfl != srs->fileListsEnd(); itfl++) { const std::shared_ptr<FileList>& fls = itfl->second; if (!forceupdate && srs->sizeEstimated(fls)) { continue; } if (fls->hasSFV()) { if (srs->getSFVObservedTime(fls) > SFVDIROBSERVETIME) { reportCurrentSize(siteskiplist, sectionskiplist, srs, fls, true); continue; } } else { if (srs->getObservedTime(fls) > DIROBSERVETIME) { reportCurrentSize(siteskiplist, sectionskiplist, srs, fls, true); continue; } } reportCurrentSize(siteskiplist, sectionskiplist, srs, fls, false); } } } bool setContainsPattern(const std::unordered_set<std::string> & uniques, const std::string & matchpattern) { for (const std::string & unique : uniques) { if (util::wildcmp(matchpattern.c_str(), unique.c_str())) { return true; } } return false; } void Engine::reportCurrentSize(const SkipList & siteskiplist, const SkipList & sectionskiplist, const std::shared_ptr<SiteRace> & srs, const std::shared_ptr<FileList>& fls, bool final) { std::unordered_set<std::string> uniques; std::list<File *>::const_iterator itf; std::string subpath = srs->getSubPathForFileList(fls); bool similar = false; std::string firstsimilar; for (itf = fls->begin(); itf != fls->end(); itf++) { File * file = *itf; if (file->isDirectory()) { continue; } std::string filename = file->getName(); size_t lastdotpos = filename.rfind("."); if (lastdotpos != std::string::npos && filename.length() > 8 && lastdotpos == filename.length() - 8 && filename.substr(lastdotpos) == ".missing") { filename = filename.substr(0, lastdotpos); // special hack for some zipscripts lastdotpos = filename.rfind("."); } if (lastdotpos != std::string::npos) { size_t len = filename.length(); size_t checkpos = lastdotpos + 1; while (checkpos < len) { if (isalnum(filename[checkpos])) { ++checkpos; } else { filename = filename.substr(0, checkpos); break; } } } Path prepend = subpath; SkipListMatch match = siteskiplist.check((prepend / filename).toString(), false, true, &sectionskiplist); if (match.action == SKIPLIST_DENY || (match.action == SKIPLIST_UNIQUE && setContainsPattern(uniques, match.matchpattern))) { continue; } if (match.action == SKIPLIST_SIMILAR) { if (!similar) { firstsimilar = filename; similar = true; } else if (FileList::checkUnsimilar(filename, firstsimilar)) { continue; } } uniques.insert(filename); } srs->reportSize(fls, uniques, final); } void Engine::addToScoreBoard(const std::shared_ptr<FileList>& fl, const std::shared_ptr<SiteRace> & sr, const std::shared_ptr<SiteLogic> & sl) { assert(fl->getState() != FileListState::FAILED); const std::shared_ptr<Site> & site = sl->getSite(); const SkipList & skip = site->getSkipList(); std::string subpath = sr->getSubPathForFileList(fl); Path subpathpath(subpath); std::shared_ptr<Race> race = sr->getRace(); bool racemode = race->getProfile() == SPREAD_RACE; SitePriority priority = site->getPriority(); const SkipList & secskip = race->getSectionSkipList(); bool flskip = false; if (!subpath.empty()) { SkipListMatch dirmatch = skip.check(subpath, true, true, &secskip); if (dirmatch.action == SKIPLIST_DENY || (dirmatch.action == SKIPLIST_UNIQUE && sr->getFileListForPath("")->containsPatternBefore(dirmatch.matchpattern, true, subpath))) { flskip = true; } } for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator cmpit = race->begin(); cmpit != race->end(); cmpit++) { const std::shared_ptr<SiteLogic> & cmpsl = cmpit->second; const std::shared_ptr<Site> & cmpsite = cmpsl->getSite(); const SkipList & cmpskip = cmpsite->getSkipList(); const std::shared_ptr<SiteRace> & cmpsr = cmpit->first; std::shared_ptr<FileList> cmpfl = cmpsr->getFileListForPath(subpath); if (!cmpfl) { cmpsr->addSubDirectory(subpath); continue; } SitePriority cmppriority = cmpsite->getPriority(); if (raceTransferPossible(cmpsl, cmpsr, sl, sr, race) && !flskip) { addToScoreBoardForPair(cmpsl, cmpsite, cmpsr, cmpfl, sl, site, sr, fl, skip, secskip, race, subpathpath, priority, racemode); } if (fl->getNumUploadedFiles() && raceTransferPossible(sl, sr, cmpsl, cmpsr, race)) { addToScoreBoardForPair(sl, site, sr, fl, cmpsl, cmpsite, cmpsr, cmpfl, cmpskip, secskip, race, subpathpath, cmppriority, racemode); } } fl->setInScoreBoard(); } void Engine::addToScoreBoardForPair(const std::shared_ptr<SiteLogic> & sls, const std::shared_ptr<Site> & ss, const std::shared_ptr<SiteRace> & srs, const std::shared_ptr<FileList>& fls, const std::shared_ptr<SiteLogic> & sld, const std::shared_ptr<Site> & ds, const std::shared_ptr<SiteRace> & srd, const std::shared_ptr<FileList>& fld, const SkipList & dstskip, const SkipList & secskip, const std::shared_ptr<Race> & race, const Path & subpath, SitePriority priority, bool racemode) { if (fld->getState() == FileListState::UNKNOWN || fld->getState() == FileListState::PRE_FAIL || fld->getState() == FileListState::FAILED) { return; } int avgspeed = ss->getAverageSpeed(ds->getName()); if (avgspeed > maxavgspeed) { avgspeed = maxavgspeed; } std::list<File *>::const_iterator itf; for (itf = fls->begin(); itf != fls->end(); itf++) { File * f = *itf; const std::string & name = f->getName(); if (fld->contains(name) || f->isDirectory() || f->getSize() == 0) { continue; } SkipListMatch filematch = dstskip.check((subpath / name).toString(), false, true, &secskip); if (filematch.action == SKIPLIST_DENY || (filematch.action == SKIPLIST_UNIQUE && fld->containsPattern(filematch.matchpattern, false))) { continue; } if (filematch.action == SKIPLIST_SIMILAR) { if (!fld->similarChecked()) { fld->checkSimilar(&dstskip, &secskip); } if (fld->containsUnsimilar(name)) { continue; } } PrioType p = getPrioType(f); unsigned long long int filesize = f->getSize(); unsigned short score = calculateScore(p, filesize, race, fls, srs, fld, srd, avgspeed, priority, racemode); scoreboard->update(name, score, filesize, p, sls, fls, srs, sld, fld, srd, race, subpath.toString()); race->resetUpdateCheckCounter(); } } void Engine::updateScoreBoard() { for (const std::pair<std::shared_ptr<FileList>, std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic>>> & changedlist : spreadjobfilelistschanged) { const std::shared_ptr<FileList>& fl = changedlist.first; const std::shared_ptr<SiteRace>& sr = changedlist.second.first; const std::shared_ptr<SiteLogic>& sl = changedlist.second.second; const std::shared_ptr<Site>& site = sl->getSite(); const SkipList& skip = site->getSkipList(); std::string subpath = sr->getSubPathForFileList(fl); Path subpathpath(subpath); std::shared_ptr<Race> race = sr->getRace(); bool racemode = race->getProfile() == SPREAD_RACE; const SkipList & secskip = race->getSectionSkipList(); if (fl->getState() == FileListState::FAILED) { scoreboard->wipe(fl); failboard->wipe(fl); fl->unsetInScoreBoard(); continue; } for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator cmpit = race->begin(); cmpit != race->end(); cmpit++) { const std::shared_ptr<SiteLogic> & cmpsl = cmpit->second; const std::shared_ptr<Site> & cmpsite = cmpsl->getSite(); const SkipList & cmpskip = cmpsite->getSkipList(); const std::shared_ptr<SiteRace> & cmpsr = cmpit->first; bool regulartransferpossible = raceTransferPossible(sl, sr, cmpsl, cmpsr, race); std::shared_ptr<FileList> cmprootfl = cmpsr->getFileListForPath(""); if (!subpath.empty()) { SkipListMatch dirmatch = cmpskip.check(subpath, true, true, &secskip); if (dirmatch.action == SKIPLIST_DENY || (dirmatch.action == SKIPLIST_UNIQUE && cmprootfl->containsPatternBefore(dirmatch.matchpattern, true, subpath))) { continue; } } std::shared_ptr<FileList> cmpfl = cmpsr->getFileListForPath(subpath); if (!cmpfl) { cmpsr->addSubDirectory(subpath); continue; } FileListState cmpstate = cmpfl->getState(); if (cmpstate == FileListState::UNKNOWN) { continue; } bool cmpfailed = cmpstate == FileListState::FAILED; int avgspeed = site->getAverageSpeed(cmpsite->getName()); if (avgspeed > maxavgspeed) { avgspeed = maxavgspeed; } SitePriority cmppriority = cmpsite->getPriority(); for (std::unordered_set<std::string>::const_iterator it = fl->scoreBoardChangedFilesBegin(); it != fl->scoreBoardChangedFilesEnd(); it++) { const std::string & name = *it; File * f = fl->getFile(name); if (f == nullptr) { // special case when file has been deleted, reverse transfer from cmp->changed scoreboard->remove(name, fl, cmpfl); failboard->remove(name, fl, cmpfl); if (cmpfailed || !raceTransferPossible(cmpsl, cmpsr, sl, sr, race)) { continue; } f = cmpfl->getFile(name); if (f == nullptr) { continue; } if (!subpath.empty()) { SkipListMatch dirmatch = skip.check(subpath, true, true, &secskip); if (dirmatch.action == SKIPLIST_DENY || (dirmatch.action == SKIPLIST_UNIQUE && sr->getFileListForPath("")->containsPatternBefore(dirmatch.matchpattern, true, subpath))) { continue; } } if (fl->contains(name) || f->isDirectory() || f->getSize() == 0) { continue; } SkipListMatch filematch = skip.check((subpathpath / name).toString(), false, true, &secskip); if (filematch.action == SKIPLIST_DENY || (filematch.action == SKIPLIST_UNIQUE && fl->containsPattern(filematch.matchpattern, false))) { continue; } if (filematch.action == SKIPLIST_SIMILAR) { if (!fl->similarChecked()) { fl->checkSimilar(&skip, &secskip); } if (fl->containsUnsimilar(name)) { continue; } } SitePriority priority = site->getPriority(); avgspeed = cmpsite->getAverageSpeed(site->getName()); if (avgspeed > maxavgspeed) { avgspeed = maxavgspeed; } PrioType p = getPrioType(f); unsigned long long int filesize = f->getSize(); unsigned short score = calculateScore(p, filesize, race, cmpfl, cmpsr, fl, sr, avgspeed, priority, racemode); std::shared_ptr<ScoreBoard> & updateboard = (race->hasFailedTransfer(name, cmpfl, fl)) ? failboard : scoreboard; updateboard->update(name, score, filesize, p, cmpsl, cmpfl, cmpsr, sl, fl, sr, race, subpath); race->resetUpdateCheckCounter(); continue; } if (scoreboard->remove(name, cmpfl, fl)) { scoreboard->resetSkipChecked(fl); } failboard->remove(name, cmpfl, fl); if (cmpfailed || cmpfl->contains(name) || !regulartransferpossible || f->isDirectory() || f->getSize() == 0) { continue; } SkipListMatch filematch = cmpskip.check((subpathpath / name).toString(), false, true, &secskip); if (filematch.action == SKIPLIST_DENY || (filematch.action == SKIPLIST_UNIQUE && cmpfl->containsPattern(filematch.matchpattern, false))) { continue; } if (filematch.action == SKIPLIST_SIMILAR) { if (!cmpfl->similarChecked()) { cmpfl->checkSimilar(&cmpskip, &secskip); } if (cmpfl->containsUnsimilar(name)) { continue; } } PrioType p = getPrioType(f); unsigned long long int filesize = f->getSize(); unsigned short score = calculateScore(p, filesize, race, fl, sr, cmpfl, cmpsr, avgspeed, cmppriority, racemode); std::shared_ptr<ScoreBoard> & updateboard = (race->hasFailedTransfer(name, fl, cmpfl)) ? failboard : scoreboard; updateboard->update(name, score, filesize, p, sl, fl, sr, cmpsl, cmpfl, cmpsr, race, subpath); race->resetUpdateCheckCounter(); } } fl->resetScoreBoardUpdates(); } spreadjobfilelistschanged.clear(); scoreboard->sort(); scoreboard->shuffleEquals(); } void Engine::refreshScoreBoard() { std::vector<ScoreBoardElement *>::iterator it; for (it = scoreboard->begin(); it != scoreboard->end(); ++it) { ScoreBoardElement * sbe = *it; sbe->update(calculateScore(sbe)); } scoreboard->sort(); scoreboard->shuffleEquals(); } void Engine::refreshPendingTransferList(const std::shared_ptr<TransferJob>& tj) { std::unordered_map<std::shared_ptr<TransferJob>, std::list<PendingTransfer> >::iterator it = pendingtransfers.find(tj); if (it == pendingtransfers.end()) { pendingtransfers[tj] = std::list<PendingTransfer>(); } it = pendingtransfers.find(tj); std::list<PendingTransfer> & list = it->second; list.clear(); tj->clearExisting(); switch (tj->getType()) { case TRANSFERJOB_DOWNLOAD: { std::unordered_map<std::string, std::shared_ptr<FileList>>::const_iterator it2; for (it2 = tj->srcFileListsBegin(); it2 != tj->srcFileListsEnd(); it2++) { const std::shared_ptr<FileList>& srclist = it2->second; std::shared_ptr<LocalFileList> dstlist = tj->findLocalFileList(it2->first); for (std::list<File *>::iterator srcit = srclist->begin(); srcit != srclist->end(); srcit++) { File * f = *srcit; const std::string & filename = f->getName(); if ((it2->first != "" || filename == tj->getSrcFileName()) && !f->isDirectory() && f->getSize() > 0) { std::unordered_map<std::string, LocalFile>::const_iterator dstit; if (!dstlist) { dstlist = tj->wantedLocalDstList(it2->first); } dstit = dstlist->find(filename); if (tj->hasFailedTransfer((Path(dstlist->getPath()) / filename).toString())) { continue; } const Path subpath = it2->first; if (!dstlist || dstit == dstlist->end() || dstit->second.getSize() == 0) { PendingTransfer p(tj->getSrc(), srclist, filename, dstlist, filename); addPendingTransfer(list, p); tj->addPendingTransfer(subpath / filename, f->getSize()); } else { tj->targetExists(subpath / filename); } } } } break; } case TRANSFERJOB_UPLOAD: { std::unordered_map<std::string, std::shared_ptr<LocalFileList> >::const_iterator lit; for (lit = tj->localFileListsBegin(); lit != tj->localFileListsEnd(); lit++) { std::shared_ptr<FileList> dstlist = tj->findDstList(lit->first); if (dstlist == NULL || dstlist->getState() == FileListState::UNKNOWN || dstlist->getState() == FileListState::EXISTS) { continue; } for (std::unordered_map<std::string, LocalFile>::const_iterator lfit = lit->second->begin(); lfit != lit->second->end(); lfit++) { if ((lit->first != "" || lfit->first == tj->getSrcFileName()) && !lfit->second.isDirectory() && lfit->second.getSize() > 0) { std::string filename = lfit->first; const Path subpath = lit->first; if (dstlist->getFile(filename) == NULL) { if (tj->hasFailedTransfer((Path(dstlist->getPath()) / filename).toString())) { continue; } PendingTransfer p(lit->second, filename, tj->getDst(), dstlist, filename); addPendingTransfer(list, p); tj->addPendingTransfer(subpath / filename, lfit->second.getSize()); } else { tj->targetExists(subpath / filename); } } } } break; } case TRANSFERJOB_FXP: { std::unordered_map<std::string, std::shared_ptr<FileList>>::const_iterator it2; for (it2 = tj->srcFileListsBegin(); it2 != tj->srcFileListsEnd(); it2++) { const std::shared_ptr<FileList>& srclist = it2->second; std::shared_ptr<FileList> dstlist = tj->findDstList(it2->first); if (dstlist == NULL || dstlist->getState() == FileListState::UNKNOWN || dstlist->getState() == FileListState::EXISTS) { continue; } for (std::list<File *>::iterator srcit = srclist->begin(); srcit != srclist->end(); srcit++) { File * f = *srcit; const std::string & filename = f->getName(); if ((it2->first != "" || filename == tj->getSrcFileName()) && !f->isDirectory() && f->getSize() > 0) { const Path subpath = it2->first; if (dstlist->getFile(filename) == NULL) { if (tj->hasFailedTransfer((Path(dstlist->getPath()) / filename).toString())) { continue; } PendingTransfer p(tj->getSrc(), srclist, filename, tj->getDst(), dstlist, filename); addPendingTransfer(list, p); tj->addPendingTransfer(subpath / filename, f->getSize()); } else { tj->targetExists(subpath / filename); } } } } break; } } tj->updateStatus(); } void Engine::addPendingTransfer(std::list<PendingTransfer> & list, PendingTransfer & p) { std::string extension = File::getExtension(p.getSrcFileName()); if (extension == "sfv" || extension == "nfo") { list.push_front(p); // sfv and nfo files have top priority } else { list.push_back(p); } } void Engine::issueOptimalTransfers() { std::vector<ScoreBoardElement *>::const_iterator it; ScoreBoardElement * sbe; std::shared_ptr<SiteLogic> sls; std::shared_ptr<SiteLogic> sld; std::string filename; std::shared_ptr<Race> race; std::list<std::tuple<std::string, std::shared_ptr<FileList>, std::shared_ptr<FileList>>> removelist; for (it = scoreboard->begin(); it != scoreboard->end(); it++) { sbe = *it; sls = sbe->getSource(); sld = sbe->getDestination(); race = sbe->getRace(); filename = sbe->fileName(); if (!sld->uploadSlotAvailable()) { continue; } if (!sbe->skipChecked()) { sbe->setSkipChecked(); SkipListMatch match = sbe->getDestination()->getSite()->getSkipList().check( (Path(sbe->subDir()) / filename).toString(), false, true, &sbe->getRace()->getSectionSkipList()); if (match.action == SKIPLIST_SIMILAR) { if (!sbe->getDestinationFileList()->similarChecked()) { sbe->getDestinationFileList()->checkSimilar(&sbe->getDestination()->getSite()->getSkipList(), &sbe->getRace()->getSectionSkipList()); } } if ((match.action == SKIPLIST_UNIQUE && sbe->getDestinationFileList()->containsPattern(match.matchpattern, false)) || (match.action == SKIPLIST_SIMILAR && sbe->getDestinationFileList()->containsUnsimilar(filename))) { removelist.emplace_back(sbe->fileName(), sbe->getSourceFileList(), sbe->getDestinationFileList()); continue; } } if (!transferExpectedSoon(sbe)) { continue; } //potentiality handling if (sbe->getPriorityType() == PrioType::NORMAL) { // priority files shouldn't affect the potential tracking sls->pushPotential(sbe->getScore(), filename, sld); } if (!sls->potentialCheck(sbe->getScore())) { continue; } TransferType type(TransferType::REGULAR); if (sbe->getSourceSiteRace()->isDownloadOnly()) { type = TransferType::PRE; } else if (sbe->getSourceSiteRace()->isDone()) { type = TransferType::COMPLETE; } if (!sls->downloadSlotAvailable(type)) { continue; } std::shared_ptr<TransferStatus> ts = global->getTransferManager()->suggestTransfer(filename, sls, sbe->getSourceFileList(), sld, sbe->getDestinationFileList(), sbe->getSourceSiteRace(), sbe->getDestinationSiteRace()); if (!!ts) { race->addTransfer(ts); } sbe->setAttempted(); } for (const std::tuple<std::string, std::shared_ptr<FileList>, std::shared_ptr<FileList>> & elem : removelist) { scoreboard->remove(std::get<0>(elem), std::get<1>(elem), std::get<2>(elem)); } if (!removelist.empty()) { scoreboard->sort(); scoreboard->shuffleEquals(); } } void Engine::transferFailed(const std::shared_ptr<TransferStatus> & ts, int err) { TransferStatusCallback * cb = ts->getCallback(); if (cb && cb->callbackType() == CallbackType::RACE && static_cast<Race *>(cb)->hasFailedTransfer(ts->getFile(), ts->getSourceFileList(), ts->getTargetFileList())) { ScoreBoardElement * sbe = scoreboard->find(ts->getFile(), ts->getSourceFileList(), ts->getTargetFileList()); if (sbe) { failboard->update(sbe); scoreboard->remove(sbe); scoreboard->sort(); scoreboard->shuffleEquals(); } } } void Engine::checkIfRaceComplete(const std::shared_ptr<SiteLogic> & sls, std::shared_ptr<Race> & race) { std::shared_ptr<SiteRace> srs = sls->getRace(race->getName()); if (!srs->isDone()) { bool unfinisheddirs = false; bool emptydirs = false; int completedlists = 0; std::unordered_set<std::string> subpaths = race->getSubPaths(); for (std::unordered_set<std::string>::iterator itsp = subpaths.begin(); itsp != subpaths.end(); itsp++) { std::shared_ptr<FileList> spfl = srs->getFileListForPath(*itsp); if (!!spfl && spfl->getState() == FileListState::LISTED) { if (!race->sizeEstimated(*itsp)) { if (spfl->getSize() > 0) { unfinisheddirs = true; continue; } emptydirs = true; } else if (spfl->getNumUploadedFiles() >= race->estimatedSize(*itsp) && spfl->timeSinceLastChanged() > STATICTIMEFORCOMPLETION && sls->getCurrLogins() > sls->getCurrUp() + sls->getCurrDown() && !spfl->hasFilesUploading()) { completedlists++; if (!srs->isSubPathComplete(spfl)) { srs->subPathComplete(spfl); } } else { unfinisheddirs = true; continue; } } else { unfinisheddirs = true; continue; } } if (completedlists > 0 && !unfinisheddirs) { if (emptydirs) { race->reportSemiDone(srs); } else { int uploadslotcount = 0; for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it = race->begin(); it != race->end(); it++) { if (it->second != sls && !it->first->isDone()) { uploadslotcount += it->second->getSite()->getMaxUp(); } } sls->raceLocalComplete(srs, uploadslotcount); global->getEventLog()->log("Engine", "Spread job " + race->getName() + " completed on " + sls->getSite()->getName()); } if (race->isDone()) { raceComplete(race); } } } } void Engine::raceComplete(const std::shared_ptr<Race>& race) { for (std::list<std::shared_ptr<Race> >::iterator it = currentraces.begin(); it != currentraces.end(); it++) { if ((*it) == race) { currentraces.erase(it); finishedraces.push_back(race); break; } } issueGlobalComplete(race); global->getEventLog()->log("Engine", "Spread job globally completed: " + race->getName()); if (dropped) { global->getEventLog()->log("Engine", "Scoreboard refreshes dropped since spread job start: " + std::to_string(dropped)); } return; } void Engine::transferJobComplete(const std::shared_ptr<TransferJob>& tj) { global->getEventLog()->log("Engine", tj->typeString() + " job complete: " + tj->getSrcFileName()); for (std::list<std::shared_ptr<TransferJob> >::iterator it = currenttransferjobs.begin(); it != currenttransferjobs.end(); it++) { if ((*it) == tj) { currenttransferjobs.erase(it); break; } } } unsigned short Engine::calculateScore(ScoreBoardElement * sbe) const { const std::shared_ptr<Race> & race = sbe->getRace(); SitePriority priority = sbe->getDestination()->getSite()->getPriority(); int avgspeed = sbe->getSource()->getSite()->getAverageSpeed(sbe->getDestination()->getSite()->getName()); return calculateScore(sbe->getPriorityType(), sbe->getFileSize(), race, sbe->getSourceFileList(), sbe->getSourceSiteRace(), sbe->getDestinationFileList(), sbe->getDestinationSiteRace(), avgspeed, priority, race->getProfile() == SPREAD_RACE); } unsigned short Engine::calculateScore(PrioType priotype, unsigned long long int filesize, const std::shared_ptr<Race> & itr, const std::shared_ptr<FileList>& fls, const std::shared_ptr<SiteRace> & srs, const std::shared_ptr<FileList>& fld, const std::shared_ptr<SiteRace> & srd, int avgspeed, SitePriority priority, bool racemode) const { switch (priotype) { case PrioType::PRIO: return 10000; case PrioType::PRIO_LATER: if (itr->getTimeSpent() > NFO_PRIO_AFTER_SEC) { return 10000; } break; case PrioType::NORMAL: break; } unsigned short points = 0; unsigned long long int maxfilesize = srs->getMaxFileSize(); if (avgspeed > maxavgspeed) { avgspeed = maxavgspeed; } if (filesize > maxfilesize) { maxfilesize = filesize; } if (maxfilesize) { unsigned long long int pointsfilesize = maxpointsfilesize; pointsfilesize *= filesize; pointsfilesize /= maxfilesize; points += pointsfilesize; } points += getSpeedPoints(avgspeed); if (racemode) { if (priority >= SitePriority::VERY_HIGH) { points += maxpointspercentageowned; } else { unsigned long long int pointspercentageowned = maxpointspercentageowned; int unownedpercentage = 100 - fld->getOwnedPercentage(); pointspercentageowned *= unownedpercentage; pointspercentageowned /= 100; points += pointspercentageowned; } } else { if (priority >= SitePriority::VERY_HIGH) { points += maxpointslowprogress; } else { unsigned long long int pointslowprogress = maxpointslowprogress; int maxprogress = itr->getMaxSiteNumFilesProgress(); if (maxprogress) { pointslowprogress *= fld->getNumUploadedFiles(); pointslowprogress /= maxprogress; points += pointslowprogress; } } } points += getPriorityPoints(priority); assert(points >= 0 && points < 10000); return points; } void Engine::setSpeedScale() { maxavgspeed = 1024; for (std::list<std::shared_ptr<Race> >::iterator itr = currentraces.begin(); itr != currentraces.end(); itr++) { for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator its = (*itr)->begin(); its != (*itr)->end(); its++) { for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator itd = (*itr)->begin(); itd != (*itr)->end(); itd++) { int avgspeed = its->second->getSite()->getAverageSpeed(itd->second->getSite()->getName()); if (avgspeed > maxavgspeed) maxavgspeed = avgspeed; } } } } void Engine::preSeedPotentialData(const std::shared_ptr<Race>& race) { std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator srcit; std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator dstit; int maxpointssizeandowned = getMaxPointsFileSize() + getMaxPointsPercentageOwned(); for (srcit = race->begin(); srcit != race->end(); srcit++) { const std::shared_ptr<SiteRace>& srs = srcit->first; const std::shared_ptr<SiteLogic> & sls = srcit->second; if (sls->getSite()->getAllowDownload() == SITE_ALLOW_TRANSFER_NO || (sls->getSite()->getAllowDownload() == SITE_ALLOW_DOWNLOAD_MATCH_ONLY && !srcit->first->isDownloadOnly())) { continue; } for (dstit = race->begin(); dstit != race->end(); dstit++) { const std::shared_ptr<SiteRace>& srd = dstit->first; const std::shared_ptr<SiteLogic> & sld = dstit->second; if (!raceTransferPossible(sls, srs, sld, srd, race)) { continue; } int priopoints = getPriorityPoints(sld->getSite()->getPriority()); int speedpoints = getSpeedPoints(sls->getSite()->getAverageSpeed(sld->getSite()->getName())); for (unsigned int i = 0; i < sld->getSite()->getMaxUp(); ++i) { sls->pushPotential(maxpointssizeandowned + priopoints + speedpoints, "preseed", sld); } } } } bool Engine::raceTransferPossible(const std::shared_ptr<SiteLogic>& sls, const std::shared_ptr<SiteRace>& srs, const std::shared_ptr<SiteLogic>& sld, const std::shared_ptr<SiteRace>& srd, const std::shared_ptr<Race>& race) const { if (sls == sld) return false; const std::shared_ptr<Site> & srcsite = sls->getSite(); const std::shared_ptr<Site> & dstsite = sld->getSite(); if (srcsite->getAllowDownload() == SITE_ALLOW_TRANSFER_NO || (srcsite->getAllowDownload() == SITE_ALLOW_DOWNLOAD_MATCH_ONLY && !srs->isDownloadOnly())) { return false; } if (dstsite->getAllowUpload() == SITE_ALLOW_TRANSFER_NO) { return false; } if (!srcsite->isAllowedTargetSite(dstsite)) { return false; } if (srd->isDownloadOnly()) { return false; } if (srcsite->hasBrokenPASV() && dstsite->hasBrokenPASV()) { return false; } // protocol check if (!transferProtocolCombinationPossible(srcsite->getTransferProtocol(), dstsite->getTransferProtocol())) { return false; } //ssl check int srcpolicy = srcsite->getSSLTransferPolicy(); int dstpolicy = dstsite->getSSLTransferPolicy(); if ((srcpolicy == SITE_SSL_ALWAYS_OFF && dstpolicy == SITE_SSL_ALWAYS_ON) || (srcpolicy == SITE_SSL_ALWAYS_ON && dstpolicy == SITE_SSL_ALWAYS_OFF)) { return false; } if ((srcpolicy == SITE_SSL_ALWAYS_ON || dstpolicy == SITE_SSL_ALWAYS_ON) && !srcsite->supportsSSCN() && !dstsite->supportsSSCN()) { return false; } return true; } unsigned int Engine::preparedRaces() const { return preparedraces.size(); } unsigned int Engine::currentRaces() const { return currentraces.size(); } unsigned int Engine::allRaces() const { return allraces.size(); } unsigned int Engine::currentTransferJobs() const { return currenttransferjobs.size(); } unsigned int Engine::allTransferJobs() const { return alltransferjobs.size(); } std::shared_ptr<Race> Engine::getRace(unsigned int id) const { std::list<std::shared_ptr<Race> >::const_iterator it; for (it = allraces.begin(); it != allraces.end(); it++) { if ((*it)->getId() == id) { return *it; } } return std::shared_ptr<Race>(); } std::shared_ptr<Race> Engine::getRace(const std::string & race) const { std::list<std::shared_ptr<Race> >::const_iterator it; for (it = allraces.begin(); it != allraces.end(); it++) { if ((*it)->getName() == race) { return *it; } } return std::shared_ptr<Race>(); } std::shared_ptr<TransferJob> Engine::getTransferJob(unsigned int id) const { std::list<std::shared_ptr<TransferJob> >::const_iterator it; for (it = alltransferjobs.begin(); it != alltransferjobs.end(); it++) { if ((*it)->getId() == id) { return *it; } } return std::shared_ptr<TransferJob>(); } std::list<std::shared_ptr<PreparedRace> >::const_iterator Engine::getPreparedRacesBegin() const { return preparedraces.begin(); } std::list<std::shared_ptr<PreparedRace> >::const_iterator Engine::getPreparedRacesEnd() const { return preparedraces.end(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getRacesBegin() const { return allraces.begin(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getRacesEnd() const { return allraces.end(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getCurrentRacesBegin() const { return currentraces.begin(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getCurrentRacesEnd() const { return currentraces.end(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getFinishedRacesBegin() const { return finishedraces.begin(); } std::list<std::shared_ptr<Race> >::const_iterator Engine::getFinishedRacesEnd() const { return finishedraces.end(); } std::list<std::shared_ptr<TransferJob> >::const_iterator Engine::getTransferJobsBegin() const { return alltransferjobs.begin(); } std::list<std::shared_ptr<TransferJob> >::const_iterator Engine::getTransferJobsEnd() const { return alltransferjobs.end(); } void Engine::tick(int message) { if (startnextprepared && getNextPreparedRaceStarterTimeout() != 0) { nextpreparedtimeremaining -= POKEINTERVAL; if (nextpreparedtimeremaining <= 0) { startnextprepared = false; global->getEventLog()->log("Engine", "Next prepared spread job starter timed out."); } } for (std::list<std::shared_ptr<Race> >::iterator it = currentraces.begin(); it != currentraces.end(); it++) { std::shared_ptr<Race> race = *it; int timeoutafterseconds = race->timeoutCheck(); if (timeoutafterseconds != -1) { if (waitingInScoreBoard(race)) { race->resetUpdateCheckCounter(); continue; } if ((*it)->failedTransfersCleared()) { global->getEventLog()->log("Engine", "No activity for " + std::to_string(timeoutafterseconds) + " seconds, aborting spread job: " + (*it)->getName()); for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator its = race->begin(); its != race->end(); its++) { its->first->timeout(); its->second->raceLocalComplete(its->first, 0, false); } race->setTimeout(); currentraces.erase(it); finishedraces.push_back(race); issueGlobalComplete(race); break; } else { if (race->clearTransferAttempts()) { restoreFromFailed(race); race->resetUpdateCheckCounter(); std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it2; for (it2 = race->begin(); it2 != race->end(); it2++) { it2->second->activateOne(); } } } } for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator it2 = (*it)->begin(); it2 != (*it)->end(); it2++) { int wantedlogins = it2->second->getSite()->getMaxDown(); if (!it2->first->isDone()) { wantedlogins = it2->second->getSite()->getMaxLogins(); } if (it2->second->getCurrLogins() + it2->second->getCleanlyClosedConnectionsCount() < wantedlogins && (it2->first->getMaxFileSize() || (*it)->getTimeSpent() < RETRY_CONNECT_UNTIL_SEC)) { it2->second->activateAll(); } } } for (std::list<std::shared_ptr<TransferJob> >::const_iterator it = currenttransferjobs.begin(); it != currenttransferjobs.end(); it++) { if ((*it)->isDone()) { transferJobComplete(*it); break; } else { if (!!(*it)->getSrc() && !(*it)->getSrc()->getCurrLogins()) { (*it)->getSrc()->haveConnectedActivate((*it)->maxSlots()); } if (!!(*it)->getDst() && !(*it)->getDst()->getCurrLogins()) { (*it)->getDst()->haveConnectedActivate((*it)->maxSlots()); } } } std::list<unsigned int> removeids; for (std::list<std::shared_ptr<PreparedRace> >::const_iterator it = preparedraces.begin(); it != preparedraces.end(); it++) { (*it)->tick(); if ((*it)->getRemainingTime() < 0) { removeids.push_back((*it)->getId()); } } while (removeids.size() > 0) { unsigned int id = removeids.front(); removeids.pop_front(); for (std::list<std::shared_ptr<PreparedRace> >::iterator it = preparedraces.begin(); it != preparedraces.end(); it++) { if ((*it)->getId() == id) { preparedraces.erase(it); break; } } } if (!currentraces.size() && !currenttransferjobs.size() && !preparedraces.size() && !startnextprepared && pokeregistered) { global->getTickPoke()->stopPoke(this, 0); pokeregistered = false; } estimateRaceSizes(); refreshScoreBoard(); forcescoreboard = true; } void Engine::issueGlobalComplete(const std::shared_ptr<Race> & race) { for (std::set<std::pair<std::shared_ptr<SiteRace>, std::shared_ptr<SiteLogic> > >::const_iterator itd = race->begin(); itd != race->end(); itd++) { itd->second->raceGlobalComplete(itd->first); wipeFromScoreBoard(itd->first); skiplistcachesites.insert(itd->second->getSite()); } skiplistcachesections.insert(race->getSection()); if (currentraces.empty()) { clearSkipListCaches(); } } std::shared_ptr<ScoreBoard> Engine::getScoreBoard() const { return scoreboard; } void Engine::checkStartPoke() { if (!pokeregistered) { global->getTickPoke()->startPoke(this, "Engine", POKEINTERVAL, TICK_MSG_TICKER); pokeregistered = true; } } std::shared_ptr<Race> Engine::getCurrentRace(const std::string & release) const { for (std::list<std::shared_ptr<Race> >::const_iterator it = currentraces.begin(); it != currentraces.end(); it++) { if ((*it)->getName() == release) { return *it; } } return std::shared_ptr<Race>(); } void Engine::addSiteToRace(const std::shared_ptr<Race>& race, const std::string& site, bool downloadonly) { const std::shared_ptr<SiteLogic> sl = global->getSiteLogicManager()->getSiteLogic(site); bool affil = sl->getSite()->isAffiliated(race->getGroup()); if (sl->getSite()->getSkipList().check((sl->getSite()->getSectionPath(race->getSection()) / race->getName()).toString(), true, false, &race->getSectionSkipList()).action != SKIPLIST_DENY || affil || downloadonly) { downloadonly = downloadonly || (affil && race->getProfile() != SPREAD_DISTRIBUTE); std::shared_ptr<SiteRace> sr = sl->addRace(race, race->getSection(), race->getName(), downloadonly); race->addSite(sr, sl); } } int Engine::getMaxPointsRaceTotal() const { return getMaxPointsFileSize() + getMaxPointsAvgSpeed() + getMaxPointsPriority() + getMaxPointsPercentageOwned(); } int Engine::getMaxPointsFileSize() const { return maxpointsfilesize; } int Engine::getMaxPointsAvgSpeed() const { return maxpointsavgspeed; } int Engine::getMaxPointsPriority() const { return maxpointspriority; } int Engine::getMaxPointsPercentageOwned() const { return maxpointspercentageowned; } int Engine::getMaxPointsLowProgress() const { return maxpointslowprogress; } int Engine::getPriorityPoints(SitePriority priority) const { switch (priority) { case SitePriority::VERY_LOW: return 0; case SitePriority::LOW: return maxpointspriority * 0.2; case SitePriority::NORMAL: return maxpointspriority * 0.4; case SitePriority::HIGH: return maxpointspriority * 0.6; case SitePriority::VERY_HIGH: return maxpointspriority; } return 0; } int Engine::getSpeedPoints(int avgspeed) const { if (maxavgspeed) { unsigned long long int pointsavgspeed = maxpointsavgspeed; pointsavgspeed *= avgspeed; pointsavgspeed /= maxavgspeed; return pointsavgspeed; } return 0; } int Engine::getPreparedRaceExpiryTime() const { return preparedraceexpirytime; } void Engine::setPreparedRaceExpiryTime(int expirytime) { preparedraceexpirytime = expirytime; } void Engine::setNextPreparedRaceStarterTimeout(int timeout) { startnextpreparedtimeout = timeout; }
37.953125
248
0.634157
[ "vector" ]
e51501609beceff5ebf637922f699643ef7c3bcd
28,579
cpp
C++
src/graphics/bsplib/statestack.cpp
Terebinth/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
117
2015-01-13T14:48:49.000Z
2022-03-16T01:38:19.000Z
src/graphics/bsplib/statestack.cpp
darongE/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
4
2015-05-01T13:09:53.000Z
2017-07-22T09:11:06.000Z
src/graphics/bsplib/statestack.cpp
darongE/freefalcon-central
c28d807183ab447ef6a801068aa3769527d55deb
[ "BSD-2-Clause" ]
78
2015-01-13T09:27:47.000Z
2022-03-18T14:39:09.000Z
/***************************************************************************\ StateStack.cpp Scott Randolph February 9, 1998 JAM 29Sep03 - Begin Major Rewrite. \***************************************************************************/ #include "stdafx.h" #include <math.h> #include "ColorBank.h" #include "ObjectInstance.h" #include "ClipFlags.h" #include "StateStack.h" #include "context.h" #include "vmath.h" #include "fmath.h" #include "FalcLib/include/playerop.h" #include "FalcLib/include/dispopts.h" #include "Graphics/DXEngine/DXTools.h" #include "Graphics/DXEngine/DXDefines.h" #include "Graphics/DXEngine/DXEngine.h" #include "Graphics/DXEngine/DXVBManager.h" extern bool g_bUse_DX_Engine; extern "C" { void MonoPrint(char *string, ...); } #define PERSP_CORR_RADIUS_MULTIPLIER 3.f extern bool g_bSlowButSafe; extern int g_nFogRenderState; StateStackClass TheStateStack; int verts = 0; // Create the global storage for our static members. TransformFp StateStackClass::Transform; float StateStackClass::LODRange; float StateStackClass::LODBiasInv; float StateStackClass::fogValue; Pmatrix StateStackClass::Rotation; Ppoint StateStackClass::Xlation; D3DFrame::Matrix StateStackClass::mV; D3DFrame::Matrix StateStackClass::mW; D3DFrame::Matrix StateStackClass::mP; Ppoint StateStackClass::ObjSpaceEye; Ppoint StateStackClass::ObjSpaceLight; ContextMPR *StateStackClass::context; const int *StateStackClass::CurrentTextureTable; Spoint *StateStackClass::XformedPosPool; Spoint *StateStackClass::XformedPosPoolNext; Pintensity *StateStackClass::IntensityPool; Pintensity *StateStackClass::IntensityPoolNext; PclipInfo *StateStackClass::ClipInfoPool; PclipInfo *StateStackClass::ClipInfoPoolNext; class ObjectInstance *StateStackClass::CurrentInstance; const class ObjectLOD *StateStackClass::CurrentLOD; StateStackFrame StateStackClass::stack[MAX_STATE_STACK_DEPTH]; int StateStackClass::stackDepth; float StateStackClass::hAspectWidthCorrection; float StateStackClass::hAspectDepthCorrection; float StateStackClass::vAspectWidthCorrection; float StateStackClass::vAspectDepthCorrection; float StateStackClass::scaleX; float StateStackClass::scaleY; float StateStackClass::shiftX; float StateStackClass::shiftY; int StateStackClass::LODused; Pmatrix *StateStackClass::Tt; Pmatrix *StateStackClass::Tb; float StateStackClass::lightAmbient = .3f; float StateStackClass::lightDiffuse = .6f; float StateStackClass::lightSpecular = .6f; Ppoint StateStackClass::lightVector; // Reserved storage space for computed values. static Spoint XformedPosPoolBuffer[MAX_VERT_POOL_SIZE]; static Pintensity IntensityPoolBuffer[MAX_VERT_POOL_SIZE]; static PclipInfo ClipInfoPoolBuffer[MAX_VERT_POOL_SIZE]; inline void normalizeVector(Ppoint *v) { float mag = SqrtF(v->x * v->x + v->y * v->y + v->z * v->z); v->x /= mag; v->y /= mag; v->z /= mag; } // Functions used to maintain the states above. StateStackClass::StateStackClass() { stackDepth = 0; XformedPosPoolNext = XformedPosPoolBuffer; IntensityPoolNext = IntensityPoolBuffer; ClipInfoPoolNext = ClipInfoPoolBuffer; LODBiasInv = 1.0f; SetTextureState(TRUE); SetFog(1.f, NULL); } void StateStackClass::SetContext(ContextMPR *cntxt) { context = cntxt; } void StateStackClass::SetLight(float a, float d, float s, Ppoint *atLight) { lightAmbient = d; lightDiffuse = a; lightSpecular = s; memcpy(&lightVector, atLight, sizeof(Ppoint)); ObjSpaceLight = lightVector; // COBRA - DX - Switching btw Old and New Engine - the DX SUNLight if (g_bUse_DX_Engine) { // Setup light properties TheDXEngine.SetSunLight(a, d , s); // Setup Light Vector - Light direction has to be reversed D3DVECTOR Dir; Dir.x = -ObjSpaceLight.x; Dir.y = -ObjSpaceLight.y; Dir.z = -ObjSpaceLight.z; TheDXEngine.SetSunVector(Dir); } } void StateStackClass::SetCameraProperties(float ooTanHHAngle, float ooTanVHAngle, float sclx, float scly, float shftx, float shfty) { float rx2; rx2 = (ooTanHHAngle * ooTanHHAngle); hAspectDepthCorrection = 1.f / (float)sqrt(rx2 + 1.0f); hAspectWidthCorrection = rx2 * hAspectDepthCorrection; rx2 = (ooTanVHAngle * ooTanVHAngle); vAspectDepthCorrection = 1.f / (float)sqrt(rx2 + 1.0f); vAspectWidthCorrection = rx2 * vAspectDepthCorrection; scaleX = sclx; scaleY = scly; shiftX = shftx; shiftY = shfty; } void StateStackClass::SetTextureState(BOOL state) { if (state) { RenderStateTablePC = RenderStateTableWithPCTex; RenderStateTableNPC = RenderStateTableWithNPCTex; DrawPrimNoFogNoClipJumpTable = DrawPrimNoClipWithTexJumpTable; ClipPrimNoFogJumpTable = ClipPrimWithTexJumpTable; DrawPrimFogNoClipJumpTable = DrawPrimFogNoClipWithTexJumpTable; ClipPrimFogJumpTable = ClipPrimFogWithTexJumpTable; } else { RenderStateTablePC = RenderStateTableNoTex; RenderStateTableNPC = RenderStateTableNoTex; DrawPrimNoFogNoClipJumpTable = DrawPrimNoClipNoTexJumpTable; ClipPrimNoFogJumpTable = ClipPrimNoTexJumpTable; DrawPrimFogNoClipJumpTable = DrawPrimFogNoClipNoTexJumpTable; ClipPrimFogJumpTable = ClipPrimFogNoTexJumpTable; } // FIXME DrawPrimNoClipJumpTable = DrawPrimFogNoClipJumpTable; ClipPrimJumpTable = ClipPrimFogJumpTable; } void StateStackClass::SetFog(float alpha, Pcolor *color) { if (color) { UInt32 c; c = FloatToInt32(color->r * 255.9f); c or_eq FloatToInt32(color->g * 255.9f) << 8; c or_eq FloatToInt32(color->b * 255.9f) << 16; context->SetState(MPR_STA_FOG_COLOR, c); D3DCOLORVALUE cx; cx.dvR = color->r; cx.dvG = color->g; cx.dvB = color->b; cx.dvA = color->a; TheDXEngine.SetFogColor(&cx); } fogValue = alpha; TheDXEngine.SetFogLevel(fogValue); // FIXME DrawPrimNoClipJumpTable = DrawPrimFogNoClipJumpTable; ClipPrimJumpTable = ClipPrimFogJumpTable; } void StateStackClass::SetView(const Ppoint *pos, Pmatrix *cameraRot) { D3DFrame::Vector vP; float pitch = (float) - asin(cameraRot->M13); float roll = (float)atan2(cameraRot->M23, cameraRot->M33); float yaw = (float)atan2(cameraRot->M12, cameraRot->M11); vP.x = pos->y; vP.y = -pos->z; vP.z = pos->x; mV.SetViewMatrix(pitch, roll, yaw, vP); /* if(g_bUse_DX_Engine){ D3DXMATRIX Camera,p; D3DXMatrixIdentity(&Camera); }*/ } void StateStackClass::SetWorld(const Pmatrix *rot, const Ppoint *pos) { mW.InitIdentity(); mW.m[0][0] = rot->M11; mW.m[0][1] = rot->M12; mW.m[0][2] = rot->M13; mW.m[1][0] = rot->M21; mW.m[1][1] = rot->M22; mW.m[1][2] = rot->M23; mW.m[2][0] = rot->M31; mW.m[2][1] = rot->M32; mW.m[2][2] = rot->M33; mW.m[3][0] = pos->x; mW.m[3][1] = pos->y; mW.m[3][2] = pos->z; mW.m[3][3] = 1.f; } void StateStackClass::SetProjection(float fov, float aspect) { // if(context) // mW.SetProjectionMatrix(fov,aspect,context->ZNEAR,context->ZFAR); } void StateStackClass::SetCamera(const Ppoint *pos, const Pmatrix *rotWaspect, Pmatrix *Bill, Pmatrix *Tree) { ShiAssert(stackDepth == 0); // COBRA - DX - Switching btw Old and New Engine - the Camera projections if (g_bUse_DX_Engine) { //*************************************************************************************** // DX - RED - The camera bitand view axis has to be reverted Pmatrix Temp; ZeroMemory(&Temp, sizeof(Temp)); /*Temp.M31=-1.0; Temp.M23=-1.0; Temp.M12=1.0;*/ Temp.M11 = Temp.M22 = Temp.M33 = 1.0f; MatrixMult(&Temp, rotWaspect, &Rotation); D3DXMATRIX Rot, BB; D3DVECTOR DXPos; DXPos.x = pos->x; DXPos.y = pos->y; DXPos.z = pos->z; AssignPmatrixToD3DXMATRIX(&Rot, &Rotation); AssignPmatrixToD3DXMATRIX(&BB, Bill); TheDXEngine.SetCamera(&Rot, DXPos, &BB); } // Store our rotation from world to camera space (including aspect scale effects) Rotation = *rotWaspect; // Compute the vector from the camera to the origin rotated into camera space Xlation.x = -pos->x * Rotation.M11 - pos->y * Rotation.M12 - pos->z * Rotation.M13; Xlation.y = -pos->x * Rotation.M21 - pos->y * Rotation.M22 - pos->z * Rotation.M23; Xlation.z = -pos->x * Rotation.M31 - pos->y * Rotation.M32 - pos->z * Rotation.M33; // Initialize the eye postion in world space ObjSpaceEye = *pos; Tb = Bill; Tt = Tree; } void StateStackClass::CompoundTransform(const Pmatrix *rot, const Ppoint *pos) { Ppoint tempP; // Compute the rotated translation vector for this object Xlation.x += pos->x * Rotation.M11 + pos->y * Rotation.M12 + pos->z * Rotation.M13; Xlation.y += pos->x * Rotation.M21 + pos->y * Rotation.M22 + pos->z * Rotation.M23; Xlation.z += pos->x * Rotation.M31 + pos->y * Rotation.M32 + pos->z * Rotation.M33; Pmatrix tempM = Rotation; tempP.x = ObjSpaceEye.x - pos->x; tempP.y = ObjSpaceEye.y - pos->y; tempP.z = ObjSpaceEye.z - pos->z; Ppoint tempP2 = ObjSpaceLight; // Composit the camera matrix with the object rotation MatrixMult(&tempM, rot, &Rotation); // Compute the eye point in object space MatrixMultTranspose(rot, &tempP, &ObjSpaceEye); // Compute the light direction in object space. MatrixMultTranspose(rot, &tempP2, &ObjSpaceLight); } // The asymetric scale factors MUST be <= 1.0f. // The global scale factor can be any positive value. // The effects of the scales are multiplicative. static const UInt32 OP_NONE = 0; static const UInt32 OP_FOG = 1; static const UInt32 OP_WARP = 2; /*inline*/ void StateStackClass::pvtDrawObject(UInt32 operation, ObjectInstance *objInst, const Pmatrix *rot, const Ppoint *pos, const float sx, const float sy, const float sz, const float scale) { UInt32 clipFlag; float MaxLODRange; static int in = 0; ShiAssert(objInst); PushAll(); // Set up our transformations CompoundTransform(rot, pos); SetWorld(rot, pos); if ((operation bitand OP_WARP) or (scale not_eq 1.f)) { Pmatrix tempM; float cx, cy, cz; cx = cz = cy = scale; if (operation bitand OP_WARP) { cx *= sx; cy *= sy; cz *= sz; } ShiAssert((sx > 0.0f) and (sx <= 1.0f)); ShiAssert((sy > 0.0f) and (sy <= 1.0f)); ShiAssert((sz > 0.0f) and (sz <= 1.0f)); Pmatrix stretchM = { cx, 0.f, 0.f, 0.f, cy, 0.f, 0.f, 0.f, cz }; tempM = Rotation; MatrixMult(&tempM, &stretchM, &Rotation); D3DFrame::Matrix mS, mT; mT = mW; mS.InitIdentity(); mS.m[0][0] = cx; mS.m[1][1] = cy; mS.m[2][2] = cz; mW = mS * mT; } /* if(scale not_eq 1.f) { Pmatrix tempM; Pmatrix scaleM = { scale, 0.f, 0.f, 0.f, scale, 0.f, 0.f, 0.f, scale }; tempM = Rotation; MatrixMult(&tempM,&scaleM,&Rotation); D3DFrame::Matrix mS,mT; mT = mW; mS.InitIdentity(); mS.m[0][0]=scale; mS.m[1][1]=scale; mS.m[2][2]=scale; mW = mS*mT; }*/ // Store the adjusted range for LOD determinations LODRange = Xlation.x * LODBiasInv; // Choose the appropriate LOD of the object to be drawn CurrentInstance = objInst; if (objInst->ParentObject) { if (g_bSlowButSafe and F4IsBadCodePtr((FARPROC) objInst->ParentObject)) // JB 010220 CTD (too much CPU) CurrentLOD = 0; // JB 010220 CTD else // JB 010220 CTD if (objInst->id < 0 or objInst->id >= TheObjectListLength or objInst->TextureSet < 0) // JB 010705 CTD second try { ShiAssert(FALSE); CurrentLOD = 0; } else CurrentLOD = objInst->ParentObject->ChooseLOD(LODRange, &LODused, &MaxLODRange); if (CurrentLOD) { // Decide if we need clipping, or if the object is totally off screen clipFlag = CheckBoundingSphereClipping(); // Continue only if some part of the bounding volume is on screen if (clipFlag not_eq OFF_SCREEN) { // Set the jump pointers to turn on/off clipping if (clipFlag == ON_SCREEN) { Transform = TransformNoClip; DrawPrimJumpTable = DrawPrimNoClipJumpTable; } else { Transform = TransformWithClip; DrawPrimJumpTable = DrawPrimWithClipJumpTable; } // Choose perspective correction or not // if ((Xlation.x > CurrentInstance->Radius() * PERSP_CORR_RADIUS_MULTIPLIER) and // not (CurrentLOD->flags bitand ObjectLOD::PERSP_CORR)) // { // RenderStateTable = RenderStateTableNPC; // } // else // { RenderStateTable = RenderStateTablePC; // } in ++; if (in == 1) { verts = 0; } // Draw the object CurrentLOD->Draw(); // if (in == 1) // { // if (verts) // { // MonoPrint ("Obj %d:%d %d : %d\n", objInst->id, LODused, (int) MaxLODRange, verts); // } // } in --; } } } PopAll(); } Ppoint Kpos = {0, 0, 0}; // This call is for the application to call to draw an instance of an object. void StateStackClass::DrawObject(ObjectInstance *objInst, const Pmatrix *rot, const Ppoint *pos, const float scale) { // COBRA - DX - Switching btw Old and New Engine - the Camera projections if (g_bUse_DX_Engine) { //START_PROFILE(DX_ENGINE_PROF); D3DXMATRIX Rot; AssignPmatrixToD3DXMATRIX(&Rot, (Pmatrix*)rot); TheDXEngine.DrawObject(objInst, &Rot, pos, 1.f, 1.f, 1.f, scale, false, NULL); //STOP_PROFILE(DX_ENGINE_PROF); } else pvtDrawObject(OP_NONE, objInst, rot, pos, 1.f, 1.f, 1.f, scale); } // This call is for the BSPlib to call to draw a child instance attached to a slot. void StateStackClass::DrawSubObject(ObjectInstance *objInst, const Pmatrix *rot, const Ppoint *pos) { // COBRA - DX - Switching btw Old and New Engine - the Camera projections if (g_bUse_DX_Engine) { //START_PROFILE(DX_ENGINE_PROF); D3DXMATRIX Rot; AssignPmatrixToD3DXMATRIX(&Rot, (Pmatrix*)rot); TheDXEngine.DrawObject(objInst, &Rot, pos, 1.f, 1.f, 1.f, 1.f); //STOP_PROFILE(DX_ENGINE_PROF); } else pvtDrawObject(OP_NONE, objInst, rot, pos, 1.f, 1.f, 1.f, 1.f); } // This call is rather specialized. It is intended for use in drawing shadows which // are simple objects (no slots, dofs, etc) but require asymetric scaling in x and y // to simulate orientation changes of the object casting the shadow. void StateStackClass::DrawWarpedObject(ObjectInstance *objInst, const Pmatrix *rot, const Ppoint *pos, const float sx, const float sy, const float sz, const float scale) { // COBRA - DX - Switching btw Old and New Engine - the Camera projections if (g_bUse_DX_Engine) { //START_PROFILE(DX_ENGINE_PROF); D3DXMATRIX Rot; AssignPmatrixToD3DXMATRIX(&Rot, (Pmatrix*)rot); TheDXEngine.DrawObject(objInst, &Rot, pos, sx, sy, sz, scale); //STOP_PROFILE(DX_ENGINE_PROF); } else pvtDrawObject(OP_WARP, objInst, rot, pos, sx, sy, sz, scale); } /*inline*/ UInt32 StateStackClass::CheckBoundingSphereClipping(void) { // Decide if we need clipping, or if the object is totally off screen // REMEMBER: Xlation is camera oriented, but still X front, Y right, Z down // so range from viewer is in the X term. // NOTE: We compute "d", the distance from the viewer at which the bounding // sphere should intersect the view frustum. We use .707 since the // rotation matrix already normalized us to a 45 degree half angle. // We do have to adjust the radius shift by the FOV correction factors, // though, since it didn't go through the matix. // NOTE2: We could develop the complete set of clip flags here by continuing to // check other edges instead of returning in the clipped cases. For now, // we only need to know if it IS clipped or not, so we terminate early. // TODO: We should roll the radius of any attached slot children into the check radius // to ensure that we don't reject a parent object whose _children_ may be on screen. // (though this should be fairly rare in practice) float rd; float rh; float rx; // UInt32 clipFlag = ON_SCREEN; rx = CurrentInstance->Radius(); rd = rx * vAspectDepthCorrection; rh = rx * vAspectWidthCorrection; if (-(Xlation.z - rh) >= Xlation.x - rd) { if (-(Xlation.z + rh) > Xlation.x + rd) { return OFF_SCREEN; // Trivial reject top } // clipFlag = CLIP_TOP; return CLIP_TOP; } if (Xlation.z + rh >= Xlation.x - rd) { if (Xlation.z - rh > Xlation.x + rd) { return OFF_SCREEN; // Trivial reject bottom } // clipFlag or_eq CLIP_BOTTOM; return CLIP_BOTTOM; } rd = rx * hAspectDepthCorrection; rh = rx * hAspectWidthCorrection; if (-(Xlation.y - rh) >= Xlation.x - rd) { if (-(Xlation.x + rh) > Xlation.x + rd) { return OFF_SCREEN; // Trivial reject left } // clipFlag or_eq CLIP_LEFT; return CLIP_LEFT; } if (Xlation.y + rh >= Xlation.x - rd) { if (Xlation.y - rh > Xlation.x + rd) { return OFF_SCREEN; // Trivial reject right } // clipFlag or_eq CLIP_RIGHT; return CLIP_RIGHT; } rh = rx; if (Xlation.x - rh < NEAR_CLIP_DISTANCE) { if (Xlation.x + rh < NEAR_CLIP_DISTANCE) { return OFF_SCREEN; // Trivial reject near } // clipFlag or_eq CLIP_NEAR; return CLIP_NEAR; } // return clipFlag; return ON_SCREEN; } void StateStackClass::PushAll(void) { ShiAssert(stackDepth < MAX_STATE_STACK_DEPTH); stack[stackDepth].XformedPosPool = XformedPosPool; stack[stackDepth].IntensityPool = IntensityPool; stack[stackDepth].ClipInfoPool = ClipInfoPool; stack[stackDepth].Rotation = Rotation; stack[stackDepth].Xlation = Xlation; stack[stackDepth].ObjSpaceEye = ObjSpaceEye; stack[stackDepth].ObjSpaceLight = ObjSpaceLight; stack[stackDepth].CurrentInstance = CurrentInstance; stack[stackDepth].CurrentLOD = CurrentLOD; stack[stackDepth].CurrentTextureTable = CurrentTextureTable; stack[stackDepth].DrawPrimJumpTable = DrawPrimJumpTable; stack[stackDepth].Transform = Transform; XformedPosPool = XformedPosPoolNext; IntensityPool = IntensityPoolNext; ClipInfoPool = ClipInfoPoolNext; stackDepth++; } void StateStackClass::PopAll(void) { stackDepth--; XformedPosPoolNext = XformedPosPool; IntensityPoolNext = IntensityPool; ClipInfoPoolNext = ClipInfoPool; XformedPosPool = stack[stackDepth].XformedPosPool; IntensityPool = stack[stackDepth].IntensityPool; ClipInfoPool = stack[stackDepth].ClipInfoPool; Rotation = stack[stackDepth].Rotation; Xlation = stack[stackDepth].Xlation; ObjSpaceEye = stack[stackDepth].ObjSpaceEye; ObjSpaceLight = stack[stackDepth].ObjSpaceLight; CurrentInstance = stack[stackDepth].CurrentInstance; CurrentLOD = stack[stackDepth].CurrentLOD; CurrentTextureTable = stack[stackDepth].CurrentTextureTable; DrawPrimJumpTable = stack[stackDepth].DrawPrimJumpTable; Transform = stack[stackDepth].Transform; } void StateStackClass::PushVerts(void) { ShiAssert(stackDepth < MAX_STATE_STACK_DEPTH); stack[stackDepth].XformedPosPool = XformedPosPool; stack[stackDepth].IntensityPool = IntensityPool; stack[stackDepth].ClipInfoPool = ClipInfoPool; XformedPosPool = XformedPosPoolNext; IntensityPool = IntensityPoolNext; ClipInfoPool = ClipInfoPoolNext; stackDepth++; } void StateStackClass::PopVerts(void) { stackDepth--; XformedPosPoolNext = XformedPosPool; IntensityPoolNext = IntensityPool; ClipInfoPoolNext = ClipInfoPool; XformedPosPool = stack[stackDepth].XformedPosPool; IntensityPool = stack[stackDepth].IntensityPool; ClipInfoPool = stack[stackDepth].ClipInfoPool; } // Cobra - RED - This function is now about 2 times faster that it was before with following changes... // can be 3 times if FIXME is solved void StateStackClass::Light(const Pnormal *n, int i, const Ppoint *p) { float iSpec = 0.f, iDiff = 0.f; Ppoint viewVector, halfVector; ShiAssert(IsValidIntensityIndex(i - 1)); while (i--) { // Cobra - RED - If Poly Normal facing other side dnt calculate light, // just assign last calculated light to avoid dark spots on near polys //if((double)(ObjSpaceEye.x*n->i+ObjSpaceEye.y*n->j+ObjSpaceEye.z*n->k)<(double)0.0){ // Operations are following the Normal check to keep the pocessor // *IntensityPoolNext = LastLight; // cache still online and execute a backaward cache call // n++; p++; IntensityPoolNext++; // which is faster than a forward call for a P Class processor // continue; //} // Cobra - RED - End iDiff = max(n->i * ObjSpaceLight.x + n->j * ObjSpaceLight.y + n->k * ObjSpaceLight.z, 0.f) * lightDiffuse; // Cobra - RED - Zero is Zero both in Float and Long...but Long is faster // ...........(lightSpecular)......................................... if ( not LODused and ((*(long*)&lightSpecular) bitand 0x7fffffff) and DisplayOptions.bSpecularLighting) { viewVector.x = ObjSpaceEye.x - p->x; viewVector.y = ObjSpaceEye.y - p->y; viewVector.z = ObjSpaceEye.z - p->z; normalizeVector(&viewVector); // FIXME - RED - This check should avoid any light calculation if camera NOT // LOOKING at the poly face, even iDiff could be not calculated // but till when BSP seems to draw even hidden polys I have to assign just // iDiff to have not dark spots on near polys, however avoiding iSpec calculations if ((viewVector.x * n->i + viewVector.y * n->j + viewVector.z * n->k) < 0.0) { *IntensityPoolNext = min(lightAmbient + iDiff, 1.f); // Operations are following the Normal check to keep the pocessor n++; p++; IntensityPoolNext++; // cache still online and execute a backaward cache call continue; // which is faster than a forward call for a P Class processor } halfVector.x = ObjSpaceLight.x + viewVector.x; halfVector.y = ObjSpaceLight.y + viewVector.y; halfVector.z = ObjSpaceLight.z + viewVector.z; normalizeVector(&halfVector); // Cobra - RED - Easy using FPU... isn't it...? But now Conditional Integers improve of about 100% //iSpec = powf(max(n->i*halfVector.x+n->j*halfVector.y+n->k*halfVector.z,0.f),32.f)*lightSpecular; iSpec = n->i * halfVector.x + n->j * halfVector.y + n->k * halfVector.z; if (iSpec <= 0) iSpec = 0; else { iSpec = iSpec * iSpec; // iSpec^2; iSpec = iSpec * iSpec; // iSpec^4; iSpec = iSpec * iSpec; // iSpec^8; iSpec = iSpec * iSpec; // iSpec^16; iSpec = iSpec * iSpec; // iSpec^32; iSpec *= lightSpecular; } // Cobra - RED - End } *IntensityPoolNext = min(lightAmbient + iDiff + iSpec, 1.f); n++; p++; IntensityPoolNext++; } } /*inline*/ void StateStackClass::TransformInline(Ppoint *p, int n, const BOOL clip) { float scratch_x, scratch_y, scratch_z; // Make sure we've got enough room in the transformed position pool ShiAssert(IsValidPosIndex(n - 1)); while (n--) { scratch_z = Rotation.M11 * p->x + Rotation.M12 * p->y + Rotation.M13 * p->z + Xlation.x; scratch_x = Rotation.M21 * p->x + Rotation.M22 * p->y + Rotation.M23 * p->z + Xlation.y; scratch_y = Rotation.M31 * p->x + Rotation.M32 * p->y + Rotation.M33 * p->z + Xlation.z; if (clip) { ClipInfoPoolNext->clipFlag = ON_SCREEN; if (scratch_z < NEAR_CLIP_DISTANCE) ClipInfoPoolNext->clipFlag or_eq CLIP_NEAR; if (fabs(scratch_y) > scratch_z) { if (scratch_y > scratch_z) ClipInfoPoolNext->clipFlag or_eq CLIP_BOTTOM; else ClipInfoPoolNext->clipFlag or_eq CLIP_TOP; } if (fabs(scratch_x) > scratch_z) { if (scratch_x > scratch_z) ClipInfoPoolNext->clipFlag or_eq CLIP_RIGHT; else ClipInfoPoolNext->clipFlag or_eq CLIP_LEFT; } ClipInfoPoolNext->csX = scratch_x; ClipInfoPoolNext->csY = scratch_y; ClipInfoPoolNext->csZ = scratch_z; ClipInfoPoolNext++; } register float OneOverZ = 1.f / scratch_z; p++; XformedPosPoolNext->z = scratch_z; XformedPosPoolNext->x = XtoPixel(scratch_x * OneOverZ); XformedPosPoolNext->y = YtoPixel(scratch_y * OneOverZ); XformedPosPoolNext++; } } void StateStackClass::TransformNoClip(Ppoint *p, int n) { TransformInline(p, n, FALSE); } void StateStackClass::TransformWithClip(Ppoint *p, int n) { // TODO: Need to make sure we're not going to walk off the end... TransformInline(p, n, TRUE); } void StateStackClass::TransformBillboardWithClip(Ppoint *p, int n, BTransformType type) { float scratch_x, scratch_y, scratch_z; Pmatrix *T; // Make sure we've got enough room in the transformed position pool ShiAssert(IsValidPosIndex(n - 1)); if (type == Tree) { T = Tt; } else { T = Tb; } while (n--) { scratch_z = T->M11 * p->x + T->M12 * p->y + T->M13 * p->z + Xlation.x; scratch_x = T->M21 * p->x + T->M22 * p->y + T->M23 * p->z + Xlation.y; scratch_y = T->M31 * p->x + T->M32 * p->y + T->M33 * p->z + Xlation.z; ClipInfoPoolNext->clipFlag = ON_SCREEN; if (scratch_z < NEAR_CLIP_DISTANCE) ClipInfoPoolNext->clipFlag or_eq CLIP_NEAR; if (fabs(scratch_y) > scratch_z) { if (scratch_y > scratch_z) ClipInfoPoolNext->clipFlag or_eq CLIP_BOTTOM; else ClipInfoPoolNext->clipFlag or_eq CLIP_TOP; } if (fabs(scratch_x) > scratch_z) { if (scratch_x > scratch_z) ClipInfoPoolNext->clipFlag or_eq CLIP_RIGHT; else ClipInfoPoolNext->clipFlag or_eq CLIP_LEFT; } ClipInfoPoolNext->csX = scratch_x; ClipInfoPoolNext->csY = scratch_y; ClipInfoPoolNext->csZ = scratch_z; ClipInfoPoolNext++; register float OneOverZ = 1.f / scratch_z; p++; XformedPosPoolNext->z = scratch_z; XformedPosPoolNext->x = XtoPixel(scratch_x * OneOverZ); XformedPosPoolNext->y = YtoPixel(scratch_y * OneOverZ); XformedPosPoolNext++; } } BOOL StateStackClass::IsValidPosIndex(int i) { return (i + XformedPosPool < XformedPosPoolBuffer + MAX_VERT_POOL_SIZE); } BOOL StateStackClass::IsValidIntensityIndex(int i) { return (i + IntensityPool < IntensityPoolBuffer + MAX_VERT_POOL_SIZE); } void StateStackClass::SetLODBias(float bias) { LODBiasInv = 1.f / bias; TheDXEngine.SetLODBias(LODBiasInv); };
31.097933
184
0.619266
[ "object", "vector", "transform" ]
e51716c851a2ea1e802b59d06e6076c707ef6223
759
cc
C++
leet_code/Count_Servers_that_Communicate/solve.cc
ldy121/algorithm
7939cb4c15e2bc655219c934f00c2bb74ddb4eec
[ "Apache-2.0" ]
1
2020-04-11T22:04:23.000Z
2020-04-11T22:04:23.000Z
leet_code/Count_Servers_that_Communicate/solve.cc
ldy121/algorithm
7939cb4c15e2bc655219c934f00c2bb74ddb4eec
[ "Apache-2.0" ]
null
null
null
leet_code/Count_Servers_that_Communicate/solve.cc
ldy121/algorithm
7939cb4c15e2bc655219c934f00c2bb74ddb4eec
[ "Apache-2.0" ]
null
null
null
class Solution { private : const int c_visit = 2; public: int countServers(vector<vector<int>>& grid) { int ret = 0; for (int i = 0; i < grid.size(); ++i) { int cnt = 0; for (int j = 0; j < grid[i].size(); ++j) { if (grid[i][j] > 0) { ++cnt; } } if (cnt > 1) { for (int j = 0; j < grid[i].size(); ++j) { if (grid[i][j] == 1) { grid[i][j] = c_visit; ++ret; } } } } for (int j = 0; j < grid[0].size(); ++j) { int cnt = 0; for (int i = 0; i < grid.size(); ++i) { if (grid[i][j] > 0) { ++cnt; } } if (cnt > 1) { for (int i = 0; i < grid.size(); ++i) { if (grid[i][j] == 1) { grid[i][j] = c_visit; ++ret; } } } } return ret; } };
16.866667
46
0.399209
[ "vector" ]
e51850f9ead46cd7b02b2a2a04120798b57812ae
2,378
cpp
C++
Contests/Projects/practice/456C.cpp
aqfaridi/Competitve-Programming-Codes
d055de2f42d3d6bc36e03e67804a1dd6b212241f
[ "MIT" ]
null
null
null
Contests/Projects/practice/456C.cpp
aqfaridi/Competitve-Programming-Codes
d055de2f42d3d6bc36e03e67804a1dd6b212241f
[ "MIT" ]
null
null
null
Contests/Projects/practice/456C.cpp
aqfaridi/Competitve-Programming-Codes
d055de2f42d3d6bc36e03e67804a1dd6b212241f
[ "MIT" ]
null
null
null
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <vector> #include <iomanip> #include <cmath> #include <set> #include <map> #include <queue> #include <climits> #include <cassert> using namespace std; typedef long long LL; typedef pair<LL,LL> pii; typedef pair<LL,pii > piii; #define pb push_back #define mp make_pair #define sz size() #define ln length() #define forr(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) forr(i,0,n) #define all(v) v.begin(),v.end() #define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end()) #define clr(a) memset(a,0,sizeof a) #define debug if(1) #define debugoff if(0) #define print(x) cerr << x << " "; #define pn() cerr << endl; #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define MAX 1000010 #define MOD 1000000007 priority_queue<piii> Q; int mrk[MAX]; LL a[MAX]; LL done[MAX]; int main() { ios::sync_with_stdio(false); LL n,nm,nmp,vlp,loss,gain,dif,vl,ans=0; cin>>n; for(int i=0;i<n;i++){ cin>>nm; a[nm]++; } for(int i=0;i<=MAX;i++){ if(a[i] > 0){ loss = (i-1)*a[i-1] + (i+1)*a[i+1]; Q.push(mp((i*a[i]-loss),mp(i*a[i] , i))); } } mrk[0] = 1; while(!Q.empty()){ piii p = Q.top(); dif = p.first; gain = p.second.first; nm = p.second.second; Q.pop(); if(mrk[nm]) continue; bool b= false; if(mrk[nm-1] && a[nm-1] > 0) { dif += (nm-1)*a[nm-1]; b = true; } if(mrk[nm+1] && a[nm+1] > 0) { dif += (nm+1)*a[nm+1]; b = true; } if(b and !done[nm]){ Q.push(mp((dif),mp(gain , nm))); done[nm] = 1; continue; } mrk[nm] = 1; mrk[nm-1] = 1; mrk[nm+1] = 1; ans += gain; } cout<<ans<<endl; return 0; }
25.031579
121
0.429773
[ "vector" ]
e52c940666d5d2f6a64ccf6aea2a8a17650fdcb7
16,950
cc
C++
content/browser/service_worker/service_worker_cache_listener.cc
sunjc53yy/chromium
049b380040949089c2a6e447b0cd0ac3c4ece38e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
content/browser/service_worker/service_worker_cache_listener.cc
sunjc53yy/chromium
049b380040949089c2a6e447b0cd0ac3c4ece38e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
content/browser/service_worker/service_worker_cache_listener.cc
sunjc53yy/chromium
049b380040949089c2a6e447b0cd0ac3c4ece38e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2014 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 "content/browser/service_worker/service_worker_cache_listener.h" #include "base/bind.h" #include "base/debug/trace_event.h" #include "base/strings/utf_string_conversions.h" #include "content/browser/service_worker/service_worker_cache.h" #include "content/browser/service_worker/service_worker_cache_storage_manager.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/common/service_worker/service_worker_messages.h" #include "storage/browser/blob/blob_data_handle.h" #include "third_party/WebKit/public/platform/WebServiceWorkerCacheError.h" namespace content { using blink::WebServiceWorkerCacheError; namespace { WebServiceWorkerCacheError ToWebServiceWorkerCacheError( ServiceWorkerCacheStorage::CacheStorageError err) { switch (err) { case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR: NOTREACHED(); return blink::WebServiceWorkerCacheErrorNotImplemented; case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NOT_IMPLEMENTED: return blink::WebServiceWorkerCacheErrorNotImplemented; case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NOT_FOUND: return blink::WebServiceWorkerCacheErrorNotFound; case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_EXISTS: return blink::WebServiceWorkerCacheErrorExists; case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_STORAGE: // TODO(jkarlin): Change this to CACHE_STORAGE_ERROR_STORAGE once that's // added. return blink::WebServiceWorkerCacheErrorNotFound; case ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_CLOSING: // TODO(jkarlin): Update this to CACHE_STORAGE_ERROR_CLOSING once that's // added. return blink::WebServiceWorkerCacheErrorNotFound; } NOTREACHED(); return blink::WebServiceWorkerCacheErrorNotImplemented; } // TODO(jkarlin): ServiceWorkerCache and ServiceWorkerCacheStorage should share // an error enum type. WebServiceWorkerCacheError CacheErrorToWebServiceWorkerCacheError( ServiceWorkerCache::ErrorType err) { switch (err) { case ServiceWorkerCache::ErrorTypeOK: NOTREACHED(); return blink::WebServiceWorkerCacheErrorNotImplemented; case ServiceWorkerCache::ErrorTypeExists: return blink::WebServiceWorkerCacheErrorExists; case ServiceWorkerCache::ErrorTypeStorage: // TODO(jkarlin): Change this to CACHE_STORAGE_ERROR_STORAGE once that's // added. return blink::WebServiceWorkerCacheErrorNotFound; case ServiceWorkerCache::ErrorTypeNotFound: return blink::WebServiceWorkerCacheErrorNotFound; } NOTREACHED(); return blink::WebServiceWorkerCacheErrorNotImplemented; } } // namespace ServiceWorkerCacheListener::ServiceWorkerCacheListener( ServiceWorkerVersion* version, base::WeakPtr<ServiceWorkerContextCore> context) : version_(version), context_(context), next_cache_id_(0), weak_factory_(this) { version_->embedded_worker()->AddListener(this); } ServiceWorkerCacheListener::~ServiceWorkerCacheListener() { version_->embedded_worker()->RemoveListener(this); } bool ServiceWorkerCacheListener::OnMessageReceived( const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(ServiceWorkerCacheListener, message) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheStorageHas, OnCacheStorageHas) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheStorageOpen, OnCacheStorageOpen) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheStorageDelete, OnCacheStorageDelete) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheStorageKeys, OnCacheStorageKeys) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheMatch, OnCacheMatch) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheMatchAll, OnCacheMatchAll) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheKeys, OnCacheKeys) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheBatch, OnCacheBatch) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_CacheClosed, OnCacheClosed) IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_BlobDataHandled, OnBlobDataHandled) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; } void ServiceWorkerCacheListener::OnCacheStorageHas( int request_id, const base::string16& cache_name) { TRACE_EVENT0("ServiceWorker", "ServiceWorkerCacheListener::OnCacheStorageHas"); context_->cache_manager()->HasCache( version_->scope().GetOrigin(), base::UTF16ToUTF8(cache_name), base::Bind(&ServiceWorkerCacheListener::OnCacheStorageHasCallback, weak_factory_.GetWeakPtr(), request_id)); } void ServiceWorkerCacheListener::OnCacheStorageOpen( int request_id, const base::string16& cache_name) { TRACE_EVENT0("ServiceWorker", "ServiceWorkerCacheListener::OnCacheStorageOpen"); context_->cache_manager()->OpenCache( version_->scope().GetOrigin(), base::UTF16ToUTF8(cache_name), base::Bind(&ServiceWorkerCacheListener::OnCacheStorageOpenCallback, weak_factory_.GetWeakPtr(), request_id)); } void ServiceWorkerCacheListener::OnCacheStorageDelete( int request_id, const base::string16& cache_name) { TRACE_EVENT0("ServiceWorker", "ServiceWorkerCacheListener::OnCacheStorageDelete"); context_->cache_manager()->DeleteCache( version_->scope().GetOrigin(), base::UTF16ToUTF8(cache_name), base::Bind(&ServiceWorkerCacheListener::OnCacheStorageDeleteCallback, weak_factory_.GetWeakPtr(), request_id)); } void ServiceWorkerCacheListener::OnCacheStorageKeys(int request_id) { TRACE_EVENT0("ServiceWorker", "ServiceWorkerCacheListener::OnCacheStorageKeys"); context_->cache_manager()->EnumerateCaches( version_->scope().GetOrigin(), base::Bind(&ServiceWorkerCacheListener::OnCacheStorageKeysCallback, weak_factory_.GetWeakPtr(), request_id)); } void ServiceWorkerCacheListener::OnCacheMatch( int request_id, int cache_id, const ServiceWorkerFetchRequest& request, const ServiceWorkerCacheQueryParams& match_params) { IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id); if (it == id_to_cache_map_.end()) { Send(ServiceWorkerMsg_CacheMatchError( request_id, blink::WebServiceWorkerCacheErrorNotFound)); return; } scoped_refptr<ServiceWorkerCache> cache = it->second; scoped_ptr<ServiceWorkerFetchRequest> scoped_request( new ServiceWorkerFetchRequest(request.url, request.method, request.headers, request.referrer, request.is_reload)); cache->Match(scoped_request.Pass(), base::Bind(&ServiceWorkerCacheListener::OnCacheMatchCallback, weak_factory_.GetWeakPtr(), request_id, cache)); } void ServiceWorkerCacheListener::OnCacheMatchAll( int request_id, int cache_id, const ServiceWorkerFetchRequest& request, const ServiceWorkerCacheQueryParams& match_params) { // TODO(gavinp,jkarlin): Implement this method. Send(ServiceWorkerMsg_CacheMatchAllError( request_id, blink::WebServiceWorkerCacheErrorNotImplemented)); } void ServiceWorkerCacheListener::OnCacheKeys( int request_id, int cache_id, const ServiceWorkerFetchRequest& request, const ServiceWorkerCacheQueryParams& match_params) { IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id); if (it == id_to_cache_map_.end()) { Send(ServiceWorkerMsg_CacheKeysError( request_id, blink::WebServiceWorkerCacheErrorNotFound)); return; } scoped_refptr<ServiceWorkerCache> cache = it->second; cache->Keys(base::Bind(&ServiceWorkerCacheListener::OnCacheKeysCallback, weak_factory_.GetWeakPtr(), request_id, cache)); } void ServiceWorkerCacheListener::OnCacheBatch( int request_id, int cache_id, const std::vector<ServiceWorkerBatchOperation>& operations) { if (operations.size() != 1u) { Send(ServiceWorkerMsg_CacheBatchError( request_id, blink::WebServiceWorkerCacheErrorNotImplemented)); return; } IDToCacheMap::iterator it = id_to_cache_map_.find(cache_id); if (it == id_to_cache_map_.end()) { Send(ServiceWorkerMsg_CacheBatchError( request_id, blink::WebServiceWorkerCacheErrorNotFound)); return; } const ServiceWorkerBatchOperation& operation = operations[0]; scoped_refptr<ServiceWorkerCache> cache = it->second; scoped_ptr<ServiceWorkerFetchRequest> scoped_request( new ServiceWorkerFetchRequest(operation.request.url, operation.request.method, operation.request.headers, operation.request.referrer, operation.request.is_reload)); if (operation.operation_type == SERVICE_WORKER_CACHE_OPERATION_TYPE_DELETE) { cache->Delete(scoped_request.Pass(), base::Bind(&ServiceWorkerCacheListener::OnCacheDeleteCallback, weak_factory_.GetWeakPtr(), request_id, cache)); return; } if (operation.operation_type == SERVICE_WORKER_CACHE_OPERATION_TYPE_PUT) { scoped_ptr<ServiceWorkerResponse> scoped_response( new ServiceWorkerResponse(operation.response.url, operation.response.status_code, operation.response.status_text, operation.response.response_type, operation.response.headers, operation.response.blob_uuid, operation.response.blob_size)); cache->Put(scoped_request.Pass(), scoped_response.Pass(), base::Bind(&ServiceWorkerCacheListener::OnCachePutCallback, weak_factory_.GetWeakPtr(), request_id, cache)); return; } Send(ServiceWorkerMsg_CacheBatchError( request_id, blink::WebServiceWorkerCacheErrorNotImplemented)); } void ServiceWorkerCacheListener::OnCacheClosed(int cache_id) { DropCacheReference(cache_id); } void ServiceWorkerCacheListener::OnBlobDataHandled(const std::string& uuid) { DropBlobDataHandle(uuid); } void ServiceWorkerCacheListener::Send(const IPC::Message& message) { version_->embedded_worker()->SendMessage(message); } void ServiceWorkerCacheListener::OnCacheStorageHasCallback( int request_id, bool has_cache, ServiceWorkerCacheStorage::CacheStorageError error) { if (error != ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR) { Send(ServiceWorkerMsg_CacheStorageHasError( request_id, ToWebServiceWorkerCacheError(error))); return; } if (!has_cache) { Send(ServiceWorkerMsg_CacheStorageHasError( request_id, blink::WebServiceWorkerCacheErrorNotFound)); return; } Send(ServiceWorkerMsg_CacheStorageHasSuccess(request_id)); } void ServiceWorkerCacheListener::OnCacheStorageOpenCallback( int request_id, const scoped_refptr<ServiceWorkerCache>& cache, ServiceWorkerCacheStorage::CacheStorageError error) { if (error != ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR) { Send(ServiceWorkerMsg_CacheStorageOpenError( request_id, ToWebServiceWorkerCacheError(error))); return; } CacheID cache_id = StoreCacheReference(cache); Send(ServiceWorkerMsg_CacheStorageOpenSuccess(request_id, cache_id)); } void ServiceWorkerCacheListener::OnCacheStorageDeleteCallback( int request_id, bool deleted, ServiceWorkerCacheStorage::CacheStorageError error) { if (!deleted || error != ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR) { Send(ServiceWorkerMsg_CacheStorageDeleteError( request_id, ToWebServiceWorkerCacheError(error))); return; } Send(ServiceWorkerMsg_CacheStorageDeleteSuccess(request_id)); } void ServiceWorkerCacheListener::OnCacheStorageKeysCallback( int request_id, const std::vector<std::string>& strings, ServiceWorkerCacheStorage::CacheStorageError error) { if (error != ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR) { Send(ServiceWorkerMsg_CacheStorageKeysError( request_id, ToWebServiceWorkerCacheError(error))); return; } std::vector<base::string16> string16s; for (size_t i = 0, max = strings.size(); i < max; ++i) { string16s.push_back(base::UTF8ToUTF16(strings[i])); } Send(ServiceWorkerMsg_CacheStorageKeysSuccess(request_id, string16s)); } void ServiceWorkerCacheListener::OnCacheMatchCallback( int request_id, const scoped_refptr<ServiceWorkerCache>& cache, ServiceWorkerCache::ErrorType error, scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<storage::BlobDataHandle> blob_data_handle) { if (error != ServiceWorkerCache::ErrorTypeOK) { Send(ServiceWorkerMsg_CacheMatchError( request_id, CacheErrorToWebServiceWorkerCacheError(error))); return; } if (blob_data_handle) StoreBlobDataHandle(blob_data_handle.Pass()); Send(ServiceWorkerMsg_CacheMatchSuccess(request_id, *response)); } void ServiceWorkerCacheListener::OnCacheKeysCallback( int request_id, const scoped_refptr<ServiceWorkerCache>& cache, ServiceWorkerCache::ErrorType error, scoped_ptr<ServiceWorkerCache::Requests> requests) { if (error != ServiceWorkerCache::ErrorTypeOK) { Send(ServiceWorkerMsg_CacheKeysError( request_id, CacheErrorToWebServiceWorkerCacheError(error))); return; } ServiceWorkerCache::Requests out; for (ServiceWorkerCache::Requests::const_iterator it = requests->begin(); it != requests->end(); ++it) { ServiceWorkerFetchRequest request( it->url, it->method, it->headers, it->referrer, it->is_reload); out.push_back(request); } Send(ServiceWorkerMsg_CacheKeysSuccess(request_id, out)); } void ServiceWorkerCacheListener::OnCacheDeleteCallback( int request_id, const scoped_refptr<ServiceWorkerCache>& cache, ServiceWorkerCache::ErrorType error) { if (error != ServiceWorkerCache::ErrorTypeOK) { Send(ServiceWorkerMsg_CacheBatchError( request_id, CacheErrorToWebServiceWorkerCacheError(error))); return; } Send(ServiceWorkerMsg_CacheBatchSuccess( request_id, std::vector<ServiceWorkerResponse>())); } void ServiceWorkerCacheListener::OnCachePutCallback( int request_id, const scoped_refptr<ServiceWorkerCache>& cache, ServiceWorkerCache::ErrorType error, scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<storage::BlobDataHandle> blob_data_handle) { if (error != ServiceWorkerCache::ErrorTypeOK) { Send(ServiceWorkerMsg_CacheBatchError( request_id, CacheErrorToWebServiceWorkerCacheError(error))); return; } if (blob_data_handle) StoreBlobDataHandle(blob_data_handle.Pass()); std::vector<ServiceWorkerResponse> responses; responses.push_back(*response); Send(ServiceWorkerMsg_CacheBatchSuccess(request_id, responses)); } ServiceWorkerCacheListener::CacheID ServiceWorkerCacheListener::StoreCacheReference( const scoped_refptr<ServiceWorkerCache>& cache) { int cache_id = next_cache_id_++; id_to_cache_map_[cache_id] = cache; return cache_id; } void ServiceWorkerCacheListener::DropCacheReference(CacheID cache_id) { id_to_cache_map_.erase(cache_id); } void ServiceWorkerCacheListener::StoreBlobDataHandle( scoped_ptr<storage::BlobDataHandle> blob_data_handle) { DCHECK(blob_data_handle); std::pair<UUIDToBlobDataHandleList::iterator, bool> rv = blob_handle_store_.insert(std::make_pair( blob_data_handle->uuid(), std::list<storage::BlobDataHandle>())); rv.first->second.push_front(storage::BlobDataHandle(*blob_data_handle)); } void ServiceWorkerCacheListener::DropBlobDataHandle(std::string uuid) { UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); if (it == blob_handle_store_.end()) return; DCHECK(!it->second.empty()); it->second.pop_front(); if (it->second.empty()) blob_handle_store_.erase(it); } } // namespace content
36.847826
80
0.722183
[ "vector" ]
e52ffe127eaaeee71f8d282ed4db76bcd2490f70
5,527
cpp
C++
falkon/sparse/cpp/sparse_matmul.cpp
fwilliams/falkon
26deb0aeeaa867ac370b9316bdfa4f4a1160b3e6
[ "MIT" ]
1
2021-11-10T16:50:53.000Z
2021-11-10T16:50:53.000Z
falkon/sparse/cpp/sparse_matmul.cpp
fwilliams/falkon
26deb0aeeaa867ac370b9316bdfa4f4a1160b3e6
[ "MIT" ]
null
null
null
falkon/sparse/cpp/sparse_matmul.cpp
fwilliams/falkon
26deb0aeeaa867ac370b9316bdfa4f4a1160b3e6
[ "MIT" ]
null
null
null
#include <ATen/Parallel.h> #include<ATen/ParallelOpenMP.h> #include <torch/extension.h> #define INDEX(A, i, j, si, sj) ( A[i * si + j * sj] ) #define ASSERT_IS_CPU(x) AT_ASSERTM(x.device().is_cpu(), #x " must be CPU tensor") template <typename scalar_t> static void run_parallel(scalar_t* A_data, scalar_t* B_data, scalar_t* out_data, int64_t* A_indptr, int64_t* B_indptr, int64_t* A_index, int64_t* B_index, int64_t si, int64_t sj, int64_t N, int64_t M) { if (si > 1) { torch::parallel_for(0, N, 2048, [&](int64_t start, int64_t end) { int64_t i, j, i_start, i_end, j_start, j_end; int64_t row_val, col_val; scalar_t val_ij; for (i = start; i < end; i++) { i_start = A_indptr[i]; i_end = A_indptr[i+1]; if (A_indptr[i] == A_indptr[i+1]) { continue; } auto out_row = &out_data[i*si]; for (j = 0; j < M; j++) { j_start = B_indptr[j]; j_end = B_indptr[j+1]; val_ij = out_row[j]; while (j_start < j_end && i_start < i_end) { row_val = A_index[i_start]; col_val = B_index[j_start]; if (row_val == col_val) { val_ij += A_data[i_start] * B_data[j_start]; j_start++; i_start++; } else if (row_val < col_val) { i_start++; } else { j_start++; } } out_data[j] = val_ij; //INDEX(out_data, i, j, si, sj) = val_ij; } } }); } else { at::parallel_for(0, N, 2048, [&](int64_t begin, int64_t end) { int64_t i, j, i_start, i_end, j_start, j_end; int64_t row_val, col_val; scalar_t val_ij; for (j = begin; j < end; j++) { if (B_indptr[j] == B_indptr[j+1]) { continue; } for (i = 0; i < N; i++) { i_start = A_indptr[i]; i_end = A_indptr[i+1]; j_start = B_indptr[j]; j_end = B_indptr[j+1]; val_ij = INDEX(out_data, i, j, si, sj); while (j_start < j_end && i_start < i_end) { row_val = A_index[i_start]; col_val = B_index[j_start]; if (row_val == col_val) { val_ij += A_data[i_start] * B_data[j_start]; j_start++; i_start++; } else if (row_val < col_val) { i_start++; } else { j_start++; } } INDEX(out_data, i, j, si, sj) = val_ij; } } }); } } torch::Tensor addspmm(torch::Tensor rowptrA, torch::Tensor colA, torch::Tensor valA, torch::Tensor colptrB, torch::Tensor rowB, torch::Tensor valB, torch::optional<torch::Tensor> out=torch::nullopt) { ASSERT_IS_CPU(rowptrA); AT_ASSERTM(rowptrA.dim() == 1, "rowptrA must be 1D"); const int64_t N = rowptrA.size(0) - 1; ASSERT_IS_CPU(colA); AT_ASSERTM(colA.dim() == 1, "colA must be 1D"); ASSERT_IS_CPU(valA); AT_ASSERTM(valA.dim() == 1, "valA must be 1D"); AT_ASSERTM(valA.size(0) == colA.size(0), "Values and column-data must be of the same size for matrix A"); ASSERT_IS_CPU(colptrB); AT_ASSERTM(colptrB.dim() == 1, "rowptrB must be 1D"); const int64_t M = colptrB.size(0) - 1; ASSERT_IS_CPU(rowB); AT_ASSERTM(rowB.dim() == 1, "rowB must be 1D"); ASSERT_IS_CPU(valB); AT_ASSERTM(valB.dim() == 1, "valB must be 1D"); AT_ASSERTM(valB.size(0) == rowB.size(0), "Values and column-data must be of the same size for matrix B"); AT_ASSERTM(valB.scalar_type() == valA.scalar_type(), "Matrices A, B and out must be of the same type."); torch::Tensor out_; if (!out.has_value()) { out_ = torch::zeros({N, M}, valA.options()); } else { out_ = out.value(); ASSERT_IS_CPU(out_); AT_ASSERTM(N == out_.size(0), "Input shape mismatch"); AT_ASSERTM(M == out_.size(1), "Input shape mismatch"); AT_ASSERTM(out_.scalar_type() == valA.scalar_type(), "Matrices A, B and out must be of the same type."); } const auto scalar_type = valA.scalar_type(); const auto si = out_.stride(0); const auto sj = out_.stride(1); const auto rowptrA_data = rowptrA.data_ptr<int64_t>(); const auto colA_data = colA.data_ptr<int64_t>(); const auto colptrB_data = colptrB.data_ptr<int64_t>(); const auto rowB_data = rowB.data_ptr<int64_t>(); AT_DISPATCH_ALL_TYPES(scalar_type, "call", [&] { run_parallel<scalar_t>( valA.data_ptr<scalar_t>(), valB.data_ptr<scalar_t>(), out_.data_ptr<scalar_t>(), rowptrA_data, colptrB_data, colA_data, rowB_data, si, sj, N, M); }); return out_; }
38.381944
112
0.47856
[ "shape" ]
e532f1779ada23f74cd5b84ed90c1260e2ce4a1f
3,912
cpp
C++
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/view/ContextThemeWrapperHolder.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
7
2017-07-13T10:34:54.000Z
2021-04-16T05:40:35.000Z
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/view/ContextThemeWrapperHolder.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/Frameworks/Droid/Base/Core/src/elastos/droid/view/ContextThemeWrapperHolder.cpp
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
9
2017-07-13T12:33:20.000Z
2021-06-19T02:46:48.000Z
//========================================================================= // 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 "elastos/droid/view/ContextThemeWrapperHolder.h" #include <elastos/utility/logging/Logger.h> #include <utils/CallStack.h> #include <elastos/core/Thread.h> using Elastos::Core::Thread; using Elastos::Utility::Logging::Logger; namespace Elastos { namespace Droid { namespace View { // CAR_INTERFACE_IMPL(ContextThemeWrapperHolder, ContextThemeWrapper, IContextThemeWrapperHolder) ContextThemeWrapperHolder::ContextThemeWrapperHolder() : mMemoryLeakTarget(FALSE) , mMemoryCount(0) { Logger::I("ContextThemeWrapperHolder", " >> Create ContextThemeWrapperHolder: %p", this); } ContextThemeWrapperHolder::~ContextThemeWrapperHolder() { if (mMemoryLeakTarget) { Logger::I("ContextThemeWrapperHolder", " >> Destroy ContextThemeWrapperHolder: %p", this); } } PInterface ContextThemeWrapperHolder::Probe( /* [in] */ REIID riid) { if (riid == EIID_IInterface) { return (PInterface)(IContextThemeWrapperHolder*)this; } else if (riid == EIID_IContextThemeWrapperHolder) { return (IContextThemeWrapperHolder*)this; } return ContextThemeWrapper::Probe(riid); } ECode ContextThemeWrapperHolder::GetInterfaceID( /* [in] */ IInterface *pObject, /* [out] */ InterfaceID *pIID) { if (NULL == pIID) return E_INVALID_ARGUMENT; if (pObject == (IInterface *)(IContextThemeWrapperHolder *)this) { *pIID = EIID_IContextThemeWrapperHolder; return NOERROR; } return ContextThemeWrapper::GetInterfaceID(pObject, pIID); } UInt32 ContextThemeWrapperHolder::AddRef() { UInt32 count = Object::AddRef(); // if (mMemoryLeakTarget) { // android::CallStack stack; // stack.update(); // String backtrace(stack.toString("").string()); // Logger::I("ContextThemeWrapperHolder", "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"); // Logger::I("ContextThemeWrapperHolder", ">> AddRef: %p, refcount: %d, callstack:\n%s", this, count, backtrace.string()); // Logger::I("ContextThemeWrapperHolder", "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"); // } return count; } UInt32 ContextThemeWrapperHolder::Release() { if (mMemoryLeakTarget) { // Thread::Sleep(10); if (GetStrongCount() < 3) { Logger::I("ContextThemeWrapperHolder", " >> Release: %p, refcount: %d", this, GetStrongCount()); } // android::CallStack stack; // stack.update(); // String backtrace(stack.toString("").string()); // Logger::I("ContextThemeWrapperHolder", "-------------------------------------------------------"); // Logger::I("ContextThemeWrapperHolder", ">> Release: %p, refcount: %d, callstack:\n%s", this, GetStrongCount(), backtrace.string()); // Logger::I("ContextThemeWrapperHolder", "-------------------------------------------------------"); } Int32 count = Object::Release(); // if (mMemoryLeakTarget) { // if (count == 1 && (++mMemoryCount == 3)) { // Release(); // } // } return count; } } // namespace View } // namespace Droid } // namespace Elastos
34.315789
142
0.603016
[ "object" ]
e5368390cc91e408f5850beccb1d1fd688a550bc
3,567
hpp
C++
src/IO/ArgumentParser.hpp
chrismile/cfd3d
5943ae78be7334888b7f7b1f4622f9cf61626a2c
[ "BSD-2-Clause" ]
24
2020-12-02T09:21:45.000Z
2022-02-07T09:31:34.000Z
src/IO/ArgumentParser.hpp
chrismile/cfd3d
5943ae78be7334888b7f7b1f4622f9cf61626a2c
[ "BSD-2-Clause" ]
null
null
null
src/IO/ArgumentParser.hpp
chrismile/cfd3d
5943ae78be7334888b7f7b1f4622f9cf61626a2c
[ "BSD-2-Clause" ]
6
2020-12-06T18:56:06.000Z
2021-08-11T05:58:09.000Z
/* * BSD 2-Clause License * * Copyright (c) 2019, Christoph Neuhauser, Stefan Haas, Paul Ng * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CFD3D_ARGUMENTPARSER_HPP #define CFD3D_ARGUMENTPARSER_HPP #include <string> #include "Defines.hpp" class OutputFileWriter; /** * Parses the command line arguments passed to the program. For more information on the format, please see README.md. * @param argc The number of arguments. * @param argv The arguments. * @param scenarioName The name of the scenario to use. * @param solverName The name of the solver to use. * @param outputFileWriterType The type of the output file writer to use. * @param shallWriteOutput Whether to write an output file at all. * @param numParticles The number of particles to seed when using a particle tracer. * @param traceStreamlines Whether to trace streamlines in the fluid flow. * @param iproc The number of processes in x direction (MPI solver only). * @param jproc The number of processes in y direction (MPI solver only). * @param kproc The number of processes in z direction (MPI solver only). * @param blockSizeX The block size to use for 3D domains in x direction (CUDA and OpenCL solver only). * @param blockSizeY The block size to use for 3D domains in y direction (CUDA and OpenCL solver only). * @param blockSizeZ The block size to use for 3D domains in z direction (CUDA and OpenCL solver only). * @param blockSize1D The block size to use for 1D domains (CUDA and OpenCL solver only). * @param openclPlatformId The ID of the OpenCL platform to use for computations (OpenCL solver only). * Which platform corresponds to which ID can be found out with the command line tool 'clinfo'. * @param gpuId Which GPU to use for computations (currently CUDA solver only). Using multiple GPUs is not supported. */ void parseArguments( int argc, char *argv[], std::string &scenarioName, std::string &solverName, std::string &outputFileWriterType, bool &shallWriteOutput, LinearSystemSolverType &linearSystemSolverType, int &numParticles, bool &traceStreamlines, int &iproc, int &jproc, int &kproc, int &blockSizeX, int &blockSizeY, int &blockSizeZ, int &blockSize1D, int &gpuId, int &openclPlatformId); #endif //CFD3D_ARGUMENTPARSER_HPP
54.045455
117
0.760863
[ "3d" ]
e5498308b894a4e3966b597d34acb354a2e49771
644
cpp
C++
tinyember/TinyEmberPlusRouter/TinyEmberPlusRouter/model/matrix/Matrix.cpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
78
2015-07-31T14:46:38.000Z
2022-03-28T09:28:28.000Z
tinyember/TinyEmberPlusRouter/TinyEmberPlusRouter/model/matrix/Matrix.cpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
81
2015-08-03T07:58:19.000Z
2022-02-28T16:21:19.000Z
tinyember/TinyEmberPlusRouter/TinyEmberPlusRouter/model/matrix/Matrix.cpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
49
2015-08-03T12:53:10.000Z
2022-03-17T17:25:49.000Z
/* Copyright (C) 2012-2016 Lawo GmbH (http://www.lawo.com). Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include "Matrix.h" namespace model { namespace matrix { Matrix::Matrix(int number, Element* parent, std::string const& identifier, NotificationSink* notificationSink) : Element(number, parent, identifier) , m_notificationSink(notificationSink) {} Matrix::~Matrix() { for(auto signal : m_targets) delete signal; for(auto signal : m_sources) delete signal; } }}
25.76
113
0.673913
[ "model" ]
e54aff499bf7e25e931119e720e29dfeb74a9494
1,791
cpp
C++
UVa/uva_369_Combinations.cpp
bishoy-magdy/Competitive-Programming
689daac9aeb475da3c28aba4a69df394c68a9a34
[ "MIT" ]
2
2020-04-23T17:47:27.000Z
2020-04-25T19:40:50.000Z
UVa/uva_369_Combinations.cpp
bishoy-magdy/Competitive-Programming
689daac9aeb475da3c28aba4a69df394c68a9a34
[ "MIT" ]
null
null
null
UVa/uva_369_Combinations.cpp
bishoy-magdy/Competitive-Programming
689daac9aeb475da3c28aba4a69df394c68a9a34
[ "MIT" ]
1
2020-06-14T20:52:39.000Z
2020-06-14T20:52:39.000Z
#include<bits/stdc++.h> #include<iostream> #include<string> #include<vector> #include<cmath> #include<list> #include <algorithm> #include<vector> #include<set> #include <cctype> #include <cstring> #include <cstdio> #include<queue> #include<stack> #include<bitset> #include<time.h> #include<fstream> /******************************************************/ using namespace std; /********************define***************************/ #define ll long long #define ld long double #define all(v) ((v).begin()), ((v).end()) #define for_(vec) for(int i=0;i<(int)vec.size();i++) #define lp(j,n) for(int i=j;i<(int)(n);i++) #define clr(arr,x) memset(arr,x,sizeof(arr)) #define fillstl(arr,X) fill(arr.begin(),arr.end(),X) #define pb push_back #define mp make_pair #define print_vector(X) for(int i=0;i<X.size();i++) /********************************************************/ /***********************function************************/ void fast(){ios_base::sync_with_stdio(NULL);cin.tie(0); cout.tie(0);} void online_judge(){freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);} const int flag_max=0x3f3f3f3f; const ll OO=1e9 ; const double EPS = (1e-7); int dcmp(double x, double y) { return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1; } /***********************main_problem****************************/ ll memo[105][105]; void compination(){ memo[1][1]=1; memo[1][0]=1; for(int i=2;i<101;i++){ memo[i][0]=1; for(int j=1;j<=i;j++){ memo[i][j]=memo[i-1][j]+memo[i-1][j-1]; } } } /**************************Bisho_O*****************************************/ int main() { fast(); int a,b; compination(); while(cin>>a>>b && (a!=0 && b!=0)) { cout<<a<<" things taken "<<b<<" at a time is "<<memo[a][b]<<" exactly.\n"; } return 0; }
21.841463
89
0.505863
[ "vector" ]
e54dd6459e5fb6e8780e30bb1c0918dd2b40d557
8,057
hpp
C++
src/org/apache/poi/hssf/usermodel/DummyGraphics2d.hpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
src/org/apache/poi/hssf/usermodel/DummyGraphics2d.hpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
src/org/apache/poi/hssf/usermodel/DummyGraphics2d.hpp
pebble2015/cpoi
6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6
[ "Apache-2.0" ]
null
null
null
// Generated from /POI/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java #pragma once #include <fwd-POI.hpp> #include <java/awt/fwd-POI.hpp> #include <java/awt/font/fwd-POI.hpp> #include <java/awt/geom/fwd-POI.hpp> #include <java/awt/image/fwd-POI.hpp> #include <java/awt/image/renderable/fwd-POI.hpp> #include <java/io/fwd-POI.hpp> #include <java/lang/fwd-POI.hpp> #include <java/text/fwd-POI.hpp> #include <java/util/fwd-POI.hpp> #include <org/apache/poi/hssf/usermodel/fwd-POI.hpp> #include <java/awt/Graphics2D.hpp> struct default_init_tag; class poi::hssf::usermodel::DummyGraphics2d : public ::java::awt::Graphics2D { public: typedef ::java::awt::Graphics2D super; private: ::java::awt::image::BufferedImage* bufimg { }; ::java::awt::Graphics2D* g2D { }; ::java::io::PrintStream* log { }; protected: void ctor(); void ctor(::java::io::PrintStream* log); void ctor(::java::io::PrintStream* log, ::java::awt::Graphics2D* g2D); public: void addRenderingHints(::java::util::Map* hints) override; void clip(::java::awt::Shape* s) override; void draw(::java::awt::Shape* s) override; void drawGlyphVector(::java::awt::font::GlyphVector* g, float x, float y) override; void drawImage(::java::awt::image::BufferedImage* img, ::java::awt::image::BufferedImageOp* op, int32_t x, int32_t y) override; bool drawImage(::java::awt::Image* img, ::java::awt::geom::AffineTransform* xform, ::java::awt::image::ImageObserver* obs) override; void drawRenderableImage(::java::awt::image::renderable::RenderableImage* img, ::java::awt::geom::AffineTransform* xform) override; void drawRenderedImage(::java::awt::image::RenderedImage* img, ::java::awt::geom::AffineTransform* xform) override; void drawString(::java::text::AttributedCharacterIterator* iterator, float x, float y) override; void drawString(::java::lang::String* s, float x, float y) override; void fill(::java::awt::Shape* s) override; ::java::awt::Color* getBackground() override; ::java::awt::Composite* getComposite() override; ::java::awt::GraphicsConfiguration* getDeviceConfiguration() override; ::java::awt::font::FontRenderContext* getFontRenderContext() override; ::java::awt::Paint* getPaint() override; ::java::lang::Object* getRenderingHint(::java::awt::RenderingHints_Key* hintKey) override; ::java::awt::RenderingHints* getRenderingHints() override; ::java::awt::Stroke* getStroke() override; ::java::awt::geom::AffineTransform* getTransform() override; bool hit(::java::awt::Rectangle* rect, ::java::awt::Shape* s, bool onStroke) override; void rotate(double theta) override; void rotate(double theta, double x, double y) override; void scale(double sx, double sy) override; void setBackground(::java::awt::Color* color) override; void setComposite(::java::awt::Composite* comp) override; void setPaint(::java::awt::Paint* paint) override; void setRenderingHint(::java::awt::RenderingHints_Key* hintKey, ::java::lang::Object* hintValue) override; void setRenderingHints(::java::util::Map* hints) override; void setStroke(::java::awt::Stroke* s) override; void setTransform(::java::awt::geom::AffineTransform* Tx) override; void shear(double shx, double shy) override; void transform(::java::awt::geom::AffineTransform* Tx) override; void translate(double tx, double ty) override; void clearRect(int32_t x, int32_t y, int32_t width, int32_t height) override; void clipRect(int32_t x, int32_t y, int32_t width, int32_t height) override; void copyArea(int32_t x, int32_t y, int32_t width, int32_t height, int32_t dx, int32_t dy) override; ::java::awt::Graphics* create() override; ::java::awt::Graphics* create(int32_t x, int32_t y, int32_t width, int32_t height) override; void dispose() override; void draw3DRect(int32_t x, int32_t y, int32_t width, int32_t height, bool raised) override; void drawArc(int32_t x, int32_t y, int32_t width, int32_t height, int32_t startAngle, int32_t arcAngle) override; void drawBytes(::int8_tArray* data, int32_t offset, int32_t length, int32_t x, int32_t y) override; void drawChars(::char16_tArray* data, int32_t offset, int32_t length, int32_t x, int32_t y) override; bool drawImage(::java::awt::Image* img, int32_t dx1, int32_t dy1, int32_t dx2, int32_t dy2, int32_t sx1, int32_t sy1, int32_t sx2, int32_t sy2, ::java::awt::image::ImageObserver* observer) override; bool drawImage(::java::awt::Image* img, int32_t dx1, int32_t dy1, int32_t dx2, int32_t dy2, int32_t sx1, int32_t sy1, int32_t sx2, int32_t sy2, ::java::awt::Color* bgcolor, ::java::awt::image::ImageObserver* observer) override; bool drawImage(::java::awt::Image* img, int32_t x, int32_t y, ::java::awt::Color* bgcolor, ::java::awt::image::ImageObserver* observer) override; bool drawImage(::java::awt::Image* img, int32_t x, int32_t y, ::java::awt::image::ImageObserver* observer) override; bool drawImage(::java::awt::Image* img, int32_t x, int32_t y, int32_t width, int32_t height, ::java::awt::Color* bgcolor, ::java::awt::image::ImageObserver* observer) override; bool drawImage(::java::awt::Image* img, int32_t x, int32_t y, int32_t width, int32_t height, ::java::awt::image::ImageObserver* observer) override; void drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2) override; void drawOval(int32_t x, int32_t y, int32_t width, int32_t height) override; void drawPolygon(::java::awt::Polygon* p) override; void drawPolygon(::int32_tArray* xPoints, ::int32_tArray* yPoints, int32_t nPoints) override; void drawPolyline(::int32_tArray* xPoints, ::int32_tArray* yPoints, int32_t nPoints) override; void drawRect(int32_t x, int32_t y, int32_t width, int32_t height) override; void drawRoundRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t arcWidth, int32_t arcHeight) override; void drawString(::java::text::AttributedCharacterIterator* iterator, int32_t x, int32_t y) override; void drawString(::java::lang::String* str, int32_t x, int32_t y) override; void fill3DRect(int32_t x, int32_t y, int32_t width, int32_t height, bool raised) override; void fillArc(int32_t x, int32_t y, int32_t width, int32_t height, int32_t startAngle, int32_t arcAngle) override; void fillOval(int32_t x, int32_t y, int32_t width, int32_t height) override; void fillPolygon(::java::awt::Polygon* p) override; void fillPolygon(::int32_tArray* xPoints, ::int32_tArray* yPoints, int32_t nPoints) override; void fillRect(int32_t x, int32_t y, int32_t width, int32_t height) override; void fillRoundRect(int32_t x, int32_t y, int32_t width, int32_t height, int32_t arcWidth, int32_t arcHeight) override; void finalize() override; ::java::awt::Shape* getClip() override; ::java::awt::Rectangle* getClipBounds() override; ::java::awt::Rectangle* getClipBounds(::java::awt::Rectangle* r) override; ::java::awt::Color* getColor() override; ::java::awt::Font* getFont() override; ::java::awt::FontMetrics* getFontMetrics() override; ::java::awt::FontMetrics* getFontMetrics(::java::awt::Font* f) override; bool hitClip(int32_t x, int32_t y, int32_t width, int32_t height) override; void setClip(::java::awt::Shape* clip) override; void setClip(int32_t x, int32_t y, int32_t width, int32_t height) override; void setColor(::java::awt::Color* c) override; void setFont(::java::awt::Font* font) override; void setPaintMode() override; void setXORMode(::java::awt::Color* c1) override; ::java::lang::String* toString() override; void translate(int32_t x, int32_t y) override; // Generated DummyGraphics2d(); DummyGraphics2d(::java::io::PrintStream* log); DummyGraphics2d(::java::io::PrintStream* log, ::java::awt::Graphics2D* g2D); protected: DummyGraphics2d(const ::default_init_tag&); public: static ::java::lang::Class *class_(); private: virtual ::java::lang::Class* getClass0(); };
59.681481
231
0.714658
[ "object", "shape", "transform" ]
e550eef360e22d415f8859604f3cb876d8b38f11
3,152
hpp
C++
Demo/src/MenuState.hpp
fallahn/xygine
c17e7d29bb57a5425a58abd3a05a843d6bac48e3
[ "Unlicense" ]
220
2015-10-22T16:12:13.000Z
2022-03-16T18:51:11.000Z
Demo/src/MenuState.hpp
fallahn/xygine
c17e7d29bb57a5425a58abd3a05a843d6bac48e3
[ "Unlicense" ]
64
2016-05-05T19:17:13.000Z
2021-02-11T19:24:37.000Z
Demo/src/MenuState.hpp
fallahn/xygine
c17e7d29bb57a5425a58abd3a05a843d6bac48e3
[ "Unlicense" ]
33
2016-01-13T16:44:26.000Z
2021-11-05T21:57:24.000Z
/********************************************************************* (c) Matt Marchant 2017 http://trederia.blogspot.com xygineXT - Zlib license. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. *********************************************************************/ #pragma once #include <xyginext/core/State.hpp> #include <xyginext/core/ConfigFile.hpp> #include <xyginext/ecs/Scene.hpp> #include <xyginext/resources/Resource.hpp> #include <xyginext/resources/ResourceHandler.hpp> #include <SFML/Graphics/Font.hpp> #include "StateIDs.hpp" #include "SharedStateData.hpp" namespace xy { class PostBlur; class Transform; } namespace MenuID { enum { Main, Player, Network, Keybind }; } class LoadingScreen; class MenuState final : public xy::State { public: MenuState(xy::StateStack&, xy::State::Context, SharedStateData&, LoadingScreen&); xy::StateID stateID() const override { return StateID::MainMenu; } bool handleEvent(const sf::Event&) override; void handleMessage(const xy::Message&) override; bool update(float) override; void draw() override; private: xy::Scene m_scene; xy::Scene m_helpScene; xy::AudioResource m_audioResource; xy::ResourceHandler m_resource; // Handles to resources we'll use xy::ResourceHandle m_menuBGRes, m_grassRes, m_flowerRes, m_helpSignRes, m_caveStoryRes, m_helpRes, m_keyBindsRes, m_buttonRes; SharedStateData& m_sharedStateData; LoadingScreen& m_loadingScreen; bool m_helpShown; xy::PostBlur* m_blurEffect; xy::ConfigFile m_keyBinds; sf::Vector2f m_menuTarget; sf::Vector2f m_leftMenuTarget; sf::Vector2f m_rightMenuTarget; sf::Vector2f m_helpTextTarget; void loadKeybinds(); void createScene(); void createMenu(); void createHelp(); void showHelpMenu(); void createFirstMenu(xy::Transform&, std::uint32_t, std::uint32_t, sf::Font&); void createSecondMenu(xy::Transform&, std::uint32_t, std::uint32_t, sf::Font&); void createThirdMenu(xy::Transform&, std::uint32_t, std::uint32_t, sf::Font&); void createKeybindInputs(xy::Entity, std::uint8_t); void updateLoadingScreen(float, sf::RenderWindow&) override; };
27.893805
85
0.66783
[ "transform" ]
e55185733cd205e0e0be1f4d47062bfb56463e08
1,632
cpp
C++
src/problems/51-100/90/problem90.cpp
abeccaro/project-euler
c3b124bb973dc3a1cf29e8c96c3e70c8816d5fa3
[ "MIT" ]
1
2019-12-25T10:17:15.000Z
2019-12-25T10:17:15.000Z
src/problems/51-100/90/problem90.cpp
abeccaro/project-euler
c3b124bb973dc3a1cf29e8c96c3e70c8816d5fa3
[ "MIT" ]
null
null
null
src/problems/51-100/90/problem90.cpp
abeccaro/project-euler
c3b124bb973dc3a1cf29e8c96c3e70c8816d5fa3
[ "MIT" ]
null
null
null
// // Created by Alex Beccaro on 28/02/18. // #include "problem90.hpp" #include <generics.hpp> using std::vector; using generics::combinations; namespace problems { void problem90::extend(vector<uint32_t>& dice) { bool six = false, nine = false; for (const auto& n : dice) { if (n == 6) six = true; else if (n == 9) nine = true; } if (six && !nine) dice.push_back(9); else if (nine && !six) dice.push_back(6); } bool problem90::is_valid(const vector<uint32_t>& d1, const vector<uint32_t>& d2, const vector<uint32_t>& tests) { for (uint32_t t : tests) { uint32_t n1 = t / 10; uint32_t n2 = t % 10; auto contains = [](const vector<uint32_t>& vec, uint32_t val) { return std::find(vec.begin(), vec.end(), val) != vec.end(); }; if (!((contains(d1, n1) && contains(d2, n2)) || (contains(d2, n1) && contains(d1, n2)))) return false; } return true; } uint32_t problem90::solve(const vector<uint32_t>& tests) { uint32_t result = 0; const vector<uint32_t> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; vector<vector<uint32_t>> combs = combinations(digits, 6); for (auto i = combs.begin(); i < combs.end(); i++) { extend(*i); for (auto j = i; j < combs.end(); j++) { extend(*j); if (is_valid(*i, *j, tests)) result++; } } return result; } }
27.661017
117
0.484681
[ "vector" ]
e551b7076b2463251dcfd9699442195f3aa9553c
4,116
cpp
C++
weighting.cpp
drigil/Radiosity
e28c05d59bc56694aeffc7befd84768b2b637399
[ "MIT" ]
13
2018-08-10T16:25:11.000Z
2022-03-06T08:41:49.000Z
weighting.cpp
drigil/Radiosity
e28c05d59bc56694aeffc7befd84768b2b637399
[ "MIT" ]
null
null
null
weighting.cpp
drigil/Radiosity
e28c05d59bc56694aeffc7befd84768b2b637399
[ "MIT" ]
2
2018-12-07T09:42:47.000Z
2018-12-19T06:47:27.000Z
//////////////////////////////////////////////////////////////////////// // // weighting.cpp: Weightings to apply to a rendered image to get // how much light comes from which point. // // Copyright (c) Simon Frankau 2018 // #include <cmath> #include "geom.h" #include "weighting.h" // Generate a weightings array based on projecting rectangles onto a // sphere. Assumes 90 degree field of view. void projSubtendWeights(int resolution, std::vector<double> &weights) { // From -1 to +1. double conv = 2.0 / resolution; // Make total come to 1. double weight = 3.0 / (M_PI * 2.0); for (int y = 0; y < resolution; ++y) { for (int x = 0; x < resolution; ++x) { Vertex v1 = Vertex(x * conv - 1, y * conv - 1, 1); Vertex v2 = Vertex((x + 1) * conv - 1, y * conv - 1, 1); Vertex v3 = Vertex(x * conv - 1, (y + 1) * conv - 1, 1); v1 = v1.norm(); v2 = v2.norm(); v3 = v3.norm(); weights.push_back(weight * cross(v3 - v1, v2 - v1).len()); } } } // Like projSubtendWeights, but generated analytically rather than through // finite differences. void calcSubtendWeights(int resolution, std::vector<double> &weights) { // From -1 to +1. double conv = 2.0 / resolution; // Make total come to 1. double weight = 3.0 / (M_PI * 2.0); for (int y = 0; y < resolution; ++y) { for (int x = 0; x < resolution; ++x) { // We're calculating how much a pixel at (px, py) occludes // of the unit sphere. We'll axis align it, and calculate // it for (sqrt(distSq), 0) instead: double px = (x + 0.5) * conv - 1.0; double py = (y + 0.5) * conv - 1.0; // Distance from centre of projection plane. double distSq = px * px + py * py; // When we project down from the pixel to the sphere, the // x-axis scaling factor is is derivative of arctan, 1/(1 // + dist^2)... double xFactor = 1.0 / (1.0 + distSq); // and the y-axis factor is just scaled by 1/(distance // from centre of sphere we're projecting onto) // (this is just perspective). double yFactor = sqrt(xFactor); // And the final calculation, throwing in a couple of // "conv"s to get the scaling factor right. weights.push_back(weight * conv * conv * xFactor * yFactor); } } } // Calculate forward-facing weights. Like calcSubtendWeights, but with an extra // cos(theta) factor for the angle from facing direction. void calcForwardLightWeights(int resolution, std::vector<double> &weights) { double conv = 2.0 / resolution; double weight = 1.0 / M_PI; for (int y = 0; y < resolution; ++y) { for (int x = 0; x < resolution; ++x) { // Mostly calculation is same as before... double px = (x + 0.5) * conv - 1.0; double py = (y + 0.5) * conv - 1.0; double distSq = px * px + py * py; double xFactor = 1.0 / (1.0 + distSq); // We multiply in an extra sqrt(xFactor) to get what we need, // which turns the whole thing into an extra xFactor. weights.push_back(weight * conv * conv * xFactor * xFactor); } } } // Calculate sideways-facing weights. Like calcForwardLightWeights, // but for the sideways-facing cube maps. void calcSideLightWeights(int resolution, std::vector<double> &weights) { double conv = 2.0 / resolution; double weight = 1.0 / M_PI; for (int y = 0; y < resolution / 2; ++y) { for (int x = 0; x < resolution; ++x) { // Mostly calculation is same as before... double px = (x + 0.5) * conv - 1.0; double py = (y + 0.5) * conv - 1.0; double distSq = px * px + py * py; double xFactor = 1.0 / (1.0 + distSq); // The extra weighting needed for the extra cos is yFactor * -py. weights.push_back(weight * conv * conv * xFactor * xFactor * -py); } } }
38.111111
79
0.547133
[ "vector" ]
e553becc4adc04f3f9d0b843f07947835d63592a
28,618
cpp
C++
DDrawCompat/Win32/Log.cpp
c3358/DDrawCompat
27ae9affb8f78d56c1cd09cf888be9ac94c051e9
[ "0BSD" ]
1
2021-02-10T17:49:17.000Z
2021-02-10T17:49:17.000Z
DDrawCompat/Win32/Log.cpp
c3358/DDrawCompat
27ae9affb8f78d56c1cd09cf888be9ac94c051e9
[ "0BSD" ]
null
null
null
DDrawCompat/Win32/Log.cpp
c3358/DDrawCompat
27ae9affb8f78d56c1cd09cf888be9ac94c051e9
[ "0BSD" ]
null
null
null
#include <sstream> #include <Common/Hook.h> #include <Common/Log.h> #include <Win32/Log.h> namespace { template <typename CreateStruct> std::ostream& logCreateStruct(std::ostream& os, const CreateStruct& cs) { return Compat::LogStruct(os) << Compat::hex(cs.dwExStyle) << cs.lpszClass << cs.lpszName << Compat::hex(cs.style) << cs.x << cs.y << cs.cx << cs.cy << cs.hwndParent << cs.hMenu << cs.hInstance << cs.lpCreateParams; } template <typename DevMode> std::ostream& logDevMode(std::ostream& os, const DevMode& dm) { return Compat::LogStruct(os) << dm.dmPelsWidth << dm.dmPelsHeight << dm.dmBitsPerPel << dm.dmDisplayFrequency << dm.dmDisplayFlags; } template <typename MdiCreateStruct> std::ostream& logMdiCreateStruct(std::ostream& os, const MdiCreateStruct& mcs) { return Compat::LogStruct(os) << mcs.szClass << mcs.szTitle << mcs.hOwner << mcs.x << mcs.y << mcs.cx << mcs.cy << Compat::hex(mcs.style) << Compat::hex(mcs.lParam); } } std::ostream& operator<<(std::ostream& os, const COMPAREITEMSTRUCT& cis) { return Compat::LogStruct(os) << cis.CtlType << cis.CtlID << cis.hwndItem << cis.itemID1 << Compat::hex(cis.itemData1) << cis.itemID2 << Compat::hex(cis.itemData2) << Compat::hex(cis.dwLocaleId); } std::ostream& operator<<(std::ostream& os, const COPYDATASTRUCT& cds) { return Compat::LogStruct(os) << Compat::hex(cds.dwData) << cds.cbData << cds.lpData; } std::ostream& operator<<(std::ostream& os, const CREATESTRUCTA& cs) { return logCreateStruct(os, cs); } std::ostream& operator<<(std::ostream& os, const CREATESTRUCTW& cs) { return logCreateStruct(os, cs); } std::ostream& operator<<(std::ostream& os, const CWPSTRUCT& cwp) { return Compat::LogStruct(os) << Compat::WindowMessageStruct(cwp.hwnd, cwp.message, cwp.wParam, cwp.lParam); } std::ostream& operator<<(std::ostream& os, const CWPRETSTRUCT& cwrp) { return Compat::LogStruct(os) << Compat::WindowMessageStruct(cwrp.hwnd, cwrp.message, cwrp.wParam, cwrp.lParam) << Compat::hex(cwrp.lResult); } std::ostream& operator<<(std::ostream& os, const DELETEITEMSTRUCT& dis) { return Compat::LogStruct(os) << dis.CtlType << dis.CtlID << dis.itemID << dis.hwndItem << Compat::hex(dis.itemData); } std::ostream& operator<<(std::ostream& os, const DEVMODEA& dm) { return logDevMode(os, dm); } std::ostream& operator<<(std::ostream& os, const DEVMODEW& dm) { return logDevMode(os, dm); } std::ostream& operator<<(std::ostream& os, const DRAWITEMSTRUCT& dis) { return Compat::LogStruct(os) << dis.CtlType << dis.CtlID << dis.itemID << Compat::hex(dis.itemAction) << Compat::hex(dis.itemState) << dis.hwndItem << dis.hDC << dis.rcItem << Compat::hex(dis.itemData); } std::ostream& operator<<(std::ostream& os, const GESTURENOTIFYSTRUCT& gns) { return Compat::LogStruct(os) << gns.cbSize << Compat::hex(gns.dwFlags) << gns.hwndTarget << gns.ptsLocation << gns.dwInstanceID; } std::ostream& operator<<(std::ostream& os, HDC dc) { os << "DC"; if (!dc) { return os << "(null)"; } return Compat::LogStruct(os) << static_cast<void*>(dc) << CALL_ORIG_FUNC(WindowFromDC)(dc); } std::ostream& operator<<(std::ostream& os, const HELPINFO& hi) { Compat::LogStruct log(os); log << hi.cbSize << hi.iContextType << hi.iCtrlId; if (HELPINFO_WINDOW == hi.iContextType) { log << static_cast<HWND>(hi.hItemHandle); } else { log << static_cast<HMENU>(hi.hItemHandle); } return log << hi.dwContextId << hi.MousePos; } std::ostream& operator<<(std::ostream& os, HFONT font) { LOGFONT lf = {}; if (font) { GetObject(font, sizeof(lf), &lf); } return Compat::LogStruct(os) << static_cast<void*>(font) << (font ? &lf : nullptr); } std::ostream& operator<<(std::ostream& os, HRGN rgn) { os << "RGN"; if (!rgn) { return os << "(null)"; } DWORD size = GetRegionData(rgn, 0, nullptr); if (0 == size) { return os << "[]"; } std::vector<unsigned char> rgnDataBuf(size); auto& rgnData = *reinterpret_cast<RGNDATA*>(rgnDataBuf.data()); GetRegionData(rgn, size, &rgnData); return os << Compat::array(reinterpret_cast<RECT*>(rgnData.Buffer), rgnData.rdh.nCount); } std::ostream& operator<<(std::ostream& os, HWND hwnd) { os << "WND"; if (!hwnd) { return os << "(null)"; } if (!IsWindow(hwnd)) { return Compat::LogStruct(os) << static_cast<void*>(hwnd) << "INVALID"; } char name[256] = {}; RECT rect = {}; GetClassName(hwnd, name, sizeof(name)); GetWindowRect(hwnd, &rect); return Compat::LogStruct(os) << static_cast<void*>(hwnd) << static_cast<void*>(GetParent(hwnd)) << name << Compat::hex(GetClassLong(hwnd, GCL_STYLE)) << rect << Compat::hex(CALL_ORIG_FUNC(GetWindowLongA)(hwnd, GWL_STYLE)) << Compat::hex(CALL_ORIG_FUNC(GetWindowLongA)(hwnd, GWL_EXSTYLE)); } std::ostream& operator<<(std::ostream& os, const LOGFONT& lf) { return Compat::LogStruct(os) << lf.lfHeight << lf.lfWidth << lf.lfEscapement << lf.lfOrientation << lf.lfWeight << static_cast<UINT>(lf.lfItalic) << static_cast<UINT>(lf.lfUnderline) << static_cast<UINT>(lf.lfStrikeOut) << static_cast<UINT>(lf.lfCharSet) << static_cast<UINT>(lf.lfOutPrecision) << static_cast<UINT>(lf.lfClipPrecision) << static_cast<UINT>(lf.lfQuality) << Compat::hex<UINT>(lf.lfPitchAndFamily) << lf.lfFaceName; } std::ostream& operator<<(std::ostream& os, const MDICREATESTRUCTA& mcs) { return logMdiCreateStruct(os, mcs); } std::ostream& operator<<(std::ostream& os, const MDICREATESTRUCTW& mcs) { return logMdiCreateStruct(os, mcs); } std::ostream& operator<<(std::ostream& os, const MDINEXTMENU& mnm) { return Compat::LogStruct(os) << mnm.hmenuIn << mnm.hmenuNext << mnm.hwndNext; } std::ostream& operator<<(std::ostream& os, const MEASUREITEMSTRUCT& mis) { return Compat::LogStruct(os) << mis.CtlType << mis.CtlID << mis.itemID << mis.itemWidth << mis.itemHeight << Compat::hex(mis.itemData); } std::ostream& operator<<(std::ostream& os, const MEMORYSTATUS& ms) { return Compat::LogStruct(os) << ms.dwLength << ms.dwMemoryLoad << ms.dwTotalPhys << ms.dwAvailPhys << ms.dwTotalPageFile << ms.dwAvailPageFile << ms.dwTotalVirtual << ms.dwAvailVirtual; } std::ostream& operator<<(std::ostream& os, const MENUGETOBJECTINFO& mgoi) { return Compat::LogStruct(os) << Compat::hex(mgoi.dwFlags) << mgoi.uPos << mgoi.hmenu << static_cast<GUID*>(mgoi.riid) << mgoi.pvObj; } std::ostream& operator<<(std::ostream& os, const MINMAXINFO& mmi) { return Compat::LogStruct(os) << mmi.ptReserved << mmi.ptMaxSize << mmi.ptMaxPosition << mmi.ptMinTrackSize << mmi.ptMaxTrackSize; } std::ostream& operator<<(std::ostream& os, const MSG& msg) { return Compat::LogStruct(os) << Compat::WindowMessageStruct(msg.hwnd, msg.message, msg.wParam, msg.lParam) << msg.time << msg.pt; } std::ostream& operator<<(std::ostream& os, const NCCALCSIZE_PARAMS& nccs) { return Compat::LogStruct(os) << Compat::array(nccs.rgrc, sizeof(nccs.rgrc) / sizeof(nccs.rgrc[0])) << nccs.lppos; } std::ostream& operator<<(std::ostream& os, const NMHDR& nm) { return Compat::LogStruct(os) << nm.hwndFrom << nm.idFrom << Compat::hex(nm.code); } std::ostream& operator<<(std::ostream& os, const POINT& p) { return Compat::LogStruct(os) << p.x << p.y; } std::ostream& operator<<(std::ostream& os, const RECT& rect) { return Compat::LogStruct(os) << rect.left << rect.top << rect.right << rect.bottom; } std::ostream& operator<<(std::ostream& os, const SIZE& size) { return Compat::LogStruct(os) << size.cx << size.cy; } std::ostream& operator<<(std::ostream& os, const STYLESTRUCT& ss) { return Compat::LogStruct(os) << Compat::hex(ss.styleOld) << Compat::hex(ss.styleNew); } std::ostream& operator<<(std::ostream& os, const TITLEBARINFOEX& tbi) { return Compat::LogStruct(os) << tbi.cbSize << tbi.rcTitleBar << Compat::array(tbi.rgstate, sizeof(tbi.rgstate) / sizeof(tbi.rgstate[0])) << Compat::array(tbi.rgrect, sizeof(tbi.rgrect) / sizeof(tbi.rgrect[0])); } std::ostream& operator<<(std::ostream& os, const TOUCH_HIT_TESTING_INPUT& thti) { return Compat::LogStruct(os) << thti.pointerId << thti.point << thti.boundingBox << thti.nonOccludedBoundingBox << thti.orientation; } std::ostream& operator<<(std::ostream& os, const WINDOWPOS& wp) { return Compat::LogStruct(os) << wp.hwnd << wp.hwndInsertAfter << wp.x << wp.y << wp.cx << wp.cy << Compat::hex(wp.flags); } namespace Compat { std::ostream& operator<<(std::ostream& os, WindowMessage msg) { #define LOG_WM_CASE(msg) case msg: return os << #msg; switch (msg.msg) { LOG_WM_CASE(WM_NULL); LOG_WM_CASE(WM_CREATE); LOG_WM_CASE(WM_DESTROY); LOG_WM_CASE(WM_MOVE); LOG_WM_CASE(WM_SIZE); LOG_WM_CASE(WM_ACTIVATE); LOG_WM_CASE(WM_SETFOCUS); LOG_WM_CASE(WM_KILLFOCUS); LOG_WM_CASE(WM_ENABLE); LOG_WM_CASE(WM_SETREDRAW); LOG_WM_CASE(WM_SETTEXT); LOG_WM_CASE(WM_GETTEXT); LOG_WM_CASE(WM_GETTEXTLENGTH); LOG_WM_CASE(WM_PAINT); LOG_WM_CASE(WM_CLOSE); LOG_WM_CASE(WM_QUERYENDSESSION); LOG_WM_CASE(WM_QUERYOPEN); LOG_WM_CASE(WM_ENDSESSION); LOG_WM_CASE(WM_QUIT); LOG_WM_CASE(WM_ERASEBKGND); LOG_WM_CASE(WM_SYSCOLORCHANGE); LOG_WM_CASE(WM_SHOWWINDOW); LOG_WM_CASE(WM_SETTINGCHANGE); LOG_WM_CASE(WM_DEVMODECHANGE); LOG_WM_CASE(WM_ACTIVATEAPP); LOG_WM_CASE(WM_FONTCHANGE); LOG_WM_CASE(WM_TIMECHANGE); LOG_WM_CASE(WM_CANCELMODE); LOG_WM_CASE(WM_SETCURSOR); LOG_WM_CASE(WM_MOUSEACTIVATE); LOG_WM_CASE(WM_CHILDACTIVATE); LOG_WM_CASE(WM_QUEUESYNC); LOG_WM_CASE(WM_GETMINMAXINFO); LOG_WM_CASE(WM_PAINTICON); LOG_WM_CASE(WM_ICONERASEBKGND); LOG_WM_CASE(WM_NEXTDLGCTL); LOG_WM_CASE(WM_SPOOLERSTATUS); LOG_WM_CASE(WM_DRAWITEM); LOG_WM_CASE(WM_MEASUREITEM); LOG_WM_CASE(WM_DELETEITEM); LOG_WM_CASE(WM_VKEYTOITEM); LOG_WM_CASE(WM_CHARTOITEM); LOG_WM_CASE(WM_SETFONT); LOG_WM_CASE(WM_GETFONT); LOG_WM_CASE(WM_SETHOTKEY); LOG_WM_CASE(WM_GETHOTKEY); LOG_WM_CASE(WM_QUERYDRAGICON); LOG_WM_CASE(WM_COMPAREITEM); LOG_WM_CASE(WM_GETOBJECT); LOG_WM_CASE(WM_COMPACTING); LOG_WM_CASE(WM_COMMNOTIFY); LOG_WM_CASE(WM_WINDOWPOSCHANGING); LOG_WM_CASE(WM_WINDOWPOSCHANGED); LOG_WM_CASE(WM_POWER); LOG_WM_CASE(WM_COPYDATA); LOG_WM_CASE(WM_CANCELJOURNAL); LOG_WM_CASE(WM_NOTIFY); LOG_WM_CASE(WM_INPUTLANGCHANGEREQUEST); LOG_WM_CASE(WM_INPUTLANGCHANGE); LOG_WM_CASE(WM_TCARD); LOG_WM_CASE(WM_HELP); LOG_WM_CASE(WM_USERCHANGED); LOG_WM_CASE(WM_NOTIFYFORMAT); LOG_WM_CASE(WM_CONTEXTMENU); LOG_WM_CASE(WM_STYLECHANGING); LOG_WM_CASE(WM_STYLECHANGED); LOG_WM_CASE(WM_DISPLAYCHANGE); LOG_WM_CASE(WM_GETICON); LOG_WM_CASE(WM_SETICON); LOG_WM_CASE(WM_NCCREATE); LOG_WM_CASE(WM_NCDESTROY); LOG_WM_CASE(WM_NCCALCSIZE); LOG_WM_CASE(WM_NCHITTEST); LOG_WM_CASE(WM_NCPAINT); LOG_WM_CASE(WM_NCACTIVATE); LOG_WM_CASE(WM_GETDLGCODE); LOG_WM_CASE(WM_SYNCPAINT); LOG_WM_CASE(WM_NCMOUSEMOVE); LOG_WM_CASE(WM_NCLBUTTONDOWN); LOG_WM_CASE(WM_NCLBUTTONUP); LOG_WM_CASE(WM_NCLBUTTONDBLCLK); LOG_WM_CASE(WM_NCRBUTTONDOWN); LOG_WM_CASE(WM_NCRBUTTONUP); LOG_WM_CASE(WM_NCRBUTTONDBLCLK); LOG_WM_CASE(WM_NCMBUTTONDOWN); LOG_WM_CASE(WM_NCMBUTTONUP); LOG_WM_CASE(WM_NCMBUTTONDBLCLK); LOG_WM_CASE(WM_NCXBUTTONDOWN); LOG_WM_CASE(WM_NCXBUTTONUP); LOG_WM_CASE(WM_NCXBUTTONDBLCLK); LOG_WM_CASE(WM_INPUT_DEVICE_CHANGE); LOG_WM_CASE(WM_INPUT); LOG_WM_CASE(WM_KEYDOWN); LOG_WM_CASE(WM_KEYUP); LOG_WM_CASE(WM_CHAR); LOG_WM_CASE(WM_DEADCHAR); LOG_WM_CASE(WM_SYSKEYDOWN); LOG_WM_CASE(WM_SYSKEYUP); LOG_WM_CASE(WM_SYSCHAR); LOG_WM_CASE(WM_SYSDEADCHAR); LOG_WM_CASE(WM_UNICHAR); LOG_WM_CASE(WM_IME_STARTCOMPOSITION); LOG_WM_CASE(WM_IME_ENDCOMPOSITION); LOG_WM_CASE(WM_IME_COMPOSITION); LOG_WM_CASE(WM_INITDIALOG); LOG_WM_CASE(WM_COMMAND); LOG_WM_CASE(WM_SYSCOMMAND); LOG_WM_CASE(WM_TIMER); LOG_WM_CASE(WM_HSCROLL); LOG_WM_CASE(WM_VSCROLL); LOG_WM_CASE(WM_INITMENU); LOG_WM_CASE(WM_INITMENUPOPUP); LOG_WM_CASE(WM_GESTURE); LOG_WM_CASE(WM_GESTURENOTIFY); LOG_WM_CASE(WM_MENUSELECT); LOG_WM_CASE(WM_MENUCHAR); LOG_WM_CASE(WM_ENTERIDLE); LOG_WM_CASE(WM_MENURBUTTONUP); LOG_WM_CASE(WM_MENUDRAG); LOG_WM_CASE(WM_MENUGETOBJECT); LOG_WM_CASE(WM_UNINITMENUPOPUP); LOG_WM_CASE(WM_MENUCOMMAND); LOG_WM_CASE(WM_CHANGEUISTATE); LOG_WM_CASE(WM_UPDATEUISTATE); LOG_WM_CASE(WM_QUERYUISTATE); LOG_WM_CASE(WM_CTLCOLORMSGBOX); LOG_WM_CASE(WM_CTLCOLOREDIT); LOG_WM_CASE(WM_CTLCOLORLISTBOX); LOG_WM_CASE(WM_CTLCOLORBTN); LOG_WM_CASE(WM_CTLCOLORDLG); LOG_WM_CASE(WM_CTLCOLORSCROLLBAR); LOG_WM_CASE(WM_CTLCOLORSTATIC); LOG_WM_CASE(MN_GETHMENU); LOG_WM_CASE(WM_MOUSEMOVE); LOG_WM_CASE(WM_LBUTTONDOWN); LOG_WM_CASE(WM_LBUTTONUP); LOG_WM_CASE(WM_LBUTTONDBLCLK); LOG_WM_CASE(WM_RBUTTONDOWN); LOG_WM_CASE(WM_RBUTTONUP); LOG_WM_CASE(WM_RBUTTONDBLCLK); LOG_WM_CASE(WM_MBUTTONDOWN); LOG_WM_CASE(WM_MBUTTONUP); LOG_WM_CASE(WM_MBUTTONDBLCLK); LOG_WM_CASE(WM_MOUSEWHEEL); LOG_WM_CASE(WM_XBUTTONDOWN); LOG_WM_CASE(WM_XBUTTONUP); LOG_WM_CASE(WM_XBUTTONDBLCLK); LOG_WM_CASE(WM_MOUSEHWHEEL); LOG_WM_CASE(WM_PARENTNOTIFY); LOG_WM_CASE(WM_ENTERMENULOOP); LOG_WM_CASE(WM_EXITMENULOOP); LOG_WM_CASE(WM_NEXTMENU); LOG_WM_CASE(WM_SIZING); LOG_WM_CASE(WM_CAPTURECHANGED); LOG_WM_CASE(WM_MOVING); LOG_WM_CASE(WM_POWERBROADCAST); LOG_WM_CASE(WM_DEVICECHANGE); LOG_WM_CASE(WM_MDICREATE); LOG_WM_CASE(WM_MDIDESTROY); LOG_WM_CASE(WM_MDIACTIVATE); LOG_WM_CASE(WM_MDIRESTORE); LOG_WM_CASE(WM_MDINEXT); LOG_WM_CASE(WM_MDIMAXIMIZE); LOG_WM_CASE(WM_MDITILE); LOG_WM_CASE(WM_MDICASCADE); LOG_WM_CASE(WM_MDIICONARRANGE); LOG_WM_CASE(WM_MDIGETACTIVE); LOG_WM_CASE(WM_MDISETMENU); LOG_WM_CASE(WM_ENTERSIZEMOVE); LOG_WM_CASE(WM_EXITSIZEMOVE); LOG_WM_CASE(WM_DROPFILES); LOG_WM_CASE(WM_MDIREFRESHMENU); LOG_WM_CASE(WM_POINTERDEVICECHANGE); LOG_WM_CASE(WM_POINTERDEVICEINRANGE); LOG_WM_CASE(WM_POINTERDEVICEOUTOFRANGE); LOG_WM_CASE(WM_TOUCH); LOG_WM_CASE(WM_NCPOINTERUPDATE); LOG_WM_CASE(WM_NCPOINTERDOWN); LOG_WM_CASE(WM_NCPOINTERUP); LOG_WM_CASE(WM_POINTERUPDATE); LOG_WM_CASE(WM_POINTERDOWN); LOG_WM_CASE(WM_POINTERUP); LOG_WM_CASE(WM_POINTERENTER); LOG_WM_CASE(WM_POINTERLEAVE); LOG_WM_CASE(WM_POINTERACTIVATE); LOG_WM_CASE(WM_POINTERCAPTURECHANGED); LOG_WM_CASE(WM_TOUCHHITTESTING); LOG_WM_CASE(WM_POINTERWHEEL); LOG_WM_CASE(WM_POINTERHWHEEL); LOG_WM_CASE(DM_POINTERHITTEST); LOG_WM_CASE(WM_POINTERROUTEDTO); LOG_WM_CASE(WM_POINTERROUTEDAWAY); LOG_WM_CASE(WM_POINTERROUTEDRELEASED); LOG_WM_CASE(WM_IME_SETCONTEXT); LOG_WM_CASE(WM_IME_NOTIFY); LOG_WM_CASE(WM_IME_CONTROL); LOG_WM_CASE(WM_IME_COMPOSITIONFULL); LOG_WM_CASE(WM_IME_SELECT); LOG_WM_CASE(WM_IME_CHAR); LOG_WM_CASE(WM_IME_REQUEST); LOG_WM_CASE(WM_IME_KEYDOWN); LOG_WM_CASE(WM_IME_KEYUP); LOG_WM_CASE(WM_NCMOUSEHOVER); LOG_WM_CASE(WM_MOUSEHOVER); LOG_WM_CASE(WM_NCMOUSELEAVE); LOG_WM_CASE(WM_MOUSELEAVE); LOG_WM_CASE(WM_WTSSESSION_CHANGE); LOG_WM_CASE(WM_DPICHANGED); LOG_WM_CASE(WM_DPICHANGED_BEFOREPARENT); LOG_WM_CASE(WM_DPICHANGED_AFTERPARENT); LOG_WM_CASE(WM_GETDPISCALEDSIZE); LOG_WM_CASE(WM_CUT); LOG_WM_CASE(WM_COPY); LOG_WM_CASE(WM_PASTE); LOG_WM_CASE(WM_CLEAR); LOG_WM_CASE(WM_UNDO); LOG_WM_CASE(WM_RENDERFORMAT); LOG_WM_CASE(WM_RENDERALLFORMATS); LOG_WM_CASE(WM_DESTROYCLIPBOARD); LOG_WM_CASE(WM_DRAWCLIPBOARD); LOG_WM_CASE(WM_PAINTCLIPBOARD); LOG_WM_CASE(WM_VSCROLLCLIPBOARD); LOG_WM_CASE(WM_SIZECLIPBOARD); LOG_WM_CASE(WM_ASKCBFORMATNAME); LOG_WM_CASE(WM_CHANGECBCHAIN); LOG_WM_CASE(WM_HSCROLLCLIPBOARD); LOG_WM_CASE(WM_QUERYNEWPALETTE); LOG_WM_CASE(WM_PALETTEISCHANGING); LOG_WM_CASE(WM_PALETTECHANGED); LOG_WM_CASE(WM_HOTKEY); LOG_WM_CASE(WM_PRINT); LOG_WM_CASE(WM_PRINTCLIENT); LOG_WM_CASE(WM_APPCOMMAND); LOG_WM_CASE(WM_THEMECHANGED); LOG_WM_CASE(WM_CLIPBOARDUPDATE); LOG_WM_CASE(WM_DWMCOMPOSITIONCHANGED); LOG_WM_CASE(WM_DWMNCRENDERINGCHANGED); LOG_WM_CASE(WM_DWMCOLORIZATIONCOLORCHANGED); LOG_WM_CASE(WM_DWMWINDOWMAXIMIZEDCHANGE); LOG_WM_CASE(WM_DWMSENDICONICTHUMBNAIL); LOG_WM_CASE(WM_DWMSENDICONICLIVEPREVIEWBITMAP); LOG_WM_CASE(WM_GETTITLEBARINFOEX); }; #undef LOG_WM_CASE os.width(4); os.fill('0'); os << "WM_" << std::hex << msg.msg << std::dec; return os; } std::ostream& operator<<(std::ostream& os, WindowMessage16 msg) { return os << WindowMessage(msg.msg); } std::ostream& operator<<(std::ostream& os, WindowMessageStruct wm) { os << '{' << wm.hwnd << ',' << wm.msg << ','; #define LOG_PARAM_CASE_1(param, msg, ...) \ case msg: \ static_assert(sizeof(__VA_ARGS__) == sizeof(param)); \ os << *reinterpret_cast<const __VA_ARGS__*>(&param); \ break #define LOG_PARAM_CASE_2(param, msg, TypeA, TypeW) \ case msg: \ if (IsWindowUnicode(wm.hwnd)) \ os << *reinterpret_cast<const TypeW*>(&param); \ else \ os << *reinterpret_cast<const TypeA*>(&param); \ break; #define LOG_WPARAM_CASE_1(msg, ...) LOG_PARAM_CASE_1(wm.wParam, msg, __VA_ARGS__) #define LOG_WPARAM_CASE_2(msg, TypeA, TypeW) LOG_PARAM_CASE_2(wm.wParam, msg, TypeA, TypeW) switch (wm.msg.msg) { LOG_WPARAM_CASE_1(WM_ACTIVATE, std::pair<WORD, WORD>); LOG_WPARAM_CASE_1(WM_APPCOMMAND, HWND); LOG_WPARAM_CASE_1(WM_ASKCBFORMATNAME, DWORD); LOG_WPARAM_CASE_1(WM_CHANGECBCHAIN, HWND); LOG_WPARAM_CASE_1(WM_CHANGEUISTATE, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_CHARTOITEM, std::pair<WORD, WORD>); LOG_WPARAM_CASE_1(WM_CTLCOLORMSGBOX, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLOREDIT, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLORLISTBOX, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLORBTN, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLORDLG, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLORSCROLLBAR, HDC); LOG_WPARAM_CASE_1(WM_CTLCOLORSTATIC, HDC); LOG_WPARAM_CASE_1(WM_COMMAND, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_CONTEXTMENU, HWND); LOG_WPARAM_CASE_1(WM_COPYDATA, HWND); LOG_WPARAM_CASE_1(WM_DISPLAYCHANGE, INT); LOG_WPARAM_CASE_1(WM_DPICHANGED, std::pair<WORD, WORD>); LOG_WPARAM_CASE_1(WM_DRAWITEM, HWND); LOG_WPARAM_CASE_1(WM_ERASEBKGND, HDC); LOG_WPARAM_CASE_1(WM_GETDPISCALEDSIZE, DWORD); LOG_WPARAM_CASE_1(WM_GETTEXT, DWORD); LOG_WPARAM_CASE_1(WM_HOTKEY, INT); LOG_WPARAM_CASE_1(WM_HSCROLL, std::pair<WORD, WORD>); LOG_WPARAM_CASE_1(WM_HSCROLLCLIPBOARD, HWND); LOG_WPARAM_CASE_1(WM_ICONERASEBKGND, HDC); LOG_WPARAM_CASE_1(WM_INITDIALOG, HWND); LOG_WPARAM_CASE_1(WM_KILLFOCUS, HWND); LOG_WPARAM_CASE_1(WM_MDIACTIVATE, HWND); LOG_WPARAM_CASE_1(WM_MDIDESTROY, HWND); LOG_WPARAM_CASE_1(WM_MDIMAXIMIZE, HWND); LOG_WPARAM_CASE_1(WM_MDINEXT, HWND); LOG_WPARAM_CASE_1(WM_MDIRESTORE, HWND); LOG_WPARAM_CASE_1(WM_MENUCHAR, std::pair<Compat::detail::Hex<WORD>, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_MENUCOMMAND, DWORD); LOG_WPARAM_CASE_1(WM_MENUDRAG, DWORD); LOG_WPARAM_CASE_1(WM_MENURBUTTONUP, DWORD); LOG_WPARAM_CASE_1(WM_MENUSELECT, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_MOUSEACTIVATE, HWND); LOG_WPARAM_CASE_1(WM_MOUSEHWHEEL, std::pair<Compat::detail::Hex<WORD>, SHORT>); LOG_WPARAM_CASE_1(WM_MOUSEWHEEL, std::pair<Compat::detail::Hex<WORD>, SHORT>); LOG_WPARAM_CASE_1(WM_NCLBUTTONDBLCLK, INT); LOG_WPARAM_CASE_1(WM_NCLBUTTONDOWN, INT); LOG_WPARAM_CASE_1(WM_NCLBUTTONUP, INT); LOG_WPARAM_CASE_1(WM_NCMBUTTONDBLCLK, INT); LOG_WPARAM_CASE_1(WM_NCMBUTTONDOWN, INT); LOG_WPARAM_CASE_1(WM_NCMBUTTONUP, INT); LOG_WPARAM_CASE_1(WM_NCMOUSEHOVER, INT); LOG_WPARAM_CASE_1(WM_NCMOUSEMOVE, INT); LOG_WPARAM_CASE_1(WM_NCPAINT, HRGN); LOG_WPARAM_CASE_1(WM_NCPOINTERDOWN, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_NCPOINTERUP, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_NCPOINTERUPDATE, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_NCXBUTTONDBLCLK, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_NCXBUTTONDOWN, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_NCXBUTTONUP, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_NOTIFYFORMAT, HWND); LOG_WPARAM_CASE_1(WM_PALETTECHANGED, HWND); LOG_WPARAM_CASE_1(WM_PALETTEISCHANGING, HWND); LOG_WPARAM_CASE_1(WM_PARENTNOTIFY, std::pair<WindowMessage16, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERACTIVATE, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_POINTERDOWN, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERENTER, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERHWHEEL, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_POINTERLEAVE, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERUP, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERUPDATE, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_POINTERWHEEL, std::pair<WORD, SHORT>); LOG_WPARAM_CASE_1(WM_PRINT, HDC); LOG_WPARAM_CASE_1(WM_PRINTCLIENT, HDC); LOG_WPARAM_CASE_1(WM_SETFOCUS, HWND); LOG_WPARAM_CASE_1(WM_SETFONT, HFONT); LOG_WPARAM_CASE_1(WM_SETHOTKEY, std::pair<Compat::detail::Hex<WORD>, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_SETTEXT, DWORD); LOG_WPARAM_CASE_1(WM_SIZECLIPBOARD, HWND); LOG_WPARAM_CASE_1(WM_STYLECHANGED, INT); LOG_WPARAM_CASE_1(WM_STYLECHANGING, INT); LOG_WPARAM_CASE_1(WM_UPDATEUISTATE, std::pair<WORD, Compat::detail::Hex<WORD>>); LOG_WPARAM_CASE_1(WM_VKEYTOITEM, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_VSCROLL, std::pair<WORD, WORD>); LOG_WPARAM_CASE_1(WM_VSCROLLCLIPBOARD, HWND); LOG_WPARAM_CASE_1(WM_XBUTTONDBLCLK, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_XBUTTONDOWN, std::pair<Compat::detail::Hex<WORD>, WORD>); LOG_WPARAM_CASE_1(WM_XBUTTONUP, std::pair<Compat::detail::Hex<WORD>, WORD>); case WM_NEXTDLGCTL: if (wm.lParam) { os << reinterpret_cast<HWND>(wm.wParam); } else { os << wm.wParam; } break; default: os << Compat::hex(wm.wParam); break; } #undef LOG_WPARAM_CASE_1 #undef LOG_WPARAM_CASE_2 #define LOG_LPARAM_CASE_1(msg, ...) LOG_PARAM_CASE_1(wm.lParam, msg, __VA_ARGS__) #define LOG_LPARAM_CASE_2(msg, TypeA, TypeW) LOG_PARAM_CASE_2(wm.lParam, msg, TypeA, TypeW) os << ','; switch (wm.msg.msg) { LOG_LPARAM_CASE_1(WM_ACTIVATE, HWND); LOG_LPARAM_CASE_2(WM_ASKCBFORMATNAME, Compat::detail::Out<LPCSTR>, Compat::detail::Out<LPCWSTR>); LOG_LPARAM_CASE_1(WM_CAPTURECHANGED, HWND); LOG_LPARAM_CASE_1(WM_CHANGECBCHAIN, HWND); LOG_LPARAM_CASE_1(WM_CHARTOITEM, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORMSGBOX, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLOREDIT, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORLISTBOX, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORBTN, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORDLG, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORSCROLLBAR, HWND); LOG_LPARAM_CASE_1(WM_CTLCOLORSTATIC, HWND); LOG_LPARAM_CASE_1(WM_COMMAND, HWND); LOG_LPARAM_CASE_1(WM_COMPAREITEM, COMPAREITEMSTRUCT*); LOG_LPARAM_CASE_1(WM_CONTEXTMENU, POINTS); LOG_LPARAM_CASE_1(WM_COPYDATA, COPYDATASTRUCT*); LOG_LPARAM_CASE_2(WM_CREATE, CREATESTRUCTA*, CREATESTRUCTW*); LOG_LPARAM_CASE_2(WM_DEVMODECHANGE, LPCSTR, LPCWSTR); LOG_LPARAM_CASE_1(WM_DELETEITEM, DELETEITEMSTRUCT*); LOG_LPARAM_CASE_1(WM_DISPLAYCHANGE, std::pair<WORD, WORD>); LOG_LPARAM_CASE_1(WM_DPICHANGED, RECT*); LOG_LPARAM_CASE_1(WM_DRAWITEM, DRAWITEMSTRUCT*); LOG_LPARAM_CASE_1(WM_DWMSENDICONICTHUMBNAIL, std::pair<WORD, WORD>); LOG_LPARAM_CASE_1(WM_ENTERIDLE, HWND); LOG_LPARAM_CASE_1(WM_GESTURENOTIFY, GESTURENOTIFYSTRUCT*); LOG_LPARAM_CASE_1(WM_GETDLGCODE, MSG*); LOG_LPARAM_CASE_1(WM_GETDPISCALEDSIZE, SIZE*); LOG_LPARAM_CASE_1(WM_GETICON, DWORD); LOG_LPARAM_CASE_1(WM_GETMINMAXINFO, MINMAXINFO*); LOG_LPARAM_CASE_2(WM_GETTEXT, Compat::detail::Out<LPCSTR>, Compat::detail::Out<LPCWSTR>); LOG_LPARAM_CASE_1(WM_HELP, HELPINFO*); LOG_LPARAM_CASE_1(WM_HOTKEY, std::pair<Compat::detail::Hex<WORD>, Compat::detail::Hex<WORD>>); LOG_LPARAM_CASE_1(WM_HSCROLL, HWND); LOG_LPARAM_CASE_1(WM_HSCROLLCLIPBOARD, std::pair<WORD, WORD>); LOG_LPARAM_CASE_1(WM_INITMENUPOPUP, std::pair<WORD, WORD>); LOG_LPARAM_CASE_1(WM_LBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_LBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_LBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_MBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_MBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_MBUTTONUP, POINTS); LOG_LPARAM_CASE_2(WM_MDICREATE, MDICREATESTRUCTA*, MDICREATESTRUCTW*); LOG_LPARAM_CASE_1(WM_MDIGETACTIVE, BOOL*); LOG_LPARAM_CASE_1(WM_MEASUREITEM, MEASUREITEMSTRUCT*); LOG_LPARAM_CASE_1(WM_MENUGETOBJECT, MENUGETOBJECTINFO*); LOG_LPARAM_CASE_1(WM_MOUSEACTIVATE, std::pair<SHORT, Compat::detail::Hex<WORD>>); LOG_LPARAM_CASE_1(WM_MOUSEHOVER, POINTS); LOG_LPARAM_CASE_1(WM_MOUSEHWHEEL, POINTS); LOG_LPARAM_CASE_1(WM_MOUSEMOVE, POINTS); LOG_LPARAM_CASE_1(WM_MOUSEWHEEL, POINTS); LOG_LPARAM_CASE_1(WM_MOVE, POINTS); LOG_LPARAM_CASE_1(WM_MOVING, RECT*); LOG_LPARAM_CASE_2(WM_NCCREATE, CREATESTRUCTA*, CREATESTRUCTW*); LOG_LPARAM_CASE_1(WM_NCHITTEST, POINTS); LOG_LPARAM_CASE_1(WM_NCLBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_NCLBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_NCLBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_NCMBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_NCMBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_NCMBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_NCMOUSEHOVER, POINTS); LOG_LPARAM_CASE_1(WM_NCMOUSEMOVE, POINTS); LOG_LPARAM_CASE_1(WM_NCPOINTERDOWN, POINTS); LOG_LPARAM_CASE_1(WM_NCPOINTERUP, POINTS); LOG_LPARAM_CASE_1(WM_NCPOINTERUPDATE, POINTS); LOG_LPARAM_CASE_1(WM_NCRBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_NCRBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_NCRBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_NCXBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_NCXBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_NCXBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_NEXTMENU, MDINEXTMENU*); LOG_LPARAM_CASE_1(WM_NOTIFY, NMHDR*); LOG_LPARAM_CASE_1(WM_PARENTNOTIFY, POINTS); LOG_LPARAM_CASE_1(WM_POINTERACTIVATE, HWND); LOG_LPARAM_CASE_1(WM_POINTERCAPTURECHANGED, HWND); LOG_LPARAM_CASE_1(WM_POINTERDOWN, POINTS); LOG_LPARAM_CASE_1(WM_POINTERENTER, POINTS); LOG_LPARAM_CASE_1(WM_POINTERHWHEEL, POINTS); LOG_LPARAM_CASE_1(WM_POINTERLEAVE, POINTS); LOG_LPARAM_CASE_1(WM_POINTERUP, POINTS); LOG_LPARAM_CASE_1(WM_POINTERUPDATE, POINTS); LOG_LPARAM_CASE_1(WM_POINTERWHEEL, POINTS); LOG_LPARAM_CASE_1(WM_RBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_RBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_RBUTTONUP, POINTS); LOG_LPARAM_CASE_1(WM_SETCURSOR, std::pair<SHORT, Compat::detail::Hex<WORD>>); LOG_LPARAM_CASE_2(WM_SETTEXT, LPCSTR, LPCWSTR); LOG_LPARAM_CASE_2(WM_SETTINGCHANGE, LPCSTR, LPCWSTR); LOG_LPARAM_CASE_1(WM_SIZE, POINTS); LOG_LPARAM_CASE_1(WM_SIZING, RECT*); LOG_LPARAM_CASE_1(WM_STYLECHANGED, STYLESTRUCT*); LOG_LPARAM_CASE_1(WM_STYLECHANGING, STYLESTRUCT*); LOG_LPARAM_CASE_1(WM_SYSCOMMAND, POINTS); LOG_LPARAM_CASE_1(WM_GETTITLEBARINFOEX, TITLEBARINFOEX*); LOG_LPARAM_CASE_1(WM_TOUCHHITTESTING, TOUCH_HIT_TESTING_INPUT*); LOG_LPARAM_CASE_1(WM_VKEYTOITEM, HWND); LOG_LPARAM_CASE_1(WM_VSCROLL, HWND); LOG_LPARAM_CASE_1(WM_VSCROLLCLIPBOARD, std::pair<WORD, WORD>); LOG_LPARAM_CASE_1(WM_WINDOWPOSCHANGED, WINDOWPOS*); LOG_LPARAM_CASE_1(WM_WINDOWPOSCHANGING, WINDOWPOS*); LOG_LPARAM_CASE_1(WM_XBUTTONDBLCLK, POINTS); LOG_LPARAM_CASE_1(WM_XBUTTONDOWN, POINTS); LOG_LPARAM_CASE_1(WM_XBUTTONUP, POINTS); case WM_NCACTIVATE: if (-1 == wm.lParam) { os << "-1"; } else { os << reinterpret_cast<HRGN>(wm.lParam); } break; case WM_NCCALCSIZE: if (wm.wParam) { os << reinterpret_cast<NCCALCSIZE_PARAMS*>(wm.lParam); } else { os << reinterpret_cast<RECT*>(wm.lParam); } break; default: os << Compat::hex(wm.lParam); break; } #undef LOG_LPARAM_CASE_1 #undef LOG_LPARAM_CASE_2 #undef LOG_PARAM_CASE_1 #undef LOG_PARAM_CASE_2 os << '}'; return os; } }
30.412327
100
0.736704
[ "vector" ]
e5597e95c13dd47da134470676a83c3fc899415f
564
cpp
C++
poo/header-example/main.cpp
davidlares/davidC-
7c479757ec8574623c02b03ad5b1223a43805f5c
[ "MIT" ]
null
null
null
poo/header-example/main.cpp
davidlares/davidC-
7c479757ec8574623c02b03ad5b1223a43805f5c
[ "MIT" ]
null
null
null
poo/header-example/main.cpp
davidlares/davidC-
7c479757ec8574623c02b03ad5b1223a43805f5c
[ "MIT" ]
null
null
null
#include "Books.h" #include <iostream> #include <string> using namespace std; int main(){ // instance Books book; // Pointers -> array member selections Books *bookPointer = &book; (*bookPointer).setBookId(300); // () everytime we use pointers, but we can use -> cout << (*bookPointer).getBookId() << endl; // member variables // arrow member selected operator (-> = POINTER) bookPointer->setBookId(1000); cout << bookPointer->getBookId() << endl; // object usage book.setBookId(100); cout << book.getBookId() << endl; return 0; }
22.56
65
0.657801
[ "object" ]
e55a322b2fcc0eff798dfb9f209afa8feaf59daa
41,399
cpp
C++
src/nrnpython/rxd_extracellular.cpp
vogdb/nrn
0ccc9ccbc4e376ec87c7985b4913d68da6b2817b
[ "BSD-3-Clause" ]
null
null
null
src/nrnpython/rxd_extracellular.cpp
vogdb/nrn
0ccc9ccbc4e376ec87c7985b4913d68da6b2817b
[ "BSD-3-Clause" ]
null
null
null
src/nrnpython/rxd_extracellular.cpp
vogdb/nrn
0ccc9ccbc4e376ec87c7985b4913d68da6b2817b
[ "BSD-3-Clause" ]
null
null
null
#include <../../nrnconf.h> #include <stdio.h> #include <assert.h> #include <string.h> #include "grids.h" #include "rxd.h" #include <matrix2.h> #include <pthread.h> #include <nrnwrap_Python.h> #include <cmath> #define loc(x,y,z)((z) + (y) * grid->size_z + (x) * grid->size_z * grid->size_y) static void ecs_refresh_reactions(int); static int dg_adi(Grid_node*); /* Globals */ /*Store the onset/offset for each threads reaction tasks*/ ReactGridData* threaded_reactions_tasks; extern int NUM_THREADS; extern pthread_t* Threads; extern TaskQueue* AllTasks; extern double* t_ptr; extern double* states; Reaction* ecs_reactions = NULL; /*Current from multicompartment reations*/ extern unsigned char _membrane_flux; extern int _memb_curr_total; extern int* _rxd_induced_currents_grid; extern int* _rxd_induced_currents_ecs_idx; extern double* _rxd_induced_currents_ecs; extern double* _rxd_induced_currents_scale; int states_cvode_offset; /*Update the global array of reaction tasks when the number of reactions *or threads change. *n - the old number of threads - use to free the old threaded_reactions_tasks*/ static void ecs_refresh_reactions(const int n) { int k; if(threaded_reactions_tasks != NULL) { for(k = 0; k<NUM_THREADS; k++) { SAFE_FREE(threaded_reactions_tasks[k].onset); SAFE_FREE(threaded_reactions_tasks[k].offset); } SAFE_FREE(threaded_reactions_tasks); } threaded_reactions_tasks = create_threaded_reactions(n); } void set_num_threads_3D(const int n) { Grid_node *grid; if(n != NUM_THREADS) { for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid->set_num_threads(n); } } ecs_refresh_reactions(n); } /*Removal all reactions*/ void clear_rates_ecs(void) { Reaction *r, *tmp; for (r = ecs_reactions; r != NULL; r = tmp) { SAFE_FREE(r->species_states); if(r->subregion) { SAFE_FREE(r->subregion); } tmp = r->next; SAFE_FREE(r); } ecs_reactions = NULL; ecs_refresh_reactions(NUM_THREADS); } /*Create a reaction * list_idx - the index for the linked list in the global array Parallel_grids * grid_id - the grid id within the linked list * ECSReactionRate - the reaction function * subregion - either NULL or a boolean array the same size as the grid * indicating if reaction occurs at a specific voxel */ Reaction* ecs_create_reaction(int list_idx, int num_species, int num_params, int* species_ids, ECSReactionRate f, unsigned char* subregion) { Grid_node *grid; Reaction* r; int i, j; r = (Reaction*)malloc(sizeof(Reaction)); assert(r); r->reaction = f; /*place reaction on the top of the stack of reactions*/ r->next = ecs_reactions; ecs_reactions = r; for(grid = Parallel_grids[list_idx], i = 0; grid != NULL; grid = grid -> next, i++) { /* Assume all species have the same grid */ if(i==species_ids[0]) { if(subregion == NULL) { r->subregion = NULL; r->region_size = grid->size_x * grid->size_y * grid->size_z; } else { for(r->region_size=0, j=0; j < grid->size_x * grid->size_y * grid->size_z; j++) r->region_size += subregion[j]; r->subregion = subregion; } } } r->num_species_involved = num_species; r->num_params_involved = num_params; r->species_states = (double**)malloc(sizeof(Grid_node*)*(num_species + num_params)); assert(r->species_states); for(i = 0; i < num_species + num_params; i++) { /*Assumes grids are the same size (no interpolation) *Assumes all the species will be in the same Parallel_grids list*/ for(grid = Parallel_grids[list_idx], j = 0; grid != NULL; grid = grid -> next, j++) { if(j==species_ids[i]) r->species_states[i] = grid->states; } } return r; } /*register_reaction is called from python it creates a reaction with * list_idx - the index for the linked list in the global array Parallel_grids * (currently this is always 0) * grid_id - the grid id within the linked list - this corresponds to species * ECSReactionRate - the reaction function */ extern "C" void ecs_register_reaction(int list_idx, int num_species, int num_params, int* species_id, ECSReactionRate f) { ecs_create_reaction(list_idx, num_species, num_params, species_id, f, NULL); ecs_refresh_reactions(NUM_THREADS); } /*register_subregion_reaction is called from python it creates a reaction with * list_idx - the index for the linked list in the global array Parallel_grids * (currently this is always 0) * grid_id - the grid id within the linked list - this corresponds to species * my_subregion - a boolean array indicating the voxels where a reaction occurs * ECSReactionRate - the reaction function */ void ecs_register_subregion_reaction_ecs(int list_idx, int num_species, int num_params, int* species_id, unsigned char* my_subregion, ECSReactionRate f) { ecs_create_reaction(list_idx, num_species, num_params, species_id, f, my_subregion); ecs_refresh_reactions(NUM_THREADS); } /*create_threaded_reactions is used to generate evenly distribution of reactions * across NUM_THREADS * returns ReactGridData* which can be used as the global * threaded_reactions_tasks */ ReactGridData* create_threaded_reactions(const int n) { int i, k, load; int react_count = 0; Reaction* react; for(react = ecs_reactions; react != NULL; react = react -> next) react_count += react->region_size; if(react_count == 0) return NULL; /*Divide the number of reactions between the threads*/ const int tasks_per_thread = (react_count) / n; ReactGridData* tasks = (ReactGridData*)calloc(sizeof(ReactGridData), n); const int extra = react_count % n; tasks[0].onset = (ReactSet*)malloc(sizeof(ReactSet)); tasks[0].onset->reaction = ecs_reactions; tasks[0].onset->idx = 0; for(k = 0, load = 0, react = ecs_reactions; react != NULL; react = react -> next) { for(i = 0; i < react->region_size; i++) { if(!react->subregion || react->subregion[i]) load++; if(load >= tasks_per_thread + (extra>k)) { tasks[k].offset = (ReactSet*)malloc(sizeof(ReactSet)); tasks[k].offset->reaction = react; tasks[k].offset->idx = i; if(++k < n) { tasks[k].onset = (ReactSet*)malloc(sizeof(ReactSet)); tasks[k].onset->reaction = react; tasks[k].onset->idx = i + 1; load = 0; } } if(k == n - 1 && react -> next == NULL) { tasks[k].offset = (ReactSet*)malloc(sizeof(ReactSet)); tasks[k].offset->reaction = react; tasks[k].offset->idx = i; } } } return tasks; } /*ecs_do_reactions takes ReactGridData which defines the set of reactions to be * performed. It calculate the reaction based on grid->old_states and updates * grid->states */ void* ecs_do_reactions(void* dataptr) { ReactGridData task = *(ReactGridData*)dataptr; unsigned char started = FALSE, stop = FALSE; int i, j, k, n, start_idx, stop_idx; double temp, ge_value, val_to_set; double dt = *dt_ptr; Reaction* react; double* states_cache = NULL; double* params_cache = NULL; double* states_cache_dx = NULL; double* results_array = NULL; double* results_array_dx = NULL; double dx = FLT_EPSILON; double pd; MAT *jacobian; VEC *x; VEC *b; PERM *pivot; for(react = ecs_reactions; react != NULL; react = react -> next) { /*find start location for this thread*/ if(started || react == task.onset->reaction) { if(!started) { started = TRUE; start_idx = task.onset->idx; } else { start_idx = 0; } if(task.offset->reaction == react) { stop_idx = task.offset->idx; stop = TRUE; } else { stop_idx = react->region_size-1; stop = FALSE; } if(react->num_species_involved == 0) continue; /*allocate data structures*/ jacobian = m_get(react->num_species_involved,react->num_species_involved); b = v_get(react->num_species_involved); x = v_get(react->num_species_involved); pivot = px_get(jacobian->m); states_cache = (double*)malloc(sizeof(double)*react->num_species_involved); params_cache = (double*)malloc(sizeof(double)*react->num_params_involved); states_cache_dx = (double*)malloc(sizeof(double)*react->num_species_involved); results_array = (double*)malloc(react->num_species_involved*sizeof(double)); results_array_dx = (double*)malloc(react->num_species_involved*sizeof(double)); for(i = start_idx; i <= stop_idx; i++) { if(!react->subregion || react->subregion[i]) { //TODO: this assumes grids are the same size/shape // add interpolation in case they aren't for(j = 0; j < react->num_species_involved; j++) { states_cache[j] = react->species_states[j][i]; states_cache_dx[j] = react->species_states[j][i]; } MEM_ZERO(results_array,react->num_species_involved*sizeof(double)); for(k = 0; j < react->num_species_involved + react->num_params_involved; k++, j++) { params_cache[k] = react->species_states[j][i]; } react->reaction(states_cache, params_cache, results_array); for(j = 0; j < react->num_species_involved; j++) { states_cache_dx[j] += dx; MEM_ZERO(results_array_dx,react->num_species_involved*sizeof(double)); react->reaction(states_cache_dx, params_cache, results_array_dx); v_set_val(b, j, dt*results_array[j]); for(k = 0; k < react->num_species_involved; k++) { pd = (results_array_dx[k] - results_array[k])/dx; m_set_val(jacobian, k, j, (j==k) - dt*pd); } states_cache_dx[j] -= dx; } // solve for x if (react->num_species_involved == 1) { react->species_states[0][i] += v_get_val(b, 0) / m_get_val(jacobian, 0, 0); } else { //find entry in leftmost column with largest absolute value //Pivot for (j = 0; j < react->num_species_involved; j++) { for(k = j + 1; k < react->num_species_involved; k++) { if (abs(m_get_val(jacobian, j, j)) < abs(m_get_val(jacobian, k, j))) { for (n = 0; n < react->num_species_involved; n++) { temp = m_get_val(jacobian, j, n); m_set_val(jacobian, j, n, m_get_val(jacobian, k, n)); m_set_val(jacobian, k, n, temp); } } } } for (j = 0; j < react->num_species_involved - 1; j ++) { for (k = j + 1; k < react->num_species_involved; k++) { ge_value = m_get_val(jacobian, k, j) / m_get_val(jacobian, j, j); for (n = 0; n < react->num_species_involved; n++) { val_to_set = m_get_val(jacobian, k, n) - ge_value * m_get_val(jacobian, j, n); m_set_val(jacobian, k, n, val_to_set); } v_set_val(b, k, v_get_val(b, k) - ge_value * v_get_val(b, j)); } } for (j = react->num_species_involved - 1; j >= 0; j--) { v_set_val(x, j, v_get_val(b, j)); for (k = j + 1; k < react->num_species_involved; k++) { if (k != j) { v_set_val(x, j, v_get_val(x, j) - m_get_val(jacobian, j, k) * v_get_val(x, k)); } } v_set_val(x, j, v_get_val(x, j) / m_get_val(jacobian, j, j)); } for(j = 0; j < react->num_species_involved; j++) { react->species_states[j][i] += v_get_val(x,j); } } } } m_free(jacobian); v_free(b); v_free(x); px_free(pivot); SAFE_FREE(states_cache); SAFE_FREE(states_cache_dx); SAFE_FREE(params_cache); SAFE_FREE(results_array); SAFE_FREE(results_array_dx); if(stop) return NULL; } } return NULL; } /* run_threaded_reactions * Array ReactGridData tasks length NUM_THREADS and calls ecs_do_reactions and * executes each task with a separate thread */ static void run_threaded_reactions(ReactGridData* tasks) { int k; /* launch threads */ for (k = 0; k < NUM_THREADS-1; k++) { TaskQueue_add_task(AllTasks,&ecs_do_reactions, &tasks[k], NULL); } /* run one task in the main thread */ ecs_do_reactions(&tasks[NUM_THREADS - 1]); /* wait for them to finish */ TaskQueue_sync(AllTasks); } static void* gather_currents(void* dataptr) { CurrentData* d = (CurrentData*)dataptr; Grid_node *grid = d->g; double *val = d->val; int i, start = d->onset, stop = d->offset; Current_Triple* c = grid->current_list; if(grid->VARIABLE_ECS_VOLUME == VOLUME_FRACTION) { for(i = start; i < stop; i++) val[i] = c[i].scale_factor * (*c[i].source)/grid->alpha[c[i].destination]; } else { for(i = start; i < stop; i++) val[i] = c[i].scale_factor * (*c[i].source)/grid->alpha[0]; } return NULL; } /* * do_current - process the current for a given grid * Grid_node* grid - the grid used * double* output - for fixed step this is the states for variable ydot * double dt - for fixed step the step size, for variable step 1 */ void do_currents(Grid_node* grid, double* output, double dt, int grid_id) { ssize_t m, n, i; Current_Triple* c; /*Currents to broadcast via MPI*/ /*TODO: Handle multiple grids with one pass*/ /*Maybe TODO: Should check #currents << #voxels and not the other way round*/ double* val; //MEM_ZERO(output,sizeof(double)*grid->size_x*grid->size_y*grid->size_z); /* currents, via explicit Euler */ n = grid->num_all_currents; m = grid->num_currents; CurrentData* tasks = (CurrentData*)malloc(NUM_THREADS*sizeof(CurrentData)); #if NRNMPI val = grid->all_currents + (nrnmpi_use?grid->proc_offsets[nrnmpi_myid]:0); #else val = grid->all_currents; #endif int tasks_per_thread = (m + NUM_THREADS - 1)/NUM_THREADS; for(i = 0; i < NUM_THREADS; i++) { tasks[i].g = grid; tasks[i].onset = i * tasks_per_thread; tasks[i].offset = MIN((i+1)*tasks_per_thread,m); tasks[i].val = val; } for (i = 0; i < NUM_THREADS-1; i++) { TaskQueue_add_task(AllTasks, &gather_currents, &tasks[i], NULL); } /* run one task in the main thread */ gather_currents(&tasks[NUM_THREADS - 1]); /* wait for them to finish */ TaskQueue_sync(AllTasks); free(tasks); #if NRNMPI if(nrnmpi_use) { nrnmpi_dbl_allgatherv_inplace(grid->all_currents, grid->proc_num_currents, grid->proc_offsets); for(i = 0; i < n; i++) output[grid->current_dest[i]] += grid->all_currents[i]; } else { for(i = 0; i < n; i++) { output[grid->current_list[i].destination] += grid->all_currents[i]; } } #else for(i = 0; i < n; i++) output[grid->current_list[i].destination] += grid->all_currents[i]; #endif /*Remove the contribution from membrane currents*/ if(_membrane_flux) { for(i = 0; i < _memb_curr_total; i++) { if(_rxd_induced_currents_grid[i] == grid_id) { output[_rxd_induced_currents_ecs_idx[i]] -= _rxd_induced_currents_ecs[i] * _rxd_induced_currents_scale[i]; } } } } void _fadvance_fixed_step_3D(void) { Grid_node* grid; double dt = (*dt_ptr); /*Currents to broadcast via MPI*/ /*TODO: Handle multiple grids with one pass*/ /*Maybe TODO: Should check #currents << #voxels and not the other way round*/ int id; if(threaded_reactions_tasks != NULL) run_threaded_reactions(threaded_reactions_tasks); for (id = 0, grid = Parallel_grids[0]; grid != NULL; grid = grid -> next, id++) { MEM_ZERO(grid->states_cur,sizeof(double)*grid->size_x*grid->size_y*grid->size_z); grid->do_grid_currents(dt, id); grid->volume_setup(); if(grid->hybrid) { grid->hybrid_connections(); } if(grid->diffusable){ grid->dg_adi(); } } /* transfer concentrations */ scatter_concentrations(); } void scatter_concentrations(void) { /* transfer concentrations to classic NEURON */ Grid_node* grid; for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid->scatter_grid_concentrations(); } } /***************************************************************************** * * Begin variable step code * *****************************************************************************/ /* count the total number of state variables AND store their offset (passed in) in the cvode vector */ int ode_count(const int offset) { int count = 0; states_cvode_offset = offset; Grid_node* grid; for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { count += grid->size_x * grid->size_y * grid->size_z; } return count; } void ecs_atolscale(double* y) { Grid_node* grid; ssize_t i; int grid_size; y += states_cvode_offset; for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_size = grid->size_x * grid->size_y * grid->size_z; for (i = 0; i < grid_size; i++) { y[i] *= grid->atolscale; } y += grid_size; } } void _ecs_ode_reinit(double* y) { Grid_node* grid; ssize_t i; int grid_size; double* grid_states; y += states_cvode_offset; for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_states = grid->states; grid_size = grid->size_x * grid->size_y * grid->size_z; for (i = 0; i < grid_size; i++) { y[i] = grid_states[i]; } y += grid_size; } } void _rhs_variable_step_ecs(const double t, const double* states, double* ydot, const int _cvode_offset) { Grid_node *grid; ssize_t i; int grid_size; double dt = *dt_ptr; double* grid_states; double const * const orig_states = states + states_cvode_offset; double const * const orig_1d_states = states + _cvode_offset; const unsigned char calculate_rhs = ydot == NULL ? 0 : 1; double* const orig_ydot = ydot + states_cvode_offset; double* const orig_1d_ydot = ydot + _cvode_offset; states = orig_states; ydot = orig_ydot; /* prepare for advance by syncing data with local copy */ for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_states = grid->states; grid_size = grid->size_x * grid->size_y * grid->size_z; /* copy the passed in states to local memory (needed to make reaction rates correct) */ for (i = 0; i < grid_size; i++) { grid_states[i] = states[i]; } states += grid_size; } /* transfer concentrations to classic NEURON states */ scatter_concentrations(); if (!calculate_rhs) { return; } states = orig_states; ydot = orig_ydot; /* TODO: reactions contribute to adaptive step-size*/ if(threaded_reactions_tasks != NULL){ run_threaded_reactions(threaded_reactions_tasks); } for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_states = grid->states; grid_size = grid->size_x * grid->size_y * grid->size_z; for(i = 0; i < grid_size; i++) { ydot[i] += (grid_states[i] - states[i])/dt; grid_states[i] = states[i]; } states += grid_size; ydot += grid_size; } ydot = orig_ydot; states = orig_states; /* process currents */ for (i = 0, grid = Parallel_grids[0]; grid != NULL; grid = grid -> next, i++) { do_currents(grid, ydot, 1.0, i); ydot += grid_size; } ydot = orig_ydot; /* do the diffusion rates */ for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_size = grid->size_x * grid->size_y * grid->size_z; grid->variable_step_diffusion(states, ydot); ydot += grid_size; states += grid_size; } } void _rhs_variable_step_helper(Grid_node* g, double const * const states, double* ydot) { int num_states_x = g->size_x, num_states_y = g->size_y, num_states_z = g->size_z; double dx = g->dx, dy = g->dy, dz = g->dz; int i, j, k, stop_i, stop_j, stop_k; double dc_x = g->dc_x, dc_y = g->dc_y, dc_z = g->dc_z; double rate_x = dc_x / (dx * dx); double rate_y = dc_y / (dy * dy); double rate_z = dc_z / (dz * dz); /*indices*/ int index, prev_i, prev_j, prev_k, next_i ,next_j, next_k; double div_x, div_y, div_z; unsigned char bc_x, bc_y, bc_z; double bc; /* Euler advance x, y, z (all points) */ stop_i = num_states_x - 1; stop_j = num_states_y - 1; stop_k = num_states_z - 1; if(g->bc->type == NEUMANN) { for (i = 0, index = 0, prev_i = num_states_y*num_states_z, next_i = num_states_y*num_states_z; i < num_states_x; i++) { /*Zero flux boundary conditions*/ div_x = (i==0||i==stop_i)?2.:1.; for(j = 0, prev_j = index + num_states_z, next_j = index + num_states_z; j < num_states_y; j++) { div_y = (j==0||j==stop_j)?2.:1.; for(k = 0, prev_k = index + 1, next_k = index + 1; k < num_states_z; k++, index++, prev_i++, next_i++, prev_j++, next_j++) { div_z = (k==0||k==stop_k)?2.:1.; ydot[index] += rate_x * (states[prev_i] - 2.0 * states[index] + states[next_i])/div_x; ydot[index] += rate_y * (states[prev_j] - 2.0 * states[index] + states[next_j])/div_y; ydot[index] += rate_z * (states[prev_k] - 2.0 * states[index] + states[next_k])/div_z; next_k = (k==stop_k-1)?index:index+2; prev_k = index; } prev_j = index - num_states_z; next_j = (j==stop_j-1)?prev_j:index + num_states_z; } prev_i = index - num_states_y*num_states_z; next_i = (i==stop_i-1)?prev_i:index+num_states_y*num_states_z; } } else { for (i = 0, index = 0, next_i = num_states_y*num_states_z; i < num_states_x; i++) { for(j = 0, prev_j = index - num_states_z, next_j = index + num_states_z; j < num_states_y; j++) { for(k = 0, prev_k = index - 1, next_k = index + 1; k < num_states_z; k++, index++, prev_i++, next_i++, prev_j++, next_j++, next_k++, prev_k++) { if(i==0||i==stop_i||j==0||j==stop_j||k==0||k==stop_k) { //set to zero to prevent currents altering concentrations at the boundary ydot[index] = 0; } else { ydot[index] += rate_x * (states[prev_i] - 2.0 * states[index] + states[next_i]); ydot[index] += rate_y * (states[prev_j] - 2.0 * states[index] + states[next_j]); ydot[index] += rate_z * (states[prev_k] - 2.0 * states[index] + states[next_k]); } } prev_j = index - num_states_z; next_j = index + num_states_z; } prev_i = index - num_states_y*num_states_z; next_i = index + num_states_y*num_states_z; } } /* for (i = 1, index = (num_states_y+1)*num_states_z + 1, prev_i = num_states_z + 1, next_i = (2*num_states_y+1)*num_states_z + 1; i < stop_i; i++) { for (j = 1, prev_j = index - num_states_z, next_j = index + num_states_z; j < stop_j; j++) { for(k = 1, prev_k = index - 1, next_k = index + 1; k < stop_k; k++, index++, prev_i++, next_i++, prev_j++, next_j++, next_k++) { if(index != i*num_states_y*num_states_z + j*num_states_z + k) { fprintf(stderr,"%i \t %i %i %i\n", index,i,j,k); } if(prev_i != (i-1)*num_states_y*num_states_z + j*num_states_z + k) { fprintf(stderr,"prev_i %i %i \t %i %i %i\n", prev_i,(i-1)*num_states_y*num_states_z + j*num_states_z + k,i,j,k); } if(next_i != (i+1)*num_states_y*num_states_z + j*num_states_z + k) { fprintf(stderr,"next_i %i %i \t %i %i %i\n", next_i,(i+1)*num_states_y*num_states_z + j*num_states_z + k,i,j,k); } if(prev_j != i*num_states_y*num_states_z + (j-1)*num_states_z + k) { fprintf(stderr,"prev_j %i %i \t %i %i %i\n", prev_j,i*num_states_y*num_states_z + (j-1)*num_states_z + k,i,j,k); } if(next_j != i*num_states_y*num_states_z + (j+1)*num_states_z + k) { fprintf(stderr,"next_j %i %i \t %i %i %i\n", next_j,i*num_states_y*num_states_z + (j+1)*num_states_z + k,i,j,k); } if(prev_k != i*num_states_y*num_states_z + j*num_states_z + k-1) { fprintf(stderr,"prev_k %i %i \t %i %i %i\n", prev_k,i*num_states_y*num_states_z + j*num_states_z + k-1,i,j,k); } if(next_k != i*num_states_y*num_states_z + j*num_states_z + k+1) { fprintf(stderr,"next_k %i %i \t %i %i %i\n", next_k,i*num_states_y*num_states_z + j*num_states_z + k+1,i,j,k); } ydot[index] += rate_x * (states[prev_i] - 2.0 * states[index] + states[next_i]); ydot[index] += rate_y * (states[prev_j] - 2.0 * states[index] + states[next_j]); ydot[index] += rate_z * (states[prev_k] - 2.0 * states[index] + states[next_k]); } index += 2; //skip z boundaries //prev_j = index - num_states_z; //next_j = index + num_states_z; } index += 2*num_states_z; //skip y boundaries //prev_i = index - num_states_y*num_states_z; //next_i = index + num_states_y*num_states_z; } } */ } //p1 = b p2 = states void ics_ode_solve(double dt, double* RHS, const double* states) { Grid_node *grid; ssize_t i; int grid_size; double* grid_states; double const * const orig_states = states + states_cvode_offset; const unsigned char calculate_rhs = RHS == NULL ? 0 : 1; double* const orig_RHS = RHS + states_cvode_offset; states = orig_states; RHS = orig_RHS; /* prepare for advance by syncing data with local copy */ for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid_states = grid->states; grid_size = grid->size_x * grid->size_y * grid->size_z; /* copy the passed in states to local memory (needed to make reaction rates correct) */ for (i = 0; i < grid_size; i++) { grid_states[i] = states[i]; } states += grid_size; } /* transfer concentrations to classic NEURON states */ scatter_concentrations(); if (!calculate_rhs) { return; } states = orig_states; RHS = orig_RHS; /* TODO: reactions contribute to adaptive step-size*/ if(threaded_reactions_tasks != NULL){ run_threaded_reactions(threaded_reactions_tasks); } /* do the diffusion rates */ for (grid = Parallel_grids[0]; grid != NULL; grid = grid -> next) { grid->variable_step_ode_solve(states, RHS, dt); RHS += grid_size; states += grid_size; } } /***************************************************************************** * * End variable step code * *****************************************************************************/ /* solve_dd_clhs_tridiag uses Thomas Algorithm to solves a * diagonally dominant tridiagonal matrix (Ax=b), where the * triple (lower, diagonal and upper) are repeated to form A. * N - length of the matrix * l_diag - lower diagonal * diag - diagonal * u_diag - upper diagonal * b - pointer to the RHS (length N) * lbc_diag - the lower boundary diagonal (the first diagonal element) * lbc_u_diag - the lower boundary upper diagonal (the first upper * diagonal element) * ubc_l_diag - the upper boundary lower diagonal (the last lower * diagonal element) * ubc_diag - the upper boundary diagonal (the last diagonal element) * The solution (x) is stored in b. * c - scratchpad array, N - 1 doubles long */ static int solve_dd_clhs_tridiag(const int N, const double l_diag, const double diag, const double u_diag, const double lbc_diag, const double lbc_u_diag, const double ubc_l_diag, const double ubc_diag, double* const b, double* const c) { int i; c[0] = lbc_u_diag/lbc_diag; b[0] = b[0]/lbc_diag; for(i=1;i<N-1;i++) { c[i] = u_diag/(diag-l_diag*c[i-1]); b[i] = (b[i]-l_diag*b[i-1])/(diag-l_diag*c[i-1]); } b[N-1] = (b[N-1]-ubc_l_diag*b[N-2])/(ubc_diag-ubc_l_diag*c[N-2]); /*back substitution*/ for(i=N-2;i>=0;i--) { b[i]=b[i]-c[i]*b[i+1]; } return 0; } /* static int solve_dd_clhs_tridiag_rev(const int N, const double l_diag, const double diag, const double u_diag, const double lbc_diag, const double lbc_u_diag, const double ubc_l_diag, const double ubc_diag, double* const d, double* const a) { int i; a[N-2] = ubc_l_diag/ubc_diag; d[N-1] = d[N-1]/ubc_diag; for(i=N-2; i>0; i--) { a[i-1] = l_diag/(diag - u_diag*a[i]); d[i] = (d[i] - u_diag*d[i+1])/(diag - u_diag*a[i]); } d[0] = (d[0] - lbc_u_diag*d[1])/(lbc_diag - lbc_u_diag*a[0]); for(i=1; i<N; i++) { d[i] = d[i] - a[i-1]*d[i-1]; } return 0; } unsigned char callcount = TRUE; static int solve_dd_clhs_tridiag(const int N, const double l_diag, const double diag, const double u_diag, const double lbc_diag, const double lbc_u_diag, const double ubc_l_diag, const double ubc_diag, double* const b, double* const c) { if(callcount) { callcount = FALSE; return solve_dd_clhs_tridiag_for(N, l_diag, diag, u_diag, lbc_diag, lbc_u_diag, ubc_l_diag, ubc_diag, b, c); } else { callcount = TRUE; return solve_dd_clhs_tridiag_rev(N, l_diag, diag, u_diag, lbc_diag, lbc_u_diag, ubc_l_diag, ubc_diag, b, c); } } */ /* dg_adi_x performs the first of 3 steps in DG-ADI * g - the parameters and state of the grid * dt - the time step * y - the index for the y plane * z - the index for the z plane * state - where the output of this step is stored * scratch - scratchpad array of doubles, length g->size_x - 1 */ static void ecs_dg_adi_x(ECS_Grid_node* g, const double dt, const int y, const int z, double const * const state, double* const RHS, double* const scratch) { int yp,ym,zp,zm; int x; double r = g->dc_x*dt/SQ(g->dx); double div_y, div_z; /*TODO: Get rid of this by not calling dg_adi when on the boundary for DIRICHLET conditions*/ if(g->bc->type == DIRICHLET && (y == 0 || z == 0 || y == g->size_y-1 || z == g->size_z-1)) { for(x=0; x<g->size_x; x++) RHS[x] = g->bc->value; return; } yp = (y==g->size_y-1)?y-1:y+1; ym = (y==0)?y+1:y-1; zp = (z==g->size_z-1)?z-1:z+1; zm = (z==0)?z+1:z-1; div_y = (y==0||y==g->size_y-1)?2.:1.; div_z = (z==0||z==g->size_z-1)?2.:1.; if(g->bc->type == NEUMANN) { /*zero flux boundary condition*/ RHS[0] = g->states[IDX(0,y,z)] + dt*((g->dc_x/SQ(g->dx))*(g->states[IDX(1,y,z)] - 2.*g->states[IDX(0,y,z)] + g->states[IDX(1,y,z)])/4.0 + (g->dc_y/SQ(g->dy))*(g->states[IDX(0,yp,z)] - 2.*g->states[IDX(0,y,z)] + g->states[IDX(0,ym,z)])/div_y + (g->dc_z/SQ(g->dz))*(g->states[IDX(0,y,zp)] - 2.*g->states[IDX(0,y,z)] + g->states[IDX(0,y,zm)])/div_z + g->states_cur[IDX(0,y,z)]); x = g->size_x-1; RHS[x] = g->states[IDX(x,y,z)] + dt*((g->dc_x/SQ(g->dx))*(g->states[IDX(x-1,y,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x-1,y,z)])/4.0 + (g->dc_y/SQ(g->dy))*(g->states[IDX(x,yp,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,ym,z)])/div_y + (g->dc_z/SQ(g->dz))*(g->states[IDX(x,y,zp)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,y,zm)])/div_z + g->states_cur[IDX(x,y,z)]); } else { RHS[0] = g->bc->value; RHS[g->size_x-1] = g->bc->value; } for(x=1; x<g->size_x-1; x++) { __builtin_prefetch(&(g->states[IDX(x+PREFETCH,y,z)]), 0, 1); __builtin_prefetch(&(g->states[IDX(x+PREFETCH,yp,z)]), 0, 0); __builtin_prefetch(&(g->states[IDX(x+PREFETCH,ym,z)]), 0, 0); RHS[x] = g->states[IDX(x,y,z)] + dt*((g->dc_x/SQ(g->dx))*(g->states[IDX(x+1,y,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x-1,y,z)])/2. + (g->dc_y/SQ(g->dy))*(g->states[IDX(x,yp,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,ym,z)])/div_y + (g->dc_z/SQ(g->dz))*(g->states[IDX(x,y,zp)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,y,zm)])/div_z + g->states_cur[IDX(x,y,z)]); } if(g->bc->type == NEUMANN) solve_dd_clhs_tridiag(g->size_x, -r/2.0, 1.0+r, -r/2.0, 1.0+r/2.0, -r/2.0, -r/2.0, 1.0+r/2.0, RHS, scratch); else solve_dd_clhs_tridiag(g->size_x, -r/2.0, 1.0+r, -r/2.0, 1.0, 0, 0, 1.0, RHS, scratch); } /* dg_adi_y performs the second of 3 steps in DG-ADI * g - the parameters and state of the grid * dt - the time step * x - the index for the x plane * z - the index for the z plane * state - the values from the first step, which are * overwritten by the output of this step * scratch - scratchpad array of doubles, length g->size_y - 1 */ static void ecs_dg_adi_y(ECS_Grid_node* g, double const dt, int const x, int const z, double const * const state, double* const RHS, double* const scratch) { int y; double r = (g->dc_y*dt/SQ(g->dy)); /*TODO: Get rid of this by not calling dg_adi when on the boundary for DIRICHLET conditions*/ if(g->bc->type == DIRICHLET && (x == 0 || z == 0 || x == g->size_x-1 || z == g->size_z-1)) { for(y=0; y<g->size_y; y++) RHS[y] = g->bc->value; return; } if(g->bc->type == NEUMANN) { /*zero flux boundary condition*/ RHS[0] = state[x + z*g->size_x] - (g->dc_y*dt/SQ(g->dy))*(g->states[IDX(x,1,z)] - 2.0*g->states[IDX(x,0,z)] + g->states[IDX(x,1,z)])/4.0; y = g->size_y-1; RHS[y] = state[x + (z + y*g->size_z)*g->size_x] - (g->dc_y*dt/SQ(g->dy))*(g->states[IDX(x,y-1,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,y-1,z)])/4.0; } else { RHS[0] = g->bc->value; RHS[g->size_y-1] = g->bc->value; } for(y=1; y<g->size_y-1; y++) { __builtin_prefetch(&state[x + (z + (y+PREFETCH)*g->size_z)*g->size_x], 0, 0); __builtin_prefetch(&(g->states[IDX(x,y+PREFETCH,z)]), 0, 1); RHS[y] = state[x + (z + y*g->size_z)*g->size_x] - (g->dc_y*dt/SQ(g->dy))*(g->states[IDX(x,y+1,z)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,y-1,z)])/2.0; } if(g->bc->type == NEUMANN) solve_dd_clhs_tridiag(g->size_y, -r/2.0, 1.0+r, -r/2.0, 1.0+r/2.0, -r/2.0, -r/2.0, 1.0+r/2.0, RHS, scratch); else solve_dd_clhs_tridiag(g->size_y, -r/2., 1.+r, -r/2., 1.0, 0, 0, 1.0, RHS, scratch); } /* dg_adi_z performs the final step in DG-ADI * g - the parameters and state of the grid * dt - the time step * x - the index for the x plane * y - the index for the y plane * state - the values from the second step, which are * overwritten by the output of this step * scratch - scratchpad array of doubles, length g->size_z - 1 */ static void ecs_dg_adi_z(ECS_Grid_node* g, double const dt, int const x, int const y, double const * const state, double* const RHS, double* const scratch) { int z; double r = g->dc_z*dt/SQ(g->dz); /*TODO: Get rid of this by not calling dg_adi when on the boundary for DIRICHLET conditions*/ if(g->bc->type == DIRICHLET && (x == 0 || y == 0 || x == g->size_x-1 || y == g->size_y-1)) { for(z=0; z<g->size_z; z++) RHS[z] = g->bc->value; return; } if(g->bc->type == NEUMANN) { /*zero flux boundary condition*/ RHS[0] = state[y + g->size_y*(x*g->size_z)] - (g->dc_z*dt/SQ(g->dz))*(g->states[IDX(x,y,1)] - 2.0*g->states[IDX(x,y,0)] + g->states[IDX(x,y,1)])/4.0; z = g->size_z-1; RHS[z] = state[y + g->size_y*(x*g->size_z + z)] - (g->dc_z*dt/SQ(g->dz))*(g->states[IDX(x,y,z-1)] - 2.0*g->states[IDX(x,y,z)] + g->states[IDX(x,y,z-1)])/4.0; } else { RHS[0] = g->bc->value; RHS[g->size_z-1] = g->bc->value; } for(z=1; z<g->size_z-1; z++) { RHS[z] = state[y + g->size_y*(x*g->size_z + z)] - (g->dc_z*dt/SQ(g->dz))*(g->states[IDX(x,y,z+1)] - 2.*g->states[IDX(x,y,z)] + g->states[IDX(x,y,z-1)])/2.; } if(g->bc->type == NEUMANN) solve_dd_clhs_tridiag(g->size_z, -r/2.0, 1.0+r, -r/2.0, 1.0+r/2.0, -r/2.0, -r/2.0, 1.0+r/2.0, RHS, scratch); else solve_dd_clhs_tridiag(g->size_z, -r/2., 1.+r, -r/2., 1.0, 0, 0, 1.0, RHS, scratch); } static void* ecs_do_dg_adi(void* dataptr) { ECSAdiGridData* data = (ECSAdiGridData*) dataptr; int start = data -> start; int stop = data -> stop; int i, j, k; ECSAdiDirection* ecs_adi_dir = data -> ecs_adi_dir; double dt = *dt_ptr; int sizej = data -> sizej; ECS_Grid_node* g = data -> g; double* state_in = ecs_adi_dir-> states_in; double* state_out = ecs_adi_dir-> states_out; int offset = ecs_adi_dir -> line_size; double* scratchpad = data -> scratchpad; void (*ecs_dg_adi_dir)(ECS_Grid_node*, double, int, int, double const * const, double* const, double* const) = ecs_adi_dir -> ecs_dg_adi_dir; for (k = start; k < stop; k++) { i = k / sizej; j = k % sizej; ecs_dg_adi_dir(g, dt, i, j, state_in, &state_out[k*offset], scratchpad); } return NULL; } void ecs_run_threaded_dg_adi(const int i, const int j, ECS_Grid_node* g, ECSAdiDirection* ecs_adi_dir, const int n) { int k; /* when doing any given direction, the number of tasks is the product of the other two, so multiply everything then divide out the current direction */ const int tasks_per_thread = (g->size_x * g->size_y * g->size_z / n) / NUM_THREADS; const int extra = (g->size_x * g->size_y * g->size_z / n) % NUM_THREADS; g->ecs_tasks[0].start = 0; g->ecs_tasks[0].stop = tasks_per_thread + (extra>0); g->ecs_tasks[0].sizej = j; g->ecs_tasks[0].ecs_adi_dir = ecs_adi_dir; for (k = 1; k < NUM_THREADS; k++) { g->ecs_tasks[k].start = g->ecs_tasks[k-1].stop; g->ecs_tasks[k].stop = g->ecs_tasks[k].start + tasks_per_thread + (extra>k); g->ecs_tasks[k].sizej = j; g->ecs_tasks[k].ecs_adi_dir = ecs_adi_dir; } g->ecs_tasks[NUM_THREADS - 1].stop = i * j; /* launch threads */ for (k = 0; k < NUM_THREADS-1; k++) { TaskQueue_add_task(AllTasks, &ecs_do_dg_adi, &(g->ecs_tasks[k]), NULL); } /* run one task in the main thread */ ecs_do_dg_adi(&(g->ecs_tasks[NUM_THREADS - 1])); /* wait for them to finish */ TaskQueue_sync(AllTasks); } void ecs_set_adi_homogeneous(ECS_Grid_node *g) { g->ecs_adi_dir_x->ecs_dg_adi_dir = ecs_dg_adi_x; g->ecs_adi_dir_y->ecs_dg_adi_dir = ecs_dg_adi_y; g->ecs_adi_dir_z->ecs_dg_adi_dir = ecs_dg_adi_z; }
34.818335
155
0.56284
[ "shape", "vector" ]
e55be7aa536af096abc515cb887d65f9f03c49cb
10,954
cpp
C++
src/NetworkWorker.cpp
polistern/pboted
48a255d7c8cfe5ac2d3b3c94fb4b932da75a46b4
[ "BSD-3-Clause" ]
15
2021-10-31T01:25:43.000Z
2022-03-08T11:44:10.000Z
src/NetworkWorker.cpp
polistern/pboted
48a255d7c8cfe5ac2d3b3c94fb4b932da75a46b4
[ "BSD-3-Clause" ]
10
2021-10-31T13:30:33.000Z
2022-01-24T15:55:57.000Z
src/NetworkWorker.cpp
polistern/pboted
48a255d7c8cfe5ac2d3b3c94fb4b932da75a46b4
[ "BSD-3-Clause" ]
3
2021-10-31T07:24:15.000Z
2021-11-12T18:41:30.000Z
/** * Copyright (C) 2019-2022 polistern * * This file is part of pboted and licensed under BSD3 * * See full license text in LICENSE file at top of project tree */ #include <utility> #include "NetworkWorker.h" namespace pbote { namespace network { NetworkWorker network_worker; UDPReceiver::UDPReceiver (const std::string &address, int port) : running_ (false), m_RecvThread (nullptr), f_port (port), f_addr (address), m_recvQueue (nullptr) { // ToDo: restart on error int errcode; char decimal_port[16]; snprintf (decimal_port, sizeof (decimal_port), "%d", f_port); decimal_port[sizeof (decimal_port) / sizeof (decimal_port[0]) - 1] = '\0'; struct addrinfo hints{}; memset (&hints, 0, sizeof (hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; errcode = getaddrinfo (address.c_str (), decimal_port, &hints, &f_addrinfo); if (errcode != 0 || f_addrinfo == nullptr) { throw udp_client_server_runtime_error ( ("Network: UDPReceiver: Invalid address or port: \"" + address + ":" + decimal_port + "\", errcode=" + gai_strerror (errcode)) .c_str ()); } f_socket = socket (f_addrinfo->ai_family, SOCK_DGRAM | SOCK_CLOEXEC, f_addrinfo->ai_protocol); if (f_socket == -1) { freeaddrinfo (f_addrinfo); throw udp_client_server_runtime_error ( ("Network: UDPReceiver: Could not create UDP socket for: \"" + address + ":" + decimal_port + "\"") .c_str ()); } if ((bind (f_socket, f_addrinfo->ai_addr, f_addrinfo->ai_addrlen)) != 0) { freeaddrinfo (f_addrinfo); close (f_socket); throw udp_client_server_runtime_error ( ("Network: UDPReceiver: Could not bind UDP socket with: \"" + address + ":" + decimal_port + "\", errcode=" + gai_strerror (errcode)) .c_str ()); } } UDPReceiver::~UDPReceiver () { m_RecvThread->join (); delete m_RecvThread; m_RecvThread = nullptr; freeaddrinfo (f_addrinfo); close (f_socket); m_recvQueue = nullptr; } void UDPReceiver::start () { if (running_) return; running_ = true; m_RecvThread = new std::thread ([this] { run (); }); } void UDPReceiver::stop () { if (!running_) running_ = false; LogPrint (eLogInfo, "Network: UDPReceiver: Stopped"); } void UDPReceiver::run () { LogPrint (eLogInfo, "Network: UDPReceiver: Started"); while (running_) handle_receive (); } long UDPReceiver::recv () { return ::recv (f_socket, m_DatagramRecvBuffer, MAX_DATAGRAM_SIZE, 0); } void UDPReceiver::handle_receive () { std::size_t bytes_transferred = recv (); if (bytes_transferred > 0) context.add_recv_byte_count (bytes_transferred); m_DatagramRecvBuffer[bytes_transferred] = 0; // ToDo: bad code! Need rewrite with strchr or memcpy for example std::vector<uint8_t> v_destination; std::vector<uint8_t> v_data; bool isData = false; for (u_int i = 0; i < bytes_transferred; i++) { if (m_DatagramRecvBuffer[i] == 0x0a) isData = true; else { if (isData) v_data.push_back (m_DatagramRecvBuffer[i]); else v_destination.push_back (m_DatagramRecvBuffer[i]); } } std::string s_destination (v_destination.begin (), v_destination.end ()); std::string s_data (v_data.begin (), v_data.end ()); char *eol = strchr ((char *)m_DatagramRecvBuffer, '\n'); if (eol) { *eol = 0; eol++; size_t payloadLen = bytes_transferred - ((uint8_t *)eol - m_DatagramRecvBuffer); auto packet = std::make_shared<PacketForQueue> ( s_destination, (uint8_t *)eol, payloadLen); m_recvQueue->Put (packet); } else LogPrint (eLogError, "Network: UDPReceiver: Invalid datagram"); } /////////////////////////////////////////////////////////////////////////////// UDPSender::UDPSender (const std::string &addr, int port) : running_ (false), m_SendThread (nullptr), f_port (port), f_addr (addr), m_sendQueue (nullptr) { // ToDo: restart on error int errcode; char decimal_port[16]; snprintf (decimal_port, sizeof (decimal_port), "%d", f_port); decimal_port[sizeof (decimal_port) / sizeof (decimal_port[0]) - 1] = '\0'; struct addrinfo hints{}; memset (&hints, 0, sizeof (hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; errcode = getaddrinfo (addr.c_str (), decimal_port, &hints, &f_addrinfo); if (errcode != 0 || f_addrinfo == nullptr) { throw udp_client_server_runtime_error ( ("Network: UDPSender: Invalid address or port " + addr + ":" + decimal_port) .c_str ()); } f_socket = socket (f_addrinfo->ai_family, f_addrinfo->ai_socktype, f_addrinfo->ai_protocol); if (f_socket < 0) { freeaddrinfo (f_addrinfo); close (f_socket); throw udp_client_server_runtime_error ( ("Network: UDPSender: Can't create socket for " + addr + ":" + decimal_port) .c_str ()); } } UDPSender::~UDPSender () { m_SendThread->join (); delete m_SendThread; m_SendThread = nullptr; freeaddrinfo (f_addrinfo); close (f_socket); m_sendQueue = nullptr; } void UDPSender::start () { if (running_) return; running_ = true; m_SendThread = new std::thread ([this] { run (); }); } void UDPSender::stop () { if (running_) running_ = false; LogPrint (eLogInfo, "Network: UDPSender: Stopped"); } void UDPSender::run () { LogPrint (eLogInfo, "Network: UDPSender: Started"); while (running_) send (); } void UDPSender::send () { auto packet = m_sendQueue->GetNextWithTimeout (UDP_SEND_TIMEOUT); if (!packet) return; std::string payload (packet->payload.begin (), packet->payload.end ()); std::string message = SAM::Message::datagramSend (m_sessionID_, packet->destination); message.append (payload); size_t bytes_transferred = sendto (f_socket, message.c_str (), message.size (), 0, f_addrinfo->ai_addr, f_addrinfo->ai_addrlen); handle_send (bytes_transferred); } void UDPSender::handle_send ( /*const boost::system::error_code &error,*/ std::size_t bytes_transferred) { // ToDo: error handler if (bytes_transferred > 0) context.add_sent_byte_count (bytes_transferred); } /////////////////////////////////////////////////////////////////////////////// // ToDo: Need some optimization NetworkWorker::NetworkWorker () : listenPortUDP_ (0), routerPortTCP_ (0), routerPortUDP_ (0), router_session_ (nullptr), m_RecvHandler (nullptr), m_SendHandler (nullptr), m_recvQueue (nullptr), m_sendQueue (nullptr) { } NetworkWorker::~NetworkWorker () { stop (); router_session_ = nullptr; m_RecvHandler = nullptr; m_SendHandler = nullptr; } void NetworkWorker::init () { m_nickname_ = context.get_nickname (); listenAddress_ = context.get_listen_host (); listenPortUDP_ = context.get_listen_port_SAM (); routerAddress_ = context.get_router_host (); routerPortTCP_ = context.get_router_port_TCP (); routerPortUDP_ = context.get_router_port_UDP (); m_recvQueue = context.getRecvQueue (); m_sendQueue = context.getSendQueue (); createRecvHandler (); createSendHandler (); } void NetworkWorker::start () { LogPrint (eLogInfo, "Network: SAM TCP endpoint: ", routerAddress_, ":", routerPortTCP_); LogPrint (eLogInfo, "Network: SAM UDP endpoint: ", routerAddress_, ":", routerPortUDP_); // we can init with empty listen port for auto port and use it in SAM init m_RecvHandler->start (); LogPrint (eLogInfo, "Network: Starting SAM session"); try { bool success = false, first_attempt = true; std::shared_ptr<i2p::data::PrivateKeys> key; while (!success) { if (!first_attempt) std::this_thread::sleep_for (std::chrono::seconds (10)); key = createSAMSession (); if (!key) continue; if (key->ToBase64 ().empty ()) LogPrint (eLogError, "Network: SAM session failed, reconnecting"); else success = true; first_attempt = false; } if (!context.keys_loaded ()) context.save_new_keys (key); /// Because we get sessionID after SAM initialization m_SendHandler->setSessionID ( const_cast<std::string &> (router_session_->getSessionID ())); m_SendHandler->start (); LogPrint (eLogInfo, "Network: SAM session started"); } catch (std::exception &e) { LogPrint (eLogError, "Network: Exception in SAM: ", e.what ()); } } void NetworkWorker::stop () { m_RecvHandler->stop (); m_SendHandler->stop (); LogPrint (eLogInfo, "Network: Stopped"); } std::shared_ptr<i2p::data::PrivateKeys> NetworkWorker::createSAMSession () { auto localKeys = context.getlocalKeys (); if (context.keys_loaded ()) { std::shared_ptr<SAM::DatagramSession> new_session = std::make_shared<SAM::DatagramSession> ( m_nickname_, routerAddress_, routerPortTCP_, routerPortUDP_, listenAddress_, listenPortUDP_, localKeys->ToBase64 ()); router_session_ = new_session; } else { std::shared_ptr<SAM::DatagramSession> new_session = std::make_shared<SAM::DatagramSession> ( m_nickname_, routerAddress_, routerPortTCP_, routerPortUDP_, listenAddress_, listenPortUDP_); localKeys->FromBase64 (new_session->getMyDestination ().priv); router_session_ = new_session; } if (router_session_->getMyDestination ().priv.empty () || router_session_->getMyDestination ().pub.empty ()) { LogPrint (eLogError, "Network: SAM session failed"); return {}; } if (router_session_->isSick ()) LogPrint (eLogError, "Network: SAM session is sick"); else LogPrint (eLogDebug, "Network: SAM session is OK"); LogPrint (eLogInfo, "Network: SAM session created, nickname: ", m_nickname_, ", sessionID: ", router_session_->getSessionID ()); return localKeys; } void NetworkWorker::createRecvHandler () { LogPrint (eLogInfo, "Network: Starting UDP receiver with address ", listenAddress_, ":", listenPortUDP_); m_RecvHandler = std::make_shared<UDPReceiver> (listenAddress_, listenPortUDP_); m_RecvHandler->setNickname (m_nickname_); m_RecvHandler->setQueue (m_recvQueue); } void NetworkWorker::createSendHandler () { LogPrint (eLogInfo, "Network: Starting UDP sender to address ", routerAddress_, ":", routerPortUDP_); m_SendHandler = std::make_shared<UDPSender> (routerAddress_, routerPortUDP_); m_SendHandler->setNickname (m_nickname_); m_SendHandler->setQueue (m_sendQueue); } } // namespace network } // namespace pbote
24.895455
79
0.639401
[ "vector" ]
e562fdf5824610a6e77a6bf90ad8bf883696af33
10,918
cpp
C++
3rdparty/GPSTk/core/tests/FileHandling/FFBinaryStream_T.cpp
mfkiwl/ICE
e660d031bb1bcea664db1de4946fd8781be5b627
[ "MIT" ]
50
2019-10-12T01:22:20.000Z
2022-02-15T23:28:26.000Z
3rdparty/GPSTk/core/tests/FileHandling/FFBinaryStream_T.cpp
wuyou33/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation
2f1ff054b7c5059da80bb3b2f80c05861a02cc36
[ "MIT" ]
null
null
null
3rdparty/GPSTk/core/tests/FileHandling/FFBinaryStream_T.cpp
wuyou33/Enabling-Robust-State-Estimation-through-Measurement-Error-Covariance-Adaptation
2f1ff054b7c5059da80bb3b2f80c05861a02cc36
[ "MIT" ]
14
2019-11-05T01:50:29.000Z
2021-08-06T06:23:44.000Z
//============================================================================ // // This file is part of GPSTk, the GPS Toolkit. // // The GPSTk 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.0 of // the License, or any later version. // // The GPSTk 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 GPSTk; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // 02110, USA // // Copyright 2015, The University of Texas at Austin // //============================================================================ //============================================================================ // // This software developed by Applied Research Laboratories at the // University of Texas at Austin, under contract to an agency or // agencies within the U.S. Department of Defense. The // U.S. Government retains all rights to use, duplicate, distribute, // disclose, or release this software. // // Pursuant to DoD Directive 523024 // // DISTRIBUTION STATEMENT A: This software has been approved for public // release, distribution is unlimited. // //============================================================================= #include "FFBinaryStream.hpp" #include "TestUtil.hpp" using namespace std; using namespace gpstk; // generic little-endian binary stream class FFBinaryStreamLE : public FFBinaryStream { public: FFBinaryStreamLE(const char* fn, std::ios::openmode mode=std::ios::in|std::ios::binary) : gpstk::FFBinaryStream(fn, mode) {} virtual bool isStreamLittleEndian() const throw() { return true; } }; // generic big-endian binary stream class FFBinaryStreamBE : public FFBinaryStream { public: FFBinaryStreamBE(const char* fn, std::ios::openmode mode=std::ios::in|std::ios::binary) : gpstk::FFBinaryStream(fn, mode) {} virtual bool isStreamLittleEndian() const throw() { return false; } }; class FFBinaryStream_T { public: // constructor FFBinaryStream_T() { init(); } // initialize tests void init(); int testTypes(); template <class StreamType> void testStream(const std::string& outfn, const std::string& reffn, TestUtil& testFramework); string beFile; ///< Big-endian output file string leFile; ///< Little-endian output file string beRef; ///< Big-endian output reference file string leRef; ///< Little-endian output reference file }; // class FFBinaryStream_T //============================================================ // Initialize Test Data Filenames and Values //============================================================ void FFBinaryStream_T :: init() { TestUtil testUtil; string dp = gpstk::getPathData() + gpstk::getFileSep(); string op = gpstk::getPathTestTemp() + gpstk::getFileSep(); //---------------------------------------- // Full file paths //---------------------------------------- beFile = op + "test_output_FFBinaryStream_BE.dat"; leFile = op + "test_output_FFBinaryStream_LE.dat"; beRef = dp + "test_output_FFBinaryStream_BE.exp"; leRef = dp + "test_output_FFBinaryStream_LE.exp"; } int FFBinaryStream_T :: testTypes() { TUDEF("FFBinaryStream", "writeData"); testFramework.changeSourceMethod("getData/writeData (little-endian)"); testStream<FFBinaryStreamLE>(leFile, leRef, testFramework); testFramework.changeSourceMethod("getData/writeData (big-endian)"); testStream<FFBinaryStreamBE>(beFile, beRef, testFramework); return testFramework.countFails(); } template <class StreamType> void FFBinaryStream_T :: testStream(const std::string& outfn, const std::string& reffn, TestUtil& testFramework) { StreamType testStrm(outfn.c_str(), ios::out); static const uint8_t uint8Arr[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!' }; // test edges as well as "random" non-edge numbers static const uint16_t uint16Arr[] = { 0xffff, 0x0000, 0xdead, 0xbeef, 0x7ff3 }; static const uint32_t uint32Arr[] = { 0, 2147483647, 4294967295, 6456568 }; static const uint64_t uint64Arr[] = { 0, 9223372036854775807, 18446744073709551615lu, 2904954569522 }; static const int8_t int8Arr[] = { 0, 127, -127, -1 }; static const int16_t int16Arr[] = { 0, -1, -32767, 32767, 98, -1553 }; static const int32_t int32Arr[] = { 0, -1, -2147483647, 2147483647, -123456, 63454567 }; static const int64_t int64Arr[] = { 0, -1, -9223372036854775807, 9223372036854775807, 104993356393, -544342456764 }; // http://www.h-schmidt.net/FloatConverter/IEEE754.html // 3a00f07f static const float fltArr[] = { 4.918649210594594E-4 }; // http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html // 01 23 45 67 89 ab cd ef // 3d 85 9d 6a a8 91 f3 7f static const double dblArr[] = { 3.5127005640885040e-303, 2.4573306210644260e-12 }; static const streampos fileSize = sizeof(uint8Arr) + sizeof(uint16Arr) + sizeof(uint32Arr) + sizeof(uint64Arr) + sizeof(int8Arr) + sizeof(int16Arr) + sizeof(int32Arr) + sizeof(int64Arr) + sizeof(fltArr) + sizeof(dblArr); // Note that this puts 17 bytes into the file which means that // the longer quantities (2-, 4-, and 8-bytes) will not be // aligned. This is in itself a useful test. unsigned i; uint8_t tu8; uint16_t tu16; uint32_t tu32; uint64_t tu64; uint8_t ts8; int16_t ts16; int32_t ts32; int64_t ts64; float tf; double td; // writeData makes sure that the output file grows by the // expected number of bytes for the data type. // unsigned types streampos expectedPos = 0; for (i = 0; i < sizeof(uint8Arr); i++) { testStrm.writeData(uint8Arr[i]); expectedPos += 1; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } // sizeof is in bytes, divide by 2 to get array size, repeat as necessary for (i = 0; i < (sizeof(uint16Arr) >> 1); i++) { testStrm.writeData(uint16Arr[i]); expectedPos += 2; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(uint32Arr) >> 2); i++) { testStrm.writeData(uint32Arr[i]); expectedPos += 4; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(uint64Arr) >> 3); i++) { testStrm.writeData(uint64Arr[i]); expectedPos += 8; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } // signed types for (i = 0; i < sizeof(int8Arr); i++) { testStrm.writeData(int8Arr[i]); expectedPos += 1; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(int16Arr) >> 1); i++) { testStrm.writeData(int16Arr[i]); expectedPos += 2; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(int32Arr) >> 2); i++) { testStrm.writeData(int32Arr[i]); expectedPos += 4; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(int64Arr) >> 3); i++) { testStrm.writeData(int64Arr[i]); expectedPos += 8; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(fltArr) >> 2); i++) { testStrm.writeData(fltArr[i]); expectedPos += 4; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } for (i = 0; i < (sizeof(dblArr) >> 3); i++) { testStrm.writeData(dblArr[i]); expectedPos += 8; TUASSERTE(streampos, expectedPos, testStrm.tellg()); } testStrm.close(); // getData tests make sure that the data read back in from the // file matches what was written out in the first place. StreamType testStrmIn(outfn.c_str(), ios::in); #ifdef WIN32 testFramework.assert(bool(testStrmIn), "Couldn't open " + outfn + " for input", __LINE__); #else testFramework.assert(testStrmIn, "Couldn't open " + outfn + " for input", __LINE__); #endif // check file size testStrmIn.seekg(0, testStrmIn.end); TUASSERTE(streampos, fileSize, testStrmIn.tellg()); testStrmIn.seekg(0, testStrmIn.beg); // unsigned types for (i = 0; i < sizeof(uint8Arr); i++) { testStrmIn.getData(tu8); TUASSERTE(uint8_t, uint8Arr[i], tu8); } // sizeof is in bytes, divide by 2 to get array size, repeat as necessary for (i = 0; i < (sizeof(uint16Arr) >> 1); i++) { testStrmIn.getData(tu16); TUASSERTE(uint16_t, uint16Arr[i], tu16); } for (i = 0; i < (sizeof(uint32Arr) >> 2); i++) { testStrmIn.getData(tu32); TUASSERTE(uint32_t, uint32Arr[i], tu32); } for (i = 0; i < (sizeof(uint64Arr) >> 3); i++) { testStrmIn.getData(tu64); TUASSERTE(uint64_t, uint64Arr[i], tu64); } // signed types for (i = 0; i < sizeof(int8Arr); i++) { testStrmIn.getData(ts8); TUASSERTE(int8_t, int8Arr[i], ts8); } for (i = 0; i < (sizeof(int16Arr) >> 1); i++) { testStrmIn.getData(ts16); TUASSERTE(int16_t, int16Arr[i], ts16); } for (i = 0; i < (sizeof(int32Arr) >> 2); i++) { testStrmIn.getData(ts32); TUASSERTE(int32_t, int32Arr[i], ts32); } for (i = 0; i < (sizeof(int64Arr) >> 3); i++) { testStrmIn.getData(ts64); TUASSERTE(int64_t, int64Arr[i], ts64); } for (i = 0; i < (sizeof(fltArr) >> 2); i++) { testStrmIn.getData(tf); TUASSERTFE(fltArr[i], tf); } for (i = 0; i < (sizeof(dblArr) >> 3); i++) { testStrmIn.getData(td); TUASSERTFE(dblArr[i], td); } testStrmIn.close(); testFramework.assert_binary_files_equal (__LINE__, reffn, outfn, "Encoded output file does not match reference"); } /** Run the program. * * @return Total error count for all tests */ int main(int argc, char *argv[]) { int errorTotal = 0; FFBinaryStream_T testClass; // test data is loaded here errorTotal += testClass.testTypes(); cout << "Total Failures for " << __FILE__ << ": " << errorTotal << endl; return( errorTotal ); } // main()
30.582633
93
0.586829
[ "3d" ]
e565808d13840e0ec4fe5e27082988af2634f993
12,160
cpp
C++
Tools/EditorFramework/Gizmos/Implementation/TranslateGizmo.cpp
eltld/ezEngine
3230235249dd2769f166872b753efd6bd8347c98
[ "CC-BY-3.0" ]
null
null
null
Tools/EditorFramework/Gizmos/Implementation/TranslateGizmo.cpp
eltld/ezEngine
3230235249dd2769f166872b753efd6bd8347c98
[ "CC-BY-3.0" ]
null
null
null
Tools/EditorFramework/Gizmos/Implementation/TranslateGizmo.cpp
eltld/ezEngine
3230235249dd2769f166872b753efd6bd8347c98
[ "CC-BY-3.0" ]
1
2020-03-08T04:55:16.000Z
2020-03-08T04:55:16.000Z
#include <PCH.h> #include <EditorFramework/Gizmos/TranslateGizmo.h> #include <EditorFramework/DocumentWindow3D/DocumentWindow3D.moc.h> #include <Foundation/Logging/Log.h> #include <QMouseEvent> #include <CoreUtils/Graphics/Camera.h> #include <Foundation/Utilities/GraphicsUtils.h> #include <EditorFramework/DocumentWindow3D/3DViewWidget.moc.h> EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezTranslateGizmo, ezGizmoBase, 1, ezRTTINoAllocator); EZ_END_DYNAMIC_REFLECTED_TYPE(); ezTranslateGizmo::ezTranslateGizmo() { m_fSnappingValue = 0.0f; m_AxisX.Configure(this, ezGizmoHandleType::Arrow, ezColorLinearUB(128, 0, 0)); m_AxisY.Configure(this, ezGizmoHandleType::Arrow, ezColorLinearUB(0, 128, 0)); m_AxisZ.Configure(this, ezGizmoHandleType::Arrow, ezColorLinearUB(0, 0, 128)); m_PlaneXY.Configure(this, ezGizmoHandleType::Rect, ezColorLinearUB(128, 128, 255)); m_PlaneXZ.Configure(this, ezGizmoHandleType::Rect, ezColorLinearUB(128, 255, 128)); m_PlaneYZ.Configure(this, ezGizmoHandleType::Rect, ezColorLinearUB(255, 128, 128)); SetVisible(false); SetTransformation(ezMat4::IdentityMatrix()); m_Mode = TranslateMode::None; m_MovementMode = MovementMode::ScreenProjection; } void ezTranslateGizmo::OnSetOwner(ezDocumentWindow3D* pOwnerWindow, ezEngineViewWidget* pOwnerView) { m_AxisX.SetOwner(pOwnerWindow); m_AxisY.SetOwner(pOwnerWindow); m_AxisZ.SetOwner(pOwnerWindow); m_PlaneXY.SetOwner(pOwnerWindow); m_PlaneXZ.SetOwner(pOwnerWindow); m_PlaneYZ.SetOwner(pOwnerWindow); } void ezTranslateGizmo::OnVisibleChanged(bool bVisible) { m_AxisX.SetVisible(bVisible); m_AxisY.SetVisible(bVisible); m_AxisZ.SetVisible(bVisible); m_PlaneXY.SetVisible(bVisible); m_PlaneXZ.SetVisible(bVisible); m_PlaneYZ.SetVisible(bVisible); } void ezTranslateGizmo::OnTransformationChanged(const ezMat4& transform) { ezMat4 m; m.SetIdentity(); m_AxisX.SetTransformation(transform * m); m.SetRotationMatrixZ(ezAngle::Degree(90)); m_AxisY.SetTransformation(transform * m); m.SetRotationMatrixY(ezAngle::Degree(-90)); m_AxisZ.SetTransformation(transform * m); m.SetIdentity(); m_PlaneXY.SetTransformation(transform * m); m.SetRotationMatrixY(ezAngle::Degree(90)); m_PlaneYZ.SetTransformation(transform * m); m.SetRotationMatrixX(ezAngle::Degree(90)); m_PlaneXZ.SetTransformation(transform * m); } void ezTranslateGizmo::FocusLost() { if (m_MovementMode == MovementMode::MouseDiff) { QCursor::setPos(m_OriginalMousePos); GetOwnerView()->setCursor(QCursor(Qt::ArrowCursor)); } BaseEvent ev; ev.m_pGizmo = this; ev.m_Type = BaseEvent::Type::EndInteractions; m_BaseEvents.Broadcast(ev); ezViewHighlightMsgToEngine msg; msg.SendHighlightObjectMessage(GetOwnerWindow()->GetEditorEngineConnection()); m_AxisX.SetVisible(true); m_AxisY.SetVisible(true); m_AxisZ.SetVisible(true); m_PlaneXY.SetVisible(true); m_PlaneXZ.SetVisible(true); m_PlaneYZ.SetVisible(true); m_Mode = TranslateMode::None; m_MovementMode = MovementMode::ScreenProjection; m_vLastMoveDiff.SetZero(); } bool ezTranslateGizmo::mousePressEvent(QMouseEvent* e) { if (IsActiveInputContext()) return true; if (e->button() != Qt::MouseButton::LeftButton) return false; m_vLastMoveDiff.SetZero(); m_LastMousePos = e->globalPos(); m_OriginalMousePos = m_LastMousePos; if (m_pInteractionGizmoHandle == &m_AxisX) { m_vMoveAxis = m_AxisX.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Axis; } else if (m_pInteractionGizmoHandle == &m_AxisY) { m_vMoveAxis = m_AxisY.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Axis; } else if (m_pInteractionGizmoHandle == &m_AxisZ) { m_vMoveAxis = m_AxisZ.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Axis; } else if (m_pInteractionGizmoHandle == &m_PlaneXY) { m_vMoveAxis = m_PlaneXY.GetTransformation().GetColumn(2).GetAsVec3().GetNormalized(); m_vPlaneAxis[0] = m_PlaneXY.GetTransformation().GetColumn(0).GetAsVec3().GetNormalized(); m_vPlaneAxis[1] = m_PlaneXY.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Plane; } else if (m_pInteractionGizmoHandle == &m_PlaneXZ) { m_vMoveAxis = m_PlaneXZ.GetTransformation().GetColumn(2).GetAsVec3().GetNormalized(); m_vPlaneAxis[0] = m_PlaneXZ.GetTransformation().GetColumn(0).GetAsVec3().GetNormalized(); m_vPlaneAxis[1] = m_PlaneXZ.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Plane; } else if (m_pInteractionGizmoHandle == &m_PlaneYZ) { m_vMoveAxis = m_PlaneYZ.GetTransformation().GetColumn(2).GetAsVec3().GetNormalized(); m_vPlaneAxis[0] = m_PlaneYZ.GetTransformation().GetColumn(0).GetAsVec3().GetNormalized(); m_vPlaneAxis[1] = m_PlaneYZ.GetTransformation().GetColumn(1).GetAsVec3().GetNormalized(); m_Mode = TranslateMode::Plane; } else return false; ezViewHighlightMsgToEngine msg; msg.m_HighlightObject = m_pInteractionGizmoHandle->GetGuid(); msg.SendHighlightObjectMessage(GetOwnerWindow()->GetEditorEngineConnection()); m_AxisX.SetVisible(false); m_AxisY.SetVisible(false); m_AxisZ.SetVisible(false); m_PlaneXY.SetVisible(false); m_PlaneXZ.SetVisible(false); m_PlaneYZ.SetVisible(false); m_pInteractionGizmoHandle->SetVisible(true); m_vStartPosition = GetTransformation().GetTranslationVector(); ezMat4 mView, mProj, mViewProj; m_pCamera->GetViewMatrix(mView); m_pCamera->GetProjectionMatrix((float)m_Viewport.x / (float)m_Viewport.y, mProj); mViewProj = mProj * mView; m_InvViewProj = mViewProj.GetInverse(); m_LastInteraction = ezTime::Now(); SetActiveInputContext(this); if (m_Mode == TranslateMode::Axis) { GetPointOnAxis(e->pos().x(), m_Viewport.y - e->pos().y(), m_vInteractionPivot); } else if (m_Mode == TranslateMode::Plane) { GetPointOnPlane(e->pos().x(), m_Viewport.y - e->pos().y(), m_vInteractionPivot); } m_fStartScale = (m_vInteractionPivot - m_pCamera->GetPosition()).GetLength() * 0.125; BaseEvent ev; ev.m_pGizmo = this; ev.m_Type = BaseEvent::Type::BeginInteractions; m_BaseEvents.Broadcast(ev); return true; } bool ezTranslateGizmo::mouseReleaseEvent(QMouseEvent* e) { if (!IsActiveInputContext()) return false; if (e->button() != Qt::MouseButton::LeftButton) return true; FocusLost(); SetActiveInputContext(nullptr); return true; } ezResult ezTranslateGizmo::GetPointOnPlane(ezInt32 iScreenPosX, ezInt32 iScreenPosY, ezVec3& out_Result) const { out_Result = m_vStartPosition; ezVec3 vPos, vRayDir; if (ezGraphicsUtils::ConvertScreenPosToWorldPos(m_InvViewProj, 0, 0, m_Viewport.x, m_Viewport.y, ezVec3(iScreenPosX, iScreenPosY, 0), vPos, &vRayDir).Failed()) return EZ_FAILURE; ezPlane Plane; Plane.SetFromNormalAndPoint(m_vMoveAxis, m_vStartPosition); ezVec3 vIntersection; if (!Plane.GetRayIntersection(m_pCamera->GetPosition(), vRayDir, nullptr, &vIntersection)) return EZ_FAILURE; out_Result = vIntersection; return EZ_SUCCESS; } void ezTranslateGizmo::SetCursorToWindowCenter() { QSize size = GetOwnerView()->size(); QPoint center; center.setX(size.width() / 2); center.setY(size.height() / 2); center = GetOwnerView()->mapToGlobal(center); m_LastMousePos = center; QCursor::setPos(center); GetOwnerView()->setCursor(QCursor(Qt::BlankCursor)); } ezResult ezTranslateGizmo::GetPointOnAxis(ezInt32 iScreenPosX, ezInt32 iScreenPosY, ezVec3& out_Result) const { out_Result = m_vStartPosition; ezVec3 vPos, vRayDir; if (ezGraphicsUtils::ConvertScreenPosToWorldPos(m_InvViewProj, 0, 0, m_Viewport.x, m_Viewport.y, ezVec3(iScreenPosX, iScreenPosY, 0), vPos, &vRayDir).Failed()) return EZ_FAILURE; const ezVec3 vPlaneTangent = m_vMoveAxis.Cross(m_pCamera->GetDirForwards()).GetNormalized(); const ezVec3 vPlaneNormal = m_vMoveAxis.Cross(vPlaneTangent); ezPlane Plane; Plane.SetFromNormalAndPoint(vPlaneNormal, m_vStartPosition); ezVec3 vIntersection; if (!Plane.GetRayIntersection(m_pCamera->GetPosition(), vRayDir, nullptr, &vIntersection)) return EZ_FAILURE; const ezVec3 vDirAlongRay = vIntersection - m_vStartPosition; const float fProjectedLength = vDirAlongRay.Dot(m_vMoveAxis); out_Result = m_vStartPosition + fProjectedLength * m_vMoveAxis; return EZ_SUCCESS; } bool ezTranslateGizmo::mouseMoveEvent(QMouseEvent* e) { if (!IsActiveInputContext()) return false; const ezTime tNow = ezTime::Now(); if (tNow - m_LastInteraction < ezTime::Seconds(1.0 / 25.0)) return true; m_LastInteraction = tNow; ezMat4 mTrans = GetTransformation(); ezVec3 vTranslate(0); if (m_MovementMode == MovementMode::ScreenProjection) { ezVec3 vCurrentInteractionPoint; if (m_Mode == TranslateMode::Axis) { if (GetPointOnAxis(e->pos().x(), m_Viewport.y - e->pos().y(), vCurrentInteractionPoint).Failed()) return true; } else if (m_Mode == TranslateMode::Plane) { if (GetPointOnPlane(e->pos().x(), m_Viewport.y - e->pos().y(), vCurrentInteractionPoint).Failed()) return true; } const float fPerspectiveScale = (vCurrentInteractionPoint - m_pCamera->GetPosition()).GetLength() * 0.125; const ezVec3 vOffset = (m_vInteractionPivot - m_vStartPosition); const ezVec3 vNewPos = vCurrentInteractionPoint - vOffset * fPerspectiveScale / m_fStartScale; vTranslate = vNewPos - m_vStartPosition; } else { const float fSpeed = 0.2f; const ezVec3 vMouseDir = m_pCamera->GetDirRight() * (float)(e->globalPos().x() - m_LastMousePos.x()) + -m_pCamera->GetDirUp() * (float)(e->globalPos().y() - m_LastMousePos.y()); if (m_Mode == TranslateMode::Axis) { vTranslate = mTrans.GetTranslationVector() - m_vStartPosition + m_vMoveAxis * (m_vMoveAxis.Dot(vMouseDir)) * fSpeed; } else if (m_Mode == TranslateMode::Plane) { vTranslate = mTrans.GetTranslationVector() - m_vStartPosition + m_vPlaneAxis[0] * (m_vPlaneAxis[0].Dot(vMouseDir)) * fSpeed + m_vPlaneAxis[1] * (m_vPlaneAxis[1].Dot(vMouseDir)) * fSpeed; } SetCursorToWindowCenter(); } if (m_fSnappingValue > 0.0f) { ezMat3 mRot = mTrans.GetRotationalPart(); ezMat3 mInvRot = mRot.GetInverse(); ezVec3 vLocalTranslation = mInvRot * vTranslate; vLocalTranslation.x = ezMath::Round(vLocalTranslation.x, m_fSnappingValue); vLocalTranslation.y = ezMath::Round(vLocalTranslation.y, m_fSnappingValue); vLocalTranslation.z = ezMath::Round(vLocalTranslation.z, m_fSnappingValue); vTranslate = mRot * vLocalTranslation; } const ezVec3 vLastPos = mTrans.GetTranslationVector(); mTrans.SetTranslationVector(m_vStartPosition + vTranslate); m_vLastMoveDiff = mTrans.GetTranslationVector() - vLastPos; SetTransformation(mTrans); BaseEvent ev; ev.m_pGizmo = this; ev.m_Type = BaseEvent::Type::Interaction; m_BaseEvents.Broadcast(ev); return true; } void ezTranslateGizmo::SnapToGrid() { if (m_Mode != TranslateMode::None) return; BaseEvent ev; ev.m_pGizmo = this; ev.m_Type = BaseEvent::Type::BeginInteractions; m_BaseEvents.Broadcast(ev); ezMat4 mTrans = GetTransformation(); m_vStartPosition = mTrans.GetTranslationVector(); ezVec3 vPos = mTrans.GetTranslationVector(); vPos.x = ezMath::Round(vPos.x, m_fSnappingValue); vPos.y = ezMath::Round(vPos.y, m_fSnappingValue); vPos.z = ezMath::Round(vPos.z, m_fSnappingValue); mTrans.SetTranslationVector(vPos); SetTransformation(mTrans); ev.m_Type = BaseEvent::Type::Interaction; m_BaseEvents.Broadcast(ev); ev.m_Type = BaseEvent::Type::EndInteractions; m_BaseEvents.Broadcast(ev); } void ezTranslateGizmo::SetMovementMode(MovementMode mode) { if (m_MovementMode == mode) return; m_MovementMode = mode; if (m_MovementMode == MovementMode::MouseDiff) { m_OriginalMousePos = QCursor::pos(); SetCursorToWindowCenter(); } else { QCursor::setPos(m_OriginalMousePos); GetOwnerView()->setCursor(QCursor(Qt::ArrowCursor)); } }
29.87715
192
0.737993
[ "transform" ]
ec907ad5ade86ae7ab6b979b7b8713e99f824b6e
3,837
cpp
C++
unfolding/source/plot_surface.cpp
lgmontgomery/Neutron-Spectrometry
56e0b8a649019ae8d490150733195ab06171fca3
[ "MIT" ]
1
2020-01-24T17:15:15.000Z
2020-01-24T17:15:15.000Z
unfolding/source/plot_surface.cpp
lgmontgomery/Neutron-Spectrometry
56e0b8a649019ae8d490150733195ab06171fca3
[ "MIT" ]
null
null
null
unfolding/source/plot_surface.cpp
lgmontgomery/Neutron-Spectrometry
56e0b8a649019ae8d490150733195ab06171fca3
[ "MIT" ]
1
2020-07-21T18:41:42.000Z
2020-07-21T18:41:42.000Z
//************************************************************************************************** // This program reads in an arbitrary number of data series from a CSV file and plots them as a 2D // surface plot. //************************************************************************************************** #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <cmath> #include <stdlib.h> #include <vector> #include <map> #include "custom_classes.h" #include "fileio.h" #include "root_helpers.h" // Root #include "TApplication.h" #include "TAxis.h" #include "TCanvas.h" #include "TColor.h" #include "TFrame.h" #include "TGaxis.h" #include "TGraph.h" #include "TGraph2D.h" #include "TGraphErrors.h" #include "TH2F.h" #include "TLatex.h" #include "TLine.h" #include "TLegend.h" #include "TMultiGraph.h" #include "TPad.h" #include "TPaveText.h" #include "TROOT.h" #include "TStyle.h" #include "TText.h" #include "TVectorD.h" #include "TVirtualPad.h" #include "TRandom.h" int main(int argc, char* argv[]) { // Read in settings std::string settings_file = "input/plot_surface.cfg"; SurfaceSettings settings; setSurfaceSettings(settings_file, settings); // Fill settings with any user provided settings // Read in data std::vector<std::string> headers; std::vector<std::vector<double>> x_data; std::vector<std::vector<double>> y_data; readXYYCSV(settings.path_input_data, headers, x_data, y_data); int num_x = x_data[0].size(); int num_y = y_data.size(); // Generate the plot area TCanvas *c1 = new TCanvas("c1","c1",settings.x_res,settings.y_res); // Resulution of the graph (px) specified in parameters TGraph2D *dt = new TGraph2D(); std::string tgraph_titles = settings.title + "; " + settings.x_label + "; " + settings.y_label + "; " + settings.z_label; dt->SetTitle(tgraph_titles.c_str()); int k=0; // Populate with data for (int i=1; i<num_y; i++) { for (int j=1; j<num_x; j++) { dt->SetPoint(k,x_data[i][j],stod(headers[i]),y_data[i][j]); k++; } } // Set color scheme gStyle->SetPalette(settings.color_palette); // Set number of contours (z bins) gStyle->SetNumberContours(settings.num_color_bins); // Set plot type dt->Draw("COLZ"); // dt->Draw("PCOLZ"); // 3D, no interpolation // Set axes ranges if (settings.z_min != settings.z_max) { dt->SetMinimum(settings.z_min); dt->SetMaximum(settings.z_max); } if (settings.y_min != settings.y_max){ dt->GetYaxis()->SetLimits(settings.y_min,settings.y_max); } if (settings.x_min != settings.x_max){ dt->GetXaxis()->SetLimits(settings.x_min,settings.x_max); } // Axes title positions dt->GetXaxis()->CenterTitle(); dt->GetYaxis()->CenterTitle(); c1->SetRightMargin(0.2); // z labels are cutoff otherwise dt->GetZaxis()->CenterTitle(); dt->GetXaxis()->SetTitleOffset(1.4); dt->GetZaxis()->SetTitleOffset(1.8); // Number of ticks on axes if (settings.x_num_divs != 0){ dt->GetXaxis()->SetNdivisions(settings.x_num_divs,kFALSE); } if (settings.z_num_divs != 0){ dt->GetZaxis()->SetNdivisions(settings.z_num_divs,kFALSE); } c1->SetLogy(); // logarithmic y axis // Axes ticks c1->SetTickx(); // No parameter means show tick marks on both sides, labels on one c1->SetTicky(); // No parameter means show tick marks on both sides, labels on one gStyle->SetLineWidth(settings.border_width); // Set width of axis/border around the plot dt->GetZaxis()->SetTickLength(0); c1->Update(); c1->Modified(); // Output the plot to file const char *cstr_figure_file = settings.path_output_figure.c_str(); c1->Print(cstr_figure_file); }
30.452381
127
0.621058
[ "vector", "3d" ]
ec9d5cc21d761e65f6e0afd64405da888d2e8c0a
345
cpp
C++
Natives/src/main/driver/windows/CANControllerDetector.cpp
ThadHouse/FRCCANReader
c9cee6ad79c3de81c2a40f6887334b2b9e4a67d6
[ "MIT" ]
2
2020-01-15T03:36:16.000Z
2020-03-03T18:36:07.000Z
Natives/src/main/driver/windows/CANControllerDetector.cpp
ThadHouse/FRCCANReader
c9cee6ad79c3de81c2a40f6887334b2b9e4a67d6
[ "MIT" ]
1
2020-01-15T01:27:09.000Z
2020-01-15T01:27:09.000Z
Natives/src/main/driver/windows/CANControllerDetector.cpp
ThadHouse/FRCCANReader
c9cee6ad79c3de81c2a40f6887334b2b9e4a67d6
[ "MIT" ]
null
null
null
#include "CANControllerDetector.h" #include "WindowsCANController.h" using namespace can; std::vector<CANDevice> CANControllerDetector::EnumerateDevices() { return WindowsCANController::EnumerateDevices(); } std::unique_ptr<CANController> CANControllerDetector::CreateController() { return std::make_unique<WindowsCANController>(); }
23
72
0.794203
[ "vector" ]
eca2d68b57b8c8cc06e341bb6d2ffbc5162e5659
2,150
cpp
C++
src/cpp/eval/ast/statement_list_statement.cpp
scottmac/hiphop-php
880fa3d11203ce02cfc5fe994d0b306e741a235e
[ "PHP-3.01", "Zend-2.0" ]
1
2019-04-27T20:22:23.000Z
2019-04-27T20:22:23.000Z
src/cpp/eval/ast/statement_list_statement.cpp
brion/hiphop-php
df70a236e6418d533ac474be0c01f0ba87034d7f
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
src/cpp/eval/ast/statement_list_statement.cpp
brion/hiphop-php
df70a236e6418d533ac474be0c01f0ba87034d7f
[ "PHP-3.01", "Zend-2.0" ]
null
null
null
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include <cpp/eval/ast/statement_list_statement.h> #include <cpp/eval/runtime/variable_environment.h> using namespace std; namespace HPHP { namespace Eval { /////////////////////////////////////////////////////////////////////////////// StatementListStatement:: StatementListStatement(STATEMENT_ARGS, const std::vector<StatementPtr> &stmts) : Statement(STATEMENT_PASS), m_stmts(stmts) {} StatementListStatement::StatementListStatement(STATEMENT_ARGS) : Statement(STATEMENT_PASS) {} void StatementListStatement::eval(VariableEnvironment &env) const { ENTER_STMT; for (vector<StatementPtr>::const_iterator it = m_stmts.begin(); it != m_stmts.end(); ++it) { EVAL_STMT(*it, env); } } void StatementListStatement::add(StatementPtr stmt) { m_stmts.push_back(stmt); } void StatementListStatement::dump() const { dumpVector(m_stmts, " "); } void StatementListStatement::byteCode(ByteCodeProgram &code) const { for (vector<StatementPtr>::const_iterator it = m_stmts.begin(); it != m_stmts.end(); ++it) { (*it)->byteCode(code); } } /////////////////////////////////////////////////////////////////////////////// } }
36.440678
79
0.511163
[ "vector" ]
eca5124ad43ec24766719d81f3abef3ab7522050
1,398
cpp
C++
aws-cpp-sdk-machinelearning/source/model/RDSDatabase.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-machinelearning/source/model/RDSDatabase.cpp
lintonv/aws-sdk-cpp
15e19c265ffce19d2046b18aa1b7307fc5377e58
[ "Apache-2.0" ]
1
2022-01-03T23:59:37.000Z
2022-01-03T23:59:37.000Z
aws-cpp-sdk-machinelearning/source/model/RDSDatabase.cpp
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T11:58:03.000Z
2021-11-09T11:58:03.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/machinelearning/model/RDSDatabase.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace MachineLearning { namespace Model { RDSDatabase::RDSDatabase() : m_instanceIdentifierHasBeenSet(false), m_databaseNameHasBeenSet(false) { } RDSDatabase::RDSDatabase(JsonView jsonValue) : m_instanceIdentifierHasBeenSet(false), m_databaseNameHasBeenSet(false) { *this = jsonValue; } RDSDatabase& RDSDatabase::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("InstanceIdentifier")) { m_instanceIdentifier = jsonValue.GetString("InstanceIdentifier"); m_instanceIdentifierHasBeenSet = true; } if(jsonValue.ValueExists("DatabaseName")) { m_databaseName = jsonValue.GetString("DatabaseName"); m_databaseNameHasBeenSet = true; } return *this; } JsonValue RDSDatabase::Jsonize() const { JsonValue payload; if(m_instanceIdentifierHasBeenSet) { payload.WithString("InstanceIdentifier", m_instanceIdentifier); } if(m_databaseNameHasBeenSet) { payload.WithString("DatabaseName", m_databaseName); } return payload; } } // namespace Model } // namespace MachineLearning } // namespace Aws
18.64
69
0.741059
[ "model" ]
ecab3bda1f7e081273127dfb5aaa26399490e402
9,578
cpp
C++
src/gpsdclient.cpp
perryrob/oxcart
5c29535be2b813c7caebcfec31a8f934b0c88228
[ "BSD-4-Clause" ]
1
2017-03-20T20:13:16.000Z
2017-03-20T20:13:16.000Z
src/gpsdclient.cpp
perryrob/oxcart
5c29535be2b813c7caebcfec31a8f934b0c88228
[ "BSD-4-Clause" ]
null
null
null
src/gpsdclient.cpp
perryrob/oxcart
5c29535be2b813c7caebcfec31a8f934b0c88228
[ "BSD-4-Clause" ]
null
null
null
/* * gpsdclient.c -- support functions for GPSD clients * * This file is Copyright (c) 2010 by the GPSD project * BSD terms apply: see the file COPYING in the distribution root for details. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> /* for strcasecmp() */ #include <time.h> /* for time_t */ #include <math.h> #include <assert.h> #include <gps.h> #include "gpsd/gpsd_config.h" #include "gpsd/gpsdclient.h" static struct exportmethod_t exportmethods[] = { #if defined(DBUS_EXPORT_ENABLE) {"dbus", GPSD_DBUS_EXPORT, "DBUS broadcast"}, #endif /* defined(DBUS_EXPORT_ENABLE) */ #ifdef SHM_EXPORT_ENABLE {"shm", GPSD_SHARED_MEMORY, "shared memory"}, #endif /* SOCKET_EXPORT_ENABLE */ #ifdef SOCKET_EXPORT_ENABLE {"sockets", NULL, "JSON via sockets"}, #endif /* SOCKET_EXPORT_ENABLE */ }; /* convert double degrees to a static string and return a pointer to it * * deg_str_type: * deg_dd : return DD.ddddddd * deg_ddmm : return DD MM.mmmmmm' * deg_ddmmss : return DD MM' SS.sssss" * * for cm level accuracy we need degrees to 7+ decimal places * Ref: https://en.wikipedia.org/wiki/Decimal_degrees * */ char *deg_to_str(enum deg_str_type type, double f) { static char str[40]; int dsec, sec, deg, min; long frac_deg; double fdsec, fsec, fdeg, fmin; if (f < 0 || f > 360) { (void)strlcpy(str, "nan", sizeof(str)); return str; } fmin = modf(f, &fdeg); deg = (int)fdeg; if (deg_dd == type) { /* DD.dddddddd */ /* cm level accuracy requires the %08ld */ frac_deg = (long)(fmin * 100000000); (void)snprintf(str, sizeof(str), "%3d.%08ld", deg, frac_deg); return str; } fsec = modf(fmin * 60, &fmin); min = (int)fmin; if (deg_ddmm == type) { /* DD MM.mmmmmm */ sec = (int)(fsec * 1000000.0); (void)snprintf(str, sizeof(str), "%3d %02d.%06d'", deg, min, sec); return str; } /* else DD MM SS.sss */ fdsec = modf(fsec * 60, &fsec); sec = (int)fsec; dsec = (int)(fdsec * 10000.0); (void)snprintf(str, sizeof(str), "%3d %02d' %02d.%05d\"", deg, min, sec, dsec); return str; } /* * check the environment to determine proper GPS units * * clients should only call this if no user preference is specified on * the command line or via X resources. * * return imperial - Use miles/feet * nautical - Use knots/feet * metric - Use km/meters * unspecified - use compiled default * * In order check these environment vars: * GPSD_UNITS one of: * imperial = miles/feet * nautical = knots/feet * metric = km/meters * LC_MEASUREMENT * en_US = miles/feet * C = miles/feet * POSIX = miles/feet * [other] = km/meters * LANG * en_US = miles/feet * C = miles/feet * POSIX = miles/feet * [other] = km/meters * * if none found then return compiled in default */ enum unit gpsd_units(void) { char *envu = NULL; if ((envu = getenv("GPSD_UNITS")) != NULL && *envu != '\0') { if (0 == strcasecmp(envu, "imperial")) { return imperial; } if (0 == strcasecmp(envu, "nautical")) { return nautical; } if (0 == strcasecmp(envu, "metric")) { return metric; } /* unrecognized, ignore it */ } if (((envu = getenv("LC_MEASUREMENT")) != NULL && *envu != '\0') || ((envu = getenv("LANG")) != NULL && *envu != '\0')) { if (strncasecmp(envu, "en_US", 5) == 0 || strcasecmp(envu, "C") == 0 || strcasecmp(envu, "POSIX") == 0) { return imperial; } /* Other, must be metric */ return metric; } /* TODO: allow a compile time default here */ return unspecified; } void gpsd_source_spec(const char *arg, struct fixsource_t *source) /* standard parsing of a GPS data source spec */ { /* the casts attempt to head off a -Wwrite-strings warning */ source->server = (char *)"localhost"; source->port = (char *)DEFAULT_GPSD_PORT; source->device = NULL; if (arg != NULL) { char *colon1, *skipto, *rbrk; source->spec = (char *)arg; assert(source->spec != NULL); skipto = source->spec; if (*skipto == '[' && (rbrk = strchr(skipto, ']')) != NULL) { skipto = rbrk; } colon1 = strchr(skipto, ':'); if (colon1 != NULL) { char *colon2; *colon1 = '\0'; if (colon1 != source->spec) { source->server = source->spec; } source->port = colon1 + 1; colon2 = strchr(source->port, ':'); if (colon2 != NULL) { *colon2 = '\0'; source->device = colon2 + 1; } } else if (strchr(source->spec, '/') != NULL) { source->device = source->spec; } else { source->server = source->spec; } } if (*source->server == '[') { char *rbrk = strchr(source->server, ']'); ++source->server; if (rbrk != NULL) *rbrk = '\0'; } } char *maidenhead(double n, double e) /* lat/lon to Maidenhead */ { /* * Specification at * http://en.wikipedia.org/wiki/Maidenhead_Locator_System * * There's a fair amount of slop in how Maidenhead converters operate * that can make it look like this one is wrong. * * 1. Many return caps for paces 5 and 6 when according to the spwec * they should return smalls. * * 2. Some converters, including QGrid from which this code was originally * derived, add an 0.5 offset to the divided e and n just before it * is cast to integer and used for places 5 and 6. This appears to be * intended as a round-to-nearest hack (as opposed to the implicit * round down from the cast). If I'm reading the spec right it * is not correct to do this. */ static char buf[7]; int t1; e=e+180.0; t1=(int)(e/20); buf[0]=(char)t1+'A'; e-=(float)t1*20.0; t1=(int)e/2; buf[2]=(char)t1+'0'; e-=(float)t1*2; buf[4]=(char)(int)(e*12.0)+'a'; n=n+90.0; t1=(int)(n/10.0); buf[1]=(char)t1+'A'; n-=(float)t1*10.0; buf[3]=(char)n+'0'; n-=(int)n; n*=24; // convert to 24 division buf[5]=(char)(int)(n)+'a'; buf[6] = '\0'; return buf; } #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0])) /* from gpsd.h-tail */ struct exportmethod_t *export_lookup(const char *name) /* Look up an available export method by name */ { struct exportmethod_t *mp, *method = NULL; for (mp = exportmethods; mp < exportmethods + NITEMS(exportmethods); mp++) if (strcmp(mp->name, name) == 0) method = mp; return method; } void export_list(FILE *fp) /* list known export methods */ { struct exportmethod_t *method; for (method = exportmethods; method < exportmethods + NITEMS(exportmethods); method++) (void)fprintf(fp, "%s: %s\n", method->name, method->description); } struct exportmethod_t *export_default(void) { return (NITEMS(exportmethods) > 0) ? &exportmethods[0] : NULL; } /* Convert true heading to magnetic. Taken from the Aviation Formulary v1.43. Valid to within two degrees within the continiental USA except for the following airports: MO49 MO86 MO50 3K6 02K and KOOA. AK correct to better than one degree. Western Europe correct to within 0.2 deg. If you're not in one of these areas, I apologize, I don't have the math to compute your varation. This is obviously extremely floating-point heavy, so embedded people, beware of using. Note that there are issues with using magnetic heading. This code does not account for the possibility of travelling into or out of an area of valid calculation beyond forcing the magnetic conversion off. A better way to communicate this to the user is probably desirable (in case the don't notice the subtle change from "(mag)" to "(true)" on their display). */ float true2magnetic(double lat, double lon, double heading) { /* Western Europe */ if ((lat > 36.0) && (lat < 68.0) && (lon > -10.0) && (lon < 28.0)) { heading = (10.4768771667158 - (0.507385322418858 * lon) + (0.00753170031703826 * pow(lon, 2)) - (1.40596203924748e-05 * pow(lon, 3)) - (0.535560699962353 * lat) + (0.0154348808069955 * lat * lon) - (8.07756425110592e-05 * lat * pow(lon, 2)) + (0.00976887198864442 * pow(lat, 2)) - (0.000259163929798334 * lon * pow(lat, 2)) - (3.69056939266123e-05 * pow(lat, 3)) + heading); } /* USA */ else if ((lat > 24.0) && (lat < 50.0) && (lon > 66.0) && (lon < 125.0)) { lon = 0.0 - lon; heading = ((-65.6811) + (0.99 * lat) + (0.0128899 * pow(lat, 2)) - (0.0000905928 * pow(lat, 3)) + (2.87622 * lon) - (0.0116268 * lat * lon) - (0.00000603925 * lon * pow(lat, 2)) - (0.0389806 * pow(lon, 2)) - (0.0000403488 * lat * pow(lon, 2)) + (0.000168556 * pow(lon, 3)) + heading); } /* AK */ else if ((lat > 54.0) && (lon > 130.0) && (lon < 172.0)) { lon = 0.0 - lon; heading = (618.854 + (2.76049 * lat) - (0.556206 * pow(lat, 2)) + (0.00251582 * pow(lat, 3)) - (12.7974 * lon) + (0.408161 * lat * lon) + (0.000434097 * lon * pow(lat, 2)) - (0.00602173 * pow(lon, 2)) - (0.00144712 * lat * pow(lon, 2)) + (0.000222521 * pow(lon, 3)) + heading); } else { /* We don't know how to compute magnetic heading for this * location. */ heading = NAN; } /* No negative headings. */ if (isnan(heading)== 0 && heading < 0.0) heading += 360.0; return (heading); } /* gpsclient.c ends here */
28.936556
78
0.590833
[ "3d" ]
ecad2b3e5abf87f3d6c444f29e8095c831e9c16a
3,930
cpp
C++
NavMeshTester/Source/Maze/Behaviours/MazeAvoider.cpp
MODriscoll/AIForGames
47f6b4a8fe6437c6a2b708a9155df568a67c1344
[ "MIT" ]
null
null
null
NavMeshTester/Source/Maze/Behaviours/MazeAvoider.cpp
MODriscoll/AIForGames
47f6b4a8fe6437c6a2b708a9155df568a67c1344
[ "MIT" ]
null
null
null
NavMeshTester/Source/Maze/Behaviours/MazeAvoider.cpp
MODriscoll/AIForGames
47f6b4a8fe6437c6a2b708a9155df568a67c1344
[ "MIT" ]
null
null
null
#include "Maze\Behaviours\MazeAvoider.h" #include "Objects\Agent.h" #include "Maze\Maze.h" #include <Renderer2D.h> MazeAvoider::MazeAvoider(const std::string& a_Tag) : ISteer(a_Tag), m_MaxAvoidForce(100.f) { } Behaviour::eBehaviourResult MazeAvoider::Execute(Agent* a_Agent, float deltaTime) { // Get reference to the agents blackboard Blackboard* Board = a_Agent->GetBehaviourTree()->GetBlackboard(); // Does this blackboard contain the maze? if (Board->GetAs_Pointer("Maze") != nullptr) { // Calculate and apply the force a_Agent->GetRigidBody().AddForce(Calculate(a_Agent)); // Return successfull result return Behaviour::eBehaviourResult::Success; } // Return failed result return Behaviour::eBehaviourResult::Failure; } Vector2 MazeAvoider::Calculate(Agent* a_Agent) { // Get reference to the agents blackboard Blackboard* Board = a_Agent->GetBehaviourTree()->GetBlackboard(); // Get a pointer to the maze and flowfield Maze* Maz = static_cast<Maze*>(Board->GetAs_Pointer("Maze")); // Set the initial force Vector2 Force; // Is there no maze? if (Maz == nullptr) { // Return initial force return Force; } // Get reference to agents transform and rigidbody const Transform2D& ATra = a_Agent->GetTransform(); const RigidBody2D& ARig = a_Agent->GetRigidBody(); // Calculate the dynamic length using velocities float DLen = ARig.Velocity.Magnitude() / m_MaxVelocity; // Get the agents heading float Head = atan2f(ARig.Velocity.y, ARig.Velocity.x); count = 0; // Perform three raycasts // One to the left, // One straight ahead and // One to the right for (float i = -1.f; i < 2.f; ++i) { // Get the direction vector Vector2 Dir = (Vector2::Direction((Head + (RayDifference * i))) * m_MaxRange) * DLen; // Calculate the check points Vector2 CP1 = ATra.Position + Dir; Vector2 CP2 = ATra.Position + (Dir * 0.5f); cps[count++] = CP1; cps[count++] = CP2; // Determine the force to add, add it to the final force Force += DetermineForce(Maz, CP1, CP2); } // Was some force calculated if (Force != Vector2()) { // Normalise the force Force.Normalise(); // Scale the normalised force by the maximum velocity Force *= m_MaxVelocity; // Subtract the current velocity from the force Force -= ARig.Velocity; } // Return the force return Force; } void MazeAvoider::Render(aie::Renderer2D* renderer) { renderer->setRenderColour(0.8f, 0.6f, 1.f); for (size_t i = 0; i < 6; ++i) { const Vector2& pos = cps[i]; renderer->drawCircle(pos.x, pos.y, 2.f); } } void MazeAvoider::SetMaxRange(float a_MaxRange) { m_MaxRange = a_MaxRange; } void MazeAvoider::SetMaxAvoidForce(float a_MaxAvoidForce) { m_MaxAvoidForce = a_MaxAvoidForce; } float MazeAvoider::GetMaxRange() const { return m_MaxRange; } float MazeAvoider::GetMaxAvoidForce() const { return m_MaxAvoidForce; } Vector2 MazeAvoider::DetermineForce(Maze* a_Maze, const Vector2& a_CP1, const Vector2& a_CP2) { // Get the node containing the half point auto Nod = a_Maze->Node(a_CP2); // Was there a node? // If so, is it blocked? if (Nod != nullptr && Nod->Blocked()) { // Get this nodes position const Vector2& NPos = Nod->Node().Position(); // Calculate the force Vector2 Force = a_CP1 - NPos; // Normalise the force Force.Normalise(); // Scale the force by the avoid force Force *= m_MaxAvoidForce; // Return the force return Force; } // Get the node containing the full point Nod = a_Maze->Node(a_CP1); // Was there a node? // If so, is it blocked? if (Nod != nullptr && Nod->Blocked()) { // Get this nodes position const Vector2& NPos = Nod->Node().Position(); // Calculate the force Vector2 Force = a_CP1 - NPos; // Normalise the force Force.Normalise(); // Scale the force by the avoid force Force *= m_MaxAvoidForce; // Return the force return Force; } // Return no force return Vector2(); }
21.47541
93
0.691603
[ "render", "vector", "transform" ]
ecaf10901ec33c2bd835a7b6b1941860a127a208
5,931
cpp
C++
Source/Server/Server/GameService/GameManagers/Ghosts/GhostManager.cpp
dave-ml-xcv/ds3os
bf35b8415c0e8b9d50cb1a1e6dc110dcda62098d
[ "MIT" ]
null
null
null
Source/Server/Server/GameService/GameManagers/Ghosts/GhostManager.cpp
dave-ml-xcv/ds3os
bf35b8415c0e8b9d50cb1a1e6dc110dcda62098d
[ "MIT" ]
null
null
null
Source/Server/Server/GameService/GameManagers/Ghosts/GhostManager.cpp
dave-ml-xcv/ds3os
bf35b8415c0e8b9d50cb1a1e6dc110dcda62098d
[ "MIT" ]
null
null
null
/* * Dark Souls 3 - Open Server * Copyright (C) 2021 Tim Leonard * * This program is free software; licensed under the MIT license. * You should have received a copy of the license along with this program. * If not, see <https://opensource.org/licenses/MIT>. */ #include "Server/GameService/GameManagers/Ghosts/GhostManager.h" #include "Server/GameService/GameClient.h" #include "Server/Streams/Frpg2ReliableUdpMessage.h" #include "Server/Streams/Frpg2ReliableUdpMessageStream.h" #include "Config/RuntimeConfig.h" #include "Server/Server.h" #include "Core/Utils/Logging.h" #include "Core/Utils/Strings.h" GhostManager::GhostManager(Server* InServerInstance) : ServerInstance(InServerInstance) { LiveCache.SetMaxEntriesPerArea(InServerInstance->GetConfig().GhostMaxLivePoolEntriesPerArea); } bool GhostManager::Init() { ServerDatabase& Database = ServerInstance->GetDatabase(); int PrimeCountPerArea = ServerInstance->GetConfig().GhostPrimeCountPerArea; // Prime the cache with a handful of the most recent messages from the database. int GhostCount = 0; const std::vector<OnlineAreaId>* Areas = GetEnumValues<OnlineAreaId>(); for (OnlineAreaId AreaId : *Areas) { std::vector<std::shared_ptr<Ghost>> Ghosts = Database.FindRecentGhosts(AreaId, PrimeCountPerArea); for (const std::shared_ptr<Ghost>& Ghost : Ghosts) { LiveCache.Add(AreaId, Ghost->GhostId, Ghost); GhostCount++; } } if (GhostCount > 0) { LogS(GetName().c_str(), "Primed live cache with %i ghosts.", GhostCount); } return true; } void GhostManager::TrimDatabase() { ServerDatabase& Database = ServerInstance->GetDatabase(); int MaxEntries = ServerInstance->GetConfig().GhostMaxDatabaseEntries; Database.TrimGhosts(MaxEntries); } MessageHandleResult GhostManager::OnMessageRecieved(GameClient* Client, const Frpg2ReliableUdpMessage& Message) { if (Message.Header.msg_type == Frpg2ReliableUdpMessageType::RequestCreateGhostData) { return Handle_RequestCreateGhostData(Client, Message); } else if (Message.Header.msg_type == Frpg2ReliableUdpMessageType::RequestGetGhostDataList) { return Handle_RequestGetGhostDataList(Client, Message); } return MessageHandleResult::Unhandled; } MessageHandleResult GhostManager::Handle_RequestCreateGhostData(GameClient* Client, const Frpg2ReliableUdpMessage& Message) { ServerDatabase& Database = ServerInstance->GetDatabase(); PlayerState& Player = Client->GetPlayerState(); Frpg2RequestMessage::RequestCreateGhostData* Request = (Frpg2RequestMessage::RequestCreateGhostData*)Message.Protobuf.get(); std::vector<uint8_t> Data; Data.assign(Request->data().data(), Request->data().data() + Request->data().size()); if (std::shared_ptr<Ghost> ActiveGhost = Database.CreateGhost((OnlineAreaId)Request->online_area_id(), Player.PlayerId, Player.SteamId, Data)) { LiveCache.Add(ActiveGhost->OnlineAreaId, ActiveGhost->GhostId, ActiveGhost); } else { WarningS(Client->GetName().c_str(), "Disconnecting client as failed to create ghost."); return MessageHandleResult::Error; } std::string TypeStatisticKey = StringFormat("Ghosts/TotalGhostsCreated"); Database.AddGlobalStatistic(TypeStatisticKey, 1); Database.AddPlayerStatistic(TypeStatisticKey, Player.PlayerId, 1); // Empty response, not sure what purpose this serves really other than saying message-recieved. Client // doesn't work without it though. Frpg2RequestMessage::RequestCreateGhostDataResponse Response; if (!Client->MessageStream->Send(&Response, &Message)) { WarningS(Client->GetName().c_str(), "Disconnecting client as failed to send RequestCreateGhostDataResponse response."); return MessageHandleResult::Error; } return MessageHandleResult::Handled; } MessageHandleResult GhostManager::Handle_RequestGetGhostDataList(GameClient* Client, const Frpg2ReliableUdpMessage& Message) { ServerDatabase& Database = ServerInstance->GetDatabase(); PlayerState& Player = Client->GetPlayerState(); Frpg2RequestMessage::RequestGetGhostDataList* Request = (Frpg2RequestMessage::RequestGetGhostDataList*)Message.Protobuf.get(); Frpg2RequestMessage::RequestGetGhostDataListResponse Response; uint32_t RemainingGhostCount = Request->max_ghosts(); // Grab a random set of stains from the live cache. for (int i = 0; i < Request->search_areas_size() && RemainingGhostCount > 0; i++) { const Frpg2RequestMessage::DomainLimitData& Area = Request->search_areas(i); OnlineAreaId AreaId = (OnlineAreaId)Area.online_area_id(); uint32_t MaxForArea = Area.max_items(); uint32_t GatherCount = std::min(MaxForArea, RemainingGhostCount); std::vector<std::shared_ptr<Ghost>> ActiveGhosts = LiveCache.GetRandomSet(AreaId, GatherCount); for (std::shared_ptr<Ghost>& AreaMsg : ActiveGhosts) { // Filter players own messages. if (AreaMsg->PlayerId == Player.PlayerId) { continue; } Frpg2RequestMessage::GhostData& Data = *Response.mutable_ghosts()->Add(); Data.set_unknown_1(1); // TODO: Figure out what this is. Data.set_ghost_id((uint32_t)AreaMsg->GhostId); Data.set_data(AreaMsg->Data.data(), AreaMsg->Data.size()); RemainingGhostCount--; } } if (!Client->MessageStream->Send(&Response, &Message)) { WarningS(Client->GetName().c_str(), "Disconnecting client as failed to send RequestGetGhostDataListResponse response."); return MessageHandleResult::Error; } return MessageHandleResult::Handled; } std::string GhostManager::GetName() { return "Ghosts"; }
36.164634
146
0.706458
[ "vector" ]
ecb436be189cf8b870e1a56b150a81409b771f11
44,026
cpp
C++
plugin/AL_USDMayaTestPlugin/AL/usdmaya/nodes/test_ProxyShape.cpp
AlexSchwank/AL_USDMaya
99413e2c5d1c93e4c58a63ebc8b07e23cf072e86
[ "Apache-2.0" ]
null
null
null
plugin/AL_USDMayaTestPlugin/AL/usdmaya/nodes/test_ProxyShape.cpp
AlexSchwank/AL_USDMaya
99413e2c5d1c93e4c58a63ebc8b07e23cf072e86
[ "Apache-2.0" ]
null
null
null
plugin/AL_USDMayaTestPlugin/AL/usdmaya/nodes/test_ProxyShape.cpp
AlexSchwank/AL_USDMaya
99413e2c5d1c93e4c58a63ebc8b07e23cf072e86
[ "Apache-2.0" ]
null
null
null
// // Copyright 2017 Animal Logic // // 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 "test_usdmaya.h" #include "AL/usdmaya/nodes/ProxyShape.h" #include "AL/usdmaya/nodes/Transform.h" #include "AL/usdmaya/nodes/LayerManager.h" #include "AL/usdmaya/StageCache.h" #include "AL/usdmaya/fileio/translators/TranslatorContext.h" #include "maya/MFnTransform.h" #include "maya/MSelectionList.h" #include "maya/MGlobal.h" #include "maya/MItDependencyNodes.h" #include "maya/MDagModifier.h" #include "maya/MFileIO.h" #include "maya/MStringArray.h" #include "maya/MCommonSystemUtils.h" #include "pxr/usd/sdf/types.h" #include "pxr/usd/usd/attribute.h" #include "pxr/usd/usd/stage.h" #include "pxr/usd/usd/usdaFileFormat.h" #include "pxr/usd/usdGeom/xform.h" #include "pxr/usd/usdGeom/xformCommonAPI.h" #include <iostream> #include <fstream> // UsdStageRefPtr ProxyShape::getUsdStage() const; // UsdPrim ProxyShape::getRootPrim() TEST(ProxyShape, basicProxyShapeSetUp) { MFileIO::newFile(true); auto constructTransformChain = [] () { UsdStageRefPtr stage = UsdStage::CreateInMemory(); UsdGeomXform root = UsdGeomXform::Define(stage, SdfPath("/root")); UsdGeomXform leg1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1")); UsdGeomXform knee1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1")); UsdGeomXform ankle1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1")); UsdGeomXform rtoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/ltoe1")); UsdGeomXform ltoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/rtoe1")); UsdGeomXform leg2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2")); UsdGeomXform knee2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2")); UsdGeomXform ankle2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2")); UsdGeomXform rtoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/ltoe2")); UsdGeomXform ltoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/rtoe2")); return stage; }; const std::string temp_path = buildTempPath("AL_USDMayaTests_basicProxyShapeSetUp.usda"); const std::string temp_path2 = buildTempPath("AL_USDMayaTests_basicLayerSetUp.usda"); const MString temp_ma_path = buildTempPath("AL_USDMayaTests_basicProxyShapeSetUp.ma"); std::string sessionLayerContents; // generate some data for the proxy shape { auto stage = constructTransformChain(); stage->Export(temp_path, false); } MString shapeName; { MFnDagNode fn; MObject xform = fn.create("transform"); MObject shape = fn.create("AL_usdmaya_ProxyShape", xform); shapeName = fn.name(); AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load proxy->filePathPlug().setString(temp_path.c_str()); auto stage = proxy->getUsdStage(); // stage should be valid ASSERT_TRUE(stage); // should be composed of two layers SdfLayerHandle session = stage->GetSessionLayer(); SdfLayerHandle root = stage->GetRootLayer(); EXPECT_TRUE(session); EXPECT_TRUE(root); // make sure path is correct EXPECT_EQ(temp_path, root->GetRealPath()); // UsdPrim ProxyShape::getRootPrim() UsdPrim rootPrim = proxy->getRootPrim(); EXPECT_TRUE(rootPrim); EXPECT_TRUE(SdfPath("/") == rootPrim.GetPath()); stage->SetEditTarget(session); // lets grab a prim, and then modify it a bit (this should leave us with a modification in the session layer) UsdPrim rtoe1Prim = stage->GetPrimAtPath(SdfPath("/root/hip1/knee1/ankle1/ltoe1")); EXPECT_TRUE(rtoe1Prim); UsdGeomXform rtoe1Geom(rtoe1Prim); // add some scale value to the geom (we can hunt this down later UsdGeomXformOp scaleOp = rtoe1Geom.AddScaleOp(); GfVec3f scale(1.0f, 2.0f, 3.0f); scaleOp.Set<GfVec3f>(scale); std::vector<UsdGeomXformOp> ordered; ordered.push_back(scaleOp); rtoe1Geom.SetXformOpOrder(ordered); EXPECT_TRUE(session->ExportToString(&sessionLayerContents)); EXPECT_FALSE(sessionLayerContents.empty()); // save the maya file (the modifications we made to the session layer should be present when we reload) EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::saveAs(temp_ma_path)); // after saving, we should have a layerManager AL::usdmaya::nodes::LayerManager* layerManager = AL::usdmaya::nodes::LayerManager::findManager(); ASSERT_TRUE(layerManager); SdfLayerHandle refoundExpectedLayer = layerManager->findLayer(session->GetIdentifier()); EXPECT_TRUE(session->IsDirty()); EXPECT_TRUE(refoundExpectedLayer); EXPECT_EQ(refoundExpectedLayer, session); // Because root layer isn't dirty, don't expect it to be saved out EXPECT_FALSE(root->IsDirty()); refoundExpectedLayer = layerManager->findLayer(root->GetIdentifier()); EXPECT_FALSE(refoundExpectedLayer); // please don't crash if I pass a NULL layer handle EXPECT_EQ(SdfLayerHandle(), layerManager->findLayer("")); { // please don't crash if I pass a valid layer, that isn't in any way involved in the composed stage SdfLayerRefPtr temp = SdfLayer::CreateNew(temp_path2); EXPECT_EQ(nullptr, layerManager->findLayer(temp->GetIdentifier())); } } // nuke everything EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::newFile(true)); // inspect the sdf layer cache to make sure that has been cleared! { UsdStageCache& layerCache = AL::usdmaya::StageCache::Get(); EXPECT_EQ(size_t(0), layerCache.Size()); } { UsdStageCache& layerCache = AL::usdmaya::StageCache::Get(); EXPECT_EQ(size_t(0), layerCache.Size()); } // Now re-open the file, and re-check everything to make sure it restored correctly EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::open(temp_ma_path, NULL, true)); { // find the proxy shape node in the scene MSelectionList sl; EXPECT_EQ(MStatus(MS::kSuccess), sl.add(shapeName)); MObject shape; EXPECT_EQ(MStatus(MS::kSuccess), sl.getDependNode(0, shape)); MStatus status; MFnDagNode fn(shape, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // grab ptr to proxy AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load EXPECT_EQ(MString(temp_path.c_str()), proxy->filePathPlug().asString()); auto stage = proxy->getUsdStage(); // stage should be valid ASSERT_TRUE(stage); // should be composed of two layers SdfLayerHandle session = stage->GetSessionLayer(); SdfLayerHandle root = stage->GetRootLayer(); EXPECT_TRUE(session); EXPECT_TRUE(root); // make sure path is correct EXPECT_EQ(temp_path, root->GetRealPath()); AL::usdmaya::nodes::LayerManager* layerManager = AL::usdmaya::nodes::LayerManager::findManager(); ASSERT_TRUE(layerManager); SdfLayerHandle refoundExpectedLayer = layerManager->findLayer(root->GetIdentifier()); // Root wasn't dirty, shouldn't have been saved out EXPECT_FALSE(refoundExpectedLayer); // UsdPrim ProxyShape::getRootPrim() UsdPrim rootPrim = proxy->getRootPrim(); EXPECT_TRUE(rootPrim); EXPECT_TRUE(SdfPath("/") == rootPrim.GetPath()); // lets grab a prim, and then modify it a bit (this should leave us with a modification in the session layer) UsdPrim rtoe1Prim = stage->GetPrimAtPath(SdfPath("/root/hip1/knee1/ankle1/ltoe1")); EXPECT_TRUE(rtoe1Prim); UsdGeomXform rtoe1Geom(rtoe1Prim); std::vector<UsdGeomXformOp> ordered; bool foo = 0; ordered = rtoe1Geom.GetOrderedXformOps(&foo); ASSERT_EQ(size_t(1), ordered.size()); // add some scale value to the geom (we can hunt this down later UsdGeomXformOp scaleOp = ordered[0]; GfVec3f scale2(1.0f, 2.0f, 3.0f); GfVec3f scale; scaleOp.Get<GfVec3f>(&scale); EXPECT_EQ(scale2, scale); std::string contents; EXPECT_TRUE(session->ExportToString(&contents)); EXPECT_FALSE(contents.empty()); EXPECT_EQ(contents, sessionLayerContents); } } // MObject makeUsdTransformChain( // const UsdPrim& usdPrim, // MDagModifier& modifier, // TransformReason reason, // MDGModifier* modifier2 = 0, // uint32_t* createCount = 0); // void removeUsdTransformChain( // const UsdPrim& usdPrim, // MDagModifier& modifier, // TransformReason reason); // inline bool isRequiredPath(const SdfPath& path) const; // inline MObject findRequiredPath(const SdfPath& path) const; TEST(ProxyShape, basicTransformChainOperations) { MFileIO::newFile(true); auto constructTransformChain = [] (std::vector<UsdGeomXform>& xforms) { GfVec3f scale(2.0f, 3.0f, 4.0f); UsdStageRefPtr stage = UsdStage::CreateInMemory(); UsdGeomXform root = UsdGeomXform::Define(stage, SdfPath("/root")); UsdGeomXform leg1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1")); UsdGeomXform knee1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1")); UsdGeomXform ankle1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1")); UsdGeomXform rtoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/ltoe1")); UsdGeomXform ltoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/rtoe1")); UsdGeomXform leg2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2")); UsdGeomXform knee2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2")); UsdGeomXform ankle2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2")); UsdGeomXform rtoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/ltoe2")); UsdGeomXform ltoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/rtoe2")); xforms.push_back(root); xforms.push_back(leg1); xforms.push_back(knee1); xforms.push_back(ankle1); xforms.push_back(rtoe1); xforms.push_back(ltoe1); xforms.push_back(leg2); xforms.push_back(knee2); xforms.push_back(ankle2); xforms.push_back(rtoe2); xforms.push_back(ltoe2); root.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; leg1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; knee1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ankle1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; rtoe1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ltoe1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; leg2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; knee2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ankle2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; rtoe2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ltoe2.AddScaleOp().Set<GfVec3f>(scale); return stage; }; const std::string temp_path = buildTempPath("AL_USDMayaTests_basicTransformChainOperations.usda"); std::vector<UsdGeomXform> xforms; std::string sessionLayerContents; // generate some data for the proxy shape { auto stage = constructTransformChain(xforms); stage->Export(temp_path, false); } MString shapeName; { MFnDagNode fn; MObject xform = fn.create("transform"); MObject shape = fn.create("AL_usdmaya_ProxyShape", xform); AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load proxy->filePathPlug().setString(temp_path.c_str()); auto stage = proxy->getUsdStage(); UsdPrim prim = stage->GetPrimAtPath(SdfPath("/root/hip1/knee1/ankle1/ltoe1")); // AL::usdmaya::nodes::ProxyShape::kSelection { MDagModifier modifier1; MDGModifier modifier2; uint32_t createCount = 0; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kSelection, &modifier2, &createCount); EXPECT_EQ(1, proxy->selectedPaths().size()); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); EXPECT_EQ(5U, createCount); const GfVec3f scales[] = { GfVec3f(2.4f, 3.8f, 5.2f), GfVec3f(2.3f, 3.6f, 4.9f), GfVec3f(2.2f, 3.4f, 4.6f), GfVec3f(2.1f, 3.2f, 4.3f), GfVec3f(2.0f, 3.0f, 4.0f) }; const MString paths[] = { MString("/root/hip1/knee1/ankle1/ltoe1"), MString("/root/hip1/knee1/ankle1"), MString("/root/hip1/knee1"), MString("/root/hip1"), MString("/root") }; { MFnTransform fnx(leafNode); for(int i = 0; i < 5; ++i) { // make sure we can read the scale value from the transform. It should *hopefully* match the values we set previously double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // these should report true EXPECT_TRUE(proxy->isRequiredPath(SdfPath(paths[i].asChar()))); EXPECT_TRUE(proxy->findRequiredPath(SdfPath(paths[i].asChar())) != MObject::kNullObj); // step up chain fnx.setObject(fnx.parent(0)); } } // request again to construct a transform chain (using the same selection mode). // A second chain should not be constructed (cannot select the same node more than once) MDagModifier modifier1b; MDGModifier modifier2b; createCount = 0; MObject leafNode2 = proxy->makeUsdTransformChain(prim, modifier1b, AL::usdmaya::nodes::ProxyShape::kSelection, &modifier2b, &createCount); EXPECT_EQ(1, proxy->selectedPaths().size()); // hopefully not much will happen this time! EXPECT_FALSE(leafNode2 == MObject::kNullObj); EXPECT_TRUE(leafNode == leafNode2); EXPECT_EQ(MStatus(MS::kSuccess), modifier1b.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2b.doIt()); EXPECT_EQ(0U, createCount); // no real reason to do this. It shouldn't have changed anything. { MFnTransform fnx(leafNode2); for(int i = 0; i < 5; ++i) { double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // step up chain fnx.setObject(fnx.parent(0)); } } // now lets' go and remove all of those transforms for fun! proxy->removeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kSelection); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(0, proxy->selectedPaths().size()); // having removed those chains, we shouldn't have any more transform nodes left { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } // AL::usdmaya::nodes::ProxyShape::kRequired { MDagModifier modifier1; MDGModifier modifier2; uint32_t createCount = 0; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequired, &modifier2, &createCount); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); EXPECT_EQ(5U, createCount); const GfVec3f scales[] = { GfVec3f(2.4f, 3.8f, 5.2f), GfVec3f(2.3f, 3.6f, 4.9f), GfVec3f(2.2f, 3.4f, 4.6f), GfVec3f(2.1f, 3.2f, 4.3f), GfVec3f(2.0f, 3.0f, 4.0f) }; const MString paths[] = { MString("/root/hip1/knee1/ankle1/ltoe1"), MString("/root/hip1/knee1/ankle1"), MString("/root/hip1/knee1"), MString("/root/hip1"), MString("/root") }; { MFnTransform fnx(leafNode); for(int i = 0; i < 5; ++i) { // make sure we can read the scale value from the transform. It should *hopefully* match the values we set previously double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // these should report true EXPECT_TRUE(proxy->isRequiredPath(SdfPath(paths[i].asChar()))); EXPECT_TRUE(proxy->findRequiredPath(SdfPath(paths[i].asChar())) == fnx.object()); // step up chain fnx.setObject(fnx.parent(0)); } } // request again to construct a transform chain (using the same selection mode). // Since the nodes already exist, then no new nodes should be created one would hope! MDagModifier modifier1b; MDGModifier modifier2b; createCount = 0; MObject leafNode2 = proxy->makeUsdTransformChain(prim, modifier1b, AL::usdmaya::nodes::ProxyShape::kRequired, &modifier2b, &createCount); // hopefully not much will happen this time! EXPECT_FALSE(leafNode2 == MObject::kNullObj); EXPECT_TRUE(leafNode == leafNode2); EXPECT_EQ(MStatus(MS::kSuccess), modifier1b.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2b.doIt()); EXPECT_EQ(0U, createCount); // no real reason to do this. It shouldn't have changed anything. { MFnTransform fnx(leafNode2); for(int i = 0; i < 5; ++i) { double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // step up chain fnx.setObject(fnx.parent(0)); } } // now lets' go and remove all of those transforms for fun! proxy->removeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequired); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); // having removed those chains, we shouldn't have any more transform nodes left { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_FALSE(it.isDone()); } // now lets' go and remove all of those transforms for fun! proxy->removeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequired); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); // having removed those chains, we shouldn't have any more transform nodes left { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } // AL::usdmaya::nodes::ProxyShape::kRequested { MDagModifier modifier1; MDGModifier modifier2; uint32_t createCount = 0; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequested, &modifier2, &createCount); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); EXPECT_EQ(5U, createCount); const GfVec3f scales[] = { GfVec3f(2.4f, 3.8f, 5.2f), GfVec3f(2.3f, 3.6f, 4.9f), GfVec3f(2.2f, 3.4f, 4.6f), GfVec3f(2.1f, 3.2f, 4.3f), GfVec3f(2.0f, 3.0f, 4.0f) }; const MString paths[] = { MString("/root/hip1/knee1/ankle1/ltoe1"), MString("/root/hip1/knee1/ankle1"), MString("/root/hip1/knee1"), MString("/root/hip1"), MString("/root") }; { MFnTransform fnx(leafNode); for(int i = 0; i < 5; ++i) { // make sure we can read the scale value from the transform. It should *hopefully* match the values we set previously double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // these should report false EXPECT_TRUE(proxy->isRequiredPath(SdfPath(paths[i].asChar()))); EXPECT_TRUE(proxy->findRequiredPath(SdfPath(paths[i].asChar())) != MObject::kNullObj); // step up chain fnx.setObject(fnx.parent(0)); } } // request again to construct a transform chain (using the same selection mode). // Since the nodes already exist, then no new nodes should be created one would hope! MDagModifier modifier1b; MDGModifier modifier2b; createCount = 0; MObject leafNode2 = proxy->makeUsdTransformChain(prim, modifier1b, AL::usdmaya::nodes::ProxyShape::kRequested, &modifier2b, &createCount); // hopefully not much will happen this time! EXPECT_FALSE(leafNode2 == MObject::kNullObj); EXPECT_TRUE(leafNode == leafNode2); EXPECT_EQ(MStatus(MS::kSuccess), modifier1b.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2b.doIt()); EXPECT_EQ(0U, createCount); // no real reason to do this. It shouldn't have changed anything. { MFnTransform fnx(leafNode2); for(int i = 0; i < 5; ++i) { double sc[3]; EXPECT_EQ(MStatus(MS::kSuccess), fnx.getScale(sc)); EXPECT_NEAR(scales[i][0], sc[0], 1e-5f); EXPECT_NEAR(scales[i][1], sc[1], 1e-5f); EXPECT_NEAR(scales[i][2], sc[2], 1e-5f); MStatus status; MPlug primPathPlug = fnx.findPlug("primPath", &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // make sure path is correct EXPECT_EQ(paths[i], primPathPlug.asString()); // step up chain fnx.setObject(fnx.parent(0)); } } // now lets' go and remove all of those transforms for fun! proxy->removeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequested); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); // This one is slightly different. The requested transforms are ref counted, so we *should* still have some plugin nodes { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_FALSE(it.isDone()); } // So here the second call should nuke the nodes MDagModifier modifier1d; proxy->removeUsdTransformChain(prim, modifier1d, AL::usdmaya::nodes::ProxyShape::kRequested); EXPECT_EQ(MStatus(MS::kSuccess), modifier1d.doIt()); { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } // Now lets see what happens when we mix and match TM types. // AL::usdmaya::nodes::ProxyShape::kRequired { MDagModifier modifier1; MDGModifier modifier2; uint32_t createCount = 0; // construct a chain of transform nodes EXPECT_EQ(0, proxy->selectedPaths().size()); MObject leafNode = proxy->makeUsdTransformChain(prim, modifier1, AL::usdmaya::nodes::ProxyShape::kSelection, &modifier2, &createCount); EXPECT_EQ(1, proxy->selectedPaths().size()); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); EXPECT_EQ(5U, createCount); // construct a chain of transform nodes UsdPrim kneeprim = stage->GetPrimAtPath(SdfPath("/root/hip1/knee1")); createCount = 0; MObject kneeNode = proxy->makeUsdTransformChain(kneeprim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequired, &modifier2, &createCount); EXPECT_EQ(1, proxy->selectedPaths().size()); // make sure we get some sane looking values. EXPECT_FALSE(kneeNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); EXPECT_EQ(0U, createCount); // now remove the selected transforms to the prim { { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_FALSE(it.isDone()); } MDagModifier modifier1b; proxy->removeUsdTransformChain(prim, modifier1b, AL::usdmaya::nodes::ProxyShape::kSelection); EXPECT_EQ(MStatus(MS::kSuccess), modifier1b.doIt()); EXPECT_EQ(0, proxy->selectedPaths().size()); // We should now only have 3 TM's left { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_FALSE(it.isDone()); uint32_t count = 0; while(!it.isDone()) { it.next(); count++; } EXPECT_EQ(3, count); } { // we should be able to attach to this transform MStatus status; MFnTransform fnx(kneeNode, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // and we *should* find it has zero children EXPECT_EQ(0, fnx.childCount()); } // now remove the last transforms MDagModifier modifier1c; proxy->removeUsdTransformChain(kneeprim, modifier1c, AL::usdmaya::nodes::ProxyShape::kRequired); EXPECT_EQ(MStatus(MS::kSuccess), modifier1c.doIt()); // should have removed all of the transforms { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } } } // void makeUsdTransforms( // const UsdPrim& usdPrim, // MDagModifier& modifier, // TransformReason reason, // MDGModifier* modifier2 = 0); // void removeUsdTransforms( // const UsdPrim& usdPrim, // MDagModifier& modifier, // TransformReason reason); // TEST(ProxyShape, basicTransformChainOperations2) { MFileIO::newFile(true); auto constructTransformChain = [] (std::vector<UsdGeomXform>& xforms) { GfVec3f scale(2.0f, 3.0f, 4.0f); UsdStageRefPtr stage = UsdStage::CreateInMemory(); UsdGeomXform root = UsdGeomXform::Define(stage, SdfPath("/root")); UsdGeomXform leg1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1")); UsdGeomXform knee1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1")); UsdGeomXform ankle1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1")); UsdGeomXform rtoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/ltoe1")); UsdGeomXform ltoe1 = UsdGeomXform::Define(stage, SdfPath("/root/hip1/knee1/ankle1/rtoe1")); UsdGeomXform leg2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2")); UsdGeomXform knee2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2")); UsdGeomXform ankle2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2")); UsdGeomXform rtoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/ltoe2")); UsdGeomXform ltoe2 = UsdGeomXform::Define(stage, SdfPath("/root/hip2/knee2/ankle2/rtoe2")); xforms.push_back(root); xforms.push_back(leg1); xforms.push_back(knee1); xforms.push_back(ankle1); xforms.push_back(rtoe1); xforms.push_back(ltoe1); xforms.push_back(leg2); xforms.push_back(knee2); xforms.push_back(ankle2); xforms.push_back(rtoe2); xforms.push_back(ltoe2); root.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; leg1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; knee1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ankle1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; rtoe1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ltoe1.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; leg2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; knee2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ankle2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; rtoe2.AddScaleOp().Set<GfVec3f>(scale); scale[0] += 0.1f; scale[1] += 0.2f; scale[2] += 0.3f; ltoe2.AddScaleOp().Set<GfVec3f>(scale); return stage; }; std::vector<UsdGeomXform> xforms; const std::string temp_path = buildTempPath("AL_USDMayaTests_basicTransformChainOperations2.usda"); std::string sessionLayerContents; // generate some data for the proxy shape { auto stage = constructTransformChain(xforms); stage->Export(temp_path, false); } MString shapeName; { MFnDagNode fn; MObject xform = fn.create("transform"); MObject shape = fn.create("AL_usdmaya_ProxyShape", xform); AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load proxy->filePathPlug().setString(temp_path.c_str()); auto stage = proxy->getUsdStage(); UsdPrim kneePrim = stage->GetPrimAtPath(SdfPath("/root/hip1/knee1")); // AL::usdmaya::nodes::ProxyShape::kSelection { MDagModifier modifier1; MDGModifier modifier2; MDagModifier modifier3; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransforms(kneePrim, modifier1, AL::usdmaya::nodes::ProxyShape::kSelection, &modifier2); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); { // we should be able to attach to this transform MStatus status; MFnTransform fnx(leafNode, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // we should have one child here (the ankle1) EXPECT_EQ(0, fnx.childCount()); } // construct a chain of transform nodes proxy->removeUsdTransforms(kneePrim, modifier3, AL::usdmaya::nodes::ProxyShape::kSelection); EXPECT_EQ(MStatus(MS::kSuccess), modifier3.doIt()); // should have removed all of the transforms { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } // AL::usdmaya::nodes::ProxyShape::kRequested { MDagModifier modifier1; MDGModifier modifier2; MDagModifier modifier3; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransforms(kneePrim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequested, &modifier2); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); { // we should be able to attach to this transform MStatus status; MFnTransform fnx(leafNode, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // we should have one child here (the ankle1) EXPECT_EQ(1, fnx.childCount()); MFnTransform fnAnkle(fnx.child(0), &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // we should have two children here (ltoe1, rtoe1) EXPECT_EQ(2, fnAnkle.childCount()); MFnTransform fnLToe(fnAnkle.child(0), &status); EXPECT_EQ(MStatus(MS::kSuccess), status); MFnTransform fnRToe(fnAnkle.child(1), &status); EXPECT_EQ(MStatus(MS::kSuccess), status); } // construct a chain of transform nodes proxy->removeUsdTransforms(kneePrim, modifier3, AL::usdmaya::nodes::ProxyShape::kRequested); EXPECT_EQ(MStatus(MS::kSuccess), modifier3.doIt()); // should have removed all of the transforms { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } // AL::usdmaya::nodes::ProxyShape::kRequired { MDagModifier modifier1; MDGModifier modifier2; MDagModifier modifier3; // construct a chain of transform nodes MObject leafNode = proxy->makeUsdTransforms(kneePrim, modifier1, AL::usdmaya::nodes::ProxyShape::kRequired, &modifier2); // make sure we get some sane looking values. EXPECT_FALSE(leafNode == MObject::kNullObj); EXPECT_EQ(MStatus(MS::kSuccess), modifier1.doIt()); EXPECT_EQ(MStatus(MS::kSuccess), modifier2.doIt()); { // we should be able to attach to this transform MStatus status; MFnTransform fnx(leafNode, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // we should have one child here (the ankle1) EXPECT_EQ(0, fnx.childCount()); } // construct a chain of transform nodes proxy->removeUsdTransforms(kneePrim, modifier3, AL::usdmaya::nodes::ProxyShape::kRequired); EXPECT_EQ(MStatus(MS::kSuccess), modifier3.doIt()); // should have removed all of the transforms { MItDependencyNodes it(MFn::kPluginTransformNode); EXPECT_TRUE(it.isDone()); } } } } // Make sure that if we make a brand new layer, make it the edit target, then // change it away, then save, the layer is saved TEST(ProxyShape, editTargetChangeAndSave) { const MString mayaAsciiPath = buildTempPath("AL_USDMayaTests_editTargetChangeAndSave.ma"); const std::string temp_path = buildTempPath("AL_USDMayaTests_ProxyShape_editTargetChangeAndSave.usda"); const SdfPath dirtiestPrimPath = SdfPath("/world/dirtiestPrim"); MFileIO::newFile(true); auto constructTransformChain = [] () { UsdStageRefPtr stage = UsdStage::CreateInMemory(); UsdGeomXform root = UsdGeomXform::Define(stage, SdfPath("/world")); return stage; }; // generate some data for the proxy shape { auto stage = constructTransformChain(); stage->Export(temp_path, false); } MString shapeName; { MFnDagNode fn; MObject xform = fn.create("transform"); MObject shape = fn.create("AL_usdmaya_ProxyShape", xform); shapeName = fn.name(); AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load proxy->filePathPlug().setString(temp_path.c_str()); auto stage = proxy->getUsdStage(); auto newLayer = SdfLayer::New(SdfFileFormat::FindById(UsdUsdaFileFormatTokens->Id), "/tmp/AL_USDMayaTests_fresh_layer.usda"); stage->GetSessionLayer()->InsertSubLayerPath(newLayer->GetIdentifier()); // At the time newLayer is made the edit target, it shouldn't be dirty! stage->SetEditTarget(newLayer); // Now make edits to the stage, which should go to newLayer, making it dirty... stage->DefinePrim(dirtiestPrimPath); // Now change edit target away again stage->SetEditTarget(stage->GetRootLayer()); // save the maya file EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::saveAs(mayaAsciiPath)); } { // reopen - the stage should have the world's dirtiest prim! EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::open(mayaAsciiPath, NULL, true)); MSelectionList sl; EXPECT_EQ(MStatus(MS::kSuccess), sl.add(shapeName)); MObject shape; EXPECT_EQ(MStatus(MS::kSuccess), sl.getDependNode(0, shape)); MStatus status; MFnDagNode fn(shape, &status); EXPECT_EQ(MStatus(MS::kSuccess), status); // grab ptr to proxy AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load EXPECT_EQ(MString(temp_path.c_str()), proxy->filePathPlug().asString()); auto stage = proxy->getUsdStage(); // stage should be valid ASSERT_TRUE(stage); // world's dirtiest prim should exist! auto dirtyPrim = stage->GetPrimAtPath(dirtiestPrimPath); ASSERT_TRUE(dirtyPrim.IsValid()); } } // Test translating a Mesh Prim via the command TEST(ManualTranslate, importMeshPrim) { AL::usdmaya::nodes::ProxyShape* proxyShape = SetupProxyShapeWithMesh(); AL::usdmaya::fileio::translators::TranslatorParameters param; param.setForcePrimImport(true); SdfPathVector importPaths; SdfPath meshPath("/pSphere1"); importPaths.push_back(meshPath); proxyShape->translatePrimPathsIntoMaya(importPaths, SdfPathVector(), param); // Select the shape, if it's there, it worked MObjectHandle translatedObject; MStatus s = MGlobal::selectByName("pSphere1Shape"); ASSERT_TRUE( s.statusCode() == MStatus::kSuccess); } //// Test translating a Mesh Prim via the command TEST(ManualTranslate, roundtripMeshPrim) { AL::usdmaya::nodes::ProxyShape* proxyShape = SetupProxyShapeWithMesh(); SdfPath meshPath("/pSphere1"); AL::usdmaya::fileio::translators::TranslatorParameters tp; tp.setForcePrimImport(true); // Import Mesh, test that it actually got imported SdfPathVector importPaths; importPaths.push_back(meshPath); proxyShape->translatePrimPathsIntoMaya(importPaths, SdfPathVector(), tp); MStatus s = MGlobal::selectByName("pSphere1Shape"); ASSERT_TRUE(s.statusCode() == MStatus::kSuccess); // Tear down Mesh SdfPathVector teardownPaths; teardownPaths.push_back(meshPath); proxyShape->translatePrimPathsIntoMaya(SdfPathVector(), teardownPaths, tp); s = MGlobal::selectByName("pSphere1Shape"); ASSERT_FALSE(s.statusCode() == MStatus::kSuccess); // Import Mesh, test that it actually got imported proxyShape->translatePrimPathsIntoMaya(importPaths, SdfPathVector(), tp); s = MGlobal::selectByName("pSphere1Shape"); ASSERT_TRUE(s.statusCode() == MStatus::kSuccess); } // void destroyTransformReferences() TEST(ProxyShape, destroyTransformReferences) { AL_USDMAYA_UNTESTED; } // MBoundingBox boundingBox() const override; TEST(ProxyShape, boundingBox) { AL_USDMAYA_UNTESTED; } // std::vector<UsdPrim> huntForNativeNodesUnderPrim(const MDagPath& proxyTransformPath, SdfPath startPath); TEST(ProxyShape, huntForNativeNodesUnderPrim) { AL_USDMAYA_UNTESTED; } // void createSelectionChangedCallback(); // void destroySelectionChangedCallback(); TEST(ProxyShape, createSelectionChangedCallback) { AL_USDMAYA_UNTESTED; } // void unloadMayaReferences(); TEST(ProxyShape, unloadMayaReferences) { AL_USDMAYA_UNTESTED; } // void serialiseTranslatorContext(); // void deserialiseTranslatorContext(); TEST(ProxyShape, serialiseTranslatorContext) { AL_USDMAYA_UNTESTED; } // SdfPathVector& selectedPaths() TEST(ProxyShape, selectedPaths) { AL_USDMAYA_UNTESTED; } // void findExcludedGeometry(); TEST(ProxyShape, findExcludedGeometry) { AL_USDMAYA_UNTESTED; } namespace { bool prepareBootstrapUSDA(MString &dirString, MString &bootstrapFullPath) { dirString = buildTempPath("usdMayaEmptyScene"); MStatus stats = MCommonSystemUtils::makeDirectory(dirString); if(!stats) return false; constexpr char content[] = "#usda 1.0"; bootstrapFullPath = (dirString + AL_PATH_CHAR "bootstrap.usda"); std::ofstream fileObj; fileObj.open(bootstrapFullPath.asChar(), std::ios::out); if (fileObj.is_open()) { fileObj << content; fileObj.close(); return true; } else { return false; } } void checkStageAndRootLayer(UsdStageRefPtr stage, const MString &expectedPath) { ASSERT_TRUE(stage); SdfLayerHandle root = stage->GetRootLayer(); EXPECT_TRUE(root); // make sure path is correct EXPECT_EQ(root->GetRealPath(), expectedPath.asChar()); } } // void resolveRelativePathWithinMayaContext(); TEST(ProxyShape, relativePathSupport) { MString tempDirString, bootstrapFullPath; EXPECT_TRUE(prepareBootstrapUSDA(tempDirString, bootstrapFullPath)); // Test the relative USD bootstrap file path support: MFileIO::newFile(true); MStatus status; MFnDagNode fn; MObject xform = fn.create("transform"); MObject shape = fn.create("AL_usdmaya_ProxyShape", xform); // Test it right away: AL::usdmaya::nodes::ProxyShape* proxy = (AL::usdmaya::nodes::ProxyShape*)fn.userNode(); // force the stage to load proxy->filePathPlug().setString("." AL_PATH_CHAR "bootstrap.usda"); // Before testing we need to save the maya scene first, since the relative path is resolved // primarily with current maya scene directory. MString mayaFileName = tempDirString + (AL_PATH_CHAR "emptyscene.ma"); EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::saveAs(mayaFileName, NULL, true)); // Now, reopen maya scene and test again: MFileIO::newFile(true); MFileIO::open(mayaFileName, NULL, true); UsdStageCache &cache = AL::usdmaya::StageCache::Get(); std::vector<UsdStageRefPtr> stages = cache.GetAllStages(); EXPECT_TRUE(!stages.empty()); auto stage = stages[0]; checkStageAndRootLayer(stage, bootstrapFullPath); // If the proxy shape is not referenced, the relative file path will be resolved using the referenced // maya scene directory: MFileIO::newFile(true); EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::reference(mayaFileName, false, false, "ref")); const MString outerFileName = buildTempPath("AL_USDMayaTests_usdMayaTestRefEmptyScene.ma"); EXPECT_EQ(MStatus(MS::kSuccess), MFileIO::saveAs(outerFileName, NULL, true)); // Now, reopen maya scene and test again: MFileIO::newFile(true); MFileIO::open(outerFileName, NULL, true); cache = AL::usdmaya::StageCache::Get(); stages = cache.GetAllStages(); EXPECT_TRUE(!stages.empty()); stage = stages[0]; checkStageAndRootLayer(stage, bootstrapFullPath); } // // funcs that aren't easily testable: // // bool getRenderAttris(void* attribs, const MHWRender::MFrameContext& frameContext, const MDagPath& dagPath); // void printRefCounts() const; // void constructGLImagingEngine(); // inline UsdImagingGLHdEngine* engine() const // nodes::SchemaNodeRefDB& schemaDB()
35.447665
144
0.670558
[ "mesh", "object", "shape", "vector", "transform" ]
ecb55663635d6d3b1d7285d20c23e10eb61bebd4
5,705
cpp
C++
cpp_project/vs-project/log_server/log_server/Sources/Network/Windows/tcp_socket.cpp
sinomiko/project
00fadb0033645f103692f5b06c861939a9d4aa0e
[ "BSD-3-Clause" ]
1
2018-12-30T14:07:42.000Z
2018-12-30T14:07:42.000Z
cpp_project/vs-project/log_server/log_server/Sources/Network/Windows/tcp_socket.cpp
sinomiko/project
00fadb0033645f103692f5b06c861939a9d4aa0e
[ "BSD-3-Clause" ]
null
null
null
cpp_project/vs-project/log_server/log_server/Sources/Network/Windows/tcp_socket.cpp
sinomiko/project
00fadb0033645f103692f5b06c861939a9d4aa0e
[ "BSD-3-Clause" ]
null
null
null
#include <cstring> #include <Winsock2.h> #include <Ws2tcpip.h> #include "Include/Utils/error.h" #include "Include/Utils/logger.h" #include "Include/Utils/typedefs.h" #include "Include/Network/tcp_socket.h" //! //! ctor & dtor //! tcp_socket::tcp_socket(void) : m_fd(__MC_INVALID_FD) , m_host("") , m_port(0) , m_type(type::UNKNOWN) { __MC_LOG(debug, "create tcp_socket"); } //! //! custom ctor //! build socket from existing file descriptor //! tcp_socket::tcp_socket(fd_t fd, const std::string& host, std::uint32_t port, type t) : m_fd(fd) , m_host(host) , m_port(port) , m_type(t) { __MC_LOG(debug, "create tcp_socket"); } //! //! Move constructor //! tcp_socket::tcp_socket(tcp_socket&& socket) : m_fd(std::move(socket.m_fd)) , m_host(socket.m_host) , m_port(socket.m_port) , m_type(socket.m_type) { socket.m_fd = __MC_INVALID_FD; socket.m_type = type::UNKNOWN; __MC_LOG(debug, "moved tcp_socket"); } //! //! client socket operations //! std::vector<char> tcp_socket::recv(std::size_t size_to_read) { create_socket_if_necessary(); check_or_set_type(type::CLIENT); std::vector<char> data(size_to_read, 0); ssize_t rd_size = ::recv(m_fd, const_cast<char*>(data.data()), size_to_read, 0); if (rd_size == SOCKET_ERROR) { __MC_THROW(error, "recv() failure"); } if (rd_size == 0) { __MC_THROW(warn, "nothing to read, socket has been closed by remote host"); } data.resize(rd_size); return data; } std::size_t tcp_socket::send(const std::vector<char>& data, std::size_t size_to_write) { create_socket_if_necessary(); check_or_set_type(type::CLIENT); ssize_t wr_size = ::send(m_fd, data.data(), size_to_write, 0); if (wr_size == SOCKET_ERROR) { __MC_THROW(error, "send() failure"); } return wr_size; } void tcp_socket::connect(const std::string& host, std::uint32_t port) { create_socket_if_necessary(); check_or_set_type(type::CLIENT); struct addrinfo* result = nullptr; struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_socktype = SOCK_STREAM; hints.ai_family = AF_INET; if (getaddrinfo(host.c_str(), nullptr, &hints, &result) != 0) { __MC_THROW(error, "getaddrinfo() failure"); } struct sockaddr_in server_addr; std::memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_addr = ((struct sockaddr_in*) (result->ai_addr))->sin_addr; server_addr.sin_port = htons(port); server_addr.sin_family = AF_INET; freeaddrinfo(result); if (::connect(m_fd, (const struct sockaddr*) &server_addr, sizeof(server_addr)) == -1) { __MC_THROW(error, "connect() failure"); } } //! //! server socket operations //! void tcp_socket::bind(const std::string& host, std::uint32_t port) { create_socket_if_necessary(); check_or_set_type(type::SERVER); struct addrinfo* result = nullptr; if (getaddrinfo(host.c_str(), nullptr, nullptr, &result) != 0) { __MC_THROW(error, "getaddrinfo() failure"); } struct sockaddr_in server_addr; std::memset(&server_addr, 0, sizeof(server_addr)); server_addr.sin_addr = ((struct sockaddr_in*) (result->ai_addr))->sin_addr; server_addr.sin_port = htons(port); server_addr.sin_family = AF_INET; freeaddrinfo(result); if (::bind(m_fd, (const struct sockaddr*) &server_addr, sizeof(server_addr)) == SOCKET_ERROR) { __MC_THROW(error, "bind() failure"); } } void tcp_socket::listen(std::size_t max_connection_queue) { create_socket_if_necessary(); check_or_set_type(type::SERVER); if (::listen(m_fd, max_connection_queue) == SOCKET_ERROR) { __MC_THROW(debug, "listen() failure"); } } tcp_socket tcp_socket::accept(void) { create_socket_if_necessary(); check_or_set_type(type::SERVER); struct sockaddr_in client_info; socklen_t client_info_struct_size = sizeof(client_info); fd_t client_fd = ::accept(m_fd, (struct sockaddr*) &client_info, &client_info_struct_size); if (client_fd == __MC_INVALID_FD) { __MC_THROW(error, "accept() failure"); } return{ client_fd, inet_ntoa(client_info.sin_addr), client_info.sin_port, type::CLIENT }; } //! //! general socket operations //! void tcp_socket::close(void) { if (m_fd != __MC_INVALID_FD) { __MC_LOG(debug, "close socket"); closesocket(m_fd); } m_fd = __MC_INVALID_FD; m_type = type::UNKNOWN; } //! //! create a new socket if no socket has been initialized yet //! void tcp_socket::create_socket_if_necessary(void) { if (m_fd != __MC_INVALID_FD) { return; } //! new TCP socket m_fd = socket(AF_INET, SOCK_STREAM, 0); m_type = type::UNKNOWN; if (m_fd == __MC_INVALID_FD) { __MC_THROW(error, "tcp_socket::create_socket_if_necessary: socket() failure"); } } //! //! check whether the current socket has an approriate type for that kind of operation //! if current type is UNKNOWN, update internal type with given type //! void tcp_socket::check_or_set_type(type t) { if (m_type != type::UNKNOWN && m_type != t) { __MC_THROW(error, "trying to perform invalid operation on socket"); } m_type = t; } //! //! get socket name information //! const std::string& tcp_socket::get_host(void) const { return m_host; } std::uint32_t tcp_socket::get_port(void) const { return m_port; } //! //! get socket type //! tcp_socket::type tcp_socket::get_type(void) const { return m_type; } //! //! set type, should be used if some operations determining socket type //! have been done on the behalf of the tcp_socket instance //! void tcp_socket::set_type(type t) { m_type = t; } //! //! direct access to the underlying fd //! fd_t tcp_socket::get_fd(void) const { return m_fd; } //! //! comparison operator //! bool tcp_socket::operator==(const tcp_socket& rhs) const { return m_fd == rhs.m_fd && m_type == rhs.m_type; } bool tcp_socket::operator!=(const tcp_socket& rhs) const { return !operator==(rhs); }
22.549407
135
0.711131
[ "vector" ]
ecb787ca2b2276799903cb277461c0c149f5ddfd
3,826
hpp
C++
Software/Plotting/include/Plotting/PlotterTaskNode.hpp
implementedrobotics/Nomad
de8c27ed79cdcde59b1fd6e9a0865d29b84b7d58
[ "MIT" ]
31
2019-08-11T18:24:54.000Z
2022-03-08T01:22:55.000Z
Software/Plotting/include/Plotting/PlotterTaskNode.hpp
implementedrobotics/Nomad
de8c27ed79cdcde59b1fd6e9a0865d29b84b7d58
[ "MIT" ]
15
2019-05-29T12:57:20.000Z
2020-09-29T02:26:06.000Z
Software/Plotting/include/Plotting/PlotterTaskNode.hpp
implementedrobotics/Nomad
de8c27ed79cdcde59b1fd6e9a0865d29b84b7d58
[ "MIT" ]
11
2019-08-12T03:05:06.000Z
2022-01-09T05:34:16.000Z
/* * PlotterTaskNode.hpp * * Created on: July 17, 2019 * Author: Quincy Jones * * Copyright (c) <2019> <Quincy Jones - quincy@implementedrobotics.com/> * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software * is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef NOMAD_PLOTTING_PLOTTERTASKNODE_H_ #define NOMAD_PLOTTING_PLOTTERTASKNODE_H_ // C System Files #include <stdint.h> // C++ System Files #include <iostream> #include <string> #include <vector> // Third Party Includes #include <Eigen/Dense> // Project Includes #include <Communications/Messages/double_vec_t.hpp> #include <Realtime/RealTimeTask.hpp> // TODO: Some of this functionality shoud be in a "Logger" node. The logger would then connect to the plotter. namespace Plotting { class PlotterTaskNode : public Realtime::RealTimeTaskNode { public: enum InputPort { PORT_1 = 0, // Input Port 1 PORT_2 = 1, // Input Port 2 PORT_3 = 2, // Input Port 3 PORT_4 = 3, // Input Port 4 PORT_5 = 4, // Input Port 5 PORT_6 = 5, // Input Port 6 PORT_7 = 6, // Input Port 7 PORT_8 = 7, // Input Port 8 MAX_PORTS }; // Base Class Convex Model Predictive Controller Locomotion Task Node // name = Task Name // N = Trajectory Steps // T = Trajectory Time Window PlotterTaskNode(const std::string &name); // TODO: Set plot params on the port // i.e. Plot style, Plot Names, Port Axis Names, etc. void RenderPlot(); // Plot the acquired data void DumpCSV(const std::string &file); // Save a .csv file of the logged data // Connect Input to Port Output void ConnectInput(InputPort port_id, std::shared_ptr<Communications::PortInterface> port); // Add a signal variable to plot // TODO: Which subplot is this going on, etc. void AddPlotVariable(InputPort port_id, int signal_idx); protected: // Overriden Run Function virtual void Run(); // Pre-Run Setup Routine. Setup any one time initialization here. virtual void Setup(); // Plot Variable List std::vector<int> plot_vars_[MAX_PORTS]; // Plot Data List (Doubles Only For Now) std::vector<Eigen::VectorXd> plot_data_[MAX_PORTS]; // Hold time points std::vector<double> time_data_[MAX_PORTS]; // Messages double_vec_t port_message_; // Buffer Size uint64_t sample_window_; // Add Subplots/Scopes // TODO: Type: // Realtime/Window/Trigger Event // TODO: Additional Types // Cached // TODO: Axis Properties Class (Color, style, Name, Blah) }; } // namespace Plotting #endif // NOMAD_PLOTTING_PLOTTERTASKNODE_H_
33.269565
111
0.662833
[ "vector", "model" ]
ecb8619ff7af693186a015cfc3f89359dbbbac4e
6,023
cpp
C++
src/main.cpp
SolveigMultimedia/smm_avi_splitter
54a231e607418f6a87bf340e5814d850db8be357
[ "MIT" ]
1
2015-11-13T04:28:41.000Z
2015-11-13T04:28:41.000Z
src/main.cpp
SolveigMultimedia/smm_avi_splitter
54a231e607418f6a87bf340e5814d850db8be357
[ "MIT" ]
null
null
null
src/main.cpp
SolveigMultimedia/smm_avi_splitter
54a231e607418f6a87bf340e5814d850db8be357
[ "MIT" ]
null
null
null
/* Copyright (c) 2015 Solveig Multimedia www.solveigmm.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* DllMain - entry point. DllRegisterServer/DllUnRegisterServer. Factory template for the filter. */ #include "stdafx.h" #include "proppages.h" #include "strsafe.h" #include "avisplitter.h" //declare the factory template for filter CFactoryTemplate g_Templates[] = { // one entry for each CoCreate-able object { CAVISplitter::m_sudFilter.strName,// Name. CAVISplitter::m_sudFilter.clsID,// CLSID. CAVISplitter::CreateInstance,// Creation function. NULL, &CAVISplitter::m_sudFilter// Pointer to filter information. }, { L"AVI Splitter about page", (const CLSID*)&__uuidof(CAboutPropPage), CAboutPropPage::CreateInstance, NULL, &CAVISplitter::m_sudFilter// Pointer to filter information. }, { L"AVI Splitter property page", (const CLSID*)&__uuidof(CPropertyPropPage), CPropertyPropPage::CreateInstance, NULL, &CAVISplitter::m_sudFilter// Pointer to filter information. } }; int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); // DLL entry point for initialization of directshow base classes extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID); BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved) { BOOL ret = DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason, lpReserved); #ifdef DEBUG if (dwReason == DLL_PROCESS_ATTACH) { } else if (dwReason == DLL_PROCESS_DETACH ) { // test leak _CrtDumpMemoryLeaks(); } #endif return ret; } bool SetRegKeyValue(LPCTSTR pszKey, LPCTSTR pszSubkey, LPCTSTR pszValueName, LPCTSTR pszValue) { bool bOK = false; TCHAR szKey[MAX_PATH]; StringCbCopy(szKey, MAX_PATH, pszKey); if(pszSubkey != 0) { StringCbCat(szKey,MAX_PATH,_T("\\")); StringCbCat(szKey,MAX_PATH,pszSubkey); } HKEY hKey; LONG ec = ::RegCreateKeyEx(HKEY_CLASSES_ROOT, szKey, 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, 0); if(ec == ERROR_SUCCESS) { if(pszValue != 0) { ec = ::RegSetValueEx(hKey, pszValueName, 0, REG_SZ, reinterpret_cast<BYTE*>(const_cast<LPTSTR>(pszValue)), (_tcslen(pszValue) + 1) * sizeof(TCHAR)); } bOK = (ec == ERROR_SUCCESS); ::RegCloseKey(hKey); } return bOK; } bool DeleteRegKey(LPCTSTR pszKey, LPCTSTR pszSubkey) { bool bOK = false; HKEY hKey; LONG ec = ::RegOpenKeyEx(HKEY_CLASSES_ROOT, pszKey, 0, KEY_ALL_ACCESS, &hKey); if(ec == ERROR_SUCCESS) { if(pszSubkey != 0) ec = ::RegDeleteKey(hKey, pszSubkey); bOK = (ec == ERROR_SUCCESS); ::RegCloseKey(hKey); } return bOK; } void RegisterSourceFilter(const CLSID& clsid, const GUID& subtype2, LPCTSTR chkbytes, LPCTSTR ext, ...) { TCHAR null[MAX_PATH]; memset(null, 0, sizeof(null)); StringFromGUID2(GUID_NULL, null, MAX_PATH); TCHAR majortype[MAX_PATH]; memset(majortype, 0, sizeof(majortype)); StringFromGUID2(MEDIATYPE_Stream, majortype, MAX_PATH); TCHAR subtype[MAX_PATH]; memset(subtype, 0, sizeof(subtype)); StringFromGUID2(subtype2, subtype, MAX_PATH); TCHAR clsidstr[MAX_PATH]; memset(clsidstr, 0, sizeof(clsidstr)); StringFromGUID2(clsid, clsidstr, MAX_PATH); TCHAR keyPath[MAX_PATH]; memset(keyPath, 0, sizeof(keyPath)); StringCbCat(keyPath,MAX_PATH,_T("Media Type\\")); StringCbCat(keyPath,MAX_PATH,majortype); SetRegKeyValue(keyPath, subtype, _T("0"), chkbytes); SetRegKeyValue(keyPath, subtype, _T("Source Filter"), clsidstr); memset(keyPath, 0, sizeof(keyPath)); StringCbCat(keyPath,MAX_PATH,_T("Media Type\\")); StringCbCat(keyPath,MAX_PATH,null); DeleteRegKey(keyPath, subtype); va_list marker; va_start(marker, ext); for(; ext; ext = va_arg(marker, LPCTSTR)) DeleteRegKey(_T("Media Type\\Extensions"), ext); va_end(marker); } void UnRegisterSourceFilter(const GUID& subtype2) { TCHAR majortype[MAX_PATH]; memset(majortype, 0, sizeof(majortype)); StringFromGUID2(MEDIATYPE_Stream, majortype, MAX_PATH); TCHAR subtype[MAX_PATH]; memset(subtype, 0, sizeof(subtype)); StringFromGUID2(subtype2, subtype, MAX_PATH); TCHAR keyPath[MAX_PATH]; memset(keyPath, 0, sizeof(keyPath)); StringCbCat(keyPath,MAX_PATH,_T("Media Type\\")); StringCbCat(keyPath,MAX_PATH,majortype); DeleteRegKey(keyPath, subtype); } // self-registration entrypoint STDAPI DllRegisterServer() { // Teach file source to understand avi format //RegisterSourceFilter(CLSID_AsyncReader, MEDIASUBTYPE_Avi, _T("0,4,,52494646"), _T(".avi"), NULL); // base classes will handle registration using the factory template table HRESULT hr = AMovieDllRegisterServer2(true); return hr; } STDAPI DllUnregisterServer() { //UnRegisterSourceFilter(MEDIASUBTYPE_Avi); // base classes will handle de-registration using the factory template table HRESULT hr = AMovieDllRegisterServer2(false); return hr; }
28.818182
115
0.719077
[ "object" ]
ecb8d2dc850ebeb1009b3bca34311a30f4f7cc3a
3,388
cpp
C++
folly/executors/test/ThreadedExecutorTest.cpp
lucyge/folly
d107498e71ab32e103c4fa7ca58ccc32990208b8
[ "Apache-2.0" ]
null
null
null
folly/executors/test/ThreadedExecutorTest.cpp
lucyge/folly
d107498e71ab32e103c4fa7ca58ccc32990208b8
[ "Apache-2.0" ]
3
2016-07-19T00:19:58.000Z
2019-07-19T23:33:10.000Z
folly/executors/test/ThreadedExecutorTest.cpp
cedexis/folly
284a4bf64203f8cc81918e0a91d726d45b3ee2ed
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <folly/executors/ThreadedExecutor.h> #include <folly/Conv.h> #include <folly/futures/Future.h> #include <folly/gen/Base.h> #include <folly/portability/GTest.h> namespace { class ThreadedExecutorTest : public testing::Test {}; } // namespace TEST_F(ThreadedExecutorTest, example) { folly::ThreadedExecutor x; auto ret = folly::via(&x) .then([&] { return 42; }) .then([&](int n) { return folly::to<std::string>(n); }) .get(); EXPECT_EQ("42", ret); } TEST_F(ThreadedExecutorTest, dtor_waits) { constexpr auto kDelay = std::chrono::milliseconds(100); auto x = std::make_unique<folly::ThreadedExecutor>(); auto fut = folly::via(&*x, [&] { /* sleep override */ std::this_thread::sleep_for(kDelay); }); x = nullptr; EXPECT_TRUE(fut.isReady()); } TEST_F(ThreadedExecutorTest, many) { constexpr auto kNumTasks = 1024; folly::ThreadedExecutor x; auto rets = folly::collect( folly::gen::range<size_t>(0, kNumTasks) | folly::gen::map([&](size_t i) { return folly::via(&x).then([=] { return i; }).then([](size_t k) { return folly::to<std::string>(k); }); }) | folly::gen::as<std::vector>()) .get(); EXPECT_EQ("42", rets[42]); } TEST_F(ThreadedExecutorTest, many_sleeping_constant_time) { constexpr auto kNumTasks = 256; constexpr auto kDelay = std::chrono::milliseconds(100); folly::ThreadedExecutor x; auto rets = folly::collect( folly::gen::range<size_t>(0, kNumTasks) | folly::gen::map([&](size_t i) { return folly::via(&x) .then([=] { /* sleep override */ std::this_thread::sleep_for(kDelay); }) .then([=] { return i; }) .then([](size_t k) { return folly::to<std::string>(k); }); }) | folly::gen::as<std::vector>()) .get(); EXPECT_EQ("42", rets[42]); } TEST_F(ThreadedExecutorTest, many_sleeping_decreasing_time) { constexpr auto kNumTasks = 256; constexpr auto kDelay = std::chrono::milliseconds(100); folly::ThreadedExecutor x; auto rets = folly::collect( folly::gen::range<size_t>(0, kNumTasks) | folly::gen::map([&](size_t i) { return folly::via(&x) .then([=] { auto delay = kDelay * (kNumTasks - i) / kNumTasks; /* sleep override */ std::this_thread::sleep_for(delay); }) .then([=] { return i; }) .then([](size_t k) { return folly::to<std::string>(k); }); }) | folly::gen::as<std::vector>()) .get(); EXPECT_EQ("42", rets[42]); }
31.082569
77
0.577332
[ "vector" ]
ecbb7a0c1f8c818c78a60ee211315eae632b8fc3
26,552
hpp
C++
src/helics/core/CommonCore.hpp
bmkelley/HELICS
742383907e5ad8af25a97d17a60985976af7c2e1
[ "BSD-3-Clause" ]
null
null
null
src/helics/core/CommonCore.hpp
bmkelley/HELICS
742383907e5ad8af25a97d17a60985976af7c2e1
[ "BSD-3-Clause" ]
null
null
null
src/helics/core/CommonCore.hpp
bmkelley/HELICS
742383907e5ad8af25a97d17a60985976af7c2e1
[ "BSD-3-Clause" ]
null
null
null
/* Copyright (c) 2017-2020, Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See the top-level NOTICE for additional details. All rights reserved. SPDX-License-Identifier: BSD-3-Clause */ #pragma once #include "../common/GuardedTypes.hpp" #include "../common/JsonBuilder.hpp" #include "ActionMessage.hpp" #include "BrokerBase.hpp" #include "Core.hpp" #include "HandleManager.hpp" #include "gmlc/concurrency/DelayedObjects.hpp" #include "gmlc/concurrency/TriggerVariable.hpp" #include "gmlc/containers/AirLock.hpp" #include "gmlc/containers/DualMappedPointerVector.hpp" #include "gmlc/containers/DualMappedVector.hpp" #include "gmlc/containers/MappedPointerVector.hpp" #include "gmlc/containers/SimpleQueue.hpp" #include "helics-time.hpp" #include "helics/external/any.hpp" #include "helics/helics-config.h" #include "json/forwards.h" #include <array> #include <atomic> #include <map> #include <memory> #include <set> #include <string> #include <tuple> #include <unordered_map> #include <vector> namespace helics { class TestHandle; class FederateState; class BasicHandleInfo; class FilterCoordinator; class FilterInfo; class TimeoutMonitor; enum class handle_type : char; /** enumeration of possible operating conditions for a federate*/ enum class operation_state : std::uint8_t { operating = 0, error = 5, disconnected = 10 }; /** function to print string for the state*/ const std::string& state_string(operation_state state); /** helper class for containing some wrapper around a federate for the core*/ class FedInfo { public: FederateState* fed = nullptr; operation_state state{operation_state::operating}; constexpr FedInfo() = default; constexpr explicit FedInfo(FederateState* newfed) noexcept: fed(newfed) {} FederateState* operator->() noexcept { return fed; } const FederateState* operator->() const noexcept { return fed; } operator bool() const noexcept { return (fed != nullptr); } }; /** base class implementing a standard interaction strategy between federates @details the CommonCore is virtual class that manages local federates and handles most of the interaction between federate it is meant to be instantiated for specific inter-federate communication strategies*/ class CommonCore: public Core, public BrokerBase { public: /** default constructor*/ CommonCore() noexcept; /**function mainly to match some other object constructors does the same thing as the default * constructor*/ explicit CommonCore(bool arg) noexcept; /** construct from a core name*/ explicit CommonCore(const std::string& coreName); /** virtual destructor*/ virtual ~CommonCore() override; virtual void configure(const std::string& configureString) override final; virtual void configureFromArgs(int argc, char* argv[]) override final; virtual void configureFromVector(std::vector<std::string> args) override final; virtual bool isConfigured() const override final; virtual bool isOpenToNewFederates() const override final; virtual void globalError(local_federate_id federateID, int errorCode, const std::string& errorString) override final; virtual void localError(local_federate_id federateID, int errorCode, const std::string& errorString) override final; virtual void finalize(local_federate_id federateID) override final; virtual void enterInitializingMode(local_federate_id federateID) override final; virtual void setCoreReadyToInit() override final; virtual iteration_result enterExecutingMode(local_federate_id federateID, iteration_request iterate = NO_ITERATION) override final; virtual local_federate_id registerFederate(const std::string& name, const CoreFederateInfo& info) override final; virtual const std::string& getFederateName(local_federate_id federateID) const override final; virtual local_federate_id getFederateId(const std::string& name) const override final; virtual int32_t getFederationSize() override final; virtual Time timeRequest(local_federate_id federateID, Time next) override final; virtual iteration_time requestTimeIterative(local_federate_id federateID, Time next, iteration_request iterate) override final; virtual Time getCurrentTime(local_federate_id federateID) const override final; virtual uint64_t getCurrentReiteration(local_federate_id federateID) const override final; virtual void setTimeProperty(local_federate_id federateID, int32_t property, Time time) override final; virtual void setIntegerProperty(local_federate_id federateID, int32_t property, int16_t propertyValue) override final; virtual Time getTimeProperty(local_federate_id federateID, int32_t property) const override final; virtual int16_t getIntegerProperty(local_federate_id federateID, int32_t property) const override final; virtual void setFlagOption(local_federate_id federateID, int32_t flag, bool flagValue = true) override final; virtual bool getFlagOption(local_federate_id federateID, int32_t flag) const override final; virtual interface_handle registerPublication(local_federate_id federateID, const std::string& key, const std::string& type, const std::string& units) override final; virtual interface_handle getPublication(local_federate_id federateID, const std::string& key) const override final; virtual interface_handle registerInput(local_federate_id federateID, const std::string& key, const std::string& type, const std::string& units) override final; virtual interface_handle getInput(local_federate_id federateID, const std::string& key) const override final; virtual const std::string& getHandleName(interface_handle handle) const override final; virtual void setHandleOption(interface_handle handle, int32_t option, int32_t option_value) override final; virtual int32_t getHandleOption(interface_handle handle, int32_t option) const override final; virtual void closeHandle(interface_handle handle) override final; virtual void removeTarget(interface_handle handle, const std::string& targetToRemove) override final; virtual void addDestinationTarget(interface_handle handle, const std::string& dest) override final; virtual void addSourceTarget(interface_handle handle, const std::string& name) override final; virtual const std::string& getInjectionUnits(interface_handle handle) const override final; virtual const std::string& getExtractionUnits(interface_handle handle) const override final; virtual const std::string& getInjectionType(interface_handle handle) const override final; virtual const std::string& getExtractionType(interface_handle handle) const override final; virtual void setValue(interface_handle handle, const char* data, uint64_t len) override final; virtual const std::shared_ptr<const data_block>& getValue(interface_handle handle, uint32_t* inputIndex) override final; virtual const std::vector<std::shared_ptr<const data_block>>& getAllValues(interface_handle handle) override final; virtual const std::vector<interface_handle>& getValueUpdates(local_federate_id federateID) override final; virtual interface_handle registerEndpoint(local_federate_id federateID, const std::string& name, const std::string& type) override final; virtual interface_handle getEndpoint(local_federate_id federateID, const std::string& name) const override final; virtual interface_handle registerFilter(const std::string& filterName, const std::string& type_in, const std::string& type_out) override final; virtual interface_handle registerCloningFilter(const std::string& filterName, const std::string& type_in, const std::string& type_out) override final; virtual interface_handle getFilter(const std::string& name) const override final; virtual void addDependency(local_federate_id federateID, const std::string& federateName) override final; virtual void registerFrequentCommunicationsPair(const std::string& source, const std::string& dest) override final; virtual void makeConnections(const std::string& file) override final; virtual void dataLink(const std::string& source, const std::string& target) override final; virtual void addSourceFilterToEndpoint(const std::string& filter, const std::string& endpoint) override final; virtual void addDestinationFilterToEndpoint(const std::string& filter, const std::string& endpoint) override final; virtual void send(interface_handle sourceHandle, const std::string& destination, const char* data, uint64_t length) override final; virtual void sendEvent(Time time, interface_handle sourceHandle, const std::string& destination, const char* data, uint64_t length) override final; virtual void sendMessage(interface_handle sourceHandle, std::unique_ptr<Message> message) override final; virtual uint64_t receiveCount(interface_handle destination) override final; virtual std::unique_ptr<Message> receive(interface_handle destination) override final; virtual std::unique_ptr<Message> receiveAny(local_federate_id federateID, interface_handle& endpoint_id) override final; virtual uint64_t receiveCountAny(local_federate_id federateID) override final; virtual void logMessage(local_federate_id federateID, int logLevel, const std::string& messageToLog) override final; virtual void setFilterOperator(interface_handle filter, std::shared_ptr<FilterOperator> callback) override final; /** set the local identification for the core*/ void setIdentifier(const std::string& name); /** get the local identifier for the core*/ virtual const std::string& getIdentifier() const override final { return identifier; } virtual const std::string& getAddress() const override final; const std::string& getFederateNameNoThrow(global_federate_id federateID) const noexcept; /** set the core logging level*/ virtual void setLoggingLevel(int logLevel) override; virtual void setLoggingCallback(local_federate_id federateID, std::function<void(int, const std::string&, const std::string&)> logFunction) override final; virtual void setLogFile(const std::string& lfile) override final; virtual std::string query(const std::string& target, const std::string& queryStr) override; virtual void setQueryCallback(local_federate_id federateID, std::function<std::string(const std::string&)> queryFunction) override; virtual void setGlobal(const std::string& valueName, const std::string& value) override; virtual bool connect() override final; virtual bool isConnected() const override final; virtual void disconnect() override final; virtual bool waitForDisconnect( std::chrono::milliseconds msToWait = std::chrono::milliseconds(0)) const override final; /** unregister the core from any process find functions*/ void unregister(); /**TODO(PT): figure out how to make this non-public, it needs to be called in a lambda function, * may need a helper class of some sort*/ virtual void processDisconnect(bool skipUnregister = false) override final; virtual void setInterfaceInfo(interface_handle handle, std::string info) override final; virtual const std::string& getInterfaceInfo(interface_handle handle) const override final; private: /** implementation details of the connection process */ virtual bool brokerConnect() = 0; /** implementation details of the disconnection process */ virtual void brokerDisconnect() = 0; protected: virtual void processCommand(ActionMessage&& command) override final; virtual void processPriorityCommand(ActionMessage&& command) override final; /** transit an ActionMessage to another core or broker @param rid the identifier for the route information to send the message to @param command the actionMessage to send*/ virtual void transmit(route_id rid, const ActionMessage& command) = 0; /** transit an ActionMessage to another core or broker @param rid the identifier for the route information to send the message to @param command the actionMessage to send*/ virtual void transmit(route_id rid, ActionMessage&& command) = 0; /** add a route to whatever internal structure manages the routes @param rid the identification of the route @param interfaceId an interface id code that can be used to identify the interface route should be added to, in most cases this should be zero since there is only one interface @param routeInfo a string containing the information necessary to connect */ virtual void addRoute(route_id rid, int interfaceId, const std::string& routeInfo) = 0; /** remove or disconnect a route from use @param rid the identification of the route */ virtual void removeRoute(route_id rid) = 0; /** get the federate Information from the federateID*/ FederateState* getFederateAt(local_federate_id federateID) const; /** get the federate Information from the federateID*/ FederateState* getFederate(const std::string& federateName) const; /** get the federate Information from a handle @param handle a handle identifier as generated by the one of the functions*/ FederateState* getHandleFederate(interface_handle handle); /** get the basic handle information*/ const BasicHandleInfo* getHandleInfo(interface_handle handle) const; /** get a localEndpoint from the name*/ const BasicHandleInfo* getLocalEndpoint(const std::string& name) const; /** get a filtering function object*/ FilterCoordinator* getFilterCoordinator(interface_handle handle); /** check if all federates managed by the core are ready to enter initialization state*/ bool allInitReady() const; /** check if all connections are disconnected (feds and time dependencies)*/ bool allDisconnected() const; /** get the minimum operating state of the connected federates*/ operation_state minFederateState() const; private: /** get the federate Information from the federateID*/ FederateState* getFederateCore(global_federate_id federateID); /** get the federate Information from the federateID*/ FederateState* getFederateCore(const std::string& federateName); /** get the federate Information from a handle @param handle an identifier as generated by the one of the functions @return the federateState pointer object*/ FederateState* getHandleFederateCore(interface_handle handle); private: std::string prevIdentifier; //!< storage for the case of requiring a renaming std::map<global_federate_id, route_id> routing_table; //!< map for external routes <global federate id, route id> gmlc::containers::SimpleQueue<ActionMessage> delayTransmitQueue; //!< FIFO queue for transmissions to the root that need to be delayed //!< for a certain time std::unordered_map<std::string, route_id> knownExternalEndpoints; //!< external map for all known external endpoints with names and //!< route std::unique_ptr<TimeoutMonitor> timeoutMon; //!< class to handle timeouts and disconnection notices /** actually transmit messages that were delayed until the core was actually registered*/ void transmitDelayedMessages(); /** respond to delayed message with an error*/ void errorRespondDelayedMessages(const std::string& estring); /** actually transmit messages that were delayed for a particular source @param source the identifier for the message to transmit */ void transmitDelayedMessages(global_federate_id source); /**function for doing the actual routing either to a local fed or up the broker chain*/ void routeMessage(ActionMessage& cmd, global_federate_id dest); /** function for routing a message from based on the destination specified in the * ActionMessage*/ void routeMessage(const ActionMessage& cmd); /**function for doing the actual routing either to a local fed or up the broker chain*/ void routeMessage(ActionMessage&& cmd, global_federate_id dest); /** function for routing a message from based on the destination specified in the * ActionMessage*/ void routeMessage(ActionMessage&& cmd); /** process any filter or route the message*/ void processMessageFilter(ActionMessage& cmd); /** process a filter message return*/ void processFilterReturn(ActionMessage& cmd); /** process a destination filter message return*/ void processDestFilterReturn(ActionMessage& command); /** create a source filter */ FilterInfo* createFilter(global_broker_id dest, interface_handle handle, const std::string& key, const std::string& type_in, const std::string& type_out, bool cloning); /** check if we can remove some dependencies*/ void checkDependencies(); /** deal with a query response addressed to this core*/ void processQueryResponse(const ActionMessage& m); /** handle command with the core itself as a destination at the core*/ void processCommandsForCore(const ActionMessage& cmd); /** process configure commands for the core*/ void processCoreConfigureCommands(ActionMessage& cmd); /** check if a newly registered subscription has a local publication if it does return true*/ bool checkForLocalPublication(ActionMessage& cmd); /** get an index for an airlock function is threadsafe*/ uint16_t getNextAirlockIndex(); /** load the basic core info into a JSON object*/ void loadBasicJsonInfo( Json::Value& base, const std::function<void(Json::Value& fedval, const FedInfo& fed)>& fedLoader) const; /** generate a mapbuilder for the federates*/ void initializeMapBuilder(const std::string& request, std::uint16_t index, bool reset) const; /** generate results for core queries*/ std::string coreQuery(const std::string& queryStr) const; /** generate results for some core queries that do not depend on the main processing loop * running*/ std::string quickCoreQueries(const std::string& queryStr) const; /** generate the filteredEndpoint query results for a particular federate*/ std::string filteredEndpointQuery(const FederateState* fed) const; private: int32_t _global_federation_size = 0; //!< total size of the federation std::atomic<int16_t> delayInitCounter{0}; //!< counter for the number of times the entry to //!< initialization Mode was explicitly delayed shared_guarded<gmlc::containers::MappedPointerVector<FederateState, std::string>> federates; //!< threadsafe local federate information list for external functions gmlc::containers::DualMappedVector<FedInfo, std::string, global_federate_id> loopFederates; // federate pointers stored for the core loop std::atomic<int32_t> messageCounter{ 54}; //!< counter for the number of messages that have been sent, nothing //!< magical about 54 just a number bigger than 1 to prevent //!< confusion ordered_guarded<HandleManager> handles; //!< local handle information; HandleManager loopHandles; //!< copy of handles to use in the primary processing loop without //!< thread protection std::map<int32_t, std::set<int32_t>> ongoingFilterProcesses; //!< sets of ongoing filtered messages std::map<int32_t, std::set<int32_t>> ongoingDestFilterProcesses; //!< sets of ongoing destination filter processing std::map<int32_t, std::vector<ActionMessage>> delayedTimingMessages; //!< delayedTimingMessages from ongoing Filter actions std::atomic<int> queryCounter{ 1}; //!< counter for queries start at 1 so the default value isn't used gmlc::concurrency::DelayedObjects<std::string> activeQueries; //!< holder for active queries /// holder for the query map builder information mutable std::vector<std::tuple<JsonMapBuilder, std::vector<ActionMessage>, bool>> mapBuilders; std::map<interface_handle, std::unique_ptr<FilterCoordinator>> filterCoord; //!< map of all local filters // The interface_handle used is here is usually referencing an endpoint gmlc::containers::DualMappedPointerVector<FilterInfo, std::string, global_handle> filters; //!< storage for all the filters std::atomic<uint16_t> nextAirLock{0}; //!< the index of the next airlock to use std::array<gmlc::containers::AirLock<stx::any>, 4> dataAirlocks; //!< airlocks for updating filter operators and other functions gmlc::concurrency::TriggerVariable disconnection; //!< controller for the disconnection process private: /** wait for the core to be registered with the broker*/ bool waitCoreRegistration(); /** deliver a message to the appropriate location*/ void deliverMessage(ActionMessage& message); /** function to deal with a source filters*/ ActionMessage& processMessage(ActionMessage& message); /** add a new handle to the generic structure and return a reference to the basicHandle */ const BasicHandleInfo& createBasicHandle(global_federate_id global_federateId, local_federate_id local_federateId, handle_type HandleType, const std::string& key, const std::string& type, const std::string& units, uint16_t flags = 0); /** check if a global id represents a local federate @param global_fedid the identifier for the federate @return true if it is a local federate*/ bool isLocal(global_federate_id global_fedid) const; /** get a route id for a non-local federate @param global_fedid the identifier for the federate @return parent_route if unknown, otherwise returns the route_id*/ route_id getRoute(global_federate_id global_fedid) const; /** process a message for potential additions to the filter ordering @param command the message to process */ void processFilterInfo(ActionMessage& command); /** function to check for a named interface*/ void checkForNamedInterface(ActionMessage& command); /** function to remove a named target*/ void removeNamedTarget(ActionMessage& command); /** indicate that a handle interface is used and if the used status has changed make sure it is indicated in all the needed places*/ void setAsUsed(BasicHandleInfo* hand); /** function to consolidate the registration of interfaces in the core*/ void registerInterface(ActionMessage& command); /** function to handle adding a target to an interface*/ void addTargetToInterface(ActionMessage& command); /** function to deal with removing a target from an interface*/ void removeTargetFromInterface(ActionMessage& command); /** function disconnect a single interface*/ void disconnectInterface(ActionMessage& command); /** organize filters @details organize the filter and report and potential warnings and errors */ void organizeFilterOperations(); /** generate a query response for a federate if possible @param fed a pointer to the federateState object to query @param queryStr the string containing the actual query @return "#wait" if the lock cannot be granted immediately and no result can be obtained otherwise an answer to the query */ std::string federateQuery(const FederateState* fed, const std::string& queryStr) const; /** send an error code and message to all the federates*/ void sendErrorToFederates(int error_code, const std::string& message); /** check for a disconnect and take actions if the object can disconnect*/ bool checkAndProcessDisconnect(); /** send a disconnect message to time dependencies and child federates*/ void sendDisconnect(); /** broadcast a message to all federates*/ void broadcastToFederates(ActionMessage& cmd); friend class TimeoutMonitor; }; } // namespace helics
54.187755
100
0.682058
[ "object", "vector" ]
ecc177e534802a0046476cf6d2ca183ceff42634
994
cpp
C++
topcoder/SRM/SRM-145-DIV-2/ImageDithering/ImageDithering/main.cpp
mathemage/CompetitiveProgramming
fe39017e3b017f9259f9c1e6385549270940be64
[ "MIT" ]
2
2015-08-18T09:51:19.000Z
2019-01-29T03:18:10.000Z
topcoder/SRM/SRM-145-DIV-2/ImageDithering/ImageDithering/main.cpp
mathemage/CompetitiveProgramming
fe39017e3b017f9259f9c1e6385549270940be64
[ "MIT" ]
null
null
null
topcoder/SRM/SRM-145-DIV-2/ImageDithering/ImageDithering/main.cpp
mathemage/CompetitiveProgramming
fe39017e3b017f9259f9c1e6385549270940be64
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <assert.h> using namespace std; class ImageDithering { public: int count(string dithered, vector<string> screen) { unsigned d[26]; for (int i = 0; i < 26; i++) { d[i] = 0; } for (unsigned i = 0; i < dithered.length(); i++) { d[dithered[i] - 'A'] = 1; } int count = 0; for (vector<string>::iterator str = screen.begin(); str != screen.end(); ++str) { for (unsigned i = 0; i < str->length(); i++) { count += d[(*str)[i] - 'A']; } } return count; } }; int main() { ImageDithering id; string sc1[] = { "AAAAAAAA", "ABWBWBWA", "AWBWBWBA", "ABWBWBWA", "AWBWBWBA", "AAAAAAAA" }; vector<string> scr1(sc1, sc1 + 6); assert( id.count("BW", scr1) == 24); string sc2[] = {"OT", "QF", "KD", "HR", "VV", "XB"}; vector<string> scr2(sc2, sc2 + 6); assert( id.count("JSPQKYRME", scr2) == 3); cout << id.count("JSPQKYRME", scr2); return 0; }
19.88
85
0.527163
[ "vector" ]
ecd81c821ca9087d0fdafcc42e8bbb05d72f118f
2,689
hpp
C++
sdk/storage/azure-storage-blobs/test/perf/inc/azure/storage/blobs/test/list_blob_test.hpp
RickWinter/azure-sdk-for-cpp
b4fe751310f53669a941e00aa93072f2d10a4eba
[ "MIT" ]
96
2020-03-19T07:49:39.000Z
2022-03-20T14:22:41.000Z
sdk/storage/azure-storage-blobs/test/perf/inc/azure/storage/blobs/test/list_blob_test.hpp
RickWinter/azure-sdk-for-cpp
b4fe751310f53669a941e00aa93072f2d10a4eba
[ "MIT" ]
2,572
2020-03-18T22:54:53.000Z
2022-03-31T22:09:59.000Z
sdk/storage/azure-storage-blobs/test/perf/inc/azure/storage/blobs/test/list_blob_test.hpp
RickWinter/azure-sdk-for-cpp
b4fe751310f53669a941e00aa93072f2d10a4eba
[ "MIT" ]
81
2020-03-19T09:42:00.000Z
2022-03-24T05:11:05.000Z
// Copyright (c) Microsoft Corporation. All rights reserved. // SPDX-License-Identifier: MIT /** * @file * @brief Test the performance of listing blobs. * */ #pragma once #include <azure/core/io/body_stream.hpp> #include <azure/core/uuid.hpp> #include <azure/perf.hpp> #include "azure/storage/blobs/test/blob_base_test.hpp" #include <memory> #include <string> #include <vector> namespace Azure { namespace Storage { namespace Blobs { namespace Test { /** * @brief A test to measure listing a blob. * */ class ListBlob : public Azure::Storage::Blobs::Test::BlobsTest { public: /** * @brief Construct a new ListBlob test. * * @param options The test options. */ ListBlob(Azure::Perf::TestOptions options) : BlobsTest(options) {} /** * @brief The size to upload on setup is defined by a mandatory parameter. * */ void Setup() override { // Call base to create blob client BlobsTest::Setup(); long count = m_options.GetMandatoryOption<long>("Count"); auto rawData = std::make_unique<std::vector<uint8_t>>(1); auto content = Azure::Core::IO::MemoryBodyStream(*rawData); // Upload the number of blobs to be listed later in the test for (auto blobCount = 0; blobCount < count; blobCount++) { auto blobName = "Azure.Storage.Blobs.Perf.Scenarios.DownloadBlob-" + Azure::Core::Uuid::CreateUuid().ToString(); m_containerClient->GetBlockBlobClient(blobName).Upload(content); } } /** * @brief Define the test * */ void Run(Azure::Core::Context const& context) override { // Loop each page for (auto page = m_containerClient->ListBlobs({}, context); page.HasPage(); page.MoveToNextPage(context)) { // loop each blob for (auto blob : page.Blobs) { (void)blob; } } } /** * @brief Define the test options for the test. * * @return The list of test options. */ std::vector<Azure::Perf::TestOption> GetTestOptions() override { // TODO: Merge with base options return {{"Count", {"--count"}, "Number of blobs to list", 1, true}}; } /** * @brief Get the static Test Metadata for the test. * * @return Azure::Perf::TestMetadata describing the test. */ static Azure::Perf::TestMetadata GetTestMetadata() { return {"ListBlob", "List blobs.", [](Azure::Perf::TestOptions options) { return std::make_unique<Azure::Storage::Blobs::Test::ListBlob>(options); }}; } }; }}}} // namespace Azure::Storage::Blobs::Test
26.362745
88
0.606917
[ "vector" ]
ece17f4ac94488267b1f0c6210e1eb65c50178d7
9,397
cpp
C++
test/performance-regression/full-apps/qmcpack/src/QMCWaveFunctions/AtomicOrbitals/HFAtomicSTOSetBuilder.cpp
FeiyangJin/hclib
d23c850dce914e2d80cae733670820812a1edeee
[ "BSD-3-Clause" ]
55
2015-07-28T01:32:58.000Z
2022-02-27T16:27:46.000Z
test/performance-regression/full-apps/qmcpack/src/QMCWaveFunctions/AtomicOrbitals/HFAtomicSTOSetBuilder.cpp
FeiyangJin/hclib
d23c850dce914e2d80cae733670820812a1edeee
[ "BSD-3-Clause" ]
66
2015-06-15T20:38:19.000Z
2020-08-26T00:11:43.000Z
test/performance-regression/full-apps/qmcpack/src/QMCWaveFunctions/AtomicOrbitals/HFAtomicSTOSetBuilder.cpp
FeiyangJin/hclib
d23c850dce914e2d80cae733670820812a1edeee
[ "BSD-3-Clause" ]
26
2015-10-26T22:11:51.000Z
2021-03-02T22:09:15.000Z
////////////////////////////////////////////////////////////////// // (c) Copyright 2003 by Jeongnim Kim ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // National Center for Supercomputing Applications & // Materials Computation Center // University of Illinois, Urbana-Champaign // Urbana, IL 61801 // e-mail: jnkim@ncsa.uiuc.edu // Tel: 217-244-6319 (NCSA) 217-333-3324 (MCC) // // Supported by // National Center for Supercomputing Applications, UIUC // Materials Computation Center, UIUC ////////////////////////////////////////////////////////////////// // -*- C++ -*- #include "QMCWaveFunctions/AtomicOrbitals/HFAtomicSTOSetBuilder.h" #include "Particle/DistanceTableData.h" #include "Particle/DistanceTable.h" #include "QMCWaveFunctions/SlaterDeterminant.h" #include "QMCWaveFunctions/MultiSlaterDeterminant.h" #include "Utilities/OhmmsInfo.h" #include <set> #include <sstream> using std::set; namespace qmcplusplus { template<class T, class POS> std::ostream& operator<<(std::ostream& out, const ComboSTO<T,POS>& asto) { out << asto.Name << " LM = " << asto.LM << endl; for(int i=0; i<asto.C.size(); i++) out << asto.Rnl[i]->ID << " " << asto.C[i] << endl; return out; } HFAtomicSTOSetBuilder::HFAtomicSTOSetBuilder(ParticleSet& els, TrialWaveFunction& wfs, ParticleSet& ions): OrbitalBuilderBase(els,wfs), Lmax(-1) { d_table = DistanceTable::add(ions,els); } bool HFAtomicSTOSetBuilder::getBasis(xmlNodePtr cur) { typedef TrialWaveFunction::RealType RealType; //STONorm<RealType> anorm(4); cur = cur->xmlChildrenNode; while(cur!=NULL) { string cname((const char*)(cur->name)); if(cname == basisfunc_tag) { XMLReport("Found a radial basis function.") int n=atoi((const char*)(xmlGetProp(cur, (const xmlChar *)"n"))); int l=atoi((const char*)(xmlGetProp(cur, (const xmlChar *)"l"))); Lmax = max(Lmax,l); string newRnl; const xmlChar* aptr(xmlGetProp(cur, (const xmlChar *)"id")); if(aptr) { newRnl = (const char*)aptr; } else { std::ostringstream idstream(newRnl.c_str()); idstream << 'R' << RnlID.size(); XMLReport("WARNING!!!! Rnl does not have id. Assign a default" << newRnl) } double screen = 1.0; xmlNodePtr s = cur->xmlChildrenNode; while(s != NULL) { string vname((const char*)(s->name)); if(vname == param_tag) { putContent(screen,s); } s=s->next; } map<string,int>::iterator it = RnlID.find(newRnl); if(it == RnlID.end()) { //the ID of the next Radial Function int id = Rnl.size(); RnlID[newRnl] = id; Rnl.push_back(new RadialOrbital_t(n,l,screen)); //Rnl.push_back(new RadialOrbital_t(n-l-1,screen,anorm(n-1,screen))); XMLReport("STO function (n,l,screen) " << n << " " << l << " " << screen) Rnl[id]->ID = id; } } cur=cur->next; } return true; } HFAtomicSTOSet* HFAtomicSTOSetBuilder::getOrbital(xmlNodePtr cur) { typedef TrialWaveFunction::RealType RealType; HFAtomicSTOSet* psi = new HFAtomicSTOSet(Lmax); XMLReport("The maximum angular momentum " << Lmax) //set of RadialFunctions(integers) set<int> RnlSet; int spin = atoi((const char*)(xmlGetProp(cur, (const xmlChar *)"spin"))); xmlNodePtr orb=cur->xmlChildrenNode; while(orb!=NULL) { string cname((const char*)(orb->name)); //a single-particle orbtial consiting of a number of Orbitals is added if(cname == spo_tag) { XMLReport("Found a SingleParticleOrbital.") //using an existing Orbtial xmlChar *att=xmlGetProp(orb,(const xmlChar*)"ref"); if(att) { string aname((const char*)att); XMLReport("Using an existing Orbital id =" << aname) map<string,SPO_t*>::iterator it = OrbSet.find(aname); if(it == OrbSet.end()) { ERRORMSG("Orbital " << aname << " does not exisit. Failed.") } else { XMLReport("Using an existing " << aname << " Orbtial") //create a ComboSTO using a copy Constructor int lm = (*it).second->LM; if(xmlHasProp(orb, (const xmlChar *)"l")) { int l=atoi((const char*)(xmlGetProp(orb, (const xmlChar *)"l"))); int m=atoi((const char*)(xmlGetProp(orb, (const xmlChar *)"m"))); lm = psi->Ylm.index(l,m); } SPO_t* aSTO = new SPO_t(lm, psi->Ylm,(*it).second->Rnl, &((*it).second->C[0])); psi->Orbital.push_back(aSTO); for(int nl=0; nl<aSTO->Rnl.size(); nl++) RnlSet.insert(aSTO->Rnl[nl]->ID); } } else // add a new orbital { //get the properties first int l=atoi((const char*)(xmlGetProp(orb, (const xmlChar *)"l"))); int m=atoi((const char*)(xmlGetProp(orb, (const xmlChar *)"m"))); string aname((const char*)(xmlGetProp(orb, (const xmlChar *)"id"))); XMLReport("Adding a new Orbital id =" << aname << " l= " << l << " m=" << m) //temporary storage for coefficients and radial orbtials vector<RealType> c; vector<RadialOrbital_t*> sto; RealType ctmp; xmlNodePtr s = orb->xmlChildrenNode; while(s != NULL) { string sname((const char*)(s->name)); if(sname == basisfunc_tag) { //getting the index of the radial basis functions string rfn((const char*)(xmlGetProp(s, (const xmlChar *)"ref"))); //c.push_back(atof((const char*)(xmlGetProp(s, (const xmlChar *)"C")))); xmlNodePtr z=s->xmlChildrenNode; while(z != NULL) { string vname((const char*)(z->name)); if(vname == param_tag) { putContent(ctmp,z); c.push_back(ctmp); } z=z->next; } XMLReport("Adding STO " << rfn << " C = " << c.back()) map<string,int>::iterator it = RnlID.find(rfn); sto.push_back(Rnl[(*it).second]); RnlSet.insert((*it).second); } s = s->next; } ///create a ComboSTO SPO_t* aSTO = new SPO_t(psi->Ylm.index(l,m), psi->Ylm, sto, &c[0]); aSTO->Name = aname; ///add the ComboSTO to HFAtomicSTOSet::Orbital psi->Orbital.push_back(aSTO); ///register name for re-use OrbSet[aname] = aSTO; }/// }///found Orbtial orb = orb->next; } ///time to add a set of Rnl to HFAtomicSTOSet for pre-calculations set<int>::iterator irnl = RnlSet.begin(); while(irnl != RnlSet.end()) { psi->RnlPool.push_back(Rnl[*irnl]); irnl++; } return psi; } bool HFAtomicSTOSetBuilder::put(xmlNodePtr cur) { typedef TrialWaveFunction::RealType RealType; typedef DiracDeterminant<HFAtomicSTOSet> Det_t; typedef SlaterDeterminant<HFAtomicSTOSet> SlaterDeterminant_t; SlaterDeterminant_t *asymmpsi; vector<SlaterDeterminant_t*> slaterdets; vector<RealType> C; int is=0; cur = cur->xmlChildrenNode; while(cur != NULL) { string cname((const char*)(cur->name)); if(cname == basisset_tag) { getBasis(cur); } else if(cname == sd_tag) { int first = 0; xmlNodePtr tcur = cur->xmlChildrenNode; slaterdets.push_back(new SlaterDeterminant_t); C.push_back(1.0); //if(xmlHasProp(tcur,(const xmlChar*)"C")) { //C[is] = atof((const char*)(xmlGetProp(tcur, (const xmlChar *)"C"))); //} while(tcur != NULL) { string vname((const char*)(tcur->name)); if(vname == param_tag) { putContent(C[is],tcur); } else if(vname == det_tag) { HFAtomicSTOSet* psi = getOrbital(tcur); psi->setTable(d_table); Det_t * adet = new Det_t(*psi,first); adet->set(first,psi->size()); XMLReport("Adding a determinant to the SlaterDeterminant " << first<< " " << psi->size()) slaterdets[is]->add(adet); first += psi->size(); } tcur = tcur->next; } is++; } cur = cur->next; } XMLReport("Done with he initialization HFAtomicSTSet") if(slaterdets.size() > 1) { MultiSlaterDeterminant<HFAtomicSTOSet> *multidet= new MultiSlaterDeterminant<HFAtomicSTOSet>; HFAtomicSTOSet::BasisSet_t *bs=new HFAtomicSTOSet::BasisSet_t; for(int i=0; i<slaterdets.size(); i++) { cout << "Multi determinant " << C[i] << endl; slaterdets[i]->setBasisSet(bs); multidet->add(slaterdets[i],C[i]); } targetPsi.addOrbital(multidet); } else { slaterdets[0]->setBasisSet(new HFAtomicSTOSet::BasisSet_t); targetPsi.addOrbital(slaterdets[0]); } return true; } } /*************************************************************************** * $RCSfile$ $Author: jmcminis $ * $Revision: 5794 $ $Date: 2013-04-25 20:14:53 -0400 (Thu, 25 Apr 2013) $ * $Id: HFAtomicSTOSetBuilder.cpp 5794 2013-04-26 00:14:53Z jmcminis $ ***************************************************************************/
32.97193
106
0.552304
[ "vector" ]
ecf200614bbec0c429e9b5cc60afd9a73f80c394
4,517
cc
C++
src/featbin/append-vector-to-feats.cc
shuipi100/kaldi
8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0
[ "Apache-2.0" ]
805
2018-05-28T02:32:04.000Z
2022-03-26T09:13:12.000Z
src/featbin/append-vector-to-feats.cc
shuipi100/kaldi
8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0
[ "Apache-2.0" ]
49
2015-10-24T22:06:28.000Z
2019-12-24T11:13:34.000Z
src/featbin/append-vector-to-feats.cc
shuipi100/kaldi
8e30fddb300a87e7c79ef2c0b9c731a8a9fd23f0
[ "Apache-2.0" ]
267
2018-06-07T08:33:28.000Z
2022-03-30T12:18:33.000Z
// featbin/append-vector-to-feats.cc // Copyright 2012 Korbinian Riedhammer // 2013 Brno University of Technology (Author: Karel Vesely) // 2013-2014 Johns Hopkins University (Author: Daniel Povey) // See ../../COPYING for clarification regarding multiple 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 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. #include "base/kaldi-common.h" #include "util/common-utils.h" #include "matrix/kaldi-matrix.h" namespace kaldi { void AppendVectorToFeats(const Matrix<BaseFloat> &in, const Vector<BaseFloat> &vec, Matrix<BaseFloat> *out) { // Check inputs, KALDI_ASSERT(in.NumRows() != 0); // Build the output matrix, out->Resize(in.NumRows(), in.NumCols() + vec.Dim()); out->ColRange(0, in.NumCols()).CopyFromMat(in); out->ColRange(in.NumCols(), vec.Dim()).CopyRowsFromVec(vec); } } // namespace kaldi, int main(int argc, char *argv[]) { try { using namespace kaldi; using namespace std; const char *usage = "Append a vector to each row of input feature files\n" "\n" "Usage: append-vector-to-feats <in-rspecifier1> <in-rspecifier2> <out-wspecifier>\n" " or: append-vector-to-feats <in-rxfilename1> <in-rxfilename2> <out-wxfilename>\n" "See also: paste-feats, concat-feats\n"; ParseOptions po(usage); bool binary = true; po.Register("binary", &binary, "If true, output files in binary " "(only relevant for single-file operation, i.e. no tables)"); po.Read(argc, argv); if (po.NumArgs() != 3) { po.PrintUsage(); exit(1); } if (ClassifyRspecifier(po.GetArg(1), NULL, NULL) != kNoRspecifier) { // We're operating on tables, e.g. archives. string feat_rspecifier = po.GetArg(1); SequentialBaseFloatMatrixReader feat_reader(feat_rspecifier); string vec_rspecifier = po.GetArg(2); RandomAccessBaseFloatVectorReader vec_reader(vec_rspecifier); string wspecifier = po.GetArg(3); BaseFloatMatrixWriter feat_writer(wspecifier); int32 num_done = 0, num_err = 0; // Main loop for (; !feat_reader.Done(); feat_reader.Next()) { string utt = feat_reader.Key(); KALDI_VLOG(2) << "Processing utterance " << utt; const Matrix<BaseFloat> &feats(feat_reader.Value()); if (!vec_reader.HasKey(utt)) { KALDI_WARN << "Could not read vector for utterance " << utt; num_err++; continue; } const Vector<BaseFloat> &vec(vec_reader.Value(utt)); Matrix<BaseFloat> output; AppendVectorToFeats(feats, vec, &output); feat_writer.Write(utt, output); num_done++; } KALDI_LOG << "Done " << num_done << " utts, errors on " << num_err; return (num_done == 0 ? -1 : 0); } else { // We're operating on rxfilenames|wxfilenames, most likely files. Matrix<BaseFloat> mat; ReadKaldiObject(po.GetArg(1), &mat); Vector<BaseFloat> vec; ReadKaldiObject(po.GetArg(2), &vec); Matrix<BaseFloat> output; AppendVectorToFeats(mat, vec, &output); std::string output_wxfilename = po.GetArg(3); WriteKaldiObject(output, output_wxfilename, binary); KALDI_LOG << "Wrote appended features to " << output_wxfilename; return 0; } } catch(const std::exception &e) { std::cerr << e.what(); return -1; } } /* Testing: cat <<EOF >1.mat [ 0 1 2 3 4 5 8 9 10 ] EOF cat <<EOF > 2.vec [ 0 1 ] EOF append-vector-to-feats --binary=false 1.mat 2.vec 3a.mat cat <<EOF > 3b.mat [ 0 1 2 0 1 3 4 5 0 1 8 9 10 0 1 ] EOF cmp <(../bin/copy-matrix 3b.mat -) <(../bin/copy-matrix 3a.mat -) || echo 'Bad!' append-vector-to-feats 'scp:echo foo 1.mat|' 'scp:echo foo 2.vec|' 'scp,t:echo foo 3a.mat|' cmp <(../bin/copy-matrix 3b.mat -) <(../bin/copy-matrix 3a.mat -) || echo 'Bad!' rm {1,3?}.mat 2.vec */
30.52027
92
0.633828
[ "vector" ]
a6032a270f9124881ad3680d9ab961462a33a0c1
10,613
cc
C++
pfktop/pidlist.cc
flipk/pfkutils
d8f6c22720b6fcc44a882927c745a822282d1f69
[ "Unlicense" ]
4
2015-06-12T05:08:56.000Z
2017-11-13T11:34:27.000Z
pfktop/pidlist.cc
flipk/pfkutils
d8f6c22720b6fcc44a882927c745a822282d1f69
[ "Unlicense" ]
null
null
null
pfktop/pidlist.cc
flipk/pfkutils
d8f6c22720b6fcc44a882927c745a822282d1f69
[ "Unlicense" ]
1
2021-10-20T02:04:53.000Z
2021-10-20T02:04:53.000Z
/* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org> */ #include "pidlist.h" #include "posix_fe.h" #include <stdlib.h> #include <iomanip> #include <algorithm> using namespace pfktop; using namespace std; PidList :: PidList(const Options &_opts, Screen &_screen) : opts(_opts), screen(_screen), nl(_screen.nl), erase(_screen.erase), home(_screen.home), db(true) { } PidList :: ~PidList(void) { } void PidList :: fetch(void) { pxfe_readdir p; dirent de; string procDir = "/proc"; if (!p.open(procDir)) { cout << "cannot open /proc" << nl; return; } // clear the 'stamp' on everything in the db. db.unstamp(); while (p.read(de)) { char * endpp = NULL; string de_name(de.d_name); unsigned long _pid = strtoul(de.d_name, &endpp, 10); if (*endpp != 0) // not an integer, must be one of those other words // found in /proc. continue; pid_t pid = (pid_t) _pid; // this dirent is a valid pid. let's consume it. tidEntry * pe = db.find(pid); if (!pe) { // we've not seen this one before, add an entry // for it. pe = new tidEntry(pid, pid, procDir + "/" + de_name + "/task/" + de_name); db.add(pe); } // this will set the stamp. pe->update(); pxfe_readdir t; string taskDir = procDir + "/" + de_name + "/task"; t.open(taskDir); // ignore return cuz read will ret false anyway while (t.read(de)) { char * endpt = NULL; unsigned long _tid = strtoul(de.d_name, &endpt, 10); if (*endpt != 0) // not an integer, must be one of those other words // found in /proc. continue; if (_tid == _pid) // its the main thread which we already got, skip. continue; pid_t tid = (pid_t) _tid; tidEntry * te = db.find(tid); if (!te) { // a thread we've not seen before, add an entry for it. te = new tidEntry(tid, pid, taskDir + "/" + de.d_name, pe); db.add(te); pe->db.add(te); } // this will set the stamp. te->update(); } } // look for every entry with no stamp. // these entries represent threads or processes which // have exited and need to be cleaned up. pidList_t notStampedList; db.find_not_stamped(notStampedList); for (pidList_t::iterator it = notStampedList.begin(); it != notStampedList.end(); it++) { tidEntry * te = *it; { // this entry didn't get updated above, so update it here. // basically all this does is right-shift the history, // for pretty display. te->update(); // we dont delete the entry until the history has shifted // completely off. this way threads that have recently died // will still show up for a little while. if (te->any_nonzero_history() == false) { db.remove(te); if (te->pid != te->tid) { // the case we're dealing with here is when a thread // exits but the parent process does not -- must make // sure parent.db doesn't point to an object since deleted. tidEntry * pe = db.find(te->pid); // not finding it would be quite normal, // if a process exited and took all threads with it // there would be no parent.db to search. if (pe) pe->db.remove(te); } delete te; } } } } struct mySorterClass { Options::sort_type type; mySorterClass(Options::sort_type _type) : type(_type) { } bool operator() (const tidEntry * a, const tidEntry * b) { switch (type) { case Options::SORT_TID: return (a->tid < b->tid); case Options::SORT_PRIO: // sort first by prio if (a->prio < b->prio) return true; if (a->prio > b->prio) return false; // break a prio tie by thread id return (a->tid < b->tid); case Options::SORT_VSZ: // first by vsz if (a->vsz > b->vsz) return true; if (a->vsz < b->vsz) return false; return (a->tid < b->tid); case Options::SORT_RSS: // first by rss if (a->rss > b->rss) return true; if (a->rss < b->rss) return false; return (a->tid < b->tid); case Options::SORT_TIME: if (a->history[0] > b->history[0]) return true; if (a->history[0] < b->history[0]) return false; return (a->tid < b->tid); case Options::SORT_CMD: if (a->cmd < b->cmd) return true; if (a->cmd > b->cmd) return false; return (a->tid < b->tid); } // shouldn't be reached return false; } }; void PidList :: print(void) const { cout << home; int height = screen.height(); if (height < 0) { cout << "ERROR" << nl; return; } height--; // account for header row. height--; // account for TOTAL row at bottom // build list of things we want to print. // basically only things that have some CPU // time in the history to print. pidList_t::const_iterator lit; pidVec_t printList; for (lit = db.begin(); lit != db.end(); lit++) { tidEntry * te = *lit; if (te->any_nonzero_history()) printList.push_back(te); } // sort the list by priority, highest prio at the top. mySorterClass mySorter(opts.sort); std::sort(printList.begin(), printList.end(), mySorter); bool more = false; if ((int) printList.size() > height) { printList.resize(height); more = true; } // no, there IS no "nl" here. this code prints a nl // prior to each entry so the cursor always ends up // on the right of the last entry. cout << screen.header_color << " "; cout << ((opts.sort == Options::SORT_TID) ? "TID" : "tId"); cout << " "; cout << ((opts.sort == Options::SORT_CMD) ? "CMD" : "Cmd"); cout << " "; cout << ((opts.sort == Options::SORT_VSZ) ? "VSZ" : "Vsz"); cout << " "; cout << ((opts.sort == Options::SORT_RSS) ? "RSS" : "Rss"); cout << " "; cout << ((opts.sort == Options::SORT_PRIO) ? "PRIO" : "Prio"); cout << " "; cout << ((opts.sort == Options::SORT_TIME) ? "TIME" : "Time"); cout << " (10 sec history) 10av" << screen.normal_color; int totalCpu = 0; pidVec_t::iterator vit; for (vit = printList.begin(); vit != printList.end(); vit++) { tidEntry * te = *vit; cout << nl << setw(6) << te->tid; if (te->tid == te->pid) cout << "+"; else cout << " "; if (te->history[0] > 0) cout << screen.nonzero_cmd_color; else cout << screen.zero_cmd_color; cout << setw(16) << te->cmd << " " << screen.normal_color << setw(7) << te->vsz << " " << setw(7) << te->rss << " " << setw(4) << te->prio << " "; // sum and count the CPU history, for the 'average' column. int s = 0; int c = 0; if (te->history.size() > 0) if (te->history[0] > 0) totalCpu += te->history[0]; for (int ind = 0; ind < 10; ind++) { bool skip = false; int v = 0; if (ind >= (int) te->history.size()) skip = true; if (!skip) { v = te->history[ind]; // negative value means we've been // updating in the unstamped case // and this entry should not be counted // in the average. if (v < 0) skip = true; } if (skip) cout << " "; else { s += v; if (v == 0) cout << screen.zero_color; else cout << screen.nonzero_color; cout << setw(2) << v << " " << screen.normal_color; c++; } } if (c > 0) s /= c; cout << setw(2) << s; // average } cout << nl << screen.header_color << " 'h' for help TOTAL " << " " << setw(3) << totalCpu; if (more) cout << " MORE"; else cout << " "; cout << screen.normal_color; cout << erase; }
30.585014
79
0.492415
[ "object" ]
a604fac8c4dc11c3294c7bb2d9ed0660af3d52ef
4,759
hxx
C++
Code/Tools/Standalone/Source/Driller/Trace/TraceDrillerDialog.hxx
aaarsene/o3de
37e3b0226958974defd14dd6d808e8557dcd7345
[ "Apache-2.0", "MIT" ]
1
2021-09-13T00:01:12.000Z
2021-09-13T00:01:12.000Z
Code/Tools/Standalone/Source/Driller/Trace/TraceDrillerDialog.hxx
aaarsene/o3de
37e3b0226958974defd14dd6d808e8557dcd7345
[ "Apache-2.0", "MIT" ]
null
null
null
Code/Tools/Standalone/Source/Driller/Trace/TraceDrillerDialog.hxx
aaarsene/o3de
37e3b0226958974defd14dd6d808e8557dcd7345
[ "Apache-2.0", "MIT" ]
1
2021-07-20T11:07:25.000Z
2021-07-20T11:07:25.000Z
/* * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #ifndef TRACEDRILLERDIALOG_H #define TRACEDRILLERDIALOG_H #pragma once #if !defined(Q_MOC_RUN) #include <QtWidgets/QDialog> #include <QtGui/QIcon> #include <QtCore/QAbstractItemModel> #include <AzToolsFramework/UI/Logging/LogControl.h> #include "Source/Driller/DrillerMainWindowMessages.h" #include "Source/Driller/DrillerOperationTelemetryEvent.h" #endif namespace Ui { class TraceDrillerDialog; } // namespace Ui namespace AZ { class ReflectContext; } namespace Driller { class TraceFilterModel; class TraceMessageDataAggregator; class TraceDrillerLogModel; class TraceDrillerDialogSavedState; class TraceDrillerDialog : public QDialog { Q_OBJECT public: AZ_CLASS_ALLOCATOR(TraceDrillerDialog, AZ::SystemAllocator, 0); TraceDrillerDialog(TraceMessageDataAggregator* data, int profilerIndex, QWidget *pParent = NULL); virtual ~TraceDrillerDialog(); // NB: These three methods mimic the workspace bus. // Because the ProfilerDataAggregator can't know to open these DataView windows // until after the EBUS message has gone out, the owning aggregator must // first create these windows and then pass along the provider manually void ApplySettingsFromWorkspace(WorkspaceSettingsProvider*); void ActivateWorkspaceSettings(WorkspaceSettingsProvider*); void SaveSettingsToWorkspace(WorkspaceSettingsProvider*); void SaveOnExit(); virtual void closeEvent(QCloseEvent *evt); virtual void hideEvent(QHideEvent *evt); void ApplyPersistentState(); AZ::u32 m_windowStateCRC; AZ::u32 m_filterStateCRC; int m_viewIndex; // persistent state is used as if they were internal variables, // though they reside in a storage class // this lasts for the entire lifetime of this object AZStd::intrusive_ptr<TraceDrillerDialogSavedState> m_persistentState; public slots: void OnDataDestroyed(); void onTextChangeWindowFilter(const QString &); void onTextChangeMessageFilter(const QString &); void UpdateSummary(); protected: DrillerWindowLifepsanTelemetry m_lifespanTelemetry; Ui::TraceDrillerDialog* m_uiLoaded; TraceFilterModel* m_ptrFilter; TraceDrillerLogModel* m_ptrOriginalModel; public: static void Reflect(AZ::ReflectContext* context); }; class TraceDrillerLogTab : public AzToolsFramework::LogPanel::BaseLogView { Q_OBJECT; public: AZ_CLASS_ALLOCATOR(TraceDrillerLogTab, AZ::SystemAllocator, 0); TraceDrillerLogTab(QWidget *pParent = NULL); virtual ~TraceDrillerLogTab(); // return -1 for any of these to indicate that your data has no such column. // make sure your model has the same semantics! virtual int GetIconColumn() { return 0; } virtual int GetWindowColumn() { return 1; } virtual int GetMessageColumn() { return 2; } // you may not return -1 for this one. virtual int GetTimeColumn() { return -1; } using AzToolsFramework::LogPanel::BaseLogView::rowsInserted; public slots: void rowsAboutToBeInserted(); void rowsInserted (); protected: bool m_isScrollAfterInsert; }; class TraceDrillerLogModel : public QAbstractTableModel { Q_OBJECT; public: AZ_CLASS_ALLOCATOR(TraceDrillerLogModel, AZ::SystemAllocator, 0); //////////////////////////////////////////////////////////////////////////////////////////////// // QAbstractTableModel virtual int rowCount(const QModelIndex& index = QModelIndex()) const; virtual int columnCount(const QModelIndex& index = QModelIndex()) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual QVariant data(const QModelIndex& index, int role) const; //////////////////////////////////////////////////////////////////////////////////////////////// TraceDrillerLogModel(TraceMessageDataAggregator* data, QObject *pParent = NULL); virtual ~TraceDrillerLogModel(); public slots: void OnDataCurrentEventChanged(); void OnDataAddEvent(); protected: TraceMessageDataAggregator* m_data; AZ::s64 m_lastShownEvent; QIcon m_criticalIcon; QIcon m_errorIcon; QIcon m_warningIcon; QIcon m_informationIcon; }; } #endif
31.516556
158
0.661273
[ "object", "model", "3d" ]
a60cdbc5cf1cd06f9d314f1b9e024ff512e1e535
4,589
hh
C++
trick_source/er7_utils/integration/rk4/include/rk4_second_order_ode_integrator_base.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
647
2015-05-07T16:08:16.000Z
2022-03-30T02:33:21.000Z
trick_source/er7_utils/integration/rk4/include/rk4_second_order_ode_integrator_base.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
995
2015-04-30T19:44:31.000Z
2022-03-31T20:14:44.000Z
trick_source/er7_utils/integration/rk4/include/rk4_second_order_ode_integrator_base.hh
gilbertguoze/trick
f0537efb0fa3cb5c0c84e36b60f055c1d1c60d21
[ "NASA-1.3" ]
251
2015-05-15T09:24:34.000Z
2022-03-22T20:39:05.000Z
/** * @if Er7UtilsUseGroups * @addtogroup Er7Utils * @{ * @addtogroup Integration * @{ * @endif */ /** * @file * Defines the class RK4SecondOrderODEIntegrator, which integrates a state * comprising a zeroth derivative / first derivative pair via the RK4 method. */ /* Purpose: () */ #ifndef ER7_UTILS_RK4_TWO_STATE_INTEGRATOR_BASE_HH #define ER7_UTILS_RK4_TWO_STATE_INTEGRATOR_BASE_HH // System includes // Interface includes #include "er7_utils/interface/include/er7_class.hh" // Integration includes #include "er7_utils/integration/core/include/second_order_ode_integrator.hh" namespace er7_utils { /** * Base class for integrating a second order ODE using the standard * 4th order Runge-Kutta method. * This class also serves as the base for the second order ODE integrators * that use 4th order Runga-Kutta-Gill. */ class RK4SecondOrderODEIntegrator : public SecondOrderODEIntegrator { ER7_UTILS_MAKE_SIM_INTERFACES(RK4SecondOrderODEIntegrator) // Note: // This is an abstract class. // - The constructors for this class are protected. // - The assignment operator for this class is private / unimplemented. public: /** * RK4SecondOrderODEIntegrator destructor. */ virtual ~RK4SecondOrderODEIntegrator (void); protected: // Constructors. /** * RK4SecondOrderODEIntegrator default constructor. * Notes: * - This implicitly assumes the time derivative of position is velocity. * - This is needed so that Trick can checkpoint/restart its integrators. */ RK4SecondOrderODEIntegrator (void); /** * RK4SecondOrderODEIntegrator copy constructor. * @param[in] src Object to be copied. */ RK4SecondOrderODEIntegrator (const RK4SecondOrderODEIntegrator & src); /** * RK4SecondOrderODEIntegrator non-default constructor * for a simple second order ODE, one in which generalized velocity * is time derivative of generalized position. * @param[in] size State size * @param[in,out] controls Integration controls */ RK4SecondOrderODEIntegrator ( unsigned int size, IntegrationControls & controls); /** * RK4SecondOrderODEIntegrator non-default constructor * for a generalized second order ODE in which position is advanced * using the position derivative function. * @param[in] position_size Size of the generalized position * @param[in] velocity_size Size of the generalized velocity * @param[in] deriv_funs Position derivative functions container * @param[in,out] controls Integration controls */ RK4SecondOrderODEIntegrator ( unsigned int position_size, unsigned int velocity_size, const GeneralizedPositionDerivativeFunctions & deriv_funs, IntegrationControls & controls); /** * RK4SecondOrderODEIntegrator non-default constructor * for a generalized second order ODE in which position is advanced * using the position step function. * @param[in] position_size Size of the generalized position * @param[in] velocity_size Size of the generalized velocity * @param[in] step_funs Position step functions container * @param[in,out] controls Integration controls */ RK4SecondOrderODEIntegrator ( unsigned int position_size, unsigned int velocity_size, const GeneralizedPositionStepFunctions & step_funs, IntegrationControls & controls); // Member functions. /** * Non-throwing swap. * @param other Item with which contents are to be swapped. */ void swap (RK4SecondOrderODEIntegrator & other); using SecondOrderODEIntegrator::swap; // Member data. double * init_pos; /**< trick_units(--) @n Position at the start of an integration cycle. */ double * init_vel; /**< trick_units(--) @n Velocity at the start of an integration cycle. */ double * saved_pos; /**< trick_units(--) @n Position after stage 1. */ double * dtheta; /**< trick_units(--) @n Product of delta t and weighted sum of generalized velocities. */ double * posdot_hist[4]; /**< trick_units(--) @n Position derivatives at each step in the integration cycle. */ double * veldot_hist[4]; /**< trick_units(--) @n Velocity derivatives at each step in the integration cycle. */ private: /** * Not implemented. */ RK4SecondOrderODEIntegrator & operator= ( const RK4SecondOrderODEIntegrator &); }; } #endif /** * @if Er7UtilsUseGroups * @} * @} * @endif */
26.994118
77
0.694269
[ "object" ]
a61415e83a7c355419a215d713ce1f6ca8191590
8,079
cpp
C++
Labs/2_simple_calculator/2b_parser_plus_visitor_to_calculate/CalcLexer.cpp
MNXANL/GRAU-CL
862e404549bc061dee92e952b596dc0deab4416b
[ "MIT" ]
null
null
null
Labs/2_simple_calculator/2b_parser_plus_visitor_to_calculate/CalcLexer.cpp
MNXANL/GRAU-CL
862e404549bc061dee92e952b596dc0deab4416b
[ "MIT" ]
null
null
null
Labs/2_simple_calculator/2b_parser_plus_visitor_to_calculate/CalcLexer.cpp
MNXANL/GRAU-CL
862e404549bc061dee92e952b596dc0deab4416b
[ "MIT" ]
null
null
null
// Generated from Calc.g4 by ANTLR 4.7.1 #include "CalcLexer.h" using namespace antlr4; CalcLexer::CalcLexer(CharStream *input) : Lexer(input) { _interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); } CalcLexer::~CalcLexer() { delete _interpreter; } std::string CalcLexer::getGrammarFileName() const { return "Calc.g4"; } const std::vector<std::string>& CalcLexer::getRuleNames() const { return _ruleNames; } const std::vector<std::string>& CalcLexer::getChannelNames() const { return _channelNames; } const std::vector<std::string>& CalcLexer::getModeNames() const { return _modeNames; } const std::vector<std::string>& CalcLexer::getTokenNames() const { return _tokenNames; } dfa::Vocabulary& CalcLexer::getVocabulary() const { return _vocabulary; } const std::vector<uint16_t> CalcLexer::getSerializedATN() const { return _serializedATN; } const atn::ATN& CalcLexer::getATN() const { return _atn; } // Static vars and initialization. std::vector<dfa::DFA> CalcLexer::_decisionToDFA; atn::PredictionContextCache CalcLexer::_sharedContextCache; // We own the ATN which in turn owns the ATN states. atn::ATN CalcLexer::_atn; std::vector<uint16_t> CalcLexer::_serializedATN; std::vector<std::string> CalcLexer::_ruleNames = { u8"T__0", u8"T__1", u8"T__2", u8"COMMA", u8"ABS", u8"MAX", u8"MIN", u8"SUM", u8"PROD", u8"FACT", u8"DIV", u8"MUL", u8"SUB", u8"ADD", u8"ID", u8"INT", u8"NEWLINE", u8"WS" }; std::vector<std::string> CalcLexer::_channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; std::vector<std::string> CalcLexer::_modeNames = { u8"DEFAULT_MODE" }; std::vector<std::string> CalcLexer::_literalNames = { "", u8"'='", u8"'('", u8"')'", u8"','", u8"'abs'", u8"'max'", u8"'min'", u8"'sum'", u8"'prod'", u8"'!'", u8"'/'", u8"'*'", u8"'-'", u8"'+'" }; std::vector<std::string> CalcLexer::_symbolicNames = { "", "", "", "", u8"COMMA", u8"ABS", u8"MAX", u8"MIN", u8"SUM", u8"PROD", u8"FACT", u8"DIV", u8"MUL", u8"SUB", u8"ADD", u8"ID", u8"INT", u8"NEWLINE", u8"WS" }; dfa::Vocabulary CalcLexer::_vocabulary(_literalNames, _symbolicNames); std::vector<std::string> CalcLexer::_tokenNames; CalcLexer::Initializer::Initializer() { // This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there. for (size_t i = 0; i < _symbolicNames.size(); ++i) { std::string name = _vocabulary.getLiteralName(i); if (name.empty()) { name = _vocabulary.getSymbolicName(i); } if (name.empty()) { _tokenNames.push_back("<INVALID>"); } else { _tokenNames.push_back(name); } } _serializedATN = { 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, 0x2, 0x14, 0x64, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, 0xb, 0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe, 0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, 0x9, 0x10, 0x4, 0x11, 0x9, 0x11, 0x4, 0x12, 0x9, 0x12, 0x4, 0x13, 0x9, 0x13, 0x3, 0x2, 0x3, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x4, 0x3, 0x5, 0x3, 0x5, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x8, 0x3, 0x8, 0x3, 0x8, 0x3, 0x8, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xa, 0x3, 0xb, 0x3, 0xb, 0x3, 0xc, 0x3, 0xc, 0x3, 0xd, 0x3, 0xd, 0x3, 0xe, 0x3, 0xe, 0x3, 0xf, 0x3, 0xf, 0x3, 0x10, 0x6, 0x10, 0x50, 0xa, 0x10, 0xd, 0x10, 0xe, 0x10, 0x51, 0x3, 0x11, 0x6, 0x11, 0x55, 0xa, 0x11, 0xd, 0x11, 0xe, 0x11, 0x56, 0x3, 0x12, 0x5, 0x12, 0x5a, 0xa, 0x12, 0x3, 0x12, 0x3, 0x12, 0x3, 0x13, 0x6, 0x13, 0x5f, 0xa, 0x13, 0xd, 0x13, 0xe, 0x13, 0x60, 0x3, 0x13, 0x3, 0x13, 0x2, 0x2, 0x14, 0x3, 0x3, 0x5, 0x4, 0x7, 0x5, 0x9, 0x6, 0xb, 0x7, 0xd, 0x8, 0xf, 0x9, 0x11, 0xa, 0x13, 0xb, 0x15, 0xc, 0x17, 0xd, 0x19, 0xe, 0x1b, 0xf, 0x1d, 0x10, 0x1f, 0x11, 0x21, 0x12, 0x23, 0x13, 0x25, 0x14, 0x3, 0x2, 0x5, 0x4, 0x2, 0x43, 0x5c, 0x63, 0x7c, 0x3, 0x2, 0x32, 0x3b, 0x4, 0x2, 0xb, 0xb, 0x22, 0x22, 0x2, 0x67, 0x2, 0x3, 0x3, 0x2, 0x2, 0x2, 0x2, 0x5, 0x3, 0x2, 0x2, 0x2, 0x2, 0x7, 0x3, 0x2, 0x2, 0x2, 0x2, 0x9, 0x3, 0x2, 0x2, 0x2, 0x2, 0xb, 0x3, 0x2, 0x2, 0x2, 0x2, 0xd, 0x3, 0x2, 0x2, 0x2, 0x2, 0xf, 0x3, 0x2, 0x2, 0x2, 0x2, 0x11, 0x3, 0x2, 0x2, 0x2, 0x2, 0x13, 0x3, 0x2, 0x2, 0x2, 0x2, 0x15, 0x3, 0x2, 0x2, 0x2, 0x2, 0x17, 0x3, 0x2, 0x2, 0x2, 0x2, 0x19, 0x3, 0x2, 0x2, 0x2, 0x2, 0x1b, 0x3, 0x2, 0x2, 0x2, 0x2, 0x1d, 0x3, 0x2, 0x2, 0x2, 0x2, 0x1f, 0x3, 0x2, 0x2, 0x2, 0x2, 0x21, 0x3, 0x2, 0x2, 0x2, 0x2, 0x23, 0x3, 0x2, 0x2, 0x2, 0x2, 0x25, 0x3, 0x2, 0x2, 0x2, 0x3, 0x27, 0x3, 0x2, 0x2, 0x2, 0x5, 0x29, 0x3, 0x2, 0x2, 0x2, 0x7, 0x2b, 0x3, 0x2, 0x2, 0x2, 0x9, 0x2d, 0x3, 0x2, 0x2, 0x2, 0xb, 0x2f, 0x3, 0x2, 0x2, 0x2, 0xd, 0x33, 0x3, 0x2, 0x2, 0x2, 0xf, 0x37, 0x3, 0x2, 0x2, 0x2, 0x11, 0x3b, 0x3, 0x2, 0x2, 0x2, 0x13, 0x3f, 0x3, 0x2, 0x2, 0x2, 0x15, 0x44, 0x3, 0x2, 0x2, 0x2, 0x17, 0x46, 0x3, 0x2, 0x2, 0x2, 0x19, 0x48, 0x3, 0x2, 0x2, 0x2, 0x1b, 0x4a, 0x3, 0x2, 0x2, 0x2, 0x1d, 0x4c, 0x3, 0x2, 0x2, 0x2, 0x1f, 0x4f, 0x3, 0x2, 0x2, 0x2, 0x21, 0x54, 0x3, 0x2, 0x2, 0x2, 0x23, 0x59, 0x3, 0x2, 0x2, 0x2, 0x25, 0x5e, 0x3, 0x2, 0x2, 0x2, 0x27, 0x28, 0x7, 0x3f, 0x2, 0x2, 0x28, 0x4, 0x3, 0x2, 0x2, 0x2, 0x29, 0x2a, 0x7, 0x2a, 0x2, 0x2, 0x2a, 0x6, 0x3, 0x2, 0x2, 0x2, 0x2b, 0x2c, 0x7, 0x2b, 0x2, 0x2, 0x2c, 0x8, 0x3, 0x2, 0x2, 0x2, 0x2d, 0x2e, 0x7, 0x2e, 0x2, 0x2, 0x2e, 0xa, 0x3, 0x2, 0x2, 0x2, 0x2f, 0x30, 0x7, 0x63, 0x2, 0x2, 0x30, 0x31, 0x7, 0x64, 0x2, 0x2, 0x31, 0x32, 0x7, 0x75, 0x2, 0x2, 0x32, 0xc, 0x3, 0x2, 0x2, 0x2, 0x33, 0x34, 0x7, 0x6f, 0x2, 0x2, 0x34, 0x35, 0x7, 0x63, 0x2, 0x2, 0x35, 0x36, 0x7, 0x7a, 0x2, 0x2, 0x36, 0xe, 0x3, 0x2, 0x2, 0x2, 0x37, 0x38, 0x7, 0x6f, 0x2, 0x2, 0x38, 0x39, 0x7, 0x6b, 0x2, 0x2, 0x39, 0x3a, 0x7, 0x70, 0x2, 0x2, 0x3a, 0x10, 0x3, 0x2, 0x2, 0x2, 0x3b, 0x3c, 0x7, 0x75, 0x2, 0x2, 0x3c, 0x3d, 0x7, 0x77, 0x2, 0x2, 0x3d, 0x3e, 0x7, 0x6f, 0x2, 0x2, 0x3e, 0x12, 0x3, 0x2, 0x2, 0x2, 0x3f, 0x40, 0x7, 0x72, 0x2, 0x2, 0x40, 0x41, 0x7, 0x74, 0x2, 0x2, 0x41, 0x42, 0x7, 0x71, 0x2, 0x2, 0x42, 0x43, 0x7, 0x66, 0x2, 0x2, 0x43, 0x14, 0x3, 0x2, 0x2, 0x2, 0x44, 0x45, 0x7, 0x23, 0x2, 0x2, 0x45, 0x16, 0x3, 0x2, 0x2, 0x2, 0x46, 0x47, 0x7, 0x31, 0x2, 0x2, 0x47, 0x18, 0x3, 0x2, 0x2, 0x2, 0x48, 0x49, 0x7, 0x2c, 0x2, 0x2, 0x49, 0x1a, 0x3, 0x2, 0x2, 0x2, 0x4a, 0x4b, 0x7, 0x2f, 0x2, 0x2, 0x4b, 0x1c, 0x3, 0x2, 0x2, 0x2, 0x4c, 0x4d, 0x7, 0x2d, 0x2, 0x2, 0x4d, 0x1e, 0x3, 0x2, 0x2, 0x2, 0x4e, 0x50, 0x9, 0x2, 0x2, 0x2, 0x4f, 0x4e, 0x3, 0x2, 0x2, 0x2, 0x50, 0x51, 0x3, 0x2, 0x2, 0x2, 0x51, 0x4f, 0x3, 0x2, 0x2, 0x2, 0x51, 0x52, 0x3, 0x2, 0x2, 0x2, 0x52, 0x20, 0x3, 0x2, 0x2, 0x2, 0x53, 0x55, 0x9, 0x3, 0x2, 0x2, 0x54, 0x53, 0x3, 0x2, 0x2, 0x2, 0x55, 0x56, 0x3, 0x2, 0x2, 0x2, 0x56, 0x54, 0x3, 0x2, 0x2, 0x2, 0x56, 0x57, 0x3, 0x2, 0x2, 0x2, 0x57, 0x22, 0x3, 0x2, 0x2, 0x2, 0x58, 0x5a, 0x7, 0xf, 0x2, 0x2, 0x59, 0x58, 0x3, 0x2, 0x2, 0x2, 0x59, 0x5a, 0x3, 0x2, 0x2, 0x2, 0x5a, 0x5b, 0x3, 0x2, 0x2, 0x2, 0x5b, 0x5c, 0x7, 0xc, 0x2, 0x2, 0x5c, 0x24, 0x3, 0x2, 0x2, 0x2, 0x5d, 0x5f, 0x9, 0x4, 0x2, 0x2, 0x5e, 0x5d, 0x3, 0x2, 0x2, 0x2, 0x5f, 0x60, 0x3, 0x2, 0x2, 0x2, 0x60, 0x5e, 0x3, 0x2, 0x2, 0x2, 0x60, 0x61, 0x3, 0x2, 0x2, 0x2, 0x61, 0x62, 0x3, 0x2, 0x2, 0x2, 0x62, 0x63, 0x8, 0x13, 0x2, 0x2, 0x63, 0x26, 0x3, 0x2, 0x2, 0x2, 0x7, 0x2, 0x51, 0x56, 0x59, 0x60, 0x3, 0x8, 0x2, 0x2, }; atn::ATNDeserializer deserializer; _atn = deserializer.deserialize(_serializedATN); size_t count = _atn.getNumberOfDecisions(); _decisionToDFA.reserve(count); for (size_t i = 0; i < count; i++) { _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); } } CalcLexer::Initializer CalcLexer::_init;
42.973404
120
0.617527
[ "vector" ]
a61a43870793d313dbdd330ddc96ed70a71b32c7
1,777
cpp
C++
leetcode.com/0956 Tallest Billboard/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
1
2020-08-20T11:02:49.000Z
2020-08-20T11:02:49.000Z
leetcode.com/0956 Tallest Billboard/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
null
null
null
leetcode.com/0956 Tallest Billboard/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
1
2022-01-01T23:23:13.000Z
2022-01-01T23:23:13.000Z
#include <iostream> #include <numeric> #include <unordered_map> #include <vector> using namespace std; // ref: Java knapsack O(N*sum) // https://leetcode.com/problems/tallest-billboard/discuss/203261/Java-knapsack-O(N*sum) // class Solution { // public: // int tallestBillboard(vector<int>& rods) { // int n = rods.size(); // unordered_map<int, int> dp; // dp[0] = 0; // for (int x : rods) { // unordered_map<int, int> cur; // for (auto& p : dp) { // cur[p.first - x] = max(p.second, cur[p.first - x]); // cur[p.first] = max(p.second, cur[p.first]); // cur[p.first + x] = max(p.second + x, cur[p.first + x]); // } // dp = cur; // } // return dp[0]; // } // }; class Solution { public: int tallestBillboard(vector<int>& rods) { int n = rods.size(); int sum = accumulate(rods.begin(), rods.end(), 0); vector<vector<int>> dp(n + 1, vector<int>(sum + 1)); vector<vector<bool>> vis(n + 1, vector<bool>(sum + 1)); vis[0][sum / 2] = true; for (int i = 0; i < n; ++i) { for (int j = 0; j <= sum; ++j) { if (j - rods[i] >= 0 && vis[i][j - rods[i]]) { vis[i + 1][j] = true; dp[i + 1][j] = max(dp[i][j - rods[i]] /* + rods[i] */, dp[i + 1][j]); } if (vis[i][j]) { vis[i + 1][j] = true; dp[i + 1][j] = max(dp[i][j], dp[i + 1][j]); } if (j + rods[i] <= sum && vis[i][j + rods[i]]) { vis[i + 1][j] = true; dp[i + 1][j] = max(dp[i][j + rods[i]] + rods[i], dp[i + 1][j]); } } } return dp[n][sum / 2]; } }; int main(int argc, char const* argv[]) { Solution s; vector<int> rods = {1, 2, 3, 6}; cout << s.tallestBillboard(rods) << endl; return 0; }
28.206349
88
0.47946
[ "vector" ]
a61ec61188c3e6e05a0c7d133a5c8cfd8d8a7a7c
3,878
hpp
C++
src/lib/sql/lru_k_cache.hpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
1
2021-04-14T11:16:52.000Z
2021-04-14T11:16:52.000Z
src/lib/sql/lru_k_cache.hpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
null
null
null
src/lib/sql/lru_k_cache.hpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
1
2020-11-30T13:11:04.000Z
2020-11-30T13:11:04.000Z
#pragma once #include <list> #include <unordered_map> #include <utility> #include <vector> #include "abstract_cache.hpp" #include "boost/heap/fibonacci_heap.hpp" namespace opossum { // Generic cache implementation using the LRU-K policy. // When an item should be evicted the item with the largest backward k-distance is evicted. // This is the item whose k-th most recent access is the furthest in the past. // Note: This implementation is not thread-safe. template <size_t K, typename Key, typename Value> class LRUKCache : public AbstractCache<Key, Value> { public: // Entries within the LRU-K cache. // They keep a reference history of the K last accesses. class LRUKCacheEntry { public: Key key; Value value; // Reference history, ordered with the least-recent access at the beginning. std::vector<size_t> history; // Adds an entry to the history list of the cache entry. // If the history has K elements, all items are shifted left // and the new entry is added at the end. void add_history_entry(size_t current_access_counter) { if (history.size() < K) { history.push_back(current_access_counter); return; } for (size_t i = K - 1; i > 0; --i) { history[i - 1] = history[i]; } history[K - 1] = current_access_counter; } // The underlying heap in the LRU-K cache is a max-heap. // The item with the largest backward k-distance should be at the top. // This is the item with the lowest k-th most recent access number. // If the history of both items is not equally long, the item with the shorter history is evicted. bool operator<(const LRUKCacheEntry& other) const { if (history.size() != other.history.size()) { return history.size() > other.history.size(); } return history[0] > other.history[0]; } }; typedef LRUKCacheEntry entry_t; typedef typename boost::heap::fibonacci_heap<entry_t>::handle_type handle_t; explicit LRUKCache(size_t capacity) : AbstractCache<Key, Value>(capacity), _access_counter(0) {} void set(const Key& key, const Value& value, double cost = 1.0, double size = 1.0) { ++_access_counter; auto it = _map.find(key); if (it != _map.end()) { // Update entry. handle_t handle = it->second; entry_t& entry = (*handle); entry.value = value; entry.add_history_entry(_access_counter); _queue.update(handle); return; } // If the cache is full, erase the item at the top of the heap // so that we can insert the new item. if (_queue.size() >= this->_capacity) { _evict(); } // Insert new item in cache. entry_t entry{key, value, {_access_counter}}; handle_t handle = _queue.push(entry); _map[key] = handle; } Value& get(const Key& key) { ++_access_counter; auto it = _map.find(key); handle_t handle = it->second; entry_t& entry = (*handle); entry.add_history_entry(_access_counter); _queue.update(handle); return entry.value; } bool has(const Key& key) const { return _map.find(key) != _map.end(); } size_t size() const { return _map.size(); } void clear() { _map.clear(); _queue.clear(); } void resize(size_t capacity) { while (_queue.size() > capacity) { _evict(); } this->_capacity = capacity; } const boost::heap::fibonacci_heap<entry_t>& queue() const { return _queue; } protected: // Priority queue to hold all elements. Implemented as max-heap. boost::heap::fibonacci_heap<entry_t> _queue; // Map to point towards element in the list. std::unordered_map<Key, handle_t> _map; // Running counter to keep track of the reference history. size_t _access_counter; void _evict() { auto top = _queue.top(); _map.erase(top.key); _queue.pop(); } }; } // namespace opossum
28.306569
102
0.658845
[ "vector" ]
a6218868551ec5ce990cff885c74eeac0e4dc6b0
986
cpp
C++
1045.cpp
hgfeaon/PAT
3210bdab10eba77b69cdfb7a3c68638f9b7af5ac
[ "BSD-3-Clause" ]
null
null
null
1045.cpp
hgfeaon/PAT
3210bdab10eba77b69cdfb7a3c68638f9b7af5ac
[ "BSD-3-Clause" ]
null
null
null
1045.cpp
hgfeaon/PAT
3210bdab10eba77b69cdfb7a3c68638f9b7af5ac
[ "BSD-3-Clause" ]
null
null
null
#include <cstdio> #include <cstdlib> #include <vector> using namespace std; int max(int a, int b) {return a>b?a:b;} int main() { int N, M, L, tmp; scanf("%d", &N); scanf("%d", &M); if (M < 1) return 0; vector<char> MColors(M); for (int i=0; i<M; i++) { scanf("%d", &tmp); MColors[i] = tmp; } scanf("%d", &L); if (L < 1) return 0; vector<char> LColors(L); for (int i=0; i<L; i++) { scanf("%d", &tmp); LColors[i] = tmp; } int cols = M + 1; vector<int> curr_row(cols, 0); vector<int> next_row(cols, 0); for (int i = L-1; i >=0; i--) { for (int j = M - 1; j>=0; j--) { if (MColors[j] == LColors[i]) { curr_row[j] = next_row[j] + 1; } else { curr_row[j] = max(next_row[j], curr_row[j + 1]); } } swap(curr_row, next_row); } printf("%d\n", next_row[0]); return 0; }
20.122449
64
0.43712
[ "vector" ]
98b007a4ec77317122de998ea811b02b28ddb136
6,192
cpp
C++
World.cpp
Aroueterra/RPG_Framework
8bfb35d540890787f6b04ebe487d2ce7e323f8b7
[ "MIT" ]
5
2018-10-01T10:16:17.000Z
2022-02-09T01:21:30.000Z
World.cpp
Aroueterra/RPG_Framework
8bfb35d540890787f6b04ebe487d2ce7e323f8b7
[ "MIT" ]
null
null
null
World.cpp
Aroueterra/RPG_Framework
8bfb35d540890787f6b04ebe487d2ce7e323f8b7
[ "MIT" ]
null
null
null
#include "World.h" #include "Painter.h" using std::string; using std::vector; using std::cout; using std::cin; using std::endl; WorldMap::WorldMap() {} Room::Room(string title, string description, int n) { Title = title; Description = description; Code = n; } Room::Room() {} GameState::GameState() {} //Room::Room(string title, string description, int code); void WorldMap::Reveal(int player_y, int player_x) { Colorize Format; int Tile; if (replacedCounter>0) { for (int y = 0, x = 0; y < 10;) { if (Map[y][x] == 20) Map[y][x] = replaced_Tile; x++; if (x == 40 && y != 10) { y++; cout << endl; x = 0; } } } else { replacedCounter++; } replaced_Tile = Map[player_y][player_x]; Map[player_y][player_x] = 20; //Format.Pseudo_Clear(5); Format.WorldPaint(9, "[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~("); Format.WorldPaint(14, " EBERON "); Format.WorldPaint(9, ")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]\n"); for (int y = 0, x = 0; y < 10;) { cout << " "; switch (Map[y][x]) { case 1: Format.WorldPaint(15, "^"); break; case 2: Format.WorldPaint(2, "*"); break; case 3: Format.WorldPaint(2, "*"); break; case 4: Format.WorldPaint(10, "*"); break; case 5: Format.WorldPaint(3, "~"); break; case 6: Format.WorldPaint(14, "#"); break; case 7: Format.WorldPaint(13, "I"); break; case 8: Format.WorldPaint(14, "O"); break; case 9: Format.WorldPaint(14, "="); break; case 10: Format.WorldPaint(6, "."); break; case 11: Format.WorldPaint(13, "="); break; case 12: Format.WorldPaint(9, "~"); break; case 13: Format.WorldPaint(6, "="); break; case 14: Format.WorldPaint(8, "I"); break; case 15: Format.WorldPaint(0, "="); break; case 20: Format.WorldPaint(13, "@"); break; } x++; if (x == 40 && y != 10) { y++; cout << endl; x = 0; } } Format.WorldPaint(9, "[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~("); Format.WorldPaint(15, " WEST MAP "); Format.WorldPaint(9, ")~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]\n"); } int WorldMap::get_Map_Tile(int y, int x) { return Map[y][x]; } string forest_Description = "\nThis forest has seen better days, you reckon.\nYou are surrounded on each side by rows of tall evergreen trees.\nOut of the corner of your eye, you can spot animals darting through the shadows.\nIt would be best if you did not have to stay any longer.\n"; string grass_Description = "\nThe tall grass blocks your vision and your feet sink deep into mud.\nDespite the uneven footing, you can make your way across. Several insects inhabit this marsh.\n"; string road_Description = "\nThe royal road to New Estera is frequented by merchants and travellers alike.\nYour journey will take you away from the comforts of this castle.\nYou should be able to avoid any monster encounters if you stick to the road.\n"; string sand_Description = "\nLow sand and gravel make easy travel. Small creatures tend to hide themselves \nunder the pockets of sand here, best avoid resting anytime soon.\nYou quicken your stride.\n"; string bridge_Description = "\nA thin mist smoothes over the rickety wooden bridge.\nThe river beneath roars furiously, and constantly licks against the railing.\nYou try not to fall through the cracks.\n"; string farm_Description = "\nThis plot of land has been struck by a serious case of drought.]nWhat was once full of greenery and life is now a barren waste.\nPerhaps this was the doing of evil, not nature?\n"; string door_Description = "\nYou stand before a massive oaken door. \nYou can hear feet shuffling inside, enter?\n"; Room Forest("|Rain Forest", forest_Description, 4); Room Grass("|Suspicious Grass", grass_Description, 3); Room Road("|Royal Road", road_Description, 6); Room Sand("|Sandy Shore", sand_Description, 10); Room Bridge("|Old Bridge", bridge_Description, 9); Room Door("|Massive Door", door_Description, 8); Room Farm("|Farmlands", farm_Description, 8); void Room::get_Info(int tile) { Colorize Format; switch (tile) { case 2: case 4: Format.WorldPaint(14, Forest.get_Title()); Format.WorldPaint(1, "---------------------------------------------------------------------|\n"); Format.WorldPaint(15, Forest.get_Description()); break; case 3: Format.WorldPaint(14, Grass.get_Title()); Format.WorldPaint(1, "---------------------------------------------------------------------|\n"); Format.WorldPaint(15, Grass.get_Description()); break; case 6: Format.WorldPaint(14, Road.get_Title()); Format.WorldPaint(1, "---------------------------------------------------------------------|\n"); Format.WorldPaint(15, Road.get_Description()); break; case 8: Format.WorldPaint(14, Door.get_Title()); Format.WorldPaint(1, "---------------------------------------------------------------------|\n"); Format.WorldPaint(15, Door.get_Description()); break; case 9: Format.WorldPaint(14, Bridge.get_Title()); Format.WorldPaint(1, "--------------------------------------------------------------------|\n"); Format.WorldPaint(15, Bridge.get_Description()); break; case 10: Format.WorldPaint(14, Sand.get_Title()); Format.WorldPaint(1, "--------------------------------------------------------------------|\n"); Format.WorldPaint(15, Sand.get_Description()); break; case 13: Format.WorldPaint(14, Farm.get_Title()); Format.WorldPaint(1, "--------------------------------------------------------------------|\n"); Format.WorldPaint(15, Farm.get_Description()); break; } } string Room::get_Title() { return Title; } int Room::get_Code() { return Code; } string Room::get_Description() { return Description; } vector<Monster> GameState::get_MonsterCache() { if (!MonsterCache.empty()) { vector<Monster> list = MonsterCache; return list; } else vector<Monster> list; } void GameState::list_Monster(Monster monster) { MonsterListing.clear(); MonsterListing.push_back(monster.get_Name()); } void GameState::kill_MonsterCache() { Monster monster; } void GameState::fill_MonsterCache(Monster monster) { MonsterCache.push_back(monster); } void GameState::empty_MonsterCache() { MonsterCache.clear(); }
30.653465
286
0.609658
[ "vector" ]
98b76b066820511f112311d8d44e39752e3df296
3,837
cpp
C++
src/swift2d/materials/Shader.cpp
Simmesimme/swift2d
147a862208dee56f972361b5325009e020124137
[ "MIT" ]
null
null
null
src/swift2d/materials/Shader.cpp
Simmesimme/swift2d
147a862208dee56f972361b5325009e020124137
[ "MIT" ]
null
null
null
src/swift2d/materials/Shader.cpp
Simmesimme/swift2d
147a862208dee56f972361b5325009e020124137
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////// // // // This file is part of Swift2D. // // // // Copyright: (c) 2011-2015 Simon Schneegans & Felix Lauer // // // // This software may be modified and distributed under the terms // // of the MIT license. See the LICENSE file for details. // // // //////////////////////////////////////////////////////////////////////////////// // includes ------------------------------------------------------------------- #include <swift2d/materials/Shader.hpp> #include <swift2d/utils/Logger.hpp> #include <swift2d/materials/ShaderIncludes.hpp> namespace swift { //////////////////////////////////////////////////////////////////////////////// Shader::Shader(std::string const& v_source, std::string const& f_source, std::string const& g_source, std::vector<std::string> const& transform_feedback_varyings) : dirty_(true) , v_source_(v_source) , f_source_(f_source) , g_source_(g_source) , transform_feedback_varyings_(transform_feedback_varyings) {} //////////////////////////////////////////////////////////////////////////////// void Shader::set_sources(std::string const& v_source, std::string const& f_source, std::string const& g_source, std::vector<std::string> const& transform_feedback_varyings) { dirty_ = true; v_source_ = v_source; f_source_ = f_source; g_source_ = g_source; transform_feedback_varyings_ = transform_feedback_varyings; } //////////////////////////////////////////////////////////////////////////////// void Shader::upload() const { dirty_ = false; ShaderIncludes::get().process(v_source_); ShaderIncludes::get().process(f_source_); ShaderIncludes::get().process(g_source_); // set the vertex shader source v_shader_.Source(v_source_); try { v_shader_.Compile(); } catch (oglplus::CompileError& e) { LOG_ERROR << "Failed to compile Vertex Shader!" << std::endl; LOG_ERROR << e.Log() << std::endl; } program_.AttachShader(v_shader_); // set the fragment shader source if (f_source_ != "") { f_shader_.Source(f_source_); try { f_shader_.Compile(); } catch (oglplus::CompileError& e) { LOG_ERROR << "Failed to compile Fragment Shader!" << std::endl; LOG_ERROR << e.Log() << std::endl; } program_.AttachShader(f_shader_); } // set the geometry shader source if (g_source_ != "") { g_shader_.Source(g_source_); try { g_shader_.Compile(); } catch (oglplus::CompileError& e) { LOG_ERROR << "Failed to compile Geometry Shader!" << std::endl; LOG_ERROR << e.Log() << std::endl; } program_.AttachShader(g_shader_); } // add transform feedback varyings if (transform_feedback_varyings_.size() > 0) { program_.TransformFeedbackVaryings( transform_feedback_varyings_, oglplus::TransformFeedbackMode::InterleavedAttribs ); } // link and use it try { program_.Link(); } catch (oglplus::LinkError& e) { LOG_ERROR << "Failed to link Shader!" << std::endl; LOG_ERROR << e.Log() << std::endl; } } //////////////////////////////////////////////////////////////////////////////// void Shader::use() const { // upload to GPU if neccessary if (dirty_) { upload(); } program_.Use(); } //////////////////////////////////////////////////////////////////////////////// }
30.943548
80
0.477196
[ "geometry", "vector", "transform" ]
98b9cdd2422a3ef2726a248fd74884d73e49016c
3,681
cpp
C++
Project2DFX/searchlights.cpp
RusJJ/AMLMods_GTASA
1ed9fb23b373c6407d722b30ab0420ee74be37fb
[ "MIT" ]
7
2021-08-17T09:25:28.000Z
2021-12-02T03:16:58.000Z
Project2DFX/searchlights.cpp
sugoma245/AMLMods_GTASA
7cdf312098ba0c166ab873e978c906021d972f08
[ "MIT" ]
1
2021-08-21T12:38:04.000Z
2021-08-21T16:19:32.000Z
Project2DFX/searchlights.cpp
sugoma245/AMLMods_GTASA
7cdf312098ba0c166ab873e978c906021d972f08
[ "MIT" ]
1
2021-08-16T15:05:10.000Z
2021-08-16T15:05:10.000Z
#include <searchlights.h> #include <cmath> #include <stdint.h> extern float* flWeatherFoggyness; extern int* nActiveInterior; extern void* TheCamera; extern uintptr_t pGTASA; extern char(*GetIsTimeInRange)(char hourA, char hourB); std::vector<CLamppostInfo> Lampposts; std::map<unsigned int, CLamppostInfo> FileContent; std::vector<CLamppostInfo>* m_pLampposts = &Lampposts; std::map<unsigned int, CLamppostInfo>* pFileContent = &FileContent; extern float fSearchlightEffectVisibilityFactor; void CSearchLights::RenderSearchLightsSA() { /* It needs a full rework */ /*if(*flWeatherFoggyness) { if (GetIsTimeInRange(20, 7) && *nActiveInterior == 0) { static auto SetRenderStatesForSpotLights = (void(*)()) (pGTASA + 0x194980); SetRenderStatesForSpotLights(); // 0x952126 word_952126 // 0x95275C word_95275C for (auto it = m_pLampposts->cbegin(); it != m_pLampposts->cend(); ++it) { if (it->nDrawSearchlight) { // CCamera* + 2264 = m_pRwCamera CVector* pCamPos = (&TheCamera + 2264); float fDistSqr = (pCamPos->x - it->vecPos.x)*(pCamPos->x - it->vecPos.x) + (pCamPos->y - it->vecPos.y)*(pCamPos->y - it->vecPos.y) + (pCamPos->z - it->vecPos.z)*(pCamPos->z - it->vecPos.z); if ((fDistSqr > 50.0f*50.0f) && (fDistSqr < 300.0f*300.0f)) { float fVisibility = fSearchlightEffectVisibilityFactor * ((0.0233333f)*sqrt(fDistSqr) - 1.16667f); RwV3D EndPoint = *(RwV3D*)&it->vecPos; EndPoint.z = CLODLightManager::SA::FindGroundZFor3DCoord(it->vecPos.x, it->vecPos.y, it->vecPos.z, 0, 0); if (!(it->colour.r == 255 && it->colour.g == 255 && it->colour.b == 255) && !(it->colour.r == 254 && it->colour.g == 117 && it->colour.b == 134)) { //yellow DrawCustomSpotLightSA(*(RwV3D*)&it->vecPos, EndPoint, min((8.0f * (it->vecPos.z - EndPoint.z)), 90.0f), it->fCustomSizeMult / 6.0f, 5.0f, 8, fVisibility); } else if (!(it->colour.r == 254 && it->colour.g == 117 && it->colour.b == 134)) { //white DrawCustomSpotLightSA(*(RwV3D*)&it->vecPos, EndPoint, min((8.0f * (it->vecPos.z - EndPoint.z)), 90.0f), it->fCustomSizeMult / 6.0f, 255.0f, 8, fVisibility); } else { //pink DrawCustomSpotLightSA(*(RwV3D*)&it->vecPos, EndPoint, min((8.0f * (it->vecPos.z - EndPoint.z)), 90.0f), it->fCustomSizeMult / 6.0f, 200.0f, 18, fVisibility); } } } } static auto ResetRenderStatesForSpotLights = (void(*)()) (pGTASA + 0x196C1C); ResetRenderStatesForSpotLights(); } }*/ } void CSearchLights::DrawCustomSpotLightSA(RwV3D StartPoint, RwV3D EndPoint, float TargetRadius, float baseRadius, float slColorFactor1, char slColorFactor2, float slAlpha) { } void CSearchLights::RegisterLamppost(CEntity* pObj) { /*unsigned short nModelID = pObj->GetModelIndex(); CMatrix dummyMatrix; CSimpleTransform& objTransform = pObj->GetTransform(); if (objTransform.m_translate.x == 0.0f && objTransform.m_translate.y == 0.0f) return; dummyMatrix.SetTranslateOnly(objTransform.m_translate.x, objTransform.m_translate.y, objTransform.m_translate.z); dummyMatrix.SetRotateZOnly(objTransform.m_heading); auto itEnd = pFileContent->upper_bound(PackKey(nModelID, 0xFFFF)); for (auto it = pFileContent->lower_bound(PackKey(nModelID, 0)); it != itEnd; it++) m_pLampposts->push_back(CLamppostInfo(dummyMatrix * it->second.vecPos, it->second.colour, it->second.fCustomSizeMult, it->second.nCoronaShowMode, it->second.nNoDistance, it->second.nDrawSearchlight, pObj->GetTransform().m_heading)); */}
39.580645
240
0.656343
[ "vector" ]
98be428dd58c3804cd6f0c049c585a23d53a30d0
1,650
cpp
C++
android-28/android/view/accessibility/CaptioningManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
12
2020-03-26T02:38:56.000Z
2022-03-14T08:17:26.000Z
android-29/android/view/accessibility/CaptioningManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
1
2021-01-27T06:07:45.000Z
2021-11-13T19:19:43.000Z
android-29/android/view/accessibility/CaptioningManager.cpp
YJBeetle/QtAndroidAPI
1468b5dc6eafaf7709f0b00ba1a6ec2b70684266
[ "Apache-2.0" ]
3
2021-02-02T12:34:55.000Z
2022-03-08T07:45:57.000Z
#include "../../content/Context.hpp" #include "./CaptioningManager_CaptionStyle.hpp" #include "./CaptioningManager_CaptioningChangeListener.hpp" #include "../../../java/util/Locale.hpp" #include "./CaptioningManager.hpp" namespace android::view::accessibility { // Fields // QJniObject forward CaptioningManager::CaptioningManager(QJniObject obj) : JObject(obj) {} // Constructors // Methods void CaptioningManager::addCaptioningChangeListener(android::view::accessibility::CaptioningManager_CaptioningChangeListener arg0) const { callMethod<void>( "addCaptioningChangeListener", "(Landroid/view/accessibility/CaptioningManager$CaptioningChangeListener;)V", arg0.object() ); } jfloat CaptioningManager::getFontScale() const { return callMethod<jfloat>( "getFontScale", "()F" ); } java::util::Locale CaptioningManager::getLocale() const { return callObjectMethod( "getLocale", "()Ljava/util/Locale;" ); } android::view::accessibility::CaptioningManager_CaptionStyle CaptioningManager::getUserStyle() const { return callObjectMethod( "getUserStyle", "()Landroid/view/accessibility/CaptioningManager$CaptionStyle;" ); } jboolean CaptioningManager::isEnabled() const { return callMethod<jboolean>( "isEnabled", "()Z" ); } void CaptioningManager::removeCaptioningChangeListener(android::view::accessibility::CaptioningManager_CaptioningChangeListener arg0) const { callMethod<void>( "removeCaptioningChangeListener", "(Landroid/view/accessibility/CaptioningManager$CaptioningChangeListener;)V", arg0.object() ); } } // namespace android::view::accessibility
26.190476
140
0.748485
[ "object" ]
98cc8706b69cb0bc026f24a46b8fca77e863f619
12,814
cpp
C++
base/cluster/mgmt/cluscfg/basecluster/cbaseclusteraction.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/cluster/mgmt/cluscfg/basecluster/cbaseclusteraction.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/cluster/mgmt/cluscfg/basecluster/cbaseclusteraction.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 1999-2001 Microsoft Corporation // // Module Name: // CBaseClusterAction.cpp // // Description: // Contains the definition of the CBaseClusterAction class. // // Maintained By: // David Potter (DavidP) 06-MAR-2001 // Vij Vasu (Vvasu) 08-MAR-2000 // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // Include Files ////////////////////////////////////////////////////////////////////////////// // The precompiled header. #include "Pch.h" // For the CBaseClusterAction class #include "CBaseClusterAction.h" // For the CEnableThreadPrivilege class. #include "CEnableThreadPrivilege.h" ////////////////////////////////////////////////////////////////////////////// // Global variables ////////////////////////////////////////////////////////////////////////////// // Name of the cluster configuration semaphore. const WCHAR * g_pszConfigSemaphoreName = L"Global\\Microsoft Cluster Configuration Semaphore"; ////////////////////////////////////////////////////////////////////////// // Macros definitions ////////////////////////////////////////////////////////////////////////// // Name of the main cluster INF file. #define CLUSTER_INF_FILE_NAME \ L"ClCfgSrv.INF" ////////////////////////////////////////////////////////////////////////////// //++ // // CBaseClusterAction::CBaseClusterAction // // Description: // Default constructor of the CBaseClusterAction class // // Arguments: // pbcaiInterfaceIn // Pointer to the interface class for this library. // // Return Value: // None. // // Exceptions Thrown: // Any thrown by underlying functions // //-- ////////////////////////////////////////////////////////////////////////////// CBaseClusterAction::CBaseClusterAction( CBCAInterface * pbcaiInterfaceIn ) : m_ebcaAction( eCONFIG_ACTION_NONE ) , m_pbcaiInterface( pbcaiInterfaceIn ) { TraceFunc( "" ); DWORD dwBufferSize = 0; UINT uiErrorLine = 0; LPBYTE pbTempPtr = NULL; DWORD sc = ERROR_SUCCESS; SmartSz sszTemp; CRegistryKey rkInstallDirKey; // // Perform a sanity check on the parameters used by this class // if ( pbcaiInterfaceIn == NULL ) { LogMsg( "[BC] The pointer to the interface object is NULL. Throwing an exception." ); THROW_ASSERT( E_INVALIDARG, "The pointer to the interface object is NULL" ); } // if: the input pointer is NULL // // Get the cluster installation directory. // m_strClusterInstallDir.Empty(); // Open the registry key. rkInstallDirKey.OpenKey( HKEY_LOCAL_MACHINE , CLUSREG_KEYNAME_NODE_DATA , KEY_READ ); rkInstallDirKey.QueryValue( CLUSREG_INSTALL_DIR_VALUE_NAME , &pbTempPtr , &dwBufferSize ); // Memory will be freed when this function exits. sszTemp.Assign( reinterpret_cast< WCHAR * >( pbTempPtr ) ); // Copy the path into the member variable. m_strClusterInstallDir = sszTemp.PMem(); // First, remove any trailing backslash characters from the quorum directory name. { WCHAR szQuorumDirName[] = CLUS_NAME_DEFAULT_FILESPATH; SSIZE_T idxLastChar; // Set the index to the last non-null character. idxLastChar = ARRAYSIZE( szQuorumDirName ) - 1; --idxLastChar; // idxLastChar now points to the last non-null character // Iterate till we find the last character that is not a backspace. while ( ( idxLastChar >= 0 ) && ( szQuorumDirName[ idxLastChar ] == L'\\' ) ) { --idxLastChar; } // idxLastChar now points to the last non-backslash character. Terminate the string after this character. szQuorumDirName[ idxLastChar + 1 ] = L'\0'; // Determine the local quorum directory. m_strLocalQuorumDir = m_strClusterInstallDir + L"\\"; m_strLocalQuorumDir += szQuorumDirName; } LogMsg( "[BC] The cluster installation directory is '%s'. The localquorum directory is '%s'." , m_strClusterInstallDir.PszData() , m_strLocalQuorumDir.PszData() ); // // Open the main cluster INF file. // m_strMainInfFileName = m_strClusterInstallDir + L"\\" CLUSTER_INF_FILE_NAME; m_sihMainInfFile.Assign( SetupOpenInfFile( m_strMainInfFileName.PszData() , NULL , INF_STYLE_WIN4 , &uiErrorLine ) ); if ( m_sihMainInfFile.FIsInvalid() ) { sc = TW32( GetLastError() ); LogMsg( "[BC] Could not open INF file '%s'. Error code = %#08x. Error line = %d. Cannot proceed (throwing an exception).", m_strMainInfFileName.PszData(), sc, uiErrorLine ); THROW_RUNTIME_ERROR( HRESULT_FROM_WIN32( sc ), IDS_ERROR_INF_FILE_OPEN ); } // if: INF file could not be opened. LogMsg( "[BC] The INF file '%s' has been opened.", m_strMainInfFileName.PszData() ); // Associate the cluster installation directory with the directory id CLUSTER_DIR_DIRID SetDirectoryId( m_strClusterInstallDir.PszData(), CLUSTER_DIR_DIRID ); // Set the id for the local quorum directory. SetDirectoryId( m_strLocalQuorumDir.PszData(), CLUSTER_LOCALQUORUM_DIRID ); // // Create a semaphore that will be used to make sure that only one commit is occurring // at a time. But do not acquire the semaphore now. It will be acquired later. // // Note that if this component is in an STA then, more than one instance of this // component may have the same thread excecuting methods when multiple configuration // sessions are started simultaneously. The way CreateMutex works, all components that // have the same thread running through them will successfully acquire the mutex. // SmartSemaphoreHandle smhConfigSemaphoreHandle( CreateSemaphore( NULL // Default security descriptor , 1 // Initial count. , 1 // Maximum count. , g_pszConfigSemaphoreName // Name of the semaphore ) ); // Check if creation failed. if ( smhConfigSemaphoreHandle.FIsInvalid() ) { sc = TW32( GetLastError() ); LogMsg( "[BC] Semaphore '%ws' could not be created. Error %#08x. Cannot proceed (throwing an exception).", g_pszConfigSemaphoreName, sc ); THROW_RUNTIME_ERROR( HRESULT_FROM_WIN32( sc ), IDS_ERROR_SEMAPHORE_CREATION ); } // if: semaphore could not be created. m_sshConfigSemaphoreHandle = smhConfigSemaphoreHandle; // // Open and store the handle to the SCM. This will make life a lot easier for // other actions. // m_sscmhSCMHandle.Assign( OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS ) ); // Could we get the handle to the SCM? if ( m_sscmhSCMHandle.FIsInvalid() ) { sc = TW32( GetLastError() ); LogMsg( "[BC] Error %#08x occurred trying get a handle to the SCM. Cannot proceed (throwing an exception).", sc ); THROW_RUNTIME_ERROR( HRESULT_FROM_WIN32( sc ), IDS_ERROR_OPEN_SCM ); } TraceFuncExit(); } //*** CBaseClusterAction::CBaseClusterAction ////////////////////////////////////////////////////////////////////////////// //++ // // CBaseClusterAction::~CBaseClusterAction // // Description: // Destructor of the CBaseClusterAction class // // Arguments: // None. // // Return Value: // None. // // Exceptions Thrown: // None. // //-- ////////////////////////////////////////////////////////////////////////////// CBaseClusterAction::~CBaseClusterAction( void ) throw() { TraceFunc( "" ); TraceFuncExit(); } //*** CBaseClusterAction::~CBaseClusterAction ////////////////////////////////////////////////////////////////////////////// //++ // // CBaseClusterAction::Commit // // Description: // Acquires a semaphore to prevent simultaneous configuration and commits // the action list. // // Arguments: // None. // // Return Value: // None. // // Exceptions Thrown: // CAssert // If this object is not in the correct state when this function is // called. // // Any exceptions thrown by functions called. // //-- ////////////////////////////////////////////////////////////////////////////// void CBaseClusterAction::Commit( void ) { TraceFunc( "" ); DWORD dwSemaphoreState; // Call the base class commit method. BaseClass::Commit(); LogMsg( "[BC] Initiating cluster configuration." ); // // Acquire the cluster configuration semaphore. // It is ok to use WaitForSingleObject() here instead of MsgWaitForMultipleObjects // since we are not blocking. // dwSemaphoreState = WaitForSingleObject( m_sshConfigSemaphoreHandle, 0 ); // zero timeout // Did we get the semaphore? if ( ( dwSemaphoreState != WAIT_ABANDONED ) && ( dwSemaphoreState != WAIT_OBJECT_0 ) ) { DWORD sc; if ( dwSemaphoreState == WAIT_FAILED ) { sc = TW32( GetLastError() ); } // if: WaitForSingleObject failed. else { sc = TW32( ERROR_LOCK_VIOLATION ); } // else: could not get lock LogMsg( "[BC] Could not acquire configuration lock. Error %#08x. Aborting (throwing an exception).", sc ); THROW_CONFIG_ERROR( HRESULT_FROM_WIN32( sc ), IDS_ERROR_SEMAPHORE_ACQUISITION ); } // if: semaphore acquisition failed // Assign the locked semaphore handle to a smart handle for safe release. SmartSemaphoreLock sslConfigSemaphoreLock( m_sshConfigSemaphoreHandle.HHandle() ); LogMsg( "[BC] The configuration semaphore has been acquired. Committing the action list." ); // Commit the action list. m_alActionList.Commit(); TraceFuncExit(); } //*** CBaseClusterAction::Commit ////////////////////////////////////////////////////////////////////////////// //++ // // CBaseClusterAction::Rollback // // Description: // Performs the rolls back of the action committed by this object. // // Arguments: // None. // // Return Value: // None. // // Exceptions Thrown: // Any exceptions thrown by functions called. // //-- ////////////////////////////////////////////////////////////////////////////// void CBaseClusterAction::Rollback( void ) { TraceFunc( "" ); // Call the base class rollback method. BaseClass::Rollback(); // Rollback the actions. m_alActionList.Rollback(); TraceFuncExit(); } //*** CBaseClusterAction::Rollback ////////////////////////////////////////////////////////////////////////////// //++ // // CBaseClusterAction::SetDirectoryId // // Description: // Associate a particular directory with an id in the main INF file. // // Arguments: // pcszDirectoryNameIn // The full path to the directory. // // uiIdIn // The id to associate this directory with. // // Return Value: // None. // // Exceptions Thrown: // CRuntimeError // If SetupSetDirectoryId fails. // // Remarks: // m_sihMainInfFile has to be valid before this function can be called. //-- ////////////////////////////////////////////////////////////////////////////// void CBaseClusterAction::SetDirectoryId( const WCHAR * pcszDirectoryNameIn , UINT uiIdIn ) { TraceFunc1( "pcszDirectoryNameIn = '%ws'", pcszDirectoryNameIn ); if ( SetupSetDirectoryId( m_sihMainInfFile, uiIdIn, pcszDirectoryNameIn ) == FALSE ) { DWORD sc = TW32( GetLastError() ); LogMsg( "[BC] Could not associate the directory '%ws' with the id %#x. Error %#08x. Cannot proceed (throwing an exception).", pcszDirectoryNameIn, uiIdIn, sc ); THROW_RUNTIME_ERROR( HRESULT_FROM_WIN32( sc ), IDS_ERROR_SET_DIRID ); } // if: there was an error setting the directory id. LogMsg( "[BC] Directory id %d associated with '%ws'.", uiIdIn, pcszDirectoryNameIn ); TraceFuncExit(); } //*** CBaseClusterAction::SetDirectoryId
30.877108
182
0.548463
[ "object" ]
98ce8c813757a89434c110262e33f85154280e53
6,454
cpp
C++
loadstore-benches.cpp
mfleming/uarch-bench
a87790f76e02913fdafa2723fb0c99c485c93822
[ "MIT" ]
501
2017-06-01T23:20:31.000Z
2022-03-22T06:52:09.000Z
loadstore-benches.cpp
mfleming/uarch-bench
a87790f76e02913fdafa2723fb0c99c485c93822
[ "MIT" ]
90
2017-06-01T23:54:34.000Z
2021-10-30T00:31:02.000Z
loadstore-benches.cpp
mfleming/uarch-bench
a87790f76e02913fdafa2723fb0c99c485c93822
[ "MIT" ]
42
2018-01-22T12:58:53.000Z
2022-02-16T06:45:41.000Z
/* * loadstore_benches.cpp */ #include <iostream> #include <cassert> #include <sstream> #include <iomanip> #include "benchmark.hpp" #include "hedley.h" #include "util.hpp" #include "context.hpp" #include "timers.hpp" #include "table.hpp" #include "isa-support.hpp" extern "C" { bench2_f store16_any; bench2_f store32_any; bench2_f store64_any; bench2_f store128_any; // AVX2 128-bit store bench2_f store256_any; // AVX2 256-bit store bench2_f store512_any; // AVX512F 512-bit store bench2_f load16_any; bench2_f load32_any; bench2_f load64_any; bench2_f load128_any; // AVX (REX-encoded) 128-bit load bench2_f load256_any; // AVX (REX-encoded) 256-bit load bench2_f load512_any; // AVX512F 512-bit load } using namespace std; /* * A specialization of BenchmarkGroup that outputs its results in a 4 x 16 grid for all 64 possible * offsets within a 64B cache line. */ class LoadStoreGroup : public BenchmarkGroup { static constexpr unsigned DEFAULT_ROWS = 4; static constexpr unsigned DEFAULT_COLS = 16; unsigned rows_, cols_, op_size_; public: LoadStoreGroup(const string& id, const string& name, unsigned op_size, unsigned rows, unsigned cols) : BenchmarkGroup(id, name), rows_(rows), cols_(cols), op_size_(op_size) { assert(rows < 10000 && cols < 10000); } HEDLEY_NEVER_INLINE std::string make_name(ssize_t misalign); HEDLEY_NEVER_INLINE std::string make_id(ssize_t misalign); HEDLEY_NEVER_INLINE static shared_ptr<LoadStoreGroup> make_group(const string& id, const string& name, ssize_t op_size); template<typename TIMER, bench2_f METHOD> static shared_ptr<LoadStoreGroup> make(const string& id, unsigned op_size, featurelist_t features = {}) { shared_ptr<LoadStoreGroup> group = make_group(id, id, op_size); auto maker = DeltaMaker<TIMER>(group.get(), 1000).setFeatures(features); for (ssize_t misalign = 0; misalign < 64; misalign++) { maker.template make<METHOD>(group->make_id(misalign), group->make_name(misalign), 128, [misalign]() { return misaligned_ptr(64, 64, misalign); }); } return group; } virtual void runIf(Context& c, const predicate_t& predicate) override { auto benches = getBenches(); if (!supports(benches.front()->getFeatures())) { // skip tests if we don't have the supported features return; } // because this BenchmarkGroup is really more like a single benchmark (i.e., the 64 actual Benchmark objects // don't their name printed but are show in a grid instead, we run the predicate on a fake Benchmark created // based on the group name Benchmark fake = StaticMaker<DefaultClockTimer>::make_bench<dummy_bench>(this, "fake", getDescription(), 1); if (!predicate(fake)) { return; } std::ostream& os = c.out(); os << endl << "** Inverse throughput for " << getDescription() << " **" << endl; // column headers os << "offset "; for (unsigned col = 0; col < cols_; col++) { os << setw(5) << col; } os << endl; assert(benches.size() == rows_ * cols_); // collect all the results up front, before any output vector<double> results(benches.size()); for (size_t i = 0; i < benches.size(); i++) { Benchmark& b = benches[i]; results[i] = b->run(c.getTimerInfo()).getCycles(); } for (unsigned row = 0, i = 0; row < rows_; row++) { os << setw(3) << (row * cols_) << " : "; for (unsigned col = 0; col < cols_; col++, i++) { os << setprecision(1) << fixed << setw(5) << results[i]; } os << endl; } } void printBenches(std::ostream& out) const override { using namespace table; auto& benches = getBenches(); assert(benches.size() >= 2); Table t; t.colInfo(0).justify = ColInfo::LEFT; t.newRow().add("ID").add("Description"); for (const auto& bench : {benches[0], benches[1], benches.back()}) { t.newRow().add(bench->getPath()).add(bench->getDescription()); if (bench == benches[1]) { t.newRow().add("...").add(std::to_string(benches.size() - 3) + " more benches not shown"); } } out << t.str(); } }; constexpr unsigned LoadStoreGroup::DEFAULT_ROWS; constexpr unsigned LoadStoreGroup::DEFAULT_COLS; shared_ptr<LoadStoreGroup> LoadStoreGroup::make_group(const string& id, const string& name, ssize_t op_size) { return make_shared<LoadStoreGroup>(id, name, op_size, DEFAULT_ROWS, DEFAULT_COLS); } std::string LoadStoreGroup::make_name(ssize_t misalign) { std::stringstream ss; ss << "Misaligned " << (op_size_ * 8) << "-bit " << getDescription() << " [" << setw(2) << misalign << "]"; return ss.str(); } std::string LoadStoreGroup::make_id(ssize_t misalign) { std::stringstream ss; ss << "misaligned-" << misalign; return ss.str(); } template <typename TIMER> void register_loadstore(GroupList& list) { #if !UARCH_BENCH_PORTABLE // load throughput benches list.push_back(LoadStoreGroup::make<TIMER, load16_any>("load/16-bit", 2)); list.push_back(LoadStoreGroup::make<TIMER, load32_any>("load/32-bit", 4)); list.push_back(LoadStoreGroup::make<TIMER, load64_any>("load/64-bit", 8)); list.push_back(LoadStoreGroup::make<TIMER, load128_any>("load/128-bit", 16)); list.push_back(LoadStoreGroup::make<TIMER, load256_any>("load/256-bit", 32)); list.push_back(LoadStoreGroup::make<TIMER, load512_any>("load/512-bit", 64, { x86Feature::AVX512F })); // store throughput list.push_back(LoadStoreGroup::make<TIMER, store16_any>( "store/16-bit", 2)); list.push_back(LoadStoreGroup::make<TIMER, store32_any>( "store/32-bit", 4)); list.push_back(LoadStoreGroup::make<TIMER, store64_any>( "store/64-bit", 8)); list.push_back(LoadStoreGroup::make<TIMER, store128_any>("store/128-bit", 16)); list.push_back(LoadStoreGroup::make<TIMER, store256_any>("store/256-bit", 32)); list.push_back(LoadStoreGroup::make<TIMER, store512_any>("store/512-bit", 64, { x86Feature::AVX512F })); #endif // #if !UARCH_BENCH_PORTABLE } #define REG_LOADSTORE(CLOCK) template void register_loadstore<CLOCK>(GroupList& list); ALL_TIMERS_X(REG_LOADSTORE)
36.670455
124
0.645491
[ "vector" ]
98ceaa7599c9b22eaf33ea61cd05e652e5cae65c
983
cpp
C++
Weekly Contest 180/1381. Design a Stack With Increment Operation/Solution.cpp
Ainevsia/Leetcode-Rust
c4f16d72f3c0d0524478b6bb90fefae9607d88be
[ "BSD-2-Clause" ]
15
2020-02-07T13:04:05.000Z
2022-03-02T14:33:21.000Z
Weekly Contest 180/1381. Design a Stack With Increment Operation/Solution.cpp
Ainevsia/Leetcode-Rust
c4f16d72f3c0d0524478b6bb90fefae9607d88be
[ "BSD-2-Clause" ]
null
null
null
Weekly Contest 180/1381. Design a Stack With Increment Operation/Solution.cpp
Ainevsia/Leetcode-Rust
c4f16d72f3c0d0524478b6bb90fefae9607d88be
[ "BSD-2-Clause" ]
3
2020-04-02T15:36:57.000Z
2021-09-14T14:13:44.000Z
#include <string> #include <vector> #include <iostream> #include <sstream> #include <algorithm> #include <tuple> #include <deque> #include <unordered_map> #include <cmath> using namespace std; class CustomStack { public: vector<int> s; int l; CustomStack(int maxSize) { l = maxSize; s.clear(); s.reserve(l); } void push(int x) { if (s.size()>=l) return; s.push_back(x); } int pop() { if (s.size()==0) return -1; int res = s.back(); s.pop_back(); return res; } void increment(int k, int val) { int i = 0; while (k>0 and i<s.size()) { s[i] += val; k--; i++; } } }; /** * Your CustomStack object will be instantiated and called as such: * CustomStack* obj = new CustomStack(maxSize); * obj->push(x); * int param_2 = obj->pop(); * obj->increment(k,val); */ int main() { return 0; }
17.553571
67
0.513733
[ "object", "vector" ]
98cfb19e465763fdf021c65861795d8015589e90
1,733
cpp
C++
ngraph/core/src/op/grn.cpp
uikilin100/openvino
afc5191b8c75b1de4adc8cb07c6269b52882ddfe
[ "Apache-2.0" ]
1
2021-03-16T17:40:26.000Z
2021-03-16T17:40:26.000Z
ngraph/core/src/op/grn.cpp
uikilin100/openvino
afc5191b8c75b1de4adc8cb07c6269b52882ddfe
[ "Apache-2.0" ]
42
2020-11-23T08:09:57.000Z
2022-02-21T13:03:34.000Z
ngraph/core/src/op/grn.cpp
tsocha/openvino
3081fac7581933568b496a3c4e744d1cee481619
[ "Apache-2.0" ]
4
2021-04-02T08:48:38.000Z
2021-07-01T06:59:02.000Z
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include "ngraph/op/grn.hpp" #include <algorithm> #include <iterator> #include "itt.hpp" #include "ngraph/attribute_visitor.hpp" #include "ngraph/axis_set.hpp" #include "ngraph/op/broadcast.hpp" #include "ngraph/shape.hpp" using namespace std; using namespace ngraph; NGRAPH_RTTI_DEFINITION(op::v0::GRN, "GRN", 0); op::v0::GRN::GRN(const Output<Node>& data, float bias) : Op({data}), m_bias(bias) { constructor_validate_and_infer_types(); } bool op::v0::GRN::visit_attributes(AttributeVisitor& visitor) { NGRAPH_OP_SCOPE(v0_GRN_visit_attributes); visitor.on_attribute("bias", m_bias); return true; } void op::v0::GRN::validate_and_infer_types() { NGRAPH_OP_SCOPE(v0_GRN_validate_and_infer_types); const auto& data_pshape = get_input_partial_shape(0); if (data_pshape.is_static()) { const Shape& data_shape{data_pshape.to_shape()}; // Input data must be 2, 3 or 4D tensor. NODE_VALIDATION_CHECK(this, (data_shape.size() >= 2 && data_shape.size() <= 4), "Input tensor rank must be 2, 3 or 4 dimensional (actual input " "shape: ", data_shape, ")."); } set_output_type(0, get_input_element_type(0), get_input_partial_shape(0)); } shared_ptr<Node> op::v0::GRN::clone_with_new_inputs(const OutputVector& new_args) const { NGRAPH_OP_SCOPE(v0_GRN_clone_with_new_inputs); if (new_args.size() != 1) { throw ngraph_error("Incorrect number of new arguments"); } return make_shared<GRN>(new_args.at(0), m_bias); }
30.946429
94
0.650317
[ "shape" ]
98d267c8ba640858d72ee5d75c32c93a491d921b
308,617
cc
C++
chrome/browser/ui/webui/nearby_internals/quick_pair/quick_pair_handler.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
chrome/browser/ui/webui/nearby_internals/quick_pair/quick_pair_handler.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
86
2015-10-21T13:02:42.000Z
2022-03-14T07:50:50.000Z
chrome/browser/ui/webui/nearby_internals/quick_pair/quick_pair_handler.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2021 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/ui/webui/nearby_internals/quick_pair/quick_pair_handler.h" #include <memory> #include "ash/quick_pair/repository/fast_pair/fast_pair_image_decoder.h" #include "ash/quick_pair/ui/fast_pair/fast_pair_notification_controller.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/i18n/time_formatting.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #include "components/image_fetcher/core/image_fetcher.h" namespace { // Keys in the JSON representation of a log message const char kLogMessageTextKey[] = "text"; const char kLogMessageTimeKey[] = "time"; const char kLogMessageFileKey[] = "file"; const char kLogMessageLineKey[] = "line"; const char kLogMessageSeverityKey[] = "severity"; // Test device metadata for debug purposes const char16_t kTestDeviceName[] = u"Pixel Buds"; const char16_t kTestEmail[] = u"testemail@gmail.com"; const char kImageBytes[] = "89504E470D0A1A0A0000000D4948445200000200000002000806000000F478D4FA00002000" "49444154789CECBD0BB064C9591EF8E73955F7DEBE7D6FBFBBE73DA3796934A391460F24C4" "C80203A1100821198CC59A084BC0C2CA6083F12EE6E1085E8E70ACC3188CBDB026C2EB7D38" "300E7040ACBDCBDADE65D7115E160C1890401A4642A3D7489A999EEE19754F3FEEBD55E7E4" "C69727FF537F7DF567F59DF774D7F967AA6FD5A973F2E4C9CCCAEFFB1FF9A70C32C820830C" "32C820830C32C820830C32C820830C32C820830C32C820830C32C820830C32C820D78484A1" "1B67F2C8A71F5938F64A90BDC99E9C3C7E4A8E1F3B2693C99E88541224480C5D075622D206" "912851421489E98B56EA5A24B69584364AAC1A69E2582A9C5D3512A5EDCA892195A512A348" "5D0709C3C8D8974CA7533977EE9CECECECC8C73EF631F9E217BF285555C93BDFF94EF9E33F" "FE6379ECB1C7E4F6DB6F4F45E1DCA79F7E5A3EFAD18FCAADB7DE2AEF7BDFFBE4F1C71F97A7" "9E7A4A3EFFF9CFCB850B17248420A74E9D92A669E4E8D1A3F2C4134FC8E9D3A7E5E1871F96" "37BEF18D72F2E4C974EE1BDEF00679DBDBDE263FF7733F270F3CF0402A17D77FCDD77C8DFC" "D2BFF82579F7D7BD5B5EF39A7BE4B77EFBFF933BEFB853FECA07FE8ABCE3CFBD437EEAA77E" "4AD6D7D7BB478BE519E0FBBEFFFBE4F38F7E5EBEEDDBBE2DDDE7D4C993B2BBBB27870E1FAA" "DBD81C90180E44917589711C828C44C248A2D451225EA320A18E22E32ACA8684B01EAAB026" "318EDA285508614D704D8C18BAA3FCAA519B1823465F15BB21588710AA1863A5D58C8226EA" "3EC588D18A0392067C8C6DDBC6D804A9DAEE57105A09D2A41F86C8248A34019F833431CA5E" "109986101A748D88EC8AC84E8C71D71C6B4208F8A1E0F3043FC5FCDAC9AFBDDC8A2451DA88" "07AD729DA3B4D3368D8B909FA46D1B09FA7DDB76C7F11B6E83C4B6C9C5A55F76777DF7E052" "872A959DDA20C4D47D692E90EEFBDC24FDFBEEBB7C7E3A3B4A8C6D7755B0BFFB285515E606" "04C614C636EA8DF1D8B698536A3970E0801C3E7C58363636169EFC6A91304C7049460B4706" "196490579460B2C2E48B497A6F6F2F918DDDDDDD74FCA9A79F92BDC9442E5DBA24E7CF9D4F" "E0B0B9B999E6F1F5F50D397EFC449AA8BFEBBBBE7BEB969B6FB94E440E8BC8C918E3B62400" "4F9F8F89C8D118E3560801AFCDEFFFEBDFBFB9B3BB73E0D4A953E3ADEDADF510AA03EBEBEB" "EB93E9644362DC8C3160F61F772835C340404E4748DB7418C4541442672789CCF0A8933C21" "6728EB802CF8F00A96AAA096C86E3E296A31516F163A461BF8F2D8C36686CB7C9D9E3B7F81" "010B9C30094176A3C4CB12653748B82C215E1609200E2009BB51E47210B910253E1302FECA" "D351E297DA18CF57512E89C83312E40C3056449E9410CEF5F708A17F6EEFD10719E4859481" "000C32C82B540054172F5E94271E7F226962787FE38D37CAA14387E4C4891309F4EF7FEDFD" "727073F3C4AD6F7EF37531C6571D3B76F4D51FF8C0076F585F5B3B1182DCF286071EB87E67" "77F7C0B77FF083274308874020401E5412C8C479A8896D943BEFBA33697E105C93B4C92AC8" "74D2B8D6A14E09974EFB152DB8D74DBB7213AA19EBD2DC6D3B6DB5336BC5744EB40C201DCE" "901D66562B2D2B468B9D316BCF8BE02F5189C33C6D89B3B773158B7A7EAE6210598B4160CD" "D80EB602F38FA24CA4273B1DC03799D8589B9B5C0A226742159E91101E0F317C2E4A3C1D42" "7852247E3604F984487834883C8D3242B016BB81220CF2FC642000830CF20A100003CCAC00" "5B98F2A1F1C3547FDD75D7CB2DB7DC225FFFEEAF9763C78EDD70EBADB7DEDBB6CDDD9B9B07" "DF72E9D2A557BDFFFDEFBF633299DC16AA50ADAFADCB74DAC868542777C3CEEE6E32D98EEA" "5A269349BA07C0DDE2D34C139F0135801E5605250621C36A9B494007A232D3D713A8C5994A" "1F6764A0FB7F06849D097A76E3A0D745055BC9E01C53B933600E4A2D5CE9EAD119CCBBF3DB" "39134308B3F7312E0227DA255866A2CFA09609E32EE981DF7E8EB3CF735604F3A7EDC9C7EC" "B9628C9B22726B365ABC56C4D42313851002DC119F0E413E1543F55991F0275555FD8984F0" "07B03484059633C820FB9381000C32C8CB200A4200FA64BE3F7F3EBD87667FF3CD3743CB5F" "BBE9A69BDE72ECD8B1AFAAEBFAAD31C6D7C618EFC8AAAD4C9BA900F051CE68344AE401AE01" "404D339DF626F236DD67DE9E1CCC9B04453DAECEB4EDE4744E606D4CE031EBF700A6746A77" "61ABFFF418D869D8A2F7EEB5F5D07F5413BF85AE9E28E42F549B0FD92560956A992B79319E" "4135F79E7B90A540CFE96E127AF53EC65961BDFF5C665C221A0B46777EC85C20F68694CEB7" "3F232B6A41F0FCCE7D9C40883D89E9BBAA8D4A68304FDF2D12EFD68701110B127642081FAF" "42F5875555FD41A8C37F0A21FCA13E91987E1B64104F060230C8202F9128009C3D7B3699F1" "277B7B09F48F1F3F1E6E7BD56D771C3F76FCCEADADED07D7D6C65F359D4EDF361A8D360052" "C9DF9FE7F136B6D954AE409D7DE2BD59B955EC4EA0D27DDF01696FEE572559187166E269C9" "32A753675FBD9AEE2DE8F6C4C15E95C56AF585C2430FFD57904210A312090E7253C0EEDC09" "71C63562A0BB2D062904329904A1788199B69E4CFD217F8E73D18BB62DFCCADB5AA8B93F1A" "4B4C0A9B942E2624C4B011253E20511E08217C4722225575BAAEEB7F5785EA3F84207F14AA" "EA3321C839EABC41064932108041067991051339347498F6BFF4A52FC95BDFFA5679ED6B5F" "3B3A70F0E0D7DE71FBED7FE1E0D6D67B44E466350F37D30E4060860F06D0240359CC66F479" "908E3253F6E34C938D315B0166E7CCF9FDB3DA19252CC402F4256BD4785E792239BA5CEDE2" "71A6FA2E9411E7D8869EA680DB5307FDC6DC934D16F3652B96590262BF0CB25095C53BC579" "9A31FBAED7FB17207AC60308F8D56AA12E83301F65DF7D1DE60A0AF63973DB69F482D0F573" "E585201AB03F8BBDC83687A639D54CA71F90507D00C72B9C5B55BF578F46BF5CD7F5FF1424" "9C8F6A89F139C8202B240301186490174302CCFB512E5FBE9C4CFC98BC8F1C3922F7DD77DF" "D7DE75D79DDF1EA3BC6F3A9D6ED775D5FBE7ADA4CF2003BDDFBE03072C1913F3BDF125F765" "28C0F7BE663D1E0D31C8D22B850486628F19B0EA357B13603F033113FC9711B8E578013285" "F744C0980C2C485B9F796F66EFC1743E784F49C95CE482A9EFDC33F2A32E100E5B91608214" "0D60078D87080688437F3F5DE6D78706CC962FFA036EDE6C62C84495DD0CA15F2E5887BA73" "031862D02D0DC452C34CF472FBB74DF3D6C964F2D6BAAE7FB6AEEBFFA3AEEBFFA1AAAA7F3D" "9804061908C02083BC80A24BF6A69369CAD98040BE5B6FB9F5D8A9EB4E7DF0F0E1C3DF3B1E" "8FEF823500A02F49616B7A50EE00B64D80DFC69996EFBE7A8D7FE6AB5759B018F4044066A0" "3907DA0520E803D8C2DC1AF30485F91673650703AE7D6C9FC618CCB4EA6E7DBA0542537F83" "B1C0BA369B2CBAE0C3FEEC19D0CA7CD5674AED6CED7C35738ACF1ECBC42BCC69E7EA56992B" "3FCEEEDBBB29E64D0C33DAA17101B09634B30AD93ADAEB4A644064AE5E330250A5B2A7619A" "DAA44E9FABA4E9879C6740FFD375FD5D7B478CCBAA699AF74808EFA9ABEAE9F178FCCFEABA" "FEC721844717C8DF202B210301186490174830319F3F772E4DC45555CBFDF7DFFFE6EDEDED" "1F3D7AF4E85F44A01E22F32FEF5CEE23CA015031AFEF0769D0B5FE9DE6D6662DBF0B1454B3" "BF4463C63751F6D180523B17F4172DDAF59AB37EDFC50BB4F32443CB25E2A1E0DCF99F6302" "D5649DC8DFC1E2D1836FABC970B2BF5A3579BBD6DE46C5E717562DB0A543B55C5D4227734B" "F3E87B6B35E8030DBBEFB1ACB1AB8B6AD59DB11F8178F84E032767A04B7FABB0E06EE813EE" "F4F78FB3043FD299E0C3DC4B7A109FDD6B163711953DCD0703CC48CB74E66A48C05F755601" "7D06FB9A5907BAEF3BCB40F7CC4DD31C6D9AE607EBAAFAC1D178FC4F47F5E8272484C786B9" "60B5642000830CF23C44275904EAC1BF7FF32D37CB9BDEF4E6076FB8E1FA5F9428AFABEA2A" "F9F2E10A501372A320DF34D2B49DD69F401E24C0D5F6E735FD6835520D76EB03BE83B128CC" "08464F2CDA6C61C8F1019AE12D591E40089A76B642A12BA00773D198C1D8CEE1D33C00CE8B" "0548E9B5EF19B05AD086C032E21D8F6D9C273114F15F2A6F76D2CCA2B1B0167FE69B982D7D" "D4F7546FEF1EF32B0B722FF4FEFAAE7CCDA900B01E55752201203B782939A9549BAFE6FDFD" "B69EBD3B24DDA895A6C9568ED069FF557AD5B9BCFC1E75B6A423AF2288792C363B3BDF3DAD" "EBEFAE47A35FA947A31FAA43F5390957B04E0C724DC840000619E4790800149AFDE681CD83" "0F3EF8E07B4F9E3CF9A1B5B5B5AF0290E1BB944036836FD336E95893C1BE51E06DE34CFB4F" "2A7FECCDEBD6D46F4128490604DC1F65C71CFEDF346DFA0C3047B99D9B21F6B9065466C440" "5DDA8B207EA56356FB66D0650D5AE64033CE5DA3EF9326EE955511A03BF7E1F26DDDE69713" "CE97D5BB4CCC776DB640584200C2B6402C48B8FEDA4E4D7F6D94BD3E8C60D63E6AC2AF72DE" "8694F6377FEE00BD233D338B4235F77C2D522D3641A60DCE6916AC02897064D2A1F109215B" "28A4AAD3586CF6F6BEB59A4EBFB56DDB5FDDD8D8F8E9F178FC9F31B6C6E3F1903AF71A9581" "000C32C8F3104CBEDBDBDBDFBFB1B1FEF7902E17C07FE9F2A57E0DBA02B06ADAFAB7CDC09F" "34740BC632AFED2B28866CBED6172666FBB2F798B905E67DCD6A29585CB627FDBDF4B86AAC" "9241CD82BE7EC760EA6BC78B80CBE058FABC00D40EB0EE07983C12C3F5E2B2B50DEC7D6C9B" "D83A949EDD7BB6B625926102396DA84020D7C1CCB40FAB4107E42007B51E5702817192F234" "60C383A67717800C741607B532647211E60309B3A5E5FD93C9E4FD9B9B9BFFCB8913273EF4" "D4534FED824C2E2361835C9D32108041067996A266DEB66DBFBCAAAA7F5385EAD44E5AABAF" "E66224E381163E4D5AF89C368EF76DECAD02D6E7AEC0DD696B752A0DE763332864F89B4E26" "E9359974A0DFC70964D1D502C5A56806BCA50054DEE792862F0E9096CAF1AE2D9DEB9D6749" "0913949258C2622D0ED63A60CBB3C0CFF7E16B4A6DB08CA4F4310E64FDE0B2668195B1B744" "A885C8D6A1CA1ABD9283919282519DC64FF77D9546641B95381A325177E30C7FAB60E31260" "B198CADE6EFCE0A14387FF7255D7DF79F6CC997F814453D808C8ABF72057A70C046090419E" "A5C4D88EDAB6FDF9A6693EA4016EBD7FDF68FC9D46DE24933C07F9CD27C4E902C7EA513759" "03DC1153006B82E6EE4F80DFCC8201190C929657CF9B853D20936701EEACF57B80C6D68192" "265C12CF64DFB7A963912801B107BCB6CEC9F49D81D496250592C22E843977C212D253AAB3" "907B60597BDA6BC410017B8D3E0BC644720D5495ECE57215D435C620A5831E8D7AF3BF8E4D" "04148220543D59989189D40F11592A2FAE6D6E1CF8A5F1F5D77FCFD9B367DF7FF9F2E52F36" "FB70850C7275C840000619E459089651354DF3CB4DD36C6B4477CC267D4CC66C8E9F017F3B" "17C0A781673AF1A6DCFD3BBB3DE0F7A0DFA7F5935994BABA050824D96C2CC6745D02660639" "2968F51EC895DE73BDF83EE2100FAEAF770E9FE789779F677B3D1310AE4BE9DA52FB72FF94" "CE6397823DCEE0CFF78D26C8B30933700F395FC01844603C4E2E83440646751A53DDE64EAD" "041086A659702DE0FE3BBB3B321A8DDF7EE30D377EE1E92F3DFDDF9C3D7BF6670F1EDC9C6D" "2B3DC8552B03011864907D48DBB6E3E974FA2B6D6CBFA9DB38A64A21F16DD6F2A700FDE92C" "C80F26545D22D707946551D32CE673803C12056195004CACF8ACD7E8C49F0031486FA6656D" "DE031C2B1EE82D730DECB76CB63678E0E6DDC7D3D04BF7F19EC77B3621106562C37E7D8FF0" "78206FAF610057D9CF3378EDC1F7572B0597DF6BE42DED2F40CF26C65A303BD669EB2D807D" "3AED5C05A3516F11C0DF2AD412318E337185F560548F7A570248EE743A49E3FCC8D1233F13" "4278DBF9F3CF7C6B5D8FE2C1830717FA6490AB47060230C820579069D3BCAF994E7FA98DED" "96266341A47E4AE88389117EFE14893FEFE79F99FABB08FEBA1A753BED614FFF5DF858F7E4" "E2858BB2BBB7DB2F73B3266BD6E81508C480044FFE9EE6CFE06CFF9640589604FB59F14841" "4902B926969D5F3A2EA61C0F944B51F81EA07BF7F2488FE782F0EA2304CC42606E41BCD4EE" "4CAA3836C102BC2D4FC78B95746ED359A7A619FC351702DC4B788F08FF4402EA4AC6A371EF" "5668EB56EA66E63E8055006B0E2F5FBA2C870F1DFA4B073636FEFCF9679EF9C1E974F2CF0F" "6E6EC9683C40C9D528E55FD90ACA239F7EE415F9D008023B79FC941C3F762C659743B670CD" "CB1E72EEF036675D0B79C73209ADE0371BDB4A02C0A86AA48963A97076D5E4AD55AB142D6C" "939B604EAAEB204BE6DF9590385B36F7CF9AA6F94E11DD0226F626FE14859FDE4FFB20BFB4" "8E9FA2BBD50F8B49177BFA43E3DFDDD99189EEDA9713D5D8495C5D0316E0D5BDC04BFB3CBF" "B4F5E5AAC6A75A5F6F5520025102229665E06CC53BAF04A6A5F79E94EA2557F8CEAB8B3884" "82BF5F26DEFDAC66EEDD939FD99E67415FC7180823C64E4B49A39820B2CF5FFB5BC791754B" "A5F3355FC0A8EE5D03635C371EF54B43BB5507A3B4C5748DF2F298C27BE433D8D9B9FC701B" "E3376C6D6D7D4A2D1857832C1B5FAB24036D1B64104726D3C9756DD3FE8710C2BD3A494393" "D249D91280D680719B7DFD49E3875F753496E9DE44CE5F382FCF5C7C46762EEFF413710263" "63D6B7C08C73100780C91F2F9EBC19344A206E3563251569A21F8F930F776D6D2DBD171369" "CED77A206D85FDD55EA09BADD3952C01DE3D58BCB24BD77B6DE3C516789ABDB6F7B272BCFB" "97CEF15C2D6234787509691CC85EDE31B264B1B0E5D9BE56A287BE461FE3A5FD2D964CC656" "2A6CF654D7FDF2D27A52A7F34004527E894C3A46283F938AB4E574D5C8FAC6C66B628C8FEC" "EDEDFDB5F5F5F5FFBEF47C83BC32652000830C42B2B7BBF7954DDBFC66555563CD0D9F02FC" "DA695A8ED72801C8FEFF2E018F74EF73D6B7F1DA5A3A0FA98155EB57AD5DB5724EDBDA0502" "EEA4495FD7F8AB89D7F3B55B33B0828EBE6752A020A22B0CF47C4CF41B1B1BE92F9678E1AF" "5A1818D84B806D854DF025426235575902A42A1EF9F04CEF9EB0BFBC54B6A79DB3FBC4BB6F" "49B8FDBCF77A0F68F8D82D122FED7FC9C480DD1BB69E96A0D8F23596047D8DF1876B9504A0" "BFF1DADCDC4CFD9C486626A4D0F695688E9B71471842B72CB0FB21B412B3DB20B621ED79D1" "A548965F984C26B7D675FD23F86E90AB43869E1A64102369695F6C7FB13753B73353EC0C94" "75695F934DFEB3A43DE37107EC172F5C90F3E7CFA7E0BE3E414F9ED0AD368E497A925305DB" "20C012F828307B016056BC631E58E1BE78E15E000790000003FE5629F86BFAACFDF61E502F" "FBBCEC5A0B7EE23C97673960CDDD3B978FF3337A657AA6FB9275E44AF5B4961090C33367CE" "24A0B6244FFDF55AB61248AFBDBCBFFCBC2003186318970076F43382F8F0528B538C93DE1A" "811815F4BF5A105097BD38917E4789DEBD80DD09535D7F786F6FEF1D9B9B9BEFAAEBFAC242" "630EF28A9381000C324896A669FED664B2F7F7FBCD5CB2DF14008D603F8DF2E735FD312778" "19AF8DD3394F3DF554DA176096673FCE99649309B569D284AF1A3FEEA1E778BE5E15D64459" "13B4DA7E69BDBB7D6FCF415D00464F3FFDB46C6D6DC9D1A34793A6A8F54D11E24BCA1403A6" "B62EDEBD4B1AFB32733B3FB377BD1E673067C01607B44B9A7AA98ECB2C019ED5C0BE479BA2" "DF3156D0DEBA0782B5DCF0312F4EC13E07131FDB56DA1E4A2E706FF435C8C0F6F6767AA1AF" "533E81EC765A1B77A0AFC414DF231600BF05441C8D4DB069DA54A94E41850FEEEDED9D5E5F" "5FFFBAAAAAFEE342E30DF28A129F12AFA80C41809D1414A56B46D2F40A60AAB296DD81FFCF" "4EA793BF2939208FB5FECE673AED37C6D114BE9035F8D0639467B209172F05700DC2528DDF" "6AFB9864853450ABF1A9947CF176E2F7AEF1009F01AECEBEDF40CB0BF1BC202BD00EA1291E" "397224590834184D1C50F3A474DC5EB71FF3BA077CB28404F03981DC265EDB2EFBBE548FD2" "FDBD003F31408C3172F6EC5979E69967E692FC30D873609D1D2B81DC3F9E95420C21B2C4C0" "1239ED6BF4B3F635EE8B318A73B12450E71AC48B801CF6A417B90534F360E8B20BEAEF633C" "1EFFD3F168FCBDC86DB5D0402FB378636915656805230301580D49936BDB48481BAF5448AF" "FBBF4DDBE63D98C0305F03E8270CFED91FCF6005D32880FCEC99B372E1E285F928EB6C4AC5" "2489EB30E99F3B776E6E49965024BE98C9DB6A839196827962C181C18CB56E8E11F0FCF6D6" "EC0C97C0F1E3C7E5D8B1633D91B1EDE08907469E78E795AE293DFB32D9EF355E1FD8F62F01" "BF576F8F38A8CB075A3F4CFE698748CA30280E09622DDEF3FBB355822D07768509BB9802C5" "0D40D33F79F264EAEBCE3AB5874440E9FCCB3B3BB2B1BE9EBE5382AB4B09EDCE866953AA29" "720A8C3EB3BEBEF6D610C2930B0DFE328A37B65651865630321080D5906EC7BD361180189B" "7F3B9D4EBFAE037F35F943DB9FF451FEF86CB7D5D5490E131F401D93F9EEEE5EBFADAF35F7" "E35C985AA1E96132B5E6690EF0F3C4D3F2AFE45FF6346A0FDC3DE0B25AA5029612011C3F7C" "F8B0DC74D34DC932A011EA817CDA5EBD584A9ABE14C076BFE679AF8CD2B9DEF1521B7B6DC5" "24C08AD716783DF9E493E90502C5A0EFE508F0CA60CDDEB6A15A1338E1928A3DAED605B620" "68BF82F05D77DD7589E42A59C198C7780649808B08258D120918254B41D0658266E9615555" "9F5A5F5F7F7B08E1F185067F9964D9D85C25196200065941E9F6436F9BE96FB46D93C01F24" "0851FEC9D79FCCFF4A049A0CFE9DC9BF03FF5AD6D7D7929FFF89279EE8C13198B5D8982831" "9102F84112C44474B3256119C079DAA115EF1AEF5869A5006B9336DB1C071CE29960C10000" "9C3A75AA07073CA747029864A894088B474E2C31F12C1825B250BA9FD7E69ED581C983773F" "AF5C5BBE8A0230DAAE238BBB0B7D63415AB76CE6FEE2B2F93BEDBB68B67DB6E327504C869E" "C39600F429FE9E3E7D3AD5F9C61B6F9413274EF4B1017013E02FE2070E1D3A64568D54529B" "3AABDBAB6DDA3B7677773EBDBEBEFE952154BF9FEAAF7932C24C0B8D6191900DF2E2CA4000" "065931E9D2F9B46DFCF5B66DDFDD05FC611FF5695AD284DCE8487B9A3E67F0C75A69C951FE" "29214A3D4AFEDB3367CFF64BF5ACAF1F2F803E08829AFB254FEC761D3F6B732A16AC1974EC" "242F0E08A8D8EBEC7DB43E6AF22D018B38653439573CEEF7852F7C21919B9B6FBE39059069" "6C009BA33D705561BFB78A3D6F59D0A12D5F4823F6C4BB8747406C7925B0F7347CEE475B3F" "8C07002A3469AF8F2CC9C3332838B3282963F266C19CC78C5E63FB90EF6DEBAEE302561E90" "954F7DEA5309EC6FBDF5D6740CCF0032A889ADB6B60EA65531D853A0EFCBBC7745557736CA" "B66D377676767E6FBCB6F6BE3AD4FF06E7C30ED96D63DCE6D5B6AD0C14E0A59581000C2271" "857E76D8D2BC6DDBFFB66DA7DF54A57CFE9534D389D9C427FBFD9B594E7E517F3F82FD4248" "133922B75593D735FDEAEBC77798307B0DC844F5B3D8ED5E19EC3CB067A0F126790FD4B95C" "7B8E050F31C0C7444025E43C066A0D808668AD01F63C2E8BBFF3F20678646199B6CD752E01" "3A83B61069F0AC32A5CFA5F298A0A425A1172F264B110893055BAF2E259700EFC0A720CD4B" "45BD7AAB687976AC8839CE65E13C4D1405CB0548CCEDB7DF9EDC40200118DB2008B8AE0B0C" "6C3311C816B6D84A68677101F87E3299FC6BA9E5FBAAAAFA797C0E7927CDDCFB834FFA2596" "A1BD8DAC620CC06A09DA277E7FDBC47F944C8F69339EA6D3F64DCA55CD90D63631AD88C024" "8508787C0FF0B791DBEAEB4F0152972FA7EFBAF5D48B9A9D38E6790F58ECB9D60C2C4B3456" "6B765D766DC9AC6CCBAB28FFBC14B46B2D072FF883A121C21AA0B10E25307FA1C50352264A" "5E3DF83AEFB85756E95ACF958131F1D8638F2500554B9106565A97D0952C1D5E7F789616FB" "59CBB22B3D3C8B0613475E31A02FAC0A4099B7DC724B227DF8AD68C22204898204D8A5AE7A" "5DAA73B608C43E2871F4CF43153ED89DD359009AB048905F2C59AB365EB27BBD9265B000AC" "B42C4E62D7AC60A289E13BDAA6F947DDE41672A4FFA4DFD4670FE00F933EFCFDED0C4001FE" "00F52F7EF18B6942B7FE4D9DE8A0F1E3C5E67A0F6885B4FB6564808F7B9AA3D5A679192103" "8A4712ECF160F2083079282DFFC3840FAB07AC012001B006F47BCE3BDA3F8BA749EF47D83F" "6FEBC4EF4B24E1D9DCBB44BEC410245B271021003FA2FE55AC6FDEB67389183259632B9225" "7EF6DE56ABB73127964894AC00DA6F29DB9FA90B401E80FF99CF7C26FD0EEEBCF3CEFC9CBB" "A9EF75D9687AC6B4D7C03C798C4D9723BB73454C3F50C5FAF2683CFAAB89653F87FE1FE4F9" "CB400056565609FCA1ED87AF6CA7EDFF98AC1EA1D3FC61EE87C97292B4FF491FECA7096F82" "59E6079FB76A40F3CB9D24C503C0CCAB295075D2F426752130F68080AF13D2EAECB97682B7" "69636589B5C1D6CF6A780CFA7DF3114960B0D57B43237CE491471218DC76DB6D732E010F30" "3DA0BE927800CC40EE01BA250225CB07971D6949A57D5E260EF6B8B6214811088025423606" "C42376F63C6E6BBE1F9BEB97F535D7D712017B5F7B1F2670699F80BA4E561EB834D0B7F7DC" "738FACAF6FA4DFC605FC06C623D958DF48FB63543A6E60EA8F9D5BA003FACE74D9B6CD87F0" "131C8DABBFB6F2BB8FBD4C321080151344DA860817C2AA98FF9389F1C6B699FEAF31761BF4" "24ED346DDFDB99FF27D86C07DBFAA6C0B8362D65427C806E92F3F8E38F278D47274C357362" "92C6040FE0D3CFACA1F35A7F3BB92F33C5B35F56CDC60C0A1CD5AD4BBBD865E0697B256DD3" "D681EBC69BE37829824196544384D608EB094B299FC19534728F3478E0CCE299E74B96142E" "DFEB1FBE8F6D433C1BAC417017011839A8CF23311ED07BC7ECFDD5C2648329C5047A8A4378" "D82263C91EAF06B001834263029A3E825C1F7AE821B9F7DE7BD3CA809459F0DC79191DEB76" "224CD763296CCCE4B1862BA0230186547CAFC8A81A8FEBEF09ABA596BC2264D8BA69D5A45B" "81B332AF645D9C36BFDEB6F12826A068B659EDA2FED5E7DF252EC1F9B5F1EBC37F6B7DFE6A" "F6C7679876A10579606627713BC92AE02EF3C9B2795A13B4D8EFD8CA60AFE534C5B63E368D" "315F675F6C766633325F678FA3EDD0360007B41D48003FA318300AE483DECF31EF2504DA1E" "F095EEC3E7717D4B75E7CF55DED807CF0FAB50C9C263DB8DD7FF47CADCE7F5078F05DB1FDC" "2F7A4D696CD8F2EC314B3254ECBE16F0F9A37FD1CF380E1280B17AFEFCB96ED92CCAB3C427" "0708260E209D212091A369F3572793E93F1CAC2F1CCAC20000200049444154002FBD0C1680" "9511E5D7ABC3B1D3D2A2A6FD8518DB2F574D6696D6B7F3FBA775FFD8DC67AA8159A37ECB5C" "803FB41C315BACEAF227987701FE4A06EC2469276ACFAC2C34A9B3F93A3AC15E1EF8F2E748" "390638731C5B1EACF6184D309A5D6256AA8FBD1FFB9FD5250000FCF8C73F2EAF79CD6B52E4" "B84D1CF4ACFAB1A0297BDF0B69F29EEBC13BEE95C9CFBAEC1ADB46BA0494AD259ECF9FAD17" "0CDC6CAAF76238D4C26057062C7301A8666F357AAEA7D7EE915C4628072400FDFCA77FFAA7" "F2BAD7BD2E9180CE1D7621F57983F253F063B7E246D24A1C8D51E8E624B806A6D3E6074632" "DAAB47A31F0EA1498181438CFA8B2F03015809E980BF5A250290547FF9B118DBEF0D556716" "9FE6A0BF14F13FD94B7E7F4C44B00424D01A01F8AB94D90CE00FDFBE4E7A200478C1A48BE5" "6F1A27607768630DCA9AD5ED24EC99A14B444188349480C9D3061980BCFBB009D80280DDFC" "8737026260D232AD360B908159F8A31FFDA8BCEA55AF4A91E31A1CE83DAB07B00C904C98F8" "5CCF3C2F0500F78E79DFF179F6DE7A5C8915C00F99FE74BD3FBB856C9F78C42F902BC69238" "6D6BBB24904983673560E056225C227581F20C045A6162AD00F80EA00FD203120077002C3E" "F86C8302BB32BBFC0069FB60D403E02FEA12404AEEE90FB5516EDD580B7F39B7F442BF0CF2" "C2CA40005640625AFC37494B03574152A21FA96F9CB6F58F62620998F0F2FEFD5D86BF894C" "F6267D2C405A9E85A54B1534FCB5E4BB55F097BC8C0A9319345868FE3A497AD1D51E007911" "DACB80DE0283B7FC4F886C7860E8B925848889773F9560FCC09E95C2232042C4428104EDF6" "C94F7E32B53B88008EEBF2312900BFF71DBF5F461C4AE4C23BD793D27925D2A0CF04CD1F2F" "6B55B16D6241573FB3C66DEF61CDF39C0BC07B3E7BACA50C837CBEED23EE6726203CDE3886" "052400BF993FFBB33F4B2400E5210E021633ACA2696C79315B1CA2260CC26704E8C01D30FD" "2FF6AAFACFC6E3FAC7631A228B6D3DC80B270301B8E605BF304C32ABB3EE15734B1B9B9F17" "690F60026952647FB7A1CF346FEF9BB4181080B63387C22C89890A933734389D0801FC9AD6" "5727766FA2666D78BE3E3393A93820296662B6665A0F68D86CCF665E15262936988BCFE7A8" "7F4F63148768B01520526E7AFE1ECBC7F05C080E54C0F49E91C5D36EC501690679AF4DBCBE" "B9D279A5F2F818AC431823BA511293A3482E1ACF2A63091A8F17250BA59C015EBD030573DA" "71C1EBFD99309448A2D767F80EAB03409E610140C2201000C408683C4DF2FD2361491DBB60" "40090B49C8AA2AC864AFF93191EAB7EAE9F8FF6CE3C0015E4C1908C0B52EF8F154ABA1F9AB" "B451BEBB8D3165FAC312A46E1FFF36014E0FFE397F39B47E80E3DA7894CCB6A79F7C724EF3" "C74B353BCFEC2F8E9997276F0658590226E24CE425F1AEF7C8452037049F1F1C1F7070B2CC" "A9B0D99F2D131E7068F99FFBDCE7D25F90008D14B7E2DD8F4DE62500E26BAF4418EC7925EB" "8D779CEFA1560E8C11CDF6C71AB3470682B37223520C8025613AFEF89C521A603BF6EC7DF8" "59AC75CA5ECBA44EBFB31603DE4E1A9680CF7EF6B389045C7FFDF5C95D0662B475702B6DA5" "1DEA98129349BD68E10F19EC51B5C9DEDE6F84B5EAFEAA958FA74042BFEB06799E3210806B" "5962FEDDD4ABE44B0BB7B6D3F61F871C6DDC9AF4BE6AF2EFF2FC4FBB28E4BA5BF2D7E5F77F" "5C2E5FBAD4039FE6F6D7495DB3B8092DC5B25A9590358027730B0E1EB07993B710305A136F" "70A2DB8540479C54C15A770B0A76221702077BFF65266B3613B35689F7200138FFAEBBEE9A" "AB9B7DD67DF5B4A39596409AA544244AA4C1BB972D03E4510343F53B3B5E38E53183AEED77" "A131E42DE98CB404D38E15762D588261EFC1E3CB5BADE2051F5AF700BB0E42CE9D01970FFC" "FF7881008010F4E33F2D45D67AA81BA003FF387BCED15EB3FBBF1FA8AAFB2B69771729F420" "2F840C04E09A963C09AE4CDC1F342AF9EFB0A5394C89BAAB5F93FDFF9DF63FED27E5B47DA9" "54B2B6BE963415982C757254B32582BA742D774B5B027B6BE23DD0F4BE635FB007460A209E" "29DE0366152F6E80819F35D29269D99EE7AD74E0B62811156B4DC0DF471F7D348102120621" "4F40C9E5B19F3EB7E201BB07BCFBD1F23D62C6D7E0B9402E411211F068EF517A263B86387B" "63A9FE76ADBF37EEAC35C16EE3EC9569135D312915222B5A375E9668FBD912919877130421" "FAC4273E210F3CF0403A8EB6818BC00B4CC4125CCD06086210F32641CDB4BD6BB70EBF7EE0" "C0816FA89F85656C90FDCB4000AE4149CBDF92EF7BC51EBC95BF1DDBF6BD3AC17426FFCEEF" "BFB7B7DBE72EC777DDDEE541D6D7D664E7F24E4AF6A381699ACB1C9316088050E4B307BEAC" "717B1A9DBD462761BB44CF6A660CECDEBD8526633BB1737DBC6BC5090A64A2E211080FE84B" "F7B4C785C00C0163A83348800298A75D5F499BB7E7B0A6EDB555A92D6C7D3978CEBB4ECFC5" "38B1BE7F3EDF12206F05041325065F8F78D86BF53A754D79FD64CBB460CEE493978EDABAB2" "C5C93E9F989510F81D6D6C6CA495002001AF7EF5AB1389468CCD786D3C37BEBB6B4C5E8A64" "14E836EA48E4AA69DE7D7977F7D70FAC6F7C73470E067921652000D7A4E4FDB6A33F595E8B" "1242B85762FB7743DE5D4C37F869DB6906FE6E72EC82FE46FD7AF798F73DD73DDA5583C267" "CDFEC71AB73721736C009B8ED9FCEA69CAF6BD47323C2DD54EF4163C58B3F400870142C82C" "6CCFE3B23CB0E76BF879F8D9D03F3015E35CAC0EE0BAA978EDCDEDE69D5FD2183DD0E7F62D" "3D07DFA74B7C737E6EA73F71C092FBD02EE913438CF83919B8AD466EEB61DBC51241261CDC" "96B65ECB96FE79CF64736BB09B07E782042065F0891327E4E4C993894C1F5D3B3AF79B8A71" "96A124D549D41AD01D85256032D9FBA62A841F5F1FADFF1D898333E0859481005C83821FE7" "AA756C1BDB9F862931A8E93F6BEC69B73F68FD6D77AC42D05FD5ED07B0B6B62E67CE3CD99B" "FE7552D37DCE7552B5816A5663B71229584A9C09561C60F780590800EC44EC9974EDF576AD" "36038F178C28049456F35390D2099EC98C5776A0E565AC99F33108F69B87D9F8A69B6EEA77" "12F4840988D706FBD5F69F0D49F0EEA5E780286A5E08EF7A8F6CB12B898987056B6F9C7070" "266BE136F6C2B6B7C67C70AC8A250EB65CFBFC9E8B8749AD98F1A965C39A864DB48E1D3B96" "CA477B6D6CAC9B31D4767B04B4394780F0FDBB4D85F6F6F67E2A54F2DBD5487E33B67E9F0D" "F2EC652000D790E4692399FF576B67EDF8BE28ED37A489284ABFC4AFB702A4E57E6DDAEC27" "F9F64348EBFD2FEF5C9E5BEFAFBB9F41F3577780A7E932A8B1CFDD031F166F6996984870AB" "29722016032E83862716743898CB6A750CE45C7F7B3FAE3F831ABB35F8592DC1823B00ED8F" "C871988BEDBDECBDBDF71E4097DA616ED438FDE401A0D7970AB2007F98BAED73ABBB888994" "1D379644B146AFF7B2B9F8ED382B913D4FBBE73C036CAEB7DA3893516B51B2A0CFAB024AE3" "1802B33FD222830460A748FCB636D6D7CD83CA3CF0076B11E8F203C494B1BE91C9DEF4C7D6" "E3FA6FC6C10AF082C94000AE3109D264F3D9AA3C700A1AFA212413A9F2E4DB47FBF711FF4D" "4EF653F7131FFE6262D2BDFBED9EFE9ADFDF9A5BD984BD6CE294024960FF2A83A4900F9BCB" "67CD90B54E5E8FCF5A259B7397DD8BCDC142206933030A91002120B5D75B00B2F7433F206D" "3000E3E8D1A37324808501DAF3FB97888377DC2325563C0B02EE893A22F21F6386C158356D" "6E17CF35A36DC2AB2B4AC244CD5A87B86F6C5C055B1A3C62A96DE045FC737F8B433E5ACA58" "08812B002B3F8E1F3F9E9609EE242BC0817E596067F50FD22251590CF33E81EE6669A54ED3" "345F39ADDBBFB9B1B6F60FDB6620012F840C9B015D4312D3BAB620A196D57985F64169E541" "807F6CDBBCDCAF95695EE78F892226209B4D60E3B5F5B461C9F9735FEA275010005CABC0E3" "69BF423E7FD6A0559669487CACA4C93210B116C6E01EC985C06BCA3D60F6BEB3666A2BADD9" "1048EFA9B9143840B1A5BD112CF8B119DC5E0FB7CBC30F3F9CFA00A021649DD0978D606752" "64DBCB6B672E8BAFE5EFBC63DABFEAFBE736B3E4D01201211264FBB934DE6CBB733D95EC5A" "20F7C68DBD97057675EDF0F5152508624B811D07B6CEF6B32504BA9A05F901F07D5A2A193B" "D59F0959CA08A85601CB8342F7FDDE64E767A74DF3A66A5475E8F55C5F8324192C00D78824" "3D3842FFAF57E799435AE8FF0B8818C63C32356BFC91F31F098074BD3F3623010918D5D8AD" "6D4F9E7CF28C4CB0FB5F5E6E87894897A3094DE273F7F3EAE02CBDB3136D24DF77A0A03AD6" "ACB91CABC5B585CD77BC657C422484AD16A56B0299C1BD6585E268940A78E2EC1DC0448883" "C624F70334EA8F7DEC63F2FAD7BF3EC50570647D4943F7FAA6D457E268F59E05A1741FB514" "C18284FAD96438960C68DF58337E24B3BCB617CAE17EF2CCF47A1F7557457241713BD91502" "F61A3D87FB8989AD7539F1F6C0429622B63AD8DF00347F04DB1E3972446EBEF966D9D9ED72" "03CCEAA3BF8B6E7F8018663902FBE7417B4EA77269E7E2BFDD3AB8FD6A09D53987330DF22C" "642000D7847466B380809A55FA4144F9CE36C637741347E7E787C6DFE4C03F8DCA47B6BF34" "B9263FFF38F9FDD39A6D4C7839EA1F5A89AE04604DCC0354ABED7AFE5B36F97A206A01C5BB" "269A18809652000B019A4EEE3CF9F2841F28939B389A2193150616FB9C9C09CE0B0C536177" "876D07FBEC48C50C77C07DF7DDD75B666C9D640919F0FACFBBA747666409F0DBB6C07340FB" "C7CBBB8F358BDB0C7CF63C0ECE63C268AD0E4C983C6B8F4DF663090793347B0E5B8E987C78" "ED658905DF87AFB7CF8EF748A98D4DB6D415609FA58DCE8A09B56A6A444094F47B9D4E27A7" "762EEFFCECE6C681FF7208087C7E3210806B407457AD50AF8EF60F994E9A1FE9E687D807FA" "61995F9BB7F74D136B36FDA7F6C913F2A54B171734368D05B0E2015EA0A4370C446CDEF576" "6ED3EB389A5B9C49D8037B5B3E4FD4962458A029590EF8D918704A00E001026BFC622C019E" "15C0BEE77B21680CF10058432E1437C16DB21F12E0DD939FC32B4B881CE059401E4122E1AA" "50F3B6D5CED9BAE1114ADB6E91E24CB8DF82C991605D0A9620723B7AA4520CD95080E6151B" "5EBF703B5B421197042346B24C810080346169E05D77DE9948F7DA78AD2B2FCF61316FE5A5" "41CC215BF772CBA5FF12619FEC7CE7B8AE7F75341AFDFBD2EA9641AE2C0301B816046EB395" "FA0DA449E2BB45E2DD2938A8D7FE9BBCCFFFB49F243BD37F3799600242C4F6B973E7FBC954" "D7FC5BEDDF0324150B1C1CC9CD006A357FFD6C3574CF1AE095A57568690D386B82E22CCDF2" "96E77944870196490D03E3328B4609486C3B94AEB575C0E6418805408E00BB3CD00369BE8F" "A7C597AE2BF531BF57D0B4DA3FC7458863F511024FBE9F05580F6CBDCF9E76DFE6552E7CDF" "404B33ED38D0DF81987ED6B26C9A68DB5F969C94AC00625C6BB68E70EBC01570EAD4A914EC" "D9ED06ACB9806352F383C90DD0BB01F01EE5EBA952C9E5BD9D9F5B1F6DDDDB62BB6F87F00D" "72651908C0352021CC4F7ED7BE6052697F409F1B417F4DDED92F69FED06C744226F335966D" "F164084DCE03074FBB679260CF1527A8ABE453156772B7E4A04444BC7AB6667D7720DFAB10" "C0D8FAA8D8095A0C21F0EE596A132F96C0D3FA3937BE509C0413162C0F0468DC72CB2DA99F" "3C3702D789018BFBC7EB2FEFBA40169E90D7FD9F3973662E3DB48DC217F2E7978818F747A4" "E03B26726C11B0C00E17894D016CC1D96B1BEFF9983C05FADDF0673BCE99B8D9F1CC2B5F40" "C21138091280E440E977AA75CE56BAB4B22757475D9AAD843990476E80493379CD68BAF7E3" "9B1B1B7F67B0023C371908C035205129F34A489A643E1463BC2F2F0DEA803FFBFE61FEC73A" "E1A4FD57DD463F62CC8F78D928725DF36F27627196EA49C1B4EC81A1984994275FF6937B40" "EB81BFD0E4CB91DA2520B375B3A01BC9C5C0E0CBE5060A5CB465D83A7B6E007E2626310C84" "F638347FAC0CC0FB1B6EB82181EB324D9F8F796DE27DF6CAB0E7A07EB8374CFF2091DCC796" "B4554EAE06B51E88B3D4D323095EDDF4DC92062E64E28FE402F000BB4446BC8D8CBCBA2D1B" "CFD1C95D11F3925BA4DE467F221E40FA768829503746BC1A430662CE07A00DD1050956D548" "263B3B3FD98EAB5FABEAEA63433CC0B39781005CB502D0AF408DBB3DB65747422BCD8F88F1" "31C6ECF79F36B31726123B596132B319DB742B5A5DF3EF6935E26888AC2D57B4AE5B48CBF2" "CCE75ED95E909F9019D50A930DEB6BF7EEE59117ABBD5AFFAD9DB4F9DE9EA589E31E5823E4" "7B71B91608BD760449FB933FF99344E29028089FB93E2520E776F63E0BF5996D3B4B6A401E" "A1B98230A22EECDED16B2C787AC487356AAE87D75FDCA61C7CAAE5A8D6CF44C01BA342E3C8" "DE0FCFC8A4D42302DE33D87BAB2B44835421B0E85CBA74599E7CF2744A139C9FDCD4C18EB7" "F9BE0C71766E1D44A64D1B2E5CDCFD99CD839B5FD70E04E059CB4000AE5AE94266621D5666" "B7BF64CE6FDB0F48135F15EA2A45FC777EF5B65F13AD094242FF4FD6FE9F399FFCFF3A4187" "6CCEF500CD034B0F04BDC95027596BCEF74CBC365F3B9B2F79A22F69AD56F3F27680632DD1" "8A670DB062C14DCBF2DAAA64C1B0C7BC951256D8F5C12675885A02101878F8F0E1D4777C0E" "F7936D4FEE1F3E97CF11025D900E98FEF157C78F64C0B5FDC72E166FE50693468F7430C0F2" "B1AA5A4CCDCCCBF9F4BDD6C72357D6FF6F0930F797570721B7185B0C2C91648289622E5CB8" "98FA15BFCF30676DCAFD61C03E2F73EA0841C8731F56055468FFE9BB626C5E3D1AD59F185C" "01CF4ECABFCA415EF9821F4CDB48882BF26A534EFF0F8901C0F48A9AF4A749EF313DF491FF" "DD3E0109FCED1AFB6EA7C0C9527013870C58D3A767F2F4AE0BE4978F1439AD9F4B4BB384C0" "94EFE14DF05C471B2D5E9ACCF9D91884ECF18A92F130F910A3FD72399EA9DFAB937D36DC0F" "3BEE7DF8C31F4EB90240043CADDFD6C9FBDE6B53AE9F3DA6600DD33FEEAF3B450A817B9593" "49A9E01C6BEAF700551CC262C706F799ED07AF2F3CEB8F1D4B0CB4E22495F27E07769C79E3" "52A8AF3D32653FC7EC62401E05B4E95C5C4C027CF35E8B4AC5CC627A242F11C43E02D0FCF7" "76F67EE4D9E4041AA493A12DAE6AF186F6B5FA82165B7D558CF12B1444F405DF7FB7FC0FEE" "80389741AC1E8DD276BF172F5C9C9BDC01FEAC5D7BC0CBDAA0D0C4CAEF85F6BF1702150B04" "6CEEB51A945707FB9D8AD5FEED73F0C4CE1B1A592999F94B00EA89DE233A3E707B4FBE9767" "E9E07AA8006001181FF9C8471209D0F4CDCBC40378EE13AF7F2DB0823C2237015B4AB85F4B" "84479FC59AE76D3B2959B0E383C99518F37E89B078A0EC914FFDDE8E09ABA9DBF66712665D" "07F65EEC6E101AAB4C0A74BB6D2C09ACAA40406FCFCFCF625607746584FE778EFBEC4D26DF" "319D366FEA6208E48AAF4172DB0DED70F549E857C48AC47EEDEC2ABCDA6FD7CE8A09FCBB09" "AAC991D06972CAB67F3B3161A281A9B13559D13452DB8A17C9DEDFCF012D7100C68A3729B3" "B9D69EB34C2B2F1DB3E06F275C9E7CADA99A57225800E3E72BB587922F0B60B6BCD273F1FB" "12312999EAA1F983043CF4D0437D4027884009C86D1B94FACA3B4F010DD1FE30FD637C29E1" "600B015B43F83B5B2E9308760778E5D86B2D00B3C6CD8481DD034C506CBF312961F2609F89" "DBCD1BB76CE9B2045BCF457BC20A8078802AD81C26A6ACBEEF4337E3A981C09C924855DAC4" "6BF747DB9454E8CAAF413A196200AE4249A6AF345936D7DCB32D9163ADB47F517FECDD0493" "13FF98802B35FF4B9EE000FC69B7B6FC192F4CEABADB9F9809CC02295B03F83D6B3BDE39B6" "7C15BE4F2938CB4EA8EC571633D9B339BD14D9EF95CBE7B10F9901AB641D891405CFA0E391" "01062A06397BAD1830931C4406933C96086279E0A143871231602B4EE979AF742C641711C6" "0DC01FCBD66C601FFBCDB59E9C0699CDE291E21B2CA87AB11E3C9E6C40A8B7C69EFB9CB7FE" "154318EDF8E1B60AE426F0C6B64718EDFDAC9581098D8E35F42302734F3F795AEEBEEB6ED9" "DBCB312D92FDFC28B78DBDCF5F64B657906463414F66B04A633AF996A6597BC7783CFA7F87" "5880FDC94000AE460969C4AFD0F3A68D7EDE214DDCCEEFBBC43F9AFA372D039C26625057B3" "218DB4A1D01261010866F253F0B7131D9BABED24C9D9FCC468348196C779A0CEE73341E0E8" "7D0F94447C4DD0D3BE84007319D87AE482570194EA6213C5F0F3D8E0305B27AB717A1A64A4" "A592362EC27E0FED11E663FC05A1DBDADA92EDEDEDB97CF79EE582DB83811FF745A01F5C0C" "0027041BDA3A73F064A065796C4DB1E3C13EE7328B891724C884CC6BD7489927B5BEB6DEDC" "2F9E958557A4781623B66484C292D6924543CB427D1F7FEC71B9E3F63B52405FDAEA3799FB" "F3B955AE9B6AFE1A0BA0F101F63962C458F8C9AA3EF8B5C38A80FDC9E002B8CA24FD2CDA2B" "FBB8AEA557B2FCC5F82D36F82F36DD64D6817F93DC01622288D38494D2FE5E9A031B5D2D60" "27214F63E4095A4CC01E83A1CDF5CE939D4E945E4C00DF47C8C4AA13B6ADBFD5F8B92E961C" "F071365DB3D6AED7EAA631961C3148B19667C1C4DED75A154A842250243AB7A35776CC6BC9" "713EDC01B0F2C0940C4200ADDD02B16D772F58CE3E1788210823FCFD9A300A5AAA92108E39" "D0F2D5B2A4E5E8F304C7BF6F9FDB120B6FC320FB0CF6B985C8D495C05C8810CA125268C79E" "3DAF34B6BCB166856334984023D323C816AC2CE3F1A8D7FC17F29A04DD174044DF7559018D" "A5ACAEB1C1D7D74CA7D3AFC5D6DF08102CBD06E964B0005C6D92002EAECED23F49B3C5C936" "36DF84A43E0A88316F25AA39FF3171D46136D96042852607026027532F910C6BF29E862504" "4AFCBD05687126583193634B9BBFD8F375FD35DF4FCCA45932ADDB09BAA2E57BACF9F3B9AC" "5DDA3A5B409BEF96799709B7A77D0EB6B0B036C8ED68CBB3266D316006B33F8003AF63C78E" "252200D7008E0358F05260F6E22394F0604C40D3C778C196C44A82942C0A1116AEBBB7EE5D" "DBC1EB6B710245C558A8784CD873BCDD22BD36B2E35BEBB42C6DAF8D0FB1D602BD8697ADF2" "B5156D5A659F93EBC3BF279036F41BFA30B72C763517A437C1AADE2AFBFF731440D7772232" "5B0E18BA3931670B9CEE4DFEABB5D1FAFF2D8317E08A321080AB4C30D893DD6655486C67F2" "7F8F4439889FBDFAFE634E01DC6BC43900D04ECE300DEB76B2D6442AB2A82D598DCA9E6327" "3B3B117BA67E06573B41EBB6B1421A9A15D696664DE02FB3F3B42D2FDA7E19B0B2E6570279" "5B0E9B875933F4DEDBF3F5B8D5FCD9CCCCF76482A2BBCBE1380800B699D5324004F00298AB" "766E81B13211EFE8179CABBB47DAFAB149DB122FF577AB35C9B62B8F357E067BBDD7A7364E" "8023EA3922DFB3A87030A51862C00496FB9BFB301AB781ED8352BF7179B6EEF63C260988B5" "B8FBEEBBCD0A9E2ED22F4847EEE74CFF3927C0DC6601C965D0A69D3FF726D3F78F267B3F56" "55E113A5DFDA209D0C04E02A136CF9BB4A99FF4237417CB3E4DF7A372165D378ECD6FD6B0A" "D06E829999A97503199D7031D9DBE03FD6B43CCB80FDCCA66F7126627B5C8C96A9A65BDE1E" "D6EEEEE6DDD7D3ACBD3A96AE13C7ADE0D5912767B66AB0EFDE2314DEE46FEFCB41864240E3" "DD2F1813BD4784A0EDC3CA03128018006BB1909CD14EFB9C412FD29235BCD402C340CD4192" "4CF0F4B35D6962576878417E9EE5449CB1C680CD6DEEB94E6C3DD9B220E40E699D259896C8" "F0730B11604B2ED83AE28D0BB652A00FE1C2811506BB0336ED34FBF883A63BD341D493000D" "0B4C45630E081A21985D83CDDE77ADAD6FFC50D30C046099F82AC720AF5869832E015C99FF" "EE896D7C4F37D1C52E4808409AB5AFD94459759340D05DDBA6C9022066A2ED970A66B952D4" "3B830F4FAE7692F3C054A504DA9EE61C1D93BD9DA8AD4582CBF1344D31B10B5E1DBC7A3020" "5833BAAD8B57675B077B8E175466CFF502E7546C101D03A1822D0044FBD79AC36125E097FA" "E5F15713FBE8F3B2EFDDBEEC39B6DFED3358CB8A98BEE76BC401490F2CD942C07D2C66391F" "B75B3041A996B8D97EB6E50A813C5F638303955455B4ADB067F217223D7C3FF401622FD087" "9D7F3E2468AA428EFDD7B11A666BFF3BF037C7257F07D256C10A34FD9EBDA63DD5C2D293D7" "4BD9D7209D0C1680AB46F28F3DAC4E9761F29836D3BF90A2FBD33C305BFB1F0D0140CB5461" "C666ABB4F67FAF270036FADF4E9C9EE6C3FEFF4051FEAC7DB14BC196C3FE5A3B7147DA70C5" "4E94AC75DA89DED362852C1176E20F2651903749335873EC00D7D9962D0E995089144BE1B5" "1D130FCF9DC0ED274673D7F301EAB002E0052B801812C181771E41D167B2899818C43DB0B6" "BE726B35F1346671CCF842710D42267E3180CF2987EDF94CA83C52C9406E01985D473C9679" "8C958830BB43B8FFBDE7D3F79A6F011B04A9663FBB47F7FB8E860BA8CBCFD4726617A86AFC" "D6B7DA9DE60307D60EFC03040A0FE2CB6001B8CA64C5B47F4C18EFEDC12283BFE601E8F282" "C4DE2428F9DFD82D079AD3E6550B664DD2FBACC2A0A76227339BDD4D9CC030D60485CCAF5C" "2EC716B49450852778D60685266CABFDB196CD1AB5106831C950B160E19DE769B1569BB419" "03F99EB68DC47139B0161B4D643CB4480571D644BDB667CD9BFB2A9865888122F26DBFF17E" "FAF69C8AA2F8B95C0675B62A30D07240A6D786EC96B0FDC199FE8488B08D97F0DADC8E5B6F" "0CF2F8F4FACCB3A6E09ECF3C73BE3B9683FBEC289A590262EFE68BA67CE9170E747300B20B" "4EA6936F9E4CF79235905F83E4DFC3D00E5787D80530CFEF2557CDAB8DF1CEB68D0FA61F78" "02FEB6D7B89ABC07003C0255989F50A0E9EB1EFF3A21E1186BFCCB26DA92DF9CB557D66A55" "58A362D011026A2132525186390649FECCF7B7CFC1DAA417942586304493B6560CE9B0EF2D" "412905135A52C5A0CACF2904A09E55C196CD7F6105409FC38FCC2E831231E136A84C04BC47" "0AF4C5A480CFF1C649A094CDF69E7ABEED735B6F6E17CF45E569FDA571C163C39EABFDA962" "FBC6BB47EC9372CD620DBC1D0955B8EFF53D566C9C3B773EFD4EBB73D4E4DFA700925984A0" "69C3594DE78E545261FE786D5BC911195569D334FB1A64BED50679254BDAF9B71BB4A3BA7A" "6EAF51957C63555A6233FFAA93DF0CE5D6FDAB4E1351F5B22D36C813C857EB0FBA4D1345F7" "5DA7FDEB2417BBB631FE7F04FB4D267B73939F4E6ABC6449081898087864802764AB115990" "28110E8E2E67C06153B107789EB665F31B08012F6B651E40F0E4ED0190A7B1B226DB52EE02" "EE576E3B31DAB2773E83921734A9790110F96F098015FBB92A44AF3341BA92A58001BC445C" "BCEBBD73F8BD47903C25CC42A80000200049444154C06752273496997C6A19EC42B0F789C6" "6DC6F7E2F667526CC95FE9DE422E012CC354B7DD5CBB4535FD47B6FA770983D432C0AE8BB6" "3914637CB7C679782B42565D861880AB4046E3B13C73E182ECEEEC3CE73CD60087039B9B72" "60E3C0CC172E31AD9DDF9D74D1F2A36A36F96F1ED8482400D9B9120DA8BA9DB8B0F77ECCE6" "F81753508F69DBBE5323FFD5D4DF4D286D6E87A04982406B7AD36017EDDFCC4D565E54B59D" "8884264C169EB419404B802706C478E2E6F2BC09B2243C29CB923CED9102EFBCE7B0E3C403" "112160B040A4FE730607CF14CCE4C793E8B8461880F8F934498FA679F6B640B6E5D9FEE3D8" "034B763C8B803DC7AE8FD7FD2582890DB1D697D664E66392C85AB16D735B8768D6E47BE386" "C713B7A5D5C0BD3E2EF50B9325B642B015A1A2244C622C4CB6EE9AB951DB0F2400591DCD8D" "730040B7DE5F6C0E9454B4CE03DD6641FD912A245E30994EBEB1AAAA5F2EB984565D060270" "150880184BDA2E5DBEE4FE38F72393E904BF40591BADA5B2429E54A0EDEFEE767E3265D969" "7B4DAC9F4780D5689CB2EDD5C9F230928DB5F5F403C62E7B49F34E4BF29A173C2F511439DC" "B6ED3B2B9D788CFF3FE67BB6F0E585CEEB871C40A80E26478080D596748D774923F2B44559" "02C4A572FABAD37A79219F7BC9FFCEF76442C093B93813B010E1B0F7B665797F39FE401C8D" "8FEB1F68AF772606CB820519D82DA83279E067B0CFA6EF016EE86BB80134DABF04901E11F4" "DA5E0C49B09610BD97AD0B27DA59761FDB46254B4D4581A4B62DBCF6F4C6288F4B6F5C797F" "B96DB9DDF977C3417D25C2C6C44125EDD171F9725ACE79F2E4C9D9395D29B33A4A5EF29F01" "DF8CFAB46360BF555ABEEF7432F9D6F168ED47AB7AF49965EDB5AA321080AB407430AF556B" "CFB9B2F82901EC01DA49ABAFF20414AA943C2349FAFD74A6760DB46BF6761379984CA7E9BA" "031B1B2902FFE0C18332AAC78918601D6F6582BB9EAF6450F9EA18E528E68B3EF23F47FFC3" "F72FB98EF36050F759DD844CEEAC2DEF87487940BF4C736280F2DAC2AEFBF74CC691A2CA6D" "9DBD74B17C2DD7C74ED81C98A8A2F762CD92DBC0234B915C22CB9ECDBB279FE369BCD1C9A8" "C71AB06AD489285FBA24070E1C58D893BFD4361E38DB7EB4417D1690B99EC109061532737B" "9A2803306BEFDCDEFC3CF63B26B53C2EA3B3EE9FCBB7657059DC4F42F101F65C6BE9102203" "9E1502713D7BBB7BF3759199D21FEC2A80EE2A11E17D028C6B20B90EDBD0B6D3AF1F8DEA7F" "32EC02B828030118C4111324642682F4E34574EDA4910B172F26B08575E0D0D67632DB8D46" "E33E6DE7B2C97F3FD2B6EDDB3B261F7ACB8405BF6E72D0F5BFB3BF36F14BA0287A6B6E55F1" "804E1C8260AFB3E579E7B3E65D0A92E3F2BD88771159987CB9EE5E1D3D20B06D60EFC3FE75" "CFC4CEF7B3F7E14D813CF2E3812D3F1B6BB9FC1CF61C0BC09680680C08C600AC00A57A78ED" "E969C26CC5F0B4F240160906C352FF95C0D56B63AFBFADF66DAD305E9BF3F97C4FFD6C978C" "AA795E9CE03D312E21BB44D15E6F0978C965C16460279377B5EC898439EBA262BDD8044176" "EB005D2EA8274B9A13DE3BDE18FD131972032FC8400006D9B7C46C49A8F26E6C693BDEBD56" "CE9D3F9F82AFB60E6EC9E1434752712003294F7F7C0E3FBA90F6FBFF73B309ACED363792B6" "CF05A0568048C13F899490B99FD73DF7B771B4A092F6CE13B4B75E5BDF732A612B3C81DAFB" "3338799A2A7FEF050A3299B0133783B5A7A9B30582DBC06B43D69EED7396C8A0B50278E673" "4F136690638B860603C21280C872AF7D9709DFCFD6DD0BC6F3C89EC83C41E132ECF8B4D773" "2E06DB7E16A0F57AB62679FD60499E67DDE0B1AAEDC92E17A1DF46AF10149605562628D65E" "CB7D3F2BBF7B9EDD5D0D020CB3ECBFDD932DF4659803FA1C232476C554B7A4B06D9BAF6DF6" "DA1B43085F2C8DC55595C5B0DB4106D9B774AB08A069E1078DB881DDC98E9C3E7B5ACE3E7D" "36F9E4102B00077D14D9F7AB8DF1448CF2869CE7D3581414CC3A4280D1CBA672DDEC2718D3" "AD10809780C003B68549C7B99635BECAAC32F026531BD5EED58B2753FEDE828F37D1F23AFD" "8A561FB0A6CE0481C1C03E2783826705612D9F09959EA740C6AE0C6E6F4FBBE6E7E0F6C238" "D0BA3109F334654FBBE676669268DBBFD45742FE712122C163C52B4B1CF0E5E7F09EC7F68D" "AD27AF926032E8DD8B9F9BC92BF787906BC0D685EBD9B5A31280ECBEEB9FCB949F6981D5F6" "F56F67F157F57FF6052C966DDB8EA7D3F6AB24D412A54AAF41F2581CDA6190E72F9D169E2C" "03F548F6F676E5F4934FC899A7CEA4950B587EB8361AC90800A3CB0E0B2F9C1324BE354ADC" "E87D7EBAF5771BCD8A9FD0CF009531CDEAE63F328B25989BACBC0993BF130205069C92962A" "B2A8ED3280DAE37602B4E72D5B512034E1F2337975562905F979D7B246CB6545F2E796EA28" "0EE0DA7BD8679642F21C6E6B2ED75B59807ED7DC0FCBEAC5AE86525DF9AFD73FCF664CD9CF" "1EA87BF5F4C68A474EEC5F760D786D6823F62B5A3160DBB675924A95C89E1D1F252B5520F7" "910656CEEA986D8EC1EE071066F89EDFE43BE77F67FE00DB1B6D6CFEBC2E155E998DD4F621" "830B60901754D2D2C27A94F65107183F75EE4CCA2770E4D061397870AB0B2C6C96A4E64C0B" "0BDAAFD48F96FDB73901D02CFB9FB90C603F6DE672943380F164E44D5E15E5366770672D88" "27D68A92E95813B70539AB6597409AE3164A64C2BBBF07629E59DE3EA37D3E7671709B4921" "5E80D30E0B999FD965622D261E387960653FF379B60FEDDE0F25A0B5E383AD361C33C2A4C4" "D3DCBD34CEBCF993065B466779AA183264FBC6F687FDFDE8F7BCBC8FC94D74DC1ADE9860B2" "60019A7F0FB6CFB8FF6C39D6F5C45625FB7E56BF56AA5077897D432EB38D334D3FF182ECFA" "8BD26F099CEA699606E8B9987FDAA6F93A894DA8AA10C521ACAB2A830560901747A2E48442" "A314D8F3C49927E50B8F7D01B9FD6534AABB5506CEABE926A837879C01CC6ADD497242A0F4" "796EFBDF2A95AD4BB32CB0DA89CF9BECEC84C7016562C0AA7292B294CA65B3AF251B6C7215" "C77C2E0404228BDABC37995BE0F5B47CBE0F0327130171FA802D01F63B4EF3CB1A2347C47B" "DAA3CA323260EBC16DAF20AC04C0B35070B9B66FF8FE814CFD6CF6E771E4BDE7EF6CDD191C" "BD71C984C3B39088D36662C6AF1D3BFA99CBE171BA6CBCD83ED3EF99F8E939DE7B261055CE" "E2896DBE454DFF51C79848FE30FB33D7AD790C19AB802610CAF7BC753299BCA56D9AE50AC8" "8AC940000679D1447F9FC82580D713A74FCBE7BFF005397FFE1959874B003F526843D096F4" "D534882EBC4FFA35C09D2819C84EC1746C1E10A23464F2556B036B814213174F747D898EAF" "5CC59B08B94C5ECFCE0066C50309FB1C7CAE37F197AC025E59C1F8651994F8198548049316" "AFCE5EBD4A6DC6E770391E7162001202BC604CD6FB2101FC1C5E5DF7F3BD67A160F2E411B4" "521D4A1A76A9DF2C39E0F818BEC6DEC7920FBDC6C68394EAE01159761BF16FCA239EF6DA3E" "3051DBA837DB936D3FA83230037DBD537F4A7E938E37F12BEA264835E07F2F030118E42590" "987E881BEB1B69D9E0D3E7BF24172F5F4286231923AF0032F8D49584BA92585537B6126F08" "7D4CAFCC850FC6BCFB5F7FD880C09476DFB393953533B3D95A85352B7BBCBF6561126D9D9C" "F856D3B2E7EBFA746FB580A7D907D2403DC08C8E4FDE03647B8D10F89426EE60F2DF47B3F9" "8E1400D1B67F4569976D1D3DC2E3FD65A0928229D9B6B53E4F2986A1D41EDE7B0FB085B6E1" "E531C744C6FAD82B27077F8938789607B51A705B7AA0CA75F4C693F7DC7683234D9F1BC912" "E6956BEBEF591AF83DEFAB206615CD1C98F7D9408D647D60CE1528C60520A68098D610BD4D" "D66B91B52115B0CA40000679C9043F60B805D64663B978F9B29C3E7326AD1C585B5B97508D" "24D429BBE0D1A01B7F5BF39F9AFC68CD6F3FD9678DBBFFAAA01DDB14B19593AED47E579A98" "BDBFDE64C85BBD8A33B9B3ABA054BEC8BC66CBDFD96B0369CCDE779297CC5566C740CF3DC2" "ED21942ED89AFE3DE0F2A2BFB93CAE9FF762D2C61A35D7D53E57C902E081BDD7070CAC1EC0" "07DA2488417B194096DAB9D43E7CCCBA10B84DB84F8496A97A755229AD52E03A3099E3711D" "1C52CAA4C59222EEA9A8983ECF08FA0331837E8A0508661180CC070D376DF36511E3D449C6" "B4AAB238FB0C32C88B281D88878E045CBC289FFBFCA369EDEFA8C60FB895B6696F98FDF267" "7F924FB769538EFF645A6FE3BC05C0047DE9C4C2266E3B41D9C9C94EEC0C289ED9D55E6B85" "27BA862C123AD1B5CE66390C985E0C010B47507BE5316832D9F180C7D645C5D3E06D197861" "ED3D967121153372BADBF7F84E5F9AAB81818AEB6BFBC00A6FBF6B4951209338EF02C9E668" "718896D7BFDCB6E204EB8903C25E791E69094B6230BC71109D00C2E804FA95EA1F9D0C8E5C" "FFD236C71EA9F3DC0DDCBE5E4C8D7D1F3891D7C2D3E77EEA0D8261EEABE40A88641150AF41" "9A23E25DED64FA9A21087026C32A80415E16C14F102B05767677E4F49927D3264587B68FE0" "977A3F92FC54ADF4C97E5236C2AA92F1B81689A3CEDF9F8379305960B3242C3704D8789AA7" "9D50BDFDD0C54C5A36B90A83A0D0C46E275CCF84EF693E1CF9CF0066FDAC4C428231F53300" "7801837C1F7B7F91C5E43025D0B0D702BC01E23A51A3BD34EF3EFA73737373CE7AC265E31A" "94A1FB35D83AA01C94A1E5D97A58A2A6C778CB6221A0B340C40059221BDC865E9F689D79AF" "012120B77D6A37076262CA04D1237B16443D626AC19AC96C296190AD271F67525151C09E8A" "1D4B5A0726DB96A0EA7BCF9593EA8AB4E4B167F6FDFBA8E67D630880E61FE69A6A1628ACD7" "CF362DC3D58D4C24BE715CD50F2F34F08ACA4000067959A5CE3B10229BE064DAC8B1A3475E" "BB0E974017399027913C51F66986DB1429DC6DFBDB6993E7F2E485CD4430C1607F0221F0F2" "34609145CD4F8C566527E952D29B924667CBE1FB799A286BBD0CE06C6A55A928156C09C8C5" "F1C57A960EDB66D0E2A1C14B266CDBDBDB72E38D37A6BD200E1F3E9CB2EDE13D801FEFD1EE" "0CCC168075AF06FC850548CB3F7FFE7CFA8B3CFE7A1CF7071940D9705778E4A66462B7CFC0" "1AABD7DFF63B8F4C71B93C3E14D87857440B9A9E966DBF632B86A7D15F890878844EEFCB4B" "5155ECAE843CAED98DE5F50113338EC5E076B36D6D9F238DE3688376BBF37AF37FD0CF8B04" "29CEBDC789EDECC2FC657AF2A67D7355C77FB950C08ACA40000679792481C15E8A01D8DA3A" "F8EAEDADED6F1D8D46EF19D5A3B7A649C7FEE02D38255250A78D7F000E2AC78E1D931B6EB8" "419E7EFA693973E64C7A7DE94B5F4AA0A4E731905B9FA8677E5DF65E08C8F91A7B0FD600C5" "0117155E5EC862C9026B9A914CFA56BC09DC8AD61F1AFA850B171240637F87E3C78FA7DDD9" "AEBBEEBAD4C6478F1EEDC9D5731105F492E0FEE8B773E7CEA5BEC40B9FB54ED8E407D73321" "62426581D5BA1B1834C5216BDC8F628881B6BB47123C2B81E73BE7F1B3ACAC5830A77B63C3" "7B3EFBB76415E373B97E3CA6B8DD99AC5A8B822D5F64917CD9BE42FF5673E9AA5BD1D5409D" "DB3FE6B5FDC1F8FFB3AA10F37B94D7D9064C9470772D9608B6B1BDAFAE8718009581000CF2" "92097ECA30EBC384BCBEB6363EB47DE83B373737FFFAE681CDFBED84D2FB6CCD1CC75AB415" "9D4400F6200178C1C4FCA94F7D4A3EFDE94F271001684083B59AB24D456B27769E70ED677B" "7F369D725D3D133CD79BFDAA56AB128758A8781AB667DD10D33E1EC1D1EFA18143EB3E74E8" "90BCEA55AF92DB6FBF5D6EBBEDB6A4E5BF94024DFFC48913E9A582F172F6EC5979ECB1C7E4" "F4E9D3A9AE78E15C9014900AAF7DB9AD2399C03D42C7E06FBFB78491EFC71A3E133EDB6FB6" "3FD81DC3E709B90DB80C1DC7DE58E33122852D8BAD2585EBBAECAF3826FC2BF5C3B26B4272" "5754E9D51DC8D1FB6D8AE0EFD2031BAB40BFFB6F7F64DE1230BF1AA05B89D4B6F1EE493BAC" "02501908C0202FAEE41F2826A94B972F417B5C3B7CE8D0DF387CE8C88F545538A6F7F64CB4" "76E2E2EFEC357A9ECDFC063270DF7DF7C91D77DC9188C0273FF94979EAA9A792B95A77895B" "06ACACD578BED99259D333C572E0983880C3CFACC7F81A21400BB43260D93389D9375F4DEE" "D0E815F4EFBCF3CEA51AFACB21206E4AEC20B0063CFEF8E3F2C4134F2462006B01FA14D601" "9C6B577A582991311E675E9F709F717643CED868CDEA1C1FA252B224D8F73616C21213DE81" "4FCBB0F56052C0E359CFE7A0586F6741AFAD18C8AD366FDF07E316E0F810FE0D20A1970DF6" "D3AC9F31AF06EA7627D5B40086E4F61554AB7F949911A0630A1D01686FBD7CE9D27522F2C4" "C2C3ADA00C046090174DF08383AF1E66FE8DF5F5EB6EBCE1C6EF3D79FCC40F8FC7E36443F6" "40DF4AC9C4CBD7B006D7E6DDE0701C80002270EBADB7CAC73FFE71F9C217BE90000444A014" "B02766422B698ABCEC8D4DC325F2C00481AD0D9C498D27497E5ECF772B34515BE0C7F9708F" "E07B98F6EFBFFFFEF43A72E4C842FBBE52055AFF5D77DD955E301B7FEE739F4BD601F439C8" "80E473345F814DEDEC594BB85F4AD61C9B548A2D35A53EF134F7CA49E75BEA7B7BCC5AAA3C" "0B954728ED751C68EAD55F1C2B81F7DB60299DE359B3F8B8D651834A914A5CB2A53FB6F979" "A4C3F156CC5AFF857A58C37F7E17661901BBD5C561EDE9A79EBE7D20009D0C046090175CF4" "470893F278BC76FCBA93D7FDCBEDADAD77EA7D584366294D4CDE792AA589458900B4DA37BF" "F9CDF2DAD7BE56FEE00FFE20590510D00682600304BD32ADF064CC13BD070856738B4E6097" "951271E03A3079F0EA5CD1BE00B080E07C5845DEF4A637C94D37DDB450F6D526D0FC61B5C0" "0B02ABC0A38F3E9A5C05B070A08F55D8CC2ECEB8E1BFACA5DBFEF6DA5CDB5D37A50A1485AF" "E772E01D8F5B0BC25C6F1E774200CC7BF7B3C6EE8D532BCB7E9FDE7126B5DC56A1B0F43650" "C0606AAB949B42413F2C06FCCDE50908EA25B05F77DFF4E983BBE581310505E6D50855B857" "44FED3C2C3ADA00C0460901754F0930493DFDBDB95A347AFFFF6A3878FFC625DD7731ABF37" "B1B0781393D044ED7DC7E5EB7B901125026F7FFBDB5340DB473EF2913451C31AA07E54D5EC" "ED7DBC7BB1E6C540C1DAB71070B329D533BBEA396C5560F3B338A4493F430B86C50391F530" "F17FF9977FB95C7FFDF50BCF73AD088215F1420CC8673FFBD94406102FA04B0C3D00130231" "CF02E08D2BDBE7EA5651B1267AEF3E422E00FECEDECF736994B46A4FB36722E9FD3EBC3651" "F148295B06985CF0CBB6199BFF6D39E3512D559D631E52AE8F36837EE8357CDDF6D70609C6" "68F47F6329B0A1826D8A3119CBEEEEE5DB161E724565200083BC2092A71B994C27B2B6BE76" "C7F163C77FEDD0A1436F9002305BF126DED2F7DE397C8C5D02F6388010F101F7DE7B6F5ACE" "F6BBBFFBBB29481026E32B695A3CD17A805CAA036B915C67050C1001DE514FEFA324C55EEF" "6974D12C4983260CD2F39EF7BC2799CC5745D0C7F7DC734F8A6DF8E217BF98AC1FD6F5E311" "274FA3E67157B202F018E66B978D212F0E80FBD4B31288B3D1958E1BEFDC12C1F09E9DAF89" "148FC065785600EF37689FC95B2E8AD53D95AEF8EF82F65296CF1054DFD782661B05E50266" "4440CDFE3816358AA0F329B46D83CCA327171E6445652000833C6FC18F37E5E14786BFF1DA" "4FDC78FD8D3FB96CB2B162274C0FDCBDEF4AE759E1FB6B6E008022001FBE62803E5C020F3F" "FC703A06D01087B0B01665419CB5216F122CD597CDB00C4A1EC87BDA179F8367453E04901D" "F8F7DFF18E77F4CFB66A823E87E5033120887D403FC33A80F6E06443CB88A877DCD3623D40" "B45622FBDEE60CB0E4C003630FD06D7D38BF038F130F84BD3124CE6F3538C97FD8FAC56DE2" "B5931DDF36BF80BD3EA5A7CED614FE7DCC951BE96D2609F902B78D425E495055F5ED3248D7" "DE43330CF27C656767175AE6AD278E1DFB77EBEBEBF0AFF93F5A23CB007DD977FB159DA034" "DF3D4CFD08007CF2C927D3C40B933022E011390E9FF8C73EF6B1E426003094D67E7B75F396" "5FD9F79C78A5E4F7E5B4ACD15939E0B919B82C7C8F0879ACD77FF7BBDF2D37DF7CF330BE33" "01846BE0D4A953690CC022009001416000B6C264CB0337FD6B130195805F9CA04C6F0920F7" "AFCD20E98DA192258001D982AD37966C1D3C2B849734488874302160933F7FB6F5C256E1E9" "7EB847BF374036EBDB65B7B33B74AB04D24661F6C88C08F44A46572189B1990586ACB80C04" "6090E724214757C3E4BF7570EB5DA74E9EFCD5D16874A83451AAEC17ECF9BDA78189A3C588" "D13000FE08028409181A3F001EE6704D66A3A96D630E8C43CE006887F015DBF23D4DA994B5" "CD8ADD0B40A5140058F2D37A20CFD6059D50A1F1E379DFF8C637CA830F3E38F71C83CCDA12" "2400F90D600D00090411405B79D695D298E3BFAC11DB7800D6E8D952C0C7BD7AD8F71EE9B4" "0492C76EA0E57E3695B18E512F28517F47EC92B0A0ED8D59A1150BF67CB69AF0785E5FCB56" "B87EE95F9BCCF9FD73E273EF0AB06600F5F2CF1202CD4BF719BF8F0307360F2C74EA8ACA40" "000679D6829F1A803384B07DC3A9EB7F637B7BFB1D523053AA9426543BB99408007FF62665" "3B212AF001D0A1F503F491D14E93C6C0176CF70DC0B5DB5BDB7DCE002601563C33294F9AFA" "9EB52DCF42C09FEDA4CBCFC7A4C05A044070F0FEBDEF7DEF3511DDFF6289B62B0820822131" "8E35F360C841939C00481C22E8114FEE1F712C3E42897DBCE44225B2290E2154E1F161C71E" "5BB058F3662D5CCFD3659481F65DB0E75A10E7FB5485ED80ED7DE7098B207E2857A0DBF6B3" "C9DB7F0783F9FD3A00DD193411841C28D876075AD335693541BAAEED948267F69E7B2ACB6B" "4C060230C8BE457F837B933DD9D838F0E0F5D75DFF7FD575BDE901B28A07DC9182AA8492DD" "78D77AC70205625569C3A0715AFEF5D0430F252087091CE0AFFB064033C339AAFDEB44346D" "A6C91D007FF1673EF39954064082B52E8FB0785A9BD5BC8422F84B417E1E91F0B437DB1698" "D0900C072407E00FEBC6B52C57B2302D130B90DA8E180BC887007208D700FA9D13452D13AE" "873726F4B30DE6E43165970A5AD780B7F3211309252E9102459938D8E3DC86FCACBCB18F10" "F11403FE4244A074CC5A00BCDF0D9200F52E0081E65F7529FD9DDC0D316A2E002D87720186" "CE2510C40601A62FD0460301C832108041F62DF891217FFFF6D6F67F7DE2F8899F110790AD" "B0D6EF4DA6960C7864C12BCF230DD0D831C160E917B478987811E0876398D459DB80AF1FC7" "E016B01323480002C64002602ED434B31E112801046B729EE624460B62F2B38C4C70201540" "0BBE6D807FC96A71B50B8F316EFF121958F69D5EAB608C7EBFE5965B521E01C40768EC882D" "8BAF5F04B0C5E5A01EE07AE491C78D470CF9793D97901748EA9DE391583144410ADB2D7BC1" "800CEA156508F43E7BED8136D77D26628EF06FA3F96DC4940A7061CBDFFE19ECB2BF6C2968" "678575CF316D709FB10C92642000835C5982EEC73F95EB4E9DFAB9ED835B7F4352A04EEC19" "B80A4F2C9E29DBFB2B0E607AE02A8E391D600E6DFFA31FFD68BFDE1D5A1D8EA996EF8946C6" "33098036AD24C0FA873D40F126656E0B7E36EF99F53B6F7F010F30700EC01FF5C412BF12D0" "BD92A5D4BFCBC46BBB52391E4163AD57AFD72C74700B800C2090525D411E587AEFB95E766C" "E8F8E1604FC9DA7669BB600E22B5655B6B92E71A607269C797055F2BBCE6DF827C29C19010" "987B6391EFC7D601D40B04606D6D7D56E73CEF44ABDBB7B93D678D3DBB477FCC26109A5DDB" "590D4000EA2138268B3F330E3288114C8EF8211E3B7AF47F06F8F72654FA9DB389DF7E6E69" "2732294CE66236C62995A57F312101C411E4F73BBFF33B696278C31BDE904CFE20021E6073" "7D71BD6603943C316132C67A718DA08725802743AF5C7B3CD2BA69EF7CA189904DB6522043" "38064D15D9EFBEF11BBFB158F6AA8B07FE1E59D0F647BF63ACC37A8478108C0104095AFF7C" "A90C21C0F7FA31D05238AB69DBFDF2ADA9DC2E97630DDCC68A788181D1F8E1F5189361D6DE" "C500BFFDCE6AEDBA9F7F2898F66D9DB82EDC0E564000C6A3715AFB9FF477254291E6875EE3" "B7BFABCEEF1F75C740E90FCF24B955D08ED54000B20C1680418A9282FDBAF5B8B7DF74C34D" "BFB6BEBEFE46D636583C6D2852D4FB95088037C1B2D95797EB610D3F7CE0D08491D807E67E" "68FDA5A4257C1FBCA0F1C5BC57BD35BD62673C90000412AA86E895E9593C78E9175F238565" "58250DD512053C2FD6F77FF5577FF542D9AF54F1FA749970DB95AC29DEF7DE67B9421D6C9F" "80F08114228910DA1AC9946025B2BB493221638260C19CAD47256DD91EB751F9ACFD7BE019" "29F0CF5A1DB87ED6F2C06390DBCD5AC62CA9558DDD736FD89747243C32A296B7D1789492F5" "201EA069A72908B0EA5700C4942408017F9DF131248F405AF6A75B04C74C1EEC0281D84701" "A84B61B10157540602308823DD8F0993DED6F6F65F3A72E8F0AFF232219E6CF9AF77CC4E32" "A56BAD78D7E02F3433446D23952F26658021262368FD9E46A3C25A8A9DD850265607A8B6AF" "F7D4004258195433B21368A45CED254DD19A4EBDAC806C05B0D76B7D703F24B301D1792583" "BF07D6CBA4644EF7C8E473F91CC82CEE95A5A2DFAB5B08DB12234010BB496A60A807F87CBD" "ED43CF24EFF57BA435FC9C9FE04A2487AFF59ECD5A123840957F1FEC0EB0CF63A3FBEDEF54" "08E4F5BEEC76E057B73CEF80ACAFADCBCEEE0EF2F5771600BCAA3AEFFE27DDB6C019C1B144" "B06D733B67FC57ABA4E60E90BC82008FDA9FB3B0C1C0EACAE2281964C5A5FB214FA7C90CFE" "B78E1F3DB600FE563C53BDF71263DA8FC61FEA9D1B4D94B63D07F5005063F7B7DFFBBDDF4B" "F9FC5FFFFAD7A7F3303997CC925EBDED79D612C0932E343EDC07D1F520023C697A939F3739" "DB7B7913B38AA7316AB958B70EF3F4BBDEF5AE85325E09C244CD7B568F18F277A5F3BDF7DE" "77A53296D5CBEB07F435E20000FA77DF7D77D250E112F0EECFE558D0B7CBE11804ED78F2C6" "6BC9E42F446682134CEA95B7ECBDFDDEBA1EF89EF679B45E7A5C970E46CA01E0B52F93A8F5" "B457C32C621F3B898A0278DE1320E4D8A35425BBD4326BFF69E39FACF077E5186B80FE0D03" "EEA90C0D31C8BCC498D8F8A1EDEDBF7BE2F889BF2F068C553CAD5C9CC94285C15DF6714C08" "FC75331704FA615BDFD7BCE635695206F0C33CCF13E87EC502B3120C3193AAFE45F2181004" "BD977D6E9E10BD49CFD64B7DA8DC9EF6B3D60B04049BD940F387DB03E0FF4A8BF667ED7A59" "FB07C75D62CB61605D6615F0CE17676C79E3D31BA7B68E62FA012400E3EFD5AF7E7522824A" "02968DB79225CA6AD2212FDFB3DF79CFEF11020FC8F57A94E9593D827127D860406B15B071" "486D4B0000200049444154EF3D325D8AE8B77D6B0904BEB7310376ECDBEBF1777D63632E83" "DF2C1628B7496606315902E6B7596E5B7D3F3BBF57F8751C4857B7A66D16D71CAFA80C2E80" "418C749BF96C6D6DFDC0A1ED437F5B6CC08D13E423579884AF748EFDCCA64DFB5E9706FDFE" "EFFF7E02FC2FFBB22F4B60887CF7AC593D17D1894B530443D3833BC04E90380E12005740C9" "05C0665D4B106C56406B46B5EFEDB303746086C676B60848C37EFD58DD000BC02B5D3C70F5" "B4649B70C7B6999DD8F73B563CCB94375E4B6394EBC6E52809C0864AF88B716089188375E9" "79C55817EC773CE6793CD873EDF936329FCBB6E77279A500D5528E7E5B3EBF67526273082C" "B342D8636905C0FADA9CE5AF1B1F92FDFDA916D9E43FDB18A8AB4BB604E47FBA32E36CF540" "4F00F4616496A671C565200083641F592BD3C90440F313470E1FF949A12035712623FBD94E" "689CACA644063C4B823D86F7D0C831F9FED11FFD519A58B09D2DCA8716560ACA2B1DF3267C" "061000350807347DEB56D02025C4042002DF6A6E7285493B3ABEFF7E12ADAB64D2847B01CF" "A9F707D9C0FA7E64F54330A2E62378A54909684BC7B9DD3D2D9FDBE84A7D593AD7AB83251C" "1E79E036B6E7AB0BE8B6DB6E4BFD899C13E8178E0DE16B2DE85A5FBF829C1D6396147ACFED" "C588B0B5AA6451B2CFCB0435507C82E7F20BCE324215ABC9DBF34BD6038E29403BC2FFAF44" "1926FFEEBD3152A39CB8F89B4D1683BE3AD6E4AF3600993BAFD19B0C321080959720C9DF2F" "12AB63C78EFDAB43DB87BE5908FCBD493792A9DE1E630DCB9B9C4B6588014C002E22F01180" "05308426AC19FD3C93BB07903C817913AB5D77AD1A3DEE8D79428302F53C68E038862044AD" "83D59A6CB93CA97A91DD972F5D4E9A3E401E2666948FA0331000100158222E5DBE2487C7AF" "3CCDBF64D5F1FA7D19187B84C97B5F9265E794CAF60881777EA080395D128BD521002D8C4D" "DD77C21257BDA632EBFA85C91F2D09E4BAA87896225B96D5C039CF0093032ECBABB39065A1" "2A2C81B5E398B57A761558AB003F03DA14443FEDD6399D26C8C66F0F66FDAA0AF3A0AE4102" "39D14FD09C00DABE6AB5547781860AE443797F90C9C24059511908C08A4BD642368E1D3DF6" "DB9B9B9B6F64D3A44A49932F1DB79FBDBFE24CB60ABEF8910280E1EB47563F64F483260C30" "64CDC4D3D89689672AD609C92EF18A796580AE0DB75A13820211A9BCBBB3DBA78D65ED4A1C" "6D2D66FF2CCA83FB02029FF27DF7DD9796318204A02E2004B03EE07971EDE1238717EAFD72" "8AD76FDE7B4FBC7359A3B379E7B5DD2CC9E47169AFF580B624B65F18284B6528C8A27F9034" "08E3E391471E5900712DE74A41A33C964B75F1EAE17DCFA4C2037BDB5E4CF0D93560BFF362" "06C42102963094A2FFC5B82BF04ADB338F46B29BF7E8809B3E6D041432F1C81BFC2CEBDF68" "CDFC41FB7506FEF81656860B172EEC1486C4CAC940005658F2C4BA75EAE4C9FFBCB6B6764F" "09FCAD7813B82C01FED2779E99520112BED50F7FF8C329D31D4CFE0046D5B8791229D5D54E" "5C1E602CBB564C90148808C0DA5E87E3478F1C4D817976C21602350600582E50164803D2CE" "82D460499F269CD10D69AC2502310075B5E8EA7829653FA0CEE0C5EDED4DD8F65A0B3C2040" "6A6EC771B4D7786DDCFB7D93BBCAEC17EFF5AB772F4FBCF39681B4CC7E3769D929FA0FEF61" "09D02582B61D82139DCFF7E1FA32B8734A5E7E466FE589B50E784B0FAD8580E30802651914" "32D9F33D35B0CF5A0BC404C7B2D95FC86580631B070ECCF6F88BDD2640FD3349A7DA9B1924" "6F004463AA53FF17B60AB6E98491CD746363632000590602B08212CC247668FBD0FFA3E0CF" "263E156F72E0EFD81AC07F8526399E14F159F3F923D80F20802D6D41081005EF6D4EB2DFF7" "DEC4C8F5098E9F14DA9D12128D39D0E757D046DD3893204F9A00339C078080991FE08F54C5" "F81E2082E57D6C9EC5BD713F0D807CB984B5510F3085809EDB96C7832D476329B0231F5EE8" "772F60126D8176867B0456134DD10B22B08C742C138FA432E87A65D96744FF81C8A18FB1FB" "A42E251507A0C50484B2C9BD64D112C705E081B047783D6D5FC50B5CB500CDE0AFE57920CE" "DFEDE765FB378D73FD0DA5FCFF4D7205686DD14255F2DFCF58408B40C054EFACDDB7D94A10" "BAFC01B9A744370E8839BBE0743AC1D8198200B30C046005256D92D146D93CB0F92BEBEBEB" "6F5906FE56EC24CEEFBD631E607884007F15FC91DC079FBFE22BBE224D949860792B52AEA3" "9D884AE794BE632D8FEB8BB60108039878D2847500F5F32C2721FB3661C6C779007E98F911" "CBA0C76D9BB39544D3112F7B8E175B9691396E3F3EE6B5259703F0473B3CF6D8630940D1CE" "B078004435B84E33F3E105C205AB0B5E3807497A707E6B7676F4EEE7890792ACB92FBBDE3E" "0BEA85C0408C11C4ACD87E8B4BCCEF2C9549E4E31155EB87F7EAC1F1067C3E9BF4F9BDF71B" "DB8FD9DF9EC76584424C808A12FF14783BE95CF33836CB0098BCF8890484B980BE6C15C887" "D296BFFDDE247A3C66E04F1E815406FAE691473E355800B20C0460C5043F0800D0F6F6A15F" "D93C70E0FD16FC3DF1B42421E05FF6BD3865F07B0024267868FE98F8DFF296B7F466600BFE" "5CC7B0CF58006F32F726409660A29E0138002B5B1E8E614281766F770DD4BAE3B9EEBDF7DE" "04FC9A51105AAE380064DB0BE7A13C94FF724A499B2F1DE3E7F18EABE836C6584E87258EB0" "8AE099BBE0AFC52D9E353012DFA31F6035414228B4D10D37DCD0E7682899DB4BF5F43E7BCF" "B6CC5AA40983B04410E318A983D1F742C44268AC7956232B571A9F2A76FB604B0238EEC096" "6597B07A01B5917CFED6AF2FCEEF8BC15E0C49E0DF6834B106682FB4D5FAFA9A4CA6790540" "D3745AFC48AD10A10FE4333DD2AFF6CF618229E83FC4F9347F9D75A0ED959EB62BEEA98546" "5C511908C0352E76E269BB0D7C0E6C6F6DFFFBCD0307DEC1E0EF99FEC501F392C6EF5DEB81" "887D8F1F3F343A04FC21B84E2751BB57BF270CFEA5F354BCEFBD89D1D3AED04E6999D2FA7A" "9AE82D004003457D013EBB7BBBB2737947AEBFE17AB9E9C69B12E8E3856B00FC5CB6A7616B" "9F20EEE1E5929206EFF59FF7F94AC701FE8885C0B6BBD09C15BCD18E25512D1FF5C29841FB" "8068814460E73EF40DAC2B285BCF5B561F6F5C2EBB86DD011C65AF3109F7DC734F3A8E6753" "F70D8F31D6D0F93768F3ED8B63E1F2FA87EBE381BAF7DC5673B7E4A9E402F0CCFB9EF65FD1" "8642AE45211BF9671938F7A40A954CD58A91B57C5D05B0408854CB17111E6A310700C6EC3A" "E8B20776D73D75F6A94F2F74F48ACA4000AE71E92782CEA75D1D3C78F0B7EAAA7E93F5B30A" "4D12256012870078C4C08ABDCE961FF21A7F984C91DD0F267224BAE1DDD7544A1A0797B95F" "59984C0A6DA0A2AE00808B4EF651D72FAFAF27800781C18A855B6EBE254D6AEADFB765786D" "6C5F0041900A94FB724A89B0ED573CE0D4CF683F0024E22010FD8DCF42D778CBDDF42FDA11" "E08FCFF0BF8360C192001F3CAC2D3029A31D9F0D89B17DE18D3DEF7C16DC53E33CFEF00FFF" "B0DF54887F4F1E787BD6347B7FBBBCCF6E1D1C9D4454DA76ED927D046CD9DE1A7EFB1D033B" "5F27E637C9E77B8441CC6F0D4403BF95A6C9593FB3C62ED95A19B3493FE4DDFE179F479708" "9A2D80352D005602B4F3A9FF71CDEECECEE98586585119088091517D6D35077E245BDB5B69" "9DFF68771700F51F2DF8ABD81FE595B47AEFC5DF79F5E0F7F8D123910A34FFD7BDEE756949" "15A2E0D9DFCF529A489E8B2C4E268B1228925F9304E975202CD048B10D31C048E3022CF07B" "EDE9B5A34ED83077BF94E2F5D932F13450AFAF85888E6AB7681B757170347F9553C7F2F5D6" "FC6C2D259AAC093BF761D508DC0258A36F49C0B379268F547ACFA962C989E4150C782E1091" "4F7CE2130BCFA0E496356E1D036CC21702729B2C48DFDBB6F14CFBD14952653F97AC20ACF9" "7B11FD5EBB71CE00B6D4E977D6FF3F994C1370B79203003BD49FADF15712E0CC25F953EF0A" "E8EBDCE93DC9F4AF16879DCB97E4E2E54B0F2F74E48ACA4000AE6589924C6A30AD1D3D72F4" "5F1DDC3CF8760BFEFCC3F5B47CFE6CC1CA4E90ACDD7893A61E03C029F83FF0C0034973861F" "DD0B72122228DE71166FD2F68E79D7F1F9F61A9DB0002C3061C3DC0CFF33CCFCB066008C74" "299F10F8D936E0F6D5B6D4B801CE32F862CBB2B679B61AF4B263B63D74E5846D2B057FAB89" "0793A8C9F68D0541B59C202810C4022E012CCFB3DBDDEE4718F04BA6FB2B09C601C605C608" "021C3B0DB799ABB790D99EDD01162C8508903863958F71801E3F93BDD6D3D83D60F7AEE1A5" "7E4C109669FF18EF487C85B1A0161D803FB6201FD533FF7FD2E453478494EBBF7707048DFE" "EF909EFBA74F08348B254CB93BA693E6330B0FB5A23210806B58F0B3E940E5E00F1E3CB8F5" "2D6D0E8609B2F8A3F6C05E4843F0B4FC9259DB1EB393094CBE9FFFFCE753F214ECE4870900" "13A5CDA6E74DBCDE24B74C3C73BE3789335873BD85C80026724C6EF04103F8416674999FD5" "D2BC36F5DAD0122ABC5E4AEDDF6B0B0FB0F7FB79D9B92A6A3DB1BBC659D010EA77B620D8B2" "398113FA01FD8276445C095C0CA5F1E489BDE795DA420C80F33931078222BE01E302562268" "B9DE33B0F5CD1BB74C1AB48E36B5301329FB1CB67F036D3D6C9FC53E63E93B7619D8FA9740" "DF8B47D03B6DAC6FE8C34A48B932A63DF0C7BCCCAF370564937E17FDDFCD63E979707E1B67" "D1FF21F6A0AF7B99C464E1AD656777777777E7F2A30B9DB9A2B2B87E6A906B469A16EBD8C7" "1F3CBC7DE8A7BB8D34DA1EFC2D23F7805B68373E05283DE6992FAD4666CFD572A1093DFAE8" "A3F2D0430FC99D77DED983BF382069CBB6E24DC4563C82E0694B57123B79A9E956C11FEBD0" "61660699D1DD08B9BDBC97D7861AF58E3230A1A3CC175B4A6DB8ACDD3D29B5E5F3E923065F" "3B2E342F824DBB6BCDE462B44A9CAB4B48BDB165C1DEFBCE7B268F0097B4645824504FC4B5" "683FB3295C854DE65E5D5833B7D75897897D5F5D2185AFA7FD0B69EF7C1FFDCE6AFE1EF0F3" "733211906C055ADF584FC979F499F13E187FFEACCDBB6BA29AF973805F9499A9BF6BB2FC5D" "9F1028F7574A32360619FBCCB967CE0D310059060B8091E0AC27BFDA447F70BBBB3B72F4C8" "B11F3E76F4E8DF53CD5585271A9E0023EDD5CF66D4D2C4E9FDD5087AFCD801FC5822854039" "04BA69AA5B9E54C59984974DCECFBA9F9DC0B4D2840B4D0E4082FAA3CE6B69CFF24EDBF440" "CA6BD32BBD24EFFE0757C80BF17CCBC42359DEE765DF79E77AC7BC73F07C180F4A9A546C90" "9B3716745F0464DC43AC05B47BB499646B82BE87CB0B631DAE145D16E88D1D4F1BDFCFF394" "2C08815606E03D347FDDC511018AA893A79947F2FDB3B58BEB1FC9A7EF69FA56ACBF3E9A25" "7D9E25808989E7CF0F4E3CC032AB80D0EF4AB2D5060A412200C9E72F49FB6F264DB741963E" "735EFD9F4CFFEAE5D7ED016387FAFD5B992539EBC98069A3D1A896F3E7CE7D643C7E656DA7" "FD72CA40008C780965AE46D99BECC194FC210BFE6C62F426752F62DF7E2F737B742F1281E0" "6CAC83C919133E22FD619645C01F26739BE087CB103341F3E4B64C9E2B78DAE7D58951CDFA" "2000D028F10A393BA06D0B5B86D72EA563FC3D349F976BDDBF3716D81CEE9D57BA7ED9B198" "4DD79AC14F453FC302C2641563083B30C29F0EC1CA11F4932EB154CD147D9596DEC5D9DA78" "94AB1603EF1997D5D7CA32978498B1CFEF513FC42368A643252662347F2F3E202CD9D84788" "34D8B4BD7A5F5EC6D7D226549E55803F0B918DD239B60D544AA4C23E1BFA0A846DD24CA44A" "63622FA5EDAD44498705F585D1949F2F984C7F790340F3BD9201948BB6FFD4A7FF7FF6DE3C" "EAB2EBAA0FDCF77DF354A34A9235CB48B63C626C83CD641C4FACA43B4D67F522BDE86441D2" "9D4056FE617213C80A7835B0685861B4C922A48319C26463B0DD74023618D9B2846D820149" "D664CB9AA7AA5259AA5155DF704FAFDFB9679FF33BFBEDF3BEAF249525B9DEAEF5EA7BEF0E" "E79E7BEEB9FBB7E773EFAD377DF2A6B1E77BBED25400209A7F8E53AF9E29E1A53F76FC98CC" "CFCDFF8F171DB8E83FB6C05F1C4DD0065A592B80075ADE77DEA6455C6EBBEDB698AF0D9F3F" "FAA86575BD72A41EF0DB88E667A2254F3A5F011E6E092DF18BE233AC4D723B9EC5E36C347F" "1D63081BC8404120E1B9A060CCEA763CBC71F0B4666B9A3F9B36F97CCDD5D752CB2A1400C0" "B5A0928E35040200FF7DF7DD175783C4F340A0255C4900575803D4DC6E4DDA81322B5AC180" "ADBEB68EE371F1C0DA8E9BBA782004605ED988FE8E5689B491FA1E085B6B818DC667E0E736" "58EB5781C1BE679E4BC013105A667FDE67CFF1E6420ED20C43EADF7AAA0498ABFC4929ECD3" "E58C802E07FD0D5B7AE943896A524120F908D2580C6E81B870D3DD5FBCF9D0E1A90740691A" "03F0154428A5B930BFF0DA0B0F1CF86349CC4726805E4B93B5BEEAE0F8F45BDF1904C1BCBF" "F0852F64B3BF6A69CC285BED8861CEF63B1FE71DB31D792653000952C9C0A8A1F123921BF7" "80EDAD7EB6B6F1187A1F8D29D072C75A0AF9D9266F2C6507C28A3DCE5A7E26B56941D86B9B" "8300F537BE03DC390B422BC561C5440448E2D9407384591D421AB249666667E28249101ED4" "1A808F8EE94EC07FBBB9E381B2775F6C02D76D1054E00A80DB02C22F83A727500801BD0560" "BD9697EE67FB6785066D9FD7B4F000DC0A0DFC914684BF8D29F0C09F85225DDB21F2A86EB0" "00215D39DEA39AEE7B4DEE1B2C00835F3FC4C0BEE19926B7809DB761A8F817F43C91386790" "7EFAF9BB3FFFB94905A7CE379A5A0088B204FA02A4C4A0972FBEF0A20FCFCDCE55D5D0F845" "6C316D0B061EC87980C164F3E511E90FED0DE57025A547D9687FBD16076BD976AD39DAFE3D" "1BB24C779456E9D3DC7DFC464D0200BFFAF93DE0E33E7A96013B7E42C28E0DFEC375CE95F6" "CF7436029205A349DABE7D06767CACE540357F1D0705698C0104303C0798F7212C627CB4AC" "2EE68F2400D1DC7F58021E7EE8E19877CFEB3530E8B1D6DDEA7B6B7FEBB71D130FC0793B40" "0702000A2069C0E7C8D4EEE7F162C1C506E2F1BBC0F7CAFDF26A0388E105ECBBF7AE6F8F17" "23E0D8FDADEF764C34460302DBC6262A7ECE0CEF1A9E13FA2A43B47F97B4FCA02BFF01EED5" "EC8FF5017ACD1228818174B174BDC112B0B2BC2C77DC79E76D274F9CBC17C2E3673EF399B1" "FB3E1F692A00102148E4854830802177766579E517E7E7E72FB3C555C4D1DA5AA02EC672C0" "71011ED0795A0BC01F265B686730DB8201A9AF3638A6FDE0986AAD69530CC37E26428010B3" "D2FAFCD02CC19410E1DF53A5394F00B2E3D5129EC4C90CC0B351F0EF530D79AD757F2EA805" "DC93C803244BF65930B540D16E83100060E467894048088D181794F6E5859874AD8040E998" "48B58310F0C57BBE28575E71656CD35A99BCFE7BDBBD7B6ACD397BDF3A9F6C854D3D06F30C" "311E4853442C8C5A396CCA5E4B00F6C6D082370B05320190ED71F61A2DEDDD2B04B4DDC792" "5E1BCBFFC67BC57B205DB45EE6B14D0BFF49D2E0C99E34243177F47CD4E44F970A863F0D3C" "25BEEB7F034B12DEF1DFFFFDDF7766C4F9475301806876F4021C8E0E80BD29FBF6EC7DEFD2" "D2D23F5706E981A30525D6C0C5C401B0C95FCC0BC50C8B8502F5F923DA1F3E7FA4FA69FD7C" "6B8AE5F42DDDC7A0EF693F814C9E96F9DA7BF4980F5F3BA45C6DB8273066600A5A96D68E93" "385ABE384280A7F97B1A3F7FC707EE8667BBF46F0B945BDB3CEDD6DEAB0798DE39769B771D" "1D4F9881351E40E70F2C30983F281405A1EC924B5E341620893985E707827F1DC77FE1EE2F" "C815975F11CFD10A81B6FFADFEB47E334D9A5356E8F18406DC238A15C1CDC10183D6C2A5E7" "79F9FF3630D0DE13D7066805FC891122AC86CFC7B43E6C21F0048396101852FADFE28246FF" "8F64E3CCBAAC6F6ECA7C740329F80FA6FE9805806BC426062B4020BCCFDFD3FE2155D0BE7F" "215A1A1E7AE8A18F607C3855F27CA7A90040F442740160D9CC95E5A51F05F82B688BF3D27B" "003EE963FDF12C2488897456468217FBCE3BEF8C66DC6BAFBDB6D2FCF5380655CBA0ACA936" "181FA7C7543D41471A8024C4480110882CC73160CAD0C8B8C6BF27F888037A16E8F9B7023D" "FBFB751BF6C3D40DF0D7223193FA7D36B453806BEDDB4E73F7CE69B5E7090142F3A74B51FE" "3A2E312072763606F7617C50E35F4B07ABD918CF0EEE02B80954E386B560E6F199E8768255" "00FB3D5FAFA7617BC7B0E6BC9D5069E786077A92E2196001403C00DE11DC8F15C6EDB52D79" "057A26090E5E3B16E4BDE0432FFEA095EAE7F5D7EBBB50FA1F52FD36D687D53EE3730A9AE3" "DF0FA1690AE82905A0CF3F539E7F5E21B016094232FBEB5FECC74A83274F9E0C7FFEE77FF6" "C9FBEE7B4076EF7EEE16DA7ABED15400205A59591EDBF67C25355FF77DF8F63DBBF7FCB802" "8D92D50C2681BD052F4F8BB54C8EC11F2F31183334363036ACE8D7A51C7AABA928797ED98E" "96DF951D30D69D3067DB3E08FE7E008B46F9875486D71B2725DB176FFC842C270CF61EF8C3" "ED80FB84F061E335762204B4C6A445DEBDD87626ED6FFDF6F6B500D01ECBF7AAE67D7CD432" "82BA0BAF7CC52BE589279F90C38F1F8E63A6E3AC71013AFE986B184B04043EF0E00372E5E5" "57CAE2D26295B6E9DDAF777F769F15A25BCFC882B827F4A8B549D78AE0B6BCF9AC7FAD45AC" "77EA26D83442AF8F363090FBD602722B74B0B6EF9DEFB5A1E332B808E7A54F4BFF6EA6D2BF" "55F642E8A3D63F44FB4BCAED4BEF9D6E9721D0AF63F0973EAF1D305C6FB8CFB5D555B9ED8E" "3BFEEEE0A1C30FECD9BBE7CB5E6AFBF94CD391207AA19886BA1410331B665FB9B2BCF27E21" "BF3D530BAC2C60B5B6F3B9761BBFD41AED0FDF2D564263F0F73411BE0E5B0794F87A9E19D7" "63B01EB3E36DDA0EA2B0D14FF4F9C00517C866026566B45E5FBCBF6C71E1003F35F35B2140" "FFC22A02D0BFEEBAEBF239362ADEBB1F8F3C70F5FA6BBF7BCFB1255C79E7B668A7828B18D0" "E0D434056D1D4768F35C8701CF125A23E618A7B3615C77ADED42264C5AFFDD7F962DF06FED" "0B8E56EE01AC1D43BE47DD8E7E23DE03F783804068C39DA921609F8D67EA67ED1F63A06366" "AD0256C0B0FDB2C0CFE758E067B281857ADD492E8090CCFFB3B110D45634FFAFAF23BE0359" "01E4EA53DC37C180522AFCEA800F59005DC8BFF50FF3B3A5E565B9F3F6DB6F78E2C891681D" "F29EFBF94A530180E885E20240518BCD8DCDF93DBB76FF115EC40DD36F8F295990B700EFF9" "FCC5A96B9FFB9098123431146601A8C2E76FC19F1940CBCFCF4CBC759C572485B5193E8789" "1919347F0426820143F36713B1BDCF497F3DA1493F0CFEFADBEE03E3476604345C8C1BFE7A" "D1D816B0BCE7E0090AADBE7BE7B48EE94D5EBBD73ED376C0E99DE35D538C1F5B92706B055C" "3BB718FCD4B4AE2E9DEDC6C7135A260940F6BB07FA93C6158467AE56003B4E2DF0B54200B7" "69E78F35ED774EDC803DDE9E374940B0FD924686000B2C781E1000628D7EF4633404470EED" "14F02EE7A580BF1826385802CAD2BE250AA00B1A1BA025826B21E0C4C913F2E4D1631FBDEC" "F22B64EFBEFD32A542530180E8855008082F07349DE5C5A5F72D2C2C5C6B4BAA5A86EBF9F2" "9939F526BFDFFB88619ACA50E0BBC6CA6BD0FEE1B385195703FE42435BF7C0BD333E47715C" "049E866A41DFFEE6BF60B6588408E00F53B1469FDBFBB2F76AAFCFA01F26F8F9ADF6AFC185" "085683F081C035B84B7652FFDF8E616BBB770C6F9F0462DB7D6F51EB98569B2DC1C36AD436" "2DD4132C18F434AD2E24CB81385A6B8B5A73B5753F767BE7141AF20403BD4FCC3D0800988B" "5CC990C132385ABC15F6D81DE065CD0801BA07E2C1A9F2C7E7EDF4E30952DC9EBE27484F46" "195E15CCA0FDE33BF8463D549CDE2709E0250B09C3B2C07D1601FA8EB5FF20DCD8DAEA9A3C" "F8C0838FDD72CB2D1F9B9B9F93A74E3F35F64CCE679A0A00449B2F000B00225AE7E7E6BF7F" "6565E57FB6E554953CF09FA4F14F1200C480BE6E03F823FD0A35CE9183AD0BE330D3F5B433" "66722C048464CA54B25A3EFB40F9180F14C56827F0F7C34A01D085FFB555C7BFC5B45B4292" "FAAAB71302D40A00F703CE43512458230004D08860E256D3768B997AF7E96DF3FE8A03609E" "C9D9A3D6764B16445B7DF2FAE369CCBCDF13286D3B16845BA0D922EFFA3B39AF2538D8FBE5" "FEF5A90C2E0400AC6F0000B4CF431C7FBF156C95AC39DE0A0FE200BCD03BC8E3EBF9F5F9C3" "C77A9ABFB564709FE6171772CD7FACCC87204006F6A019000AF81DE7F60FC67F80FF901D90" "620046B61050F1FD6331B4A5E52539F2F891FF777E76F6CCFEFD178D3DBFF39DA60200D153" "694191E72B0D4CA27BC3DADADACF8BF392F1364F5B6D7DAC55C00345DE06BF254CD71A71AD" "B9DA9E361A1AF9CA16DC4769C53D5B9CA465EAF78885066552D0FA1F7AF8A198238EE86B35" "FB7B9A25F7CFBB77160418FC39AF9F83D8AC2080CA75580B01808F0C04496970BA380EBE5B" "6014630DB17DB6DF27019105B99636EED1A47DB67DEB3EB05AACBDF6766DDBF6BC00520BF6" "761E3E1DF2C6D36BDB0A21DEF5EC731896E95ECEE0EF09625608E1635AC28077BC27585AF3" "BD5D3B401C60E7ED5610B0EF3BFF8EC27D5C136436AEF70FDA88EFCC5614047AB3A67F50B7" "BEBA0322F6F795FF3F823C09087DE8354C60B80FF4A31B6245FEF8FFFBE30FDC71D75D31BD" "D47B36E7334D0500A2B5B5E76F7A485CDB7F7D7D717979F9F7BDC554AA631DA62F8D803FBB" "5F1CA6CCBFC1B4005E9FFFFCE7E5F2CB2F8FC20057F8E3E319B815DCADC6C456002FC25948" "08600060E6E48126E881071E8802006213907EA579E39EB6E7DDAF1D2B9BCB6FFDFC56EBE7" "ED1823084AB096200620A47B80E5C45EDF03317B9FDE6F7184053180E1CD0DAF1D6F5B8B2C" "507A6661DB17EF58AF0F9D09641307F4BC71F3EE7712B5FAD3FAEEB53DE99E850404498581" "20F0E17D823548EB40D8BE778EDFDF6AF55628B69A3A1FEB59043CC0F70AFD8811E6EC3E6B" "E5538A168FC5C5781C16BD42E53FAC56BAB5B92533F3B3296F5F44A3FCBA94E6975701AA9E" "4D2A07942E91630242FD1EE3EFAEB53558FEEEFFEF7FFDD77F76FCC409D97C643C50FA7CA7" "A900407466FDF96B01C0845E5A5C7AEFC2DCC255286AE13104718AD758A0F7B459FB11197F" "99420AAE820F1BB9FE580F1F9AAC2DB8220D462C0E23E4C8E1406E8A16F08B615C62181233" "3014F881D91F653F01FE56F39706036F8D13033B6BFC56D3F7347FB403D0475544F87E3186" "30632ECCCE46A1404BC3723FBC716BF5D51B777B1E0B565E9BDE35EC336B1DBB53D06CDD97" "77BEF79C3DDAAEDFF69ADE31E28C9DEDCB4EB6F333B1B1375EDBA354355397C5B6D1FE76EE" "DB71F0040E2B30705B5E1BDEBBE48DD74E0409719EA524EBC26C42245C8800002000494441" "54565AD2C23F6786E0BF3E99ED07BF3E15F45384971210D8A74A01229C092014FC57DC005B" "5BBDACEDDA257FF6E77FFEDF1617E6E5BA97BEB672117DE6539F1ABBC7F391A60200D18609" "A87B3E5017F3FDD765616EE17B961697BE0312B4528BA18AD400D6027D3EAE051AFA17DA0A" "346804FC21880DFE4B5DD884C9321EABBD4DDA6FFB22A652A01886C3A0CFFD00F823360116" "0A98FD3DCDBF759FC168FD3D55ECB3E97C1EE0F371BA4FB334501F017DD1DFD0FAF0D1C586" "C400CB24506AF5DF0325EFF9D86731E97CDEA67F5BDA9ED776EB3AB6EF62043A260F945AD7" "B6E77940EFED6B8D15F7D74BC9B3020BBB2CEC7BC8EDAADBC796C89E345EF63EECB56DE4FF" "76C7E9362FF2DFFB8803FA3C96DE7C41F09FE82240B3B3D1D58AEAA573F34B5118181A102D" "E49773FD3AADFC17422AFF3BF674452ADED5E763101B70FCD871F9DBBFFBDBDF4776D79347" "8F8ECD8D294D05808A96179F9BF5D85BD4A5BCE7C5F985D7AC2CAFFC474EDF13471BB0C065" "4DFA5620B0DB6D5BFA3D2EDAB1B1114BFC02F851AF5DD7F31787413103EBFBF1E54F5BD499" "B5008231617AE98062C008B10948F583BF4F179469019565C8C144F7F36728BA54C6D59AFA" "BDE03F3D0E2E13803FE225E092D0C570A0FDE93D681BF6195826EEDD8327F8B5CE9904EEDE" "F1F6B972BB93DAB6DBBCEB58D068514B88B0FDF4DA17236C7A7DF3DAF3C6D013CE269DEF7D" "E7FE6804BC9643B6A6784FD8B080EE05E58931E18B016D0FD8ED3EEF7CDB8EC8B86066DF57" "E4FA038CFB34B731C7D7CF9C19567F4C4B014BAAEDDFE5EC7F8DF4E7311CEAF91717C1E01E" "E0458092F21FE30160F57BE8E187EEFBEBFFFED91BD6D737E4F1C347644AE3341500886C3E" "FD734D7809CE6CACEFDEBDB6EB2333287E42D5EAEC8BA9E469D0A111F52F06F4C4303B057F" "30AA9B6FBE39FAAB01AAAAF95BE6DE12025AFBF85E98F1687FAC2B8099220B13FA17C08FCC" "04802D565E53F017675CECB630C1CFEFA5F4B16540E331F838AD6FAFDAFD4B5FFAD2F81B7D" "C25F30FDBC1C2A0900BA2C6E6BACECB3F53451A1780E4BAD31F0E6917D46DE76BBDF3EFBED" "8EB3A0EA090CDE352D59E1D2B639C9CAD1BAEF563FED3D297194BF383137DC9EBE8FBA2C2E" "E689370E7C3F765C5A3CA005DADE6FBBAFE5FBD7F3BC7A0376CCCB7877B1C00F68332D017C" "FAA9A786F897B979E9B7FA218A5F8C7A4FBE80400B0369945FBAFB242C14F3BF8E2D8A0CA1" "34F4FBDFFFFE8FDD78E32765EF9E3D636334A581A60200D1F3AD44240061D7EADAAF2E2E2C" "5EC8E0AF64B5310FEC5BE0EF7DC4808C8EC7E73EF7B9F81DEBE3EB92AC2DA6DA02021BA8E4" "0908A1110CD862747C6DA4FA212B016B10689EBFB56A28D9E047067F05622EE06303FE6CEA" "9F8D07500100EDC21D81C03FB8231007A0657F319EBAFE005FDFA6847900CDBF6D811C2B14" "7863E5EDB300CACFA775CE766D7BDFEDBD788245EBDC9DCCB767224478F724E639D87DAD7E" "07C7B2E66508A890ED8D079BF3EDFD789630693CAF9D80BF07FAAD77CF1B73A6E137FA3F80" "3BD2F100D498EB6710FC38373B44ED4B42F818E13F2A35FD73F0DFB86C402327BA3A60BCD7" "F4416A20C60619379FBCE186DFC1F7BDFBF68D8DFB975211A6F39DA60200D14E19C397AB2F" "A3D1E81F2C2C2CFCAFF10522C66281341853BED56AAD6060CFF3DAD2E224007F9C03F33534" "7F254F63F49832EF6B0901426BBCDBED4A3606403F609E78D9353011A67FEB53B7F7C7BFBD" "E8FD2D5A7296F7AB56EF6500042A5DCB420202BCB06EBD6A79D88EFB04F8779436A6EDEBC2" "402D30F580C5DEA78D27B0E7B7889F93472D20E6EB32007973C1EB430BB43C00F6E69647DE" "F8EDA42F62EED36BC3EB8B37B7783C5BCF52E7C3500CC7B7ECF1F7968FDF1E6BB57A3E7F92" "B6EF090AB65DAF5FBC6DB83F55E1FB41E39F999153A74F0D057C20BCF4AAE57743DEFF6800" "FD4EDB55ADBECB8ABF8C1C6131045AAE3CBD17FBF6EC01DFFACC85175E78FDBFF9A11F1AEB" "23E8FFFEE99F76B79F6F3415008838C0EEB92600C2EACADA0FE065E06A7F1ED3B1E0EFFDF6" "0200AD3020C458005877DC7147F4F5238D0E15CB2CD36981BEC740BD73EC3D71BF3C4D8853" "093B5A450EB10948478496AD6BC7DBBED8DFBDC9DBB7F9FCB6842F0702B2E66F63035448C0" "B1C78F1F8F51FFB000E03BB41E165C58309354279E5724F4FAED6D6BFDB5CF96C90358EF3A" "DEB9DB1D3369FC3DD0F0AED13B8571BCE35A6D6D77AC77EFB69F0CE276DEDA31B3DFED7B68" "AFCDCFBE4BB13E5A12DB5E5F0CA0EB362B0C88234C71EAADF7DDB6DDFAED8D4F6BFC86FE8C" "22F86F25104780350AFF80AF44D37F3CB08BB9FC9D46F8C5DC7EC4058CB20010AB00EABE78" "BB4391A0C0732CFE0E5118409D81E59515B9E5965BFEF3A1C38FCBFCC2E2D8F84FA9D05400" "209A9F5B18DBF6E5A681196C2272F67B16E6E7DFAAE0EF49FC93405FB55806278F395AE625" "A9D0CFDD77DF9DD7F457BFB5C7705ADF3D4DCD63A0FCDB5A08F4989EEA02F0777C106077FC" "C47179F5AB5E9D81D992BDC7DEE4EE7BA0DF8AE8E7B1F43202F05B811C7D43D53F644DC0FC" "0FC6D7A7857FB496030B6118676C43AC853EF7AEB14CB2BD1F3BD6DEF79D1EB3DDB3E363D8" "E5D0D28EED395628B47DB060E7CD7D8FBCEB9EEDB9DE3CF5FA38695C3D8160D2BE2E95D58E" "96ABAD3EAE68285470C70AC4C1A408B62C672C0C70F11EFD3E49DB6F69FF9EB06FFBA66B39" "F4492B9FE946D1F72FF1BD9D89401D17FDED0607FF50D67770170C96FC52F44763FFD205A4" "2CFF5BE20142BA0E84820B0F1C907BEEB9E7B15FFEE5FFF0DB4F9D3A2577DE71C7D8339A52" "A1A90040F47C08024C2FD435BBD6D67ED1320C7B9C0581D030F95BF09FF45DABFC3DFEF8E3" "D174ADC0B85DD0DF249AA4FD8B6184D68CECFDD5F600BA08FA5B5D598DA0A9568AEDEED133" "EDE303068C8F0DE4D33164C1432B177A667F6D0B5A3FB47F4940A9001FD7434FE773DFB04F" "0B06796334E9AF1D47160C3C10B39A6267B22C3C46EFF5C7F6A905C05EDF2D7942A16DA7D5" "86BD1F4BDEF649F7B4D3DF766E59AB8E770C9FAF7380D301392E842D5E3A069CB2E7094E16" "C0D5B2C09F49697F628430CF3AE03DA3FC1BF705E136FAE387C5C1B6363762312054FFD363" "2A2F40CCFB0BA5BE7FF42274830410BA9C06185400888241A816FDC15822F7FFFFF9CFBFF6" "F38F3CFAC869D400F19EFB940A4D0500228D587DAEA84BD1B20BF3F3BF3EEA468B5CF0C7BE" "685E301F03BE35FF8BA381D8ED00262C50832A7F007F902EB92A0D06DFDAEE317E8F415BA6" "6E850071985197CCFF1052A0596B7C025B3DB81F42000B70D65C7C05728DC446A12336C3AA" "96AE1A3DAE8135E9117370F4E8D168C687895FDB552100ED23F80F400E268463F5BA81D63C" "B0D60A5C17D740AAA52720586B8007325EBB361EC2D655E07D3DA5615ACB837DAEF65C3140" "EDCD019900F4670BC0F61E2D5079C282ED871DBFAE1103D16A437FF3787AEFA698F7CFBE9F" "8815C15F04B062EC55588450DB35A2EFAD6583BF6F57D37F12E8B780DF3E7B6F4CB07D0396" "8C785F212DF9BB1E63002499EE8735FD93295F8AF61FB5FB84F45A034073FBC2500F980202" "4332FBA70F7CFFFBF6C26D79DFEFFCCE6FFFEC81FD17E472C2536AD35400209A19CD8C6DFB" "721218C0FCFCFC772F2E2E7E93178FC08CD33213D55443C3DFEF9DC7DB0156D058114C8768" "7F80945DD3DF4AFE2DE1C40380ED8401CBACAD5061BFA37F871F3F3C984C676662AC827501" "A8D60D26DAA7055800F260B2006E543284E500E00FE187ABF1B5081A3A0400AC8288D80304" "49E25CB485EB80D961E54114227AD39BDE146B2668F4BF6A745C779DEFBF4B2BC54108401E" "33076D8A31B75B21C70A76DE336021829F8327D469FB2D606D09732DAB43EBB98B03A8965A" "428837BF6C9B1EE0DBEDDEFD78828CD766EB7D122318B010668302B56F985B98574861D512" "D1982F98DB6CB2B7F73209F83D57410BE83D6160D2185B42FB58500D4ACC60EEEF62CE3F80" "7A6E61AE5AF04A15FC4E6B00E498C14120406C40D80A294D70700B84E14B760FC42A82A9F8" "0FB2A4E06AFBDDDFF9DD773FF2E8A301A9C07DE0D28253F2682A00109D593F33B6EDCB497D" "E8D7D6E6D77ED23278A596F6B013D0B78C48F7E3A5D4C57C6EBDF5D698E70FF0813060357F" "4FD3F7C863E816007A93CF6F81DF6B83098C0495BE2028017815E4B5EE3E3EB0120080B154" "315601445540DCDB9CB3EC7320D780EDB312C603608F0FF28CBFFAABBF3A0A011FFAD08762" "85445C0B9A7F9FB226B0E63FC6355A103636B3FFBF4B415F9ED00302C38715C0031AFB0C5B" "D61DFBDD6EF39E8D1841CD6AC8ADEA7F2D61C31B43EF5ABCCF1336EC9C6881B13DCF9267F5" "F0FA60DB6E090ED6B2A273C80A69DEFB68AFB59562478EA68A7598B3986F98AF6A19D24C01" "3B7E2DA09EA4E95B61C09EE73D233BAEF53319C5D8A533A9E476D4E661C9583F23A399D95C" "D16F10823B5AB44744ECF3EC745F8C0A1CB6F7A5EE7F30630901E3A28B2F925B6FFDDCC3EF" "79CF7BFEC3DCCC8C3C89F5369C3930A59AA60200D14E34C07345783116E717FFEDDCDCDC01" "5EE8C7D3A43CF0575206D43B297F4A0CBACA540064D0622100C01CC9EBB17BABEF8546AD72" "268FB9DAEF1EC3E57B08A4B52A69DF21A480699E3C71524E3D752AFE06C04283D2DC7B6805" "F6B972F09DD7B71671D11F1DBB97BFFCE5B1C8CFCFFEECCFCA273EF10979C94B5E12850368" "FCE8CBE958F6744BD637D6730120F4870500269C03E1050C1FCFC3AEB2D87AA61E30890151" "8F5A20D8B2EAD8EB6D07C66200CA3B4F1AA0EC09C1ADEBB4DAF5C81BAB49820A93376FECFB" "68DBB5FB8223C40B9D07D7960AAC21B9E6D47DE459D26402A84B23DD4F1C01819F8527E8B7" "C628C4803E64B16CE4FBC61CC73C8EEF0978C9D6501510203EACFE17E24983853FB51B2483" "7F5037401F8AB0900EB03C034AC0DE3DFBE43DBFF49E9F3B78E8D0FA65975D1A6B0F4C697B" "9A0A004433CF6121A09910AE5C5C587C274CDADECB3D09FC6DA01F6BB22D8DA34F55C80062" "B7DC724BFC8DF5F2756112CB6CECF79D5804826339B04CD00316AB1D7B3E559848618A4710" "E04632FFBDF295AF8C3E77B83038325A8BF2B498BA473B395683FDE056F8C11FFCC1C8F034" "6052CDB6100034462050FA55CBBFAE0461060280F70CBD71F4F6C90461C0D36AADC6EF6998" "7AECA460C149CF5CC634C7F14044DB96F79DEFC97EB77D6D516B7FEBBEB85D7E8F785E4A7A" "FFEC7BEA7DB85D3E0E73077306C220E60DAF14A8E42DEE1328BEC4D3FEBD8F3845855AEFB6" "37A66AD5DA48C2B1A435FA75CE2FCC2F44EB466C17FEFE8CF55DFA9E409D57F59352E74F02" "0B00C30183501032F85F7CD1C572F7DD5FB8EFB7FECB6FBD67657965C81C086DBE34A54253" "0180A9C110CE350D2FD1DC4F75D2CD6EF69B1573B0E0CF8C82817E4CA368580CB85D68A308" "F80348415BE6423F4A1EF0DB7DDE5F0FA8EC5FDBA749F7C6017E6090F80DCDE8F5AF7FBDBC" "E635AF89E98ACC2801CC2D062F8699B68EF380D1DBAFF9FEDFF33DDF23EF7EF7BB63A020E2" "0CC08CBF944C91EAFFE72A87DE424AF880A142108380837675312325CFFFEF69FAFC9BC1D5" "6EB76D330888F880CAE6740BC89E20224600F18EB5D7690912ADE7B6DDB1AD7DE23C6B3B86" "F6DEEDBD78EF9A07FA3A8FF9FC9E6A4D0034A1F9EF4BD5EB34A54EB343F0CE862448F66659" "6C31DABBADE7EF590876F2D713B8B4EF48598CFD4B41B8F11A41CA12E1F1F83EAFEA5B0955" "7D4FD5FF535080CED1EA3A321C15C2D8CA7FA36EB054BEE797DFF3C367D6D7375F7CCD8BC7" "AC341E3DF2E823DB1E733ED054002072F8C297E19A789967BE717E6EEE7FE38A7F422FDB24" "9F3FFF9EC47894F4E580068DE57211B0067FB5A6BF79DA9E34342DEF5E3C8D9E8941DDF6D5" "D62EE0C046F58FE23B2C15C85240BF711F7A9D9699D4F6C5038049E4997DED77F40D960704" "FEFDD55FFD5574A580092A786B9061A034AF60AC291650508701E7754E64F9244D947F8BC3" "C45BDF3DCDCF0A03F6F9B325A3352FECD8B59E4F6B9BBD4EAB5FE2F8F9BD36BD6B5820B7DF" "F537C7AE78EF259F6B9F199FD375454BD6B90E411CCF1B6E255895307720D4E21DC53ECC1F" "6CD7F784054A760170C19F96C9DF8EA167ED11E79DE6BFF13AD2C9F193275201ABE1BA6AFA" "1F8497AD741D5DC047DFA5E1DA3D69F61234BCAFACF217AF173458B08FEE03BD3E620E2EBD" "F432042EFFDDFBDFF7BEF7215EE258E21153DA194D0500A2FE39F01B6142CFCC8CFEBE3498" "B6F7B1FE4466FA9E39D87E079381967ADF7DF745CD5FF3DDCF86910B3107AB15D863789F65" "86AD8F823F98201820AE81F5F4E16F4780945ED3D3F4ED3DB7C8DBE76DB3DBBDEBE9B8C312" "81788A189B90564CC44705952E05008AC390797C347E40D3027961A39655481C933F038E77" "BE0794FAD70BFAF3DC005E9B9D59D9D16BDFB66941CB031D3BEEDE5CB5F7EA09582D21C4B3" "6CD877CAC6DED8A04C7E2EF6789EFB5C780ACF177304E00FFF3F9E3DB47D3C7F5882200870" "864BCB9CCFE3D1F2FD0713D7E399FAED387B34EA4672F2D449D9583F9384912EA7D82E2D2E" "0DF7DFA55C7E190DB8DE0F68DE510EBF86EA0F29814911EB14FC07A1A0EFF5772AFA932C03" "18B33FF8833FF8F9AD2DAC00B8BBD9D729F934150088161716C7B69D4BC28BB6BEB13E3F1A" "8DFE1933714B2D21C0FAFE5BDAA01048E9BAFE48F78396AA40C3E641A59679D07E6F99B365" "42DFB9C08E5D6D4F57CD03F0A35D68FAAF7AD5AB22F00B05E37982C7A431F4FAD63A66D2F9" "ADF6C0AC61BED5E03D30426843ECCB67506DADE9C06D42508300200664BDE0350BF4169876" "E226689DEF8144702C11BAAFB5E68305606F4CBDF65AC7D97169593BBCE7C7E75BCB015BC3" "B86D6FC9662B885981CC0A0576AE2388154006E1515D3E782F2144E2F983345347FB65E791" "35FB076315E8262C1D6C85A196B0C8F70C81E4A924A0CEC4762516FF51C1A5CB91FC5262F7" "13D6E7E57CA5AFF2FAF3FF41C74BE5873E5B0AF43BB26ABEEA9AAF928F7FFCE31F7BEF7BDF" "FB5FB00F4B6D4FE9EC682A0010655F542235519D3A75B2D2909F2D0213585A5CFAE78B0B8B" "97AA59B8A511B6988DBEA09E499D5FDA9E52D090BB0E5322FC8C9CEE270422FCDDD3A8C430" "8A16B078020B6B4076211E3039F8CDC144A0ED4323C2023F9282EEF8397820583D4FC705E2" "01418B5AFB5AEDA1EF60E01002901608E0071357EDDF33D3B7C61284310000E8B3D295183D" "A1CF0A7FAD7D1E987A82944C00040605061C21AB800643764E611DCFCC6CFBD2D2D0BD67E1" "69ED56D0F0EEC5FBEB8D19833FBB00ECBBE8CD79BB9F1791D2BA11AB6BAB71212B35FBE37D" "04B0C6F2D17D9FB57F0D325537802DE7CB60CFEFB467F6F7E69D5D85B3356E336915CB13C7" "8EE7B1E84633311347EB5C20386F14A3FE7571BF94D31FA4ACE11F86D5FC74653F7EA69677" "95ED831B606979298EC74FFFF4CFC4D57E5656D7F2C24053DA394D0500A25B6EBDA5FAAD13" "0F2F67F42F1D3B469AC1D8E9674DA8F4B7B4B0F82F3A19674AE298135B4CA63705633C891D" "2F2600E5B6DB6E8BBF01AA0834F352FCC4C940B05A83EDAB774DCB04BDDAF92A0468753D68" "3AA89F8F1C7B582884805F0C43F0FAD21248BCFE7A141A6671EFB70716BB77EF8E0200042B" "8036183C183DF79D99B5D71E7FC733436D0108161A156E0520FBEC278D830790DEFED618D8" "F520AC50C1BF2D48054743B7E4B56BFBEA0915ADF1F3EEDB1302BC31E3B1E3CC949E0A4E79" "73BD05FEFA5B8B5301D8F11E6AC0A83E5BBC075A0F00CF9CFB8C687B5D488ADF49CF0A2006" "FCBDDF769CB67BC7E3F3EF43144CA3CB14A67FC4336CAC4740C77C8D3C72D0EF8BEF5F08E3" "3BA9360615AA2409052190E0D00F65814389FE47A5C1EB5E769DFCE66FFCE6CFDD7EFB6D7F" "F3D2EBAE1B9B0BDBD15D77DE79D6E77C25D2540020BAF9965BCB0F94B43C73465621953F75" "260A002FBDEEA5715A6E6E229F7B4E9692663714F1381317BA8860853505B6B11624C9FE1F" "2E2C2CBC1E39E20CD4629891652C2DE66299167F07B0422B05E823475E4B8C0A314571B405" "8F3CA66125F5DE44EE5B4D5F3F007E7C90C6F78DDFF88DD1DC8F3C7A49FE7D66B44C5650B2" "C7B4BE7B6DF1760F5C3CE0F280553F30D9ABC6A6EB0C88010E71842CAFDF60F68825807913" "63C3CB0FDBE36B4DC917043C30F6C623189FBCBD86ED3F6F9BA4BD7BAE04319ABA4D31B442" "89BD173B86F63EBCEDD63D2254FE98B57CA59D003EEFB716395E2302EF220246C1537445CB" "3E45FAE3FDC4DFCE54F1534BC07A5AED727E7E61A88E67AC743630B0F53E7BEF3E0B156C55" "D1FBD0B6619940E53D98FEBB988AB725A7CF9C4109F3D4DFA4D927333EBE0E4BF9EABD0C80" "9E7A52C62DD6F84FB101F0FBC7FB4B79025AF16F7D5D5E7CF5D5F2898FDFF0E97FF7A33FFA" "4E08C6EB6605D029ED9CA60200D1DC1C0D075E0498E89797E5E0C1C7E4861B6E90A3C78ECA" "8B2E7E519CB3989C471E7F3C4EDC580A761535E137A2D9175AE01954A74BA5743D0223BF60" "FF05FF4C4B7E7A9A0933161B40D462349E0080FEDD7FFFFDB1CCE8B5D75E3BB6BA9F47DB31" "0B254F10E94D143F2F98A342806A3900FE37BFF9CD31871FDA8324537A6B553F314CD8DB67" "B7B5DAF1B6B5CEDFE9F5C0A0C0D8712FB83FFCD5D5FDC0EC1928A0F5B58A2931E3C7F98887" "C05FB5DC4C027E6F7CBC3E7BC72879028F38F382B575BBC640677CE6DEB99E30C94192F6DD" "B04249EF5492F40406CFCDE13D5FEBA6E16DFC9BBFB7C05F92E0A06B49602E40B8058FC05C" "50733908A00AAB51303E7DBD0FB5E0E118AC328940416D435D7BAA218BB1020899F75B0298" "1D53EFB9CFCECCC8D163C7A28032D24261A93CF6ECCC6C84F221E77F249AF0DF49F1F90F4D" "052DEF9FB0BFACF0971F479004FE21833FB60D817EBB6005E9DFF5AE1FFB2EF0D895E5E5F8" "6E4CE9E9D1540020AA5E0E30A854877A6575354EBC13C74FC8A9D593B2B2B62A5FB8EB0BF2" "C10FFE61F4470154BFEEEBDE28070F3D26575C79659CC8175D78A15CBABA26A7CF9C76AFB3" "B1B1715927DDB7698118A69656E181BBC7C4849893320D80BF17F12F8E16268621D8BED9BF" "C1983C2DF8EB423931E0E9E4C998DE06F3F8DBDEF6B6E8E3579326AFE6E75DD36AFA2D46EE" "D176C76CB76D27DFFBB4A80B841A3068A459AA4914F7AF1500D9626235660B667A0C84B847" "1E7924FA7FF13D32E1B4609007D6ADDFDE3E4BB63DAB197AA06181D782B5E72E68017567E2" "0CECF12C68D8763CC1488CA0E08DB31EE3CD314FC06E090CEC92D32A901AC3A16E9C90B23C" "42AA660973BAA6FCD97E6B1F5450D0678F45BB741D0B9C870FAED3A5F4424FF3F7AC2D4C93" "E6D1FCDCBC1C3F31B8E96650DA37FAFD51E80AC2C04866E76623F8A7334B09FEAEACD7AF16" "806EE844AE02A8457DCA75FB6825E88422FE8752E93110F8C77FE227BEFFF6DB6FFFFC9EDD" "7BE25A20537AFA3415007640CA30E6E6E765767E2E3220BC702B2B43BD76BC947801F042C2" "D4F5D9CFFEB5ECDBB34F5EFDD5AF1E5E8CCDA114AC120264D656777DEBAED5B59956EEBAC7" "C83CF0F73E7A8C9AECBEF8C52F46E603D323828BAC76200E7360B20C93FBD5027E36F54300" "00F043528720F5F55FFFF5B1780F3421357D7A40B49D49DB8ED34E7E7BC7D8ED93DA6C3148" "FD0DA68F3A05881BC1DA0ACAB0256983CC9CD9F46C01CF3E7F000640E09E7BEE8942D36C0A" "C412B20E79A0D972177863E09DEF6D6F0987BCCF03586F0E59C0F7FAC6C2835A08B84F9E15" "857F5B812B90702DE6B9DBF16A013E8FAD9DFF5AFB0196407C00CC6AFDD17B81A008308D51" "F46935CA49E3A4E30A1E838F5E43050D7C30CF2078E23DE758111E07DB9E15883C61117D43" "BADF97BEF444047B0074AC72194DEF41E617E687F14C5A7DE045FCF3B6726F31A21FE58047" "92FDFEF14FDF5775FEFB04FCD80EFE89A0E01B3EF189FFFA9F7EF557DF2D29EB664ACF8CA6" "02C033A058D8254AC28589E145C70BFFF891C763953D48BABB76EF92DDBB77E50561F072AE" "2CADBCA315FCE731246B76F49893185002F820DD0FCC02A6476536963932B598BB773D667C" "36B84F7D9E60749ACAF68637BC2106F7E17B0BF8BD7BB2F7E59DE37D6F6D9BF47BD23EEF58" "4F20C1BDA16601A737EAF2C30A5E5D8AD466FFEAA47EE33C084C3015430840CA180B13DEF3" "F7E6866D7B12F07AFDB0DA79CB0FEF99FBAD7B409CF9E6B906AC70DC35FCF3B60FDE3D3180" "8BF3DCECB8B58402DDC6CF57CDFCD0F611D8A7667A80B316FCC1BB00E0D7C23EEAF6F29E9F" "EDB72A1EBA2895BD978DF58DB88E00AE0D214005443B869E05C0B33A480A42558B03171A5A" "3FB31E1599E8F7D7733B494BFBD2FD8816FAED72509FD602809C305C77281454B47D5DEA37" "F62C9AFEF7EFDD2F8F3D7AF0E80FFFC8BFFD3FB01563FC4CFCFEEB4F1685EC7CA6A900F02C" "93C6AF424A5F5D5D93A34F3C298F1F3A2CBB56D7E4C5570D652A373637E6432F6FD2D50783" "63926C81BCC7DCBD0FC0022668BCB8A88FAF00240D6DBFC51878BF657EBD49E963E0079383" "D60F0DE88D6F7C63CCE3D77CF6ED80DFFBEDF56B27FB76BAFDD96C134C186E21045B22F052" "C1C11673115A808A058356BB3806E3092140DD281863EFB96D07FC4A0CCA769FF5B78BF35C" "3C61D15B27C0BB8E07F662E6A777AC6EB3D7E99CC247AD6765EFC59B779E6F5FEF05CF733D" "AD7CA715FA340304F35C97D3C6F301D8431086B95FD3FC14F85B7DB3BFF51CF5FBB32523A4" "F52EA0894B8A27C08258EC72B263DBBA0E8F45CCF57FEAA99885928F484BEF2283295B2D42" "01FF08F5EC16925E4632CAD5FEF3B542C882832E10A4F101BDC632A4943F9C73D5D557C94F" "FEC44FFEEC030FDC7F701129808E6B754A674F5301E09CD2601E3B7EF2B83CF8D08343204B" "D892DDBB76BF697565F5E2ADADDA7F38C90C270E736A6D87768097166BD25F1963124A5EB6" "BD9638DA81050E667C0CFE56E3D7C2256078887286A91FC2079823CE0133B13E64FDEBB939" "C4614ECFC6F7496DB5B6D9E33D80D1EFB87F30E06FFEE66F8E0B2D615CF0014365AD2CA428" "7F306A0F6CBDEBE319026810D489EF001BAF3E803D8F81D2BB5F3BFE6C766FB5E9CD21312E" "093173B8B5F08C34040EEFBB1ED35A51D17B265D632D84D6FBE6813F97EE05F801ECF181B6" "8D774E833D616903E0E383EFFA7E6820DF76560A1E07003E3E98271A34C8E3A02E07F409FD" "C0BB0601001F048C7A9ABD9DBFDE7CC6F520C41FF9D29198CFAFCAC3F09E9F195BA0A8D3A8" "7FADF6A7CF2B45F46B905F1035F927DB401F52911FFF39C0AAF1CA57BD52DEFBDEF7FEFABB" "DFF3EE9FC4BECDF58DB1673EA5A7475301E01C1326312264F1E223201099046BAB6BDFE795" "59B51A8907F85EC43DBF346AB283E91F3AFD389F00002000494441540C00CC434DFF7C1D71" "18AAF7028AC94068E5F2C3BF8FEBC2F70D6D1F1AB0066BE1FA1E2058E66BAF2B0D66DEFA7E" "B6E73D936D1E63E5B184000697C7F5D75F1FAD3070C1E0D9D89509430A08D348EEED08638E" "63C1EC21E0619CF15D53C7EC1CB1636ABF7B00CFF7C39ABB9D3B9E30C73E7A0ED6D3F96E23" "FC2DD976BDFD1D650AB4DE23FEBEDDFCB6F39CF7A9A6AFA00FE10B42173E1ACDDFA7B5FC61" "F951D0C7F3401F35D34301B335079934B21FE7EA5FD5FA394D580B67614E41F8D08A9338E6" "CCE933D945D47A3FBCDFF8603EA13AE1E1C38FC7C57ECABC1AD6DB989F9B1D73E9E428FE10" "4A6A9FE6F227DFBE6E2C417F34D626F21F32C4C69975B9E6DA6BE4E69B6FF9EC8FBDEB5DFF" "3B4E5765E299120BE2E7334D05802F03218065617341565756DFB9B8B0F8EF1151CBCCC6F3" "A90632B1EB761B0F20E645568DE1E69B6F8E417F6056C8B1E76222B203E0E7EB8786A95FFD" "9ED0F8C1F060EEFE9AAFF99AB8480F18108E5150B27DF5B42ED98641F1766F7FEBBBB7AFC5" "14BD73261DEB5D53FF6A59E077BCE31DF2C77FFCC7793537AD09A0A4C17C81D2025BC15B7A" "CF5A0D0ECF00019E2A0468C1212FB8CBBB77AFDF7C1C5FD36AE7B64DFB5DC837DF99C03D4F" "EBF7EED58E817D47C4B15C4CBA27FE6B330484E6BCD5F4F11EE17D02C062DC356B45635C60" "E6C747415F853A16BA99AC2019520C08CE5133BF24B3BF057EED27040EB5FCA06F5A6D12FD" "881681D0676191DF3776C978638DE57B714F070F1DC41A25A54E5FE8A3DF1F190048F38B26" "FB2EADD99F815F9F55D0C8BF580C8856FACDC715E00FA5CC2F09041B1B9B72E0C203709B9C" "F8E11FFE37FF0B72FDF7EEDBFFACADD7A26377BED35400388784E87F30897D7BF7BD69FFBE" "FDBF351A8DAE54A6E045672BC84FD2802C40F339604E083C040300206B99DF9629D7B667DB" "B6C0AF7FD13E801FDF919683A87444E8824969FD7BEBB36D01BE07AADEB6497FC5010C0F04" "265D63A7C77AA0EA9D8F718715E06BBFF66B2348231E035AA38DCE56E0D731D7CC0D6F6D06" "250554B40701EFEEBBEF966BAEB9260293B76850674AD77AF7E18D9B776FDB01BFB518D871" "B3E3E409A362DE096BBEF79E51EBB7771F763E2A986B9C0CC014D92AACE9C7F2B6C91A80F9" "AD457B00B82AD429887B64AFD9A520504DE3C3BBAB817B6A2552E0E7F7484DFE380EFDD4D5" "2255308410A8CF5A8312D95562C7839FD7507AFA68AC7B12AF3BEAD2023E43F5C299187FD0" "C956AF71059DC23655F9D3BCBF02EAF533E972511FB60004750B0489858556569665F79E3D" "F2FDDFF77DFFE8F6DB6FBF3F66229C38EE8CEC949E09F9B3754A4F9B201D6F6E6C4473FFFC" "C2FCFE8B572FFEAD8585857F80971DCC0326350DCEB18CD07B31C598E03D26D653B118E4FB" "23025D25DCED80CA3206067FAEDEA78C47172781A67FDD75D7451FFF3305FEB3E9E376FB26" "9D6FA9B5BD75CE76FDB7BF9599BFFDED6F970F7CE003D144ACEB1A8813F3C1E0AFCCDFAEDA" "C6F304ED43FBC33341B021840000109E931532BC7B9934769380D9DBE71D27665EB360EB69" "FE5E7FBCE3EC311EC0DBE7252696458355D54C0F2045F43CB47D003E7E2B01542168C1AAA3" "9ABEAE42A966FAD698F0F5F558CDDB57F057ED5DB305F45816AAD8FDA699461A84C7D608AD" "0FC1152827CDDB3E551844BA3282950F3F7E4466E766A2DF1F57479E7DE45B33A358F9AFD7" "143FDC6718CAFD8A8A02989F2190A6DF65014032E0F7B9D25F34FB4B528492D000F047BAF5" "E5975F21EF7AD7BBFEF59FFEE99FFEF9E2D2929B25F34C480338CF779A0A00CF32A130C6C2" "E2027CBEDFB77BD7EE5F0033D600B0C8D053400D0B001EC3606665C15FCF65AD116D60795F" "8DFED515FE3CA66AAF65819FC15F23FA75511B800C7CFCC87597F422B156DB02FE563FB6DB" "D6EAB73DA665DAE6FDDE39BCCDD3886D5BDE6F6F9F023AC60ED1FADFFAADDF2A1FFBD8C7E2" "6F808C1EC3265A0DF2F2404448006066082100DA2A82BE60FD417AA0AE24C70012C8122064" "6DF2FA2E8E00EA8D95B55479DABF67CDB2CF6BD2B3F3C83BB6354F743E73012C8DB950D3BE" "7ED44F8F31D5887D80BE7ED455C3D5F7EC35F5BA2CCC69A0A782BE9EAFD602F44D8B06D920" "3FB614E23C5809D405A1EFA76619688681F2035B51D33EDF906286F0F7D1471E89DAFFECEC" "5CF6E06FF52181FF8CCC8C6632F80F16FEC174DF49978BFD8858333F058386DAC4AF11FF71" "75BF748ECE9F03072E908F7EF4233FF3810F7CE057245568DD6E4E4CE9E9D15400781648F3" "F9512CE3D2C54B5F71CD8BAFF993A74E9DBA1C4C59A57D056DD5FEAD7FDF4AFB0CCACCCCB8" "BEBEFE85C68215FE34DF1FCC4B850C6900B0BD86057F5D871CFD05D8BFE4252F89DA2B729B" "D157301D5E92D73331DB6B8BC3A8BD6D3B057D260B66DBB5EBB531497BDDC9F1DEB16803F3" "00C1916F79CB5B6249699856D756D7E23847ED2BF98B756E789600067EBE5705628019840B" "0801B000A93BC0DEBFF75C3C616927F766DBF6B473252F98D0B352D876BC763DE1A805F892" "72D9A131E33D51ED5E23F7B56D5D7D4FD3F6B47CAFB6A1DABBBD27EE933E437E9EFA5B9F21" "B7C3A9B39222EF3D015A8505F419C702EC7591297E0F39321FBF792D0D2FE6418B543DF2F0" "2382946468DE92CE85268EBA252A50F4F93E69353FD5EF43DA9153F948EB4F8581FADE281C" "494010CD028062D3F7316BE98FFEF00F7FF5C77FE2277E78697951762FED927CE1293DEB34" "15009E2975834FECCCFABA5C7DD5D5DFF9E22BAFFECDC78F1C89200C8D595FC0ACE9917FCE" "032DA197A477D2EE8289C6C74B8C8562E06F86F6A775E235CAD5329416F0E7B5C9534013B4" "4A68FA68137E7E051F0D7452B2C02F0E689CCDBE9D1EEBFDB6C74E0224AF8D4980EF81249F" "E73D4B3E07E00C2100A9919FFEF4A7A3691563ACCF4117855186CB024066C2A674B0186D1B" "5A2CEA03DC7EFBED31262346739F3C59090E9E25C402AB8D19F102F0B82FADE7E33D07CFCA" "E29DC7FBBCE3791B979A46FB9A0E07B0C798E0BB9ACCF57C00A7023EE634833EBB5F729DFD" "8686CF60CFF5FD3BAA70C8424148163C067E6D9F7F6B5B1A1488E3D157F015751568D0A75A" "194ACC87E4545C2C1A3454CC0B790EA925E1C9A34FCAA38F3C1AE7E2DCFC5CE44D43006F2A" "5D8D3EE8F34AEBF8F7FA3D9AF7932B20A5FE65ED3F037F890D50908F66FF9815407501C290" "5D00EB62E8FBBFF8D0873FFCAF240624CEBB551EA7F4ECD15400781A3404616D6690C54B79" "C98B5EF423575D71E54F3DF4F0439109C795BB92F94C415619B96A27DE8237E2B800585860" "D0467B600A77DD7557D4FCD54FCFA9511EE0F36F9CA32644DC175C0800FE97BDEC65D954CD" "BE49EEA3FDEB316A71C0B3759E779CFDBEDDBED67176BB0571EFF8D6F99EA0E0091B1C8487" "BF1002103301A6FE577FF599384F9029C0CF93E78982494F8BED4C5AEA550B05A15DD41F40" "8C06808F8B05B1D66AEFB537F5F2957A937522E6B979C2C2A4316C090242D70A8E1B44FBA8" "9A7348163508DA184708C308DAD3F51200723A2E98C3D6ACAF1AB25E0B6DE11C4F28D5F167" "CD5E3F76295E7BDC88D6D9D7BEDBB160E1413F2AA820B6474DFC42A98F5C998FDB3B79F294" "ECDFBF2F6AD3871F7F3C46CEAB7549C704267F542BC50AA6B373254B288E498C0B98CDEBF8" "C776FB50E2FC00FE9A1E2042DABDE48D452090BC4EBFEE1F0AFFF4390600B9FEC864B9E596" "9B3FFD8BBFF84B6F7DF8914752C60CF8A3CF23A7F4ECD05400781AA40B7C6045ACA34F3E29" "DFF22DDFF2DD2FBEFAEA9FC22A5DD0C4552351BF9FFAEC94C16AA4B6170720DBACFCC7DFC1" "3490EF0F66870F1885462B7B1604DEA61A05FA0AD040243F1806160C52CB0518A6F5E17ACC" "DDDBE6EDDFEEAF77CCA476F9770B50BC6D6234E749C7B5F67B02C44EAE8D803DB852DEF296" "B7C6744D6407A8B6AA1600FEB04B809F452B4B00BFF13C3117D03E2C017121AB1327DC9C79" "DBD79D0A5E3C065E9609CF6B36FF7B0284777D7D3FB89CB26AAE182FCC51D5ECD5B4CF5515" "F18E411002D0034435168723ECAD599FB570B6C2B076CF42980A05D6C4CFC19B2C68B33B81" "AD03ECE6516145330DF0D1225E56D0887DC738A6B6D48201CDFFCA2BAF18AC1700D9940E08" "1E71EAE42979ECD06372F2F809995F588C6ABD16EAD57A0773310EA02B1A7C5DD63F6BED69" "C68DA7F7E9EF500B019A12A8E7F7299D1182EAADB7DE7AEBBFFC97DFFDCD7199F2786F7372" "665AF0E79CD35400781A04A672D14517CB4B5F7A1D9600BEEE9BBEE94DBFAAC53FC0789551" "A95957CBC02A03D6CA5D2DCDAA3779C9CC2CD9F48FA03FF8E961A207B393E457B4E7F4A950" "897EC004713E8008FE62003F02D52499F8A1A9324D0A16B37DF78EF1987BEB98D6F749A035" "E9BB778ED5CC3DDAC9F6D677254F33C65F3C3300D7377CC337C4623E88E04786800A720C36" "56CBB481802D2144DD0BB004C08DA36B41A840D1D2E0BD6DDEFDF2B69D3CA3CE2C0DACE771" "3C0C7FD4FCAD15F654BBC707EF9646CE4B5A3E1AC2AAFAC5F15B3F6CB9D2B16CF58FC7DAFE" "E58FF5F1F3FDD8F73434B23BF8FA786721A0B1A0A2560255226C9FB58D6851D8D89075F084" "C5A528C06335CA214B41624032EA90C0C48F3976F0E0A108C60B691972057AC40074291530" "041367126FA92B6E7805F1F87B88EACFEEA3B474AF1D132BF8C567DF6FC9CBAE7B99DC7EC7" "ED9FFBDEEFFBDE6F387DFAF4A6F64B26CCED293D7B3415009E06A944FFBAD7BE56D676ADFD" "086460BCBC60BA604C78D1C0A83478475300F1D2E26F5C3B7B5472B3C561A4AD8F9A8801F8" "F0FDE39A1AA5CF3E5C057D0D125A4D4B1A435382991F4203FE82B1E21868A656ABDD29004C" "FAEEDDDFA4F3B6DBD7DADE3ACEDB3F09B0CE76BB07987C9C2704E0F9E9AA8CF07B029CE1C6" "81F00820530B93FA7F5963F480C463945A1D0EF3005622000C043DF51DB386DABA27BBCD73" "73ECC44A60B560B57CA9EF5AA3E4352F5E0BEE606E6A7EBC8E9D822484284D7583D0AA606F" "4DFA36708FDD2656C8E2AA7B425AB6ADC6C7B10F2AE0EB7DF3312C6C3060AB4BCD7E38FEA0" "554F40EF6133D6E31F140BC439E0FD461AE3FCDC5C9C5B00F621E570480B45354A0D4A1E8D" "E6A2891E3C08C17E5B6461884BFAEA33CCBE7E11915001BB2425BFD3687E5B5B210B0221D7" "F34FAD0C91FF7D2F975E76A97CF2C64FDEF0CE77BEF3ED1B1B1BEB78EEEBCE2A86533A77D4" "9E65531AA32EBD7C0AE4F3F3F3ABCB4BCBFFF04CCA2905C34235BCCF7CE633119CF162621B" "6B0BEC6BE440BDD65F4F8A461B58116E14D7E33E9D73FE95B9A35DBCFC007C049E41238066" "003F2918AC5E1BE745667196A06FB77BC06701DFDBEF7D9FD4A6B77F12EDE41899006E3BBD" "9ED7D7EDEE5D0104A08FE781E591F13CC0A41F7DF4D1F817FB400072CD166073B11502AC55" "43850DCC43CC17B8A710DB81390900652160270193DEFE602C4D1C54CAA0A855EEC0E4751D" "7B05F9C585C5E887E692C8BAB68446E7AB46AF162C0E88E531E1A03D2B3479817BD6D4EFF9" "F5F53E39F8564898E0E722A42070AA9EF65B3FD64AC7A0EF595FB45D7561C4BA05072E90B5" "B55D83B5716E4E36305E4F9D8EF9FA1A84D77533713E812FA8FF3FDE8F0CE67744E147BEA4" "56A104F429CAA4E4F18BD4057FB44F14D52F747EE159C399BDE6FFF743D0207CFE1FFDB38F" "FEEA3B7FF09DFF0A73010AC9238F3C3276CF533AB734150076489AFEA24C686161E1D5CBCB" "CBFFA9EBBABDCA08B04F97BD05D84208803540CD99AAC9A849CF16A3F0048160FCF7385735" "456CC35F659C60AED0F2F6EFDF9F9724D5C54A543800C87050981800F0FA2306B4BC633CF0" "6B1DBBDD3EEFF7A43E78C79D2DB5C6C06BCFF6C3EB93174CE78D27E686821B9E21522EF181" "C63E986C0F46EB0C9E33A77B613EB5B4527B3D6CC7BC84D5E8539FFA54F4B94228C43CE0D5" "E2ACE582D35483C91AB1C7AA36AF560B7C14E8D5B5A1EF80BAC3846AEDE3A3816E6CBE67B0" "17025D3D9FF3E62DD85BADDE0A0136629F89EF5589DBF484031650585051B79CB6659F999D" "5B3C1755809094CEB807858A5657650DD6C6F985B82ADF564AD9036AA3525F48CA0A7CFF28" "3C86F350C657C81513AB1E4219A1ECA4BC9C6F57FA2242610021450B74695E8754D52F0907" "A11F77070D6D872204F4412EBEE862B9EDB6DB3EFCF18F7F3C46FB2366C5CBA299D2B9A7A9" "00B003EA52DE7B8C1C5E5BFFC6E5E5E55F5C5D5D7DBD466873A016981898DDEB5EF7BA68DE" "0503072387C6A51AB732D056352A0BFA42EB81E32FCC791AED0C1F3E72F3F112E972A49A2F" "AC1A9446F88B632EB6C0E781A7F7527BB41DE0B5DA150356938EF5F64DDAEE1D77B6018396" "5A8282D76EEB58EF183CDB98C609663F3717330650D2596B32E0A38BCDD895E66C7B0CEA2C" "6CA00D2C5004411173279A93C9846D81B6332971985B2A7C70ED7AFC55C057B3BE826C48CB" "D5EA4A790C92EAEFD6887C36E173609DBDBF16987B7F799B7D26DEBBA6C7B4C03E24BF3DEE" "817DF60AF4F63E3AA7AAE32452A101B4B8B020AB7BF7E680C7C518B8D745E08F963FADC84B" "6BF12B64433B5F8C950617A29B704EE672A05F1C139B62978AF5749DD0827D21AFDF3F1CD3" "27AD5F2D0256D34FF32DD4697E7057AC2C2FCBE5575C21BFF11BBFF12B37DE78E3BFBEEAEA" "AB278CC294BE1C3415007640605A175C70E0AAABAFBAFAB7F7ECDEF38DD1779618809246E5" "CFA475C0F1A2411040143618ADE6D78371E33C2DD4A28C82ABFBB1695135142D210A429BD0" "F0D53FAAD1E21EE08B93C7ED698A9E16C8D402E8A70BF8AD6D3B696392C0723602CD249A74" "8C375E1EF8EFF49A63CF87AAD1A9C68F804DB87334B603CF19F347AD3A0C425CC446AFAB26" "690D0E842000D33A848C403E73052A05F0EC0307D012B05BEB039BC8B55EBEBE23FCD17E71" "560C7F38E0CD82672B48CFAB9DC042108F2F5BD5EC3574A95E7B3C5B29D82AC19ABD6711D9" "4EF863A14BC725A6352E2C0CF1444B8B58402C0238003DAEC3119586948BAFF727A5063F5A" "1CA94089E5A667E76469697988114A0723C25EF757E7674D9EFAD8AB7B274B0405D8FB9CCD" "2F215903D20DC52A825A1408FDDEBD6777AC3770FDF5D7FFD00D37DCF0EFB17DD7AEB5B131" "99D29797A6024083A2A96C732B9A5F5FF18A577CFF252FBAE4E7510E1335FE599267AD412D" "01CA94B47087325898E835B7DE328DC290F4C52E79C7425A8B3216D53E780538A5ED40DA32" "467B3E9307B03BFDED819EB76DD2BEB3151ABCDF1EB5407CD2F9DEBD79E778FDD94E40F02C" "33AA3D73DEBBA43980B90490B02670EF598FCC7A020AF01A0CE8C51678FD51E0E6D2B59A52" "6A9787661F385FBBA30039AB95B3C66FC1DE02BD151CEC18B3666FEFDDFAF85928F00416D6" "EE5B6D7AEF8FF7BC8371A5806692FB6E79792982F5D212623E86A245D0F44F23FF3FD4BC61" "684B71BBCBDFB91B1DB92DC02B96979663E0DFD8FCE4F43CB347858A90858102ECC3BEDEB1" "0690A0B5B5155D92A05FFE955FFE1F1E3F7CF8BFC1DF0FE1736B6B6AF67FAE692A0010F14B" "8C89BB15B6E4DA175FFB63575C71E5FFB59EB47A665A96D9321361C6C0DA06477033E3AE4D" "F4E30174E2803C33BEB3B94766929EC63C09D4BC6B6D679E9FB4EF999AF4C501BE9D9E7336" "7D399BE36D7FBCFE79636ECFB1C7F1770528BB7F52901B5F4F0345D5A210C87DE3D5A1B051" "FCBC8FCDDD4242EAC8D4CCB7F3DF0BBE63B3BB37E69E39DE9BA762D2FEF8DE78453DD6E63D" "A0B76E012B506D47DAC6E6D66604CC214E62212EAE83EF310812311231D0733697E0CD659C" "2BD3BE24001EC5BFA3BCF01ECFCF7ACC906AB7BCBC12AD0843E651C871FD3D1D9DB5F7BC00" "B050619F41C317AF963F7DD76A7F7ACF18A703175E08F7C37D1FFAD087DFF6B77FFBB75F7C" "E31BDF98E7DB949E7B9A0A0044C78F1ECB3FA0B97FDDD7BDE1E75EF5CA57FE80A6C8B1E630" "A2EA5E1E380E4C2490D42E55FA13A71A596D46C90A082D20928629DA031E6EDBB740F8656D" "F93A1E604903C83C6A1DD73AAF25A46C07B23BA149E704E3329964319874FDD6336BEDF7B4" "6F7B3DEFFAFA9D3575EE9B2D0A65BF071373E2098A568BEF52EE386FE777C4CBA7F7821795" "7A53B39EC7D402AF4D87D47EF2FD33B073054E76B979C2190B29ADE7EA51A00246B8AD99D9" "2130726D6158B37F09E99D2908328E43378A200DD05F4F817963F363C8B6CF297994983746" "1D9F9404C5D5D5155958588C6BECCF4008D016533D9FB8ECAFB6D76F9976D9C76F82FB7459" "DF6401E8536D7FDC3BEE13F148D75F7FFDEF7EF6B39FFD27885DC0EF29F03FBF682A00101D" "4B0570E05FBDF8E28B5F7ECD577DD50F207846C15F4919AA6A386C9E15D274943C66CBD1D7" "424CC782BEC7245BC7F27EEFBBDD67A9332BBC79006BCDA616F83C50F7DAF318C14E808F01" "D93B7612ED94F9B4FAE98185B7DDFBDEEAB33786ADBE6C771EF7C36AAFADBE7BF34DD2DA15" "9E906A8557ABC9778E2BC17BAEF69DF0E6ECC8AC8ED8516642A0F534D82FCFBE796BA9B0F7" "3DA98FADB1B7FB39E5B14BB13A007AFDA09EFD7CCA7CE85204BE2A077D8F80BC62DAEF82CE" "71F5E99700BCFCFE51947EDD178C17DD5F484A475F169C8A4B0577B3556A1FDAAA04FE5084" "8B9002F96C405FD0C34209FAD3EFB83FD41741D0DFEFBFEF7DFFE2FA8F7DECD75EF29297CA" "AEDDBBC6FA3CA5E79EA60200D1D2F2B006382A675D75F5D5FF08A63AF8F13530C9027B4711" "CA5CF94B88E15B2B81D5623C93A6DDEF69BFE2306FDB266FDF0ECCCF86019E0D60B58EE3EB" "7A407F36C7EC945AC2C84EEE4BB639DF1BCF565B93F67BDB265D63D279EC5FF7C0CE82B507" "DCDE5CF2BE7B7E70CF92E45DDFBAD4F8BDD19C79D6E45BAE083EDF136CBC39EE91F76CF37B" "DC27C1AA93AA7091A638E2AF664248E20BEA72901C6B97FAD125ED5BFBDE4902FD2E5AF907" "1920BDABA32EB90242AEBC17E750959B4FF3215D0B8177DAB7E3C7869461B5F27B169EF21C" "A8C08F08017FC8297FBCC42F9ECBC2FC424C2FBDEBCE3B3FFF471FFCE0DF3F7CF8F03DBB77" "EF897C558309A7F4FCA2A90040F4B55FFB75F10726F3BEBDFBAE3B79F244D63A94C1052AC3" "69199935ADDADC5F254F2BF7008ECD8F1EF355B2C7717B1E3353EA9D1AEDAD733CB0F1841D" "8FBCF62C75C6F5C06DB780C4BBBEBD7FDEA7CFC8BBB7AE51B3DE02BED777719E8198E7EC5D" "C79ED312C4BCFBB6029FD5D0B703703E57B6112EF81EBC3EE87CB74284BD9610D804530698" "B5F74900DF1A7FBEE6D9F8E8BDFB0B49F3EE43B9F6CCCC6CD2A4E76461610078802A400F45" "8CD48C8EC06168F7674E9F196AE876A352412FFDD7A588BE10B57FDE89DF694E20C2BECB86" "8054B96F941B51FF7C97FECFC31CD46230380BB010D0FCFCB07682C621D871CCF7DD979C7E" "8DFCABD7F0D7F50186BAFE6A0540BBABAB6BD1B5F1A94F7DEADF7FF0831FFC216499208515" "0A54EB994DE9B9A7A90040B49526EAD6F0125CA81357999017C0A48CC7D6190F2688CA064A" "794C541C862986217BCC7BD2774B9E063BE9F856DF2669B1DEB9DEBDD8DFADB62CF0D8EF67" "4B676B55685DCBEB8BB6D53B8B28E96F3B4FC4990FDE585980E673BCB2B3766CED3D78CF9D" "B75953BFEEF7F2E985E6BC0579CE08B0A6F99606EFD124C1E26C29241FF6608A0F1981E183" "C7225F5A99508B1BC5DA06F373B18CF74CAAD81728EDB10C2005ED85524837C1743E664CC8" "EA0AE016453E4849F4A705783AA9840A6D26B7D90DD74EABF5A6C575867549868A7C34BE0A" "F222C5129185151688FACA2D20E9D942B080C9FFA9A79EDAFC8DDFFC8D77DC7BCFBDD7A3F2" "64166E1BCF724ACF0F9A0A0044274E1C8F7EACF8CAEDDD776D34BA91C6C6EB75B3C6258629" "7BDAC876160091715066A0F2B4330F78EC76EF3A3BDDEEB53DC6B81AE79C2D3D175AC2A47B" "F1049CD6B84E6AAF75BE77DDEDF6EFE4386B09F2FA68BFDB6DDABECE775B68C80AC6817CE1" "5600B0C0EE5D9FEF6B52DF9F0EE53E248D3EC4E8798D59406123D43898891AFC686624F373" "0B311A7F10E86763653DB51C0D15F43653F685D4A67CB3645EA7E67C3E4641BBEB7265D178" "662CAA97E64E28CDA6BDC90AA049FE22A39096E31DCB10E0C12C5F100F80223CD2158D5EAF" "D007A9403AB0F95F034285AE2F21662ACCCECC44E03F72E4C8E64D37DDF46BF73F70FFBFBB" "EFDEFB1EC7B6B892E889E3454A99D2F396A60200D1F11327065FD6C2C2BEB9B9B98BF465F1" "CCC0FADDAE70A6B49DFF55A9B58DAF6BFDABDEF1F6FB24CDD2D2A47DAD633DE63D091C7742" "3B31812B9DCDB13BA1B3E9BFA7F97BE4CD9D9D5A313CCB89ECE079EAFE16106F07CC9E26EE" "FDF584871679F7E9CDFB6742D5FDCA803DA36EC8B18F608E824629FB402B19A24C6E047F23" "C8C774B61877A085BE148A1378ABA55DCAB532CEABCB49CFC88174DDE00DC0B3EBA50AEC8B" "E7E52A7C5DD6CABB7221F5FEC776BC110F54ACAF0B525911B6422FCB2B2B8320B3D9674140" "A3F9B4BF1C4F90C781D2FEFA244841C3C7B6DB6EBBEDBF7EF4A31FFDAEC3870F1FD1E26453" "7A61D1540020DAB7674F04F4858585178D46A365EB2FE617D6D3B45AE6D696B6B61D592669" "AFE599435BDFBDFD3BD97EAEC80304AB759FAD06BE53B29695569BADED3B39C6D3AABDE35B" "E77B6D78648FF1C0DC036CEFBCA743DE1C3C1794FBDDF725F29C5C12436AE14CCCAFCF6B00" "24D0E785B8BA04DB2199B507015E81BCCBD5F22A541FE04F4612115C7AB2B28B2E855B39FA" "D5045F2A3B0EE3DC0FD72FA6003A85CCFC6A09487DEDA40403186C977CAA120B886AA98915" "0647D1BDB1155D9952D2F7A23FDF98FF93155423FB25C6366CCAE2E292ECDDB7571E7BECB1" "FB3FF5A94FFDD39B6FBEF9461CA7AB8A5AB7D7949EFF341500882EBFFCB2F8238470A956F5" "B3B4538DDA131E5AC16CD260F0DE36BEBED7070E2CF3FAEF91D78ED707EB0AB0DB5AE4DDC7" "B926FB8CCE651F9E0DCBC7D91CD7125A5AA0EEFD9DE4467836C9EB678B5858C97E7904C477" "29F68617F7C177007F04FA4193E7857D8A256408CAC3F2B9417DE295A65D8D60CEB6CFEE76" "1D1A44D4A7D2399D9AF68364604E6250F2E127DF7F28C576321E937FBEBE7A8DE66A3DB0D4" "65559F520259FD37E09FF945B4228E24603C642699F9B58A5FAC0B1C03FBB438809AFD2124" "61ACF75F70819C3C794AFEE44FFEE4671F7CF0C1FF136E105802B4E7C1B54B4CE9F94E5301" "80E892175D3E309AAEBBECE0C147E5E8B16371F18D49C5405ACCD303E8962FDD6BBF05602D" "CD52C99626DE09B5EEC1D3D2B73BE67CA4B31D839D1EEF8DB73DDF33DD7BFB269D772EA875" "ADDC4F3679CB10A83643458278BD0105FC19137CABD4A792B3B1B646C2C374C55A9157ADB7" "9B74DF35F8273C8CEE0405DEDC76B627940B7459532FE01C721840CA224A4240D94E7EFF54" "3C2CF7AEE3B6CB87DC830000200049444154CB817CCD4669006AB38F4294C4BA0009FE5319" "DFE20948E97DC92D10839E6746B26BF7EEB8EF8E3BEF7CDF273EFEF1EFBDFDB6DB0E62B553" "2C46F6D8638FA59448F7EA537A01D05400203AFAC413B122D79E7D7B2EBEE28A2BE33ADAC7" "8E1D97F5F5D395A9511ACC99B5796FBF77AC776E9B39159AA4BDB54CDBDE368FBC63BCEB48" "E3D87341ADEB3F9BF4744DE1CF17B3E74EAC49DEBEB3A302902A6CB62C0F628A086971216F" "719F62C6EFA2295FF3DE3320A500BEB08520B48D5C9F5E015F684B57AD631F2BDDD49A3759" "DA3D3BFA60A697725E5C594FCDFDA2D17759CBCFD1F695554568DF68F0CB8F527752B11FCD" "EB1F0E52E12264D7809AE18350CE7FF2F16B2AA1BA2068168C3DCD3E84644549D92942A0AF" "CF2A661E0E7114588B0026FDA79E3A2D77DD75D707EFB8E3F6771E3B7EFC1EAC6ABA6FFF7E" "999B9F77AD99537AE1D15400209A9B9D19EA6BF7FD016CBDE4924B65CF9E61419FADADCD18" "01AC35C43997DBA604CAB3A0E53131F3D67444A549D7F1DAF6B63D93F35ADB5F88F442BB97" "49CFDEB30C785AB93DD69EC3041F72CC458FC270270BB3F3F17799FB920168782770DCECE0" "7FC6EFE8874EDA3B45B0DB5805F89B0B4055D66D63362F2BDAF1BD686E7DA0D4BBA1A2DE60" "EA962C0C4B69981E7DF4D1F7EA4F2F2E833C269D06ED4936F7E71882ACF8AB2B80AC0400E2" "A135F30C486130FEFCD2C92E05F7E98098D80B7545E467504C1FB80EDC249D8C6473734BBA" "39CDE71FB200E026C1B3DAB56B775C61F481071F387EE79D77FDC19123477EE6E0C1839F7F" "F2C927E4F2CB2F9763478FC9934F3CB12305674A2F0C9A0A0044330B0BD1C736373F7F0D7C" "86602E28F681085A358BC52541D737647DE34CACDDBD7E663DE5D70E66C83ED5C2EEC35666" "3E36708F7F7381218F3C063E7D01CF0DB59EC173DA27110281B42D056F49353F5224773F5E" "66974DDA762E668DDBA4B646733BF9D4E1630780F39C9D9919FCCA59E8ADA0472BDC51FE38" "DE8DB04529ED49E34DE56E156CB3893E2F4053DF3C1BDFEB7119F6845C3237A4B45E3D96AD" "02A1E4E3DBD612C6AACC20D5FBA926FE529B3F645D3E79FC3B32FF4BD9241AC1DFA57B5333" "0159223AE1A0C150AC14A108345DAA10D87581D6EED71A00DCF1A1555403441D030801C86C" "C073D3F981BA06BBF7ED8D073EFCF0C3F7FDE55FDEF453870E1DFEF599D999CD03FB2F88F5" "FBCFAC9F292BFE4DE92B8AA60200D1E9A74EC79762717EFEC2680AD8A2853DF00F5ACFC242" "CCA9ED52282D72626334715AF10B95C0B8A2995A0B82A91BCEE5816D2114AE2008068A6533" "39BDAB15793DD24A61DDF8BE9D909A19B96089560EB31ADE4035736E5DF35C00AB1737210D" "C0A48EE4C86D491A2D1FE95502947C5FA1D9AC4799893BB9DA9E6B86AFDB99B4D1A0E09D4C" "CF71C1983033E48477B6046F97CDC316D48BF039007FCC7DEF06B3BB648174D8DF75C55CCE" "E36AB575688F6C4606B8C55F3DF9E1F5FFDE68DA3C0EB90A5D71DDF3C2F4C5DC5FB4FB120F" "97B6C571E9F3F1D1EA1E52709B94F4B8106ABFBD681339B84EF2EA7783072198F108791C55" "6849434F610765895EC901839ACAA7E984814E28881DC83DC075044497DBAFF659E1A58C71" "0C5644F071E863C5C285C5C558E61CAE182C3D8CEA7DB06EDEFBC57BAEFFF4673EF393F7DE" "77DF5F1C7AEC31B9EAC557CB85175D189726D6788D297D65D2540020DAB5BA3A98CB46A3FD" "C1968C4D363FB802542050A08DB9C5B3B3B2D02D3441501298F75BA9C4A856D78AD5C88496" "E3AC0BACA87021E402E8D2A222928090AB0C76265551B7556576FB30A4358D661257EA5D53" "AABA1B744116DE3E7E6F45430AC484252DA4545C235218A86A6C7A26315851E013E591A16A" "03CF6168C7A94AA7C24A280C75C4969704CC10D6BC604D4941695D6AD716809214553D0C5D" "D17B5300694E53EB52853E4D351BC67B78BEBC4C2DB4EBE8A71DD9BAEF52B5AD5AED70CF64" "6256418673C1CD3DB1B9395039D82A302FAF58599F53D79B67F96ADCB5903BD273BA1B698F" "DC149BF4B345C0EBF3403C47F3A8F77C96A6AF75491BC739458AC963247945DD727F18DA3E" "BDE7DD10E9CF73B39CABD68AAAB28F8411C51028F227C01F09E7F67709E08B899E05842840" "D12EBD8474F5276FCF5606BA7E25880CE308EB0DCCFBBBD676C9BE7D7B11DF74FA965B6EFD" "9DFBEEBBFF970E1F3E74EBC14387A262031FFFFCDC7CD6F89B8586A6F41541530180E8C453" "A7F0822EEC9A5BDDA58CB798DB49E2EF52E52E295AB906D788D12A233C25CD5C2D7433DD8C" "CC765DAE1FFE7C252FD0B0A56117164B7ECBC49C46A3BCB2C9D879A4738D6DEB3AAB759356" "B6D9A7EA692332C24AEE6F253C7492C1BCEAB389602E7EE190A5848E23C635C29B5D30A100" "936E1A04A4722EFBAE038D8DFE566D3547C7877A295E5E8845FDB62ADD60135C4F19AAA9F9" "50D4F0FADA8DEF1D83AC4A4954398E94D0AAFF55DC4B067BFA1EEAE7CBD7DCDE8A53D030E7" "D117DC2D1A75EA215B0E8AFC11EA39855F5BE94EBA520068A4D1F4FDA03907AD0A9AFDEBC5" "D5A1F7A711FB43605E97B19CD3F10205FDC58C0229C241D1F4B3EDA6CC47BA5A1757072AD5" "F8421234AAB94E8FA6365884E80278E2892FF5377CF2868F6F6D6CFEFABDF7DDFB07A74E3D" "750626FEC1CCBF1E5D05AC884CE92B9FA602001196CB9C9999D92BABAB7BD4F44DC65C8ADC" "4D184105353A16E2B95102BE6C4D533FE61607F48C334226FB92DB9DA5604861CAE32B8515" "E6AEBA7039A62B0C8703A43A66C665911146D8A040E9F4B14B0BA478FE4396093ABAC7F123" "256B65B5B540AD0D6158E35C9F97AA8663A677D2E0C6F60EA4A5A035884BF26D8664622E0B" "A30C16805E47260A240A8263561735CD92C65A34EC1A50B9C321EFA2AA730ACA41FDD8650E" "A8DE5A37630A53E9FF054FA4E8CCC9B49EE73FEBD7A6CD3268D551F5DC29FDCDC273A85B9B" "2C04149FBBE475F1E9BC347787B1EDEB3ECA80CC7836BD8E4BAFC2BB0272EDF609BAD25E7E" "3B34D2BE7E5E45D8279F7D1246D89C5F2C01EA6629703FCA7980B50B27F75FF98D3E60B53A" "9220CCDA7F57B5A07D282372F1452FFAD127BFF4E44FDDF49737C9CAEAAA5C7BCD35D1CC6F" "8F9BD2F94353018068B4B529B3B3339776DD68AED28494AD86905FC08EF8534D66A3774C36" "E1D57EC849E449F8FC7DDCCF4CDEC1AAB3AC31B1D66DFC88D47FD2C16AE69DF705DE34361A" "3E75056C698953CBC03354A7AA64EA8F07B68E3A3E57082886FAE7A5DE4A20BF6901BCDA56" "3A4AF6E471E04F6A6002FFCA2FA14850A43B057FD29AF3371383503DAC4A7B1F170C449760" "A57338C08F2D0BBD986D559B4518650D31D071AAE95BD37F2570E42130667B29E3A0401B97" "B4D527D0D7F3AC7C37AF4D2EA14B4288AE99AF5EFD2C6884829146B0E4762B81A51BE5F3F4" "F841A6ACC747442D292323E4F31C49E03FEAAAF3AA61CBF579433E9BDD5A4A8E37AAB22A16" "6BE4D0D228FFEE4B9962B658A44BC2D7FFDAAF79CDBE5FFC855F901B3E7983FCC55FFC85FC" "F5673F2B7BF7EE930307F6B3FF6D4AE7114D0500A230443EEF1FB0A07E1914884A8471DA51" "D276F391A6D55CF4A33E2C6490F6D45EDDD4901F32D0E52312B874BA4A8828D81077CBB5C4" "C75FF4F12DED3B126146387EBED7E7F16D2133CF71E327DD67E2F439829D02A88A765C40B6" "0A05C880C62BA4D5415E1D59658A10A35610D6361964CBCDE8786640EA54B029F3255A0654" "E326C41B3383933B4018B0E946F91C7B9ED873A9746C1503900E2CAE041AE7A82D9B7EE56B" "0C00DCD737523F55BE6606FBF2BF154A3ADE1BCCB2D45904A4BAF52416EA33EEF5D9E9BC08" "1C8037BE32A3182B09BF49F19B5A09D20454F3BB2BF0E7F9AB8338E251AE82F9B46F2EC86B" "3FAA17A9308D6A9CD2B586EA7E65195F9545ABF14B8723F0EFF12347AE464ADFFFF46DDF26" "6F7AD39BE4431FFEB0DCF0C91BE5D1471E96A74E9F8E3102533ABF682A00101D3EF4B8ECDD" "BB7715652F37FB2DD200C74D7DC99317A9F13EA7638B1992B77515588DC3A8CF5EE9702E19" "2EC5323158170AFB5184D345442AF0CF0D785773A412B377221966396674576ED775D96CAA" "5DC9A94F2A62A824A0428C743540DB342D5199288D4E4740C3C15B5AF025FB71D42C1C281D" "4D99B8F18DD2B845CB45DF9347578AC58125B93CAC7D8D9F5D2D18E41AF121544CDC7ED721" "CCD03E263488EAAFAAA656D690FA1C85DA71F7018B9B2A34E8593C7C655226EB44D6D80B68" "E567959E6765D4C8F75744DF9E6D37E958CEB5AF66687699F429A052DFB3BAECF158C1AEA0" "9ABF06FFA5B991DFB1224476524A082BE0D6D3550572066FE614D996163908BF659DB917CE" "BAC92392AF53FA114C0D8112A8583A86A0D3BEEFF7DE7BFF0372FF830FC9CACA8AFCBDB7BE" "45BEE6B5AF95BFBCE926F9BDDFFB3D79F0810765796971C725C4A7F4C2A7A9004074D1C517" "2255665FBFD5334C0F0784925A953664693F5266F4C1B7E355E27D0D76CC243B020F210D82" "B8D17044950A684CD3F9CC6265088C14A28CCBDA02086C798FA3F9149D7D5C48604DA4B8CB" "E9F850520A839A3DD5BD4255D5F2B60CF8D4BE19783DBC307A4EE7CBEA7A194A65AC1CAC35" "76874280584CBEA133DABC6ABD6AD5A1A03DF53F5307EB6961DA101BBC57C50C24301AD3FC" "4375EF638240C66715282A845725B636CFE7DD654B4ED43302429EAF5A9F409FBDF1C9EB0D" "56961437BD32240B4DBE0B9A3BC632C1F21CB9BC7AAD2910327CE720CF184C98DE9FA14A1E" "0BC25D65D163F792A4F74883F8F231A9035DE025BF439EDF62D4071DF060F84415505963BA" "CAA7564AA07789DFD3F17713D91D737373CBFBF7EECD5939479F7852961617E53BBEE33BE4" "D5AF7EB57CE4231F91F7BFFFFDD23DFCB0ECDEB3A7996A3BA5AF1C9A0A0044A85A363FB770" "20BE8429864CFD74AE8F9D737494A7198D20A6A0118312350F7724B9136833BBABF615642C" "5A41285C41B566052B36A957BE5CD248ADA0A12031468E7F701C2AB8BF65AC589BCF10CA43" "598218F2E08D07141AAD552483609D671FF29D94A1320BA374F46C2A70AB2D279AAA55B2B5" "29929C0244BB8ED75F1842E974B88A00620506FAAB2E021377513DDFCAFD40CBB766C0CF8D" "65E02C0172746C575F3BBB25F2DFA2796661C4717B0C9B52581D0B8B24C48CCD13FD936BDD" "77D571E3025851B32BED9F6C315DEA4601CB40A7F64386C8888E216130F663A4B13CE36E3D" "95CEB3454833764269AB88844273B19E892A44EA3C528B55555780C0BEA3730B75C63790BA" "576511D1BD9112A2D7413D92F9F9F9DD575C71F99886BFB5B921DFFC4DDF246F79CB5BE4AD" "6F7DABFCE9473E2277DD79A7AC9F3E1D1701F2D264A7F4954153018008657E171717F7D57E" "6493C39BAB713144F177638ECB2AAEEEB6A0CFA70577179F9BAF64A28DC634B7B19803C508" "8302F9F850AB1D56750B86435922ED63DC6230AEE9E05E4662C6A63AA330B10ACCF301A302" "ACE9F83A30B208341D5D277FCFE6842E6BC54185290D6ECB434C4218016F2705583350684C" "40C65B062FF6F1A77DA5A6AC226E0573ECEBAF45C31AFCEB3C7F1559A4EA6F08B58057051B" "96C6EA780716308C5C9AAD23EC62C9809A045C4AC6C8DB4D7B6342422D419854437E1E8CD5" "1D05897659FBEF4201797D15BB3181D658ED48880FA330C603CA59433B23955A55EBEFCABC" "C9D62C1ADF1CC867DD564E244C9EDBEAA0D1E585BB7A5C4A2B9D99534558188DBA7DA74E9E" "5C08219CB1A07EEFBDF744CBC09BBFE54DF286377C9DDC78E38DF2377FF33772E79D77C9A1" "C38764766E368FF394BE72682A0010EDDEB31B52F245B1F25EDC9C63CAC91457236BFDFAA5" "176FC4FCA5BC84B5E64B0C430C3F324D56E71223CA00C31A06A71D169DB50208EE56DE178A" "89BCD917EDB7EAC9150FEBEAB6C78480BA2D15A554B3662B46E6D465B0C6D4AB6826EFBACC" "ACB5D67AA9954E1A7D2548046A8E2D37B9950C68E5068B9FB84BEC386860622873226B5EB9" "946C1D741952AC40EA5C85A92C1C44ED350C059A746B96571C0B40D9AFCFBDCE0E28739735" "F502F6F9C9A9993B0B30EDE0C22E9BCA93F014CA1B931F935A135898D0BFB92AA00DAEEBAA" "6307B96F94059B316B5C76C7904582626EB280C6C29BBEA3C53950C6A12BD680E8A74FCFB6" "CF11F7A563D9CD242A68D22241A2F5294A9D81D887D1E0121A9150995310B9B69F5EA37A67" "CC0BA5F72429F87744AEB52C69A57E0C42C7DE43070FEF3D73E6CC63080AF4E8A1071F96D9" "B93979C9B52F916BBFEA5AF9C2DD77CB830F3E2077DDF579B9F596CFC9E9A74EC5BE6A21AB" "29BDB0C99F05E729CD0EAB91EDAEA467654666F52EE3922777804D0B20C021100B2922BFEB" "1804581B2B5B02F910EBC0A012499FB5138EA322F65DEB3C7E519E1AF8C7557D125786DF2C" "2C5813E518F8172EDFD1482AD32E8691A27E1174558242BD872EC75E121A421687721F02B5" "49821657AF138A040F9AE35D69A7B5469FE331AA3E29409A61262D9860BC6CE39800A31907" "CD2EC80FA1F4CB660D642B85022D81ADFE2E51FF4239003AF3C6A641D9A7B24C5EA9AEABFB" "600B07E5580B923AF20426E98EC68FFBAECFA27201D433606821C5328CBA02E4B551210CFE" "FACE1475224B85AE10D07721C9946672E5294215BEF29C4875FAF3FBDB8D090FB555431FCC" "689CF564F9539FE7288FC7488B1A493DE907F9B9E44BE0DFD690093177D18B2EDEBBB9B9F9" "D876817E21550F7CDDEB5F276F7EF3B7C897BEF42579CD6B5F237FF8810FC8238F3C12B30A" "C25035D586C74EE90544530180E8E8978E6229E0C5B9E5F952D94F2981835FBCCFDDC82A8C" "01CE9077DBC3EB2603018B3DB88057A06D21E35961A885B706423BF7AA355336DBAB6E4CD2" "F2C7DAA02C0A351D733D056352C9710CEA4DE00B93E9BE5CAE68725D66AE46EB4BE758C1AD" "CECBA728F0AC95710F8B9E5E4EF307C166257422554DFA9E04BC8E73F749E8E381CE404C80" "DFE5C24506D1498AAC8203ED333219047CC59E5C2BFA504A5A2901125B9CB8767F968AE8C2" "BDB9AFACA59AE7548D2103DC50D79E6FA14C059E431DBD0BC5A553AC6675719D404FB60EFA" "650066035420281EB68C92065EB958F2F88808B90C4B4FBB9C0DC0F34C3376AA61A2DFD1F8" "45425367DE85E1F6BA2C04E4972A88ECDAB5B6E04CD78974E2D40959DBB34BBEEB3BBF4BFE" "F1B77FBB7CFA339F96EBAFFF84DCF0898FCBF1E327E21A03171E38D02CAB3DA5E72F4D0500" "A699C83B7629A3E50033D64F264DF1BA263D9DA366E2B4BD0A2150F3B9A369F1C5323B0C0C" "6E642ACCBED74A7E2054ADD38E449C4B56D1F313FAE1C91263F75D403F0F4BB284B0D97788" "9E2FBE4D6DD7285C89B98DA72ED6DDA83936334E0FB0876B765445AE00808E652584E5C5EB" "684C7341A26225B059092C38F415305A4D9F05C5F2BB4B568440C03844B34B0E0C947C85A2" "D1ABA669DD05E5F905D22E152742797A5C37226624F439382EFEA24A88054AED18D07D90D4" "1AFAFADAFC0485DE2540ED20A050E9E62CA84929D99C4E1E2A6F536D0CCA2829425E573D6B" "1634BBFCE0855C0E21A7FE728129498B270DEE02239892CF3F1B0AAAF38C252BF52F54426D" "A06A843A1925AF2C680366D90A985D5E29E170343B92271E7B72F9E4C993D272014CA2FBFB" "FB656969495EFB9AD7C9B52FBE56BEF6B5AF978F7EF42372E4C811595F3F230F3DFC505C60" "086B0A8CA2DB6612A79CD2F381A60200110A618C666676674DA632D9D71A40D614CC1CF705" "84F2128B48652A2EA53E1BC440290A46956E362EAC04D6B444AC5692C993065483769204F9" "B4AA31F28FE76602317B5537AB31281A78ED12E0DC7E65CE5DCD3CF31F0D78AAF5731D7165" "9AB6FA5EC99E900C70958615EA6713AAB67338963AFA0BB8911EC9635774DE6260EFA88FDA" "7731428348F0B5F7EAC1B1F93D5913F2C1B50FBEDC29053E524A64D1AEB9EFF4EC74B8D3FC" "CA961AD120D251D5674A8EA87DF255D0A28CCDB5FAFD498BEC562EB66A77168AB2EF3E94BB" "E0D8D62A63C0BCA455853D9EBBF46E9511AFDBAFDF677B071E9FA8AFE56917759C43B158C0" "75310C3B2F15DC25A1ACB69A702C421F5D9C233975F2D4EE2F1D3E220B8B0BF274E8F8D163" "F2D8238FCADCDCBCBCFC652F9757BCE215B184FA93479F949B6EBA49BE78CF17E5B6CF7D0E" "8B0DC5EDE8C2FAFA866C2C6CBA8B889D6BE2C5BC7851B3290D34150088E6E6E6465DD7EDE2" "5C72250EDE676D703890DEDCE2AC240D988BFEA480A98EE1B2BCB2632AB51540B816BFCA28" "4529A8FB95FBEEE5B98F1F97258CCCE969FBD8C9F579CCB032EEE7012B1B5850908E0E1B63" "7CA5E00FB7CCA6E70C5EDC6F128D34827E100202ADF0566AB6873CA45D9653D4D45DDD7ECE" "2C488C5E17CA513FACA9B79F5530AE806002EB243F7319AFD3503DA7501D53187D0163BE2C" "0B71397E0157EECB9807D27AAB71928298269AA1BE2D1E9BB443D7FED76D16646B6B48B1BE" "D43C99DFA5027EDCD74ADC630B08C7E95007F298E77922B99D6E34AA7E0BAF24D905D601CA" "BB9BDA1C568CECA8AE00BD80A1CB2E074B5928EB747EDB70CBAE7E394820ADE78906A39662" "6545D8969231905AC49A1C175F72F1EE3DFBF6C9CCCCE418809D50B47A7423595C5E924B2E" "BB54DEF8C637CAD1A347E5B39FFD5BB9E38EDBA2450099041887A74E9D92E3C78FC9A14387" "22203FFCF0C372E96597C5ABE09CF5F5F5988575AE686E7EFE9CB5FD42A6A90040F4E49347" "771D3870C19E12956BB45D8EEEEF2ACEE08024E90CC6794E7A3229B19E25803510D5F4BB2A" "45AED37C7E0517ED572010F7C09FAD89D526D24CE8DE0B5B722C0363F7CEA752F05D066C4F" "60AA8733E8D8D0F0D36DE7EF55CA995093AC388D9540AE0309432A8293A3B8B3BB2664062F" "062424A88E459A6B71B5D278A5858A48FBD6712963174A5C405AF4884BE8B09CD967106520" "ADEB477419105514221FBE5840A5FB2A0D8F3DD09229426256A7FD29F7D2D16D310EF7C3BA" "BD298556BB41FE7102B53C73748EEA787B9247CE78EB6A4DBCB28D97096ADD5B5E66410679" "9662026BDD239251B840589FE2FEBBCC1F428AF92F734D474F6B820C86933C5E5525CC7C24" "3D88DACA50BB28CD4B683296A0812F2C2CEC5D5C5C94679D82C8B1E3C7A265E16D6F7F8BBC" "FD1D6F8D573878F060B40EE0DAB7DD769BF47D90BBBFF0053978F090ACADAD22ED5A2EBBF4" "32595E598EC7F626B5F199109EEDB163C7E4DBFFF1B7CBBDF7DC2B37DD78A3CC2F3C3DCBC7" "572A4D0500A2F9B9D95511592AFCAC120128A7D9A6AA7128BF950A0AE597BB46BAC46F8BEE" "14AA173A949EA8445FAD71CE95C0EA403BBAC4B815800D0941EFD643710E44F48F299AE578" "0A5F67D74150ED5AB7652DBCA04B559885FDA8D97AA2775ECCAF1A8D1D485B56B06170640D" "B302BE3CACB5C0C2A161A1A3A0BAAE16BEA881F2E473D95BB285EBEA731953A877C95E3D86" "89D4736F4309E0AB01508504F6CE5771011AB7C02E01C70E55652104D2904DD0E1D02625FE" "A73F7D5F9E617E0279E2D555F80A1981984AF5EAFB52B9F6B587242D95EB15ADDFF6AD6C97" "6A9C3A675E56D38752ED4752E24238307018AB51313CA8B5224D9EBC900FBD33752500D5F0" "5500229FFF1846DAF1ABB7E11E171616E4B1438FED3A74F830D29D6D03CF2E21CC6166144B" "0E2F2C2F464BC15BDFFEB67889377EC31BA3391E99056F7BC7DBB1005BF5EE3E5B14D232C8" "175D7840FEE93FF9CE737BBF2F509A0A00442BAB2BF35DD78DB29F94B36B8C299ADFB52AA0" "8F999AF21A1364E404B257546D3666C4A2D450A01B8164E5B324F3AF64C80C55639DD66A09" "3D312156C8789BB2B6C2306944C6C6857694810AACD91770E521ABD65D5780A7EDFA3C3200" "76A5F962C7E832D0D5C259A850A3D40FE0FA29543B5E23ED6DE1365DE12EA159083C2E8A8F" "AC754A598BBED29A09C548F31E5B35B03ABCF464985764E931C83D36C5F218A936D9E53AF8" "6ABEC84F256BF803A8772633622C6ABFB7A92204D42C3CAAE09444147D6205235974298BF9" "94795F0A1055AE9B2AEEA4B4D0057A6EFA8C2A59A0EE9BD608D001D77D05B043CAB9CF6255" "6C6A80FAF2BE74941D58BD061DCF527E3461EC9DCA72964E5F15A0C7F588F167CDD7D4671A" "64CFE6C6464CDF3BD704D7FB93EBEBF92A870F1DAA6A08CCCDCECAD5575D155D02101C47A3" "67BFB600E2BAE076809B614AE334150088FABE1FC462B62167CA2832FC9FC57066F2D66FCE" "7EBE5001A7F2FAAE6366BF9D041C8A793AF3BE7241D664A4624532C6AC99B964C65AC17CBE" "2481A0BDF7D496C7798A2A465654BB121AF52D5B378A265F0902A53B651C8ABE9B40B05482" "532DBDC40CE8109754C17233A5EDEA8A2CFC70D439D52E08A475B23FDD3CB68250F50429C7" "06A3F53724000E12ACF45B05D586393D9F5BC500943A12D523533022F4A1A96C024C33BA8C" "919AFD475AC847B87B815F9FFC28B23D24D0D3D538017A56A31C244AD72714AC023DCB1DD1" "8824137C67E63B69F7237D3975CCFA54807254C62B670C8CD2BA0246082ED616BDAA1695A2" "DF74EDCC7AECF856DF5303A324DC74A5DD314983BE6F6E6DC9D2E2D2F281FD079E5616C0B9" "A03E165DC3BF99B1F5B69E0D029FF872083B2F549A0A0044DD686669F8456F5CE5032C227D" "D1BFD26E02BC7C3A33026DAED2AE49036C50FD4E2B6870F7AC79B21B637E5E5A1F29CB7AD0" "D0765F40B4B06A13F8E820FEB80652AAE509B1DF3A586B7CC872467F2EF51BAAB614927340" "DC98862FF91CE5E4E5BAA1DE4D39E2D5F324212154A33F7C07B0E57E6449ACD8844B6C8206" "AA71C11FC7B5C18263357A9C9DC0A99CC318F65296AD1E73F954DA7669A3D340BD1CC74093" "C95C8ABB54C09A04179E2676427154BE5049DC8E2C13A1AA14CC3D2816191709A56450D4AA" "7C7D4F695711FCF8BD166A7CEC0D8B424B25AA91F0530A7A75D5D870A97021F0E7F9D3497D" "C3D55A16D6B293DFBB2C91D092D634A71C21CCB310442DBB1BCDCDCECE9D3795FC6667E622" "2FF15C97539A0A0015F55B5B2B1D7C636C321C7B9312131ED5CCA89516A854A52875212B33" "63DAA2D47C74AC397609180571E00D0AB47A3C591EBA72DCC0116A861D8F19156018BBB6F0" "A0C818E31C3F6E9CF9B12B256B950E03CE5B68B960031125609104148D0C1F70465B2B7DE9" "1200D5B0A95A59285A28971CE8A9E852155C671E97A78057298A8C9604523C5E6C69089441" "50DF7865B9D17BE8280A3F1F38164C50CF9FAC5DE73E9515146D16407115D8F3551808E6B6" "0C3893F0AA41AF3C171C29289DA682DBB8C69CB3083818B47A15531F48F850318AD7F3E8A8" "232C30AB4BC1D603E1EF212F16C4081C067381612255643E5B9F4211EC924121833EBB2834" "8E437251A37116552C0D26C0B61719CDCE2CCC2FCE8F2D08F4954AF34BF332333BA5463B4D" "00002000494441549305E529D5341500884E9E38B97B79652557011C2FD6C3ECB388DDFC22" "B316E969CACA5018E42CEF6F09ABB54651E927F99A217B5385104C12F32D418263FD222B45" "15FC504E2FB714EC7D5981605C4010B60288BA6FC759570CB00EC4BC8C8A1302314EF5A967" "8D5A39BF8DC1A801A8E375EA3B5A5950B122D4C3107855BF2EAF359B050FD6F6AB804302B5" "0AC669FC4B5A571169FA7CB7465CE8245F3B775014FCC65D37F919E8F85436F37AFC82AE80" "3D22537C1D50605C57E4EE308F9D8B12E5391E34432554724995C150D4DEEADEB280C7E396" "DB1D9F6FECA22A8FBEB4D3552DD4F3825D61E53707A636DEE920958549D30BF5BDC98B09A6" "4936EAEA472134D5F5152BC36584C040CFCED1F48BB062DEBFB8F4F168657565EDBCA9D8B7" "BABC2273B373D2F75B63FBA63415002A9A9F9D5D2EEA55577BE8B2BAAA2A34713DAAF2C7F9" "E59233076BBD4C829857B3330CA950059A6486F7C04748C7348D540CB15C964CE4BC8773A1" "B326C9CA7F2839919EB0205AB92CEB94B54094D31989B9AA601452CBE43715CD3050FB40AE" "1A580AE78AFAA64357003F670494EFC5B2100A2E12EA17057CCC085F9833B5532916E959F4" "63235D0B6BB546375E34C88A51F94CE323AD9F73FDE4EB7E073AA48CB942442D6B85F1F003" "1DC4AC41D33A16EEC1E572751B65A961B6C1D4F115B560935D5354EE390B275972AE85F03C" "6F34ED74C462553D2C6372AE0A98EAC6D17767ECB83451F3F5394E42DF751DE3513144701F" "BB2E0B061C255004645EA593C324A5C4D398DBB222771103822CAFAECAFDF7DFB7FCC94FDE" "10D3EFCE07216034EA64756D4DD6D6768DED9BD25400A868667E7EB94E3D3207F88A6D6572" "2C3EEC724AF6418F9D1B88A1711BDC74C7884F6DD4296F92796561317501146D2914F8E680" "2CC6F6B13EDAEDD44B6F8CBA7A4CF88B323E3E4DFBAD7D35FADC58A05D61A6A5A470C6FC8E" "16BDD1BB36A096B5D60A978DC5A10BD5F5735B79719FAE04C5698D815C9CA8BE0F15586AC7" "430DF359E94D9A684F92050B39553D0332A3B36C50DA678DDF9835E2CA8466BF79E4F6C116" "B712D51730C28D7B4EA74571B88D7A0A053BC5EC4424B7949ACA799285A0DBBB5A9D26A9AE" "332D97FE537C80FE095D5E186A883F1995EB74651E9A57B2B4AF426E722DE97CD5199545BF" "149B90FB54DF3205BBD276C834D95C95B6A5FBD5388BF86C51A848FB1C3AD9DCDC402AE0DA" "25975C12D3E3CE070100B10E175E78E174F5C2064D0500A2D9F9D9E5C069CC564570026D2D" "59B37679B11902EA22374C2EEF656D9FB4E881E9100872DA970DB1A6AB8FB40FA455641160" "4CFD34AACB1871FE9E986BAAC9B8CB5DF29AA94AFD8A917714E8593BACC6A0CB96837C7D2A" "485347489788F97CFFD932D2512D01B342A1F023A5004102767EBA2245892D8B0B96BCF5EA" "DEB35721E49CEF5EB32272CE7891CEF81A9CB6C8BEEB8ECE0922D575AB6122E064DB916B95" "50C053FD7D2C6E711CFCF3588954E31905502A98C4439CB32BF44151F060AE58382AA97F46" "46601B416AD4AAEE3AAFC8CF5F816911CA3320EB73EE876B079D7BEC5FD767A91719B1BB80" "D22FC687A812C2B22B221FE28DABA42584D2697DB9A7DC0F8D11E8CB7B846A7B2BCB2B8B2F" "7FD9ABCE1B17C0D2D2725C1B629DD211A754682A0010CD8C468B25BA586A17C08417A69213" "482395FC7ED719E2E359BCDB91329AC241357FDB5A1B6C0474C1F59AC9D75AA41856CCE4F7" "D3DE418E8EE6F8803A58DA70FB2CB554017C9D61C43AC039952A6FAA03F34AD05346AC7C6E" "59E29785A25227BFB0F1909E8FBD5306E0FA1E829A99497ECA233D8E6EE9AB1A7CFB2CA7D5" "350CB8BBA14A2DE400B5FCBC6D7609F5BCD41DE00742F755654E9467691B2BAEA67A98ADFE" "1E28C8CE8EE19875642C46918F1B4FA7D3FBAF5FAEA2F9D7E342604CDF8ADB4BCF55E11290" "AA8B0E69FD0875BD95F89B2CDF73DF726361A8069078471566D7555D49E77595409FDD1DE5" "AB79FDCA4CCDFC461596EC8EA89F2B7715568C7E6B63F1D4C913E74D1060E8B7646E7EAE0A" "DA9E52A1A900C014C292973267448131F264830AC394714829055A95959D44CC044C15B08E" "4CCF420C3A8388FA0E59A312CD16E85C46BFA3611ABB3F2986CDB1DB2106CCEB008846DE53" "60A2A65171CA966ECF88412D925050F9B4F3954BC5BB4A3ECBD9185C1380AC0319D30AAA77" "C4A38BA657E204B20BBA124042F691C7F3FA320E35E04A65430849ABAB65B4AE0A082BC35C" "CECB2A7F96463A5321B1142ECA58116AF0ECA4F22255639D3B5BDDA841639A85C2A0DD9592" "CA63C251463CAEDC58F6B1364F8752FF8CB041732A5B38BAAE58BE3AA9DE090DEE2BD93269" "6EE68ABFA4A16753FED8442F634BA3938B03B13C4BAF8D3E9F9245E4B46B5673F4A509A94B" "11D3630AD5B56411AB020EB519BEF209D5084723121AA754D15400203A7DFACCCAEEDD0BB1" "60C640E5550DDB080192CF60AB818CF9162BE26D1D31ACAEE612CC623B161E949315F64FFD" "D0DED4CCB6C4235815AF2888818E1E3BAEE0FD84F3983D3154756307B020E1065CE9FD730A" "5A568154F32F8BA2D8108E5CFEB50B79DC028F43BE993A7FBB807E9757D8E30C10E2F5A4D6" "EAB8F24A79216BCDF96130B0FFFFECBD69932449921DA6EA995559353D077BB800C8DD95A5" "5028F800E1FFFF29C4072C787C8108B0D74CCFF4559519AE940837D5F79E9A4535A6201421" "32DD76A72B32C2DD6E537D7A1ADB0A98EFE101AAA7830600A2AA97161CD0A03384010C2AFA" "814D0EBA90CC00757D39969E768C281C187C651DECEFE27AC56FDB271D53415B3454EA146D" "309D92112DC17E3109A2CC39A5B44AE0026C6384F255DDDB70686D5AAB5E171DDCCA5249F3" "06DD00EF6906B0D820791CA058CB305DDCA9D0672E16ED5DBFBBECFBD516FEE12D45015C33" "011A3B9A9E45CA0900A8BC7FFFFEF1B28390CA11E966BC7B07C899625931032F0201E62025" "5AB542B3290AB8221432194853EB364E5C64316926494EFCCC24E02DFEFAE59F3ADB672951" "C59F75F6B298E645B21BBAAE4B583A5BE5B3CAA0793270FE35349273DBC3D1CECA851271F2" "33B1ED367F1F5101C2A6BBA0CC4C521C369B2C4DE689BE26C5D4C853BD67014CD6C8EFFA08" "F7F3AE477083BFC1024C26B87111A418F0D08214B14D67584A74346D79ED9F686ADA96399A" "94C1DDCFA00915CDD10FB2B3C0D17271A6532355D382F3EA5B8E2D43F88E2F05DCC895D81A" "F24A535D5FDCC025A20515ACA716C2167B9E7134BBC418452DB499A6179F9EDE3F3E9AFB8B" "BD81F2FEFDE3BC3FCE52E504005422E24149204BAFD63EE3773E84B87236A5DBF9DE809468" "5521DE42F11A37281926D5DEE3429DA4D90930344D2C87D225C51BE16E4E36CD6C7F4A1A83" "AE281822C99993A9B4F9BA5D0F9BFD2FC9DDE859F1AF9F8BDCF14EB3359815AEAF2547B11C" "2E53DC680CAFE4E28DE2DD9D7E21624C1EDC6C463126F67B4042273B3187B871A866480332" "63D314B0485D110777A4196612D566A6BB1D2688BA246980AB9CBF7BA9A26BF159B4F745F7" "8921CB9D174BF0B42EAC61E917F9145834A88D0E1C844808E98E1F66943C6B39319E1349EF" "1558BD7DD88D66A8BE079EE0734B19FA642260F6C8A9AB85A1FDE1847FCB87C5B09745C311" "EA28EB9C0383D7DB83EE283069EBF1E1C13E3D3FBFFF3FFEFDBF7FF7E9D3A797FFBFA403FE" "FFB25C2F3D3A6E3F5C9F99B75E4E0040C5DD1FBBC3549DDD86C2B73B926B1D682000480206" "69D51B30E8DEBEEE3E7DD70FF5F122D4B6E5ECD664CA64B5F50DDB48BB94B628ECB478D0D5" "2EE7F0386C6E67FA15E399C39E9A9D35E7ABF9041879C843D21A734D14376DFDC6F6EFE207" "B085BB49761AC9D19FF3DC994CD0F7853E04EC79AD0F27FC49E60BEFFDC465942B30FB41BE" "004B274EF9BECBF6A46519E0A38457C75C3023C5CA58F5DB4B321E1D9214C27D9FD1F8C979" "AE3B31D63E9EE6B30188C9FC41A3AD58F9853FCB8E5B7BD9C9BF58E384B593ED3BCD1E407C" "45AA8C866348FF7C8CFB35D2557F5E26957E21925F049AAD72D8CC05CAC80B9F9D5B2753A1" "CC9D5E3E958F5D4D9B9BFBFB7FFBBFFDDBF711F1D35B30035C99FFBB77EFED613B59DDAA9C" "B34225221E59D229C2E190B80108BABCDB3EA5C03D547C5ED21324DF2F1D3F72EB1AEFD32F" "E4C407F53509A70B4061D655A64E0C617E560AC5B7133F5D3078050B7D3CDE0CA2131CA088" "04300E038872BE0236891C6B058C021A55D53F393D1687132C5513252978871643723964C2" "2104C60D8548DAFCC156342E7F9E99219E5334018D7315A4D1520ED350EAEF4A0A4CA18FA5" "85D024FBF77A45926C420BB779AB3010E17D4DD22C3B3CB2868A3B4E66748EC4B9FEBBBA64" "B09EE5505046149E7E00B48F9A3367F6C7A9426831D41C97E6B6D8123CA7B6074015512CA2" "8A3A720854AA6E5C2694B70BB18B6AAD7B2A17364E3E009AB42510F090444332AD222DF8CD" "F3FF72B9BCFBC77FFC8777CFD71B01DF406CFCF50AE4EBFFF69E45EB2CB77202002ADBB63D" "A93739712AC2EDDEA848D3F015038EEEDD5B07BBDF8AA7A5D14593468478B26D16EA7C11EF" "4BBA3353EAAD122397953962EAEEF4C5CCD09925F5B02E6322CC4AD554AD93F458124D5250" "22D2298D26918F22D644F8C9BE6F29F8161E239021391578A83A1FA95AAF70316158DE98D3" "18239B4DC69AEDCC95AA511ADF2DAB20CF2198A384F709C59F197AED658F11330E0401D0B5" "EB7B043E8EE92149BFECD332498319A20F05A37A02230129B3F28492DF617EF337D1040D29" "B7221C7A98237616CE5B4FDD3D806CABD74CF8EE8C12338CCE8D460B7A1019A95F67B0F51F" "2F17A0E034DF0286848FCB21D7C5827EA3221FF06499A3B65FFDE69BEDB25FDE4424C05503" "703503BC15A7C7BFB49C0040CB134813E9D7BCA92B1BA7232D5E1DC052DDB14AD38980AC38" "28556F4408D72423A5E226C5F60B5BCC98DB0930A86C779353A0327F341C9084BBF44FCC5A" "7A8BC958D467323FCCD0828825341D0E464899FA305C628E06E9901401350F99950E1A8D2B" "B3CD303592B6E845666A3E3CC923C8A933730E88A2007B20FD0D92A18230A36BB1609441CF" "69DD3A6D5C32031DFCE1002E2A3262BC1CD84D68794BF30365976B790EA44C2969750F76A0" "890BA9AC39CF99E4EBE7AC8DECEF21D104AE0EA03543EC4720B93378F36D35B7B8EE1A9C3F" "99F36E99DBA7DD05DCB676B628F70894792128124150099E73C71EB3050130CA0ED89D038D" "FAAFA38410E3EEEFDF3D3DDCEE3B79034CF1FDBBA7DB5D0067599713005009B377B3FC3433" "FC396C898E7E25ADE9928795E4379DE83BCD986BDD70660B91E22643FA6A0C023E8C88AAFE" "3D95DEA1498A59CF4912C8B2E793A43E8F7B10AC247E418E4C9CD92ED5ACDCE90240E95CA7" "CE547ACF40541DF57EE03D8F4C7493AADBF48DD070B6F2BA376DC78C255D307A8881F3A88D" "D63DA5F4BA8CA82D086B9645321470523BA44028EEFEE73E9B008F69F9092CE5DFD0A868C4" "009EEB4C1E60945AAE8D07888D7B25240B1E7592595A0F4194088FA9A446265B7739A312D2" "573CFD98490F64A02C3343CBDFC1F3575940716B96D5C6CD5AD8FE40671BCEBD26E62F778C" "FBB63D766AA28DB96A9B1C6BC6FEDEFC7AFFFEF6DD777FD8DE9A09E00C035C9713005079DC" "1EDEF3ED66428CBA5D30CBC4D0E95812732EA18B92F7248D702105BD301304316607292326" "2ADDE85A0BFE7AF15B3DE14C747BF9920683B2C531E92B458A125A6309B944A99809239B20" "C817E3088173BDD29662C5CB2B60DC9687BAD8C3422547CE2A87786C30E5E25F0B7A724BE3" "6BE9559F9DDC27ECD5A6F920E87BCE1FF35EF5F8671F0498219A5229E79A24D4629EA54198" "99B574AC05E815F809BFB3810CD27A810A8637FA1CC6C31B2494A91288BBDE8BA0409ABA6A" "98C7FD76DB9DD3F818E819EED8E5E6CAD474248C11C0D8A2744A20A7A3B83C05ECC4CF3701" "8A5C6E759F8459D0678C31B3D7E5F9BFFEB53B5C15FBAAAD0A9BD7F697FDAAF078F877FFEE" "7F7FDC2642F6BACB7917C0BA9C00804A583C643AD0BB5CB9ABE4BA10DEDF2B1AC48C9AE8DE" "2FD0E42E35B333A09144863E350FB1567549554CA10437D0C53B4692DD246541BAE3B663D1" "E73E5F1A55E0448D131C2CB21F8D1F35490C7F8ED60CD4B33175D5E929958DD979B086CE73" "D9D6D65D6FE973DE229CAFA624569DE3027112563FE77380B6030CACDEF7260513630D0112" "8D292FC5FFD42C688865D4EADE2F37BF86AC83D791A32A7A61DF08D3E75CB7067DEF2529CB" "FA7BE6FA0B0217E478D8FC459C2034CF61C4ACA94A10D45304F3A69B9C0B794FA7839FE17E" "04951D18F4223C55C25BE9386089A5D11BDAC057AA6DB866C5BBF6EB3FFE87FFF0F8FCF9B3" "6D6F480370B99CD701AFCA0900A884D923CB3D33F7EF1C409F0DBA21142403D9EA8AD04F8C" "73CDFC4D2406306BB6C16B085FC5450975579B7E471DCA69A66EC035BE3D4B0E5EF432ABFC" "27A0540E553E493D20C8813EAB384C202163C0AD181E5F962480A0D9DF8DB505960C3A1458" "C9D0356301D64505EA1BC3EC422F33E6C83E210F806A238C723190329F2A9095F27605A0AC" "60E8D2914C7E98BCD3D9B18389C65D68CD3CA309F694CC67AD06E69D742CEAB7391736D330" "F032F8434CA76D0926B04A58375F34CCC010DAA23DD8F7806A143BBB4FE1BBDA85C1C0537A" "F7F6DB718D5FED298655A417A8B6EB748EB56240257D22C0E11DA6D5F3D026BD7BFFFEC1B7" "ED4DDC07F0743A017EB19C00804AC4FEC1FDA108880AB72CE29B1C59B9A8C64B5698847240" "7F30F04ECAD8CEDB7EB9FD57A4191F2A700606A40F7696BC8A6372E8E0AA07341F32CAAD40" "0D66A081074998A2F514D162864F594ABCBE4B2968D620281DD7F92D898CB537CAA6317F8D" "93C2762BAC187CB08006E72860C9153676C500041E285F41AA0CB0275892E50A24D441E603" "5A85A0214731D3086AAFA934BA822BD8D4D09CE9EAAFF673C47AEF48929B0264BC07A75784" "396DCE7E18A1E0213BAC385414609C680BFB7D53534A56E36EBCE2403C0422E97C15A2B444" "52AD44B439E6A4450A4662B83D78071EB76B9A09C753EAE0727B65A93F01E3E605BCD91701" "DD8636E8EFFE97BF7B7765FEAB08A0D756B6BC01E2BC0C68594E0040657FB9BC7F787AB297" "E78B4AB6C687DB161A006635B37D8E2A41485E6A02DA21EC12A370CDD1124B5F887D766803" "26F14CF4CB9364B82AAC42E567B527D1F9521B2E872225814DFF0726BE4995E7C442469809" "845413DE149B25C995C18F1B5DA4C339EF730C0D71559818CF01694EB86D0658A2BE0EF47D" "AE8C52330B40BBA367684BCA2C7A0AA0603F0A17A45038C2691F66640A766263D6C5135B7E" "8C3B7B07E614B669CF20A66B33120CED86FEE40E0B43BF15014431B992E62982A0BF85C694" "21A6645D19F8C06A8F9A46E440DE0A7068FABE400FDC276D02FA0046CDEF468EFB9A60C887" "6A27B0D76B0FF76C9D6D19CAA1B6D61F58781B7702FCD33FFCD3BB7DBFBC09A9F84804F4EE" "96ADF32C73390100157F7878D877881392E56BC10C9318C5F4494B1156269CE06AEBE2145E" "46123F89A44DBD87F4BED9D42F31FA48BBE94AA5DAB4A7ABB141EE5529187590C4B2610AB2" "2E496E548C7C7C43EA59043B406E2DA9B1220316BD754C44B47E393BD0B5C881620E4DBCEC" "700DEB1304CC8615DC015AD027404461B646AAF57CD64D9D0B7A0A60C253B42083B72520CA" "BD16C5640B068A2968517602187CDF822DF025B55F4C79D2AAD4DBF5A96B4D9C4C388A31C8" "FB8EAB499F0A06C9D504EBC9C945D6912DB2924671A449F539355E21617700EF0080D9BE38" "FECB9E963484128A38F9C32CAE53967D98794478DEB75A283A17A42130CC9DDF9676DF2EB1" "F75A5E65B98E733B9300DD2D2700A0F2B03DDCE2638DD466EC99CC5201DBE6E53630D114D4" "23A2CA5D08F513218EE8040577C6972313D9FF98C083134C439402C978EEC6464D2769998B" "88E760C2ECB4C8D3128D58D7B3AA723723BBBD690E744E80A38C28FB60457C4B1672305E96" "E069B24B1B83CC722D1A3FC3074540A619AB3ABC80478DA8221D286BE0B41810E571D19D2E" "628E97D5EF320719BDC020D108D0B6D5FFE206C96ECBCD77A39EBDA9F66B9D5DE575A82504" "9818AD8D2513AC7DB1D046B036E1DA9F2D1DF122BFAA1D140540A611D52454B480F31AE5B8" "94E16EE4EB92C778629C0C3AF23C9A436B92EBE1FD793D7BA51868587B7204E6FB37382A20" "5F4EA7CD40C6D2D4805DBFFFDD6F7FB7DD12192D51DCEB2ABFFAF8B1E6E92C733901001537" "7B6046CA8C4798B8F88E2F848FA9DE8C257721C8F5F2E2207AFF40CE83C99E326E3D1B0FEE" "0FFD7098068E3E6F8DB92C99D14AD2BD33C6EEC4B7A6BC0BB7E7E8CFB6FBEE396CD0E89633" "622A3ABE7BF38AFCF7A2D1E90C9C469C121AFC05185C9067BFA14F6E50CFA68ADCBD04FB31" "471CFB0F2401D3F16061FBBC91A6844FF96E5D78D3C211684CC51764DAA3818CBE0F522391" "4CCD0AC0DA82F90731BE7A3F25E305E8E2778EB903139B7724DBD4FBBD02099A42F6426A76" "BC1F0761A06B8E5BA6A2DC7B02FD318030A4E4CDF5F56A73CCDB74EF463EAB2E41F9D0042E" "6835D8D4D5AFB817FF191EC7ED45F82B5CDBBABC5C1ECDDF8654FCF272B1C7C73304F05E39" "01009597CBE5E1C3BB27BBA6C95C80F5764005A28FC3DDA4A57150A17E230E22C862510AD2" "2B4148E2E544A86C241801E3629227B233318B796C4B293F947FF7E7F3EF1428C0FCE6BAA4" "3DA28A652F16E98A184C693EDA33249D263145181FA51416299D3157802843675FD27B4AAD" "EA7100E86416256997D41D3AEF95CC37A5C2E1718E690051AF77368EA7476DBB194068746D" "043E4D0C8FA4631F973989E75C500BAE9C2521846A1AB4738C57B06DD1CF3E0E861B1562C8" "C04E183C65334C73CFCAC1B5B40E56EB5E511FD47E3144FADDA82FF5B9F63D32020685E5E5" "D183CB0D79E96FBA97529260C99D597A1BC21244E3DA6B9C1541141EBA07D23722D74F3419" "F180C57CED256E2180A9D93D8B9613005071B76D0FE28C64774C89B4989E0AAFC41A7AF4C0" "F10F10FFF170DD07D2FB40E0A11382821175BB98112BF292207B5D41E3717AC69916AD983F" "7D3DFFCACE56037454063F4EAF6ADA5695E089EBDF629ED391B0D2FA2663C13CA7F4A3129A" "32163129D02C6D04062CDAAFE92B905A213265688FC1C877615C0109D8ADE61EF1E1CA4801" "5494853BCF4B3973BA48BC9C9D50986BDB13B729DFC79A2590A88DD236B5855C7B2C6A8479" "8BCCAFCE8F8E6D7DF574DFF57DC96931F672FAE388496911DA07F4679CA937EB96844A7966" "02E770CD0AC1A0F3BC7B6A1B6EFB6693EDEB94D80BFBDE0554800D3B81D8A3CF5DC333817F" "D248948B620331307FD1A123E47EADE17A05F0DFFFFDDF6FFFF2873FD8D3FBF7D3A85F5BB9" "3A007EF3CD376F22E4F16BCA0900A86CDBF620E142948AF776CEF80EE095AD5F88C9C0DE6C" "8F8C4C02D29DD2C0847BC814F7A1DACD07D231B0B53CF705A8A27FC7B4B4EB0C96A5273E32" "4E5A92FDAAA07E70685623B4B28E871EA48CE87D180B567ACD6CA5EB752F074A26B73D0CEC" "1828181B4B4B35F7ECF99FE380D02F60016A69966E4D72FB9784E651B601056C6C43BFB38E" "5DC6977FE627B924B0CAF0B279E19D1618BDD2866660C2BAA0C84572054A4E690BCAD94F52" "14431333850FD2A6AB3D509A82EEC482F155CF297A0166BD185919305760F93763198D1B8B" "8A2894F95A6E33C7798D0D478119740B8795F3413DBB7EEED9FAFAD9E561D79C64AE89A8DE" "E2590F7B797EB6BFFDDBBFDDFEFAAFFF7AA9A57B6DE50A787EF7BBDFD9EF7FFFFB573FD6AF" "292700A0E2E60F4C388425D5A9BDC3C5B248EE7A48B14CDC505FBE337DA8679C1EE6882EE9" "137BB033339A85C939BD2C35B796868E38E4F0B8037A42099AC1C29112EBE42B111AAD602E" "BEE0D2B122E6EC9D4F7903F29DA8A908AA4FD922D4C64E39F20D8E82F3F4F7E4BCE06A4559" "BB892024CCF0E8FB4834535237EAFDA247FD9D1F65496B918BBD0246B49408D05EDCF7FCB8" "B1C5616086495F592377F156352DB8321CF5D9F0A1CEDF0B3910834F4D467E939DE6D0CFF4" "71C8B87E42A2A1DC9DD688B72D259FEA1EB61CEF6F50F98837BEF37C14A6A64C896858C2F1" "B20F1BED5B4E2BDEB07185097AD37AB1A6C391342AE89D9C365C4016A26DB86A383FFEEA9B" "F7D7D4B8EB844AAFAB5C350046B4F12C5A4E00C04542D50C08BA01766B1B6AA5EA8E110A85" "78689236BEB019411B9BAAB8548C2AB570BC3913507A442AD743AFE8604D0E0E2BB617411E" "448DC188F737B82E9AA7629300044C34EB33031A0A4193EA06F565A1D5685D8A280EE0328D" "9435DF24618E4074D4519EF7B3A42C3339287B18DC0902DD1CDEE42BE919DF088C2084D330" "DC629D581B022ED07B290E72CBB532927603FC861C4FB90FB514C964C011A73DB047A6D2CD" "F7911CC9584A5FF68A121CF16FB42FF83E888C90A96B82CB8C77FCBB67E4DC3893DBD82790" "EA8FB16C4E6D545B80E441BE3C198ADBA3156EE0E8FAFDC306509077355826F0027689F16E" "DE6900CD931368516D452A1C6A4FE77D19D1FB7EBCF3FCFCF3E3F3CBB4895E65B9EC8FF6AB" "0FDF9C3E0077CA0900A8EC7B3C3E5E9131E5589DF89BCFBF882DBD39A525B980DDDDA7F7B9" "80482841CD572A6C495480AA3C2EA6455DCEAA9431AC097A2FDE7A7854CA042C662988F3A9" "9710489A00EDD431474409416FC7D862AD5636CA88084B0331080248CC5326AF7AEF0C9358" "B4E715AE145B6FBA8ECABE86D31DF97D04C5A20B960825EAAAD549C9583BCFCA8AF2A21734" "C2497FACCC230088B846BACF95579D2EE351E0C57F862C275F7073CB25309CDFBC2F498D4B" "A71BA681F9A8112C9B208299EE3D9C4D4D9C651CB6CBA686DC0B5BEE3F48DE3E4042FAA26C" "860BA92A3745AA07D23F676B627D021C8746035075AB754B20C1F749E03D1D2C83DEA200A4" "1D0BEF3374ACD7C7A78FDB55327E0B4C312F013A2F035A971300708938F8EECEA74F4500F8" "288D03BC7D4112A6DBD37C108D2F79C9733BF991ACAB079322CA803C370C2E48C263E9983C" "993B59E84085641CF9AF88382562F812D4F429D1988111739D237325DE6893B4C8C918694C" "023A98B3B6DCE7DEC0124BD75634364A723AD62B6ABDB51F9AFB20C7D627B57C1416402BEB" "DBA3773B48DB90CC37F43DAEAD8D5336CEE06825686672A002434D2BC2C02AD773A7EAAC35" "3C1E48253933D89A8E0D496CF3BF09F26446725ED962C0FB6730381B8E9537A7B979B4052C" "83FAC460B8762669C2EA7443BF4F93BD13BC86D45E7B99C1EF48C15B51289992B784025C56" "A453EED6B3D41EF7082CE843CDCDBC07ADC69A51129202708CF15089FFC7BFFF3FFD0F7FFC" "E32D47FE6B2F571F806FBFFDD6FEFCA73FBFFAB17E4D39EA388BFF00002000494441540100" "1577F7BC3A364F4D3F87DD9E3D7153A3EFC9E1A85E21E16E82F4F72A0B207B304088C3C7BD" "E541DCBEF70DF6736D37592DD890B79785FDB06AB73A83E7C529AAE5EA07D1C29799575F89" "304185489B2D66913DF4BB148CB870B491D2286089958D5EACF7290D27A36C7D52E6971223" "184297A037CBB4B6B32A9E6BCAFDE0199E97F9032CEDF0210023B83F71BF3E2E883C607B06" "ED21DE8FD94E4A9D586CAC256BA2788F50564A7E4BFBD30E94A4188C3A79B306A025346A7D" "CD7F3751CB2BF32F2D92692AEAEAD978A162F76BCF02A81678EFFC794CBED20B726F8D8D9E" "8373E0C6218454E9C4FE695C7525F16A1B3826A6D2700B4A76BBC4CBC3CBE5B33DEC532BAF" "AE5C235E2EFBF3F2FC9DE50400527C5085E0A31B74A698872D1DE250705E551616956B169F" "A8A4FC540428991539CDB1AA2F48A50D8F60E217D335A7209D8A4732D908FB2D58B5318317" "63B4339728DA43120A331D720263553CF795B308765F86F17D79A0878BC62123025202A651" "4E33A157EB021454C8D5BE973FC64E77F897744D5EFF3959D022049966D0086B3FEABBAEB5" "00BA98A6974783E53912031DFE81EC5F802809009B0415A48F28A7386D4FF0023A280E7FE5" "6CB9BA3068EC832B61DE9BCD9C70D4B24401B23B0FE55908DAFBF49B8FAB3AB1CF780026FB" "4F802A66B4D202E76B691A0234D643E05C593AE7D1E4055D3EC497FC74F2C23E02D04448EF" "2D117E501B880E4079787C67EFDEBDB7C7C777D314BEB672D5005CC7795FE3FAB6CB0900A4" "C4769CB2C566517164FAB90A4BEB257D0DE232886A7863B82B6236354799FFD8C62B364C4A" "80C2529E00073CCF1255A6E93D6808EE2CAF27E49638C4B62BB85110511327EE0C2E3F31C2" "EA87B4C00BE73C28666E35263323BB35314BD20E548FA6042E680D7F533A6001032604DA44" "D58AA78A504BBE1DAFBBF2058291144BEC5739212795E1B6D833BECD5B01A8A1A9887CD647" "BE1F6A07D7F1127C5844D961557BE447B5282FD47CCD2A8906B2E167B194D46AFF3710D07A" "25DA39EAF7D6331752C401EE1E68A18C03B01D5FA4E39E4AD866A491A928FF387204F09E24" "E17EBFE6E0F7ED703CCCB98C7123A391E6A103F668CA121E688D9E0581049B473861AEEFCB" "CB8BFDF5BFFAD7F63FFFFEAF2660F01ACB1500FCE6DBDFD9C70F1F5EFD58BFA69C00408A6F" "48297BE770AC0E0D3BEDA4D4CC126B4A3644E105D14F18A031CF62360669BD27BEB1765318" "0107AD993410A361EA66750E24DD8954539F3A81CAA702AA7D6E551CC98490D197623255C2" "69996BDFC921B00FAF7DD16FEA13298D4302C7585932874680C20F690D6F4D6D47F6DD9A97" "E62D9FEBD6257E4BC94FC200E19BE04629845D33FC323FCD76C1EC2105EA8AF33D08D91632" "1B41808FBA5AB6AE96A650D60430B9301819693968CFFA0240013380C9197FCF25197982B8" "114A582F04EDA1CC84C9E03B01EFD0DA64B2ACAB67C2E14730772EE72A9D37D53E1FB2E7EB" "D9FC3FCE6DB00D59A2C5E2DF6EFB33D510C6749673DE1DEBEF4764802ABE42CD1206D4868B" "8B08A0C70140BEF9F537FE569C00B7C783C53D3E9EAC6E55CE59E19202441283BC78440A8B" "CAA32CC28F453DD754D622914EAC8149AB15B74198954ABDBD6BBD4F0B790A7D24A2DDBDDF" "E1DBCD60A6D5D107BDB3FC42D22F3D5712642548514D85380A16A820A97892FA6D9A9F0236" "E553C06DCF12A98CBD4041FA4CE4BF2A560A9FAD9F6A81481DCE1A1A62391E9AB2993EB2A3" "693E6BE948FA05274E97B9B4D20E80617123467B9952113B987F90A73A802A766F5671EB26" "79FA9703E422A3213A8DF9A9B7BA5363D052911F484E89EC4BCAB90F703B00D618D3115AB7" "A96F43BDB4559B871342861D6E340787C6277739C24C69E62562C72AFD6F88E6C7DB40181D" "E919625F3E76EE755A428D8575015EA2D518DDFDFCFCB2BDECFB4C3F5E61791771737CDCDF" "C058BFA69C00800A05300DA9C81940CF12E7B204D5A44C2B9AFA570A112EB5B3533A5AA6A7" "81764AA5CFC4C04038F0471314EBA719827CE9CFAA8F10405E60E3D37B219DF0BAAB809F21" "E65F730DDD3FBC9BE9CE7F031D15D571BD3F98BF8C3BEA3730A9067C06B82B7E9FE68908D1" "2888F01890DC65F824D18729EEC85CED7BAA0D76ADF658BBCC6190B9FC0914D991D405F547" "9997883314238CD242F911E65A4321E750EE4125EE01C83AD6B80128578613D3F4E02F8163" "B51149CFD4925495A6A59B860220430A01775491E704F698D226701F2BA285350BA6CF3023" "ADC880C24DF57B399E7ADD2538C211B9BF90F20B7C75A4CC3E889DD1F7B0D5CA84899956F7" "0DAF69DF63DFE2E56D30C48B5F8E6440270058961300ACCA8AE1B538F789F88CC2617B40FA" "511EB96041BDFEAAA0FE8690E6902152AA6529335F1B99C632BC0CF51128F86F3D0733651C" "F3B17EACEB461A6E4075E1A416350237ACBE674908896A7484E9C4C537C89978EAE7E7CEFC" "1148413E15BAE8E4ACD6B4268DD98F3F055A95035E916E00B789AF024ADED4B600485E7362" "83E11FFC86987FF15805407B011538B6D52AF8173687F39C8A578938A6465E4D08671219D7" "F1CF26F324FBA0B73F3D44497DF29425EF2E20B1892FC7B451E93B312DD07E0513A7D54C07" "41673D0B01E08885596E9A65A50D94AADA7ACA6F02B2C5D8693E3A68AF8BC0167DC3DA8EEF" "AE4BB0CDA1ABAFB1C463D43E39CB5C4E00B02CE3701EAEF083C00EA6DB6CF7BD7489C1C671" "2CE9B750FAA250A55000506C719E65A111448E533262260D1421D2167E84E423C0817A6F9D" "98DC292C8DFB82CBCFA43893B28402A7F1BC5CA55B8C2EFBC1A3805777C599339012A6B760" "2C2957BB35837BDAC58920278FA57CFE476EFFEC27385EA092EA7232615EBFE3ABBD77EA98" "8A62A841D25ECE67687AE9A0E522B574CEB531A31EFDBEE66358EDE5EA49C6B8D3DC814F67" "DA63A4D03D62E1B1E371A5724AC7414025C45FA403B2DAB7D4A12992A5EA65D5D95C2AC914" "D9EA69116A8E2A4225A5F912BE793EBDE84169A7260756D77AF9D0B62C3FD100B0CA0290F0" "1334766747DE16568A822E49087A707B032180B7F256C6F995E50400BD900ABDF2D5D7C164" "D9E7BFB63ECEE79D605CAF15E56767B9395577649F4EB1A713C7FCB02961387E0CF9496567" "F6569F06307D634450BB7CAF52BCB29668EF979005D1BC5227A7635B11C3647ABEA8D3F503" "ABF79339207A606DF0A839A1BAA674CCE3E992ACD99E42C41852F7F1FB4E511BDCDE718362" "326356F9A8147FAB833D482DDBE10DA4B5BB8111EF652ECAFB0F080E4D6088267C20BA296B" "9F4C9E8BE41A144102FC0990595834DF25C028E98C6B47615446CC59C6EC7446782F8B531F" "9D2BBEB8AA86EBD827ACD2CF47C6F3FBCD9780D6CB875F803CC7E763F4C9F37AA1AD1D2932" "7B358D960F33025F9AC47102EA13C05A1DEC73A7666AEBECF781D26B2BE189CCDFC470FFE2" "7202002A4804647228F127E5DEEFA96E1B9FC48537A9F666C71CC37B86C3D91477552A3941" "49BB902280FA49DA6A6F33DBFBDA73D08728C496A88C3371628A5FF392840D8CB5C2131D63" "75E622092E722CF5BD1A6B21E5A9BD1E2C1273C70AFC9C1917672ED8F68B23B4A43CEB1282" "0B6C92E86A028F38FD7C80D41DEDCF118636B4141C1EE0401B79F784C5F02BC8592BC044D7" "1393DD9F41AD760FCE8B6C3E5917DE0BD45E6124C70EAABDB0B32BFC7C4155EE8B5ADF5047" "4CD2893BDE5298DE3032EFDFEE50E764300FBA18888633183DC9E8E4A177DB9B9CE82F376A" "4B76953DE144444EF90BE0AA909EFCE33C4812C123A454C663D9162271A42FBC786F491F7E" "EAFEBF584E004065DFF787EBBDD11A3BDE527C34A8DF04096148C70301352539734D82CC9C" "73452ACB7CF74A58A3115022900622B4967813C990D44240079CF34E088056265C0E6374A9" "BC6CEF1AC9DFC0948691F1BDFFDC474D7F4C0CA4A12CEFE39F785993A2AB1A242702B7A09A" "BAA77F7330CCBED49A77D3C0E2DDEACE4EFE0DE5E038F65182BF92F2A93BA376C8E4DDE473" "301A56FBABADFC70106CEE7116F4C9C34AC1CF93AA7673D572B0FB6BB02E8C2EE009424D9E" "1236EDBDD20CDD3A8C287AA8D6731FD16488D32652F18AA3DEF83F71D025CD41ED559EDFD1" "06D2048CFCFFB1913663427C35563E763AD3593FDA4D20C678FAAEA820D62A4A423147632C" "0C72AFB32CE7E92C554E0040851375550993E332A9083B332F89958042BB9273B52597C2BB" "EAD387C313C93B2D798A3A9269DCD02CF196E8D3189C17036174D36FB393B18BB401222E80" "82D5A12CD937A6317D9F4C93AF0096DBE70C84BF889ECF2686749A1BCC147491BCF469768C" "C043F6EEF0C5D86933A07DCC49835B6EB8FF36789DA099E15C03C6771570B2A75495D318D0" "40BFA4283BD6172A3F53A069C0C6E54ED11C054C3836A6838C3039203C5F9E31F73C2341A0" "90233A9AB3A54C9E01FCDCFE6E89820500B7CF05248C40D138BF9430EA765361CE8B8756DF" "0EBE6602C4436E0A406298E9361916A9FB739FD689C30C6DC29FFB7E02F01010DAA6AD5F49" "CD257CFEEEB596D58548674139010095700A519303E80BEA3451D5BBBF96C43A113894E54F" "4C6B1AD739CE700BFD1143AD1269D20FA8ED9AB804C72F7421EF2EF35F1448302522B58719" "1A2433A73870AE9B96235AC7529296C42CDD4B3C8EFBF8CB313079314BA932E7DD898F44AF" "E22BC3BFA0E2F317A0B19624120356AE7FCC287FCE8F0C4E663ACD8E692289E74B3709DFF4" "453267D45080F0282D2DE66FAF3988B60FB8C7AA5F486D4281D345589F31F391FB2D5805BE" "C3B1CF3019D07A61330579E763B916172479F64D65C2DBA554E0F2749B21ED13A00664F45C" "49F14E7B25F7094FB18079B6E833D0C2699D8E8CFCBAB5F3CE193043FBD58A7BF8BDDF5E5B" "D9F2BE943732DEBFB49C00400A282E6EDD9B437B607F840433314426762C951719FA0BBB55" "1A3D665041DF530E70FABE9AE56E2C3DBA9A1416ED37B23A4ABD53A19CFC5C8F106EA843EB" "463F62FE2CF179667F2BC6E12D2D314D52F49BFE340DB1A50A3B524A0371D04FCCA8F1DCED" "BF1BC5934F170781292740B326AFF7E9170CC65DA8B90931778445C779E3350EC983600F5E" "CBE1877819BEA5A436479E675AE655144503C02459AF7203A82989C2179B4F8830434AD9BB" "2CCD77D2BC8FB01B9C72AB50822D2E7AAC091404183AE79F18D129EC6C8AA18A07B116F654" "2CA005B480B4C313BC6C8883684151AB3CFFD3E88E67F7EDCDC8C5FBCEF7519EA597130050" "81C34FA6D8BCE2EC0C73226FE29885DAFADCC4820A919AD4A1F7982D97A332A121C9641A77" "8F5E1149633E49A9135C6983B0F6A40ED8A7C12AA12DC93C2B75D453297003154D790823E7" "3B198057BB1AE6477661F8E90D61F868144C9A98579F2B061FF59F59042752DD401D389D98" "9FBB23600B6D5C2DBF93F42D8B90F5D35C1F0030867621A6CA28DA6ECCF52EBE283A448DEF" "E7792D7F0C91F4799EDCB479AD7FE67D51EF082CE9E72094F1170096F902C7AE8BA680BDC0" "9CAF7FA47F0FA9EC055852C31CB5931AB6E80B95C02BF44C6428A1283C7A9C3F0674F826E4" "3375C61AD81E6D5DD779938AC73F99C830FA58660811E426FADACB6EAF3FDDF17F4B390100" "952BD3981C79493AB505A998CEB4F27F133ABB207073C94B5B1C76EE4A3766C455947D8030" "E3FB8929D798BC08D5B20B3C0714EF3C0D58AE5E2529AB0826854765A29AE60F5119D844F0" "46CF45B2AD280048C43C76C8426364A4F64FC0C1C610489906A99716C967C8B6304328BA0A" "CA18989EDDECA0C9906704E9E98608305F6816281360F932A0976131011D6182D58FEC28B5" "C9A6A9698DB74232C03B94E4277318E49A93E3263819A73C3EEABDA6E4DD33B4AD3BECF1BE" "68CC1F801621B493752957AEB4365EFB51D6B1C3AEDC4B38F0A4B5F2D9D410478E10EC1400" "91EA6FBE8B5B8CC62B41E1802E4B50950872CC75DEC5C1931F8799A48331A1106309FF420D" "E47FC7E5EDE83ABEAE9C00800A349FAE042316C4B1317E6609B36C8730B7E3EB58D48BFA45" "EA49E65ACE7E0BE645E498091B8812883684375CDA135350114FCA2C73E1A3420C75F11255" "41637C9088E5738AD6E41437AB7EC1FCF379992D76A8ABC9A14B84A8432C2CDDE8B9C11B1D" "1EE7AC51686977B32FA133EFB21BA2ED0D5A85F2282D8E31EAC97ADBB5BDA4D7F7917C68C6" "82A3877253A0C3194A444184FA89442915664442DA1588F1FB885830D2F2546ABE851DBE8E" "CEF85E12F2509E8B3257C0C1F3000DB49C12B14066110233E9F72087251D44B76DBC97E70D" "6C55A4F6F1C7B40D2727803CA9AA49C8FD215D3002F5B923BCEDF502FD197931130B85556C" "8AE0B5961389AADF4839F9FF97CB0900B8AC44FBFB7C717C60E6C58E4B83794E679A0812D7" "DD31C3D40E984699214ABFEA62739D2B5D556C249D344E5CA18B31AB605D2B21DFEAA2593B" "919D0434997B84EDD84E8C3C89A213E36027B024C420FE41C380E539FF56094F2F47617573" "0A4FAA8180EDB9CF63F09A84E9875E59019A4A1F0886CA0971449A8344ACA16F0358543E89" "1481AD8043ED93F1BEF755AFA5E57A33A9942641A42DD2C2C84AD41FCDBB6C675917C37AF3" "C4D55A7026C01A0A33739CA56290F523404686DD653B1D045F7F3B2E0474DA2FA4CD11F080" "E451BCBB6BEFC77C7E2B8870CA897100A6D85CBE3762F661513704328F4FB345260C93E883" "B6FD6ACF97B6C60B182738E38D10D30567AFB7BCA5B17E4D3901C0A2C408C6A92292FE6243" "851EDEF160FD84E41CC478D682EDF83C71DA83D0A64D56947A40229C6CA8DE6AC101531859" "979C481B30A537153CA14E4CA803097552F5BAEF1CA900464614B424CB6CB7C87C13ED9C81" "0FD9FC35B94FD60B2659522ACF7F5DB0CE4C4597A4340D34892BC1D60C9A80ECB74A6D701C" "9C3C361A4397AEED0D99F0BC541402D507BDBF9A334241114016FC15264691E082C22ECBA6" "5A98072F4A440AB5E3CDF482F9A0D33406CD370A961F49E60B9015DE342B644AF71DC7D374" "F017123A3AF55BC34C73AF1D5DAC5D4AEBEF052E58A30020C1CA9E04B9645A6C372F92EA41" "347BE55B30017DECA194FE6BED8CB40302D1DE463915005F2E2700E0C25270962282A60734" "3F25AD553A24EF2733AC4C730B0C2155B316C1A2DD17EE15439C55ADAE884D825A2AE46A62" "E2F8DA8558FD0A6914AFCFEF979C4A49EADC4D987F8EBF88204939397EA831738C0C32160E" "90CAD529069AC9670B67CBC56BDF3577C42F90CBF9FBE9D96672288D40F72D70EA4A85F1A5" "CB97D6AF2D90466030CB4C3900FB063403EABF40BF8F0D3A254D4A6046CE7AB8F35E8F0AFB" "DA4F1A9660867B7CB76776BB1DF737B82948B6406A690F64353C5ADA8706C02A5D319D8869" "A560B2DF0B4CDC3E6CA49DC9903167A0C1E74CE70567A2A3FA76366E63F5DA1241570A43B3" "A042C336FE5BA7CA75D57853E17968D300B2071DA07981A1EEF517F5EA3A4B2F2700E0228E" "47CC80FAA1A3EF495AB5C6BBF3F79206C62F3E1E54E79F452AC04161BD572E1206D13CEE7A" "63FCD6E563CAB816740BD06C732F52F58B6935EFFFAA8828A51E4F49A76112CF1026D7F9AB" "A1B3D83A3B4314E04A86DEE3C245EAE5A98D52E6929D7EE6292909AE4531AE731B8C226A4D" "A2E09421971FB741AAE63DFA5827CC8259F58C7AA055962447EA2392296DF7D4248C776E76" "F54A30059F98AC57962AB0276F6F92545B10A11243619DC278FF8F7C01E9A34120A9340414" "D228E7A5A4ED8CE088029CE978C8CE7B2545D74EE468D5DDB6C146E396EF9F4F7DCB0F6022" "A48BC7FECDB5A0200600C2F5FD6DE2BB7AC36058FA0B44451E6D099CC907187D88362703F6" "56D650F6C9A1FD6FB1AF77D1EB2B7E46017CB19C00408AD795B075AA9270044BA92A25CEAC" "8FBDBDCD5235077EE1EDE0DA24B5F4FA4ADAE9126A674C77AA11E91D5DB08642A8B52227F8" "9925B524AE56AA119D8985FB046732B4464C5962AFEF527D4C6AEDBAD98F6CE5964CA4FA03" "F5AB99DAF3639A476D1F23A630360EE76BE9819D9FE7DF2D193E42E278FD63848566D9A5BE" "E4AD5ED2B3A23B9B3EFBF08FE8B90DDA6ED13783B8FC10946E9236F9848A7DDE1AE891054E" "F57341DFC924A532F57ECC4DE25E025F1D30A603A2F77DD245E77CA3CEA8D315C3F3C170AA" "BFECFD3DF56E8D4D7B965B68B6F9D3C6F7A84B86AC7A7A7D66A308025A338A2A90BE938324" "0F958F343BA926DDA914CBE55B43F3F346CA5B1AEBD794533FB2282427D321ECCF257399D8" "DC2094F9BEE1B9A98EFEDEFA2B664B084522E250D8C48B9B45EB338FA98D405B6E5161AAA1" "A037B201A0832E284B9D929E7548445DA674B9C296FD1DA0E2056D0D9A13E098302369AD99" "079CEAE679A8AFBCC2E98E6E8031641FE5FE05158269B0F5FA98223888B1F62556EB226BD6" "D2D256AB2BB0E79558A9DEF5D55B8AD6CAFC2235F170021DA69A3A93CECEA4049D76FB5E10" "0697BE8715E038A46EA915793472421B5E8D605352B1CEE3E57DB7A07E3B315B1D0947D550" "94438E89AE624E739233804B3F0CD74B78B0BE78164E938BD999B626CDB9B7E356EBCF3728" "3A9C013DE8E241D2B27D99089DE58D955303C025D26B94894477CE69EF4CE789D486A9824B" "4C709F45AE2A5229CC582A66EF6AAA3589DB969A0C1A07A5812D8CA2B5AF8429EB3FB187FE" "0A4EB8BC61C833CFBF0C67A849B04D709070A6443E105F33105BED6F0008753539E5B53FFE" "84F9449FED6AF6545767FF106A65D08380D30F55B1AA66672998AD07078F46F483D89977AF" "7BDFF6C174A83335581736AAA5C051F12A8233ECF3205A8E6CC1EB2AE35B530EE6080D0885" "0486AAFB3989138743C6185BEDC1042A34965AE7DAFB1CDF0EFFFC6DA3352C930F062200B6" "24FC23AC301539BC1FB253872A1F7E09053F99043096927D1CF5AE0920D5ED5A7DE59C1F5B" "7B6EF4C903691926984466981448840A450B41BE73C65F6539F1CE17CB09005A496B1C52D4" "1EDE4A49027ADCF08A09E64737F22D62463639D0AF8141BF8FBEECA523939EAA289379DA5C" "17791BF76EA2B1F97BFE0A4A072F492B16AFB15940E68C2645E2E4597AEAB7021A0315BE8A" "39256ABA97BFB4A420D659F7A4424F46D26E499B96810799CC6E522937C7B5763FC0E48B47" "57FD8A1B01ADCD2D3FFD686347CBD235A9963101E54F6053C54A1EA72D2943C208E150213E" "14E42C181DC88929067B77D9707ACF2E401E664BDF29464976772EE2509A0FB0477D999078" "1629C18F742768BF626DD3D1E0C6D837804E893420FF13A7B390F371BB75946801722739F6" "A812890680749618B462AC785FB7E88A00BCCEF296C6FA35E504005C6E6ACBE1794BCCC8E9" "C89536A0AEAD25B040DFB3445CBA0016C7161BB30BB4E5EC27B4408943A9C82B0FFE1CF2C5" "39E9FD4E8362BA94F0BA11859004D8B724FB0B0034FA3488664AAC6CB26049AB7A5553464C" "3A9D2B938891CF82F3EF4E54D449AA9D049DA036F93B7E04F36445342169C74E549E45F5D0" "B92E33C1CC7315A0D5EFA476A08C7EE933C18E7B99DCC7296EBF9870D63552FED290DA0A11" "7F2414925A19B55639012F0699681B79294C7C1114307154C880D97B0AF631810C99B3E0F1" "F77D87E8066C1FAFF456660C5E33A2A687E3429B241136026056BEF371D364C4C6F4613C01" "32422A7FD2427066C11181E1A97DE4FC08D5315A3FD739B7B6C4C0213099C8565B9CDAD75A" "BAEFC659B49C00404AB1401CD770108DFAAFB8008F37BA28DC98131F44E1E81031BBA35EB6" "CF2AEFA003CCD25F31E4543730818B05F33711599A144F7F74D7E751B7C42D97F812C2C343" "5EC724A8F40A220BC90C9972F27A565C9F4B77239434D66F713B88A924BA297B73EB8FFCA9" "0C88D5DA7D82A67C0A554F144EE39CFE1AB8904E9407B34E4691FDA810C9DBD4EE2317404E" "2B0104D3FA791FF47E01D471D220D7F1E51A4E2BDEFC1A6AE3EDB417D172B7A1F3DC58D3A2" "B0E4DCD97F58FA0978C3CB514192E2F7C031F8068DD96D8A1D7E7793473FC1D9029919A5E0" "7CA64625C254949D9623233BFF954941C10CD3861C6BCE3ABF5BE038CF8269FBBC523A8179" "DE104E78FB67E31CDDAFBC6C343D6799CA0900B84C829B934A39BF62D9432506A92A19B55B" "991512C9C3599AC4D4A0FF793BD7A482843D0FF656D87167456F5741D3403086A9F7449034" "441FD3C2327549385ABDC86901473EC47D130B65A971CC33085C8048B3ED5FD4C051DA07B4" "8739E57648B580EEA6C734DFD6937C92B0410C17F94C833B28EACC286BE910374FD32E4890" "B502558F4E24D043F509371F82E5E5F374EB61FE5A55F2EE4E309722BE2EE0118E0664E211" "D505F6D9A766E1FC5ADFAB3A9C9D05354416C978E074B7D5A1AC7D238C5A3543BA91014C3C" "F75A6662BCFDBCC909E8D748F315C196F6FCE2D9B82C4C921161A6F45D3AC3729F409A11CA" "CC6833BDA957F796B8CA69B790AB6A03F59C02C878974DF4E09596958AE42C55CE28002E53" "D6881054AE3F45FB6615A00DE9B588542503224E11AB2A981189785884380FF2CCC07B5FD7" "5FF52759602B9AE5FDB96990AD561A410F9F3348C0A981F06A86EE8FE7B90D9B40574A9722" "650E10C2202502CF39478D7582BD642284C0168C05A22B184D8EB3FABA506B3398001F08D1" "5E549F3C432DD177F556E75584148C011BD663D2E430261DEF3AAB22727E1518A757BD8C8A" "187FF11667F0437B7D626F5EE61CD92F095016E012736D04848DFC0368BCB4DE9EEB338048" "30234D0C9469915BBFEB2E8562A1F0B84792230E55A479067C1534CE661B6F9FD2B3DFC959" "B1C6EC54A7F3E88610C07E0504DAC811F00C8E3FCBAD9C1A002A11F1734F1AD3A57B6FDFE3" "4CB10A9A5E23A9BD984C8934B368DE048FE3A323456AA545255B346314F1ECAEAFE7D8F719" "348067047F21EFDD990B216E4A8349DEA3ECBF2B1041B668E77A54424B693239A94AD94E04" "3A9915886D3209BC5F53388D0B6A7295CD8121D8A9921DFF8852EF3B811A5AA3B4B52F72EC" "47EE0BCE5D5004BC271F92166BEE8479B592EBC1A600280700766E4D5D0820F4EA74C9C9DE" "CF3E3126EDD4FAF5200EE258C888480C9C6EBA0B01E506099BD24F77DF03209D2E1DE7E720" "A739C67C0077936C5020391936220BBC4C1D04F2AAAE9D3483F3790FAA3746F8E0316EC7D1" "A1C9C377D0AA29D0827F4C82EFE797E70F97FDB248FAF5FACA657FB40F1F3ED87E629E6539" "010095D8F71FA72F475939F318D14C274111294BC7DF8D7D80072E384FD5C15201D3662FED" "C174935A9830C1AA2B89C2425D490F81D91585EE545F32C4103157A9B0FE2A13059C0865EE" "CABE895BEF18D810FB164F6C78F6A65CA5B7F75926DAC9587470ED268DAE0B03AAB2077749" "BA39FEE1262448AD1398AC65E7C03D0686E86C49DF30EE57E1A889634A48FDCFE30BFD8A9F" "48C73B9B18256D87E1BD5E4C2D254C79F60000200049444154F0C8840D6F7BA331BE95528C" "B65F99986AFF50FB144629CCBB4C109968089C106192E4685735134B8F919020B500051439" "690F9DBFB2D7BB0E20C6ADBED3965AA1F871DDA4681CC8E3B2B677F6839EA575AB681EF611" "201349ED779AFCAD5D8EB5F9C337BECD80E63596077F1CF37787EEBDF172020029FED0BF81" "335112B723F4E7284A0C628404394952B9F544DABBB3171B7B6C0F920D53A4CF6496779CD2" "A4ABC810C674A9D3352382CCD7BBE225F489A508A997E850AAB3D99CC2767B0B9A5FAAB708" "38453858697039091001AB54EF1613F152D1B265D952B064CD037082303BF1A3C87EF37292" "B9416EBF5B951EA161CA28FD96029808FCBE63FD2A81ABF7D7274059A0B1AEFC6D5A084ECE" "2483D73E29B8B0C1E8B5EDE237032824CB2A27CA7B6DF0F189043506A89CE072CA70C8734C" "8C90EA522D12B9E49BF392D7335B0321D57E820BEF8E83CC9535D570FDDC9F2F403CF6E0CD" "A9B0F910713F427D0C786F76EC866499AD5172668C1112BB3D6C6F461C7E781C247D5A8CB3" "D809005A0105218943C3FACC384E8A29AA4D84D98AFE350613EBA41EF73EE7DBE5113FA412" "DC174FD9EA985171E421116B78C8DF3F17085D34B1EF2A2E110A0E8133C5C7E20C140A5834" "5843EAAA6F9104DE200505C5B7A7C296E7BB24298E50885A2A8BA84C8CD58DA4A68EC92990" "31E507805476984FAF6066A394BFD8071D8481471CB7221AD989993FE6FCECD92F0E77ACC4" "010C4AD8EDCF0B6065CBF817CF5C99CD0D4FD4654393BBE1845BC298A964DF67931232DC8D" "BDBDE3F76256C14041DB61B381995823B0D3443B94BDDDAAE27A3F01435510465BA9D8A9D3" "86C8FCFFD817333345BF01400A38B4ABB3A9851A4FBA8ADE40D996A7F6C12AE483C1032F48" "1D3FA7F11936739E3123D03C50FD51ED3E40F2D8639370F17ACBA9F8FF723901C0AAB46B4A" "A1AA66DBFB7C862A22C0F16E112B3722B779605120FFCACB0DD523AA001EDEA6DA092335A0" "1B0104A00249EAC2A0C4F1811DAAD8DBBC3B934D99014BA34AE27161A9C1D89278D58D6A14" "F14C732659CD60F928260F7506E6EE184BE6094887C2CD143E589BC75CBF54CCEFAC0016E9" "1AAD050087ACA2D11AD26D7E430B51572337A1BCBA7DEBD84EEB0B46E6040464AD5BEBB91E" "B384CF8049EF0E4850400813261FF12B216E1EB4EE8C9B18F4BACBCC01BC59AD95EBAF6D30" "8A0434A913AF08A3A3B66E947723C1C8B6A53F01690BC61C1DBC93247502C4958993A4728D" "042226AE155046413A6F990CA17D1FD40FCC441B7B20AC76ABA5A5FB151CF90404DC35F0F6" "AACB64C63C0B971300FC42F12EADB0A86ADE2E096A7545660143BC72F0A393C8D52B102F9F" "E573E0B583842E3902983112CB38C987B66E8704FF4964AB7A9BBA75A683961D039DDBD4BB" "7DBCED4D4A3FE871B2068EE75FDBD671F14B5E139B7C0A8CE168750758A8B1C2596FE38805" "856D8DB17A499733999953001FCD6C240E237C6B9F081531E3ECBB43A4193E86E38FD9E430" "25CFA9503C021E995B41F4E746482BB54E5E5A86E034863C3607738652A58D81187049CC09" "0A73DD78EC59FB7E275110BC4C21DD1F1175EDD9666727E083FF8E14C0350F706634B91D90" "40C63833E16E3E6D7833B1F1F7A5A5116E8BDF446146E6B1E9984A1E04F653A2CA72FC63CC" "6F29F4EB0C73FB7239E7A7159166B2B89E25F9C0826263929ED269D28C1884258888B46A3B" "CFD68F21AA7B1F947675A18BF4832A2A0F78616BD393FF5525D8074035AE83602561224783" "F263683CAB40CCB828C8936E517296C66AEB82A09296A14A07E8D146D8A62A4BCC11053486" "BEDE08F9526FF66A9BF113C77CD7772488D7D431778A6A37080019C1850227CDF9B2800FCD" "8386491A813F230ED3579BE77244B090D4EB666B86575804A19753D002CF1526AE3445EE00" "451698E4045F32E268DB7732D72DC07BCD0165E293FD000892DF3A317F38A3D25B4C2CE412" "246F4053F406358F9D6E54A97B497CF821251199D0B59A13C5A7C4E476CC7B4D9DE56D9653" "03D08A3060A2CBC1AA6D967E423DD7F5B7E3DF92C28A7FDD3F85C26F3881CAD437F69CA717" "1615AA80170B74A343E65292751261E27A3E515717827D48511BBAE6D50310E32609A6D45D" "D399BD7496299B1456CC0E4CA5CBE6050BE4779DA8ECB395B6215858A7D9CA04514DCA9FA4" "784896FC1D204AD077705C443F688E4A03C13FE53CD038DB15BC7892A542060570A69BB42A" "112255CA165E3C0BED018325A77AE63650D500B3DD6CD1C05A6982F2110A3575016FEB022D" "01A215C4E5677CCE78974A20D430363BFC79E64FB82617A2E444796A91AD90A31168532D3A" "00F395DA2057B769034EA005DE59C7ABB89A3816FAA6D75AF62F6D86B39C00804B125894FB" "C8B9A203C6019334F17277C038925F03BDD9D61829ED33B14DFADDA30288044C9A046F843A" "59E55A5D2952B111E5F156AF64EE33CAD71F45C0EA4A64A7FCF242B4E8AAD4B118DDE69BD2" "1233045CD90C1381958D1F904109632FCA140540302AF3984D0077181B44F5C572B4C725C5" "AE78BCD76C6AFE16EA1A2E23C228FB88678F81E3D7BDC600D025FD6FF75674815E6A149036" "9ECF7D6BB805A9D62E9952BEB5C86459EDD65C920CEDE46C28BE3964EAE84EF696FBCA0A34" "EAEF8EEAC6CBFC39EDF8656BAF7D3BE63D6DEED4DF7017107F0F48600E8DCEE9D87316F04F" "608D5A452919997A40B3F8BD284DC0765783F3DACA3607769D85CA0900A8B87BA3E3DE8E2B" "4B822C953B08A8511820E9E4906DCD4BAAFC254C8030BCE6894D5EC84284219EE10B765473" "104866A159EB9768423D4D894E8CA43C3C988C8488522931C9D59E8C9C1542C5EF6675257D" "7AD5110904E8D6391F9D2BC9BAF8B92ABD3B3E8234DEFF20264BF86AC9E78355EDB0696726" "C0A600A8B69CEBEB826F42C7044A244D17E2A467A66EF54DB1303BD5FEE9EF133614C9BBB4" "5131BFE330C520EC327FD2E44B004198E082758BF9326F7B6E4F319ECE60862092D6801688" "9E3DEAD9289A448161F6C7698DF86230D42DA1AADB98B07436DC4C4049F1F276FC3A23E6FB" "0CCA1C5234A0268357961A30F58F61404F4E9097CBC5F691A4EAF597EB5C7C5803F4B39C00" "80CBC3B6EDFBAE8123D0CC85D80B8D4138912CA13F22542B012E0FDF3BFB32E850D7776CFF" "67463A498CA845184B79B953B709A474C2397FA3AAF83D1A91632FE7F47F10700036CCC231" "A4769210E55ADFE6A4D6C3A10C9C941DB76CFA3C0007E19025732EA62293775FFC2DC24BEF" "2C41864AE562AF2F67C580445F626E3ECFC6DD21FE86DDAD33D3052F30CD18A3575863CD73" "50645D49B788CAC8FB1A742769A4049825AD01E9545868EF592A79BFF5E3218E8DC455B185" "21A1C33C9640F578E461A8FEAF99E19C355BB44FF2BE4BCB90D2AA834263D3FC9334600FB1" "D9D75E2BD57F82603E07C72F9B2DCE48F1705CBF0D4AA2991CF9A08AC6AC5C22B03ED7D1ED" "FB1E97CBCB9B00002EF372965E4E0040252262F3CD9A0C722B93A7AD8BE27AC92C8F17E87C" "3261CC8C69FDE13AEA8B0800F105509154A4C9A9CA24173B9321D0EE43A49E3512ECE41645" "B12B998DA738ED243519AAEEEA57FE9BE783B504B7BF93018AC45322CE4A77A1527D081926" "FF05C755B5050258DEBEA35199183F4B93FC3B6A6048987F6DE306BB1A0ADF11C143CC480D" "313734C6979DE1FCFD5DAB900C2401D02263A01BAE6FB65219A37EEFDE6534A71AF717267B" "7578C7F74DDE306309F22CB45A2CC6C1F52A4C1B1F03DD91E4396DFE46376F57EF667E891A" "7F02CE1918E77E8D76598F9B3729DEE95FAF76B3A68C3FC99C00C6697E6B2FB868FC3A95F0" "8A2E42536C424AE122F7CEE649A5C8847135034C07FEF5151F59DBDE82AEE36BCA09007A69" "97F488A73B317C61D47736980AADF3819EDF99BFB152A922CEBE32D8994DA9712735404A2B" "BDFEA2DD4E97AE68BB3E793477EE08EFF043206555AB13A19F3A045FBB92803336DDC9ECAC" "6A7ECC07D5D6FA8DF0425285720225F2A4670F69C9B3CF7C55EAB985E8C3AEDAA6A3588E80" "0676FAD3B9CF7989A5E35EBB43C00026214663494888C69C577F690D5893215BB2A93F9CBF" "5BED9BA9C35A613A73AEFC23829EEE22BF614DEA717614ADD195685776762BB5B9E6BD706C" "3468062814A383F04CC3EDBDBDDC8BDB74583A468726A50D2DDBCEFD5D40A0C0C254334FD9" "4C53722D5AE2A24CA885B550743B0397D759249FC759A672028056E050E76AACBB15BEE884" "FFDBEA486ABC793915091374957AA632792EC103BF187966D3FB82D464C5F0626E30A60FAD" "5D64D22B5EACB9CD8684485A8419E38C3E20ED61926E0D883A88D74E4CA342A81D95AB6D3F" "FBC462257EEC990E8BB7D11C1408909E84A6EB0DE8796A0CBB95BF4275A60023181EAA6629" "F4F8017ED82D8F4060FFB8AB7A9CFD3E76E7B9981DFC7251662DC562814CB08F455FC79608" "88751C1D78545D7C8115F39EB64F0A5FD055D1CCECB2AEE3F11D6B5D1A298AFC681900D36C" "9195DDBBBA1B6051A57B36FBA9CA3DC31CBD3DC76005634D5F9EE3916D640564AEEE34D598" "871E5D34C11F5ADA2DF03DC251698DD241D6FDB87978563FBECE929BD0FBF9388B9D00602E" "A0AB83C12D08C6F1F3FD0440C58BA26D3CD253DF65FE4604AFB4EE094838698A552F852B4A" "BD2B4636F3F97B2039DAF8265527FD161C16986AD2FABDAB81E1CD8C1CE54AD783A44F1648" "737EF8DA5B601BA73038C493CB5C13A3B13E5D2AA74FB6F99AAE9ABB35732D47B49DD4E509" "A88459F1A4E3874C63BC8FEF2BC1CEEDD1234BA0074BD61CB5B0B79587640C8DC2304664BD" "05AE665D4D24C3A1AB9AFB33D6B065D9D629FB651898738DD8796B8480105AAEB94C878798" "A56372AB65875ADFB36107E3EF7707D811D1D72EF9A1BC01ED9CB91E82493CE0400A1FF7FA" "A76DBFFC5E0AD8D099227007538C8BB620CF1DCE2A4B173CC1447B768FD8BF3232E9BFB372" "1B676DB6B3F47202002D13272D8260CAF36647FF287B13EA5066976AD90566987837339AE8" "36BF922CF4AD892E32332BA9ADD9FAA5235E4FFAF4FBDC6BF0F726D64DCF71DA5875BCEA19" "DB528AF3616F150740D18AA8F48E70C9FC81D32537AEABD5349B2F454E54DF50876A3CC801" "F3A6C1605011409333BFBAD38E4A75D6244BEE1FDF0520E39AAE989E3605C9EF3D4D6F13D0" "274039D755A69FFC5D40A1DBBCB3B10FEB7DCB2B199CC004ED6BF99DCC03AC05C8B9B97DBF" "DFCEA2A6BC0E59E7F296A7505BD16E10C3D0CBB310FE4B95A39F03F07AFD30D0443DB1D198" "46EE00AB17DB50B0B778B8D9A14C079DA609160D0A80F0F9CD36B6080E5278CD657BE0F93C" "4B2F2700581625587CE8400C08610FE99C7F62801096CC8F13AB700319DA34FE9E2D00425C" "D551AB9799E012FB1AF5ADF2C4E71FC7879DD5A1CB4E933984FC13C44E9B1A0B96CA06922A" "C958A4DBFC0C90502459A434E03438103627BE3289CCCC50D4DDA6CBC80C5B1C200942ADB4" "A70254F6047AC96D825230AF1A366A94DB778DFDCF1AAA29F8E25B600E26E0C3F3C06DFBED" "C2F4FA580E83345D613C588043E6C1B5B615BED9F312602D7395AACF1C3EDBD6495B857FCB" "BCC3E918E6BCF475AF3D4A6F33BECB39DAB6DA2031D0BA6F0B475FE7DA0914D419D5BE6CE9" "34C9B6FA0AEBF4A633C87192344F40073774F26AC0FF414D6688228831C6C7C7C73D9D205F" "7B79F778B0B86DE5B77196130070B94955DB22364C65FD5B114FFAFA0E5448885902821680" "9E7FAB043A3535AA48E28B386B2366A4F212D7C5B67396A01684B08F2F50C75C20E368BFC1" "4D4BB2E1E424D94B76EE0BCC8158432B1880E6C96A8AE5EF1804139699E6C038AB4764785D" "9BCF20C9DD44027752B68B6BC56086A5C560B0B298E414D887C2A2245D5E1E749B587EADC7" "4E1D56F38231732E89562FDEB93DB6A1ED451755D28DEAC1346F26DB64B0FAB148081A9415" "991C12D34491F3726B6B679F9183D5EE9C4F8FC27113AC21094E4EC2B6E823317ED3BDE834" "D755794B93B1D7FD00047C57C70435C952DC7DD4283951431BF8930906ABF8950E748A75FB" "6EDBECF3A74FF1F2F2DC3496AFB33C3E3EDAFBA70F76B99CF702AECA0900A85CADB6934355" "93F87B1890FCBC384F759889DB80D093D8D254E12CF11B11A80856770F522E525D68751DCC" "DCA3F47D3CDC955F28F5CEEDEADA6183667BA684EE651812B2FC39AB61C53B9EA421B92BDE" "558A2FE99B52A7F210E8729B15F3C25C212282B32DB27240FCCB595340D2EF6A7659D8CCF4" "A40CCC70777E4AF42EAEFE3EAE0A2EF5386925BABD3FC7346B8A345E3FD5DC3B338B690320" "86BDEFD305A6A259F262C6A333B44F9A16A2CD12B403ABFDA70181865527D0612A391B4DD7" "98079F3ECDFB9EC17530C367F65B4DA4B4EDF4C4581F1E34F9271CE3DBB4C6721654C0C77D" "CB7E5502ADAACC10B91300FFA55F08B787C7CDFEE587EFEDCFDF7F5FD2F16B2E5700E00F9B" "3D3F3FBFFAB17E4D39010095388C87CD6B9B0FF48A40E6CF2DAD68313F307995C40D0F92E3" "21FB58B3E459170B4D8478F6EE57BABCA4D27745917BCCBFECF245CAC01D9D0DE325D1ABCA" "BE9130023E86FCEE81B9D65C099C900075C8853215CAA74C86A78ABD0F66E685B0BE4AA642" "6B098CA0E02C4A7A6F2A04CB70814C574B3F97344E19F2E8963D1FF6FDEE1AD0897BA9AA03" "4F4DC392920C72ACE0F025C0ACC7C2578AD509778ADC19C00720A7698C37E62ACBC975DAB7" "A47589B6A859CD008E3B9F050780CBB59750DEB6B6B537E95CA7D77EF6BF22C95720BF815B" "1BE3CD10530B92FEF90CE45E254CC6408255FC001B946F83427489FFAB8186684D1EAFAB46" "E5CAF83F3E7DB08787D79F26F70A003E3C7DB06D5B48676739010097D8177E4F598AA14F1C" "7EFCDDC41567D2373E575EFA688472D629B0ACC176D27CC6CB5E1B75CE998ACA3896835A68" "31BE507ABE03957791D046EC9BED596B4C2267836F9D33360D640BAEE9E3EEF92F54FEF57C" "B411C498BEE13AD27E1ED4BF45785DF169BF6593D36E843EC8661E7AD2C77DFF211EFEB834" "271B4993865C065420626297F26FCD5EA9B5C7C85B9F592B52FB8881C76064C1BC73392606" "57CD664EE1794D89A0008473F4D78A116C0B95FECB10C08E92C2C8790FA07883A4C5278BC1" "F2B33AC7BE1F317C3D47403F3F302B3492C1CCDAA12541100383723E43860816CF703FABBB" "2E808FF86C70F84182C5B0A7F74FFBF6F0281A8DD75A6E00E0C3DB003B5F534E0040258C8C" "EBBDF039224958638BC10C85E919187414C142181BCADCB6480E64A8EEF654D8F58DECFCE8" "F3CCF0FA98F247FC214CDDFB2F4A7CF99640382B352D023BC391246A64F754A8E393EADF28" "17424944633D24A360311DB63333396D896F1A2311ED82BC953D4C71B0DB16096484028832" "D9501E62841A62FE19A2A4535EE1821A82262E9AB40AA2A2E0B04A2C7F707DBCFCFA01FDB4" "28E022AF784CC0099EEAA9AFE67DEB752672DF6618A2C956E470BDD917E3A660D9DA7E5E2D" "F1C8DA99B700DA48915CFD4DE9583C0D72A75FFD2CB60AB54BFF7F91C6B3A16D5B1D610542" "9821A117B5769E70652BC0CCC3CB55064ED42BB9B3F68A6420D274684B76FBF8F1E3FECDA6" "5112AFB5BC7BF7EE36B21300ACCB0900A8C4BEC715152B490FA13085BE8B7B36A6414C12EE" "62D1C59EC969A84BE1B343571021542918F1D4A4226E23587ABA55B21D7A983DF3CD45252C" "442B714F5126F668D6010990B8F14C557FC2064F632CEE04666170B027BB7B1BD358231E3C" "A45F66DE1813A6030C4843C894F7A2DECE0A9193209291B085862E8F09A9B7313F7A9FC716" "DABC9A813A53BEF3CB972340F0EE31EB3B31B9E9B1B93166655DBD0D48733C535F78D72568" "B444315B33B54F90494A36D1E0C59CAE39F41C9984FE610E3C93E5B0BA981309259022E0E0" "CE20B886B4D6226444E030176E043AFB7971854A635FA43F40F49A7539D80F88D1C7D0DEBC" "BC5C2CEC32BDF71ACB955E3CBE7B77DE0570A79C00808A6FBE73D855112FE24075DF770FD5" "6B75E10EF180334ECC2CE3DEFB690F2C07A7641E4555BD9E2B6528535C22A62CB9F6469B22" "54EAEEFD128294C4CAF5B9626E1CBDC4147864D1CB0C6DC59C792E25528180463910A24700" "4AF0DA2A55B5E4BFEFE3BFC3F918044C13367BBEEB8FAC79C175ACBC1AB244EE62FB2FED46" "CD6926B0616DD160521C19D295190C12C504D0C6D4FD5D0CF7E01FE5481864633FA31BAC89" "415FA5A23683B3DA1F21A24737B70242DCD7DCFB36ED6106DB48492DF73C8C5A0AC03849D4" "3DB2B5F07C0BC8E3BCFC13DFA527477A3F373D33FC4239C08E350D0AFF33AAB2004513FFD9" "8D0166B2C566CC54C31D918C317FBEBC5CAE5EF177939CBDA2727570FDE6FAEF7E4601ACCA" "0900A83C3C3C5E385C04C703041831BF2909B73CE5EDB0AA3ABC7943572B8B43DC6D8B1122" "1D4D0962D2C99054D7C2FA84009B30516E910950EF97122B482820A82ECFA10D25E04E92B2" "8B06826E9BA38B7098C96BEBDC338448661B1AFBAED713CFA387AAB99B288A294B342583AB" "BE8CFAB0D77DEECD618FA773A757775D93A31AA754D0DC479D576B8E7C3D99919A83347A40" "F76580D1F461B5ED0A7C1695F8AAF6D24A4FE223F67083264822208CF67B8B049131B1835F" "DE04D8F6757005B7AF864BDF82F771DBB7B9D8308773D86FC02390CEDB966383FA02EB5740" "C6CAF190536D53F365AA48E65D20A36909742081756EA08BF7C9E3F6F0F2F0064200AFE571" "A8FEDF82BFC3D794130050B9DD06386C63490E913F6292D1D7DF2FA40356D57ADD22C8CF71" "1F9220C02BBD78116911389CCE8A2892A3D534BA2E95775BF12C716488510F433291AB5A5B" "4332F54ED01A20B264DBA52919B5F21DEB4D8BA1043FA520B4318BC2EA580616692092C4C0" "664F7E464DFA2FBCF4C79AEEEA6E98AC9B6FA0C37C44992FA86B90EC59D2AFED33C9EF531F" "D994008687366FFF7A14C038F6D2DE65D0F13C9C15BDF747FA11B206E201235CC8E749DCE3" "BED7ADC37BBD404DB913901F89D1FA2EDC6A867F29F631696032174E6E1DEBEF91FF4E826B" "EC19876F010DEFB677373A1B79B1D0D4393077EBED374121353921F349F3DCFE12B0203E48" "7EB389FFDFFFD7FFB3FFE10F7FB0F7EFDF4FD3FEDACAD509F0DB6FBFB51F7FFCE9D58FF56B" "CA0900A8ECFB7EB96E188DB5CFFCDF791CC7F70E4D80782A672189339D7B4AB2B005C53D6A" "9D4413967EC0F8B90256836F4B27ADAA9D790367129BFD18470B60CE22FBCBBDE8A06BEC03" "203E1195EF9CA8BD33E3B746C0D5C1AD3B31F29CA69A3CD7E07034242DC06058C2B88079EA" "4FF422EEAC8D722AB629C798809E7D4E73CD2B4FC610B56F21A185F92CC046500C39CC2404" "020ACDD09EDD5B1C62A9F0836649FD030EEB04C2D18E79DE173B2BB315BA008599B137A06B" "AA65E94F1EFB9EB4108EF929270B9F73F8F3B99045367520151FCF955F0069AD8E2BC2DB2F" "191598CDC478CED176528B0A83AC73B1E99E606D3EF7C33527009B4C30DF346FEC5A34E629" "85893C9BFB7EB16F7EFDF186EC1FDF481E806F7FFF3FD8E3BB93D5ADCA392B542EFBE5A601" "487B519180F2469E2F95523C4E0567783CC017D54C4F8F3287036647A0526DED47A3480B12" "3DA90438474FEF8A2F9E1F0DA564AFAA4C530662203C92ED8FC31F9B96C28B78F5E042EE54" "335917AF21A2C8FE1A9259AE735F9BEA2BFB31F74BB228CE4CCACAED407B1BDC08D5BD2E2E" "1EFA47A53BCDB96186C7200F1EE31281504C41986B933A57BA7B363730406DFB2D31054466" "9E0B8E559749108D0E182EC0A5798250004327C6CFF92F625AC3EE1763755E3767F0873D57" "F393A08DD5C33C26BA0930997566CECBDFA09D72310F8ADD221C8E838E15CABA8DFF3B1DEE" "EC664F3214C8BD411BC03992A1458FE477CF2F17FB37FFEADF5C1EFEA7872FECC9D7536E51" "009BDF4201CF3297130050F1B017FEBB189C98115B14C0282B769EE94C0124F46126AED3BB" "E42C644500C90B996F055C7AA453C99CB52CC14E1F74E0657ECC7F172A0222470001068623" "7A91A6EA87A923A699087A85F4A02569A774688DD88987BB789EAF6746832238C320F77B7A" "6D089F90EA606610168C3E59536174CF77D1DCEB1A05810C767403ABCECC8B51FC1EE3E335" "EF0361C0B802A44E2E8139518E892DFC400EA8FB4EE0106B23112B4DDBA4FE0BE362219662" "DD71D9D0F8DCB762EE040ED15CE60820269BEF68FE026AD7ACCD898B56EB989A5070451AAF" "52FCF3D5BF4447DA0736F7A32AAA87E1F642DF484EC26D0979ACE3BDCF9F9F2F666F2333DE" "35E2E1E3371F2B43E959B49C0080CAE3BBC7E7AB8A2C0BB3315800FC0EC19CE5F78D886C4A" "214DC6327E811D82C01729E7C0D424CC0C29912A3D07C12E32DE08E1BD029BBD9568ED040C" "780AB662852052601A518490BDC8D9B3DF281EBE6AA28C78C64349F345D1DD41DE5621F939" "046F0E816DF2F15560EEBF00A9A6D513D306809E8412F2C53EA449CAE5828386C904FB4EBD" "88062C2264DE7D20B7BC4658341C34F7876684F23BB0BD98992AA79AAD3A7B18617ADED386" "A06B9E3133141553366D384AF675AE421A0A3F0E95DE9760461718F9B87889AA4AF57E3ABD" "D136BDB57A0BF38F3A4BA8C786FA9FCE4AB65713EBF4654D11E6AFA5C6486878F333EA1484" "9BA12A7194753E67AF9C4E1F86D6202B1E0BFBB06DF6CFFFFCCF3FFDFCD34F6F2613E05FC5" "5F9DA980EF94130050D9C33F975044875E585BC1F3460058DD38FEEAC400CC7FC12899274F" "C8801CF138918EA9EACF3A93A38A4060BB88D0A4DD99AE54AC5FF03B242A89F0EAA4996859" "EA3BEEA810C2E41BDE54C52DE6B97C20069A084223F058CF3E213B5ABFC88743F53AA3AC69" "E0C4394B299E9F9FA548665016267D4D6F7E91F583E669D403064FF72B0C861821AB21EBB3" "842ECEFD187966C224299174203B910B1468D76B2DC6FE13E33381C13A023A7FB829B338B8" "5A2758A8A6E683EAC4B3BCDE143E9A7E08A40170AADC2B548E7D5320A2FBB8B33FEF00C0BE" "831DBFC031A7001F6771337E96EBA7FB3C961EFC500120B53803149DA8185A1A80A010F70F" "D024B4B53D6E97EDDD836D6F0100BC7F672F76B19F3F7F9A7E3BCB0900A4B8C7CB94356FD6" "0BE2EB45BEEEF1EBF1FF4523C8EE2D8E801399E61A86B4C4EFDA8D19E0BADCCEBCBAF8748F" "A31BDE67C2DF1F9D1205A548E345B445D14019F92A509208582C2A572F7D489EC5D4495350" "8C7874F890D006288A20D19078163164F6A3406B4DAB41EBCB65DA17778A17519EDFE1BECF" "EB447D6900B0FA3F98A000AE565F69E929E744D05673E9475B0FF993C309FBCAF5C921261D" "B447AAFDE88FD3B7FA6C7D45E0433509D245BABF60E16B005E5A3309134D77A6F57AFE56C3" "66A57BC32952B06F746B9F9A36629C7D9FB582E3D0A43967EA243D0BFC98C0712B5AE0F58B" "17AD61441AB0F00000200049444154241822AC605C97978BFD8FDFFEFEF2B0BD0D1F80A7A7" "0FB7C93AEF025897130048F14B97DC4A1D57522AE3814E160C683D3F92440666795F05AF7A" "05BA7C078641F0E12EC9561DDE48481F66CB8A2B2DCF7D99CA4A9C77CC571401F7FA813DDE" "8F796C1E954E81891C65406A6EE90BC5A833A34B9DAB800A565AE433166807E26297CB8FF7" "178472C59068708001F4A048CED5D7347960BF98EFF48EE9F8178E9015CCE7D6B40B297223" "EF7CBD58806996F2CBEB5EFC1FA92732A6E35B54738F61439B93CF33F3ECAA8C79EE17353A" "FD82A11E2629DAD737897C61BAC85FB3DF969A1F61DD5EFD93E4400D1A40428739AB120FA5" "73DEF86EA3044FCEB904327DF290E8D3A195C3650F099F80C74E42866C725E28724076B397" "E797971775777AB5E5BA16EF9F9EDEC458BFA69C00808A9BBF543CBD289F17A96FC5A90D45" "F9EAA887245AA3EF57A57F0BD33030BFA8536DE500B6B71E30F9440898F7F8A33E0E0607A5" "2FE53A534A07252EF8E354CFD0180014293977F28D38685E88164198FF6D9C3B7A1060E800" "6C30BE86FE39C001883E32EACDBB4198E8148E88B038BDF23694A948C63CF4314433D16784" "FB10358008685D6E539AFE01999868E2A4606AE2154E7B5A3612F5F30062246E0E272A7217" "68AFB1B4CCB025FB17F28E042654EA3E022CD54BEC075E6AF4D20EC958767FC049335319E7" "CB7C45B1B3841E72D51F9C06C788027B7F6B127BAAD9055F6C381F9D50F054C74DA3B7D10C" "E23F98D14DDA49C0E3421F6843D51CA9635176F9BBEFBE7BB94280B720155F731DFCE637BF" "5982F8B39C0040CAE5F2F2F2F8F884B491C5C408A9579999E6F170A2F3C0C117D5E4E29D7C" "35C9677425C120056C27EEE155C23FC090D9D9ECF84084B4E5CC67AF25ED65263DB161DD04" "BB9EF0C3643249468EBF83BECF770EA646779B9374C7765CF4870008115FF5A66F6D320D00" "66D015205BEABC3EBA5635F6F66849FA2B862C190EA39854859E0EA7BCB469E74CC9BC26DA" "4B80C1B6FDDA0F3D7C510106FB84C089AF46566186CE0B31365A307A910905ECCC9D7A5CA6" "334FBDA554AB6A06C3F2433520AE2DAD4D478F6B296E63D918202AD3AFB87849A645793A52" "BCE63DB8984537C601414C966D67635EAA4F0344C81D0B71F80C64BD95F39FE69B7B12FC91" "7E6B082BE8D223C62C4F4F4FFB353CEE2DA4027E7AFF644F1F9EBE4075DF7639010015777F" "5639C992CDD1F5BE4A153A0C801D909C802A7399883D13112D74DFB5EBA99E2CEF6730E989" "B1516D9D09A624998465C60C7EA7AEF17C6A0EBAE643E602C4B4242CE75BED12340088205C" "522DFC18874D5275E63BAF34BB5560DB15B57A818C31772C99D344749F04443F64FB2AA1E6" "BC566F1D0C128E9F33500B6A4B731950144136589EF0401B999867C5E0E75E8D6AF6A8FAB0" "77288C8FF68BD37E1007D2FBF888806A361A376BC6FA71CE8B41DFE981900D0A13D1B1EED7" "C43B3B995060D602A345B7B06F6B2DE95E8F7CCD65FC2C5027930EF4C537D937EB12B5179D" "B56502E8C827801D7EA9359E9718634F4D80CC570D7CECA9FD7868DB7032DEBF7BFCBCECEA" "2B2C4F4FEFECF1E1F14B72D79B2E2700A0E2E69F417D35F106CB364E2AC119028C221C7CA8" "7E07210A39A8FCC2E45E85920C35D38D325B71681E601E800C262AEEE20E51CC70E5922037" "FB6567DBDFEC4615C9B4BBD304038394F007E7770CAB3A077346A64DA6F9A37E252F2CE9B8" "0CBFFA0E8F3B2255C093389FAD97031F06C661782B46D6A735E841802C78CDB767C979127D" "27ADF81EBA825535F6A9118010A6471D0BEE4F8B7AE87BCF597B21EFB7D123D045A4CEF2E7" "88C698EBB580177EAF303F71FB96EBC052F6A135A9843CDDD4C2EE7704BA70DDAE67FC2A16" "A5E61531FFB5B7E9E6C1024766D44E189F0493EFC82BDF5923969F88B688F62BC10839DC56" "D6CBD97190A7B07ACE676BB4F1FDF7DF7FDEF7B77119D0A74F9F90ADF32C5339010095CF2F" "9F3F3F3DBDB7979728465FA5DDAD2DA981D7679EDE255B5DACABAC93DBDE0F92D0BA9AB740" "40844A53C4E0347F38ECE26CB7570BEA51361799438748C4D1482233F3467A433B530C456D" "A3C7740E3647F9DA8BE98C67250DAC48B749B0292D721F53A03FF7ED8190D7D968511E154B" "E08088087C3D482D8D3555DA5C7FBE9E927F39E11163E5E43F63B0C2E923BFAB7C0109FC54" "937148ACEB38841BECA11C00057683A46606648539C3C81DC38CF688917A3F74071478BE13" "B088F3626DEFF6F96F8E7C32FF998B60E27174E2C6BCBBA8E35B444FE7B3B45FCB74C06037" "BC01DAD68149702086CF8E7E04F1791099086CE30967CD4D8D9FA6CD55CBF0FBDFFFD5CBE6" "B69AF957573E5CA300B6C53A9CE5564E0040E5FDE3BB97CBBE4BB63DD8F142A89CF0E92EED" "4BF21E3867A92376CFF2D5249EAABA252229E2A8170D1543258679FBB0DB54E7464C8DC3E5" "C220DD04F7A91C8FBA5395321B75EC87E31A4B35C70B5E5226D49E3C0DA35EB2FDFBC4BC9A" "84235C86ECD4668DD2DD277B3019003D89F43D3120B40B9302994AAA9F7BD3FA34665E6040" "3DF1CBB62F6B4CFD258094FE13D51E8F35B756A47F81664C62B0817ABBE8DE0C2D9ECC4E41" "A9F9FD6977DAC7CADCE7CE14A8E4339340A9EBE7792F94731C361CFE1E9A8DBCB18F32FB61" "6F77349F6B9AFD4EC7448ED0198E7C221898869D6E0A2CEA895B13DBED02A172E623100140" "8D845E16212683EA2F4DE75E3A865CAF6132D9E3F20FFFF48F373AF7166EC83B9D00BF5C4E" "0040E5F9F9E5E5DDD561E4A539017246AFE9AD5EF80930B210152BA3F5D0433E2380229609" "0682E2F7951FC5CCC4168253B5520C43B3058AFD9DDFE9DEFE8918987B14ABF01A7B7ED7B3" "25D46FC518A222D340D729FD6A8D2B011588B77569528DF53C9DF7214028B19D42D056CCBF" "31F39B309E4C99C465C4E553252B75858FA03EAA9B5D48D99BBF243B0ECFA3D8C3CA1628CC" "620ED163AC84FE4433732D3651DDF9C08C1F9A07F6B3605EC35118D97F4BD0C33E1D95475F" "E7B9CC707526B127245DAF71E738626530E68D9F53ED474D4449E4060F20025C87C6EAB884" "EBE6F95F7B92018F132EA0FDC2A5FA0D70923E34C8ED40E74DF013E624238EBAE6C08140F7" "0F1F9E2EFB1E6F422A7EFFFEC93E9C4E8077CB0900A86C0FDBE5A64A0DB6FD19C5061F0572" "3149328DD1A5D72F4B3A5DE539B359077169A8BE2418795BB7F53DC676F7FBF4A427E6BC3A" "284A545770456F6573229C754F7B3E4997ACE4DFC6495190B3969CB5C00AAB9321B239C096" "99A0FD628C2DEC4ED68F9E2EE99839D7527A705CDA432AFA54F717EBBE3165756F9CFC1374" "B2D1EF7A68893C5A8E7D000C919849231077EA91A515C546141349A9D724CF00B252821153" "FF68A7944E444C5A2A6C23AC0F591F21F56FD4AA136899F3639878D1B37689BCFC3BA0EF77" "FF5702FFADE670614FC09AD34FE5F84A9C5AAED40ED2336C2E5A83796360518009A3819740" "156DEF4B39E6618FCB65BFE5C67F0300202E9BC5E56DE43CF89A7202002A7BEC97620C1EA5" "22E30C62AA0E1CC539155A4600C90320BFAE4A46FC7EB424CCDFF8503B204439578935596F" "5E4B41A754F03323638234A11BFE130F8A1C3F49102BBF243789A1AE4A0DF64CB6B8A40FC0" "D449BAE8A46CEA96C4D5D4B6CA4276F6ABF7871101AD10560A3912D84C52D5045F951390BA" "C60539A8746E6BCA7CD7A008B1E62F830566EA0E09B11827EF9D69ED97D677597ED8E113C4" "7533CC9CC4A89C000B28E08D0211BC30B9172264AFD08628415CFAEB36A975057C36BBF8A1" "85C36D96695AA9A8146BE62A3A63D51FD76D569895D5FE915904BD708B9C19FA4F02F005AB" "2649DF2BF575CD7B6DA9D0BD5ADFD39E4B7A5311497679787CF7E26F4403F0F0F8640F8FEF" "A7EFCF7294130070D9E373B8172182C68D6546FC2347772246041B00CF2735386ACAAA5D6A" "50EF32284BF39FE54D78062A51D2F6528A1DD53486CB123FFFD7820918BAAED91155A55B5D" "31526182AE136587F467DEEA08963221515A9A0148E45D69D58D2572327088905F5F34DD40" "73C8635E0EF0854B99D2B723064A3B24E4CEC4499235B2F16301441AE6DC0145F4FDC84CB1" "A7E4CC925FD798B4A50780DAEB67A7776533D024CC3B08F90E729FACE458628FBA16C58849" "35CFFE01E302A5C95930C142316EE27FCDD720D515D926A669DCCB9FBD5BF9037052FD5A1B" "1B21851BC1A8068A33E35F5DE38B79E0B9F0A4102C504420418F7C9FE39AC376786F9B9C3F" "D5A65D2FFF797979F9F48FFFE51F3E5D2E97379108E87A19D0E74FDF4EDF9F65CCCF390F28" "0F0F8F3FC6659F1DD71A2108C9193609CDCAE227F1F18E983C113828E5830EB2D1A5272C5B" "719CBA7A7FDB24B7AD4AD9103956792A4C7884C53430D4C4A494DEC94CC0127DF178B1E99B" "30EB62CE42DC3996FF10C9196330071081B83146F98A25C7BA657130BA1D63AEF4BB5D9A0E" "1340E214C6DF55FA4CD8A37042C83AB13BA1AC6A1CED0B8849A7C172F85B2CBBCFCCDC69CE" "13007670BBDE39532D833FF27EBFAEE2C898481759699B8054BA30210CB2785F7ECE75E23D" "598EA779E3DEB08F732E25EAAFA6C426505973E514BA978991384C506D09A901D9B27F1976" "E8E9B71FD35E479E0F3225F2BE9094D9D06E30CCEEF36404096A568FEF3FFBE3C3F38DBCBD" "854C801F3FD80F3FFF643FFDFCD3F4DB594E0020657BD83E25B1B0925883003720F91CC2A7" "4C9333DF315903F36B62347D167B6112B1D44464A2108AF9972CAA5DDAFBC25F5C20C1ACDF" "17C93F55A78BE7E5B122D024E5B00318018F3E7F151B5F36E3D1AEA42F6E6D6D0741EFECD2" "44F3425492CC36D50450023175F439EFAB97A885CD9569A64360BE9ADA98BADD167D090F9D" "E45D3A42EB40A392ED12ED77BD04C884279023A0470113019AD4628C3B0DA26B9704CCA006" "764A3B4AFA486C48559B261FE9E1AE6A72CEE7C0D5B1883F124A787B008E720474DCADF3D0" "9D9A874B8A9EC98C72B8A61AF68C00100D9984CEF4D9A8919756E77686373CD51306CA1956" "ED017A45FB98B55F8A7C473D04B26DBBE54DD8DC3FFDAF7FF7779FAFCCFF2D78C67FF8F8D1" "3E7FFE6497CB9DBBC2DF783901009597CBCBCF57955197AE4B1D594C0F4CE446FFADE5F216" "E90999EE8EBFBBCBB5962284D9E6207A4EC402D7C426111A2DFB3AEC6F12AE96ED139C11A9" "8488530EC1004018AA70D8D3D420116FE776F23DCE3B40540FF398921C3141D618D0BC2A59" "F3FA67F2C417E269143FBD268CECB4C67978A00217150C49681454498CA9096CC7BFDB507B" "17A0389C0DC5B171E193600191DF5BDDF81644B0A4E3384214839807BCF3F37FABF9683A01" "4A4E550E7CB6F63D89548D8FC1E4D295FFC04D6B22FA1F19BB55F2A47623A5D1860D9AA84C" "7A35FA0DF979431B7167B39B3A0C46F47DDDCE0D3BE789FA9E6EF3236DC32612FB4834B451" "3BEC407BCD4618228A288890D519276B00CE0419FB257EFEEE4F7FFE8296EF75952BE37F7E" "793E6F03BC534E004025F6F8D94CD59F45848974A82251B38629A3777A1BB77129B1D1228C" "44E899CAD5EC0D10F9E0BA4AE681F71C99F5F16D03D16E8886051E17620AC22CFD0C307F74" "4F130115F1AFAFF4B6B8B2A5D75C2F7C1E6C969A4136A90EF611CBC219E1E86D2416822A97" "3183DE5F0350C163613345FA95A4CDDE5B9FCB04505A0262DFABF14A6FF9C63FD500606C3E" "F2FB1F6FEC16B4CFA29A8D3D089C3184E1B9EE4C7D9C8C4898C1E094D71F3E1EAD97951A79" "8FFDAEE36A4E1432E9F1DE4492286FEF86693EFE4AD5CDF34759FEC210080067D520FBBF5E" "D0435D6BE62ED2521069B0115D143127A9B9A57876BA98A8FA480EBF0472BCB415782158E5" "715B91ED9607E0D9F64F9F5F9EA7365F6B797CFE6CFB7E5992C5B39C0040CAF3F3CB0F1F3F" "6E37D258A46F4203E0A641F7816781A021C1F285E89D09D52FEECA1009A90888A8FA88F94E" "B22B7DF30B0C449BEDCFA1B3CE63E276EECC13DBF92B3B9D6B02997A90C4E272AA2BC84549" "790887054983CCC4D82F42E7499999B3E6213B40698A8D9C40BB2F85F8F631232F40E0B230" "219F5BBF7C48E81946489A8EBED43A6DF0BC4FE6372D1F010993796CBD18B1FF0504C604CF" "971AB5AD9592FF001FCBB9AFB038CA0F1C88AEABFEAC9B187331AF27246C44EA94F09C60A3" "9991D26350657DFA9459046D48EEC9EC9DF65AED4948DAB297C69CCDCC7D080B9309D0AB8D" "9B6620E8EC13C0E170DAB101862B2199239A7091CB7705169B6F3F7EF3CDAFFB0679B5E5D7" "BFFEB57DFAFCE94C0474A79C0080CB163FA83E2E0F1D189EB3939883F86461E71DF10827FA" "632431DD2DE330D7B675965042D80C984A27D271DC173E49E0F70A33764A04C32FB226C0C0" "CCA40DCA9B0E3528A435A701B1145D66D5024BB3E4996D696A5CCC69F23A52BA43824F06C9" "F575C270AB63D7818EBA214877D9B5958C7127E9D7AC839AA1C21641BF0106E2DBFCB330EE" "6A82D77D5C1424DB41F7C634EE7CCF2875F11735002E73E9C19087231F1200B719232C951A" "2078DFEBDF18415EAAD33D107CAE3B01E24EA6219192E94E8E8C0800FE53DF14B6FDD0F043" "1AA3610D27C4D9C1D0685FA5DF03C05ED28A8D45790625845AE00A0347551009DE4651CF6D" "0FEFECD3A71F7FF8C77FFE177B78232AF11FBEFFC1B6C7CDB68787E9B7B39C0040CAD3FBA7" "EF830E144BDD66ACD6A3AF4B1317A25FFF92862D2526D1F2F6E75BB6BD20627A7B2D8986DC" "03DF8A041C7C2904D101700AA8B0C77D777C24F650E95399510459240E692628831B187456" "3FBE23F4846442CCAC48D23180219690A1F9E5D4CBB3E73BC42A064620F6D43B84D9A5873D" "CD1C780FF976F0257DF44CB4CC8B29EDEFB509C6DF944AB8BAD4FB5E5F126321A0691219E2" "C84DB02A3C81946B0218683118B6BF1BB20D0685309A08DCE8E7A4012B10D9B5311B8636BC" "F6E44CB6904C2EC18DE7DC1247EE37EE89C98BEE0660662B2D0C00B1513C90F6016D736E7E" "DA7662E2AAD977CC475FDF9AEBFC8B6802CD2CBD92A0170EBBB1C7F7F1F262F15618E2BEDB" "0F7FFEC1AE618F6799CB0900A8B86D3F96877E94E078148940039300584FBB611091847442" "C21C39FAA1EE2A44185DAB9AD4E23111E7F6421B1D3FC76C5B2F7D419AD5DE99194068EA55" "2431D2E868F01796E652E24C29853DD4BD3198EC750B7BEB7398121CF500EBD066859DEA78" "FEEEE5DEA10AB49E01E784C9AB2EA63BFA07F5EF88731FFBA30684044FFA9EF6AAE63068E0" "53071B735BF0F2D54C94F68AB9ECF83EB853B94E64E20028A5688F64B8DDB784E75ED00E58" "7BEC0908296D4E4663E4BB62D36769995929656E206ECBFB3EB5155DED5E3B7A80D92D3329" "EC4362DFF27A66CA4DC108AE45C248944B8227F11860847498CC763E53ECA3E17D0D09A001" "C75C7300D8FBA7F73FFCCDDFFCCD649A78ADE5B7BFFDADFDE7FFF29FEDE5E5F94D8CF72F2D" "2700A0F2F2FCFCE3E3E383D22696FA2B1A80E857B7CF175D1C9C241D96C48B5B19A41496FC" "CD4A22357A67660C46F7003029D09030F00765DCCE6362C9AF8521890DB28F2099E320662E" "4488582CA708A87F572A66E5075DCDDB34DEE55BD0E3D95BF76AC6BC5D88B4A7DA3BA2DDFE" "A7CE7FDA2024B8687F33D7EF10CD8C18A63CA0DA8CAE15B879AD3B220222BDF819EB149218" "CF04C78B283402B08CE35EFD554648F5742C26BE734A67BAAE361525BDE47B91F3977DCBEF" "E44E003072EC1F6C881860409C34DB9CE5DF73440BF66F0D3552EA37D2A621222101463605" "499BA2610850D80248DCFE2865C19CFF4FCF5F0CB73D05C3467E14398F0511266D072E9382" "A6E1D6C04FE13B8DFE7597DD2ECDADFB2C5C4E00C0C5FD730A0E7B119CAB436E4A011AB12E" "926377181C1C0426396FEFAC0A08BEB909932D5F82512F52AD124356A157D5ECD21AE7E3CF" "8793E091942E52900216F4C7AB010F483E0002D937765422C5421150386CADA476CA867A57" "C02DC7AB194EE83C5437559AF2462A928717D3A614B2320753E9F08C5A8F6E1F00A0102629" "EFE737FB20EAFA7DF94FD6FCE88E8B5A83B5935DC13A56009473A1AA2FC06FE7C433C53765" "CE0E29B98F95F1854AC4D6E02DCF9DA6BE8E9D6CE1C5BC93CF0DC99C45E049CBC093903E01" "5BE1BB04348573AA1D96BA710B634510DCC201B9726FFF1B7F1120315E07C35302220CE199" "FD3C0B527768F5721C578DC5D516FED3CF9F3FFFFCD34F6F262CEE16F9F07C8601DE2B2700" "A0F2FCF2F2F9C3FE14877E8FC9E786CFE116CD1EA8A97021421D877713491274730505BCFD" "45AC6C50BA2272249D69C453673A7369D6CFE3AD85E39185CD7713B4FE15B96E59D68A9901" "1FD44D65921E75A2F5487A24DA83C9E92FD40C30E643ECA0B31618E1518BF04371A59854E3" "31C18A29A5BF81910755C27F9764B6B43370281F49C1A6E35005046CEAD2AE91AA85EF87B8" "F9BA3660C37F936F01FC1330078961B0979B8ADC8F30BEECF3EDCE1953F4C62C51987EDB66" "5D85ADF76BF010696552F1C64B4361712A75C7EDA22680420027681DD27CD16E1A2481DBC7" "4545BC5F0112185CA94623E4FAE1FC0EC05976568F262033DE245A24082F95C558C73DEC71" "7BF8F9E9FDD354DF6B2DD7B13E3E3CDE01EA67390100957D7FF9C1CC7E0EF78F57CAE5E92C" "44FE7D72D89A6D6F7C09CD411DFA16036C9D02D2AB06627148FA6ADBCCDF396D2C34035677" "D1DF67DBBF5058D45E110956E38A946F65CB17065C01E2A4656066536ACC4640859D711604" "96BEF9490223C42427699AC180FEA1FF72995401901AF98B34C3746B40C8B3008053763DBA" "44671AD788196FBD1EDF83E00BD3EB9025255DED480DAD46718BC31FEB57371936CE6B3C1E" "F87EA4B321C24513F8CDDE8C392D0C62586A768F92642B3C715102DB91B42002C52BB77F69" "1B022784F717DBE6AF956E75BE7BEB9109FF1780DBE51340CAA88F003640DA8E1C05ADFF66" "64CAC8F51E20BAE811A125F8F760DDAE63BF6A007EF8F1D39FFEFCDD9F6E39F2DF42D92F17" "FBF9E79F4F0DC09D7202002ADFFCEA57DF87C79F3DE26349A29EDEBE8C0018B5A304250F81" "AF003946B114F265BA813F4A8DA7F64E90F110E27A5FBBA0A54B6131881C5FD56BABBA480A" "F3F635C323910CAB311A74753F487D1A043052E24B26027A36B141619CE3D70267783125B2" "B591FACEF7A6EB54E60A4C50F33588755D29F5ED141EC722B029F7E2AFB9ADDB6B8D892718" "72BADC27909147C610BDBEF16DB72127B84A4D85629ED65F8C1C5A98B11F58B1B47318EB48" "AB9CA1991DE019AD664E46326E713CADA9656D59531DD49CE6D8B4DF091CB64DF73AA02A03" "7A5ACF04F8C3F10F4F079D53D4756C474E0C845398D32A5DA8C131BDF0DACBF97DD2054410" "A839B08EC27EBB10E8BB0F1F3E5ED39EDB6B2FD735797CF7DE9E3FFFF1D58FF56BCB0900A8" "5C2EFBA78707FBDE36FBD71633A1EFCAB6957A3CCF6CC8D32CE1D083AD74D42F0F338850DE" "B7880CE04E37179894CC5B3726619F184204AB3117CFF6F77A0214F1B6EEF67C274CC144BC" "4D1313346ECF31469904F3CA3D90AA7D615EDE4113CF1A4B50DC96E99E30F071D4032635D5" "10AB4C8414E2E9FCCCA1B68DC1C40F0938FF18C0497865CBA960E34EFB7D47F0456857FAD8" "A6BF635E87ECE26DEF4BE85FF2F59E88083111C796D8A176A8DF8DA4F2A13529338397C321" "1453DBC871D133FEF9F0DE09D11099F11951FB1D98F1B5CDBDFC600A66138E64605B3D2730" "1C940D34A316E41CB5A4E1EC7409B7D9919892E50DEBEB403D89F9195BFC7DEDDB65DFEDFD" "E3BB3FBDFFED3B7B0BE5BA8EBFFAF8D1FEF8C73FDCEE4138CB5C4E0040E5D3CF9FAEAAB13F" "3D5C6D46C37BB4DCFEC8014F997B53D525CB27A9B7D81A33B02E511879F2062A28E26849A7" "5A685668DB5A10D68646F21F2F02075A45120F8918E5A847520D3D0921A911A328A21F883C" "48E65A89025A940419F659A6BF7D4336DA9A0FB1FF6A3D5E13ADC33FBEE654B7479EF63D99" "AA4C187100D1EDEB47012AB66E2F677DE787C6A536898C4AF26EF5A423259C087D66B6C2F0" "6C0205CB7ED57F35565DEAED7590EAB9F6409A208A7BA704CE2F3BEADFB5531CD960110D44" "53553BEF1D808692C633A6BEEA8821593B726FF4292B1F1ED6434CBA2F3E96A3A7E91BD4BD" "FA116A28E030A02DC87DC7861E395FE2B74068C04995423E3A535C415B33BF25027AB07FF9" "E377DFFDF0C30F6FC604F0F1C347FBFCFC7CBB0AF92C73390100954FCFCFF671DFFFECC5B8" "4991E79CF023FF25263DA9084D8993D0C185081D52F11471C0525E791B3760B1A2F5BE439A" "E0268A6DE66F2242E33B682021CD14D34FE638086D1159E933FECEB96009D84743E5FC5620" "81C1C8787610D00A770CD8CDAD98086CC7AA1540B89A74AF56B2854B0967A3A7F99F019A34" "0B1F2ABF25E01992073BF7499442D9C0554229CD8E78E147690C829826E687E15113DD5B41" "A422181070984F7D34EBFB2BD1ACCBF464E7E183C1A16C58A70A1829D539DB3D128875C73B" "38BCE28ADEEC6F8672126C4C9F12BADA228EFB961A708216C209F8021ED6CDC0C4A2371C10" "D775E7CFE50253F679930719486DC089F22B7574F825618F4048A06E1BA9100A4A1F30E1E5" "72F9E3CB7EB9393FBEFAE266CF979729A3E459504E0040E59A37FAE1E1E14FB85DAE1F577C" "CE5357F7C82CD500298D0C22DB844829AEDF42EA25924BF1EE2BC29E5EC5E54C37A54CED32" "150F48C49BD1DF861C5A1C948405060853708C788D37EDC2876985D84ED94521EFCFBE0880" "2C4CF867261634FE622AB960D186C07CCB71591E9B24A6891EFA591F0E6F392DC81E0C6997" "3535C5962BD4A08BEE39EE481C2465EA49698BA0416089DE6446AFE604008CDC1B7B2C7783" "646494EFF3B768FB553A070D4431FFE69F6146A02D2B93A65CF7039D4506BC3BAFB9B49E35" "D78372E73E7B1C08F764241FD148007BDD53D4830C3B2C3602EE72A6134C1C7FA79A9F2F0F" "8A8201FD34E4D672440ED4B46988725F079CA3AB09E062BFFBED6FFEF09B5F7FF32618E2D5" "F1EFAAE9F84FFFE9C7C9E1F62C4739010095778FB7C3F76312EE528FB3B45F977900E15B92" "9BC04146163FE8E061B36DD983EE149072103F71F431A178CD116E014C9AFC9F2C7C372256" "356632450C4917EA7C63168C3A93D9B3E7573E43A085C935CCB744C229DC514C1ED6DFCF39" "26D697F3F3FFB2F76631B664D975D83E7133F3E59BABAA6BEA6AF6A481A65B2D523F064D81" "9464FB8B80F4A11F0BFA15017F18300C81A0048820204BB00159FEB0448B143F6CC1B004D3" "063DD0B24C11A269901607D9B09ADDCD5964574FD555D5556FCE7CF972B8671B1171F6DA6B" "EF1359739788CC38E8AE97F7DE8813678AB3D61E4F08C76300E67AD2464BF766E48EF6F656" "3F4777E4044740644C98B769012CE337AD752974BF0462002F8144258C0CE9895615000020" "0049444154B97648351E5C041F85F65B547833F02C069D3B98C1E37F5EE363BC3FD785758B" "61D6504394FAA5D559BD2DC98FA2CB8C89CA94D63C79C80749DAEB2A12AAC7D2B7B9719867" "A93D4AD4252620987F4F5EFC62EFC9F461C002718AC0A19A0DDC53B8A252BFB1AFE002EA4D" "1258F2D0D8FB7A65FFCA93EEA20B5A46B5FFF8FFB73B49F3329795005079F8E840AE5FBF7E" "6F77F7EAC49623E824957CB2121642007300E293F342785177F7729941890ED609D23D0194" "48004D07D6F3F3DA860D268831E40E479230633A3CFE0D448454B904F259CA288154D1A66C" "87FFE470BB540F45C47B0343AF22A847605C28B8B4399AE58E9B806BC407A903FBDA7C7892" "ACCE8E86C33067EE3350209F864A60CAB1F7F3A3E9B4003EF6D984FAEE48E108F6C1212D40" "621B5BF2CB0B24414AD7D759054DA627E6B35126463D22BD4201EB3351348FA34F1AB30670" "58A1D49DF3A4D9486CA2248ED6C207A34C5A719B91BEC6EA44163B01BD2F257F6B033360CD" "A8693E82EFC27C52E830A8F0BAD3853E9B346FE42D9A1DFB16171A83511A1ECD51AFBFF6FA" "E19812F83284C58DE375656F6F3E60690D035C2C2B01A0F2F0E123D9DDD9BD73E3FAF5E9F0" "8890A9AB63D86539F7FDC8E48DECB394CF0E70EDB396BC61C64DC09F443F5B5D1C6F2F1277" "D776B1259DE92A4CD5118DE984086EDFBCD1051F682745EAFBA3629313A8FE991C84BFA1D2" "2C1853216FF03EFB9FAB6D8B6667B95E6DBD543C3CD10993CF621A1406D4B2F08C84F7313D" "2D27C9A1A37611CFAF5D25A4B876A347F1F5334511B6F3F295E797C464E48508D90E63C72A" "F9A7B8DEA87464AC5F557CF6BCF72D5B36F82C80894C187E4E7DA80B43C78BC3EAF0E75684" "D852C481E53A201250405A8C907ADFC2C42E69E1EC1C7E8A7230939B875A3201EC690F03BB" "110C73B09CBF1AC21D183622D619B00AC2572568083C911091F23057FC84A91C5EBD7AF5DE" "4804CE234D17A98C63B8BBB32B078787AB06E09CB212002AB76E5C97DD9DCD5D386E513AD5" "4CB4B1C7167E99E3C6E31B41BB27834507CABD94826F108F4D26862E608DEF638D40C17D2E" "B364682F544F5FC236623E007D738384C939E2A3C6829CC4A81F4A3D3229195EE13618B887" "E0D3BE37C0B136D2A8320CB86A3B4E4867F6A6C8864EAF407815BCFAF1BD7A3F306CD9D9CE" "6E497A8385DF844E0D34FF8660E6A06C550E7CDC565E212C69FB0A81932239F0A5010CEDEA" "BAADFC81DB41EF0D7EEC2318541CD47361F8662D93573D3B521AED3A87CBE14A88EC544A03" "7F6107C310CA476365755AAEFDC0D8FD89EEFF9318252F8412EF999E5DB5590D967210F463" "B180FFA12D2DC4F1DEEDDB4F3D1C264D543FC617AD8CFDDCDBDB93BBF7EEAE6180E7949500" "50B976EDFA9820E39BBAB05858192062CEBFB429C05D5E5BE66DB65B07E45A7C4F63E9AF30" "6737681DCC56692C2439C7C54DBB749BA5086FF4C98188488E49C79CE824A7427658498E76" "007ACA54D8110D4E5BEA9BB30BD104BB4D25504253D95FA0531774CFC27D43B40B023812AA" "999367F001E0FE2BF4B54162E679201EE6CE71D662B58C93E2C1EF9A446F16F059930FF017" "7660F07ED9BA186611DAA78129919B9944A40F2D1477E2E399CB9C60284D3B21737FD80973" "C9068B26578FB2CC0337F7B5A515B6443F84C7B06E61EC72EF08BF99448C67FF83601280AB" "DF13DEA7B076E3CA8F92B4C6DFE9BEF04BF174E205E44BA0B940824146FACCB1F9652D9A9E" "AC183FCCF850C63C27771E1C3CAC97C9217E74EC1E865ED45ACB5C560240E5C1C38772F5EA" "D5BB57AF5E9D9398A74DDF24D268CB6E1720656F49F1FC4912CE76CD2489286D40F9951638" "179A6DD0D160AEDB25DCB8DD6A575F0015497F98B09E7EA8BE9DC4810BD2093F23AA59397D" "718CF3768252DB78D8C142213581F8B8DBCE1C246C8900D231011E1137207B5D9D54C4B4C0" "06C57FD240C2E23D3EF5ED335F83247D31639DCDA7454B58D553C4568B9B0F6614619B7FFB" "9DC6098F6BCF83A68409C9F8549F58A9BC28AA0F68111F7C1A7E27685CA9391E92A6C23AA9" "BA706D221598629BECE984466D2600CEA047F32E7E1897BD43410BA6DEDF38CF0ECE1EB550" "30BFBC14407395B40513C12A18678A16F6F614091440B565162DFCBB789FFA57959698B314" "3F623933F242DA87601E785036E7FB4C5CC45286348F6B09652500541E1F3D1A4FFE7B24F2" "14A14993BAB1AB30BB76110409390259B08D737E46360178E6302AE1E5D720B595A6E6751B" "6FDBFA60235C58E94C5C5895991FCCCF4D12207B71770E52CE58E6AB8354ED15CE125CF231" "608EC45532B2853EB8173D4B9576484CF687B77B6322243BD12FEE0EA6B0CF03E7B89E54DE" "8C2B1A6988030939EF4576E292B7BAD41E1E91D70CF21D1448C5DC3FA729A581B876EB1040" "0BDEA8E9F738DE794DD02B4100CD05819D6D8CE87713F975213FB1CDAC012A13B4D00CBC09" "CBA1134C48242E2A8F848FFE09F63966A4547FCEF4F7400FA2BC1083BF1BA5F83A34138231" "2E8E1898A7921BECFA017F3D8D6ACC65A0F644B3898696C6E21337DE33FA346D36C3C39BB7" "6E2FEF1317B08C26802B57AEC49C206B096525005476367BB23DAB77B6DBD14B76E3D9CAF8" "04409632C4C1AFD097F6AA67DB60D1D283548AE9CF52776187A6B04D1B1131956DB78DFB65" "A9AD0175C3464F3B3E498B11F0BD93B6C9520FA152B534A55C57E017445EEC0F1CCBCB6A68" "F67BE03C08FEB4D8C69286C24C27064EDCA6341751764F21704B3B48CB678F8E589F30CF71" "D612FC931B7BDF6688E0E88313952009DA67B60B182CE48D0F3F73B89EC634C825CE8F88FB" "2ECC18AE610EBC6A0D04D14999505F4B4B88E484C4C2F69ABA84FA9F47CBCD09FEABBF1B19" "3443DB422218F28731A2293ECF21D470304D54756F7E9594B09F8096280388611BB8CCBB15" "897FEC3D8E6D9E4DF66D0F69927C45D6BF6832B081D652BAB193361723189E9D9EBD767A78" "74793400AAB279FAA92903E25A96CB4A00A88C2932777777BFA92AC7A5942BB56D4E03CEF6" "A6921C8382946500A5F1B6CC43BBBCF2A849DCD33AA9905D7AF3A43FF95ED42F9970885722" "04EE8974D865D838019AFC7BB29D9A245A48D959480A341B79E62726F52DB5C9F897488C68" "8094E7FA6E3451DDF6CC9D296D93ADD5F3380409550B2477D650F70DB13FCCEC42000CBE18" "B3DA6174410CD8FF9F8E78EEBCEE893985438D48CA4FA976E3C14434F4DCD5D097881901DC" "8B62ECA4D9E37D5C7AA2E91A7B6A5399ED0A4BA4C5E911138E1246273F078E94F63B99E3BA" "36512D85E2E8A7643DE9DDCC6F32879E829FA9D7410BBCFD6D0E84B68E391916BD20D38FC3" "346D95F6103CADCEF6FAD96F437D8D0B4D37693AD8BB276ADFE268943911D0EBA7F5F29C8D" "AFEAC9BAD6B25C560240E50F7FFA0F8D1FC6A3A3EED75A5F88CC7C06DBC18C7C512CC66636" "9B01680385C7124995A1B0A8EAA2820BEB78BDB151BBF39E785BB4012132F441BE4A2F4081" "AC72FE8B611B968B2D1E4F6E7B1E491EB41F424DDD80CB0F6BC97EFE365E6A4D8746C31E62" "9A84A5EC798E3131D701131E260DEC0C261D714A42393EA7390B58452A906046F0CAEC3A00" "3C778140DF9BECBE1C9555E58E9BB40E9C580507C5EE26C15CD0402F488185C6897C16827D" "B95D63D2668698926700ECAD619612809BDADF57A82E77240C7E0C6D5DEC2E2E87D6007CDD" "226816DE0B036FFED27C232C773047BE04AB7E1A0B3EC23B7C6D1EFD35BCEBB656420E0426" "13D4D679889D9042EA4F4A89ECBF30AEA7CDB0797D7F7FFF2DDFFC0B558AC8666767C154B5" "162B2B01A0D2F2469F6C76771E94525EF053CE28FB1FEBF0D26620B40116E4C54FAA67DC91" "A516F3E68DD24948C70BE9DD6D8C7636F8F4DB506450960972A17BA9749B6150310A2422BB" "2E9829F846003DF531FFD5807531735EB1B164F9D87F87AF037C0A3400DA743A9C9DCF1E9C" "CD5CD3B03028FD8649E35D28DF0E04F212A5F6541571860C0C2418A30EF3F43370AFE4E8C8" "9553DB2B9915B20F62688993477823D0D1C9C84F80904C57F5B356C5C06F1E92C49492F4DD" "45522C0158FBCBF2451451720D50BAC7C718D8AC6964A1A9626A49C4A3D06996D22D740AE3" "B3DB7A3F81851764FE0DEF88D9EF9BE35DA9F34141ED77854690E83C25FB29C17350DCD65F" "32514F8DE8A271C210E222CA81F0A6D4E19C9B2E60D16E29AE2595950050393E7932C58BEE" "5FB9F27A91F2EDD32F93D83FE04F6CAAD99ECED2007FE6F85F20C8826DBDDD814DA2A9F821" "49706815F021494CC9C7A05FFB2A7937E34FD8741B3A73B63ED66076AD6E95706853388C84" "E2B55C8D6F5224AB38E7EC2E16D2BE788887D543E026E6D91D5208E7917560B13F30854BFD" "629B7E3BAA071A5CD648A44C456A0392D68A817D679229ED64BCC81CA276813984C6B6CD76" "0D9FA388803EFE4595A23878545C4AE6BB42D4039F2605506CE33970B440CA25500D879BE3" "622264F31AAEA18BD68570CC6F08252D34FF8AF722F698C7C068C110C1DE08DE6080EF2382" "5555A81E25873F9B458A3480D39F337B00BCBF149C4990977D2401E10D0D6C5AA985F49422" "DDCC2E7D5386F2C6D0697E2E70291E91B296E5B212002EB5886E653C31EB1B57064F919AED" "FDE11532DBA22375A77AF6D73582C5A2685122E30F27DCD1BD5A5CF2C76605312A92932893" "9DBF01640223AC2FA8E2DEEDF85111D32C418569D510B850E6C24219FF5A675CA26DE30729" "D5CC0D909E6C3C4C028E49827864F94BFC44B68070164072988BA95AA525CF71895135CE87" "847B636394100E99F1C8D6508C1A80DC20C76F9C4E7C4D6301293439D8A7F5E652B0C671D3" "96DA571DD4B863063926E1DAFC221A8F423BB15AEC4023ACBD34481A35186097210A22B31E" "EE16BD4785FE4D927B697DB3D308F9965284082349C9C80D50BC7F64C19B892E67FE33495D" "7C9D34BFFDC2B97ABB57DD4900E6A5ADF5498B05A19D731F2C90E1B2ACF1732215C6FC1B97" "0EFF2F5387DF4359090095C3A3C3E9ECE8BDFD2B5FBD79F366FAD5DF600D422B0150B03B96" "70D7B23BDEF9D638328DFABDEA92916D304AF1E3EE7C180FD0E9302AD42D4BBB5357724483" "A43D39122593981A28942C7FB39F02B92A92ADD825C09828283C9CFFC99D2C0E5CF82A24A4" "4920DDC9C0F689C2E96CC3ADFD754B75867633C3090FD060F208B4049A901E94F1D1D89F91" "9ADA3DA055EDC900B465DF9901B8C6562712955AE4DFD8C700C64E00391DB18824D2E3638B" "F5BCD06C4FB59DC8B3BF0C732D6D0116491BBECD9B01A479EF2BBFC3C5495D5A994C6ACC77" "200496B3A56C887E3B43A0F1B4B6C2ABB6A4C3D7F04C5CD901995203FA7D8429C1D4BFA13C" "2E455ECB4FBBC8A57353594B57560240E5E6AD9BD32140BBBB3BF7B667DBF9074AF0035F00" "42D6E9C534C9883603BCEC901A161663D22CB8BC256D93CD278ED943E35E621BA04BB66FB3" "EA53121EAB9722A5DB757C6C6B6878800316AB5C53EB128D7B4E934A0E8D774F6706EC4E5D" "9C9C09D9A98B9ACB7B73370A11936872A84F03870CC6E1F62962E7CAE0DC497304DCCD819F" "692433B1D1A44150D294985E9D089901AB49A219F4421AA364CECE1903E368F80154FD6016" "272ED86535B4DBA46EA55B1ACB9BD7465507C0628FA174D50B26288C5221BA46476D33C772" "47BF4244A3B51B61FD5E4F158FCAC921BFFC253406037110336DA9930C654D00CC5365CA98" "58A8726DFB859D1060EF2F121B365FA220DD634F811A8C5EFFE269C3C91151B53C2943B934" "27014E253B75AEA52B2B01A0524FABD46D95EDB07D3D2F9CA2382704763D67D9A525E7B3B7" "AEBD84222C1674256F329077A0432789B981ABDBC535B40D5BEDC273BA12ECF9544FFB8C26" "391AD39907F1F433420AEAAEC7EDB3D40BBE130DB190FA43EA60310222B683B50D8F894102" "1BB2CD771225F58D66357C1ACE19BE25BF0A5CBBECCC0115B9FD4BA7F107A260E365A701BA" "6DDB77F04299243311E1719F41289E0AE98F8A76F3D099624E88FE374D16013CDDE46A9FF6" "BF8E25043297DBE4E6221CB1B8E0DF12503FFA98F03A04296BBF201AC6DBCBF67F8E428953" "523B7F1F241DCAD13901B87DED3A1916376B147F73B43131CE4B2074DBE47244C0353BB69A" "A0EF84AFC0B5B3F8019189FCDB75C36618F7B583C387878F17FD6A2E60197DB976F7F6E4EA" "D5EBAB19E02DCA4A00A8ECECEC4C31B2C366F8B2C73CBB54EE9ABB28B55B781CCB4F7EF2DB" "BC190D11BBDA55B1AA50BFED6E9076E355200106FE5005F0AEBEF477145425D51B25C4B9FF" "53229176E84D89DB3215DF288113C5247B9296826452A02DF036C5330DF810A46E00B93B84" "8C3E1425F728B6181BAA3D8B50ABE9030288C68843AF477D6CA2B42F0E6CE45048BCAAFD1B" "BC11C01C72CE000A0FF007687CD6EC812E48030B0024805196294BFEB110D96B77F689FAB1" "EEA1EEE791EEB2324A23B10B0E592CA6C6AB83A60B6BBD14A457464B4C53C539B5827F0A85" "28669BBC49D02DD747F021686DF354BE42F1FE3E34B8D6C6C51CFAA021E4BE12B89BD0A0EE" "371197391BCA24443360BED535579296870FF1D4AF87C7C727AD7DCB6FF0452A2301E8D7E0" "5A72590900157BF9B767DB97E7233387203599938F4A7EE9491A140F17B43D35E04A57A2A4" "43EFBEEFCDB657B73041E4590F752EC38F04D92AFD5CDEE22B4E6462BF85CDABB581A5AA70" "121F030877CAD593BED959B8964694E5F075748F812B2169980BDE2CE977F660C766AF144E" "B930015CB11AA9E334C2D44D101DCA6FC05A8B380C0B9312095A6959E1EC03DBF87D5C5C79" "5E1830B93706307884C27CC244C3343FD104C3FDA4A44D616EED1DA18C40617D692FD527C4" "72A29B433CDDAF2000AADA4C59FB385785D59D134319CAB63B8C9406BF00AE3CBDE76AA18B" "12BEF3761B890D4E01ED9131BE1F2B13EBDA1256318916BAC7C7AF281977A232C1E7BCF57F" "D46A6E36C3FD679E7D4A2E4B292DE9D77A0AE05B9795005079FCE4685A309BCDE6CE8D5B37" "1E15919B86C04B922FABE36D4B084EF2E1F302350F9B5E8FC9D830A06224299BAB2AE74BC7" "B2F4D4CEF7A0BF5225491B1A374793A88A1457A562BB8D46543FCF5E0188A5D03394920611" "5E16126ACC0CE117F4AA13287D3549CE3C179D04EA24A49BA238C8804D773E4BFE07F66C6C" "E8957EE4B1CD33E2110011BE95D6503E034289482482D1FDAD7EC88FDDD74010BE02CE7325" "A00F124F7106468A7E0CC4ACFD6EB1FDE40C1B260A6423AD5B24C0889BB6FB75B03A9E2207" "8830D9FC4013616B2178EEDBD89534E5330B984E8A141A078ACD671C2EDC274E1A446BA5B4" "AC7F623E3DA401E28387F05966E0E2FAF9FCA39800CB5524DE3FEA5171E2376C368F77C7F4" "E66FB14F5CA4328EE5D9F6AC7FDFD712CA4A00A8ECEEEEDA0BF2B06EEBAB9BDDCDCD90C54D" "840ED421884C022F4BA7BE81ABF417C7D27D1B05247FAF49C20A1266C17E15E47FEC926477" "5C221E61B3A66C440D7F247D839BDD2E4A0993723F927A150DB43D9D012578865306C1E05D" "4E3D54937F194C221A8629A0825307977E0FF81401BC8403624CB54E5D266DD072D220A57F" "0C3072F34BBA8EFD096C0CAB3D303C5B69E426D5711BB78A2892859C042204103447767600" "E645E9275A5B0CD4D66868767CF504E9569C3831C1ED8F25A63519488F8F11FB825425C740" "632C0C94FC1AE2DD7627BCF95194FFBFF885738E7E3BA287F3F5C7B498C101D61EE2D6011A" "0D27BE635D433AAA5A5C04407F94961FDEC925822B45F6F676E5DEBD7B2FBFF9CD3765776F" "B79BF38B58CECECEE499679F96DBB79FBE14FD7DAF652500542CFDEA7872D6B66EBFBC57F6" "BEDD7E85272F316DFC0D0954967D06E236E55F2E7001A57DAE4BFC835CF5EAAA74C98049D8" "CA616FC9D980379F7E2362BF86F3DBCADFA9D2F3CC618A413F90211F53C68EA2718442166F" "B291869300892008404A1CD451538CE6B00799F3A12C00CA8C5F3D4C7A1A643E4048DC0C92" "D5E7C1AF209EDE0767D1F42C074DFBD909A5E18C814B694706B379201E8BF356402F5D889E" "3F8B0E600AA01BD7F8DC267A869DE12F4B619725A9E9693DDA3B1667DEB502481E15EBD4E4" "379264FAF97C7D24B78A5A0EF66A810941D3BBC74440682C284AC6CC5F9CBDD0BE07791D66" "8D8039EB4D349248B9ADA5D9FC289184157F375DBDC1BC249BB07C6E379B8D3C3E7AFCF237" "EF7D53AEEE5FEDAEB988E5E8E84876AE6C4238E65AFAB212002A96E7BFCA140DF01A6F0200" "4A4A14620E7E9CBA1740C60972E41C3FAA85B5D91F5292BDEE93885F32D891406662A9B9AC" "5BDD493A0E1B2601B8123ABB344571FD85C98A3800B73AA1022E7DBD660260B085A0466708" "04C54ADA0F9592D0B88DBBCF1BE0A68194CE500BA99B0B0D52BAA4757649EA8C17D151C319" "04B21F007F601B7BFA2DCF2B7AD488051E41A4C22346648AF93782802F1B391C092F2732CC" "B4353A8BE5851BCD1FA1ADF81C19696756E27EF2B2263782B9DF15E35FC636535E09F74F60" "47CB58409E91B56F409A5D90175287616DA50803C6D9C2CF09F3DCFE2609DD921115CA6DE0" "192CA383E2B807CD73432428981B347C096B90AB3A52E366307CF18517BFF6B1975EEA340B" "17B14CEAFFB3337970F0504ECECE2E7C7FDF4F59090095A3C3C7D387939313B97EEDDA9787" "C1136D84B73DE9B8F918D0A2A5DF8198A4F317396110EFBFFC37271C11A118B3A8FDC76D41" "F5405ED6007F426D95E54D1FA15AAC83F0DF1D2E97D21959FD71B30969564D22630D726B8B" "118DEC21AE9DCD76C1933F8D7980F405E2730E2C4BFFF5B244ADA1169268393AA3FA08E24A" "26046D4E6680AAD109A2D2097CF8DE531F9706F22048CA7533C8C573F8A382010174D40D77" "768DA98D0BDDA1295DB3F573F04C8F6CAA2102192744FD6F264334F7D212F14CAAF7852803" "F793905E83806693238B8595E636141E0DA24514E64B14D743639BBDDDAE0F1A07EA2BFBB5" "1436EE5B9B52A3036745BC5FBF8EA7FF0D8393661DBCF5F3F55FD7B35E9B7521CB38C667E4" "97B19673CB4A00A8BC79E78DE9C393274FC685F385679E7926E5FC7715A1B2BAB948DA40D4" "5F7029611F2B795F2BF64F221624D923E4CF8DED24123B58F4ECBE20722062146FF4F47D56" "3FD8469F801C4E548D4484CFCC5C38769B494C101953F63FFB5B500511A54446A4040264E1" "60BD2924FA4A18B7285D56BF4EB51287F36D764FC7539F37B397FB3259A8A48D83B63E6800" "6052ED7B1E207CAF04C612EAE741F0DF6CAE823663FAB3D2DF9473A1CB549846074B90809B" "5BE4AA1AA60D0162ED9EA05DE2C106024BD368B8786DA431F499233D9810E70C3F58900242" "AC6AA6FFEE05A57659DE0FAF7600A98EEF9042D390D3822FAC814E95487D0CECB14C270A6A" "4B140607C5E06BE2891D8A966315F9ADEDE580FF9973D39BB196F3CB4A00A85816AF297186" "D6D7AB496EE9BD94F01AF3B660E822F0DA5706EB25677DDC48E0174578EC0D9028499A1223" "085DC5421BA48BD87DFDDE218B1D37E7642109875DA0A1050821F264BBA52EFB466CA365E4" "A8C95D18DC482454FCDE98D285DBE563A7002BA20A456469D043A819791014DA6CA784B934" "BE4CAEF2E730976264AC060C2B4404BAEBF1B749C00EDEF13149F33311984A555098A86D83" "441A949EE59196819EF868B002A61AC122B3925D2342E3C452ACAF677C44822C7E96B3BC9C" "E849D2ECC0E782CE24108999F5E606D5E0EC0722451973B02AC9F10F4B065D2C510B408FC1" "809023E36469D3E553438BFD26E61869F7FAC97F79AD8EE33A645A4DFE3E3CDE7C5AA7AF16" "A820EED4AA77BBF57A418B8500AEE5EDCB4A00A8FC913F0A9FBF7101BD7C7C72BCDD6C361B" "DF50E712DD7D4C8868C93C5A7C387B7F0BDD99C548763C8207BC6D4FD8C4344A52257AD433" "4C2E2AF9F8ABA4C297FE27FF9D05250261BBAC9608D0D8AAE8665C5192A737B73D38021278" "737C3B132AB17619412B2473A6115870E2C3A0A83F1B0468E8EFE91CF28848050FFF56574D" "F1E890FE34B7C0A1B2F2DE1FD60EF91E04957A896D0030110983FEB8C20925F04DE719D194" "C33667EB5F61A1D2CE1170E0B776F4DDA49A09C9B2E3A19030EE5E19943382350AB88156A5" "A5CDD6A8290BF932EC3D1571091E5D2E7171C7D10AF562651371E7FD60BE7CCE23E2CEA7C2" "149922885C33508CCC87D9504BF38376B3050FCB62323BC4FEC041B6C8977636BA954B52A6" "2D78BBEC14B99658560240E5EC787618691BEB2BE5AA7CBD887C12FB473C05A86D7C83AB4D" "8542F448522878413318D166B5642FB4AB9A448ADF59CA5A020A7E82CEA1C9512EEBB02800" "315AC1B6DD25ADC1A282CD241A577B1A6E21B39A50A8A026351DA9F1A3C413AF5BF25A779B" "7840366C960CB0D3E6384ACF4DF24228A12EF7AA9B376B833F5AD4548F2C6A53C6BC7ED453" "DD9ADACDCF0A7DEF2E02A18921912DE7BE49B9D57CDE4B0359BFDFB52EE2122AD7AF8C982E" "2DFBBB51C91CC31A1BF2E9109A073E1130AD5E5FE742442735032D21C93D8F2924788D5E79" "06CAC9B567D410982330DE475634D13BA14261830CE2F1A5C520F1C98041A64F5644CBC258" "88BCE014462652D6AAE42C88EE141A94AABFB3ED84918B5B40464B7C43D6D29795005079F4" "E8C1F4610AC5D956B97A75FFAB7BBBBB9F3C3BDB02CC3825105ECBE0D424C8F95D9A3620B0" "7F2206B34E95127A84D29E018949C0E8B1D9B017783B163E0B30EFF425B08D8585208DBFB6" "FAACEFA40AA65DD4DA294661348E51F6A447CF1D49001CFE8CD41E3A2E38441974042B0A70" "B1A2A4AA8E97A36FCC8116A3001C0FDB478732233E01C293DADEC64697329671A3037BE148" "83D8E3DA9CE5B8FB95E449074D8DA4C89A086994C6525DF2769BBBF67D07C1B31EB7954F0E" "88F06F081A2D7FB4E6C690A3686A64F2FF1019D2738352DC99702011F6411BFA464D88372C" "24126AE03FD9F7416C3984B1CF9829441884D759FEC2CEDD40A40D6BC94A1C7A655291A6D1" "C679ECF6B0F9DAB0B95C498066DFA715FEDFAEAC0480CAC34600C6727CFC446EDEBCF9C59B" "B76E7EDFD9769B80959195BC7D7903C55B2B71D3E9929C2C2D52A553CE8A7BBF17DF9A0180" "ED792C2163232D692BC70D0BCF6CBB066F27053B896D52BE5B875310296D70A1EFCCEF21DB" "F05902A2210B367F3303E06B462B1C0C24D8B87361412C7777E12B1F25D33800C453CCBA48" "404DA5369994DDB545A91D9A4567070D154DAA7F1A35ABBB8B0275899F9D07D909CEB53273" "7F60F757F79A8F03426DD0EA935024304A06605E8391D425A2910842C111D0740FF866F533" "35AC45E4286A6DF13F7D2CD164B60C38079BDBD5C8B7DAF1BD85C83685EC5967959B47A278" "45BBC67A066A2DB17DAEAFF870E29D34BE93DFCFC856A6A090229ED9701A736D1908398F44" "D016E817E668927E6D5EC8D2CE5E59CBDB97950068C43214000020004944415450B975F316" "3E9C5ED91F5F9EDF199302454142FDC8CF69C3B3B3D55D5A998D71E2A24D28EED61436B6F0" "8BBDBC66634ED2323ED946488E6949AA0B2C98584A0E9562E72C5C4A09D2834C4571FDD45A" "DF808A83B76DF81C4DE6518CAD2D9CF6B46DB30EFC3C36345644B0883BE08A407AD2384B94" "6F693CB5A951EC89C9765F6629AEF6931AC8D6FCAB5DC58E7BDE269F47C5B3D0964E52D36E" "0D8A12E02B1146D23AB8A9A044B4569EFD1451A2025064DD4500A6328F13AAC4B2E9C71DE4" "0263983F77934375F5253B05DA7DAE868FFDD5C5BAF3FA1982032BAB25EA04EA42527CD458" "84EA393AA8D532D80F6C42634D5ACEB7454C2998E0C29A4924147FF979961EAEABB2D5FADB" "DB250DD3052DA536134A9EF4B574652500549EF9C873F830BE88C330FCAB31A14494C9F8ED" "8F4E6C00D78670853609C52655C2CB6C7719C0DA1706D3A60A74894AFC101EDA2C5CF53E37" "A666DB3A3FACF4BF2DBF2C1CD6681B60037E7204631348218F6A5649B80069A1710D2E2976" "DAAEED0420D663140C66DB5DBB44023C5071E0961E1006864992B87326E15E200E4A7F50D2" "9DB9DDF69C148C6C5A0EAA776E22EB76B95E0DDDD2006C89DC9155463024AE3D325650A8AB" "F930215FDAE4AC89E69430B69E6A18904C6B35D124F88228EA8F9902F3BCB3EA5CA9FDA41B" "C96BC5E6C192ED34D6197C384DFA17A0334C14A0163009240D1B3BD092E209927861E95F3C" "3C8FDFA1D6BE697F99F40E46DA4B78DFE3C4D2F8E09D72A38E4737A4F99ADB7E7F10F9EAE2" "EB7D41CB24A06D5703C03B292B01A0727078880F633ACE9D9DCD6FECEFEF8D363402AD56B2" "082011B85972B6DF961DE9788365B539FD12E2E293B77510512D8C4D53A6FAA58725F094D8" "A700ECFC3D795EB38733364B3AB1CDDA39D88140E2B6E7ECAD2D905A8A879B116110652195" "230D7A89486C5C48A205644202CD23E3D7E0AFD6EFD242E97449A1230CA0061CB91E965431" "53C1A76051725E9A3FBB571DEC780CA7875623244B27F0713D0CA88E664835CDD7EAD2673F" "912E3CAB4402D181BC91E0E56611E131321B3F171A5C076D411F14269CF810A79D5390A70C" "55A0655B0C8D150963175E07D63688DB9D89F27B482AA4D166DF6FC04F5E2CED8E4275729E" "82E83B10C8F2E24614BEFF2D1539EC7EBEA065ECF5E69C11594B5F86EE9BCB5CE0B535BF8A" "755B5FA9B5BE02D2CD221BDBBAB32755916C708CF7F3BB1B8453DBC0A8B60EA8B80E023989" "1B6A27F4842A087C4A92BEF9EF243D9B24A5019E6C435690A4501DD2D2FA66ECD0E15A0E93" "B2942454FBCE4949EC09342CB9DDE9A2BCB777A04A04C1C2F8308FE10E2280A42908D34884" "C31CE67055F7601B536DD79BC4DF3BF9D9D874CE97095B81F7A1CF1A5A19CEC4C77DD177C0" "7952942AE3D1B876798DBE10EE9510A56F89EDCAB22EBB7F8266B6BCF8856E9F0C6FAD9F20" "BA58AB0E986E268B036E99236DBC105590B8143F94A359965E38FE0D7F57D78228FBECA80B" "0800F6128FDF9E0AEDCE4E1278BC9A6F47CDE3E8CF14959779F62FD3FFD7F2F665D5005019" "4A7CE36AADDB5AF577A4948FCD2ACDE21BD3A481D600A005A0DC0368A1FD02C211F66182C3" "2EE7803BC4D9668A7308B2B290939A500DF9B324BBE302CE01B8DDCB99A42C2340CA557A3B" "5D346BED6462A2095C8AC764BB263FE61270D5BBA646B751CBA17FE2BB78216D028F6815DF" "7F434821AAF1780F039B89E4982975618E7396BD29A77BB6BD4272454383F31F1C3DAB87D5" "2947376881F41DB40441EB409EF7466E388D72D01650D814B7AACC69883DF3A5ABD335ADBD" "38BCCD1F41C95E9ECD09F63DB1267BB77CEEADF9C5D7302D545E666AA172CA64CB9D6DF164" "5A138EBCA4D973A66F0DF7F922CD9727F4111C2E55F0B7B826203BF771B29ED2CE24002F9E" "D54C469AA72BAB3BB828DE0F5BF3FC2E700403BD96B309E40B974DCA2BF4DFB5BC75590900" "95DFFCEDDF089F0F0E0EE4B37FECB3BFF699CF7CE6DF7DF4E811D47E31F77F442F27F6856C" "914D7AD5E80C4772A73F3449757C6849A14D30D83F33A884938732175EE2C62E35595D9E21" "95748FAD3E549F1CA382742831548FA00AB722316CF18D19B6F3000E44A00C1834111B3A83" "9ED5CF954F36C470B81DBAD7B044E1DF5DF9FA6B3BE9D61BB3903CC8EB66099F87254BE1EA" "D541ADCFC973C51C12D9A722101F1771557A27306F6392948B4492A0EE0C89313F37CFBA33" "D54036786C6C55C0BC93D4E7AADCACB9ED2066693E490D444BA6452FA4BC1D1281DC409EDF" "2BB3DB8FBF0E8340A217B5C37A4AD80398C99B00AFE70C4D11715241861723C03C675A9C80" "3AC7F4798FCE832D92013E0AA5455714D9AA7E7E71895ED032F675578B6CCA65EAF57B2F2B" "01A0726D6F3F7EB15FA554FDDC199D28E5DEC2299908B47AE6ECC31BA8D0CBEBF8CCFBAD08" "6DAEFCBBD23EC69B30D4D6D1CE69DB939A04D04005070212D6FB4923A94122DD2E1669CFD2" "6D0E942216872B34162CFDB814A3F8EC5EED1E6D1082CC01CC533F8A46100A5232110D624C" "66A58F9DCCA5072C96B6E1F196E78CEB9C3B15E2DFC5001E662621C99FDA4B5EFCBDC73C4B" "B4F9D934962D2A20A8E5719383BE2F517A4E22A039DBA04E29922B69C2624644D3E874B84F" "912746A602C161B226C42338577F7A3F405438610E3B428A913973AECBD91062D82B6BE627" "DAD1224206318249EF41F247C0DACE39B382F68B8894B68C75445C3D3D70230524BA3B914E" "A986F11C1B0326E1BADD94CD17BBA9B8A065ECF976495BB89673CB4A00A87CFB777C47F83C" "BEB055EB6F1E1E1E4E676A07C46E9BB1C50FAB98EDBA249577DC1134289715D71491CEBE3A" "BFE88EB24AB9C97DF71EC26E8BAF4D7273C565DC9CC2E62AE1FEB8C1B4AD872497183198AD" "FE2EBD15489951E2970805688A5108F7AF88F5165303B00A8577FA542296A9BB5E652D035D" "A8A44AEDC68605B838D088FF0F36621BF90488390B1F8BB3EEE068A4A5A2ABBAA08588C4C7" "0324647113742B3BE644694CB91EF1EC8BB5AA8397D020E0044327B7814BD06148C29EF60C" "82AE5A4863EEA06DA405876F85DECC63EF297F35AD097E1F29A222E4E1A7B56A9F0B351463" "568840BA23A3FB2128FA639A289C01314515D93D9E2F635A0F93C4EA2C1DA482CD09BC5248" "ABA56899B701D796F2FB9B8DBC2297A4CCDB72790BCDDC5A7259090095870FEF85CFA3FD76" "1886DFBD79F3E683A10CB7B7B225FB3C2912A166F54DA5940C4049B48A3B9984CC15B083B2" "37BDD9C22DD48EAE0DC54C0E95C4B176294B45F4B8EC30CF5ED1268585930FC1499CF4188A" "F3C62FD04290A4082863DBA74B6D85BBCF23DD1DDAE26685B99A2178E063840B6FAA06D436" "53ED1A967C39ED2C9304E1DF086C16C67FFEA6011EC5AF45873ACE18C836F5147758C39531" "DA51FCB2798874E94C19D41FA812CC3306F6DE26C264CC423B6936C4DB2B7AEB286A0E766C" "5E01BDA1A39B0D5F358D4BE7D762BF0FF1CC034B6B8CE892401F3468E8C2BA551A6202618B" "60E0C01490F252789049D417E894F05F5EF7E27E437C580FFB203890378D96F0E146D14FA2" "9F570923E6B91AA045F9F5B36D6FFAB9D8A5CC446B89C1AFA52B2B01A0727074143ED7C903" "B91C3CB7DDBE5EF6CA6D5739CF52E4D0D9FB9AA442E4C08AA5078E88831F49B55C5C7228EC" "BC451B543E74053BA1018DA07E0E032B7C3D3559D387E0845828B90D3D5B4AB4C313ACD386" "6E80D234089CE0A73D2FF444E348F2F8208A80C6105231EDEAF899367BCC0CC0B1C4F14BCF" "B27F3B3F03348C6578FE6F6BD7A439EA7B52E8EAEED984FB06D0F849E3BF937F9E49C542E1" "89EC5C9958828F7B93DA9B935F18C5A0D510A8A6031D6B2191497FD3DA677F576F9011A224" "4DBB86A1787FC6C373E0A16FCCADFD4EC42D06E07B7DF3AC36A63291D1817AEF0BC0899703" "70468C8C1F8581DF46BE49E836134302F7D9B7C11933C63D84B4D6C9F9D89211D9DE82B5C4" "FE1BCA0445A1A95B50E49903EAAF6DCFCEDE22C4F1629549CBB2D99561D8BD14FDFD20CA4A" "00A8DCBEF954F88CB0B452DE54D1F9A840C321780F1398B7177A1497786341F6C080D8FC20" "97868D3A682FE3FAD9FED8FF2C2D709F14C54BFFF277E4C1FE64AD8398C45B02A181F68152" "15DB58716AD5E02028AE24C083B29D9E6CBEEE796E528F4B981D5748E8E8B89B7508E4BBC1" "9274220A689339EB05D2E68F0A7DA9A03E8950D9F5DE36A587666FFA44C5CE2DDE2C8EBFA7" "4540DEE93CD1C5C025B030B7EDE3D95509D899540ACC05D115C2D742E41D91789A831B4BB2" "DEE479CE6B5BE750CF737A5BF687992225E8C017BC8604EE1CAA2BEE65074F7A5EE703110B" "E9D37B2B9DA828852932788A3F376403E630D6F8EE156A7C6D1945E75750692F88841CCF1B" "DCB9389C51D688C8F84DDD6EBFD88498F396D2852A53C8E8B0D385FDAEE5FCB212002A63CE" "FF5C4E4F4FE5E4E4F4D7AE5DBBFA27B75BB357BB04C2D8642F64E1BD93BD7BE51CD55409FF" "CC7F07A9248886513D4F12E32207704C709C635C14DE3CBDD1F346142F081B925D6FA04D88" "EA698967114509D4A539089201BAF3C667302AAC8A8692A4572FE7B1845F450C6E0B60C243" "1B4B265A5DA8F5B4C9DAC97F2CEC2BF425D1DEDCD9EE692C6348DD0283082442DD3411B8C3" "D2C20A35A4BE3329595613078244F5B8E39DC6EF4C3D609D3672C2848FC1577922D09AF655" "F577262DD830AEF893B510441CE2E4A4B5CEEFAD109957EFCE2855D6C1D7B891D39CAC8B69" "7B17CEDA5A884B13A48F8E86C3007F093BD6F75C20E31C41ADADE168EAE9E1F5B4C8F02F76" "86CB1304584B5D7C77D6727E590900956D3DEBBE3BAB67F2F8F1E1FF73FBD6ADFF50D5EDEF" "167B9EC1B8D0661F94F7A63580AD7DE1EDCE9A00167C39C6599601C59F1A1DC358E25AD076" "4ADCD1AC83A5F936A86B31CC939A361A56494A72100407E053D68ACB969E80965A0291B0C4" "F6A12F0C3C113C21D8DAE69925DB7EC8FCBE30A6CDB26DCE6574219CFD84316529AC8F0030" "7581BD0217B4F5FDD9012C4227E037234AC5278FD577BD8D2F82369B52E9DE4E7BC45A8FEA" "73112EC987E3D85C963838452C2D75D410446E11C7EAAD7C02D8074152AADD40283AAE9D62" "FD9B36C48948152D4393A1ED8A617E670BBDCBC542ECC8A46204C2528087987D7B19B0E8DD" "604144A1E2284F57213051EBA6681C5EA4C2CE6181D37DBFBED9D9BC2A97A48C63BD3D3DEB" "88FA5ADEBAAC0480CAB3CF3CDB7D377BEF0EBF76B6757250C2C6C7EAC6F3E38172340036B0" "9060D8D4F9EC894E9E4CA5502298E8E027B4611AFEC086BD28C951090E7F90B34008602B4D" "4A5D777F7295E9BC112A7C07F2C68B8D31A27EEB00A960CD5ECBF9CD731A641A471732691E" "DEAEA80F6F778A5F3883DE23150CC4A650B826E181C8303077A82EA1ED6AD232A4B865A2B2" "24ED1B1855DBFCE90278E59B944E40E2AE844D50C751B3B4405A47B33F40D4F953FE79267A" "02268269C43282CABECC97C03B1E74AB1BB39E53517406BD677E1BD191A6268F9A25BE2D25" "1C0AF79760E673199A935231B94D51031C1A9049776D2759D2FB85DC02165581FA59279188" "3B36218F290A3FA97CAE2EE47EB8C8854D8F6B79676525005416F6ECE975DA6EEB684BFBDA" "66B3F9F8A82E553B87061288D2164280CE46CB2CB9E12756214AF3F66F9B44498D22093598" "15826E802AB34D44B54FDCE255A1043705DE4C8DD0D84ED70B355E25C6A5B5A9C40C6EDE8D" "28B903DC4BB8324ACE25F793C63D90A46E1223B8740CAEBBBC1B1CF7AE67B737B3B35B05DA" "014ED78E00C8CB73167E254D804BCF4A805E1688C71C7286B626E2E47F6B4F7C0A3B30928E" "C6B02DDA9D705DFFEE1839A4015F32DD5896BB6EA4D021AA23715956F72FBC4BC19192D752" "FBDEDE612375859EE226AB14D9028C77FF9FE02563A06D6D826B46047D5E7A5A9BFD3FF916" "C4681C3AB298DE8FB9EAE8DBD0E6F8572F9B383C11CCF51CE07755560240E5CEDD6F76DFC9" "EC07505FFAE84B9FBF7DFBA98F9F9C9CB819C02E4878AFE22A75682BBB92162AA4D1D9990E" "D8CF1BDBA294C89547D200A734AB874567D25828651B0C7571F39642EFD87200FB3FB52838" "2709BC9899B8F8662E5E33F533F80BB6FB58F11F257F49FA6C9795FBBE74438FBB22C8C7EB" "82BABF9C0788B990C4585D129FB534C943C148564DAD0A64AFD97DCD0C25CB216273F6C98A" "FB220784BDC9EB20E00CE619CE9B401382B9EAF236F03C667D8D4BBB3C86E6215F6CFC693C" "E1E8CAE27A5057155F0CD591DCABF038D3123256BAE6CBC0BC5A0AFE50BFDBD9ED2507012C" "12D20987387C91603E20DA18356ACDF4A0966D90C9D312A1A413154126695ECA94B170F897" "DD02BEE0A5D6ED5BBC836B592A2B01A0728E2FD4A80190E3E3E35F92227FD6BEC3EB8C33F3" "59959F00DB3C8C958FEC668849EA7C100C889D7E19D5ED20E8628149D141E065146E3F426D" "9B24A73820B4B74A59747C7212447E0BC2EA73234211D4ED52A50C7D254892051BAF7F92EE" "057762125842BBA9C9CA35D660D2AFF52B271C6C0259AB3F828E8533CE6DB723023B4F0680" "0E1335D5D47A0E77A36E874801EA8B4BE0ED37D20D67E741F55642EB60201AE098C194E6DC" "CD080E345A52AE79FAAFB6CE625D2DECC39D76C4DE077109BC06DF05EE4F0D6D9C97B2AF08" "93C27192246CF0960FA38443A6D01E28E862040EC6C7E0DA88C6C2AB52A784608D0498B360" "92E6F98D99879B426EA3D81F7365A4F7BB70B042AADFFB2F5F2BAA9FEB2EBAC0256B4FD6F2" "CECA4A00A8E4D3E6AC0C65471E1F3EF9F9D1C9C4CF0437A7A33227E39BBEA593ECF890A0F6" "C2B3A390A83B30B184A82C89B25C6E1B90D5852F9592FE48AC004D618050B4CF6B68CFE370" "266CAB82E747392682246F56C888885E483AA8455CF5CA8E94245DC7BB3318F47265D47EB8" "C41A3CD585C18965617F0A837F571A808E2035500300A92D739F2849CDD60F8DFD830D3CB2" "04EA1B9F0ED8AB2358BAA5A7F8DF649AB0C801489D5DDAE4A40FC11229296B211F4494E45A" "5EEC04E64632541369C51091B6413DAA22122FB143A531B4968ED75ED929DC6D885931BB37" "09027DF53301B074EC8D1A706BA133B58D7058FE8F4C4E65B0F0D996B0971CF326330B2D98" "403878F092093BBD8151E3449F4D3351CB7CD0B088FCE2B63B85EA6297F35ED9B5BC755909" "00956BD7F6BBEF44F092FDCBD3B3ED377676362FCD7E00A64EF44DD470A5D016896427D8D4" "A3FA8FB7DF187B4D2ABE924EFA4BEAC88471DD9ECE9B29A46593F4A89F11F84A2003255618" "6CED8537ABC0333CA3A1D22637DFC41B68DBF84DDB50EC5B0DDEE61C8211D5CD1178B2E738" "F789C3C466E65643C8A2859F8180A8E72248829A6B0108805D75DE3B99B1E467E0E7731601" "BB2B26C677D7C6B937E0470E0B9A2173DCCB1009C2400B82CD208833B08B1BC9F3B1F10660" "A5F3FC383F429F3587118A6BE090213234B67A0E031A23ADB6F292DA2B01282FD9C25FF42D" "6F843D39F4D2590696046818E8FEB66640D98B42B3643E0683750B127B6C1B9E448D557722" "F0F797D751E8DCAC27194AF965D95CB23300C77570B938CF0752560240E5E4C971F79D95D3" "D3D3B31B376EFC8BDB4F3DF5E74F4F4E49ADEE277705B24EA20EA4DCA461089B4DFC81E288" "2998902457282A135694E439DF6F89EDAA9C3E8C36BB04F71E4D00221202B0BBBFD99FC054" "9C9E1BC1231F0C1040048280DC36784EFD9FA568E9DBC0CF0D404A8E70F69963CD7D8BE7EB" "29AE1880DF72006882694AB78B1C02ED48DF5262BB973CFB4DB51FE3FDAD290BE603CC4DB6" "FD6756961302D1DA20B2364F0DCD4521A2C83A928269A48746E934EAA7729F2D14D4FC0BC8" "B1AE35B718F071DB4C826712440DE8A465104B3A58CA5AC5E6008E7A91B63EB3331E3CEDFD" "CA81E6ACD71895EE4F4C0778961FA20487627E914CAB366A1C065F2F5A9CC8A727D1E7B35F" "EA9A74E1CBB0301A6B79BBB212002AC3CEA6FBCE4AA9DB3156F7578AC89F8F0A5081E454C4" "BD80A56D3AA60598ED84836F84A6BA543E0620EAFF0A6CAFBC9BBAAD3C66772FFEEC2C7149" "91B8CDC53684476BDAD0A26B429088C4B65E2306E0289415D011C5DB4FE469A9642D6E0011" "D4A5A1CD180DCAEEA61119BDBB002C09BE1B41B2361378D62AA3BF06FA3484ED78DEE9BF70" "C89A430667D42873BCB78666CC766F9004FA71C1012CF32EFC7F7A06F7D7BA9DCC45F4B3D2" "984D8505281B23C37D34BB796C701F8A1F1824545F1E36CC21931190DA9A0EF4E13E90C4CF" "CB9642140B6BB7EC493AC411538759989D9AD320087AD03018F07BB8250EFBA138FED0C7C1" "D68F135F0B2914F275109A8DE0C0D771360DA6C9420E8069686D1D7F45B47C5E2E53299E0B" "63A500EFAEAC04804A5D480464A5942A078F1EFCC2AD9B37A7B85DECB5C5E55D4049A75E6C" "E955A1956355618FC5220EB47CA4AFABF085100C1747DBAE231C9ED9D7DF7EA110A2BE212C" "71B8CAD72FA7F028729A92E21B97DBDD1B784CF1E0FD31B2240CBE7509E82378F579237DCB" "3A42DF5DDB0207340ED11706A2F98F1A480D4BF374D681C67CF7B3437E75E0565D9CAF9236" "7407700D736C75D8EF213F82D273A7CF35CE15F7AB4800578C69D0AA3061A4F0C239CD4F78" "170263C3182B9125BB86099BF21B111C55F957A1FE41438617C81B6CEB39127277EE2BD626" "5BC3F6AE220287421359CACF449DBF83D6C2926129A4FAC97BA1CE64324710959601D0DA61" "EF8C0A399C36958BF767F6FB613D05CE0CD0F2F9BAF8125FDC32F676B3EC9FB996B7292B01" "A0F2C61B77BBEFAC6CB75BD9D9D9F97F9F7FFE85AF5EB972E513A7676760F45329BEB17076" "C0E8D4A3DD22CD8401D72633006CA7B26C7F977340CFA5226D8E54A67E74C98A4F11EB0C00" "45C2E62FF061F06DCC139624AD88110693A212C7601C859F40D214383F208D83DFD4AE1D00" "2A3E7E24099217065A43A607FB1B5D6CCF1F92F48921698F32C12C78D62F6320B52D49F551" "D86DD275F59E72B33BE0771139D050062F1ABFE885DF870EF2F8703B67873603574C2B1D52" "638E8A0AA0427FA0898944D4CF729881AB3475430121606A44400700A736DB9827DF1097B8" "D55F5060BACA00D59A80303171F5C12B5EDF24E473A8C302EC70EAEB05626D4A342D9108D9" "22D4A0F28BA6435B339E9B236BDAE4CB0BABEFE216956C595DCBBB282B01A0F2CC479EE9BE" "E3727C7CAC8F0E0FFED9D56BD77E40260290360076E621EF5C4F063447192B6D28D8C05231" "09A0D0E6E432943B689D2F32BBDC3397019F7C038DA18B24B82480275027D40E321549F89D" "5A949207B124984D2674835D4AF847ED61808F68B030204176C4DCF487A4105832C0134908" "23DBC68855FDD3C65D6B90D8712F3413A6AC4C9278A6715AE0A310894A1F356097E3709C40" "187C1D687E2649B7AE54499AA5329B1782C35E3AF4C7A6184F3230B64434C86B108FA4B6B9" "0AE404911BBAB0267D7960DACD3F229F8A37E5BEAA8864284247579748984012D4D76269E6" "9F681EB230BC4684D3FBEDAF8D6BF78644B267D3C01C6A3294CDAC191CC9880CC1A421349E" "DE57ABCF86C1FD346CFD95A2BF72A972E114E9D6E35ADE7959090015DD9E6F0298CAF64C4E" "8E8F7F5E557F40D4C0CE254A696140143D34150B0B0268B64D2260175EDA64231E1636BDF6" "5CDEE85D9DEEA895642EDA54DF4A7A89BF1991891BB18530FA130A452C582E027C974D15E6" "E14C1BB36D984E4C04E319BD0453CC7F77B46F0DC4C1A52ADFF483C9C34092DACE0A992065" "9739AF7DB05353DCB988A7CEB7E728F922587B7039343A82715249D7DB7F29A4B1F3CAB7F9" "2ED23FAF2B34B7BECAE0F0587CE0E7B6B06DDFC2EE905CA824722001C89D5C44353E6B43D8" "31333AF69923A5D29A4B2F0BF097C56B331F54928C0B4E09CE075769C851E184885621E6DE" "0F048A5EFBE85329612D0F20F796E8C7341CA5A50456BCEF3C63EC806999ED5827A0CD6F88" "C967FBF74C6AF9C5E579BFB8A5AC28F69ECB3A74549E7BF6B9EE3B2EE36638EC0CBF34A9FF" "1380B857AEBFE80E2A055A6A387B9932DE0E07E18DAC14F2164E1B5D899B26DAB0A86276C3" "BA12F02E43035B48BDF1316491FAC93CA1C53C8B7969739080991A9A84068D869D556052A8" "B07620748CFEEEA5FBDC1BC262AF8F1C26BBFAEDCB4224867A8CB14D870205CCA0E8845232" "90F9184471DEEB89F67B7A805D1EE6CC0941A888D9A0CD566A078D74B834FA6144308F9A8F" "394DB59FF7A7DD35A85C09C884D6B681568A78086DC4B838B10DCA1A1EFFE40C5728D3A2FB" "8A12D9D5F81CAC495BBF986F8A3E31D0A768111B9F6259FCDABB625A311303E63E783F4DD3" "E02464AEBF98F9244B0F183227BB4CB2955F36D15F2DA2DF904B54C2814B6B79D765250054" "FEEF5FFEE7DD775CC697EEE8E8E82BDFF77D7FEA573EFDA94F7FCFC1C101D90EE70B9B1A2E" "80A8BDBC24F68A790539BCA667357D62699B851692764DDDD759A7BB5A4858D2F9917DCC52" "6BB724A95882646F12BDB0045D5C2A04B0B03E99DB672441687327295A4872C23029693A78" "E34D32BFBB909D2FFD7684A9FBCEC1DFECAB4A696545664F775633AB649B731A50A00D9109" "FA3F1B3FA0DA6F9B3D7C144C12E76A430BE858583298E4A9989D0E8D54A698722127BD7603" "7B54CFCF607D013B27F603AB24F963F4A7E43B7E0D1F5463C442EC99D459BC2EC47FF0CEA1" "DF3E9BD6FBD909903C4BAB7BFF43AB151C25D5186CBBC56C0A834BFB639CF9740EFF10DF17" "5801D89787E2082CBB5F218D0891E74244DFE7BF4507599402D70A9624E164CE41E4E7FA95" "7E810B581C93A0B5BC9BB212002ABA7DFB4412A7C727F2F8E0F0E78661F81E568F47679EF3" "5D523D67F8BC734F11059577BED280BF5536B8E39D7B1933108A03FD792F01EC83B4991689" "1F32F88360F8261E54E79A8F460534B4CBFDE4B4C21B9724643212E10D6D7FF98973A125B6" "A14FE3569BF46436E6F3068027405DA52BD249BC26B956062C69E162198D009EDC462620A6" "CA553750ABCF9CA9F58DB880C0A8AF8710D616EAF6A1302212E78B3888F58384F07006418B" "8098D5DFC31C9247DA875258E7AD04FE29F48FF92E7BEAAB457FF4673248EA93ABF0ADF103" "BCDE6DDE4B3B8D91D7BC69C78C44D99A747230602D8A38C84FDF0DB3F7BD1DC295B2000452" "9F730D70B1289278D640330DB497AF5242A0390740094204B40F14ED83C3C1106A2CEEA8D8" "F69199AB6C7EF65C427A018B3647DDA2BCC8D7F26ECA4A00A8FCA14F7F7BF75D2E6312A0B3" "33FD998383831F195A084F7712304BC9F897748EB60D553AF58F4D07D045DAF1A1ED3B2D24" "052775333DDC12F7108EB444AA26FD518317741085FEC3B2ABABFF5DE5AC4D2B11CE7A4FC9" "624C9A170B69E24D5FF9B9C138823E75E44184407CDE55119A472D76BF88A6C267A73478DB" "C7C1F3DC09A40EE671E16994BEF90000200049444154F6910603CF615B3D017000639670D9" "66C1EAE8A0960F823D08134BE66261FCCC0EE270D038B2694489BCF96F4167C18E67542DC6" "CBD6928197ABA97C9E89481A99615F10620E74E540E486E6CBE69D6CE0E65B83F78266ADB4" "D109BFABA7FA9D9C27C73F860163524202A18277122411F9212C15B88634C2C20706E158EE" "39A9CFACF1E054D8769F2F16989430BC7D1E0BA1CF9B9DCDEF6F86CDAF9EA397B970651CBB" "F18C96590818E49274FB032F2B01A072E5EA6EF75D2E7BFB3BE326F02BC7C7C7BF7E757FFF" "B367DB6D7823CD5E3CE39CB6B3FD05AE77F1E5D5499219A60DC04F040BDEC5ADB8B3613B70" "84251DAF2EFC91E418FA94D832139805325D246E9C5284C88DE25C83F962766E24F2434808" "DB657A6BB5DD8F186D8D9784BC01B4F96F09880328047BB3F76F521870D61BF2522FDD5885" "81153B0E7AFE1055FBE18EE98B1A3E1B49307F00F6D00FCFC03DDC57EDBF8343A1A63B637B" "70763FF92A4467BD25D2E563C9CFF027599D3E516EE5A2C439612D50E21D76EA2BD41FE891" "662D0CF7C71C2C4DDB5699CC5031AF7FDCA98393E34665914E1A6BBDC07FC5A828D2009156" "6624FDB8DE720DA81DFE632F07AD3D76962946F23D3477F4FE8F0284FABBCF04DADA2296F4" "A88D7151D9BFB22F6FBE79E71F7FE3D557656F6F4F2E43194F657DEEB9E7E4E32FBD2427F5" "F452F4F95B5156024065F30ED448E3CB7B74FC643403FCECF51B373EABE610D8D08563E4B1" "852430E7CD45C4D5A5C2026E77F80E81CD1296D377195639352F5FE37B1F4980494C0AEE8D" "45927F833B39315E875CEAAD4E06815E4AA7E706A611461E0E6725850E420B63DB7BBA3D78" "F62FF8418633F1B34980BE0AFA09AB90F209CC8EF9012209480D8109F4D1E565500EF3458D" "E61C06D3D8DA01461A2E0EF70597045B8385FB2218431B67CB5068991D49EF80F616F61750" "9262E1F0467DA0B5C6EB67185A3401C8464C72C364C41658382D99884164A902B919EF256B" "8AA0861F401960B67235182E071920926B6AE8A96925B79AC30A11570862EC9143E2EF2938" "D168E7F0774EED7EE5F62888EBE3C787FFE4E4F8C9C29B7EF1CA48C20E0E1ECAFEFEBE6C36" "3B222B0178CF652500540E1E3FEEBE5B2A27C72772FFC1C3FFFD23CF3DFB83EEB94F1929E0" "A55BE2FB6A45D317D9914E24485021D18784FDB3038B5CB52C6E09297EDFECE1E2B64811FA" "9EBCDB957ECFC4C254E69691CF1CB52C5C72DEE0B9F1EC84C6EC814C2800DC8A26B174550D" "BC0752392F8C891D658B67C67C4A04ED12EB38C7D9CDEDDBEDB3F2F1BCAEC205C09204ED0E" "7E4AE31881B3AA8F03084C98F0061E95234BA8BF4C56082DCD7E0FF5BBA2AAE99A2AA659A0" "239D2BCD0BAF521BBFCA6D721536A0B7A1A556F5B50CC63213189F3327243C832C146B204B" "964FC2A6ABB5B391F141A813C592E648B4E9EB6C98575FD82198D7C9BA829973FF743E80C7" "170EF4F64AC4B9444120F9D3B44514176DE1BEB34985B2776C3672F4F8E8AB577676FFCF6F" "FBE84BE73AF95EA43212806BFBFB52CB2097ECD0C30FBCAC0480CA37DF78ADFB6EA99C9D9D" "C98347F77EF9A31F7DE1B5EB376EBC787A7ACAA22F49F869C320B0E56279C5CD1EE89799FA" "51A363D182BD5BE89BAE04C761A708D189B18F10F0EF69C32535BB37C77FF3A37DFDB01F00" "3919C2E774AB51424442BFCA1A9308C0FE68B7EF47608C61636C0608B525C7E1220C2A5E9F" "8D5655C51CD90F3144CE7FABEA217CACF6EFFE36A0E0587B9E517B140E868959CF68387B49" "BB8D71E5FEDA9FC9BC629F0DFCBD7E058047C193A22DD4C74929B2C3A4592327201D360BE4" "B0A0D562F62B54EBD139D3257C4020AE199D354D322EA1F7F35C548F0808ABC97272B81739" "BCF8DB580CD06E8C497B9A56823CFF992BF7EF526B4E211B3FDD67FD98B8476B9FAFE75E70" "E81D70E77F37B291ADD49FD34175B339FF2C938B54C67E6E1F6DA56C860503D05ADE4D5909" "00951BB76E76DF2D95F165DC6ECF4E4ECFCEBE52CAF0A2871589A718A5585DA84C17368CF6" "8954AF151B86B64D2D3A15A7059F367FDBF6494C6F366E4FDE82CDCB4289B80D413B408E8C" "2241B2D766F385C5A0DDE3CE4BE4AEC8A8C55A05A57B68283CC4507A69D0889179FD5BFF49" "0F6DB7573540F34C6D35FB4076A686244D376098FB9FD4FC0948610E30340C756BA84F5121" "A7CA55F818988600A4026399FC00CCFF8E33EA21AF40CC2FE164C8F052F12C0376B045529B" "5B6D614CDB0157CC194D5B65F9014CDA0F2481C01923136C360A85C2608E7FC1A443512506" "DC26698B3B09064267D76B7A3611BAD98BDE7FB3F7B6609C6C0DB5F1C151C09C562BF7AC84" "674CE940E05C188FF806A1C1F9198AF73F3BE680C74F0E88455E7DEDD59F79F8F0E1A5B0FF" "8F63B4D9993328EEEFEC7523BE967757560240E5234F3FDF7D775E79F2E4584E4E4E7FA614" "F96E8D8A514029ABB807DA84017041FDEBF67093448C3BB0739440FDDCEEA7F8F9D2249790" "3B3D9C62665F723BDBDF10F31C7C39B6DF719853124B3A63DEC123F689C553E5263888770D" "32C977C129301BB417F6005714781A1868AA2DBB628BB080735ABC9342D9582B6012BDD326" "E4EEE708006BE6C251BE006BA8E45D9A56060C939DC94971B19F0680CA73E124C2E78C0887" "D2A146CA94B104821334173C3A399BA256CCB52B5234E49DE47BADBF2EEA7ADBAD0550EEF2" "65DC307192E1EF4A04F6C512D67FD61F09A4705F5774D68565E7ABCDCC300C4E38C668820D" "691A12E180D73F8DB39BC95CC3A4DEB8A4CF88C3359290B3EDD92BD7F6AFFDF4A6ECCA6643" "9A860B5A46E9FFF8C991DC7FF040AE5FBF75E1FBFBAD2E2B01A0B2B3FBCE556857872BF2E4" "C9D14F1E1F1FFFF501894104406009440AE51DCF19C96C7377396B689B71732C0A2A794E60" "62084DCE60E433C0D2F75B6D842CF99BA423266399E3979DAC66DA074846669AF0FDD8DD20" "0C399A34C6EA5B93E0D98CA171878F922A017D92EA70CD4217392CAF98398223315C3110FC" "CB02E99008E80E44D4B24EC54F800976461EFB006B03C008FE78C8823942683CE010496003" "200903C463ADDDDF85B552894B8536D13CB80D7F2E5382A404FE3E4AFC398EA5B016A94AD0" "28CDDCA9927600AC34CE41CB0511CD49159EF9D68F48562C12C16C4ECD43BF16CFCD315D38" "6BE38AB837BFB5DDDE0968048AC5F9CFE33F143F7B638009A2D7C89830A0D5422369A4ECFD" "5227E1203D6D9E77377BFFCB8BCF7FF474D80CDDBB71D1CA3856C3B0917BF7EFC8C3834752" "A708ACB5BC9FB212002AF7EEDDEBBE3BAF8C2FDBE9D9E9EFDC7EEAF62F3CF5D4537FFAF8C9" "B1ABBAED183929B46139D04607C1EA8058DCFBB94B2A82703B3E4A971BE72AD16435A7ADF8" "1C5199249D09244D7DDBD4D426C9C6F046DA149532BFB1C63E98386C53F7CFF1377532107E" "F196D5850D0EA4824C11AC2060A7AB789FCBC4C8B5A01EBED617C5E96D95005ADBE13F1A1A" "64A6003789301C2A9E1FC13C92A0D85649F50B698FCCC9AF9F77FF3CAFA7A82128094C0BB7" "4518FC0B324FB2341F3DE699C751D4808D8738E8F93A68C01B744A3EDF29B4817F7132A3C2" "CC93E67C80096520121408CE7458103FD169BA745A3D26F2E2EFAF39484ED9BE07AA8BFE52" "3AF9AF090B3611F0B360A25B6CC17355BC067402C2F1DEAF7FE5EB3F75727C7629A4FFD1E1" "EFEAFE55B976F3EA1439B2E44FB59677575602406572E67B17E5E8F191DCBD73F7A79E79FA" "993F1D9DBA045EEF63284FC8EF4D0668DBDF2C02006A4C426593486DDB9D7F2E90D2E39EBF" "045C25FC6B720CE848F712713A540992557125013DB320D7396DCDDE5F6A60DC16491AF4CA" "7C0B8663D67C4D8D1D8D04A83DA7901A7C7E98E756E0510DCE562469070251180C1DB85815" "8F396787B640B8882868AEAF9E0FFAEAD2BC0849C5B14AEF1B3BA6A56177206E6A7ECA77AF" "26B94A0A4F0C8541B0B4C39622182BAF8B60727035366701CC9A9D68E1F1F1EE0B9FB341F5" "D310CCAAF87159569088AC834B4B0ECA0276142CB59DDF11C6D5432747309A347FACC66FEF" "F6406B832334DCA4D6FE190A06C87C3C7C4DE6F79B48B6691BB6F5B78F8E8F7E617B762A83" "5E7C07C0B1EF678F4F65777F87F231ACE5FD94950050B9B67FADFBEEADCAEE666FF405F827" "2727273F3A3372CF2C57119E34BEDD83CCA77D16DA3439C21EB739894810191CEF44DC06CB" "CE42BCBD65FD2B3D22782362FF3775A3ED86063E6C3F76202EE4CCE48013257E971587F41D" "353385D941BAC2A64BE23D5DD5E383DBD4C33905943BA004E9770E210478F0813C90689384" "DE49FA460CCAE2F5D05CD706F809DC4A0B916449593A10CE017E2E35B60F48174D13ECE718" "100162C1D2C7D56117D2793F4D704A5372F0845740C4A9B998B36497D241038101F12A74D0" "10DD604EA84ED9EC677B83A27DDC136BD950901F05EEE0D174131492F6E810D4F46A3E7F21" "12A7F900140B1274523F6B1DCC91B70445C67CF4EF5C87696506F2B151731E16E9C83993A2" "91806CB7DB9FFEF8A73E31D9C59709D3C52AA3F3DFF1E1B11C1E1C78F8EF5ADE5759090095" "878FEE77DFBD5DB97BF79B2F3FF3CCD3FFF8631FFBD89F7B7C78E84E4900C6B6F134A72127" "022EB9286D1C9ED0461600817612B237B244E5CE658B0A7FDC1B48074B748540913DF4D5EF" "335867F28164257846B2DD26721381C040DFCC21FEBD932A4216F1F1E3BE843E938D3D1FFD" "0B29117B2CD9F3D5C15018CC85C609D2B98A7BF2532300E6649221C20069BBF8337D50BD7E" "046FB416A20D068A96A8097D6D8F347B32AA270A9148514F6CDC9384C903F7DF9D143DBCDE" "EFC52FF35FA61D49CE8D21B35D93EC59B3002C66DB7838F4DFC800122104FB3A6600E6367E" "3FC49D0EEC7DC498D3DB44B6FE79608B73676349C54D0D26BD7BD86C69C102A6A9D9886EC7" "1345C9EF65289EF301FF61D2CB66C436625565B3BB2B3B7BBB3F79B63D1B350172D1CB380F" "67A767F2644C76544AE6466B798F65250054DEAD09602C27A727F2C61B6FFCC3975E7AE9CF" "C9501699384BD0F38E3890631D9905C4A56A465C6CF0A69524E0CBEF810136E76CEF5B944A" "0B497219C9EA7222D0275A27294DC4B50AE4441762AF494B5DD21841259D8F61618974A117" "BC0974521354C4D486A07F714D4A50A9B3A405C9B98D22F66D05F6B3A39F722DF69DCEEA62" "13EFD0CE68BF2069D90997372339E3390F990FB2A935023AEBC4E9623C89C80D6620A8F597" "7EAFF49D016499D3E7B3C623CC079188C05DF37BE23FC299D09206A1BDC44241F6BC9D3894" "AA910237A9C53C17A6422F9241246AE632B9B4F7D423711AA968390C70C00F6903267DD938" "40D5DA515DBB651A85A00173731AE67BF030DCA9C7A5C8DEDEAE3C7AF4F057BFF1EAABBFB6" "B37339B6F0ED762B376EDE90DB379E7A4787B6ADE59D95950050F9C37FE4ED0F03CA657C51" "B7DBB3FFF1F0F0F06FECEEECFC1B67754BF9EF19DCC5B7179232077358B24D183B8E81051B" "22D5F69B10BE04792D88E724A0B2404E42646407CD6C0156617051A0AAE68ADD3991243F60" "8D49B85DFC5B9066F035F0D5BCB1BDB29EE8A76F309609FB030846FE004FFC66CB05E8E066" "1B0FA10C868ABE9AB4D8A2FFA67E9AF6A622AC4F9BF4EE836EE0597DA092E4CDED23B211BB" "EBD790346FDFB1BADBEE37700EDAA6301E15D7829CE0E85AEF8313191FD411A8AB50B40511" "8CAA4AF3E852B8F2B5BE8482198727AD44A617D60D738B82CC3D83217E17018015C4E18306" "EE65C0180E20BEE8A9BF73BCD88DAC9169CE88D9F8EED6CA5101AEAD7387C130BB14E16344" "A272E5D3B34755F8E993935F7A74E7BE5CD9DFEF6AB988E5F4E444B667671301E8F784B5BC" "D7B212002A77EEBCD17DF77665DC5C0E0E0F647777F3539FFAC4277FF8F4F090E27D4B0226" "45489A79DA4FC78392B86ED2238EB93599A2F0061A374690000EA19288952CE5F239E6ED1B" "DFEB10AE570218048995B3FFB5E297D0569F90DE2563CB2E9754DFF068EF4B068C22740230" "9D51E0F66192E902097100AF410D1EF3DA9B8499A55AEE16B2E31337B01F2BEE27713D8379" "10E5DB9795C886CD294BFF793E49FD6C752DF92EB033DA8C9CD51789DA2AA0D1B594CE4620" "4425EFBCEEC448CC533574C8C6B726274091DEFCA06887A4EF6D92352C6A8B7E2876D223DD" "A8830F12B405648C371F16114F1BCC63856B6B69B67E6FB39D04C82458D1776A1F16058F69" "730B6A646A202D009B1F8AF918F0815393C5619872909CD5EDFFFAB16FFBB80C97C0FB5FDB" "790D677A3665615DCB0757560240E5E0D1A3EEBB77528E8F8FE5F5D75EFF471F7DF1A51F9E" "1D72DC96CD581B00A994F079DE5848FDAE01896033B52C720E5A43275573BE812C08475610" "D59CD8AA28EF3F4B4F7C8009367D647E73E9A613FA13A61722103321A290A865F504C882F9" "BB55CA2B6023132205C8CF021B2A4898FDAB344F6D73A7A376F16C036068F663063E7752D3" "20C1AAD035A82B4AB7B80BC4C17C14A24921D44960AA2294CEB6620CF15CD29C8FF667BFCF" "33F6615CC86C505590DCC71EC45116517AAF780C876A664D0324FCA0FA9034DAAE118AC999" "3C83A53D1FE44238ACD64C6004B8A691534FCB8BD6A7F56F923F4C2A01A4FD74CB3926DDB3" "F719B11FA6EF075F274D809F62D64B99C3F5688DF3788100253F067E1586E918DCEDE74ECF" "CEFEF954AF5E7C75F8389E4F8E8FA5EA566EDE1CB52A6BFCFF0755560240E5E68D77960A78" "E9BEE3E3E3DF7AF4E8E1CF3CFDF4D3DF7FF4E4099C7F5C954F6AC72E418919941DB87C538A" "0CC20549CF851E728DE7BBCFF196315531EB104A93FAFC3B6FBF14270353C6B3E2B1F306E5" "01E8101E45DF363B45704A83D4AFB32924A85C9D54D84ECD5261A1F18494DAC80040B4781D" "AC9A36C252A1D1F0619EEAD0D41B76A6E310410BEF235073B0F64A6DDE202BE35A56802848" "9534A9B57679F73580A0B7B0067F86E83F114F3C44EBD03C566F5748DB45C9AC0112949E4A" "635293368095399E27823A5E789DF8A01400A3FB9E808C581E7C96D8B917ED1DC23C5210AD" "6BD1987CBB146FB12A0311DDA005B3A7E03D704D01DE9BD124388508CEA46C94F4C70463E3" "D9F5433BB3405540F6FDDC0B027D8EC8C16CCDBE1E57F7F7E5C1D1D17F3B4AC29721F5EF08" "FE27A7A772B63D95DDDDDD4415D7F27ECB4A00A8EC5C79EFC331AAA7EE3FBCFFDF3DFDF433" "DF1F3D881432B9C4D73C4AE3AC56071696704928D81B9C60D826E4CE60FC889885ACCBC74E" "6F56544752B64203230BA98A61EC00523C36BFAD4D14F76447952A885103215F3FDD1F9DF9" "3C214B6532656009FCD000C6428054585D4F0F32A918F704709FC146F3A089D709A2A6CA1F" "50AF0A39432AA8482033DC77685E58E0630D7CB58C7C714ECC37C1D5EB39CA823CF4515993" "A0395D31BCE90B45664452E764AD0DB039ACB0292249B5215574D362F00146711066D5FE34" "14AA7EF8169FA950CCF37F007D86677E0A038CEBC84D39768010CC0A940DD05F692658B476" "E99D97A6D51B876BD4160CB63E89389BA600EF0F29FEA8A68970EF8ECE7F0707475FF9CA57" "7EF2EC747B2992FF8CCE7F57AF5D959D4B72D0D1875D560240E5F7BFF4E5EEBB775AC685FA" "E5AF7CEDBFBF7DF3D65F7BF623CF7EF6F1D151F40180084879C5C537F12CA89BDDD38E3A0D" "47EC2E4999B031C63CE9B483D85EDDA9E44538D4C97745F61BA04BC3F903768F014894A4A3" "B6832557957E73B73F547C03C743435FA3C75F55EFDF2C75D6700F484BC8BBDFE001260102" "916E1EBCCDAEC177AFF8EC550FA8D7D46FD22274068E60BBAF685B949AA306840751B14E62" "9B7C1EFB3309BAC1A74801E31A39C200E3C7044612D9CC923E93195710501D8A4C834EAF3C" "B48F8D4B059E7F4650442CD50F65236A6338D73FE0901F4EB13BC4762B5E93B6C80B7D1EC7" "60088E82F6CE44023CB7CB24FDD9BFD7C9019F841DD6B20CD12C62249DA283C6327AFCBF79" "E7CD1FBF7BF7DEEB57AE5CE966F12296715F1DD5FFCF3FFBECA5E8EF875D560240E585679F" "EBBE7BA76572063C3890FBF71FFCFDE79E7BFEBFCA9B84EF8DBE81DA9721931849E91CE32C" "6A6A4593324BD8AC59EA08FB483E49ACB2C391EFA54DA8A1B6767EFF50872A24AB08CD1AB7" "43983CD0DF4A36FEF3341B9C9085BE0B271CB64D117E106DD3B614BD8E191442466A7A4D79" "055D6B2009EC7CCEA0029FC020910BF2B667F17F6A0E87E60532A05477F2E40760D3D831A9" "605F0348D875F67EE7A3854D5D0E9F3F72A4844F04E57C30C9BEA9AE89AAC1898F786CB067" "D8F74B9C71D24CD151D9CA0E929477DF9C0E2348A6037428CE7E16CE6358AAFD39B4B8BC62" "5CADC4675ADAED6A9138EA273472182EB466445E9D20AB6CCAD0D6B977DC56E9B6F2C15FEC" "6C593C3AA753732402440E88474747B2BBB3F313DFF527FEF8B9A6BD8B56767776E52B5FF9" "9A8C66D55103B2960FB6AC0480CAB8D8DE4F197D01EEDEB9F38F1E3EFFFCDFDCBB72E5E9ED" "745885DB1BA1518497727BD8A4DD2A9448A460930E805F92D465400E2FE2D8F8E070868D8C" "9CF628B10F3CDE495A728242129D309B61BBB4D9AD79AF53FCCB9A086A7E57343965C1AE4D" "BE110618F30649E6894C4000ECEC34A768A7B6410E9BB7399605F53F03B424893DAAE6F977" "47456A170E05EAC7D5C2F178EE6072C8D1004AF519ACD4446CE8943AD0336B1FA45EEF8B62" "AE0953E17027CB8750F15412F1B175608362F0CCC42A10C4E0FB42CE82F45D49C7171BA9B4" "94BCDDCC375BBB3956FAB84878D7A2E988020026ED814013376B0D5CE3C5CE7E46AAB56533" "1C7FC3A142296787C214C3AD4EE7FDDBBB60C7030FA3345CFFA7CDB0F3BB458773DF9F8B54" "C6313C3D399DF2B3AC26806F4D59090095078F1E74DFBDDB72787878FFA58FBDF44F3FFEF1" "4FFCC58383C3E0F13E1596E271A0884E1289CBD32459370FEFA98E8A9CA44185C87B01B6B2" "E082DD3CC4DBDF1C5E186CB183DB4C39689C3F065343F1E71B318134A7DE1E216027B8EB4D" "0E0B9A12DF184B93BE81B2941AB67A050D1D664FF9E844C0B66693D619583BB34A92C05DB5" "50F137A4F2E2218C4B527C9CA9789DDBD96106A736E7F1A036805B558076D01A98EA590831" "115FAE4D9F61D7B9C4AB21E90F49BE38E4C7DB04D2D0A23972E246AEA38AFB7CB03A5C2CDF" "021F3CC5D459DBFBA10306C54F9D24BB7B0B9393E6583AB5AECEDEFA46564750294DC33139" "E2B1632E85E84D367B03788BB6111FA77CCC7581DA7F7E5F4747C00D4BFF4D8B326BF106E4" "9F68CBB199AE5CFBC1AFE8DCBE8D9C1C3FFE6F4E8E4F2E45E8DF5CCAD4D7B75218AEE5FD95" "950050F9C833CF77DFBDDB72FDDAB19C1C6F7FFEECECEC2F4212B4CD8C364548F9337A40FD" "3F98F3543B67BCA17E70EC6349DF34DC0221BB491366E3B64D8BBC986159A00DAC925ADB9B" "1A55F831D14B3428E71CEED66B21D9ACA72A6EE28439812544E5CE92144CE44659CDDFB66A" "564947B0D5308EA68E26713DDAD609A0313612BF9B1DE02AEE61CEB5443E0C98421D4C8BCC" "44A16EE2F06B0AF5D7AE9F11370092B29A1AD98A7CBD00BC15CBC363D67D3E943A03D53BBC" "F2F10B6926A4650614223471D67D499AE3601BD52AEEEFB23088855443E4B80F67BC794D97" "748AA6025CFDBB18833F45B498D6AB11B951A350482391CFC3F077A7340D821303017F615F" "9FF9FB09B8E11712A5FDDE2FC7A77D4CFC73727AF2B9870F1FFC1F201997A11491ABD7AEAF" "07FF7C0BCB4A00A8DCBD7BB7FBEEDD96313CE7F0F0E01F3EFFC2B37F637F7FFFA3C727C762" "A2454A74EB214BC5373893044A9310904EB544D0466C73E1BDE73CBD8097804BEA9BBD4994" "B07FABC753032862F3DBF7F603DB3A35D89BFD61AD102F89E0EF52AC4952906195F980834E" "9505C7486645C9C1CE9DD214B66106F8A8EAF74605F0AF0E5450E322B18E4BDFC1AECF84C2" "3CD2D56DE2AE35A8684D2425314BDE6CBF6EE02E432406F04E732065534F55154DD360DA93" "865D89CCC53109DA08CAEA27960780788BF3A9E85322E447328B78EEE4377D4FD103EC1E08" "35BC8D316BB0480B80353079F0539E8AD925BF9946D89741DBD1001B6808A4A9A135ADB1D2" "C698D762AFE9C37FDC0D87D765E5138CFB705D37FBE9E4FCF7F557BEF113AFBDFE4DD9DFBF" "F8CE7F66827BEAD62DB9756BC7876D2D1F7859090095A79FB9D57DF76ECBF8223F7EFCF8C9" "1B6FBEF19F7DEA939FFA51AD96EE57DC76CAF66C6429F30771367E0DD20FDB2A4D32B20DDF" "A4ED3E9108DB4507AAC6240FE03687148A7467E347E7B298B780377D6F795F0208F88366C7" "3373F4CB590FD51FE1D2A78BAE0E985CF26143CD07D1B42310DAC9AF9D55F8B9AEF048F2F0" "174746CDFDD73857B69169B5F0438E248800C2E4A1E610BB76AF819C3FCBB504A1F5E4DD6F" "64C454F98A6759929B3A8FCDE2F471F887425B042747BA26DC0ED295895A985033F2CC7F13" "D169BE8D2DE14ED06B39716EF598B4A866BFE7043E6D043DB976036F33AD8DDA99A1B614CE" "9E7DB3500E0C8BEF67FF05BCDFACD5620D8FDBE59C3098DAC5AE4D69B3EDD9A336E2F4F4E4" "8BD7AF5DFF894F7DE21397421ADE1DA31DEEDD9B12AC5D1A6DC7BFA6B212002A878F0EBBEF" "DE4B199DFF5EFEFD977FE2A9DB4FFDD51B376E7EDBC9C97108093469B79207FBBC990C3145" "AED019E0EC042FAE0637105B942218FC0D7C42157C0543B39FB9DEC16A023D9700F9A9E797" "100AD5ECCDAEBE8EA9E3B2177C21D050A87523D0D776108CB5A593C6C5D5F08E240EA430B3" "10E89B5A9EB00A7056D904D1FC2C1CCC15A9DC0D855993609FB3BFC376DB0EEC05B892D04B" "6DA28122F386CF036B42306E6D6D6DC76C6AE60F50D4330FAA3FD3CD1C99D0D58EB0B4C190" "D4ACB47616D647BBCF33F911A1327CF4E00402FE949CA769A1408C4D0B60984CBE2C62592E" "2DD746BBCFC1D5EA6D0484499591777220B4353614096182460C586BA72D6203393BA0614B" "59095BDB475F847BF7EEFFDDB3B32A57F6F63A727711CB6618A6844767A727FD7A59CB075A" "560240E5E17B4C059CCBF8A2DF7FF0E0F4956F7CE3C7BFEBBBBEF33F3D9E8EB09416EF3B6F" "16DD0127ED385C537DB36ED6C2938440ABD086E2D598BAB4824C902F1FAE91763889A6CDC9" "F7FB2CC2F9F70CD60650F01B8016E22D4A071C8E6CAC10C8C6034FE8637D9779E366757C52" "D506153C03200D3BE9A8B1D968BA47DAF33D6D2BFB1090094012D9B07D5DE1B287EB4110AC" "E3CD53BFA6A37CADC351C5BF80AE4105ED806E7676B1C39E002E2DF363F2608F842481B649" "AB697EDC1C914867CF544C6903B2A314C921380E3B111E5F7D6E512FEE30083399A5F9695A" "134BBCC3A17693F665B3F1303B1C356CCAA724D943833090DF4E7C9F3877C0D976DB9C0E55" "B667B3FDDED6B9AF3E4F47E4AEB99E7D92FD0F54E5ABA7B5FE83D3EDA99C1D5FFC14B863DF" "60E773E100002000494441549F9C1CCB932727ABEDFF43282B01A072FBF67B4B05BC54AE5D" "DB9707F7EFFDFD87F71FFCD0EEEEEE53A36F40A1237519ACA70DB0ED7438EDCF5405D8C45A" "099B6F76ADB74D5F20936B732C3468B3B8E91A0E7277C02B85DA478F61F08114E50222001A" "25D9A1678FECA49218BDB09B131D6455CA36E87D7635BD2750822C4D2AE7960CA85A3639F6" "00D39845CF9B16EA70A08DD2EF12282A69609834996620FC5D3875309DAA679A00F67FE039" "69E316C636F090A84150009B5F5C013929478038CA80F074C4C2099239DAD9B30D76399F3D" "6B8D6CE5321170B397C0D9D1482AF20058DF9828DB5A02283790C460CDCE7806C6859E07C5" "92F9078884508B49926F1A032618588FA47AE3EC1BEEB4384CA03F6A55748A2ED89DDE2FF3" "1F90998EDB04636E0BD8B9AD278F101AFFDDDDD9933B6FBEF95F3FB87B6FBB774962E0C7F1" "BB7EEB96ECECEEC8D9D949F7FB5A3ED8B212002A37AEBF7F1F002E4F9E3CB9FBE0C1C31F7B" "F1A32FFEB5319615928BF41B6D216054FFB36D6A85E2E34DA5ABF33900B8AEB89A73BE1B68" "EBC7B2BAFA524CCD4D1EF53009D81E6CE1585A025E09A0D625A5A89AD4A8B66D366265502F" "169A55C949CE03A60BA467661951BA379264646ABC666B5EF1A65A2D4C549C148198A887D0" "4DEAFCDAC6B45823D80721DAFE554DED0FFAD2694010835F29D4CFFA50FD2861F30DB052C3" "813FC62C66425371725FF4158019C3FA202E25B3206F6AE8BC5290837F0188D19690B8683E" "9F9EACFB6D6D4A237702F24A9C259104A5EF0B5D559A3ADDB562485E451A106DC0AFB626D5" "92E7508BB61EF2470C790668CAB688B300064B79AC786EB14442B4A6ED99657222D834DF0E" "0F2BCC0E843C5F083F145E624492AAC866B3233B3BBBFF6CCCF93FE6C1BFE8651836F2F8F0" "400E1F1DC8DED5EB17BEBF7F10CA4A00A85CBD7AB5FBEEFD9431B1D0E3A3A31FAD5AFFF230" "0C57C98D7AFEB760DB8A7AFA560A6F188481C1539F33F495AC1170294DC481788E3C20305A" "52DBE20442539386A079476889E0000427B04512A3A06A9E77B9DAF4E4F3A68B2DD51DEDA8" "236C0F2FA4FE475295006A35DCEF3E0011384505E7D9BB2926025F5465A7B1F4CECF4F55B3" "85BBD6821D19A1A5A90CCA14D6C8EB838A4245AC0EA0CC140DF239C7BC5480624DCE84EC2F" "60C412E688EC3BE18AAB48064AD312B12ADDDACAFE007E3369497C0D66695F9BFDBCD68AB5" "B26971F69EFF5F1B28D37A9AD4FB03C6DC007E06FFA1F92ECC2680A18BA8F171D3D13D6270" "326C24A59AF9ADCE270779E85E01C11B55FE530E00442264F38CB5B9CD58CAD4696331EE45" "0F1EDCFFA7F71F3EFC95ABD7AF5D78DB7F99CC276772F3A9DBD3581E9FAEC7FE7E18652500" "54FEEEDFFB3BDD77EFA78C8BFAAB5FFDDA6B7FE1DFFF0B3FF2037FE92FFD1777EEDC21699B" "12ECB8FC2226C79940CC3A5325A00805898218F939432027315992E8E21E640F77185B0028" "52F9339842371C6A736036291BCD9442D50FF3B5E7259391B89906E73ACB9F8F843CA5EB6F" "766084F4DFA9B0A34900B27DAA47592B80F8FEE6BC57533220A56BB39F842A0EF281431F1F" "C4637C4BE38141F12858375D3859C0A410F8866F51262236022E0BFF69CEB9BF582644AA6A" "D5606AF0AA4A480EE55F65A6EA1671EB9B81F8B6A5C2D6364EA6A470FF13E79EA5BA96CC3D" "F82B346518EF6663F63043CFFF3F45EF0C1E6130B478C1A8A92BA87FBB3DC318889226808F" "06B6316D7554B1281CCAC73D3E6B3A525CE4B5D75EFF2B6FDE79532E4BDEFFD3B353B971FD" "86BCF0FC0B524ED7237F3F8CB212002AFFDEBFF367BAEFDE6F19F3773FFFEC33FFE5C3870F" "FEA39DDDDD4F9E9E9C90ED8F55F651796CB9C76C47725B6945201369EF432CF65C01DB78FB" "33C3BB0D8F4F8A6B52A0C764B3CAD6C3C742ECB5CC5211AE4CC2319F3D2FB45907006EE00D" "E934A595EB803C83713BCF3F8C26E7A90F527FCC6D1F340CDC70E138FD9E3801E425A9C6E9" "596CB250066ABBA4C6E7585B82F6874D1913805527865AA84D4C58DC866FAA7D50A3404804" "A46C1EF27E9CD936CDE48FFD15A491BDCC07358CB5529C7D70EBA3F5ABBC38A66FCCA3BEB4" "B4BF76E21F344B48E613CD0B768CAE3BDD9A6D89CF1568C48AEA189D644352215A67E1F46D" "4BFD5B365807A32A1BC4D9C6D5228090D9CF6EB70C84BE5E6FDCB829BFFBAF7EF7273EFF85" "CF7FF1E9A79F1EB38BCA452F63C8DFF5EBD7E5C5E75F98A2A8B210B1966F4D59090095CF7E" "E79FE8BE7BBF65B3D9C8BD7BF7B65FFFFA2B7FEBD39FFAF48F9D1C1FC333892DB00CA43370" "3707A95AA416DA28915380B2F4353B6949260055B2AB13B2517A21CA49D0D49DE63525D051" "FAEED580AB64E06EFD806D3DE50FC84F37DB7A14BC39835B23032DEE1B206A3501BC0CD4DC" "3410C147FD7A0E99A46BB01993F4CC44C3DB48E05F3DDC6F061C4F3B0C3B3AC69FB408AA1E" "B5507DDEB5CD2FECFE682F1D0A93FB24313064CE0B505B9D05A05B28DF40698E66E61302AB" "13B440A07661EE4A09410E0865AD3541368841246C34F34E7A2D0220382796A411A2512F96" "81B936C97DBE6E08F3C8E627EA03C803F911E094C018C24A94CBEB83B42F8DBC9866A111E7" "0A4ED1B208527FAD6FED28652850685D69CBC930DDBFD98C7944C6B9FCDB9FF937BFE352D8" "FEA71C20752BAFBFFE4D79F2E458AE5EBDD65DB2966F4D59090095C78F1E77DF7D1065D041" "EEDDBDFFE31FF9C8A3BF7CE5CADE1F3DDBCEEA2D4885E6C4860C7132AB41C5BC9239CB1939" "5D2DA86BED6B48E50CFE0C98D2DF27761F36AB598559E88439DEBC8A44C9327A38538570A8" "72293D680200FC9656D7F513AE56F7902CB6AD662063C95A54BA1CEB26917A157E48132470" "AB036DB6F31A9A5DDA47A20135644D220DD1F6DF110BA16B7216399E077252732748EF8E9B" "1B0878CD86521A48D3F43B81B0C37534100F03C4C26D8DE7D806497DBED60F9832606676E7" "9A8C12E6CCB2E9A9527A6A1036F24524AD03D6811DE96BC4A0A071615D0E4C05482BE64497" "DF0B99F46E6AB92470668446BACE070859222A9DCF2AD0327BFF4F3E2D18038A8861B71923" "D8EDFB71AEAE5CD9973B77DEFC3B0FEEDDFFFD6BD7AE49DDF6DABB8B56C6711AB31DEEED5D" "090777ADE55B5F560240E5D5D75EEDBEFBA0CAA3478FE4C6CDEBFFF3673EF399BF7AFFFE7D" "DFBCC89E6DB2380A3629DB24A2F357514B314C21541A251A5C6BFA47729C12DBC2CDBC202E" "0D4245B9ADAEFA0D3687947B9E4AF0656CEAE7C207C5B45B70926B2B73121FD824DCC6DD6C" "BF70522B253CB75852A504DC95DA9720CB2099409F2561DF94959DD918FC494A9F1BEB31DD" "1240D9FA66B6E1F9FE22124E1CACCD1E3E8ED3FC67C54970619C832942DD5B5DA377BC8FB3" "A30DCE2C286E23E7104C1F536DF1255E0780DA08049144A2336E16B28E81C29219C17E6D3E" "07856CEB513D6E2D2F813C95962C665B5DF355E87155388C74EE0B22557436AECDCBA4CE12" "FBE0E7F147726C63C31ABAA87128F4E0620708351F03218D9693FDB906239D4CACE6B8773D" "92227FEBF9175E98B48717BD8C63727272228707075227D5FFAAFBFF30CB4A00A89C9C3CE9" "BEFBA08AEA565E7EF94B3FFAC94F7EF23FDEDBDBDB9FC30219AC6D5F75902F26CDA9ABFEDD" "E63A23DF047E96D4853903A475D60C445B6BBE1EE0CBA5386098664248522B03930989C7C9" "02B35A243AA2B08AB782D4F92695CDF66DEA6CD5B0194B0348489CE29EF1680B6B2D028031" "F8B53164934629E4A4C8668D48BEDC8BDFC14F6DFE2A01A5F1110B3514C10142EE7761BF94" "395D71D308558D24424C9DAF46C05A1E0903233CB104674A801A816C17E2C8EBA4112E5E98" "A684F085855E77008DEFC22AE3EC87822C7C0A26E8D127514CB6E43D255CBF6D2A034EA815" "92F80CB6DA4B1B7B5B834C76DB38E900895E9BFDDFC88A3902460D8469111A012A4CE214C4" "D6D607B4097367287C751E1F6BF7A8EE7FFDB5D7FEF3FB0F1EBCBABFBFDFCDFD452B63FF46" "22376A3D26C747B9D8FDFD8358560240E5C68DDBDD771F54B979F32979F0E0C12BBFF77B5F" "FAC1EFFCE37FECEF9D9ECE492ECC1E6A5ECCE649ED2182E6C9EF2A6ADFAC9AD4A04DA2B0D3" "52AB9EB33102A29D48F8F68C6B719D72981D4B470551809D731C83F0B8194E86DA01D2B59A" "745B22684C854ECA631601B52BC5A0BB6777AC83FB290423D3B39BDB359B114C63504C2E27" "A7AD0CFE26C5077F02023D31C98F40C2EAD7D44625153F341F2CD9272743BE4FD8DE1E1CC8" "EDFE9A00DC257BBF6456FD6B29C9D4320F41303B602AECBF943B229107762CF452DDCC6292" "396B83C6B4C4E292BC79FAE331B6249BC1DFD4E21B3A16D7C6C9925E995EC242F53A2D43BA" "0FD9F7CC51B3CE24A2B684589E67239E0DD096730B359CC9EED6AE6FE1AFAE31C280756B76" "F4F43F3C3CFCDCCB5FFEF25F1FE7E53248FFD2F25DBCF8E28BEDBCFF55FAFFB0CB4A00A8EC" "5FF9D63ADC7CE499A7E48DD75FFDB1BB1F7FE93FB871FDE6771D1D3D6E9B46818848427603" "603F1FC00E706175AAC776037DA77B94764E3893B5CDC7C9410B892A963F5FA522491D65AB" "133095B6E1557F1ED4BA0592B4389C0298DCCFA179A5A30E8D751079C859FF5845CBAAF9F1" "EFCA71E4ED62066A26158A3CFB86F4B3DA98CD0706224E5C7286404AEB5BAB83A89047BD8A" "6FF6E468E01A8978760187F5B16982FD0A3CBC339B03DC119104741F2F12BF8D8C606C3822" "81247DA77B441EC8D19489986FDEECE419350F8255A6F8DB2F88F9F64148A4F8013F95D631" "01E8D4A4A104C264E45829C7FF7C063FB9F027A74021023C6BE24AC8D1CF3E3BF6FF9980CF" "6D9B400C4EA99AD36460048249C7A4FF9D1DB9FFE4E43FF9C833CF4D79F02FBAF43F8EDB98" "1DF5DEFD7BD0BCADE5C32F2B01A072FFC183EEBB0FB28C9BC7E80BF0DBBFF9DB3FF2DDFFF6" "77FF6F93ED71DA94142420E73587B7BB0EB0F74F71C93284F0A4023BF9A82165B1C980BA81" "7B2950474F5906874212D7807B424E7DF158EB5228FF8F990ED2266A85A557980DAA607347" "E30C1BABD211A92C4DF291B0D2341E49262D1293FF98B41E6B83AD1812B92A2502B294FC19" "2C6BDCC959BD6F59F7B089317A6AEC3FA539564BA1CB110DDC6792C0D1D379905CBBC19237" "457B204A41381F00013B83336B7648536458AF4410005EA9CE1928D36955BC1470803FDB86" "9AF681CE2020AF83C6333C535FD668D107B46906FC396490A575BA18FE126563A7060A2477" "4BCD6D4EB0E1C021FABB2049D178ED664EFB5B52BCBF38D9A657A5D3988D3F8EEAFE575F7F" "FD67BFFAB5AFFDF4F8F7D1C9915CF4328ED9ADEBB726E7BF8E25ADE5432B2B01A0F2D4D34F" "77DF7DD0E5D6EDDB7278F4F81FDFBB7BF7676EDFBEFDFD878F1FCF59CFF82014110FC952DB" "DC5B885713B8E6D0400E2E6EB7959646D64E1B2B9619CDA518F701A0330848BDCD6985E74A" "5DE2732DA603B8861D8EEC15ECB10D9333353485025A1D9C1487D51B00A78C68E2CF76F53A" "617090DA231833E0C243A293BC05C0A1E20E7BCA5A8EE23660F4B2FD004741EAE4A41168A0" "03ED83F0737DFC828627680BDCE9136353BDFF85884E9833900BF181A208088C55037605CF" "9CD715A78F76FF0E72D46CEBAE5038A8F9B6F0DC943C974440598B83654504495A463FB7B1" "63353A89834921F90B2C499BF40E291D24A42D61903BE9FAF21EE3FD41981131E07336F587" "320CB2D90B263DD1E994BF870F1FFD83BBF7EE4DB1F017BD8CE370F4E4681ADBAB7B9723C9" "D11FD4B212002A47C7DF9A30402EE3E27FFCE4B17CE1377FFD87BFF77BFEE4F78F0C784A7C" "61C0605A001C176CEA740F172CEDE440E14D0A8E450DF8213DD6A639263B7E311BA520FB9A" "9F40D6D4C8745890811F0BB79DD318C881C2FECCA0A39D24AA0E44E65818B2D799D354810D" "394ABC242137708A6A73DF60433B0C7C93894060068804C0FE05B67B2F64D63944293ECAB1" "4E984CDA178B9F47B6BF582F24549C1E17490EDA4B24248F0B54FAA483C6EC581E023EEC06" "44CB4D2E0CBED60955B7A947A248DA25711579319577719F86D2FC41C4325BB6E7CD24D8D6" "AAAD9142EB5282B66092F241ADCC3C66B10B64CF37C0B525076D91F9DD98062A49EA96669A" "88AD3901D6C97F623B39258CEE087BBBBB64DAF7F52C1E90496BD088D5FC794CF97BE7DEDD" "FFEFF1D1C1FFF0A98F7F5BB75F5CD452F5B60CC38E8C89D1F6AEEC5D9A7EFF412B2B01A032" "E6EEFF30CAAD9B37C783823EF7F5575EF9DB9FF8F8277EE8E0E0A0A9E0933D92DAE24056B0" "39F3E1264A16568ECBB7A43FE668361FB0228004B3DDB31D3F488A5C8A6F845C4010D22F00" "1B218936ABC853063EDE80213B294161003593EA7B10E4919BBDEE9988C4308528F193D42F" "EE98C8200F2D84A6E705C99863FCE1FEDFFEF19CFCECACC7A4060D503A265A66FF0BF6EFE3" "AE56FC50C27C3868D7743812D7A341DBA04A9593C4CCA484C7BD0F7723DF93104110E7DF54" "E4A6015352B3F35A0C2680400EE99C0A5E41C54F820C4EB0031DC2D3DA5186C19B555A1480" "B5D17257D03854F878CC6607CBC5C06CC13277BA56C9B518362FA3A3DF28007CF94B5FFAA1" "D75F7F4DAE5FBFD199D12E62D99E9DC9FEB5ABF2F433CF2513CD5A3EECB212002E671FCEF9" "D3E3A2DF1195DFF9ADDFFB2BB76FDEFE33376FDDF8B71E3F3EC26F015084A5EFD23204363B" "E4D6549B2EC53AC8923C13AAA9A82B80FD5414C7110B808DAF7335F840DEE1B3E06859E808" "C4E743F41D68821681804F5CEAAD2D36DD7D10CCAE6FC4A75244846DCE2EF5770443E63CF2" "0ED6AD9D06E8B699D3B30CEC83BD9BC0006393C850B4AD378FFA96FD6F56F58BDB9A176CC1" "4CEAFC04C75877D47CF8B354CC498E1A2BAEFEF6F9E4E16120972ECF8469578A5D8B443AEC" "DDE68494EB9DE75282BBBFB6F64CA0D9FC5F8C189ADB4A2155BF2B262CDFFEAC299BB4055A" "DBE99581CA7A9A616DC74D0B9191C92C614363E4611E6BCB1360668BC2FD6F1A1336918DE0" "5DDA897F205E785F6C5CDDF136BC664D03B17F755FBEF4A52FFDCD575E79EDFF1A93FE9C9E" "5EEC24383A85FD8DE3B6139D31D7F2AFADAC0480CADD0777BBEFBE5565DC3C1E3E7C285FF8" "8D2FFEE09FFADEEFFDC542523B83A89050C840399522423BDA0CCC9036E229E628FF7F7B5F" "026459765497F7FDAAFABFB6EEE9E9694D0BC90824C10C20096C85C42609894560908D3084" "0399C50E108B30410022641C8158044480418EC06121DB028523B09130C82C811CD8488025" "248D66ED999EEE9EEA6D7AEFE9AEBDAAABEA57FDFFEF75DCF76E669EBCAF06648566A6BBFA" "A662D4DDBFFE7FEFBEFB7EBD3C79F264A688C55117602F523ECF75E6E4B23735947880D3E3" "7B34D80BE64FFE89A9BB07E3FEF0F21913A9EAC3DE360B531A58DF0D8374783F2517AB0FF2" "DC2172D42BDD03F15AE2FF46A665A0E299C08EBD31CFA365833A659B5A909641F62A902DE1" "E3C27EF810CC39E406846C263FF1F74845704DD50547E4BC63FA77CC81E3AAF8FB4069EF02" "4F1C8472545E9F3A6F271DDD581A583B4BA7ED8E83DC6B278041F612016874B6D1F927B050" "25902803AE645E052560E7818871720EE7603A5F0D22F4FBC0E9014DA9A571C6700FB815B7" "C7E643927EB2BF1B9CDCA97F7BA0219000E310278FF6687363F3F4030F3CF88BFDED6DEA6E" "DCC8377FCF59FD1DF444CF3FFCBC7A6A62B1E7DE0A00003B74E7332F02443B78C77EEA6F6E" "7DFCEA95ABBF73E8EEBBDFBAB9B1A9B4A199B1AF942211D726DBA6244C8C7AE24A2D109BF1" "9319F2999241CD3A034A18261DFCB4CC4D233FDBFC8795FD794318062B4809373F843CB10C" "FE494EC934E2E1F5B2802CB4F685CFA50F628DCC853E1647EA1278512A9F903A378E140580" "DE9EDB44EE411C51707A169F95689A123FF8A873593742CA1C3FE48F75A01236CB476D45FA" "0C34B531ED8479AF08D11B5E07C0A7A07BC0AF11384BA4D5112088DA53BF4DB0874E588046" "BB5A09403300C61414E8EC828E99ACE77462A57CCF9AA85B9914A866F069FF986149C0B682" "FB41022434A54575BD8D5D1433632C565531AE05D4DCBF0BB31E5CDB135F5F595E7AFB8B5F" "FC22DFBD4D847093BD2ECD9D3E530F37DA7F605FEBE7C59E7D2B00006CB8B3D37AED99B4BA" "0D66BF4F972E5EFCDDBB0F1F7E2B76D523118905F3600969C63B3FC8982EC5284E1FD5201E" "CC54CE6CFC2C55C3875F9EB26D53949A4FB7FDFEE567AD839074AF0BB81ECC979BE3668003" "287BA4B0F3CF28E0702A10ACCB2782B029EC7843E6B082800276A404CEC63A66A6671CB41E" "56111C680A1C44DBB87F019C2C03976CDF4C5A24A8F4CD6105007E5F20AAAF8F8F4386F8D8" "2233E02A0892325401248132A7063A0E6F418A96016A44CFC76FC6F83A6024E00BE71C4C70" "4C552B2E487F0406234D531E82630719C78BE9985C0B8222C2A6A706DF1347DCE4CF0BCD56" "69C320F89CFE3EA9E640D364DCBE96D31838DF40BB5BCAEF860F34BB6F96AE5FBBF681E3C7" "4EFCD9ECCC0C8D76F6FEE8DB58F3DFB9F38E5AE7B0BEB6DEA61D8B3D27560000D8F4813B5A" "AF3DD33675C73EDADCECDFB7BEB1F1DE43070FBEEDDAB56BD4191B03C7AE1160E041C09C57" "247842A1716321422196F5F4010710B5684C3C96A60C20FED7879A7A4275C0EC384CB4AE0E" "4823D03C6F4EA051502C12602680A2089BD7D6D364023DD299FFFA96E63D1EB4017CAC10F4" "7C1CF94B7FFB1C7008DE80681F86EBE4BD0BD841B193553682DBD326A621E820A8007DE5D5" "F13751BE94021A6919AF0FC143BA0607691F283BD5FD87C98A245E93B24D827361DF7F276B" "E3BD73A95705EBE3A42B5FD550F5DE2B43C1552CECF863DC1D5C48F9F94A58A22030837500" "55FB7B26DF6FF8CA03D3825DFC506FC3804E7634ED194E6A8CDA85D8B3BED10090AE267DC8" "07DBE5126E4FFDF7898971EA6FF737CE9E3DFBF678DC9D9D01DD0E16B7238E468F02C022FC" "BB79AC0000B00FFCFE075AAF3DD3167F19363637E8437FF4873FF1F69FFAE937BCE4A52FBD" "777E7E5EBA9769F91E3F6E311F9F62130D47348FC9C22616CCF9A6232F3E901A07E854A825" "BD03F4143985290FFE005165501AD43CF8C482298383975B0F6E82923282884EA96C7E5BD0" "9F1B10A33BC5E57E9CD30F4CD5A35314B19F8D204346ADABF3508A5FCE08AC8487F485EDEC" "A7023BE3A885B1106901E7546C631E6C93CF6912533649667F1C03181CD0835F9B9C692732" "FBAD98D02B5BC034850726C0DCBFCA02024C7AF3F02B479247AFCCF74CD5F98EC7EE8E5830" "C88257F4A59A3E329C02FFAE544D3AC00505B95A7BDF8C1FE04BAC9CB940B85E98C9408D80" "0D7FF738F520EBC90195ECA3AE75726A9A4E9D3AF9B61B1B37AECEEE9F6D7FFFF7984580B6" "33E893DF19D1F8D88411CD167BEEAD0000B07BBEF89ED66BCF86C587C3FCFCFCF0F4D9B36F" "B9E7DE7B1F890C408C325A222388FC396212E7C1EC4032AE8252591637084A4A68F014D2CC" "45A222398AE43BAD7308ADA82B640F46799DCC015B8C80C6B51879E6542E47E3FC2175989A" "1A697411CD358F803D808835CD93E787904FC8082379612484F9D0D7752D4C9B0798584850" "D2A7C37E1893702A47F700BAEBA53E07DA6CA0D9EF118F8D4637EF77DB1F0303E4331ADD22" "CDCF7B1D76B9DFC11C8FFF6E35225A36176BE11D8C7434D578D241D23523A5134B22C7D3AF" "98301DF67A5418C8208F9718E0678E34EAB6AC9993AA8600423CF1EFF07BC42C99E72E9A49" "9BC02C0051109050A734EA5E06068DC877C5EC13964F8640FBF6EDA39327E7DE73FFA71FF8" "BDD9580ABCF5ECA61C9F0B8BDFE199D969EA4D4C28EB58ECA6B10200C01616175BAF3D5B16" "9DFE073EF007475657567EFE2D6FF9EE775DBF763D0FA35B69338C561D7468E3AE6CF5E7D3" "2C01E2E754A45E71C89044F4F20E28FBD6EE7BB200A16A9313C1E8DB1213E9EF1E400446C0" "482D73F80BAF2857ADD74BBEB51414007A70DE41DACE2A40C24D7C3A619C3A4DFB5E5E66ED" "F01DAC472E5317DA302BC010704546C0F526B603F638489B66152AE6FDE499D99097014CA8" "A0330EA4818A01AF6BE17E0470400596B230007CD0A0A94925352D7C779BDB2E550A81FDA3" "ED47400233F50622258F9D23514F2080573EA374BCD96716E5C1D8DDFC5A8DAE061C7D60FD" "81302DEAA8EA16C37539AB97F902F14DDC2F80C1251176E60CE6DAE2E0A2106874EDFAFC6F" "4C4D4FD525807B3FFA77B4BDDDAFC7FD460050ECE6B30200C0AAEAB943A7F1A176F8F0F3E8" "C973E77E796969F94DD33333AF8E7303AA0AF84B74F6011FB47294569ED3C19859C228518E" "C77F0DE054B3B5816776E0248DC300A76B1D33D2F368DAB98F23C240B65D3C87A7F6DF1011" "0732ED670352E2D93A910908FCB0CE4AF94C7E5BD68E91BFA63DB8DD32396DE68340C23868" "C43FBBD0C3BA3DA9BC9273FB59632159BF1CD6ABF02C1D2B820F6FFA2804732EB9340717DE" "4AC5645D0065105F5A6B4A7370EF7D0142692D75091D96AB825E45EAECB3B2431371CB9E05" "6118F43E402A80074A41C31D12D16B3A2630143C21A1E2EF2BC2121116EA7538B8EF75CAA2" "E352EF82743CAFEC8F013632EC9FA9014753B3D374ECD8D15FBD7CF9E2F9FDFBF7D3C80F69" "2F1B3F83F6DF71A09EF6381CED7DA1E3AD68050080FDA357BEB2F5DAB3695158B4B8B4441F" "FBDB8FFFD037BEE1EB1F8D9D0987A3A17D582733CD72789849702687E960BA9F65DE382D00" "39F0D45AD59B76C3ED08C5F31C76A0DF5D46B50A3821702270FE1C40785190B37383281C1E" "B426674FECF0700A6030E7E0D4C0D346FD92CAF64A8F7BBB36BE0EE380A4F73D7C0E236887" "A585FC0776FD6B40C86ECD7EF8E73EB5DD155095446F81D5FF1C0D9BB23B664094A5D13611" "81D0E5E15F02AC9102E7C475BAA131E84CA81A06A5D7EBFDF1A9214F682266AEDB67AADFA5" "EE79DC9D127BF5C77BDD0CD60101AB3198E7EFB57D81685EF8FBE714858590F42FECD0D161" "8BD604F3F9DC4A1B01684CC9A4CA9B5CC4B60BABE552EF81783DD3D353B1F4EDC10B172FFE" "C2D4E464F3BBB7C799F0F82CBBB1BE4EA391A7D999D9F69E15BB29AC0000B0A5C567AF11D0" "D3597C905D3877F1B11373277FE6CB5FF1F2DF5C5A5E4ACD4EDA8EA25628439B5BD5047099" "133F10B9A44A1FD2411E52B6818FD0BDD2CD2CB4223927D15473D230DAA5DB5CE6F409A7EE" "C1FBB0EBA0CB1D69CE4460AB5E0791BF6785BD5C85E6EAC1D953061E4883D996F357FF1804" "4484049B8C5680D8C9B4EF0F33341402CC1F687EA4EA7C2B6CE4FD16F71B5C6B5F444F8040" "2AADBF95B3CFF7D4EEA8617BF8AC5893EF82145C28B23360254B843B6C8DDB80371CE7CBDF" "516C67ECF8E7B2C741CFED950971150FF7692A03BC0BE6D40C425D62F29C2E699761852101" "E61CE6346045012DB303B9F36774A120824F80CD97EA3901CED191441FA7A2000020004944" "4154471EF9013FF43433BBAFDDE7628F59BC8FBD6E8FC63AE3B5F23F403AAAD8CD65050080" "DDFDBCBB5AAF3DDB161F1677DD75809E3C7BEADDFBF7CDBCE6F0E1CF7BF3E6E686E64BAD14" "DA3CBCF4A19FE552C5E93BCDC28293738493ECD4192A606067AD0364481E793E319ED63160" "A95BE0F385B6789023DDDC69EBB19CFD3CFF6CA4E15F90CFB21ADF96DAA92E40697A8554C9" "E578A08533B0601D34493F046101E03B12E0FF545790031C8216B99A6FB79A04B9C1AA6DE0" "AB03D601EF9F361E529A9AF7CE9424B6EEA18288C6795B67A9DD1E816C30CA7906523EA5AC" "F43B8AE239FCEA4AAA87D986B4A79DAA82EB57C11EA70CE43B049D2EE37B2BDD787991071E" "91CFAE95D76DF415007A788F13E860108303B3F07BCAAF4A7A82D759399A9E99A1B9B9B91F" "5C5858381A27FD0D76B6692F5BDCA3C16010679D5067AC127057ECE6B40200C00EEC9F6DBD" "F65C58FC25DA9AEAD1E2C2FCDB0F1F7EFE9BC6C6C6C68683A1A12BE5699A3DDCD929118BB2" "9C031A35D8671E0148B00959FE2950A5409BC3C394E97B89BED383DDE3033A0413E9F339A4" "2C8FDD25D3DA21E85AB33EEA3E13D135A7F500365C332E398C4CFF767B6E89635580476D07" "CCCE47D66A225F88B8B98D6D42337C7F84B100278D3A01CA06CBC8B90170514A1DB0A29E3F" "8A60C80338E2EB21CA53381EF64DA74E3A70B6B22C27375786F388A814341EF02D4A7B80A5" "7C9C9E72CA404127C5104059CF804AF63E408D62D3AF0FF7A7452733AD9FB149B857EA9839" "3D601B16B1559DAA29398C0FC74E87467E240D87F05AE5BBD14A95A5E98821D09D771CA027" "9E78E2371E7AE8A1F7C7BC7FCC83EFCEC4EC0DE37B13271CC6BDD9DEE360672F580100604F" "3E79A9F5DA736531E2585E3E7B766373EB475EF39AD7FCEEEAEA9AA5A6914E172A323919CA" "1EC246AD8FA6EA6E33535D92E318FE2A4E6026977B0C608B557EAB02952000C13A0DC01CD8" "1B1FF2CA42459B5C7F162503289128CCFC2C6F34C49FF7B2883C3511200AD4063FBBB113EA" "A4CDD0A374FC808E990119DE04BC4E2991D2E14E01D70FAF35D1B032072CFA035CA4FBC1BD" "FBF1B6B333DCB513404A192524604085C975EB07B0DB9EF4DC0F4DEB5EDE5B6D07DD7CC825" "B53C8B2925F287D01F9DAE2C5DE6EEE7013F5014503ECBEC3D0259028C035BD2DC8B91EEF1" "C837FBC3CA7F66219AB1C54E7B096469B2F8B958F2B7BAB27ADFFDF77FFA1DFDADBE0E3EDA" "E31615FF879FFF7C9A999E69B14EC56E3E2B0000AC3735DD7AEDB9B43BEF1AA78D1B5BEF5F" "5C58FABA7DFB66BF7FEDC67AD38C2499A16FE101687D770308A4A3792B1FA779D796E02A28" "DD9CDE6ACE2DE26F991780F42A3B9FE46CA1EA40140441F504D8B2B8112F7A795D9703B9F8" "108C435766C06B0918BE9748236860381048C86E04001F4948D95C53680D466AE5D7B93F00" "36043269086025329122B22686F64FD1ADF7D95AF3E3647795835D4B56E359B2BD4D9FAC3B" "E427275B0B0F535E1D8187DE66273752A9F1E6AE8DA05A80F016E884A03A6560C155D0F7A5" "71BB02CA9CED5EC4E7AAB852807521A9919474EA638D047FBF1820407742CE5A34958595EC" "6D5319A48C0AEB019AAD482C027C1FE33F262626E2BD1A7CF2139FFCBEB89643771DBA2D9C" "7FD5E9D0C6C68DDBE25AF78A150000367360A6F5DA7369F1E1B7B9B545F73D74FF0FBCE1B5" "AFFBCAD999D97BD61904400EB7B144253B1BB5710A0073BE367A559C2E0FB8F899543E8091" "BA1003386C48A267981048A40D7672DD40C08325ED0134A761C7D7382FAB41B0D17C1045B7" "44CB1CA5628D3A83208E0E3360B45B549FB3068D830BEA4CC0A104E360C974E893DEFE48FB" "07E617ACF36F6E213BDDAC235FAA1AC8E9776FC4647A5CFE77FB31ACAC8C4B144ECD54B0F3" "162008331D76A5B9ED7748098206B0357DFBB9173ED7F273D7BED40190F70AA27A05802463" "A931A541CC5A84C6890B38605D877702964CCA09CB103195C520D529FBE57D7A7FAAF367B2" "C139440BD85650BB4130091647FB1E3972E4472F5FB972FA8E3BF6D3D0EFFD123807331DB8" "ACB8D8CD6F050080FDC5FFFA8BD66B37832D2D2D8DAE5FBDFE2FDEF6B61F7928526CDB3B3B" "A2F097BC2CD3A0A02A670A18A35E4704747D90875680285C0C68F1F437F29ECBB0829ED350" "03361DA0EA79A8DBE695A023CD1C26095881E30450FB030D2C39F2C05701256C19FDAD9300" "A9BDC60CA4E8753B0127641C9682A65A3DCFF4B168DB1213901C9682066FF6941417D40D7C" "0CB8C3B5C0FD0876CBDBC70297EEA40F04C0C524DA4B9B22E374F95DC20DC818DF00801001" "6466CE46FED6B9933412926B1280A0B2162E49B5A023310BA0C817EE4AF637004E83350A1A" "D02EC615AE5DBE0EF09B2060D701402501D5F8BD21523C103BFCADADADDD7FE5CAE5F71F7E" "FEDD341E1BE0ECF188B84E970C47B4DDDFDEF3D7BAD7AC0000B08BE79E6CBD7633589CA4F5" "A13FFA1F0F4F4D76DFF4FDFFF25FFDF9FCB56B34180D0D3DEE533DBE8DD6A1F69C035023CE" "E387B0A65483E4F4AD363070339894AFAF6446813A28A15CBD3A678F2587840F4DACD3F6C6" "D9336360F3C7DE44F1F5117CBBAE9F9CD7C97DE93C6D870EE58469111E8E6D1D2F479D41DF" "8B9DF578CE7972DCA8BB10711C44C8C82E8400F783CB3953BAC4A6263871ADA023C03E610A" "A0ED929D0017F1B7AD74012F2675BA031684F3DE3CA5CFA579D3EAD835A5E0B283D6837C2A" "68AA270C113A73A4E23375BD73D977509DB0DEA26058913A7DB1BBE0251D538FC50C534C36" "35CD8112A87671DD9D2C6DD5ACB97276CFF93B3FF281A6A7A6A202FEECE3478F7DCB646FB2" "16C3ED753A3C24E43E18ECD4257FC56E2D2B0000ECCB5FF68AD66B3783C587F28D1B37E8C8" "43473EFC452FF9D4BF7EE5AB5FF99E85857959193A147D603AD325AF79438A8E1814C88359" "E70AA833E49F3B9931E0E57C4DA4AAB385B207A5E902080E1A3C013B73AEF34665BC89C6BD" "97E8144BEE4246F50BAD0F4A7C3907800179AF9CCB0BF2D107BDAEDDB000D2A2D7CE86575D" "853A30EF3DDC8C264AE5B1BEC664F21FF7A983B548A0C922BF4634974BE302003F3CABA23E" "1D596C28750445F53F2B1D9C84400B340CCE71139FE6FECB5C20CB1BA4AF1482AC749A5D58" "8380743FDC838656CECB17D589239D2F15058E8CD032E44A7F73005D738C6099EDA8F7C137" "3D1A84FEAF941D91940E7CEF62DE7F301C0C3FF1F14F7CEBD2E2E27264026EACDF685DEB5E" "B3F86C9A999985E64AEDFB5BECE6B50200C0EEF9927B5BAFDD2C163B6BADAEAED2B1E3477F" "FBF0E73DEFCBEFBAEBD00FAFADAD65ED8B4160C68D7CC4EBDB4A80FAA149D0BD8D3F0FD63C" "98432AE50ACAD1A607B597B7230069DED74C7CC363422E3677AE59DA8107EC1871A3E4ECA9" "155585CC793338C054482EF243F68242C89C0CB2142E018B2609DFF85A70FEEC90A14BA1AE" "4FF7D57355403ADF6EC39430DD215B26DB82258BE967C9F11A8D6696F2E09484BE9F243584" "33EE658F0110B41FE5E9BABDEA4D3415951CA9F7B5A29F1781797AE9A30F6BCBAF9358FD1F" "48C11C83CC1AC47801AC21EDBB0BA07D085A05C014BE8570B8FF7ACD807793AF57AEA27E0D" "CAFB5804C8A78BBF833333D3F4C489B97F7EE5F2A5B9A9E949DADCDA68EDDE5EB37A601945" "0030B32BB02B76F35B010060DDC96EEBB59BC90EDD7D28E617E9E8D1A3EFF8DAAF7DCD7774" "BBDD43DBDBDB5A872E4E3690E9106B22DF3C1A6C0C9BF9A0A1C31505B7D4E8F3D121D2F52E" "1B0D1CC0D968AB61BB323D1847EEFA80F5961DC81CB97D8DA3E71C20D89C7B0E22BCB77D0A" "F8E71CD9AA6E404B0E253DD1EC8C3A07643C52DA04FBF3F32C7FA49151A7818A0ABE1E5D17" "5C97C562B09726FE17D57B53DB0E2A4E0F8D7F8014A85BF77A2D2BE43BA5A98DD41447F2F6" "802A9D4B69222C4BF5BA86A0C39C449C4A81070D883E45C01C88506B85BF1CCB7E67CCA619" "50AAE0C6658806D718524AAB6E51AC4204F9CE93A4B2B84D36C177CFD3FEFD07E8ECD927DF" "79EEC2A53FFEC2977EF12EC069EF591C5EB6B97183569616E1BB57EC56B30200C076B66FFE" "F19CB1C5E6C2E2C2EAA71FF8F45BBEFEEBDEF091386E336A04720BD62B8830CAD4E666B952" "71384E3D03966D2110F038A68ED1466846DB62B91D767063AA3A481960E3228389F81B6BC4" "F45E7403A4B50A10B99165183CB5227923420C0A90889BCB046F9C203B64CDDD676986A06D" "901500053DB66133020D4348E43DD4AF2368C9589090D205F84845B53F3A65BDEC201A0B4F" "5AC3CFBBC11A0B6AA641032054D53DB303722E03C260F63E8FE115B5BE5770C03DFDE3CF2B" "0080522EE8E4C0A291A08A1040F0AA438BD968F7B5E0D90194A5166CDA0B762CE4DFE3E6F5" "CA593D021FA305821263C2C78FE73E74E8109D3A75FAF71F7EE0E15F3978F02085BAD90FED" "69ABF7DF3B69F15CECD6B50200C03ADD9B9B01A8CD111D3878889657D73E7AEC89277EECCB" "EEBDF7B75756571B10E0E069C9742DE7873938CDC6EDA153170E20790B17487BB627A7C2F9" "5FA195217AA5947F35317FD0A97F968A2775B046BC6823683935D7AF87147FCB835D1D2F04" "B2BB88ED6094705A174C0C067684C459A3100EC58E215B6F9E57579681018C0390C0E7B757" "87DB83CECF67DEC499CFAA808E07F4F0D278C6808081BC348E296E00207205C6D13A0993D9" "E90668CCA48E37A4F1BC7C2C74EAEDD6B9411C2A540298EF155CE22E397C66ACB48F405A03" "320BE96C8E142431F381637D796DF578DFFADA52939F0A00564A03482A278AFEA6A7696969" "F181C78E3CF23D55D5E83876F6FC8CFFE6CE55BDA632A4D53BA4D82D650500806DDDD86CBD" "76335AADC8F6440F3DF8E07BB7B7B626EFBDF7DE77D7BDE053BD71DBD12330603F9789AB60" "504B004795BC497AB802456E88FFF4518F6A7E7374530EA6D17BFA6C683B6CFEA9270B5876" "13DCE57FCA2C7D383E41BFF9907998562E5E0714C87950F8D576FE9A2A7121E8A02471FCDE" "E4A26DCA424E23743EB31E3E009462B065AA0C205277162C98BF65BD18246584A02B900CD1" "E11412D2FE913AA840F9DFCAF942F42E6C93D375E3F70D9D337FDF1C5E93FCD4093B833F41" "A959907CD1EE20B2B68A0146F3B9081A86C341F37B942C6A6C90E297FD6100E8038D0004F6" "BADDF8FAE5871F7CF89B63D43F3B3B435BFD8DF6BEEC316B52406332F4A9D8AD6D0500806D" "ACADB75EBB59ADA63F07C30802FEFD810307665EF4F99FFF4B8B4BCB8D72391798412C1D12" "D7EB53446CDEDB72A8FCB0D50AE9E035498FB4691E0407EE5AC7AC002BF3D381C15DC8585C" "C42CBB8AC5D267B9B0501908702CD817201997F885AC4C3293CB65437734B246C042E2A8D2" "6B3E3B46AB7E9D4CF7C000A38749F56C164CC0BF9DD152002E31F78B170C151EC1C9B1B883" "5E90609B9BDFC0E43F017FEA6125324E237DA38EA08E9C5DA591BD1F49048F7D12B465EF2E" "A3A5F98B013743181DECAE27DB66F793EF81A615D2F5F15F84B1489BEB03A6F5EB92BD0898" "AB668250EDFC8531832F315713F0A02C0631B1B67FA2D7A507EF7FF8BB96965797A7A6F7D1" "309EB69AD865A57BC9E2BE0C8BE06F0F59010060D3FB6E8E61409FA94DD14C9D877CF4B1A3" "EF1A0E879FFFC217BCE007373636343AE767AA3C16392255E7005E99D97523A40A781CF1FD" "1A851A1A20A3B6B9A18A0F6D36A20104B6CC0EA7D8E1FA3477CE3D7103D0EBECACBC384E3D" "9E320138FBCF84DAC18210318F2D7CADE04D15FBC144B7E67A845ED6E83484343931092BD8" "B7050066E8F04C07C700D704FFB6E573640083EC630205AED27BD59C337D2B5C0555130E5C" "33F7D2C77152CD3B1A30E040ECE9B21443F367B54B4DBE4D99C8C2F11B27CD80F433D29347" "BF83928A2075E0697CB2D4AE22D30500656CAC79F435CD8A2C2B830DFF580F4249CC193FD7" "ED76E9E4DCC9EFBCFAD4D5FBBAB742DAB058B1A7B10200C0EEBCF360EBB59BDE9CAB2B03CE" "5FB8F8D697BCE4A5CFF7217CEBFAFA7A436942C42BF176EEB8C419A6A8882A8DACC1020CBB" "31CF739CCB12B435AFD2BB7A2CEDD087550ADCA90E856E5896965E63A53E38486125386561" "16C6F5FDA4EF85E97DE4A8E5B41D94F2E12C80265876A6E18FE6D5E17552BFD62C13AE18FA" "D9A31EA1B59F229AE3BB84BE5C3D1376232404014E9D237EAC16E5713AA1E296B7DAFF011B" "FBF03746F6A925B4F3920E483F30DF15D44C982B932F09A632109C05396F0836DDA1838112" "A085A15704A902462AB655B5A6413067ED00BCE85A9CB23299D623828598F73F76ECF84FCE" "9D9CFB9FB1D63F2F6DDC8B26BF1FA188FEF69A150000F6F0C30FB45EBB152CFE82C616C197" "2E5DF8DE377FFB9B4FEDDFB7EFE0DAFA3AB42CD59892808EAF635CE84BE35264CE16C0F172" "0997D2FE3A7C28E43EAA76984DB48BAA2EED1A87D13150F7E0D8194788C3E5B901C4AC00BC" "3FCB7D7384C978C1438ED96A11AC051EE203039578EF9A696EAC2180C989BE199623BED4B4" "62D63CBEBC227301AC0A034B155D9E59E0FD11702557AAA91725AE559029258EF83D5070E5" "9C89B1EB63AB434BBC090F78A870FF08EFB8CDDF43C4CFAD9D5B9F1167EED9D366C25124E2" "2D1090EF0B672A10483881039A4249E75399803A75EE61600146AA26410621FD3C8EF4BD78" "F1E22F3FF9E4D9DFEAF57AF54FFD6DD0E71F28C1627BCC0A00003B72E4A1D66BB782C58753" "EC07D0EF6F2FDF75F0AE6F7BE31BDF785F77628276760624C2791141890C5D224C99C48768" "9F1FC44CEF92F2AFCDB31CF3B6EAB0C5599165D49516E6923FCE37F01B8CB20BC486408587" "009DEE827998B71C7A70AA2DE0D79C330241973C6DE004844C3302A15D085653D05AA396BE" "D9A83B0D8961CA9DFBD4CBBEA0F3071D43688BDA746FACD377BBF473B07FE705ABA3E79EFE" "92510187CB4DA538B78ED7CCF75FBE27124193B02421387B1DB86CDA658D0EEE936B5AF306" "C7771CC1A5BDB7FA55C1681E7F8EE90D4D53C46E7FF554438A298071F9FE88F83168CA43BF" "57BE9E72373B33434F3C71E23F3E7AE4D19F8F5DFF9AE3B5CB6FF79231F0E94DF61AC1641B" "3317BBC5AD0000B0D8D2F256B5988B3C7870829E7AEADAA78F1D3FF6852F79F14B3E353E41" "872333C026E97AA1ABD59512BB63163E710455691995387C138536227743E20235ACF9697D" "4233FB2014AC72DEE978A968CB852CF5A00C81662E2CD59D0303F3B94C60C06D7D4390598A" "CD3ABD320E0C58543F01D17A72C252A900DB23E0C9C9F07D3D07BF8F2C905206217FD2A691" "C4D89A961FD0927B77B2AFCDE29BBDA8AA6C2094E3897D98F7E756BAB016266AB22819057D" "8E852108FEE4CBA6647BDD9B80B49F0447E55251C057C94023908C5ED6E85CD7E5B8698122" "3B652D041D38A87668AEAB51FAE3B5F2F8DF0C34F162234B53399A9A9CA493A74EFDDB4F7E" "F293BF36D5EBD5C7B19318F7A685B441C1FCF616DB4B560000D8603068BD76AB585C7BFC7D" "9D9A9A8E02AD73ABABAB5F79E8AE438F4469437FBBDF8C364585FA2E2D63317A473AD713F8" "7CCC67A77F6B691EBF83C451F2C35E8F1DE44DD2F29792525B06D5000360A2C520CE885589" "EC245A42AF04473C72E9820B20F72FE043214CED74B87780ACBF59635E97AF5909BDAE0003" "9094F287FDE38B36F78053268E882CA8D125B043CCEF07BFB151BF39A72439EF230BE81AC1" "5FA0D8400AF3E2DCA9504F2A8ABEC69132D3C06F012D83F91EF199CD4026B0741DB56E8275" "28750741693329FB837D0790C6D7F368A65FEE7DD61088EF41FCFE3760C8254095B116000A" "F4A23C4D4DCED0B56BD73E78EAD4A95F9B9CEC51AF3B99EEC7EDE1129D73C5F9EF612B0000" "EC15AFB83987017D26C691920F03BA70F13C9D3D77E6C2CCF4CC577FE5ABBFEA91E9A9E9A9" "581DF074CF2C76FE2173D01CAE6919943EEC85F2174A581FC81AA76B34EC1217CCB95AAE02" "1089000EC0E1CFC0FA1A67EDA4CC918FEDB9477F76DE11D3047A958D13F30076D295A09680" "1D003A21290F34DE4CC1888AE56017B05490AF11D311212878208E82B51980CB4100FA29A9" "3CD0CE8B752682821EA2AED5AF54449976887B22188D03E83E1CA9EF17DADF5EB600102F0C" "848A27F97301B417A65535B300CEA9FB0E5A964ACC04C097D50A1E217ACF50A79969255F08" "6E291CEAF2BFE6B05AC38EAC56CE70757BBD3884EB2FCF9F3FF796C8B0F5FB63BBB033C58A" "DDBA560000D8F30E1F6EBD76AB183F24FB5B5BB4B4BC48C3D188AE5CB972D20FC3AB5EFBBA" "D73ED8EDF526FB5B7DC8192BE5DBA2C825D40AA0B676E2E489C87C4E0D404456FE05BA326D" "1F9B9C885405903EB40339B32E7532CDA147A24CD77480320F785EFBF77CCDF5317D303F77" "90BAE0E8DDB4BC85689F480592FAB26D1004AECCCC1560B19F5192439A833F23037176E914" "E852573C333487237D8954B1C700680042D37BBF1E7F1B5C72C44DB4CCA726664292421E2B" "01342580330815BAF0843EE415347BCFF7D323E210E087CD8FF2689B531B782F1AB6A9B2EF" "8F4C47ACF3771DD96F2DE5B447D4AD6EF62AE6BDFBDBDB1F9D9F9F7F631C0DDCF40A28566C" "6F59010060FD3D32CF7A62A24B51E234D59BA28585C5E38F3F76F4B52FFF8A573CE8FD04ED" "F0F0A08034781ED967F5EC9446F906EB4C8C652905DAC5A1B1C29ACC83BBF993F3E8824D38" "5A358D72883D7CFA993A1CA5ED6109924ED0081C7FC6117B08ED73E5EF7190B33740C76001" "C8FBA77F2B0E6207E9CD5EF37C79A5F1390AD5697F5A76C82EB4926E7CBC03288D14D236B1" "0C8DB3C4060F4AF90B0DEE9AF6C1E495B141F6C2A8E4E57A487B1BE0BA316FC1F47DFDEF4A" "76AA014DEA78F9EAADBE41BF2B467F508F504EE71441E72E256A5545758B9FA6BC257DFF20" "EDE390B14A69A854EAB7B0B0F057F30B0BDF18C57FB5F3DFE52B5FACD8AD6EBBFCD614DB13" "961EC4FBF6CDD2E2E2E2438F3EF2E8778D753A343E3E0E0E473D1193B43E957E0940604E38" "09B6542B60236BDB108FD5F38D7360271BBC46C73E95DC858C5E779C5BA8DFE3EBF768873E" "88D4A9399E4F6578E297D2B5790138483F28751DE473DC754E204AB33EAEED57F902119E07" "008BAAF82DE8D1BF06B96EEB4C756F10492040402F2C7F754106B134F78A242DC02C83D0F1" "95D6BA0B3B40C13A5AA7C0803502AC9D70694A1E51768944464428DF17F494463390314EFC" "33455672DF59631210B2C00C027E6F30A053D9091D6814E4FB213DFC11A0C15AE2F721EE69" "FCFD585D5DFDD3A79E7AEA1BA24E62BC6E1854BC7FB1BD690500DC063635354967CE9CF9D0" "A54B975F5C75AAC5C810708B5B093225421FD94859F2F3DEE4B5C551329D9DF2ACECB01B6B" "E8612F35F4411FC6E0FCF9BF16289045F0B99A63F37FBC26EC59AF0E068E2F550CCD3A9A73" "DBF2AF86E60F027ECC06489A20082BE0A5D531382ED2CD4427561FC2C3BE21906921B16C6C" "2DFE45027D97F6519D3497D3B95CB12DEF211135321893C1395CC691EE6F05D136F74510EF" "CFED1F3CC7E0694C2F65B58578EF92533640874B0D05F024E70DC23307517AFCFC88D7026C" "871C4AF654AFB1163A06222B51CD4D9D7F14F99D3B77EE9DA74F9F7973FC1D895DFF769131" "162BB667AC00803D6EFC708DA54C233F7AF2C2858B2FDBDEEE5F8E346730D12C44B7791D3C" "387D716EA26E6FA27F1F02F4A15787AD0EBE9D3B17C7EFBD3A1A30FECC28F0CF9B8143DEAB" "C30DA9B6DD7BAF7E0AA3695EAFCFD6E00030903A7E75CECC2264690CF98CB20DE2E87D30D7" "E647C1CC44B0EBB2D7EAE0D85C86A8CC427A8363068104BCC97C7C10B5A19A9FDFD3D4FF3B" "D15E48EA41931702287865D52E7DFC47DE4B6740112CA6E89E097515F7095204C76D8742B1" "DB6726A282697E0C1C79553A7DD027D123942490DE2F1EDED3B0170E8E41ADF4175F73FC7D" "3877FEFC6F9D3B77EE57E2A09F4EA73C1A8BED7D2BDFF2DBC29A876F6C603218EC3C75ECC4" "F12F5B5B5F7F6272B2296982946E46D5EA439EBDBFE4808589D5085129D68C424F16029908" "5F82DA7C04AF44E25E73C1CE320E2139FD510D0846BB8AFD98B978FAB445B04E96AF300475" "5AE2EC31579F7A1DC87FE0DB5D52B4F375396E7B6CCF6D3685C4E7F32220F4E7BC3ADCA4A0" "4AFA781255B72BF340A2E26F4AEEEA9EF7A42575E23E01A071631FD465F0FDCAF7CA015381" "258A446458148DD21D8C71D64B4761293B79CFE922736B5CB656DC42AE9C6846FA86D4BFA2" "4993044D2B19C166736D1170CCCCCEC6DEFEEF79FCE8E33F393D3D5337FE2956EC76B00200" "6E1B6B1E9E93BD49DAEEF7571F7BECB197EF6CEF7C329637718E581EB252F617A4A48B840D" "0F49711E6C842CB477A2C7E143E2D4A5F31FD6C2AB236087EDD37F48954BBE36A3CE91F296" "CFF9A0DA030033ACFF12B6C2A30FE71FEE4ED32B9BC154B9031C0491B487BD80F5E25E1081" "834FA913E94047A9ED2E0B1B1D4933261C4AC3F723A4497752AA99D5C1FB00AA7E8111207D" "AB000C24C19CD0FFA3A0AA7A5E5A5541131F3E930369633B774F109D93ACC099AA02D61D20" "70AC2A6781A16170B49A205DA9DC279781D840DC0DB0595C0468313DD0E98CD582D9959595" "5FB974F9D28F8FFC88C6C7C75A4C54B1627BD50A00B8CD2C3E88BBCD2CF3E1C54B97BE766B" "6BEB9138D444F2FCF250D5813968216894A8511E32017904CE795EA8F30EDC2D10DC273E74" "B5D24C3405D87087190B06061E41060387A0A23D92E307D100345ECA8AD27CD012B9C04E29" "8FD8813497A566298D56949BE5C41BEFA600C850E6A4347FE554D447E2F8710CAE299B4842" "B8E6BA38BFCF024789929DD6F6FBA0E7E2FD0CE084D1013B10116A4A04A64E9AEB5631A5EE" "6F5AA1343A62B0E8ED90260621C4402B98BDC94B31E39E8C864DFAA7CEF923B2C22F1C83CB" "F87D1A79EA757B3436D6A163C78EFDD895CB57DE393333D3B4072ECEBFD86D640500DCA6D6" "9DE8D6D1DCD1A38F7DF5D5AB57FFCF742A77B2B4BDAAC6590780FC34966969BA179D2D08EF" "20CA97A318E760D30EC204F81A058833E052AE80FF26A5859599F7266A37D43EAF5B9AF5AB" "DB10AA3B3941679CB95E3BAF5BF2E898E776995347C53A23061E5BEFD481EA9EB705837837" "D8E9AAF0CE020E97F930EC97277A8E90A50D82DD0702E607AFD3E2341C3D0CBA91B41F9594" "FF395B1A89FB29D13E541AC07A75DF59BF108C5FAFFB3374183834550C389D11410D7F1FE2" "773F50D8397EFCD83F3E75EAE47BA7A6A780252956ECF6B1D207E036B5F890EEF56277B3FE" "F6DCDCDC376F6F6FBFF5052F78C1FBA2F2796B6BAB51C8CB133845534E4BDF24E79B5803E9" "87CF664AB40037C0F01A9EE5DEB48D7566225E7322ACFD0E2AB293D23C74485ABAA66C4650" "87E202401682B1B7249F1161A1D104C0CF0D08424023996E627D822D304FC6EC028F4984B5" "07C8A547EA5DA278A4BC53C73F76FA0128DEC6A12500001A5C49444154764989C04C05A973" "B70446FD4253EEE753174270B8D200802B05F87C4E6F62EBDE06B8B724171A64A64050C53F" "365AE235E23580F05040964853F8337A3111B4F248663CAE057D8CB902CD4C4FC7EE7E8F1C" "3B7EFC95C3E120CC4CCFA4A64925F22F76FB590100B7B1458739D1EDD278678CAE5EBDFA3B" "FD7EFFCC0B5FF8C28F4E4E4EBAADFE56DE695D5C802316BA350D82A48C2C593B6D000E02A2" "6E870FE99C6A0F10518A23C0E81DF3DDC01E64112DFE9CA34F9C0FA08D6D64B1F033124A9E" "7FB4FB38E1F6885CEB90795E82EA06640F9C36CFE15409972736F4BD46B72185F74A16E8A0" "1E75EA2C7AD3D63FE27489530E0AE44CCBDDEC1E7069A7D10C64CE3F8400797868310C204D" "7713C0831CD2C96B5CFE878243D53E28609073425749BE8FFC7EA9EC48DF9598CEB863763F" "CD2FCE3F78E2F889D7BBAA0A71A46F7F736B17A456ACD8ED6185F7BADDADAE87AF6876DF2C" "3DF5D4537FFDF8D1C7BF20105D687A055815BFD2BCFC3C77BB384CF015E2980388FAB4FC8A" "1FDA52FF9F030750A163B99AB6EE557119EA1242D0E8579693225F19E266AA0DDAB97BA3F0" "978B06E7D4BA5E9827C85E502A17B20E774613C0423BFE0852E920A24B658E066805A0DA21" "15C07D0AF06688F68182EC9B4D0164004C00830562CC7470DAA25E5F256801B8104100766F" "E5A4A03B95BD625D824DD5E4DF2F652500388ABEC102B478CD51D81723FD4B972FFDF79327" "E75EB5B3B3B311CB62773B47B162B7931500504C1EB83122DADEDEBE70E6F4E997F6FB5B8F" "4F4D4D59553944F20491AC74981327C20F71C811C3201E93170F764EBE3A9A90446FE8C89B" "F7AAB27CD4741B1C8D0440A0904E95DF01169C0110A6AB51B8D868CA413300A90103120844" "879605A8D7C86314C1D13606B4B7EC6D0660F8456048908E0F12ED3258C0813C4EA87C9EE5" "60901C747ECC511BF6D1CF1187AE2D08FB4384657FE16900839ED700012E23857B63DE5EB1" "76007B0090D127B4BE9F70A8280A8CA5AE31AD75E6EC999F397EFCD8F74696247ECFF3A98E" "C58ADD8E560040B1DAF8711823FFD16834B878E1C22B9697963FCC1DD150F9AD0F71762CFA" "333E58D08470FABB46B18EB2288DEBC3D987D411EC2839F1609881C08D7FA47B1D9C9D27FD" "A5E890270532B0F026128523068D4053182AB0C367E569CA68041137EAF194D110BA1E6978" "8E8BBD65116449B510CE35EA7BC735FC24CE0FFBF7B3DFF3018089C7B5E8001F3693236727" "6D26EF653322C0919388EC52E41FFF97B106F2738CCA83B2010146FC4AD5006E00E96751CB" "C0A90D06195E9A11B9D6F983748AF435ABD5DFEE6F1F3F7EFCF5972E5D7A776CF6135BFB86" "E2FC8B15ABAD00806262EC1AC6C6C768ACEA84E3274EBCE9DC934FFE3051E847AD009B4C91" "67AD5BFE3C85522F7EC0D70FF58A8CD04F9C10CCCD97FF3196F00D6DAF75FB81A0581FC001" "381F6EDB2BED83B5FD2F6A0AD2BB814296C3C22C81B69EA036EE958FD16ECE6EE080046116" "788BA4D8D238C5AAB275EF04C7CF81530D08704A9F808244E9BB907A08B80C440500114102" "7D6DDBDC76AAF89A50F664DF4739C072FC2DF00A84A4F530A301480BA0F307E0A26B72C29E" "54F01939574A2575624A6B76965657D63EF5C8238F1C5E989FFFBFFBF7EF57AD40B162C56A" "2B00A058DB02D551FFC4C4781C24F4BEF3E7CF1DBC71E3C6C762D580940AA647BAD5D2DBFC" "35A18349113A250161F352302D80793E8044ECD03F5E810137F9C998812C6A1D7975C279C4" "6EB4093E18674F5C1FEFD969C135E5ED84C91ECB6E8586E94AD12B10C08A036455A42D321F" "1D0193C7757BD9724F59D7C5C01A08A73D0F4C2A84A97B655B2477BF4BFB5FDD5F2B84E405" "3871F4E0B8859920018B81CB3983F6F8178602C483D98C3E59136B0131D72FE74A2C4DEC71" "115357737373BFF4C0830F7C8DF77E657A66DAA6568A152B565B0100C576B590A8D73817DD" "07BF79E5D2E5AFBB7EEDFACF474155FC8F1D9733111594C3494AB8250B4FCE009DB70AE8F8" "B8989767315E2010B3F9F6D3DC44DD2DA70CDE11B408CC52F0B93D0C9C71E0AC1DE9F020B9" "44AE82741AC52B34E2723715FEC94E243A3F104CF58336B9DCCB5E36856449789034331FC7" "FF423A210762523140027C988FD07A7D0534CAECA036204BF5A47485AE139917ABF60FBC66" "1401C2C85FCCC878CACA4121D71F1C833C5D07DFC398EF1F8E861BC78F1F7FDDE9D3A77F31" "82D898EFE7A98FC58A15B356CA008BFD9D161FC4B143DA583546972F5DFEE585A5A5935FFA" "A55FF2C19812585F5FAB41020BD1306E7332818F327117ABDB91E2269D6F2F8E5B8BCB584F" "604565D884C69E38070D4275B7E6C205A5C741F316D8D1E44EC324FC0387A37A7A1F140870" "AA02E7F3C361787E7D0D38B81742D0F5CB9556EA5CB944DF393C621041A00110FC77C8C7B7" "E9EF4C88684095D39600D99E110A31BD82377C7303802A9B5E712A5E1431639666C85B193B" "AA9A79FE0CAC80FD71A1015271846F77AA4B0BF3F3FFFBECD9B36F1E8E86FD999959AA3A55" "8BC92856AC985A61008AFDFD169A4835D2AB8B0B8B7FF0C413739FBFB8B870AC7EC8C687BC" "8707344781CA0580A08B95E36DE5B63874F927170D9228D91B5D5DE37C476934B0E8DF9052" "17AA9F34C72FE7200B223C8A03830AE88D33B41502ED8645CD4859FE6D42919F4BBDF331FA" "97A63640617B65E66BC0C0C37BB84AA1F98875D8040C896554F4758F4CC7D3589EC260E005" "A7E1C50BDD91A76828355E422E1FF5000C106AE0E7ECF93CB4020EB00827BA0EDD43011A09" "0844862A5EFB9933677EF4FCB90BDF321C0EFB3105D066808A152B965B0100C53E334BCFF6" "A8A45E5B5BBBF8E0830FBD6C7E7EFE5D1114C41C2B29592B8773E2B0B8C77E0531670E0238" "2F1ED45143D919F7C16720C00ED4382F1C9243417BCA73D4AD2BD31C75C60A30E8E0B1B470" "61E91499204E2257CD7B4B8959E05488D51988EE00AF9FE9701143A6D7BD3219942A1FB8EC" "D10CD881CA00145922858E7A3BC41F92634F07E25E4D7C9C2AD5F9F3FC861C0085C4F5DBDC" "BDC30D3715222C5A94AC06AC5B3A1F061C42647B03C4FD8BF4FEFE3BF6C7BEFEEB274E9C78" "E585F317FE73B7D7A3F18989E2F88B15FB0CAD008062FF5F161FAE715E7AAC14585858F885" "134F9C78D9952B57FE2A0E5799181F87FA6A671EFACD4B0C11B4DDAC31539A17E04F2C1DF4" "022824324F4E2878D299F6E068F958465C27CEDEBA7F17D009A76361B73C6030741D2AF623" "6AA6D899B1CA94D1E39C263082BF54DE98DE1BB271CAC840409F21D95EC144F6242945A33D" "023C3023E6D8929A51911D1F870157ABF451EE4CC64C6821887D573C56DE7910A6FAD57F4D" "D309894B211525E9ECFE0838030D1E7EE8A177DF77DF7D8747DE3F1CFBF99B76C1C58A15FB" "7BAD008062FFDF161FB1B1D42AB201CB4B4BC78E3E7EF41B2E5FBDF27D316A9E9AEC31716F" "CABB889DADE47051B0860E04A971EE658FE575565D4E1C95FB51D21CA8430D189183C2DF30" "0E011805737E3C97E6FA1B3120AE81528E3AEB699FC39B7C2F82F6BD470CE252C25CA364DB" "450FA7F2C9A442604334E59231248184BA97720C282F7481D5FC7AB79AB7F0B43E6D32D012" "EEED36A5CF5B512346FCE4F435826645CDB6739F834ACA39A38D7C93EB8FA2BED5D595BF3C" "72E4C8DD0F3EF0E0CFF4B7FA9BD353D32D2C59AC58B1BFDF0A0028F6595B7CC047DA35E65C" "171717FFDBE3C78F1D5C5959F9C8E4E4148D8F4F68F49EA266EE1B842567AC18202108F2BA" "02FD539D0449CDBABC2F2845AE638DD584720736D9B1F3CEB4041CF50616F0014008B82848" "13B4F3E89A10D1AE7F0C2C8238F8A6542F7DA6D24FAAD6404E2580C09375F64614288047AB" "2202000189B7418D6F7A2F48CF04040E21DB4DFEA863B99FD5591009F3601A11E537356D2B" "A65B74BC0377766C8E3D3B331B5F8D0AFF373FF1C4DC1B0783C1F2BEFDFB69A23B61BE07C5" "8A15FBCCAD0080629FBD410E39A600FAFDFED2B9F3E7BEE9FCF98BFF64381C2CC5B22C5562" "63499DB3822F624764FE29EA7C3507797D76BC19550E1A014D0DB03620FE7B249F41919A56" "0FA47E042A21D4285C18056D5F2B79788E6A655D0070BC878E785ADD40E0DC9B0F653DF65D" "65DC2EAEC34C4934658CA8A5A016CBC00C82321879032328FF0BD93130979FDF2950FB338B" "2FB58F4616802D7DD35B22DD5FB95412A9EB8836313E4653935374EDFAB58F1F3B7EFC45F3" "F3D7FF34EA4EBA130A308B152BF6D9590100C53E27169FC51313137544B6B4BCF4E767CF9E" "3D78FDFAF57F37313E51D7670B2D0E896B530F806A3062078E79767E5DA7DAC11F42E5B3F0" "10A9FE00F47D608620551948AF7C983027416F569A26B4BD7A535927330F021C8C4A1ED60C" "984332EF928BF7962E8736BDAA94CF1AF148D7C5E45C2BA7F43AA6F2255AF7D27320AF0DB0" "AD1592277704331DC844F488CEEA73569C7E70646E5B4502DA3C6A2BD2DE8AF831DDC378EF" "C6C7C6EBD1BD3B83C1CA99B367BEFDE8E38FBD6EBBBFB5182B4F5AE0B158B1629F95150050" "EC7367C989C63C6D7C48CFCF2FFC9B93274F7DC5DADAEAA5E9E9991A1C54ACF06775372AD4" "310F0F797027912A0002831C50108769077E519D31A72384E6268DBCD1218A83092415088A" "205438C76B474D4008B6F61F697BA97220482B40542F0DFD530540032A9A7242672FBC791B" "B7246696DEA9339575729EDD44F8BA56D9C9AC520037C1A609DADF18B33667B19C6334139A" "0E8B7C3F8479616C141A75FFCCCC0C0DFD884E9F3DFBEB67CE9C39B8B4BCF467B5C8942754" "162B56EC73620500147B46ACAA3A3433334DCBCB4B8F9E3871FC1F5CB870FE4D37D637FE36" "9669C516C3EAFF4100085D034D9C99227B744C98D366D5BAA1A9812190940350FE0126EA35" "2C4190B23B43E54B239F5485E0D36C01A2D42E181CAB38FF3673D18807530D3D281FC451A3" "78909D360A14B9A5B1B7FDFA6B7001ED8479063E5F7D0026643702BF32DEBE614B8C18D074" "1774BADF5A68A0CC8950F778E11CAD27A05235DA00E9731074A67FD4920C8723BA7CE5F2AF" "3D76F4B14327E7E67EB6D3A97C4C01943EFEC58A7DEEAD74022CF60C59E38C22FDDFDFDEA2" "F985850F2F2FAD7C7876FFCC6B9F77D7A1F74DF4BAF70C07231A0E07CDE92157ACCEDA52E4" "EAD4A1CD1076B8C3C896348F8C6C41483DFE0D83C05A37FE9C0CFA61DA1C1B14B9247B8B3E" "D901ABA03D0BA4B430901E188049A867F857352FC0FC05EB129A614072AAA46B0CBA0650D2" "85EC252E56307D0A901868F10799EE02BA393A1136646C8ACB3FE59A8982A9FC11A74012FF" "9DA5FF0453FE1C7730747535891F795A5A5CFAC3D3A74FFDF86034BC1E01C2D4F434559D0E" "0D07C3F24B5AACD833600500147B46AD71769D1A08C40636376EDCF8F8607BE7DEC9C9C91F" "3A78F0AEFF127503716EFB70B8FB439E5BF506108619DF6D4AEE6C84E8A06F3CA90B92FF8F" "AFC4F2328C6A099C25A70884E297E392796F93264F036F28F7B400449052E772B9E4D8B9A5" "BEF7DA114FCBE01C5622C299AD436F97F12993D28A9DA14DB296246A5EDE9E8C5332F6A5FC" "FC9A02701694106B0212ABE21A56653275F17BEAA9AB7F73E1E2A51FED4E74E7760683BACE" "3F3201B5E36F2DBC58B1629F2B2B298062CF8E25C712458131AA5B5A5A7ADFC2C2FCE4FADA" "FAAF0E87C341AF3759E77FA5AE3DCFE3B3E34DD1A4D0D0FCFFC218A0B7538F289C4155D5B4" "37E7E32B337F20BD97F3D23032D7393D5B7CEB086AD439B1EEF9DF228643E24027DA350D71" "829E8C87F038F5E24E52036D472FEB04CD012AF969974F20800A29E581024149BE1874A39A" "0047615710C4A91B66411C9E039A16F1BF63FA2452FA5127B2B8B474DFF5EB4FFDC39373A7" "DEB0B0303F1741624C0F152B56ECD9B102008A3DAB169293898240E75C7F756DEDE72E5CBC" "74C7C2C2FCBBB6B7B7B77A9393D4E98C9906388E63D9ACAE5C47EEAAD383C01B3AE319A2DC" "8CAD75D94FF8EDAAA783BCB60B123AA3425F72FFE0903D34CFD12A02F8CF43082D0B75A67C" "512269583EF61DA0CC29E3BE180DA400104A4E3ADB47780A70473E497E08EACA5BFDEABE19" "9601BAF72644236BECF6BA343D35137B469C9E9B9BFB8EB9279EF8EAADFEF691C9A9C99A21" "D283142B56ECD9B002008A3D27C675F271B470E5DCE6B56BF3BF70FEFCB9E9E5C5C59F0B21" "84C9DE64DDF98D67CD635B588D52837547E8244DAE1A29E9C631A3D3729DCAE00874D8A699" "0DFBE90A3A1472531ED3B79E843697939075D8DC05AF211652EE1CEBF0B041202CD68ECA45" "200242488CF68D1631989C7DF3924E217402729CD02D6DE641CF450EBB15AA3893AF2BEE73" "A7D3A9C57DDD6EECE0B7FAD0A95373DFF4E8A347BEE8EA5357FF24B20012F117C75FACD8B3" "6E450350EC39B5DA415515F57A5DDAD9D90E2BCB2BBF3A3F7FFD3F757B93DF7AE0C081EFEA" "75BBFFB43BD9A3C160407E900483905377CAA2AB9A9EF2DE01FC67B09A01A6FF475E1DB84F" "CD748CB08F856B5AB3EE838212337E57D2E05AEA27023ED35340D7240A7788D2A5E411C90B" "C7F593C1B00F4ED57F2D3F6AB228BC5E84461569640F690EB37726D47732CA592F41FB13D4" "1A86CAD593236337C08D8D1B0B972E5FFA0F3BDB833FDFDEE93FB2BEB656FF2C8E98367AC1" "62C58A3DEB560040B19BC04252C057F578D7F5F9F5C5D5B5F5DF0B21FCDEF8D8F80BC7C6C6" "7E7A7A66FA8726A7266746434F83C18E46DD211068D7ADD25C1C6D1679938D54CD88BCE48C" "35411070AC516ADB6B1579562CD8BCD688F9F29D4DBA00A76BB12D7AB1BCD1890601DBEC52" "12D029B8900FFE9DB7D191321A3958D177F0B1ACD36791A386F904AC81AEBB33D6A15E6FA2" "1674AEAEAECE2D2F2FBF7B6575E5BFAEAFAD0F620DFF810377D0706A8AB6FBFD12F2172B76" "13580100C56E220BA9194C875CD5AB5300C3C1F0D2F5F9859FEEF6C67FF6D0C1BB7E6AA2D7" "FD89A9C9E9CF8BEF8DAC40AC20108FE5342C55F15D501A5C66E480F3317EC849346B7AFFCB" "413942B7E5870C22A45AA05D0A608F959D93249901D50E590AA0358207F41172F06C041F5E" "33D45368531E63FC591638C051042CC911EAAA85D41EA99E0E19859DFDAD7E585C5BF8D0B5" "6BD77F737979E9D363E3E3750A2036F671CEAEBB58B162CFBD150050ECA6B6E858627AC039" "DA595A5EFAF58D8DCD5F9F9D9D7AFD810377BDADDBEDFDB36EB73B1641C020F613C03A76F5" "5BCDDF4DE4EB9419D82D1205311FC9F112DB8091308FB04DF4BE6737EDA079105940E032AA" "DEE54A86BCEE9E3B043A1536EE1A3D3BFBBA43C72FA57E20226C65F7B3EA01EED9ECB86111" "C938E7F8DECED838F526C6EB687F7DE3C6F5CDCDCDF75EBF36FF9B7E30BCB13DDCA92B3AA6" "262769381A358D7E427EBE62C58A3DD7560040B19BDEA2F3E9745C3D6B6073738B565756FE" "A6DFDFF99B89F1EED4ECBED9EFEEF526DFD1EBF5EE898D68624399E168D8A2FC4DAF7F981E" "673A049252EE3037AF290B04559D7607B4A5789A1AE09F6553EA1CF4EC87D6C0D22A57B310" "F0190DCCB1CDB101337C7D29E447D642357DDA3F3F4090DF821286EA573161DDB9CF550D3B" "E31C6D6D6D6D2E2E2EFEC96030F89DF9F985BF667D42CCEF53C7D160B8D33E76B162C56E2A" "2B00A0D8AD63A1A9DBEF74BB753F81D168B4B9BCB2F2FEF1F1CDF7BBE05F363D33F3FDBD5E" "EF3BC7C7C75F1C1D568C4263841AFF033FDAA8F85164472A08E45AB69636003C735B6340C6" "F9BA4C8CC73E95A7F0E9CF02542C9011F7590B1890CB414D6D3E7C4C9305580D81B5FE0A2C" "9CB0010070123019EB8CD5A02B46F0A3E190463E3672EA7F646575E53D0B0BF31FDEDEDC1E" "DC79F0CE7A9FC7C62B1AEEC01C8362C58ADDF4560040B15BD6E2A8E198638E7D03D6D7571F" "EF6FF7DF3131D17DC7E4E4E4DD3B3B3B2F9F9C9CFC9E5EAFF7EDBD5EEF40A350F7341AC55E" "FA2388E239479076C10C1C60F91F97BC2968C0EE79F5BB833A51AE3090CA84449F6B4F7EB6" "DCD96B431DD41948B65F861785F4CFBC220089FDDDEA08C18C14814B19E37E56754BDFF8F7" "9DED9D303F3FFF89ADADCD3F1E0E861F1F793F173CADF577B6EBBD8CB5FBE313E329FD42BB" "F109C58A15BB89AD008062B7AE81BF895168A7D338B0C160706D7373F3DAD2D2F247A6A6EA" "EE725F35313EF16DD333D36FEC74C65E353E3EEE2270A84B0BE36C801136ECC966E21B4C80" "A90214E5E554BF2AF4E5A3DEE6E049DDBC31AB1900E2213064C10404D9230881919A152561" "A48DFFF952820CE5897B17FF1EF7637B7B7BD57BFF899595953F5D5E5EF9E0DADAEA5AD460" "70A7C658CFDF758186C31DA0548A152B762B5A0100C5F698354E2D5610C452BC4E55D1DAFA" "FA7DC1FBFB6EDCB8F1CEAAD399EDF57ADF363E3EFEA65EAFF79AB1B1B117459A3BFAC74871" "470D8144D222FE87B6BCDC16172B0152DAC050F8DC4EF869DA1AF327A4B63E041212810180" "E3FC81B360417A0D28DB5071A99ED34E7E69F1DA96971A8014EBF4836F260B0E0683ADF5F5" "F54FF6B7B6FE7A736BEBA35B5BFDFB6766A7FDEACA4A2DE0EBD6CEBF47E3112454A56F58B1" "627BC90A0028B6274D7C72DD6D70BC51AE773A340A7EFDC68D1B1FDCDADCFCE0CCBE59EA54" "9D178D8F8D7DCDF8C4F8AB7BDDC9D75755F5159DF1311AEB74EACF47FD401DBD87103F9B28" "FDACDC4E28F8CC51FF1DE1B11E416706483F00F0F43CAEB7AAB47F01971B8E929831FE7D00" "2245EE41502587DDB0236375FF84ADADC153C3C1E0A1C17078FFD656FF5383C1CE27FA5B5B" "9B31FA8FCAFE665EC3781DE9D3F67643EF172B566C4F5A0100C56E0F0B1C2957D419EFD068" "A29B68EF9DF31B1B37CE3BE73E30333D1B7505776EEFECBCAC5355AFEA76BBF774BBDD7BC7" "C6C65E5E55D51D5114C77D0A46A366F44F64187892619D0CE01EFD3E48E31D342EE9ABC701" "73D39F1895431320AA8FD3808D58E2583BFB9D91F40888D505F1F5AAEAD44E3E8E54668D43" "FCF9A0E99838F47E74696767702C84707A63E3C6A73B639DFBC2289C1F0E073ECE5C88EB8E" "E0607C62A2064771613E40D95FB162C5F6B4150050ECF6B4948FEF549D3473A0E2F2BAA5CD" "CDCD8FF537B73E169DE3BE7DFB687BB033DEE9545F303D35FDC5CEB9C3C3E1E805BD5EEF0B" "C7C7C65E38F4C39989898938BD68D27BDFABAA6A22920EB1C96E3A1E92FCD1498F82F7431F" "FC8E739D8D884186A3E164F061CA39371E9ADF49E7EB11C92357552E24F162188D4623E7DC" "2084B053B96AC3D3CED668381C753A63CB5B5B9B17ABAA736E341A5D1C8D46A707839D33C3" "D168398ED48D60647D6395EEB8E34EEA757B34513525953CA1B02E8B6CD51F162B56AC58B1" "62C58A152B56AC58B162C58A152B56AC58B162C58A152B56AC58B162C58A152B56ECA63722" "FA7FA2AD0F1FF68D68610000000049454E44AE426082"; // Converts |log_message| to a raw dictionary value used as a JSON argument to // JavaScript functions. base::Value LogMessageToDictionary( const ash::quick_pair::LogBuffer::LogMessage& log_message) { base::Value dictionary(base::Value::Type::DICTIONARY); dictionary.SetStringKey(kLogMessageTextKey, log_message.text); dictionary.SetStringKey( kLogMessageTimeKey, base::TimeFormatTimeOfDayWithMilliseconds(log_message.time)); dictionary.SetStringKey(kLogMessageFileKey, log_message.file); dictionary.SetIntKey(kLogMessageLineKey, log_message.line); dictionary.SetIntKey(kLogMessageSeverityKey, log_message.severity); return dictionary; } } // namespace QuickPairHandler::QuickPairHandler() : fast_pair_notification_controller_( std::make_unique<ash::quick_pair::FastPairNotificationController>()), image_decoder_(std::make_unique<ash::quick_pair::FastPairImageDecoder>( std::unique_ptr<image_fetcher::ImageFetcher>())) {} QuickPairHandler::~QuickPairHandler() = default; void QuickPairHandler::RegisterMessages() { web_ui()->RegisterDeprecatedMessageCallback( "getQuickPairLogMessages", base::BindRepeating(&QuickPairHandler::HandleGetLogMessages, base::Unretained(this))); web_ui()->RegisterDeprecatedMessageCallback( "notifyFastPairError", base::BindRepeating(&QuickPairHandler::NotifyFastPairError, base::Unretained(this))); web_ui()->RegisterDeprecatedMessageCallback( "notifyFastPairDiscovery", base::BindRepeating(&QuickPairHandler::NotifyFastPairDiscovery, base::Unretained(this))); web_ui()->RegisterDeprecatedMessageCallback( "notifyFastPairPairing", base::BindRepeating(&QuickPairHandler::NotifyFastPairPairing, base::Unretained(this))); web_ui()->RegisterDeprecatedMessageCallback( "notifyFastPairAssociateAccount", base::BindRepeating(&QuickPairHandler::NotifyFastPairAssociateAccountKey, base::Unretained(this))); } void QuickPairHandler::OnJavascriptAllowed() { observation_.Observe(ash::quick_pair::LogBuffer::GetInstance()); } void QuickPairHandler::OnJavascriptDisallowed() { observation_.Reset(); } void QuickPairHandler::HandleGetLogMessages(const base::ListValue* args) { AllowJavascript(); const base::Value& callback_id = args->GetList()[0]; base::Value list(base::Value::Type::LIST); for (const auto& log : *ash::quick_pair::LogBuffer::GetInstance()->logs()) { list.Append(LogMessageToDictionary(log)); } ResolveJavascriptCallback(callback_id, list); } void QuickPairHandler::OnLogBufferCleared() { FireWebUIListener("quick-pair-log-buffer-cleared"); } void QuickPairHandler::OnLogMessageAdded( const ash::quick_pair::LogBuffer::LogMessage& log_message) { FireWebUIListener("quick-pair-log-message-added", LogMessageToDictionary(log_message)); } void QuickPairHandler::NotifyFastPairError(const base::ListValue* args) { std::vector<uint8_t> bytes; base::HexStringToBytes(kImageBytes, &bytes); image_decoder_->DecodeImage( std::move(bytes), base::BindOnce(&QuickPairHandler::OnImageDecodedFastPairError, weak_ptr_factory_.GetWeakPtr())); } void QuickPairHandler::OnImageDecodedFastPairError(gfx::Image image) { fast_pair_notification_controller_->ShowErrorNotification( kTestDeviceName, image, base::DoNothing(), base::DoNothing()); } void QuickPairHandler::NotifyFastPairDiscovery(const base::ListValue* args) { std::vector<uint8_t> bytes; base::HexStringToBytes(kImageBytes, &bytes); image_decoder_->DecodeImage( std::move(bytes), base::BindOnce(&QuickPairHandler::OnImageDecodedFastPairDiscovery, weak_ptr_factory_.GetWeakPtr())); } void QuickPairHandler::OnImageDecodedFastPairDiscovery(gfx::Image image) { fast_pair_notification_controller_->ShowDiscoveryNotification( kTestDeviceName, image, base::DoNothing(), base::DoNothing()); } void QuickPairHandler::NotifyFastPairPairing(const base::ListValue* args) { std::vector<uint8_t> bytes; base::HexStringToBytes(kImageBytes, &bytes); image_decoder_->DecodeImage( std::move(bytes), base::BindOnce(&QuickPairHandler::OnImageDecodedFastPairPairing, weak_ptr_factory_.GetWeakPtr())); } void QuickPairHandler::OnImageDecodedFastPairPairing(gfx::Image image) { fast_pair_notification_controller_->ShowPairingNotification( kTestDeviceName, image, base::DoNothing(), base::DoNothing()); } void QuickPairHandler::NotifyFastPairAssociateAccountKey( const base::ListValue* args) { std::vector<uint8_t> bytes; base::HexStringToBytes(kImageBytes, &bytes); image_decoder_->DecodeImage( std::move(bytes), base::BindOnce( &QuickPairHandler::OnImageDecodedFastPairAssociateAccountKey, weak_ptr_factory_.GetWeakPtr())); } void QuickPairHandler::OnImageDecodedFastPairAssociateAccountKey( gfx::Image image) { fast_pair_notification_controller_->ShowAssociateAccount( kTestDeviceName, kTestEmail, image, base::DoNothing(), base::DoNothing(), base::DoNothing()); }
79.193482
83
0.910083
[ "vector" ]
98d341e91c7afce13ba51b2fe61446f415405d8c
8,084
cpp
C++
lane_detection/src/peak_finder.cpp
repa1030/simulator_ubuntu
8f46ddcd2887f863aa5e71ab878fb0eb9bd4a523
[ "MIT" ]
null
null
null
lane_detection/src/peak_finder.cpp
repa1030/simulator_ubuntu
8f46ddcd2887f863aa5e71ab878fb0eb9bd4a523
[ "MIT" ]
null
null
null
lane_detection/src/peak_finder.cpp
repa1030/simulator_ubuntu
8f46ddcd2887f863aa5e71ab878fb0eb9bd4a523
[ "MIT" ]
null
null
null
// ================================================================= // Copyright (C) 2020 Hochschule Karlsruhe - Technik und Wirtschaft // This program and the accompanying materials // are made available under the terms of the MIT license. // ================================================================= // Authors: Anna-Lena Marmein, Magdalena Kugler, Yannick Rauch, // Markus Zimmermann, Patrick Rebling // ================================================================= // Algorithm based on: https://github.com/claydergc/find-peaks // ================================================================= #include "peak_finder.h" // Constructor PeakFinder::PeakFinder() : EPS(2.2204e-16f) { } // Destructor PeakFinder::~PeakFinder() { } // Calulcate derivation (delta) vector of an input in void PeakFinder::diff(std::vector<float> in, std::vector<float>& out) { out = std::vector<float>(in.size()-1); for(int i=1; i<in.size(); ++i) out[i-1] = in[i] - in[i-1]; } // Calculate products of each vector elements from 0 to size(a) of two input vectors a and b void PeakFinder::vectorProduct(std::vector<float> a, std::vector<float> b, std::vector<float>& out) { out = std::vector<float>(a.size()); for(int i=0; i<a.size(); ++i) out[i] = a[i] * b[i]; } // Find vector elements that are smaller than a given threshold void PeakFinder::findIndicesLessThan(std::vector<float> in, float threshold, std::vector<int>& indices) { for(int i=0; i<in.size(); ++i) if(in[i]<threshold) indices.push_back(i+1); } // Select elements in origin float vector with given indices vector void PeakFinder::selectElements(std::vector<float> in, std::vector<int> indices, std::vector<float>& out) { for(int i=0; i<indices.size(); ++i) out.push_back(in[indices[i]]); } // Select elements in origin int vector with given indices vector void PeakFinder::selectElements(std::vector<int> in, std::vector<int> indices, std::vector<int>& out) { for(int i=0; i<indices.size(); ++i) out.push_back(in[indices[i]]); } // Analyse the sign of the vector elements and returns an output vector with range [1, -1] void PeakFinder::signVector(std::vector<float> in, std::vector<int>& out) { out = std::vector<int>(in.size()); for(int i=0; i<in.size(); ++i) { if(in[i]>0) out[i]=1; else if(in[i]<0) out[i]=-1; else out[i]=0; } } // Find peaks in vector x0_raw void PeakFinder::findPeaks(std::vector<int> x0_raw, std::vector<int>& peakInds) { // Convert the input int vector to float vector x0 std::vector<float> x0; for(int i=0; i < x0_raw.size(); i++) { x0.push_back(static_cast<float>(x0_raw[i])); } // Search the global minimum and maximum inside x0 int minIdx = std::distance(x0.begin(), min_element(x0.begin(), x0.end())); int maxIdx = std::distance(x0.begin(), max_element(x0.begin(), x0.end())); // Calculate (max-min)/4 for selection later float sel = (x0[maxIdx]-x0[minIdx])/4.0; // Get derivation vector of x0 std::vector<float> dx; diff(x0, dx); // Replace 0.0 with -EPS replace(dx.begin(), dx.end(), 0.0f, -EPS); // Generate two vectors, one from dx[start] till dx[end-1] // and one from dx[start+1] to dx[end]. So there are is one // vector dx0 and one vector dx1 that is shifted by one std::vector<float> dx0(dx.begin(), dx.end()-1); std::vector<float> dx1(dx.begin()+1, dx.end()); std::vector<float> dx2; // Calculate the product of the elements of dx0 and dx1 // dx2[i] = dx0[i] * dx1[i] // This is done for knowledge of sign change inside the // derivation vector vectorProduct(dx0, dx1, dx2); // Find where the derivative changes sign as this is a // necessary condition for a peak std::vector<int> ind; findIndicesLessThan(dx2, 0, ind); // Generate a vector that stores the indices where the sign // changes in the derivation vector std::vector<float> x; std::vector<int> indAux(ind.begin(), ind.end()); // Select the elements from the origin float vector x0 where the // derivative changes sign selectElements(x0, indAux, x); // Insert first and last element of origin vector to x as it is // not possible to get a significant derivation there (check separately) x.insert(x.begin(), x0[0]); x.insert(x.end(), x0[x0.size()-1]);; // Insert the two elements respectively their indices also into the index vector ind.insert(ind.begin(), 0); ind.insert(ind.end(), x0.size()); // Select the Global Minimum and the minimum two its left (same element) int minMagIdx = distance(x.begin(), min_element(x.begin(), x.end())); float minMag = x[minMagIdx]; float leftMin = minMag; int len = x.size(); // Only if the vector has more elements than two if(len>2) { float tempMag = minMag; bool foundPeak = false; int ii; // Deal with first point a little differently // Generate subvector from x (first 3 elements), // calculate the differences of the elements and check the signs std::vector<float> xSub0(x.begin(), x.begin()+3); std::vector<float> xDiff; std::vector<int> signDx; diff(xSub0, xDiff); signVector(xDiff, signDx); // The first point is larger or equal to the second if(signDx[0] <= 0) { // Want alternating signs, so erase if not alternating if(signDx[0] == signDx[1]) { x.erase(x.begin()+1); ind.erase(ind.begin()+1); len = len-1; } } // First point is smaller than the second else { // Want alternating signs, so erase if not alternating if(signDx[0] == signDx[1]) { x.erase(x.begin()); ind.erase(ind.begin()); len = len-1; } } // Define first iterator if(x[0] >= x[1]) ii = 0; else ii = 1; // Defines a maximum number of peaks float maxPeaks = ceil((float)len/2.0); std::vector<int> peakLoc(maxPeaks,0); std::vector<float> peakMag(maxPeaks,0.0); int cInd = 1; int tempLoc; while(ii < len) { // Iterate through peaks ii = ii+1; // Reset peak finding if we had a peak and the next peak is bigger // than the last or the left min was small enough to reset. if(foundPeak) { tempMag = minMag; foundPeak = false; } // Found new peak that was lager than temp mag and selectivity larger // than the minimum to its left. if(x[ii-1] > tempMag && x[ii-1] > leftMin + sel) { tempLoc = ii-1; tempMag = x[ii-1]; } // Make sure we don't iterate past the length of our vector if(ii == len) // We assign the last point differently out of the loop break; // Move onto the valley ii = ii+1; // Come down at least sel from peak if(!foundPeak && tempMag > sel + x[ii-1]) { // We have found a peak foundPeak = true; leftMin = x[ii-1]; // Add peak to index peakLoc[cInd-1] = tempLoc; peakMag[cInd-1] = tempMag; cInd = cInd+1; } // New left minima else if(x[ii-1] < leftMin) leftMin = x[ii-1]; } // Check end point if(x[x.size()-1] > tempMag && x[x.size()-1] > leftMin + sel) { peakLoc[cInd-1] = len-1; peakMag[cInd-1] = x[x.size()-1]; cInd = cInd + 1; } // Check if we still need to add the last point else if(!foundPeak && tempMag > minMag) { peakLoc[cInd-1] = tempLoc; peakMag[cInd-1] = tempMag; cInd = cInd + 1; } //Create output if(cInd > 0) { std::vector<int> peakLocTmp(peakLoc.begin(), peakLoc.begin()+cInd-1); selectElements(ind, peakLocTmp, peakInds); } } }
33.131148
107
0.57187
[ "vector" ]
98d5d7722dfea54ae37806d616a5d0e325597a37
3,991
cpp
C++
Division-Engine/Engine/Rendering/Texture/TextureHandler.cpp
Dlee4428/Division-Engine
fea6b1d389fbd10cac78b8510fa5a2c3d66d4791
[ "MIT" ]
null
null
null
Division-Engine/Engine/Rendering/Texture/TextureHandler.cpp
Dlee4428/Division-Engine
fea6b1d389fbd10cac78b8510fa5a2c3d66d4791
[ "MIT" ]
null
null
null
Division-Engine/Engine/Rendering/Texture/TextureHandler.cpp
Dlee4428/Division-Engine
fea6b1d389fbd10cac78b8510fa5a2c3d66d4791
[ "MIT" ]
null
null
null
#include "TextureHandler.h" // GLOBAL SETTERS FOR IMAGE FORMAT TYPE REFERENCE const ImageFormatType ImageFormatType::IMAGE_FORMAT_SRGBA8 = ImageFormatType(GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, 4, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_SRGB8 = ImageFormatType(GL_SRGB8, GL_RGB, GL_UNSIGNED_BYTE, 3, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_SBGR8 = ImageFormatType(GL_SRGB8, GL_BGR, GL_UNSIGNED_BYTE, 3, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_RGBA8_LINEAR = ImageFormatType(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, 4, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_RGB8_LINEAR = ImageFormatType(GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, 3, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_R8 = ImageFormatType(GL_R8, GL_RED, GL_UNSIGNED_BYTE, 1, 1); const ImageFormatType ImageFormatType::IMAGE_FORMAT_R16 = ImageFormatType(GL_R16, GL_RED, GL_UNSIGNED_SHORT, 1, 2); const ImageFormatType ImageFormatType::IMAGE_FORMAT_DEPTH_32F = ImageFormatType(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, 1, 4); TextureHandler::TextureHandler(GLenum textureType_) : type(textureType_), mipmapLevels(8) { OnCreate(); } TextureHandler::~TextureHandler() { OnDestroy(); for (unsigned int i = 0; i < images.size(); ++i) { if (images[i].data != 0) { delete[] images[i].data; } } } void TextureHandler::OnCreate() { glCreateTextures(type, 1, &name); } void TextureHandler::OnDestroy() { // Clear out Textures and image memory data glDeleteTextures(1, &name); } void TextureHandler::Bind() const { glActiveTexture(GL_TEXTURE0); glBindTexture(type, name); } void TextureHandler::Bind(int unit_) const { glBindTextureUnit(unit_, name); } void TextureHandler::ModifyTextureParam(GLenum param_, GLfloat value_) { // TEXTURE WRAP and VALUE parameter for terrain glTextureParameterf(name, param_, value_); } void TextureHandler::InitFromImageFile(const std::string& imagePath_, const ImageFormatType& imageFormat_) { // Push single file element into vector // With the type of DevIl image LoadPath images.push_back(LoadFileType(imagePath_, imageFormat_)); Process(); } void TextureHandler::InitFromImageFiles(const std::vector<std::string>& imagePaths_, const ImageFormatType& imageFormat_) { // Push multiple file elements into vector for (auto p : imagePaths_) { images.push_back(LoadFileType(p, imageFormat_)); } Process(); } void TextureHandler::InitFromImageData(uint32_t width_, uint32_t height_, const uint8_t* imageData_, const ImageFormatType& imageFormat_) { // For the FBO function, init depthTexture Data for Terrain ImageDataType imageData; imageData.format = imageFormat_; imageData.width = width_; imageData.height = height_; imageData.sizeInBytes = width_ * height_ * imageFormat_.numberChannels * imageFormat_.bytesPerChannel; if (imageData_ != 0) { imageData.data = new uint8_t[imageData.sizeInBytes]; memcpy(imageData.data, imageData_, imageData.sizeInBytes); } else { imageData.data = 0; } images.push_back(imageData); Process(); } const ImageDataType TextureHandler::LoadFileType(const std::string& imagePath_, const ImageFormatType& imageFormat_) { // DevIl Image Loader ilInit(); ILuint imageIl; ilGenImages(1, &imageIl); ilBindImage(imageIl); ilEnable(IL_ORIGIN_SET); ilOriginFunc(IL_ORIGIN_LOWER_LEFT); ImageDataType imageData; ILboolean result = ilLoadImage(imagePath_.c_str()); if (result) { imageData.format = imageFormat_; imageData.width = ilGetInteger(IL_IMAGE_WIDTH); imageData.height = ilGetInteger(IL_IMAGE_HEIGHT); imageData.sizeInBytes = imageData.width * imageData.height * imageData.format.numberChannels * imageData.format.bytesPerChannel; imageData.data = new uint8_t[imageData.sizeInBytes]; memcpy(imageData.data, ilGetData(), imageData.sizeInBytes); } else { Debug::FatalError("Cannot access image file " + imagePath_, __FILE__, __LINE__); } ilDeleteImages(1, &imageIl); return imageData; }
30.234848
139
0.774493
[ "vector" ]
98ec0a6bc885bb40e3ea4630efe47dd613083f16
101,402
cpp
C++
ugene/src/plugins_3rdparty/hmm3/src/hmmer3/easel/esl_msa.cpp
iganna/lspec
c75cba3e4fa9a46abeecbf31b5d467827cf4fec0
[ "MIT" ]
null
null
null
ugene/src/plugins_3rdparty/hmm3/src/hmmer3/easel/esl_msa.cpp
iganna/lspec
c75cba3e4fa9a46abeecbf31b5d467827cf4fec0
[ "MIT" ]
null
null
null
ugene/src/plugins_3rdparty/hmm3/src/hmmer3/easel/esl_msa.cpp
iganna/lspec
c75cba3e4fa9a46abeecbf31b5d467827cf4fec0
[ "MIT" ]
null
null
null
/*::cexcerpt::header_example::begin::*/ /* Multiple sequence alignment file i/o. * * Contents: * 1. The <ESL_MSA> object * 2. The <ESL_MSAFILE> object * 3. Digital mode MSA's (augmentation: alphabet) * 4. Random MSA database access (augmentation: ssi) * 5. General i/o API, for all alignment formats * 6. Miscellaneous functions for manipulating MSAs * 7. Stockholm (Pfam/Rfam) format * 8. A2M format * 9. PSIBLAST format * 10. SELEX format * 11. Debugging/development routines * 16. Copyright and license information * * Augmentations: * alphabet: adds support for digital MSAs * keyhash: speeds up Stockholm file input * ssi: enables indexed random access in a file of many MSAs * * to do: SRE, Sat Jan 3 09:43:42 2009 (after selex parser added) * - SELEX parser is better in some respects than older Stockholm * parser; stricter, better error detection, better modularity. * Generalize the SELEX parser routines and use them for Stockholm. * - Test files for SELEX parser are in esl_msa_testfiles/selex, with * tabular summary list in 00MANIFEST. This is an experiment with * writing tests that require lots of external files, such as * format parsers. Write test driver routine that reads 00MANIFEST * and runs esl_msa_Read() against these files, checking for proper * return status, including errors. * - The selex parser's read_block() reads lines into memory and * parses them later. afp->linenumber is thus no longer an * accurate record of where a parse error occurs. read_xxx() * format parsers now need to include line number in their * afp->errbuf[] message upon eslEFORMAT error. Stockholm parser * doesn't do this. Make it so, and document in examples. * - Format autodetection doesn't work yet. Coordinate w/ how sqio * does it, and implement. May require buffering input to make * it work with .gz, pipes without rewinding a stream. Might be * a good idea to generalize input buffering - perhaps making * it part of ESL_FILEPARSER. * - PSIBLAST, A2M format only supported on output, not input. * Implement input parsers. * - SELEX format only supported on input, not output. * Implement output writer. * - More formats need to be parsed. Check on formats for current * best MSA programs, such as MUSCLE, MAFFT; implement i/o. * * SRE, Thu Jan 20 08:50:43 2005 [St. Louis] * SVN $Id: esl_msa.c 440 2009-11-13 17:02:49Z eddys $ */ /*::cexcerpt::header_example::end::*/ /*::cexcerpt::include_example::begin::*/ #include <hmmer3/easel/esl_config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <limits.h> #include <hmmer3/easel/easel.h> #include <hmmer3/hmmer.h> #ifdef eslAUGMENT_KEYHASH #include "esl_keyhash.h" #endif #ifdef eslAUGMENT_ALPHABET #include <hmmer3/easel/esl_alphabet.h> #endif #ifdef eslAUGMENT_SSI #include "esl_ssi.h" #endif #include <hmmer3/easel/esl_wuss.h> #include <hmmer3/easel/esl_vectorops.h> #include "esl_msa.h" /*::cexcerpt::include_example::end::*/ /****************************************************************************** *# 1. The <ESL_MSA> object *****************************************************************************/ /* create_mostly() * SRE, Sun Aug 27 16:40:00 2006 [Leesburg] * * This is the routine called by esl_msa_Create() and esl_msa_CreateDigital() * that does all allocation except the aseq/ax alignment data. * * <nseq> may be the exact known # of seqs in an alignment; or <nseq> * may be an allocation block size (to be expanded by doubling, in * esl_msa_Expand(), as in: * <if (msa->nseq == msa->sqalloc) esl_msa_Expand(msa);> * <nseq> should not be 0. * * <alen> may be the exact length of an alignment, in columns; or it * may be -1, which states that your parser will take responsibility * for expanding as needed as new input is read into a growing new * alignment. * * A created <msa> can only be <_Expand()>'ed if <alen> is -1. * * Args: <nseq> - number of sequences, or nseq allocation blocksize * <alen> - length of alignment in columns, or -1 * * Returns: pointer to new MSA object, w/ all values initialized. * Note that msa->nseq is initialized to 0 here, even though space * is allocated. * * Throws: <NULL> on allocation failure. */ static ESL_MSA * create_mostly(int nseq, int64_t alen) { int status; ESL_MSA *msa = NULL; int i; ESL_ALLOC_WITH_TYPE(msa, ESL_MSA*, sizeof(ESL_MSA)); msa->aseq = NULL; msa->sqname = NULL; msa->wgt = NULL; msa->alen = alen; /* if -1, then we're growable. */ msa->nseq = 0; /* our caller (text or digital allocation) sets this. */ msa->flags = 0; #ifdef eslAUGMENT_ALPHABET msa->abc = NULL; msa->ax = NULL; #endif /*eslAUGMENT_ALPHABET*/ msa->name = NULL; msa->desc = NULL; msa->acc = NULL; msa->au = NULL; msa->ss_cons = NULL; msa->sa_cons = NULL; msa->pp_cons = NULL; msa->rf = NULL; msa->sqacc = NULL; msa->sqdesc = NULL; msa->ss = NULL; msa->sa = NULL; msa->pp = NULL; for (i = 0; i < eslMSA_NCUTS; i++) { msa->cutoff[i] = 0.; msa->cutset[i] = FALSE; } msa->sqalloc = nseq; msa->sqlen = NULL; msa->sslen = NULL; msa->salen = NULL; msa->pplen = NULL; msa->lastidx = 0; /* Unparsed markup, including comments and Stockholm tags. * GS, GC, and GR Stockholm tags require keyhash augmentation */ msa->comment = NULL; msa->ncomment = 0; msa->alloc_ncomment = 0; msa->gf_tag = NULL; msa->gf = NULL; msa->ngf = 0; msa->alloc_ngf = 0; msa->gs_tag = NULL; msa->gs = NULL; msa->ngs = 0; msa->gc_tag = NULL; msa->gc = NULL; msa->ngc = 0; msa->gr_tag = NULL; msa->gr = NULL; msa->ngr = 0; #ifdef eslAUGMENT_KEYHASH msa->index = esl_keyhash_Create(); msa->gs_idx = NULL; msa->gc_idx = NULL; msa->gr_idx = NULL; #endif /*eslAUGMENT_KEYHASH*/ #ifdef eslAUGMENT_SSI msa->offset = 0; #endif /* Allocation, round 2. */ if(nseq > 0) { ESL_ALLOC_WITH_TYPE(msa->sqname,char**, sizeof(char *) * nseq); ESL_ALLOC_WITH_TYPE(msa->wgt, double*, sizeof(double) * nseq); ESL_ALLOC_WITH_TYPE(msa->sqlen, int64_t*, sizeof(int64_t)* nseq); } /* Initialize at the second level. */ for (i = 0; i < nseq; i++) { msa->sqname[i] = NULL; msa->sqlen[i] = 0; msa->wgt[i] = -1.0; /* "unset so far" */ } return msa; ERROR: esl_msa_Destroy(msa); return NULL; } /* get_seqidx() * * Find the index of a given sequence <name> in an <msa>. * If caller has a good guess (for instance, the sequences are * coming in a previously seen order in a block of seqs or annotation), * the caller can pass this information in <guess>, or -1 if * it has no guess. * * This function behaves differently depending on whether * keyhash augmentation is available or not. Without keyhashing, * the name is identified by bruteforce search of the names * in the <msa>. With keyhashing, we hash search, which should * improve performance for large alignments. * * If the name does not already exist in the MSA, then it * is assumed to be a new sequence name that we need to store. * seqidx is set to msa->nseq, the MSA is Expand()'ed if necessary * to make room, the name is stored in msa->sqname[msa->nseq], * (and in the hash table, if we're keyhash augmented) * and msa->nseq is incremented. * * Returns: <eslOK> on success, and the seqidx is * passed back via <ret_idx>. If <name> is new * in the <msa>, the <name> is stored and the <msa> * may be internally reallocated if needed. * * Throws: <eslEMEM> if we try to add a name and allocation fails. * <eslEINVAL> if we try to add a name to a non-growable MSA. */ static int get_seqidx(ESL_MSA *msa, char *name, int guess, int *ret_idx) { int seqidx; int status; *ret_idx = -1; /* can we guess? */ if (guess >= 0 && guess < msa->nseq && strcmp(name, msa->sqname[guess]) == 0) { *ret_idx = guess; return eslOK; } /* Else look it up - either brute force * or, if we're keyhash-augmented, by hashing. */ #ifdef eslAUGMENT_KEYHASH status = esl_key_Store(msa->index, name, &seqidx); if (status == eslEDUP) { *ret_idx = seqidx; return eslOK; } if (status != eslOK) return status; /* an error. */ #else for (seqidx = 0; seqidx < msa->nseq; seqidx++) if (strcmp(msa->sqname[seqidx], name) == 0) break; if (seqidx < msa->nseq) { *ret_idx = seqidx; return eslOK; } #endif /* If we reach here, then this is a new name that we're * adding. */ if (seqidx >= msa->sqalloc && (status = esl_msa_Expand(msa)) != eslOK) return status; status = esl_strdup(name, -1, &(msa->sqname[seqidx])); msa->nseq++; if (ret_idx != NULL) *ret_idx = seqidx; return status; } /* msa_get_rlen() * * Returns the raw (unaligned) length of sequence number <seqidx> * in <msa>. */ static int64_t msa_get_rlen(const ESL_MSA *msa, int seqidx) { int64_t rlen = 0; int pos; #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) rlen = esl_abc_dsqrlen(msa->abc, msa->ax[seqidx]); #endif if (! (msa->flags & eslMSA_DIGITAL)) { for (pos = 0; pos < msa->alen; pos++) if (isalnum(msa->aseq[seqidx][pos])) rlen++; } return rlen; } /* set_seq_ss() * * Set the secondary structure annotation for sequence number * <seqidx> in an alignment <msa> by copying the string <ss>. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ static int set_seq_ss(ESL_MSA *msa, int seqidx, const char *ss) { int status; int i; if (msa->ss == NULL) { ESL_ALLOC_WITH_TYPE(msa->ss, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->ss[i] = NULL; } if (msa->ss[seqidx] != NULL) free(msa->ss[seqidx]); return (esl_strdup(ss, -1, &(msa->ss[seqidx]))); ERROR: return status; } /* set_seq_sa() * * Set the surface accessibility annotation for sequence number * <seqidx> in an alignment <msa> by copying the string <sa>. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ static int set_seq_sa(ESL_MSA *msa, int seqidx, const char *sa) { int status; int i; if (msa->sa == NULL) { ESL_ALLOC_WITH_TYPE(msa->sa, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->sa[i] = NULL; } if (msa->sa[seqidx] != NULL) free(msa->sa[seqidx]); return (esl_strdup(sa, -1, &(msa->sa[seqidx]))); ERROR: return status; } /* set_seq_pp() * * Set the posterior probability annotation for sequence number * <seqidx> in an alignment <msa> by copying the string <pp>. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ static int set_seq_pp(ESL_MSA *msa, int seqidx, const char *pp) { int status; int i; if (msa->pp == NULL) { ESL_ALLOC_WITH_TYPE(msa->pp, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->pp[i] = NULL; } if (msa->pp[seqidx] != NULL) free(msa->pp[seqidx]); return (esl_strdup(pp, -1, &(msa->pp[seqidx]))); ERROR: return status; } /* verify_parse() * * Last function called after a multiple alignment parser thinks it's * done. Checks that parse was successful; makes sure required * information is present; makes sure required information is * consistent. Some fields that are only use during parsing may be * freed (sqlen, for example), and some fields are finalized now * (<msa->alen> is set, for example). * * <errbuf> is a place to sprintf an informative message about the * reason for a parse error. The caller provides an <errbuf> * of at least 512 bytes. * * Returns: <eslOK>, and errbuf is set to an empty string. * * Throws: <eslEFORMAT> if a problem is detected, and an * informative message about the failure is in errbuf. */ //static int //verify_parse(ESL_MSA *msa, char *errbuf) //{ // int idx; // // if (msa->nseq == 0) ESL_FAIL(eslEFORMAT, errbuf, "parse error: no alignment data found"); // // /* set alen, until proven otherwise; we'll check that the other seqs // * have the same length later. // */ // msa->alen = msa->sqlen[0]; // // /* We can rely on msa->sqname[] being valid for any index, // * because of the way the line parsers always store any name // * they add to the index. // */ // for (idx = 0; idx < msa->nseq; idx++) // { //#ifdef eslAUGMENT_ALPHABET // if ((msa->flags & eslMSA_DIGITAL) && (msa->ax == NULL || msa->ax[idx] == NULL)) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: no sequence for %s", // msa->name != NULL ? msa->name : "", msa->sqname[idx]); //#endif // if (! (msa->flags & eslMSA_DIGITAL) && (msa->aseq == NULL || msa->aseq[idx] == NULL)) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: no sequence for %s", // msa->name != NULL ? msa->name : "", msa->sqname[idx]); // // /* either all weights must be set, or none of them */ // if ((msa->flags & eslMSA_HASWGTS) && msa->wgt[idx] == -1.0) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: expected a weight for seq %s", // msa->name != NULL ? msa->name : "", msa->sqname[idx]); // // /* all aseq must be same length. */ // if (msa->sqlen[idx] != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: sequence %s: length %" PRId64 ", expected %" PRId64, // msa->name != NULL ? msa->name : "", msa->sqname[idx], msa->sqlen[idx], msa->alen); // // /* if individual SS is present, it must have length right too */ // if (msa->ss != NULL && msa->ss[idx] != NULL && msa->sslen[idx] != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GR SS for %s: length %" PRId64 ", expected %" PRId64, // msa->name != NULL ? msa->name : "", msa->sqname[idx], msa->sslen[idx], msa->alen); // // /* if SA is present, must have length right */ // if (msa->sa != NULL && msa->sa[idx] != NULL && msa->salen[idx] != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GR SA for %s: length %" PRId64 ", expected %" PRId64, // msa->name != NULL ? msa->name : "", msa->sqname[idx], msa->salen[idx], msa->alen); // // /* if PP is present, must have length right */ // if (msa->pp != NULL && msa->pp[idx] != NULL && msa->pplen[idx] != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GR PP for %s: length %" PRId64 ", expected %" PRId64, // msa->name != NULL ? msa->name : "", msa->sqname[idx], msa->pplen[idx], msa->alen); // } // // /* if cons SS is present, must have length right */ // if (msa->ss_cons != NULL && strlen(msa->ss_cons) != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GC SS_cons markup: len %zd, expected %" PRId64, // msa->name != NULL ? msa->name : "", strlen(msa->ss_cons), msa->alen); // // /* if cons SA is present, must have length right */ // if (msa->sa_cons != NULL && strlen(msa->sa_cons) != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GC SA_cons markup: len %zd, expected %" PRId64, // msa->name != NULL ? msa->name : "", strlen(msa->sa_cons), msa->alen); // // /* if cons PP is present, must have length right */ // if (msa->pp_cons != NULL && strlen(msa->pp_cons) != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GC PP_cons markup: len %zd, expected %" PRId64, // msa->name != NULL ? msa->name : "", strlen(msa->pp_cons), msa->alen); // // /* if RF is present, must have length right */ // if (msa->rf != NULL && strlen(msa->rf) != msa->alen) // ESL_FAIL(eslEFORMAT, errbuf, "MSA %s parse error: GC RF markup: len %zd, expected %" PRId64, // msa->name != NULL ? msa->name : "", strlen(msa->rf), msa->alen); // // /* If no weights were set, set 'em all to 1.0 */ // if (!(msa->flags & eslMSA_HASWGTS)) // for (idx = 0; idx < msa->nseq; idx++) // msa->wgt[idx] = 1.0; // // /* Clean up a little from the parser */ // if (msa->sqlen != NULL) { free(msa->sqlen); msa->sqlen = NULL; } // if (msa->sslen != NULL) { free(msa->sslen); msa->sslen = NULL; } // if (msa->salen != NULL) { free(msa->salen); msa->salen = NULL; } // if (msa->pplen != NULL) { free(msa->pplen); msa->pplen = NULL; } // return eslOK; //} /* Function: esl_msa_Create() * Synopsis: Creates an <ESL_MSA> object. * Incept: SRE, Sun Jan 23 08:25:26 2005 [St. Louis] * * Purpose: Creates and initializes an <ESL_MSA> object, and returns a * pointer to it. * * If caller already knows the dimensions of the alignment, * both <nseq> and <alen>, then <msa = esl_msa_Create(nseq, * alen)> allocates the whole thing at once. The MSA's * <nseq> and <alen> fields are set accordingly, and the * caller doesn't have to worry about setting them; it can * just fill in <aseq>. * * If caller doesn't know the dimensions of the alignment * (for example, when parsing an alignment file), then * <nseq> is taken to be an initial allocation size, and * <alen> must be -1. <alen=-1> is used as a flag for a * "growable" MSA. For example, the call <msa = * esl_msa_Create(16, -1)>. allocates internally for an * initial block of 16 sequences, but without allocating * any space for individual sequences. This allocation can * be expanded (by doubling) by calling <esl_msa_Expand()>. * A created <msa> can only be <_Expand()>'ed if <alen> is * -1. * * In a growable alignment, caller becomes responsible for * memory allocation of each individual <aseq[i]>. Caller * is also responsible for setting <nseq> and <alen> when * it is done parsing and creating the new MSA. In * particular, the <esl_msa_Destroy()> function relies on * <nseq> to know how many individual sequences are * allocated. * * Args: <nseq> - number of sequences, or nseq allocation blocksize * <alen> - length of alignment in columns, or -1 * * Returns: pointer to new MSA object, w/ all values initialized. * * Throws: <NULL> on allocation failure. * * Xref: squid's MSAAlloc() */ ESL_MSA * esl_msa_Create(int nseq, int64_t alen) { int status; ESL_MSA *msa; int i; msa = create_mostly(nseq, alen); /* aseq is null upon successful return */ if (msa == NULL) return NULL; /* already threw error in mostly_create, so percolate */ ESL_ALLOC_WITH_TYPE(msa->aseq, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->aseq[i] = NULL; if (alen != -1) { for (i = 0; i < nseq; i++) { ESL_ALLOC_WITH_TYPE(msa->aseq[i], char*, sizeof(char) * (alen+1)); msa->aseq[i][alen] = '\0'; /* caller might forget to null terminate; help the poor */ } msa->nseq = nseq; } return msa; ERROR: esl_msa_Destroy(msa); return NULL; } /* Function: esl_msa_Expand() * Synopsis: Reallocate for more sequences. * Incept: SRE, Sun Jan 23 08:26:30 2005 [St. Louis] * * Purpose: Double the current sequence allocation in <msa>. * Typically used when we're reading an alignment sequentially * from a file, so we don't know nseq 'til we're done. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on reallocation failure; <msa> is undamaged, * and the caller may attempt to recover from the error. * * Throws <eslEINVAL> if <msa> is not growable: its <alen> * field must be -1 to be growable. * * Xref: squid's MSAExpand(), 1999. */ int esl_msa_Expand(ESL_MSA *msa) { int status; int old, newSz; /* old & new allocation sizes (max # seqs) */ void *p; /* tmp ptr to realloc'ed memory */ int i,j; if (msa->alen != -1) ESL_EXCEPTION(eslEINVAL, "that MSA is not growable"); old = msa->sqalloc; newSz = 2*old; /* Normally either aseq (ascii) or ax (digitized) would be active, not both. * We could make sure that that's true, but that's checked elsewhere. */ if (msa->aseq != NULL) ESL_RALLOC_WITH_TYPE(msa->aseq, char**, p, sizeof(char *) * newSz); #ifdef eslAUGMENT_ALPHABET if (msa->ax != NULL) ESL_RALLOC_WITH_TYPE(msa->ax, ESL_DSQ**, p, sizeof(ESL_DSQ *) * newSz); #endif /*eslAUGMENT_ALPHABET*/ ESL_RALLOC_WITH_TYPE(msa->sqname, char**, p, sizeof(char *) * newSz); ESL_RALLOC_WITH_TYPE(msa->wgt, double*, p, sizeof(double) * newSz); ESL_RALLOC_WITH_TYPE(msa->sqlen, int64_t*, p, sizeof(int64_t)* newSz); if (msa->ss != NULL) { ESL_RALLOC_WITH_TYPE(msa->ss, char**, p, sizeof(char *) * newSz); ESL_RALLOC_WITH_TYPE(msa->sslen, int64_t*, p, sizeof(int64_t) * newSz); } if (msa->sa != NULL) { ESL_RALLOC_WITH_TYPE(msa->sa, char**, p, sizeof(char *) * newSz); ESL_RALLOC_WITH_TYPE(msa->salen, int64_t*, p, sizeof(int64_t) * newSz); } if (msa->pp != NULL) { ESL_RALLOC_WITH_TYPE(msa->pp, char**, p, sizeof(char *) * newSz); ESL_RALLOC_WITH_TYPE(msa->pplen, int64_t*, p, sizeof(int64_t) * newSz); } if (msa->sqacc != NULL) ESL_RALLOC_WITH_TYPE(msa->sqacc, char**, p, sizeof(char *) * newSz); if (msa->sqdesc != NULL) ESL_RALLOC_WITH_TYPE(msa->sqdesc, char**, p, sizeof(char *) * newSz); for (i = old; i < newSz; i++) { if (msa->aseq != NULL) msa->aseq[i] = NULL; #ifdef eslAUGMENT_ALPHABET if (msa->ax != NULL) msa->ax[i] = NULL; #endif /*eslAUGMENT_ALPHABET*/ msa->sqname[i] = NULL; msa->wgt[i] = -1.0; /* -1.0 means "unset so far" */ msa->sqlen[i] = 0; if (msa->ss != NULL) { msa->ss[i] = NULL; msa->sslen[i] = 0; } if (msa->sa != NULL) { msa->sa[i] = NULL; msa->salen[i] = 0; } if (msa->pp != NULL) { msa->pp[i] = NULL; msa->pplen[i] = 0; } if (msa->sqacc != NULL) msa->sqacc[i] = NULL; if (msa->sqdesc != NULL) msa->sqdesc[i] = NULL; } /* Reallocate and re-init for unparsed #=GS tags, if we have some. * gs is [0..ngs-1][0..nseq-1][], so we're reallocing the middle * set of pointers. */ if (msa->gs != NULL) for (i = 0; i < msa->ngs; i++) { if (msa->gs[i] != NULL) { ESL_RALLOC_WITH_TYPE(msa->gs[i], char**, p, sizeof(char *) * newSz); for (j = old; j < newSz; j++) msa->gs[i][j] = NULL; } } /* Reallocate and re-init for unparsed #=GR tags, if we have some. * gr is [0..ngs-1][0..nseq-1][], so we're reallocing the middle * set of pointers. */ if (msa->gr != NULL) for (i = 0; i < msa->ngr; i++) { if (msa->gr[i] != NULL) { ESL_RALLOC_WITH_TYPE(msa->gr[i], char**, p, sizeof(char *) * newSz); for (j = old; j < newSz; j++) msa->gr[i][j] = NULL; } } msa->sqalloc = newSz; return eslOK; ERROR: return status; } /* Function: esl_msa_Copy() * Synopsis: Copies an MSA. * Incept: SRE, Tue Jan 22 15:30:32 2008 [Janelia] * * Purpose: Makes a copy of <msa> in <new>. Caller has * already allocated <new> to hold an MSA of * at least <msa->nseq> sequences and <msa->alen> * columns. * * Note: Because MSA's are not reusable, this function does a * lot of internal allocation for optional fields, without * checking <new> to see if space was already allocated. To * reuse an MSA <new> and copy new data into it, we'll * eventually need a <esl_msa_Reuse()> function, and/or * recode this to reuse or free any already-allocated * optional memory it encounters in <new>. Until then, * it's unlikely that <esl_msa_Copy()> is useful on its own; * the caller would be expected to call <esl_msa_Clone()> * instead. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. In this case, <new> * was only partially constructed, and should be treated * as corrupt. */ int esl_msa_Copy(const ESL_MSA *msa, ESL_MSA *newMSA) { int i, x, j; int status; /* aseq[0..nseq-1][0..alen-1] strings, * or ax[0..nseq-1][(0) 1..alen (alen+1)] digital seqs * <new> must have one of them allocated already. */ if (! (msa->flags & eslMSA_DIGITAL)) for (i = 0; i < msa->nseq; i++) strcpy(newMSA->aseq[i], msa->aseq[i]); #ifdef eslAUGMENT_ALPHABET else { for (i = 0; i < msa->nseq; i++) memcpy(newMSA->ax[i], msa->ax[i], (msa->alen+2) * sizeof(ESL_DSQ)); newMSA->abc = msa->abc; } #endif for (i = 0; i < msa->nseq; i++) { esl_strdup(msa->sqname[i], -1, &(newMSA->sqname[i])); newMSA->wgt[i] = msa->wgt[i]; } /* alen, nseq were already set by Create() */ newMSA->flags = msa->flags; esl_strdup(msa->name, -1, &(newMSA->name)); esl_strdup(msa->desc, -1, &(newMSA->desc)); esl_strdup(msa->acc, -1, &(newMSA->acc)); esl_strdup(msa->au, -1, &(newMSA->au)); esl_strdup(msa->ss_cons, -1, &(newMSA->ss_cons)); esl_strdup(msa->sa_cons, -1, &(newMSA->sa_cons)); esl_strdup(msa->pp_cons, -1, &(newMSA->pp_cons)); esl_strdup(msa->rf, -1, &(newMSA->rf)); if (msa->sqacc != NULL) { ESL_ALLOC_WITH_TYPE(newMSA->sqacc, char**, sizeof(char **) * msa->nseq); for (i = 0; i < msa->nseq; i++) esl_strdup(msa->sqacc[i], -1, &(newMSA->sqacc[i])); } if (msa->sqdesc != NULL) { ESL_ALLOC_WITH_TYPE(newMSA->sqdesc, char**, sizeof(char **) * msa->nseq); for (i = 0; i < msa->nseq; i++) esl_strdup(msa->sqdesc[i], -1, &(newMSA->sqdesc[i])); } if (msa->ss != NULL) { ESL_ALLOC_WITH_TYPE(newMSA->ss, char**, sizeof(char **) * msa->nseq); for (i = 0; i < msa->nseq; i++) esl_strdup(msa->ss[i], -1, &(newMSA->ss[i])); } if (msa->sa != NULL) { ESL_ALLOC_WITH_TYPE(newMSA->sa, char**, sizeof(char **) * msa->nseq); for (i = 0; i < msa->nseq; i++) esl_strdup(msa->sa[i], -1, &(newMSA->sa[i])); } if (msa->pp != NULL) { ESL_ALLOC_WITH_TYPE(newMSA->pp, char**, sizeof(char **) * msa->nseq); for (i = 0; i < msa->nseq; i++) esl_strdup(msa->pp[i], -1, &(newMSA->pp[i])); } for (x = 0; x < eslMSA_NCUTS; x++) { newMSA->cutoff[x] = msa->cutoff[x]; newMSA->cutset[x] = msa->cutset[x]; } if (msa->ncomment > 0) { ESL_ALLOC_WITH_TYPE(newMSA->comment, char**, sizeof(char **) * msa->ncomment); newMSA->ncomment = msa->ncomment; newMSA->alloc_ncomment = msa->ncomment; for (i = 0; i < msa->ncomment; i++) esl_strdup(msa->comment[i], -1, &(newMSA->comment[i])); } if (msa->ngf > 0) { ESL_ALLOC_WITH_TYPE(newMSA->gf_tag, char**, sizeof(char **) * msa->ngf); ESL_ALLOC_WITH_TYPE(newMSA->gf, char**, sizeof(char **) * msa->ngf); newMSA->ngf = msa->ngf; newMSA->alloc_ngf = msa->ngf; for (i = 0; i < msa->ngf; i++) { esl_strdup(msa->gf_tag[i], -1, &(newMSA->gf_tag[i])); esl_strdup(msa->gf[i], -1, &(newMSA->gf[i])); } } if (msa->ngs > 0) { ESL_ALLOC_WITH_TYPE(newMSA->gs_tag, char**, sizeof(char **) * msa->ngs); ESL_ALLOC_WITH_TYPE(newMSA->gs, char***, sizeof(char ***) * msa->ngs); newMSA->ngs = msa->ngs; for (i = 0; i < msa->ngs; i++) { ESL_ALLOC_WITH_TYPE(newMSA->gs[i], char**, sizeof(char **) * msa->nseq); esl_strdup(msa->gs_tag[i], -1, &(newMSA->gs_tag[i])); for (j = 0; j < msa->nseq; j++) esl_strdup(msa->gs[i][j], -1, &(newMSA->gs[i][j])); } } if (msa->ngc > 0) { ESL_ALLOC_WITH_TYPE(newMSA->gc_tag, char**, sizeof(char **) * msa->ngc); ESL_ALLOC_WITH_TYPE(newMSA->gc, char**, sizeof(char **) * msa->ngc); newMSA->ngc = msa->ngc; for (i = 0; i < msa->ngc; i++) { esl_strdup(msa->gc_tag[i], -1, &(newMSA->gc_tag[i])); esl_strdup(msa->gc[i], -1, &(newMSA->gc[i])); } } if (msa->ngr > 0) { ESL_ALLOC_WITH_TYPE(newMSA->gr_tag, char**, sizeof(char **) * msa->ngr); ESL_ALLOC_WITH_TYPE(newMSA->gr, char***, sizeof(char ***) * msa->ngr); newMSA->ngr = msa->ngr; for (i = 0; i < msa->ngr; i++) { ESL_ALLOC_WITH_TYPE(newMSA->gr[i], char**, sizeof(char **) * msa->nseq); esl_strdup(msa->gr_tag[i], -1, &(newMSA->gr_tag[i])); for (j = 0; j < msa->nseq; j++) esl_strdup(msa->gr[i][j], -1, &(newMSA->gr[i][j])); } } #ifdef eslAUGMENT_KEYHASH esl_keyhash_Destroy(newMSA->index); newMSA->index = NULL; esl_keyhash_Destroy(newMSA->gs_idx); newMSA->gs_idx = NULL; esl_keyhash_Destroy(newMSA->gc_idx); newMSA->gc_idx = NULL; esl_keyhash_Destroy(newMSA->gr_idx); newMSA->gr_idx = NULL; if (msa->index != NULL) newMSA->index = esl_keyhash_Clone(msa->index); if (msa->gs_idx != NULL) newMSA->gs_idx = esl_keyhash_Clone(msa->gs_idx); if (msa->gc_idx != NULL) newMSA->gc_idx = esl_keyhash_Clone(msa->gc_idx); if (msa->gr_idx != NULL) newMSA->gr_idx = esl_keyhash_Clone(msa->gr_idx); #endif #ifdef eslAUGMENT_SSI newMSA->offset = msa->offset; #endif return eslOK; ERROR: return status; } /* Function: esl_msa_Clone() * Synopsis: Duplicates an MSA. * Incept: SRE, Tue Jan 22 15:23:55 2008 [Janelia] * * Purpose: Make a duplicate of <msa>, in newly * allocated space. * * Returns: a pointer to the newly allocated clone. * Caller is responsible for free'ing it. * * Throws: <NULL> on allocation error. */ ESL_MSA * esl_msa_Clone(const ESL_MSA *msa) { ESL_MSA *nw = NULL; int status; #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) { if ((nw = esl_msa_CreateDigital(msa->abc, msa->nseq, msa->alen)) == NULL) return NULL; } else #endif if ((nw = esl_msa_Create(msa->nseq, msa->alen)) == NULL) return NULL; if ((status = esl_msa_Copy(msa, nw) ) != eslOK) goto ERROR; return nw; ERROR: esl_msa_Destroy(nw); return NULL; } /* Function: esl_msa_Destroy() * Synopsis: Frees an <ESL_MSA>. * Incept: SRE, Sun Jan 23 08:26:02 2005 [St. Louis] * * Purpose: Destroys <msa>. * * Xref: squid's MSADestroy(). */ void esl_msa_Destroy(ESL_MSA *msa) { if (msa == NULL) return; if (msa->aseq != NULL) esl_Free2D((void **) msa->aseq, msa->nseq); #ifdef eslAUGMENT_ALPHABET if (msa->ax != NULL) esl_Free2D((void **) msa->ax, msa->nseq); #endif /*eslAUGMENT_ALPHABET*/ esl_Free2D((void **) msa->sqname, msa->nseq); esl_Free2D((void **) msa->sqacc, msa->nseq); esl_Free2D((void **) msa->sqdesc, msa->nseq); esl_Free2D((void **) msa->ss, msa->nseq); esl_Free2D((void **) msa->sa, msa->nseq); esl_Free2D((void **) msa->pp, msa->nseq); if (msa->sqlen != NULL) free(msa->sqlen); if (msa->wgt != NULL) free(msa->wgt); if (msa->name != NULL) free(msa->name); if (msa->desc != NULL) free(msa->desc); if (msa->acc != NULL) free(msa->acc); if (msa->au != NULL) free(msa->au); if (msa->ss_cons != NULL) free(msa->ss_cons); if (msa->sa_cons != NULL) free(msa->sa_cons); if (msa->pp_cons != NULL) free(msa->pp_cons); if (msa->rf != NULL) free(msa->rf); if (msa->sslen != NULL) free(msa->sslen); if (msa->salen != NULL) free(msa->salen); if (msa->pplen != NULL) free(msa->pplen); esl_Free2D((void **) msa->comment, msa->ncomment); esl_Free2D((void **) msa->gf_tag, msa->ngf); esl_Free2D((void **) msa->gf, msa->ngf); esl_Free2D((void **) msa->gs_tag, msa->ngs); esl_Free3D((void ***)msa->gs, msa->ngs, msa->nseq); esl_Free2D((void **) msa->gc_tag, msa->ngc); esl_Free2D((void **) msa->gc, msa->ngc); esl_Free2D((void **) msa->gr_tag, msa->ngr); esl_Free3D((void ***)msa->gr, msa->ngr, msa->nseq); #ifdef eslAUGMENT_KEYHASH esl_keyhash_Destroy(msa->index); esl_keyhash_Destroy(msa->gs_idx); esl_keyhash_Destroy(msa->gc_idx); esl_keyhash_Destroy(msa->gr_idx); #endif /* keyhash augmentation */ free(msa); return; } /* Function: esl_msa_SetName() * Synopsis: Set name of an MSA. * Incept: SRE, Sat Feb 23 18:42:47 2008 [Casa de Gatos] * * Purpose: Sets the name of the msa <msa> to <name>. * * <name> can be <NULL>, because the MSA name is an * optional field; in which case any existing name in * the <msa> is erased. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetName(ESL_MSA *msa, const char *name) { int status; if (msa->name != NULL) free(msa->name); status = esl_strdup(name, -1, &(msa->name)); return status; } /* Function: esl_msa_SetDesc() * Synopsis: Set the description line of an MSA. * Incept: SRE, Sat Feb 23 18:47:06 2008 [Casa de Gatos] * * Purpose: Sets the description line of the msa <msa> to <desc>. * * As a special case, <desc> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetDesc(ESL_MSA *msa, const char *desc) { int status; if (msa->desc != NULL) free(msa->desc); status = esl_strdup(desc, -1, &(msa->desc)); return status; } /* Function: esl_msa_SetAccession() * Synopsis: Set the accession number of an MSA. * Incept: SRE, Sat Feb 23 18:49:04 2008 [Casa de Gatos] * * Purpose: Sets accession number of the msa <msa> to <acc>. * * As a special case, <acc> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetAccession(ESL_MSA *msa, const char *acc) { int status; if (msa->acc != NULL) free(msa->acc); status = esl_strdup(acc, -1, &(msa->acc)); return status; } /* Function: esl_msa_SetAuthor() * Synopsis: Set the author string in an MSA. * Incept: SRE, Wed Mar 4 10:41:21 2009 [Janelia] * * Purpose: Sets the author string in <msa> to <author>. * * As a special case, <author> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetAuthor(ESL_MSA *msa, const char *author) { int status; if (msa->au != NULL) free(msa->au); status = esl_strdup(author, -1, &(msa->au)); return status; } /* Function: esl_msa_SetSeqName() * Synopsis: Set an individual sequence name in an MSA. * Incept: SRE, Wed Mar 4 10:56:28 2009 [Janelia] * * Purpose: Set the name of sequence number <idx> in <msa> * to <name>. * * Returns: <eslOK> on success. * * Throws: <eslEINVAL> if <name> is <NULL>; * <eslEMEM> on allocation error. * * Note: msa->sqname[] is not optional, so we may * rely on it already being allocated for * i=0..sqalloc-1. */ int esl_msa_SetSeqName(ESL_MSA *msa, int idx, const char *name) { int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (name == NULL) ESL_EXCEPTION(eslEINVAL, "seq names are mandatory; NULL is not a valid name"); if (msa->sqname[idx] != NULL) free(msa->sqname[idx]); status = esl_strdup(name, -1, &(msa->sqname[idx])); return status; } /* Function: esl_msa_SetSeqAccession() * Synopsis: Sets individual sequence accession in an MSA. * Incept: SRE, Wed Mar 4 11:03:26 2009 [Janelia] * * Purpose: Set the accession of sequence number <idx> in <msa> to * <acc>. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetSeqAccession(ESL_MSA *msa, int idx, const char *acc) { int i; int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (acc == NULL) { if (msa->sqacc != NULL) { free(msa->sqacc[idx]); msa->sqacc[idx] = NULL; } return eslOK; } /* Allocate/initialize the optional sqacc array, if it's not already done: */ if (msa->sqacc == NULL) { ESL_ALLOC_WITH_TYPE(msa->sqacc, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->sqacc[i] = NULL; } if (msa->sqacc[idx] != NULL) free(msa->sqacc[idx]); status = esl_strdup(acc, -1, &(msa->sqacc[idx])); return status; ERROR: return status; } /* Function: esl_msa_SetSeqDescription() * Synopsis: Sets individual sequence description in an MSA. * Incept: SRE, Wed Mar 4 11:09:37 2009 [Janelia] * * Purpose: Set the description of sequence number <idx> in <msa> to * <desc>. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error. */ int esl_msa_SetSeqDescription(ESL_MSA *msa, int idx, const char *desc) { int i; int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (desc == NULL) { if (msa->sqdesc != NULL) { free(msa->sqdesc[idx]); msa->sqdesc[idx] = NULL; } return eslOK; } /* Allocate/initialize the optional sqdesc array, if it's not already done: */ if (msa->sqdesc == NULL) { ESL_ALLOC_WITH_TYPE(msa->sqdesc, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->sqdesc[i] = NULL; } if (msa->sqdesc[idx] != NULL) free(msa->sqdesc[idx]); status = esl_strdup(desc, -1, &(msa->sqdesc[idx])); return status; ERROR: return status; } /* Function: esl_msa_FormatName() * Synopsis: Format name of an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:33:34 2009 [Janelia] * * Purpose: Sets the name of the msa <msa> using <name>, where * <name> is a <printf()>-style format with * arguments; for example, <esl_msa_FormatName(msa, "random%d", i)>. * * <name> can be <NULL>, because the MSA name is an * optional field; in which case any existing name in * the <msa> is erased. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatName(ESL_MSA *msa, const char *name, ...) { va_list ap; int status; if (msa->name != NULL) free(msa->name); if (name == NULL) { msa->name = NULL; return eslOK; } va_start(ap, name); status = esl_vsprintf(&(msa->name), name, &ap); va_end(ap); return status; } /* Function: esl_msa_FormatDesc() * Synopsis: Format the description line of an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:34:25 2009 [Janelia] * * Purpose: Format the description line of the msa <msa> using <desc>. * where <desc> is a <printf()>-style format with * arguments. * For example, <esl_msa_FormatDesc(msa, "sample %d", i)>. * * As a special case, <desc> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatDesc(ESL_MSA *msa, const char *desc, ...) { va_list ap; int status; if (msa->desc != NULL) free(msa->desc); va_start(ap, desc); status = esl_vsprintf(&(msa->desc), desc, &ap); va_end(ap); return status; } /* Function: esl_msa_FormatAccession() * Synopsis: Format the accession number of an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:35:24 2009 [Janelia]. * * Purpose: Sets accession number of the msa <msa> using <acc>, * where <acc> is a <printf()>-style format with arguments. * For example, <esl_msa_FormatAccession(msa, "PF%06d", i)>. * * As a special case, <acc> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatAccession(ESL_MSA *msa, const char *acc, ...) { va_list ap; int status; if (msa->acc != NULL) free(msa->acc); va_start(ap, acc); status = esl_vsprintf(&(msa->acc), acc, &ap); va_end(ap); return status; } /* Function: esl_msa_FormatAuthor() * Synopsis: Format the author string in an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:36:05 2009 [Janelia] * * Purpose: Sets the author string in <msa>, using an <author> string * and arguments in same format as <printf()> would take. * * As a special case, <author> may be <NULL>, to facilitate * handling of optional annotation. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatAuthor(ESL_MSA *msa, const char *author, ...) { va_list ap; int status; if (msa->au != NULL) free(msa->au); va_start(ap, author); status = esl_vsprintf(&(msa->au), author, &ap); va_end(ap); return status; } /* Function: esl_msa_FormatSeqName() * Synopsis: Formats an individual sequence name in an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:36:35 2009 [Janelia] * * Purpose: Set the name of sequence number <idx> in <msa> * to <name>, where <name> is a <printf()> * style format and arguments. * * Returns: <eslOK> on success. * * Throws: <eslEINVAL> if <name> is <NULL>; * <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. * * Note: msa->sqname[] is not optional, so we may * rely on it already being allocated for * i=0..sqalloc-1. */ int esl_msa_FormatSeqName(ESL_MSA *msa, int idx, const char *name, ...) { va_list ap; int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (name == NULL) ESL_EXCEPTION(eslEINVAL, "seq names are mandatory; NULL is not a valid name"); if (msa->sqname[idx] != NULL) free(msa->sqname[idx]); va_start(ap, name); status = esl_vsprintf(&(msa->sqname[idx]), name, &ap); va_end(ap); return status; } /* Function: esl_msa_FormatSeqAccession() * Synopsis: Format individual sequence accession in an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:37:08 2009 [Janelia] * * Purpose: Set the accession of sequence number <idx> in <msa> to * <acc>, where <acc> is a <printf()> style format and * arguments. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatSeqAccession(ESL_MSA *msa, int idx, const char *acc, ...) { va_list ap; int i; int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (acc == NULL) { if (msa->sqacc != NULL) { free(msa->sqacc[idx]); msa->sqacc[idx] = NULL; } return eslOK; } /* Allocate/initialize the optional sqacc array, if it's not already done: */ if (msa->sqacc == NULL) { ESL_ALLOC_WITH_TYPE(msa->sqacc, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->sqacc[i] = NULL; } if (msa->sqacc[idx] != NULL) free(msa->sqacc[idx]); va_start(ap, acc); status = esl_vsprintf(&(msa->sqacc[idx]), acc, &ap); va_end(ap); return status; ERROR: return status; } /* Function: esl_msa_FormatSeqDescription() * Synopsis: Formats individual sequence description in an MSA, printf()-style. * Incept: SRE, Fri Sep 11 11:37:35 2009 [Janelia] * * Purpose: Set the description of sequence number <idx> in <msa> to * <desc>, where <desc> may be a <printf()> style format and * arguments. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation error; * <eslESYS> if a <*printf()> library call fails. */ int esl_msa_FormatSeqDescription(ESL_MSA *msa, int idx, const char *desc, ...) { va_list ap; int i; int status; if (idx >= msa->sqalloc) ESL_EXCEPTION(eslEINVAL, "no such sequence %d (only %d allocated)", idx, msa->sqalloc); if (desc == NULL) { if (msa->sqdesc != NULL) { free(msa->sqdesc[idx]); msa->sqdesc[idx] = NULL; } return eslOK; } /* Allocate/initialize the optional sqdesc array, if it's not already done: */ if (msa->sqdesc == NULL) { ESL_ALLOC_WITH_TYPE(msa->sqdesc, char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->sqdesc[i] = NULL; } if (msa->sqdesc[idx] != NULL) free(msa->sqdesc[idx]); va_start(ap, desc); status = esl_vsprintf(&(msa->sqdesc[idx]), desc, &ap); va_end(ap); return status; ERROR: return status; } /*---------------------- end of ESL_MSA functions ---------------------------*/ /****************************************************************************** *# 3. Digital mode MSA's (augmentation: alphabet) *****************************************************************************/ #ifdef eslAUGMENT_ALPHABET /* Function: esl_msa_GuessAlphabet() * Synopsis: Guess alphabet of MSA. * Incept: SRE, Fri May 18 09:55:08 2007 [Janelia] * * Purpose: Guess whether the sequences in the <msa> are * <eslDNA>, <eslRNA>, or <eslAMINO>, and return * that guess in <*ret_type>. * * The determination is made based on the classifications * of the individual sequences in the alignment. At least * one sequence must contain ten residues or more to be * classified. If one or more sequences is called * <eslAMINO> and one or more is called <eslDNA>/<eslRNA>, * the alignment's alphabet is considered to be * indeterminate (<eslUNKNOWN>). If some sequences are * <eslDNA> and some are <eslRNA>, the alignment is called * <eslDNA>; this should cause no problems, because Easel * reads U as a synonym for T in DNA sequence anyway. * * Tested on Pfam 21.0 and Rfam 7.0, this routine correctly * classified all 8957 Pfam alignments as protein, and 503 * Rfam alignments as RNA (both seed and full alignments). * * Returns: <eslOK> on success, and <*ret_type> is set * to <eslDNA>, <eslRNA>, or <eslAMINO>. * * Returns <eslEAMBIGUOUS> and sets <*ret_type> to * <eslUNKNOWN> if the alphabet cannot be reliably guessed. * * Xref: J1/62 */ int esl_msa_GuessAlphabet(const ESL_MSA *msa, int *ret_type) { int64_t namino = 0, ndna = 0, nrna = 0, nunknown = 0; int type; int i,x; int64_t j,n; int64_t ct[26]; if (msa->flags & eslMSA_DIGITAL) { *ret_type = msa->abc->type; return eslOK; } *ret_type = eslUNKNOWN; /* On wide alignments, we're better off looking at individual sequence * classifications. We don't want to end up calling the whole alignment * indeterminate just because a few sequences have degenerate residue * codes. */ for (i = 0; i < msa->nseq; i++) { for (x = 0; x < 26; x++) ct[x] = 0; for (n = 0, j = 0; j < msa->alen; j++) { x = toupper(msa->aseq[i][j]) - 'A'; if (x < 0 || x > 26) continue; ct[x]++; n++; if (n > 10000) break; /* ought to know by now */ } esl_abc_GuessAlphabet(ct, &type); switch (type) { case eslAMINO: namino++; break; case eslDNA: ndna++; break; case eslRNA: nrna++; break; default: nunknown++; } } if (namino > 0 && (ndna+nrna) == 0) *ret_type = eslAMINO; else if (ndna > 0 && (nrna+namino) == 0) *ret_type = eslDNA; else if (nrna > 0 && (ndna+namino) == 0) *ret_type = eslRNA; else if (ndna+nrna > 0 && namino == 0) *ret_type = eslDNA; /* On narrow alignments, no single sequence may be long enough to * be classified, but we can determine alphabet from composition * of the complete alignment. Of course, degenerate residue codes in * a DNA alignment will still screw us. */ if (*ret_type == eslUNKNOWN) { n = 0; for (x = 0; x < 26; x++) ct[x] = 0; for (i = 0; i < msa->nseq; i++) { for (j = 0; j < msa->alen; j++) { x = toupper(msa->aseq[i][j]) - 'A'; if (x < 0 || x > 26) continue; ct[x]++; n++; if (n > 10000) break; /* ought to know by now */ } if (n > 10000) break; } esl_abc_GuessAlphabet(ct, ret_type); } if (*ret_type == eslUNKNOWN) return eslEAMBIGUOUS; else return eslOK; } /* Function: esl_msa_CreateDigital() * Synopsis: Create a digital <ESL_MSA>. * Incept: SRE, Sun Aug 27 16:49:58 2006 [Leesburg] * * Purpose: Same as <esl_msa_Create()>, except the returned MSA is configured * for a digital alignment using internal alphabet <abc>, instead of * a text alignment. * * Internally, this means the <ax> field is allocated instead of * the <aseq> field, and the <eslMSA_DIGITAL> flag is raised. * * Args: <nseq> - number of sequences, or nseq allocation blocksize * <alen> - length of alignment in columns, or -1 * * Returns: pointer to new MSA object, w/ all values initialized. * Note that <msa->nseq> is initialized to 0, even though space * is allocated. * * Throws: NULL on allocation failure. * * Xref: squid's MSAAlloc() */ ESL_MSA * esl_msa_CreateDigital(const ESL_ALPHABET *abc, int nseq, int64_t alen) { int status; ESL_MSA *msa; int i; msa = create_mostly(nseq, alen); /* aseq is null upon successful return */ if (msa == NULL) return NULL; /* already threw error in mostly_create, so percolate */ ESL_ALLOC_WITH_TYPE(msa->ax, ESL_DSQ**, sizeof(ESL_DSQ *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->ax[i] = NULL; if (alen != -1) { for (i = 0; i < nseq; i++) { ESL_ALLOC_WITH_TYPE(msa->ax[i], ESL_DSQ*, sizeof(ESL_DSQ) * (alen+2)); msa->ax[i][0] = msa->ax[i][alen+1] = eslDSQ_SENTINEL; /* help the poor */ } msa->nseq = nseq; } msa->abc = (ESL_ALPHABET *) abc; /* this cast away from const-ness is deliberate & safe. */ msa->flags |= eslMSA_DIGITAL; return msa; ERROR: esl_msa_Destroy(msa); return NULL; } /* Function: esl_msa_Digitize() * Synopsis: Digitizes an msa, converting it from text mode. * Incept: SRE, Sat Aug 26 17:33:08 2006 [AA 5302 to Dulles] * * Purpose: Given an alignment <msa> in text mode, convert it to * digital mode, using alphabet <abc>. * * Internally, the <ax> digital alignment field is filled, * the <aseq> text alignment field is destroyed and free'd, * a copy of the alphabet pointer is kept in the msa's * <abc> reference, and the <eslMSA_DIGITAL> flag is raised * in <flags>. * * Because <esl_msa_Digitize()> may be called on * unvalidated user data, <errbuf> may be passed, for * capturing an informative error message. For example, in * reading alignments from files, invalid characters in the * alignment are caught at the digitization step. * * Args: abc - digital alphabet * msa - multiple alignment to digitize * errbuf - optional: error message buffer, or <NULL> * * Returns: <eslOK> on success; * <eslEINVAL> if one or more sequences contain invalid characters * that can't be digitized. If this happens, the <msa> is returned * unaltered - left in text mode, with <aseq> as it was. (This is * a normal error, because <msa->aseq> may be user input that we * haven't validated yet.) * * Throws: <eslEMEM> on allocation failure; in this case, state of <msa> may be * wedged, and it should only be destroyed, not used. */ int esl_msa_Digitize(const ESL_ALPHABET *abc, ESL_MSA *msa, char *errbuf) { char errbuf2[eslERRBUFSIZE]; int i; int status; /* Contract checks */ if (msa->aseq == NULL) ESL_EXCEPTION(eslEINVAL, "msa has no text alignment"); if (msa->ax != NULL) ESL_EXCEPTION(eslEINVAL, "msa already has digital alignment"); if (msa->flags & eslMSA_DIGITAL) ESL_EXCEPTION(eslEINVAL, "msa is flagged as digital"); /* Validate before we convert. Then we can leave the <aseq> untouched if * any of the sequences contain invalid characters. */ for (i = 0; i < msa->nseq; i++) if (esl_abc_ValidateSeq(abc, msa->aseq[i], msa->alen, errbuf2) != eslOK) ESL_FAIL(eslEINVAL, errbuf, "%s: %s", msa->sqname[i], errbuf2); /* Convert, sequence-by-sequence, free'ing aseq as we go. */ ESL_ALLOC_WITH_TYPE(msa->ax, ESL_DSQ**, msa->sqalloc * sizeof(ESL_DSQ *)); for (i = 0; i < msa->nseq; i++) { ESL_ALLOC_WITH_TYPE(msa->ax[i], ESL_DSQ*, (msa->alen+2) * sizeof(ESL_DSQ)); status = esl_abc_Digitize(abc, msa->aseq[i], msa->ax[i]); if (status != eslOK) goto ERROR; free(msa->aseq[i]); } for (; i < msa->sqalloc; i++) msa->ax[i] = NULL; free(msa->aseq); msa->aseq = NULL; msa->abc = (ESL_ALPHABET *) abc; /* convince compiler that removing const-ness is safe */ msa->flags |= eslMSA_DIGITAL; return eslOK; ERROR: return status; } /* Function: esl_msa_Textize() * Synopsis: Convert a digital msa to text mode. * Incept: SRE, Sat Aug 26 18:14:30 2006 [AA 5302 to Dulles] * * Purpose: Given an alignment <msa> in digital mode, convert it * to text mode. * * Internally, the <aseq> text alignment field is filled, the * <ax> digital alignment field is destroyed and free'd, the * msa's <abc> digital alphabet reference is nullified, and * the <eslMSA_DIGITAL> flag is dropped in <flags>. * * Args: msa - multiple alignment to convert to text * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. * <eslECORRUPT> if one or more of the digitized alignment strings * contain invalid characters. */ int esl_msa_Textize(ESL_MSA *msa) { int status; int i; /* Contract checks */ if (msa->ax == NULL) ESL_EXCEPTION(eslEINVAL, "msa has no digital alignment"); if (msa->aseq != NULL) ESL_EXCEPTION(eslEINVAL, "msa already has text alignment"); if (! (msa->flags & eslMSA_DIGITAL)) ESL_EXCEPTION(eslEINVAL, "msa is not flagged as digital"); if (msa->abc == NULL) ESL_EXCEPTION(eslEINVAL, "msa has no digital alphabet"); /* Convert, sequence-by-sequence, free'ing ax as we go. */ ESL_ALLOC_WITH_TYPE(msa->aseq, char**, msa->sqalloc * sizeof(char *)); for (i = 0; i < msa->nseq; i++) { ESL_ALLOC_WITH_TYPE(msa->aseq[i], char*, (msa->alen+1) * sizeof(char)); status = esl_abc_Textize(msa->abc, msa->ax[i], msa->alen, msa->aseq[i]); if (status != eslOK) goto ERROR; free(msa->ax[i]); } for (; i < msa->sqalloc; i++) msa->aseq[i] = NULL; free(msa->ax); msa->ax = NULL; msa->abc = NULL; /* nullify reference (caller still owns real abc) */ msa->flags &= ~eslMSA_DIGITAL; /* drop the flag */ return eslOK; ERROR: return status; } #endif /*---------------------- end of digital MSA functions -----------------------*/ /****************************************************************************** *# 4. Random MSA database access (augmentation: ssi) *****************************************************************************/ #ifdef eslAUGMENT_SSI /* Function: esl_msafile_PositionByKey() * Synopsis: Use SSI to reposition file to start of named MSA. * Incept: SRE, Mon May 28 11:04:59 2007 [Janelia] * * Purpose: Reposition <afp> so that the next MSA we read * will be the one named (or accessioned) <key>. * * Returns: <eslOK> on success, and the file <afp> is repositioned * such that the next <esl_msafile_Read()> call will read the * alignment named <key>. * * Returns <eslENOTFOUND> if <key> isn't found in the index * for <afp>. * * Returns <eslEFORMAT> if something goes wrong trying to * read the index, indicating some sort of file format * problem in the SSI file. * * Throws: <eslEMEM> on allocation failure; * <eslEINVAL> if there's no open SSI index; * <eslESYS> if an <fseek()> fails. * In all these cases, the state of the <afp> is uncertain * and may be corrupt; the application should not continue * to use it. */ int esl_msafile_PositionByKey(ESL_MSAFILE *afp, const char *key) { uint16_t fh; off_t offset; int status; if (afp->ssi == NULL) ESL_EXCEPTION(eslEINVAL, "Need an open SSI index to call esl_msafile_PositionByKey()"); if ((status = esl_ssi_FindName(afp->ssi, key, &fh, &offset, NULL, NULL)) != eslOK) return status; if (fseeko(afp->f, offset, SEEK_SET) != 0) ESL_EXCEPTION(eslESYS, "fseek failed"); /* If the <afp> had an MSA cached, we will probably have to discard * it, unless by chance it's exactly the MSA we're looking for. */ if (afp->msa_cache != NULL) { if ( (afp->msa_cache->name == NULL || strcmp(afp->msa_cache->name, key) != 0) && (afp->msa_cache->acc == NULL || strcmp(afp->msa_cache->acc, key) != 0)) { esl_msa_Destroy(afp->msa_cache); afp->msa_cache = NULL; } } /* The linenumber gets messed up after a file positioning. Best we can do * is to reset it to zero. */ afp->linenumber = 0; return eslOK; } #endif /*eslAUGMENT_SSI*/ /*------------- end of functions added by SSI augmentation -------------------*/ /***************************************************************** *# 6. Miscellaneous functions for manipulating MSAs *****************************************************************/ /* Function: esl_msa_ReasonableRF() * Synopsis: Determine a reasonable #=RF line marking "consensus" columns. * Incept: SRE, Wed Sep 3 10:42:05 2008 [Janelia] * * Purpose: Define an <rfline> for the multiple alignment <msa> that * marks consensus columns with an 'x', and non-consensus * columns with a '.'. * * Consensus columns are defined as columns with fractional * occupancy of $\geq$ <symfrac> in residues. For example, * if <symfrac> is 0.7, columns containing $\geq$ 70\% * residues are assigned as 'x' in the <rfline>, roughly * speaking. "Roughly speaking", because the fractional * occupancy is in fact calculated as a weighted frequency * using sequence weights in <msa->wgt>, and because * missing data symbols are ignored in order to be able to * deal with sequence fragments. * * The greater <symfrac> is, the more stringent the * definition, and the fewer columns will be defined as * consensus. <symfrac=0> will define all columns as * consensus. <symfrac=1> will only define a column as * consensus if it contains no gap characters at all. * * If the caller wants to designate any sequences as * fragments, it must convert all leading and trailing gaps * to the missing data symbol '~'. * * For text mode alignments, any alphanumeric character is * considered to be a residue, and any non-alphanumeric * character is considered to be a gap. * * The <rfline> is a NUL-terminated string, indexed * <0..alen-1>. * * The <rfline> result can be <msa->rf>, if the caller * wants to set the <msa's> own RF line; or it can be any * alternative storage provided by the caller. In either * case, the caller must provide allocated space for at * least <msa->alen+1> chars. * * Args: msa - MSA to define a consensus RF line for * symfrac - threshold for defining consensus columns * rfline - RESULT: string containing x for consensus, . for not * * Returns: <eslOK> on success. * * Xref: HMMER p7_Fastmodelmaker() uses an essentially identical * calculation to define model architecture, and could be * rewritten now to use this function. * * A2M format alignment output uses this to define * consensus columns when #=RF annotation isn't available. */ int esl_msa_ReasonableRF(ESL_MSA *msa, double symfrac, char *rfline) { int apos; int idx; double r; double totwgt; #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) { for (apos = 1; apos <= msa->alen; apos++) { r = totwgt = 0.; for (idx = 0; idx < msa->nseq; idx++) { if (esl_abc_XIsResidue(msa->abc, msa->ax[idx][apos])) { r += msa->wgt[idx]; totwgt += msa->wgt[idx]; } else if (esl_abc_XIsGap(msa->abc, msa->ax[idx][apos])) { totwgt += msa->wgt[idx]; } else if (esl_abc_XIsMissing(msa->abc, msa->ax[idx][apos])) continue; } if (r > 0. && r / totwgt >= symfrac) msa->rf[apos-1] = 'x'; else msa->rf[apos-1] = '.'; } } #endif if (! (msa->flags & eslMSA_DIGITAL)) { for (apos = 0; apos < msa->alen; apos++) { r = totwgt = 0.; for (idx = 0; idx < msa->nseq; idx++) { if (isalpha(msa->aseq[idx][apos])) { r += msa->wgt[idx]; totwgt += msa->wgt[idx]; } else totwgt += msa->wgt[idx]; } if (r > 0. && r / totwgt >= symfrac) msa->rf[apos] = 'x'; else msa->rf[apos] = '.'; } } msa->rf[msa->alen] = '\0'; return eslOK; } /* Function: esl_msa_MarkFragments() * Synopsis: Heuristically define seq fragments in an alignment. * Incept: SRE, Wed Sep 3 11:49:25 2008 [Janelia] * * Purpose: Use a heuristic to define sequence fragments (as opposed * to "full length" sequences in alignment <msa>. * * The rule is that if the sequence has a raw (unaligned) * length of less than <fragthresh> times the alignment * length in columns, the sequence is defined as a fragment. * * For each fragment, all leading and trailing gap symbols * (all gaps before the first residue and after the last * residue) are converted to missing data symbols * (typically '~', but nonstandard digital alphabets may * have defined another character). * * As a special case, if <fragthresh> is negative, then all * sequences are defined as fragments. * * Args: msa - alignment in which to define and mark seq fragments * fragthresh - define frags if rlen < fragthresh * alen; * or if fragthresh < 0, all seqs are marked as frags. * * Returns: <eslOK> on success. * * Throws: (no abnormal error conditions) */ int esl_msa_MarkFragments(ESL_MSA *msa, double fragthresh) { int i; int pos; for (i = 0; i < msa->nseq; i++) if (fragthresh < 0.0 || msa_get_rlen(msa, i) < fragthresh * msa->alen) { #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) { for (pos = 1; pos <= msa->alen; pos++) { if (esl_abc_XIsResidue(msa->abc, msa->ax[i][pos])) break; msa->ax[i][pos] = esl_abc_XGetMissing(msa->abc); } for (pos = msa->alen; pos >= 1; pos--) { if (esl_abc_XIsResidue(msa->abc, msa->ax[i][pos])) break; msa->ax[i][pos] = esl_abc_XGetMissing(msa->abc); } } #endif if (! (msa->flags & eslMSA_DIGITAL)) { for (pos = 0; pos < msa->alen; pos++) { if (isalnum(msa->aseq[i][pos])) break; msa->aseq[i][pos] = '~'; } for (pos = msa->alen-1; pos >= 0; pos--) { if (isalnum(msa->aseq[i][pos])) break; msa->aseq[i][pos] = '~'; } } } return eslOK; } /* Function: esl_msa_SequenceSubset() * Synopsis: Select subset of sequences into a smaller MSA. * Incept: SRE, Wed Apr 13 10:05:44 2005 [St. Louis] * * Purpose: Given an array <useme> (0..nseq-1) of TRUE/FALSE flags for each * sequence in an alignment <msa>; create a new alignment containing * only those seqs which are flagged <useme=TRUE>. Return a pointer * to this newly allocated alignment through <ret_new>. Caller is * responsible for freeing it. * * The smaller alignment might now contain columns * consisting entirely of gaps or missing data, depending * on what sequence subset was extracted. The caller may * want to immediately call <esl_msa_MinimGaps()> on the * new alignment to clean this up. * * Unparsed GS and GR Stockholm annotation that is presumably still * valid is transferred to the new alignment. Unparsed GC, GF, and * comments that are potentially invalidated by taking the subset * of sequences are not transferred to the new MSA. * * Weights are transferred exactly. If they need to be * renormalized to some new total weight (such as the new, * smaller total sequence number), the caller must do that. * * <msa> may be in text mode or digital mode. The new MSA * in <ret_new> will have the same mode. * * Returns: <eslOK> on success, and <ret_new> is set to point at a new * (smaller) alignment. * * Throws: <eslEINVAL> if the subset has no sequences in it; * <eslEMEM> on allocation error. * * Xref: squid's MSASmallerAlignment(), 1999. */ int esl_msa_SequenceSubset(const ESL_MSA *msa, const int *useme, ESL_MSA **ret_new) { ESL_MSA *newMSA = NULL; int nnew; /* number of seqs in the new MSA */ int oidx, nidx; /* old, new indices */ int i; int status; *ret_new = NULL; nnew = 0; for (oidx = 0; oidx < msa->nseq; oidx++) if (useme[oidx]) nnew++; if (nnew == 0) ESL_EXCEPTION(eslEINVAL, "No sequences selected"); /* Note that the Create() calls allocate exact space for the sequences, * so we will strcpy()/memcpy() into them below. */ #ifdef eslAUGMENT_ALPHABET if ((msa->flags & eslMSA_DIGITAL) && (newMSA = esl_msa_CreateDigital(msa->abc, nnew, msa->alen)) == NULL) {status = eslEMEM; goto ERROR; } #endif if (! (msa->flags & eslMSA_DIGITAL) && (newMSA = esl_msa_Create(nnew, msa->alen)) == NULL) {status = eslEMEM; goto ERROR; } if (newMSA == NULL) {status = eslEMEM; goto ERROR; } /* Copy the old to the new */ for (nidx = 0, oidx = 0; oidx < msa->nseq; oidx++) if (useme[oidx]) { #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) memcpy(newMSA->ax[nidx], msa->ax[oidx], sizeof(ESL_DSQ) * (msa->alen+2)); #endif if (! (msa->flags & eslMSA_DIGITAL)) strcpy(newMSA->aseq[nidx], msa->aseq[oidx]); if ((status = esl_strdup(msa->sqname[oidx], -1, &(newMSA->sqname[nidx]))) != eslOK) goto ERROR; newMSA->wgt[nidx] = msa->wgt[oidx]; if (msa->sqacc != NULL && msa->sqacc[oidx] != NULL) { if ((status = esl_msa_SetSeqAccession(newMSA, nidx, msa->sqacc[oidx])) != eslOK) goto ERROR; } if (msa->sqdesc != NULL && msa->sqdesc[oidx] != NULL) { if ((status = esl_msa_SetSeqDescription(newMSA, nidx, msa->sqdesc[oidx])) != eslOK) goto ERROR; } if (msa->ss != NULL && msa->ss[oidx] != NULL) { if ((status = set_seq_ss(newMSA, nidx, msa->ss[oidx])) != eslOK) goto ERROR; } if (msa->sa != NULL && msa->sa[oidx] != NULL) { if ((status = set_seq_sa(newMSA, nidx, msa->sa[oidx])) != eslOK) goto ERROR; } if (msa->pp != NULL && msa->pp[oidx] != NULL) { if ((status = set_seq_pp(newMSA, nidx, msa->pp[oidx])) != eslOK) goto ERROR; } /* unparsed annotation */ for(i = 0; i < msa->ngs; i++) { if(msa->gs[i] != NULL) if ((status = esl_msa_AddGS(newMSA, msa->gs_tag[i], nidx, msa->gs[i][oidx])) != eslOK) goto ERROR; } for(i = 0; i < msa->ngr; i++) { if(msa->gr[i] != NULL) if ((status = esl_msa_AppendGR(newMSA, msa->gr_tag[i], nidx, msa->gr[i][oidx])) != eslOK) goto ERROR; } nidx++; } newMSA->flags = msa->flags; if ((status = esl_strdup(msa->name, -1, &(newMSA->name))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->desc, -1, &(newMSA->desc))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->acc, -1, &(newMSA->acc))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->au, -1, &(newMSA->au))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->ss_cons, msa->alen, &(newMSA->ss_cons))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->sa_cons, msa->alen, &(newMSA->sa_cons))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->pp_cons, msa->alen, &(newMSA->pp_cons))) != eslOK) goto ERROR; if ((status = esl_strdup(msa->rf, msa->alen, &(newMSA->rf))) != eslOK) goto ERROR; for (i = 0; i < eslMSA_NCUTS; i++) { newMSA->cutoff[i] = msa->cutoff[i]; newMSA->cutset[i] = msa->cutset[i]; } newMSA->nseq = nnew; newMSA->sqalloc = nnew; /* Since we have a fully constructed MSA, we don't need the * aux info used by parsers. */ if (newMSA->sqlen != NULL) { free(newMSA->sqlen); newMSA->sqlen = NULL; } if (newMSA->sslen != NULL) { free(newMSA->sslen); newMSA->sslen = NULL; } if (newMSA->salen != NULL) { free(newMSA->salen); newMSA->salen = NULL; } if (newMSA->pplen != NULL) { free(newMSA->pplen); newMSA->pplen = NULL; } newMSA->lastidx = -1; *ret_new = newMSA; return eslOK; ERROR: if (newMSA != NULL) esl_msa_Destroy(newMSA); *ret_new = NULL; return status; } /* remove_broken_basepairs_from_ss_string() * * Given an array <useme> (0..alen-1) of TRUE/FALSE flags, remove * any basepair from an SS string that is between alignment * columns (i,j) for which either <useme[i-1]> or <useme[j-1]> is FALSE. * Helper function for remove_broken_basepairs_from_msa(). * * The input SS string will be overwritten. If it was not in * full WUSS format when pass in, it will be upon exit. * Note that that means if there's residues in the input ss * that correspond to gaps in an aligned sequence or RF * annotation, they will not be treated as gaps in the * returned SS. For example, a gap may become a '-' character, * a '_' character, or a ':' character. I'm not sure how * to deal with this in a better way. We could demand an * aligned sequence to use to de-gap the SS string, but * that would require disallowing any gap to be involved * in a basepair, which I'm not sure is something we want * to forbid. * * If the original SS is inconsistent it's left untouched and * non-eslOK is returned as listed below. * * Returns: <eslOK> on success. * <eslESYNTAX> if SS string * following esl_wuss_nopseudo() is inconsistent. * <eslEINVAL> if a derived ct array implies a pknotted * SS, this should be impossible. */ static int remove_broken_basepairs_from_ss_string(char *ss, char *errbuf, int len, const int *useme) { int64_t apos; /* alignment position */ int *ct = NULL; /* 0..alen-1 base pair partners array for current sequence */ char *ss_nopseudo = NULL; /* no-pseudoknot version of structure */ int status; ESL_ALLOC_WITH_TYPE(ct, int*, sizeof(int) * (len+1)); ESL_ALLOC_WITH_TYPE(ss_nopseudo, char*, sizeof(char) * (len+1)); esl_wuss_nopseudo(ss, ss_nopseudo); if ((status = esl_wuss2ct(ss_nopseudo, len, ct)) != eslOK) ESL_FAIL(status, errbuf, "Consensus structure string is inconsistent."); for (apos = 1; apos <= len; apos++) { if (!(useme[apos-1])) { if (ct[apos] != 0) ct[ct[apos]] = 0; ct[apos] = 0; } } /* All broken bps removed from ct, convert to WUSS SS string and overwrite SS */ if ((status = esl_ct2wuss(ct, len, ss)) != eslOK) ESL_FAIL(status, errbuf, "Error converting de-knotted bp ct array to WUSS notation."); free(ss_nopseudo); free(ct); return eslOK; ERROR: if (ct != NULL) free(ct); if (ss_nopseudo != NULL) free(ss_nopseudo); return status; } /* remove_broken_basepairs_from_msa() * * Given an array <useme> (0..alen-1) of TRUE/FALSE flags, remove * any basepair from SS_cons and individual SS annotation in alignment * columns (i,j) for which either <useme[i-1]> or <useme[j-1]> is FALSE. * Called automatically from esl_msa_ColumnSubset() with same <useme>. * * If the original structure data is inconsistent it's left untouched. * * Returns: <eslOK> on success. * <eslESYNTAX> if WUSS string for SS_cons or msa->ss * following esl_wuss_nopseudo() is inconsistent. * <eslEINVAL> if a derived ct array implies a pknotted * SS, this should be impossible */ static int remove_broken_basepairs_from_msa(ESL_MSA *msa, char *errbuf, const int *useme) { int status; int i; if (msa->ss_cons != NULL) { if((status = remove_broken_basepairs_from_ss_string(msa->ss_cons, errbuf, msa->alen, useme)) != eslOK) return status; } /* per-seq SS annotation */ if (msa->ss != NULL) { for(i = 0; i < msa->nseq; i++) { if (msa->ss[i] != NULL) { if((status = remove_broken_basepairs_from_ss_string(msa->ss[i], errbuf, msa->alen, useme)) != eslOK) return status; } } } return eslOK; } /* Function: esl_msa_ColumnSubset() * Synopsis: Remove a selected subset of columns from the MSA * * Incept: SRE, Sun Feb 27 10:05:07 2005 * From squid's MSAShorterAlignment(), 1999 * * Purpose: Given an array <useme> (0..alen-1) of TRUE/FALSE flags, * where TRUE means "keep this column in the new alignment"; * remove all columns annotated as FALSE in the <useme> * array. This is done in-place on the MSA, so the MSA is * modified: <msa->alen> is reduced, <msa->aseq> is shrunk * (or <msa->ax>, in the case of a digital mode alignment), * and all associated per-residue or per-column annotation * is shrunk. * * Returns: <eslOK> on success. * Possibilities from <remove_broken_basepairs_from_msa()> call: * <eslESYNTAX> if WUSS string for <SS_cons> or <msa->ss> * following <esl_wuss_nopseudo()> is inconsistent. * <eslEINVAL> if a derived ct array implies a pknotted SS. */ int esl_msa_ColumnSubset(ESL_MSA *msa, char *errbuf, const int *useme) { int status; int64_t opos; /* position in original alignment */ int64_t npos; /* position in new alignment */ int idx; /* sequence index */ int i; /* markup index */ /* Remove any basepairs from SS_cons and individual sequence SS * for aln columns i,j for which useme[i-1] or useme[j-1] are FALSE */ if((status = remove_broken_basepairs_from_msa(msa, errbuf, useme)) != eslOK) return status; /* Since we're minimizing, we can overwrite in place, within the msa * we've already got. * opos runs all the way to msa->alen to include (and move) the \0 * string terminators (or sentinel bytes, in the case of digital mode) */ for (opos = 0, npos = 0; opos <= msa->alen; opos++) { if (opos < msa->alen && useme[opos] == FALSE) continue; if (npos != opos) /* small optimization */ { /* The alignment, and per-residue annotations */ for (idx = 0; idx < msa->nseq; idx++) { #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) /* watch off-by-one in dsq indexing */ msa->ax[idx][npos+1] = msa->ax[idx][opos+1]; else msa->aseq[idx][npos] = msa->aseq[idx][opos]; #else msa->aseq[idx][npos] = msa->aseq[idx][opos]; #endif /*eslAUGMENT_ALPHABET*/ if (msa->ss != NULL && msa->ss[idx] != NULL) msa->ss[idx][npos] = msa->ss[idx][opos]; if (msa->sa != NULL && msa->sa[idx] != NULL) msa->sa[idx][npos] = msa->sa[idx][opos]; if (msa->pp != NULL && msa->pp[idx] != NULL) msa->pp[idx][npos] = msa->pp[idx][opos]; for (i = 0; i < msa->ngr; i++) if (msa->gr[i][idx] != NULL) msa->gr[i][idx][npos] = msa->gr[i][idx][opos]; } /* The per-column annotations */ if (msa->ss_cons != NULL) msa->ss_cons[npos] = msa->ss_cons[opos]; if (msa->sa_cons != NULL) msa->sa_cons[npos] = msa->sa_cons[opos]; if (msa->pp_cons != NULL) msa->pp_cons[npos] = msa->pp_cons[opos]; if (msa->rf != NULL) msa->rf[npos] = msa->rf[opos]; for (i = 0; i < msa->ngc; i++) msa->gc[i][npos] = msa->gc[i][opos]; } npos++; } msa->alen = npos-1; /* -1 because npos includes NUL terminators */ return eslOK; } /* Function: esl_msa_MinimGaps() * Synopsis: Remove columns containing all gap symbols. * Incept: SRE, Sun Feb 27 11:03:42 2005 [St. Louis] * * Purpose: Remove all columns in the multiple alignment <msa> * that consist entirely of gaps or missing data. * * For a text mode alignment, <gaps> is a string defining * the gap characters, such as <"-_.">. For a digital mode * alignment, <gaps> may be passed as <NULL>, because the * internal alphabet already knows what the gap and missing * data characters are. * * <msa> is changed in-place to a narrower alignment * containing fewer columns. All per-residue and per-column * annotation is altered appropriately for the columns that * remain in the new alignment. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. * Possibilities from <esl_msa_ColumnSubset()> call: * <eslESYNTAX> if WUSS string for <SS_cons> or <msa->ss> * following <esl_wuss_nopseudo()> is inconsistent. * <eslEINVAL> if a derived ct array implies a pknotted SS. * * Xref: squid's MSAMingap(). */ int esl_msa_MinimGaps(ESL_MSA *msa, char *errbuf, const char *gaps) { int *useme = NULL; /* array of TRUE/FALSE flags for which cols to keep */ int64_t apos; /* column index */ int idx; /* sequence index */ int status; ESL_ALLOC_WITH_TYPE(useme, int*, sizeof(int) * (msa->alen+1)); /* +1 is just to deal w/ alen=0 special case */ #ifdef eslAUGMENT_ALPHABET /* digital mode case */ if (msa->flags & eslMSA_DIGITAL) /* be careful of off-by-one: useme is 0..L-1 indexed */ { for (apos = 1; apos <= msa->alen; apos++) { for (idx = 0; idx < msa->nseq; idx++) if (! esl_abc_XIsGap (msa->abc, msa->ax[idx][apos]) && ! esl_abc_XIsMissing(msa->abc, msa->ax[idx][apos])) break; if (idx == msa->nseq) useme[apos-1] = FALSE; else useme[apos-1] = TRUE; } } #endif if (! (msa->flags & eslMSA_DIGITAL)) /* text mode case */ { for (apos = 0; apos < msa->alen; apos++) { for (idx = 0; idx < msa->nseq; idx++) if (strchr(gaps, msa->aseq[idx][apos]) == NULL) break; if (idx == msa->nseq) useme[apos] = FALSE; else useme[apos] = TRUE; } } if((status = esl_msa_ColumnSubset(msa, errbuf, useme)) != eslOK) return status; free(useme); return eslOK; ERROR: if (useme != NULL) free(useme); return status; } /* Function: esl_msa_NoGaps() * Synopsis: Remove columns containing any gap symbol. * Incept: SRE, Sun Feb 27 10:17:58 2005 [St. Louis] * * Purpose: Remove all columns in the multiple alignment <msa> that * contain any gaps or missing data, such that the modified * MSA consists only of ungapped columns (a solid block of * residues). * * This is useful for filtering alignments prior to * phylogenetic analysis using programs that can't deal * with gaps. * * For a text mode alignment, <gaps> is a string defining * the gap characters, such as <"-_.">. For a digital mode * alignment, <gaps> may be passed as <NULL>, because the * internal alphabet already knows what the gap and * missing data characters are. * * <msa> is changed in-place to a narrower alignment * containing fewer columns. All per-residue and per-column * annotation is altered appropriately for the columns that * remain in the new alignment. * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. * Possibilities from <esl_msa_ColumnSubset()> call: * <eslESYNTAX> if WUSS string for <SS_cons> or <msa->ss> * following <esl_wuss_nopseudo()> is inconsistent. * <eslEINVAL> if a derived ct array implies a pknotted SS. * * Xref: squid's MSANogap(). */ int esl_msa_NoGaps(ESL_MSA *msa, char *errbuf, const char *gaps) { int *useme = NULL; /* array of TRUE/FALSE flags for which cols to keep */ int64_t apos; /* column index */ int idx; /* sequence index */ int status; ESL_ALLOC_WITH_TYPE(useme, int*, sizeof(int) * (msa->alen+1)); /* +1 is only to deal with alen=0 special case */ #ifdef eslAUGMENT_ALPHABET /* digital mode case */ if (msa->flags & eslMSA_DIGITAL) /* be careful of off-by-one: useme is 0..L-1 indexed */ { for (apos = 1; apos <= msa->alen; apos++) { for (idx = 0; idx < msa->nseq; idx++) if (esl_abc_XIsGap (msa->abc, msa->ax[idx][apos]) || esl_abc_XIsMissing(msa->abc, msa->ax[idx][apos])) break; if (idx == msa->nseq) useme[apos-1] = TRUE; else useme[apos-1] = FALSE; } } #endif if (! (msa->flags & eslMSA_DIGITAL)) /* text mode case */ { for (apos = 0; apos < msa->alen; apos++) { for (idx = 0; idx < msa->nseq; idx++) if (strchr(gaps, msa->aseq[idx][apos]) != NULL) break; if (idx == msa->nseq) useme[apos] = TRUE; else useme[apos] = FALSE; } } esl_msa_ColumnSubset(msa, errbuf, useme); free(useme); return eslOK; ERROR: if (useme != NULL) free(useme); return status; } /* Function: esl_msa_SymConvert() * Synopsis: Global search/replace of symbols in an MSA. * Incept: SRE, Sun Feb 27 11:20:41 2005 [St. Louis] * * Purpose: In the aligned sequences in a text-mode <msa>, convert any * residue in the string <oldsyms> to its counterpart (at the same * position) in string <newsyms>. * * To convert DNA to RNA, <oldsyms> could be "Tt" and * <newsyms> could be "Uu". To convert IUPAC symbols to * N's, <oldsyms> could be "RYMKSWHBVDrymkswhbvd" and * <newsyms> could be "NNNNNNNNNNnnnnnnnnnn". * * As a special case, if <newsyms> consists of a single * character, then any character in the <oldsyms> is * converted to this character. * * Thus, <newsyms> must either be of the same length as * <oldsyms>, or of length 1. Anything else will cause * undefined behavior (and probably segfault). * * The conversion is done in-place, so the <msa> is * modified. * * This is a poor man's hack for processing text mode MSAs * into a more consistent text alphabet. It is unnecessary * for digital mode MSAs, which are already in a standard * internal alphabet. Calling <esl_msa_SymConvert()> on a * digital mode alignment throws an <eslEINVAL> error. * * Returns: <eslOK> on success. * * Throws: <eslEINVAL> if <msa> is in digital mode, or if the <oldsyms> * and <newsyms> strings aren't valid together. */ int esl_msa_SymConvert(ESL_MSA *msa, const char *oldsyms, const char *newsyms) { int64_t apos; /* column index */ int idx; /* sequence index */ char *sptr; int special; if (msa->flags & eslMSA_DIGITAL) ESL_EXCEPTION(eslEINVAL, "can't SymConvert on digital mode alignment"); if ((strlen(oldsyms) != strlen(newsyms)) && strlen(newsyms) != 1) ESL_EXCEPTION(eslEINVAL, "invalid newsyms/oldsyms pair"); special = (strlen(newsyms) == 1 ? TRUE : FALSE); for (apos = 0; apos < msa->alen; apos++) for (idx = 0; idx < msa->nseq; idx++) if ((sptr = strchr((char*)oldsyms, msa->aseq[idx][apos])) != NULL) msa->aseq[idx][apos] = (special ? *newsyms : newsyms[sptr-oldsyms]); return eslOK; } /* Function: esl_msa_AddComment() * Incept: SRE, Tue Jun 1 17:37:21 1999 [St. Louis] * * Purpose: Add an (unparsed) comment line to the MSA structure, * allocating as necessary. * * Args: msa - a multiple alignment * s - comment line to add * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ int esl_msa_AddComment(ESL_MSA *msa, char *s) { void *p; int status; /* If this is our first recorded comment, we need to allocate; * and if we've filled available space, we need to reallocate. */ if (msa->comment == NULL) { ESL_ALLOC_WITH_TYPE(msa->comment, char**, sizeof(char *) * 16); msa->alloc_ncomment = 16; } if (msa->ncomment == msa->alloc_ncomment) { ESL_RALLOC_WITH_TYPE(msa->comment, char**, p, sizeof(char *) * msa->alloc_ncomment * 2); msa->alloc_ncomment *= 2; } if ((status = esl_strdup(s, -1, &(msa->comment[msa->ncomment]))) != eslOK) goto ERROR; msa->ncomment++; return eslOK; ERROR: return status; } /* Function: esl_msa_AddGF() * Incept: SRE, Tue Jun 1 17:37:21 1999 [St. Louis] * * Purpose: Add an unparsed \verb+#=GF+ markup line to the MSA, * allocating as necessary. <tag> is the GF markup * tag; <value> is the text associated w/ that tag. * * Args: msa - a multiple alignment * tag - markup tag * value - markup text * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ int esl_msa_AddGF(ESL_MSA *msa, char *tag, char *value) { void *p; int n; int status; /* If this is our first recorded unparsed #=GF line, we need to allocate(). */ if (msa->gf_tag == NULL) { ESL_ALLOC_WITH_TYPE(msa->gf_tag, char**, sizeof(char *) * 16); ESL_ALLOC_WITH_TYPE(msa->gf, char**, sizeof(char *) * 16); msa->alloc_ngf = 16; } /* or if we're out of room for new GF's, reallocate by doubling */ if (msa->ngf == msa->alloc_ngf) { n = msa->alloc_ngf * 2; ESL_RALLOC_WITH_TYPE(msa->gf_tag, char**, p, sizeof(char *) * n); ESL_RALLOC_WITH_TYPE(msa->gf, char**, p, sizeof(char *) * n); msa->alloc_ngf = n; } if ((status = esl_strdup(tag, -1, &(msa->gf_tag[msa->ngf]))) != eslOK) goto ERROR; if ((status = esl_strdup(value, -1, &(msa->gf[msa->ngf]))) != eslOK) goto ERROR; msa->ngf++; return eslOK; ERROR: return status; } /* Function: esl_msa_AddGS() * Incept: SRE, Tue Jun 1 17:37:21 1999 [St. Louis] * * Purpose: Add an unparsed \verb+#=GS+ markup line to the MSA, * allocating as necessary. It's possible that we * could get more than one of the same type of GS * tag per sequence; for example, "DR PDB;" structure * links in Pfam. Hack: handle these by appending to * the string, in a \verb+\n+ separated fashion. * * Args: msa - multiple alignment structure * tag - markup tag (e.g. "AC") * sqidx - index of sequence to assoc markup with (0..nseq-1) * value - markup (e.g. "P00666") * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ int esl_msa_AddGS(ESL_MSA *msa, char *tag, int sqidx, char *value) { void *p; int tagidx; int i; int status; /* first GS tag? init&allocate */ if (msa->gs_tag == NULL) { #ifdef eslAUGMENT_KEYHASH msa->gs_idx = esl_keyhash_Create(); status = esl_key_Store(msa->gs_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) return status; ESL_DASSERT1((tagidx == 0)); #else tagidx = 0; #endif ESL_ALLOC_WITH_TYPE(msa->gs_tag, char**, sizeof(char *)); /* one at a time. */ ESL_ALLOC_WITH_TYPE(msa->gs, char***, sizeof(char **)); ESL_ALLOC_WITH_TYPE(msa->gs[0], char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->gs[0][i] = NULL; } else { /* Get a tagidx for this GS tag. * tagidx < ngs; we already saw this tag; * tagidx == ngs; this is a new one. */ #ifdef eslAUGMENT_KEYHASH status = esl_key_Store(msa->gs_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) return status; #else for (tagidx = 0; tagidx < msa->ngs; tagidx++) if (strcmp(msa->gs_tag[tagidx], tag) == 0) break; #endif /* Reallocation (in blocks of 1) */ if (tagidx == msa->ngs ) { ESL_RALLOC_WITH_TYPE(msa->gs_tag, char**, p, (msa->ngs+1) * sizeof(char *)); ESL_RALLOC_WITH_TYPE(msa->gs, char***, p, (msa->ngs+1) * sizeof(char **)); ESL_ALLOC_WITH_TYPE(msa->gs[msa->ngs], char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->gs[msa->ngs][i] = NULL; } } /* Store the tag, if it's new. */ if (tagidx == msa->ngs) { if ((status = esl_strdup(tag, -1, &(msa->gs_tag[tagidx]))) != eslOK) goto ERROR; msa->ngs++; } /* Store the annotation on the sequence. * If seq is unannotated, dup the value; if * seq already has a GS annotation, cat a \n, then cat the value. */ if (msa->gs[tagidx][sqidx] == NULL) { if ((status = esl_strdup(value, -1, &(msa->gs[tagidx][sqidx]))) != eslOK) goto ERROR; } else { int n1,n2; n1 = strlen(msa->gs[tagidx][sqidx]); n2 = strlen(value); ESL_RALLOC_WITH_TYPE(msa->gs[tagidx][sqidx], char*, p, sizeof(char) * (n1+n2+2)); msa->gs[tagidx][sqidx][n1] = '\n'; strcpy(msa->gs[tagidx][sqidx]+n1+1, value); } return eslOK; ERROR: return status; } /* Function: esl_msa_AppendGC() * Incept: SRE, Tue Jun 1 17:37:21 1999 [St. Louis] * * Purpose: Add an unparsed \verb+#=GC+ markup line to the MSA * structure, allocating as necessary. When called * multiple times for the same tag, appends value * strings together -- used when parsing multiblock * alignment files, for example. * * Args: msa - multiple alignment structure * tag - markup tag (e.g. "CS") * value - markup, one char per aligned column * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ int esl_msa_AppendGC(ESL_MSA *msa, char *tag, char *value) { int tagidx; int status; void *p; /* Is this an unparsed tag name that we recognize? * If not, handle adding it to index, and reallocating * as needed. */ if (msa->gc_tag == NULL) /* first tag? init&allocate */ { #ifdef eslAUGMENT_KEYHASH msa->gc_idx = esl_keyhash_Create(); status = esl_key_Store(msa->gc_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) return status; ESL_DASSERT1((tagidx == 0)); #else tagidx = 0; #endif ESL_ALLOC_WITH_TYPE(msa->gc_tag, char**, sizeof(char **)); ESL_ALLOC_WITH_TYPE(msa->gc, char**, sizeof(char **)); msa->gc[0] = NULL; } else { /* new tag? */ /* get tagidx for this GC tag. existing tag: <ngc; new: == ngc. */ #ifdef eslAUGMENT_KEYHASH status = esl_key_Store(msa->gc_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) goto ERROR; #else for (tagidx = 0; tagidx < msa->ngc; tagidx++) if (strcmp(msa->gc_tag[tagidx], tag) == 0) break; #endif /* Reallocate, in block of one tag at a time */ if (tagidx == msa->ngc) { ESL_RALLOC_WITH_TYPE(msa->gc_tag, char**, p, (msa->ngc+1) * sizeof(char **)); ESL_RALLOC_WITH_TYPE(msa->gc, char**, p, (msa->ngc+1) * sizeof(char **)); msa->gc[tagidx] = NULL; } } /* new tag? store it. */ if (tagidx == msa->ngc) { if ((status = esl_strdup(tag, -1, &(msa->gc_tag[tagidx]))) != eslOK) goto ERROR; msa->ngc++; } return (esl_strcat(&(msa->gc[tagidx]), -1, value, -1)); ERROR: return status; } /* Function: esl_msa_AppendGR() * Incept: SRE, Thu Jun 3 06:34:38 1999 [Madison] * * Purpose: Add an unparsed \verb+#=GR+ markup line to the MSA structure, * allocating as necessary. * * When called multiple times for the same tag, appends * value strings together -- used when parsing multiblock * alignment files, for example. * * Args: msa - multiple alignment structure * tag - markup tag (e.g. "SS") * sqidx - index of seq to assoc markup with (0..nseq-1) * value - markup, one char per aligned column * * Returns: <eslOK> on success. * * Throws: <eslEMEM> on allocation failure. */ int esl_msa_AppendGR(ESL_MSA *msa, char *tag, int sqidx, char *value) { void *p; int tagidx; int i; int status; if (msa->gr_tag == NULL) /* first tag? init&allocate */ { #ifdef eslAUGMENT_KEYHASH msa->gr_idx = esl_keyhash_Create(); status = esl_key_Store(msa->gr_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) return status; ESL_DASSERT1((tagidx == 0)); #else tagidx = 0; #endif ESL_ALLOC_WITH_TYPE(msa->gr_tag, char**, sizeof(char *)); ESL_ALLOC_WITH_TYPE(msa->gr, char***, sizeof(char **)); ESL_ALLOC_WITH_TYPE(msa->gr[0], char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->gr[0][i] = NULL; } else { /* get tagidx for this GR tag. existing<ngr; new=ngr. */ #ifdef eslAUGMENT_KEYHASH status = esl_key_Store(msa->gr_idx, tag, &tagidx); if (status != eslOK && status != eslEDUP) return status; #else for (tagidx = 0; tagidx < msa->ngr; tagidx++) if (strcmp(msa->gr_tag[tagidx], tag) == 0) break; #endif /* if a new tag, realloc for it */ if (tagidx == msa->ngr) { ESL_RALLOC_WITH_TYPE(msa->gr_tag, char**, p, (msa->ngr+1) * sizeof(char *)); ESL_RALLOC_WITH_TYPE(msa->gr, char***, p, (msa->ngr+1) * sizeof(char **)); ESL_ALLOC_WITH_TYPE(msa->gr[msa->ngr], char**, sizeof(char *) * msa->sqalloc); for (i = 0; i < msa->sqalloc; i++) msa->gr[msa->ngr][i] = NULL; } } if (tagidx == msa->ngr) { if ((status = esl_strdup(tag, -1, &(msa->gr_tag[tagidx]))) != eslOK) goto ERROR; msa->ngr++; } return (esl_strcat(&(msa->gr[tagidx][sqidx]), -1, value, -1)); ERROR: return status; } /* Function: esl_msa_Checksum() * Synopsis: Calculate a checksum for an MSA. * Incept: SRE, Tue Sep 16 13:23:34 2008 [Janelia] * * Purpose: Calculates a 32-bit checksum for <msa>. * * Only the alignment data are considered, not the sequence * names or other annotation. For text mode alignments, the * checksum is case sensitive. * * This is used as a quick way to try to verify that a * given alignment is identical to an expected one; for * example, when HMMER is mapping new sequence alignments * onto exactly the same seed alignment an HMM was built * from. * * Returns: <eslOK> on success. * * Xref: The checksum is a modified version of Jenkin's hash; * see <esl_keyhash> for the original and citations. */ int esl_msa_Checksum(const ESL_MSA *msa, uint32_t *ret_checksum) { uint32_t val = 0; int i,pos; #ifdef eslAUGMENT_ALPHABET if (msa->flags & eslMSA_DIGITAL) { for (i = 0; i < msa->nseq; i++) for (pos = 1; pos <= msa->alen; pos++) { val += msa->ax[i][pos]; val += (val << 10); val ^= (val >> 6); } } #endif if (! (msa->flags & eslMSA_DIGITAL)) { for (i = 0; i < msa->nseq; i++) for (pos = 0; pos < msa->alen; pos++) { val += msa->aseq[i][pos]; val += (val << 10); val ^= (val >> 6); } } val += (val << 3); val ^= (val >> 11); val += (val << 15); *ret_checksum = val; return eslOK; } /*-------------------- end of misc MSA functions ----------------------*/ /***************************************************************** * Easel - a library of C functions for biological sequence analysis * Version h3.0; March 2010 * Copyright (C) 2010 Howard Hughes Medical Institute. * Other copyrights also apply. See the COPYRIGHT file for a full list. * * Easel is distributed under the Janelia Farm Software License, a BSD * license. See the LICENSE file for more details. *****************************************************************/
35.123658
132
0.574999
[ "object", "model", "solid" ]
98f003dd3c9ead3d9dae93772abf1894acd5fb74
4,237
cpp
C++
Samples/05-Direct2DGeometries/05-Direct2DGeometries.Win32/Scene.cpp
PeymanTahghighi/WolfEngine
12bc0dd5171e296f0b51bad74809cb44d47a0bf9
[ "MIT" ]
1
2021-08-17T09:26:17.000Z
2021-08-17T09:26:17.000Z
Samples/05-Direct2DGeometries/05-Direct2DGeometries.Win32/Scene.cpp
PeymanTahghighi/WolfEngine
12bc0dd5171e296f0b51bad74809cb44d47a0bf9
[ "MIT" ]
null
null
null
Samples/05-Direct2DGeometries/05-Direct2DGeometries.Win32/Scene.cpp
PeymanTahghighi/WolfEngine
12bc0dd5171e296f0b51bad74809cb44d47a0bf9
[ "MIT" ]
null
null
null
/* Project : Wolf Engine (http://WolfStudio.co). Copyright(c) Pooya Eimandar (http://PooyaEimandar.com) . All rights reserved. Source : https://github.com/PooyaEimandar/WolfEngine - Please direct any bug to hello@WolfStudio.co or tweet @PooyaEimandar on twitter Name : Scene.cpp Description : This is the main type for your game Comment : */ #include "PCH.h" #include "Scene.h" using namespace std; using namespace DirectX; using namespace D2D1; using namespace Wolf::System; using namespace Wolf::Framework; using namespace Wolf::Graphics; using namespace Wolf::Graphics::Direct2D::Shapes; Scene::Scene() { W_Game::SetAppName(L"02-Direct2DShapes.Win32"); ColorF color = ColorF::Navy; this->backColor[0] = color.r; this->backColor[1] = color.g; this->backColor[2] = color.b; } Scene::~Scene() { Release(); } void Scene::Initialize(std::map<int, std::vector<W_WindowInfo>> pOutputWindowsInfo) { // TODO: Add your pre-initialization logic here W_Game::Initialize(pOutputWindowsInfo); } void Scene::Load() { // TODO: load your game assets here auto gDevice = this->GDevice(); //Load spriteBatch this->spriteBatch = make_unique<W_SpriteBatch>(gDevice); this->spriteBatch->Load(); //Load ellipse this->ellipse = make_unique<W_Ellipse>(gDevice); this->ellipse->SetGeormetry(530, 100, 70, 70); this->ellipse->SetColor(ColorF::White); this->ellipse->SetBorderColor(ColorF::White); //Load rectangle this->rectangle = make_unique<W_Rectangle>(gDevice); this->rectangle->SetGeormetry(0, 300, this->GetWindowWidth(), 400, 0, 0); this->rectangle->SetColor(ColorF::Blue); this->rectangle->SetBorderColor(ColorF::Blue); #pragma region Create Clouds this->geoCloud0 = make_unique<W_Geometry>(gDevice); this->geoCloud0->SetColor(ColorF::LightGray); this->geoCloud0->SetBorderColor(ColorF::LightGray); this->geoCloud0->Begin(); { this->geoCloud0->AddArc( Point2F(40, 220),//Start D2D1::Point2F(210, 220),//End D2D1::SizeF(70, 70),//Size 0.0f, //Rotation angle D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL); this->geoCloud0->AddArc( Point2F(120, 220),//Start D2D1::Point2F(340, 220),//End D2D1::SizeF(100, 150),//Size 0.0f, //Rotation angle D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL); this->geoCloud0->AddArc( Point2F(150, 220),//Start D2D1::Point2F(400, 220),//End D2D1::SizeF(100, 90),//Size 0.0f, //Rotation angle D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL); } this->geoCloud0->End(); this->geoCloud1 = make_unique<W_Geometry>(gDevice); this->geoCloud1->SetColor(ColorF::LightGray); this->geoCloud1->SetBorderColor(ColorF::LightGray); this->geoCloud1->Begin(); { this->geoCloud1->AddArc( Point2F(420, 220),//Start D2D1::Point2F(580, 220),//End D2D1::SizeF(20, 20),//Size 0.0f, //Rotation angle D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL); this->geoCloud1->AddArc( Point2F(520, 220),//Start D2D1::Point2F(770, 220),//End D2D1::SizeF(40, 50),//Size 0.0f, //Rotation angle D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL); } this->geoCloud1->End(); #pragma endregion } void Scene::Update(const Wolf::System::W_GameTime& pGameTime) { // TODO: Add your update logic here W_Game::Update(pGameTime); } void Scene::Render(const Wolf::System::W_GameTime& pGameTime) { // TODO: Add your drawing code here this->spriteBatch->Begin(); { this->spriteBatch->Draw(this->ellipse.get()); this->spriteBatch->Draw(this->rectangle.get()); this->spriteBatch->Draw(this->geoCloud0.get()); this->spriteBatch->Draw(this->geoCloud1.get()); } this->spriteBatch->End(); W_Game::Render(pGameTime); } void Scene::OnWindowResize(UINT pIndex) { // TODO: Add your logic for on window resizing event W_Game::OnWindowResize(pIndex); } void Scene::OnDeviceLost() { // TODO: Add your logic for on device lost event W_Game::OnDeviceLost(); } ULONG Scene::Release() { if (this->IsReleased()) return 0; // TODO: Release your assets here UNIQUE_RELEASE(this->spriteBatch); UNIQUE_RELEASE(this->ellipse); UNIQUE_RELEASE(this->rectangle); UNIQUE_RELEASE(this->geoCloud0); UNIQUE_RELEASE(this->geoCloud1); return W_Game::Release(); }
24.211429
138
0.709936
[ "render", "vector" ]
c70c10e2fb88aa1ff247c54631ba91659257a0d0
4,098
cpp
C++
src/plugins/dlniwe/fspathsmanager.cpp
MellonQ/leechcraft
71cbb238d2dade56b3865278a6a8e6a58c217fc5
[ "BSL-1.0" ]
1
2017-01-12T07:05:45.000Z
2017-01-12T07:05:45.000Z
src/plugins/dlniwe/fspathsmanager.cpp
MellonQ/leechcraft
71cbb238d2dade56b3865278a6a8e6a58c217fc5
[ "BSL-1.0" ]
null
null
null
src/plugins/dlniwe/fspathsmanager.cpp
MellonQ/leechcraft
71cbb238d2dade56b3865278a6a8e6a58c217fc5
[ "BSL-1.0" ]
null
null
null
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2014 Georg Rudoy * * Boost Software License - Version 1.0 - August 17th, 2003 * * Permission is hereby granted, free of charge, to any person or organization * obtaining a copy of the software and accompanying documentation covered by * this license (the "Software") to use, reproduce, display, distribute, * execute, and transmit the Software, and to prepare derivative works of the * Software, and to permit third-parties to whom the Software is furnished to * do so, all subject to the following: * * The copyright notices in the Software and this entire statement, including * the above license grant, this restriction and the following disclaimer, * must be included in all copies of the Software, in whole or in part, and * all derivative works of the Software, unless such copies or derivative * works are solely in the form of machine-executable object code generated by * a source language processor. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **********************************************************************/ #include "fspathsmanager.h" #include <QStandardItemModel> #include <QSettings> #include <QCoreApplication> #include <QtDebug> #include <HUpnpAv/HFileSystemDataSource> #include <HUpnpAv/HRootDir> #include <xmlsettingsdialog/datasourceroles.h> namespace LeechCraft { namespace DLNiwe { namespace HAV = Herqq::Upnp::Av; FSPathsManager::FSPathsManager (HAV::HFileSystemDataSource *source, QObject *parent) : QObject (parent) , Model_ (new QStandardItemModel (this)) , FSSource_ (source) { Model_->setHorizontalHeaderLabels ({ tr ("Path") }); auto headerItem = Model_->horizontalHeaderItem (0); headerItem->setData (DataSources::DataFieldType::LocalPath, DataSources::DataSourceRole::FieldType); LoadSettings (); } QAbstractItemModel* FSPathsManager::GetModel () const { return Model_; } void FSPathsManager::RefillSource () { FSSource_->clear (); for (auto i = 0; i < Model_->rowCount (); ++i) FSSource_->add ({ Model_->index (i, 0).data ().toString (), HAV::HRootDir::RecursiveScan, HAV::HRootDir::WatchForChanges }); } void FSPathsManager::AppendItem (const QString& path) { auto item = new QStandardItem (path); item->setEditable (false); Model_->appendRow (item); FSSource_->add ({ path, HAV::HRootDir::RecursiveScan, HAV::HRootDir::WatchForChanges }); } void FSPathsManager::LoadSettings () { QSettings settings (QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_DLNiwe"); const auto& paths = settings.value ("RootPaths").toStringList (); for (const auto& path : paths) AppendItem (path); } void FSPathsManager::SaveSettings () { QStringList paths; for (auto i = 0; i < Model_->rowCount (); ++i) paths << Model_->index (i, 0).data ().toString (); QSettings settings (QCoreApplication::organizationName (), QCoreApplication::applicationName () + "_DLNiwe"); settings.setValue ("RootPaths", paths); } void FSPathsManager::addRequested (const QString&, const QVariantList& rowData) { const auto& path = rowData.value (0).toString (); if (path.isEmpty ()) return; AppendItem (path); SaveSettings (); } void FSPathsManager::removeRequested (const QString&, QModelIndexList rows) { if (rows.size () > 1) std::reverse (rows.begin (), rows.end ()); for (const auto& row : rows) Model_->removeRow (row.row ()); RefillSource (); SaveSettings (); } } }
30.58209
85
0.693021
[ "object" ]
c70cf44d95ac8ebed30555b66442689cbd38c806
2,872
cpp
C++
f00ale-cpp/src/p16.cpp
f00ale/advent_of_code_2019
96186541d32898ba195b2d0fc1ba222c462e0ca0
[ "Apache-2.0" ]
9
2019-12-01T14:52:40.000Z
2020-12-16T14:24:19.000Z
f00ale-cpp/src/p16.cpp
f00ale/advent_of_code_2019
96186541d32898ba195b2d0fc1ba222c462e0ca0
[ "Apache-2.0" ]
null
null
null
f00ale-cpp/src/p16.cpp
f00ale/advent_of_code_2019
96186541d32898ba195b2d0fc1ba222c462e0ca0
[ "Apache-2.0" ]
51
2019-11-26T14:49:05.000Z
2021-12-01T20:53:41.000Z
#include <iostream> #include <vector> #include <algorithm> #include <tuple> #include <set> #include <sstream> void p16(std::istream & is) { int ans1 = 0; int ans2 = 0; const std::vector<int> input = [&is] { std::vector<int> v; bool done = false; int num = 0; bool have_num = false; std::string str; while (!done) { char c; is.get(c); if (!is.good()) { done = true; c = '\n'; } if(c >= '0' && c <= '9') { num *= 10; num += c - '0'; have_num = true; v.push_back(num); num = 0; } else if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { str.push_back(c); } else { if(have_num) { } else if(!str.empty()) { } if(c == '\n') { } have_num = false; num = 0; str.clear(); } } return v; }(); for(auto problem : {1,2}) { size_t offset = 0; auto v = input; v.reserve(input.size() * 10000); if(problem == 2) { for (int i = 0; i < 7; i++) { offset *= 10; offset += v[i]; } auto cpy = v; for (int i = 1; i < 10000; i++) v.insert(v.end(), cpy.begin(), cpy.end()); } const std::vector<int> phase{0, 1, 0, -1}; std::vector<int> precalc(v.size()+1); for (int varv = 0; varv < 100; varv++) { for (size_t i = offset; i < v.size(); i++) { precalc[i+1] = precalc[i]+v[i]; } for(size_t i = offset; i < v.size()/2; i++) { int pp = 0; int tmp = 0; size_t stride = i; size_t nextstride = i; for (size_t j = 0; j < v.size(); j += stride) { stride = nextstride; tmp += phase[pp]*(precalc[std::min(static_cast<size_t>(j+stride),v.size())]-precalc[j]); nextstride = i+1; pp++; if(pp > 3) pp = 0; } v[i] = (std::abs(tmp) % 10); } for(size_t i = std::max(offset, v.size()/2); i < v.size(); i++) { v[i] = std::abs(precalc[v.size()]-precalc[i]) % 10; //phase is always 1 } } int ans = 0; for(size_t i = offset; i < offset+8; i++) { ans *= 10; ans += v[i]; } if(problem == 1) ans1 = ans; else ans2 = ans; } std::cout << ans1 << std::endl; std::cout << ans2 << std::endl; } int main() { p16(std::cin); }
26.109091
108
0.361769
[ "vector" ]
c711ddd3a117a0ea07522b305ec925d972192258
18,683
cpp
C++
src/main.cpp
ramenguy99/ray
443368a9b633f6c0c76c9f91be41616b2c672479
[ "Unlicense" ]
null
null
null
src/main.cpp
ramenguy99/ray
443368a9b633f6c0c76c9f91be41616b2c672479
[ "Unlicense" ]
null
null
null
src/main.cpp
ramenguy99/ray
443368a9b633f6c0c76c9f91be41616b2c672479
[ "Unlicense" ]
null
null
null
#include <stdlib.h> #include <stdarg.h> #include <float.h> #include <stdio.h> #include <math.h> #include <stdint.h> #include <string.h> #include <ctype.h> #include <limits.h> #include <stddef.h> #define __STDC_FORMAT_MACROS 1 #include <inttypes.h> //OUTPUT #define OUTPUT_WIDTH 1920 #define OUTPUT_HEIGHT 1080 #define RAY_BOUNCES 8 #define RAYS_PER_PIXEL 8 #define MAX_RAYS_PER_PIXEL 4096 //PREPROCESSING #define MIN_TRIANGLES_PER_LEAF 10 #define MIN_TRIANGLE_DIFFERENCE 3 #define PREPROCESSING_ONLY 0 #define SCENE_DRAGONS 1 //MULTITHREADING #define NUMBER_OF_THREADS 8 //DEBUG #define DEBUG_COLORS 0 #include "defines.h" //Platform dependent code #include "platform.cpp" #include "threading.cpp" //Utils #include "math/math.cpp" #include "math/math_vec.cpp" #include "math/math_mat.cpp" #include "math/math_quaternion.cpp" #include "mesh.cpp" #include "collada/collada.cpp" #include "image.cpp" //Ray tracing #include "sampler.cpp" #include "geometry.cpp" #include "bounding_volumes.cpp" #include "world.cpp" #include "ray.cpp" #include "tile_work.cpp" struct command_line_options { char* OutputFileName; u32 OutputHeight; u32 OutputWidth; u32 RaysPerPixel; u32 RayBounces; u32 NumberOfThreads; bool PreprocessingOnly; }; internal command_line_options ParseCommandLineOptions(int argc, char** argv) { //Default values command_line_options Opt = {}; Opt.OutputHeight = OUTPUT_HEIGHT; Opt.OutputWidth = OUTPUT_WIDTH; Opt.RaysPerPixel = RAYS_PER_PIXEL; Opt.RayBounces = RAY_BOUNCES; Opt.NumberOfThreads = NUMBER_OF_THREADS; Opt.PreprocessingOnly = PREPROCESSING_ONLY; Opt.OutputFileName = 0; char* UseHMessage = ", use -h for help\n"; for(int i = 1; i < argc; i++) { char* arg = argv[i]; if(arg[0] == '-') { switch(arg[1]) { case 'o': { if(argc - i <= 2) { printf("Expected width and height for the output after -o%s", UseHMessage); exit(1); } Opt.OutputWidth = atoi(argv[++i]); Opt.OutputHeight = atoi(argv[++i]); if(Opt.OutputWidth == 0 || Opt.OutputWidth > (1 << 16) || Opt.OutputHeight == 0 || Opt.OutputHeight > (1 << 16)) { printf("Output resolution must be two integer values between one and 2^16"); exit(1); } } break; case 'r': { if(argc - i <= 1) { printf("Expected number of rays per pixel after -r%s", UseHMessage); exit(1); } Opt.RaysPerPixel = atoi(argv[++i]); if(Opt.RaysPerPixel == 0 || Opt.RaysPerPixel > MAX_RAYS_PER_PIXEL) { printf("Number of rays per pixel must be integer between one and 2^16"); exit(1); } } break; case 'b': { if(argc - i <= 1) { printf("Expected number of rays bounces after -b%s", UseHMessage); exit(1); } Opt.RayBounces = atoi(argv[++i]); if(Opt.RayBounces == 0 || Opt.RayBounces > (1 << 16)) { printf("Number of ray bounces must be integer between one and 2^16"); exit(1); } } break; case 'j': { if(argc - i <= 1) { printf("Expected number of threads -j%s", UseHMessage); exit(1); } Opt.NumberOfThreads = atoi(argv[++i]); if(Opt.NumberOfThreads == 0 || Opt.NumberOfThreads > 512) { printf("Number of threads must be integer between one and 512"); exit(1); } } break; case 'p': { Opt.PreprocessingOnly = true; } break; case 'h': { printf("Usage: %s OUTPUT_FILE [OPTIONS]...\n", argv[0]); printf(" -o WIDTH HEIGHT specify output resolution\n"); printf(" -r RAYS specify number of rays per pixel\n"); printf(" -b BOUNCES specify number of bounces per ray\n"); printf(" -j THREADS specify number of threads to use\n"); printf(" -p only do mesh preprocessing and print stats\n"); printf(" -h show this message\n"); exit(1); } break; default: { printf("Invalid argument %s%s", arg, UseHMessage); exit(1); } break; } } else { if(Opt.OutputFileName) { printf("Invalid argument %s%s", arg, UseHMessage); exit(1); } Opt.OutputFileName = arg; } } if(!Opt.OutputFileName) { printf("Must specify an output file path%s", UseHMessage); exit(1); } return Opt; } int main(int argc,char** argv) { //Parse command line options command_line_options Opt = ParseCommandLineOptions(argc, argv); u32 OutputHeight = Opt.OutputHeight; u32 OutputWidth = Opt.OutputWidth; u32 RaysPerPixel = Opt.RaysPerPixel; u32 RayBounces = Opt.RayBounces; u32 NumberOfThreads = Opt.NumberOfThreads; bool PreprocessingOnly = Opt.PreprocessingOnly; //Prepare output image image_data OutputImage = AllocateImage(OutputWidth, OutputHeight); //Init scene world World = AllocWorld(vec3(0.7f, 0.9f, 1.0f)); char* DragonPath = "../res/dragon.dae"; collada_scene DragonScene = ReadColladaFromFile(DragonPath); if(DragonScene.MeshesCount == 0) { printf("Failed to load collada file at %s\n", DragonPath); exit(1); } mesh_data Dragon = DragonScene.Meshes[0]; mat4 ModelMatrix = Mat4Rotate(90.0f, vec3(1.0f, 0.0f, 0.0f)); //Transform to Z up TransformMeshVertices(&Dragon, ModelMatrix); #if 0 PushMaterial(&World, vec3(1.f, 1.0f, 1.0f), vec3(0.0f), 0.5f); PushMaterial(&World, vec3(0.0f), vec3(1.0f), 0.0f); PushMaterial(&World, vec3(0.3f, 1.0f, 0.3f), vec3(0.0f), 0.1f); PushMaterial(&World, vec3(0.3f, 0.3f, 1.0f), vec3(0.0f), 0.1f); PushMaterial(&World, vec3(1.0f, 0.0f, 0.0f), vec3(0.0f), 0.1f); PushMaterial(&World, vec3(0.804f, 0.498f, 0.196f), vec3(0.0f), 0.7f); PushMaterial(&World, vec3(1.0f, 1.0f, 1.0f), vec3(0.0f), 1.0f); PushMaterial(&World, vec3(0.3f, 0.6f, 0.9f), vec3(0.0f), 0.8f); //PushMaterial(&World, vec3(1.0f, 0.843f, 0.0f), vec3(0.0f), 0.7f); //PushMaterial(&World, vec3(1.0f, 0.7f, 0.7f), vec3(0.0f), 1.5f, false); PushPlane(&World, vec3(0, 0, 1), 0.0f, 2); PushPlane(&World, vec3(0, 0, -1), -3.0f, 1); PushPlane(&World, vec3(0, -1, 0), -2.0f, 0); PushPlane(&World, vec3(1, 0, 0), -2.0f, 3); PushPlane(&World, vec3(-1, 0, 0), -2.0f, 4); PushMeshInfo(&World, &Dragon); PushMesh(&World, 0, vec3(-1.0f, -2.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(0.15f), 5); PushMesh(&World, 0, vec3(0.0f, -2.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(0.15f), 6); PushMesh(&World, 0, vec3(1.0f, -2.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(0.15f), 7); //Init camera vec3 CameraP = vec3(0, -8, 1); vec3 CameraZ = Normalize(vec3(0, 0, 0.7f) - CameraP); vec3 CameraX = Normalize(Cross(vec3(0, 0, 1), CameraZ)); vec3 CameraY = Normalize(Cross(CameraZ, CameraX)); #elif 0 //Plane PushMaterial(&World, vec3(1.f, 1.0f, 1.0f), vec3(0.0f), 0.5f); //PushMaterial(&World, vec3(0.0f), vec3(1.0f), 0.0f); //Dragons PushMaterial(&World, vec3(0.3f, 0.6f, 0.9f), vec3(0.0f), 0.8f); PushMaterial(&World, vec3(1, 1, 1), vec3(0.0f), 1.0f); PushMaterial(&World, vec3(0.804f, 0.498f, 0.196f), vec3(0.0f), 0.9f); // PushMaterial(&World, vec3(1, 1, 1), vec3(0.0f), 1.1f, true); //Spheres u32 FirstSphereMaterial = World.MaterialsCount; PushMaterial(&World, vec3(1,1,1), vec3(0), 1.0f); PushMaterial(&World, vec3(1,0,0), vec3(0), 0.1f); PushMaterial(&World, vec3(0,1,0), vec3(0), 0.8f); PushMaterial(&World, vec3(0,0,1), vec3(0), 0.2f); PushMaterial(&World, vec3(0.3f,0.2f,0.6f), vec3(0), 0.2f); PushMaterial(&World, vec3(1.0f,0.2f,0.1f), vec3(0), 0.3f); PushMaterial(&World, vec3(1.0f,0.6f,0.1f), vec3(0), 0.8f); PushMaterial(&World, vec3(0.3f, 1, 0.8f), vec3(0), 0.6f); u32 SphereMaterialsCount = World.MaterialsCount - FirstSphereMaterial; random_series ColSeries = RandSeries(324634); random_series PosSeries = RandSeries(3634); random_series SizeSeries = RandSeries(33); u32 SpheresX = 7; u32 SpheresY = 7; For(y, SpheresY) { For(x, SpheresX) { #if 0 f32 H = RandRange(&ColSeries, 0.0f, 360.0f); f32 S = RandRange(&ColSeries, 0.5f, 1.0f); f32 V = RandRange(&ColSeries, 0.5f, 1.0f); vec3 Color = HSVToRGB(H, 1, 1); PushMaterial(&World, vec3(Color), vec3(0), Color.a); #endif f32 Radius = RandRange(&SizeSeries, 0.3f, 1.0f); f32 Off = 0.5f; if(x == 2 && y == 2) { Radius *= 0.5f; } vec3 Position; Position.x = (f32)x / SpheresX * 20 - 8 + RandRange(&PosSeries, -Off, Off); Position.y = (f32)y / SpheresY * 20 - 8 + RandRange(&PosSeries, -Off, Off); Position.z = Radius; u32 Material = RandU32(&ColSeries) % SphereMaterialsCount + FirstSphereMaterial; PushSphere(&World, Position, Radius, Material); } } PushPlane(&World, vec3(0, 0, 1), 0.0f, 0); //PushSphere(&World, vec3(0, 0, 0), 1.0f, 1); PushMeshInfo(&World, &Dragon); f32 DragonScale = 0.3f; PushMesh(&World, 0, vec3(-3.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonScale), 1); PushMesh(&World, 0, vec3(0.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonScale), 2); PushMesh(&World, 0, vec3(3.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonScale), 3); //Init camera vec3 CameraP = vec3(-8, -8, 8); vec3 CameraZ = Normalize(vec3(0, 0, 0) - CameraP); vec3 CameraX = Normalize(Cross(vec3(0, 0, 1), CameraZ)); vec3 CameraY = Normalize(Cross(CameraZ, CameraX)); #elif 1 PushMaterial(&World, vec3(0.5f, 0.5f, 0.5f), vec3(0.0f), 0.1f); PushMaterial(&World, vec3(0.7f, 0.5f, 0.3f), vec3(0.0f), 0.3f); PushMaterial(&World, vec3(0.3f, 0.6f, 0.9f), vec3(0.0f), 0.8f); PushMaterial(&World, vec3(0.0f), vec3(0.9f, 0.0, 0.0f), 0.0f); //Dragons PushMaterial(&World, vec3(1, 1, 1), vec3(0.0f), 1.0f); PushMaterial(&World, vec3(0.3f, 0.6f, 0.9f), vec3(0.0f), 0.8f); PushMaterial(&World, vec3(0.804f, 0.498f, 0.196f), vec3(0.0f), 0.9f); // PushMaterial(&World, vec3(1.0f, 1.0f, 1.0f), vec3(0.0f), 1.0f, true); // PushMaterial(&World, vec3(1.0f, 0.7f, 0.7f), vec3(0.0f), 1.1f, false); // PushMaterial(&World, vec3(1.0f, 1.0f, 1.0f), vec3(0.0f), 1.0f, true); PushPlane(&World, vec3(0, 0, 1), 0.0f, 0); // PushSphere(&World, vec3(-2, 1, 1), 0.7f, 2); // PushSphere(&World, vec3(4, -0.3f, 0), 2.0f, 3); PushSphere(&World, vec3(5.5, 7, 2.5), 2.5f, 4); PushSphere(&World, vec3(-5.5, 7, 2.5), 2.5f, 4); PushMeshInfo(&World, &Dragon); //PushMesh(&World, 0, vec3(0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(0.3f), 4); f32 DragonBigScale = 0.3f; f32 DragonSmallScale = 0.20f; PushMesh(&World, 0, vec3(-2.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonSmallScale), 5); PushMesh(&World, 0, vec3(0.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonBigScale), 4); PushMesh(&World, 0, vec3(2.0f, 0.0f, 0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(DragonSmallScale), 6); //Spheres u32 FirstSphereMaterial = World.MaterialsCount; PushMaterial(&World, vec3(1,1,1), vec3(0), 1.0f); PushMaterial(&World, vec3(1,0,0), vec3(0), 0.1f); PushMaterial(&World, vec3(0,1,0), vec3(0), 0.8f); PushMaterial(&World, vec3(0,0,1), vec3(0), 0.2f); PushMaterial(&World, vec3(0.3f,0.2f,0.6f), vec3(0), 0.2f); PushMaterial(&World, vec3(1.0f,0.2f,0.1f), vec3(0), 0.3f); PushMaterial(&World, vec3(1.0f,0.6f,0.1f), vec3(0), 0.8f); PushMaterial(&World, vec3(0.3f, 1, 0.8f), vec3(0), 0.6f); u32 SphereMaterialsCount = World.MaterialsCount - FirstSphereMaterial; random_series ColSeries = RandSeries(324634); random_series PosSeries = RandSeries(3634); random_series SizeSeries = RandSeries(33); u32 SpheresX = 15; u32 SpheresY = 15; f32 Center = 15; f32 Range = 30; For(y, SpheresY) { For(x, SpheresX) { f32 Radius = RandRange(&SizeSeries, 0.2f, 0.3f); f32 Off = 0.5f; vec3 Position; Position.x = (f32)x / SpheresX * Range - Center + RandRange(&PosSeries, -Off, Off); Position.y = (f32)y / SpheresY * Range - Center + RandRange(&PosSeries, -Off, Off); Position.z = Radius; u32 Material = RandU32(&ColSeries) % SphereMaterialsCount + FirstSphereMaterial; PushSphere(&World, Position, Radius, Material); } } //Init camera vec3 CameraP = vec3(0, -10, 1); vec3 CameraZ = Normalize(vec3(0, 0, 1) - CameraP); vec3 CameraX = Normalize(Cross(vec3(0, 0, 1), CameraZ)); vec3 CameraY = Normalize(Cross(CameraZ, CameraX)); #else PushMaterial(&World, vec3(0.5f, 0.5f, 0.5f), vec3(0.0f), 0.1f); PushMaterial(&World, vec3(0.7f, 0.5f, 0.3f), vec3(0.0f), 0.3f); PushMaterial(&World, vec3(0.3f, 0.6f, 0.9f), vec3(0.0f), 0.8f); PushMaterial(&World, vec3(0.0f), vec3(0.9f, 0.0, 0.0f), 0.0f); PushMaterial(&World, vec3(1.0f, 1.0f, 1.0f), vec3(0.0f), 1.0f, true); PushPlane(&World, vec3(0, 0, 1), 0.0f, 0); PushSphere(&World, vec3(-2, 1, 1), 0.7f, 2); PushSphere(&World, vec3(4, -0.3f, 0), 2.0f, 3); PushSphere(&World, vec3(3, 5, 2), 2.0f, 4); PushSphere(&World, vec3(-5, 6, 2), 2.0f, 4); PushMeshInfo(&World, &Dragon); PushMesh(&World, 0, vec3(0.0f), Mat3Rotate(vec3(0.0f, 0.0f, 1.0f), 90.0f), vec3(0.3f), 4); //Init camera vec3 CameraP = vec3(0, -10, 1); vec3 CameraZ = Normalize(vec3(0, 0, 1) - CameraP); vec3 CameraX = Normalize(Cross(vec3(0, 0, 1), CameraZ)); vec3 CameraY = Normalize(Cross(CameraZ, CameraX)); #endif //Preprocess meshes PreprocessWorldMeshes(&World, PreprocessingOnly); if(PreprocessingOnly) { return 0; } //Compute tile ranges for workers tile_work_array WorkArray = {}; u32 TilesX = 16; u32 TilesY = 16; u32 TilesToDo = TilesX * TilesY; u32 TileWidth = OutputWidth / TilesX; u32 TileHeight = OutputHeight / TilesY; u32 LastTileWidth = OutputWidth - TileWidth * (TilesX - 1); u32 LastTileHeight = OutputHeight - TileHeight * (TilesY - 1); WorkArray.TotalEntries = TilesToDo; WorkArray.Entries = (tile_work_entry*)ZeroAlloc(sizeof(tile_work_entry) * TilesToDo); For(y, TilesY) { u32 CurrHeight = y == TilesY - 1 ? LastTileHeight : TileHeight; For(x, TilesX) { u32 CurrWidth = x == TilesX - 1 ? LastTileWidth : TileWidth; u32 TileIndex = y * TilesY + x; WorkArray.Entries[TileIndex].x = x * TileWidth; WorkArray.Entries[TileIndex].y = y * TileHeight; WorkArray.Entries[TileIndex].CountX = CurrWidth; WorkArray.Entries[TileIndex].CountY = CurrHeight; WorkArray.Entries[TileIndex].RandomSeries.State = rand(); } } // Data common to all workers tile_worker_thread_init Init = {}; Init.WorkArray = &WorkArray; Init.OutputWidth = OutputWidth; Init.OutputHeight = OutputHeight; Init.OutputImage = &OutputImage; Init.RaysPerPixel = RaysPerPixel; Init.RayBounces = RayBounces; Init.World = &World; Init.CameraP = CameraP; Init.CameraX = CameraX; Init.CameraY = CameraY; Init.CameraZ = CameraZ; Init.MainThreadId = GetCurrentThreadId(); GetSamplePositions(Init.Samples, RaysPerPixel); //Create workers timestamp BeginCounter = GetCurrentCounter(); u32 SecondaryThreadsCount = NumberOfThreads - 1; For(i, SecondaryThreadsCount) { CreateWorkerThread(TileWorkerProc, &Init); } TileWorkerProc(&Init); //Wait for other workers to finish but keep printing stats while(WorkArray.EntriesDone < WorkArray.TotalEntries) { Sleep(1); } printf("\rRay casting progress: 100%%"); timestamp EndCounter = GetCurrentCounter(); f32 SecondsElapsed = GetSecondsElapsed(BeginCounter, EndCounter); //Print stats printf("\n"); printf("%u - %u Output size\n", OutputWidth, OutputHeight); printf("%u Rays per pixel - %u Rays Bounces\n", RaysPerPixel, RayBounces); printf("%" PRIu64 "/%" PRIu64 "(%.3f %%) rays-triangle intersections passed\n", Init.TriangleTestsPassed, Init.TriangleTestsTotal, (f64)Init.TriangleTestsPassed / (f64)Init.TriangleTestsTotal); printf("Casted %" PRIu64 " rays in %.3f seconds(%.3f MRays/s)\n", Init.RaysCasted, SecondsElapsed, Init.RaysCasted / (SecondsElapsed * (1000 *1000))); //Output result to file WriteImageToBMPFile(&OutputImage, Opt.OutputFileName); return 0; }
35.451613
119
0.554408
[ "mesh", "geometry", "transform" ]
c725bb9a1d968c3081b35596fd9f0b42dcf37370
12,003
cc
C++
zircon/tools/mtd-redundant-storage/mtd-rs-tool.cc
allansrc/fuchsia
a2c235b33fc4305044d496354a08775f30cdcf37
[ "BSD-2-Clause" ]
210
2019-02-05T12:45:09.000Z
2022-03-28T07:59:06.000Z
zircon/tools/mtd-redundant-storage/mtd-rs-tool.cc
PlugFox/fuchsia
39afe5230d41628b3c736a6e384393df954968c8
[ "BSD-2-Clause" ]
56
2021-06-03T03:16:25.000Z
2022-03-20T01:07:44.000Z
zircon/tools/mtd-redundant-storage/mtd-rs-tool.cc
PlugFox/fuchsia
39afe5230d41628b3c736a6e384393df954968c8
[ "BSD-2-Clause" ]
73
2019-03-06T18:55:23.000Z
2022-03-26T12:04:51.000Z
// Copyright 2019 The Fuchsia 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 <fcntl.h> #include <getopt.h> #include <lib/mtd/mtd-interface.h> #include <lib/nand-redundant-storage/file-nand-redundant-storage.h> #include <lib/nand-redundant-storage/nand-redundant-storage.h> #include <string.h> #include <unistd.h> #include <cerrno> #include <cstdint> #include <cstdio> #include <optional> #include <vector> #include <fbl/unique_fd.h> const uint32_t kFilePageSize = 4096; const uint32_t kFileBlockSize = kFilePageSize * 64; const uint32_t kFilePermissions = 0666; constexpr const char kOptString[] = "i:n:o:s:dexh"; constexpr const option kLongOpts[] = { {"input", required_argument, nullptr, 'i'}, {"output", required_argument, nullptr, 'o'}, {"num-copies", required_argument, nullptr, 'n'}, {"file-size", required_argument, nullptr, 's'}, {"no-header", no_argument, nullptr, 'x'}, {"decode", no_argument, nullptr, 'd'}, {"encode", no_argument, nullptr, 'e'}, {"help", no_argument, nullptr, 'h'}, {nullptr, no_argument, nullptr, 0}, }; constexpr const char kUsageFormatString[] = R""(Usage: %s -o <out-path> -i <in-path> -n <N> MTD Redundant Storage Tool. Options: --help, -h print this message, then exit --input, -i <in-path> the input file --num-copies, -n <N> the number of copies to be written to MTD (required if writing). --output, -o <out-path> the output file. Overrides -n and -i. --no-header, -x Writes the input file without the header this file cannot be read back by this tool --file-size, -s <N> Size of the file to be read from MTD (required if reading with -x set). --encode, -e Specifies that |input| should be encoded and redundantly written into |output|. --decode, -d Specifies that |input| should be decoded and written into |output|. Examples: Write three copies of foo.zip to /dev/mtd0 $ %s -i foo.zip -o /dev/mtd0 -n 3 Read the contents of /dev/mtd0 into foo.zip $ %s -o foo.zip -i /dev/mtd0 Write(encode) three copies of foo.zip to bar, a file on host $ %s -o bar -i foo.zip -e -n 3 Read(decode) the contents of bar into foo.zip $ %s -i bar -o foo.zip -d Notes: The user should have read/write permissions for any MTD devices used. If <out-path> specifies an MTD, then the file that <in-path> points to will be written to <out-path> with at most <N> minus one backup copies. If <in-path> specifies an MTD, then the file that <out-path> points to will be either created or truncated, and then read into from the MTD. If no file can be found, then <out-path> remains unchanged. <N> is ignored in this setup. If both <out-path> and <in-path> are an MTD, this is an error. Full input/output interactions are listed in the table below. -i is a | -o is a | -e/-d flags | Action ------------------------------------------------------------ MTD | MTD | <any> | Unsupported | | | File | MTD | <none> | input file encoded & written to MTD File | MTD | -e | input file encoded & written to MTD File | MTD | -d | Unsupported | | | MTD | File | <none> | MTD decoded & written to file MTD | File | -e | Unsupported MTD | File | -d | MTD decoded & written to file | | | File | File | -d | input is decoded & written to output File | File | -e | input is encoded & written to output File | File | <none> | Unsupported | | | <any> | <any> | -e -d | Unsupported )""; struct MtdRsToolFlags { const char* input = nullptr; const char* output = nullptr; uint32_t num_copies = 0; bool no_header = false; size_t file_size = 0; bool decode = false; bool encode = false; bool help = false; }; void Usage(const char* prog_name) { fprintf(stdout, kUsageFormatString, prog_name, prog_name, prog_name, prog_name, prog_name); } bool IsMtd(const char* path) { auto mtd = mtd::MtdInterface::Create(path); if (!mtd) { // Logs any informative errors. An error where the path doesn't // lead to a valid MTD is an uninformative error as this is expected // behavior for either the input or the output device. if (errno == EACCES) { fprintf(stderr, "Unable to open %s: %s\n", path, strerror(errno)); } return false; } return true; } std::optional<MtdRsToolFlags> ParseFlags(int argc, char** argv) { MtdRsToolFlags flags; int opt; while ((opt = getopt_long(argc, argv, kOptString, kLongOpts, nullptr)) != -1) { switch (opt) { case 'i': flags.input = optarg; continue; case 'n': { auto optarg_end = optarg + strlen(optarg); uint64_t num_copies_long = strtoul(optarg, &optarg_end, 10); if (errno == EINVAL || num_copies_long == 0) { fprintf(stderr, "-n value is invalid\n"); return std::nullopt; } flags.num_copies = static_cast<uint32_t>(num_copies_long); if (static_cast<uint64_t>(flags.num_copies) != num_copies_long) { fprintf(stderr, "Overflow on -n argument. Supply 32-bit int.\n"); return std::nullopt; } continue; } case 'o': flags.output = optarg; continue; case 'x': flags.no_header = true; continue; case 's': { auto optarg_end = optarg + strlen(optarg); flags.file_size = strtoul(optarg, &optarg_end, 10); if (errno == EINVAL || flags.file_size == 0) { fprintf(stderr, "-s value is invalid\n"); return std::nullopt; } continue; } case 'e': flags.encode = true; continue; case 'd': flags.decode = true; continue; case 'h': default: if (opt != 'h') { return std::nullopt; } flags.help = true; } } return flags; } std::unique_ptr<nand_rs::NandRedundantStorageInterface> FileInterface(const char* filename) { fbl::unique_fd fd(open(filename, O_RDWR | O_CREAT, kFilePermissions)); if (!fd) { fprintf(stderr, "Unable to open file %s: %s\n", filename, strerror(errno)); return nullptr; } auto interface = std::make_unique<nand_rs::FileNandRedundantStorage>( std::move(fd), kFileBlockSize, kFilePageSize); if (!interface) { fprintf(stderr, "Unable to open file backed MTD interface %s: %s\n", filename, strerror(errno)); return nullptr; } return interface; } std::unique_ptr<nand_rs::NandRedundantStorageInterface> MtdInterface(const char* mtd) { auto interface = nand_rs::NandRedundantStorage::Create(mtd::MtdInterface::Create(mtd)); if (!interface) { fprintf(stderr, "Unable to open MTD interface %s: %s\n", mtd, strerror(errno)); return nullptr; } return interface; } int Read(std::unique_ptr<nand_rs::NandRedundantStorageInterface> interface, const char* interface_path, const char* output, bool skip_header, size_t file_size) { std::vector<uint8_t> buffer; if (interface->ReadToBuffer(&buffer, skip_header, file_size) != ZX_OK) { return 1; } fbl::unique_fd output_fd(open(output, O_CREAT | O_TRUNC | O_RDWR, kFilePermissions)); if (!output_fd) { fprintf(stderr, "Unable to open file %s: %s\n", output, strerror(errno)); return 1; } ssize_t written = write(output_fd.get(), buffer.data(), buffer.size()); if (written < 0) { fprintf(stderr, "Unable to write to file %s: %s\n", output, strerror(errno)); return 1; } if (static_cast<uint64_t>(written) != buffer.size()) { fprintf(stderr, "Unable to complete write to file %s: %s: expected %zd actual %zd\n", output, strerror(errno), static_cast<uint64_t>(written), buffer.size()); return 1; } fprintf(stdout, "SUCCESS: File read from %s into %s\n", interface_path, output); return 0; } int Write(std::unique_ptr<nand_rs::NandRedundantStorageInterface> interface, const char* interface_path, const char* input, uint32_t num_copies, bool skip_header) { fbl::unique_fd input_fd(open(input, O_RDONLY)); if (!input_fd) { fprintf(stderr, "Unable to open input file %s: %s\n", input, strerror(errno)); return 1; } ssize_t input_file_size = lseek(input_fd.get(), 0L, SEEK_END); std::vector<uint8_t> file_buffer(input_file_size); ssize_t ret = pread(input_fd.get(), file_buffer.data(), input_file_size, 0L); if (ret != input_file_size) { fprintf(stderr, "Unable to read file to buffer %s: %s\n", input, strerror(errno)); return 1; } uint32_t num_copies_written; zx_status_t status = interface->WriteBuffer(file_buffer, num_copies, &num_copies_written, skip_header); if (status == ZX_OK) { fprintf(stdout, "SUCCESS: Wrote %d copies of %s to %s\n", num_copies_written, input, interface_path); } return status; } int main(int argc, char** argv) { auto flags = ParseFlags(argc, argv); if (!flags) { return 1; } if (flags->help) { Usage(argv[0]); return 0; } if (flags->output == nullptr || flags->input == nullptr) { fprintf(stderr, "ERROR: -i or -o not set.\n"); return 1; } if (strcmp(flags->input, flags->output) == 0) { fprintf(stderr, "ERROR: -i and -o file are the same.\n"); return 1; } if (flags->encode && flags->decode) { fprintf(stderr, "ERROR: -d and -e are both set.\n"); return 1; } bool input_is_mtd = IsMtd(flags->input); bool output_is_mtd = IsMtd(flags->output); if (input_is_mtd && output_is_mtd) { fprintf(stderr, "ERROR: -i and -o are both MTD's.\n"); return 1; } if (input_is_mtd) { if (flags->encode) { fprintf(stderr, "ERROR: Unable to encode when outputting to a file.\n"); return 1; } if (flags->no_header && flags->file_size == 0) { fprintf(stderr, "ERROR: -s required to read from an MTD without a header.\n"); return 1; } auto interface = MtdInterface(flags->input); if (!interface) { return 1; } return Read(std::move(interface), flags->input, flags->output, flags->no_header, flags->file_size); } if (output_is_mtd) { if (flags->decode) { fprintf(stderr, "ERROR: Unable to decode when outputing to an MTD.\n"); return 1; } if (flags->num_copies <= 0) { fprintf(stderr, "ERROR: -n missing.\n"); return 1; } auto interface = MtdInterface(flags->output); if (!interface) { return 1; } return Write(std::move(interface), flags->output, flags->input, flags->num_copies, flags->no_header); } if (!flags->encode && !flags->decode) { fprintf(stderr, "ERROR: Cannot determine action because both -i and -o are files." " Please set either -d or -e"); return 1; } if (flags->decode) { auto interface = FileInterface(flags->input); if (!interface) { return 1; } return Read(std::move(interface), flags->input, flags->output, flags->no_header, flags->file_size); } if (flags->encode) { if (flags->num_copies <= 0) { fprintf(stderr, "ERROR: -n missing.\n"); return 1; } auto interface = FileInterface(flags->output); if (!interface) { return 1; } return Write(std::move(interface), flags->output, flags->input, flags->num_copies, flags->no_header); } Usage(argv[0]); return 1; }
32.093583
100
0.602266
[ "vector" ]
d175b3d187b76f8cc546fcb1b7fc5cab88e40210
12,585
cpp
C++
CaptureManagerSource/VideoSurfaceCopierManager/DirectX11ConvertorTransform.cpp
luoyingwen/CaptureManagerSDK
e96395a120175a45c56ff4e2b3283b807a42fd75
[ "MIT" ]
64
2020-07-20T09:35:16.000Z
2022-03-27T19:13:08.000Z
CaptureManagerSource/VideoSurfaceCopierManager/DirectX11ConvertorTransform.cpp
luoyingwen/CaptureManagerSDK
e96395a120175a45c56ff4e2b3283b807a42fd75
[ "MIT" ]
8
2020-07-30T09:20:28.000Z
2022-03-03T22:37:10.000Z
CaptureManagerSource/VideoSurfaceCopierManager/DirectX11ConvertorTransform.cpp
luoyingwen/CaptureManagerSDK
e96395a120175a45c56ff4e2b3283b807a42fd75
[ "MIT" ]
28
2020-07-20T13:02:42.000Z
2022-03-18T07:36:05.000Z
/* MIT License Copyright(c) 2020 Evgeny Pereguda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "DirectX11ConvertorTransform.h" #include "../MediaFoundationManager/MediaFoundationManager.h" #include "../Common/Common.h" #include "../Common/GUIDs.h" #include "../LogPrintOut/LogPrintOut.h" #include <thread> namespace CaptureManager { namespace Transform { namespace VideoSampleAllocator { using namespace Core; DirectX11ConvertorTransform::DirectX11ConvertorTransform(): mIsReady(false) {} DirectX11ConvertorTransform::~DirectX11ConvertorTransform() {} // IMFTransform implementation STDMETHODIMP DirectX11ConvertorTransform::GetStreamLimits( DWORD* aPtrInputMinimum, DWORD* aPtrInputMaximum, DWORD* aPtrOutputMinimum, DWORD* aPtrOutputMaximum) { HRESULT lresult; do { LOG_CHECK_STATE_DESCR(aPtrInputMinimum == NULL || aPtrInputMaximum == NULL || aPtrOutputMinimum == NULL || aPtrOutputMaximum == NULL, E_POINTER); *aPtrInputMinimum = 1; *aPtrInputMaximum = 1; *aPtrOutputMinimum = 1; *aPtrOutputMaximum = 1; lresult = S_OK; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetStreamIDs( DWORD aInputIDArraySize, DWORD* aPtrInputIDs, DWORD aOutputIDArraySize, DWORD* aPtrOutputIDs) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::GetStreamCount( DWORD* aPtrInputStreams, DWORD* aPtrOutputStreams) { HRESULT lresult; do { LOG_CHECK_STATE_DESCR(aPtrInputStreams == NULL || aPtrOutputStreams == NULL, E_POINTER); *aPtrInputStreams = 1; *aPtrOutputStreams = 1; lresult = S_OK; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetInputStreamInfo( DWORD aInputStreamID, MFT_INPUT_STREAM_INFO* aPtrStreamInfo) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrStreamInfo); LOG_CHECK_STATE_DESCR(aInputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); aPtrStreamInfo->dwFlags = MFT_INPUT_STREAM_WHOLE_SAMPLES | MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER; aPtrStreamInfo->cbMaxLookahead = 0; aPtrStreamInfo->cbAlignment = 0; aPtrStreamInfo->hnsMaxLatency = 0; aPtrStreamInfo->cbSize = 0; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetOutputStreamInfo( DWORD aOutputStreamID, MFT_OUTPUT_STREAM_INFO* aPtrStreamInfo) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrStreamInfo); LOG_CHECK_STATE_DESCR(aOutputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); aPtrStreamInfo->dwFlags = MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE | MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; aPtrStreamInfo->cbAlignment = 0; aPtrStreamInfo->cbSize = 0; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetInputStreamAttributes( DWORD aInputStreamID, IMFAttributes** aPtrPtrAttributes) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::GetOutputStreamAttributes( DWORD aOutputStreamID, IMFAttributes** aPtrPtrAttributes) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::DeleteInputStream( DWORD aStreamID) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::AddInputStreams( DWORD aStreams, DWORD* aPtrStreamIDs) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::GetInputAvailableType( DWORD aInputStreamID, DWORD aTypeIndex, IMFMediaType** aPtrPtrType) { HRESULT lresult = S_OK; CComPtrCustom<IMFMediaType> lMediaType; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrPtrType); LOG_CHECK_STATE_DESCR(aInputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); if (aTypeIndex == 0) { LOG_INVOKE_QUERY_INTERFACE_METHOD(mInputMediaType, aPtrPtrType); } else { lresult = MF_E_NO_MORE_TYPES; } } while (false); if (FAILED(MF_E_INVALIDSTREAMNUMBER) && aPtrPtrType != NULL) { *aPtrPtrType = NULL; } return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetOutputAvailableType( DWORD aOutputStreamID, DWORD aTypeIndex, IMFMediaType** aPtrPtrType) { HRESULT lresult = S_OK; CComPtrCustom<IMFMediaType> lMediaType; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrPtrType); LOG_CHECK_STATE_DESCR(aOutputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); LOG_INVOKE_QUERY_INTERFACE_METHOD(mOutputMediaType, aPtrPtrType); lresult = MF_E_NO_MORE_TYPES; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::SetInputType( DWORD aInputStreamID, IMFMediaType* aPtrType, DWORD aFlags) { HRESULT lresult = S_OK; do { LOG_CHECK_STATE_DESCR(aPtrType == nullptr, MF_E_INVALIDMEDIATYPE); std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_STATE_DESCR(aInputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); if (aFlags != MFT_SET_TYPE_TEST_ONLY) { mInputMediaType = aPtrType; CComPtrCustom<IMFDXGIDeviceManager> lInputStreamDeviceManager; do { LOG_INVOKE_MF_METHOD(GetUnknown, aPtrType, CM_DeviceManager, IID_PPV_ARGS(&lInputStreamDeviceManager)); LOG_CHECK_PTR_MEMORY(lInputStreamDeviceManager); mInputStreamDeviceManager = lInputStreamDeviceManager; } while (false); lresult = S_OK; } } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::SetOutputType( DWORD aOutputStreamID, IMFMediaType* aPtrType, DWORD aFlags) { HRESULT lresult = S_OK; do { LOG_CHECK_STATE_DESCR(aPtrType == nullptr, MF_E_INVALIDMEDIATYPE); std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_STATE_DESCR(aOutputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); if (aFlags != MFT_SET_TYPE_TEST_ONLY) { mOutputMediaType = aPtrType; CComPtrCustom<IMFDXGIDeviceManager> lOutputStreamDeviceManager; do { LOG_INVOKE_MF_METHOD(GetUnknown, aPtrType, CM_DeviceManager, IID_PPV_ARGS(&lOutputStreamDeviceManager)); LOG_CHECK_PTR_MEMORY(lOutputStreamDeviceManager); mOutputStreamDeviceManager = lOutputStreamDeviceManager; } while (false); lresult = S_OK; } } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetInputCurrentType( DWORD aInputStreamID, IMFMediaType** aPtrPtrType) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrPtrType); LOG_CHECK_STATE_DESCR(aInputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); LOG_CHECK_STATE_DESCR(!mInputMediaType, MF_E_TRANSFORM_TYPE_NOT_SET); LOG_INVOKE_QUERY_INTERFACE_METHOD(mInputMediaType, aPtrPtrType); } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetOutputCurrentType( DWORD aOutputStreamID, IMFMediaType** aPtrPtrType) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrPtrType); LOG_CHECK_STATE_DESCR(aOutputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); LOG_CHECK_STATE_DESCR(!mOutputMediaType, MF_E_TRANSFORM_TYPE_NOT_SET); LOG_INVOKE_QUERY_INTERFACE_METHOD(mOutputMediaType, aPtrPtrType); } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetInputStatus( DWORD aInputStreamID, DWORD* aPtrFlags) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrFlags); LOG_CHECK_STATE_DESCR(aInputStreamID != 0, MF_E_INVALIDSTREAMNUMBER); if (!mConvertor) { *aPtrFlags = MFT_INPUT_STATUS_ACCEPT_DATA; } else { *aPtrFlags = 0; } } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::GetOutputStatus( DWORD* aPtrFlags) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::SetOutputBounds( LONGLONG aLowerBound, LONGLONG aUpperBound) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::ProcessEvent( DWORD aInputStreamID, IMFMediaEvent* aPtrEvent) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::GetAttributes( IMFAttributes** aPtrPtrAttributes) { return E_NOTIMPL; } STDMETHODIMP DirectX11ConvertorTransform::ProcessMessage( MFT_MESSAGE_TYPE aMessage, ULONG_PTR aParam) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); if (aMessage == MFT_MESSAGE_COMMAND_FLUSH) { mConvertor.Release(); } else if (aMessage == MFT_MESSAGE_COMMAND_DRAIN) { mConvertor.Release(); } else if (aMessage == MFT_MESSAGE_NOTIFY_BEGIN_STREAMING) { if (!mConvertor) SampleConvertor::createDirectX11Convertor( mInputStreamDeviceManager, mInputMediaType, mOutputStreamDeviceManager, mOutputMediaType, &mConvertor); } else if (aMessage == MFT_MESSAGE_NOTIFY_END_STREAMING) { } else if (aMessage == MFT_MESSAGE_NOTIFY_END_OF_STREAM) { } else if (aMessage == MFT_MESSAGE_NOTIFY_START_OF_STREAM) { } } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::ProcessInput( DWORD aInputStreamID, IMFSample* aPtrSample, DWORD aFlags) { HRESULT lresult = S_OK; do { std::lock_guard<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrSample); LOG_CHECK_STATE(aInputStreamID != 0 || aFlags != 0); LOG_CHECK_STATE_DESCR(!mInputMediaType, MF_E_NOTACCEPTING); LOG_CHECK_STATE_DESCR(mIsReady, MF_E_NOTACCEPTING); LOG_CHECK_STATE_DESCR(!mConvertor, MF_E_NOTACCEPTING); mSample.Release(); LOG_INVOKE_POINTER_METHOD(mConvertor, Convert, aPtrSample, &mSample); mIsReady = true; } while (false); return lresult; } STDMETHODIMP DirectX11ConvertorTransform::ProcessOutput( DWORD aFlags, DWORD aOutputBufferCount, MFT_OUTPUT_DATA_BUFFER* aPtrOutputSamples, DWORD* aPtrStatus) { HRESULT lresult = S_OK; do { std::unique_lock<std::mutex> lock(mMutex); LOG_CHECK_PTR_MEMORY(aPtrOutputSamples); LOG_CHECK_PTR_MEMORY(aPtrStatus); LOG_CHECK_STATE(aOutputBufferCount != 1 || aFlags != 0); if (!mIsReady) { lresult = MF_E_TRANSFORM_NEED_MORE_INPUT; break; } aPtrOutputSamples[0].pSample = mSample; mSample->AddRef(); aPtrOutputSamples[0].dwStatus = 0; *aPtrStatus = 0; mIsReady = false; } while (false); return lresult; } } } }
22.234982
93
0.684068
[ "transform" ]
d17912959945eed1de97dba50557c555367ebe69
6,449
cpp
C++
src/main.cpp
timout/CarND-MPC
a2f8980b921710562a7b376e3cdd450bf5780891
[ "MIT" ]
null
null
null
src/main.cpp
timout/CarND-MPC
a2f8980b921710562a7b376e3cdd450bf5780891
[ "MIT" ]
null
null
null
src/main.cpp
timout/CarND-MPC
a2f8980b921710562a7b376e3cdd450bf5780891
[ "MIT" ]
null
null
null
#include <math.h> #include <uWS/uWS.h> #include <chrono> #include <iostream> #include <thread> #include "MPC.h" #include "json.hpp" #include "helper.h" // for convenience using json = nlohmann::json; // Checks if the SocketIO event has JSON data. // If there is data the JSON object in string format will be returned, // else the empty string "" will be returned. inline std::string hasData(std::string s) { auto found_null = s.find("null"); auto b1 = s.find_first_of("["); auto b2 = s.rfind("}]"); if (found_null != std::string::npos) { return ""; } else if (b1 != std::string::npos && b2 != std::string::npos) { return s.substr(b1, b2 - b1 + 2); } return ""; } inline Eigen::VectorXd vec2eigen(std::vector<double> source) { return Eigen::Map<Eigen::VectorXd, Eigen::Unaligned>(source.data(), source.size()); } int main(int argc, char* argv[]) { uWS::Hub h; const int latency = 100; MPC mpc; h.onMessage([&](uWS::WebSocket<uWS::SERVER> ws, char *data, size_t length, uWS::OpCode opCode) { // "42" at the start of the message means there's a websocket message event. // The 4 signifies a websocket message // The 2 signifies a websocket event std::string sdata = std::string(data).substr(0, length); if (sdata.size() > 2 && sdata[0] == '4' && sdata[1] == '2') { std::string s = hasData(sdata); if (s != "") { auto j = json::parse(s); std::string event = j[0].get<std::string>(); if (event == "telemetry") { // j[1] is the data JSON object std::vector<double> ptsx = j[1]["ptsx"]; std::vector<double> ptsy = j[1]["ptsy"]; double px = j[1]["x"]; double py = j[1]["y"]; double psi = j[1]["psi"]; double v = j[1]["speed"]; double delta = j[1]["steering_angle"]; double a = j[1]["throttle"]; delta *= -1; // change of sign because turning left is negative sign in simulator but positive yaw // Convert points to vehicle's coordinate space convert_space(ptsx, ptsy, px, py, psi); // std::vector points vectors to Eigen::VectorXd of points vectors Eigen::VectorXd ptsx_e = vec2eigen(ptsx); Eigen::VectorXd ptsy_e = vec2eigen(ptsy); // Fit a polynomial. Eigen::VectorXd coeffs = polyfit(ptsx_e, ptsy_e, mpc.POLYNOMIAL_ORDER); // Because points were transformed to vehicle coordinates. psi = 0; // Calculates the cross track error // Because points were transformed to vehicle coordinates, x & y equal 0 below. double cte = polyeval(coeffs, 0); // Calculate the orientation error // Derivative of the polyfit goes in atan() // px = 0 in the vehicle coordinates, the higher orders are zero // Leaves only coeffs[1] double epsi = -atan(coeffs[1]); // Computing parameters for latency compensation.. double lt = latency / 1000; // Predict state after latency // x, y and psi are all zero after transformation above px = 0.0 + v * lt; // psi is zero, cos(0) = 1 py = 0.0; // sin(0) = 0, y + v * 0 * lt cte = cte + v * sin(epsi) * lt; epsi = epsi + v * delta * lt / mpc.Lf; psi = psi + v * delta * lt / mpc.Lf; v = v + a * lt; Eigen::VectorXd state(6); state << px, py, psi, v, cte, epsi; auto solution = mpc.Solve(state, coeffs); // Prepare JSON message for the simulator environment json msgJson; // New values for the actuators controls msgJson["steering_angle"] = solution->steering; msgJson["throttle"] = solution->accelerator; // points of minimum cost trajectory returned from the solver msgJson["mpc_x"] = solution->x; msgJson["mpc_y"] = solution->y; // Reference points in the vehicle's coordinate system msgJson["next_x"] = solution->next_x; msgJson["next_y"] = solution->next_y; auto msg = "42[\"steer\"," + msgJson.dump() + "]"; // std::cout << msg << std::endl; // Latency // The purpose is to mimic real driving conditions where // the car does actuate the commands instantly. // // Feel free to play around with this value but should be to drive // around the track with 100ms latency. // // NOTE: REMEMBER TO SET THIS TO 100 MILLISECONDS BEFORE // SUBMITTING. std::this_thread::sleep_for(std::chrono::milliseconds(latency)); ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT); } } else { // Manual driving std::string msg = "42[\"manual\",{}]"; ws.send(msg.data(), msg.length(), uWS::OpCode::TEXT); } } }); h.onConnection([&](uWS::WebSocket<uWS::SERVER> ws, uWS::HttpRequest req) { std::cout << "Connected!!!" << std::endl; }); h.onDisconnection([&](uWS::WebSocket<uWS::SERVER> ws, int code, char *message, size_t length) { ws.close(); std::cout << "Disconnected" << std::endl; }); int port = 4567; if (h.listen(port)) { std::cout << "Listening to port " << port << std::endl; } else { std::cerr << "Failed to listen to port" << std::endl; return -1; } h.run(); }
39.564417
119
0.479144
[ "object", "vector" ]
d18148a582872bcc421f84101eff2a8e67ea3237
12,019
cpp
C++
isis/src/system/apps/messckgen/main.cpp
kdl222/ISIS3
aab0e63088046690e6c031881825596c1c2cc380
[ "CC0-1.0" ]
134
2018-01-18T00:16:24.000Z
2022-03-24T03:53:33.000Z
isis/src/system/apps/messckgen/main.cpp
kdl222/ISIS3
aab0e63088046690e6c031881825596c1c2cc380
[ "CC0-1.0" ]
3,825
2017-12-11T21:27:34.000Z
2022-03-31T21:45:20.000Z
isis/src/system/apps/messckgen/main.cpp
jlaura/isis3
2c40e08caed09968ea01d5a767a676172ad20080
[ "CC0-1.0" ]
164
2017-11-30T21:15:44.000Z
2022-03-23T10:22:29.000Z
/** This is free and unencumbered software released into the public domain. The authors of ISIS do not claim copyright on the contents of this file. For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "Isis.h" #include <iostream> #include <sstream> #include <QString> #include <QFile> #include <QHash> #include <QList> #include <QSet> #include <QString> #include "FileName.h" #include "iTime.h" #include "Pvl.h" #include "PvlGroup.h" #include "PvlKeyword.h" #include "PvlObject.h" using namespace Isis; void updatePointing(PvlGroup &ckGroup, PvlObject &pivotPointing, PvlObject &atthistPointing); PvlGroup* insertGroup(PvlObject &object, PvlGroup &group, int index); void IsisMain() { UserInterface &ui = Application::GetUserInterface(); // Convert between integer representations of months to abbreviated QStrings, // as used in the TDB time format of the kernel date ranges QHash<int, QString> MONTH_TO_STRING; MONTH_TO_STRING[1] = "JAN"; MONTH_TO_STRING[2] = "FEB"; MONTH_TO_STRING[3] = "MAR"; MONTH_TO_STRING[4] = "APR"; MONTH_TO_STRING[5] = "MAY"; MONTH_TO_STRING[6] = "JUN"; MONTH_TO_STRING[7] = "JUL"; MONTH_TO_STRING[8] = "AUG"; MONTH_TO_STRING[9] = "SEP"; MONTH_TO_STRING[10] = "OCT"; MONTH_TO_STRING[11] = "NOV"; MONTH_TO_STRING[12] = "DEC"; // Fetch the pivot file FileName pivotFileName; if (ui.WasEntered("PIVOT")) { pivotFileName = ui.GetFileName("PIVOT"); } else { // If not provided, assume the latest pivot file in the data area QString pivotString("$messenger/kernels/ck/pivot_kernels.????.db"); pivotFileName = FileName(pivotString).highestVersion(); } Pvl pivot(pivotFileName.expanded()); // Fetch the atthist file FileName atthistFileName; if (ui.WasEntered("ATTHIST")) { atthistFileName = ui.GetFileName("ATTHIST"); } else { // If not provided, assume the latest atthist file in the data area QString atthistString("$messenger/kernels/ck/atthist_kernels.????.db"); atthistFileName = FileName(atthistString).highestVersion(); } Pvl atthist(atthistFileName.expanded()); // Open the input file from the GUI or find the latest version of the DB file FileName dbFileName; if (ui.WasEntered("FROM")) { dbFileName = ui.GetFileName("FROM"); } else { QString dbString("$messenger/kernels/ck/kernels.????.db"); dbFileName = FileName(dbString).highestVersion(); } Pvl kernelDb(dbFileName.expanded()); PvlObject &pointing = kernelDb.findObject("SpacecraftPointing"); PvlObject &pivotPointing = pivot.findObject("SpacecraftPointing"); PvlObject &atthistPointing = atthist.findObject("SpacecraftPointing"); PvlKeyword &runtime = pointing.findKeyword("Runtime"); runtime[0] = pivotPointing.findKeyword("Runtime")[0]; PvlKeyword &clock = pointing.findKeyword( "SpacecraftClockKernel", Pvl::Traverse); clock[0] = pivotPointing.findKeyword( "SpacecraftClockKernel", Pvl::Traverse)[0]; PvlKeyword &leapsecond = pointing.findKeyword( "LeapsecondKernel", Pvl::Traverse); leapsecond[0] = pivotPointing.findKeyword( "LeapsecondKernel", Pvl::Traverse)[0]; bool foundMapping = false; for (int i = 0; i < pointing.groups(); i++) { PvlGroup &ckGroup = pointing.group(i); if (ckGroup.isNamed("Selection")) { // We've already found the mapping section, so just update the pivot and // atthist files for all remaining selection groups if (foundMapping) updatePointing(ckGroup, pivotPointing, atthistPointing); // We're looking for the group with a comment that says MAPPING, // signifying the beginning of the section we wish to update for (int j = 0; j < ckGroup.comments(); j++) { QString comment = ckGroup.comment(j); if (comment.contains("MAPPING")) { foundMapping = true; updatePointing(ckGroup, pivotPointing, atthistPointing); PvlGroup &pivotSelection = pivotPointing.findGroup("Selection"); // Find end time, if it's a week past the current start date, or more, // then create a new selection group. Otherwise, add new kernel // entries to the existing group. QString pivotEndRaw; for (int k = pivotSelection.keywords() - 1; k >= 0; k--) { PvlKeyword &keyword = pivotSelection[k]; if (keyword.isNamed("Time")) { pivotEndRaw = keyword[1]; break; } } // Remove the trailing " TDB" as it confuses the time conversion QString newEnd = pivotEndRaw; pivotEndRaw.remove(QRegExp(" TDB$")); QString pivotEnd = pivotEndRaw; PvlKeyword &time = ckGroup.findKeyword("Time"); QString currentStartRaw = time[0]; currentStartRaw.remove(QRegExp(" TDB$")); QString currentStart = currentStartRaw; // Add 7 days (in units of seconds) to the current start time to // signify a week's time from the start time iTime weekFromStart(currentStart); weekFromStart += 7 * 24 * 3600 + 1; // See if a week has passed from the start time to the pivot end time iTime pivotEndTime(pivotEnd); time[1] = newEnd; PvlGroup *currentGroup = &ckGroup; // Add a second to adjust for midnight conversion iTime coveredTime(currentStart); coveredTime += 1; while (coveredTime <= pivotEndTime) { // Keep adding a new file for every day that doesn't have coverage // in the DB file, but is covered by the pivot and atthist files PvlObject::PvlKeywordIterator itr = currentGroup->begin(); itr++; // Until our covered time has exceeded a week past the current // group's start time, add new files to the current group while (coveredTime <= weekFromStart && coveredTime <= pivotEndTime) { // Construct the QString used to identify the day's BC file QString year = coveredTime.YearString(); QString month = coveredTime.MonthString(); if (month.size() < 2) month = "0" + month; QString day = coveredTime.DayString(); if (day.size() < 2) day = "0" + day; QString bcFileName = "$messenger/kernels/ck/"; bcFileName += "msgr" + year + month + day + ".bc"; // Check that the current day's BC file exists QString bcExpanded = FileName(bcFileName).expanded(); if (!QFile(bcExpanded).exists()) { QString msg = "The BC file [" + bcExpanded + "] does not exist"; throw IException(IException::User, msg, _FILEINFO_); } // If the current day's file isn't already present in the group, // then go ahead and add it if ((*itr)[0] != bcFileName) { PvlKeyword bcKeyword("File", bcFileName); itr = currentGroup->addKeyword(bcKeyword, itr); } itr++; // Move forward a day's time (in seconds) so we can do the same // for the next day coveredTime += 24 * 3600; } if (coveredTime <= pivotEndTime) { // Set the end of the previous range and the beginning of the new // range to a week past the previous beginning QString newEndTime = weekFromStart.YearString() + " "; newEndTime += MONTH_TO_STRING[weekFromStart.Month()] + " "; newEndTime += weekFromStart.DayString() + " "; newEndTime += "00:00:00.000 TDB"; // Add another week's time coveredTime = weekFromStart; weekFromStart += 7 * 24 * 3600; PvlKeyword &currentTime = currentGroup->findKeyword("Time"); currentTime[1] = newEndTime; PvlKeyword latestTime(currentTime); latestTime[0] = newEndTime; latestTime[1] = newEnd; PvlGroup *latestGroup = new PvlGroup("Selection"); latestGroup->addKeyword(latestTime); PvlKeyword atthistPlaceholder("File"); atthistPlaceholder += ""; PvlKeyword pivotPlaceholder("File"); pivotPlaceholder.addComment("Regular pivot angle CK"); pivotPlaceholder += ""; latestGroup->addKeyword(atthistPlaceholder); latestGroup->addKeyword(pivotPlaceholder); latestGroup->addKeyword(currentGroup->findKeyword("Type")); updatePointing(*latestGroup, pivotPointing, atthistPointing); currentGroup = insertGroup(pointing, *latestGroup, i); } } } } } } // Get the output filename, either user-specified or the latest version for // the kernels area (as run by makedb) FileName outDBfile; if (ui.WasEntered("TO")) { outDBfile = ui.GetFileName("TO"); } else { outDBfile = FileName("$messenger/kernels/ck/kernels.????.db").newVersion(); } // Write the updated PVL as the new CK DB file kernelDb.write(outDBfile.expanded()); } void updatePointing(PvlGroup &ckGroup, PvlObject &pivotPointing, PvlObject &atthistPointing) { bool foundPivot = false; for (int k = ckGroup.keywords() - 1; k >= 0; k--) { PvlKeyword &keyword = ckGroup[k]; if (keyword.isNamed("File")) { if (!foundPivot) { // Last file in the list is the pivot file PvlGroup &pivotSelection = pivotPointing.findGroup("Selection"); keyword[0] = pivotSelection.findKeyword("File")[0]; foundPivot = true; } else { // Atthist file comes just before the pivot file in the // MAPPING group PvlGroup &atthistSelection = atthistPointing.findGroup("Selection"); keyword[0] = atthistSelection.findKeyword("File")[0]; break; } } } } PvlGroup* insertGroup(PvlObject &object, PvlGroup &group, int index) { // Keep track of the comments signifying the beginning of the mapping section, // as it will need to be moved to the most recent date range QList<QString> mappingComments; // Add a copy of the last group to the end so we can begin shifting all our // mapping selection groups down object.addGroup(object.group(object.groups() - 1)); for (int i = object.groups() - 2; i > index; i--) { // Shift groups down until we reach the new beginning of the mapping section object.group(i) = object.group(i - 1); // See if we've found the mapping comments yet if (mappingComments.size() == 0) { // If not, let's get the comments from the current group and check them // against our criteria for the mapping comments PvlGroup &currentGroup = object.group(i); bool foundMapping = false; for (int j = 0; j < currentGroup.comments(); j++) { QString comment = currentGroup.comment(j); mappingComments.append(comment); if (comment.contains("MAPPING")) foundMapping = true; } if (mappingComments.size() > 0 && !foundMapping) { // Still haven't found the mapping comments, so clear away whatever // comments we did find mappingComments.clear(); } else { // We found the mapping comments, so now that we've extracted them we // can remove them from the former latest selection group currentGroup.nameKeyword().clearComment(); } } } // Add the new group object.group(index) = group; // Add all the mapping comments PvlGroup &currentGroup = object.group(index); for (int i = 0; i < mappingComments.size(); i++) currentGroup.addComment(mappingComments[i]); // Return the location of the new group return &currentGroup; }
35.98503
81
0.628671
[ "object" ]
d1906ef592ff7ac5e7a245e656a00c9b36871495
4,385
cpp
C++
willow/src/op/globalaveragepool.cpp
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
61
2020-07-06T17:11:46.000Z
2022-03-12T14:42:51.000Z
willow/src/op/globalaveragepool.cpp
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
1
2021-02-25T01:30:29.000Z
2021-11-09T11:13:14.000Z
willow/src/op/globalaveragepool.cpp
gglin001/popart
3225214343f6d98550b6620e809a3544e8bcbfc6
[ "MIT" ]
6
2020-07-15T12:33:13.000Z
2021-11-07T06:55:00.000Z
// Copyright (c) 2019 Graphcore Ltd. All rights reserved. #include <memory> #include <popart/error.hpp> #include <popart/op/globalaveragepool.hpp> #include <popart/opmanager.hpp> #include <popart/opserialiser.hpp> #include <popart/tensor.hpp> namespace popart { GlobalAveragePoolOp::GlobalAveragePoolOp(const OperatorIdentifier &_opid, const Op::Settings &settings_) : Op(_opid, settings_) {} void GlobalAveragePoolOp::setup() { // If the input is N x C x D1 x D2 then the output shape N x C x 1 x 1 // If the input is N x C x D1 ... Dn then the output shape N x C x 1 x ... x 1 auto gap = inShape(getInIndex()); std::fill(gap.begin() + 2, gap.end(), 1); outInfo(getOutIndex()) = {inInfo(getInIndex()).dataType(), gap}; kernel = Shape(inShape(getInIndex()).begin() + 2, inShape(getInIndex()).end()); } void GlobalAveragePoolOp::appendOutlineAttributes(OpSerialiserBase &os) const { Op::appendOutlineAttributes(os); os.appendAttribute("kernel", kernel); } Shape GlobalAveragePoolOp::getStrides() const { Shape strides(kernel.size()); std::fill(strides.begin(), strides.end(), 1); return strides; } Shape GlobalAveragePoolOp::getLowerPads() const { Shape lowerPads(kernel.size()); std::fill(lowerPads.begin(), lowerPads.end(), 0); return lowerPads; } Shape GlobalAveragePoolOp::getUpperPads() const { Shape lowerPads(kernel.size()); std::fill(lowerPads.begin(), lowerPads.end(), 0); return lowerPads; } std::unique_ptr<Op> GlobalAveragePoolOp::clone() const { return std::make_unique<GlobalAveragePoolOp>(*this); } std::vector<std::unique_ptr<Op>> GlobalAveragePoolOp::getGradOps() { std::vector<std::unique_ptr<Op>> upops; upops.emplace_back(std::make_unique<GlobalAveragePoolGradOp>(*this)); return upops; } GlobalAveragePoolGradOp::GlobalAveragePoolGradOp(const GlobalAveragePoolOp &op_) : Op(Onnx::GradOperators::GlobalAveragePoolGrad, op_.getSettings()), unpooledInfo(op_.inInfo(GlobalAveragePoolOp::getInIndex())), creatorSpatialK(op_.getSpatialK()), creatorStrides(op_.getStrides()), creatorLowerPads(op_.getLowerPads()), creatorUpperPads(op_.getUpperPads()) {} void GlobalAveragePoolGradOp::appendOutlineAttributes( OpSerialiserBase &os) const { Op::appendOutlineAttributes(os); os.appendAttribute("creatorSpatialK", creatorSpatialK); os.appendAttribute("creatorStrides", creatorStrides); os.appendAttribute("creatorLowerPads", creatorLowerPads); os.appendAttribute("creatorUpperPads", creatorUpperPads); } const std::vector<GradInOutMapper> & GlobalAveragePoolGradOp::gradInputInfo() const { // the input to the grad-op at index getGradPooledIn() // is the gradient of the output of the average pool // at index 0. // the input to the grad-op at index getPooledIn() // is the output of the average pool at index 0 // etc for getPrePooledIn() static const std::vector<GradInOutMapper> inInfo = { {getGradPooledInIndex(), GlobalAveragePoolOp::getOutIndex(), GradOpInType::GradOut}, {getPooledInIndex(), GlobalAveragePoolOp::getOutIndex(), GradOpInType::Out}, {getPrePooledInIndex(), GlobalAveragePoolOp::getInIndex(), GradOpInType::In}}; return inInfo; } // The input to the average pool (PrePooled) is // the input to the grad op at index 0. const std::map<int, int> &GlobalAveragePoolGradOp::gradOutToNonGradIn() const { // the grad-op output at index 0 corresponds // to the non-grad-op's input at index 0 static const std::map<int, int> outInfo = { {getOutIndex(), GlobalAveragePoolOp::getInIndex()}}; return outInfo; } void GlobalAveragePoolGradOp::setup() { outInfo(getOutIndex()) = unpooledInfo; } std::unique_ptr<Op> GlobalAveragePoolGradOp::clone() const { return std::make_unique<GlobalAveragePoolGradOp>(*this); } namespace { static OpDefinition::DataTypes T = {DataType::FLOAT16, DataType::FLOAT}; static OpDefinition globalAveragePoolOpDef({OpDefinition::Inputs({{"X", T}}), OpDefinition::Outputs({{"Y", T}}), OpDefinition::Attributes({})}); static OpCreator<GlobalAveragePoolOp> globalAveragePoolOpCreator(OpDefinitions( {{Onnx::Operators::GlobalAveragePool_1, globalAveragePoolOpDef}})); } // namespace } // namespace popart
35.08
80
0.706043
[ "shape", "vector" ]
d19333ce3bc5f9453c3ca54ef24d17ee6105c443
1,881
cpp
C++
scsdk/c++/scsdk_test/standard_cyborg/algorithms/SparseICPTests.cpp
StandardCyborg/scsdk
92f80bf2a580ebaafa6b0d1052d90d5c8f6682f7
[ "Apache-2.0" ]
7
2020-11-26T01:07:26.000Z
2021-12-14T07:45:19.000Z
scsdk/c++/scsdk_test/standard_cyborg/algorithms/SparseICPTests.cpp
StandardCyborg/scsdk
92f80bf2a580ebaafa6b0d1052d90d5c8f6682f7
[ "Apache-2.0" ]
null
null
null
scsdk/c++/scsdk_test/standard_cyborg/algorithms/SparseICPTests.cpp
StandardCyborg/scsdk
92f80bf2a580ebaafa6b0d1052d90d5c8f6682f7
[ "Apache-2.0" ]
null
null
null
/* Copyright 2020 Standard Cyborg 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 <gtest/gtest.h> #include "standard_cyborg/algorithms/SparseICPWrapper.hpp" #include "standard_cyborg/sc3d/Geometry.hpp" #include "standard_cyborg/math/Mat3x4.hpp" #include "standard_cyborg/math/Vec3.hpp" using standard_cyborg::math::Mat3x4; using standard_cyborg::math::Vec3; using standard_cyborg::sc3d::Geometry; TEST(SparseICP, testSparseICP) { std::vector<Vec3> positions0 { {1.0f, 1.0f, 0.0f}, {4.0f, 0.0f, 0.0f}, {1.0f, 4.0f, 0.0f}, }; std::vector<Vec3> normals { {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 1.0f}, }; std::vector<Vec3> positions1 { {1.0f, 1.0f, 0.01f}, {4.0f, 0.0f, 0.01f}, {1.0f, 4.0f, 0.01f}, }; Geometry geo0 (positions0, normals); Geometry geo1 (positions1, normals); standard_cyborg::algorithms::SparseICPParameters pars; pars.p = 0.2; pars.max_icp = 15; pars.stop = 2e-3; // 2e-3 pars.max_outer = 100; // 50 pars.max_inner = 1; pars.print_icpn = true; Mat3x4 m = standard_cyborg::algorithms::SparseICPPointToPlane(geo0, geo1, pars); EXPECT_TRUE(Mat3x4::almostEqual(m, Mat3x4({ 1, 0, 0, +0.0, 0, 1, 0, +0.0, 0, 0, 1, +0.01 }), 1.0e-6, 1.0e-6)); }
26.125
84
0.636364
[ "geometry", "vector" ]
d198935e0122f8d30b1567b776782557ea49777d
1,255
cpp
C++
PT07Z.cpp
shikhar8434/OJ-problems
7e787b41fd8b6342f73ee59066e2a324608c511d
[ "MIT" ]
2
2020-10-13T12:37:15.000Z
2020-10-28T14:29:15.000Z
PT07Z.cpp
shikhar8434/OJ-problems
7e787b41fd8b6342f73ee59066e2a324608c511d
[ "MIT" ]
null
null
null
PT07Z.cpp
shikhar8434/OJ-problems
7e787b41fd8b6342f73ee59066e2a324608c511d
[ "MIT" ]
null
null
null
// Problem: Longest path in a tree // Contest: SPOJ - Classical // URL: https://www.spoj.com/problems/PT07Z/ // Memory Limit: 1536 MB // Time Limit: 500 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #define F first #define S second #define PB push_back #define MP make_pair #define ll long long int #define vi vector<int> #define vii vector<int, int> #define vc vector<char> #define vl vector<ll> #define mod 1000000007 #define INF 1000000009 using namespace std; int maxD, maxNode; vi adj[10005]; bool vis[10005]; void dfs(int node, int len) { vis[node] = 1; if(len > maxD) { maxD = len; maxNode = node; } for(int child : adj[node]) { if(!vis[child]) { dfs(child, len+1); } } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; int m = n-1; int a, b; for(int i = 1; i <= m; i++) { cin >> a >> b; adj[a].PB(b); adj[b].PB(a); } dfs(1, 0); maxD = -1; for(int i = 1; i <= n; i++) { vis[i] = 0; } dfs(maxNode, 0); cout << maxD << "\n"; return 0; }
17.676056
63
0.521116
[ "vector" ]
d19e75ea67eedf9c4329d44184d032d902ede6eb
19,573
cpp
C++
src/io/ply.cpp
ak-1/glslViewer
46a69dc946e3327f00a5e7650a7bd35aca7098ed
[ "BSD-3-Clause" ]
1
2021-09-05T21:07:44.000Z
2021-09-05T21:07:44.000Z
src/io/ply.cpp
ak-1/glslViewer
46a69dc946e3327f00a5e7650a7bd35aca7098ed
[ "BSD-3-Clause" ]
null
null
null
src/io/ply.cpp
ak-1/glslViewer
46a69dc946e3327f00a5e7650a7bd35aca7098ed
[ "BSD-3-Clause" ]
null
null
null
#include "ply.h" #include <iostream> #include <fstream> #include <string> #define TINYPLY_IMPLEMENTATION #include "tinyply/tinyply.h" #include "../tools/geom.h" #include "../tools/text.h" bool loadPLY(Uniforms& _uniforms, WatchFileList& _files, Materials& _materials, Models& _models, int _index, bool _verbose) { std::string filename = _files[_index].path; std::string name = filename.substr(0, filename.size()-4); Material default_material; std::vector<glm::vec4> mesh_colors; std::vector<glm::vec3> mesh_vertices; std::vector<glm::vec3> mesh_normals; std::vector<glm::vec2> mesh_texcoords; std::vector<INDEX_TYPE> face_indices; std::vector<INDEX_TYPE> edge_indices; std::unique_ptr<std::istream> file_stream; try { file_stream.reset(new std::ifstream(filename, std::ios::binary)); if (!file_stream || file_stream->fail()) throw std::runtime_error("file_stream failed to open " + filename); std::vector<std::string> colors_names, texcoords_names, faces_name, edges_name; tinyply::PlyFile file; file.parse_header(*file_stream); // std::cout << "\t[ply_header] Type: " << (file.is_binary_file() ? "binary" : "ascii") << std::endl; // for (const auto & c : file.get_comments()) std::cout << "\t[ply_header] Comment: " << c << std::endl; // for (const auto & c : file.get_info()) std::cout << "\t[ply_header] Info: " << c << std::endl; std::vector<std::string> comments = file.get_comments(); for (size_t i = 0; i < comments.size(); i++) { // std::vector<std::string> parts = split(comments[i], ' ', true); // if (parts[0] == "TextureFile") { // Material mat("default"); // mat.set("diffuse", parts[1]); // _mesh.addMaterial(mat); // } } for (const auto & e : file.get_elements()) { for (const auto & p : e.properties) { // std::cout << "\t[ply_header] \tproperty: " << p.name << " (type=" << tinyply::PropertyTable[p.propertyType].str << ")"; // if (p.isList) std::cout << " (list_type=" << tinyply::PropertyTable[p.listType].str << ")"; // std::cout << std::endl; if (p.name == "red" || p.name == "green" || p.name == "blue" || p.name == "alpha" || p.name == "r" || p.name == "g" || p.name == "b" || p.name == "a") colors_names.push_back(p.name); else if ( p.name == "u" || p.name == "v" || p.name == "s" || p.name == "t" || p.name == "texture_u" || p.name == "texture_v") texcoords_names.push_back(p.name); else if (p.name == "vertex_indices" || p.name == "vertex_index") faces_name.push_back(p.name); else if (p.name == "vertex1" || p.name == "vertex2") edges_name.push_back(p.name); } } // Because most people have their own mesh types, tinyply treats parsed data as structured/typed byte buffers. // See examples below on how to marry your own application-specific data structures with this one. std::shared_ptr<PlyData> vertices, normals, colors, texcoords, faces, edges; // The header information can be used to programmatically extract properties on elements // known to exist in the header prior to reading the data. For brevity of this sample, properties // like vertex position are hard-coded: try { vertices = file.request_properties_from_element("vertex", { "x", "y", "z" }); } catch (const std::exception & e) { } try { normals = file.request_properties_from_element("vertex", { "nx", "ny", "nz" }); } catch (const std::exception & e) { } if (!colors_names.empty()) { try { colors = file.request_properties_from_element("vertex", colors_names); } catch (const std::exception & e) { } } if (!texcoords_names.empty()) { try { texcoords = file.request_properties_from_element("vertex", texcoords_names); } catch (const std::exception & ) { } } // Providing a list size hint (the last argument) is a 2x performance improvement. If you have // arbitrary ply files, it is best to leave this 0. if (faces_name.size() == 1) { try { faces = file.request_properties_from_element("face", faces_name, 3); } catch (const std::exception & e) { std::cerr << "tinyply exception: " << e.what() << std::endl; } } if (edges_name.size() > 0) { try { edges = file.request_properties_from_element("edge", edges_name, 2); } catch (const std::exception & e) { std::cerr << "tinyply exception: " << e.what() << std::endl; } } // // Tristrips must always be read with a 0 list size hint (unless you know exactly how many elements // // are specifically in the file, which is unlikely); // try { tripstrip = file.request_properties_from_element("tristrips", { "vertex_indices" }, 0); } // catch (const std::exception & e) { std::cerr << "tinyply exception: " << e.what() << std::endl; } file.read(*file_stream); if (vertices) { const size_t numVerticesBytes = vertices->buffer.size_bytes(); mesh_vertices.resize(vertices->count); std::memcpy(mesh_vertices.data(), vertices->buffer.get(), numVerticesBytes); if (colors) { size_t numChannels = colors_names.size(); size_t numColors = colors->count; float* fClr = (float *) colors->buffer.get(); uint8_t* bClr = (uint8_t *) colors->buffer.get(); for (size_t i = 0; i < numColors; i++) { if (colors->t == tinyply::Type::FLOAT32) { const float r = *fClr++; const float g = *fClr++; const float b = *fClr++; float a = 1.0f; if (numChannels == 4) a = *fClr++; mesh_colors.push_back( glm::vec4(r, g, b, a) ); } if (colors->t == tinyply::Type::UINT8) { const int r = *bClr++; const int g = *bClr++; const int b = *bClr++; int a = 255; if (numChannels == 4) a = *bClr++; mesh_colors.push_back( glm::vec4(r/255.0f, g/255.0f, b/255.0f, a/255.0f) ); } } } if (normals) { if (normals->t == tinyply::Type::FLOAT32) { const size_t numNormalsBytes = normals->buffer.size_bytes(); mesh_normals.resize(normals->count); std::memcpy(mesh_normals.data(), normals->buffer.get(), numNormalsBytes); } } if (texcoords) { if (texcoords->t == tinyply::Type::FLOAT32) { const size_t numTexcoordsBytes = texcoords->buffer.size_bytes(); mesh_texcoords.resize(texcoords->count); std::memcpy(mesh_texcoords.data(), texcoords->buffer.get(), numTexcoordsBytes); } } if (faces) { const INDEX_TYPE* array1D = reinterpret_cast<INDEX_TYPE*>(faces->buffer.get()); size_t n = faces->count * 3; face_indices.insert(face_indices.end(), array1D, array1D + n); } if (edges) { const INDEX_TYPE* array1D = reinterpret_cast<INDEX_TYPE*>(edges->buffer.get()); size_t n = faces->count * 2; edge_indices.insert(edge_indices.end(), array1D, array1D + n); } } } catch (const std::exception & e) { std::cerr << "Caught tinyply exception: " << e.what() << std::endl; } // return true; // Succed loading the PLY data // (proceed replacing the data on mesh) // _materials[default_material.name] = default_material; if (face_indices.size() > 0) { Mesh mesh; mesh.addColors(mesh_colors); mesh.addVertices(mesh_vertices); mesh.addTexCoords(mesh_texcoords); mesh.addIndices( face_indices ); if ( mesh_normals.size() > 0 ) mesh.addNormals( mesh_normals ); else mesh.computeNormals(); mesh.computeTangents(); _models.push_back( new Model(name, mesh, default_material) ); } if (edge_indices.size() > 0) { Mesh mesh; mesh.setDrawMode( GL_LINES ); mesh.addColors(mesh_colors); mesh.addVertices(mesh_vertices); mesh.addTexCoords(mesh_texcoords); if ( mesh_normals.size() > 0 ) mesh.addNormals( mesh_normals ); mesh.addIndices( edge_indices ); _models.push_back( new Model(name + "_edges", mesh, default_material) ); } if ( face_indices.size() == 0 && edge_indices.size() == 0) { Mesh mesh; mesh.setDrawMode( GL_POINTS ); mesh.addColors(mesh_colors); mesh.addVertices(mesh_vertices); mesh.addTexCoords(mesh_texcoords); mesh.addNormals( mesh_normals ); _models.push_back( new Model(name + "_points", mesh, default_material) ); } return false; } // bool loadPLY(Uniforms& _uniforms, WatchFileList& _files, Materials& _materials, Models& _models, int _index, bool _verbose) { // std::string filename = _files[_index].path; // std::fstream is(filename.c_str(), std::ios::in); // if (is.is_open()) { // Material default_material; // Mesh mesh; // std::string line; // std::string error; // int orderVertices=-1; // int orderIndices=-1; // int vertexCoordsFound=0; // int colorCompsFound=0; // int texCoordsFound=0; // int normalsCoordsFound=0; // int currentVertex = 0; // int currentFace = 0; // bool floatColor = false; // enum State{ // Header, // VertexDef, // FaceDef, // Vertices, // Normals, // Faces // }; // State state = Header; // int lineNum = 0; // std::string name; // std::vector<glm::vec4> colors; // std::vector<glm::vec3> vertices; // std::vector<glm::vec3> normals; // std::vector<glm::vec2> texcoord; // std::vector<INDEX_TYPE> indices; // std::getline(is,line); // lineNum++; // if (line!="ply") { // error = "wrong format, expecting 'ply'"; // goto clean; // } // std::getline(is,line); // lineNum++; // if (line!="format ascii 1.0") { // error = "wrong format, expecting 'format ascii 1.0'"; // goto clean; // } // while(std::getline(is,line)) { // lineNum++; // if (line.find("comment")==0) { // continue; // } // if ((state==Header || state==FaceDef) && line.find("element vertex")==0) { // state = VertexDef; // orderVertices = MAX(orderIndices, 0)+1; // vertices.resize(toInt(line.substr(15))); // continue; // } // if ((state==Header || state==VertexDef) && line.find("element face")==0) { // state = FaceDef; // orderIndices = MAX(orderVertices, 0)+1; // indices.resize(toInt(line.substr(13))*3); // continue; // } // if (state==VertexDef && (line.find("property float x")==0 || line.find("property float y")==0 || line.find("property float z")==0)) { // vertexCoordsFound++; // continue; // } // if (state==VertexDef && (line.find("property float nx")==0 || line.find("property float ny")==0 || line.find("property float nz")==0)) { // normalsCoordsFound++; // if (normalsCoordsFound==3) normals.resize(vertices.size()); // continue; // } // if (state==VertexDef && (line.find("property float r")==0 || line.find("property float g")==0 || line.find("property float b")==0 || line.find("property float a")==0)) { // colorCompsFound++; // colors.resize(vertices.size()); // floatColor = true; // continue; // } // else if (state==VertexDef && (line.find("property uchar red")==0 || line.find("property uchar green")==0 || line.find("property uchar blue")==0 || line.find("property uchar alpha")==0)) { // colorCompsFound++; // colors.resize(vertices.size()); // floatColor = false; // continue; // } // if (state==VertexDef && (line.find("property float u")==0 || line.find("property float v")==0)) { // texCoordsFound++; // texcoord.resize(vertices.size()); // continue; // } // else if (state==VertexDef && (line.find("property float texture_u")==0 || line.find("property float texture_v")==0)) { // texCoordsFound++; // texcoord.resize(vertices.size()); // continue; // } // if (state==FaceDef && line.find("property list")!=0 && line!="end_header") { // error = "wrong face definition"; // goto clean; // } // if (line=="end_header") { // if (colors.size() && colorCompsFound!=3 && colorCompsFound!=4) { // error = "data has color coordiantes but not correct number of components. Found " + toString(colorCompsFound) + " expecting 3 or 4"; // goto clean; // } // if (normals.size() && normalsCoordsFound!=3) { // error = "data has normal coordiantes but not correct number of components. Found " + toString(normalsCoordsFound) + " expecting 3"; // goto clean; // } // if (!vertices.size()) { // std::cout << "ERROR glMesh, load(): mesh loaded from \"" << filename << "\" has no vertices" << std::endl; // } // if (orderVertices==-1) orderVertices=9999; // if (orderIndices==-1) orderIndices=9999; // if (orderVertices < orderIndices) { // state = Vertices; // } // else { // state = Faces; // } // continue; // } // if (state==Vertices) { // std::stringstream sline; // sline.str(line); // glm::vec3 v; // sline >> v.x; // sline >> v.y; // if ( vertexCoordsFound > 2) sline >> v.z; // vertices[currentVertex] = v; // if (normalsCoordsFound > 0) { // glm::vec3 n; // sline >> n.x; // sline >> n.y; // sline >> n.z; // normals[currentVertex] = n; // } // if (colorCompsFound > 0) { // if (floatColor) { // glm::vec4 c; // sline >> c.r; // sline >> c.g; // sline >> c.b; // if (colorCompsFound > 3) sline >> c.a; // colors[currentVertex] = c; // } // else { // float r, g, b, a = 255; // sline >> r; // sline >> g; // sline >> b; // if (colorCompsFound > 3) sline >> a; // colors[currentVertex] = glm::vec4(r/255.0, g/255.0, b/255.0, a/255.0); // } // } // if (texCoordsFound>0) { // glm::vec2 uv; // sline >> uv.x; // sline >> uv.y; // texcoord[currentVertex] = uv; // } // currentVertex++; // if ((uint32_t)currentVertex==vertices.size()) { // if (orderVertices<orderIndices) { // state = Faces; // } // else{ // state = Vertices; // } // } // continue; // } // if (state==Faces && indices.size() > 0) { // std::stringstream sline; // sline.str(line); // int numV; // sline >> numV; // if (numV!=3) { // error = "face not a triangle"; // goto clean; // } // int i; // sline >> i; // indices[currentFace*3] = i; // sline >> i; // indices[currentFace*3+1] = i; // sline >> i; // indices[currentFace*3+2] = i; // currentFace++; // if ((uint32_t)currentFace==indices.size()/3) { // if (orderVertices<orderIndices) { // state = Vertices; // } // else { // state = Faces; // } // } // continue; // } // } // is.close(); // // Succed loading the PLY data // // (proceed replacing the data on mesh) // // // mesh.addColors(colors); // mesh.addVertices(vertices); // mesh.addTexCoords(texcoord); // if ( indices.size() > 0 ){ // mesh.addIndices( indices ); // } // else { // mesh.setDrawMode( GL_POINTS ); // } // if ( normals.size() > 0 ) { // mesh.addNormals( normals ); // } // else { // mesh.computeNormals(); // } // mesh.computeTangents(); // _materials[default_material.name] = default_material; // if (mesh.getDrawMode() == GL_POINTS) // name = "points"; // else if (mesh.getDrawMode() == GL_LINES) // name = "lines"; // else // name = "mesh"; // _models.push_back( new Model(name, mesh, default_material) ); // return true; // clean: // std::cout << "ERROR glMesh, load(): " << lineNum << ":" << error << std::endl; // std::cout << "ERROR glMesh, load(): \"" << line << "\"" << std::endl; // } // is.close(); // std::cout << "ERROR glMesh, can not load " << filename << std::endl; // return false; // }
38.079767
202
0.470853
[ "mesh", "vector", "model" ]
d19edf11930c7f549f13cbf1ab1227e5bc98f666
16,113
hpp
C++
include/nil/crypto3/zk/snark/schemes/ppzksnark/r1cs_gg_ppzksnark/ipp2/commitment.hpp
NoamDev/crypto3-zk
5f03e49b737994a3cecf673b029a4e32a2a8aaa5
[ "MIT" ]
null
null
null
include/nil/crypto3/zk/snark/schemes/ppzksnark/r1cs_gg_ppzksnark/ipp2/commitment.hpp
NoamDev/crypto3-zk
5f03e49b737994a3cecf673b029a4e32a2a8aaa5
[ "MIT" ]
null
null
null
include/nil/crypto3/zk/snark/schemes/ppzksnark/r1cs_gg_ppzksnark/ipp2/commitment.hpp
NoamDev/crypto3-zk
5f03e49b737994a3cecf673b029a4e32a2a8aaa5
[ "MIT" ]
null
null
null
//---------------------------------------------------------------------------// // Copyright (c) 2018-2020 Mikhail Komarov <nemo@nil.foundation> // Copyright (c) 2020 Nikita Kaskov <nbering@nil.foundation> // // MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. //---------------------------------------------------------------------------// // @file This module implements two binding commitment schemes used in the Groth16 // aggregation. // The first one is a commitment scheme that commits to a single vector $a$ of // length n in the second base group $G_1$ (for example): // * it requires a structured SRS $v_1$ of the form $(h,h^u,h^{u^2}, ... // ,g^{h^{n-1}})$ with $h \in G_2$ being a random generator of $G_2$ and $u$ a // random scalar (coming from a power of tau ceremony for example) // * it requires a second structured SRS $v_2$ of the form $(h,h^v,h^{v^2}, // ...$ with $v$ being a random scalar different than u (coming from another // power of tau ceremony for example) // The Commitment is a tuple $(\prod_{i=0}^{n-1} e(a_i,v_{1,i}), // \prod_{i=0}^{n-1} e(a_i,v_{2,i}))$ // // The second one takes two vectors $a \in G_1^n$ and $b \in G_2^n$ and commits // to them using a similar approach as above. It requires an additional SRS // though: // * $v_1$ and $v_2$ stay the same // * An additional tuple $w_1 = (g^{u^n},g^{u^{n+1}},...g^{u^{2n-1}})$ and $w_2 = // (g^{v^n},g^{v^{n+1},...,g^{v^{2n-1}})$ where $g$ is a random generator of // $G_1$ // The commitment scheme returns a tuple: // * $\prod_{i=0}^{n-1} e(a_i,v_{1,i})e(w_{1,i},b_i)$ // * $\prod_{i=0}^{n-1} e(a_i,v_{2,i})e(w_{2,i},b_i)$ // // The second commitment scheme enables to save some KZG verification in the // verifier of the Groth16 verification protocol since we pack two vectors in // one commitment. #ifndef CRYPTO3_R1CS_GG_PPZKSNARK_IPP2_COMMITMENT_HPP #define CRYPTO3_R1CS_GG_PPZKSNARK_IPP2_COMMITMENT_HPP #include <tuple> #include <vector> #include <boost/assert.hpp> #include <boost/iterator/zip_iterator.hpp> #include <nil/crypto3/algebra/type_traits.hpp> #include <nil/crypto3/algebra/algorithms/pair.hpp> namespace nil { namespace crypto3 { namespace zk { namespace snark { /// Both commitment outputs a pair of $F_q^k$ element. template<typename CurveType> using r1cs_gg_ppzksnark_ipp2_commitment_output = std::pair<typename CurveType::scalar_field_type::value_type, typename CurveType::scalar_field_type::value_type>; /// Key is a generic commitment key that is instanciated with g and h as basis, /// and a and b as powers. template<typename FieldType> struct r1cs_gg_ppzksnark_ipp2_commitment_key { typedef FieldType field_type; typedef typename field_type::value_type value_type; typedef typename std::vector<value_type>::const_iterator const_iterator; typedef typename std::vector<value_type>::iterator iterator; /// Exponent is a std::vector<value_type> a; /// Exponent is b std::vector<value_type> b; /// Returns true if commitment keys have the exact required length. /// It is necessary for the IPP scheme to work that commitment /// key have the exact same number of arguments as the number of proofs to /// aggregate. inline bool valid(std::size_t n) { return a.size() == n && n == b.size(); } /// Returns both vectors scaled by the given vector entrywise. /// In other words, it returns $\{v_i^{s_i}\}$ template<typename InputIterator> r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> scale(InputIterator sfirst, InputIterator slast) { BOOST_ASSERT(std::distance(sfirst, slast) == a.size() && std::distance(sfirst, slast) == b.size()); r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> result; const_iterator afirst = a.begin(), bfirst = b.begin(); while (sfirst != slast && afirst != a.end() && bfirst != b.end()) { result.a.emplace_back(afirst->to_projective() * sfirst->to_affine()); result.b.emplace_back(bfirst->to_projective() * sfirst->to_affine()); } return result; } /// Takes a left and right commitment key and returns a commitment /// key $left \circ right^{scale} = (left_i*right_i^{scale} ...)$. This is /// required step during GIPA recursion. r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> compress(const r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> &other, const typename FieldType::number_type &scale) { BOOST_ASSERT(a.size() == other.a.size() && other.valid()); r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> result; const_iterator afirst = a.begin(), bfirst = b.begin(); const_iterator oafirst = other.a.begin(), obfirst = other.b.begin(); while (afirst != a.end() && bfirst != b.end() && oafirst != other.a.begin() && obfirst != other.b.begin()) { auto ra = oafirst->to_projective() * scale; auto rb = obfirst->to_projective() * scale; ra.add_assign_mixed(*afirst); rb.add_assign_mixed(*bfirst); result.a.emplace_back(ra.to_affine()); result.b.emplace_back(rb.to_affine()); ++afirst; ++bfirst; ++oafirst; ++obfirst; } return result; } }; /*! * Returns both vectors scaled by the given vector entrywise. * In other words, it returns $\{v_i^{s_i}\}$ */ template<typename FieldType, typename InputIterator> r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> scale(const r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> &key, InputIterator first, InputIterator last) { BOOST_ASSERT(std::distance(first, last) == key.a.size() && std::distance(first, last) == key.b.size()); r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> result; std::for_each( boost::make_zip_iterator(std::make_tuple(first, key.a.begin(), key.b.begin())), boost::make_zip_iterator(std::make_tuple(last, key.a.end(), key.b.end())), [&](const std::tuple<const typename FieldType::value_type &, const typename FieldType::value_type &, const typename FieldType::value_type &> &t) { result.a.emplace_back(std::get<1>(t).to_projective() * std::get<0>(t).to_affine()); result.b.emplace_back(std::get<2>(t).to_projective() * std::get<0>(t).to_affine()); }); return result; } /// Takes a left and right commitment key and returns a commitment /// key $left \circ right^{scale} = (left_i*right_i^{scale} ...)$. This is /// required step during GIPA recursion. template<typename FieldType> r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> compress(const r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> &left, const r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> &right, const typename FieldType::number_type &scale) { BOOST_ASSERT(left.a.size() == right.a.size()); r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType> result; typename r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType>::const_iterator lafirst = left.a.begin(), lbfirst = left.b.begin(); typename r1cs_gg_ppzksnark_ipp2_commitment_key<FieldType>::const_iterator rafirst = right.a.begin(), rbfirst = right.b.begin(); std::for_each( boost::make_zip_iterator( std::make_tuple(left.a.begin(), left.b.begin(), right.a.begin(), right.b.begin())), boost::make_zip_iterator( std::make_tuple(left.a.end(), left.b.end(), right.a.end(), right.b.end())), [&](const std::tuple< const typename FieldType::value_type &, const typename FieldType::value_type &, const typename FieldType::value_type &, const typename FieldType::value_type &> &t) { auto ra = std::get<2>(t).to_projective() * scale; auto rb = std::get<3>(t).to_projective() * scale; ra += std::get<0>(t); rb += std::get<1>(t); result.a.emplace_back(ra.to_affine()); result.b.emplace_back(rb.to_affine()); }); return result; } /// Commitment key used by the "single" commitment on G1 values as /// well as in the "pair" commtitment. /// It contains $\{h^a^i\}_{i=1}^n$ and $\{h^b^i\}_{i=1}^n$ template<typename CurveType> using r1cs_gg_ppzksnark_ipp2_vkey = r1cs_gg_ppzksnark_ipp2_commitment_key<typename CurveType::g2_type>; /// Commitment key used by the "pair" commitment. Note the sequence of /// powers starts at $n$ already. /// It contains $\{g^{a^{n+i}}\}_{i=1}^n$ and $\{g^{b^{n+i}}\}_{i=1}^n$ template<typename CurveType> using r1cs_gg_ppzksnark_ipp2_wkey = r1cs_gg_ppzksnark_ipp2_commitment_key<typename CurveType::g1_type>; template<typename CurveType> struct r1cs_gg_ppzksnark_ipp2_commitment { typedef CurveType curve_type; typedef r1cs_gg_ppzksnark_ipp2_wkey<CurveType> wkey_type; typedef r1cs_gg_ppzksnark_ipp2_vkey<CurveType> vkey_type; typedef r1cs_gg_ppzksnark_ipp2_commitment_output<CurveType> output_type; /// Commits to a tuple of G1 vector and G2 vector in the following way: /// $T = \prod_{i=0}^n e(A_i, v_{1,i})e(B_i,w_{1,i})$ /// $U = \prod_{i=0}^n e(A_i, v_{2,i})e(B_i,w_{2,i})$ /// Output is $(T,U)$ template<typename InputG1Iterator, typename InputG2Iterator> static output_type pair(const vkey_type &vkey, const wkey_type &wkey, InputG1Iterator afirst, InputG1Iterator alast, InputG2Iterator bfirst, InputG2Iterator blast) { // (A * v) auto t1 = algebra::pair(afirst, alast, vkey.a); auto t2 = algebra::pair(wkey.a, bfirst, blast); // (B * v) auto u1 = algebra::pair(afirst, alast, vkey.b); auto u2 = algebra::pair(wkey.b, bfirst, blast); // (A * v)(w * B) return {t1 *= t2, u1 *= u2}; } /// Commits to a single vector of G1 elements in the following way: /// $T = \prod_{i=0}^n e(A_i, v_{1,i})$ /// $U = \prod_{i=0}^n e(A_i, v_{2,i})$ /// Output is $(T,U)$ template<typename InputG1Iterator> output_type pair(const vkey_type &vkey, InputG1Iterator afirst, InputG1Iterator alast) { return {algebra::pair(afirst, alast, vkey.a), algebra::pair(afirst, alast, vkey.b)}; } }; /// Commits to a tuple of G1 vector and G2 vector in the following way: /// $T = \prod_{i=0}^n e(A_i, v_{1,i})e(B_i,w_{1,i})$ /// $U = \prod_{i=0}^n e(A_i, v_{2,i})e(B_i,w_{2,i})$ /// Output is $(T,U)$ template<typename ProofSchemeCommitmentType, typename InputG1Iterator, typename InputG2Iterator> typename ProofSchemeCommitmentType::output_type pair(const typename ProofSchemeCommitmentType::vkey_type &vkey, const typename ProofSchemeCommitmentType::wkey_type &wkey, InputG1Iterator afirst, InputG1Iterator alast, InputG2Iterator bfirst, InputG2Iterator blast) { // (A * v) auto t1 = algebra::pair(afirst, alast, vkey.a); auto t2 = algebra::pair(wkey.a, bfirst, blast); // (B * v) auto u1 = algebra::pair(afirst, alast, vkey.b); auto u2 = algebra::pair(wkey.b, bfirst, blast); // (A * v)(w * B) return {t1 *= t2, u1 *= u2}; } /// Commits to a single vector of G1 elements in the following way: /// $T = \prod_{i=0}^n e(A_i, v_{1,i})$ /// $U = \prod_{i=0}^n e(A_i, v_{2,i})$ /// Output is $(T,U)$ template<typename ProofSchemeCommitmentType, typename InputG1Iterator> typename ProofSchemeCommitmentType::output_type pair(const typename ProofSchemeCommitmentType::vkey_type &vkey, InputG1Iterator afirst, InputG1Iterator alast) { return {algebra::pair(afirst, alast, vkey.a), algebra::pair(afirst, alast, vkey.b)}; } } // namespace snark } // namespace zk } // namespace crypto3 } // namespace nil #endif // CRYPTO3_R1CS_GG_PPZKSNARK_TYPES_POLICY_HPP
53.889632
120
0.528828
[ "vector" ]
d1a67c3132124cea23839a92390fe3c578986ea6
1,803
hpp
C++
json.hpp
acheeseye/ai-playing-checkers
fc02ef095fbcad8d730a25b156373cc6370d4f58
[ "MIT" ]
null
null
null
json.hpp
acheeseye/ai-playing-checkers
fc02ef095fbcad8d730a25b156373cc6370d4f58
[ "MIT" ]
12
2018-01-25T05:33:28.000Z
2018-04-04T04:37:52.000Z
json.hpp
acheeseye/ai-playing-checkers
fc02ef095fbcad8d730a25b156373cc6370d4f58
[ "MIT" ]
null
null
null
/*! @file */ #ifndef JSON_HPP #define JSON_HPP #include "jsoncpp/json.h" #include <string> #include <vector> //!Typedef'd in-case JSON library is ever changed. typedef Json::Value json_t; /**Converts a json_t to a std::string (same as the std::to_string function). \param json JSON object to convert. \return String representation of JSON object. */ std::string JSON_serialize(const json_t& json); /**Converts a std::string represented JSON object into a json_t (throws on bad JSON string). \param stringified String representation of JSON object. \return JSON object of the passed string. */ json_t JSON_parse(const std::string& stringified); /**Converts a json_t to a std::string (same as the std::string JSON_serialize function). \param json JSON object to convert. \return String representation of JSON object. */ std::string to_string(const json_t& json); /**Converts a JSON array object containing doubles or ints to a C++ vector of doubles (throws if json array contains values other than doubles or ints). \param json JSON object to convert. \return Vector of doubles. */ std::vector<double> to_double_array(const json_t& json); /**Converts a JSON array object containing unsigned ints to a C++ vector of size_t (throws if json array contains values other than ints >= 0). \param json JSON object to convert. \return Vector of size_t. */ std::vector<size_t> to_size_array(const json_t& json); /**Converts a JSON array object containing JSON array objects of doubles or ints to a C++ vector of vector of doubles (throws if json array contains values that contain values other than doubles or ints). \param json JSON object to convert. \return Vector of vector of doubles. */ std::vector<std::vector<double>> to_array_double_array(const json_t& json); #endif
36.06
204
0.750416
[ "object", "vector" ]
d1a72f3d9aca5260d4174904233dc7e2dd7c1e82
5,191
cpp
C++
src/IECore/ObjectVector.cpp
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
null
null
null
src/IECore/ObjectVector.cpp
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
null
null
null
src/IECore/ObjectVector.cpp
goddardl/cortex
323a160fd831569591cde1504f415a638f8b85bc
[ "BSD-3-Clause" ]
1
2020-09-26T01:15:37.000Z
2020-09-26T01:15:37.000Z
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of Image Engine Design nor the names of any // other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #include "IECore/ObjectVector.h" #include "IECore/MurmurHash.h" #include "boost/lexical_cast.hpp" #include "boost/format.hpp" using namespace IECore; static IndexedIO::EntryID g_sizeEntry("size"); static IndexedIO::EntryID g_membersEntry("members"); const unsigned int ObjectVector::m_ioVersion = 1; IE_CORE_DEFINEOBJECTTYPEDESCRIPTION( ObjectVector ); ObjectVector::ObjectVector() { } ObjectVector::~ObjectVector() { } ObjectVector::MemberContainer &ObjectVector::members() { return m_members; } const ObjectVector::MemberContainer &ObjectVector::members() const { return m_members; } void ObjectVector::copyFrom( const Object *other, CopyContext *context ) { Object::copyFrom( other, context ); const ObjectVector *tOther = static_cast<const ObjectVector *>( other ); m_members.resize( tOther->m_members.size() ); for( unsigned i=0; i<m_members.size(); i++ ) { if( !tOther->m_members[i] ) { m_members[i] = 0; } else { m_members[i] = context->copy<Object>( tOther->m_members[i].get() ); } } } void ObjectVector::save( SaveContext *context ) const { Object::save( context ); IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion ); unsigned int size = m_members.size(); container->write( g_sizeEntry, size ); IndexedIOPtr ioMembers = container->subdirectory( g_membersEntry, IndexedIO::CreateIfMissing ); unsigned i=0; for( MemberContainer::const_iterator it=m_members.begin(); it!=m_members.end(); it++ ) { if( *it ) { std::string name = str( boost::format( "%d" ) % i ); context->save( it->get(), ioMembers.get(), name ); } i++; } } void ObjectVector::load( LoadContextPtr context ) { Object::load( context ); unsigned int v = m_ioVersion; ConstIndexedIOPtr container = context->container( staticTypeName(), v ); unsigned int size = 0; container->read( g_sizeEntry, size ); m_members.resize( size ); std::fill( m_members.begin(), m_members.end(), (IECore::Object*)0 ); ConstIndexedIOPtr ioMembers = container->subdirectory( g_membersEntry ); IndexedIO::EntryIDList l; ioMembers->entryIds(l); for( IndexedIO::EntryIDList::const_iterator it=l.begin(); it!=l.end(); it++ ) { MemberContainer::size_type i = boost::lexical_cast<MemberContainer::size_type>( (*it).value() ); m_members[i] = context->load<Object>( ioMembers.get(), *it ); } } bool ObjectVector::isEqualTo( const Object *other ) const { if( !Object::isEqualTo( other ) ) { return false; } const ObjectVector *tOther = static_cast<const ObjectVector *>( other ); if( m_members.size()!=tOther->m_members.size() ) { return false; } for( MemberContainer::size_type i=0; i<m_members.size(); i++ ) { if( m_members[i] ) { if( !m_members[i]->isEqualTo( tOther->m_members[i].get() ) ) { return false; } } else { if( tOther->m_members[i] ) { return false; } } } return true; } void ObjectVector::memoryUsage( Object::MemoryAccumulator &a ) const { Object::memoryUsage( a ); for( MemberContainer::const_iterator it=m_members.begin(); it!=m_members.end(); it++ ) { if( *it ) { a.accumulate( it->get() ); } } } void ObjectVector::hash( MurmurHash &h ) const { Object::hash( h ); for( MemberContainer::const_iterator it=m_members.begin(); it!=m_members.end(); it++ ) { if( *it ) { (*it)->hash( h ); } else { h.append( 0 ); } } }
27.611702
98
0.678097
[ "object" ]
d1a7446db711ac82e51fdc6acb550dc9881a7151
12,430
cpp
C++
code/4/1c8f84a8129f31e235082718b564cd5040d31e1e.cpp
schafar92/antlr-cpp
6bebcbd3c8d9d1ec37db92d33cc854505eb31d1f
[ "MIT" ]
null
null
null
code/4/1c8f84a8129f31e235082718b564cd5040d31e1e.cpp
schafar92/antlr-cpp
6bebcbd3c8d9d1ec37db92d33cc854505eb31d1f
[ "MIT" ]
null
null
null
code/4/1c8f84a8129f31e235082718b564cd5040d31e1e.cpp
schafar92/antlr-cpp
6bebcbd3c8d9d1ec37db92d33cc854505eb31d1f
[ "MIT" ]
null
null
null
#include <iostream> #include <assert.h> #include <string> #include "parallel.h" #include "Timer.h" using namespace std; namespace par { // Fills A with random doubles, ppopulates b with row sums, returns largest val double fillArray(double **a, int n, double *b) { double largestValue = 0.0; int init = 1325; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { init = 3125 * init % 65536; // cheap and nasty random generator a[j][i] = (static_cast<double>(init) - 32768.0) / 16384.0; largestValue = (a[j][i] > largestValue) ? a[j][i] : largestValue; } } // fill b with 0 for (int i = 0; i < n; ++i) { b[i] = 0.0; } // add every element of each row of A to each row of B for (int j = 0; j < n; ++j) { for (int i = 0; i < n; ++i) { b[i] += a[j][i]; } } return largestValue; } double fillArray2(double *a, int n, double *b) { double largestValue = 0.0; int init = 1325; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { init = 3125 * init % 65536; // cheap and nasty random generator a[j*n + i] = (static_cast<double>(init) - 32768.0) / 16384.0; largestValue = (a[j*n + i] > largestValue) ? a[j*n + i] : largestValue; } } // fill b with 0 for (int i = 0; i < n; ++i) { b[i] = 0.0; } // add every element of each row of A to each row of B for (int j = 0; j < n; ++j) { for (int i = 0; i < n; ++i) { b[i] += a[j*n + i]; } } return largestValue; } /* Purpose : Find largest component of double vector dx n : number of elements in input vector dx : double vector with n+1 elements, dx[0] is not used dx_off : offset in reading dx */ int indexOfLargestElement(int n, double *dx, int dx_off) { double dmax, dtemp; int itemp = 0; if (n < 1) { itemp = -1; } else if (n == 1) { itemp = 0; } else { itemp = 0; dmax = abs(dx[0 + dx_off]); for (int i = 0; i < n; ++i) { dtemp = abs(dx[i + dx_off]); if (dtemp > dmax) { itemp = i; dmax = dtemp; } } } return itemp; } // Scales a vector by a constant void scaleVecByConstant(int n, double da, double *dx, int dx_off, int incx) { if (n > 0) { if (incx != 1) { int nincx = n * incx; for (int i = 0; i < nincx; i += incx) dx[i + dx_off] *= da; } else { for (int i = 0; i < n; ++i) dx[i + dx_off] *= da; } } } /* Constant times a vector plus a vector Purpose : To compute dy = da * dx + dy --- Input --- n : number of elements in input vector(s) scaler : double scalar multiplier dx : double vector with n+1 elements dy : double vector with n+1 element --- Output --- dy = da * dx + dy, unchanged if n <= 0 */ void daxpy(int n, double scaler, double *dx, double *dy, int offset) { if ((n > 0) && (scaler != 0)) { for (int i = 0; i < n; ++i) { dy[i + offset] += scaler * dx[i + offset]; } } } /* void msaxpy(int nr, int nc, double dx[], int offset, double scaler[], double dy[]) { int i, j; # pragma omp parallel \ shared ( dx, nc, nr, scaler, dy ) \ private ( i, j ) # pragma omp for for (j = 0; j < nc; j++) { for (i = 0; i < nr; i++) { dy[i + j*offset] += dx[j*offset] * scaler[i]; } } return; } */ void msaxpy(int nr, double * a, int n, double * x, double * y) { int i, j; #pragma omp parallel shared(nr,a,x,y) private(i,j) /* #pragma omp for schedule(dynamic,1) nowait */ #pragma omp for for (j = 0; j<nr; j++) { for (i = 0; i<nr; i++) { y[i, j] += a[j*n] * x[i]; } } } // Performs Gaussian elimination with partial pivoting int gaussian_eliminate(double **a, int n, int *ipivot) { // Pointers to columns being worked on double *col_k, *col_j; int nm1 = n - 1; int info = 0; if (nm1 >= 0) { int kp1, l; for (int k = 0; k < nm1; ++k) { // Set pointer for col_k to relevant column in a col_k = &a[k][0]; kp1 = k + 1; // Find pivot index l = indexOfLargestElement(n - k, col_k, k) + k; ipivot[k] = l; // Zero pivot means that this column is already triangularized if (col_k[l] != 0) { double t; // Check if we need to interchange if (l != k) { t = col_k[l]; col_k[l] = col_k[k]; col_k[k] = t; } // Compute multipliers t = -1.0 / col_k[k]; scaleVecByConstant(n - kp1, t, col_k, kp1, 1); // Row elimination with column indexing for (int j = kp1; j < n; ++j) { // Set pointer for col_j to relevant column in a col_j = &a[j][0]; t = col_j[l]; if (l != k) { col_j[l] = col_j[k]; col_j[k] = t; } daxpy(n - kp1, t, col_k, col_j, kp1); } } else info = k; } } ipivot[n - 1] = n - 1; if (a[n - 1][n - 1] == 0) { info = n - 1; } return info; } void sswap(int n, double * px, int ix, double * py, int iy) { int i, ipx, ipy; double t; ipx = 0; ipy = 0; for (i = 0; i<n; i++) { t = *(px + ipx); *(px + ipx) = *(py + ipy); *(py + ipy) = t; ipx += ix; ipy += iy; } } void sscal(int n,double sa,double* x, int ix) { int i, ipx; if (n <= 0) return; if (ix != 1) { for (i = 0; i<n; i++) { ipx = i*ix; x[ipx] *= sa; } } else { for (i = 0; i<n; i++) { x[i] *= sa; } } } void saxpy(int n, double a, double x[], double y[]) { int i,ix,iy,m; if (n <= 0 || a == 0.0) { return; } m = n % 4; for (i = 0; i < m; i++) { y[i] = y[i] + a * x[i]; } for (i = m; i < n; i = i + 4) { y[i] = y[i] + a * x[i]; y[i + 1] = y[i + 1] + a * x[i + 1]; y[i + 2] = y[i + 2] + a * x[i + 2]; y[i + 3] = y[i + 3] + a * x[i + 3]; } return; } #define al(i,j) a[i+(n*j)] void sgesl(double *a, int n, int *ipvt, double *b) { /* C version of Cleve Moler's SGESL - with Fortran ordering and call by address convention */ double t; int k, k1, kb, l, nk, nm1, nv; nv = n; if (nv > 0) { nm1 = nv - 1; for (k = 0; k<nm1; k++) { l = ipvt[k]; t = b[l]; if (l != k) { b[l] = b[k]; b[k] = t; } nk = nv - k - 1; k1 = k + 1; saxpy(nk, t, &al(k1, k), &b[k1]); } } for (kb = 0; kb<nv; kb++) { k = nv - kb - 1; b[k] = b[k] / al(k, k); t = -b[k]; saxpy(k, t, &al(0, k), b); } } #define am(p,q) (a+p+q*n) // Performs Gaussian elimination with partial pivoting int gaussian_eliminate3(double *a, int n, int *ipivot) { int info = 0; int nm1 = n - 1; for (int k = 0; k<nm1; k++) { int kp1 = k + 1; // int l = isamax(n - k, am(k, k), 1) + k; int l = indexOfLargestElement(n - k, am(k, k), k) + k; ipivot[k] = l; if ((*am(l, k)) == 0.0) { info = k; return 0; } double t; if (l != k) { t = *am(l, k); *am(l, k) = *am(k, k); *am(k, k) = t; } t = -1.0 / (*am(k, k)); sscal(n - k - 1, t, am(kp1, k), 1); if (l != k) { sswap(n - k - 1, am(l, kp1), n, am(k, kp1), n); } msaxpy(n - k - 1, am(k, kp1), n, am(kp1, k), am(kp1, kp1)); } return 0; } // Solves the system a * x = b using the factors computed in dgeco or // gaussian_eliminate void dgesl(double **a, int n, int *ipivot, double *b) { double t; int k, l, nm1, kp1; nm1 = n - 1; // Solve a * x = b. First solve l * y = b if (nm1 >= 1) { for (k = 0; k < nm1; ++k) { l = ipivot[k]; t = b[l]; if (l != k) { b[l] = b[k]; b[k] = t; } kp1 = k + 1; daxpy(n - kp1, t, &a[k][0], b, kp1); } } // Now solve u * x = y for (int kb = 0; kb < n; ++kb) { k = n - (kb + 1); b[k] /= a[k][k]; t = -b[k]; daxpy(k, t, &a[k][0], b, 0); } } // Multiply matrix m times vector x and add the result to vector y void dmxpy(int n1, double *y, int n2, double *x, double **m) { for (int j = 0; j < n2; ++j) { for (int i = 0; i < n1; ++i) { y[i] += x[j] * m[j][i]; } } } void dmxpy2(int n, double *y, double *x, double *m) { for (int j = 0; j < n; ++j) { for (int i = 0; i < n; ++i) { y[i] += x[j] * m[j*n+i]; } } } // Runs the benchmark void run(double **a, double *b, int n, int *ipivot) {} void validate2(double *a, double *b, double *x, int n) { // copy b into x for (int i = 0; i < n; ++i) { x[i] = b[i]; } // reset A and B arrays to orignal rand values double biggestA = fillArray2(a, n, b); for (int i = 0; i < n; ++i) { b[i] = -b[i]; } // multipy a*x, add to b dmxpy2(n, b, x, a); double biggestB = 0.0; double biggestX = 0.0; for (int i = 0; i < n; ++i) { biggestB = (biggestB > abs(b[i])) ? biggestB : abs(b[i]); biggestX = (biggestX > abs(x[i])) ? biggestX : abs(x[i]); } double residn = biggestB / (n * biggestA * biggestX * (2.2204460492503131e-016)); assert(residn < CHECK_VALUE); } // Validates the result void validate(double **a, double *b, double *x, int n) { // copy b into x for (int i = 0; i < n; ++i) { x[i] = b[i]; } // reset A and B arrays to orignal rand values double biggestA = fillArray(a, n, b); for (int i = 0; i < n; ++i) { b[i] = -b[i]; } // multipy a*x, add to b dmxpy(n, b, n, x, a); double biggestB = 0.0; double biggestX = 0.0; for (int i = 0; i < n; ++i) { biggestB = (biggestB > abs(b[i])) ? biggestB : abs(b[i]); biggestX = (biggestX > abs(x[i])) ? biggestX : abs(x[i]); } double residn = biggestB / (n * biggestA * biggestX * (2.2204460492503131e-016)); // assert(residn < CHECK_VALUE); if (residn > CHECK_VALUE) { cout << "Validation failed!" << endl; cout << "Computed Norm Res = " << residn << endl; cout << "Reference Norm Res = " << CHECK_VALUE << endl; assert(false); } else { cout << "Calculations are correct!" << endl; cout << "Computed Norm Res = " << residn << endl; cout << "Reference Norm Res = " << CHECK_VALUE << endl; } } int start(const unsigned int runs) { ResultFile r; r.name = "Sequential LinPack" + to_string(runs); r.headdings = { "Allocate Memory", "Create Input Numbers", " gaussian_eliminate", "Solve", "Validate" }; Timer time_total; for (size_t i = 0; i < runs; i++) { cout << i << endl; // Allocate data on the heap Timer time_allocate; /* double **a = new double *[SIZE]; for (size_t i = 0; i < SIZE; ++i) { a[i] = new double[SIZE]; } */ double *a = new double[NSIZE*NSIZE]; double *b = new double[NSIZE]; double *x = new double[NSIZE]; int *ipivot = new int[NSIZE]; time_allocate.Stop(); // Main application Timer time_genRnd; auto aa = fillArray2(a, NSIZE, b); time_genRnd.Stop(); Timer time_gauss; gaussian_eliminate3(a, NSIZE, ipivot); time_gauss.Stop(); Timer time_dgesl; sgesl(a, NSIZE, ipivot, b); time_dgesl.Stop(); Timer time_validate; validate2(a, b, x, NSIZE); time_validate.Stop(); r.times.push_back({ time_allocate.Duration_NS(), time_genRnd.Duration_NS(), time_gauss.Duration_NS(), time_dgesl.Duration_NS(), time_validate.Duration_NS() }); // Free the memory for (size_t i = 0; i < NSIZE; ++i) { // delete[] a[i]; } delete[] a; delete[] b; delete[] x; delete[] ipivot; } // r.CalcAvg(); // r.PrintToCSV(r.name); time_total.Stop(); cout << "Total Time: " << Timer::format(time_total.Duration_NS()); return 0; } }
23.903846
84
0.466774
[ "vector" ]
d1a7c3a4db20677a12b2be325ce827ba7fbfeac5
1,172
cpp
C++
c++/TC/SRM/145/div2/250.cpp
taku-xhift/labo
89dc28fdb602c7992c6f31920714225f83a11218
[ "MIT" ]
null
null
null
c++/TC/SRM/145/div2/250.cpp
taku-xhift/labo
89dc28fdb602c7992c6f31920714225f83a11218
[ "MIT" ]
null
null
null
c++/TC/SRM/145/div2/250.cpp
taku-xhift/labo
89dc28fdb602c7992c6f31920714225f83a11218
[ "MIT" ]
null
null
null
 #include <iostream> #include <vector> using namespace std; class ImageDithering { public: static int count(string dithered, vector<string> screen) { int ret = 0; for (int i = 0; i < screen.size(); ++i) { for (int j = 0; j < screen[i].size(); ++j) { // up if (i != 0 && dithered.find(screen[i-1][j], 0) != string::npos) { ++ret; break; } // left if (j != 0 && dithered.find(screen[i][j-1], 0) != string::npos) { ++ret; break; } // down if (i != screen.size()-1 && dithered.find(screen[i+1][j], 0) != string::npos) { ++ret; break; } // right if (j != screen[i].size()-1 && dithered.find(screen[i][j+1], 0) != string::npos) { ++ret; break; } } } return ret; } }; string sample[] = { "AAAAAAAA", "ABWBWBWA", "AWBWBWBA", "ABWBWBWA", "AWBWBWBA", "AAAAAAAA" }; #define numberof(arg) (arg/arg[0]) int main() { vector<string> arg; //for (int i = 0; i < numberof(sample); ++i) { for (int i = 0; i < 6; ++i) { arg.push_back(sample[i]); } cout << ImageDithering::count("BW", arg) << endl; }
18.3125
87
0.492321
[ "vector" ]
d1a94ed7fbc4ed4eb01fba2d39d5b676f961514e
455
cpp
C++
codeforces/282A.cpp
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
1
2019-11-06T15:17:48.000Z
2019-11-06T15:17:48.000Z
codeforces/282A.cpp
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
null
null
null
codeforces/282A.cpp
andraantariksa/code-exercise-answer
69b7dbdc081cdb094cb110a72bc0c9242d3d344d
[ "MIT" ]
1
2018-11-13T08:43:26.000Z
2018-11-13T08:43:26.000Z
/*input 1 ++X */ #include <iostream> #include <vector> int tot = 0; unsigned short inpTot; std::string temp; std::vector<std::string> s; int main(){ std::cin>>inpTot>>std::ws; for(unsigned short i = 0; i < inpTot; i++){ getline(std::cin, temp); s.push_back(temp); } for(std::string i: s){ if(i.find("--") != std::string::npos){ tot--; }else if(i.find("++") != std::string::npos){ tot++; } } std::cout<<tot<<std::endl; return 0; }
15.689655
46
0.575824
[ "vector" ]
d1b5269a4c7b82c71778f2979201e76e634556bd
830
cpp
C++
05/uva400.cpp
ericxie/aoapc
10092cebbc5b47364680ffecb5269d94349330e8
[ "MIT" ]
10
2019-11-10T10:37:23.000Z
2021-06-16T14:18:22.000Z
05/uva400.cpp
ericxie/aoapc
10092cebbc5b47364680ffecb5269d94349330e8
[ "MIT" ]
null
null
null
05/uva400.cpp
ericxie/aoapc
10092cebbc5b47364680ffecb5269d94349330e8
[ "MIT" ]
null
null
null
#include <iostream> #include <iomanip> #include <vector> #include <string> #include <algorithm> std::vector<std::string> files; const int W = 60; void solve(int n,int w){ int col,row,i,j,k; for(i=0;i<W;i++) std::cout << '-'; std::cout << '\n'; col = (W+2) / (w + 2); row = (n + col - 1) / col; for(i=0;i<row;i++){ for(j=0;j<col;j++){ k = j * row + i; if(k>=n) continue; std::cout << std::setw(w) << std::left << files[k]; if(j == col -1 || k + row >=n ) std::cout << '\n'; else std::cout << " "; } } } int main(){ std::string s; std::ios::sync_with_stdio(false); int n,w; while(std::cin >> n){ files.resize(n); w = 0; for(int i=0;i<n;i++){ std::cin >> files[i]; if(w < files[i].size()) w = files[i].size(); } std::sort(files.begin(),files.end()); solve(n,w); } return 0; }
19.302326
54
0.520482
[ "vector" ]
d1b66b44d5423e3ac21ce5e16e2ae858bf905408
2,973
hh
C++
tests/harfbuzz-1.7.6/src/src/hb-subset-plan.hh
sillywalk/grazz
a0adb1a90d41ff9006d8c1476546263f728b3c83
[ "Apache-2.0" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
tests/harfbuzz-1.7.6/src/src/hb-subset-plan.hh
sillywalk/grazz
a0adb1a90d41ff9006d8c1476546263f728b3c83
[ "Apache-2.0" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
tests/harfbuzz-1.7.6/src/src/hb-subset-plan.hh
sillywalk/grazz
a0adb1a90d41ff9006d8c1476546263f728b3c83
[ "Apache-2.0" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
/* * Copyright © 2018 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its documentation for any purpose, provided that the * above copyright notice and the following two paragraphs appear in * all copies of this software. * * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Google Author(s): Garret Rieger, Roderick Sheeter */ #ifndef HB_SUBSET_PLAN_HH #define HB_SUBSET_PLAN_HH #include "hb-private.hh" #include "hb-subset.h" #include "hb-object-private.hh" struct hb_subset_plan_t { hb_object_header_t header; ASSERT_POD (); hb_bool_t drop_hints; // TODO(Q1) actual map, drop this crap // Look at me ma, I'm a poor mans map codepoint : new gid // codepoints is sorted and aligned with gids_to_retain. // These first two lists provide a mapping from cp -> gid // As a result it does not list the full set of glyphs to retain. hb_prealloced_array_t<hb_codepoint_t> codepoints; hb_prealloced_array_t<hb_codepoint_t> gids_to_retain; // This list contains the complete set of glyphs to retain and may contain // more glyphs then the lists above. hb_prealloced_array_t<hb_codepoint_t> gids_to_retain_sorted; // Plan is only good for a specific source/dest so keep them with it hb_face_t *source; hb_face_t *dest; }; typedef struct hb_subset_plan_t hb_subset_plan_t; HB_INTERNAL hb_subset_plan_t * hb_subset_plan_create (hb_face_t *face, hb_subset_profile_t *profile, hb_subset_input_t *input); HB_INTERNAL hb_bool_t hb_subset_plan_new_gid_for_old_id(hb_subset_plan_t *plan, hb_codepoint_t old_gid, hb_codepoint_t *new_gid /* OUT */); HB_INTERNAL hb_bool_t hb_subset_plan_new_gid_for_codepoint(hb_subset_plan_t *plan, hb_codepoint_t codepont, hb_codepoint_t *new_gid /* OUT */); HB_INTERNAL hb_bool_t hb_subset_plan_add_table(hb_subset_plan_t *plan, hb_tag_t tag, hb_blob_t *contents); HB_INTERNAL void hb_subset_plan_destroy (hb_subset_plan_t *plan); #endif /* HB_SUBSET_PLAN_HH */
34.569767
76
0.711066
[ "object" ]
d1c76261f7d1682437a181c207b847cc834c0320
1,758
cpp
C++
BashuOJ-Code/5145.cpp
magicgh/algorithm-contest-code
c21a90b11f73535c61e6363a4305b74cff24a85b
[ "MIT" ]
null
null
null
BashuOJ-Code/5145.cpp
magicgh/algorithm-contest-code
c21a90b11f73535c61e6363a4305b74cff24a85b
[ "MIT" ]
null
null
null
BashuOJ-Code/5145.cpp
magicgh/algorithm-contest-code
c21a90b11f73535c61e6363a4305b74cff24a85b
[ "MIT" ]
null
null
null
#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<iomanip> #include<algorithm> #include<queue> #include<stack> #include<vector> #define ri register int #define ll long long using namespace std; const int MAXN=400005; struct Pair{int u,depth;}; struct Edge{int is_sc,u,v;}; vector<int>a[MAXN]; Edge b[MAXN]; int n,m,p,fa[MAXN],prt[MAXN],dep[MAXN],Cnt[MAXN]; inline const int GetInt() { int num=0,bj=1; char c=getchar(); while(!isdigit(c))bj=(c=='-'||bj==-1)?-1:1,c=getchar(); while(isdigit(c))num=num*10+c-'0',c=getchar(); return num*bj; } inline int getfa(int u) { if(prt[u]==u)return u; else return prt[u]=getfa(prt[u]); } inline void AddEdge(int u,int v) { a[u].push_back(v); a[v].push_back(u); } inline int onion(int a,int b) { a=getfa(a),b=getfa(b); if(dep[a]<dep[b])swap(a,b); if(a==b)return a; prt[a]=onion(fa[a],b); Cnt[prt[a]]+=Cnt[a]; Cnt[a]=0; return prt[a]; } void DFS(int u,int father,int depth) { dep[u]=depth,fa[u]=father; vector<int>::iterator it; for(it=a[u].begin();it!=a[u].end();++it) { if(*it==father)continue; DFS(*it,u,depth+1); } } int main() { //freopen("t.in","r",stdin); //freopen("t.out","w",stdout); n=GetInt(),m=GetInt(),p=GetInt(); for(ri i=1;i<=n;i++)prt[i]=i,Cnt[i]=1; for(ri i=1;i<=m+p;i++) { int u=GetInt(),v=GetInt(); int f1=getfa(u),f2=getfa(v); if(f1!=f2) { b[i]=(Edge){1,u,v}; prt[f1]=f2,AddEdge(u,v); } else b[i]=(Edge){0,u,v}; } for(ri i=1;i<=n;i++) { prt[i]=i; if(!dep[i])DFS(i,0,1); } for(ri i=1;i<=m;i++) if(!b[i].is_sc)onion(b[i].u,b[i].v); for(ri i=m+1;i<=m+p;i++) { if(b[i].is_sc)printf("No\n"); else printf("%d\n",Cnt[onion(b[i].u,b[i].v)]); } //fclose(stdin); //fclose(stdout); return 0; }
18.903226
56
0.597838
[ "vector" ]
d1cad6ccfe64be9061206d44192a0756289faabc
2,771
cpp
C++
ExternalCode/copasi/UI/TimeSeriesWidget.cpp
dhlee4/Tinkercell_new
c4d1848bbb905f0e1f9e011837268ac80aff8711
[ "BSD-3-Clause" ]
1
2021-01-07T13:12:51.000Z
2021-01-07T13:12:51.000Z
ExternalCode/copasi/UI/TimeSeriesWidget.cpp
dhlee4/Tinkercell_new
c4d1848bbb905f0e1f9e011837268ac80aff8711
[ "BSD-3-Clause" ]
7
2020-04-12T22:25:46.000Z
2020-04-13T07:50:40.000Z
ExternalCode/copasi/UI/TimeSeriesWidget.cpp
daniel-anavaino/tinkercell
7896a7f809a0373ab3c848d25e3691d10a648437
[ "BSD-3-Clause" ]
2
2020-04-12T21:57:01.000Z
2020-04-12T21:59:29.000Z
// Begin CVS Header // $Source: /fs/turing/cvs/copasi_dev/copasi/UI/TimeSeriesWidget.cpp,v $ // $Revision: 1.17 $ // $Name: Build-33 $ // $Author: shoops $ // $Date: 2010/07/16 19:05:17 $ // End CVS Header // Copyright (C) 2010 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., University of Heidelberg, and The University // of Manchester. // All rights reserved. // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc., EML Research, gGmbH, University of Heidelberg, // and The University of Manchester. // All rights reserved. // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual // Properties, Inc. and EML Research, gGmbH. // All rights reserved. #include <QLayout> #include <QGridLayout> #include "copasi.h" #include "TimeSeriesWidget.h" #include "TimeSeriesSubwidget.h" #include "CTimeSeriesTable.h" #include "qtUtilities.h" #include "CopasiDataModel/CCopasiDataModel.h" #include "report/CCopasiRootContainer.h" #include "utilities/CCopasiVector.h" #include "trajectory/CTrajectoryTask.h" /* * Constructs a TimeSeriesWidget which is a child of 'parent', with the * name 'name' and widget flags set to 'f'. */ TimeSeriesWidget::TimeSeriesWidget(QWidget* parent, const char* name, Qt::WFlags fl) : CopasiWidget(parent, name, fl) { if (!name) setObjectName("TimeSeriesWidget"); setWindowTitle(trUtf8("TimeSeriesWidget")); mWidgetLayout = new QGridLayout(this); mCentralWidget = new TimeSeriesSubWidget(this, "TimeSeriesSubwidget"); mWidgetLayout->addWidget(mCentralWidget, 0, 0); mCentralWidget->setFramework(mFramework); } /* * Destroys the object and frees any allocated resources */ TimeSeriesWidget::~TimeSeriesWidget() {} bool TimeSeriesWidget::loadFromBackend() { mCentralWidget->displayOptimizationTab(false); assert(CCopasiRootContainer::getDatamodelList()->size() > 0); mCentralWidget->table()->setTimeSeries(dynamic_cast<CTrajectoryTask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Time-Course"])->getTimeSeries()); return true; } bool TimeSeriesWidget::saveToBackend() { return true; } bool TimeSeriesWidget::update(ListViews::ObjectType objectType, ListViews::Action action, const std::string & /* key */) { if (objectType == ListViews::MODEL && action == ListViews::ADD) mCentralWidget->table()->setTimeSeries(CTimeSeries()); return true; } bool TimeSeriesWidget::leave() { //return saveToCompartment(); return true; } bool TimeSeriesWidget::enterProtected() { return true; } void TimeSeriesWidget::setFramework(int framework) { CopasiWidget::setFramework(framework); mCentralWidget->setFramework(mFramework); }
26.390476
172
0.718152
[ "object", "model" ]
d1cbd16d835b8ea506679220fc602d7708519f11
3,897
cpp
C++
tests/raw.cpp
bytemaster/Boost.RPC
a27795d37481fb5d53774cc8cf4270fff1f84964
[ "Unlicense" ]
23
2015-03-31T05:54:47.000Z
2022-02-27T14:30:16.000Z
tests/raw.cpp
bytemaster/Boost.RPC
a27795d37481fb5d53774cc8cf4270fff1f84964
[ "Unlicense" ]
null
null
null
tests/raw.cpp
bytemaster/Boost.RPC
a27795d37481fb5d53774cc8cf4270fff1f84964
[ "Unlicense" ]
13
2015-04-22T04:32:26.000Z
2019-08-29T13:22:21.000Z
#include <boost/rpc/json/value_io.hpp> #include <boost/rpc/raw.hpp> #include <boost/rpc/describe.hpp> #include <boost/chrono.hpp> #include <boost/rpc/datastream.hpp> #include <boost/iostreams/device/null.hpp> #include <boost/iostreams/device/array.hpp> #include <boost/iostreams/stream.hpp> struct substruct { double hi; double low; }; struct test { int a; std::string b; boost::rpc::signed_int si; boost::rpc::unsigned_int usi; std::vector<std::string> data; std::list<int32_t> ldata; std::map<std::string,std::string> keys; std::vector<char> bdata; substruct sub; }; BOOST_REFLECT( test,(a)(b)(si)(usi)(data)(ldata)(keys)(bdata)(sub) ) BOOST_REFLECT( substruct,(hi)(low) ) int main( int argc, char** argv ) { test t; t.a = 5; t.b = "hello world"; t.data.push_back( "Hello" ); t.data.push_back( "World" ); t.keys["hello"] = "world"; t.si.value = -1234; t.usi.value = 1234; t.bdata.insert(t.bdata.begin(), t.b.begin(), t.b.end() ); std::string jtest = boost::rpc::json::to_json(t); std::cerr<<"json: " <<jtest << std::endl; std::cerr<< "\n description: \n"; boost::rpc::description d = boost::rpc::describe_type<test>(); std::cerr<< "\n...\n"; std::cerr<<boost::rpc::json::to_json( d ); std::stringstream ss; ss.seekp(0); boost::rpc::raw::pack(ss, t); int64_t count = 100000; { boost::rpc::datastream<size_t> ds; boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); for( int64_t i = 0; i < count; ++i ) { ss.seekp(0); boost::rpc::raw::pack(ds, t); } boost::chrono::system_clock::time_point end = boost::chrono::system_clock::now(); std::cerr<<"\nsize: "<<ds.tellp()<<" time = "<<count / ((end-start).count()/1000000000.0) <<std::endl; } { std::vector<char> tmp(ss.str().size()); boost::rpc::datastream<char*> ds(&tmp.front(),tmp.size()); boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); for( int64_t i = 0; i < count; ++i ) { ss.seekp(0); boost::rpc::raw::pack(ds, t); } boost::chrono::system_clock::time_point end = boost::chrono::system_clock::now(); std::cerr<<"time = "<<count / ((end-start).count()/1000000000.0) <<std::endl; } /* { boost::iostreams::stream<boost::iostreams::null_sink> ds; boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); for( int64_t i = 0; i < count; ++i ) { ss.seekp(0); boost::rpc::raw::pack(ds, t); } boost::chrono::system_clock::time_point end = boost::chrono::system_clock::now(); std::cerr<<"\nsize: "<<ds.tellp(); std::cerr<<"null_sink time = "<<count / ((end-start).count()/1000000000.0) <<std::endl; } return 0; */ { std::vector<char> tmp(ss.str().size()); boost::iostreams::stream<boost::iostreams::array_sink> ds(&tmp.front(),tmp.size()); boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); for( int64_t i = 0; i < count; ++i ) { ss.seekp(0); boost::rpc::raw::pack(ds, t); } boost::chrono::system_clock::time_point end = boost::chrono::system_clock::now(); std::cerr<<"time = "<<count / ((end-start).count()/1000000000.0) <<std::endl; } boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now(); for( int64_t i = 0; i < count; ++i ) { ss.seekp(0); boost::rpc::raw::pack(ss, t); } boost::chrono::system_clock::time_point end = boost::chrono::system_clock::now(); std::cerr<<"time = "<<count / ((end-start).count()/1000000000.0) <<std::endl; test t2; boost::rpc::raw::unpack(ss, t2); std::cerr<<"unpacked\n"; std::cerr<<boost::rpc::json::to_json( t2 ); return 0; }
33.594828
106
0.591481
[ "vector" ]
d1ceaa75f51d6a9e03855d8977f2a58b507798d6
3,583
cpp
C++
Tudat/JsonInterface/Environment/spice.cpp
ViktorJordanov/tudat
069ceeab8f12405c356e19f50d6df037914df85c
[ "BSD-3-Clause" ]
null
null
null
Tudat/JsonInterface/Environment/spice.cpp
ViktorJordanov/tudat
069ceeab8f12405c356e19f50d6df037914df85c
[ "BSD-3-Clause" ]
null
null
null
Tudat/JsonInterface/Environment/spice.cpp
ViktorJordanov/tudat
069ceeab8f12405c356e19f50d6df037914df85c
[ "BSD-3-Clause" ]
null
null
null
<<<<<<< HEAD /* Copyright (c) 2010-2018, Delft University of Technology ======= /* Copyright (c) 2010-2019, Delft University of Technology >>>>>>> origin/master * All rigths reserved * * This file is part of the Tudat. Redistribution and use in source and * binary forms, with or without modification, are permitted exclusively * under the terms of the Modified BSD license. You should have received * a copy of the license with this file. If not, please or visit: * http://tudat.tudelft.nl/LICENSE. * */ #include "Tudat/JsonInterface/Environment/spice.h" namespace tudat { namespace json_interface { //! Create a `json` object from a shared pointer to a `SpiceSettings` object. void to_json( nlohmann::json& jsonObject, const std::shared_ptr< SpiceSettings >& spiceSettings ) { if ( ! spiceSettings ) { return; } using K = Keys::Spice; jsonObject[ K::useStandardKernels ] = spiceSettings->useStandardKernels_; if ( spiceSettings->useStandardKernels_ ) { assignIfNotEmpty( jsonObject, K::alternativeKernels, spiceSettings->alternativeKernels_ ); } else { jsonObject[ K::kernels ] = spiceSettings->kernels_; } jsonObject[ K::preloadEphemeris ] = spiceSettings->preloadEphemeris_; if ( spiceSettings->preloadEphemeris_ ) { jsonObject[ K::interpolationStep ] = spiceSettings->interpolationStep_; jsonObject[ K::interpolationOffsets ] = { spiceSettings->getInitialOffset( ), spiceSettings->getFinalOffset( ) }; } } //! Create a shared pointer to a `SpiceSettings` object from a `json` object. void from_json( const nlohmann::json& jsonObject, std::shared_ptr< SpiceSettings >& spiceSettings ) { using K = Keys::Spice; spiceSettings = std::make_shared< SpiceSettings >( ); updateFromJSON( spiceSettings->useStandardKernels_, jsonObject, K::useStandardKernels ); if ( spiceSettings->useStandardKernels_ ) { updateFromJSONIfDefined( spiceSettings->alternativeKernels_, jsonObject, K::alternativeKernels ); } else { updateFromJSON( spiceSettings->kernels_, jsonObject, K::kernels ); } updateFromJSONIfDefined( spiceSettings->preloadEphemeris_, jsonObject, K::preloadEphemeris ); if ( spiceSettings->preloadEphemeris_ ) { spiceSettings->interpolationOffsets_ = getValue( jsonObject, K::interpolationOffsets, spiceSettings->interpolationOffsets_ ); spiceSettings->interpolationStep_ = getValue( jsonObject, K::interpolationStep, spiceSettings->interpolationStep_ ); } } //! Load in Tudat the Spice kernels specified in \p spiceSettings. void loadSpiceKernels( const std::shared_ptr< SpiceSettings >& spiceSettings ) { using namespace spice_interface; clearSpiceKernels( ); if ( spiceSettings ) { if ( spiceSettings->useStandardKernels_ ) { std::vector< std::string > alternativeKernelsFiles; for ( boost::filesystem::path kernel : spiceSettings->alternativeKernels_ ) { alternativeKernelsFiles.push_back( kernel.string( ) ); } loadStandardSpiceKernels( alternativeKernelsFiles ); } else { for ( const boost::filesystem::path kernel : spiceSettings->kernels_ ) { spice_interface::loadSpiceKernelInTudat( kernel.string( ) ); } } } } } // namespace json_interface } // namespace tudat
32.279279
105
0.661178
[ "object", "vector" ]
d1d138b5b8a63cbe75a57078e380ee58d4fbed0f
10,823
cpp
C++
src/valve/hl1bspinstance.cpp
wtrsltnk/game-assets
a30f205fe020768f877feb4e55e091c72609d74f
[ "MIT" ]
7
2016-11-11T12:52:52.000Z
2021-03-02T22:38:21.000Z
src/valve/hl1bspinstance.cpp
wtrsltnk/game-assets
a30f205fe020768f877feb4e55e091c72609d74f
[ "MIT" ]
null
null
null
src/valve/hl1bspinstance.cpp
wtrsltnk/game-assets
a30f205fe020768f877feb4e55e091c72609d74f
[ "MIT" ]
2
2019-04-25T22:57:11.000Z
2020-09-02T18:29:23.000Z
#include "../../include/valve/hl1bspinstance.h" #include <glm/glm.hpp> #include <set> using namespace std; using namespace valve::hl1; BspInstance::BspInstance(BspAsset* asset) : _asset(asset), _shader(nullptr) { this->_shader = new Shader(); this->_shader->BuildProgram(); } BspInstance::~BspInstance() { this->Unload(); } void BspInstance::Render(const glm::mat4& proj, const glm::mat4& view) { glm::mat3 rotMat(view); glm::vec3 pos = -glm::vec3(view[3]) * rotMat; std::set<unsigned short> visibleFaces = this->FindVisibleFaces(pos, this->_asset->_modelData[0].headnode[0]); if (visibleFaces.size() > 0) this->_visibleFaces = visibleFaces; this->_shader->UseProgram(); this->_shader->SetProjectionMatrix(proj); this->_shader->SetViewMatrix(view); this->_asset->RenderFaces(this->_visibleFaces); } void BspInstance::Unload() { if (this->_shader != nullptr) delete this->_shader; this->_shader = nullptr; } std::set<unsigned short> BspInstance::FindVisibleFaces(const glm::vec3& pos, int headNode) { std::set<unsigned short> leafFaces; int leaf = this->TracePointInLeaf(pos, headNode); if (leaf != 0) { // add all faces of current leaf for (int f = 0; f < this->_asset->_leafData[leaf].markSurfacesCount; f++) { unsigned short findex = this->_asset->_marksurfaceData[this->_asset->_leafData[leaf].firstMarkSurface + f]; if (this->_asset->FaceFlags(findex) == 0) leafFaces.insert(findex); } hl1::tBSPVisLeaf* visleaf = &this->_asset->_visLeafs[leaf]; // add all faces of leafs through vis data for (int l = 0; l < visleaf->leafCount; l++) { for (int f = 0; f < this->_asset->_leafData[visleaf->leafs[l]].markSurfacesCount; f++) { unsigned short findex = this->_asset->_marksurfaceData[this->_asset->_leafData[visleaf->leafs[l]].firstMarkSurface + f]; if (this->_asset->FaceFlags(findex) == 0) leafFaces.insert(findex); } } // Add all faces of non worldspawn model for (int m = 1; m < this->_asset->_modelData.count; m++) { for (unsigned short f = 0; f < this->_asset->_modelData[m].faceCount; f++) { if (this->_asset->FaceFlags(f + this->_asset->_modelData[m].firstFace) != 0) continue; leafFaces.insert(f + this->_asset->_modelData[m].firstFace); } } } else { for (unsigned short i = 0; i < this->_asset->_faceData.count; i++) { if (this->_asset->FaceFlags(i) != 0) continue; this->_visibleFaces.insert(i); } } return leafFaces; } int BspInstance::TracePointInLeaf(const glm::vec3& point, int nodenum) { float d; hl1::tBSPNode *node; hl1::tBSPPlane *plane; while (nodenum >= 0) { node = &this->_asset->_nodeData[nodenum]; plane = &this->_asset->_planeData[node->planeIndex]; d = glm::dot(point, plane->normal) - plane->distance; if (d > 0) nodenum = node->children[0]; else nodenum = node->children[1]; } return -nodenum - 1; } void BspInstance::BotmanTraceLine(glm::vec3 start, glm::vec3 end, botman_trace_t *tr) { tBSPLeaf *startleaf, *endleaf; int numsteps, totalsteps; glm::vec3 move, step, position; float dist, trace_dist; memset(tr, 0, sizeof(botman_trace_t)); if ((start.x < -4095) || (start.x > 4095) || (start.y < -4095) || (start.y > 4095) || (start.z < -4095) || (start.z > 4095)) { // start beyond edge of world is INVALID!!! fprintf(stderr,"TraceLine: start point beyond edge of world!\n"); } if (end.x > 4095.0f) { float percent = 4095.0f / end.x; end.y = end.y * percent; end.z = end.z * percent; end.x = 4095.0f; } if (end.y > 4095.0f) { float percent = 4095.0f / end.y; end.x = end.x * percent; end.z = end.z * percent; end.y = 4095.0f; } if (end.z > 4095.0f) { float percent = 4095.0f / end.z; end.x = end.x * percent; end.y = end.y * percent; end.z = 4095.0f; } if (end.x < -4095.0f) { float percent = 4095.0f / end.x; end.y = end.y * percent; end.z = end.z * percent; end.x = -4095.0f; } if (end.y < -4095.0f) { float percent = 4095.0f / end.y; end.x = end.x * percent; end.z = end.z * percent; end.y = -4095.0f; } if (end.z < -4095.0f) { float percent = 4095.0f / end.z; end.x = end.x * percent; end.y = end.y * percent; end.z = -4095.0f; } // find the starting and ending leafs... startleaf = &this->_asset->_leafData[TracePointInLeaf(start, 0)]; endleaf = &this->_asset->_leafData[TracePointInLeaf(end, 0)]; // set endpos, fraction and contents to the default (trace completed) tr->endpos = end; tr->fraction = 1.0f; tr->contents = endleaf->contents; if (startleaf->contents == CONTENTS_SOLID) tr->startsolid = TRUE; // is start and end leaf the same (couldn't possibly hit the world)... if (startleaf == endleaf) { if (startleaf->contents == CONTENTS_SOLID) tr->allsolid = TRUE; return; } // get the length of each interation of the loop... move = end - start; dist = glm::length(move); // determine the number of steps from start to end... if (dist > 1.0f) numsteps = totalsteps = (int)dist + 1; else numsteps = totalsteps = 1; // calculate the length of the step vector... step = move * float(2.0f / numsteps); position = start; while (numsteps) { position = position + step; endleaf = &this->_asset->_leafData[TracePointInLeaf(position, 0)]; if ((endleaf->contents == CONTENTS_SOLID) || // we hit something solid... (endleaf->contents == CONTENTS_SKY)) // we hit the sky { glm::vec3 hitpos; hitpos = position; // store the hit position tr->hitpos = position; // back off one step before solid position = position - step; // store the end position and end position contents tr->endpos = position; tr->contents = endleaf->contents; move = position - start; trace_dist = glm::length(move); tr->fraction = trace_dist / dist; break; // break out of while loop } numsteps--; } } // WARNING!!! the "vector" parameter should be NORMALIZED!!! float DistanceToIntersection(const glm::vec3 origin, const glm::vec3 vector, const glm::vec3 plane_origin, const glm::vec3 plane_normal) { float d = -(glm::dot(plane_normal, plane_origin)); float numerator = glm::dot(plane_normal, origin) + d; float denominator = glm::dot(plane_normal, vector); if (fabs(denominator) < 0.00001) return (-1.0f); // normal is orthogonal to vector, no intersection return -(numerator/denominator); } #define TWO_PI 6.2831853f #define DELTA 0.001f // find the face where the traceline hit... tBSPFace *BspInstance::TraceLineFindFace(glm::vec3 start, botman_trace_t *tr) { glm::vec3 v_intersect, v_normalized, v_temp; tBSPFace *return_face = NULL; float min_diff = 9999.9f; v_normalized = glm::normalize(tr->endpos - start); tBSPLeaf *endleaf = &this->_asset->_leafData[TracePointInLeaf(tr->endpos, 0)]; unsigned short *p = this->_asset->_marksurfaceData + endleaf->firstMarkSurface; // find a plane with endpos on one side and hitpos on the other side... for (int i = 0; i < endleaf->markSurfacesCount; i++) { int face_idx = *p++; tBSPFace *face = &this->_asset->_faceData[face_idx]; tBSPPlane *plane = &this->_asset->_planeData[face->planeIndex]; float d1 = glm::dot(tr->endpos, plane->normal) - plane->distance; float d2 = glm::dot(tr->hitpos, plane->normal) - plane->distance; if ((d1 > 0 && d2 <= 0)||(d1 <= 0 && d2 > 0)) { // found a plane, find the intersection point in the plane... glm::vec3 plane_origin, v_angle1, v_angle2; plane_origin = (plane->normal * plane->distance); float dist = DistanceToIntersection(start, v_normalized, plane_origin, plane->normal); if (dist < 0) return NULL; // can't find intersection v_temp = (v_normalized * dist); v_intersect = (start + v_temp); // loop through all of the vertexes of all the edges of this face and // find the angle between vertex-n, v_intersect and vertex-n+1, then add // all these angles together. if the sum of these angles is 360 degrees // (or 2 PI radians), then the intersect point lies within that polygon. float angle_sum = 0.0f; // loop though all of the edges, getting the vertexes... for (int edge_index = 0; edge_index < face->edgeCount; edge_index++) { glm::vec3 vertex1, vertex2; // get the coordinates of the vertex of this edge... int edge = this->_asset->_surfedgeData[face->firstEdge + edge_index]; if (edge < 0) { edge = -edge; tBSPEdge* e = &this->_asset->_edgeData[edge]; vertex1 = this->_asset->_verticesData[e->vertex[1]].point; vertex2 = this->_asset->_verticesData[e->vertex[0]].point; } else { tBSPEdge* e = &this->_asset->_edgeData[edge]; vertex1 = this->_asset->_verticesData[e->vertex[0]].point; vertex2 = this->_asset->_verticesData[e->vertex[1]].point; } // now create vectors from the vertexes to the plane intersect point... v_angle1 = glm::normalize(vertex1 - v_intersect); v_angle2 = glm::normalize(vertex2 - v_intersect); // find the angle between these vectors... float angle = glm::dot(v_angle1, v_angle2); angle = (float)acos(angle); angle_sum += angle; edge++; } // is the sum of the angles 360 degrees (2 PI)?... if ((angle_sum >= (TWO_PI - DELTA)) && (angle_sum <= (TWO_PI + DELTA))) { // find the difference between the sum and 2 PI... float diff = (float)fabs(angle_sum - TWO_PI); if (diff < min_diff) // is this the BEST so far?... { min_diff = diff; return_face = face; } } } } return return_face; }
29.410326
136
0.575441
[ "render", "vector", "model", "solid" ]