blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 247 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 4 111 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 58 | visit_date timestamp[ns]date 2015-07-25 18:16:41 2023-09-06 10:45:08 | revision_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | committer_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | github_id int64 3.89k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 25 values | gha_event_created_at timestamp[ns]date 2012-06-07 00:51:45 2023-09-14 21:58:52 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-08-24 19:49:39 ⌀ | gha_language stringclasses 159 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 10.5M | extension stringclasses 111 values | filename stringlengths 1 195 | text stringlengths 7 10.5M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37ba1318a5ba85abe7dea99b241a46626ff58b6c | b59f0e50a7295abd6343555533e20d68ef456af9 | /konstrat ayarı kendi fonksiyonum.cpp | cb2057878c6a8513e4fbae65fb30cea2eb14a405 | [] | no_license | ismailozdere/OpenCV-goruntu-isleme-C-- | c22e4cf3a4a38e0e605f635389f8589152b2b808 | 6163214ac580ec0e1be8d616a91d74694eed199f | refs/heads/main | 2023-04-20T04:36:00.431186 | 2021-04-26T09:04:02 | 2021-04-26T09:04:02 | 361,681,673 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,014 | cpp | konstrat ayarı kendi fonksiyonum.cpp | //#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>
//#include "opencv2/imgproc/imgproc.hpp"
//#include <iostream>
//
//using namespace std;
//using namespace cv;
//
////int blue, green, red;
////int y = 100;
////int x = 120;
////double constVal = 0.3;
////int derinlik = 1;
////
////Mat orgImg;
////
////
////int main()
////{
//// orgImg = imread("Harley_Quinn.jpg");
////
//// Mat crtGrayImg(orgImg.rows, orgImg.cols, CV_8UC1, Scalar(0));
////
//// if (derinlik == -1) {
////
//// for (int i = 0; i < orgImg.cols; i++) {
//// for (int j = 0; j < orgImg.rows; j++) {
////
//// orgImg.at<Vec3b>(j, i)[0] = orgImg.at<Vec3b>(j, i)[0] * constVal;
//// orgImg.at<Vec3b>(j, i)[1] = orgImg.at<Vec3b>(j, i)[1] * constVal;
//// orgImg.at<Vec3b>(j, i)[2] = orgImg.at<Vec3b>(j, i)[2] * constVal;
//// }
//// }
////
//// Vec3b pixsel = orgImg.at<Vec3b>(y, x);
////
//// blue = pixsel.val[0];
//// green = pixsel.val[1];
//// red = pixsel.val[2];
////
//// cout << "Blue Value:" << blue << endl;
//// cout << "green Value:" << green << endl;
//// cout << "red Value:" << red << endl;
////
//// }
////
//// else if (derinlik == 1) {
////
//// cvtColor(orgImg, orgImg, CV_BGR2GRAY);
////
//// for (int i = 0; i < orgImg.cols; i++) {
//// for (int j = 0; j < orgImg.rows; j++) {
////
//// crtGrayImg.at<uchar>(j, i) = orgImg.at<uchar>(j, i) * constVal;
//// }
//// }
////
////
//// }
////
////
//// namedWindow("Resim Penceresi", CV_WINDOW_AUTOSIZE);
//// imshow("Resim Penceresi", crtGrayImg);
////
////
////
//// waitKey(0);
//// destroyWindow("Resim Penceresi");
////
////
//// return 0;
////}
//
//Mat newCont;
//
//void convert(Mat input, Mat output, int derinlik, float alfa)
//{
// if (derinlik == -1)
// {
// for (int i = 0; i < input.rows; i++) {
// for (int j = 0; j < input.cols; j++) {
//
// if (input.at<Vec3b>(i, j)[0] * alfa > 255)input.at<Vec3b>(i, j)[0] = 255;
// else input.at<Vec3b>(i, j)[0] = input.at<Vec3b>(i, j)[0] * alfa;
//
// if (input.at<Vec3b>(i, j)[1] * alfa > 255)input.at<Vec3b>(i, j)[1] = 255;
// else input.at<Vec3b>(i, j)[1] = input.at<Vec3b>(i, j)[1] * alfa;
//
// if (input.at<Vec3b>(i, j)[2] * alfa > 255)input.at<Vec3b>(i, j)[2] = 255;
// else input.at<Vec3b>(i, j)[2] = input.at<Vec3b>(i, j)[2] * alfa;
// }
// }
// }
// else if (derinlik == 1) {
//
// cvtColor(input, input, CV_BGR2GRAY);
//
// for (int i = 0; i < input.rows; i++) {
// for (int j = 0; j < input.cols; j++) {
//
// if (input.at<uchar>(i, j) * alfa > 255)input.at<uchar>(i, j) = 255;
//
// }
// }
// }
// newCont = input;
//}
//
//
//int main()
//{
//
// Mat orgim = imread("Harley_Quinn.jpg");
// imshow("orjinal", orgim);
//
// convert(orgim, newCont, -1, 1.0);
// imshow("resim", newCont);
//
// convert(orgim, newCont, 1, 1.0);
// imshow("resim1", newCont);
//
// waitKey(0);
// return 0;
//}
//
//
//
|
2e49c3a7040f986a7f5b50870f7d88ae2b49e881 | 3f924c3ff73819e506bef8720ba638f5cd6aba6e | /en_bandit.cpp | 817f10aa3831b2bc76fb7e8f54c5f4c35b4e59c1 | [] | no_license | clockword/OpenglFramework | 94885b2bbd667652d20baee3729ff6bc0c85e42d | 2b618ac55faca40fb8a33d0c6b95c7188d14efb1 | refs/heads/main | 2023-02-01T01:09:35.045608 | 2020-12-17T10:39:43 | 2020-12-17T10:39:43 | 316,512,402 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,002 | cpp | en_bandit.cpp | #include "en_bandit.h"
EnBandit::EnBandit() : Enemy()
{
}
EnBandit::EnBandit(glm::vec2 pos, glm::vec2 size, glm::vec3 color, glm::vec2 velocity) :
Enemy(pos, size, color, velocity)
{
}
void EnBandit::Update(SpriteRenderer& renderer, float deltatime)
{
if (!Active || IsDestroyed)
return;
if (currentHp <= 0.0f) {
Active = false;
IsDestroyed = true;
return;
}
int status = anim->GetAnimStatus();
bool isContinuous = true;
float speed = 150.0f;
if (isControl)
{
glm::vec2 moveDirection = moveDir;
status = (int)BanditAnimStatus::RUN;
glm::vec2 direction(glm::normalize(player->Position - Position));
float distance = glm::length(player->Position - Position);
atkInterval += deltatime;
if (distance <= 1400.0f)
{
if (distance <= 60.0f)
{
if (atkInterval >= AtkDelay)
{
xFlip = direction.x > 0.0f ? true : false;
atkInterval = 0.0f;
ShootBullets("bandit_swd", false, false, 5.0f, glm::vec2(15.0f, 0.0f), 0.5f);
if (Velocity.y == 0.0f)
status = (int)BanditAnimStatus::ATK_DWN;
else
status = (int)BanditAnimStatus::ATK_UP;
isContinuous = false;
}
moveDirection.x = 0.0f;
}
else
{
moveDirection.x = direction.x < 0.0f ? -speed : speed;
if(Position.x > player->Position.x + 30.0f || Position.x < player->Position.x - 30.0f)
xFlip = direction.x < 0.0f ? false : true;
if (Position.y > player->Position.y + 100.0f && Velocity.y == 0.0f)
moveDirection.y = -850.0f;
}
}
if (moveDir.y != 0.0f)
moveDirection.x = xFlip ? speed : -speed;
Move(moveDirection);
}
else
{
status = (int)BanditAnimStatus::SWOON;
}
if (status != anim->GetAnimStatus())
anim->SetAnimStatus(status, isContinuous);
if (currentHp >= 0.0f)
hpBar->Size.x = currentHp / MaxHp;
hpBar->Position = Position + glm::vec2(0.0f, -60.0f);
hpBar->Update(renderer, deltatime);
CollObject::Update(renderer, deltatime);
for (auto bullet : bullets) {
if (!bullet.second->IsIndependent) {
bullet.second->playerPos = Position;
bullet.second->xFlip = xFlip;
}
bullet.second->Update(renderer, deltatime);
}
}
void EnBandit::Init()
{
Enemy::Init();
enType = EnemyType::BANDIT;
anim->SetAnimStatus((int)BanditAnimStatus::RUN);
AtkDelay = 1.0f;
atkInterval = AtkDelay;
MaxHp = 100.0f;
currentHp = MaxHp;
damage = 1.0f;
}
void EnBandit::CollisionStepped(std::vector<CollObject*> obj)
{
if (obj.size() == 1)
{
if (Position.x > obj[0]->Position.x + obj[0]->collider->Width * 0.5f && xFlip && moveDir.y == 0.0f && isControl ||
Position.x < obj[0]->Position.x - obj[0]->collider->Width * 0.5f && !xFlip && moveDir.y == 0.0f && isControl) {
moveDir.y += -850.0f;
}
}
}
void EnBandit::CollisionSticked(std::vector<CollObject*> obj)
{
for (auto coll : obj)
{
if (Position.x < coll->Position.x && moveDir.x > 0.0f && moveDir.y == 0.0f && isControl ||
Position.x > coll->Position.x && moveDir.x < 0.0f && moveDir.y == 0.0f && isControl)
moveDir.y += -850.0f;
}
}
|
b14529d0093cc55b2daea2b4d854b91bb9145de3 | 8e3bed8a6cdd5f979840b205f9cedbe297769f13 | /Source/GameServer/include/KanturuEntranceNPC.h | 95808292849e8eb6f017730a802e6fd5a042c81e | [
"MIT"
] | permissive | vuonglequoc/ServerSimulator | 93cd48edf1cd5bec77e9c823b930bf35f26c7111 | 12bd6f24fcf957c657864a81da3dfb0467b48c2b | refs/heads/master | 2023-02-03T05:55:40.232793 | 2020-12-19T22:27:34 | 2020-12-19T22:27:34 | 35,360,781 | 2 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 789 | h | KanturuEntranceNPC.h | //**********************************************************************//
// Project: HaRiBO MU GameServer - Season 4 //
// Company: RealCoderZ MU Development © 2010 //
// Description: MU Kanturu Enterance NPC Structure & Functions //
// Decompilation By: Deathway //
// Coded & Modified By: WolF & M.E.S //
//**********************************************************************//
#ifndef KANTURU_ENTERANCE_NPC_H
#define KANTURU_ENTERANCE_NPC_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CKanturuEntranceNPC
{
public:
CKanturuEntranceNPC();
virtual ~CKanturuEntranceNPC();
void NotifyEntranceInfo(int iIndex);
void NotifyResultEnterKanturuBossMap(int iIndex);
};
extern CKanturuEntranceNPC g_KanturuEntranceNPC;
#endif |
0dbd9436aeaa2cf73ba02522b170478912bc94de | f17392de7d4dbf0dba252bf3b0336619dcc02019 | /src/ObjectMap.cpp | 9ff63052a8c119eb30d05d8efb6093c7da7755c1 | [] | no_license | m2omou/bomberman | 3d1f269968a31ed6f941e90826007f6baf438be5 | f183453764891e81b2ee2f5b0d5cf9d80aab0912 | refs/heads/master | 2020-05-16T23:49:17.564197 | 2014-07-21T07:01:29 | 2014-07-21T07:01:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,519 | cpp | ObjectMap.cpp | #include "ObjectMap.hpp"
#include "AObject.hpp"
#include <typeinfo>
#include "SerializableFactory.hpp"
ObjectMap::ObjectMap(int width, int height)
: Map(width, height)
{
}
void ObjectMap::initialize(void)
{
ObjectMap::iterator it;
for (it = this->begin(); it != this->end(); ++it)
{
if ((*it).content != 0)
(*it).content->initialize();
}
}
void ObjectMap::update()
{
ObjectMap::iterator it;
for (it = this->begin(); it != this->end(); ++it)
{
if ((*it).content != 0)
(*it).content->update();
}
}
void ObjectMap::draw(void)
{
ObjectMap::iterator it;
for (it = this->begin(); it != this->end(); ++it)
{
if ((*it).content != 0)
(*it).content->draw();
}
}
ObjectMap::~ObjectMap()
{
ObjectMap::iterator it;
for (it = this->begin(); it != this->end(); ++it)
{
if ((*it).content != 0)
delete (*it).content;
}
}
std::string t_caseObject::serialize() const
{
std::stringstream ss;
if (content)
{
std::string tmp = content->serialize();
ss << typeid(*content).name() << " " << tmp.size() << " " << tmp;
return ss.str();
}
return "null";
}
void t_caseObject::unserialize(const std::string &str)
{
std::stringstream ss(str);
if (!str.compare("null"))
content = 0;
else
{
std::string tmp;
ss >> tmp;
content = static_cast<AObject*>(SerializableFactory::create(tmp));
content->initialize();
content->unserialize(Serializer::extractSerializable(ss));
}
}
|
9c9bfbe70d0f53c80e385a0f220b83b528e45369 | 070740e4005b1d04ecc399e2c598bd943bf5922a | /DesignPatterns/ChainOfRespon/Application.h | d3c22eb4b01181f5d96606ce75a5ee562227f261 | [] | no_license | yylwuwei/HelloWorld | df30718be3bdd1f40237a3aaad368dcc15895bdc | dc4fc5884b6f6b9de23dc719334b0e96fad5e5e5 | refs/heads/master | 2021-01-17T14:31:24.105647 | 2015-06-13T14:14:22 | 2015-06-13T14:14:22 | 7,886,919 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 224 | h | Application.h | #pragma once
#include "helphandler.h"
class Application : public HelpHandler
{
public:
//the last object to deal with help request
Application(Topic topic):HelpHandler(NULL, topic)
{
}
virtual void HandleHelp();
};
|
0f20cdfadd35d5f09e2c0af7a56079b65921e9ca | ba44ca818aca6cbe5b024d7cd2b3bb23a55d9744 | /cpp_solutions/chapter_10_sorting_and_searching/problem_10_02_anagramSort.h | cbab0188c9926e581db49234a5d0f168463d0c37 | [
"BSD-3-Clause"
] | permissive | isayapin/cracking-the-coding-interview | 609ed07b6986f6637dea63f5895620353feec4fa | dce288e3aa4107ff84b95ae0f8bf1b4a92422587 | refs/heads/master | 2023-01-08T10:23:16.918337 | 2020-11-08T15:33:14 | 2020-11-08T15:33:14 | 259,108,359 | 0 | 0 | NOASSERTION | 2020-11-08T15:33:15 | 2020-04-26T18:50:59 | null | UTF-8 | C++ | false | false | 1,675 | h | problem_10_02_anagramSort.h | /*
* PROBLEM:
* Given an array of strings, sort the array such that all anagrams are next to each other.
* Anagrams are strings that contain the same characters e.g. "abc" and "bca".
*
* TEST CASE:
* Input: {ddd, abc, ccc, bac, aaa, cab, bbb, acb}
* Output: {aaa, abc, acb, bac, cab, bbb, ccc, ddd}
* Note that the only requirement is for anagrams to be next to each other. The order of the anagram groups and the
* order of the sorted array does not matter.
*
* ALGORITHM:
* 1. Initialize a hash table (std::map<std::string, std::vector<std::string>>) where keys are sorted anagrams
* and values are vectors of unsorted anagrams. This takes advantage of the observation that anagrams, when sorted, are
* identical. Use std::map instead of std:unordered_map to allow testability regardless of C++ compiler.
* 2. For each string in input array:
* a. Create a sorted version of the string.
* b. If the sorted string is already in the hash table, add the unsorted string to the vector of strings associated \
* with the sorted version.
* c. If the string is not in the hash table, add the sorted version as a key and the unsorted version as a value.
* 3. For each key in hash table, add contents of the associated vectors to a vector of strings.
*
* TIME COMPLEXITY:
* Step (1) takes O(1) time.
* Step (2) takes O(N) time assuming the strings are of constant length.
* Step (3) takes O(N) time.
* Thus, the algorithm takes O(N) time.
*
* SPACE COMPLEXITY:
* The hash table will require O(N) space.
*
* CODE:
*/
#pragma once
#include <vector>
#include <string>
namespace chapter_10 {
void anagramSort(std::vector<std::string>& array);
}
|
3298c513fbc9ddc096c8f1f2af0fe9d33b95a596 | 58ef4939342d5253f6fcb372c56513055d589eb8 | /ScheduleMessage/Client/source/MsgEditor/inc/MsgExpandableControl.h | 84571e91faacb8768c2edce2c304c6295dc046f3 | [] | no_license | flaithbheartaigh/lemonplayer | 2d77869e4cf787acb0aef51341dc784b3cf626ba | ea22bc8679d4431460f714cd3476a32927c7080e | refs/heads/master | 2021-01-10T11:29:49.953139 | 2011-04-25T03:15:18 | 2011-04-25T03:15:18 | 50,263,327 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,383 | h | MsgExpandableControl.h | /*
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: MsgExpandableControl declaration
*
*/
#ifndef CMSGEXPANDABLECONTROL_H
#define CMSGEXPANDABLECONTROL_H
// ========== INCLUDE FILES ================================
#include <eikedwob.h> // for MEikEdwinSizeObserver
#include <aknenv.h> // for CAknEnv
#include <AknUtils.h>
#include <eikcapc.h>
#include <fepbase.h>
#include "MsgExpandableTextEditorControl.h" // for CMsgBaseControl
// ========== CONSTANTS ====================================
// ========== MACROS =======================================
// ========== DATA TYPES ===================================
// ========== FUNCTION PROTOTYPES ==========================
// ========== FORWARD DECLARATIONS =========================
class CMsgExpandableControlEditor;
class CEikLabel;
class CRichText;
class CGlobalText;
class CEikRichTextEditor;
class CAknButton;
// ========== CLASS DECLARATION ============================
/**
* Defines an expandable control for message editors/viewers.
*/
class CMsgExpandableControl : public CMsgExpandableTextEditorControl,
public MCoeCaptionRetrieverForFep
{
public:
/**
* Constructor.
*/
IMPORT_C CMsgExpandableControl();
/**
* Constructor.
*/
IMPORT_C CMsgExpandableControl( MMsgBaseControlObserver& aBaseControlObserver );
/**
* Destructor.
*/
IMPORT_C ~CMsgExpandableControl();
/**
* Returns a reference to the editor control.
* @return
*/
IMPORT_C CEikRichTextEditor& Editor() const;
/**
* Returns a reference to the label control.
* @return
*/
IMPORT_C CEikLabel& Caption() const;
/**
* Sets text content of the control editor from the contents of
* a rich text object. Old content is discarded. Copies also
* formatting from given rich text object if plain text mode
* is disabled.
*
* @param aText New text content.
*/
IMPORT_C void SetTextContentL( CRichText& aText );
/**
* Sets text content of the control editor from the contents of
* a descriptor. Old content is discarded.
*
* @since 3.2
*
* @param aText New text content.
*/
IMPORT_C void SetTextContentL( const TDesC& aText );
/**
* Copies stripped content to aBuf. Control chars, newlines and if
* aNoExtraSemicolons is ETrue, also two consecutive semicolons are
* replaced with semicolon and space.
* @param aBuf buffer where stripped content will be copied.
* @param aMaxLen max length of aBuf.
* @param aNoExtraSemicolons ETrue if two consecutive semicolons must be handled.
*/
IMPORT_C void TextContentStrippedL( TDes& aBuf, TInt aMaxLen, TBool aNoExtraSemicolons = ETrue );
/**
* Calls iEditors HandleFrameSizeChangeL trapped
*/
void HandleFrameSizeChange();
/**
* Returns a pointer to the button control.
*
* @since 3.2
*
* @return Pointer to button control if available, otherwise NULL.
*/
// CAknButton* Button() const;
public: // from CMsgBaseControl
/**
* Creates this control from resource.
* @param aResourceId
*/
void ConstructFromResourceL( TInt aResourceId );
/**
* Prepares control for viewing.
* @param aEvent
* @param aParam
*/
void NotifyViewEvent( TMsgViewEvent aEvent, TInt aParam );
/**
* Resets (= clears) contents of the control.
*/
IMPORT_C void Reset();
/**
* Calculates and sets the size of the control and returns new size as
* reference aSize.
* @param aSize
*/
IMPORT_C void SetAndGetSizeL( TSize& aSize );
/**
* Checks if the focus change up or down is possible and
* returns ETrue if it is.
* @param aDirection
* @return
*/
IMPORT_C TBool IsFocusChangePossible( TMsgFocusDirection aDirection ) const;
public: // from CCoeControl
/**
* Sets container window.
* @param aContainer
*/
IMPORT_C void SetContainerWindowL( const CCoeControl& aContainer );
/**
* Handles key events.
* @param aKeyEvent
* @param aType
* @return
*/
IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
TEventCode aType );
/**
* Returns minimum size of the control.
* @return
*/
IMPORT_C TSize MinimumSize();
/**
* Returns control's input capabilities.
* @return
*/
IMPORT_C TCoeInputCapabilities InputCapabilities() const;
/**
* For handling dynamic layout switch.
*/
IMPORT_C void HandleResourceChange( TInt aType );
public: // from MCoeControlObserver
/**
* Handle control event.
* @param aControl
* @param aEventType
*/
IMPORT_C void HandleControlEventL( CCoeControl* aControl,
TCoeEvent aEventType );
public: // from MCoeCaptionRetrieverForFep
/**
* Returns a caption for called
* @param aCaption On return, contains the caption.
*/
void GetCaptionForFep( TDes &aCaption ) const;
protected:
/**
* Creates the editor for the control.
* @return
*/
CMsgExpandableControlEditor* CreateEditorL();
/**
* Reads control properties from resource.
* @param aReader
*/
virtual void ReadControlPropertiesFromResourceL( TResourceReader& aReader );
/**
* Creates caption for the control from resource.
* @param aReader
* @return
*/
virtual CEikLabel* CreateCaptionFromResourceL( TResourceReader& aReader );
/**
* Creates editor for the control from resource.
* @param aReader
* @return
*/
virtual CMsgExpandableControlEditor* CreateEditorFromResourceL(
TResourceReader& aReader );
/**
* Sets the correct layout for button.
*/
virtual void LayoutButton();
protected: // from CMsgBaseControl
/**
* Prepares for read only or non read only state.
* @param aReadOnly
*/
void PrepareForReadOnly( TBool aReadOnly );
/**
* Reads layout data from "LAF".
*/
virtual void ResolveLayoutsL();
protected: // from CCoeControl
/**
* Returns a number of controls.
* @return
*/
IMPORT_C TInt CountComponentControls() const;
/**
* Returns a control of index aIndex.
* @param aIndex
* @return
*/
IMPORT_C CCoeControl* ComponentControl( TInt aIndex ) const;
/**
* Sets new position for all the controls.
*/
IMPORT_C void SizeChanged();
/**
* This is called when the focus of the control is changed.
* @param aDrawNow
*/
IMPORT_C void FocusChanged( TDrawNow aDrawNow );
/**
* Draw control.
* @param aRect
*/
IMPORT_C void Draw( const TRect& aRect ) const;
/**
* Sets the control as ready to be drawn. This implementation
* should be called by the derived classes implementing their
* own ActivateL function.
*/
IMPORT_C void ActivateL();
private:
/**
* Performs view event handling.
*/
void DoNotifyViewEventL( TMsgViewEvent aEvent, TInt aParam );
/**
* Updates text color for caption from current skin.
*/
void UpdateCaptionTextColorL();
protected:
CEikLabel* iCaption;
TAknLayoutText iCaptionLayout;
// Offset between control and caption. Used for highlight etc.
TInt iCaptionTop;
TAknLayoutText iEditorLayout;
// Offset between control and editor. Used for highlight etc.
// TAknLayoutRect iFrameLayout;
//CAknButton* iButton;
TAknLayoutRect iButtonLayout;
TInt iButtonTop;
TInt iCtrltype;
};
#endif // CMSGEXPANDABLECONTROL_H
// End of File
|
a1bf27bdb57ffb04799503bb20fdaef4d35158da | cc03da06df7a960f8736b03e5a946c29daf002ca | /qDataGeneratorTracking.cpp | 4b263f1d4469a53c66a732437fbdb23b122324df | [] | no_license | HLMizuno/OpenIGTLinkSimulator | 37bc2c81bde1731bc0085b4ff1c87c7a8d0fa328 | 6ba9d6c82844ba53c3c5fc65841b34e18a3b7531 | refs/heads/master | 2021-01-17T17:13:27.024349 | 2014-09-05T20:10:43 | 2014-09-05T20:10:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,408 | cpp | qDataGeneratorTracking.cpp | /*=========================================================================
Program: Data Generator Tracking Class for OpenIGTLink Simulator
Language: C++
Copyright (c) Brigham and Women's Hospital. All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include <cstring>
#include <sstream>
#include <cmath>
#include "qDataGeneratorTracking.h"
//-----------------------------------------------------------------------------
qDataGeneratorTracking::qDataGeneratorTracking(): qDataGeneratorBase()
{
//------------------------------------------------------------
// Allocate TrackingData Message Class
//
// NOTE: TrackingDataElement class instances are allocated
// before the loop starts to avoid reallocation
// in each image transfer.
this->TrackingMsg = igtl::TrackingDataMessage::New();
this->TrackingMsg->SetDeviceName("Tracker");
this->NumberOfChannels = 3;
this->TrackingElement.resize(this->NumberOfChannels);
this->Phi.resize(this->NumberOfChannels);
this->Theta.resize(this->NumberOfChannels);
this->fTracking = 0;
for (int i = 0; i <this->NumberOfChannels; i ++)
{
std::stringstream ss;
ss << "Channel " << i;
this->TrackingElement[i] = igtl::TrackingDataElement::New();
this->TrackingElement[i]->SetName(ss.str().c_str());
this->TrackingElement[i]->SetType(igtl::TrackingDataElement::TYPE_TRACKER);
this->TrackingMsg->AddTrackingDataElement(this->TrackingElement[i]);
this->Phi[i] = 0.0;
this->Theta[i] = 0.0;
}
}
//-----------------------------------------------------------------------------
qDataGeneratorTracking::~qDataGeneratorTracking()
{
}
//-----------------------------------------------------------------------------
void qDataGeneratorTracking::RegisterHandlers(igtl::TCPConnectorServerOIGTL * connector)
{
connector->RegisterMessageHandler("STT_TDATA", this);
connector->RegisterMessageHandler("STP_TDATA", this);
}
//-----------------------------------------------------------------------------
void qDataGeneratorTracking::GenerateData(igtl::MessageBase::Pointer& data)
{
if (this->fTracking)
{
igtl::Matrix4x4 matrix;
igtl::TrackingDataElement::Pointer ptr;
for (int i = 0; i < this->NumberOfChannels; i ++)
{
std::cerr << "Data for Channel:" << i << std::endl;
this->TrackingMsg->GetTrackingDataElement(i, ptr);
GetRandomTestMatrix(matrix, this->Phi[i], this->Theta[i]);
ptr->SetMatrix(matrix);
this->Phi[i] += 0.1*(float)(i+1);
this->Theta[i] += 0.05*(float)(i+1);
}
this->TrackingMsg->Pack();
data = this->TrackingMsg;
}
}
//------------------------------------------------------------
int qDataGeneratorTracking::HandleReceivedMessage(igtl::Socket *socket, igtl::MessageHeader * header)
{
std::cerr << "qDataGeneratorTracking::HandleReceivedMessage() : " << header->GetDeviceType() << std::endl;
if (strcmp(header->GetDeviceType(), "STT_TDATA") == 0)
{
igtl::StartTrackingDataMessage::Pointer sttMsg;
sttMsg = igtl::StartTrackingDataMessage::New();
sttMsg->SetMessageHeader(header);
sttMsg->AllocatePack();
if (socket && socket->GetConnected())
{
int r = socket->Receive(sttMsg->GetPackBodyPointer(), sttMsg->GetPackBodySize());
if (r == 0)
{
// Connection closed.
return 0;
}
}
else
{
return 0;
}
int c = sttMsg->Unpack(1);
if (c & igtl::MessageHeader::UNPACK_BODY) // if CRC check is OK
{
int interval = sttMsg->GetResolution();
if (interval > 100)
this->SetInterval(interval);
this->fTracking = 1;
return 1;
}
}
else if (strcmp(header->GetDeviceType(), "STP_TDATA") == 0)
{
igtl::StopTrackingDataMessage::Pointer stpMsg;
stpMsg = igtl::StopTrackingDataMessage::New();
stpMsg->SetMessageHeader(header);
stpMsg->AllocatePack();
//if (socket && socket->GetConnected())
// {
// //int r = socket->Receive(stpMsg->GetPackBodyPointer(), stpMsg->GetPackBodySize());
// //if (r == 0)
// // {
// // // Connection closed.
// // return 0;
// // }
// }
//else
// {
// return 0;
// }
//
//int c = stpMsg->Unpack(1);
//if (c & igtl::MessageHeader::UNPACK_BODY) // if CRC check is OK
// {
this->fTracking = 0;
return 1;
//}
}
return 1;
}
//------------------------------------------------------------
void qDataGeneratorTracking::GetRandomTestMatrix(igtl::Matrix4x4& matrix, float phi, float theta)
{
float position[3];
float orientation[4];
// random position
position[0] = 50.0 * cos(phi);
position[1] = 50.0 * sin(phi);
position[2] = 50.0 * cos(phi);
phi = phi + 0.2;
// random orientation
orientation[0]=0.0;
orientation[1]=0.6666666666*cos(theta);
orientation[2]=0.577350269189626;
orientation[3]=0.6666666666*sin(theta);
theta = theta + 0.1;
//igtl::Matrix4x4 matrix;
igtl::QuaternionToMatrix(orientation, matrix);
matrix[0][3] = position[0];
matrix[1][3] = position[1];
matrix[2][3] = position[2];
igtl::PrintMatrix(matrix);
}
//-----------------------------------------------------------------------------
void qDataGeneratorTracking::ChannelChanged(int i)
{
this->TrackingMsg = igtl::TrackingDataMessage::New();
this->TrackingMsg->SetDeviceName("Tracker");
this->NumberOfChannels = i;
this->TrackingElement.resize(this->NumberOfChannels);
this->Phi.resize(this->NumberOfChannels);
this->Theta.resize(this->NumberOfChannels);
this->fTracking = 0;
for (int i = 0; i < this->NumberOfChannels; i ++)
{
std::stringstream ss;
ss << "Channel " << i;
this->TrackingElement[i] = igtl::TrackingDataElement::New();
this->TrackingElement[i]->SetName(ss.str().c_str());
this->TrackingElement[i]->SetType(igtl::TrackingDataElement::TYPE_TRACKER);
this->TrackingMsg->AddTrackingDataElement(this->TrackingElement[i]);
this->Phi[i] = 0.0;
this->Theta[i] = 0.0;
}
}
|
5ba116d3366c80164c85387eb5b158868b0d02d3 | 0356ed0691256155cc710de0b6ef4997ab1408e0 | /source/yats/include/yats/slot.h | c60295058c2a47e22ede75e04304eadf8ee2188e | [
"MIT"
] | permissive | hpicgs/yats | 205746ae53fbbd643ff5d15a7889450afd712833 | 60b024613b94ab53b7623d6cd670bca377a46be5 | refs/heads/master | 2021-05-07T02:12:40.820032 | 2018-04-06T17:25:12 | 2018-04-06T17:25:12 | 110,519,860 | 4 | 1 | MIT | 2018-04-06T17:25:13 | 2017-11-13T08:19:53 | C++ | UTF-8 | C++ | false | false | 2,036 | h | slot.h | #pragma once
#include <cstdint>
#include <tuple>
#include <type_traits>
#include <utility>
namespace yats
{
template <typename... Args>
class output_bundle
{
public:
template <typename... Params>
output_bundle(Params&&... params)
: m_return_values(std::forward<Params>(params)...)
{
}
std::tuple<Args...> tuple() &&
{
return std::move(m_return_values);
}
protected:
std::tuple<Args...> m_return_values;
};
/**
* Main class to represent a slot.
* @param T Type of slot value
* @param Id Unique identifier of slot.
*/
template <typename T, uint64_t Id>
class slot
{
public:
using value_type = T;
static constexpr uint64_t id = Id;
static_assert(std::is_move_constructible<value_type>::value, "The slots value type has to be move constructible.");
/**
* Creates a new slot object.
* @param value Initial value of slot
*/
slot(value_type value)
: m_value{ std::move(value) }
{
}
template <uint64_t OtherID>
slot(const slot<T, OtherID>& other)
: m_value(other.m_value)
{
}
template <uint64_t OtherID>
slot(slot<T, OtherID>&& other)
: m_value(std::move(other.m_value))
{
}
operator const value_type&() const
{
return m_value;
}
operator value_type&()
{
return m_value;
}
T& operator*()
{
return m_value;
}
template <typename Type = T>
std::enable_if_t<std::is_pointer<Type>::value, Type> operator->()
{
return m_value;
}
template <typename Type = T>
std::enable_if_t<!std::is_pointer<Type>::value, Type*> operator->()
{
return &m_value;
}
template <typename Type = T>
std::enable_if_t<std::is_copy_constructible<Type>::value, Type> clone() const
{
return m_value;
}
T extract()
{
return std::move(m_value);
}
protected:
value_type m_value;
};
template <typename T, uint64_t Id>
constexpr uint64_t slot<T, Id>::id;
}
|
39af92514494d538aea02f1fe64cb72f0b95631c | 32dd914187a35418f883db741520a305a8b90226 | /Ellipses.cpp | 26836c5c5d753ac8fab3137c1147ff6f5a582a57 | [] | no_license | Frostjaw/sp_lab4 | b28c913e39cad206a7513cc3efb527f1d9053602 | 4a575d1003b02835c48301c065a98d8ac0e9e830 | refs/heads/main | 2022-12-24T15:41:36.499133 | 2020-10-10T05:56:17 | 2020-10-10T05:56:17 | 302,826,285 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 581 | cpp | Ellipses.cpp | #include <windows.h>
#include "resource.h"
#include "MainWindow.h"
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR, int nCmdShow)
{
MainWindow win;
HACCEL hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCEL1));
win.Register();
if (!win.Create(L"Ellipses", WS_OVERLAPPEDWINDOW))
{
return 0;
}
ShowWindow(win.Window(), nCmdShow);
// Run the message loop.
MSG msg = {};
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(win.Window(), hAccel, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return 0;
}
|
405fe2847fcb56c3eefef242dadaecb775c0c6b0 | a14ac66b8ad248a284a63b8e28c49e8540f950c6 | /src/texture.cpp | 9933af946132e12f96fd8e5977d790aaaed998e7 | [] | no_license | Mazrog/endora | 6a0aaecc9ee0b3f7014c353c49efdf8c31a07c27 | a8b81dcf798fb198bfbd9c62f26289b75ccafc0b | refs/heads/master | 2021-04-15T18:04:59.083431 | 2019-10-26T16:16:44 | 2019-10-26T16:16:44 | 126,400,117 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,793 | cpp | texture.cpp | //
// Created by mazrog on 17/04/18.
//
#include <endora/texture.hpp>
#include <endora/utils.hpp>
Texture::Texture(GLenum type) : _type(type) {}
Texture::~Texture() {
for(auto const& id : _ids) {
if (id) {
glDeleteTextures(1, &id);
endora_error("Texture deletion");
}
}
}
unsigned int Texture::generate_texture() {
GLuint texture;
glGenTextures(1, &texture); endora_error("Texture generation");
_ids.push_back(texture);
return _ids.size()-1;
}
unsigned int Texture::load_texture_to_vram(unsigned width, unsigned height, void * pixels, GLenum internal_format, GLenum format) {
generate_texture();
bind();
glTexImage2D(_type, 0, internal_format,
width,
height, 0,
format, GL_UNSIGNED_BYTE, pixels);
endora_error("tex image 2D");
glTexParameteri(_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR); endora_error("mipmap linear");
glTexParameteri(_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR); endora_error("texture param MAG");
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
float border_color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, border_color);
return _ids.size()-1;
}
void Texture::bind() const {
bind(_ids.size()-1);
}
void Texture::bind(GLuint index) const {
glBindTexture(_type, _ids.at(index)); endora_error("Texture binding");
}
void Texture::send(unsigned index, int slot) const {
glActiveTexture(GL_TEXTURE0 + slot); endora_error("Texture active");
bind(index);
}
void Texture::disable() {
glBindTexture(_type, 0); endora_error("disable texture");
}
|
c6aaf9c882b4a088f3c732b723f0971658e5677f | 7346a08f114af67997d7e162845cad6a6fbf5da1 | /Data Structure(C++)/Vector&Pointer/main.cpp | 06e3584d35dbd192ce0c3052eb8eed0741266d7e | [] | no_license | ruiwenhe-10/Data-structure-Implementation-and-Practice-CPP | 9fa62e5b63b4968f719382ba8ecc0be0a6f6103c | 8797cf4146046c11b36e4d6b37d376f66b277dfd | refs/heads/master | 2022-12-26T14:34:20.584111 | 2020-09-21T05:06:42 | 2020-09-21T05:06:42 | 296,963,845 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 492 | cpp | main.cpp | #include <iostream>
using namespace std;
#include "IntVector.h"
int main() {
IntVector a(0);
cout << a.size() << endl;
cout << a.capacity() << endl;
if (a.empty()) {
cout << "true" << endl;
}
else {
cout << "false" << endl;
}
a.insert(0, 1);
for (unsigned i = 0; i < a.size(); ++i) {
cout << a.at(i) << ' ';
}
cout << endl;
return 0;
} |
1d5b1ebc7168e113cfc9f4bafbd984592c238e2c | 28872b04166f1e2b2021889b8ad9c6a877b128f5 | /hollywood name list.cpp | 011caf0c0b4337476dca610aee3a1292f081f915 | [] | no_license | Arpan-shrma/Game-of-Hangman | c88fb23e402507727e7eb2d7811a382540847fee | 879691e2c0aa37d0697aa716de959b3191e74b49 | refs/heads/master | 2022-04-11T09:05:01.914329 | 2020-04-10T10:38:14 | 2020-04-10T10:38:14 | 254,608,583 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 287 | cpp | hollywood name list.cpp | #include<iostream>
#include<conio.h>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{char name[100];
ofstream file("ollywood.txt");
if(file.fail())
{cout<<"error";
}cout<<"enter movie list name";
cin>>name;
for(int i=0;i<1;i++)
{
cout<<name;
}
}
|
28ba154f5a726dd099c5ba37484bde949f10a1ff | 20bc832fd0d882923d0a00f6c82c21ff54060cb5 | /avios.cpp | 09b7c933a623926471eefbda63e00cd2e8f6eb9a | [] | no_license | madhuavinash11/OS-PROJECT | a38882f9cf1df26b5d3c01a5f2f5bccbf787dc4c | 2abc87efaac524b93bf220b04f9bc7fdf6aebf56 | refs/heads/master | 2020-03-10T14:29:05.032913 | 2018-04-13T16:25:26 | 2018-04-13T16:25:26 | 129,424,118 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,403 | cpp | avios.cpp | #include<iostream>
#include<conio.h>
using namespace std;
main()
{
int id[3]={2132,2102,2453},time=0;
int p[3]={2,4,8},pa=0;
cout<<"\n student s1 id is:"<<id[0]<<" process time is :"<<p[0]<<"\n";
cout<<"\n student s2 id is:"<<id[1]<<" process time is :"<<p[1]<<"\n";
cout<<"\n student s3 id is:"<<id[2]<<" process time is :"<<p[2]<<"\n";
cout<<"\n\n";
cout<<"order \tp1 p2 p3\n\n";
cout<<"----- \t--------\n";
cout<<"\t"<<p[0]<<" "<<p[1]<<" "<<p[2]<<"\n\n";
for(int i=0;i<14;i++)
{
if(p[2]>p[1] && p[2]>p[1] && p[2]>=pa)
{
p[2]=p[2]-1;
cout<<" p3\t";
}
else if(p[1]>p[0] && p[1]>p[2] && p[1]>=pa)
{
p[1]=p[1]-1;cout<<" p2\t";
}
else if(p[0]>p[2] && p[0]>p[1] && p[0]>=pa)
{
p[0]=p[0]-1;cout<<" p1\t";
}
else if(p[2]==p[1])
{
if(id[2]<id[1])
{
p[2]=p[2]-1;cout<<" p3\t";
}
else if(id[1]<id[2])
{
p[1]=p[1]-1;cout<<" p2\t";
}
}
else if(p[2]==p[0])
{
if(id[2]<id[0])
{
p[2]=p[2]-1;cout<<" p3\t";
}
else if(id[0]<id[2])
{
p[0]=p[0]-1;cout<<" p1\t";
}
}
else if(p[0]==p[1])
{
if(id[0]<id[1])
{
p[0]=p[0]-1;cout<<" p1\t";
}
else if(id[1]<id[0])
{
p[1]=p[1]-1;cout<<" p2\t";
}
}
cout<<p[0]<<" "<<p[1]<<" "<<p[2]<<"\n\n";
time =time+1;
}
cout<<"\n time taken to complete all 3 processes is :"<<time;
}
|
77ec617ba3db335c789a367a1037d8a06907ff80 | 19a5be6bd612e59e75d835a809cb5e55ab5d9066 | /Practica2parte2.cpp | 96a7fe85ab869f4b971a63f6ed1a3a34be4cc491 | [] | no_license | SaulRamirezz/Practica2parte2 | 74f3d265367dff68d45aa59385f9433793728561 | 6ce4d84bd1b68e1f3b74db44fb82ebdfccd34f78 | refs/heads/master | 2022-10-13T10:21:59.239646 | 2020-06-01T00:41:27 | 2020-06-01T00:41:27 | 268,390,397 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,187 | cpp | Practica2parte2.cpp | #include <iostream>
using namespace std;
//Voy a mejorar este programa pero mientras subo este :v
int main()
{
int servicios, otra = 0, saldo = 200, InOut = 0;
cout << "Hola, bienvenido a la termial TeleNook." << endl;
cout << "1.- Consultar saldo 2.- Retirar creditos 3.- Ingresar creditos" << endl;
cout << "Cual de nuestros servicios quieres usar?: "; cin >> servicios;
switch (servicios) {
case 1:
cout << "Tu saldo es de: " << saldo << " millas." << endl;
break;
case 2:
cout << "Cuantos creditos deseas retirar?: "; cin >> InOut;
if (saldo < InOut) {
cout << "No tienes las millas suficientes para retirar esa cantidad." << endl;
}
else {
saldo = saldo - InOut;
cout << "Creditos retirados correctamente." << endl;
cout << "Su saldo actual es de: " << saldo << " millas." << endl;
}
break;
case 3:
cout << "Cuantos creditos desea ingresar?: "; cin >> InOut;
saldo = saldo + InOut;
cout << "Creditos ingresados correctamente, su saldo actual es de: " << saldo << " millas." << endl;
break;
}
cout << "Estamos teniendo fallas tecincas por el momento, si desea utilizar otro servicio por favor reinicie la terminal.";
return 1;
}
|
c59d67ab1b524d49d705afce6f181037d70bee3b | a5f3b0001cdb692aeffc444a16f79a0c4422b9d0 | /main/autodoc/inc/autodoc/x_parsing.hxx | 8aa9940fe71b9adfed9e40f1e2d3a000fa5e4127 | [
"Apache-2.0",
"CPL-1.0",
"bzip2-1.0.6",
"LicenseRef-scancode-other-permissive",
"Zlib",
"LZMA-exception",
"LGPL-2.0-or-later",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-philippe-de-muyter",
"OFL-1.1",
"LGPL-2.1-only",
"MPL-1.1",
"X11",
"LGPL-2.1-or-later",
"GPL-2.0-only",
"OpenSSL",
"LicenseRef-scancode-cpl-0.5",
"GPL-1.0-or-later",
"NPL-1.1",
"MIT",
"MPL-2.0",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-unknown-license-reference",
"MPL-1.0",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"BSL-1.0",
"LicenseRef-scancode-docbook",
"LicenseRef-scancode-mit-old-style",
"Python-2.0",
"BSD-3-Clause",
"IJG",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-2.0-or-later",
"LGPL-2.0-only",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown",
"BSD-2-Clause",
"Autoconf-exception-generic",
"PSF-2.0",
"NTP",
"LicenseRef-scancode-python-cwi",
"Afmparse",
"W3C",
"W3C-19980720",
"curl",
"LicenseRef-scancode-x11-xconsortium-veillard",
"Bitstream-Vera",
"HPND-sell-variant",
"ICU"
] | permissive | apache/openoffice | b9518e36d784898c6c2ea3ebd44458a5e47825bb | 681286523c50f34f13f05f7b87ce0c70e28295de | refs/heads/trunk | 2023-08-30T15:25:48.357535 | 2023-08-28T19:50:26 | 2023-08-28T19:50:26 | 14,357,669 | 907 | 379 | Apache-2.0 | 2023-08-16T20:49:37 | 2013-11-13T08:00:13 | C++ | UTF-8 | C++ | false | false | 1,681 | hxx | x_parsing.hxx | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef AUTODOC_X_PARSING_HXX
#define AUTODOC_X_PARSING_HXX
// USED SERVICES
#include <iostream>
namespace autodoc
{
class X_Parser_Ifc
{
public:
// TYPES
enum E_Event
{
x_Any = 0,
x_InvalidChar,
x_UnexpectedToken,
x_UnexpectedEOF,
x_UnspecifiedSyntaxError
};
// LIFECYCLE
virtual ~X_Parser_Ifc() {}
// INQUIRY
virtual E_Event GetEvent() const = 0;
virtual void GetInfo(
std::ostream & o_rOutputMedium ) const = 0;
};
} // namespace autodoc
std::ostream & operator<<(
std::ostream & o_rOut,
const autodoc::X_Parser_Ifc &
i_rException );
#endif
|
94b875e966a345444aefb0be0dbe11f1a6ec5393 | 08bfc8a1f8e44adc624d1f1c6250a3d9635f99de | /SDKs/ilmbase/ImathTest/testInvert.cpp | 4a6a756fac965fcecb039ec3d558f73f82e7b8c1 | [] | no_license | Personwithhat/CE_SDKs | cd998a2181fcbc9e3de8c58c7cc7b2156ca21d02 | 7afbd2f7767c9c5e95912a1af42b37c24d57f0d4 | refs/heads/master | 2020-04-09T22:14:56.917176 | 2019-07-04T00:19:11 | 2019-07-04T00:19:11 | 160,623,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | cpp | testInvert.cpp | version https://git-lfs.github.com/spec/v1
oid sha256:f01cfb59bf9653f873d897fa437e2efea1e4809a957a3bfa84e3d2e5537147d3
size 4548
|
5708dd76c93a871af896a7ce7686500c56706c22 | 6e6ebd0a854d9094d15dcc90e2d6d07eec05355d | /DuiLib/Control/UIWebBrowserCEF.cpp | a8929325adf024c7cbf0902f06c4d7d6b0f87196 | [
"BSD-2-Clause",
"MIT"
] | permissive | wxxweb/duilib-old | d65eda04b2f34122acaea881edf4e2944ef54f19 | 7f19dac5a04bb176146c9fa95d6b92c0a36e6b61 | refs/heads/master | 2021-05-04T02:27:22.054211 | 2016-11-30T03:26:38 | 2016-11-30T03:26:38 | 21,518,517 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 8,841 | cpp | UIWebBrowserCEF.cpp | #include "StdAfx.h"
#ifdef UILIB_WEBBROSER_CEF
#include "UIWebBrowserCEF.h"
#include "../Utils/cef_web_browser.h"
#include "../Utils/cef_web_browser_event_handler_i.h"
#include <Shlwapi.h>
#include <set>
#pragma comment(lib, "w2x_cef.lib")
namespace DuiLib
{
class CInternEventHandler: public ICefWebBrowserEventHandler
{
public:
CInternEventHandler(CWebBrowserCefUI* _ui, ICefWebBrowserEventHandler* _impl)
: m_ui(_ui), m_pImpl(_impl) {}
~CInternEventHandler(void) {}
public:
virtual void OnAfterCreated(const TSTDSTR& _startup_url)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnAfterCreated(_startup_url);
}
virtual void OnBeforeClose(void)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnBeforeClose();
}
virtual void OnContextCreated(const TSTDSTR& _url, bool _is_main)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnContextCreated(_url, _is_main);
}
virtual void OnLoadStart(const TSTDSTR& _url, bool _is_main)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnLoadStart(_url, _is_main);
}
virtual void OnLoadEnd(const TSTDSTR& _url, bool _is_main)
{
if (NULL == m_pImpl) {
m_ui->SetInternVisible(true);
return;
}
m_pImpl->OnLoadEnd(_url, _is_main);
}
virtual bool OnLoadError(
/* [out] */ TSTDSTR& _error_text,
/* [in] */ const TSTDSTR& _failed_url,
/* [in] */ CefErrorCode _error_code
)
{
if (NULL == m_pImpl) { return false; }
return m_pImpl->OnLoadError(_error_text, _failed_url, _error_code);
}
virtual void OnNavStateChange(
const TSTDSTR& _url,
bool canGoBack,
bool canGoForward
)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnNavStateChange(_url, canGoBack, canGoForward);
}
virtual void OnAddressChange(const TSTDSTR& _url)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnAddressChange(_url);
}
virtual bool OnJsInvoke(
LPCTSTR _fn_name,
LPCTSTR _args
)
{
if (NULL == m_pImpl) { return false; }
return m_pImpl->OnJsInvoke(_fn_name, _args);
}
// virtual void OnConsoleMessage(const TSTDSTR& _msg)
// {
// if (NULL == m_pImpl) { return; }
// m_pImpl->OnConsoleMessage(_msg);
// }
virtual void OnUncaughtException(
const TSTDSTR& _msg,
const TSTDSTR& _stack_trace,
const TSTDSTR& _file_name,
const TSTDSTR& _src_line,
int _line_num,
int _column
)
{
if (NULL == m_pImpl) { return; }
m_pImpl->OnUncaughtException(_msg, _stack_trace, _file_name, _src_line, _line_num, _column);
}
public:
void SetImpl(ICefWebBrowserEventHandler* _impl)
{
m_pImpl = _impl;
}
private:
ICefWebBrowserEventHandler* m_pImpl;
CWebBrowserCefUI* m_ui;
};
class CWebBrowserCefUI::CImpl
{
public:
typedef std::set<TSTDSTR> ExternalSet;
public:
CImpl(void);
~CImpl(void);
public:
CCefWebBrowserWnd* m_pWindow;
CCefWebBrowser* const m_pCefWebBrowser;
CInternEventHandler* m_pEventHandler; // 浏览器事件处理
bool m_bInit;
bool m_bAutoNavi; // 是否启动时打开默认页面
static ExternalSet sm_external_set;
};
class CCefWebBrowserWnd : public CWindowWnd
{
public:
CCefWebBrowserWnd();
void Init(CWebBrowserCefUI* pOwner);
virtual LPCTSTR GetWindowClassName() const;
virtual void OnFinalMessage(HWND hWnd);
protected:
CWebBrowserCefUI* m_pOwner;
bool m_bInit;
};
CCefWebBrowserWnd::CCefWebBrowserWnd() : m_pOwner(NULL), m_bInit(false)
{
}
void CCefWebBrowserWnd::Init(CWebBrowserCefUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = m_pOwner->GetPos();
this->Create(m_pOwner->GetManager()->GetPaintWindow(),
TEXT("CefWebBrowserWnd"), UI_WNDSTYLE_CHILD, WS_EX_TOOLWINDOW, rcPos);
::SetClassLong(m_hWnd, GCL_HBRBACKGROUND, (LONG)::GetStockObject(WHITE_BRUSH));
m_bInit = true;
}
LPCTSTR CCefWebBrowserWnd::GetWindowClassName() const
{
return _T("CefWebBrowserWnd");
}
void CCefWebBrowserWnd::OnFinalMessage(HWND /*hWnd*/)
{
m_pOwner->Invalidate();
m_pOwner->m_impl->m_pWindow = NULL;
delete this;
}
CWebBrowserCefUI::CImpl::ExternalSet CWebBrowserCefUI::CImpl::sm_external_set;
CWebBrowserCefUI::CImpl::CImpl(void)
: m_pWindow(new CCefWebBrowserWnd)
, m_pCefWebBrowser(new CCefWebBrowser())
, m_pEventHandler(NULL)
, m_bInit(false)
, m_bAutoNavi(false)
{
}
CWebBrowserCefUI::CImpl::~CImpl(void)
{
if (NULL == m_pEventHandler) {
delete m_pEventHandler;
}
delete m_pCefWebBrowser;
delete m_pWindow;
}
CWebBrowserCefUI::CWebBrowserCefUI()
: m_impl(new CImpl)
{
m_impl->m_pEventHandler = new CInternEventHandler(this, NULL);
}
CWebBrowserCefUI::~CWebBrowserCefUI()
{
delete m_impl;
}
LPCTSTR CWebBrowserCefUI::GetClass() const
{
return _T("WebBrowserCefUI");
}
LPVOID CWebBrowserCefUI::GetInterface(LPCTSTR pstrName)
{
if( _tcscmp(pstrName, DUI_CTR_WEBBROWSER) == 0 ||
_tcscmp(pstrName, DUI_CTR_WEBBROWSERCEF) == 0 ) {
return static_cast<CWebBrowserCefUI*>(this);
}
return CControlUI::GetInterface(pstrName);
}
void CWebBrowserCefUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
if (_tcscmp(pstrName, _T("homepage")) == 0)
{
this->SetHomePage(pstrValue);
}
else if (_tcscmp(pstrName, _T("autonavi"))==0)
{
m_bAutoNavi = (_tcscmp(pstrValue, _T("true")) == 0);
} else {
CControlUI::SetAttribute(pstrName, pstrValue);
}
}
void CWebBrowserCefUI::SetPos(RECT rc)
{
CControlUI::SetPos(rc);
RECT rcPos = this->GetPos();
HWND hwnd = m_impl->m_pWindow->GetHWND();
::SetWindowPos(hwnd, NULL,
rcPos.left, rcPos.top, rcPos.right - rcPos.left,
rcPos.bottom - rcPos.top, SWP_NOZORDER | SWP_NOACTIVATE);
::GetWindowRect(hwnd, &rcPos);
m_impl->m_pCefWebBrowser->MoveBrowser(0, 0);
m_impl->m_pCefWebBrowser->ChangeBrowserSize(rc.right - rc.left, rc.bottom - rc.top);
}
void CWebBrowserCefUI::SetInternVisible(bool bVisible)
{
CControlUI::SetInternVisible(bVisible);
if (false == m_impl->m_bInit || NULL == m_impl->m_pCefWebBrowser) {
return;
}
HWND hWndParent = m_impl->m_pWindow->GetHWND();
HWND hWnd = m_impl->m_pCefWebBrowser->GetHwnd();
if (true == bVisible) {
::ShowWindow(hWndParent, SW_SHOW);
::ShowWindow(hWnd, SW_SHOW);
} else {
::ShowWindow(hWndParent, SW_SHOW);
::ShowWindow(hWnd, SW_HIDE);
}
}
void CWebBrowserCefUI::DoInit()
{
CControlUI::DoInit();
if (true == m_impl->m_bInit) {
return;
} else {
m_impl->m_bInit = true;
}
m_impl->m_pWindow->Init(this);
LPCTSTR pszUrl = TEXT("about:blank");
if (true == m_bAutoNavi && false == m_sHomePage.IsEmpty()) {
pszUrl = m_sHomePage.GetData();
}
if (true == m_impl->m_pCefWebBrowser->Create(
pszUrl, m_impl->m_pWindow->GetHWND(), m_impl->m_pEventHandler))
{
for (CImpl::ExternalSet::iterator it = CImpl::sm_external_set.begin(),
itEnd = CImpl::sm_external_set.end(); itEnd != it; ++it)
{
m_impl->m_pCefWebBrowser->AddExternal(*it);
}
}
}
void CWebBrowserCefUI::Navigate( LPCTSTR lpszUrl )
{
if (lpszUrl == NULL)
return;
if (m_impl->m_pCefWebBrowser)
{
m_impl->m_pCefWebBrowser->LoadUrl(lpszUrl);
}
}
void CWebBrowserCefUI::Refresh()
{
if (m_impl->m_pCefWebBrowser)
{
//m_pCefWebBrowser->
}
}
void CWebBrowserCefUI::GoBack()
{
if (m_impl->m_pCefWebBrowser)
{
//m_pCefWebBrowser->
}
}
void CWebBrowserCefUI::GoForward()
{
if (m_impl->m_pCefWebBrowser)
{
//m_pCefWebBrowser->
}
}
void CWebBrowserCefUI::NavigateHomePage()
{
if (!m_sHomePage.IsEmpty())
this->Navigate(m_sHomePage);
}
void CWebBrowserCefUI::SetWebBrowserEventHandler( CWebBrowserEventHandler* pEventHandler )
{
if (NULL == m_impl->m_pEventHandler) {
return;
}
if (NULL != pEventHandler &&
NULL != pEventHandler->GetInterface(DUI_WEB_BROWSER_EVENT_HANDLER_CEF))
{
CWebBrowserEventHandlerCEF* pEventHandlerCef =
static_cast<CWebBrowserEventHandlerCEF*>(pEventHandler);
pEventHandlerCef->RegisterControl(this);
m_impl->m_pEventHandler->SetImpl(pEventHandlerCef);
}
else if (NULL == pEventHandler) {
m_impl->m_pEventHandler->SetImpl(NULL);
}
else {
ASSERT(false);
}
}
bool CWebBrowserCefUI::ExecuteJsCode(LPCTSTR pstrJsCode)
{
if (NULL == m_impl->m_pCefWebBrowser) {
return false;
}
return m_impl->m_pCefWebBrowser->ExecuteJsCode(pstrJsCode);
}
bool CWebBrowserCefUI::AddExternal(LPCTSTR _fn_name)
{
if (NULL == _fn_name || TEXT('\0') == _fn_name[0]) {
return false;
}
CImpl::sm_external_set.insert(_fn_name);
return true;
}
bool CWebBrowserCefUI::RegisterCustomScheme(
LPCTSTR _scheme_name,
CustomSchemeHandler _handler
)
{
return CCefWebBrowser::RegisterCustomScheme(_scheme_name, _handler);
}
}; // namespace DuiLib
#endif // UILIB_WEBBROSER_CEF |
e97a5d2408acccdc6f6530b66f610749d2e8c2e3 | 8f8899e5dfdb5a54bcb4c538949b4d58dbed4d12 | /Codechef/CPP/Div2_September_2020/VBR_September.cpp | 087f365587a4c8dd52975377e7f021cb60fe5bea | [
"MIT"
] | permissive | kirito-udit/codeWith-hacktoberfest | 0fb7780299ea099563cbac2aabfeb33bd9135349 | 175ed242e38ca25887350052335f13b0b0c0e303 | refs/heads/main | 2022-12-27T10:28:49.304226 | 2020-10-09T05:35:22 | 2020-10-09T05:35:22 | 302,606,983 | 1 | 0 | MIT | 2020-10-09T10:22:01 | 2020-10-09T10:22:00 | null | UTF-8 | C++ | false | false | 2,809 | cpp | VBR_September.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007LL
#define For(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define int long long
#define ld long double
#define endl "\n"
int power_mod(int num,int g)
{
if(g==0)return 1;
if(g%2==1)return (num*power_mod((num*num)%mod,g/2))%mod;
return power_mod((num*num)%mod,g/2);
}
int power(int num,int g)
{
if(g==0)return 1;
if(g%2==1)return (num*power((num*num),g/2));
return power((num*num),g/2);
}
#define N 10001
int n,m,k;
vector<pair<int,int> > vec[N];
pair<int,int> a[N];
bool visit[N];
int32_t main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin>>n>>m>>k;
For(i,n)cin>>a[i].ff;
For(i,n)a[i].ss=i+1;
sort(a,a+n);
vector<int> vec1;
For(i,m){
int u,v,s;
cin>>u>>v>>s;
vec[u].pb(mp(s,v));
vec[v].pb(mp(s,u));
}
set<pair<int,int> > st;
for(int i=1;i<=n;i++)
sort(vec[i].begin(), vec[i].end());
for(int po=0;po<n;po++){
int i=a[po].ss;
if(vec[i].size()<=k-1)continue;
bool is=false;
mem(visit,false);
visit[i]=true;
int x=i,y=-1;
int u=1;
while(u<256){
u++;
int l=vec[x].size();
y=-1;
int z=INT_MAX;
int o=0;
For(j,l) {
if(st.find(mp(x,vec[x][j].ss))!=st.end()){
continue;
}
vec[x][o]=vec[x][j];
o++;
}
while(l>o){
l--;
vec[x].pop_back();
}
For(j,l) {
if(z>vec[x][j].ff){
z=vec[x][j].ff;
y=vec[x][j].ss;
}
}
if(y==-1)break;
if(visit[y])break;
For(j,l)visit[vec[x][j].ss]=true;
st.insert(mp(x,y));
st.insert(mp(y,x));
x=y;
is=true;
}
// cout<<endl;
if(is){
// cout<<i<<endl;
vec1.pb(i);
po--;
}
}
cout<<vec1.size()<<endl;
For(i,vec1.size())cout<<vec1[i]<<" ";
cout<<endl;
int c[n+1];
for(int i=1;i<=n;i++)c[i]=-1;
for(int i=1;i<=n;i++){
set<int> st1;
For(j,vec[i].size()) {
st1.insert(c[vec[i][j].ss]);
}
int x=1;
for(auto it:st1){
if(it==x)x++;
}
c[i]=x;
}
for(int i=1;i<=n;i++)cout<<c[i]<<" ";cout<<endl;
return 0;
} |
73a5905a08942ec2213c40e5d7dc53a4b9abe3e0 | 27bf674fc2272994d941ecbe4b175d2b788d1896 | /cbzcomic.cpp | 735e7aed351a9ad64339fc67af68b08618a37760 | [] | no_license | IgnacioMV/CBR | fed91c43434d2ed0407b8fd9cf693887098e96ad | a79ccda6e49c20b86f709c14f36df76dbb366ea5 | refs/heads/master | 2021-04-30T10:56:57.365204 | 2018-03-24T21:12:26 | 2018-03-24T21:12:26 | 121,343,308 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,337 | cpp | cbzcomic.cpp | #include "cbzcomic.h"
#include "comic.h"
#include "image.h"
#include "bmp.h"
#include "jpeg.h"
#include "png.h"
#include "cbzextractworker.h"
#include <QMainWindow>
#include <QDebug>
#include <QThread>
int CBZComic::extract(const QMainWindow *mainWindow)
{
qInfo() << "thumbnailThread->isRunning()";
QThread* thread= new QThread();
cbzWorker = new CBZExtractWorker();
cbzWorker->moveToThread( thread );
QObject::connect( thread, SIGNAL(started()), cbzWorker, SLOT(start()) );
QObject::connect( cbzWorker, SIGNAL(pageExtracted(Image *)), this, SLOT(addPage(Image *)));
QObject::connect( cbzWorker, SIGNAL(pageReady()), mainWindow, SLOT(pageReady()));
QObject::connect( cbzWorker, SIGNAL(finished()), this, SLOT(finishedExtraction()));
QObject::connect( cbzWorker, SIGNAL(finished()), mainWindow, SLOT(finishedExtraction()));
QObject::connect( cbzWorker, SIGNAL(finished()), thread, SLOT(quit()));
cbzWorker->setFilename(getFilename());
thumbnailThread.clear();
thumbnailThread.append(thread);
thread->start();
return 0;
}
void CBZComic::stopExtracting()
{
qInfo() << "begin stop";
cbzWorker->setRun(false);
if (!thumbnailThread.empty()) {
thumbnailThread.value(0)->exit();
thumbnailThread.value(0)->wait();
}
qInfo() << "finish stop";
}
|
bbf21e70cadb4d18ec739004ff14f99964a28be6 | d1283e273682c0565dfa6d9a2de759f78adf818d | /KMC/Thallium/Parameters.h | 6fae95ccf4e75dbf635fcadc8be05bd81d9c1103 | [] | no_license | adamsikora/School | eb5cb8cf7466dd865c5de79bc1a20bc6c3cb4b27 | e80ed577f66fc809062e2384664b71d16a84f9bc | refs/heads/master | 2016-09-10T01:21:20.963395 | 2015-10-08T10:23:44 | 2015-10-08T10:23:44 | 25,681,539 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,063 | h | Parameters.h | #pragma once
#include "StlBase.h"
class ParametersInternal // class for storing simulation parameters
{
public:
ParametersInternal() :
nu(0), T(0), E_M_M(0.0), E_M_Si(0.0), E_M_Tl(0.0), E_bM(0.0), E_b100(0.0), E_b111(0.0),
layersPerSec(0), targetCoverage(0.0), seed(0) {}
ParametersInternal
(
double nu, double T, double E_M_M, double E_M_Si, double E_M_Tl, double E_bM, double E_b100, double E_b111,
double layersPerSec, double targetCoverage, int seed
) :
nu(nu), T(T), E_M_M(E_M_M), E_M_Si(E_M_Si), E_M_Tl(E_M_Tl), E_bM(E_bM), E_b100(E_b100), E_b111(E_b111),
initialHeight(initialHeight), layersPerSec(layersPerSec), targetCoverage(targetCoverage), heatingRate(heatingRate), seed(seed) {}
double nu, T;
double E_M_M, E_M_Si, E_M_Tl, E_bM, E_b100, E_b111;
int initialHeight;
double layersPerSec, targetCoverage, heatingRate;
int seed;
};
class Parameters {
public:
void set(std::string parameterName, double parameterValue)
{
m_parameters[parameterName] = parameterValue;
}
void set(std::pair<std::string, double> pair)
{
m_parameters[pair.first] = pair.second;
}
double get(std::string parameterName) const
{
if (!m_parameters.count(parameterName)) {
std::cout << "There is no parameter with name " << parameterName << std::endl;
}
return m_parameters.find(parameterName)->second;
}
std::map<std::string, double> getAll() const
{
return m_parameters;
}
private:
std::map<std::string, double> m_parameters;
};
class Results {
public:
void set(std::string parameterName, double parameterValue)
{
m_parameters[parameterName] = parameterValue;
}
void set(std::pair<std::string, double> pair)
{
m_parameters[pair.first] = pair.second;
}
double get(std::string parameterName) const
{
if (!m_parameters.count(parameterName)) {
std::cout << "There is no result with name " << parameterName << std::endl;
}
return m_parameters.find(parameterName)->second;
}
std::map<std::string, double> getAll()
{
return m_parameters;
}
private:
std::map<std::string, double> m_parameters;
}; |
cf95bd4efe72d9740ef5fd1020e024fbd671321f | eea7c201962b016c9e17078dd531d682d491bff2 | /Nana.Cpp11/source/gui/element.cpp | 433913f59ed39012f7aff8c49bfaecd25072321f | [
"BSL-1.0"
] | permissive | gfannes/nana | be828b370e2924a18ed16cd1e454a91c45547f99 | 3b8d33f9a98579684ea0440b6952deabe61bd978 | refs/heads/master | 2018-12-28T10:30:58.166529 | 2013-12-09T23:50:40 | 2013-12-09T23:50:40 | 15,054,894 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,514 | cpp | element.cpp | #include <nana/gui/element.hpp>
#include <nana/gui/detail/bedrock.hpp>
#include <map>
#include <string>
#if defined(STD_THREAD_NOT_SUPPORTED)
#include <nana/std_mutex.hpp>
#else
#include <mutex>
#endif
namespace nana{ namespace gui
{
//Element definitions
namespace element
{
class crook
: public crook_interface
{
bool draw(graph_reference graph, nana::color_t bgcolor, nana::color_t fgcolor, const nana::rectangle& r, element_state es, const data& crook_data) override
{
if(crook_data.radio)
{
unsigned bmp_unchecked[12][12] = {
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xCFD0D0, 0xAAABAB, 0x919292, 0x919292, 0xAAABAB, 0xCFD0D0, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xA3A4A4, 0xB9BABA, 0xDBDBDB, 0xF2F2F2, 0xF2F2F2, 0xDBDBDB, 0xB9BABA, 0xA3A4A4, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xA2A3A3, 0xC3C3C3, 0xEDEDEE, 0xC6C9CD, 0xB5BABF, 0xB5BABF, 0xC8CBCE, 0xEDEEEE, 0xC3C3C3, 0xA2A3A3, 0xFFFFFF},
{0xCFD0D0, 0xB9BABA, 0xE9EAEB, 0xB3B8BD, 0xBDC2C7, 0xC8CDD2, 0xC9CED3, 0xC5C8CC, 0xBEC1C5, 0xEBECEC, 0xB9BABA, 0xCFD0D0},
{0xA9A9A9, 0xDCDCDC, 0xC5C8CC, 0xBEC3C9, 0xCBCFD5, 0xCED2D7, 0xD5D8DC, 0xDCDEE0, 0xD3D4D7, 0xD4D5D5, 0xDCDCDC, 0xA9A9A9},
{0x919292, 0xF2F2F2, 0xB4B9BD, 0xCDD1D6, 0xD3D6DA, 0xDBDDDF, 0xE4E4E5, 0xE9E9E9, 0xE8E8E9, 0xD0D1D2, 0xF2F2F2, 0x919292},
{0x919292, 0xF2F2F2, 0xBBBEC2, 0xD7DADD, 0xE0E1E3, 0xE9E9E9, 0xEFEFEF, 0xF0F0F0, 0xEFEFF0, 0xDBDCDC, 0xEFEFEF, 0x939494},
{0xA7A8A8, 0xDDDDDD, 0xCFD1D3, 0xD5D6D8, 0xE9E9E9, 0xEFEFEF, 0xF4F4F4, 0xF5F5F5, 0xEEEEEE, 0xE8E8E8, 0xDDDDDD, 0xA7A8A8},
{0xCECECE, 0xBABBBB, 0xECECED, 0xCDCECF, 0xE1E2E2, 0xF0F0F0, 0xF4F4F4, 0xF1F1F1, 0xEBEBEB, 0xF2F2F2, 0xBABBBB, 0xCECECE},
{0xFFFFFF, 0xA2A3A3, 0xC3C3C3, 0xF0F0F1, 0xE2E3E3, 0xE4E4E5, 0xE9EAEA, 0xEEEEEF, 0xF3F3F3, 0xC3C3C3, 0xA2A3A3, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xA2A3A3, 0xBABBBB, 0xDBDBDB, 0xF4F4F4, 0xF4F4F4, 0xDCDCDC, 0xBABBBB, 0xA2A3A3, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xCECECE, 0xAAABAB, 0x8E8F8F, 0x8E8F8F, 0xA9A9A9, 0xCECECE, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF}
};
unsigned bmp_unchecked_highlight[12][12] = {
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xB7CCD8, 0x7FA4BA, 0x5989A5, 0x5989A5, 0x7FA4BA, 0xB7CCD8, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x759DB4, 0x8FB7C8, 0xBCDDE5, 0xDBF6F8, 0xDBF6F8, 0xBCDDE5, 0x8FB7C8, 0x759DB4, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0x739BB3, 0x9CC2D0, 0xD3F4FA, 0x9BD7F9, 0x84CBF9, 0x84CBF9, 0x9CD8F9, 0xD4F4FA, 0x9CC2D0, 0x739BB3, 0xFFFFFF},
{0xB7CCD8, 0x8FB7C8, 0xCFF1FA, 0x80CAF9, 0x96D3FB, 0xAADDFD, 0xABDDFD, 0x9AD5FB, 0x86CEF9, 0xCFF2FA, 0x8FB7C8, 0xB7CCD8},
{0x7DA2B9, 0xBEDEE6, 0x9AD7F9, 0x98D5FB, 0xB1DFFD, 0xB2E0FD, 0xB7E3FD, 0xBCE5FD, 0xA6DCFB, 0xA1DCF9, 0xBEDEE6, 0x7DA2B9},
{0x5989A5, 0xDBF6F8, 0x80CAF9, 0xAFDEFD, 0xB6E2FD, 0xBBE5FD, 0xC1E8FD, 0xC5EAFD, 0xC7EBFD, 0x99D8FA, 0xDBF6F8, 0x5989A5},
{0x5989A5, 0xDBF6F8, 0x84CDF9, 0xB6E2FD, 0xBFE7FD, 0xC7EBFD, 0xD5F0FE, 0xDAF2FE, 0xD8F1FE, 0xB1E1FB, 0xD8F4F6, 0x5D8CA7},
{0x7BA1B8, 0xBFDFE7, 0x9FDBF9, 0xA7DDFB, 0xC8EBFD, 0xD6F1FE, 0xE2F5FE, 0xE5F6FE, 0xD8F0FD, 0xCAEDFB, 0xBFDFE7, 0x7BA1B8},
{0xB5CAD7, 0x91B8C9, 0xCFF2FA, 0x92D5F9, 0xBAE5FC, 0xDAF2FE, 0xE4F5FE, 0xDFF3FE, 0xD2EEFD, 0xDBF7FA, 0x91B8C9, 0xB5CAD7},
{0xFFFFFF, 0x739BB3, 0x9CC2D0, 0xD7F6FA, 0xBDE8FB, 0xC2E8FC, 0xD0EDFD, 0xD7F2FC, 0xDDF8FA, 0x9CC2D0, 0x739BB3, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x739BB3, 0x91B8C9, 0xBCDDE5, 0xDEF9FA, 0xDEF9FA, 0xBEDEE6, 0x91B8C9, 0x739BB3, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xB5CAD7, 0x7FA4BA, 0x5586A3, 0x5586A3, 0x7DA2B9, 0xB5CAD7, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF}
};
unsigned bmp_checked[12][12] = {
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xCFD0D0, 0xAAABAB, 0x919292, 0x919292, 0xAAABAB, 0xCFD0D0, 0xFCFCFC, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xA3A4A4, 0xB9BABA, 0xDBDBDB, 0xF2F2F2, 0xF2F2F2, 0xDBDBDB, 0xB9BABA, 0xA3A4A4, 0xF3F3F3, 0xFFFFFF},
{0xFFFFFF, 0xA2A3A3, 0xC3C3C3, 0xEDEDEE, 0xBABFC5, 0x85939F, 0x85939F, 0xBCC1C5, 0xEDEEEE, 0xC3C3C3, 0xA2A3A3, 0xFCFCFC},
{0xCFD0D0, 0xB9BABA, 0xE9EAEB, 0x8997A2, 0x274760, 0x486378, 0x365166, 0x204058, 0x8E9AA4, 0xEBECEC, 0xB9BABA, 0xCFD0D0},
{0xA9A9A9, 0xDCDCDC, 0xB9BEC4, 0x24445D, 0x91B2C6, 0xC7EBFD, 0x69C2D4, 0x14405C, 0x1E3F57, 0xC9CCCD, 0xDCDCDC, 0xA9A9A9},
{0x919292, 0xF2F2F2, 0x7D8D98, 0x304B5F, 0x90D5E5, 0x5DCEDD, 0x28A2D1, 0x178AC7, 0x183348, 0x8F9CA6, 0xF2F2F2, 0x919292},
{0x919292, 0xF2F2F2, 0x82909C, 0x183347, 0x228FC6, 0x209DD1, 0x1898D1, 0x0E84C6, 0x183348, 0x97A3AC, 0xEFEFEF, 0x939494},
{0xA7A8A8, 0xDDDDDD, 0xC0C5C9, 0x1E3F57, 0x0F3F5D, 0x0F83C7, 0x0B82C7, 0x0C3D5D, 0x1F3F58, 0xD9DCDE, 0xDDDDDD, 0xA7A8A8},
{0xCECECE, 0xBABBBB, 0xECECED, 0x99A3AB, 0x1D3E57, 0x18354A, 0x19344A, 0x1E3E57, 0xAEB8BF, 0xF2F2F2, 0xBABBBB, 0xCECECE},
{0xFFFFFF, 0xA2A3A3, 0xC3C3C3, 0xF0F0F1, 0xD1D5D7, 0xA6B0B9, 0xA9B4BC, 0xDCDFE2, 0xF3F3F3, 0xC3C3C3, 0xA2A3A3, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xA2A3A3, 0xBABBBB, 0xDBDBDB, 0xF4F4F4, 0xF4F4F4, 0xDCDCDC, 0xBABBBB, 0xA2A3A3, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xCECECE, 0xAAABAB, 0x8E8F8F, 0x8E8F8F, 0xA9A9A9, 0xCECECE, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF}
};
unsigned bmp_checked_highlight[12][12] = {
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xB7CCD8, 0x7FA4BA, 0x5989A5, 0x5989A5, 0x7FA4BA, 0xB7CCD8, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x759DB4, 0x8FB7C8, 0xBCDDE5, 0xDBF6F8, 0xDBF6F8, 0xBCDDE5, 0x8FB7C8, 0x759DB4, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0x739BB3, 0x9CC2D0, 0xD3F4FA, 0x92CCED, 0x639FC7, 0x639FC7, 0x93CDED, 0xD4F4FA, 0x9CC2D0, 0x739BB3, 0xFFFFFF},
{0xB7CCD8, 0x8FB7C8, 0xCFF1FA, 0x66A3CC, 0x264862, 0x47647A, 0x355268, 0x1E405A, 0x66A3C9, 0xCFF2FA, 0x8FB7C8, 0xB7CCD8},
{0x7DA2B9, 0xBEDEE6, 0x91CCED, 0x22445E, 0x9DBBCD, 0xE9F7FE, 0x7FE6EE, 0x154664, 0x1D3F58, 0x99D3EF, 0xBEDEE6, 0x7DA2B9},
{0x5989A5, 0xDBF6F8, 0x5C98BF, 0x2F4B60, 0xB1F6FA, 0x74FFFF, 0x32CAFF, 0x1DAAF3, 0x173348, 0x6CA1C0, 0xDBF6F8, 0x5989A5},
{0x5989A5, 0xDBF6F8, 0x5E99BF, 0x173348, 0x2AB0F2, 0x28C4FF, 0x1EBEFF, 0x11A3F2, 0x173348, 0x7BA6C0, 0xD8F4F6, 0x5D8CA7},
{0x7BA1B8, 0xBFDFE7, 0x94CEEB, 0x1D3F58, 0x114567, 0x13A2F3, 0x0DA0F3, 0x0D4367, 0x1E3F58, 0xBEE0EF, 0xBFDFE7, 0x7BA1B8},
{0xB5CAD7, 0x91B8C9, 0xCFF2FA, 0x6FA8C9, 0x1C3E58, 0x18354B, 0x18354B, 0x1D3E58, 0x9CBACC, 0xDBF7FA, 0x91B8C9, 0xB5CAD7},
{0xFFFFFF, 0x739BB3, 0x9CC2D0, 0xD7F6FA, 0xAFDAED, 0x8EB3C9, 0x98B7CA, 0xC7E3EE, 0xDDF8FA, 0x9CC2D0, 0x739BB3, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x739BB3, 0x91B8C9, 0xBCDDE5, 0xDEF9FA, 0xDEF9FA, 0xBEDEE6, 0x91B8C9, 0x739BB3, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xB5CAD7, 0x7FA4BA, 0x5586A3, 0x5586A3, 0x7DA2B9, 0xB5CAD7, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF}
};
unsigned bmp_checked_press[12][12] = {
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xA6BDCE, 0x6089A8, 0x31668E, 0x31668E, 0x6089A8, 0xA6BDCE, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x5480A1, 0x6C99B8, 0x9DC4DC, 0xBEE1F3, 0xBEE1F3, 0x9DC4DC, 0x6C99B8, 0x5480A1, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0x517E9F, 0x7AA5C2, 0xB6DDF3, 0x73B2D6, 0x4A8AB0, 0x4A8AB0, 0x74B3D8, 0xB7DEF3, 0x7AA5C2, 0x517E9F, 0xFFFFFF},
{0xA6BDCE, 0x6C99B8, 0xB1DBF1, 0x4B8DB4, 0x244660, 0x456279, 0x335167, 0x1D3F59, 0x4C90B7, 0xB1DCF3, 0x6C99B8, 0xA6BDCE},
{0x5E87A6, 0x9FC5DD, 0x71B1D6, 0x21435D, 0x7EA5BC, 0x95D9FC, 0x478BAE, 0x113858, 0x1B3E58, 0x78BDE2, 0x9FC5DD, 0x5E87A6},
{0x31668E, 0xBEE1F3, 0x4484AA, 0x2E4A60, 0x5DA2C6, 0x3A84AA, 0x19658D, 0x0F5984, 0x153248, 0x5794B7, 0xBEE1F3, 0x31668E},
{0x31668E, 0xBEE1F3, 0x4687AE, 0x153247, 0x165D84, 0x14628D, 0x0F5F8D, 0x095684, 0x163248, 0x6B9DB9, 0xBBDEF1, 0x366990},
{0x5B85A5, 0xA0C7DE, 0x74B7DC, 0x1B3E58, 0x0D3659, 0x0A5583, 0x075483, 0x0A3459, 0x1E3F58, 0xA9D2E9, 0xA0C7DE, 0x5B85A5},
{0xA3BBCD, 0x6D9BBA, 0xB2DDF3, 0x5599BE, 0x1C3E57, 0x17344A, 0x17344B, 0x1D3E57, 0x91B3C7, 0xC1E4F6, 0x6D9BBA, 0xA3BBCD},
{0xFFFFFF, 0x517E9F, 0x7AA5C2, 0xBBE1F5, 0x98CAE4, 0x80AAC3, 0x8CAFC5, 0xB7D7EA, 0xC2E4F6, 0x7AA5C2, 0x517E9F, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0x517E9F, 0x6D9BBA, 0x9DC4DC, 0xC2E4F6, 0xC2E4F6, 0x9FC5DD, 0x6D9BBA, 0x517E9F, 0xFFFFFF, 0xFFFFFF},
{0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xA3BBCD, 0x6089A8, 0x2C628B, 0x2C628B, 0x5E87A6, 0xA3BBCD, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF}
};
unsigned (*colormap)[12][12] = &bmp_unchecked;
switch(es)
{
case element_state::normal:
case element_state::focus_normal:
colormap = (crook_data.check_state != state::unchecked ? &bmp_checked : &bmp_unchecked);
break;
case element_state::hovered:
case element_state::focus_hovered:
colormap = (crook_data.check_state != state::unchecked ? &bmp_checked_highlight : &bmp_unchecked_highlight);
break;
case element_state::pressed:
colormap = &bmp_checked_press;
break;
default:
break;
}
const int x = r.x + 2;
const int y = r.y + 2;
for(int top = 0; top < 12; ++top)
{
for(int left = 0; left < 12; ++left)
{
if((*colormap)[top][left] != 0xFFFFFF)
graph.set_pixel(left + x, top + y, (*colormap)[top][left]);
}
}
}
else
{
const nana::color_t highlighted = 0x5EB6F7;
switch(es)
{
case element_state::hovered:
case element_state::focus_hovered:
bgcolor = graph.mix(bgcolor, highlighted, 0.8);
fgcolor = graph.mix(fgcolor, highlighted, 0.8);
break;
case element_state::pressed:
bgcolor = graph.mix(bgcolor, highlighted, 0.4);
fgcolor = graph.mix(fgcolor, highlighted, 0.4);
break;
case element_state::disabled:
bgcolor = fgcolor = 0xB2B7BC;
break;
default:
//Leave things as they are
break;
}
const int x = r.x + 1;
const int y = r.y + 1;
graph.rectangle(x, y, 13, 13, fgcolor, false);
graph.rectangle(x + 1, y + 1, 11, 11, bgcolor, true);
switch(crook_data.check_state)
{
case state::checked:
{
int sx = x + 2;
int sy = y + 4;
for(int i = 0; i < 3; i++)
{
sx++;
sy++;
graph.line(sx, sy, sx, sy + 3, fgcolor);
}
for(int i = 0; i < 4; i++)
{
sx++;
sy--;
graph.line(sx, sy, sx, sy + 3, fgcolor);
}
}
break;
case state::partial:
graph.rectangle(x + 2, y + 2, 9, 9, fgcolor, true);
break;
default:
break;
}
}
return true;
}
}; //end class crook
class menu_crook
: public crook_interface
{
bool draw(graph_reference graph, nana::color_t, nana::color_t fgcolor, const nana::rectangle& r, element_state es, const data& crook_data) override
{
if(crook_data.check_state == state::unchecked)
return true;
if(crook_data.radio)
{
unsigned colormap[8][8] = {
{0xFF000000,0xdee7ef,0x737baa,0x232674,0x3c3f84,0x8d96ba,0xe0e9ef,0xFF000000},
{0xdce4ed,0x242875,0x6f71b3,0x9fa0d6,0xc3c4e9,0xb1b2da,0x5c6098,0xdbe4ed},
{0x7b81ad,0x4f5199,0x8182c1,0xa1a2d4,0xccccea,0xcccced,0x9c9dcf,0x7981ae},
{0x2b2d77,0x4f509a,0x696baf,0x7879ba,0xa4a6d4,0xa9aad9,0x9193ce,0x1e2271},
{0x36387f,0x383a87,0x52549c,0x6162a8,0x6f71b3,0x7e7fbf,0x7879ba,0x282c78},
{0x9094ba,0x1b1c71,0x3c3e8b,0x4a4b96,0x585aa1,0x6768ac,0x464893,0x828bb6},
{0xe2eaf1,0x4b4d8d,0x16186d,0x292b7c,0x333584,0x2c2e7f,0x454b8c,0xdfe9f0},
{0xFF000000,0xe4ecf2,0x9599bd,0x454688,0x414386,0x9095bb,0xe3ebf2,0xFF000000}
};
int x = r.x + (static_cast<int>(r.width) - 8) / 2;
int y = r.y + (static_cast<int>(r.height) - 8) / 2;
for(int u = 0; u < 8; ++u)
{
for(int v = 0; v < 8; ++v)
{
if(colormap[u][v] & 0xFF000000)
continue;
graph.set_pixel(x + v, y, colormap[u][v]);
}
++y;
}
}
else
{
int x = r.x + (static_cast<int>(r.width) - 16) / 2;
int y = r.y + (static_cast<int>(r.height) - 16) / 2;
nana::color_t light = graph.mix(fgcolor, 0xFFFFFF, 0.5);
graph.line(x + 3, y + 7, x + 6, y + 10, fgcolor);
graph.line(x + 7, y + 9, x + 12, y + 4, fgcolor);
graph.line(x + 3, y + 8, x + 6, y + 11, light);
graph.line(x + 7, y + 10, x + 12, y + 5, light);
graph.line(x + 4, y + 7, x + 6, y + 9, light);
graph.line(x + 7, y + 8, x + 11, y + 4, light);
}
return true;
}
};
}
template<typename ElementInterface>
class element_object
: nana::noncopyable, nana::nonmovable
{
typedef ElementInterface element_t;
typedef pat::cloneable<element::provider::factory_interface<element_t>> factory_interface;
public:
element_object()
: element_ptr_(nullptr)
{
}
~element_object()
{
if(factory_)
factory_->destroy(element_ptr_);
}
void push(const factory_interface& rhs)
{
auto keep_f = factory_;
auto keep_e = element_ptr_;
factory_ = rhs;
element_ptr_ = factory_->create();
if(nullptr == factory_ || nullptr == element_ptr_)
{
if(element_ptr_)
factory_->destroy(element_ptr_);
factory_.reset();
factory_ = keep_f;
element_ptr_ = keep_e;
}
else
spare_.emplace_back(keep_e, keep_f);
}
element_t * const * keeper() const
{
return &element_ptr_;
}
private:
factory_interface factory_; //Keep the factory for destroying the element
element_t * element_ptr_;
std::vector<std::pair<element_t*, factory_interface>> spare_;
};
class element_manager
: nana::noncopyable, nana::nonmovable
{
//VC2012 does not support alias declaration.
//template<typename E> using factory_interface = element::provider::factory_interface<E>;
template<typename ElementInterface>
struct item
{
element_object<ElementInterface> * employee;
std::map<std::string, std::shared_ptr<element_object<ElementInterface>>> table;
};
element_manager()
{
crook_.employee = nullptr;
}
public:
static element_manager& instance()
{
static bool initial = true;
static element_manager obj;
if(initial)
{
initial = false;
element::add_crook<element::crook>("");
element::add_crook<element::menu_crook>("menu_crook");
}
return obj;
}
void crook(const std::string& name, const pat::cloneable<element::provider::factory_interface<element::crook_interface>>& factory)
{
_m_add(name, crook_, factory);
}
element::crook_interface * const * crook(const std::string& name) const
{
return _m_get(name, crook_).keeper();
}
private:
typedef std::lock_guard<std::recursive_mutex> lock_guard;
template<typename ElementInterface>
void _m_add(const std::string& name, item<ElementInterface>& m, const pat::cloneable<element::provider::factory_interface<ElementInterface>>& factory)
{
typedef element_object<ElementInterface> element_object_t;
lock_guard lock(mutex_);
auto & eop = m.table[name];
if(nullptr == eop)
eop = std::shared_ptr<element_object_t>(new element_object_t);
eop->push(factory);
if(nullptr == m.employee)
m.employee = eop.get();
}
template<typename ElementInterface>
const element_object<ElementInterface>& _m_get(const std::string& name, const item<ElementInterface>& m) const
{
lock_guard lock(mutex_);
auto i = m.table.find(name);
if(i != m.table.end())
return *(i->second);
return *m.employee;
}
private:
mutable std::recursive_mutex mutex_;
item<element::crook_interface> crook_;
};
namespace element
{
//class provider
void provider::add_crook(const std::string& name, const pat::cloneable<factory_interface<crook_interface>>& factory)
{
element_manager::instance().crook(name, factory);
}
crook_interface* const * provider::keeper_crook(const std::string& name)
{
return element_manager::instance().crook(name);
}
}//end namespace element
//facades
//template<> class facade<element::crook>
facade<element::crook>::facade()
: keeper_(element::provider().keeper_crook(""))
{
data_.check_state = state::unchecked;
data_.radio = false;
}
facade<element::crook>::facade(const char* name)
: keeper_(element::provider().keeper_crook(name ? name : ""))
{
data_.check_state = state::unchecked;
data_.radio = false;
}
facade<element::crook> & facade<element::crook>::reverse()
{
data_.check_state = (data_.check_state == facade<element::crook>::state::unchecked ? facade<element::crook>::state::checked : facade<element::crook>::state::unchecked);
return *this;
}
facade<element::crook> & facade<element::crook>::check(state s)
{
data_.check_state = s;
return *this;
}
facade<element::crook>::state facade<element::crook>::checked() const
{
return data_.check_state;
}
facade<element::crook> & facade<element::crook>::radio(bool r)
{
data_.radio = r;
return *this;
}
bool facade<element::crook>::radio() const
{
return data_.radio;
}
void facade<element::crook>::switch_to(const char* name)
{
keeper_ = element::provider().keeper_crook(name);
}
bool facade<element::crook>::draw(graph_reference graph, nana::color_t bgcol, nana::color_t fgcol, const nana::rectangle& r, element_state es)
{
return (*keeper_)->draw(graph, bgcol, fgcol, r, es, data_);
}
//end class facade<element::crook>
}//end namespace gui
}//end namespace nana |
29b81f1403527e7b90834f14ae56ff905bebbd6b | 5a0b853d1d80d426d4edb3572b7f2c38c70ce377 | /examples/inject/main.cpp | c8b0e77111bc1dfbbcbd1d8b7e88ac6782605212 | [
"MIT"
] | permissive | lvous/hadesmem | 1537af2779f8f12e7367dab159548572af78ef83 | 3aa789a42799dfae03e2be0c86f1fbc0f5b82ddd | refs/heads/master | 2020-05-17T07:56:17.251294 | 2015-01-07T15:48:36 | 2015-01-07T15:48:36 | 40,565,165 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,652 | cpp | main.cpp | // Copyright (C) 2010-2014 Joshua Boyce.
// See the file COPYING for copying permission.
#include <algorithm>
#include <iostream>
#include <iterator>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <windows.h>
#include <hadesmem/detail/warning_disable_prefix.hpp>
#include <tclap/CmdLine.h>
#include <hadesmem/detail/warning_disable_suffix.hpp>
#include <hadesmem/call.hpp>
#include <hadesmem/config.hpp>
#include <hadesmem/debug_privilege.hpp>
#include <hadesmem/detail/filesystem.hpp>
#include <hadesmem/detail/self_path.hpp>
#include <hadesmem/detail/str_conv.hpp>
#include <hadesmem/error.hpp>
#include <hadesmem/injector.hpp>
#include <hadesmem/module.hpp>
#include <hadesmem/process.hpp>
#include <hadesmem/process_helpers.hpp>
int main(int argc, char* argv[])
{
try
{
std::cout << "HadesMem Injector [" << HADESMEM_VERSION_STRING << "]\n";
TCLAP::CmdLine cmd{"DLL injector", ' ', HADESMEM_VERSION_STRING};
TCLAP::ValueArg<DWORD> pid_arg{
"", "pid", "Target process id", false, 0, "DWORD"};
TCLAP::ValueArg<std::string> name_arg{
"", "name", "Target process name", false, "", "string"};
TCLAP::ValueArg<std::string> run_arg{
"", "run", "Target process path (new instance)", false, "", "string"};
std::vector<TCLAP::Arg*> xor_args{&pid_arg, &name_arg, &run_arg};
cmd.xorAdd(xor_args);
TCLAP::SwitchArg name_forced_arg{
"",
"name-forced",
"Default to first matched process name (no warning)",
cmd};
TCLAP::ValueArg<std::string> module_arg{
"", "module", "Module path", true, "", "string", cmd};
TCLAP::SwitchArg path_resolution_arg{
"",
"path-resolution",
"Perform (local) path resolution on module path",
cmd};
TCLAP::SwitchArg add_path_arg{
"", "add-path", "Add module dir to (remote) search order", cmd};
TCLAP::ValueArg<std::string> export_arg{
"",
"export",
"Module export name (DWORD_PTR (*) ())",
false,
"",
"string",
cmd};
TCLAP::SwitchArg inject_arg{"", "inject", "Inject module"};
TCLAP::SwitchArg free_arg{"", "free", "Free module"};
cmd.xorAdd(inject_arg, free_arg);
TCLAP::MultiArg<std::string> arg_arg{
"",
"arg",
"Target process args (use once for each arg)",
false,
"string",
cmd};
TCLAP::ValueArg<std::string> work_dir_arg{
"",
"work-dir",
"Target process working directory",
false,
"",
"string",
cmd};
TCLAP::ValueArg<DWORD> steam_app_id_arg{
"", "steam-app-id", "Steam app id", false, 0, "uint32_t", cmd};
cmd.parse(argc, argv);
bool const free = free_arg.isSet();
bool const run = run_arg.isSet();
if (free && run)
{
HADESMEM_DETAIL_THROW_EXCEPTION(
hadesmem::Error{} << hadesmem::ErrorString{
"Modules can only be unloaded from running targets."});
}
bool const inject = inject_arg.isSet();
if (!inject && run)
{
HADESMEM_DETAIL_THROW_EXCEPTION(hadesmem::Error{}
<< hadesmem::ErrorString{
"Exports can only be called without "
"injection on running targets. Did "
"you mean to use --inject?"});
}
bool const call_export = export_arg.isSet();
if (!inject && !free && !call_export)
{
HADESMEM_DETAIL_THROW_EXCEPTION(
hadesmem::Error{} << hadesmem::ErrorString{"Please choose action(s) to "
"perform on the process "
"(inject, free, export)."});
}
auto const steam_app_id = steam_app_id_arg.getValue();
if (steam_app_id && !run)
{
HADESMEM_DETAIL_THROW_EXCEPTION(
hadesmem::Error{} << hadesmem::ErrorString{
"Steam app ID is only supported when launching the target."});
}
auto const module_path =
hadesmem::detail::MultiByteToWideChar(module_arg.getValue());
bool const path_resolution = path_resolution_arg.isSet();
bool const add_path = add_path_arg.isSet();
std::uint32_t flags = hadesmem::InjectFlags::kNone;
if (path_resolution)
{
flags |= hadesmem::InjectFlags::kPathResolution;
}
if (add_path)
{
flags |= hadesmem::InjectFlags::kAddToSearchOrder;
}
bool const has_pid = pid_arg.isSet();
bool const has_name = name_arg.isSet();
if (has_pid || has_name)
{
try
{
hadesmem::GetSeDebugPrivilege();
std::wcout << "\nAcquired SeDebugPrivilege.\n";
}
catch (std::exception const& /*e*/)
{
std::wcout << "\nFailed to acquire SeDebugPrivilege.\n";
}
std::unique_ptr<hadesmem::Process> process;
if (has_pid)
{
DWORD const pid = pid_arg.getValue();
process = std::make_unique<hadesmem::Process>(pid);
}
else
{
auto const proc_name =
hadesmem::detail::MultiByteToWideChar(name_arg.getValue());
bool const name_forced = name_forced_arg.isSet();
process = std::make_unique<hadesmem::Process>(
hadesmem::GetProcessByName(proc_name, name_forced));
}
HMODULE module = nullptr;
if (inject)
{
module = hadesmem::InjectDll(*process, module_path, flags);
std::wcout << "\nSuccessfully injected module at base "
"address " << hadesmem::detail::PtrToHexString(module)
<< ".\n";
}
else
{
std::wstring path_real{module_path};
if (path_resolution && hadesmem::detail::IsPathRelative(path_real))
{
path_real = hadesmem::detail::CombinePath(
hadesmem::detail::GetSelfDirPath(), path_real);
}
hadesmem::Module const remote_module{*process, path_real};
module = remote_module.GetHandle();
}
if (call_export)
{
auto const export_name = export_arg.getValue();
hadesmem::CallResult<DWORD_PTR> const export_ret =
hadesmem::CallExport(*process, module, export_name);
std::wcout << "\nSuccessfully called module export.\n";
std::wcout << "Return: " << export_ret.GetReturnValue() << ".\n";
std::wcout << "LastError: " << export_ret.GetLastError() << ".\n";
}
if (free)
{
hadesmem::FreeDll(*process, module);
std::wcout << "\nSuccessfully freed module at base address "
<< hadesmem::detail::PtrToHexString(module) << ".\n";
}
}
else
{
auto const exe_path =
hadesmem::detail::MultiByteToWideChar(run_arg.getValue());
auto const exe_args_tmp = arg_arg.getValue();
std::vector<std::wstring> exe_args;
std::transform(std::begin(exe_args_tmp),
std::end(exe_args_tmp),
std::back_inserter(exe_args),
[](std::string const& s)
{
return hadesmem::detail::MultiByteToWideChar(s);
});
auto const export_name = export_arg.getValue();
auto const work_dir =
hadesmem::detail::MultiByteToWideChar(work_dir_arg.getValue());
hadesmem::CreateAndInjectData const inject_data =
hadesmem::CreateAndInject(exe_path,
work_dir,
std::begin(exe_args),
std::end(exe_args),
module_path,
export_name,
flags,
steam_app_id);
std::wcout << "\nSuccessfully created target.\n";
std::wcout << "Process ID: " << inject_data.GetProcess() << ".\n";
std::wcout << "Module Base: " << hadesmem::detail::PtrToHexString(
inject_data.GetModule()) << ".\n";
std::wcout << "Export Return: " << inject_data.GetExportRet() << ".\n";
std::wcout << "Export LastError: " << inject_data.GetExportLastError()
<< ".\n";
}
return 0;
}
catch (...)
{
std::cerr << "\nError!\n";
std::cerr << boost::current_exception_diagnostic_information() << '\n';
return 1;
}
}
|
b70ad9f9ac5776ab5d4db9cdb23314015bc29d07 | 73fce4451541ccde7dafe3bebdac9cf721c852c2 | /Source/Core/Public/Platforms/RadonPlatform.h | 9c4ae9283f0ec7d0a43ab9b2a0aa46cd7c0f0c2a | [] | no_license | jwoo1601/RadonGameEngine | 1615c722ec4d4c92d06826d1c25317bced537bb9 | 53aa44bbbee4c25d07da46c3149172631688f138 | refs/heads/master | 2020-04-26T09:00:00.305181 | 2019-10-23T04:30:18 | 2019-10-23T04:30:18 | 173,441,077 | 0 | 0 | null | 2019-10-23T04:30:19 | 2019-03-02T11:44:03 | C++ | UTF-8 | C++ | false | false | 2,118 | h | RadonPlatform.h | // Copyright 2019 Simon Kim All Rights Reserved.
#ifndef RADON_PLATFORM_H
#define RADON_PLATFORM_H
#include "PlatformMinimal.h"
#if RADON_COMPILER_SUPPORTS_PRAGMA_ONCE
#pragma once
#endif
#ifdef RADON_PLATFORM_WINDOWS
#include "WindowsString.h"
#include "WindowsMemory.h"
#include "WindowsThreads.h"
#include "WindowsMutex.h"
#include "WindowsAtomics.h"
#elif RADON_PLATFORM_MAC
#include "MacString.h"
#include "MacMemory.h"
#include "MacThreads.h"
#include "MacMutex.h"
#include "MacAtomics.h"
#elif RADON_PLATFORM_LINUX
#include "LinuxString.h"
#include "LinuxMemory.h"
#include "LinuxThreads.h"
#include "LinuxMutex.h"
#include "LinuxAtomics.h"
#else
#include "PlatformString.h"
#include "PlatformMemory.h"
#include "PlatformThreads.h"
#include "PlatformMutex.h"
#include "PlatformAtomics.h"
#endif
namespace Radon
{
#ifdef RADON_PLATFORM_WINDOWS
typedef SPlatformStringWindows SPlatformString;
typedef SPlatformMemoryWindows SPlatformMemory;
typedef SPlatformThreadsWindows SPlatformThreads;
typedef SPlatformMutexWindows SPlatformMutex;
typedef SPlatformAtomicsWindows SPlatformAtomics;
#elif RADON_PLATFORM_MAC
typedef SPlatformStringMac SPlatformString;
typedef SPlatformMemoryMac SPlatformMemory;
typedef SPlatformThreadsMac SPlatformThreads;
typedef SPlatformMutexMac SPlatformMutex;
typedef SPlatformAtomicsMac SPlatformAtomics;
#elif RADON_PLATFORM_LINUX
typedef SPlatformStringLinux SPlatformString;
typedef SPlatformMemoryLinux SPlatformMemory;
typedef SPlatformThreadsLinux SPlatformThreads;
typedef SPlatformMutexLinux SPlatformMutex;
typedef SPlatformAtomicsLinux SPlatformAtomics;
#else
typedef SPlatformStringBase SPlatformString;
typedef SPlatformMemoryBase SPlatformMemory;
typedef SPlatformThreadsBase SPlatformThreads;
typedef SPlatformMutexBase SPlatformMutex;
typedef SPlatformAtomicsBase SPlatformAtomics;
#endif
}
#endif |
cfca2e81e7e90ab190e697a173e0ef9476cc9219 | 47d7c25fa563a6b8f615b9718a8d2154235b8119 | /CSIS 252/Brekke's Files/func3/main.cpp | bc1f25ee580d2aac19c61c8155d2e80edabdf42a | [] | no_license | meyerpa/CPlusPlus | aefcbd20671da909b04e68aabc5f70911590903d | 46f7b8465a6fa1929be5c88985ed38ea9ac335ce | refs/heads/master | 2021-06-04T10:25:11.551812 | 2018-02-23T21:50:01 | 2018-02-23T21:50:01 | 57,323,448 | 0 | 0 | null | 2016-04-28T18:23:24 | 2016-04-28T18:05:37 | C++ | UTF-8 | C++ | false | false | 887 | cpp | main.cpp | #include <iostream>
using namespace std;
const int arraysize=5;
const int sentinel=-999;
// function prototypes
// comment: in prototypes, parameter names are not needed
int biggest(const int numbers[],int count);
void output(const int numbers[],int count);
int search(const int numbers[],int count, int searchValue);
void read(int numbers[], int& count);
int main()
{
int numbers[arraysize];
int count;
read(numbers,count);
output(numbers,count);
output(numbers,count);
output(numbers,count);
cout << "biggest is " << biggest(numbers,count) << endl;
int searchValue;
cout << "enter a value to search for: ";
cin >> searchValue;
int position = search(numbers,count,searchValue);
if (position >= 0)
cout << searchValue << " found at position " << position << endl;
else
cout << searchValue << " not found\n";
return 0;
}
|
8d5ca97bd183a81810d3a1e6df8c3defabfb8c21 | 51d2ce6f94232af413b2d8d03bcd24de1b2dd35e | /dllsample/dummy.cpp | 0690b24e1082c2c5420069fd54e0ca843f2fbf15 | [
"MIT"
] | permissive | 0xeb/detours-cmake | 820ca77e5c3a5e8091b86bcfbb0ed19340073129 | da22e0643ec3b59141a6ebba58dfac754d955222 | refs/heads/master | 2023-05-12T15:53:33.672282 | 2023-05-02T01:16:53 | 2023-05-02T01:16:53 | 188,133,900 | 13 | 8 | null | null | null | null | UTF-8 | C++ | false | false | 269 | cpp | dummy.cpp | #include <stdio.h>
#include <Windows.h>
//-------------------------------------------------------------------------
int main()
{
::Sleep(500);
printf("Dummy program started...\n");
::Beep(200, 1000);
printf("Dummy program ended...\n");
return 0;
} |
db5d5025940db7c2cb68e10a903b3618b9e95ea2 | edf9243dad9915eba12e4f1ae2db00653b8fd409 | /src/cpp/oop/oop.cpp | 6be923530d7d17d654f896f8f7ef3c4c1906d25c | [] | no_license | dmitryvim/mipt-cpp | ce59d2c1d81d52146cee28a1a4e654d49ac155d3 | 01310b3dd33639f83a990b9ea51cd0dee265c346 | refs/heads/master | 2021-01-13T12:56:16.675274 | 2017-03-21T13:52:32 | 2017-03-21T13:52:32 | 72,815,205 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 260 | cpp | oop.cpp | //
// Created by dmitry on 2/7/17.
//
#include "Time.h"
#include <iostream>
using namespace std;
int main() {
Time a(12, 35), b(10, 33, 45);
a.plus(b).print();
a.minus(b).print();
b.plus(a).print();
b.minus(a).print();
return 0;
}
|
42f6af0c82a9d7e64c78b2641c5eb2039ff6e2aa | 30bdd8ab897e056f0fb2f9937dcf2f608c1fd06a | /contest/1542584575.cpp | d8c346dde21be77f5d2eb3ea872f0870cc1193f4 | [] | no_license | thegamer1907/Code_Analysis | 0a2bb97a9fb5faf01d983c223d9715eb419b7519 | 48079e399321b585efc8a2c6a84c25e2e7a22a61 | refs/heads/master | 2020-05-27T01:20:55.921937 | 2019-11-20T11:15:11 | 2019-11-20T11:15:11 | 188,403,594 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,499 | cpp | 1542584575.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using D = double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define makeunique(x) sort(all(x)), (x).resize(unique(all(x)) - (x).begin())
#define rep(i, x) for(int i = 0; i < (x); i++)
#define rrep(i, x) for(int i = (x - 1); i >= 0; i--)
#define sqrt(x) sqrt(abs(x))
#define y1 y1_1234413
#define j1 j1_235
#define y0 y0_235
#define j0 j0_256
#define fi first
#define se second
#define re return
#define prev PREV
#define next NEXT
#define sz(x) ((int)x.size())
template<typename T> T sqr(T a) { re a * a; }
template<typename T> T gcd(T a, T b) { re b ? gcd(b, a % b) : a; }
template<typename T> T sgn(T a) { re a > 0 ? 1 : (a < 0 ? -1 : 0); }
template<typename T> T abs(T a) { re a > 0 ? a : -a; }
const int inf = 2e9;
const ld pi = acos((ld)-1);
int f (const vi &a, int x)
{
rep (i, 2)
{
if (x > a[i] && x <= a[i + 1]) re i;
//cout << a[i] << ' ' << i << endl;
}
re 2;
}
int main()
{
int h, m, s, t1, t2;
cin >> h >> m >> s >> t1 >> t2;
h *= 5;
h %= 60;
t1 %= 60;
t2 %= 60;
t1 *= 5;
t2 *= 5;
vi a;
a.pb(h);
a.pb(m);
a.pb(s);
sort(all(a));
if (f (a, t1) == f (a, t2)) cout << "YES"; else cout << "NO";
re 0;
} |
28981c6fdb38e62f06246f5b20c1ce2150a14250 | 63cf126d0fb1c9d68887b85155c9022b53cd113d | /PersonalGame/Source/PersonalGame/OnRailPawn.cpp | dbb05b26c2df91cf7394f984954525ad85a24986 | [
"MIT"
] | permissive | thomaskAHLE/FinalProjectUe4 | 76622e1db5567775d226b1db2872768413be8d2c | 6f9b6d9ca60ebe69cd52552bbd0392bd17bb14e4 | refs/heads/master | 2023-06-21T14:19:59.311356 | 2019-12-12T23:08:43 | 2019-12-12T23:08:43 | 391,435,136 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,510 | cpp | OnRailPawn.cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "OnRailPawn.h"
#include "OnRailSplineActor.h"
// Sets default values
AOnRailPawn::AOnRailPawn()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
RootComponent = CreateDefaultSubobject<USceneComponent>("RootComponent");
}
float AOnRailPawn::GetCurrentVelocity() const
{
if (RailToFollow != nullptr)
{
return RailToFollow->GetCurrentSpeedMultiplier();
}
return 0.f;
}
void AOnRailPawn::SetPawnSpeedMultiplier(float SpeedMultiplier)
{
if (0.f < SpeedMultiplier)
{
PawnSpeedMultiplier = SpeedMultiplier;
if (RailToFollow != nullptr)
{
RailToFollow->SetTravelerSpeedMultiplier(PawnSpeedMultiplier);
}
}
}
// Called when the game starts or when spawned
void AOnRailPawn::BeginPlay()
{
Super::BeginPlay();
if (RailToFollow != nullptr)
{
if (!bStartMovingOnBeginPlay)
{
StopPawnMoving();
}
RailToFollow->SetTravelerSpeedMultiplier(PawnSpeedMultiplier);
FVector NewPos = RailToFollow->GetCurrentLocation();
if (bUpdateRotationWithSpline)
{
FRotator NewRot = RailToFollow->GetCurrentRotation();
SetActorLocationAndRotation(MoveTemp(NewPos), MoveTemp(NewRot));
}
else
{
SetActorLocation(NewPos);
}
}
}
// Called every frame
void AOnRailPawn::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (RailToFollow != nullptr && RailToFollow->IsMoving())
{
FVector NewPos = RailToFollow->GetCurrentLocation();
if (bUpdateRotationWithSpline)
{
FRotator NewRot = RailToFollow->GetCurrentRotation();
SetActorLocationAndRotation(MoveTemp(NewPos), MoveTemp(NewRot));
}
else
{
SetActorLocation(NewPos);
}
}
}
void AOnRailPawn::OnConstruction(const FTransform& Transform)
{
#if WITH_EDITOR
if (RailToFollow != nullptr)
{
if (LastIndex != EDITOR_ONLY_SplinePointIdxToMoveTo)
{
EDITOR_ONLY_bMovePawnToIndex = true;
LastIndex = EDITOR_ONLY_SplinePointIdxToMoveTo;
}
if (!FMath::IsNearlyEqual(EDITOR_ONLY_DistanceAlongSpline, LastDistance))
{
EDITOR_ONLY_bMovePawnToDistance = true;
LastDistance = EDITOR_ONLY_DistanceAlongSpline;
}
if (EDITOR_ONLY_bMovePawnToDistance)
{
if (bUpdateRotationWithSpline)
{
SetActorLocationAndRotation(RailToFollow->GetPosAtDis(EDITOR_ONLY_DistanceAlongSpline), RailToFollow->GetRotAtDis(EDITOR_ONLY_DistanceAlongSpline));
}
else
{
SetActorLocation(RailToFollow->GetPosAtDis(EDITOR_ONLY_DistanceAlongSpline));
}
EDITOR_ONLY_bMovePawnToDistance = false;
}
if (EDITOR_ONLY_bMovePawnToIndex)
{
if (bUpdateRotationWithSpline)
{
SetActorLocationAndRotation(RailToFollow->GetPosAtIdx(EDITOR_ONLY_SplinePointIdxToMoveTo), RailToFollow->GetRotAtIdx(EDITOR_ONLY_SplinePointIdxToMoveTo));
}
else
{
SetActorLocation(RailToFollow->GetPosAtIdx(EDITOR_ONLY_SplinePointIdxToMoveTo));
}
}
EDITOR_ONLY_bMovePawnToIndex = false;
}
else
{
UE_LOG(LogTemp, Warning, TEXT("No Rail to follow"))
}
#endif
}
void AOnRailPawn::StartPawnMoving()
{
if (RailToFollow != nullptr && !RailToFollow->HasReachedEndOfRail())
{
RailToFollow->StartMoving();
}
}
void AOnRailPawn::StopPawnMoving()
{
if (RailToFollow != nullptr)
{
RailToFollow->StopMoving();
}
}
void AOnRailPawn::SetRailToFollow(AOnRailSplineActor * Rail)
{
if (Rail != nullptr)
{
RailToFollow = Rail;
}
else
{
UE_LOG(LogTemp, Error, TEXT("Rail is nullptr"))
}
}
|
9262480f7e01d150f978f0bc9e53ed8dab2d2f9f | ce28066d5525cb7cbb3b37212bb5573ae040182b | /jni/Allocator.h | 8bc84ab4527b8ddb4fd417c6f872fc3c0ea212de | [] | no_license | nebogeo/earlobes | 60f4b948c3529440d4be4d2f90227ddf49807fc9 | 48f61c524af8b116cb520619c8218307b6c4f792 | refs/heads/master | 2016-09-07T18:59:17.281528 | 2012-09-29T12:18:10 | 2012-09-29T12:18:10 | 6,008,826 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,604 | h | Allocator.h | // Copyright (C) 2004 David Griffiths <dave@pawfal.org>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef ALLOCATOR
#define ALLOCATOR
using namespace std;
class Allocator
{
public:
virtual ~Allocator() {}
virtual void Reset() {}
virtual char *New(unsigned int size)=0;
virtual void Delete(char *mem)=0;
};
///////////////////////////////////////////////////
class MallocAllocator : public Allocator
{
public:
MallocAllocator() {}
virtual ~MallocAllocator() {}
virtual char *New(unsigned int size);
virtual void Delete(char *mem);
protected:
};
/////////////////////////////////////////////////////
class RealtimeAllocator : public Allocator
{
public:
RealtimeAllocator(unsigned int size);
virtual ~RealtimeAllocator() {}
virtual void Reset();
virtual char *New(unsigned int size);
virtual void Delete(char *mem);
protected:
char *m_Buffer;
unsigned int m_Position;
unsigned int m_Size;
};
#endif
|
ed018c3b5f13739ed611d983f218f177f1d496b5 | 0c6342255d4f6b8cafb3237af0766bdffdb5eaf1 | /ArraysAndStrings/Arrays3D.cpp | b611939e1ac71f1cc47c63c8d35ae39640fc549f | [] | no_license | mohammed-mohiuddin/BasicsOfCPlusPlus | 960576e966a906089d63f45c31658f622502976d | 43148bbad100995053bbc4a5d103a24c4264139a | refs/heads/master | 2020-05-24T22:23:31.146746 | 2017-03-26T14:50:05 | 2017-03-26T14:50:05 | 84,886,919 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 977 | cpp | Arrays3D.cpp | //Program to illustrate the conspet of 3D arrays.
#include <iostream>
using namespace std;
int main(){
int numbers[2][2][2] ;
cout << "Enter 8 values: " << endl ;
//Enter 8 values.
for(int i = 0; i < 2; i++){
for(int j = 0; j < 2; j++){
for(int k = 0; k < 2; k++){
cin >> numbers[i][j][k] ;
}
}
}
cout << "numbers Names" << endl ;
for(int i = 0; i < 2; i++){
for(int j = 0; j < 2; j++){
for(int k = 0; k < 2; k++){
cout << "Address: numbers[" << i << "][" << j << "][" << k << "] = " << numbers[i][j][k] << endl ;
}
}
}
}
/* Output:
---------------------------------------------
Enter 8 values:
1
2
3
4
5
6
7
8
Residents Names
Address: residents[0][0][0] = 1
Address: residents[0][0][1] = 2
Address: residents[0][1][0] = 3
Address: residents[0][1][1] = 4
Address: residents[1][0][0] = 5
Address: residents[1][0][1] = 6
Address: residents[1][1][0] = 7
Address: residents[1][1][1] = 8
-------------------------------------------- */ |
e0bd522ac10872418a641b5abd324cffb0dd33e6 | a6dc92771a884c61b9c026a3197b6027e24391b1 | /cpp/src/arrow/compute/kernels/scalar_string.cc | d5ecc754c11fa4b477683be47f984f1682660059 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"CC-BY-4.0",
"Zlib",
"NTP",
"LicenseRef-scancode-protobuf",
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL",
"LLVM-exception",
"JSON",
"ZPL-2.1",
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | zeroviral/arrow | 83e929e70396513b3802ce6b3352b123ea536828 | 83fac7aaf1cc2cd5b4e7c6229bb5b0aff6653086 | refs/heads/master | 2022-11-12T19:06:54.444437 | 2020-06-26T03:06:30 | 2020-06-26T03:06:30 | 275,087,911 | 1 | 0 | Apache-2.0 | 2020-06-26T06:21:52 | 2020-06-26T06:21:51 | null | UTF-8 | C++ | false | false | 8,473 | cc | scalar_string.cc | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include <algorithm>
#include <cctype>
#include <string>
#include "arrow/compute/api_scalar.h"
#include "arrow/compute/kernels/common.h"
#include "arrow/compute/kernels/scalar_string_internal.h"
#include "arrow/util/value_parsing.h"
namespace arrow {
namespace compute {
namespace internal {
namespace {
// TODO: optional ascii validation
struct AsciiLength {
template <typename OUT, typename ARG0 = util::string_view>
static OUT Call(KernelContext*, ARG0 val) {
return static_cast<OUT>(val.size());
}
};
using TransformFunc = std::function<void(const uint8_t*, int64_t, uint8_t*)>;
// Transform a buffer of offsets to one which begins with 0 and has same
// value lengths.
template <typename T>
Status GetShiftedOffsets(KernelContext* ctx, const Buffer& input_buffer, int64_t offset,
int64_t length, std::shared_ptr<Buffer>* out) {
ARROW_ASSIGN_OR_RAISE(*out, ctx->Allocate((length + 1) * sizeof(T)));
const T* input_offsets = reinterpret_cast<const T*>(input_buffer.data()) + offset;
T* out_offsets = reinterpret_cast<T*>((*out)->mutable_data());
T first_offset = *input_offsets;
for (int64_t i = 0; i < length; ++i) {
*out_offsets++ = input_offsets[i] - first_offset;
}
*out_offsets = input_offsets[length] - first_offset;
return Status::OK();
}
// Apply `transform` to input character data- this function cannot change the
// length
template <typename Type>
void StringDataTransform(KernelContext* ctx, const ExecBatch& batch,
TransformFunc transform, Datum* out) {
using ArrayType = typename TypeTraits<Type>::ArrayType;
using offset_type = typename Type::offset_type;
if (batch[0].kind() == Datum::ARRAY) {
const ArrayData& input = *batch[0].array();
ArrayType input_boxed(batch[0].array());
ArrayData* out_arr = out->mutable_array();
if (input.offset == 0) {
// We can reuse offsets from input
out_arr->buffers[1] = input.buffers[1];
} else {
DCHECK(input.buffers[1]);
// We must allocate new space for the offsets and shift the existing offsets
KERNEL_RETURN_IF_ERROR(
ctx, GetShiftedOffsets<offset_type>(ctx, *input.buffers[1], input.offset,
input.length, &out_arr->buffers[1]));
}
// Allocate space for output data
int64_t data_nbytes = input_boxed.total_values_length();
KERNEL_RETURN_IF_ERROR(ctx, ctx->Allocate(data_nbytes).Value(&out_arr->buffers[2]));
if (input.length > 0) {
transform(input.buffers[2]->data() + input_boxed.value_offset(0), data_nbytes,
out_arr->buffers[2]->mutable_data());
}
} else {
const auto& input = checked_cast<const BaseBinaryScalar&>(*batch[0].scalar());
auto result = checked_pointer_cast<BaseBinaryScalar>(MakeNullScalar(out->type()));
if (input.is_valid) {
result->is_valid = true;
int64_t data_nbytes = input.value->size();
KERNEL_RETURN_IF_ERROR(ctx, ctx->Allocate(data_nbytes).Value(&result->value));
transform(input.value->data(), data_nbytes, result->value->mutable_data());
}
out->value = result;
}
}
void TransformAsciiUpper(const uint8_t* input, int64_t length, uint8_t* output) {
for (int64_t i = 0; i < length; ++i) {
const uint8_t utf8_code_unit = *input++;
// Code units in the range [a-z] can only be an encoding of an ascii
// character/codepoint, not the 2nd, 3rd or 4th code unit (byte) of an different
// codepoint. This guaranteed by non-overlap design of the unicode standard. (see
// section 2.5 of Unicode Standard Core Specification v13.0)
*output++ = ((utf8_code_unit >= 'a') && (utf8_code_unit <= 'z'))
? (utf8_code_unit - 32)
: utf8_code_unit;
}
}
template <typename Type>
struct AsciiUpper {
static void Exec(KernelContext* ctx, const ExecBatch& batch, Datum* out) {
StringDataTransform<Type>(ctx, batch, TransformAsciiUpper, out);
}
};
void TransformAsciiLower(const uint8_t* input, int64_t length, uint8_t* output) {
for (int64_t i = 0; i < length; ++i) {
// As with TransformAsciiUpper, the same guarantee holds for the range [A-Z]
const uint8_t utf8_code_unit = *input++;
*output++ = ((utf8_code_unit >= 'A') && (utf8_code_unit <= 'Z'))
? (utf8_code_unit + 32)
: utf8_code_unit;
}
}
template <typename Type>
struct AsciiLower {
static void Exec(KernelContext* ctx, const ExecBatch& batch, Datum* out) {
StringDataTransform<Type>(ctx, batch, TransformAsciiLower, out);
}
};
void AddAsciiLength(FunctionRegistry* registry) {
auto func = std::make_shared<ScalarFunction>("ascii_length", Arity::Unary());
ArrayKernelExec exec_offset_32 =
applicator::ScalarUnaryNotNull<Int32Type, StringType, AsciiLength>::Exec;
ArrayKernelExec exec_offset_64 =
applicator::ScalarUnaryNotNull<Int64Type, LargeStringType, AsciiLength>::Exec;
DCHECK_OK(func->AddKernel({utf8()}, int32(), exec_offset_32));
DCHECK_OK(func->AddKernel({large_utf8()}, int64(), exec_offset_64));
DCHECK_OK(registry->AddFunction(std::move(func)));
}
// ----------------------------------------------------------------------
// strptime string parsing
using StrptimeState = OptionsWrapper<StrptimeOptions>;
struct ParseStrptime {
explicit ParseStrptime(const StrptimeOptions& options)
: parser(TimestampParser::MakeStrptime(options.format)), unit(options.unit) {}
template <typename... Ignored>
int64_t Call(KernelContext* ctx, util::string_view val) const {
int64_t result = 0;
if (!(*parser)(val.data(), val.size(), unit, &result)) {
ctx->SetStatus(Status::Invalid("Failed to parse string ", val));
}
return result;
}
std::shared_ptr<TimestampParser> parser;
TimeUnit::type unit;
};
template <typename InputType>
void StrptimeExec(KernelContext* ctx, const ExecBatch& batch, Datum* out) {
applicator::ScalarUnaryNotNullStateful<TimestampType, InputType, ParseStrptime> kernel{
ParseStrptime(StrptimeState::Get(ctx))};
return kernel.Exec(ctx, batch, out);
}
Result<ValueDescr> StrptimeResolve(KernelContext* ctx, const std::vector<ValueDescr>&) {
if (ctx->state()) {
return ::arrow::timestamp(StrptimeState::Get(ctx).unit);
}
return Status::Invalid("strptime does not provide default StrptimeOptions");
}
void AddStrptime(FunctionRegistry* registry) {
auto func = std::make_shared<ScalarFunction>("strptime", Arity::Unary());
DCHECK_OK(func->AddKernel({utf8()}, OutputType(StrptimeResolve),
StrptimeExec<StringType>, StrptimeState::Init));
DCHECK_OK(func->AddKernel({large_utf8()}, OutputType(StrptimeResolve),
StrptimeExec<LargeStringType>, StrptimeState::Init));
DCHECK_OK(registry->AddFunction(std::move(func)));
}
template <template <typename> class ExecFunctor>
void MakeUnaryStringBatchKernel(std::string name, FunctionRegistry* registry) {
auto func = std::make_shared<ScalarFunction>(name, Arity::Unary());
auto exec_32 = ExecFunctor<StringType>::Exec;
auto exec_64 = ExecFunctor<LargeStringType>::Exec;
DCHECK_OK(func->AddKernel({utf8()}, utf8(), exec_32));
DCHECK_OK(func->AddKernel({large_utf8()}, large_utf8(), exec_64));
DCHECK_OK(registry->AddFunction(std::move(func)));
}
} // namespace
void RegisterScalarStringAscii(FunctionRegistry* registry) {
MakeUnaryStringBatchKernel<AsciiUpper>("ascii_upper", registry);
MakeUnaryStringBatchKernel<AsciiLower>("ascii_lower", registry);
AddAsciiLength(registry);
AddStrptime(registry);
}
} // namespace internal
} // namespace compute
} // namespace arrow
|
8b7c7f24ebf63b9ae071910e10fe0b3503d840c4 | dc4a282b7e604cb288375e7e2876ef36b6721aa8 | /boj/10819/10819.cpp | ce9da79f2fb91016ae0b740a989ef555b4486926 | [] | no_license | yjbong/problem-solving | 89be67ba24ad7495d82dcb0788dd7db1b849996a | c775271098daa05fcac269fd15de502e60592d49 | refs/heads/master | 2023-04-02T18:47:22.920512 | 2023-03-21T17:28:02 | 2023-03-21T17:28:02 | 70,111,700 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 439 | cpp | 10819.cpp | #include <cstdio>
#include <cstdlib>
#include <algorithm>
int N; // 배열 크기
int A[8]; // 배열
int order[8];
int main(void){
scanf("%d",&N);
for(int i=0; i<N; i++) scanf("%d",&A[i]);
for(int i=0; i<N; i++) order[i]=i;
int ans=0;
do{
int curAns=0;
for(int i=0; i<N-1; i++) curAns+=abs(A[order[i]]-A[order[i+1]]);
if(ans<curAns) ans=curAns;
}while(std::next_permutation(order,order+N));
printf("%d\n",ans);
return 0;
} |
d25c53275020bd029880a79f6e7457006175c78b | c34c35fbaa9fc5ece4c9d9cf2c9e415cd582b7f7 | /GSS3-Spoj.cpp | 98cc48080e0f9dc976039acb15bb8ba2b724f83f | [] | no_license | rodrigofariasm/AlgoritmosAvancados-UVA-CF-Spoj | e920e0b1b02e29d8580c1ae1ab63cecc1f031b69 | b8c757df1b43e989d7cd7a0760c4c716b9f264d5 | refs/heads/master | 2020-12-23T02:37:34.296470 | 2016-08-04T20:35:22 | 2016-08-04T20:35:22 | 14,282,723 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,461 | cpp | GSS3-Spoj.cpp | #include <vector>
#include <string>
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cctype>
#include <utility>
#include <algorithm>
#include <math.h>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = " << x << endl; }
#define PR(a,n) { cout << #a << " = "; FOR(_,1,n) cout << a[_] << ' '; cout << endl; }
#define PR0(a,n) { cout << #a << " = "; REP(_,n) cout << a[_] << ' '; cout << endl; }
#define NINF -100001
struct node {
//Soma completa do interval/ soma maxima no intervalo/
//soma maximo começando pela esquera/ mesma coisa pela direita
int c, m, e, d;
};
vector<node> A;
vector<node> tree;
node merge(node l, node r){
node aux;
aux.c = l.c + r.c;
aux.e = max(l.e, l.c + r.e);
aux.d = max(r.d, r.c + l.d);
aux.m = max(max(r.m, l.d + r.e) , max(max(aux.c, l.m), max(aux.d, aux.e)));
return aux;
}
void build(int n, int L, int R){
int mid = (L+R)/2;
if(L == R){
tree[n] = A[L-1];
return;
}
build(n << 1, L, mid);
build((n << 1) +1, mid+1, R);
node l = tree[n<<1];
node r = tree[(n<<1)+1];
tree[n] = merge(l, r);
}
void debug(int n){
for(int i = 1; i<= n*2-1; i++){
DEBUG(tree[i].c);
DEBUG(tree[i].m);
DEBUG(tree[i].e);
DEBUG(tree[i].d);
}
}
node query(int n, int i, int j, int L, int R){
if(i > R || j < L){
node a;
a.c = 0; a.m = NINF; a.e=NINF; a.d= NINF;
return a;
}
if(L >= i && R <= j) return tree[n];
node l = query(n*2, i, j , L, (L+R)/2);
node r = query(n*2+1,i, j, (L+R)/2 +1, R);
return merge(l, r);
}
void update(int n, int idx, int value, int l, int r){
if(idx < l || idx > r) return;
if(l == r){
node aux;
aux.c = value; aux.m = value; aux.e = value; aux.d = value;
tree[n] = aux;
return;
}
update(n << 1, idx, value, l, (l+r)/2);
update((n << 1)+1, idx, value, (l+r)/2+1, r);
tree[n] = merge(tree[n<<1] , tree[(n<<1)+1]);
}
int main(){
int n, q, a, op, x, y;
cin >> n;
node aux;
tree.assign(4*n, aux);
REP(i, n){
cin >> a;
aux.c = a; aux.m = a; aux.e = a; aux.d = a;
A.push_back(aux);
}
build(1, 1, n);
cin >> q;
REP(i, q){
cin >> op >> x >> y;
if(op){
cout << query(1, x, y, 1, n).m << endl;
}else{
update(1, x, y, 1, n);
}
}
}
|
39959f84b44db0deb68d90ffe18756b85bc8116c | 5d940315b7c2175e95da5a1c2ae2178f4cb53b9e | /scriptedit.cpp | ef041bec1c1f8e9f2276de8ab67e0dfce68ea3aa | [] | no_license | oldjudge/wxamcl | 8b33bdc648bc06fcda48e30180f70e284434db34 | 301c2478d0b037dbfec0564b24500e921303802f | refs/heads/master | 2022-10-18T07:35:05.158229 | 2022-10-02T08:45:48 | 2022-10-02T08:45:48 | 33,471,214 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,893 | cpp | scriptedit.cpp | #include "main.h"
BEGIN_EVENT_TABLE (amcScriptEdit, wxStyledTextCtrl)
EVT_STC_MARGINCLICK (wxID_ANY, amcScriptEdit::OnMarginClick)
END_EVENT_TABLE()
amcScriptEdit::amcScriptEdit(wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size, long style)
: wxStyledTextCtrl (parent, id, pos, size, style)
{
m_fontsize=9;
wxString luawords =
wxT("function end if then do else for in return break while local repeat elseif and or not false true nil require");
wxString luawords2 =
wxT("wxamcl.echo wxamcl.echowin wxamcl.gag wxamcl.color wxamcl.colorwin wxamcl.colorline wxamcl.colorword wxamcl.colorall wxamcl.scroll \
wxamcl.getlinenumber wxamcl.getline wxamcl.execute wxamcl.send wxamcl.wait wxamcl.waitfor wxamcl.loadprofile wxamcl.substitute \
wxamcl.createwindow wxamcl.hidewindow wxamcl.showwindow wxamcl.clearwindow wxamcl.destroywindow wxamcl.setbackground wxamcl.createnb wxamcl.addpage wxamcl.createtoolbar wxamcl.addbtn \
wxamcl.action.new wxamcl.action.get wxamcl.action.delete wxamcl.action.enable wxamcl.action.getpattern wxamcl.action.setpattern \
wxamcl.action.getact wxamcl.action.setact wxamcl.action.getpriority wxamcl.action.setpriority wxamcl.action.getcolmatch wxamcl.action.setcolmatch \
wxamcl.action.enableall wxamcl.action.disableall wxamcl.action.getall wxamcl.action.delgroup wxamcl.action.enablegroup wxamcl.action.getuserdata wxamcl.action.execute \
wxamcl.alias.new wxamcl.alias.get wxamcl.alias.delete wxamcl.alias.enable wxamcl.alias.getall wxamcl.alias.getaction\
wxamcl.alias.setaction wxamcl.alias.delgroup wxamcl.alias.enablegroup \
wxamcl.hk.new wxamcl.hk.delgroup wxamcl.hk.delete wxamcl.hk.enable wxamcl.hk.execute wxamcl.hk.enablegroup wxamcl.hk.delgroup \
wxamcl.var.new wxamcl.var.set wxamcl.var.get wxamcl.var.delete wxamcl.var.enable wxamcl.var.getall wxamcl.var.enablegroup wxamcl.var.delgroup \
wxamcl.gauge.update wxamcl.gauge.new wxamcl.gauge.setsize wxamcl.gauge.setcolor wxamcl.gauge.createwindow wxamcl.gauge.setlabel wxamcl.gauge.delete wxamcl.gauge.setstyle \
wxamcl.timer.new wxamcl.timer.delete wxamcl.timer.start wxamcl.timer.stop wxamcl.timer.enable \
wxamcl.button.new, wxamcl.button.delete, wxamcl.button.get, wxamcl.button.setaction, wxamcl.button.getaction, wxamcl.button.press, wxamcl.button.setlabel, wxamcl.button.setbitmap, \
wxamcl.mxp.enable wxamcl.mxp.echo wxamcl.mxp.echowin \
wxamcl.list.new wxamcl.list.additem wxamcl.list.clear wxamcl.list.delete wxamcl.list.contains wxamcl.list.delitem wxamcl.list.delitemat wxamcl.list.getall wxamcl.list.get wxamcl.list.getsize \
wxamcl.list.enablegroup wxamcl.list.delgroup \
wxamcl.gmcp.send \
wxamcl.db.open wxamcl.db.execute wxamcl.db.columns wxamcl.db.results wxamcl.db.close wxamcl.db.insert \
wxamcl.draw.text wxamcl.draw.line wxamcl.draw.circle wxamcl.draw.square wxamcl.draw.winsize wxamcl.draw.bitmap wxamcl.draw.setfont wxamcl.draw.clear wxamcl.draw.refresh wxamcl.draw.settip \
wxamcl.setmsp wxamcl.getscriptsign wxamcl.createamcwin wxamcl.logwin\
wxamcl.seteventfile wxamcl.mouseevents wxamcl.setlefthandler wxamcl.setrighthandler wxamcl.setwheelhandler wxamcl.setmovehandler \
wxamcl.mxp.enable wxamcl.mxp.link wxamcl.mxp.echo wxamcl.mxp.echowin");
wxString amcwords =
"clearwin capstart capend setvar gag help loadprofile func script bscript gagwin connect pwd refreshwin raw capturewin capturenb log htmllog resume test";
wxString luawords3 =
("wxamcl.Action wxamcl.Alias wxamcl.Vars wxamcl.ClientVars wxamcl.ATCP wxamcl.GMCP wxamcl.MSDP");
SetLexer(wxSTC_LEX_LUA);
SetKeyWords(0, luawords);
SetKeyWords(1, luawords2);
SetKeyWords(3, luawords3);
SetKeyWords(2, amcwords);
SetMarginWidth (0, 0);
SetMarginType (0, wxSTC_MARGIN_NUMBER);
StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY"));
StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxLIGHT_GREY);
// set margin as unused
SetMarginType (1, wxSTC_MARGIN_SYMBOL);
SetMarginWidth (1, 0);
SetMarginSensitive (1, false);
// set visibility
SetVisiblePolicy (wxSTC_VISIBLE_STRICT|wxSTC_VISIBLE_SLOP, 1);
SetXCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1);
SetProperty("fold.compact", "0");
SetProperty("fold.comment", "1");
SetProperty("fold", "1");
SetMarginWidth (2, 0);
SetMarginType (2, wxSTC_MARGIN_SYMBOL);
SetMarginMask (2, wxSTC_MASK_FOLDERS);
StyleSetBackground (2, *wxWHITE);
SetMarginSensitive (2, true);
SetMarginWidth(0, 36);
SetMarginWidth(2, 16);
// markers
MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, _T("WHITE"), _T("BLACK"));
MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, _T("WHITE"), _T("BLACK"));
MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, _T("WHITE"), _T("BLACK"));
MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, _T("WHITE"), _T("BLACK"));
MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, _T("WHITE"), _T("WHITE"));
MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, _T("WHITE"), _T("BLACK"));
MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, _T("WHITE"), _T("BLACK"));
SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED |
wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED);
MudMainFrame *f = wxGetApp().GetFrame();
//#if defined __WXMSW__
wxFont font (*f->GetScriptFont());
wxFont bfont (wxFontInfo(m_fontsize).Bold().FaceName(font.GetFaceName()).Family(wxFONTFAMILY_MODERN));
//#endif
/*#if defined __WXGTK_
wxFont font (*f->GetScriptFont());
wxFont bfont (m_fontsize, wxMODERN, wxNORMAL, wxFONTWEIGHT_BOLD, false, font.GetFaceName());
#endif
#if defined __WXOSX
wxFont font (*f->GetScriptFont());
wxFont bfont (m_fontsize, wxMODERN, wxNORMAL, wxFONTWEIGHT_BOLD, false, font.GetFaceName());
#endif*/
m_font = font;
StyleSetFont (wxSTC_STYLE_DEFAULT, m_font);
StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK);
StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE);
//StyleSetBold(wxSTC_STYLE_DEFAULT, true);
StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY"));
// set spaces and indention
SetTabWidth (4);
SetUseTabs (false);
SetTabIndents (true);
SetBackSpaceUnIndents (true);
//Set Lua styles
StyleSetFont (wxSTC_LUA_DEFAULT, m_font);
StyleSetForeground (wxSTC_LUA_DEFAULT, wxColour("BLACK"));
//StyleSetBackground (wxSTC_LUA_DEFAULT, *wxWHITE);
StyleSetForeground(wxSTC_LUA_COMMENTLINE, wxColour ("FOREST GREEN"));
StyleSetForeground(wxSTC_LUA_COMMENT, wxColour ("FOREST GREEN"));
StyleSetForeground(wxSTC_LUA_COMMENTDOC, wxColour ("FOREST GREEN"));
StyleSetFont(wxSTC_LUA_COMMENTLINE, m_font);
StyleSetFont(wxSTC_LUA_COMMENT, m_font);
StyleSetFont(wxSTC_LUA_COMMENTDOC, m_font);
StyleSetForeground(wxSTC_LUA_PREPROCESSOR, wxColour ("BLUE"));
StyleSetFont(wxSTC_LUA_WORD, bfont);
StyleSetBold(wxSTC_LUA_WORD, true);
StyleSetForeground(wxSTC_LUA_WORD, wxColour ("BLUE"));
StyleSetFont(wxSTC_LUA_WORD2, bfont);
StyleSetForeground(wxSTC_LUA_WORD2, wxColour ("SKY BLUE"));
StyleSetForeground(wxSTC_LUA_WORD3, wxColour ("MEDIUM BLUE"));
StyleSetFont(wxSTC_LUA_WORD3, bfont);
StyleSetBold(wxSTC_LUA_WORD3, true);
StyleSetForeground(wxSTC_LUA_WORD4, wxColour ("CORAL"));
StyleSetFont(wxSTC_LUA_WORD4, bfont);
StyleSetBold(wxSTC_LUA_WORD4, true);
StyleSetFont(wxSTC_LUA_STRING, m_font);
StyleSetForeground(wxSTC_LUA_STRING, wxColour ("RED"));
StyleSetFont(wxSTC_LUA_CHARACTER, m_font);
StyleSetForeground(wxSTC_LUA_CHARACTER, wxColour ("RED"));
StyleSetFont(wxSTC_LUA_LITERALSTRING, m_font);
StyleSetForeground(wxSTC_LUA_LITERALSTRING, wxColour ("ORANGE RED"));
StyleSetFont(wxSTC_LUA_NUMBER, m_font);
StyleSetForeground(wxSTC_LUA_NUMBER, wxColour ("SIENNA"));
StyleSetFont(wxSTC_LUA_STRINGEOL, m_font);
StyleSetForeground(wxSTC_LUA_STRINGEOL, wxColour ("SIENNA"));
StyleSetFont(wxSTC_LUA_OPERATOR, m_font);
StyleSetForeground(wxSTC_LUA_OPERATOR, wxColour ("DARK ORCHID"));
StyleSetFont(wxSTC_LUA_IDENTIFIER, m_font);
StyleSetForeground(wxSTC_LUA_IDENTIFIER, wxColour ("DARK GREY"));
SetViewWhiteSpace(false);
SetCurrentPos(0);
}
amcScriptEdit::~amcScriptEdit()
{
}
//! misc
void amcScriptEdit::OnMarginClick (wxStyledTextEvent &event) {
if (event.GetMargin() == 2) {
int lineClick = LineFromPosition (event.GetPosition());
int levelClick = GetFoldLevel (lineClick);
if ((levelClick & wxSTC_FOLDLEVELHEADERFLAG) > 0) {
ToggleFold (lineClick);
}
}
event.Skip();
}
|
69018cc2ed89c76b33c615884d4f3063b40a1ee2 | ad35f05af746f617828bad9299260b5b368ea850 | /exercise12-jrsavage29/traffic_light.h | d1ab590634a9e2f2a4c50d05675b024278c7db40 | [] | no_license | jrsavage29/Software-Design | 22c3abf86b2784f160441e4fac0ad7331a8a3de8 | a2660ce12ee993ca1592d5b981fd1d7ab10fb020 | refs/heads/main | 2023-03-27T22:55:34.450209 | 2021-03-22T02:13:28 | 2021-03-22T02:13:28 | 350,170,272 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 399 | h | traffic_light.h | // traffic_light.h
#ifndef TRAFFIC_LIGHT_H
#define TRAFFIC_LIGHT_H
#include <QWidget>
class QRadioButton;
class TrafficLight: public QWidget{
Q_OBJECT
public:
TrafficLight(QWidget * parent = nullptr);
public slots:
void toggle();
private:
QRadioButton * redlight;
QRadioButton * yellowlight;
QRadioButton * greenlight;
int position;
};
#endif
|
2c26232fe38a760e9da4d73577e9e022196f7b43 | ffe41324b5ab98c46c52ffbaf896d668658641c5 | /GuitArduino/Potentiometer.cpp | 106613b4b732e4cd0f5609a04d1bd1b90657846c | [] | no_license | TCRichards/Arduino-MIDI-Guitar | ec08fb9144a77cc75bf6cd67c01fabf47af2e044 | dcc6fe254c06ce6be2b8f5ea47c9cf0f06678595 | refs/heads/master | 2021-07-09T04:59:13.067127 | 2020-07-05T19:30:10 | 2020-07-05T19:30:10 | 146,234,915 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 423 | cpp | Potentiometer.cpp | #include "Potentiometer.h"
Potentiometer::Potentiometer(int pin) {
_pin = pin;
pinMode(pin, INPUT);
_min = 20; // Default minimum value (should be changed by each unique piece)
}
int Potentiometer::getValue() {
return analogRead(_pin);
}
void Potentiometer::setMin(int minimum) {
_min = minimum;
}
int Potentiometer::getMin() {
return _min;
}
bool Potentiometer::isOn() {
return getValue() > getMin();
}
|
9f9f9b05d808b96d939fee5c0ec938c652e14e0a | 39d1f586447ed9c48c805350e3b0abcaeb52dc07 | /CODING BLOCKS/Algo++ Classes/Class-2_12_Jun/check_sorted_rec.cpp | f4a3a4d76ecc214922116e4b319e65ad5238b672 | [] | no_license | vaarigupta/OOPS_DS_ALGO | 80e3123f59b09c10e0b2750130b5554d9a7690a0 | 921756a9ef5a4b99c610bb9803776940d072438f | refs/heads/master | 2022-06-15T04:35:21.238885 | 2022-06-10T20:00:00 | 2022-06-10T20:00:00 | 132,237,189 | 1 | 1 | null | 2019-12-06T19:35:57 | 2018-05-05T10:20:30 | C++ | UTF-8 | C++ | false | false | 478 | cpp | check_sorted_rec.cpp | #include<iostream>
using namespace std;
bool check_sorted(int *arr, int n)
{
if(n==1)
{
return true;
}
if(arr[0]<arr[1] && check_sorted(arr+1,n-1))
{
return true;
}
return false;
}
int main()
{
int arr[] = {1,2,3,4,5,6};
int n = sizeof(arr)/sizeof(int);
if(check_sorted(arr,n))
{
cout<<"Yes sorted "<<endl;
}
else
{
cout<<"Not sorted"<<endl;
}
return 0;
}
|
845867950457b03810676ecba9371de5ca6168a2 | bf32bb6630167ba66981b3126280dbebe0b30ce9 | /main.cpp | e728a79a01c8130c96215f576ab2538454e246f6 | [] | no_license | astro813/810PROJECT | d7a4b9bd29e96fa3cc49784b37cea7df478d4df8 | c68e3ee6c20f9fd07d556692bcf530f381693d49 | refs/heads/master | 2021-01-10T13:57:11.734168 | 2016-05-10T15:01:43 | 2016-05-10T15:01:43 | 55,813,925 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,738 | cpp | main.cpp | //***********************************************************************************
//Discription:Main function of robotsimulator
//written by Jun Chen
//***********************************************************************************
#include "robotgui.h"
#include <QApplication>
vector<Robot*> robotList;
int Robot::count_robots = 0;
Datalayer myLayer(400,400);
int main(int argc, char *argv[]){
QApplication a(argc, argv);
RobotGui w; //create GUI
//Lake
//(double s,double x,double y,double theta,double r,double a, int ID): speed(s),coordinate_x(x),coordinate_y(y),theta(theta),robotsize_radius(r),alert(a), ID(ID)
//Robot* LakeA=new Robot(0.0,300.0,300.0,45,35,35,0);
//Robot* LakeB=new Robot(0.0,350.0,300.0,45,35,35,0);
//Robot* LakeC=new Robot(0.0,325.0,325.0,45,30,30,0);
//Robot* LakeD=new Robot(0.0,330.0,275.0,45,30,30,0);
/*robotList.push_back(LakeA);
robotList.push_back(LakeB);
robotList.push_back(LakeC);
robotList.push_back(LakeD);*/
Robot* LakeE=new Robot(0.0,350.0,350.0,0,50,60,0);
robotList.push_back(LakeE);
//Trees
Robot* TreeA=new Robot(0.0,30.0,330.0,45,5,5,0);
Robot* TreeB=new Robot(0.0,50.0,100.0,45,5,5,0);
Robot* TreeC=new Robot(0.0,100.0,20.0,45,5,5,0);
Robot* TreeD=new Robot(0.0,250.0,100.0,45,5,5,0);
Robot* TreeE=new Robot(0.0,150.0,250.0,45,5,5,0);
robotList.push_back(TreeA);
robotList.push_back(TreeB);
robotList.push_back(TreeC);
robotList.push_back(TreeD);
robotList.push_back(TreeE);
w.show(); //Show the GUI
return a.exec(); //Run
}
|
6ea404f5adc009fbe317d88627f7579308df0f5b | 993dc3ab9132772a40b50eec1cd1fa09b5487e1b | /imageeditorengine/filters/FilterIclSource/Src/CFilterIclSource.cpp | 9ec0a66f8735e0849e39fbdd37576a80d0415836 | [] | no_license | SymbianSource/oss.FCL.sf.app.imgeditor | c421f8e73b20bdafcead4996aa1b5876f3e081b8 | 77320f0d084576e49b70e92c70921959e1809d35 | refs/heads/master | 2021-01-16T23:03:41.398394 | 2010-11-15T12:21:35 | 2010-11-15T12:21:35 | 68,768,705 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,617 | cpp | CFilterIclSource.cpp | /*
* Copyright (c) 2010 Ixonos Plc.
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - Initial contribution
*
* Contributors:
* Ixonos Plc
*
* Description:
*
*/
#include <e32std.h>
#include <eikenv.h>
#include <fbs.h>
#include <ImageConversion.h>
#include <ICL/icl_propertyuids.h>
#include "CFilterIclSource.h"
const TInt KScaleBits = 12;
const TInt KBlockSize = 16;
const TInt KDestBufferMaxDim = 352;
//=============================================================================
EXPORT_C TInt CFilterIclSource::Create()
{
CFilterIclSource * ptr = NULL;
TRAPD (error, ptr = NewL(); );
if (error != KErrNone)
{
ptr = NULL;
}
return (TInt)((MImageFilter*)ptr);
}
//=============================================================================
CFilterIclSource* CFilterIclSource::NewL()
{
CFilterIclSource * self = new (ELeave) CFilterIclSource();
CleanupStack::PushL (self);
self->ConstructL();
CleanupStack::Pop (self);
return self;
}
//=============================================================================
CFilterIclSource::~CFilterIclSource()
{
delete iBitmap;
delete[] iDestBuffer;
if (iLoader)
{
iLoader->Cancel();
}
delete iLoader;
delete[] iIndexMap;
for (TInt i = 0; i < iBlockBufferSize; ++i)
{
delete iBlockBuffer[i];
iBlockBuffer[i] = NULL;
}
delete[] iBlockBuffer;
iBlockBuffer = NULL;
}
//=============================================================================
CFilterIclSource::CFilterIclSource()
{
}
//=============================================================================
void CFilterIclSource::ConstructL()
{
}
//=============================================================================
TRect CFilterIclSource::Rect()
{
if (iOutputState == EDirect)
{
return iRect;
}
else
{
return iScaledRect;
}
}
//=============================================================================
TReal CFilterIclSource::Scale()
{
if (iOutputState == EDirect)
{
return 1.0;
}
else
{
return iRelScale;
}
}
//=============================================================================
TSize CFilterIclSource::ViewPortSize()
{
return iSize;
}
//=============================================================================
TBlock * CFilterIclSource::GetBlockL ( const TRect & aRect )
{
if (iOutputState == EBuffer)
{
if ( !aRect.Intersects(iScaledRect) )
{
return NULL;
}
TRect rect = aRect;
rect.Intersection(iScaledRect);
TBlock * pB = new (ELeave) TBlock (rect);
TUint32 * pS = iDestBuffer + (rect.iTl.iY - iScaledRect.iTl.iY) * iDestSize.iWidth +
(rect.iTl.iX - iScaledRect.iTl.iX);
TUint32 * pD = pB->iData;
for (TInt i = rect.iTl.iY; i < rect.iBr.iY; ++i)
{
Mem::Copy(pD, pS, pB->iWidth * sizeof(TUint32));
pD += pB->iWidth;
pS += iDestSize.iWidth;
}
return pB;
}
else
{
if (!aRect.Intersects(iRect))
{
return NULL;
}
// Clip rectangle to image
TRect rect = aRect;
rect.Intersection(iRect);
// Create block for pixel data
TBlock * pB = new (ELeave) TBlock;
pB->iRect = rect;
pB->iWidth = (pB->iRect.iBr.iX - pB->iRect.iTl.iX);
pB->iHeight = (pB->iRect.iBr.iY - pB->iRect.iTl.iY);
pB->iDataLength = pB->iWidth * pB->iHeight;
pB->iData = new (ELeave) TUint32 [pB->iDataLength];
// Store pixel data to block
TBitmapUtil bm (iBitmap);
bm.Begin(TPoint(0,0));
TUint8 * psos = (TUint8*)(iBitmap->DataAddress());
psos += pB->iRect.iTl.iY * iWStep + pB->iRect.iTl.iX * 3;
TUint32 * pd = pB->iData;
for (TInt i = rect.iTl.iY; i < rect.iBr.iY; ++i)
{
TUint8 * ps = psos;
psos += iWStep;
for (TInt j = rect.iTl.iX; j < rect.iBr.iX; ++j)
{
TUint8 b = *ps++;
TUint8 g = *ps++;
TUint8 r = *ps++;
*pd++ = (r << 16) | (g << 8) | b;
}
}
bm.End();
return pB;
}
}
//=============================================================================
void CFilterIclSource::SetParent (MImageFilter * aParent)
{
iParent = aParent;
}
//=============================================================================
void CFilterIclSource::SetChild (MImageFilter * aChild)
{
iChild = aChild;
}
//=============================================================================
TInt CFilterIclSource::CmdL (const TDesC16 & aCmd)
{
TLex lex (aCmd);
while ( !lex.Eos() )
{
TPtrC token = lex.NextToken();
if (token.Compare( _L("file") ) == 0)
{
iFileName.Zero();
// Find the start of the string
while (!lex.Eos())
{
if (lex.Get() == '"') break;
}
// Get the text data
while (!lex.Eos())
{
TChar c= lex.Get();
if (c == '"')
{
break;
}
else
{
iFileName.Append(c);
}
}
if (iBitmap)
{
delete iBitmap;
iBitmap = NULL;
}
if(iLoader)
{
delete iLoader;
iLoader = NULL;
}
iSize.iWidth = 0;
iSize.iHeight = 0;
iRect.iTl.iX = 0;
iRect.iTl.iY = 0;
iRect.iBr.iX = 0;
iRect.iBr.iY = 0;
iWStep = 0;
}
else if( token.Compare( _L("loadimage") ) == 0 )
{
if ( !iBitmap )
{
// Delete old bitmap and create new
iBitmap = new (ELeave) CFbsBitmap;
// Create new loader and start loading image
if (iLoader)
{
delete iLoader;
iLoader = NULL;
}
iLoader = new (ELeave) CImageLoader (this);
iLoader->LoadBitmapL (iFileName, iBitmap);
// Wait here until loading is finished
CActiveScheduler::Start();
// Delete loader, not needed anymore
delete iLoader;
iLoader = NULL;
// Get image size
iSize = iBitmap->SizeInPixels();
// Update region of interest
iRect.iTl.iX = 0;
iRect.iTl.iY = 0;
iRect.iBr.iX = iSize.iWidth;
iRect.iBr.iY = iSize.iHeight;
// Compute row offset in bytes
iWStep = CFbsBitmap::ScanLineLength(iSize.iWidth, EColor16M);
// Initialize block buffer size to 2 x row size in blocks
iBlockBufferSize = iSize.iWidth / KBlockSize;
if (iSize.iWidth % KBlockSize > 0)
{
iBlockBufferSize++;
}
iBlockBufferSize *= 2;
// Compute image size in 16 x 16 blocks
iSizeInBlocks.iWidth = iSize.iHeight / KBlockSize;
if (iSize.iHeight % KBlockSize > 0)
{
iSizeInBlocks.iWidth++;
}
iSizeInBlocks.iHeight = iSize.iHeight / KBlockSize;
if (iSizeInBlocks.iHeight % KBlockSize > 0)
{
iSizeInBlocks.iHeight++;
}
// Crate new block buffer, init to zero
iBlockBuffer = new (ELeave) TBlockEntry * [iBlockBufferSize];
Mem::FillZ (iBlockBuffer, iBlockBufferSize * sizeof(TBlockEntry *));
// Reset oldest block index to zero
iOldestBlock = 0;
// Create index map, init to -1
TInt blocks = iSizeInBlocks.iWidth * iSizeInBlocks.iHeight;
delete[] iIndexMap;
iIndexMap = NULL;
iIndexMap = new (ELeave) TInt [blocks];
for (TInt i = 0; i < blocks; ++i) iIndexMap[i] = -1;
}
iOutputState = EBuffer;
// set crop rectangle to full image size
if (iRect.Size() == TSize(0,0))
{
iRect.iTl.iX = 0;
iRect.iTl.iY = 0;
iRect.iBr.iX = iSize.iWidth;
iRect.iBr.iY = iSize.iHeight;
}
// load rectangle
LoadRectL();
}
else if( token.Compare( _L("ulc") ) == 0 )
{
lex.Inc();
lex.Val( iRect.iTl.iX );
}
else if( token.Compare( _L("ulr") ) == 0 )
{
lex.Inc();
lex.Val( iRect.iTl.iY );
}
else if( token.Compare( _L("lrc") ) == 0 )
{
lex.Inc();
lex.Val( iRect.iBr.iX );
}
else if( token.Compare( _L("lrr") ) == 0 )
{
lex.Inc();
lex.Val( iRect.iBr.iY );
}
else if( token.Compare( _L("fileoutput") ) == 0 )
{
iRect.iTl.iX = 0;
iRect.iTl.iY = 0;
iRect.iBr.iX = iSize.iWidth;
iRect.iBr.iY = iSize.iHeight;
iOutputState = EDirect;
}
else if( token.Compare( _L("bufferoutput") ) == 0 )
{
iOutputState = EBuffer;
}
}
return 0;
}
//=============================================================================
const char * CFilterIclSource::Type()
{
return "iclsource";
}
//=============================================================================
void CFilterIclSource::OperationReady (const TInt /* aError */)
{
CActiveScheduler::Stop();
}
//=============================================================================
void CFilterIclSource::LoadRectL()
{
// compute destination buffer size
TInt width = iRect.iBr.iX - iRect.iTl.iX;
TInt height = iRect.iBr.iY - iRect.iTl.iY;
if (width >= height)
{
TReal scale = (TReal)KDestBufferMaxDim / width;
iDestSize.iWidth = KDestBufferMaxDim;
iDestSize.iHeight = (TInt)(height * scale + 0.5);
}
else
{
TReal scale = (TReal)KDestBufferMaxDim / height;
iDestSize.iHeight = KDestBufferMaxDim;
iDestSize.iWidth = (TInt)(width * scale + 0.5);
}
// create new destination buffer
delete[] iDestBuffer;
iDestBuffer = new (ELeave) TUint32 [iDestSize.iWidth * iDestSize.iHeight];
// scale buffer
TBitmapUtil bmtl (iBitmap);
bmtl.Begin(TPoint(0,0));
TInt scale = (height << KScaleBits) / iDestSize.iHeight;
TUint32 * pD = iDestBuffer;
TUint8 * pS = (TUint8 *)iBitmap->DataAddress() +
iRect.iTl.iY * iWStep + iRect.iTl.iX * 3;
for (TInt i = 0; i < iDestSize.iHeight; ++i)
{
TInt y = (i * scale) >> KScaleBits;
for (TInt j = 0; j < iDestSize.iWidth; ++j)
{
TInt x = (j * scale) >> KScaleBits;
TUint8 * pSS = pS + y * iWStep + x * 3;
TUint32 c = (*(pSS + 2) << 16) | (*(pSS + 1) << 8) | *pSS;
*pD++ = c;
}
}
bmtl.End();
iRelScale = (TReal)(iDestSize.iHeight) / (TReal) height;
iScaledRect.iTl.iX = (TInt)(iRect.iTl.iX * iRelScale + 0.5);
iScaledRect.iTl.iY = (TInt)(iRect.iTl.iY * iRelScale + 0.5);
iScaledRect.iBr.iX = (TInt)(iRect.iBr.iX * iRelScale + 0.5);
iScaledRect.iBr.iY = (TInt)(iRect.iBr.iY * iRelScale + 0.5);
// check that iScaledRect is inside buffer
TInt tmp = iScaledRect.iBr.iX - iScaledRect.iTl.iX - iDestSize.iWidth;
if ( tmp > 0 )
{
iScaledRect.iBr.iX -= tmp;
}
tmp = iScaledRect.iBr.iY - iScaledRect.iTl.iY - iDestSize.iHeight;
if (tmp > 0 )
{
iScaledRect.iBr.iY -= tmp;
}
/*
CFbsBitmap * bitmap = new (ELeave) CFbsBitmap;
CleanupStack::PushL(bitmap);
User::LeaveIfError(bitmap->Create(iDestSize, EColor16M));
TBitmapUtil bm (bitmap);
bm.Begin(TPoint(0,0));
TUint8 * pDOS = (TUint8 *)bitmap->DataAddress();
TUint32 * ps = iDestBuffer;
TInt ws = CFbsBitmap::ScanLineLength(iDestSize.iWidth, EColor16M);
for (TInt ii = 0; ii < iDestSize.iHeight; ++ii)
{
TUint8 * pD = pDOS;
pDOS += ws;
for (TInt j = 0; j < iDestSize.iWidth; ++j)
{
TUint32 c = *ps++;
*pD++ = c & 0xFF;
c >>= 8;
*pD++ = c & 0xFF;
c >>= 8;
*pD++ = c & 0xFF;
}
}
bm.End();
TFileName filename;
filename.Copy (_L("c:\\nokia\\images\\sf_"));
filename.AppendNum((TInt)iDestBuffer);
filename.Append(_L(".mbm"));
bitmap->Save(filename);
CleanupStack::PopAndDestroy(); // bitmap
*/
}
//=============================================================================
CImageLoader::CImageLoader(MLoaderObserver * aObserver) :
CActive (EPriorityStandard),
iObserver (aObserver)
{
CActiveScheduler::Add (this);
}
//=============================================================================
CImageLoader::~CImageLoader()
{
if (iDecoder)
{
iDecoder->Cancel();
}
delete iDecoder;
}
//=============================================================================
void CImageLoader::LoadBitmapL (TDesC & aFileName, CFbsBitmap * iBitmap)
{
// Delete old decoder
if (iDecoder)
{
iDecoder->Cancel();
}
delete iDecoder;
iDecoder = NULL;
//Get the MIME type of the file to be decoded:
TBuf8<KMaxFileName> mimeType;
RFs vFs;
User::LeaveIfError(vFs.Connect());
CleanupClosePushL(vFs);
TRAPD( getMimeErr, CImageDecoder::GetMimeTypeFileL(
vFs,
aFileName,
mimeType ) );
if ( getMimeErr != KErrNone ) { }
CleanupStack::PopAndDestroy(); // vFs
// If MIME type contains "jpeg", then it would make sense to check
// for HW Codec possibility
TUid implementationUid = KNullUid; // default value that can be used
TInt vStartIndLocation = mimeType.Find( _L8( "jpeg" ) );
if( vStartIndLocation != KErrNotFound )
{
RUidDataArray implArray;
const TUid properties[] = { KUidHwCodec };
// Request existing plugins with the desired properties
TRAPD( getIntErr, CImageDecoder::GetInterfaceImplementationsL(
properties,
1,
implArray ) );
if ( implArray.Count() != 0 && getIntErr == KErrNone )
{
// use the first HW codec from the list
implementationUid = implArray[0];
// HW Codec found
}
}
// if HW codec not found implementationUid == KNullUid ->
// ICL selects proper codec
TRAPD( decErr, iDecoder = CImageDecoder::FileNewL(
vFs,
aFileName,
CImageDecoder::EOptionNone,
KNullUid,
KNullUid,
implementationUid ) );
if ( decErr != KErrNone )
{
User::Leave( decErr );
}
// Create new bitmap
User::LeaveIfError ( iBitmap->Create (iDecoder->FrameInfo().iOverallSizeInPixels, EColor16M));
// Start decoding
iDecoder->Convert (&iStatus, *iBitmap);
if (iStatus != KRequestPending)
{
User::Leave(iStatus.Int());
}
SetActive();
}
//=============================================================================
void CImageLoader::RunL()
{
if (iStatus.Int() == KRequestPending)
{
iDecoder->ContinueConvert (&iStatus);
}
else
{
iObserver->OperationReady ( iStatus.Int() );
}
}
//=============================================================================
void CImageLoader::DoCancel()
{
if (iDecoder)
{
iDecoder->Cancel();
}
}
#if !defined(EKA2)
GLDEF_C TInt E32Dll( TDllReason )
{
return KErrNone;
}
#endif
|
0c60da871e70688ce9e89e0110b7d48f11695618 | ee5d47e1b6d68ad1a0bb1b9d4d643ae8d576c668 | /kernel/src/net/dhcp_layer.cpp | 6287069988ced4e44be7fc5caa63638a72d52b96 | [
"MIT"
] | permissive | wichtounet/thor-os | c7008b69cbec11dac2daac60e588bf588cc65836 | 4fae8bb77cf4b3b34241c7004a32e8bca22a51e9 | refs/heads/develop | 2023-05-30T15:19:47.312478 | 2021-05-24T09:15:10 | 2021-05-24T09:15:10 | 13,440,471 | 1,743 | 217 | MIT | 2021-05-24T09:15:10 | 2013-10-09T11:28:24 | C++ | UTF-8 | C++ | false | false | 12,420 | cpp | dhcp_layer.cpp | //=======================================================================
// Copyright Baptiste Wicht 2013-2018.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://www.opensource.org/licenses/MIT)
//=======================================================================
#include "net/dhcp_layer.hpp"
#include "net/udp_layer.hpp"
#include "net/ethernet_layer.hpp"
#include "kernel_utils.hpp"
#include "tlib/errors.hpp"
namespace {
void prepare_packet(network::packet& packet, network::interface_descriptor& interface) {
packet.tag(3, packet.index);
// Set the DHCP header
auto* dhcp_header = reinterpret_cast<network::dhcp::header*>(packet.payload + packet.index);
dhcp_header->htype = 1; // Ethernet hardware
dhcp_header->hlen = 6; // Ethernet Mac Address
dhcp_header->hops = 0; // No relays
dhcp_header->secs = 0; // Not used for us
dhcp_header->client_ip = 0; // Cleared by default
dhcp_header->your_ip = 0; // Cleared by default
dhcp_header->server_ip = 0; // Cleared by default
dhcp_header->gw_ip = 0; // Cleared by default
// Set the MAC address
char mac[6];
network::ethernet::mac64_to_mac6(interface.mac_address, mac);
std::copy_n(mac, 6, dhcp_header->client_haddr);
std::fill_n(dhcp_header->client_haddr + 6, 10, 0);
// Clear the legacy BOOTP fields
std::fill_n(dhcp_header->server_name, 64, 0);
std::fill_n(dhcp_header->boot_filename, 128, 0);
packet.index += sizeof(network::dhcp::header);
}
} //end of anonymous namespace
network::dhcp::layer::layer(network::udp::layer* parent) : parent(parent) {
parent->register_dhcp_layer(this);
}
void network::dhcp::layer::decode(network::interface_descriptor& /*interface*/, network::packet_p& packet) {
packet->tag(3, packet->index);
logging::logf(logging::log_level::TRACE, "dhcp: Start DHCP packet handling\n");
auto* dhcp_header = reinterpret_cast<header*>(packet->payload + packet->index);
logging::logf(logging::log_level::TRACE, "dhcp: Identification: %u\n", size_t(dhcp_header->xid));
// Note: Propagate is handled by UDP connections
if (listening.load()) {
packets.push_back(packet);
listen_queue.notify_one();
}
}
std::expected<network::dhcp::dhcp_configuration> network::dhcp::layer::request_ip(network::interface_descriptor& interface) {
logging::logf(logging::log_level::TRACE, "dhcp: Start discovery\n");
listening = true;
// 1. Send DHCP Discovery
{
// Ask the UDP layer to craft a packet
auto payload_size = sizeof(network::dhcp::header) + 4 + 3 + 5 + 4;
network::udp::kernel_packet_descriptor udp_desc{payload_size, 68, 67, network::ip::make_address(255, 255, 255, 255)};
auto packet_e = parent->kernel_prepare_packet(interface, udp_desc);
if (!packet_e) {
return std::make_unexpected<dhcp_configuration>(packet_e.error());
}
auto& packet = *packet_e;
::prepare_packet(*packet, interface);
auto* dhcp_header = reinterpret_cast<network::dhcp::header*>(packet->payload + packet->tag(3));
dhcp_header->op = 1; // This is a request
dhcp_header->xid = 0x66666666; // Our identification
dhcp_header->flags = 0x8000; // We don't know our IP address for now
auto* options = packet->payload + packet->tag(3) + sizeof(network::dhcp::header);
// Option 0: Magic cookie
options[0] = 99;
options[1] = 130;
options[2] = 83;
options[3] = 99;
// Option 1: DHCP Discover
options[4] = 53; // DHCP Message Type
options[5] = 1; // Length 1
options[6] = 1; // DHCP Discover
// Option 2: Request Gateway / DNS / Mask
options[7] = 55; // Parameter Request List
options[8] = 3; // Length 3
options[9] = 1; // Subnet mask
options[10] = 3; // Router (Gateway)
options[11] = 6; // DNS Server
// Pad 3 bytes
options[12] = 0;
options[13] = 0;
options[14] = 0;
// End of options
options[15] = 255;
// Finalize the UDP packet
auto status = parent->finalize_packet(interface, packet);
if (!status) {
return std::make_unexpected<dhcp_configuration>(status.error());
}
}
logging::logf(logging::log_level::TRACE, "dhcp: Sent request\n");
// 2. Receive DHCP Offer
network::ip::address offer_address;
network::ip::address server_address;
network::ip::address gateway_address;
network::ip::address dns_address;
bool gateway = false;
bool dns = false;
{
while (true) {
logging::logf(logging::log_level::TRACE, "dhcp: Wait for answer\n");
if (packets.empty()) {
listen_queue.wait();
}
auto packet = packets.back();
packets.pop_back();
auto* dhcp_header = reinterpret_cast<network::dhcp::header*>(packet->payload + packet->tag(3));
if (dhcp_header->xid == 0x66666666 && dhcp_header->op == 0x2) {
logging::logf(logging::log_level::TRACE, "dhcp: Received DHCP answer\n");
auto* options = packet->payload + packet->tag(3) + sizeof(network::dhcp::header);
bool dhcp_offer = false;
auto cookie = (options[0] << 24) + (options[1] << 16) + (options[2] << 8) + options[3];
if (cookie != 0x63825363) {
logging::logf(logging::log_level::TRACE, "dhcp: Received wrong magic cookie\n");
continue;
}
size_t i = 4;
while (true) {
auto id = options[i++];
// End of options
if (id == 255) {
break;
}
// Pad
if (id == 0) {
continue;
}
auto n = options[i++];
if (!n) {
continue;
}
if (id == 53) {
if (options[i++] == 2) {
dhcp_offer = true;
}
} else if (id == 3) {
gateway_address = network::ip::make_address(options[i], options[i + 1], options[i + 2], options[i + 3]);
i += n;
gateway = true;
} else if (id == 6) {
dns_address = network::ip::make_address(options[i], options[i + 1], options[i + 2], options[i + 3]);
i += n;
dns = true;
} else {
i += n;
}
}
if (!dhcp_offer) {
logging::logf(logging::log_level::TRACE, "dhcp: Received wrong DHCP message type\n");
continue;
}
offer_address = switch_endian_32(dhcp_header->your_ip);
server_address = switch_endian_32(dhcp_header->server_ip);
break;
}
}
}
logging::logf(logging::log_level::TRACE, "dhcp: Received DHCP Offer\n");
logging::logf(logging::log_level::TRACE, "dhcp: From %h\n", size_t(server_address.raw_address));
logging::logf(logging::log_level::TRACE, "dhcp: IP %h\n", size_t(offer_address.raw_address));
logging::logf(logging::log_level::TRACE, "dhcp: DNS %b\n", dns);
logging::logf(logging::log_level::TRACE, "dhcp: Gateway %b\n", gateway);
// 3. Send DHCP Request
{
// Ask the UDP layer to craft a packet
auto payload_size = sizeof(network::dhcp::header) + 20;
network::udp::kernel_packet_descriptor udp_desc{payload_size, 68, 67, server_address};
auto packet_e = parent->kernel_prepare_packet(interface, udp_desc);
if (!packet_e) {
return std::make_unexpected<dhcp_configuration>(packet_e.error());
}
auto& packet = *packet_e;
::prepare_packet(*packet, interface);
auto* dhcp_header = reinterpret_cast<network::dhcp::header*>(packet->payload + packet->tag(3));
dhcp_header->op = 1; // This is a request
dhcp_header->xid = 0x66666666; // Our identification
dhcp_header->flags = switch_endian_16(0x8000); // We don't know our IP address for now
dhcp_header->server_ip = switch_endian_32(server_address.raw_address); // Address ip of the server
auto* options = packet->payload + packet->tag(3) + sizeof(network::dhcp::header);
// Option 0: Magic cookie
options[0] = 99;
options[1] = 130;
options[2] = 83;
options[3] = 99;
// Option 1: DHCP Request
options[4] = 53; // DHCP Message Type
options[5] = 1; // Length 1
options[6] = 3; // DHCP Request
// Option 2: Request IP address
options[7] = 50;
options[8] = 4;
options[9] = offer_address(0);
options[10] = offer_address(1);
options[11] = offer_address(2);
options[12] = offer_address(3);
// Option 3: DHCP server
options[13] = 54;
options[14] = 4;
options[15] = server_address(0);
options[16] = server_address(1);
options[17] = server_address(2);
options[18] = server_address(3);
// End of options
options[19] = 255;
// Finalize the UDP packet
auto status = parent->finalize_packet(interface, packet);
if (!status) {
return std::make_unexpected<dhcp_configuration>(status.error());
}
}
// 4. Receive DHCP Acknowledge
{
while (true) {
if (packets.empty()) {
listen_queue.wait();
}
auto packet = packets.back();
packets.pop_back();
auto* dhcp_header = reinterpret_cast<network::dhcp::header*>(packet->payload + packet->tag(3));
if (dhcp_header->xid == 0x66666666 && dhcp_header->op == 0x2) {
logging::logf(logging::log_level::TRACE, "dhcp: Received DHCP answer\n");
auto* options = packet->payload + packet->tag(3) + sizeof(network::dhcp::header);
auto cookie = (options[0] << 24) + (options[1] << 16) + (options[2] << 8) + options[3];
if (cookie != 0x63825363) {
logging::logf(logging::log_level::TRACE, "dhcp: Received wrong magic cookie\n");
continue;
}
bool dhcp_ack = false;
size_t i = 4;
while (true) {
auto id = options[i++];
// End of options
if (id == 255) {
break;
}
// Pad
if (id == 0) {
continue;
}
auto n = options[i++];
if (!n) {
continue;
}
if (id == 53) {
if (options[i] == 5 || options[i] == 6) {
dhcp_ack = true;
}
++i;
continue;
}
}
if (!dhcp_ack) {
logging::logf(logging::log_level::TRACE, "dhcp: Received wrong DHCP message type\n");
continue;
}
logging::logf(logging::log_level::TRACE, "dhcp: Received DHCP Ack\n");
break;
}
}
}
listening = false;
dhcp_configuration conf;
conf.dns = dns;
conf.gateway = gateway;
conf.ip_address = offer_address;
if (dns) {
conf.dns_address = dns_address;
}
if (gateway) {
conf.gateway_address = gateway_address;
}
logging::logf(logging::log_level::TRACE, "dhcp: Finished discovery\n");
return {conf};
}
|
757aae8b85056df9c86c800206035512e9a5dfe1 | 014510302f610c73f259094a4eebd481c359da46 | /tensorflow/core/kernels/dml_tensor_array.cc | f91ca14afb349c0b6f7660ce9f5a08201e7553ea | [
"Apache-2.0"
] | permissive | renovate-testing/test-8830-tensorflow-directml | 760b52fc10467b0f472b7e88ba86c95e90a3fe38 | 6657ce56d018e76e89fd143ebc8af7a3d2c946e5 | refs/heads/directml | 2023-03-19T05:37:31.395166 | 2021-03-10T14:50:09 | 2021-03-10T14:50:09 | 346,389,339 | 0 | 0 | Apache-2.0 | 2021-03-10T15:00:01 | 2021-03-10T14:48:49 | C++ | UTF-8 | C++ | false | false | 5,295 | cc | dml_tensor_array.cc | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Portions Copyright (c) Microsoft Corporation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "dml_tensor_array.h"
#include "tensorflow/core/common_runtime/dml/dml_common.h"
#include "tensorflow/core/common_runtime/dml/dml_device.h"
#include "tensorflow/core/common_runtime/dml/dml_util.h"
#include "tensorflow/core/public/version.h"
namespace tensorflow {
namespace tensor_array {
Status DmlAddToTensor(OpKernelContext* ctx, Tensor* sum, const Tensor* current,
const Tensor* add) {
NodeDef def;
def.set_op("AddV2");
def.add_input("x");
def.add_input("y");
SetAttrValue(sum->dtype(), &(*def.mutable_attr())["T"]);
// Delegate to DML's kernel for Add
Status s;
auto op_kernel = CreateOpKernel(DEVICE_DML, ctx->device(),
ctx->get_allocator(AllocatorAttributes()),
def, TF_GRAPH_DEF_VERSION, &s);
TF_RETURN_IF_ERROR(s);
absl::InlinedVector<TensorValue, 4> inputs = {
TensorValue(const_cast<Tensor*>(current)),
TensorValue(const_cast<Tensor*>(add))};
AllocatorAttributes output_attrs[] = {AllocatorAttributes()};
OpKernelContext::Params op_ctx_params;
op_ctx_params.op_kernel = op_kernel.get();
op_ctx_params.device = ctx->device();
op_ctx_params.inputs = &inputs;
op_ctx_params.output_attr_array = output_attrs;
OpKernelContext op_ctx(&op_ctx_params, 1);
op_kernel->Compute(&op_ctx);
TensorValue out = op_ctx.release_output(0);
ctx->device()->CopyTensorInSameDevice(
out.tensor, sum, ctx->op_device_context(),
[ctx](const Status& s) { OP_REQUIRES_OK(ctx, s); });
return op_ctx.status();
}
void DmlTensorSetZero(OpKernelContext* ctx, Tensor* value) {
auto* device = static_cast<DmlDevice*>(ctx->device());
D3D12BufferRegion dst = dml_util::CreateBufferForTensor(device, *value);
uint8_t pattern[] = {0};
device->GetExecutionContext()->FillBufferWithPattern(
dst.Resource(), dst.Offset(), dst.SizeInBytes(), pattern);
}
void DmlConcatTensors(OpKernelContext* ctx, Tensor* output_tensor,
absl::Span<PersistentTensor> values) {
auto* device = static_cast<DmlDevice*>(ctx->device());
D3D12BufferRegion dst =
dml_util::CreateBufferForTensor(device, *output_tensor);
uint64_t dst_offset = dst.Offset();
for (PersistentTensor& value : values) {
const Tensor& input_tensor = *value.AccessTensor(ctx);
// These should have been validated earlier
assert(input_tensor.dtype() == output_tensor->dtype());
assert(input_tensor.NumElements() <= output_tensor->NumElements());
uint64_t bytes_to_copy = input_tensor.TotalBytes();
D3D12BufferRegion src =
dml_util::CreateBufferForTensor(device, input_tensor);
// GPU resources are always kept in UAV state
const auto barrier_state = D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
device->GetExecutionContext()->CopyBufferRegion(
dst.Resource(), dst_offset, barrier_state, src.Resource(), src.Offset(),
barrier_state, bytes_to_copy);
dst_offset += bytes_to_copy;
CHECK(dst_offset <= dst.Resource()->GetDesc().Width);
}
}
void DmlSplitTensor(OpKernelContext* ctx, Tensor* output_tensor,
const Tensor& input_tensor, int64 start_element,
int64 element_count) {
// These should have been validated earlier
assert(input_tensor.dtype() == output_tensor->dtype());
assert(output_tensor->NumElements() == element_count);
assert(start_element + element_count <= input_tensor.NumElements());
uint64_t element_byte_size =
output_tensor->TotalBytes() / output_tensor->NumElements();
uint64_t bytes_to_copy = element_count * element_byte_size;
uint64_t src_offset = start_element * element_byte_size;
auto* device = static_cast<DmlDevice*>(ctx->device());
D3D12BufferRegion dst =
dml_util::CreateBufferForTensor(device, *output_tensor);
D3D12BufferRegion src = dml_util::CreateBufferForTensor(device, input_tensor);
// GPU resources are always kept in UAV state
const auto barrier_state = D3D12_RESOURCE_STATE_UNORDERED_ACCESS;
device->GetExecutionContext()->CopyBufferRegion(
dst.Resource(), dst.Offset(), barrier_state, src.Resource(),
src.Offset() + src_offset, barrier_state, bytes_to_copy);
}
Status DmlTensorCopy(OpKernelContext* ctx, Tensor* src, Tensor* dst) {
TF_RETURN_IF_ERROR(ctx->allocate_temp(src->dtype(), src->shape(), dst));
ctx->device()->CopyTensorInSameDevice(
src, dst, ctx->op_device_context(),
[ctx](const Status& s) { OP_REQUIRES_OK(ctx, s); });
return Status::OK();
}
} // namespace tensor_array
} // namespace tensorflow |
886b9c84cd0ace30237947d53cbceeb69b4af50b | 0ce5a9be7357cd649cbfc2814ea3f558f227e064 | /client/GroupGame/GroupGame/Classes/scene/SceneManager.cpp | 299ebf7061ca4bc072c728994fe4ee11cce7050c | [] | no_license | mjssw/myproj | 1beb06c2b8e490a11decfa5213e122b54d09beec | 4051ae1ed6062caa8acb24959416a5c4cfb4dea0 | refs/heads/master | 2021-01-17T06:23:53.492422 | 2014-10-27T09:19:03 | 2014-10-27T09:19:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205 | cpp | SceneManager.cpp | #include "SceneManager.h"
SIGNLETON_CLASS_INIT(CSceneManager);
void CSceneManager::SetCurView(CViewBase *curView)
{
m_curView = curView;
}
CViewBase* CSceneManager::GetCurView()
{
return m_curView;
}
|
737f8d42d312ac750ec006166cb6bcdef34085ec | f8d76935f342abceff51a90a2844110ac57a4d2e | /solution/srm163_calendarrecycle.cpp | 3c0bbb221b04db82d119d71e3287d3f3d7ca8e9c | [] | no_license | rick-qiu/topcoder | b36cc5bc571f1cbc7be18fdc863a1800deeb5de1 | 04adddbdc49e35e10090d33618be90fc8d3b8e7d | refs/heads/master | 2021-01-01T05:59:41.264459 | 2014-05-22T06:14:43 | 2014-05-22T06:14:43 | 11,315,215 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 66,965 | cpp | srm163_calendarrecycle.cpp | /*******************************************************************************
* Automatically generated code for TopCode SRM Problem
* Problem URL: http://community.topcoder.com/stat?c=problem_statement&pm=1847
*******************************************************************************/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
class CalendarRecycle {
public:
int useAgain(int year);
};
int CalendarRecycle::useAgain(int year) {
int ret;
return ret;
}
int test0() {
int year = 2002;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2013;
if(result == expected) {
cout << "Test Case 0: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 0: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test1() {
int year = 2013;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2019;
if(result == expected) {
cout << "Test Case 1: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 1: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test2() {
int year = 2008;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2036;
if(result == expected) {
cout << "Test Case 2: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 2: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test3() {
int year = 9999;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 10010;
if(result == expected) {
cout << "Test Case 3: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 3: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test4() {
int year = 2525;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2531;
if(result == expected) {
cout << "Test Case 4: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 4: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test5() {
int year = 5442;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5453;
if(result == expected) {
cout << "Test Case 5: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 5: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test6() {
int year = 7243;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7254;
if(result == expected) {
cout << "Test Case 6: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 6: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test7() {
int year = 2372;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2400;
if(result == expected) {
cout << "Test Case 7: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 7: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test8() {
int year = 2938;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2949;
if(result == expected) {
cout << "Test Case 8: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 8: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test9() {
int year = 5873;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5879;
if(result == expected) {
cout << "Test Case 9: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 9: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test10() {
int year = 2937;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2943;
if(result == expected) {
cout << "Test Case 10: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 10: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test11() {
int year = 9501;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9507;
if(result == expected) {
cout << "Test Case 11: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 11: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test12() {
int year = 3326;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3337;
if(result == expected) {
cout << "Test Case 12: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 12: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test13() {
int year = 9706;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9717;
if(result == expected) {
cout << "Test Case 13: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 13: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test14() {
int year = 2177;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2183;
if(result == expected) {
cout << "Test Case 14: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 14: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test15() {
int year = 7848;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7876;
if(result == expected) {
cout << "Test Case 15: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 15: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test16() {
int year = 2959;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2970;
if(result == expected) {
cout << "Test Case 16: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 16: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test17() {
int year = 6576;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6616;
if(result == expected) {
cout << "Test Case 17: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 17: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test18() {
int year = 9408;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9436;
if(result == expected) {
cout << "Test Case 18: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 18: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test19() {
int year = 6965;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6971;
if(result == expected) {
cout << "Test Case 19: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 19: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test20() {
int year = 4094;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4100;
if(result == expected) {
cout << "Test Case 20: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 20: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test21() {
int year = 7617;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7623;
if(result == expected) {
cout << "Test Case 21: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 21: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test22() {
int year = 9288;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9328;
if(result == expected) {
cout << "Test Case 22: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 22: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test23() {
int year = 9378;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9389;
if(result == expected) {
cout << "Test Case 23: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 23: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test24() {
int year = 3584;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3612;
if(result == expected) {
cout << "Test Case 24: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 24: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test25() {
int year = 3834;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3845;
if(result == expected) {
cout << "Test Case 25: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 25: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test26() {
int year = 5139;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5150;
if(result == expected) {
cout << "Test Case 26: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 26: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test27() {
int year = 3305;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3311;
if(result == expected) {
cout << "Test Case 27: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 27: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test28() {
int year = 6941;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6947;
if(result == expected) {
cout << "Test Case 28: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 28: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test29() {
int year = 7596;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7624;
if(result == expected) {
cout << "Test Case 29: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 29: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test30() {
int year = 7435;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7446;
if(result == expected) {
cout << "Test Case 30: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 30: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test31() {
int year = 3861;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3867;
if(result == expected) {
cout << "Test Case 31: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 31: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test32() {
int year = 6732;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6760;
if(result == expected) {
cout << "Test Case 32: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 32: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test33() {
int year = 9352;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9380;
if(result == expected) {
cout << "Test Case 33: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 33: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test34() {
int year = 5332;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5360;
if(result == expected) {
cout << "Test Case 34: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 34: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test35() {
int year = 4675;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4686;
if(result == expected) {
cout << "Test Case 35: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 35: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test36() {
int year = 6750;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6761;
if(result == expected) {
cout << "Test Case 36: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 36: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test37() {
int year = 3276;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3316;
if(result == expected) {
cout << "Test Case 37: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 37: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test38() {
int year = 9770;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9781;
if(result == expected) {
cout << "Test Case 38: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 38: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test39() {
int year = 5709;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5715;
if(result == expected) {
cout << "Test Case 39: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 39: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test40() {
int year = 5663;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5674;
if(result == expected) {
cout << "Test Case 40: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 40: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test41() {
int year = 5375;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5386;
if(result == expected) {
cout << "Test Case 41: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 41: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test42() {
int year = 9626;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9637;
if(result == expected) {
cout << "Test Case 42: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 42: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test43() {
int year = 6108;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6136;
if(result == expected) {
cout << "Test Case 43: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 43: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test44() {
int year = 3102;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3113;
if(result == expected) {
cout << "Test Case 44: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 44: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test45() {
int year = 3375;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3386;
if(result == expected) {
cout << "Test Case 45: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 45: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test46() {
int year = 8453;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8459;
if(result == expected) {
cout << "Test Case 46: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 46: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test47() {
int year = 9852;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9880;
if(result == expected) {
cout << "Test Case 47: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 47: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test48() {
int year = 9286;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9297;
if(result == expected) {
cout << "Test Case 48: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 48: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test49() {
int year = 5279;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5290;
if(result == expected) {
cout << "Test Case 49: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 49: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test50() {
int year = 3288;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3328;
if(result == expected) {
cout << "Test Case 50: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 50: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test51() {
int year = 4561;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4567;
if(result == expected) {
cout << "Test Case 51: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 51: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test52() {
int year = 5403;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5414;
if(result == expected) {
cout << "Test Case 52: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 52: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test53() {
int year = 6053;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6059;
if(result == expected) {
cout << "Test Case 53: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 53: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test54() {
int year = 7574;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7585;
if(result == expected) {
cout << "Test Case 54: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 54: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test55() {
int year = 9692;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9704;
if(result == expected) {
cout << "Test Case 55: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 55: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test56() {
int year = 6324;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6352;
if(result == expected) {
cout << "Test Case 56: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 56: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test57() {
int year = 2155;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2166;
if(result == expected) {
cout << "Test Case 57: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 57: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test58() {
int year = 3646;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3657;
if(result == expected) {
cout << "Test Case 58: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 58: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test59() {
int year = 3764;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3792;
if(result == expected) {
cout << "Test Case 59: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 59: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test60() {
int year = 7987;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7998;
if(result == expected) {
cout << "Test Case 60: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 60: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test61() {
int year = 5962;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5973;
if(result == expected) {
cout << "Test Case 61: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 61: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test62() {
int year = 5802;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5813;
if(result == expected) {
cout << "Test Case 62: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 62: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test63() {
int year = 8275;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8286;
if(result == expected) {
cout << "Test Case 63: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 63: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test64() {
int year = 5089;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5095;
if(result == expected) {
cout << "Test Case 64: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 64: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test65() {
int year = 5170;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5181;
if(result == expected) {
cout << "Test Case 65: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 65: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test66() {
int year = 6273;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6279;
if(result == expected) {
cout << "Test Case 66: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 66: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test67() {
int year = 5954;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5965;
if(result == expected) {
cout << "Test Case 67: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 67: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test68() {
int year = 3892;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3904;
if(result == expected) {
cout << "Test Case 68: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 68: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test69() {
int year = 8011;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8022;
if(result == expected) {
cout << "Test Case 69: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 69: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test70() {
int year = 3576;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3604;
if(result == expected) {
cout << "Test Case 70: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 70: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test71() {
int year = 9766;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9777;
if(result == expected) {
cout << "Test Case 71: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 71: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test72() {
int year = 5495;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5501;
if(result == expected) {
cout << "Test Case 72: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 72: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test73() {
int year = 2537;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2543;
if(result == expected) {
cout << "Test Case 73: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 73: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test74() {
int year = 9657;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9663;
if(result == expected) {
cout << "Test Case 74: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 74: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test75() {
int year = 8449;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8455;
if(result == expected) {
cout << "Test Case 75: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 75: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test76() {
int year = 3949;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3955;
if(result == expected) {
cout << "Test Case 76: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 76: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test77() {
int year = 4134;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4145;
if(result == expected) {
cout << "Test Case 77: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 77: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test78() {
int year = 4407;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4418;
if(result == expected) {
cout << "Test Case 78: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 78: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test79() {
int year = 2981;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2987;
if(result == expected) {
cout << "Test Case 79: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 79: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test80() {
int year = 3250;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3261;
if(result == expected) {
cout << "Test Case 80: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 80: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test81() {
int year = 8222;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8233;
if(result == expected) {
cout << "Test Case 81: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 81: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test82() {
int year = 3482;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 3493;
if(result == expected) {
cout << "Test Case 82: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 82: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test83() {
int year = 9455;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9466;
if(result == expected) {
cout << "Test Case 83: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 83: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test84() {
int year = 6591;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6603;
if(result == expected) {
cout << "Test Case 84: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 84: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test85() {
int year = 6963;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6974;
if(result == expected) {
cout << "Test Case 85: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 85: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test86() {
int year = 6130;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6141;
if(result == expected) {
cout << "Test Case 86: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 86: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test87() {
int year = 6533;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6539;
if(result == expected) {
cout << "Test Case 87: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 87: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test88() {
int year = 9446;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9457;
if(result == expected) {
cout << "Test Case 88: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 88: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test89() {
int year = 7762;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7773;
if(result == expected) {
cout << "Test Case 89: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 89: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test90() {
int year = 8597;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8609;
if(result == expected) {
cout << "Test Case 90: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 90: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test91() {
int year = 4990;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5002;
if(result == expected) {
cout << "Test Case 91: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 91: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test92() {
int year = 4718;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4729;
if(result == expected) {
cout << "Test Case 92: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 92: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test93() {
int year = 5260;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 5288;
if(result == expected) {
cout << "Test Case 93: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 93: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test94() {
int year = 4534;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 4545;
if(result == expected) {
cout << "Test Case 94: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 94: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test95() {
int year = 6528;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 6556;
if(result == expected) {
cout << "Test Case 95: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 95: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test96() {
int year = 8062;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8073;
if(result == expected) {
cout << "Test Case 96: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 96: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test97() {
int year = 7667;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7678;
if(result == expected) {
cout << "Test Case 97: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 97: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test98() {
int year = 8224;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 8252;
if(result == expected) {
cout << "Test Case 98: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 98: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test99() {
int year = 7266;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 7277;
if(result == expected) {
cout << "Test Case 99: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 99: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test100() {
int year = 2008;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2036;
if(result == expected) {
cout << "Test Case 100: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 100: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test101() {
int year = 9999;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 10010;
if(result == expected) {
cout << "Test Case 101: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 101: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test102() {
int year = 2300;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2306;
if(result == expected) {
cout << "Test Case 102: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 102: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test103() {
int year = 2100;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2106;
if(result == expected) {
cout << "Test Case 103: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 103: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test104() {
int year = 9996;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 10024;
if(result == expected) {
cout << "Test Case 104: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 104: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test105() {
int year = 2099;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2105;
if(result == expected) {
cout << "Test Case 105: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 105: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test106() {
int year = 2072;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2112;
if(result == expected) {
cout << "Test Case 106: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 106: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test107() {
int year = 2400;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 2428;
if(result == expected) {
cout << "Test Case 107: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 107: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test108() {
int year = 9900;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 9906;
if(result == expected) {
cout << "Test Case 108: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 108: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int test109() {
int year = 9992;
CalendarRecycle* pObj = new CalendarRecycle();
clock_t start = clock();
int result = pObj->useAgain(year);
clock_t end = clock();
delete pObj;
int expected = 10020;
if(result == expected) {
cout << "Test Case 109: Passed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 0;
} else {
cout << "Test Case 109: Failed! Time: " << static_cast<double>(end-start)/CLOCKS_PER_SEC << " seconds" << endl;
return 1;
}
}
int main(int argc, char* argv[]) {
int passed = 0;
int failed = 0;
test0() == 0 ? ++passed : ++failed;
test1() == 0 ? ++passed : ++failed;
test2() == 0 ? ++passed : ++failed;
test3() == 0 ? ++passed : ++failed;
test4() == 0 ? ++passed : ++failed;
test5() == 0 ? ++passed : ++failed;
test6() == 0 ? ++passed : ++failed;
test7() == 0 ? ++passed : ++failed;
test8() == 0 ? ++passed : ++failed;
test9() == 0 ? ++passed : ++failed;
test10() == 0 ? ++passed : ++failed;
test11() == 0 ? ++passed : ++failed;
test12() == 0 ? ++passed : ++failed;
test13() == 0 ? ++passed : ++failed;
test14() == 0 ? ++passed : ++failed;
test15() == 0 ? ++passed : ++failed;
test16() == 0 ? ++passed : ++failed;
test17() == 0 ? ++passed : ++failed;
test18() == 0 ? ++passed : ++failed;
test19() == 0 ? ++passed : ++failed;
test20() == 0 ? ++passed : ++failed;
test21() == 0 ? ++passed : ++failed;
test22() == 0 ? ++passed : ++failed;
test23() == 0 ? ++passed : ++failed;
test24() == 0 ? ++passed : ++failed;
test25() == 0 ? ++passed : ++failed;
test26() == 0 ? ++passed : ++failed;
test27() == 0 ? ++passed : ++failed;
test28() == 0 ? ++passed : ++failed;
test29() == 0 ? ++passed : ++failed;
test30() == 0 ? ++passed : ++failed;
test31() == 0 ? ++passed : ++failed;
test32() == 0 ? ++passed : ++failed;
test33() == 0 ? ++passed : ++failed;
test34() == 0 ? ++passed : ++failed;
test35() == 0 ? ++passed : ++failed;
test36() == 0 ? ++passed : ++failed;
test37() == 0 ? ++passed : ++failed;
test38() == 0 ? ++passed : ++failed;
test39() == 0 ? ++passed : ++failed;
test40() == 0 ? ++passed : ++failed;
test41() == 0 ? ++passed : ++failed;
test42() == 0 ? ++passed : ++failed;
test43() == 0 ? ++passed : ++failed;
test44() == 0 ? ++passed : ++failed;
test45() == 0 ? ++passed : ++failed;
test46() == 0 ? ++passed : ++failed;
test47() == 0 ? ++passed : ++failed;
test48() == 0 ? ++passed : ++failed;
test49() == 0 ? ++passed : ++failed;
test50() == 0 ? ++passed : ++failed;
test51() == 0 ? ++passed : ++failed;
test52() == 0 ? ++passed : ++failed;
test53() == 0 ? ++passed : ++failed;
test54() == 0 ? ++passed : ++failed;
test55() == 0 ? ++passed : ++failed;
test56() == 0 ? ++passed : ++failed;
test57() == 0 ? ++passed : ++failed;
test58() == 0 ? ++passed : ++failed;
test59() == 0 ? ++passed : ++failed;
test60() == 0 ? ++passed : ++failed;
test61() == 0 ? ++passed : ++failed;
test62() == 0 ? ++passed : ++failed;
test63() == 0 ? ++passed : ++failed;
test64() == 0 ? ++passed : ++failed;
test65() == 0 ? ++passed : ++failed;
test66() == 0 ? ++passed : ++failed;
test67() == 0 ? ++passed : ++failed;
test68() == 0 ? ++passed : ++failed;
test69() == 0 ? ++passed : ++failed;
test70() == 0 ? ++passed : ++failed;
test71() == 0 ? ++passed : ++failed;
test72() == 0 ? ++passed : ++failed;
test73() == 0 ? ++passed : ++failed;
test74() == 0 ? ++passed : ++failed;
test75() == 0 ? ++passed : ++failed;
test76() == 0 ? ++passed : ++failed;
test77() == 0 ? ++passed : ++failed;
test78() == 0 ? ++passed : ++failed;
test79() == 0 ? ++passed : ++failed;
test80() == 0 ? ++passed : ++failed;
test81() == 0 ? ++passed : ++failed;
test82() == 0 ? ++passed : ++failed;
test83() == 0 ? ++passed : ++failed;
test84() == 0 ? ++passed : ++failed;
test85() == 0 ? ++passed : ++failed;
test86() == 0 ? ++passed : ++failed;
test87() == 0 ? ++passed : ++failed;
test88() == 0 ? ++passed : ++failed;
test89() == 0 ? ++passed : ++failed;
test90() == 0 ? ++passed : ++failed;
test91() == 0 ? ++passed : ++failed;
test92() == 0 ? ++passed : ++failed;
test93() == 0 ? ++passed : ++failed;
test94() == 0 ? ++passed : ++failed;
test95() == 0 ? ++passed : ++failed;
test96() == 0 ? ++passed : ++failed;
test97() == 0 ? ++passed : ++failed;
test98() == 0 ? ++passed : ++failed;
test99() == 0 ? ++passed : ++failed;
test100() == 0 ? ++passed : ++failed;
test101() == 0 ? ++passed : ++failed;
test102() == 0 ? ++passed : ++failed;
test103() == 0 ? ++passed : ++failed;
test104() == 0 ? ++passed : ++failed;
test105() == 0 ? ++passed : ++failed;
test106() == 0 ? ++passed : ++failed;
test107() == 0 ? ++passed : ++failed;
test108() == 0 ? ++passed : ++failed;
test109() == 0 ? ++passed : ++failed;
cout << "Total Test Case: " << passed + failed << "; Passed: " << passed << "; Failed: " << failed << endl;
return failed == 0 ? 0 : 1;
}
/*******************************************************************************
* Top Submission URL:
* http://community.topcoder.com/stat?c=problem_solution&cr=265773&rd=4620&pm=1847
********************************************************************************
#include <string>
#include <vector>
class CalendarRecycle {
public:
int useAgain(int year) {
int offset=0;
int add1;
if ((year % 4 == 0) && (year % 100 != 0)) add1 = 2;
else if ((year % 100 == 0 && year % 400 == 0)) add1 = 2;
else add1 = 1;
while (1)
{
year++;
int add;
if ((year % 4 == 0) && (year % 100 != 0)) add = 2;
else if ((year % 100 == 0 && year % 400 == 0)) add = 2;
else add = 1;
offset += add;
offset %= 7;
if (offset == 0 && add == add1)
return year;
}
}
};
// Powered by PopsEdit
********************************************************************************
*******************************************************************************/ |
a2ed1d1503b991689b857e9c7cbb1233f1cfc522 | 893106348b8f342b0102ac7feee028cd62c9c1f3 | /lab_2/ZipCode.h | ed01a61f173922889301b9c5d49e5520b8307320 | [] | no_license | isaychris/CSCI222 | f17ee1b241607f8763c445ef3bf5cab5115e1954 | 4fb1a1790437a1cdcea13823c63bf4ea3833c572 | refs/heads/master | 2021-09-03T15:57:54.971274 | 2018-01-10T08:17:26 | 2018-01-10T08:17:26 | 65,824,124 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 805 | h | ZipCode.h | #ifndef _ZIPCODE_H
#define _ZIPCODE_H
using namespace std;
class ZipCode {
private:
string zipcode; //internally stored zipcode as string barcode.
int getzip; //return variable for zipcode number
string getbar; //return variable for barcode
string stringzip; //conversion variable
//helper functions
string convertInt(int);
string substr();//substring
string size(); //size of string
string c_str(); //c string
public:
void barToZip(string); //converts string barcode to int zipcode
void zipToBar(int); //converts int zipcode to string barcode.
ZipCode(int); //constructor for int zipcode, uses zipToBar().
ZipCode(string); //constructor for string barcode, uses barToZip();
//returns
int getZipCode(); //returns int zipcode
string getBarCode(); //returns string barcode
};
#endif |
fb89cdf38aba63d8cfa879fde81cd7e68d578ade | acee626dd6dd9c11e3a08daef876c0a74815318b | /src/RandomGenerator.cpp | 5a2b36b1a7a4c5ef33937ee289f04e23652ffcb7 | [
"Apache-2.0"
] | permissive | bmstu-gaming/SquaresAndPairs | 23946f244e9161bcd5af1a8763f1c6e12d35cbc3 | 9f52b0e509c5f46971264ce8f23acf700f184dce | refs/heads/master | 2021-07-12T14:46:04.337774 | 2020-07-12T07:48:07 | 2020-07-12T07:48:07 | 179,822,187 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 513 | cpp | RandomGenerator.cpp | #include "RandomGenerator.hpp"
namespace snp {
RandomGenerator::RandomGenerator() {
std::random_device rd;
generator = std::mt19937(rd());
}
RandomGenerator::~RandomGenerator() {
}
RandomGenerator::RandomGenerator(unsigned int seed) {
generator = std::mt19937(seed);
}
void RandomGenerator::setInterval(unsigned int a, unsigned int b) {
distribution = std::uniform_int_distribution<unsigned int>(a, b);
}
unsigned int RandomGenerator::operator()() {
return distribution(generator);
}
}
|
aaa3f62730029b2f4265e8916c34790cf949a0ce | b1a14e08044ae882e5dd9231811cad9af43c9b28 | /tests/test_log.cpp | 1f4731303640d2ba6489f336e263bfc325d38efc | [] | no_license | sadwd12312/sylar-from-scratch | a59f459113a85d59f52c72283a8e2e48d86ad49c | 5dbc892e5c3a1f23d1bf06d2c79c5c1a8398918e | refs/heads/main | 2023-08-07T13:15:28.352730 | 2021-09-28T03:18:45 | 2021-09-28T03:18:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,310 | cpp | test_log.cpp | /**
* @file test_log.cpp
* @brief 日志类测试
* @version 0.1
* @date 2021-06-10
*/
#include "sylar/sylar.h"
#include <unistd.h>
sylar::Logger::ptr g_logger = SYLAR_LOG_ROOT(); // 默认INFO级别
int main(int argc, char *argv[]) {
sylar::EnvMgr::GetInstance()->init(argc, argv);
sylar::Config::LoadFromConfDir(sylar::EnvMgr::GetInstance()->getConfigPath());
SYLAR_LOG_FATAL(g_logger) << "fatal msg";
SYLAR_LOG_ERROR(g_logger) << "err msg";
SYLAR_LOG_INFO(g_logger) << "info msg";
SYLAR_LOG_DEBUG(g_logger) << "debug msg";
SYLAR_LOG_FMT_FATAL(g_logger, "fatal %s:%d", __FILE__, __LINE__);
SYLAR_LOG_FMT_ERROR(g_logger, "err %s:%d", __FILE__, __LINE__);
SYLAR_LOG_FMT_INFO(g_logger, "info %s:%d", __FILE__, __LINE__);
SYLAR_LOG_FMT_DEBUG(g_logger, "debug %s:%d", __FILE__, __LINE__);
sleep(1);
sylar::SetThreadName("brand_new_thread");
g_logger->setLevel(sylar::LogLevel::WARN);
SYLAR_LOG_FATAL(g_logger) << "fatal msg";
SYLAR_LOG_ERROR(g_logger) << "err msg";
SYLAR_LOG_INFO(g_logger) << "info msg"; // 不打印
SYLAR_LOG_DEBUG(g_logger) << "debug msg"; // 不打印
sylar::FileLogAppender::ptr fileAppender(new sylar::FileLogAppender("./log.txt"));
g_logger->addAppender(fileAppender);
SYLAR_LOG_FATAL(g_logger) << "fatal msg";
SYLAR_LOG_ERROR(g_logger) << "err msg";
SYLAR_LOG_INFO(g_logger) << "info msg"; // 不打印
SYLAR_LOG_DEBUG(g_logger) << "debug msg"; // 不打印
sylar::Logger::ptr test_logger = SYLAR_LOG_NAME("test_logger");
sylar::StdoutLogAppender::ptr appender(new sylar::StdoutLogAppender);
sylar::LogFormatter::ptr formatter(new sylar::LogFormatter("%d:%rms%T%p%T%c%T%f:%l %m%n")); // 时间:启动毫秒数 级别 日志名称 文件名:行号 消息 换行
appender->setFormatter(formatter);
test_logger->addAppender(appender);
test_logger->setLevel(sylar::LogLevel::WARN);
SYLAR_LOG_ERROR(test_logger) << "err msg";
SYLAR_LOG_INFO(test_logger) << "info msg"; // 不打印
// 输出全部日志器的配置
g_logger->setLevel(sylar::LogLevel::INFO);
SYLAR_LOG_INFO(g_logger) << "logger config:" << sylar::LoggerMgr::GetInstance()->toYamlString();
return 0;
} |
4f9d06b77fcd89a4f016cca088c0ee69a99ac557 | 047e3752ac1ccd6690ec60e14ae9bb81e655701d | /src/game/item.cc | 3f0a0c54c8522c589510e832ee757761fa045ffd | [] | no_license | tpleino1/tv | 8324af81309338fb4e13ff5ce2dfb4b8c96cb079 | 6ace3bbc92b1f3cbe769aefb606f1d7fd798e390 | refs/heads/master | 2021-01-19T02:20:39.098099 | 2016-07-04T21:25:44 | 2016-07-04T21:25:44 | 16,185,703 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 176 | cc | item.cc | #include "item.hh"
// Returns items cost
size_t Item::getCost() const
{
return this->cost;
}
// Returns items id
Item::ItemID Item::getID() const
{
return this->ID;
}
|
58e1efde653cc46151106fb31b5efb6c8c81f533 | dbe8bdc2b3d9d4c13d7fc9c13895f7bcd226db05 | /LeetCode/LeetCodeCpp/242.cpp | 173ef4ab98e3c28c68a9e9999523bc47d3f1498f | [
"MIT"
] | permissive | zl6977/BasicKnowledge | 8740515e786826984c2c7e05e5cdb1d75717637e | 60d361c83243c24407be844dd9201adf83c6a0e5 | refs/heads/master | 2020-05-27T06:38:18.670076 | 2019-01-28T17:13:25 | 2019-01-28T17:13:25 | 188,524,708 | 1 | 0 | null | 2019-05-25T05:29:01 | 2019-05-25T05:29:01 | null | GB18030 | C++ | false | false | 990 | cpp | 242.cpp | #include "stdafx.h"
/*
给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的一个字母异位词。
示例 1:
输入: s = "anagram", t = "nagaram"
输出: true
示例 2:
输入: s = "rat", t = "car"
输出: false
说明:
你可以假设字符串只包含小写字母。
进阶:
如果输入字符串包含 unicode 字符怎么办?你能否调整你的解法来应对这种情况?
*/
class Solution {
public:
/*排序后相等,o(nlogn)*/
bool method_1(string s, string t)
{
sort(s.begin(), s.end());
sort(t.begin(), t.end());
return s == t;
}
/*计数判相等,o(n)*/
bool method_2(string s, string t)
{
if (s.size() != t.size())
return false;
vector<int> vec(26, 0);
for (int i = 0;i<s.size();i++)
{
vec[s[i] - 'a']++;
vec[t[i] - 'a']--;
}
for (int i = 0;i<vec.size();i++)
{
if (vec[i] != 0)
{
return false;
}
}
return true;
}
bool isAnagram(string s, string t) {
return method_2(s, t);
}
}; |
32cc45f77d596bedd5a615100459d334d5f929c1 | ee6fbe1b44f7b0b422d3f18a2ff30443e46360ca | /parser.cpp | 359811003fea6e598d5bd717d0a728673b4fc6b0 | [] | no_license | lotaa/university | 029ff2b3da025677165952b31eced1101eea697c | 816397bf09ca028d109ae63a06c89b5ae0bba586 | refs/heads/master | 2021-05-17T05:06:54.480885 | 2020-03-27T20:35:32 | 2020-03-27T20:35:32 | 250,639,915 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,837 | cpp | parser.cpp | #include<fstream>
#include<iostream>
#include<string>
#include<string.h>
#include<ctype.h>
#include<stack>
#include<unordered_set>
#include<vector>
using namespace std;
enum states { q0, q1, q2, q3, q4, q5, q6, q7, q8 };
enum Token
{
PROGRAM_SY, BEGIN_SY, END_SY, PROC_SY, ID_SY, EQUAL_SY, ASSIGNMENT_SY, SIMI_COLON_SY, LEFT_PARNTHES_SY, RIGHT_PARNTHES_SY,
CALL_SY, INT_SY, BOOL_SY, NUM_SY, TRUE_SY, FALSE_SY, END_OF_FILE_SY, SYNTAX_ERROR_SY
};
enum non_terminals
{
Program, declaration_seq, declaration_tail, declaration, x, declarer, y, statement_seq, statement_tail, statement, z, type, expr
};
Token current_token;
states currentState = q0;
unordered_set< string > terminal;
unordered_set< string > nonTerminal;
unordered_set< string > tempSet = {};
vector< vector< unordered_set< string > > > ffs(13, vector<unordered_set<string>>(4, tempSet)); // first follow set
vector< vector<string>> rules(23, vector<string>(2, " "));
vector< vector<string> > Table(15, vector<string>(19, "empty"));
class scaner
{
public:
string s;
ifstream f;
scaner()
{
f.open("language.txt");
if (!f)
{
cout << "cant open the file" << endl;
}
get_Termenal_NonTerminal();
getProductionRules();
}
~scaner()
{
f.close();
};
non_terminals convert(const string& str)
{
if (str == "Program") return Program;
else if (str == "declaration_seq") return declaration_seq;
else if (str == "declaration_tail") return declaration_tail;
else if (str == "declaration") return declaration;
else if (str == "x") return x;
else if (str == "declarer") return declarer;
else if (str == "y") return y;
else if (str == "statement_seq") return statement_seq;
else if (str == "statement_tail") return statement_tail;
else if (str == "statement") return statement;
else if (str == "z") return z;
else if (str == "type") return type;
else if (str == "expr") return expr;
}
Token getToken()
{
char ch = ' ';
int currentState = 0;
s = "";
while (f.get(ch) && !f.eof())
{
switch (currentState)
{
case q0:
if (isalpha(ch))
{
currentState = q1;
s = ch;
break;
}
else if (isdigit(ch))
{
currentState = q7;
s = ch;
break;
}
else if (ch == '(')
{
currentState = q2;
break;
}
else if (ch == ')')
{
currentState = q3;
break;
}
else if (ch == '=')
{
currentState = q4;
break;
}
else if (ch == ';')
{
currentState = q5;
break;
}
else if (ch == ':')
{
currentState = q6;
break;
}
else if (ch == '$')
{
return END_SY;
}
else if (isspace(ch))
{
break;
}
else
{
currentState = q7;
f.putback(ch);
break;
}
case q1:
while (isalnum(ch) && !f.eof() && !isspace(ch))
{
s += ch;
f.get(ch);
}
if (f.eof() || isspace(ch))
{
return checkReserved(s);
currentState = q0;
break;
}
else
{
f.putback(ch);
return checkReserved(s);
currentState = q0;
break;
}
case q2:
return LEFT_PARNTHES_SY;
case q3:
return RIGHT_PARNTHES_SY;
case q4:
return EQUAL_SY;
case q5:
return SIMI_COLON_SY;
case q6:
if (ch == '=')
{
return ASSIGNMENT_SY;
}
else
{
currentState = q7;
}
case q7:
while (isdigit(ch) && !f.eof() && !isspace(ch))
{
s += ch;
f.get(ch);
}
f.putback(ch);
return NUM_SY;
case q8:
//syntaxError() ;
return SYNTAX_ERROR_SY;
}
}
}
void syntaxError()
{
cout << endl << " syntax error " << endl;
//return SYNTAX_ERROR_SY ;
}
Token checkReserved(string x)
{
if (x == "program")
{
return PROGRAM_SY;
}
else if (x == "begin")
{
return BEGIN_SY;
}
else if (x == "end")
{
return END_SY;
}
else if (x == "proc")
{
return PROC_SY;
}
else if (x == "call")
{
return CALL_SY;
}
else if (x == "int")
{
return INT_SY;
}
else if (x == "bool")
{
return BOOL_SY;
}
else if (x == "true")
{
return TRUE_SY;
}
else if (x == "false")
{
return FALSE_SY;
}
else
{
return ID_SY;
}
}
string startSymbol()
{
unordered_set< string >::iterator itr;
itr = nonTerminal.begin();
s = *itr;
return s;
}
void get_Termenal_NonTerminal()
{
ifstream ifileG;
ifileG.open("grammer.txt");
char c;
string s = "";
ifileG.get(c);
while (!ifileG.eof())
{
if (isalnum(c))
{
s = "";
while (isalnum(c) && !ifileG.eof())
{
s += c;
ifileG.get(c);
}
terminal.insert(s);
s = "";
}
else if (c == '<')
{
s = "";
while (c != '>')
{
s += c;
ifileG.get(c);
}
s += '>';
nonTerminal.insert(s);
s = "";
ifileG.get(c);
}
else if (c == '(')
{
terminal.insert("(");
ifileG.get(c);
}
else if (c == ')')
{
terminal.insert(")");
ifileG.get(c);
}
else if (c == '=')
{
terminal.insert("=");
ifileG.get(c);
}
else if (c == '#')
{
terminal.insert("#");
ifileG.get(c);
}
else if (c == ';')
{
terminal.insert(";");
ifileG.get(c);
}
else if (c == ':')
{
ifileG.get(c);
if (c == '=')
{
terminal.insert(":=");
ifileG.get(c);
}
else if (c == ':')
{
ifileG.get(c);
if (c == '=')
{
ifileG.get(c);
}
}
}
else if (isspace(c))
{
ifileG.get(c);
}
}
}
void getProductionRules()
{
int i = 0;
ifstream ifileG;
ifileG.open("grammer.txt");
while (!ifileG.eof())
{
getline(ifileG, s);
int p = s.find("::=");
string nonT = s.substr(0, p);
string rule = s.substr(p + 3, s.length());
rules[i][0] = nonT;
rules[i][1] = rule;
i++;
}
}
void displaySet(unordered_set< string > x)
{
unordered_set< string >::iterator itr;
for (itr = x.begin(); itr != x.end(); itr++)
{
cout << "--------------" << endl;
cout << *itr << endl;
cout << "--------------" << endl;
}
}
void display2DVector(vector< vector<string>> x)
{
for (int i = 0; i < x.size(); i++)
{
cout << i << endl << "======================" << endl;
for (int j = 0; j < x[i].size(); j++)
{
cout<< j<<"->>>>>>>>" << x[i][j] << " " << endl;
}
cout << endl;
}
}
void display1DVector(vector< string> x)
{
for (int i = 0; i < x.size(); i++)
{
cout << x[i] << endl;
}
}
void displayToken()
{
string temp[40] = {
"PROGRAM_SY" , "BEGIN_SY" , "END_SY" , "PROC_SY" , "ID_SY" , "LEFT_PARNTHES_SY" , "RIGHT_PARNTHES_SY" , "EQUAL_SY" , "ASSIGNMENT_SY" ,
"SIMI_COLON_SY" , "CALL_SY" , "INT_SY" , "BOOL_SY" , "NUM_SY" , "TRUE_SY" , "FALSE_SY" , "SYNTAX_ERROR_SY" , "END_SY"
};
Token t = getToken();
while (!f.eof())
{
cout << endl << temp[t] << endl;
t = getToken();
}
}
};
class LL1
{
public:
scaner* s;
LL1()
{
s = new scaner();
current_token = s->getToken();
creatFirstFollowTable();
}
void match(Token t)
{
if (current_token == t)
{
current_token = s->getToken();
}
else
{
s->syntaxError();
}
}
unordered_set<string> cutStrings(string x)
{
unordered_set<string> tempSet2;
tempSet2.clear();
char c;
string s = "";
int i = 0;
for (int e = 0, c = x[e]; e < x.size(); )
{
if (isalnum(c) && e < x.size())
{
s = "";
while (isalnum(c) && e < x.size())
{
s += c;
c = x[++e];
}
tempSet2.insert(s);
//c = x[++e];
s = "";
}
else if (c == '<' && e < x.size())
{
s = "";
while (c != '>' && e < x.size())
{
s += c;
c = x[++e];
}
s += '>';
tempSet2.insert(s);
s = "";
c = x[++e];
}
else if (isspace(c) && e < x.size())
{
c = x[++e];
}
else if (c == '#')
{
tempSet2.insert("#");
c = x[++e];
}
else if (c == '(')
{
tempSet2.insert("(");
c = x[++e];
}
else if (c == ')')
{
tempSet2.insert(")");
c = x[++e];
}
else if (c == '=')
{
tempSet2.insert("=");
c = x[++e];
}
else if (c == ';')
{
tempSet2.insert(";");
c = x[++e];
}
else if (c == ':')
{
c = x[++e];
if (c == '=')
{
tempSet2.insert(":=");
c = x[++e];
}
else if (c == ':')
{
c = x[++e];
if (c == '=')
{
c = x[++e];
}
}
}
}
return tempSet2;
}
unordered_set<string> first(string x)
{
bool flag = false;
unordered_set< string > tempSet5 = { " " };
unordered_set< string > firstSetHolder = { " " };
unordered_set< string > tempSet6 = { " " };
tempSet5.clear();
tempSet6.clear();
firstSetHolder.clear();
if (terminal.find(x) != terminal.end())
{
tempSet5.insert(x);
//cout << x << endl;
}
else if (nonTerminal.find(x) != nonTerminal.end())
{
//cout << x << endl;
for (int i = 0; i < rules.size(); i++)
{
if (rules[i][0] == x)
{
//cout << rules[i][1] << endl;
tempSet6.clear();
//tempSet6 = cutStrings(rules[i][1]) ;
for (auto ele : cutStrings(rules[i][1]))
{
tempSet6.insert(ele);
}
//s->displaySet(tempSet6);
/*cout << "////////////////////";
cout << rules[i][1] << " ///////////////////// " << endl;*/
//s->displaySet(tempSet6);
//cout << "/////////////////" << endl;
//unordered_set< string >::iterator itr2;
unordered_set< string > ::iterator itr3;
for (itr3 = tempSet6.begin(); itr3 != tempSet6.end(); itr3++)
{
//cout << "->" << *itr3 << endl;
firstSetHolder = first(*itr3);
if (firstSetHolder.find("#") != firstSetHolder.end())
{
for (auto singleFirst : firstSetHolder)
{
tempSet5.insert(singleFirst);
//cout << singleFirst<<"|" << endl;
//if (singleFirst != "#")
//{
// flag = true;
// //cout << "==========================================" << endl;
//}
//cout << "the first value : " << singleFirst << endl;
}
}
else
{
for (auto singleFirst : firstSetHolder)
{
tempSet5.insert(singleFirst);
//cout << singleFirst<<"|" << endl;
//if (singleFirst != "#")
//{
// flag = true;
// //cout << "==========================================" << endl;
//}
//cout << "the first value : " << singleFirst << endl;
}
break;
}
//unordered_set< string >::iterator itr3;
//for (itr3 = first(*itr2).begin(); itr3 != first(*itr2).end(); itr3++) // infinite loop
//{
// //cout << *itr3 << endl;////////
// tempSet5.insert(*itr3);
// s->displaySet(tempSet5);
//}
//tempSet5.insert( first(*itr2).begin() , first(*itr2).end() ); ////////////
//if (first(*itr2).find("#") != first(*itr2).end())
//{
// flag = true; //if flag is tru then Epslon is there we don't need to continue
//}
/*
for (singleVal : mainSet )
*/
}
if (flag)
{
break;
}
}
}
}
else
{
cout << "yyyyyyy" << endl;
}
return tempSet5;
}
unordered_set<string> follow(string x)
{
unordered_set< string > tempSet2 = { " " };
unordered_set< string > tempSet3 = { " " };
tempSet2.clear();
tempSet3.clear();
if (s->startSymbol() == x)
{
tempSet2.insert("$");
return tempSet2;
}
else if (nonTerminal.find(x) != nonTerminal.end() && s->startSymbol() != x)
{
for (int i = 0; i < rules.size(); i++)
{
if (rules[i][1].find(x) != string::npos)
{
string y = rules[i][1].substr(rules[i][1].find(x) + x.size(), rules[i][1].size());
tempSet3 = cutStrings(y);
if (tempSet3.size() == 0 && x != rules[i][0])
{
for (auto t : follow(rules[i][0]))
{
tempSet2.insert(t);
}
}
for (auto t : tempSet3)
{
if (terminal.find(t) != terminal.end())
{
tempSet2.insert(t);
return tempSet2;
}
string g;
for (auto f : tempSet3)
{
g = f;
}
for (auto s : first(t))
{
if (s != "#")
{
tempSet2.insert(s);
}
else if (s == "#" && tempSet3.find(t) == tempSet3.find(g) && rules[i][0] != t)
{
for (auto t : follow(rules[i][0])) // الفكرة ان بيروح يجبيب الفرست بتاع كل حاجة بعدها
{
tempSet2.insert(t);
}
}
}
if (first(t).find("#") == first(t).end())
{
break;
}
}
}
}
return tempSet2;
}
}
void creatFirstFollowTable()
{
//ffs.clear();
unordered_set< string > tempSet2 = { " " };
tempSet2.clear();
int i = 0;
unordered_set< string >::iterator itr;
for (itr = nonTerminal.begin(); itr != nonTerminal.end(); itr++)
{
tempSet2.clear();
tempSet2.insert(*itr);
ffs.at(i).at(0) = tempSet2;
//cout << *ffs.at(i).at(0).begin() << endl ;
ffs.at(i).at(1) = first(*itr);
ffs.at(i).at(2) = follow(*itr);
/*cout << "@@@@@@@@@@@@@@@@@@@@@@" << endl;
cout << *itr << endl;
cout << "#########" << endl;
s->displaySet(ffs.at(i).at(1));
cout << "******************" << endl;*/
//s->displaySet(ffs.at(i).at(1));
//cout << *ffs.at(i).at(1).begin() << endl;
//ffs.at(i).at(2) = follow(*itr);
//ffs.at(i).at(2).insert(follow(*itr).begin(), follow(*itr).end());
/*
cout << "end first " << endl;
unordered_set< string >::iterator itr3;
for (itr3 = follow(*itr).begin(); itr3 != follow(*itr).end(); itr3++)
{
ffs.at(i).at(2).insert(*itr2);
}
cout << "end first and start follow" << endl;
//ffs.at(i).at(1) = first(*itr);
//ffs.at(i).at(2).insert(follow(*itr).begin(), follow(*itr).end() );
//ffs.at(i).at(2) = follow(*itr);
*/
i++;
}
}
void displayFFS(vector< vector< unordered_set< string > > > x)
{
for (int i = 0; i < x.size(); i++)
{
for (int j = 0; j < x[i].size(); j++)
{
s->displaySet(x[i][j]);
cout << "================" << endl;
}
cout << "##############################" << endl;
}
}
string getFirstPart(string g)
{
string y = "";
int e = 0;
if (g[e] == '<')
{
while (g[e] != '>')
{
y += g[e];
++e;
}
return y;
}
else
{
while (g[e] != '<' || !isspace(g[e]))
{
y += g[e];
}
return y;
}
}
string* cutString(string x)
{
static string y[10];
for (int i = 0; i < 10; i++)
{
y[i] = " ";
}
int itr = 0;
string temp = "";
for (int i = 0; i < x.length(); i++)//////////////////////////
{
if (x[i] == '<')
{
while (i < x.length() && x[i] != '>' && i < x.size())
{
temp += x[i];
i++;
}
temp += x[i];
y[itr] = temp;
temp = "";
itr++;
}
else
{
while (i < x.length() && x[i] != '<' || !isspace(x[i]))//////////////
{
temp += x[i];
i++;
}
y[itr] = temp;
temp = "";
itr++;
i--;
}
}
return y;
}
//void createParsingTable()
//{
// creatFirstFollowTable();
// tempSet.clear();
// int a;
// for (int i = Program; i != expr; i++) // i is the non-terminal
// {
// tempSet = ffs[i][0]; ///////////////////////////////////////////////////////////////////////////////////////////////////
// unordered_set< string >::iterator itr;
// for (itr = tempSet.begin(); itr != tempSet.end(); itr++)
// {
// a = s->checkReserved(*itr); // convert from string to token ( integer )
// for (int q = 0; q < 23; q++)
// {
// string g = rules[q][1];
// g = getFirstPart(g);
// if (rules.at(q).at(0) == convertITOS(i) && first(g).find(*itr) != first(g).end())
// {
// Table.at(i).at(a) = rules.at(q).at(1);
// break;
// }
// }
// }
// if (tempSet.find("#") != tempSet.end())
// {
// tempSet = ffs[i][1];
// unordered_set< string >::iterator itr;
// for (itr = tempSet.begin(); itr != tempSet.end(); itr++)
// {
// a = s->checkReserved(*itr);
// for (int q = 0; q < 23; q++)
// {
// string g = rules[q][1];
// g = getFirstPart(g);
// if (rules.at(q).at(0) == convertITOS(i) && first(g).find(*itr) != first(g).end())
// {
// Table.at(i).at(a) = rules.at(q).at(1);
// break;
// }
// }
// }
// }
// }
//}
void createParsingTable()
{
unordered_set< string > tempSet1 = { " " };
tempSet1.clear();
int x = 0;
for (auto nonT : nonTerminal)
{
for (auto T : first(nonT))
{
for (int i = 0; i < rules.size(); i++)
{
if ( rules[i][0] == nonT && first( *cutStrings( rules[i][1] ).begin() ).find(T) != first(*cutStrings(rules[i][1]).begin() ).end() && T != "#" )
{
Table[x][terminalNo(T)] = rules[i][1] ;
//break;
}
}
}
if (first(nonT).find("#") != first(nonT).end())
{
for (auto f : follow(nonT))
{
for (int i = 0; i < rules.size(); i++)
{
if (rules[i][0] == nonT && rules[i][1] == "#" )
{
Table[x][terminalNo(f)] = rules[i][1];
//break;
}
}
}
}
x++;
}
}
int terminalNo(string x)
{
if (x == "program")
{
return 1;
}
else if (x == "begin")
{
return 2;
}
else if (x == "end")
{
return 3;
}
else if (x == "proc")
{
return 4;
}
else if (x == "id")
{
return 5;
}
else if (x == "=")
{
return 6;
}
else if (x == ":=")
{
return 7;
}
else if (x == ";")
{
return 8;
}
else if (x == "(")
{
return 9;
}
else if (x == ")")
{
return 10;
}
else if (x == "call")
{
return 11;
}
else if (x == "int")
{
return 12;
}
else if (x == "bool")
{
return 13;
}
else if (x == "num")
{
return 14;
}
else if (x == "true")
{
return 15;
}
else if (x == "false")
{
return 16;
}
else if (x == "$")
{
return 17;
}
}
non_terminals convert(int str)
{
if (str == 0) return Program;
else if (str == 1) return declaration_seq;
else if (str == 2) return declaration_tail;
else if (str == 3) return declaration;
else if (str == 4) return x;
else if (str == 5) return declarer;
else if (str == 6) return y;
else if (str == 7) return statement_seq;
else if (str == 8) return statement_tail;
else if (str == 9) return statement;
else if (str == 10) return z;
else if (str == 12) return type;
else if (str == 13) return expr;
}
non_terminals convert(string str)
{
if (str == "Program") return Program;
else if (str == "declaration_seq") return declaration_seq;
else if (str == "declaration_tail") return declaration_tail;
else if (str == "declaration") return declaration;
else if (str == "x") return x;
else if (str == "declarer") return declarer;
else if (str == "y") return y;
else if (str == "statement_seq") return statement_seq;
else if (str == "statement_tail") return statement_tail;
else if (str == "statement") return statement;
else if (str == "z") return z;
else if (str == "type") return type;
else if (str == "expr") return expr;
}
int convertNTOI(string str)
{
if (str == "Program") return 1;
else if (str == "declaration_seq") return 2;
else if (str == "declaration_tail") return 3;
else if (str == "declaration") return 4;
else if (str == "x") return 5;
else if (str == "declarer") return 6;
else if (str == "y") return 7;
else if (str == "statement_seq") return 8;
else if (str == "statement_tail") return 9;
else if (str == "statement") return 10;
else if (str == "z") return 11;
else if (str == "type") return 12;
else if (str == "expr") return 13;
}
Token convertSTOT(string str)
{
if (str == "Program") return PROGRAM_SY;
else if (str == "begin") return BEGIN_SY;
else if (str == "end") return END_SY;
else if (str == "proc") return PROC_SY;
else if (str == "=") return EQUAL_SY;
else if (str == ":=") return ASSIGNMENT_SY;
else if (str == ";") return SIMI_COLON_SY;
else if (str == "(") return LEFT_PARNTHES_SY;
else if (str == ")") return RIGHT_PARNTHES_SY;
else if (str == "call") return CALL_SY;
else if (str == "int") return INT_SY;
else if (str == "bool") return BOOL_SY;
else if (str == "num") return NUM_SY;
else if (str == "true") return TRUE_SY;
else if (str == "false") return FALSE_SY;
else if (str == "$") return END_OF_FILE_SY;
else return ID_SY;
}
string convertITOS(int str)
{
if (str == 0) return "Program";
else if (str == 1) return "declaration_seq";
else if (str == 2) return "declaration_tail";
else if (str == 3) return "declaration";
else if (str == 4) return "x";
else if (str == 5) return "declarer";
else if (str == 6) return "y";
else if (str == 7) return "statement_seq";
else if (str == 8) return "statement_tail";
else if (str == 9) return "statement";
else if (str == 10) return "z";
else if (str == 12) return "type";
else if (str == 13) return "expr";
else { return "error"; }
}
void parser()
{
createParsingTable();
string x;
stack<string> st;
st.push("$");
st.push(*nonTerminal.begin());
current_token = s->getToken();
while (!st.empty())
{
x = st.top();
if (terminal.find(x) != terminal.end())
{
match(convertSTOT(x));
st.pop();
}
else if (nonTerminal.find(x) != nonTerminal.end()) // X is non-terminal
{
non_terminals z = convert(x);
string s = Table[z][current_token];
string* arr = cutString(s);
st.pop();
for (int i = 10; i >= 0; i--)
{
if (arr[i] == "@")
{
//escape
}
else
{
st.push(arr[i]);
}
}
}
else
{
s->syntaxError();
//SyntaxError(current_token);
}
}
}
};
void main()
{
LL1 p;
p.createParsingTable();
scaner s;
s.display2DVector(Table);
system("pause");
}
|
e8a286d155a7c2d6623b28dc731667f862cb6ad2 | 1ba4a56c6fdf189b05edb9853ab0ce39f3bf2c5f | /LeetCode/partion list.cpp | ca0dd10ab804613f0bb086e7a37433858c3aadd5 | [] | no_license | FireFoxPlus/LeetCode | 12429bcaa9bb005be4a5c9ac53515206fe42ab18 | 1ff1eddb75368b40cfc2e7f8892b59a2c0000d52 | refs/heads/master | 2021-01-01T15:55:48.958668 | 2015-07-28T06:48:53 | 2015-07-28T06:48:53 | 39,804,549 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,683 | cpp | partion list.cpp |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* partition(ListNode* head, int x) {
if(head == NULL || head->next == NULL)
return head;
ListNode *preTail = NULL , *cur = head , *preCur = NULL;
while(cur != NULL)
{
if(cur->val < x)
{
if(preTail == NULL)
{
if(preCur == NULL)
{
preTail = head;
preCur = cur;
cur = cur->next;
}
else
{
preCur->next = cur->next;
cur->next = head;
head = cur;
preTail = head;
cur = preCur->next;
}
}
else
{
if(preCur != preTail)
{
preCur->next = cur->next;
cur->next = preTail->next;
preTail->next = cur;
preTail = cur;
cur = preCur->next;
}
else
{
preTail = cur;
preCur = cur;
cur = cur->next;
}
}
}
else
{
preCur = cur;
cur = cur->next;
}
}
return head;
}
};
|
2d2f4ddd21b228cce7ae7469a6887a3e6f5c6db4 | da215a09477415e8970573476be649054d2bd582 | /C++/inheitance/MultipleInheritence/multipleInhetiance.cpp | 9561737f163e0cba19dfccc795d357c88d33a1ac | [] | no_license | imyogeshgaur/important_concepts | 822bb554a579e756d4727b57aa3c889923d3158b | 5d34232ad5cf1e3d078f6026b61ce41698e38755 | refs/heads/master | 2023-02-07T06:25:01.424360 | 2020-12-27T10:45:49 | 2020-12-27T10:45:49 | 299,019,489 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 919 | cpp | multipleInhetiance.cpp | #include <iostream>
using namespace std;
class Base1{
protected:
int base1int;
public:
void set_base1int(int a)
{
base1int = a;
}
};
class Base2{
protected:
int base2int;
public:
void set_base2int(int a)
{
base2int = a;
}
};
class Base3{
protected:
int base3int;
public:
void set_base3int(int a)
{
base3int = a;
}
};
class Derived : public Base1, public Base2, public Base3
{
public:
void show(){
cout << "The value of Base1 is " << base1int<<endl;
cout << "The value of Base2 is " << base2int<<endl;
cout << "The value of Base3 is " << base3int<<endl;
cout << "The sum of these values is " << base1int + base2int + base3int << endl;
}
};
int main()
{
Derived d;
d.set_base1int(25);
d.set_base2int(5);
d.set_base3int(15);
d.show();
return 0;
} |
4c6b7e119470d0ceac2e85149cf6cb8503a0cb1d | 124398c433f5e42134bf59cd081807286e14822b | /src/AStarPathFinder.cpp | 3b16d69a21a42a2c1f70f2202f55774ca45b924b | [] | no_license | TekatoD/MyStrategyRAIC2016 | b1c4367fbb51b83288a5c177e29a56efecf878a8 | 1ec0995adbfa5f212d86ccb35c8369d418baeaa5 | refs/heads/master | 2020-05-25T20:08:57.417078 | 2017-03-15T11:45:56 | 2017-03-15T11:45:56 | 84,962,989 | 0 | 0 | null | 2017-03-14T15:08:09 | 2017-03-14T15:08:09 | null | UTF-8 | C++ | false | false | 3,217 | cpp | AStarPathFinder.cpp | /**
* @autor arssivka
* @date 11/30/16
*/
#include "AStarPathFinder.h"
#include "Log.h"
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <queue>
const size_t AStarPathFinder::DEFAULT_QUEUE_SIZE = 32;
AStarPathFinder::AStarPathFinder(Ptr<Graph> graph, size_t initialQueueSize)
: PathFinder(std::move(graph)), mInitialQueueSize(initialQueueSize) {}
Path AStarPathFinder::findPath(const Point& from, const Point& to) {
auto graph = this->getGraph();
auto start = graph->getNearestVertex(from);
auto end = graph->getNearestVertex(to);
using Waypoint = std::pair<Point, double>;
if (start == end) {
return Path{};
}
double dist = 0;
auto comparator = [&end](const Waypoint& first, const Waypoint& second) -> bool {
return first.first.getDistanceTo(end) + first.second > second.first.getDistanceTo(end) + second.second;
};
std::vector<Waypoint> container;
container.reserve(mInitialQueueSize);
std::priority_queue<Waypoint, std::vector<Waypoint>, decltype(comparator)> q{std::move(comparator),
std::move(container)};
q.push({start, dist});
std::unordered_map<Point, double> waypoints;
waypoints.max_load_factor(0.8);
bool found = false;
while (!q.empty()) {
auto current = std::move(q.top());
q.pop();
auto& pos = current.first;
dist = current.second;
auto contains = waypoints.find(pos);
if (contains == waypoints.cend()) {
waypoints.emplace(current);
} else if (contains->second > dist) {
contains->second = dist;
} else {
continue;
}
if (pos == end) {
found = true;
break;
}
auto neighbours = graph->getNeighbourVertexes(pos);
for (auto&& neighbour : neighbours) {
q.push({neighbour.first, neighbour.second + dist});
}
}
if(!found)
return Path{start};
Path path;
Point current = end;
while (current != start) {
path.push(current);
const auto& neighbours = graph->getNeighbourVertexes(current);
auto place = std::accumulate(neighbours.cbegin(), neighbours.cend(), current,
[&waypoints, &dist](const Point& acc, const auto& pair) -> Point {
const auto& point = pair.first;
const auto found = waypoints.find(point);
if (found == waypoints.cend()) return acc;
auto len = found->second;
if (len < dist) {
dist = len;
return point;
} else {
return acc;
}
});
current = place;
}
path.push(start);
return std::move(path);
}
size_t AStarPathFinder::getInitialQueueSize() const {
return mInitialQueueSize;
}
void AStarPathFinder::setInitialQueueSize(size_t initialQueueSize) {
mInitialQueueSize = initialQueueSize;
}
AStarPathFinder::AStarPathFinder()
: PathFinder(nullptr), mInitialQueueSize(DEFAULT_QUEUE_SIZE) {}
|
cd4fd96bff7e824ac3dd4529c6c5f56c70e0c67b | eab47b71185ac405380441e251ddcc75da575052 | /camera/test/clouduploader/cloud_libs/include/common_base.h | c2f8d16bb90b3e98f0fcd32a9a8fe3bb386e806a | [] | no_license | mrtos/ambarella | 6b2bfc6adc3d314ef85cdc63bcded02b85cd3383 | 2eaae76ec56e052479ca6405a82c8fec0bc7a794 | refs/heads/master | 2016-12-13T05:10:17.576686 | 2016-01-21T09:47:01 | 2016-01-21T09:47:01 | 27,258,572 | 3 | 12 | null | null | null | null | UTF-8 | C++ | false | false | 25,500 | h | common_base.h | /**
* common_base.h
*
* History:
* 2012/12/07 - [Zhi He] create file
*
* Copyright (C) 2012, the ambarella Inc.
*
* All rights reserved. No Part of this file may be reproduced, stored
* in a retrieval system, or transmitted, in any form, or by any means,
* electronic, mechanical, photocopying, recording, or otherwise,
* without the prior consent of the ambarella Inc.
*/
#ifndef __COMMON_BASE_H__
#define __COMMON_BASE_H__
DCONFIG_COMPILE_OPTION_HEADERFILE_BEGIN
DCODE_DELIMITER;
//-----------------------------------------------------------------------
//
// IActiveObject
//
//-----------------------------------------------------------------------
typedef enum
{
ECMDType_Invalid = 0x0000,
ECMDType_FirstEnum = 0x0001,
//common used
ECMDType_Terminate = ECMDType_FirstEnum,
ECMDType_StartRunning = 0x0002,
ECMDType_ExitRunning = 0x0003,
ECMDType_Stop = 0x0010,
ECMDType_Start = 0x0011,
ECMDType_Pause = 0x0012,
ECMDType_Resume = 0x0013,
ECMDType_ResumeFlush = 0x0014,
ECMDType_Flush = 0x0015,
ECMDType_FlowControl = 0x0016,
ECMDType_Suspend = 0x0017,
ECMDType_ResumeSuspend = 0x0018,
ECMDType_SwitchInput = 0x0019,
ECMDType_Step = 0x0020,
ECMDType_DebugDump = 0x0021,
ECMDType_PrintCurrentStatus = 0x0022,
ECMDType_SetRuntimeLogConfig = 0x0023,
ECMDType_AddContent = 0x0030,
ECMDType_RemoveContent = 0x0031,
ECMDType_AddClient = 0x0032,
ECMDType_RemoveClient = 0x0033,
ECMDType_UpdateUrl = 0x0034,
ECMDType_RemoveClientSession = 0x0035,
ECMDType_UpdateRecSavingStrategy = 0x0036,
//specific to each case
ECMDType_ForceLowDelay = 0x0040,
ECMDType_Speedup = 0x0041,
ECMDType_DeleteFile = 0x0042,
ECMDType_UpdatePlaybackSpeed = 0x0043,
ECMDType_UpdatePlaybackLoopMode = 0x0044,
ECMDType_DecoderZoom = 0x0045,
ECMDType_NotifySynced = 0x0050,
ECMDType_NotifySourceFilterBlocked = 0x0051,
ECMDType_NotifyUDECInRuningState = 0x0052,
ECMDType_NotifyBufferRelease = 0x0053,
ECMDType_MuteAudio = 0x0060,
ECMDType_UnMuteAudio = 0x0061,
ECMDType_MiscCheckLicence = 0x0070,
//cloud based
ECMDType_CloudSourceClient_UnknownCmd = 0x0100,
ECMDType_CloudSourceClient_ReAuthentication = 0x0101,
ECMDType_CloudSourceClient_StartPush = 0x0102,
ECMDType_CloudSourceClient_StopPush = 0x0103,
ECMDType_CloudSinkClient_ReAuthentication = 0x0110,
ECMDType_CloudSinkClient_UpdateBitrate = 0x0111,
ECMDType_CloudSinkClient_UpdateFrameRate = 0x0112,
ECMDType_CloudSinkClient_UpdateDisplayLayout = 0x0113,
ECMDType_CloudSinkClient_SelectAudioSource = 0x0114,
ECMDType_CloudSinkClient_SelectAudioTarget = 0x0115,
ECMDType_CloudSinkClient_Zoom = 0x0116,
ECMDType_CloudSinkClient_UpdateDisplayWindow = 0x0117,
ECMDType_CloudSinkClient_SelectVideoSource = 0x0118,
ECMDType_CloudSinkClient_ShowOtherWindows = 0x0119,
ECMDType_CloudSinkClient_DemandIDR = 0x011a,
ECMDType_CloudSinkClient_SwapWindowContent = 0x011b,
ECMDType_CloudSinkClient_CircularShiftWindowContent = 0x011c,
ECMDType_CloudSinkClient_SwitchGroup = 0x011d,
ECMDType_CloudSinkClient_ZoomV2 = 0x011e,
ECMDType_CloudSinkClient_UpdateResolution = 0x011f,
ECMDType_CloudClient_PeerClose = 0x0140,
ECMDType_CloudClient_QueryVersion = 0x0141,
ECMDType_CloudClient_QueryStatus = 0x0142,
ECMDType_CloudClient_SyncStatus = 0x0143,
ECMDType_CloudClient_QuerySourceList = 0x0144,
ECMDType_CloudClient_AquireChannelControl = 0x0145,
ECMDType_CloudClient_ReleaseChannelControl = 0x0146,
//for extention
ECMDType_CloudClient_CustomizedCommand = 0x0180,
//debug
ECMDType_DebugClient_PrintCloudPipeline = 0x200,
ECMDType_DebugClient_PrintStreamingPipeline = 0x201,
ECMDType_DebugClient_PrintRecordingPipeline = 0x202,
ECMDType_DebugClient_PrintSingleChannel = 0x203,
ECMDType_DebugClient_PrintAllChannels = 0x204,
ECMDType_LastEnum = 0x0400,
} ECMDType;
class SCMD
{
public:
TUint code;
void *pExtra;
TU8 repeatType;
TU8 flag;
TU8 needFreePExtra;
TU8 reserved1;
TU32 res32_1;
TU64 res64_1;
TU64 res64_2;
public:
SCMD(TUint cid) { code = cid; pExtra = NULL; needFreePExtra = 0; repeatType = 0;}
SCMD() {pExtra = NULL; needFreePExtra = 0; repeatType = 0;}
};
typedef enum {
EMSGType_Invalid = 0,
EMSGType_FirstEnum = ECMDType_LastEnum,
//common used
EMSGType_ExternalMSG = EMSGType_FirstEnum,
EMSGType_Timeout = 0x0401,
EMSGType_InternalBug = 0x0402,
EMSGType_StorageError = 0x0410,
EMSGType_IOError = 0x0411,
EMSGType_SystemError = 0x0412,
EMSGType_DeviceError = 0x0413,
EMSGType_StreamingError_TCPSocketConnectionClose = 0x0414,
EMSGType_StreamingError_UDPSocketInvalidArgument = 0x0415,
EMSGType_DriverErrorBusy = 0x0420,
EMSGType_DriverErrorNotSupport = 0x0421,
EMSGType_DriverErrorOutOfCapability = 0x0422,
EMSGType_DriverErrorNoPermmition = 0x0423,
//for each user cases
EMSGType_PlaybackEOS = 0x0430,
EMSGType_RecordingEOS = 0x0431,
EMSGType_NotifyNewFileGenerated = 0x0432,
EMSGType_RecordingReachPresetDuration = 0x0433,
EMSGType_RecordingReachPresetFilesize = 0x0434,
EMSGType_RecordingReachPresetTotalFileNumbers = 0x0435,
EMSGType_NotifyThumbnailFileGenerated = 0x0440,
EMSGType_NotifyUDECStateChanges = 0x0441,
EMSGType_NotifyUDECUpdateResolution = 0x0442,
EMSGType_LastEnum,
} EMSGType;
typedef struct
{
TUint code;
void *pExtra;
TU16 sessionID;
TU8 flag;
TU8 needFreePExtra;
TU16 owner_index;
TU8 owner_type;
TU8 identifyer_count;
TULong p_owner, owner_id;
TULong p_agent_pointer;
TULong p0, p1, p2, p3, p4;
} SMSG;
typedef struct
{
TUint code;
void *pExtra;
TU16 sessionID;
TU8 flag;
TU8 needFreePExtra;
TU8 owner_type, owner_index, reserved0, reserved1;
TULong p_owner, owner_id;
TULong p1, p2, p3, p4;
} SScheduledClient;
typedef enum {
EModuleState_Invalid = 0,
//commom used
EModuleState_Idle,
EModuleState_Preparing,
EModuleState_Running,
EModuleState_HasInputData,
EModuleState_HasOutputBuffer,
EModuleState_Completed,
EModuleState_Bypass,
EModuleState_Pending,
EModuleState_Stopped,
EModuleState_Error,
EModuleState_WaitCmd,
EModuleState_WaitTiming,
//specified module
//muxer
EModuleState_Muxer_WaitExtraData,
EModuleState_Muxer_SavingPartialFile,
EModuleState_Muxer_SavingPartialFilePeekRemainingOnMasterPin,
EModuleState_Muxer_SavingPartialFilePeekRemainingOnNonMasterPin,
EModuleState_Muxer_SavingPartialFileWaitMasterPin,
EModuleState_Muxer_SavingPartialFileWaitNonMasterPin,
EModuleState_Muxer_SavingWholeFile,
EModuleState_Muxer_FlushExpiredFrame,
//renderer
EModuleState_Renderer_PreBuffering,
EModuleState_Renderer_PreBufferingDone,
EModuleState_Renderer_WaitVoutDormant,
//ts demuxer
EModuleState_Demuxer_UpdatingContext,
} EModuleState;
extern const TChar* gfGetModuleStateString(EModuleState state);
extern const TChar* gfGetCMDTypeString(ECMDType type);
//-----------------------------------------------------------------------
//
// IInterface
//
//-----------------------------------------------------------------------
class IInterface
{
public:
virtual void Delete() = 0;
public:
virtual const TChar* GetModuleName() const = 0;
virtual TUint GetModuleIndex() const = 0;
public:
virtual void PrintStatus() = 0;
public:
virtual void SetLogLevel(TUint level) = 0;
virtual void SetLogOption(TUint option) = 0;
virtual void SetLogOutput(TUint output) = 0;
};
//-----------------------------------------------------------------------
//
// IMsgSink
//
//-----------------------------------------------------------------------
class IMsgSink
{
public:
virtual EECode MsgProc(SMSG& msg) = 0;
};
//-----------------------------------------------------------------------
//
// IActiveObject
//
//-----------------------------------------------------------------------
class IActiveObject: virtual public IInterface
{
public:
virtual void OnRun() = 0;
};
//-----------------------------------------------------------------------
//
// IScheduledClient
//
//-----------------------------------------------------------------------
typedef TUint TSchedulingUnit;
typedef TInt TSchedulingHandle;
class IScheduledClient
{
public:
virtual EECode Scheduling(TUint times = 1) = 0;
public:
virtual TInt IsPassiveMode() const = 0;
virtual TSchedulingHandle GetWaitHandle() const = 0;
virtual TU8 GetPriority() const = 0;
virtual EECode CheckTimeout() = 0;
virtual EECode EventHandling(EECode err) = 0;
public:
virtual TSchedulingUnit HungryScore() const = 0;
};
//-----------------------------------------------------------------------
//
// IScheduler
//
//-----------------------------------------------------------------------
class IScheduler: virtual public IInterface
{
public:
virtual EECode StartScheduling() = 0;
virtual EECode StopScheduling() = 0;
public:
virtual EECode AddScheduledCilent(IScheduledClient* client) = 0;
virtual EECode RemoveScheduledCilent(IScheduledClient* client) = 0;
public:
virtual TUint TotalNumberOfScheduledClient() const = 0;
virtual TUint CurrentNumberOfClient() const = 0;
virtual TSchedulingUnit CurrentHungryScore() const = 0;
public:
virtual TInt IsPassiveMode() const = 0;
};
//-----------------------------------------------------------------------
//
// IEventListener
//
//-----------------------------------------------------------------------
typedef enum
{
EEventType_Invalid = 0,
EEventType_BufferReleaseNotify,
EEventType_Timer,
} EEventType;
class IEventListener
{
public:
virtual void EventNotify(EEventType type, TU64 param1, TPointer param2) = 0;
};
//-----------------------------------------------------------------------
//
// CObject
//
//-----------------------------------------------------------------------
class CObject: virtual public IInterface
{
public:
virtual void Delete();
virtual ~CObject();
public:
virtual void PrintStatus();
public:
CObject(const TChar* name, TUint index = 0);
virtual void SetLogLevel(TUint level);
virtual void SetLogOption(TUint option);
virtual void SetLogOutput(TUint output);
public:
virtual const TChar* GetModuleName() const;
virtual TUint GetModuleIndex() const;
protected:
TUint mConfigLogLevel;
TUint mConfigLogOption;
TUint mConfigLogOutput;
protected:
const TChar* mpModuleName;
protected:
TUint mIndex;
protected:
TUint mDebugHeartBeat;
protected:
FILE* mpLogOutputFile;
};
//-----------------------------------------------------------------------
//
// CIDoubleLinkedList
//
//-----------------------------------------------------------------------
//common container, not thread safe
class CIDoubleLinkedList
{
public:
struct SNode
{
void* p_context;
};
private:
//trick here, not very good, make pointer not expose
struct SNodePrivate
{
void* p_context;
SNodePrivate* p_next, *p_pre;
};
public:
CIDoubleLinkedList();
virtual ~CIDoubleLinkedList();
public:
//if target_node == NULL, means target_node == list head
SNode* InsertContent(SNode* target_node, void* content, TUint after = 1);
void RemoveContent(void* content);
//AM_ERR RemoveNode(SNode* node);
SNode* FirstNode() const;
SNode* LastNode() const;
SNode* PreNode(SNode* node) const;
SNode* NextNode(SNode* node) const;
TUint NumberOfNodes() const;
public:
static void* operator new (size_t, void* p);
//debug function
public:
bool IsContentInList(void* content) const;
private:
bool IsNodeInList(SNode* node) const;
void allocNode(SNodePrivate* & node);
private:
SNodePrivate mHead;
TUint mNumberOfNodes;
SNodePrivate* mpFreeList;
};
//-----------------------------------------------------------------------
//
// CIDoubleLinkedListMap
//
//-----------------------------------------------------------------------
//common container, not thread safe
class CIDoubleLinkedListMap
{
public:
struct SNode
{
void* p_context;
void* key;
};
private:
//trick here, not very good, make pointer not expose
struct SNodePrivate
{
void* p_context;
void* key;
SNodePrivate* p_next, *p_pre;
};
public:
CIDoubleLinkedListMap();
virtual ~CIDoubleLinkedListMap();
public:
//if target_node == NULL, means target_node == list head
SNode* InsertContent(SNode* target_node, void* content, void* key, TUint after = 1);
void RemoveContent(void* content);
void RemoveContentFromKey(void* key);
SNode* FirstNode() const;
SNode* LastNode() const;
SNode* PreNode(SNode* node) const;
SNode* NextNode(SNode* node) const;
TUint NumberOfNodes() const;
void* KeyFromContent(void* content) const;
void* ContentFromKey(void* content) const;
public:
static void* operator new (size_t, void* p);
//debug function
public:
bool IsContentInList(void* content) const;
private:
bool IsNodeInList(SNode* node) const;
bool IsKeyInList(void* key) const;
void allocNode(SNodePrivate* & node);
private:
SNodePrivate mHead;
TUint mNumberOfNodes;
SNodePrivate* mpFreeList;
};
//-----------------------------------------------------------------------
//
// CIWorkQueue
//
//-----------------------------------------------------------------------
class CIWorkQueue: virtual public CObject
{
typedef CObject inherited;
typedef IActiveObject AO;
public:
static CIWorkQueue* Create(AO *pAO);
virtual void Delete();
private:
CIWorkQueue(AO *pAO);
EECode Construct();
~CIWorkQueue();
public:
// return receive's reply
EECode SendCmd(TUint cid, void *pExtra = NULL);
EECode SendCmd(SCMD& cmd);
void GetCmd(SCMD& cmd);
bool PeekCmd(SCMD& cmd);
EECode PostMsg(TUint cid, void *pExtra = NULL);
EECode PostMsg(SCMD& cmd);
EECode Run();
EECode Stop();
EECode Start();
void CmdAck(EECode result);
CIQueue *MsgQ() const;
CIQueue::QType WaitDataMsg(void *pMsg, TUint msgSize, CIQueue::WaitResult *pResult);
CIQueue::QType WaitDataMsgCircularly(void *pMsg, TUint msgSize, CIQueue::WaitResult *pResult);
CIQueue::QType WaitDataMsgWithSpecifiedQueue(void *pMsg, TUint msgSize, const CIQueue *pQueue);
void WaitMsg(void *pMsg, TUint msgSize);
private:
void MainLoop();
static EECode ThreadEntry(void *p);
void Terminate();
private:
AO *mpAO;
CIQueue *mpMsgQ;
CIThread *mpThread;
};
//-----------------------------------------------------------------------
//
// IClockSource
//
//-----------------------------------------------------------------------
typedef enum {
EClockSourceState_stopped = 0,
EClockSourceState_running,
EClockSourceState_paused,
} EClockSourceState;
class IClockSource: virtual public IInterface
{
public:
virtual TTime GetClockTime(TUint relative = 1) const = 0;
virtual TTime GetClockBase() const = 0;
virtual void SetClockFrequency(TUint num, TUint den) = 0;
virtual void GetClockFrequency(TUint& num, TUint& den) const = 0;
virtual void SetClockState(EClockSourceState state) = 0;
virtual EClockSourceState GetClockState() const = 0;
virtual void UpdateTime() = 0;
};
typedef enum {
EClockSourceType_generic = 0,
} EClockSourceType;
extern IClockSource* gfCreateClockSource(EClockSourceType type = EClockSourceType_generic);
//-----------------------------------------------------------------------
//
// CIClockReference
//
//-----------------------------------------------------------------------
typedef enum {
EClockTimerType_once = 0,
EClockTimerType_repeat_count,
EClockTimerType_repeat_infinite,
} EClockTimerType;
typedef struct SClockListener_s
{
IEventListener* p_listener;
EClockTimerType type;
TTime event_time;
TTime event_duration;
TUint event_remaining_count;
struct SClockListener_s* p_next;
TULong user_context;
} SClockListener;
class CIClockReference: virtual public CObject
{
typedef CObject inherited;
protected:
CIClockReference();
~CIClockReference();
EECode Construct();
public:
static CIClockReference* Create();
void Delete();
public:
//void SetClockSource(IClockSource* clock_source);
void SetBeginTime(TTime start_time);
void SetDirection(TU8 forward);
void SetSpeed(TU8 speed, TU8 speed_frac);
EECode Start();
EECode Pause();
EECode Resume();
EECode Stop();
EECode SyncTo(TTime source_time, TTime target_time, TU8 sync_source_time, TU8 sync_target_time, TU8 reset_to_1x_forward = 0);
void Heartbeat(TTime current_source_time);
void ClearAllTimers();
SClockListener* AddTimer(IEventListener* p_listener, EClockTimerType type, TTime time, TTime interval, TUint count = 0);
EECode RemoveTimer(SClockListener* timer);
EECode RemoveAllTimers(IEventListener* p_listener);
TTime GetCurrentTime() const;
virtual void PrintStatus();
private:
SClockListener* allocClockListener();
void releaseClockListener(SClockListener* p);
void clearAllClockListener();
void updateTime(TTime target_time);
private:
CIMutex* mpMutex;
//IClockSource* mpClockSource;
volatile TTime mBeginSourceTime;
volatile TTime mCurrentSourceTime;
volatile TTime mBeginTime;
volatile TTime mCurrentTime;
TU8 mbPaused;
TU8 mbStarted;
TU8 mbSilent;
TU8 mbForward;
TU8 mSpeed;
TU8 mSpeedFrac;
TU8 mReserve0, mReserved1;
CIDoubleLinkedList mClockListenerList;
SClockListener* mpFreeClockListenerList;
};
//-----------------------------------------------------------------------
//
// CIClockManager
//
//-----------------------------------------------------------------------
class CIClockManager: virtual public CObject, virtual public IActiveObject
{
typedef CObject inherited;
public:
static CIClockManager* Create();
void Delete();
protected:
EECode Construct();
CIClockManager();
~CIClockManager();
public:
EECode SetClockSource(IClockSource* pClockSource);
EECode RegisterClockReference(CIClockReference* p_clock_reference);
EECode UnRegisterClockReference(CIClockReference* p_clock_reference);
EECode Start();
EECode Stop();
virtual void PrintStatus();
protected:
virtual void OnRun();
private:
virtual EECode processCMD(SCMD& cmd);
private:
void updateClockReferences();
private:
CIWorkQueue* mpWorkQ;
IClockSource* mpClockSource;
CIDoubleLinkedList mClockReferenceList;
CIEvent* mpEvent;
TU8 mbRunning;
TU8 mbHaveClockSource;
TU8 mbPaused, mbClockReferenceListDestroyed;
};
//-----------------------------------------------------------------------
//
// IMemPool
//
//-----------------------------------------------------------------------
class IMemPool : virtual public IInterface
{
public:
virtual TU8* RequestMemBlock(TULong size, TU8* start_pointer = NULL) = 0;
virtual void ReturnBackMemBlock(TULong size, TU8* start_pointer) = 0;
virtual void ReleaseMemBlock(TULong size, TU8* start_pointer) = 0;
};
//-----------------------------------------------------------------------
//
// ICustomizedCodec
//
//-----------------------------------------------------------------------
class ICustomizedCodec
{
public:
virtual EECode ConfigCodec(TU32 param1, TU32 param2, TU32 param3, TU32 param4, TU32 param5) = 0;
virtual EECode QueryInOutBufferSize(TMemSize& encoder_input_buffer_size, TMemSize& encoder_output_buffer_size) const = 0;
public:
virtual EECode Encoding(void* in_buffer, void* out_buffer, TMemSize in_data_size, TMemSize& out_data_size) = 0;
virtual EECode Decoding(void* in_buffer, void* out_buffer, TMemSize in_data_size, TMemSize& out_data_size) = 0;
public:
virtual void Destroy() = 0;
};
ICustomizedCodec* gfCustomizedCodecFactory(TChar* codec_name, TUint index);
typedef enum {
ESchedulerType_Invalid = 0,
ESchedulerType_RunRobin,
ESchedulerType_Preemptive,
ESchedulerType_PriorityPreemptive,
} ESchedulerType;
extern IScheduler* gfSchedulerFactory(ESchedulerType type, TUint index);
extern EECode gfGetCurrentDateTime(SDateTime* datetime);
//-----------------------------------------------------------------------
//
// IIPCAgent
//
//-----------------------------------------------------------------------
typedef EECode (*TIPCAgentReadCallBack) (void* owner, TU8*& p_data, TInt& datasize, TU32& remainning);
class IIPCAgent
{
public:
virtual EECode CreateContext(TChar* tag, TUint is_server, void* p_context, TIPCAgentReadCallBack callback, TU16 native_port = 0, TU16 remote_port = 0) = 0;
virtual void DestroyContext() = 0;
virtual TInt GetHandle() const = 0;
virtual EECode Start() = 0;
virtual EECode Stop() = 0;
virtual EECode Write(TU8* data, TInt size) = 0;
public:
virtual void Destroy() = 0;
};
extern IIPCAgent* gfIPCAgentFactory(EIPCAgentType type);
//-----------------------------------------------------------------------
//
// CIRemoteLogServer
//
//-----------------------------------------------------------------------
class CIRemoteLogServer: public CObject
{
public:
static CIRemoteLogServer* Create();
protected:
CIRemoteLogServer();
virtual ~CIRemoteLogServer();
EECode Construct();
public:
virtual EECode CreateContext(TChar* tag, TU16 native_port = 0, TU16 remote_port = 0);
virtual void DestroyContext();
virtual EECode WriteLog(const TChar* log, ...);
virtual EECode SyncLog();
public:
virtual void Delete();
public:
virtual void Destroy();
private:
IIPCAgent* mpAgent;
private:
CIMutex* mpMutex;
private:
TU16 mPort;
TU16 mRemotePort;
private:
TChar* mpTextBuffer;
TInt mTextBufferSize;
TChar* mpCurrentWriteAddr;
TInt mRemainingSize;
private:
TU8 mbCreateContext;
TU8 mbBufferFull;
TU8 mReserved0;
TU8 mReserved1;
};
//-----------------------------------------------------------------------
//
// CRingMemPool
//
//-----------------------------------------------------------------------
class CRingMemPool: public CObject, public IMemPool
{
typedef CObject inherited;
public:
static IMemPool* Create(TMemSize size);
virtual void Delete();
virtual TU8* RequestMemBlock(TMemSize size, TU8* start_pointer = NULL);
virtual void ReturnBackMemBlock(TMemSize size, TU8* start_pointer);
virtual void ReleaseMemBlock(TMemSize size, TU8* start_pointer);
protected:
CRingMemPool();
EECode Construct(TMemSize size);
virtual ~CRingMemPool();
private:
CIMutex* mpMutex;
CICondition* mpCond;
private:
TU8 mRequestWrapCount;
TU8 mReleaseWrapCount;
TU8 mReserved1;
TU8 mReserved2;
private:
TU8* mpMemoryBase;
TU8* mpMemoryEnd;
TMemSize mMemoryTotalSize;
TU8* volatile mpFreeMemStart;
TU8* volatile mpUsedMemStart;
private:
volatile TU32 mnWaiters;
};
//-----------------------------------------------------------------------
//
// CFixedMemPool
//
//-----------------------------------------------------------------------
class CFixedMemPool: public CObject, public IMemPool
{
typedef CObject inherited;
public:
static IMemPool* Create(const TChar* name, TMemSize size, TUint tot_count);
virtual void Delete();
virtual TU8* RequestMemBlock(TMemSize size, TU8* start_pointer = NULL);
virtual void ReturnBackMemBlock(TMemSize size, TU8* start_pointer);
virtual void ReleaseMemBlock(TMemSize size, TU8* start_pointer);
protected:
CFixedMemPool(const TChar* name);
EECode Construct(TMemSize size, TUint tot_count);
virtual ~CFixedMemPool();
private:
CIMutex* mpMutex;
CICondition* mpCond;
private:
TU8* mpMemoryBase;
TU8* mpMemoryEnd;
TMemSize mMemoryTotalSize;
TU8* volatile mpFreeMemStart;
TU8* volatile mpUsedMemStart;
TMemSize mMemBlockSize;
TU32 mnTotalBlockNumber;
TU32 mnCurrentFreeBlockNumber;
private:
volatile TU32 mnWaiters;
};
//-----------------------------------------------------------------------
//
// CISimplePool
//
//-----------------------------------------------------------------------
typedef struct
{
TU8* p_data;
TMemSize data_size;
} SDataPiece;
class CISimplePool;
typedef struct
{
TInt fd;
TU8 is_closed;
TU8 has_socket_error;
TU8 reserved1;
TU8 reserved2;
SDataPiece* p_cached_datapiece;
CIQueue* data_queue;
IMemPool* ring_pool;
CISimplePool* data_piece_pool;
} STransferDataChannel;
class CISimplePool
{
public:
static CISimplePool* Create(TUint max_count);
void Delete();
public:
void PrintStatus();
protected:
CISimplePool();
EECode Construct(TUint nMaxBuffers);
virtual ~CISimplePool();
public:
bool AllocDataPiece(SDataPiece*& pDataPiece, TUint size);
void ReleaseDataPiece(SDataPiece* pDataPiece);
TUint GetFreeDataPieceCnt() const;
protected:
CIQueue *mpBufferQ;
protected:
TU8 *mpDataPieceStructMemory;
};
DCONFIG_COMPILE_OPTION_HEADERFILE_END
#endif
|
d162a4edc793ab1233dff967a3a01c3946a4863a | fbb9aaf25c1e25e87483f47ea619e0d48d74107e | /2_source_code/cruise_control/configuration/test/cruise_configuration_test.cpp | 4701707a04a3e21e2b4a5c48505ee38b67d63fb5 | [] | no_license | naveen-kummar/cruise_control_system | e9413a75ae706042ee6f8a13a76a12ae2ee1f1e1 | 668ad3b1c31ffecdb1b2ea1dad2f31ea1af05211 | refs/heads/master | 2022-11-23T12:43:51.544460 | 2020-07-27T13:51:33 | 2020-07-27T13:51:33 | 282,911,491 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,629 | cpp | cruise_configuration_test.cpp | /*
* @file cruise_configuration_test.cpp
* @brief Defines test functions to validate configuration manager
*/
#include <gtest/gtest.h>
#include <memory>
#include <string>
#include "pthread.h"
#include "cruise_configuration.h"
using namespace cruise_control;
constexpr int32_t kNullValue{0};
class CruiseConfigurationTest : public ::testing::Test
{
protected:
virtual void SetUp()
{
cruise_config_ =
std::make_unique<CruiseConfiguration>();
}
std::unique_ptr<CruiseConfiguration> cruise_config_;
};
TEST_F(CruiseConfigurationTest, TestDefaultValues)
{
//ACT
cruise_config_->SetDefaultValues();
//ASSERT
EXPECT_EQ(kDefaultMass , cruise_config_->GetParamValue(kVehicleMass));
EXPECT_EQ(kDefaultJerk , cruise_config_->GetParamValue(kParamJerk));
EXPECT_EQ(kDefaultResistanceCoeff , cruise_config_->GetParamValue(kResistanceCoefficient));
EXPECT_EQ(KDefaultDrivingForce , cruise_config_->GetParamValue(kDrivingForce));
EXPECT_EQ(kDefaultSetSpeed , cruise_config_->GetParamValue(kParamSetSpeed));
}
TEST_F(CruiseConfigurationTest, TestNonExistentValue)
{
//ARRANGE
//ACT
try
{
cruise_config_->GetParamValue("Non Existent Parameter");
}
catch(std::invalid_argument const &err)
{
//ASSERT
EXPECT_EQ(std::string{err.what()}, std::string{"Received invalid Parameter request"});
}
catch(...)
{
FAIL() << "Unknow exception while getting parameter value";
}
}
TEST_F(CruiseConfigurationTest, TestErase)
{
//ARRANGE
cruise_config_->SetDefaultValues();
//ASSERT
EXPECT_EQ(kDefaultMass , cruise_config_->GetParamValue(kVehicleMass));
//ACT
cruise_config_->RemoveConfigParam(kVehicleMass);
//ACT
try
{
cruise_config_->GetParamValue(kVehicleMass);
}
catch(std::invalid_argument const &err)
{
//ASSERT
EXPECT_EQ(std::string{err.what()}, std::string{"Received invalid Parameter request"});
}
catch(...)
{
FAIL() << "Unknow exception while getting parameter value";
}
}
TEST_F(CruiseConfigurationTest, TestSetValue)
{
//ARRANGE
cruise_config_->SetDefaultValues();
int32_t test_value{77};
//ASSERT
EXPECT_EQ(kDefaultMass , cruise_config_->GetParamValue(kVehicleMass));
//ACT
cruise_config_->SetParamValue(kVehicleMass, test_value);
//ASSERT
EXPECT_EQ(test_value , cruise_config_->GetParamValue(kVehicleMass));
}
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
|
6029316b5bdbe8a8b8e995789ea16a9f9398c11f | ff3c9c264eed5ea19da08825a4531d9ae975c09c | /tutorial/cpp/exemplos/sobrecarga-vetor2d.cpp | 82804c5fbc942cd4af766d9887300da8676ab52b | [
"MIT"
] | permissive | agostinhobritojr/agostinhobritojr.github.io | a9ca0562aa83679ac94a4232924fdcc5afe24c11 | 2778002c29f1f376adb12ed5f37e18990478a363 | refs/heads/master | 2023-05-26T15:32:39.258165 | 2023-05-22T18:17:35 | 2023-05-22T18:17:35 | 145,466,097 | 3 | 6 | NOASSERTION | 2023-02-01T22:32:39 | 2018-08-20T20:16:50 | HTML | UTF-8 | C++ | false | false | 739 | cpp | sobrecarga-vetor2d.cpp | #include <iostream>
using namespace std;
class Vetor2d{
private:
float x, y;
public:
Vetor2d(float x_=0, float y_=0);
Vetor2d operator+(Vetor2d v);
Vetor2d operator-(Vetor2d v);
Vetor2d operator*(float a);
float operator*(Vetor2d v);
};
Vetor2d::Vetor2d(float x_, float y_){
x=x_; y=y_;
}
Vetor2d Vetor2d::operator+(Vetor2d v){
return(Vetor2d(x+v.x,y+v.y));
}
Vetor2d Vetor2d::operator-(Vetor2d v){
return(Vetor2d(x-v.x,y-v.y));
}
Vetor2d Vetor2d::operator*(float a){
return(Vetor2d(a*x,a*y));
}
float Vetor2d::operator*(Vetor2d v){
return(x*v.x+y*v.y);
}
int main(void){
Vetor2d v1(2,3), v2(-2,5), v3(6,-3), v4(1,1), v5;
float x;
v5 = v1 + v2 - v3*4.0;
x = v5*v4;
cout << "x = " << x << "\n";
}
|
4508eb22b31b7b957c7f4bdc944127bf79dd5107 | 7a7f9ce4bbe1d3e30455afa0b99f237d3d6eebc6 | /P3/uncompress.cpp | f40b0c599fd62a5a99a519774a0cb9c7119a9923 | [
"MIT"
] | permissive | ailyanlu1/c100 | 2c6d345e3261efae87fd2a030d7e8ac29796c88f | e81e5182b452a2bf698d37315791cd2e45f73a6e | refs/heads/master | 2020-03-24T19:51:47.950010 | 2013-10-23T04:27:28 | 2013-10-23T04:27:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,237 | cpp | uncompress.cpp | /*
* P3
* uncompress.cpp
* Main driver for decopmression process
*
* Author: Jay Dey cs100vaj
* Author: Joshua Yuen cs100vbc
*/
#include <fstream>
#include <iostream>
#include "HCTree.hpp"
using namespace std;
int main( int argc, char* argv[] )
{
if( argc != 3 )
{
cerr << "Incorrect arguments." << endl;
cerr << "Usage: ./uncompress infile outfile" << endl;
return 1;
}
cout << "Reading header from file: " << argv[1] << "... ";
vector<int> freq(256);
ifstream in;
in.open( argv[1], ios::binary );
int symbols = 0, bytesize = 0, compsize = 0;
bool empty = true;
unsigned char ch;
int num;
//process file header
if( in.is_open() && in.good() )
{
for( int i=0; i<freq.size(); i++ )
{
in >> num;
//populate vector
freq[i] = num;
//count total bytesize of original file
bytesize = bytesize + num;
}
}
cout << "DONE." << endl;
/* report outfile stats */
for( int i=0; i<freq.size(); i++ )
if( freq[i] != 0 )
{
symbols++;
empty = false;
}
if( symbols == 0 )
empty = true;
cout << "Uncompressed file will have " << symbols << " unique symbols and"
" size " << bytesize << " bytes." << endl;
/* build Huffman tree */
cout << "Building Huffman tree... ";
HCTree tree;
if( !empty )
{
tree.build( freq );
}
cout << "DONE." << endl;
/* Write uncompressed data to outfile */
BitInputStream is = BitInputStream( in );
ofstream out;
out.open( argv[2], ios::binary );
cout << "Writing to file: " << argv[2] << "... ";
if ( !empty )
for( int i=0; i<bytesize; i++ )
{
out << (byte)tree.decode( is );
}
cout << "DONE." << endl;
out.flush();
in.close();
out.close();
in.clear();
in.open( argv[1], ios::binary );
/* infile stats */
while( in.is_open() )
{
ch = in.get();
if( !in.good() ) break;
compsize++;
}
if( !in.eof() )
{
cerr << "There was a problem, sorry." << endl;
return -1;
}
in.close();
double ratio = 0;
if( bytesize != 0 && compsize != 0 )
ratio = (double)bytesize / (double)compsize;
cout << "Uncompression ratio: " << ratio << endl;
return 0;
}
//EOF uncompress.cpp
|
13b137446aa3e33e56f5921d394a80ad29d759d4 | 927918bb14da09c62ba72e05331b2d620c592bc2 | /src/matrices/CSCMatrix.h | 802e8e93d1f3120b0dcb8c7e8647d527af8bb956 | [] | no_license | Alberto42/HPC-Distributed-matrix-multiplication | 15046e25ad5ca33d3c7fda1def60d8d515e9eeeb | e8d2bc3e7000da1ff211d070f6b40d2d3f51fc5b | refs/heads/master | 2020-05-24T08:03:35.533560 | 2019-10-08T08:36:05 | 2019-10-08T08:36:05 | 187,176,015 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 889 | h | CSCMatrix.h | //
// Created by albert on 17.05.19.
//
#ifndef AC370756_CSCMATRIX_H
#define AC370756_CSCMATRIX_H
#include <vector>
#include <fstream>
#include <assert.h>
#include <mpi.h>
using namespace std;
class CSCMatrix {
public:
vector<CSCMatrix> split(int peacesCount);
friend ostream &operator<<(ostream &os, const CSCMatrix &matrix);
CSCMatrix();
CSCMatrix(double *nonzeros, int *extents, int *indices, int n, int m, int count, int maxNonzeroInRow, int offset,
int shiftHorizontal);
double *nonzeros;
int *extents, *indices;
int n, m, count, maxNonzeroInRow, offset, shift;
void sendSync(int dest, const int *tags);
void sendAsync(int dest, const int *tags, MPI_Request *req, MPI_Comm comm);
void receiveSync(int src, const int *tags);
};
CSCMatrix operator>>(istream &stream, CSCMatrix &matrix);
#endif //AC370756_CSCMATRIX_H
|
b3af7a534f3f856e4c0e57f98d6626adbf223dcb | 2e5534832fa885f7f09003ada2d7bf3f236e9f7f | /problem-solver/cxx/modules/soatoClassificationModule/agent/SoatoClassifier.cpp | 5aac9e0d65d528c2bb6137cff9da072f7dce1283 | [
"MIT"
] | permissive | ostis-apps/ostis-geography | 11ff259e2031f70281699cc9549298da1af82f2e | 14fc0930ed6bba3dd0ecf4aca771643ff620e203 | refs/heads/main | 2023-04-07T15:54:48.218802 | 2023-03-16T13:08:48 | 2023-03-16T13:08:48 | 209,274,423 | 2 | 112 | MIT | 2023-09-09T16:20:51 | 2019-09-18T09:51:03 | C++ | UTF-8 | C++ | false | false | 4,350 | cpp | SoatoClassifier.cpp | #include "SoatoClassifier.hpp"
#include <iostream>
#include <vector>
namespace soatoClassificationModule
{
const std::map<int, std::string> SoatoClassifier::firstDigitMap = {
{1, "Брестская область"},
{2, "Витебская область"},
{3, "Гомельская область"},
{4, "Гродненская область"},
{5, "г. Минск"},
{6, "Минская область"},
{7, "Могилевская область"},
};
std::vector<AdministrativeFacility> SoatoClassifier::classify(
const std::vector<std::pair<std::string, std::string>> & soatoCodes) const
{
std::vector<AdministrativeFacility> result;
for (int i = 0; i < soatoCodes.size(); i++)
{
result.push_back(classify(soatoCodes[i]));
}
return result;
};
AdministrativeFacility SoatoClassifier::classify(const std::pair<std::string, std::string> & soatoCode) const
{
AdministrativeFacility facility = AdministrativeFacility(soatoCode.second, soatoCode.first);
std::string code = facility.getCode();
int firstDigit = std::stoi(code.substr(0, 1));
int secondDigit = std::stoi(code.substr(1, 1));
int thirdAndFourthDigits = std::stoi(code.substr(2, 2));
int fifthDigit = std::stoi(code.substr(4, 1));
int sixthAndSeventhDigits = std::stoi(code.substr(5, 2));
int eighthAndNinthAndTenthDigits = std::stoi(code.substr(7, 3));
facility.addCategory(getFirstDigitCategory(firstDigit));
std::string secondCategory = getSecondDigitCategory(firstDigit, secondDigit);
if (!secondCategory.empty())
{
facility.addCategory(secondCategory);
}
std::string fifthSixthSeventhCategory =
getFifthSixthSeventhDigitsCategory(secondDigit, fifthDigit, sixthAndSeventhDigits);
if (!fifthSixthSeventhCategory.empty())
{
facility.addCategory(fifthSixthSeventhCategory);
}
return facility;
};
std::string SoatoClassifier::getFirstDigitCategory(const int & code) const
{
std::string result;
if (firstDigitMap.count(code) == 0)
{
result = "undefined";
}
else
{
result = firstDigitMap.at(code);
}
return result;
}
std::string SoatoClassifier::getSecondDigitCategory(const int & firstDigitCode, const int & secondDigitCode) const
{
std::string result;
if (secondDigitCode == 2)
{
if (firstDigitCode == 5)
{
result = "район г. Минска";
}
else
{
result = "район области";
}
}
else if (secondDigitCode == 4)
{
result = "город областного подчинения";
}
return result;
}
std::string SoatoClassifier::getFifthSixthSeventhDigitsCategory(
const int & secondDigitCode,
const int & fifthDigitCode,
const int & sixthAndSeventhDigitCode) const
{
std::string result;
if (fifthDigitCode == 3)
{
result = "район города областного подчинения";
}
else if (fifthDigitCode == 5)
{
if (sixthAndSeventhDigitCode >= 1 && sixthAndSeventhDigitCode <= 49)
{
result = "город районного подчинения";
}
else if (sixthAndSeventhDigitCode >= 50 && sixthAndSeventhDigitCode <= 99)
{
if (secondDigitCode == 2)
{
result = "поселок городского типа районного подчинения";
}
else if (secondDigitCode == 4)
{
result = "поселок городскоготипа, подчиненный городу областного подчинения";
}
}
}
else if (fifthDigitCode == 7)
{
if (sixthAndSeventhDigitCode == 0)
{
result = "сельский населенный пункт районного подчинения";
}
else if (sixthAndSeventhDigitCode >= 1 && sixthAndSeventhDigitCode <= 49)
{
if (secondDigitCode == 2)
{
result = "сельский населенный пункт, подчиненный городу районного подчинения";
}
else if (secondDigitCode == 4)
{
result = "сельский населенный пункт, подчиненный городу областного подчинения";
}
}
}
else if (fifthDigitCode == 8)
{
result = "сельсовет";
}
return result;
}
} // namespace soatoClassificationModule
|
5372f7feb3c6bd1d5d45d9d7ba61816cda4c4e61 | 33392bbfbc4abd42b0c67843c7c6ba9e0692f845 | /sparse/L2/include/sw/fp32/L2_definitions.hpp | 5e522eb24c835c13c05edd9ae33561601559f6cd | [
"OFL-1.1",
"BSD-3-Clause",
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | permissive | Xilinx/Vitis_Libraries | bad9474bf099ed288418430f695572418c87bc29 | 2e6c66f83ee6ad21a7c4f20d6456754c8e522995 | refs/heads/main | 2023-07-20T09:01:16.129113 | 2023-06-08T08:18:19 | 2023-06-08T08:18:19 | 210,433,135 | 785 | 371 | Apache-2.0 | 2023-07-06T21:35:46 | 2019-09-23T19:13:46 | C++ | UTF-8 | C++ | false | false | 2,753 | hpp | L2_definitions.hpp | /*
* Copyright 2019 Xilinx, 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.
*/
/**
* @file L2_definitions.hpp
* @brief common definitions used in host coce.
*
* This file is part of Vitis SPARSE Library.
*/
#ifndef XF_SPARSE_L2_DEFINITIONS_HPP
#define XF_SPARSE_L2_DEFINITIONS_HPP
#include "gen_cscmv.hpp"
#include "mtxFile.hpp"
#include "interpreters.hpp"
namespace xf {
namespace sparse {
static const unsigned int SPARSE_dataSz = sizeof(SPARSE_dataType);
static const unsigned int SPARSE_idxSz = sizeof(SPARSE_indexType);
static const unsigned int SPARSE_NnzRowIdxMemWords = SPARSE_hbmMemBits / (8 * SPARSE_dataSz);
static const unsigned int SPARSE_ColVecMemWords = SPARSE_ddrMemBits / (8 * SPARSE_dataSz);
static const unsigned int SPARSE_NnzPtrMemWords = SPARSE_ddrMemBits / (8 * SPARSE_idxSz);
static const unsigned int SPARSE_ddrPtrSz = SPARSE_ddrMemBits * SPARSE_dataSz / SPARSE_dataBits;
static const unsigned int SPARSE_hbmPtrSz = SPARSE_hbmMemBits * SPARSE_dataSz / SPARSE_dataBits;
static const unsigned int SPARSE_paramPtrSz = 4;
static const unsigned int SPARSE_maxCols = SPARSE_maxColParBlocks * SPARSE_parEntries;
static const unsigned int SPARSE_maxRows = SPARSE_maxRowBlocks * SPARSE_parEntries * SPARSE_parGroups;
// common types
typedef NnzUnit<SPARSE_dataType, SPARSE_indexType> NnzUnitType;
typedef MtxFile<SPARSE_dataType, SPARSE_indexType> MtxFileType;
typedef Program<SPARSE_pageSize> ProgramType;
typedef RunConfig<SPARSE_dataType,
SPARSE_indexType,
SPARSE_parEntries,
SPARSE_parGroups,
SPARSE_ddrMemBits,
SPARSE_hbmMemBits,
SPARSE_hbmChannels,
SPARSE_paramOffset,
SPARSE_pageSize>
RunConfigType;
typedef ColVec<SPARSE_dataType, SPARSE_ddrMemBits> ColVecType;
typedef MatCsc<SPARSE_dataType, SPARSE_indexType, SPARSE_pageSize> MatCscType;
typedef GenMatCsc<SPARSE_dataType, SPARSE_indexType> GenMatCscType;
typedef GenVec<SPARSE_dataType, SPARSE_ddrMemBits, SPARSE_pageSize> GenVecType;
typedef CscRowInt<SPARSE_dataType, SPARSE_indexType, SPARSE_parEntries, SPARSE_parGroups> CscRowIntType;
} // end namespace sparse
} // end namespace xf
#endif
|
1744a00d30ea57c432787eb529092187391d5724 | b7e44e71d7b2e5dd977e364c1c4f4a027c34fc41 | /src/libs/prediction.hpp | 2aa0fcb1b601ea1731d0fce78a8f068cfa6ef5be | [
"MIT"
] | permissive | ronaldpereira/content-based-movie-recommendation | 9e3c2a387a5a32e801f43b968b385d3dee33aca5 | 4113e262ea85be0210373000ec7d2692d92f834b | refs/heads/master | 2020-05-20T17:58:21.615077 | 2019-06-05T17:12:52 | 2019-06-05T17:12:52 | 185,698,310 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 379 | hpp | prediction.hpp | #ifndef PREDICTION
#define PREDICTION
#include <cmath>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstring>
#include "useritem.hpp"
#include "content.hpp"
#include "rocchio.hpp"
class Prediction
{
private:
double makePrediction(int, int, UserItem *, Content *, Rocchio *);
public:
void GetPredictions(char *, UserItem *, Content *);
};
#endif
|
e0dc8df62d69954410bb3595adbb080ee85a3168 | bf58e480ac00742e3da9538f9e8044fb97243738 | /BrainSTL/UserMemFunRef.cpp | 72a4f51259e7da30b0c2100a622d4f18de47dbbe | [] | no_license | mesikkera/DailyCoding | ba319560ef08cbbda4139f60a07ba6ba07914b08 | 2663068a85aa205d80512f94d2badee88a4f9210 | refs/heads/master | 2023-03-10T10:12:47.725338 | 2022-06-13T08:52:06 | 2022-06-13T08:52:06 | 43,902,184 | 2 | 0 | null | 2023-03-01T13:19:29 | 2015-10-08T16:27:07 | C++ | UTF-8 | C++ | false | false | 566 | cpp | UserMemFunRef.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template<typename RType, typename CType>
class Mem_fun_ref_class: public unary_function<CType, RType>
{
RType (CType::*pf)() const;
public:
Mem_fun_ref_class(RType (CType::*_pf)() const):pf(_pf) {}
RType operator()(const CType& o) const
{
return (o.*pf)();
}
};
// 어댑터 함수: 멤버 함수를 주소를 저장하는 함수 객체를 반환
template<typename RType, typename CType>
Mem_fun_ref_class<RType, CType> Mem_fun_ref(RType (CType::*pf) {}
|
50fda9a358395cf55dc58bb2825386c192b2e94f | e701f27376df41fab37bbdc6d1cf00d62c262952 | /MP - Práctica 1/src/Empresa.cpp | 4eac876c0ccbe71262541afa4fe55c84423d7a58 | [] | no_license | manoplin18/Segundo | 199f942d69c9a96690b73cb007a855aee4808409 | 3b518f2c3d3696f4c77fd7577d93f8f78fee35ef | refs/heads/main | 2023-02-01T08:28:43.067760 | 2020-12-20T19:51:50 | 2020-12-20T19:51:50 | 322,630,645 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,655 | cpp | Empresa.cpp | #include "Empresa.h"
Empresa::Empresa():nmaxcli(100), nmaxcon(100){
this->ncli = 0;
this->ncon = 0;
this->nmaxcon = 10;
this->contratos = new Contrato *[nmaxcon]; //Capacidad para 10 contratos
}
Empresa::~Empresa(){
for(int i = 0; i < this->ncon; i++)
delete this->contratos[i]; // elimino los objetos contratos
delete [] this->contratos; //luego elimino el array de punteros
for(int i = 0; i < this->ncli; i++)
delete this->clientes[i]; // elimino los objetos clientes
}
int Empresa::altaCliente(Cliente *c) {
int pos = -1;
if(this->ncli < nmaxcli){
this->clientes[this->ncli] = c;
pos = this->ncli;
this->ncli++;
}
else
cout << "Lo siento, el cupo de clientes esta lleno";
return pos;
}
int Empresa::altaContrato(Contrato *c) {
int pos = -1;
if(this->ncon < nmaxcon){
this->contratos[this->ncon] = c;
pos = this->ncon;
this->ncon++;
}
else
cout << "Lo siento, el cupo de contratos esta lleno";
return pos;
}
int Empresa::buscarCliente(long int dni) const {
for(int i = 0; i < this->ncli; i++){
if(this->clientes[i]->getDni() == dni){
return i; // una vez encuentre una coincidencia parara el bucle y devuelve la pos
}
}
return -1; // si no encuentra coincidencia saldra del bucle y devuelve -1
}
void Empresa::crearContrato() {
long int dni;
int pos;
cout << "\nIntroduce DNI: ";
cin >> dni;
pos=this->buscarCliente(dni); // guardamos la pos del cliente (pos = -1 si no existe)
int dia,mes,anio; //reutilizo las variables para optimizar (1) (2)
if(pos == -1){ //creo el cliente si es nuevo usuario
char nombre[100];
Cliente *c;
cout << "\nIntroduce Nombre: ";
cin.ignore();
cin.getline(nombre, 100);
cout << "\nIntroduce Fecha (dd mm aaaa): ";
cin >> dia >> mes >> anio; //(1)
c = new Cliente(dni, nombre, Fecha(dia,mes,anio));
pos = this->altaCliente(c);
}
if(pos != -1){ //creo un contrato para el usuario nuevo o no
int tipo, min;
Fecha fc;
cout << "\nTipo de Contrato a abrir(1-Tarifa Plana, 2-Movil): ";
cin >> tipo;
cout << "\nIntroduce Fecha (dd mm aaaa): ";
cin >> dia >> mes >> anio; //(2) machaco valores anteriores
fc.setFecha(dia,mes,anio);
cout << "\nMinutos hablados: ";
cin >> min;
if(tipo == 2){ //datos extras para ContratoMovil
float p;
char nac[100];
cout << "\nPrecio minuto: ";
cin >> p;
cout << "\nNacionalidad: ";
cin >> nac;
Contrato *cM = new ContratoMovil(dni,fc,p,min,nac);
this->altaContrato(cM);
}
else{ //Creo contrato de Tarifa Plana
Contrato *cTP = new ContratoTP(dni,fc,min);
this->altaContrato(cTP);
}
}
}
void Empresa::cargarDatos(){
Fecha f1(29,2,2001), f2(31,1,2002), f3(1,2,2002);
Cliente *cl1 = new Cliente(75547001, "Peter Lee", f1);
Cliente *cl2 = new Cliente(45999000, "Juan Perez", f2);
Cliente *cl3 = new Cliente(37000017, "Luis Bono", f3);
this->altaCliente(cl1);
this->altaCliente(cl2);
this->altaCliente(cl3);
Contrato *c1 = new ContratoMovil(75547001, f1, 0.12, 110, "DANES"); //habla 110m a 0.12€/m
Contrato *c2 = new ContratoMovil(75547001, f2, 0.09, 170, "DANES"); //habla 170m a 0.09€/m
Contrato *c3 = new ContratoTP(37000017, f3, 250); //habla 250m (300m a 10€, exceso 0.15€/m)
Contrato *c4 = new ContratoTP(75547001, f1, 312); //habla 312m (300m a 10€, exceso 0.15€/m)
Contrato *c5 = new ContratoMovil(45999000, f2, 0.10, 202, "ESPANIOL"); //habla 202m a 0.10/m
Contrato *c6 = new ContratoMovil(75547001, f2, 0.15, 80, "DANES"); //habla 80m a 0.15€/m
Contrato *c7 = new ContratoTP(45999000, f3, 400); //habla 400m (300m a 10€, exceso 0.15€/m)
this->altaContrato(c1);
this->altaContrato(c2);
this->altaContrato(c3);
this->altaContrato(c4);
this->altaContrato(c5);
this->altaContrato(c6);
this->altaContrato(c7);
}
bool Empresa::cancelarContrato(int idContrato){
for(int i = 0; i < this->ncli; i++){
if(this->contratos[i]->getIdContrato() == idContrato){
while( i < this->ncon){
this->contratos[i] = this->contratos[i+1];
i++;
}
this->ncon--;
return true;
}
}
return false;
}
bool Empresa::bajaCliente(long int dni){
int pos = Empresa::buscarCliente(dni);
if(pos != -1){
while( pos < this->ncli){
this->clientes[pos] = this->clientes[pos+1];
pos++; // baja del cliente
}
this->ncli--;
int i = 0;
while( i < ncon){
if(this->contratos[i]->getDniContrato() == dni ){ //busco todos los contratos que pertenezcan al mismo cliente (dni)
Empresa::cancelarContrato(this->contratos[i]->getIdContrato()); //cancelo los contratos del cliente
}else
i++;
}
return true;
}
else
return false;
}
int Empresa::nContratosTP() const{
int nContratos = 0;
for(int i = 0; i < this->ncon; i++){
if(typeid(*contratos[i]) == typeid(ContratoTP)){ // True si el tipo de contrato de contratos[i] es TP
nContratos++;
}
}
return nContratos;
}
int Empresa::descuento(float descuento) const {
int nDescuentos = 0;
ContratoMovil *c;
for (int i = 0; i < ncon; i++){
//c = dynamic_cast<ContratoMovil*>(contratos[i]);
c = (ContratoMovil*)contratos[i]; // son lo mismo
if(c){
c->setPrecioMinuto(c->getPrecioMinuto()*(1-descuento/100));
nDescuentos++;
}
}
return nDescuentos;
}
void Empresa::ver() const {
cout << "\nLa Empresa tiene " << ncli << " clientes y " << ncon << " contratos";
cout << "\nClientes: ";
for(int i = 0; i < ncli; i++){
cout << "\n";
clientes[i]->ver();
}
cout << "\n\nContratos: ";
for(int i = 0; i < ncon; i++){
cout << "\n";
contratos[i]->ver();
}
} |
d992cf47badbb2cb0ed490815249fa230ff6dd0f | f491daea3ff53f7d7c9941cfbf45e7b2c231b4f6 | /isomorphic.cpp | 4011af4727e7870568501faba3351fecab724db5 | [] | no_license | outman119/leetcode | 295015ae25d19af02a1b0305e7fe9597dae54686 | 9b6544143552c00f8b676515079ce62486537f5c | refs/heads/master | 2020-04-29T23:27:50.132403 | 2015-07-06T06:15:25 | 2015-07-06T06:15:25 | 28,943,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 713 | cpp | isomorphic.cpp | class Solution {
public:
bool isIsomorphic(string s, string t) {
int len1 = s.length();
int len2 = t.length();
if (len1 != len2)
{
return false;
}
map<char, char>mm;
map<char, char>mn;
for (int i = 0; i < len1; i++)
{
auto sc = s[i];
auto tc = t[i];
if (mm.find(sc) != mm.end() && mm[sc] != tc)
{
return false;
}
if (mn.find(tc) != mn.end() && mn[tc] != sc)
{
return false;
}
mm[sc] = tc;
mn[tc] = sc;
}
return true;
}
};
|
d87c9b4a2b46c5cfcad844ec86d14fa662de3b66 | 61b379202c3804706b93dc0968317dca411fed6f | /TAP/tap2013/sol/h_leo.cpp | 7cea981cc184ee404fa6bcb2d638dce1c703d51f | [] | no_license | johny65/acm | ef311e7ad215cea324d57e507fe5c7cde4804071 | 3f1424ac02473a25345b26d01200f07341845f53 | refs/heads/master | 2020-08-03T00:44:42.129764 | 2019-09-28T22:28:01 | 2019-09-28T22:28:01 | 211,568,939 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,097 | cpp | h_leo.cpp | #include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define dforn(i,n) for(int i=(int)n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define MAXN (1<<20)
using namespace std;
int next[MAXN];
int K[MAXN];
int res[MAXN][16];
int main()
{
forn(i,MAXN)
next[i] = 0;
for(int i=2;i<MAXN;i++)
if(next[i] == 0)
{
for(int j=2*i;j<MAXN;j+=i)
next[j] += i;
}
memset(res,0,sizeof(res));
forn(i,MAXN)
if(next[i]==0)
{
res[i][1] = 1;
K[i] = 1;
}
else
{
res[i][K[next[i]]+1] = 1;
K[i] = K[next[i]]+1;
}
forn(i,16)
for(int j=1;j<MAXN;j++)
res[j][i] += res[j-1][i];
int p, a, b, k;
cin >> p;
forn(i,p)
{
cin >> a >> b >> k;
if (k < 16) cout << res[b][k]-res[a-1][k] << endl;
else cout << 0 << endl;
}
}
|
450ea04566e08a0c45bfa1f1caa1297f0b929597 | 995c731cfbc26aaa733835eebaa6fcb0787f0081 | /gazebo-5.3.0/gazebo/gui/RenderWidget.cc | 6d34a948b64ae66e90542c5f46daa8195ca1b314 | [
"Apache-2.0"
] | permissive | JdeRobot/ThirdParty | 62dd941a5164c28645973ef5db7322be72e7689e | e4172b83bd56e498c5013c304e06194226f21c63 | refs/heads/master | 2022-04-26T18:26:51.263442 | 2022-03-19T09:22:14 | 2022-03-19T09:22:14 | 33,551,987 | 7 | 9 | null | 2022-03-19T09:22:14 | 2015-04-07T15:36:00 | C++ | UTF-8 | C++ | false | false | 11,645 | cc | RenderWidget.cc | /*
* Copyright (C) 2012-2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <iomanip>
#include "gazebo/rendering/UserCamera.hh"
#include "gazebo/rendering/RenderingIface.hh"
#include "gazebo/rendering/Scene.hh"
#include "gazebo/gui/GuiPlugin.hh"
#include "gazebo/gui/Actions.hh"
#include "gazebo/gui/GuiIface.hh"
#include "gazebo/gui/GLWidget.hh"
#include "gazebo/gui/GuiEvents.hh"
#include "gazebo/gui/TimePanel.hh"
#include "gazebo/gui/RenderWidget.hh"
#include "gazebo/gui/building/BuildingEditorWidget.hh"
using namespace gazebo;
using namespace gui;
/////////////////////////////////////////////////
RenderWidget::RenderWidget(QWidget *_parent)
: QWidget(_parent)
{
this->setObjectName("renderWidget");
this->show();
this->clear = false;
this->create = false;
QVBoxLayout *mainLayout = new QVBoxLayout;
this->mainFrame = new QFrame;
this->mainFrame->setFrameShape(QFrame::NoFrame);
this->mainFrame->show();
QVBoxLayout *frameLayout = new QVBoxLayout;
QFrame *toolFrame = new QFrame;
toolFrame->setObjectName("toolFrame");
toolFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
this->toolbar = new QToolBar;
QHBoxLayout *toolLayout = new QHBoxLayout;
toolLayout->setContentsMargins(0, 0, 0, 0);
QActionGroup *actionGroup = new QActionGroup(toolFrame);
actionGroup->addAction(g_arrowAct);
actionGroup->addAction(g_translateAct);
actionGroup->addAction(g_rotateAct);
actionGroup->addAction(g_scaleAct);
actionGroup->addAction(g_snapAct);
this->toolbar->addAction(g_arrowAct);
this->toolbar->addAction(g_translateAct);
this->toolbar->addAction(g_rotateAct);
this->toolbar->addAction(g_scaleAct);
this->toolbar->addSeparator();
this->toolbar->addAction(g_boxCreateAct);
this->toolbar->addAction(g_sphereCreateAct);
this->toolbar->addAction(g_cylinderCreateAct);
this->toolbar->addSeparator();
this->toolbar->addAction(g_pointLghtCreateAct);
this->toolbar->addAction(g_spotLghtCreateAct);
this->toolbar->addAction(g_dirLghtCreateAct);
this->toolbar->addSeparator();
this->toolbar->addAction(g_screenshotAct);
this->toolbar->addSeparator();
this->toolbar->addAction(g_copyAct);
this->toolbar->addAction(g_pasteAct);
this->toolbar->addSeparator();
QToolButton *alignButton = new QToolButton;
alignButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
alignButton->setIcon(QIcon(":/images/align.png"));
alignButton->setToolTip(
tr("In Selection Mode, hold Ctrl and select 2 objects to align"));
alignButton->setArrowType(Qt::NoArrow);
QMenu *alignMenu = new QMenu(alignButton);
alignMenu->addAction(g_alignAct);
alignButton->setMenu(alignMenu);
alignButton->setPopupMode(QToolButton::InstantPopup);
g_alignButtonAct = this->toolbar->addWidget(alignButton);
connect(alignButton, SIGNAL(pressed()), g_alignAct, SLOT(trigger()));
this->toolbar->addSeparator();
this->toolbar->addAction(g_snapAct);
toolLayout->addSpacing(10);
toolLayout->addWidget(this->toolbar);
toolFrame->setLayout(toolLayout);
this->glWidget = new GLWidget(this->mainFrame);
rendering::ScenePtr scene = rendering::create_scene(gui::get_world(), true);
this->buildingEditorWidget = new BuildingEditorWidget(this);
this->buildingEditorWidget->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Expanding);
this->buildingEditorWidget->hide();
this->msgOverlayLabel = new QLabel(this->glWidget);
this->msgOverlayLabel->setStyleSheet(
"QLabel { background-color : white; color : gray; }");
this->msgOverlayLabel->setVisible(false);
QHBoxLayout *bottomPanelLayout = new QHBoxLayout;
TimePanel *timePanel = new TimePanel(this);
this->bottomFrame = new QFrame;
this->bottomFrame->setObjectName("renderBottomFrame");
this->bottomFrame->setSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Minimum);
bottomPanelLayout->addWidget(timePanel, 0);
bottomPanelLayout->setSpacing(0);
bottomPanelLayout->setContentsMargins(0, 0, 0, 0);
this->bottomFrame->setLayout(bottomPanelLayout);
QFrame *render3DFrame = new QFrame;
render3DFrame->setObjectName("render3DFrame");
QVBoxLayout *render3DLayout = new QVBoxLayout;
render3DLayout->addWidget(toolFrame);
render3DLayout->addWidget(this->glWidget);
render3DLayout->setContentsMargins(0, 0, 0, 0);
render3DLayout->setSpacing(0);
render3DFrame->setLayout(render3DLayout);
QSplitter *splitter = new QSplitter(this);
splitter->addWidget(this->buildingEditorWidget);
splitter->addWidget(render3DFrame);
QList<int> sizes;
sizes.push_back(300);
sizes.push_back(300);
splitter->setSizes(sizes);
splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 1);
splitter->setOrientation(Qt::Vertical);
frameLayout->addWidget(splitter);
frameLayout->addWidget(this->bottomFrame);
frameLayout->setContentsMargins(0, 0, 0, 0);
frameLayout->setSpacing(0);
this->mainFrame->setLayout(frameLayout);
this->mainFrame->layout()->setContentsMargins(0, 0, 0, 0);
mainLayout->addWidget(this->mainFrame);
this->setLayout(mainLayout);
this->layout()->setContentsMargins(0, 0, 0, 0);
this->connections.push_back(
gui::Events::ConnectFollow(
boost::bind(&RenderWidget::OnFollow, this, _1)));
// Load all GUI Plugins
std::string filenames = getINIProperty<std::string>(
"overlay_plugins.filenames", "");
std::vector<std::string> pluginFilenames;
// Split the colon separated libraries
boost::split(pluginFilenames, filenames, boost::is_any_of(":"));
// Load each plugin
for (std::vector<std::string>::iterator iter = pluginFilenames.begin();
iter != pluginFilenames.end(); ++iter)
{
// Make sure the string is not empty
if (!(*iter).empty())
{
// Try to create the plugin
gazebo::GUIPluginPtr plugin = gazebo::GUIPlugin::Create(*iter, *iter);
if (!plugin)
{
gzerr << "Unable to create gui overlay plugin with filename["
<< *iter << "]\n";
}
else
{
gzlog << "Loaded GUI plugin[" << *iter << "]\n";
// Set the plugin's parent and store the plugin
plugin->setParent(this->glWidget);
this->plugins.push_back(plugin);
}
}
}
}
/////////////////////////////////////////////////
RenderWidget::~RenderWidget()
{
delete this->glWidget;
this->glWidget = NULL;
delete this->toolbar;
this->toolbar = NULL;
}
/////////////////////////////////////////////////
void RenderWidget::update()
{
if (this->clear)
{
rendering::remove_scene(this->clearName);
this->clear = false;
return;
}
else if (this->create)
{
rendering::create_scene(this->createName, true);
this->create = false;
return;
}
rendering::UserCameraPtr cam = this->glWidget->GetCamera();
if (!cam || !cam->GetInitialized())
{
event::Events::preRender();
return;
}
// float fps = cam->GetAvgFPS();
// int triangleCount = cam->GetTriangleCount();
// math::Pose pose = cam->GetWorldPose();
// std::ostringstream stream;
// stream << std::fixed << std::setprecision(2) << pose.pos.x;
// this->xPosEdit->setText(tr(stream.str().c_str()));
// stream.str("");
// stream << std::fixed << std::setprecision(2) << pose.pos.y;
// this->yPosEdit->setText(tr(stream.str().c_str()));
// stream.str("");
// stream << std::fixed << std::setprecision(2) << pose.pos.z;
// this->zPosEdit->setText(tr(stream.str().c_str()));
// stream.str("");
// stream << std::fixed << std::setprecision(2)
// << GZ_RTOD(pose.rot.GetAsEuler().x);
// this->rollEdit->setText(tr(stream.str().c_str()));
// stream.str("");
// stream << std::fixed << std::setprecision(2)
// << GZ_RTOD(pose.rot.GetAsEuler().y);
// this->pitchEdit->setText(tr(stream.str().c_str()));
// stream.str("");
// stream << std::fixed << std::setprecision(2)
// << GZ_RTOD(pose.rot.GetAsEuler().z);
// this->yawEdit->setText(tr(stream.str().c_str()));
// stream.str("");
/*stream << std::fixed << std::setprecision(1) << fps;
this->fpsEdit->setText(tr(stream.str().c_str()));
stream.str("");
stream << std::fixed << std::setprecision(2) << triangleCount;
this->trianglesEdit->setText(tr(stream.str().c_str()));
*/
this->glWidget->update();
}
/////////////////////////////////////////////////
void RenderWidget::ShowEditor(bool _show)
{
if (_show)
{
this->buildingEditorWidget->show();
this->baseOverlayMsg = "Building is view-only";
this->OnClearOverlayMsg();
this->bottomFrame->hide();
this->ShowToolbar(false);
}
else
{
this->buildingEditorWidget->hide();
this->baseOverlayMsg = "";
this->OnClearOverlayMsg();
this->bottomFrame->show();
this->ShowToolbar(true);
}
}
/////////////////////////////////////////////////
void RenderWidget::RemoveScene(const std::string &_name)
{
this->clear = true;
this->clearName = _name;
}
/////////////////////////////////////////////////
void RenderWidget::CreateScene(const std::string &_name)
{
this->create = true;
this->createName = _name;
}
/////////////////////////////////////////////////
void RenderWidget::DisplayOverlayMsg(const std::string &_msg, int _duration)
{
std::string msg = this->baseOverlayMsg.empty() ? _msg
: this->baseOverlayMsg + "\n" + _msg;
this->msgOverlayLabel->setText(tr(msg.c_str()));
if (msg.empty())
{
this->msgOverlayLabel->setVisible(false);
return;
}
this->msgOverlayLabel->resize(
this->msgOverlayLabel->fontMetrics().width(tr(msg.c_str())),
this->msgOverlayLabel->fontMetrics().height());
this->msgOverlayLabel->setVisible(true);
if (_duration > 0)
QTimer::singleShot(_duration, this, SLOT(OnClearOverlayMsg()));
}
/////////////////////////////////////////////////
std::string RenderWidget::GetOverlayMsg() const
{
return this->msgOverlayLabel->text().toStdString();
}
/////////////////////////////////////////////////
void RenderWidget::ShowToolbar(const bool _show)
{
if (this->toolbar)
{
if (_show)
{
this->toolbar->show();
}
else
{
this->toolbar->hide();
}
}
}
/////////////////////////////////////////////////
QToolBar *RenderWidget::GetToolbar() const
{
return this->toolbar;
}
/////////////////////////////////////////////////
void RenderWidget::OnClearOverlayMsg()
{
this->DisplayOverlayMsg("");
}
/////////////////////////////////////////////////
void RenderWidget::OnFollow(const std::string &_modelName)
{
if (_modelName.empty())
{
g_translateAct->setEnabled(true);
g_rotateAct->setEnabled(true);
}
else
{
g_translateAct->setEnabled(false);
g_rotateAct->setEnabled(false);
}
}
/////////////////////////////////////////////////
void RenderWidget::AddPlugin(GUIPluginPtr _plugin, sdf::ElementPtr _elem)
{
// Set the plugin's parent and store the plugin
_plugin->setParent(this->glWidget);
this->plugins.push_back(_plugin);
// Load the plugin.
_plugin->Load(_elem);
_plugin->show();
}
|
7224abfff1e85e76b7583e7bbef0570afc623ff6 | 0cef5168801e49b6b1fad3b77eaa3b69de1ab06a | /src/material/diffuselight.h | ab72626f1ac56ce1ac05f8d0d25336f40b37b84a | [
"MIT"
] | permissive | cualquiercosa327/sim-rt | 825046458989c1e56d2d790b3654d19d72bdfaaf | 7d41156c2ccace775ff6a2f48d7b5f49a6453f04 | refs/heads/master | 2021-01-26T16:04:08.238381 | 2019-09-26T07:17:45 | 2019-09-26T07:17:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 938 | h | diffuselight.h | #ifndef DIFFUSE_LIGHT_H
#define DIFFUSE_LIGHT_H
#include "imaterial.h"
#include "texture/itexture.h"
namespace rt {
/**
* a diffuse light emits light but doesn't scatter light
*/
class DiffuseLight : public IMaterial {
public:
DiffuseLight(std::shared_ptr<ITexture> texture) : m_emit(texture) {}
/**
* determines the scattered ray and the attenuation
* of light after hitting the surface of the object
*/
virtual bool scatter(const ray& rIn, const HitRecord& rec, vec3& attenuation, ray& scattered) const override {
return false;
}
/**
* returns the emitted light of this material
* @param u - the horizontal coordinate
* @param v - the vertical coordinate
* @return color for the position (u,v)
*/
virtual vec3 emitted(float u, float v, const vec3& lp) const override {
return m_emit->value(u, v, lp);
}
private:
std::shared_ptr<ITexture> m_emit;
};
}
#endif//DIFFUSE_LIGHT_H |
17a82c646d8ad593e8444152c2fce152414dcc23 | 4f431921bbb0247f848ec3ddf612a217e622c888 | /Project1/src/Sphere.h | fa224e5891de8b4001ab0318893d583a23b5a243 | [] | no_license | Wlodder/PartcleSystem | 22611dc6a26bb042f2dec62511a27425dc2289ff | e4725c42440c993506ba23f0e05f4231cd0ff02b | refs/heads/master | 2023-03-13T07:32:32.267695 | 2021-03-06T21:42:41 | 2021-03-06T21:42:41 | 345,195,124 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,679 | h | Sphere.h | #include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtx/norm.hpp>
#include <cfloat>
#include <cmath>
#include <iostream>
#include "Particle.hpp"
#include "ParticleEmitter.hpp"
class Sphere
{
// (x - x1)^2 + (y - y1)^2 + (z - z1)^2 = r^2
glm::vec3 pos;
float radius;
float dampening = 0.5;
const float M_SQRT1_2 = 0.707106781186547524401;
public:
Sphere(float x, float y, float z, float r) : pos(x, y, z), radius(r) {} ;
bool operator<=(const Particle& particle) {
// Sort in reverse order : far particles drawn first.
return (pos.x - particle.pos.x) * (pos.x - particle.pos.x)
+ (pos.y - particle.pos.y) * (pos.y - particle.pos.y)
+ (pos.z - particle.pos.z) * (pos.z - particle.pos.z) > radius * radius;
}
// bounce particle off plane
void bounce(Particle& particle, float delta)
{
glm::fquat q;
// axis of rotation = point of collision = particle position
glm::vec3 axis = particle.pos;
// only if pos == origin
axis *= M_SQRT1_2 / radius;
q[0] = axis[0];
q[1] = axis[1];
q[2] = axis[2];
q[3] = M_SQRT1_2;
// reset position to not get stuck in sphere
particle.pos = particle.pos - particle.velocity * delta;
// random float for roughness of surface of inside of globe
particle.velocity = (vec3)(abs(Random::Float()), abs(Random::Float()),abs(Random::Float())) + q * particle.velocity * glm::conjugate(q);
// if below the plane of bounce -> inside the sphere -> *-1
particle.velocity *= -1.0;
particle.velocity *= dampening;
}
void setRadius(float r)
{
radius = r;
}
void setDampening(float _dampening)
{
dampening = _dampening;
}
};
|
8975d2dbf585bee30659d8827283e2a1e10b0f15 | ac256d7a38b80de3688a97afe63ad128bffb6e89 | /src/effects/noise/OceanNoiseEffect.h | d67afb46a3aefd943ff1b99ee2d47f7af0ce9be8 | [] | no_license | exirous/GyverLampCpp | a57b45db555401143a45637de7a99e0f5f81cc02 | cfcd38e500b635c90510bd5be219e90b7cc3a2e0 | refs/heads/master | 2020-12-29T16:24:31.413741 | 2020-02-28T19:48:36 | 2020-02-28T19:48:36 | 238,669,017 | 0 | 0 | null | 2020-02-06T11:04:32 | 2020-02-06T11:04:31 | null | UTF-8 | C++ | false | false | 201 | h | OceanNoiseEffect.h | #pragma once
#include "effects/noise/NoiseEffect.h"
class OceanNoiseEffect : public NoiseEffect
{
public:
OceanNoiseEffect();
Effect* clone() const { return new OceanNoiseEffect(*this); }
};
|
549d848835c78d658627e11d4dcec7e49056f0e6 | 76535dcf8d5633f0d58d11eb1b01de64d4b2e792 | /test/uri_parse_test.cc | 6027b016abdab3e8bdb701cbb26c1ef91b39b60e | [
"MIT"
] | permissive | hfuj13/lwsock | f0703851ffe1574c8da944b8d472acf1e3b7e478 | 2157a0f1c34ca86cefe3129a23802023af1cdd02 | refs/heads/main | 2022-11-05T09:36:14.941602 | 2022-07-23T11:39:52 | 2022-07-23T11:39:52 | 78,430,799 | 17 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 7,948 | cc | uri_parse_test.cc | #include "gtest/gtest.h"
#include "lwsock.hpp"
using namespace std;
using namespace lwsock;
TEST(URI_PARSE, split_hostport_pathquery)
{
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[1234:abcd:1234:1234:1234:1234:1234:1234]/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[1234:abcd:1234:1234:1234:1234:1234:1234]", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://1234:abcd:1234:1234:1234:1234:1234:1234");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("1234:abcd:1234:1234:1234:1234:1234:1234", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://1234:abcd:1234:1234:1234:1234:1234:1234/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("1234:abcd:1234:1234:1234:1234:1234:1234", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://aa.bb.cc.dd:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://aa.bb.cc.dd:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://aa.bb.cc.dd:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://aa.bb.cc.dd/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://aa.bb.cc.dd/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://aa.bb.cc.dd");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("aa.bb.cc.dd", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://192.168.0.1:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://192.168.0.1:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://192.168.0.1:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://192.168.0.1/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://192.168.0.1/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://192.168.0.1");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("192.168.0.1", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[::]:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://[::]:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://[::]:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[::]/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://[::]/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://[::]");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::]", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://::/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://::");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[::].0.0.0.0:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::].0.0.0.0:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://[::].0.0.0.0:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::].0.0.0.0:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://[::].0.0.0.0:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::].0.0.0.0:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://[::].0.0.0.0/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::].0.0.0.0", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://[::].0.0.0.0");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("[::].0.0.0.0", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://::.0.0.0.0:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://::.0.0.0.0:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://::.0.0.0.0:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0:100", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://::.0.0.0.0/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://::.0.0.0.0/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://::.0.0.0.0");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("::.0.0.0.0", actual.first);
ASSERT_EQ("", actual.second);
}
{ string uri("ws://0.0.0.0:100/path?xx=zz");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("0.0.0.0:100", actual.first);
ASSERT_EQ("/path?xx=zz", actual.second);
}
{ string uri("ws://0.0.0.0:100/");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("0.0.0.0:100", actual.first);
ASSERT_EQ("/", actual.second);
}
{ string uri("ws://0.0.0.0:100");
auto actual = split_hostport_pathquery(uri);
ASSERT_EQ("0.0.0.0:100", actual.first);
ASSERT_EQ("", actual.second);
}
}
|
ee39843038fb78e003cb2966c49821a1bd096b56 | 362e321d0c4f054a3877fc0a36b168531f0746b5 | /LC474_Ones and Zeroes_DP.cpp | 63b3da834b89e3cdc487f6fb89103b258fb7ca4a | [] | no_license | logic-life/LeetCode | 4935b5d57c7d1b673d392e50ad5cfa50d873fb58 | 3a6e825e114fee2568ec6866833d85a4b4557f02 | refs/heads/main | 2023-04-08T19:03:24.791258 | 2021-04-13T05:36:13 | 2021-04-13T05:36:13 | 357,615,164 | 1 | 0 | null | 2021-04-13T16:12:07 | 2021-04-13T16:12:06 | null | UTF-8 | C++ | false | false | 1,056 | cpp | LC474_Ones and Zeroes_DP.cpp | class Solution {
public:
int findMaxForm(vector<string>& strs, int m, int n) { // 本题比较特殊,是二维的0-1背包问题
vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0)); // 本行和下面一行等价
// int dp[101][101] = {0}; // 像这种数组直接 = {0}的,就是把所有初值全部赋为0
for (string str : strs) {
int oneNum = 0; // 统计0的个数
int zeroNum = 0; // 统计1的个数
for (char c : str) {
if (c == '0') zeroNum++;
else oneNum++;
}
for (int i = m; i >= zeroNum; i--) { // 二维DP
for (int j = n; j >= oneNum; j--) {
dp[i][j] = max(dp[i][j], dp[i - zeroNum][j - oneNum] + 1);
}
}
}
return dp[m][n];
}
};
// reference https://leetcode-cn.com/problems/ones-and-zeroes/solution/474-yi-he-ling-01bei-bao-xiang-jie-by-ca-s9vr/
// 除了DP,本题对于字符串的处理也很值得学习 |
d00e4edb18234cc32846bd64399d81a393558249 | 5b5217cbe6f275fcc6fa4bc5699dd7dee5aba1c4 | /Hashing/Rhyming with Hashing/HashInfo.h | 7a687c0e77ad21b4bc1309b4e6bbbb6105f44ea3 | [] | no_license | stuhops/cs2420 | 5e5c70145c9fef210dbc7cab053e0436c57f3c1a | 972a49c7b4f6b4af04e012bbd2f3221d1ff46c35 | refs/heads/master | 2020-09-12T17:46:47.237437 | 2019-11-18T16:51:43 | 2019-11-18T16:51:43 | 222,498,604 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 743 | h | HashInfo.h | /* Defines a class made to store a word and what words
* follow after that word and the normality of that occurance.
*
* Author: Stuart Hopkins
* Last Updated: 03/14/18
*/
#ifndef HASHINFO
#define HASHINFO
#include <iostream>
#include <vector>
class HashInfo {
private:
std::string word;
int ct;
std::vector<std::string> succInfo;
std::vector<int> succCt;
public:
HashInfo();
void setWord(std::string w) { word = w; }; //sets the word
int getCt() { return ct; }; //returns the count
void addSuccInfo(std::string s); //Finds successor location and adds it or inserts it if doesn't exist
std::string findRandSucc(); //Finds and returns a random successor using the pobability of the successors
std::string toString();
};
#endif |
5899a2889ffc00a0864f6604671879d892d08ef5 | fdcc03ee374171db86fb1aa14a2d2da487b29c50 | /mycpp/cipher/polybius0.cpp | b23ec79bdabb4b7ff0e86dd6272af98188c19e97 | [] | no_license | octopusengine/linux | bdc29f2ff6e75f81a47db3968197ef8516c98946 | 3aba705662742ff72a38f813aceb39f1c196b8d3 | refs/heads/master | 2023-08-03T08:15:46.579783 | 2023-07-30T06:06:48 | 2023-07-30T06:06:48 | 102,712,007 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 730 | cpp | polybius0.cpp | #include <cmath>
#include <iostream>
using namespace std;
void LetterToNumber(string str) {
int R, C;
for (int i = 0; str[i]; i++) {
R = ceil((str[i] - 'a') / 5) + 1;
C = ((str[i] - 'a') % 5) + 1;
if (str[i] == 'k') {
R = R - 1;
C = 5 - C + 1;
}
else if (str[i] >= 'j') {
if (C == 1) {
C = 6;
R = R - 1;
}
C = C - 1;
}
cout<<R<<C;
}
cout << endl;
}
int main() {
string str = "tutorialspoint";
cout<<"The numeric encryption of string '"<<str<<"' is : ";
LetterToNumber(str);
return 0;
}
//https://www.tutorialspoint.com/polybius-square-cipher-in-cplusplus |
4583bf2cbbcb8fc277c4be06bd5bff6d754d709d | 5ffe04a977c11f315c26b85e953e6dc3439386f7 | /tcp/tcp_client.hpp | f81b72d81834113be3d80f9bd77e25e37903a993 | [] | no_license | kelvin7feng/1st_framework | 9f4bec63d76909b8c9d0bbfe6a492fd9e737f67d | 333be912c0111263cb446db87be84284b641ec46 | refs/heads/master | 2021-05-02T01:00:33.529574 | 2017-04-15T09:43:02 | 2017-04-15T09:43:02 | 78,534,574 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,547 | hpp | tcp_client.hpp | //
// tcp_client.hpp
// client
//
// Created by 冯文斌 on 16/9/5.
// Copyright © 2016年 kelvin. All rights reserved.
//
#ifndef tcp_client_hpp
#define tcp_client_hpp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <uv.h>
#include <unistd.h>
#include <iostream>
#include "knetpacket.h"
using namespace std;
class TCPClient{
public:
TCPClient();
virtual ~TCPClient();
TCPClient(const TCPClient& TCPClient);
static TCPClient* GetInstance();
virtual int Init(uv_loop_t* loop, const char* ip, int port);
virtual void SetPort(int port);
virtual int GetPort();
virtual void SetIp(const char* ip);
virtual const char* GetIp();
virtual void SetLoop(uv_loop_t* loop);
virtual uv_loop_t* GetLoop();
virtual void Write(const string& msg);
virtual void OnMsgRecv(uv_stream_t* client, ssize_t nread, const uv_buf_t *buf);
virtual void OnWrite(uv_write_t *req, int status);
virtual void OnConnect(uv_connect_t *req, int status);
static void AllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf);
protected:
virtual bool _ProcessNetData(const char* pData, size_t uSize);
int m_port;
const char* m_ip;
uv_loop_t* m_loop;
uv_tcp_t m_client;
struct sockaddr_in m_dest;
uv_connect_t m_connect_req;
uv_write_t m_write_req;
IKNetPacket* m_pRecvPacket;
};
#endif /* tcp_client_hpp */ |
ca96f044bc2205dbcb3856c611e58d7fdd7b1754 | ebdc4ebba054c7fb5be991b0c31804a27c628b0f | /main2.cpp | 5ef8584a09df0e85bb74aa107796a89f91452f1d | [] | no_license | raganaxi/nn | f31c861593f90b40e1687d27b4cbb5db8c37dfd9 | ad7e788f6e06b9837460ff4170b9337e7320654c | refs/heads/master | 2021-01-13T03:50:49.064501 | 2014-01-04T22:15:13 | 2014-01-04T22:15:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 641 | cpp | main2.cpp | #include <set>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
/*
set <string> lista;
lista.insert("booz");
lista.insert("jael");
lista.insert("grillo");
lista.insert("booz");
for(int i=0;i<lista.size();i++){
cout << "el miembro "<< i+1 <<" es : "<<lista.at
(i)<<endl;
}*/
set<string> myset;
set<string>::iterator it;
// set some initial values:
myset.insert("booz");
myset.insert("jael");
myset.insert("grillo");
myset.insert("booz");
std::cout << "myset contains:";
for (it=myset.begin(); it!=myset.end(); ++it)
std::cout << ' ' << *it;
std::cout << '\n';
return 0;
} |
7fa7d84aa2439a18f326cc6991b132d997a11f92 | 9102bc7799aaa75574f311ca94e24866a29aad7b | /SDK/DiTracer/camera.cpp | 2244ee1cd5d0cfd947e921639bbb556e5c3ea356 | [] | no_license | DiMasta/OptiXSamplesSDK | d34c5ffd438d74ed26894add06b3e2cc9330f52b | e1fd8af9ee3c964b15bf0d971f54677f89cd9348 | refs/heads/master | 2021-07-06T14:04:33.735993 | 2017-10-03T07:10:39 | 2017-10-03T07:10:39 | 103,932,516 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,418 | cpp | camera.cpp | #include "camera.h"
using namespace optix;
Camera::Camera() :
SceneElement()
{
}
//**************************************************************************************************************************
//**************************************************************************************************************************
Camera::~Camera() {
}
//**************************************************************************************************************************
//**************************************************************************************************************************
optix::float3 Camera::getCamEye() const {
return camEye;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
optix::float3 Camera::getLookAt() const {
return lookAt;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
optix::float3 Camera::getUpVector() const {
return upVector;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
float Camera::getFov() const {
return fov;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
float Camera::getAspectRatio() const {
return aspectRatio;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::setCamEye(optix::float3 camEye) {
this->camEye = camEye;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::setLookAt(optix::float3 lookAt) {
this->lookAt = lookAt;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::setUpVector(optix::float3 upVector) {
this->upVector = upVector;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::setFov(float fov) {
this->fov = fov;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::setAspectRatio(float aspectRatio) {
this->aspectRatio = aspectRatio;
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::prepareGPUPrograms(RTcontext* context) {
RTprogram rayGenerationProgram;
RT_CHECK_ERROR(rtProgramCreateFromPTXFile(*context, PINHOLE_CAMERA_PTX, "pinholeCamera", &rayGenerationProgram));
RT_CHECK_ERROR(rtContextSetRayGenerationProgram(*context, 0, rayGenerationProgram));
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::prepareGPUVariables(RTcontext* context) {
RTvariable eye;
RTvariable U;
RTvariable V;
RTvariable W;
float3 cameraU;
float3 cameraV;
float3 cameraW;
sutil::calculateCameraVariables(
camEye, lookAt, upVector, fov, aspectRatio, cameraU, cameraV, cameraW
);
RT_CHECK_ERROR(rtContextDeclareVariable(*context, "eye", &eye));
RT_CHECK_ERROR(rtContextDeclareVariable(*context, "U", &U));
RT_CHECK_ERROR(rtContextDeclareVariable(*context, "V", &V));
RT_CHECK_ERROR(rtContextDeclareVariable(*context, "W", &W));
RT_CHECK_ERROR(rtVariableSet3fv(eye, &camEye.x));
RT_CHECK_ERROR(rtVariableSet3fv(U, &cameraU.x));
RT_CHECK_ERROR(rtVariableSet3fv(V, &cameraV.x));
RT_CHECK_ERROR(rtVariableSet3fv(W, &cameraW.x));
}
//**************************************************************************************************************************
//**************************************************************************************************************************
void Camera::computeAspectRatio() {
aspectRatio = (float)BUFFER_WIDTH / (float)BUFFER_HEIGHT;
}
|
5a02e5df28843fb74cd037fc89278ab0cabd82b7 | f476449e49c407255bbdce9059915714a775ed19 | /BlockNDNRPi/Configure.h | b752610d6bcc85986482aac79bcd6510f00138ca | [] | no_license | hafsteinn/BlockNDN | 578887855d1b98ab5e1c3c8057aa74f0c471090d | c5e1655dc8acc2657c497c99da37c5f7c62b5d0b | refs/heads/main | 2023-01-20T10:35:03.563395 | 2020-11-30T14:47:56 | 2020-11-30T14:47:56 | 303,652,413 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 10,116 | h | Configure.h | #pragma once
#include <string>
using namespace std;
namespace BlockNDN {
class Configure
{
protected:
string blockNDNGetBlockPrefix = "/ndn/blockndn/getblocks";
int INITBLOCKSIZE = 52;
int MAXBLOCKSIZE = 64;
int OFFSETINIT = 0;
int SHA256SIZE = 64; //This was 32 in the original code
int SIZEOFINT = 4;
int SIZEOFLONG = 8;
int DEFAULT_RSA_PUBLIC_KEY_DER[1000] = {
0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
0x00, 0xb8, 0x09, 0xa7, 0x59, 0x82, 0x84, 0xec, 0x4f, 0x06, 0xfa, 0x1c, 0xb2, 0xe1, 0x38, 0x93,
0x53, 0xbb, 0x7d, 0xd4, 0xac, 0x88, 0x1a, 0xf8, 0x25, 0x11, 0xe4, 0xfa, 0x1d, 0x61, 0x24, 0x5b,
0x82, 0xca, 0xcd, 0x72, 0xce, 0xdb, 0x66, 0xb5, 0x8d, 0x54, 0xbd, 0xfb, 0x23, 0xfd, 0xe8, 0x8e,
0xaf, 0xa7, 0xb3, 0x79, 0xbe, 0x94, 0xb5, 0xb7, 0xba, 0x17, 0xb6, 0x05, 0xae, 0xce, 0x43, 0xbe,
0x3b, 0xce, 0x6e, 0xea, 0x07, 0xdb, 0xbf, 0x0a, 0x7e, 0xeb, 0xbc, 0xc9, 0x7b, 0x62, 0x3c, 0xf5,
0xe1, 0xce, 0xe1, 0xd9, 0x8d, 0x9c, 0xfe, 0x1f, 0xc7, 0xf8, 0xfb, 0x59, 0xc0, 0x94, 0x0b, 0x2c,
0xd9, 0x7d, 0xbc, 0x96, 0xeb, 0xb8, 0x79, 0x22, 0x8a, 0x2e, 0xa0, 0x12, 0x1d, 0x42, 0x07, 0xb6,
0x5d, 0xdb, 0xe1, 0xf6, 0xb1, 0x5d, 0x7b, 0x1f, 0x54, 0x52, 0x1c, 0xa3, 0x11, 0x9b, 0xf9, 0xeb,
0xbe, 0xb3, 0x95, 0xca, 0xa5, 0x87, 0x3f, 0x31, 0x18, 0x1a, 0xc9, 0x99, 0x01, 0xec, 0xaa, 0x90,
0xfd, 0x8a, 0x36, 0x35, 0x5e, 0x12, 0x81, 0xbe, 0x84, 0x88, 0xa1, 0x0d, 0x19, 0x2a, 0x4a, 0x66,
0xc1, 0x59, 0x3c, 0x41, 0x83, 0x3d, 0x3d, 0xb8, 0xd4, 0xab, 0x34, 0x90, 0x06, 0x3e, 0x1a, 0x61,
0x74, 0xbe, 0x04, 0xf5, 0x7a, 0x69, 0x1b, 0x9d, 0x56, 0xfc, 0x83, 0xb7, 0x60, 0xc1, 0x5e, 0x9d,
0x85, 0x34, 0xfd, 0x02, 0x1a, 0xba, 0x2c, 0x09, 0x72, 0xa7, 0x4a, 0x5e, 0x18, 0xbf, 0xc0, 0x58,
0xa7, 0x49, 0x34, 0x46, 0x61, 0x59, 0x0e, 0xe2, 0x6e, 0x9e, 0xd2, 0xdb, 0xfd, 0x72, 0x2f, 0x3c,
0x47, 0xcc, 0x5f, 0x99, 0x62, 0xee, 0x0d, 0xf3, 0x1f, 0x30, 0x25, 0x20, 0x92, 0x15, 0x4b, 0x04,
0xfe, 0x15, 0x19, 0x1d, 0xdc, 0x7e, 0x5c, 0x10, 0x21, 0x52, 0x21, 0x91, 0x54, 0x60, 0x8b, 0x92,
0x41, 0x02, 0x03, 0x01, 0x00, 0x01
};
int DEFAULT_RSA_PRIVATE_KEY_DER[20000] = {
0x30, 0x82, 0x04, 0xbf, 0x02, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x82, 0x04, 0xa9, 0x30, 0x82, 0x04, 0xa5, 0x02, 0x01,
0x00, 0x02, 0x82, 0x01, 0x01, 0x00, 0xb8, 0x09, 0xa7, 0x59, 0x82, 0x84, 0xec, 0x4f, 0x06, 0xfa,
0x1c, 0xb2, 0xe1, 0x38, 0x93, 0x53, 0xbb, 0x7d, 0xd4, 0xac, 0x88, 0x1a, 0xf8, 0x25, 0x11, 0xe4,
0xfa, 0x1d, 0x61, 0x24, 0x5b, 0x82, 0xca, 0xcd, 0x72, 0xce, 0xdb, 0x66, 0xb5, 0x8d, 0x54, 0xbd,
0xfb, 0x23, 0xfd, 0xe8, 0x8e, 0xaf, 0xa7, 0xb3, 0x79, 0xbe, 0x94, 0xb5, 0xb7, 0xba, 0x17, 0xb6,
0x05, 0xae, 0xce, 0x43, 0xbe, 0x3b, 0xce, 0x6e, 0xea, 0x07, 0xdb, 0xbf, 0x0a, 0x7e, 0xeb, 0xbc,
0xc9, 0x7b, 0x62, 0x3c, 0xf5, 0xe1, 0xce, 0xe1, 0xd9, 0x8d, 0x9c, 0xfe, 0x1f, 0xc7, 0xf8, 0xfb,
0x59, 0xc0, 0x94, 0x0b, 0x2c, 0xd9, 0x7d, 0xbc, 0x96, 0xeb, 0xb8, 0x79, 0x22, 0x8a, 0x2e, 0xa0,
0x12, 0x1d, 0x42, 0x07, 0xb6, 0x5d, 0xdb, 0xe1, 0xf6, 0xb1, 0x5d, 0x7b, 0x1f, 0x54, 0x52, 0x1c,
0xa3, 0x11, 0x9b, 0xf9, 0xeb, 0xbe, 0xb3, 0x95, 0xca, 0xa5, 0x87, 0x3f, 0x31, 0x18, 0x1a, 0xc9,
0x99, 0x01, 0xec, 0xaa, 0x90, 0xfd, 0x8a, 0x36, 0x35, 0x5e, 0x12, 0x81, 0xbe, 0x84, 0x88, 0xa1,
0x0d, 0x19, 0x2a, 0x4a, 0x66, 0xc1, 0x59, 0x3c, 0x41, 0x83, 0x3d, 0x3d, 0xb8, 0xd4, 0xab, 0x34,
0x90, 0x06, 0x3e, 0x1a, 0x61, 0x74, 0xbe, 0x04, 0xf5, 0x7a, 0x69, 0x1b, 0x9d, 0x56, 0xfc, 0x83,
0xb7, 0x60, 0xc1, 0x5e, 0x9d, 0x85, 0x34, 0xfd, 0x02, 0x1a, 0xba, 0x2c, 0x09, 0x72, 0xa7, 0x4a,
0x5e, 0x18, 0xbf, 0xc0, 0x58, 0xa7, 0x49, 0x34, 0x46, 0x61, 0x59, 0x0e, 0xe2, 0x6e, 0x9e, 0xd2,
0xdb, 0xfd, 0x72, 0x2f, 0x3c, 0x47, 0xcc, 0x5f, 0x99, 0x62, 0xee, 0x0d, 0xf3, 0x1f, 0x30, 0x25,
0x20, 0x92, 0x15, 0x4b, 0x04, 0xfe, 0x15, 0x19, 0x1d, 0xdc, 0x7e, 0x5c, 0x10, 0x21, 0x52, 0x21,
0x91, 0x54, 0x60, 0x8b, 0x92, 0x41, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x01, 0x00,
0x8a, 0x05, 0xfb, 0x73, 0x7f, 0x16, 0xaf, 0x9f, 0xa9, 0x4c, 0xe5, 0x3f, 0x26, 0xf8, 0x66, 0x4d,
0xd2, 0xfc, 0xd1, 0x06, 0xc0, 0x60, 0xf1, 0x9f, 0xe3, 0xa6, 0xc6, 0x0a, 0x48, 0xb3, 0x9a, 0xca,
0x21, 0xcd, 0x29, 0x80, 0x88, 0x3d, 0xa4, 0x85, 0xa5, 0x7b, 0x82, 0x21, 0x81, 0x28, 0xeb, 0xf2,
0x43, 0x24, 0xb0, 0x76, 0xc5, 0x52, 0xef, 0xc2, 0xea, 0x4b, 0x82, 0x41, 0x92, 0xc2, 0x6d, 0xa6,
0xae, 0xf0, 0xb2, 0x26, 0x48, 0xa1, 0x23, 0x7f, 0x02, 0xcf, 0xa8, 0x90, 0x17, 0xa2, 0x3e, 0x8a,
0x26, 0xbd, 0x6d, 0x8a, 0xee, 0xa6, 0x0c, 0x31, 0xce, 0xc2, 0xbb, 0x92, 0x59, 0xb5, 0x73, 0xe2,
0x7d, 0x91, 0x75, 0xe2, 0xbd, 0x8c, 0x63, 0xe2, 0x1c, 0x8b, 0xc2, 0x6a, 0x1c, 0xfe, 0x69, 0xc0,
0x44, 0xcb, 0x58, 0x57, 0xb7, 0x13, 0x42, 0xf0, 0xdb, 0x50, 0x4c, 0xe0, 0x45, 0x09, 0x8f, 0xca,
0x45, 0x8a, 0x06, 0xfe, 0x98, 0xd1, 0x22, 0xf5, 0x5a, 0x9a, 0xdf, 0x89, 0x17, 0xca, 0x20, 0xcc,
0x12, 0xa9, 0x09, 0x3d, 0xd5, 0xf7, 0xe3, 0xeb, 0x08, 0x4a, 0xc4, 0x12, 0xc0, 0xb9, 0x47, 0x6c,
0x79, 0x50, 0x66, 0xa3, 0xf8, 0xaf, 0x2c, 0xfa, 0xb4, 0x6b, 0xec, 0x03, 0xad, 0xcb, 0xda, 0x24,
0x0c, 0x52, 0x07, 0x87, 0x88, 0xc0, 0x21, 0xf3, 0x02, 0xe8, 0x24, 0x44, 0x0f, 0xcd, 0xa0, 0xad,
0x2f, 0x1b, 0x79, 0xab, 0x6b, 0x49, 0x4a, 0xe6, 0x3b, 0xd0, 0xad, 0xc3, 0x48, 0xb9, 0xf7, 0xf1,
0x34, 0x09, 0xeb, 0x7a, 0xc0, 0xd5, 0x0d, 0x39, 0xd8, 0x45, 0xce, 0x36, 0x7a, 0xd8, 0xde, 0x3c,
0xb0, 0x21, 0x96, 0x97, 0x8a, 0xff, 0x8b, 0x23, 0x60, 0x4f, 0xf0, 0x3d, 0xd7, 0x8f, 0xf3, 0x2c,
0xcb, 0x1d, 0x48, 0x3f, 0x86, 0xc4, 0xa9, 0x00, 0xf2, 0x23, 0x2d, 0x72, 0x4d, 0x66, 0xa5, 0x01,
0x02, 0x81, 0x81, 0x00, 0xdc, 0x4f, 0x99, 0x44, 0x0d, 0x7f, 0x59, 0x46, 0x1e, 0x8f, 0xe7, 0x2d,
0x8d, 0xdd, 0x54, 0xc0, 0xf7, 0xfa, 0x46, 0x0d, 0x9d, 0x35, 0x03, 0xf1, 0x7c, 0x12, 0xf3, 0x5a,
0x9d, 0x83, 0xcf, 0xdd, 0x37, 0x21, 0x7c, 0xb7, 0xee, 0xc3, 0x39, 0xd2, 0x75, 0x8f, 0xb2, 0x2d,
0x6f, 0xec, 0xc6, 0x03, 0x55, 0xd7, 0x00, 0x67, 0xd3, 0x9b, 0xa2, 0x68, 0x50, 0x6f, 0x9e, 0x28,
0xa4, 0x76, 0x39, 0x2b, 0xb2, 0x65, 0xcc, 0x72, 0x82, 0x93, 0xa0, 0xcf, 0x10, 0x05, 0x6a, 0x75,
0xca, 0x85, 0x35, 0x99, 0xb0, 0xa6, 0xc6, 0xef, 0x4c, 0x4d, 0x99, 0x7d, 0x2c, 0x38, 0x01, 0x21,
0xb5, 0x31, 0xac, 0x80, 0x54, 0xc4, 0x18, 0x4b, 0xfd, 0xef, 0xb3, 0x30, 0x22, 0x51, 0x5a, 0xea,
0x7d, 0x9b, 0xb2, 0x9d, 0xcb, 0xba, 0x3f, 0xc0, 0x1a, 0x6b, 0xcd, 0xb0, 0xe6, 0x2f, 0x04, 0x33,
0xd7, 0x3a, 0x49, 0x71, 0x02, 0x81, 0x81, 0x00, 0xd5, 0xd9, 0xc9, 0x70, 0x1a, 0x13, 0xb3, 0x39,
0x24, 0x02, 0xee, 0xb0, 0xbb, 0x84, 0x17, 0x12, 0xc6, 0xbd, 0x65, 0x73, 0xe9, 0x34, 0x5d, 0x43,
0xff, 0xdc, 0xf8, 0x55, 0xaf, 0x2a, 0xb9, 0xe1, 0xfa, 0x71, 0x65, 0x4e, 0x50, 0x0f, 0xa4, 0x3b,
0xe5, 0x68, 0xf2, 0x49, 0x71, 0xaf, 0x15, 0x88, 0xd7, 0xaf, 0xc4, 0x9d, 0x94, 0x84, 0x6b, 0x5b,
0x10, 0xd5, 0xc0, 0xaa, 0x0c, 0x13, 0x62, 0x99, 0xc0, 0x8b, 0xfc, 0x90, 0x0f, 0x87, 0x40, 0x4d,
0x58, 0x88, 0xbd, 0xe2, 0xba, 0x3e, 0x7e, 0x2d, 0xd7, 0x69, 0xa9, 0x3c, 0x09, 0x64, 0x31, 0xb6,
0xcc, 0x4d, 0x1f, 0x23, 0xb6, 0x9e, 0x65, 0xd6, 0x81, 0xdc, 0x85, 0xcc, 0x1e, 0xf1, 0x0b, 0x84,
0x38, 0xab, 0x93, 0x5f, 0x9f, 0x92, 0x4e, 0x93, 0x46, 0x95, 0x6b, 0x3e, 0xb6, 0xc3, 0x1b, 0xd7,
0x69, 0xa1, 0x0a, 0x97, 0x37, 0x78, 0xed, 0xd1, 0x02, 0x81, 0x80, 0x33, 0x18, 0xc3, 0x13, 0x65,
0x8e, 0x03, 0xc6, 0x9f, 0x90, 0x00, 0xae, 0x30, 0x19, 0x05, 0x6f, 0x3c, 0x14, 0x6f, 0xea, 0xf8,
0x6b, 0x33, 0x5e, 0xee, 0xc7, 0xf6, 0x69, 0x2d, 0xdf, 0x44, 0x76, 0xaa, 0x32, 0xba, 0x1a, 0x6e,
0xe6, 0x18, 0xa3, 0x17, 0x61, 0x1c, 0x92, 0x2d, 0x43, 0x5d, 0x29, 0xa8, 0xdf, 0x14, 0xd8, 0xff,
0xdb, 0x38, 0xef, 0xb8, 0xb8, 0x2a, 0x96, 0x82, 0x8e, 0x68, 0xf4, 0x19, 0x8c, 0x42, 0xbe, 0xcc,
0x4a, 0x31, 0x21, 0xd5, 0x35, 0x6c, 0x5b, 0xa5, 0x7c, 0xff, 0xd1, 0x85, 0x87, 0x28, 0xdc, 0x97,
0x75, 0xe8, 0x03, 0x80, 0x1d, 0xfd, 0x25, 0x34, 0x41, 0x31, 0x21, 0x12, 0x87, 0xe8, 0x9a, 0xb7,
0x6a, 0xc0, 0xc4, 0x89, 0x31, 0x15, 0x45, 0x0d, 0x9c, 0xee, 0xf0, 0x6a, 0x2f, 0xe8, 0x59, 0x45,
0xc7, 0x7b, 0x0d, 0x6c, 0x55, 0xbb, 0x43, 0xca, 0xc7, 0x5a, 0x01, 0x02, 0x81, 0x81, 0x00, 0xab,
0xf4, 0xd5, 0xcf, 0x78, 0x88, 0x82, 0xc2, 0xdd, 0xbc, 0x25, 0xe6, 0xa2, 0xc1, 0xd2, 0x33, 0xdc,
0xef, 0x0a, 0x97, 0x2b, 0xdc, 0x59, 0x6a, 0x86, 0x61, 0x4e, 0xa6, 0xc7, 0x95, 0x99, 0xa6, 0xa6,
0x55, 0x6c, 0x5a, 0x8e, 0x72, 0x25, 0x63, 0xac, 0x52, 0xb9, 0x10, 0x69, 0x83, 0x99, 0xd3, 0x51,
0x6c, 0x1a, 0xb3, 0x83, 0x6a, 0xff, 0x50, 0x58, 0xb7, 0x28, 0x97, 0x13, 0xe2, 0xba, 0x94, 0x5b,
0x89, 0xb4, 0xea, 0xba, 0x31, 0xcd, 0x78, 0xe4, 0x4a, 0x00, 0x36, 0x42, 0x00, 0x62, 0x41, 0xc6,
0x47, 0x46, 0x37, 0xea, 0x6d, 0x50, 0xb4, 0x66, 0x8f, 0x55, 0x0c, 0xc8, 0x99, 0x91, 0xd5, 0xec,
0xd2, 0x40, 0x1c, 0x24, 0x7d, 0x3a, 0xff, 0x74, 0xfa, 0x32, 0x24, 0xe0, 0x11, 0x2b, 0x71, 0xad,
0x7e, 0x14, 0xa0, 0x77, 0x21, 0x68, 0x4f, 0xcc, 0xb6, 0x1b, 0xe8, 0x00, 0x49, 0x13, 0x21, 0x02,
0x81, 0x81, 0x00, 0xb6, 0x18, 0x73, 0x59, 0x2c, 0x4f, 0x92, 0xac, 0xa2, 0x2e, 0x5f, 0xb6, 0xbe,
0x78, 0x5d, 0x47, 0x71, 0x04, 0x92, 0xf0, 0xd7, 0xe8, 0xc5, 0x7a, 0x84, 0x6b, 0xb8, 0xb4, 0x30,
0x1f, 0xd8, 0x0d, 0x58, 0xd0, 0x64, 0x80, 0xa7, 0x21, 0x1a, 0x48, 0x00, 0x37, 0xd6, 0x19, 0x71,
0xbb, 0x91, 0x20, 0x9d, 0xe2, 0xc3, 0xec, 0xdb, 0x36, 0x1c, 0xca, 0x48, 0x7d, 0x03, 0x32, 0x74,
0x1e, 0x65, 0x73, 0x02, 0x90, 0x73, 0xd8, 0x3f, 0xb5, 0x52, 0x35, 0x79, 0x1c, 0xee, 0x93, 0xa3,
0x32, 0x8b, 0xed, 0x89, 0x98, 0xf1, 0x0c, 0xd8, 0x12, 0xf2, 0x89, 0x7f, 0x32, 0x23, 0xec, 0x67,
0x66, 0x52, 0x83, 0x89, 0x99, 0x5e, 0x42, 0x2b, 0x42, 0x4b, 0x84, 0x50, 0x1b, 0x3e, 0x47, 0x6d,
0x74, 0xfb, 0xd1, 0xa6, 0x10, 0x20, 0x6c, 0x6e, 0xbe, 0x44, 0x3f, 0xb9, 0xfe, 0xbc, 0x8d, 0xda,
0xcb, 0xea, 0x8f
};
public:
int* getPublicKey();
int* getPrivateKey();
int getInitBlockSize();
string getPrefix();
int getMaxBlockSize();
int getOffsetInit();
int getSHA256Size();
int getSizeOfInt();
int getSizeOfLong();
};
}
|
417150e9b4a10a89c79694432d127d0cc21f56da | b0d7fd0b33a3c92510769aa79e166e6903998108 | /src/kernel/cpu.h | 199db0b79a075838755d9c43bd39c5fd3d5444d6 | [
"MIT"
] | permissive | hexueyuan/virtualComputer | 5047281a3accd7b3744dd5020ef6edbfb2bf3ed8 | a20b5f089622c44260176a4233abd699c0430d8b | refs/heads/master | 2020-04-09T07:21:44.874965 | 2019-04-02T07:03:59 | 2019-04-02T07:03:59 | 160,152,074 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,335 | h | cpu.h | #ifndef __CPU_H__
#define __CPU_H__
#include "base/base.h"
#include "base/selector.h"
#include "base/alu.h"
#include "base/shiftor.h"
//base/
//CPU部件由两个选择器、ALU部件和移位器组成
//八个输入端口和一个输出端口,接受一条控制总线
namespace computer {
class CPU {
public:
//构造函数
//输入:
// R0 ~ R3 四个通用寄存器
// IP 指令寄存器
// PC 程序计数器
// C、D 数据暂存器
// MAR 地址寄存器
// MDR 数据寄存器
// PSW 程序状态字寄存器
// SP 堆栈指针
// _out_ 输出
// _control_ 指令控制总线
// _selector_A_active_bits 选择器A有效指令位
// _selector_B_active_bits 选择器B有效指令位
// _shiftor_active_bits 移位器有效指令位
// _data_bits_width 数据宽度
CPU(base::BusBase* _in_R0_, base::BusBase* _in_R1_, base::BusBase* _in_R2_, base::BusBase* _in_R3_,
base::BusBase* _in_IP_, base::BusBase* _in_PC_, base::BusBase* _in_C_, base::BusBase* _in_D_,
base::BusBase* _in_MAR_, base::BusBase* _in_MDR_, base::BusBase* _in_PSW_, base::BusBase* _in_SP_,
base::BusBase* _out_, base::BusBase* _control_,
unsigned long _selector_A_active_bits,
unsigned long _selector_B_active_bits,
unsigned long _alu_active_bits,
unsigned long _shiftor_active_bits,
unsigned long _data_bits_width);
~CPU();
//执行一次当前控制总线上的指令
void operator()();
//CPU命名
void named(string _name);
//调试
void debug(string prefix = "");
private:
base::SelectorBase* _selector_A_;
base::SelectorBase* _selector_B_;
base::AluBase* _alu_;
base::ShiftorBase* _shiftor_;
base::BusBase* _selector_A_out_bus_;
base::BusBase* _selector_B_out_bus_;
base::BusBase* _alu_out_bus_A_;
base::BusBase* _alu_out_bus_B_;
string _name_;
};
}
#endif |
331bef7d0e70d646ac3ba88cf3f4676270dce58f | a61efa4c2e1fc6ccb580548f00a662a05b756291 | /C++ course/ex09/ex09.2_Palindrome.cpp | 47d30e4f33516a5e9bbf531650b3ed2f42ba052f | [] | no_license | barbararcbf12/DTU_Projects | d13a8c6db0c2d23ffbc897b7ca1e57568114b5b4 | 7eaeed0536a77e3f3b63b8912849deb53b4dacd2 | refs/heads/master | 2020-03-08T06:03:23.141031 | 2018-04-04T17:18:20 | 2018-04-04T17:18:20 | 127,962,218 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,199 | cpp | ex09.2_Palindrome.cpp | // Palindrome
#include <iostream>
#include <vector>
#include <algorithm> // std::reverse
#include <cmath>
using namespace std;
void reverseV(vector<int> v1, vector<int> &v2);
void printV(vector<int> v);
int main ()
{
int myint;
vector<int> myvector;
vector<int> myvectorInverse;
bool check = true;
while (cin >> myint){
if (cin.fail()) break;
myvector.push_back(myint);
}
reverseV(myvector,myvectorInverse);
for(int k = 0; k < myvector.size(); k++){
for(int j = 0; j < myvectorInverse.size(); j++){
if( k == j && myvector[k] != myvectorInverse[j] ) {
check = false;
break;
}
}
}
if(check == true) cout << "yes";
else cout << "no";
return 0;
}
//record reversed vector in a new vector function
void reverseV(vector<int> v1, vector<int> &v2){
reverse(v1.begin(),v1.end());
for(vector<int>::iterator p = v1.begin(); p != v1.end(); p++){
v2.push_back(*p);
}
}
void printV(vector<int> v){
for(vector<int>::iterator p = v.begin(); p != v.end(); p++){
cout << *p << " ";
}
}
|
57a4a27207edb3e9ec8cd9250bde0030c27dc91b | 9bc7e204718e6935ddb23102d5c49b5259538929 | /src/SingleLinePatternEditWidget.cpp | c64405011a38c443fe5b1c84cce0a12e21a9a1e3 | [
"BSD-2-Clause"
] | permissive | Ashgun/LogView | e68beefb7b5d5d5d59e1455554dabd6061894ab5 | b080153d32e8af26069228798f0e0384edbb6aa8 | refs/heads/master | 2021-07-08T16:07:24.163801 | 2019-03-22T18:06:37 | 2019-03-22T18:06:37 | 143,643,393 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,438 | cpp | SingleLinePatternEditWidget.cpp | #include "SingleLinePatternEditWidget.h"
#include <QVBoxLayout>
#include <QLabel>
SingleLinePatternEditWidget::SingleLinePatternEditWidget(QWidget *parent) : QWidget(parent)
{
gui_patternName = new QLineEdit();
gui_patternLineEdit = new LinePatternEditWidget();
gui_viewColorEdit = new ColorSelectionViewWidget();
QVBoxLayout* box = new QVBoxLayout;
box->addWidget(new QLabel(tr("Pattern name:")));
box->addWidget(gui_patternName);
box->addWidget(gui_patternLineEdit);
box->addWidget(gui_viewColorEdit);
box->addStretch();
setLayout(box);
}
SingleLinePatternEditWidget::SingleLinePatternEditWidget(const IMatchableEventPattern* patternBase, QWidget* parent) :
SingleLinePatternEditWidget(parent)
{
SetLinePattern(patternBase);
}
IMatchableEventPatternPtr SingleLinePatternEditWidget::GetPattern() const
{
return CreateSingleEventPattern(
gui_patternName->text(),
gui_patternLineEdit->GetEventPattern(),
gui_viewColorEdit->GetColor());
}
void SingleLinePatternEditWidget::SetLinePattern(const IMatchableEventPattern* patternBase)
{
const SingleEventPattern* pattern = dynamic_cast<const SingleEventPattern*>(patternBase);
gui_patternName->setText(pattern->Name);
gui_patternLineEdit->SetEventPattern(pattern->Pattern);
gui_viewColorEdit->SetColor(pattern->ViewColor);
}
|
02b6fbf0e229a4669d6ee39a9acce36f1a743b28 | 50a18a5c8f9443d16fe22736fa85098f4f5c1977 | /include/glowing_indexer.h | ef178a8a25e21b209741fcdb68321a5297741917 | [
"WTFPL"
] | permissive | elsampsa/skeleton-cpp | c185676200210c2087b9d2434e4fb225d9ce534a | b698684d4a0ad8906d11fd4a38a1f87896d8ae16 | refs/heads/master | 2020-04-07T16:11:52.497882 | 2018-03-07T11:46:26 | 2018-03-07T11:46:26 | 124,221,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,536 | h | glowing_indexer.h | #ifndef glowing_indexer_HEADER_GUARD
#define glowing_indexer_HEADER_GUARD
/*
* glowing_indexer.h : A brief description
*
* Copyright 2018 Sampsa Riikonen
*
* Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
*
* This file is part of the skeleton library.
*
* Skeleton is free software: you can redistribute it and/or modify
* it under the terms of the WTFPL license, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the WTFPL license
* along with this program. If not, see <http://www.wtfpl.net/about/>
*
* According to international copyright law, this code needs a copyright notice,
* but if you remove it, I don't really mind.
*
*/
/**
* @file glowing_indexer.h
* @author Sampsa Riikonen
* @date 2018
* @version 0.1.0
*
* @brief A brief description
*/
#include <iostream>
#include "demo.h"
#include "sqlite3.h"
/** This is demo class derived from a static library
*
* - Does pretty much nothing
* - Uses a also a dynamically linked library: sqlite3
*
* @ingroup some_tag
*/
class DerivedClass : public DemoClass {
public:
/** Default constructor
*
* @param nothing no parameters here
*
*/
DerivedClass();
/** Default destructor
*
*/
~DerivedClass();
void useSql();
};
#endif
|
6e2d8e834dbdcea6404d2ef6bf76f33b66d55b2a | 26f9fdff3c246e3a68ff9b0bb4f8f0a9a67bce1c | /dynamic_OWSC (copy)/1.5/nut | 3ad2a1ba0c668a0697c30b9f93f0f9d6b240b1e5 | [] | no_license | JBrakefield/My_olaFlow | 6c0aaa0dda8d8e69c127281fc9484f3cded258ea | a812362928f2466f4e2632d2636dce97a0a3b9f6 | refs/heads/master | 2020-04-08T14:00:49.750205 | 2019-01-10T19:48:55 | 2019-01-10T19:48:55 | 159,418,163 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 174,179 | nut | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 5.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "1.5";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField nonuniform List<scalar>
12160
(
1.01844e-09
1.02459e-09
7.81859e-08
1.02252e-09
1.44518e-07
1.15685e-07
1.03262e-09
3.19671e-07
1.14017e-07
9.46432e-08
1.06264e-09
6.41765e-08
3.8231e-07
6.75396e-08
9.75177e-08
1.0855e-09
5.22344e-08
7.80049e-08
3.97257e-07
4.58299e-08
2.84454e-08
1.11019e-09
5.51775e-08
5.37869e-08
8.53642e-08
8.21112e-08
3.06478e-08
2.35332e-08
1.12625e-09
6.57517e-08
5.12843e-08
5.79748e-08
1.04719e-07
1.2139e-07
1.56495e-08
5.04455e-09
1.12969e-09
1.11859e-07
5.74075e-08
5.13884e-08
6.8989e-08
8.16955e-07
2.32536e-08
5.17693e-09
7.33254e-09
1.1176e-09
1.79311e-07
7.77373e-08
5.16842e-08
4.79729e-08
1.50672e-07
4.48844e-08
7.90606e-09
7.96953e-09
9.59436e-09
1.09574e-09
8.13893e-08
7.68942e-08
5.85365e-08
4.13796e-08
5.4229e-08
1.33694e-07
2.26759e-08
5.68016e-09
3.04425e-08
8.53916e-09
1.07357e-09
6.00438e-08
5.74826e-08
5.99856e-08
4.35189e-08
3.47802e-08
3.67356e-08
3.18859e-08
6.19634e-09
1.50373e-08
3.58242e-09
1.07508e-08
1.06003e-09
6.52732e-08
4.68884e-08
5.05921e-08
4.0726e-08
3.07939e-08
2.80432e-08
1.41276e-08
9.09603e-09
1.27836e-08
2.59918e-09
2.39922e-09
3.83061e-09
1.06078e-09
8.76502e-08
4.69787e-08
4.30244e-08
3.40566e-08
2.91192e-08
3.3001e-08
1.20859e-08
2.8688e-08
1.10112e-08
7.40078e-09
4.60866e-09
5.14352e-09
3.85558e-09
1.08204e-09
5.63939e-08
5.426e-08
4.158e-08
2.9608e-08
2.82551e-08
3.47662e-08
1.26524e-08
2.40365e-07
1.14046e-08
1.57377e-08
6.50497e-09
5.33213e-09
9.87756e-09
3.17701e-09
1.13077e-09
2.86456e-08
4.45893e-08
3.93611e-08
2.76937e-08
2.68205e-08
2.44869e-08
1.2701e-08
4.91017e-08
1.32828e-08
7.26172e-09
4.79721e-09
9.7778e-09
9.52215e-09
1.52814e-08
1.21316e-09
1.78884e-08
2.6498e-08
2.99061e-08
2.65627e-08
2.50871e-08
1.8201e-08
1.03413e-08
2.74299e-08
1.70334e-08
7.05537e-09
1.03257e-08
2.53548e-08
8.59314e-09
8.20027e-09
1.34141e-09
1.29513e-08
1.74665e-08
2.06464e-08
2.31128e-08
2.25594e-08
1.59631e-08
7.99553e-09
1.61501e-08
2.34633e-08
6.90868e-09
1.23849e-08
1.98503e-08
2.6984e-08
1.59592e-08
1.53609e-09
1.02932e-08
1.28784e-08
1.47557e-08
1.78439e-08
1.84495e-08
1.52099e-08
6.51118e-09
1.02649e-08
2.69283e-08
7.05426e-09
8.02621e-09
8.82907e-09
8.1757e-08
6.78737e-08
1.83591e-09
8.72623e-09
1.03116e-08
1.1336e-08
1.37078e-08
1.47621e-08
1.48102e-08
5.67054e-09
7.12737e-09
1.81778e-08
7.53796e-09
5.93247e-09
5.07842e-09
2.86316e-08
1.04331e-07
2.31983e-09
7.74799e-09
8.77716e-09
9.30302e-09
1.09902e-08
1.193e-08
1.29842e-08
5.20038e-09
5.43132e-09
1.09543e-08
8.68235e-09
4.65453e-09
3.92543e-09
1.26517e-08
1.40216e-07
3.16148e-09
7.12168e-09
7.8147e-09
8.04515e-09
9.2323e-09
9.74858e-09
1.0405e-08
4.91408e-09
4.48543e-09
7.05855e-09
1.10571e-08
3.88056e-09
3.44663e-09
9.86589e-09
1.95499e-08
4.69834e-09
6.72388e-09
7.19665e-09
7.23919e-09
8.10891e-09
8.26911e-09
8.62574e-09
4.76216e-09
3.90143e-09
5.0784e-09
1.49202e-08
3.40246e-09
3.17809e-09
9.62393e-09
1.4193e-08
6.37006e-09
6.48612e-09
6.80227e-09
6.71458e-09
7.37835e-09
7.31725e-09
7.53439e-09
4.73621e-09
3.52657e-09
4.16551e-09
1.53026e-08
3.05518e-09
2.9739e-09
1.30019e-08
1.5109e-08
5.09564e-09
6.37103e-09
6.56552e-09
6.37698e-09
6.89966e-09
6.68981e-09
6.86078e-09
4.7954e-09
3.24867e-09
3.67728e-09
1.49331e-08
2.68513e-09
2.7979e-09
2.59158e-08
2.82599e-08
3.43006e-09
6.36174e-09
6.44994e-09
6.17223e-09
6.59056e-09
6.27239e-09
6.42491e-09
4.91261e-09
3.0215e-09
3.41664e-09
1.45369e-08
2.20305e-09
2.59719e-09
1.23526e-08
1.68571e-08
2.49934e-09
6.45721e-09
6.43819e-09
6.06942e-09
6.40218e-09
5.99846e-09
6.14607e-09
5.10808e-09
2.83937e-09
3.28182e-09
1.31055e-08
1.755e-09
2.37782e-09
7.32502e-09
7.22013e-09
1.96881e-09
6.668e-09
6.52946e-09
6.05326e-09
6.30505e-09
5.82597e-09
5.97372e-09
5.38666e-09
2.7443e-09
3.21972e-09
1.09617e-08
1.39455e-09
2.26512e-09
6.56003e-09
4.82993e-09
1.64081e-09
7.02078e-09
6.73388e-09
6.12313e-09
6.28171e-09
5.73044e-09
5.88081e-09
5.73136e-09
2.80992e-09
3.17219e-09
8.70301e-09
1.1444e-09
2.32627e-09
6.97095e-09
6.05665e-09
1.42543e-09
7.5641e-09
7.07554e-09
6.28705e-09
6.33386e-09
5.70794e-09
5.8437e-09
6.08047e-09
3.11825e-09
3.0725e-09
6.59169e-09
1.12323e-09
2.58027e-09
8.00077e-09
6.01016e-09
1.27892e-09
8.37815e-09
7.59755e-09
6.56382e-09
6.47011e-09
5.75619e-09
5.7908e-09
6.27513e-09
3.64083e-09
2.89219e-09
4.45472e-09
1.31711e-09
3.05901e-09
9.72999e-09
6.6318e-09
1.17806e-09
9.60588e-09
8.37283e-09
6.98561e-09
6.70601e-09
5.8728e-09
5.75525e-09
6.20853e-09
4.08304e-09
2.64593e-09
2.93976e-09
1.66746e-09
3.88596e-09
1.22269e-08
7.82735e-09
1.10968e-09
1.15189e-08
9.52325e-09
7.60178e-09
7.06682e-09
6.07081e-09
5.77596e-09
5.91522e-09
3.90311e-09
2.45462e-09
2.28314e-09
2.31018e-09
5.31976e-09
1.54637e-08
9.65766e-09
1.06588e-09
1.46818e-08
1.12537e-08
8.48854e-09
7.58791e-09
6.36974e-09
5.8623e-09
5.56651e-09
3.40326e-09
2.4329e-09
2.16481e-09
3.75558e-09
8.09195e-09
1.98779e-08
1.23538e-08
1.04213e-09
2.03709e-08
1.39028e-08
9.75825e-09
8.31708e-09
6.79354e-09
6.02485e-09
5.24605e-09
2.94937e-09
2.53973e-09
2.12971e-09
8.07835e-09
1.38429e-08
2.68159e-08
1.65129e-08
1.03515e-09
3.07553e-08
1.79276e-08
1.15538e-08
9.30681e-09
7.37446e-09
6.27839e-09
4.98517e-09
2.68491e-09
2.65556e-09
2.31853e-09
5.20387e-09
2.26891e-08
4.04594e-08
2.36615e-08
1.04258e-09
4.18641e-08
2.35564e-08
1.39688e-08
1.05618e-08
8.14888e-09
6.64141e-09
4.78495e-09
2.60191e-09
2.7339e-09
3.14241e-09
2.77313e-09
1.7393e-08
6.89086e-08
3.84499e-08
1.06497e-09
3.3341e-08
2.64083e-08
1.64599e-08
1.19524e-08
9.08441e-09
7.15569e-09
4.63633e-09
2.63888e-09
2.77734e-09
4.16944e-09
1.92621e-09
8.98684e-09
7.81722e-08
8.18053e-08
1.10161e-09
2.24615e-08
2.24273e-08
1.79593e-08
1.33031e-08
1.00612e-08
7.86258e-09
4.51714e-09
2.74049e-09
2.8021e-09
5.47386e-09
1.48709e-09
5.73942e-09
6.25322e-08
1.52628e-07
1.15436e-09
1.679e-08
1.76863e-08
1.74221e-08
1.38337e-08
1.07003e-08
8.66884e-09
4.42901e-09
2.86806e-09
2.8372e-09
6.97553e-09
1.22753e-09
4.04956e-09
4.09393e-08
5.54305e-08
1.34885e-08
1.28062e-09
1.4292e-08
1.52544e-08
1.31602e-08
1.10431e-08
9.38483e-09
4.38029e-09
3.00605e-09
2.90259e-09
8.63132e-09
1.07024e-09
3.09504e-09
2.81524e-08
2.89614e-08
1.20958e-08
1.07749e-08
1.55554e-09
1.31007e-08
1.20257e-08
1.11086e-08
9.4327e-09
4.38338e-09
3.16897e-09
3.00904e-09
1.03704e-08
1.05039e-09
2.4988e-09
2.0448e-08
1.87422e-08
1.14424e-08
1.0067e-08
9.04413e-09
2.06182e-09
1.0797e-08
1.06483e-08
8.98566e-09
4.39841e-09
3.37691e-09
3.19266e-09
1.20994e-08
1.20889e-09
2.12081e-09
1.52286e-08
1.33875e-08
9.75537e-09
9.87086e-09
8.6344e-09
8.90503e-09
2.58031e-09
9.94684e-09
8.48551e-09
4.43574e-09
3.70499e-09
3.50975e-09
1.37526e-08
1.47206e-09
1.89361e-09
1.14195e-08
1.01494e-08
9.281e-09
8.71578e-09
8.78421e-09
8.62102e-09
7.09661e-09
4.50252e-09
7.81105e-09
4.5039e-09
4.1714e-09
4.03749e-09
1.43262e-08
1.78693e-09
1.79562e-09
8.70027e-09
7.98912e-09
7.1582e-09
8.63407e-09
8.06551e-09
9.14918e-09
7.73774e-09
6.22289e-09
2.51054e-09
4.51717e-09
4.77581e-09
4.9713e-09
1.33387e-08
2.14206e-09
1.83354e-09
6.81647e-09
6.46951e-09
4.61186e-09
6.66062e-09
8.27823e-09
8.77243e-09
9.72035e-09
6.68676e-09
3.58299e-09
1.37559e-09
5.48757e-09
6.42314e-09
1.3207e-08
2.49502e-09
1.99079e-09
5.59555e-09
5.39552e-09
6.28696e-09
5.05102e-09
6.52856e-09
9.40216e-09
1.12753e-08
8.11971e-09
4.81005e-09
3.93664e-09
8.5779e-10
8.1273e-09
1.51107e-08
2.69653e-09
2.19371e-09
4.91627e-09
4.7152e-09
1.00405e-08
8.14911e-09
6.43239e-09
7.44302e-09
1.38563e-08
1.25664e-08
7.37366e-09
4.69183e-09
3.18095e-09
5.3493e-10
1.70935e-08
2.81178e-09
2.34027e-09
4.79186e-09
4.4264e-09
1.42706e-08
1.12676e-08
1.64546e-08
9.12814e-09
1.09421e-08
2.6193e-08
8.52402e-09
7.01628e-09
5.66101e-09
5.4191e-09
2.92518e-10
2.97701e-09
2.56585e-09
5.64081e-09
3.1205e-09
3.18727e-09
8.20565e-09
1.38492e-08
1.13682e-08
1.44148e-08
2.11938e-08
8.54899e-09
7.04165e-09
1.678e-08
1.65748e-08
3.58824e-09
3.95414e-10
3.02264e-09
8.43027e-09
3.54441e-09
3.80801e-09
3.29724e-09
5.94779e-09
1.88384e-08
8.20949e-09
4.11442e-08
1.11855e-08
5.20508e-09
1.95258e-08
7.78472e-08
3.58805e-08
1.35796e-08
8.24922e-09
1.66252e-10
1.21864e-08
4.3938e-09
1.23429e-08
4.46715e-09
4.26201e-09
7.65643e-09
2.92075e-08
6.8491e-09
1.31387e-08
5.01948e-09
1.15073e-08
8.87465e-08
1.08448e-07
5.81486e-08
3.22354e-08
3.14566e-08
6.04798e-09
1.70991e-10
5.50094e-09
6.36553e-09
2.01132e-08
4.63134e-09
5.47611e-09
4.89577e-09
4.18993e-08
5.98455e-09
6.62646e-09
6.67315e-09
5.77752e-08
1.24439e-07
8.12626e-08
7.93324e-08
5.19727e-08
1.84344e-07
4.18403e-08
1.41788e-08
1.83804e-10
1.08482e-08
1.36941e-08
4.28564e-09
6.51908e-09
3.29631e-09
4.15941e-08
5.14653e-09
6.20389e-09
2.19793e-08
1.03885e-07
8.95682e-08
8.96688e-08
5.28885e-08
6.21725e-08
3.07321e-06
8.14983e-07
1.4574e-07
2.57656e-08
2.48678e-10
2.60391e-08
8.38145e-09
4.32032e-09
7.54424e-09
2.64424e-09
2.2234e-08
4.42261e-09
7.6365e-09
5.32493e-08
1.09531e-07
7.56279e-08
5.01933e-08
4.78433e-08
7.20839e-07
5.10075e-05
1.58466e-05
4.10931e-06
5.73502e-07
6.26762e-08
4.41834e-10
9.96716e-09
7.59438e-09
4.9442e-09
9.67401e-09
2.14276e-09
1.31846e-08
4.23098e-09
1.14598e-08
1.02372e-07
3.81134e-08
4.0431e-08
3.82709e-08
1.64174e-07
9.6166e-06
0.000835769
0.000282399
8.26055e-05
1.69272e-05
2.29915e-06
2.65261e-07
9.74969e-10
8.02802e-09
8.45929e-09
6.53764e-09
2.13275e-08
1.61364e-09
8.28883e-09
3.96389e-09
3.68704e-08
2.16951e-08
2.90592e-08
3.59428e-08
5.32721e-08
2.24998e-06
0.000100932
0.000980103
0.000867355
0.000979188
0.0004702
0.000471391
0.000759094
0.000293301
8.78555e-05
1.05813e-05
1.02384e-06
2.42754e-09
8.25686e-09
1.04762e-08
8.64037e-09
1.45633e-08
1.26459e-09
8.80289e-09
4.6693e-09
1.48765e-08
1.95224e-08
3.20123e-08
2.94543e-08
3.95592e-07
1.46634e-05
0.000657916
0.00120811
0.00155338
0.000912749
0.00120758
0.00124558
0.0012459
0.00155446
0.00101309
0.0010122
0.000806942
0.000394394
8.74866e-05
1.68807e-05
1.89708e-06
4.31137e-09
9.37991e-09
1.14198e-08
9.70558e-09
4.98599e-09
1.33466e-09
7.52229e-09
6.38875e-09
1.34938e-08
1.91274e-08
2.63712e-08
6.98336e-08
2.50213e-06
5.45695e-05
0.000563987
0.000568336
7.54435e-05
7.57354e-05
0.00197761
0.00222133
0.000882762
0.000830117
0.00197955
0.00188768
0.0018902
0.00222542
0.00162717
0.00163161
0.000826054
0.000760614
0.000109475
2.07052e-05
1.88928e-06
5.97889e-09
9.64978e-09
9.26922e-09
7.59573e-09
4.04224e-09
2.95157e-08
3.28163e-08
1.63415e-08
9.81296e-09
2.09366e-08
2.72413e-08
2.80391e-07
3.84982e-06
8.46066e-06
8.47307e-06
3.88989e-06
3.88116e-06
0.000435474
0.000434997
5.30707e-05
5.30547e-05
0.00181311
0.00194228
0.00201575
0.00183619
0.00231805
0.000828407
0.000788848
0.000960765
0.000962819
0.001196
0.00119891
0.00181661
0.0015366
0.00154007
0.00194248
0.00201947
0.00183686
0.00231481
0.00147642
0.00116168
0.00131443
0.00160596
0.00147828
0.00116431
0.00131615
0.00160692
0.000825021
0.000824502
0.000126654
1.90887e-05
1.56753e-06
6.38225e-09
8.31311e-09
6.47375e-09
3.594e-09
3.52167e-08
6.60433e-07
4.44195e-07
3.45979e-07
4.52774e-08
1.68784e-08
3.66141e-08
3.5562e-07
5.38473e-07
5.30072e-07
2.97564e-07
2.89773e-07
6.91871e-06
6.93212e-06
2.84335e-06
2.82993e-06
0.00021455
0.000904032
0.000534017
0.000142535
0.000521243
0.001067
0.000903727
0.000213622
0.000534409
0.000142152
0.000521738
0.00106712
2.19496e-05
0.000192258
2.25978e-05
0.000193851
2.19191e-05
0.000192637
2.25882e-05
0.000195519
0.00155558
0.0016347
0.00164165
0.00154249
0.00168649
0.00193003
0.00164995
0.00225115
0.0007863
0.000744269
0.000741496
0.000741777
0.000737626
0.000738602
0.000812888
0.000815941
0.00101195
0.00101609
0.00155549
0.00163283
0.00164143
0.00153798
0.00136311
0.00123442
0.00126713
0.00132814
0.00136337
0.00123985
0.00126823
0.00132866
0.00168618
0.00193064
0.00164916
0.00224663
0.00125059
0.00142205
0.00125125
0.0014159
0.000836548
0.00086829
0.000122156
1.47078e-05
1.03091e-06
6.42535e-09
6.17399e-09
4.05456e-09
2.96546e-09
4.68554e-07
1.54596e-05
5.83006e-06
4.64455e-06
1.41614e-06
8.09999e-07
1.0326e-06
5.03956e-06
5.08748e-06
1.56084e-05
1.57321e-05
5.4095e-07
5.26996e-07
5.07275e-05
4.33025e-05
3.10243e-06
3.01795e-05
3.26678e-06
2.46615e-05
3.10828e-06
3.03001e-05
3.27303e-06
2.53796e-05
6.75997e-06
1.26188e-05
3.43565e-06
9.36053e-06
6.91162e-06
1.27262e-05
3.43328e-06
9.41126e-06
0.000706409
0.000174201
0.000498823
0.000890704
0.000109574
0.000460746
0.000705975
0.000173549
0.000891024
0.000499
0.00010917
0.000460866
2.05167e-05
0.000133328
1.98485e-05
0.000144919
2.06286e-05
0.00013385
1.98501e-05
0.000143944
0.00140908
0.00158661
0.001527
0.00142506
0.00155615
0.00193348
0.0015902
0.00221247
0.000788746
0.000723532
0.000721426
0.000720483
0.000705185
0.000704685
0.000650273
0.000651542
0.000630858
0.000632936
0.000600646
0.000680339
0.000706616
0.000741913
0.000598712
0.000679515
0.000704527
0.00074181
0.000946907
0.00110772
0.000960557
0.000839891
0.000884932
0.00113011
0.000944719
0.00111071
0.000960803
0.000838216
0.000885329
0.00113054
0.00140764
0.00158339
0.00152539
0.00142015
0.00123775
0.0012291
0.00123691
0.00122719
0.00155532
0.00193401
0.00158922
0.00220515
0.00108412
0.00120124
0.00108493
0.00119497
0.000868944
0.00087337
9.62456e-05
9.48197e-06
5.50318e-07
8.01645e-09
4.97338e-09
2.89629e-09
2.50532e-08
6.18831e-06
0.0004507
7.95533e-05
6.33622e-05
0.000130873
0.000229401
2.74259e-05
2.75364e-05
0.000104374
0.000104521
0.000270119
0.000271576
0.000412048
0.00041429
6.15913e-05
2.99452e-05
0.00017425
9.60833e-05
6.40066e-05
3.02693e-05
0.000180289
9.63137e-05
0.00107665
0.000997085
0.000443234
0.000337296
0.00108935
0.00099783
0.000452649
0.000336363
4.50253e-05
5.16437e-05
8.8134e-05
4.87777e-05
4.52905e-05
5.28286e-05
8.86406e-05
4.86034e-05
0.000341532
0.000187599
0.000176778
7.03342e-05
0.000347099
0.000189222
0.000177656
7.05356e-05
0.00136991
0.00158434
0.00149179
0.00141873
0.000840825
0.000750165
0.000723988
0.00072285
0.000715145
0.000714365
0.000705715
0.000704529
0.000667125
0.000667174
0.000381717
0.000498862
0.000342193
0.000496537
0.000384132
0.000495548
0.000345378
0.000493127
0.000406095
0.000537615
0.000357338
0.000512769
0.000411125
0.000535588
0.000363212
0.000509717
0.000527014
0.000600865
0.00066593
0.000692625
0.00052232
0.000597577
0.000661165
0.000691118
0.00106573
0.000912039
0.000923567
0.00106809
0.000802139
0.000828811
0.00106577
0.00090907
0.00092302
0.00106705
0.000798709
0.000828045
0.00136807
0.00158027
0.00148983
0.0014123
0.00118992
0.00118567
0.00118834
0.00118301
0.000867558
0.000821826
6.15223e-05
4.68723e-06
3.03867e-07
1.38599e-08
3.37167e-09
4.48179e-09
5.72585e-07
0.00012282
0.00146151
0.000785189
0.0013121
0.00138916
0.000399866
0.000579921
0.000582925
0.000767245
0.000771011
0.00188553
0.00188661
0.00180381
0.00180549
0.000716559
0.00039161
0.00157169
0.000822101
0.000731453
0.000396046
0.00159846
0.000826992
0.00192706
0.0015468
0.00220768
0.00142663
0.00193701
0.00154756
0.00221862
0.00142643
0.00146958
0.000873719
0.00147686
0.000873956
0.000835938
0.000845946
0.00078482
0.000785126
0.000758337
0.000756905
0.000787682
0.000785488
0.00075094
0.000749585
0.000625065
0.000662406
0.000567502
0.000613678
0.000619173
0.000661329
0.000563662
0.000611916
0.000439767
0.000528256
0.000510764
0.0005678
0.000441665
0.000525869
0.000509613
0.000565862
0.000335985
0.000403998
0.000303803
0.000382192
0.000335306
0.000402711
0.000302304
0.00037969
0.000358378
0.000453701
0.000309046
0.000401659
0.00035804
0.00044861
0.000308164
0.000397106
0.00082726
0.000608699
3.0376e-05
2.40668e-06
2.55345e-07
2.72087e-08
2.46517e-09
9.41216e-08
8.51536e-06
0.00114175
0.00157186
0.00169199
0.00166648
0.00163715
0.00164505
0.00164524
0.00180312
0.00180408
0.0015994
0.00160001
0.00160194
0.00160254
0.00162779
0.00163935
0.00163922
0.00162302
0.00162809
0.00164092
0.00163979
0.00162283
0.00158711
0.0015396
0.001561
0.0015782
0.00158723
0.00154074
0.00156082
0.00157737
0.00216483
0.00119797
0.00204681
0.00139117
0.00217128
0.0011969
0.00205151
0.00138923
0.00172984
0.0015206
0.00194767
0.00149318
0.00173637
0.00152062
0.00195494
0.00149279
0.000796142
0.000833596
0.000899822
0.000827452
0.000826763
0.000820999
0.000817768
0.000765751
0.0007635
0.000687133
0.000686192
0.000577207
0.000628059
0.000521744
0.000556945
0.000575102
0.000627319
0.000521991
0.000556435
0.000396253
0.000448555
0.000453682
0.000498584
0.000396316
0.000447993
0.000454387
0.000498181
0.000306382
0.000389791
0.000305599
0.000388251
0.000800865
0.000222168
1.70537e-05
1.74464e-06
3.27768e-07
1.72285e-08
6.15055e-09
1.99126e-06
0.000232931
0.00139902
0.00162407
0.00175997
0.00200593
0.00139311
0.00152106
0.00152132
0.00166034
0.00166042
0.00143889
0.00143983
0.00145947
0.00145836
0.00144089
0.00143988
0.00145971
0.00145814
0.00151643
0.00151657
0.00145427
0.00153322
0.0015136
0.00147538
0.00145438
0.00153414
0.00151371
0.00147484
0.00139745
0.00138149
0.00136626
0.00141767
0.0013973
0.0013837
0.00136606
0.00141683
0.00164122
0.00149708
0.00164577
0.00149679
0.000779569
0.000782031
0.000868018
0.0010068
0.00100401
0.000967097
0.000961851
0.000892334
0.000889572
0.000831088
0.00082609
0.000736279
0.000784855
0.000771503
0.000730107
0.000736033
0.00077946
0.000769597
0.000731046
0.000702094
0.000618252
0.000651762
0.000681021
0.000702062
0.000617374
0.000651418
0.000681056
0.000541189
0.000588401
0.000463608
0.00052791
0.000542197
0.000587987
0.000465699
0.000527715
0.000348233
0.000426619
0.000406683
0.000478305
0.000348624
0.000426065
0.000408359
0.000478068
0.000738419
0.000122171
1.5822e-05
2.2567e-06
1.1701e-07
1.62184e-07
3.38072e-05
0.00128528
0.00160929
0.00165831
0.00175718
0.00166829
0.00146718
0.00147322
0.00132515
0.00132843
0.00135092
0.00137457
0.00137547
0.00140893
0.001353
0.00137473
0.00137689
0.00140884
0.00150455
0.00150538
0.00131988
0.00129643
0.00134119
0.00134569
0.00132212
0.00129649
0.00134114
0.0013451
0.00135965
0.00137559
0.0013571
0.00137153
0.00136059
0.00137534
0.00135677
0.00137138
0.0013395
0.0013132
0.00128252
0.00136778
0.00133921
0.00131529
0.00128232
0.00136762
0.000734563
0.000768706
0.000795742
0.000931583
0.00105789
0.00105405
0.00098802
0.00098094
0.000927639
0.000923701
0.000825381
0.000805584
0.000858984
0.000854096
0.000815496
0.000803241
0.000857422
0.000846337
0.000769983
0.000810421
0.000795464
0.000770037
0.000769554
0.000809533
0.000794872
0.000768254
0.000732781
0.00063239
0.000671817
0.000718338
0.000732455
0.000631826
0.000671373
0.000715224
0.000548697
0.000618685
0.000553071
0.000618255
0.000376725
4.74353e-05
1.35764e-05
4.1407e-07
3.60378e-06
0.000925001
0.00150103
0.00165956
0.00166798
0.00157712
0.00155083
0.00155004
0.00156185
0.00156096
0.00107902
0.001076
0.00135714
0.00135485
0.00125745
0.00124744
0.00129567
0.00131119
0.00125919
0.00124759
0.00129672
0.0013112
0.00132805
0.00115067
0.00132979
0.00125347
0.00132826
0.00115264
0.00132982
0.00125371
0.00125343
0.00121465
0.00124361
0.00126513
0.00125405
0.00121473
0.0012436
0.00126418
0.00126903
0.0012444
0.00128921
0.00126831
0.00127049
0.00124421
0.00128932
0.0012682
0.000675908
0.000721673
0.000775142
0.000848979
0.00094315
0.000939604
0.00106063
0.00105728
0.00107311
0.00106817
0.00102241
0.000949031
0.00105141
0.000996843
0.00101035
0.000947088
0.00104127
0.000994724
0.00100875
0.000937117
0.00094662
0.000903849
0.000894318
0.000859248
0.000999447
0.000935054
0.000945475
0.000903133
0.000887174
0.000858132
0.000854652
0.000824947
0.000850587
0.000824353
0.00083094
0.000835804
0.000853009
0.000804881
0.000830557
0.000837325
0.000852541
0.000803128
0.000106674
4.15208e-05
1.24045e-06
9.12853e-05
0.00135375
0.00159339
0.00163779
0.00154964
0.00136843
0.00143495
0.00143361
0.00139988
0.00139853
0.00111827
0.000831001
0.00107748
0.00129811
0.00113736
0.00114549
0.000831693
0.00110001
0.00114488
0.00107594
0.00128505
0.00113609
0.00135069
0.00118077
0.00136834
0.00117782
0.00134444
0.00117988
0.00135851
0.00117676
0.00121488
0.00118134
0.00122795
0.00121449
0.00121594
0.00118137
0.00122844
0.00121442
0.00119812
0.00108981
0.00119809
0.00108941
0.00122408
0.00125429
0.00122405
0.00125361
0.00123675
0.00120082
0.00123797
0.00120062
0.000283363
0.000673798
0.000709434
0.000811505
0.000902778
0.000900508
0.000953761
0.000950852
0.000943498
0.000938937
0.00104839
0.00104426
0.00104488
0.00112819
0.00104423
0.00114182
0.00101172
0.00111769
0.00104435
0.00111858
0.00104169
0.0011363
0.00101125
0.00111036
0.00106648
0.000980176
0.00105931
0.000979567
0.00105239
0.000972505
0.000999564
0.000907457
0.000950996
0.000888796
0.00104742
0.00097171
0.0010005
0.000903513
0.000950654
0.000887959
0.000884117
0.000885034
0.000883248
0.000884437
9.25644e-05
3.34774e-06
0.00114347
0.0014749
0.0015998
0.00157123
0.00135596
0.000964982
0.000964136
0.000801499
0.000801161
0.00118025
0.00117801
0.0010704
0.00106898
0.000852314
0.00123187
0.00113062
0.00105402
0.00134643
0.00117219
0.000846579
0.00122387
0.00105336
0.00113023
0.00134012
0.00117178
0.00124776
0.00112442
0.00133744
0.00116566
0.00124393
0.00112417
0.00133224
0.00116535
0.00117467
0.00117805
0.00117471
0.00117792
0.000208416
0.000650194
0.000662871
0.000707745
0.000876325
0.00096666
0.000962524
0.000972233
0.000968568
0.000974102
0.000944784
0.000976851
0.000919948
0.00096587
0.000941573
0.000972645
0.000918235
0.00111095
0.00119315
0.00102488
0.00103251
0.000967234
0.00105775
0.00110661
0.00118676
0.00102415
0.00102649
0.000965701
0.00105683
0.00108531
0.00104851
0.00118826
0.00114165
0.00108484
0.00104796
0.00118091
0.00113436
0.0011037
0.00103294
0.00109787
0.00103229
0.00108624
0.00102462
0.000956798
0.000958619
0.00108343
0.00102398
0.000956763
0.000958153
7.57691e-06
0.00131822
0.00151106
0.00157844
0.00144804
0.00087806
0.000757784
0.000756193
0.000743754
0.000742284
0.000900291
0.0010384
0.000984752
0.000899937
0.000900151
0.00103466
0.00098466
0.000896183
0.000805431
0.000804583
0.00113799
0.00105799
0.00122597
0.0011186
0.00113496
0.00105768
0.00122203
0.00111822
1.53096e-05
0.000471954
0.000642745
0.000647526
0.000720293
0.00085348
0.000851443
0.0010224
0.00101785
0.0010011
0.000994439
0.000985524
0.000981296
0.00105394
0.000954018
0.00102051
0.000948457
0.00105138
0.000952973
0.00102438
0.000948013
0.00118581
0.00110586
0.00107478
0.00104636
0.00104964
0.00099655
0.00118305
0.00110318
0.0010461
0.00107441
0.00104941
0.000996198
0.00110869
0.00118568
0.00110805
0.00117743
0.00138546
0.00151509
0.00150467
0.00118095
0.00065897
0.00065598
0.000542345
0.000537072
0.00072021
0.000713235
0.00070461
0.000698707
0.0008532
0.000953469
0.000934662
0.000858969
0.000853169
0.000949949
0.000934235
0.000857925
0.000720277
0.000717854
0.000773575
0.000766686
0.000717835
0.000717205
0.000771672
0.000766496
0.0010675
0.00101659
0.00106471
0.00101621
2.86263e-05
0.000634138
0.000625231
0.000632048
0.000724117
0.000845259
0.000842479
0.000990126
0.000984443
0.0010337
0.00102329
0.000997212
0.00106578
0.000986046
0.00101905
0.000996501
0.00106027
0.000984912
0.00101192
0.00107173
0.000988146
0.00105897
0.00100697
0.00107278
0.000987388
0.00106619
0.00100679
0.00140759
0.00145782
0.001239
0.000732619
0.000431044
0.000415473
0.000435086
0.00043552
0.000760209
0.000721279
0.000633286
0.000696385
0.000677695
0.000632532
0.000750303
0.000720357
0.000630115
0.000671733
0.000674885
0.000594848
0.00054643
0.000524097
0.000844451
0.00092038
0.000910305
0.000842816
0.000843993
0.000918387
0.000910011
0.000839616
0.000804248
0.000765643
0.00079921
0.000765159
4.99129e-05
0.000627254
0.000604086
0.000620985
0.000680885
0.00067937
0.000797878
0.000795289
0.000781625
0.00078119
0.00091666
0.000911073
0.00103878
0.00099902
0.00113064
0.00103148
0.00112161
0.00102952
0.00101947
0.000993229
0.00111252
0.00102928
0.00110839
0.00102825
0.00110875
0.00103332
0.00110143
0.00103234
0.0011155
0.00104244
0.00111747
0.00104184
0.00136287
0.00118553
0.000809041
0.000562661
0.000560385
0.000425759
0.000425712
0.000379082
0.000379415
0.000444901
0.000444792
0.000761102
0.000728966
0.000613091
0.000655077
0.000675898
0.000595141
0.000745453
0.000727418
0.000609352
0.000633077
0.000672131
0.000561544
0.000345405
0.000440383
0.000467478
0.000507659
0.000301543
0.000434799
0.000424682
0.000498716
8.33722e-05
0.000612373
0.000586896
0.000628129
0.000729662
0.000724979
0.000800326
0.000795621
0.000830179
0.00082606
0.00106912
0.00099316
0.000890481
0.000942862
0.000915351
0.000820485
0.000891278
0.000940433
0.000914826
0.000821651
0.00106025
0.000991768
0.00113876
0.00114568
0.00106254
0.0010713
0.00112008
0.00112803
0.00106167
0.00107002
0.00114696
0.00109652
0.00113576
0.00109558
0.00101147
0.000713723
0.000608609
0.000516578
0.000514191
0.000421408
0.000420969
0.000255881
0.000340224
0.000447524
0.00034715
0.000411826
0.000390114
0.000250252
0.000348344
0.000449471
0.000356162
0.000414266
0.000393088
0.000495958
0.000494025
0.00057655
0.000521398
0.000570819
0.000493847
0.000303158
0.00039068
0.000279048
0.000379414
0.000130099
0.000597418
0.000587419
0.000629019
0.000625096
0.000697606
0.000691865
0.000680119
0.000674155
0.000757069
0.000750396
0.000794486
0.000853622
0.000888248
0.000836871
0.000910393
0.000864767
0.000783144
0.000907615
0.000863968
0.0008483
0.000880678
0.000836008
0.00102975
0.000994153
0.000922803
0.00090349
0.00092347
0.00102146
0.000903158
0.000993294
0.000598545
0.000599187
0.000519477
0.000454919
0.000452515
0.000350863
0.000349828
0.000261774
0.00034893
0.000479267
0.000402858
0.000427399
0.000449175
0.000268021
0.000352077
0.000477634
0.000405689
0.000427223
0.000446727
0.000451006
0.000526318
0.000476083
0.000523003
0.000441094
0.000518495
0.000468114
0.00051908
0.000249717
0.000350141
0.000244785
0.000348335
0.000186724
0.000588923
0.000611548
0.000678993
0.000673926
0.000677664
0.000670231
0.000698367
0.000689533
0.000849133
0.000799738
0.000834522
0.000773827
0.000764994
0.000674902
0.000840472
0.000798094
0.000832834
0.00076563
0.000763879
0.000668498
0.000879874
0.000912205
0.000829473
0.000872149
0.000906278
0.000871666
0.000872954
0.000828975
0.000545943
0.00049976
0.000398416
0.000399344
0.000399109
0.000399711
0.000515048
0.000515964
0.000429871
0.000434737
0.000518796
0.000428728
0.000426687
0.000513572
0.000340657
0.000385282
0.000484022
0.000450373
0.000453288
0.000479375
0.000344193
0.000386109
0.000480651
0.000442887
0.000450564
0.000467677
0.000454166
0.000492209
0.000445028
0.000488313
0.000261976
0.000591963
0.000654202
0.000680183
0.000675104
0.000682038
0.00067425
0.00065227
0.000894639
0.000735147
0.000730354
0.000749436
0.000743926
0.000637123
0.000738701
0.000741092
0.000883637
0.000722683
0.000728569
0.00082644
0.000787868
0.0007605
0.000751502
0.000818203
0.00078694
0.000751584
0.000750677
0.000868345
0.000837566
0.000861676
0.000837088
0.000510388
0.000441694
0.000341428
0.000598394
0.000341458
0.000598436
0.000739784
0.000739618
0.000362239
0.000410743
0.000508842
0.00041191
0.000515054
0.000526531
0.000323146
0.000568732
0.000402955
0.000352742
0.000503293
0.000405325
0.000510596
0.000519783
0.000316057
0.000556282
0.000473144
0.000466706
0.000469319
0.000452683
0.000432242
0.000478695
0.000423816
0.000474927
0.000364761
0.000603305
0.000664849
0.000705863
0.000701443
0.000658189
0.00074507
0.000737885
0.000703712
0.000690511
0.000786364
0.000698356
0.00067927
0.000782167
0.000741079
0.000716619
0.000732676
0.00070343
0.000729973
0.000731976
0.000707404
0.000702763
0.000810473
0.000807817
0.000770589
0.000798811
0.000802643
0.000807311
0.000761827
0.000798434
0.000557752
0.000346786
0.000512655
0.00048829
0.000301656
0.000625065
0.000511284
0.000485594
0.000298764
0.000624611
0.000704013
0.000704502
0.000383652
0.000336824
0.000417915
0.000480143
0.000480638
0.000414489
0.000372328
0.000409319
0.000330673
0.00047548
0.000475372
0.000410993
0.000468659
0.000446071
0.000465098
0.00043499
0.000467884
0.000605505
0.000695532
0.000695646
0.000690481
0.000684952
0.000744093
0.000732493
0.000695032
0.000736645
0.000723424
0.000718638
0.00075381
0.000707174
0.000626134
0.000918742
0.000691081
0.000731922
0.000720959
0.000708829
0.000749976
0.000705868
0.000618126
0.000910436
0.000745396
0.000730189
0.000767604
0.0007261
0.000736179
0.000767559
0.000722072
0.000725616
0.000521972
0.000713073
0.000812083
0.000811117
0.000712705
0.00081686
0.000815563
0.000531094
0.000546763
0.000454607
0.000546659
0.000398205
0.00066296
0.000498573
0.00062339
0.000714314
0.000544044
0.000631867
0.000517923
0.000548238
0.000455027
0.000546834
0.000399186
0.0006534
0.000484675
0.00061792
0.000712901
0.000531782
0.000623988
0.000355602
0.000390417
0.000424647
0.000474962
0.000346735
0.000390422
0.000420822
0.00047496
0.000569649
0.000532964
0.000609308
0.000751082
0.000790892
0.000663958
0.000740978
0.0007921
0.000663546
0.000591185
0.00069726
0.000676371
0.000705664
0.000670829
0.000744089
0.000694108
0.000740822
0.000668948
0.000706978
0.000671936
0.000739806
0.000740516
0.000693436
0.000668401
0.000748998
0.000785905
0.000740368
0.000786192
0.000229486
0.000656954
0.000777475
0.000657051
0.00077784
0.00094674
0.000945596
0.000436286
0.000482298
0.000568847
0.000514263
0.000520296
0.000568017
0.000564851
0.000621177
0.000695054
0.00060898
0.000691174
0.000670872
0.000585096
0.000699831
0.000436631
0.000469806
0.000514294
0.000565808
0.000506598
0.000562892
0.000614996
0.000553228
0.000692157
0.0005989
0.000685783
0.000666056
0.000576701
0.000694933
0.000450411
0.000399086
0.000557296
0.000539473
0.000395296
0.000365391
0.000343617
0.000707583
0.000762474
0.000771799
0.000756017
0.000707607
0.000926273
0.0008133
0.00077586
0.000683674
0.0007618
0.000761599
0.000753892
0.000704878
0.000913504
0.00079373
0.000775214
0.00065813
0.000738902
0.000818317
0.000636528
0.000708491
0.000807712
0.000685325
0.000704254
0.00070831
0.000713158
0.000689396
0.000704675
0.000707577
0.000712579
0.000240416
0.000648221
0.000643286
0.000553538
0.000833062
0.000650042
0.000645199
0.000556047
0.000833472
0.00100474
0.00100402
0.000503201
0.000549453
0.000579278
0.000627403
0.000537144
0.000518462
0.000595146
0.000651684
0.000599802
0.000571245
0.000489976
0.000545526
0.000566955
0.000623451
0.000524546
0.000587884
0.000517523
0.000649467
0.000597077
0.000571028
0.000336591
0.00025642
0.000403297
0.000389948
0.000253541
0.000268738
0.000253029
0.000744443
0.00079049
0.000749584
0.000762502
0.000792659
0.000737804
0.000738178
0.000770718
0.000749045
0.000762246
0.000766842
0.000737127
0.000543859
0.000666806
0.000697519
0.00073013
0.000770719
0.000765132
0.000553004
0.0010911
0.00052378
0.000635391
0.000691856
0.000694563
0.000760829
0.000758878
0.000539106
0.00106683
0.000628675
0.000939462
0.000939637
0.000665019
0.000634201
0.000538918
0.0006468
0.000518484
0.000779147
0.000667326
0.000637978
0.000535352
0.000643861
0.000523687
0.00078014
0.000541049
0.000491323
0.000484386
0.000590303
0.000523049
0.000547164
0.000529718
0.00048788
0.000487746
0.000588215
0.000522657
0.000548444
0.000486414
0.0002996
0.00039089
0.000859865
0.000465826
0.000378967
0.000861492
0.000462978
0.000294041
0.000171278
0.000264824
0.000811039
0.000780341
0.000791181
0.000733643
0.000783743
0.00078033
0.000756286
0.000732846
0.000555792
0.000425915
0.000715182
0.000632532
0.000709244
0.000578304
0.00052871
0.000413527
0.000675758
0.000708892
0.000633714
0.000578995
0.000444599
0.000599573
0.000449664
0.000600172
0.000449918
0.000599082
0.000639247
0.000540701
0.000649558
0.000514256
0.000502286
0.000560471
0.000516176
0.000603168
0.000644146
0.000538426
0.000647754
0.000520258
0.000495826
0.000557667
0.000518835
0.000458468
0.000500178
0.000460583
0.000501031
0.000943432
0.000364465
0.000358535
0.000368705
0.000970306
0.000492538
0.00106104
0.000457045
0.000366285
0.00096581
0.000480515
0.00103426
0.00045428
0.000257358
0.000274679
0.000442512
0.000607878
0.000394163
0.000644808
0.000709332
0.000536475
0.000423463
0.000571868
0.000380849
0.000713292
0.000649806
0.000538542
0.000210627
0.000675791
0.000879318
0.000675962
0.000879883
0.000392405
0.000394128
0.000441995
0.000606995
0.000443959
0.000598674
0.000444377
0.000527996
0.000498743
0.000559287
0.000454351
0.000464667
0.000508569
0.000446076
0.00061463
0.000447992
0.000601827
0.000452732
0.000531687
0.000493958
0.000557396
0.00046233
0.000457053
0.000506829
0.00110363
0.00037551
0.000433938
0.000374421
0.000433315
0.000356142
0.00105624
0.000507464
0.00110466
0.000481726
0.000367985
0.000529513
0.000354538
0.0010801
0.000502124
0.00109746
0.000491659
0.000357741
0.000531116
0.000347188
0.000348358
0.0003962
0.000599497
0.000375859
0.00060341
0.000228424
0.0010549
0.00106885
0.00105643
0.00106918
0.000560602
0.000704696
0.000561765
0.00070606
0.000473861
0.000473713
0.000501401
0.000369046
0.000542251
0.000372243
0.000478174
0.000394746
0.000483353
0.000385447
0.000500718
0.000469845
0.00051445
0.000441068
0.000504872
0.000370891
0.000542955
0.000376909
0.000483971
0.000399863
0.000486288
0.000396485
0.000503061
0.000463509
0.000513093
0.000445999
0.000642832
0.000436952
0.000453147
0.000436359
0.000449281
0.00046431
0.000463494
0.000390528
0.000994782
0.000476339
0.000979975
0.000463559
0.000585875
0.000362555
0.000580319
0.000363061
0.000362548
0.000543668
0.000387824
0.00100966
0.000467389
0.000964678
0.000471309
0.00058494
0.000356498
0.000579441
0.0003672
0.000346112
0.000545219
0.000342821
0.000967587
0.000900013
0.000967646
0.000899255
0.000901223
0.00095695
0.000902401
0.000957232
0.000497706
0.000595629
0.000499435
0.000597421
0.000538516
0.000491892
0.000539446
0.000500804
0.000540203
0.000495135
0.000541277
0.000504196
0.000461797
0.000354104
0.000454463
0.000376622
0.00046456
0.000356137
0.000455693
0.00038172
0.000388184
0.000437872
0.000406619
0.000429623
0.000394447
0.000497462
0.000504997
0.000495077
0.000500703
0.000494088
0.000492308
0.000828898
0.000464955
0.00092763
0.000444018
0.00057064
0.000391259
0.000577819
0.000383168
0.000548365
0.000354031
0.000515933
0.00036795
0.000835449
0.000454909
0.000911915
0.000447558
0.000570046
0.000390536
0.000576201
0.000389504
0.000547379
0.000345399
0.000515357
0.000365487
0.000294791
0.000564439
0.000866585
0.00081526
0.00086681
0.000814738
0.000791711
0.000863452
0.000793133
0.000863845
0.000565042
0.000416815
0.000551206
0.000408243
0.000598249
0.000529511
0.000635705
0.000464515
0.000571984
0.000423008
0.000557101
0.000414764
0.00060239
0.000529445
0.000635953
0.000468748
0.000543765
0.000512778
0.000534438
0.000536345
0.000544744
0.000516552
0.000535875
0.000539434
0.000264605
0.000305381
0.000436982
0.000298759
0.000431905
0.000457504
0.000365305
0.000449334
0.000364579
0.000544388
0.000554166
0.000539185
0.000548436
0.000825363
0.000532586
0.000765796
0.000468451
0.000830588
0.000524305
0.000761533
0.000471743
0.000650649
0.000392971
0.00059418
0.000428858
0.000650984
0.000392307
0.00059414
0.000430663
0.000363374
0.000911811
0.000790225
0.000911741
0.000791939
0.000392787
0.000782899
0.000763166
0.000783463
0.00076292
0.000752812
0.00067667
0.000741233
0.000684109
0.000811467
0.000776027
0.000817473
0.000760119
0.000756129
0.000678508
0.000742487
0.000690603
0.000812995
0.000770802
0.000815358
0.000763315
0.000492875
0.000406349
0.000495196
0.000391545
0.000529958
0.000521607
0.000597979
0.00043427
0.000498044
0.000414229
0.000500024
0.000398972
0.000532501
0.000521537
0.000598226
0.000437904
0.000676509
0.000459423
0.000315158
0.000417719
0.000319668
0.000406285
0.000527427
0.000437347
0.000515802
0.000432767
0.000748569
0.000560952
0.000749654
0.000552164
0.000745293
0.000576961
0.000752999
0.000548211
0.000748676
0.000548578
0.000744519
0.00054729
0.000747145
0.000563367
0.000745986
0.000546931
0.000647556
0.000548338
0.000662828
0.000465474
0.000647131
0.000537566
0.000663883
0.000464857
0.00036486
0.000797975
0.000450273
0.000799341
0.000448694
0.000804665
0.000704316
0.000803657
0.000705047
0.000394312
0.000739352
0.000702204
0.000757968
0.000672832
0.000726155
0.000686463
0.000772735
0.000662189
0.000741402
0.000697717
0.000755739
0.000676838
0.000726892
0.000677109
0.000767793
0.000663213
0.000689257
0.000636228
0.000683229
0.000638299
0.000735292
0.000727523
0.000746099
0.000701877
0.000691873
0.000639231
0.000684399
0.00064645
0.000736429
0.000719329
0.0007438
0.000706101
0.000587245
0.000584852
0.000410915
0.000456136
0.000396718
0.000440232
0.000409953
0.000416444
0.000406714
0.000408121
0.000778389
0.000581873
0.000756391
0.000536095
0.000806627
0.000485852
0.000840588
0.000490036
0.000776516
0.000562828
0.000746736
0.000526842
0.000815046
0.000478416
0.000831055
0.000489173
0.000671175
0.000588061
0.000666497
0.00059586
0.000672509
0.000597221
0.00066813
0.000587951
0.000672747
0.000571458
0.000668653
0.000583449
0.000672681
0.000585969
0.000668354
0.000581646
0.000328585
0.000397822
0.000626862
0.000275232
0.000627349
0.000275756
0.000721988
0.000660879
0.000767421
0.000699398
0.000757543
0.000739584
0.000603663
0.000709862
0.000628303
0.000688527
0.000713369
0.000647671
0.000763926
0.00068717
0.000751888
0.000734657
0.000587668
0.000699537
0.000613401
0.000680452
0.000564485
0.000665145
0.000664571
0.00069104
0.000630404
0.000655459
0.000619232
0.000665685
0.00065745
0.000688769
0.000632774
0.000654694
0.000616868
0.000713007
0.000699553
0.000708454
0.000690591
0.000713413
0.00068936
0.000706464
0.000691671
0.000445863
0.000650959
0.000612756
0.000657871
0.000603843
0.000651573
0.00050187
0.000545262
0.000490345
0.000531568
0.000799637
0.000481352
0.000839824
0.000452023
0.000790202
0.000527495
0.000938198
0.00047574
0.000796409
0.000476025
0.000820173
0.000452628
0.00079531
0.000522886
0.000912847
0.000474762
0.000640186
0.000601825
0.000660691
0.000571185
0.000624326
0.000444452
0.000586107
0.000515521
0.000643278
0.000582874
0.000662423
0.000551168
0.000625338
0.000432382
0.000585841
0.000503699
0.000370302
0.000261621
0.00023366
0.000263714
0.000235703
0.000643608
0.000512489
0.00026236
0.000510531
0.000261901
0.000640784
0.000694848
0.000672446
0.000725433
0.000664383
0.000692851
0.000551316
0.000658625
0.00058994
0.00061854
0.000625201
0.000684395
0.000668959
0.000722339
0.000649515
0.000688454
0.000533088
0.000651209
0.000572614
0.000612654
0.00102154
0.000617694
0.000633174
0.000648808
0.000598918
0.000605134
0.000587639
0.000617943
0.000625326
0.000647159
0.000599681
0.000604109
0.000582081
0.000318758
0.000641383
0.000748168
0.000699169
0.000795292
0.000689152
0.000786741
0.000514709
0.000494826
0.000692785
0.000555249
0.000781243
0.00091857
0.000613907
0.000989958
0.000589403
0.000851289
0.000493209
0.000499953
0.000675777
0.000536498
0.000762293
0.000900722
0.000598744
0.000972045
0.000573284
0.00083385
0.000608706
0.000432981
0.000599588
0.00040716
0.000649
0.000482872
0.000607027
0.000428851
0.000597054
0.000409758
0.000647323
0.000487051
0.000673603
0.000399012
0.000620601
0.00049498
0.000678177
0.000386905
0.000622415
0.000481564
0.000487756
0.000258287
0.000258217
0.000258547
0.000258489
0.000308242
0.000322784
0.000309653
0.000323281
0.00117344
0.000557755
0.000441567
0.000544027
0.000373181
0.000476071
0.000248287
0.00058096
0.000221839
0.000560802
0.000441285
0.00054408
0.000374146
0.000475363
0.000243017
0.000566073
0.000221007
0.000645717
0.000666849
0.000521026
0.000595329
0.000562362
0.000592381
0.00063085
0.000663685
0.000503046
0.000590577
0.000545255
0.000587486
0.00134044
0.000228977
0.000627609
0.000691213
0.000878315
0.000838796
0.000868717
0.000831852
0.000756231
0.000823696
0.000744228
0.000811733
0.000434842
0.000513456
0.000575647
0.000638461
0.000567737
0.00060436
0.000693653
0.000725847
0.000607699
0.000620202
0.000435036
0.000504014
0.000632477
0.000573944
0.000561187
0.000603348
0.000683198
0.000725949
0.000602365
0.00061904
0.000533217
0.000338469
0.000597403
0.000322113
0.000554877
0.000405891
0.000532146
0.000335082
0.000599093
0.000325032
0.000552458
0.00041608
0.000452977
0.00122133
0.000314104
0.000299038
0.000312688
0.000292577
0.000290517
0.000262049
0.00047636
0.000304095
0.000462402
0.000462561
0.000362976
0.000452148
0.000332798
0.000447782
0.000286791
0.000254539
0.000471371
0.000300782
0.000457816
0.000455433
0.000363281
0.000450836
0.000331598
0.00044514
0.00147547
0.000442467
0.000416762
0.000500764
0.000350453
0.000314248
0.000241922
0.000444841
0.000416953
0.000501381
0.000351789
0.000312237
0.000238301
0.00135598
0.000161174
0.000628134
0.000635016
0.000790531
0.000700899
0.000785627
0.000697142
0.000900954
0.000817731
0.000889155
0.000809643
0.00083512
0.00076726
0.000777743
0.000826369
0.000871469
0.000886845
0.000926161
0.000885149
0.000831286
0.000751449
0.000773861
0.000808778
0.000869814
0.000867514
0.000919932
0.00087167
0.000441317
0.000559463
0.000705321
0.000727619
0.000641822
0.000684515
0.000433871
0.000559057
0.000693802
0.000727738
0.000635867
0.000684692
0.00119575
0.000452551
0.000504568
0.0004533
0.000505707
0.00155392
0.0004262
0.000423277
0.000426683
0.000422433
0.000270853
0.000315864
0.0004154
0.000413761
0.00034538
0.000406981
0.000392998
0.000447066
0.000373852
0.00042422
0.000262472
0.000312175
0.000410045
0.000410903
0.000342657
0.00040547
0.000394456
0.000448103
0.000374737
0.000424693
0.0015023
0.000333189
0.00025122
0.000330177
0.000244819
0.00131211
0.000104838
0.0006397
0.000614274
0.00064322
0.000740988
0.000729252
0.000735043
0.000723982
0.000944633
0.00102352
0.000857737
0.000839932
0.000823041
0.000896289
0.000676118
0.000891684
0.000759524
0.000813724
0.00100186
0.00093026
0.000855274
0.000828169
0.000820165
0.000894108
0.00066419
0.00088307
0.00074968
0.000810742
0.000859469
0.000807335
0.000831672
0.000904844
0.000876324
0.000987823
0.000858862
0.000782557
0.000832786
0.000878072
0.000875207
0.000965979
0.00110859
0.00159178
0.000593554
0.000486498
0.000593808
0.000487356
0.00160614
0.000516408
0.000397021
0.000492586
0.000429367
0.000515533
0.000517572
0.000398862
0.000492858
0.000431041
0.000516343
0.000375715
0.000413098
0.000391424
0.000451187
0.000397783
0.00043142
0.000375458
0.000412822
0.000392298
0.000451375
0.000399113
0.00043177
0.00146781
0.00123004
6.41463e-05
0.000654432
0.000621988
0.000611812
0.00070737
0.000645327
0.000702097
0.000642634
0.000691991
0.000671919
0.00068532
0.000666436
0.00101468
0.000877185
0.000845873
0.000893574
0.000795377
0.000777166
0.000726811
0.000718243
0.000737881
0.000716021
0.000995398
0.00086542
0.000892398
0.000845404
0.000787591
0.000776539
0.000718939
0.000716978
0.000732718
0.000715406
0.000916611
0.00104433
0.000915498
0.0010192
0.00162452
0.000612123
0.00110334
0.000611268
0.00110135
0.00166825
0.000692085
0.000628797
0.000691646
0.000629226
0.00158711
0.00050429
0.000386209
0.000465128
0.000424004
0.000491436
0.000561057
0.000353077
0.000479452
0.000504611
0.000386857
0.000465423
0.000424401
0.000490072
0.00056084
0.00034997
0.000480304
0.000377885
0.000444741
0.000378155
0.00044511
0.00139995
0.00100644
3.76058e-05
0.000661135
0.000640194
0.000621977
0.000659882
0.000757121
0.00074239
0.000750925
0.000738202
0.000823881
0.00072808
0.00072102
0.000667129
0.000738631
0.000822871
0.000719982
0.000718136
0.000662489
0.000731529
0.000784711
0.000807559
0.000719717
0.000701071
0.000749768
0.000756563
0.000780129
0.000807114
0.000713705
0.000700321
0.000747598
0.000756128
0.00166104
0.00173207
0.000729588
0.00121358
0.000729153
0.00121149
0.00165931
0.000701835
0.000697063
0.000674724
0.000726821
0.000546262
0.00056901
0.00068148
0.000542934
0.000568682
0.000701819
0.000695132
0.000674659
0.000725793
0.000681774
0.00153013
0.000453243
0.000334819
0.000445418
0.000322119
0.000362012
0.000453994
0.000453617
0.00033352
0.000445677
0.000319908
0.000358289
0.000453739
0.00125516
3.77255e-05
2.05489e-05
0.000465136
0.000656333
0.00064629
0.000674885
0.000750432
0.000750795
0.000748136
0.000749261
0.000774449
0.000699844
0.000767338
0.000699665
0.000745512
0.000741587
0.00071549
0.000765402
0.000737384
0.000841281
0.00080843
0.000774902
0.000744893
0.000735119
0.000714734
0.000759086
0.00072312
0.000834342
0.000798075
0.000773119
0.000730321
0.000745619
0.000725564
0.000745148
0.00180672
0.00161082
0.00184241
0.00160872
0.00184159
0.00171866
0.000779351
0.00126086
0.000778877
0.00125926
0.00163101
0.000733147
0.000750572
0.000612285
0.000722055
0.000606738
0.000754034
0.000700501
0.000709498
0.000753386
0.00074713
0.000610029
0.000606594
0.000733268
0.000750375
0.000722032
0.000754279
0.000701234
0.000709335
0.000752769
0.000747151
0.00139625
0.00042671
0.000302885
0.000426913
0.000300831
0.000676747
8.8961e-07
1.04163e-05
0.00021184
0.000632005
0.000664359
0.000694941
0.000821465
0.000905763
0.000941037
0.000901904
0.000938033
0.000826269
0.000818659
0.000869697
0.000873052
0.000854435
0.000770203
0.000842392
0.000813085
0.00081724
0.000870265
0.000865272
0.000853237
0.000769101
0.000838217
0.000759575
0.000795889
0.000773211
0.000803168
0.000825251
0.000808912
0.000758839
0.000790797
0.000772675
0.000795624
0.000813779
0.000808505
0.00194356
0.00184047
0.00159644
0.00185832
0.00159393
0.00185792
0.00164907
0.000724498
0.000747031
0.0008942
0.000784574
0.000816228
0.00086405
0.0012937
0.000722626
0.00074673
0.000894151
0.000783638
0.000815981
0.0008635
0.00129244
0.00151657
0.000771967
0.00077987
0.000767104
0.000779374
0.000772062
0.000780353
0.000766064
0.000779393
0.00117701
2.10215e-05
1.09996e-08
4.72905e-06
9.59702e-05
0.000209653
0.000671964
0.000717125
0.000793713
0.00093948
0.000925991
0.000935983
0.000923019
0.000945915
0.000929189
0.000939501
0.000924998
0.000863167
0.000869109
0.000876403
0.000889186
0.000899364
0.000881789
0.00093647
0.000928366
0.00097073
0.000912315
0.000849902
0.000868749
0.000875649
0.000886444
0.000898884
0.000879099
0.000921454
0.000922206
0.000967441
0.000911345
0.000806941
0.000836727
0.00080647
0.000828696
0.00148075
0.00166047
0.00154333
0.0015181
0.00134219
0.00151557
0.00134092
0.00153046
0.00076399
0.000798453
0.0009824
0.000887566
0.000903641
0.00101832
0.00146849
0.00126094
0.00122726
0.00112834
0.000761566
0.000798102
0.000982156
0.000887254
0.000903268
0.00101707
0.00146678
0.00126031
0.0012272
0.00112817
0.00122847
0.000212261
1.10775e-06
1.25488e-09
1.79822e-06
4.37551e-05
7.80321e-05
0.00066501
0.000737006
0.000783494
0.000936482
0.00104875
0.00107496
0.001043
0.00106995
0.00101493
0.000936993
0.000954172
0.00104853
0.000961467
0.000970477
0.00101031
0.0010069
0.000935428
0.000953917
0.00104214
0.000960607
0.000967055
0.00100489
0.000924317
0.0009443
0.00102398
0.000959247
0.000923694
0.000941649
0.00101863
0.000958634
0.00151991
0.00176529
0.00176547
0.00171008
0.00186229
0.00171016
0.00186326
0.00165849
0.00176193
0.00115274
0.00145643
0.00122795
0.00115082
0.00145309
0.0012274
0.00135034
0.000820224
0.000851509
0.00105322
0.00102453
0.000995828
0.00112667
0.0012897
0.00115158
0.000819192
0.000851406
0.00105294
0.00102462
0.000995695
0.00112556
0.00128951
0.00115146
0.000901596
7.72512e-06
5.38832e-08
1.54237e-09
6.15705e-07
1.46675e-05
3.41456e-05
0.00022799
0.000748507
0.000795593
0.000880218
0.00102965
0.00111653
0.00111822
0.00110615
0.00111049
0.00105899
0.000983707
0.000978508
0.00106726
0.00099258
0.00105555
0.00111672
0.00103911
0.00115027
0.00103253
0.00105222
0.000983024
0.000977875
0.00106281
0.000992057
0.00105068
0.0011008
0.00103526
0.00114257
0.0010314
0.000453438
0.00142847
0.00157898
0.00157924
0.00155192
0.00168114
0.00155225
0.00168139
0.00151508
0.00112037
0.000897593
0.00107043
0.00116446
0.00122106
0.00136546
0.00109651
0.00132104
0.00116635
0.000900917
0.00106997
0.00116389
0.00122337
0.00136515
0.00109626
0.00131967
0.00116584
0.00117774
0.00111348
0.00121667
0.00127108
0.00114546
0.00111333
0.00121564
0.00127053
0.00114532
0.000159122
4.44028e-07
3.05859e-09
2.29009e-09
1.7782e-07
2.49568e-06
1.16559e-05
6.81471e-05
0.000722295
0.000815032
0.000858751
0.000946643
0.000994753
0.00114991
0.00114171
0.000926609
0.000989845
0.000923233
0.00117803
0.0011916
0.00107698
0.00116673
0.00117516
0.00107482
0.00108272
0.00102076
0.00104039
0.00112555
0.0010589
0.00113258
0.00119923
0.0010895
0.00107806
0.00102028
0.00103976
0.00112177
0.00105847
0.00112549
0.00118916
0.00108877
0.000337547
0.0021152
0.000279843
0.00211863
0.000280817
0.000333933
0.00139314
0.00135201
0.00135458
0.00142124
0.00144682
0.00134833
0.00139313
0.00135209
0.00135446
0.00142216
0.00144659
0.0013492
0.00139001
0.00154157
0.00140293
0.00173817
0.00139166
0.00154229
0.00140311
0.00173989
0.0002003
0.000278445
0.000821431
0.00118441
0.00114018
0.00108476
0.00124856
0.00110854
0.000823441
0.0011846
0.00113997
0.00108547
0.00124841
0.00110849
0.000958236
1.10078e-05
1.90766e-08
1.59593e-09
4.60641e-09
2.64692e-08
3.71073e-07
1.38985e-06
8.56517e-06
0.000122336
0.000835773
0.000866253
0.000899174
0.000850128
0.00103541
0.000915365
0.00102881
0.000905638
0.000907523
0.000900057
0.00122844
0.00126681
0.00111593
0.00113252
0.00107151
0.00115771
0.00126034
0.00113775
0.00124906
0.00121129
0.00115586
0.00124065
0.00113541
0.00111419
0.00111738
0.00106873
0.00111885
0.00119932
0.00129715
0.001178
0.00111831
0.001191
0.00127971
0.00117691
8.08043e-06
2.67247e-06
0.00199791
0.000227165
0.00200464
0.000229683
5.68663e-06
0.00126264
0.00128916
0.00127792
0.00130167
0.00126254
0.00128954
0.00127809
0.0013032
0.00139162
0.00139489
0.00138907
0.0013892
0.00135546
0.00135017
0.00149423
0.00146918
0.00169111
0.00139308
0.00139491
0.00138948
0.00138929
0.00135714
0.00135071
0.00149527
0.00147095
0.00169428
1.42725e-05
2.63986e-05
0.00124454
0.00122774
0.00124482
0.00122758
0.000174272
7.79789e-07
2.02826e-09
1.92642e-09
1.3325e-08
3.11859e-08
2.27534e-07
1.24719e-06
1.69711e-05
0.000382944
0.000890056
0.000896027
0.000839119
0.000852941
0.000805286
0.000851643
0.000805345
0.00102019
0.00109684
0.000945224
0.000968905
0.000937688
0.00103361
0.000917207
0.000941506
0.000885368
0.00101938
0.0010902
0.000944684
0.000958342
0.000934745
0.00102856
0.000896687
0.000928201
0.000912629
0.000882616
0.000893327
0.00125582
0.00116678
0.00130897
0.0010848
0.00117161
0.00120327
0.00123837
0.00129054
0.00115638
0.00120205
0.0011703
0.00108397
1.55479e-06
2.87839e-08
2.06052e-08
0.00204147
0.000146909
0.0020558
0.000149087
1.91208e-07
0.00121713
0.00126598
0.00126321
0.00130133
0.00121718
0.00126698
0.0012631
0.00130269
0.00128637
0.00132599
0.00124881
0.00128645
0.00133251
0.00130381
0.00147291
0.00144774
0.00178368
0.00128757
0.00132638
0.0012489
0.0012864
0.0013359
0.00130421
0.00147362
0.00145069
0.00178777
1.3046e-06
2.82662e-06
3.93136e-06
3.41644e-08
2.09608e-09
2.83742e-09
1.20431e-08
1.295e-08
1.79658e-07
2.43477e-06
4.05918e-05
0.000781136
0.000924743
0.000871845
0.000788793
0.00087793
0.000810284
0.000874046
0.00080842
0.000984092
0.00105977
0.00091372
0.000985964
0.000946841
0.000888577
0.00095865
0.000898152
0.000975492
0.000890164
0.000890253
0.000929843
0.000983587
0.00105636
0.000913147
0.000980025
0.000885052
0.000936195
0.000886283
0.000955155
0.000897404
0.000967746
0.00088906
0.00088866
0.000921866
0.000879131
0.00111305
0.00104859
0.00110922
0.00104808
1.01032e-06
7.98964e-08
6.10672e-05
6.15929e-05
2.6814e-08
2.33352e-08
0.00114343
0.00114971
1.11405e-08
0.00122394
0.00127543
0.00122379
0.00127653
0.00126884
0.00128315
0.00123274
0.00121667
0.00139353
0.00134942
0.00153603
0.00153119
0.00169941
0.00155107
0.00155947
0.00127162
0.00128396
0.0012327
0.00121679
0.00139549
0.00134939
0.00153653
0.00153222
0.00170042
0.00155191
0.00155961
1.67997e-07
4.77496e-07
1.60915e-07
2.99446e-09
1.95521e-09
3.84586e-09
6.43999e-09
5.45203e-09
2.75803e-07
5.85483e-06
6.97704e-05
0.000897499
0.000918949
0.00083834
0.000774391
0.00083476
0.000790891
0.000831273
0.000788624
0.000969586
0.00102394
0.000918761
0.00097676
0.000982523
0.000979998
0.000927872
0.000899231
0.000913049
0.000839838
0.000835842
0.00088937
0.000969229
0.00102182
0.000918082
0.00097058
0.000799131
0.000978814
0.000974399
0.00092754
0.000898471
0.000903699
0.000839184
0.000833601
0.000877191
0.000794603
1.16843e-05
6.33219e-07
4.7192e-06
4.99265e-06
3.82836e-05
3.87291e-05
3.834e-08
3.09225e-08
2.08362e-08
0.000892456
0.000901664
1.41136e-08
0.0013268
0.00127036
0.00142545
0.00137203
0.00187045
0.00153333
0.00155478
0.00152978
0.00156275
0.00146793
0.00164464
0.00147813
0.0013293
0.0012702
0.00142444
0.00137208
0.00187658
0.00153376
0.00155643
0.00153025
0.00156336
0.00146774
0.00164984
0.00147777
3.83727e-08
7.50899e-08
2.72653e-08
1.24593e-09
1.82322e-09
4.87926e-09
4.33653e-09
3.35146e-09
5.63933e-07
1.03309e-05
9.10686e-05
0.0008941
0.000892505
0.000841203
0.000775735
0.000748052
0.000746429
0.00076071
0.000758601
0.00097202
0.00100877
0.000999975
0.000936466
0.000930507
0.000870377
0.000842309
0.000794706
0.000786951
0.000824328
0.000971672
0.0010055
0.00067078
0.000728751
0.000731516
0.000996969
0.000928138
0.000930149
0.000869743
0.000832843
0.00079393
0.000784844
0.000813562
0.000669733
0.000728162
0.000729391
0.000297756
4.14406e-06
2.07517e-06
2.05327e-06
8.83987e-07
8.80068e-07
1.04558e-07
0.000337531
0.000338603
3.22633e-08
3.59176e-08
2.21034e-08
0.00193403
0.00150007
0.00193744
0.00149858
1.75452e-08
0.00138124
0.00132078
0.00145183
0.00140138
0.00148028
0.00149655
0.0014362
0.00140808
0.0016807
0.00149382
0.00138102
0.0013206
0.00145132
0.00140158
0.00148115
0.00150017
0.00140766
0.00143634
0.00168367
0.00149256
1.51317e-08
3.4884e-08
1.47215e-09
2.89689e-09
1.91223e-09
3.98211e-09
3.22239e-09
3.26486e-09
9.54027e-07
1.37859e-05
9.66245e-05
0.000848468
0.000873374
0.000869344
0.000809473
0.000719753
0.000718638
0.000681234
0.000680916
0.000685696
0.000684543
0.000863139
0.000828237
0.000764029
0.000747371
0.000583435
0.000670752
0.000570666
0.000611511
0.000650878
0.000640091
0.000529068
0.000601105
0.000854269
0.000827386
0.0007581
0.000746783
0.000576751
0.000670782
0.000573289
0.000611621
0.000651915
0.000639408
0.00052895
0.000600458
2.56763e-05
9.30331e-05
9.34949e-05
1.64381e-05
1.63719e-05
0.000307255
0.0001041
0.000307798
0.000104353
5.88671e-07
1.96273e-06
1.95761e-06
4.20792e-05
4.4356e-05
3.97434e-08
0.00236285
0.00142486
0.00219559
0.00167993
0.00235159
0.00140556
0.00218705
0.0016693
4.35739e-08
3.18195e-08
3.26131e-08
2.70959e-08
0.00146336
0.00154397
0.00139208
0.00143317
0.00184122
0.00160794
0.00146594
0.00154613
0.00143221
0.00139163
0.00183851
0.00160236
1.24996e-08
3.23268e-08
1.24225e-09
7.27729e-09
2.28369e-09
3.32814e-09
2.94186e-09
3.22821e-09
1.21877e-06
1.40005e-05
8.03714e-05
0.000525359
0.00083366
0.000892166
0.000805886
0.000740981
0.000741729
0.000798745
0.00080018
0.000634421
0.000635035
0.000516758
0.000587285
0.000512313
0.000585552
0.000798396
0.000797934
0.000679833
0.000683646
0.000586941
0.000486078
0.000543104
0.000621069
0.000465293
0.000523244
0.000791948
0.000797278
0.000679135
0.000683399
0.000589706
0.000488726
0.000620898
0.000543071
0.000466749
0.000522878
0.000273194
2.57072e-06
7.01904e-05
0.00103564
0.00104131
6.95866e-05
1.21692e-05
1.20585e-05
0.000751469
0.000364587
0.000751083
0.00036496
6.58639e-08
7.26484e-05
3.34839e-05
0.000195797
7.00926e-05
7.54126e-05
3.30181e-05
0.000206501
7.14968e-05
0.00123746
0.000555785
0.000535296
0.000204418
0.00129406
0.000565576
0.000555202
0.000205836
4.66343e-08
0.00199688
0.00154023
0.00199619
0.00153077
4.84871e-08
3.88994e-08
1.01439e-07
1.11103e-08
0.00167319
0.00152873
0.00167162
0.00152499
1.12645e-08
2.07856e-08
1.34873e-09
8.7746e-09
2.8495e-09
3.35885e-09
2.56316e-09
2.50897e-09
1.06807e-06
1.09907e-05
5.2775e-05
0.0002423
0.000768654
0.000891682
0.00108304
0.00108602
0.00139449
0.00139872
0.00106476
0.000895986
0.00106652
0.000895675
0.000639425
0.000641666
0.00067597
0.000678772
0.000400892
0.000510971
0.000459743
0.000543149
0.000402975
0.000508214
0.00045843
0.000541114
0.000497308
0.00040585
0.000484023
0.000562454
0.000399804
0.000464977
0.000501343
0.00040816
0.000562509
0.000484068
0.000401247
0.000464756
1.3955e-05
0.000828306
2.39096e-07
0.000368938
3.7809e-05
0.000224267
2.66333e-05
0.000281155
0.000664736
0.000575245
0.000837253
0.00175632
0.000989105
0.000816563
0.00176415
0.000992527
0.000572
0.00083989
0.000814847
0.000365364
3.76066e-05
0.000223392
2.64237e-05
0.000280852
0.000666003
1.48375e-05
5.1591e-05
5.39569e-06
5.75601e-05
1.58236e-05
5.23557e-05
5.33292e-06
5.62979e-05
0.000968614
0.000816892
0.000969393
0.00081627
5.47384e-08
0.000863223
0.000400188
0.00162038
0.000845096
0.000879683
0.000400141
0.00166929
0.000851384
0.00220805
0.00164625
0.00262759
0.00158328
0.00219782
0.00162993
0.00261695
0.00155857
6.60848e-08
0.00184523
0.00154246
0.00184445
0.00153601
6.63264e-08
1.04647e-07
5.50338e-08
2.02255e-08
1.06769e-08
1.29228e-08
1.46716e-09
6.0825e-09
3.87741e-09
3.12971e-09
2.39275e-09
1.33348e-09
5.79216e-07
5.12694e-06
3.64899e-05
0.000218137
0.000374151
0.000911396
0.000915589
0.00118557
0.00178173
0.00119161
0.00178793
0.000364614
0.00049759
0.000341937
0.000499205
0.000368173
0.000494323
0.000345771
0.000496386
0.000464453
0.000576495
0.000401845
0.000537565
0.00047059
0.000575486
0.000406829
0.000536001
0.000353249
0.000419882
0.000354059
0.000419611
0.000346759
0.000445288
0.00034786
0.000445254
1.06836e-06
8.43443e-05
4.53474e-08
0.000230372
0.000645529
3.23329e-05
0.000538079
0.000200008
2.32109e-05
0.000230054
0.000831887
0.00214364
0.00140017
0.00177076
0.00156214
0.00128685
0.00215207
0.00140306
0.00177536
0.00156162
0.00128977
0.000833215
0.000644097
0.000228117
3.2194e-05
0.00053848
0.000198159
2.32901e-05
0.000225515
0.000343094
0.000150395
3.89969e-05
6.46985e-05
0.000353262
0.000150906
4.43521e-05
6.73316e-05
7.97568e-08
0.0021028
0.00165915
0.00209434
0.00164618
9.48983e-08
8.09548e-08
1.2107e-07
2.48031e-08
2.60244e-08
9.8981e-09
9.38549e-09
1.63835e-09
4.03968e-09
4.57752e-09
2.61186e-09
2.90147e-09
5.46074e-10
1.23932e-07
1.00912e-06
7.18077e-06
3.77384e-05
0.000679483
0.000750711
0.000794707
0.000826385
0.000682474
0.000750241
0.000795158
0.000826423
0.00111085
0.00134832
0.00111395
0.000974493
0.00101394
0.00132702
0.00147951
0.00148092
0.0015989
0.001614
0.00110803
0.00135164
0.0011141
0.000972642
0.00101432
0.00132709
0.00148573
0.0014824
0.00159855
0.00161418
0.000316708
0.000384755
0.000299735
0.000370686
0.000316946
0.000384216
0.000299801
0.000369769
0.000413542
0.000490003
0.000335638
0.000415961
0.000415852
0.000487812
0.00033463
0.000414474
0.000300139
0.000399243
0.0003008
0.000399178
7.78046e-08
6.40067e-06
6.59784e-08
0.000519091
0.00105034
0.000719852
0.00112339
0.00180109
0.00216553
0.00187601
0.00199165
0.00165365
0.00136127
0.00179837
0.00216303
0.00187281
0.00198523
0.00112457
0.00166115
0.00135807
0.00105482
0.000720273
0.000517434
8.72176e-08
7.03547e-08
9.39828e-08
8.43041e-08
1.95403e-08
1.35621e-08
9.21394e-09
6.87384e-09
1.67998e-09
3.25957e-09
5.57014e-09
2.84606e-09
7.74443e-09
2.79442e-10
3.50074e-08
2.52846e-07
1.83416e-06
0.000591396
0.000656731
0.000744985
0.000766409
0.00059338
0.000654298
0.000743745
0.000764714
0.00129414
0.00106487
0.00153427
0.00106244
0.00124412
0.000924533
0.000939238
0.00145414
0.00129351
0.00106088
0.00153239
0.00106137
0.00124156
0.000920928
0.000937887
0.00145101
0.000273581
0.00036572
0.000274017
0.000365422
3.30894e-08
3.28573e-07
3.41598e-08
0.000877385
0.000978121
0.00161065
0.00214371
0.00166216
0.00187242
0.00149142
0.00123528
0.00160308
0.00213721
0.00165303
0.00186198
0.000977512
0.00150073
0.00123157
0.000882632
6.40149e-08
9.3487e-08
1.14732e-07
5.35152e-08
1.5406e-08
9.54995e-09
8.44853e-09
1.72968e-08
1.71091e-09
3.89967e-09
3.95286e-08
3.22199e-09
6.17581e-09
1.92291e-10
1.95817e-08
6.13633e-08
0.00149304
0.0013846
0.00148904
0.00137898
7.51425e-09
2.55722e-08
9.42921e-09
0.00154707
0.00210843
0.00155735
0.00187647
0.00153577
0.0021018
0.00154593
0.00186341
2.81843e-08
1.08004e-07
1.01933e-07
2.44324e-08
1.28449e-08
8.39009e-09
7.71699e-09
9.80619e-09
1.81353e-09
6.53502e-09
8.41373e-09
5.57055e-09
4.58317e-09
1.67357e-10
7.55565e-09
3.88206e-10
3.69267e-09
2.29265e-09
3.24601e-08
1.24371e-07
4.44907e-08
1.15454e-08
9.9941e-09
8.57033e-09
7.94062e-09
5.29869e-08
2.04517e-09
7.22719e-09
4.15284e-09
5.96806e-09
3.90853e-09
1.6814e-10
2.40871e-10
1.6896e-10
5.52101e-09
1.87862e-08
3.26681e-08
1.86978e-08
7.0787e-09
9.53226e-09
1.00317e-08
8.18222e-09
1.8817e-08
2.23447e-09
6.24023e-09
4.21808e-09
4.48518e-09
4.54957e-09
3.83842e-10
5.2065e-09
8.98916e-09
1.61328e-08
9.34778e-09
5.77138e-09
1.01949e-08
1.3377e-08
8.01604e-09
1.80252e-08
2.43414e-09
5.90012e-09
6.36902e-09
4.25252e-09
5.14337e-09
4.19423e-10
3.14101e-09
5.34173e-09
8.85859e-09
6.31588e-09
6.48257e-09
1.16409e-08
1.72237e-08
7.94016e-09
8.64282e-09
2.56524e-09
6.41911e-09
7.26067e-09
5.30642e-09
5.56185e-09
4.77117e-10
2.40134e-09
3.91489e-09
6.17073e-09
6.39884e-09
8.0648e-09
1.2293e-08
1.65581e-08
8.66758e-09
1.18565e-08
2.54178e-09
7.31887e-09
9.82079e-09
5.02061e-09
7.27557e-09
6.25637e-10
2.65754e-09
3.68187e-09
5.28786e-09
9.39884e-09
7.69535e-09
1.2013e-08
1.32413e-08
9.97422e-09
1.2681e-08
2.45635e-09
8.58354e-09
9.66932e-09
6.40517e-09
1.14902e-08
7.10233e-10
2.95573e-09
3.70659e-09
5.56356e-09
2.1435e-08
6.44243e-09
1.20825e-08
1.10947e-08
1.12424e-08
8.22005e-09
2.48481e-09
8.77682e-09
1.04874e-08
6.02137e-09
8.67567e-09
1.05347e-09
3.51726e-09
4.12703e-09
6.97391e-09
1.84598e-08
5.33906e-09
1.57632e-08
1.04015e-08
1.23814e-08
5.80167e-09
2.55428e-09
9.04763e-09
8.7708e-09
6.3596e-09
4.04032e-09
1.61059e-09
3.73012e-09
4.57087e-09
1.31523e-08
1.03255e-08
4.9557e-09
2.16823e-08
1.01572e-08
1.39125e-08
4.45145e-09
2.5757e-09
8.78956e-09
7.50983e-09
8.56851e-09
2.61111e-09
2.22655e-09
4.09728e-09
6.67322e-09
1.50564e-08
7.05931e-09
5.05225e-09
2.65603e-08
1.01357e-08
1.56907e-08
3.70044e-09
2.49326e-09
8.73537e-09
8.75454e-09
5.84945e-09
3.27679e-09
3.4815e-09
5.01982e-09
8.04597e-09
8.67833e-09
5.24815e-09
4.97355e-09
2.50112e-08
9.95031e-09
1.76045e-08
3.05962e-09
2.28911e-09
8.62909e-09
6.28418e-09
3.88551e-09
7.80569e-09
4.01793e-09
6.13435e-09
7.20822e-09
6.01854e-09
4.49845e-09
4.97166e-09
2.17942e-08
1.01111e-08
1.93493e-08
2.82865e-09
2.43601e-09
1.09719e-08
3.32056e-08
7.79084e-09
7.73067e-09
4.07383e-09
6.27269e-09
5.98967e-09
5.06995e-09
4.15439e-09
5.01671e-09
2.36394e-08
1.01462e-08
2.00734e-08
2.82481e-09
2.46886e-09
8.65032e-09
7.19254e-09
2.49755e-08
5.01398e-09
3.3651e-09
5.85297e-09
5.23379e-09
4.61025e-09
4.10221e-09
5.76425e-09
2.72748e-08
1.04332e-08
1.99949e-08
3.00439e-09
2.39484e-09
8.0353e-09
8.9963e-09
1.06767e-08
5.2531e-09
2.69644e-09
5.3285e-09
4.79258e-09
4.34395e-09
3.68788e-09
8.08303e-09
2.51751e-08
1.07395e-08
1.73114e-08
5.92946e-09
2.82387e-09
6.91737e-09
1.16251e-08
8.43223e-09
1.8065e-08
2.16505e-09
4.94853e-09
4.44054e-09
4.04523e-09
3.15699e-09
1.14144e-08
2.58655e-08
1.08996e-08
1.76159e-08
1.04105e-08
3.35987e-09
6.55291e-09
1.46062e-08
1.84802e-08
2.1485e-08
1.75051e-09
4.62963e-09
4.20406e-09
3.62255e-09
3.21224e-09
1.43626e-08
3.22691e-08
1.17122e-08
1.85081e-08
1.44913e-08
3.60946e-09
7.81903e-09
2.12845e-08
3.36202e-08
8.72255e-09
1.45365e-09
4.44018e-09
3.93229e-09
3.64031e-09
3.80075e-09
1.55894e-08
5.41357e-08
1.48778e-08
2.11313e-08
1.37785e-08
3.57017e-09
1.01783e-08
2.38696e-08
2.88775e-08
5.02165e-09
1.2125e-09
4.27282e-09
3.80464e-09
4.22175e-09
5.33787e-09
9.669e-09
6.95232e-08
1.58728e-08
2.39976e-08
9.68651e-09
3.6122e-09
1.18827e-08
1.93399e-08
1.35888e-08
5.01776e-09
1.03903e-09
4.26949e-09
4.28154e-09
5.49902e-09
1.04205e-08
6.40564e-09
3.56298e-08
1.62556e-08
2.9106e-08
7.72596e-09
3.67042e-09
1.27267e-08
3.95494e-08
1.34895e-08
9.53599e-09
8.95284e-10
4.70894e-09
5.37484e-09
7.56989e-09
8.63005e-09
6.46211e-09
2.19274e-08
1.58904e-08
3.75207e-08
6.33088e-09
3.78322e-09
9.8785e-09
4.26495e-08
2.39023e-08
1.72164e-08
7.87174e-10
5.51735e-09
7.07689e-09
9.91066e-09
6.12331e-09
8.82108e-09
1.81386e-08
1.60183e-08
4.33102e-08
4.85739e-09
3.62078e-09
8.58255e-09
3.9295e-08
2.43346e-08
3.90481e-08
7.1248e-10
6.43511e-09
7.89801e-09
8.477e-09
4.28654e-09
1.72493e-08
1.53844e-08
1.64841e-08
4.4314e-08
4.77622e-09
3.62952e-09
8.93277e-09
4.54809e-08
1.58541e-08
1.27083e-08
6.50052e-10
7.54694e-09
7.61856e-09
5.87593e-09
4.48554e-09
4.3448e-08
1.54381e-08
1.56997e-08
3.80915e-08
5.11783e-09
3.63865e-09
1.37274e-08
2.00881e-08
2.88496e-08
7.88638e-09
6.05366e-10
7.64263e-09
6.55001e-09
5.23626e-09
6.10376e-09
5.51945e-08
1.62581e-08
1.54483e-08
3.77659e-08
4.29713e-09
4.25652e-09
1.79794e-08
1.02127e-08
7.04377e-09
4.84621e-09
5.67614e-10
6.93968e-09
6.24455e-09
6.00407e-09
7.24625e-09
5.76326e-08
1.87173e-08
1.60389e-08
4.23769e-08
3.46328e-09
5.7982e-09
2.56181e-08
3.13373e-08
1.04523e-08
1.4362e-08
5.3259e-10
7.00577e-09
6.73807e-09
6.88016e-09
6.93803e-09
7.23334e-08
2.06922e-08
1.67301e-08
4.5091e-08
2.90821e-09
8.23839e-09
1.35822e-08
1.42542e-08
9.81449e-09
8.35853e-09
4.96569e-10
8.44552e-09
8.84773e-09
9.5815e-09
5.25536e-09
1.18156e-07
2.20106e-08
1.87033e-08
5.19226e-08
3.13127e-09
1.27806e-08
4.58922e-08
8.20691e-09
5.9743e-09
7.03869e-09
4.67857e-10
1.1194e-08
1.0744e-08
8.13065e-09
4.70833e-09
7.49287e-08
2.11393e-08
2.42938e-08
6.38392e-09
3.82383e-09
1.3392e-08
1.69422e-08
7.91729e-09
5.78688e-09
1.26835e-08
4.44949e-10
1.84884e-08
9.21676e-09
5.05954e-09
6.16668e-09
3.64747e-08
1.78882e-08
3.89639e-08
2.76968e-09
3.5456e-09
1.30659e-08
8.23918e-09
5.31164e-09
1.11773e-08
5.77183e-09
4.30314e-10
1.94837e-08
1.03464e-08
3.16879e-09
1.11974e-08
2.57051e-08
1.80088e-08
3.16475e-08
2.26833e-09
3.73983e-09
1.12193e-08
7.46034e-09
2.82488e-08
6.618e-09
1.02076e-08
4.24119e-10
1.35588e-08
1.54884e-08
3.32008e-09
4.7858e-08
2.01599e-08
2.04779e-08
3.68614e-08
2.22188e-09
6.56927e-09
1.04196e-08
2.44398e-08
2.52244e-08
1.17536e-08
1.30907e-08
4.26703e-10
1.45512e-08
2.17327e-08
4.95038e-09
6.45545e-08
1.89915e-08
2.36106e-08
2.04053e-08
2.98792e-09
8.36667e-09
1.77976e-08
7.99028e-08
3.29283e-08
1.56434e-08
4.4476e-09
4.33314e-10
3.08889e-08
4.70203e-08
6.58006e-09
2.80599e-08
1.84617e-08
2.76969e-08
3.34901e-09
4.40381e-09
1.15644e-08
2.51004e-08
5.53022e-08
1.69845e-08
4.03019e-09
3.65345e-09
4.36973e-10
4.90214e-08
1.81267e-08
5.60838e-09
2.20089e-08
1.86251e-08
2.11783e-08
3.40744e-09
6.517e-09
1.32247e-08
2.75738e-08
1.74153e-08
5.98696e-09
3.78601e-09
8.11495e-09
4.33312e-10
1.49058e-08
4.60424e-09
5.03451e-09
1.71709e-08
1.99634e-08
2.37987e-08
3.93863e-09
8.05252e-09
1.39534e-08
1.95744e-08
8.06075e-09
5.87482e-09
1.30443e-08
4.3084e-09
4.27703e-10
6.94934e-09
2.46498e-09
1.27379e-08
1.58186e-08
2.16085e-08
1.63918e-08
5.99001e-09
8.20512e-09
1.57307e-08
1.02452e-08
8.30642e-09
2.17501e-08
1.41168e-08
4.31833e-08
4.34256e-10
4.78599e-09
2.27387e-09
1.78543e-08
1.85074e-08
1.92224e-08
2.00399e-08
8.61292e-09
8.92556e-09
1.20158e-08
9.96744e-09
2.20709e-08
3.73123e-08
4.15168e-08
4.62126e-10
3.46286e-09
2.11523e-09
9.69417e-09
1.84139e-08
1.893e-08
4.15447e-08
8.59666e-09
8.65034e-09
9.70571e-09
1.56336e-08
3.78921e-08
4.02197e-08
5.15601e-10
2.90025e-09
4.32388e-09
6.87063e-09
1.739e-08
2.14643e-08
4.08809e-08
6.62928e-09
7.35905e-09
1.0449e-08
2.61053e-08
3.92954e-08
6.22691e-10
3.84832e-09
1.08116e-08
4.47588e-09
1.74933e-08
2.49784e-08
2.35932e-08
5.08668e-09
7.75231e-09
2.08482e-08
3.85942e-08
1.22392e-09
1.34192e-08
1.9328e-08
4.73123e-09
1.79706e-08
2.87841e-08
2.01503e-08
6.515e-09
1.83874e-08
3.6131e-08
3.15868e-09
4.73294e-08
3.1311e-08
3.30431e-09
1.94925e-08
3.0236e-08
1.94221e-08
1.46815e-08
3.64293e-08
2.80572e-09
4.75527e-08
7.33902e-08
3.66225e-09
1.9814e-08
2.45595e-08
3.05511e-08
3.80331e-08
2.23825e-09
2.32492e-07
3.59915e-08
2.76605e-09
1.76659e-08
2.3596e-08
4.0323e-08
2.11155e-09
4.38151e-08
2.67563e-08
2.44084e-09
1.35471e-08
2.62103e-08
2.2676e-09
2.53213e-08
3.03936e-08
1.97619e-09
4.33521e-09
3.08022e-09
2.63634e-08
4.06212e-08
1.48562e-09
4.98877e-09
3.63597e-08
1.427e-07
9.772e-09
4.50164e-07
3.06546e-08
0.000992722
0.000707967
0.00114165
0.0010687
0.000963343
0.00102428
0.00107208
0.00108666
0.00122163
0.0012604
0.00106895
0.00103629
0.000846043
0.00108422
0.00109878
0.00102435
0.00110463
0.00119025
0.00116262
0.00114635
0.00108654
0.00124043
0.00128574
0.0012737
0.000993406
0.00103636
0.0011015
0.00103649
0.00104527
0.000800995
0.0011898
0.00107812
0.00120031
0.00109875
0.000708874
0.00116648
0.0011986
0.0011995
0.00116292
0.0011463
0.00115433
0.00114156
0.00124102
0.000992858
0.00115389
0.00111069
0.00109372
0.00119976
0.0012569
0.00106602
0.00103668
0.00110193
0.000964676
0.000869772
0.00104506
0.0010797
0.0011318
0.00119106
0.00105238
0.00116212
0.00107811
0.00120014
0.00107271
0.00119247
0.00121465
0.00119969
0.00116362
0.00122179
0.00125958
0.00115423
0.0012853
0.00099322
0.00115394
0.00111236
0.00109386
0.00119931
0.000873667
0.000885757
0.00102605
0.000952392
0.000966096
0.00103776
0.0011518
0.00106624
0.000847016
0.0010842
0.000870015
0.0010901
0.00104186
0.00116699
0.00107962
0.00110532
0.00113167
0.000798815
0.00113656
0.00108363
0.00120764
0.00119496
0.00108591
0.00105309
0.000834038
0.00116202
0.00119059
0.00122059
0.00125821
0.00116359
0.00108497
0.00127273
0.00125601
0.000873717
0.000886128
0.00102598
0.000954208
0.000966257
0.00103846
0.0010098
0.000896669
0.00084923
0.000925659
0.000854911
0.000877722
0.000916259
0.00108895
0.00104328
0.00121463
0.000836097
0.000832232
0.00119272
0.00121526
0.00113646
0.00108348
0.00119896
0.00120765
0.00119439
0.00108555
0.00119984
0.00112729
0.00117918
0.00126357
0.00122082
0.00112492
0.000834249
0.000918545
0.00125509
0.0010848
0.00115084
0.00100992
0.000896733
0.000849247
0.000925545
0.000855475
0.00087784
0.000917513
0.00103479
0.000996147
0.00087793
0.000792096
0.000830175
0.000829026
0.00078089
0.000808902
0.000816063
0.000861005
0.000831873
0.000837378
0.00121432
0.000832668
0.00131357
0.0011363
0.000824335
0.000820303
0.00122119
0.00125919
0.00119973
0.00112718
0.00117948
0.00126362
0.00122111
0.00112486
0.00118852
0.00121119
0.00114786
0.00121976
0.00112935
0.00123026
0.00130673
0.00126195
0.0011892
0.000918752
0.00094642
0.00103498
0.000996179
0.000878011
0.000829104
0.000780664
0.000808933
0.00081593
0.000790796
0.000830144
0.000860723
0.000831539
0.00106697
0.00105516
0.000831081
0.00084421
0.000771071
0.000801729
0.000813896
0.000787974
0.000795778
0.000814376
0.00113568
0.000825482
0.00131346
0.000820378
0.00137915
0.00132977
0.000888071
0.000775198
0.000875924
0.00125592
0.00118836
0.00121147
0.00114778
0.00122093
0.00112924
0.00123085
0.00130653
0.00126225
0.00118909
0.0012412
0.00115718
0.00123565
0.00114062
0.00126156
0.00120793
0.00125417
0.00118508
0.00126775
0.00135611
0.000946635
0.000941797
0.00106727
0.0010553
0.000830934
0.000844195
0.000814006
0.000788393
0.000769507
0.000795883
0.000801591
0.000815187
0.000985115
0.00113396
0.000925438
0.000681818
0.000655762
0.000705982
0.000753609
0.000760665
0.000770948
0.000782659
0.00132951
0.000890438
0.000775423
0.00137897
0.000876073
0.00143684
0.00144476
0.0012801
0.000698013
0.000834289
0.00087318
0.00124092
0.00115711
0.00123688
0.00114052
0.00126211
0.00120784
0.00125622
0.00118503
0.00126881
0.00135594
0.00128264
0.00116928
0.00128128
0.00117698
0.00127225
0.00122432
0.0012863
0.0012073
0.00131088
0.00146794
0.000942095
0.000860031
0.00098547
0.00113423
0.000925735
0.000681661
0.000654403
0.000705692
0.000753062
0.000760875
0.000771041
0.00078337
0.000839045
0.00110984
0.0010658
0.000664444
0.000586307
0.000597415
0.000630119
0.000689487
0.000683712
0.000721522
0.000738765
0.00144456
0.00127993
0.000698681
0.000834432
0.00143669
0.000873415
0.00151671
0.00151581
0.00148816
0.00108244
0.00078411
0.000850021
0.000822057
0.0012824
0.0011692
0.00127985
0.0011765
0.00127226
0.00122412
0.00128819
0.0012072
0.00131087
0.00146782
0.00143627
0.00122039
0.00129474
0.00118591
0.00131678
0.00123628
0.00132194
0.00124047
0.00132116
0.00131458
0.00137823
0.00162021
0.000860449
0.00073888
0.000839493
0.00111012
0.00106637
0.000665026
0.000585485
0.000595835
0.000629711
0.000688497
0.000683857
0.000721512
0.000738692
0.000699715
0.000995596
0.00110418
0.000737494
0.000463912
0.000414414
0.0004701
0.000412722
0.000305535
0.000487608
0.000527574
0.000605364
0.000607879
0.00151566
0.00148798
0.00108301
0.000784358
0.00085022
0.00151663
0.000822428
0.00162246
0.00157689
0.00159383
0.0014924
0.000835913
0.000838356
0.000823741
0.000726352
0.00143601
0.00122016
0.0012935
0.00118546
0.00131741
0.00123618
0.00132176
0.00124022
0.00132046
0.00131437
0.00137786
0.00161994
0.00144166
0.00163474
0.00127526
0.00132786
0.00123888
0.00136646
0.00133447
0.00139481
0.00133837
0.00139372
0.00179042
0.000739515
0.000619623
0.000700382
0.000995837
0.00110465
0.000739055
0.000464012
0.000411489
0.000468663
0.000411728
0.00030243
0.000484704
0.000526952
0.00060334
0.000607777
0.000557712
0.000836341
0.00106919
0.000864469
0.00050023
0.000354033
0.000262223
0.000388427
0.000387116
0.000249376
0.000382138
0.00045313
0.0015768
0.00159369
0.00149221
0.000838692
0.000838565
0.000823996
0.00162238
0.000726858
0.00176334
0.00164199
0.00164722
0.00166402
0.00141511
0.000797373
0.000828558
0.00073435
0.000623089
0.00144104
0.00163402
0.0012748
0.00132894
0.00123856
0.00136736
0.0013344
0.00139542
0.00133808
0.00139321
0.00179013
0.00161928
0.00168455
0.00149268
0.00148282
0.00139421
0.00183317
0.00135199
0.00138423
0.00131696
0.00143468
0.00194484
0.000620548
0.000486605
0.000558657
0.000836594
0.00106942
0.000865964
0.000501633
0.00035449
0.000260173
0.000388321
0.000388294
0.000249627
0.000378392
0.000452713
0.000423268
0.000687977
0.000967707
0.000959533
0.000565953
0.000460506
0.000341441
0.00044186
0.000278632
0.000392291
0.000273514
0.0004068
0.000396175
0.00028242
0.00164197
0.00164713
0.00166388
0.00141518
0.000798123
0.000828756
0.000734644
0.00176332
0.000623707
0.00189404
0.00173622
0.00168584
0.00172521
0.00170505
0.00122263
0.000779271
0.000760489
0.000660269
0.000524799
0.00161692
0.00168294
0.00148934
0.00148258
0.00139272
0.00183212
0.00135106
0.0013858
0.00131649
0.00143532
0.00194486
0.00177234
0.00180399
0.00190287
0.00160222
0.00199962
0.00169077
0.00157232
0.00161431
0.00147987
0.00201857
0.00144021
0.00154557
0.00202263
0.000487783
0.000363983
0.000424393
0.000688284
0.000967867
0.000960033
0.000568312
0.000461162
0.000345588
0.000440927
0.000278746
0.000393557
0.000272433
0.000407088
0.000397069
0.00028177
0.00032223
0.000559737
0.000826748
0.000947766
0.000645077
0.000479636
0.000444541
0.000370919
0.000416496
0.000350168
0.000418827
0.0004351
0.000343811
0.00173628
0.0016858
0.0017251
0.00170486
0.00122336
0.000779559
0.000760725
0.000660626
0.00189417
0.000525503
0.0019616
0.00184765
0.00173491
0.00173538
0.00180005
0.0016827
0.000996054
0.000751098
0.000679884
0.000581575
0.000437849
0.00176878
0.00180094
0.00189962
0.0015971
0.00199649
0.00168467
0.0015662
0.00161366
0.00147696
0.00201768
0.00143866
0.00154654
0.00202288
0.00200817
0.00224706
0.00211509
0.0018124
0.00213662
0.00177444
0.00168056
0.00239336
0.00170776
0.00211724
0.00203169
0.000365313
0.000276704
0.000323161
0.000560052
0.000826868
0.000948115
0.000646535
0.000480467
0.000445278
0.000371007
0.000417233
0.000349735
0.000419278
0.000435504
0.000343201
0.000271191
0.000468862
0.000707658
0.000878983
0.000721524
0.000483117
0.000427949
0.000414108
0.000372956
0.000420898
0.000339604
0.000401685
0.000421925
0.00184777
0.00173495
0.00173533
0.00179994
0.00168259
0.00099776
0.000751256
0.000680163
0.000582012
0.00196177
0.000438711
0.00197335
0.0019167
0.00180477
0.00174836
0.00180281
0.0018306
0.00162012
0.000701497
0.000705017
0.000606112
0.000515223
0.000363236
0.00200158
0.00223383
0.00210994
0.00179978
0.00212829
0.00176674
0.00167064
0.00238835
0.0016929
0.00211799
0.00203194
0.00225942
0.00264626
0.00223489
0.00170187
0.00250993
0.00184623
0.00175952
0.00250163
0.00168954
0.00212967
0.00195725
0.000278104
0.000213926
0.000271397
0.000469037
0.00070774
0.000879207
0.00072232
0.000483943
0.000428231
0.000416197
0.000372474
0.000421516
0.000335758
0.000402934
0.000422179
0.000320774
0.000447631
0.000625343
0.000801686
0.000751717
0.000543577
0.000449246
0.00038388
0.00035054
0.000438295
0.000307719
0.00036971
0.000346031
0.000402543
0.000312286
0.00191683
0.00180486
0.00174837
0.00180275
0.0018305
0.00162017
0.000702743
0.000705247
0.000606456
0.000515781
0.00197353
0.000364306
0.00193599
0.00193081
0.00186868
0.0017762
0.00177689
0.00184284
0.00182138
0.00146002
0.000699554
0.000648607
0.00055742
0.000449765
0.00028254
0.00225531
0.00262186
0.00223928
0.00168944
0.00248231
0.0018199
0.00173577
0.0024897
0.00167554
0.00213004
0.00195742
0.00232766
0.00138134
0.000850243
0.0027779
0.00167979
0.00224628
0.00112912
0.00122737
0.000562471
0.00200519
0.00180783
0.000215117
0.000214425
0.000319854
0.000447487
0.000625388
0.00080173
0.000752181
0.000543741
0.000449324
0.000386662
0.000354416
0.000437091
0.000303599
0.000368308
0.000344008
0.000401563
0.000307616
0.000495304
0.000415133
0.000415669
0.000367692
0.000475014
0.000611793
0.000752767
0.000739942
0.000569876
0.00051528
0.000431747
0.000331944
0.000326486
0.000367293
0.000298055
0.000388709
0.000293338
0.00186878
0.00193614
0.00177626
0.00177688
0.00184279
0.00182134
0.00146018
0.00069987
0.000648909
0.000557907
0.000450619
0.00193098
0.000283866
0.00189765
0.00191335
0.00183667
0.00181416
0.00176058
0.00179886
0.0018455
0.00175305
0.00121342
0.000777363
0.00060803
0.000505638
0.000357152
0.00021746
0.00236128
0.00144523
0.00224672
0.000865995
0.00281783
0.00165823
0.00112799
0.00128263
0.000569345
0.00200523
0.00180823
0.00045958
0.000709458
0.000229378
0.000181649
0.000496486
0.00057021
0.00029696
0.00204111
0.000594823
0.00046141
0.000158856
0.000260766
0.0001205
0.00177702
0.00159167
0.00021395
0.000329127
0.000370155
0.000339251
0.000345467
0.000494889
0.000415099
0.000414821
0.000367646
0.000474748
0.000611783
0.000752689
0.000740008
0.000569265
0.000514067
0.000432103
0.000330875
0.000326418
0.000368029
0.000293048
0.000385646
0.00028725
0.000617518
0.000480797
0.000519001
0.000533459
0.000513254
0.000409781
0.000422065
0.000393827
0.000419458
0.000726014
0.000730167
0.000586716
0.000571221
0.000512549
0.000336274
0.000404365
0.000435295
0.000503396
0.000331618
0.000283171
0.00032519
0.000262586
0.00181424
0.00189776
0.00191351
0.00176061
0.00179883
0.00184547
0.00175305
0.00121367
0.000777586
0.000608405
0.000506447
0.000358389
0.00183694
0.000217745
0.00184157
0.0018909
0.00185089
0.001695
0.00176559
0.00174635
0.00180249
0.00179401
0.00158487
0.00100394
0.000705404
0.00055238
0.000413089
0.000242938
0.000328499
0.000321243
0.000322588
0.000335053
0.000477785
0.000732877
0.000240575
0.00204039
0.000503436
0.000605476
0.000464131
0.000181743
0.000594831
0.000297648
0.000159593
0.000273671
0.000120198
0.0017777
0.00159228
0.000206314
4.28153e-05
0.000329067
0.000239431
5.90558e-05
0.000205151
0.000981536
0.00174445
0.000733044
0.000647242
0.000532071
0.000375813
0.000549542
0.00146779
0.00134087
0.000329175
0.000369077
0.000339258
0.000344272
0.000374407
0.000419303
0.000383357
0.000409723
0.000617416
0.000480797
0.000519862
0.000533496
0.000513602
0.000409846
0.000422274
0.000393892
0.000419667
0.00072591
0.000729903
0.000586015
0.000568448
0.00050997
0.000340514
0.000404025
0.000439758
0.000501725
0.000329788
0.000282462
0.000325764
0.000255267
0.00070113
0.000645452
0.000565435
0.000594762
0.000635682
0.00043194
0.000398023
0.000455626
0.000415008
0.000404352
0.000185038
0.000333019
0.000361856
0.000745804
0.00058556
0.00059762
0.00060356
0.000525692
0.000373473
0.000404347
0.000450057
0.000480541
0.000291086
0.000354204
0.00176565
0.00184166
0.00189102
0.00185109
0.00174636
0.00180248
0.00179401
0.00158491
0.00100416
0.000705654
0.000553118
0.000414309
0.00024386
0.00169534
0.000328652
0.000320359
0.000322731
0.000333876
0.00177744
0.00184629
0.00184743
0.00175723
0.00151561
0.0017148
0.00172249
0.00175979
0.0016697
0.00133413
0.000867193
0.000620077
0.000449766
0.000280898
0.00031647
0.000299237
0.000317978
0.000268545
0.000359521
0.000371518
0.000335253
0.000391663
0.000205726
4.26741e-05
0.000994603
0.0017457
0.00073366
0.000652379
0.000532508
0.000326561
0.000375919
0.000548431
0.000236551
6.62407e-05
0.000201841
0.00146881
0.00134148
0.000223603
0.000518002
0.00191982
0.00135219
0.00135189
0.00123894
0.00176742
0.00136946
0.00110244
0.000773282
0.000825773
0.000563605
0.000732579
0.00112428
0.0010771
0.00037439
0.000419724
0.000383374
0.000409556
0.000156664
0.000101489
0.000212776
6.09668e-05
0.000700956
0.000645492
0.000566176
0.000594734
0.000635497
0.000432045
0.000399396
0.000455863
0.000415906
0.00040459
0.000185718
0.000332129
0.000361925
0.00074562
0.000585299
0.000595555
0.000599844
0.000521548
0.000376613
0.000405752
0.000447931
0.000479951
0.000289799
0.000354887
0.000778853
0.000701124
0.000822016
0.000746778
0.000748126
0.000603304
0.000376022
0.000522466
0.000506971
0.000423977
0.000348025
0.000448551
0.000468085
0.000657575
0.000540069
0.000637118
0.000611221
0.000538562
0.000534549
0.000575025
0.000478207
0.000399557
0.000468833
0.000460746
0.000506999
0.00171483
0.00177751
0.00184639
0.00184757
0.00175744
0.0017225
0.00175979
0.00166971
0.0013342
0.000867371
0.000620603
0.000451084
0.000282073
0.000316303
0.000298349
0.000317952
0.000267486
0.00151589
0.000359709
0.000370121
0.000335595
0.000390741
0.00170394
0.00178197
0.00181609
0.00178013
0.00162871
0.00132623
0.00165967
0.00167105
0.00165699
0.00147521
0.00109735
0.000731729
0.000496191
0.000310735
0.000334114
0.000205894
0.000357896
0.000235601
0.000266472
0.000343081
0.000302625
0.000300664
0.000120085
3.80924e-05
9.65113e-05
4.52864e-05
0.000220904
0.00194437
0.00136608
0.00135211
0.00123207
0.00175817
0.00135369
0.00109816
0.000783299
0.000824424
0.000518034
0.000565951
0.000733573
0.00112533
0.00107757
0.00205831
0.00179317
0.00115872
0.000953305
0.00107248
0.00147488
0.0012667
0.00146844
0.00173999
0.00143848
0.00135646
0.00111128
0.0010325
0.000763532
0.000852107
0.000155258
0.000102212
0.000210917
6.11397e-05
0.00077867
0.000701185
0.000821833
0.000746833
0.000748027
0.000603463
0.000376441
0.000522539
0.000506616
0.000424668
0.00034623
0.000449201
0.000469766
0.000657587
0.000538865
0.000635338
0.000606559
0.000537068
0.000521847
0.000573675
0.000463014
0.000400711
0.000469876
0.000452163
0.000505141
0.000784547
0.000829881
0.000876662
0.000789421
0.000930378
0.00065347
0.000752386
0.000695429
0.00066079
0.000474817
0.000236174
0.000475354
0.000219783
0.000535454
0.00056014
0.000629547
0.000648152
0.000567882
0.000608446
0.000614838
0.00057526
0.000600378
0.000609047
0.00054578
0.00165969
0.00170398
0.00178204
0.00181619
0.00178027
0.00162884
0.00167105
0.00165699
0.00147523
0.00109747
0.000732097
0.000497303
0.000312337
0.000334258
0.000205102
0.000357461
0.000234475
0.000266648
0.000341663
0.000302791
0.000299975
0.0013263
0.000119439
3.80605e-05
9.5092e-05
4.50136e-05
0.00162606
0.00170044
0.0017629
0.00176304
0.00168605
0.00149093
0.00114084
0.00158901
0.00157951
0.00148897
0.0012512
0.000884085
0.000576372
0.000339523
0.000409868
0.00018843
0.000388776
0.00018296
0.000233895
0.000213031
0.000212163
0.00025613
7.5819e-05
3.42443e-05
8.43608e-05
3.2094e-05
0.00205727
0.00180152
0.000952642
0.00115074
0.00106694
0.00146438
0.00125481
0.00145555
0.00173061
0.00142691
0.0013501
0.00112145
0.00103082
0.000764276
0.000852253
0.00104149
0.00116649
0.000958777
0.000819804
0.00078311
0.000720001
0.000628078
0.000680426
0.000624578
0.0011112
0.00140593
0.00128497
0.000507061
0.000451391
0.00054185
0.000689148
0.000784347
0.000829928
0.000876334
0.000789492
0.000930087
0.00065369
0.000752119
0.00069563
0.000660506
0.000474987
0.000235214
0.000475718
0.000218141
0.000535668
0.000558623
0.000627754
0.000648326
0.000555369
0.000607324
0.000601838
0.000570861
0.000585731
0.000605556
0.00052892
0.000706097
0.000857424
0.00101257
0.000875971
0.000972881
0.00077811
0.000827248
0.000740188
0.000876048
0.000469361
0.000373498
0.000354947
0.000280544
0.000497172
0.000571062
0.000601608
0.000626132
0.000634435
0.000636493
0.000633911
0.00158903
0.00162609
0.00170049
0.00176298
0.00176314
0.00168615
0.00149091
0.00157952
0.00148898
0.00125127
0.000884383
0.000577297
0.00034155
0.000409202
0.000187584
0.000387386
0.000182396
0.000234185
0.000211236
0.000212435
0.000254095
7.47766e-05
3.41567e-05
8.30976e-05
3.20593e-05
0.00114058
0.00153711
0.00161127
0.00168606
0.00171812
0.00169107
0.00158052
0.00134671
0.00100211
0.00149751
0.00143507
0.00128774
0.00100879
0.000678972
0.000401124
0.000409752
0.000187483
0.000420681
0.000180959
0.000216767
0.000190019
0.000208528
0.000166054
7.21321e-05
3.13824e-05
7.44315e-05
3.08233e-05
0.00103216
0.000953987
0.000814154
0.000779289
0.000718907
0.000622686
0.000677565
0.000620042
0.00116179
0.00110801
0.0014013
0.0012786
0.000507457
0.000440574
0.000538695
0.000688275
0.00101003
0.000984859
0.0006587
0.000825617
0.000642154
0.000828721
0.000487632
0.000483358
0.000388062
0.000423024
0.00030159
0.000449508
0.000220392
0.000717397
0.000705821
0.000857444
0.00101241
0.000875974
0.00097249
0.000778335
0.000827047
0.000740428
0.000876027
0.00046951
0.00037343
0.000353878
0.000278753
0.000496546
0.000569627
0.000599253
0.000624555
0.000621409
0.000633889
0.000618948
0.000540632
0.00101348
0.000875985
0.000853142
0.000930036
0.000809392
0.000948385
0.000838889
0.000912569
0.000507663
0.000235514
0.000407542
0.000246164
0.000513034
0.000572875
0.000534467
0.000583503
0.000550978
0.000591262
0.000634091
0.000667336
0.0006874
0.000633772
0.00149752
0.00153713
0.0016113
0.00168611
0.00171819
0.00169115
0.00158052
0.00134643
0.00143508
0.00128777
0.00100903
0.000679764
0.000403815
0.000409724
0.000187469
0.000419631
0.000180874
0.000216698
0.000191026
0.000208484
0.00016474
7.11776e-05
3.19447e-05
7.22244e-05
3.08457e-05
0.00100125
0.0014393
0.00151078
0.00159673
0.00165152
0.0016592
0.00160426
0.00147165
0.00123725
0.00094977
0.0013674
0.00125692
0.00105254
0.00077279
0.000478155
0.000453596
0.000197628
0.000435159
0.000204187
0.000250944
0.000146637
0.000275178
0.000148643
0.000110347
3.50606e-05
8.61405e-05
4.29624e-05
0.00100413
0.000982306
0.000655502
0.000821626
0.000637378
0.000826088
0.000479141
0.000479012
0.000387159
0.000420993
0.000290222
0.000442247
0.000217558
0.000716285
0.000456202
0.000675727
0.000707048
0.000477215
0.000285197
0.000334734
0.000494042
0.000421168
0.000238387
0.00042936
0.00021768
0.000293867
0.000196132
0.000782313
0.000540409
0.00101337
0.000875931
0.000852964
0.000929978
0.00080954
0.000948526
0.00083901
0.000912467
0.000507638
0.000236271
0.000406735
0.000246497
0.000512868
0.000570796
0.000532796
0.000583455
0.00054185
0.000590663
0.0006314
0.000654622
0.000684341
0.000617947
0.000798823
0.000455751
0.000899854
0.000858168
0.000863466
0.000835668
0.000671206
0.000301786
0.000809445
0.000306109
0.000543692
0.000540968
0.000588758
0.000571648
0.000609858
0.000581791
0.000592792
0.000590122
0.000606776
0.00136741
0.00143932
0.0015108
0.00159677
0.00165157
0.00165926
0.0016043
0.00147151
0.00123667
0.00125695
0.0010527
0.000773483
0.000480242
0.000453173
0.000198252
0.000434264
0.000204431
0.000251291
0.000146478
0.000275258
0.000148106
0.000111454
3.56291e-05
8.52338e-05
4.29856e-05
0.000948663
0.00131772
0.0014091
0.0014946
0.00156985
0.00159772
0.00158713
0.00151481
0.00137676
0.00115984
0.000952571
0.00121686
0.00105027
0.000828197
0.000559381
0.000487256
0.000226318
0.000498429
0.000219799
0.000333185
0.000161604
0.000318992
0.000170348
0.000170827
7.41796e-05
0.000184963
5.65137e-05
0.000451759
0.000675231
0.000704451
0.000472334
0.000276221
0.000332033
0.000494179
0.000422274
0.000238083
0.000429662
0.000217097
0.000292758
0.000196249
0.000781836
0.000303435
0.000358401
0.00049772
0.000316065
0.000487428
0.000367754
0.000605434
0.000599095
0.000679
0.000517304
0.000345393
0.000255087
0.000378596
0.000232192
0.000316849
0.000245754
0.000642422
0.000910314
0.000724348
0.000798214
0.00045532
0.000900513
0.000858262
0.000863375
0.00083645
0.00067135
0.000301946
0.000809838
0.000306375
0.000544241
0.000535538
0.000588411
0.000563882
0.0006097
0.000580355
0.000592591
0.000583445
0.00060542
0.000519768
0.000974786
0.000793423
0.000621955
0.000826681
0.000460473
0.000314633
0.000885141
0.00103741
0.000395815
0.000480883
0.000564237
0.000556107
0.000597607
0.000604388
0.000606878
0.000644223
0.000638425
0.0012169
0.00131773
0.00140912
0.00149463
0.00156989
0.00159776
0.00158718
0.00151478
0.00137647
0.00115914
0.00105041
0.00082875
0.000560983
0.000487448
0.000226603
0.000498433
0.000219792
0.000332966
0.000162487
0.000318474
0.000170384
0.000171059
7.69026e-05
0.000185196
5.73237e-05
0.000951572
0.0011922
0.00129358
0.0013936
0.00147305
0.00152387
0.00153759
0.00151113
0.0014337
0.00129792
0.00112996
0.00103375
0.00104047
0.000855966
0.0006157
0.000550263
0.0002556
0.000538526
0.000272495
0.000370687
0.000210497
0.000383123
0.000195968
0.000234109
0.000104872
0.000218204
0.000122094
0.000298742
0.000355567
0.000498138
0.00031548
0.000487729
0.00036875
0.000605927
0.000610767
0.000678636
0.000525872
0.000345228
0.00025478
0.000378628
0.000231318
0.000315582
0.000248301
0.000909728
0.000651203
0.000723861
0.00056336
0.000481797
0.000319531
0.000453135
0.000493632
0.000359022
0.000650037
0.000590681
0.000340391
0.000252702
0.000764876
0.000826844
0.000814564
0.000857284
0.00100513
0.00100205
0.000953839
0.00104694
0.000974061
0.000793161
0.000621846
0.000826679
0.000519638
0.000461683
0.000314534
0.000885523
0.00103761
0.000395567
0.000496141
0.000563708
0.000555456
0.000598365
0.000596772
0.000605618
0.000635843
0.000637303
0.000663008
0.000438165
0.000659167
0.000681637
0.000495214
0.00082759
0.000434116
0.000536054
0.000418932
0.000549439
0.00056524
0.000579652
0.000621688
0.000621496
0.000683588
0.000693667
0.00104063
0.00119224
0.0012936
0.00139362
0.00147307
0.0015239
0.00153763
0.00151114
0.00143361
0.00129764
0.00112928
0.000856418
0.00061712
0.000549152
0.000257575
0.000537734
0.000274069
0.000371116
0.00021073
0.00038314
0.000195101
0.000234822
0.000107377
0.000218869
0.000121649
0.00103341
0.00104487
0.00118564
0.00128305
0.00137663
0.00143723
0.00147075
0.00147521
0.00143703
0.00135884
0.00124835
0.00112861
0.00107343
0.000895228
0.000674501
0.000574879
0.00035954
0.000584904
0.000320972
0.000431145
0.000242118
0.000415562
0.000271034
0.000265081
0.000124886
0.00028266
0.000136422
0.000563624
0.000482004
0.000319185
0.000453169
0.000498591
0.000359465
0.000649903
0.000597698
0.000340033
0.00025402
0.000764411
0.000826442
0.000808737
0.000857055
0.00100502
0.000993873
0.000953582
0.00103969
0.000613671
0.000560714
0.000743505
0.000727162
0.000954101
0.000776202
0.000897627
0.00079772
0.00102243
0.0010087
0.000960198
0.00104324
0.000663334
0.000658831
0.000681696
0.000495203
0.000827809
0.000437958
0.000451347
0.000534478
0.000430345
0.000548216
0.000574337
0.000581891
0.000621865
0.000621854
0.000676874
0.000692574
0.000781352
0.0005752
0.0004509
0.000516407
0.000680044
0.000616557
0.000622993
0.000538306
0.000553953
0.00047913
0.000522739
0.000602695
0.000638091
0.000660501
0.000675969
0.0008956
0.00104501
0.00118568
0.00128308
0.00137665
0.00143725
0.00147078
0.00147524
0.00143702
0.00135869
0.00124805
0.00112807
0.000675619
0.000574471
0.000361483
0.000584705
0.000322827
0.00043102
0.000243325
0.000415251
0.000271015
0.00026533
0.000126916
0.000282848
0.000135408
0.00107321
0.000936666
0.00106169
0.00118672
0.00127342
0.00135055
0.0013941
0.001415
0.00141019
0.00136948
0.00129927
0.00120512
0.00111712
0.00108515
0.000735305
0.00063035
0.000434709
0.000615056
0.000496963
0.000451876
0.000356972
0.000469094
0.00031578
0.000329842
0.000122305
0.000308643
0.000112578
0.000613639
0.000565785
0.000743133
0.000727388
0.000944523
0.00077086
0.000897148
0.000797336
0.00102237
0.00100499
0.000960159
0.00103967
0.000707162
0.000687575
0.000994374
0.00089676
0.000859972
0.000921781
0.00103495
0.00101659
0.000968246
0.00104965
0.000781603
0.000575476
0.000515601
0.000680237
0.000616469
0.000622999
0.000450381
0.000545699
0.000556003
0.00048204
0.000524611
0.000611347
0.000640347
0.00066076
0.000676315
0.000484312
0.000653473
0.000736227
0.000660328
0.000536662
0.000459258
0.000328242
0.000440684
0.000341368
0.000520778
0.000534269
0.00058293
0.000617157
0.000482417
0.000530307
0.00073628
0.000936958
0.00106181
0.00118675
0.00127344
0.00135057
0.00139412
0.00141502
0.00141021
0.00136946
0.00129914
0.00120481
0.00111663
0.000630074
0.000438244
0.000614535
0.000499452
0.000452054
0.000356967
0.000469153
0.00031522
0.000330786
0.00012691
0.000309461
0.000114422
0.00108524
0.000837067
0.000980038
0.00108083
0.00118682
0.00125809
0.00131693
0.00134584
0.00135643
0.00134734
0.00131114
0.00125261
0.00119506
0.00116857
0.00103208
0.00102719
0.00108572
0.00115591
0.00113368
0.00111639
0.000663156
0.000635576
0.000684581
0.000574936
0.00052787
0.000422048
0.000499129
0.000492493
0.000352979
0.000105563
0.000375629
0.000111922
0.000706795
0.000688568
0.000988484
0.000887787
0.000859313
0.000921549
0.00103488
0.00101475
0.00096809
0.00104763
0.00100514
0.000942524
0.000998005
0.00097617
0.000483309
0.000653774
0.000736116
0.000660545
0.00053658
0.000520639
0.000534213
0.000459721
0.000339066
0.000438995
0.000345134
0.000587954
0.000618589
0.000484025
0.000530993
0.0005099
0.000645259
0.000467541
0.000587469
0.000566039
0.000592191
0.000654578
0.000551442
0.000367496
0.000462108
0.000547411
0.00049263
0.000383185
0.000450681
0.0004104
0.000301896
0.000494817
0.000837763
0.000663116
0.000637868
0.000684606
0.000577392
0.00098025
0.00108093
0.00118686
0.00125811
0.00131694
0.00134585
0.00135644
0.00134736
0.0013111
0.00125248
0.00119486
0.00116846
0.000527794
0.000423538
0.000499052
0.000493605
0.000353509
0.000106272
0.000376033
0.000111239
0.00103206
0.00102397
0.00108589
0.00116258
0.00113371
0.00111936
0.000910821
0.000783531
0.000732868
0.000743901
0.000792741
0.00101637
0.00109518
0.00118142
0.00123589
0.00127905
0.00129804
0.00130529
0.00129744
0.00126125
0.00121262
0.0011848
0.00118626
0.00102378
0.00106124
0.00106368
0.00115152
0.00113463
0.00111032
0.000564136
0.000658851
0.000603138
0.000579246
0.000388897
0.000106541
0.000387824
0.000112184
0.00100233
0.000942269
0.000994583
0.00097602
0.00102501
0.000991379
0.000508967
0.000645438
0.00046721
0.000587528
0.000565355
0.000592188
0.000653517
0.000551663
0.000379047
0.000460693
0.000547875
0.000301468
0.000494818
0.000495347
0.000391658
0.000454914
0.000415575
0.00108163
0.000438306
0.000845152
0.000676688
0.000670384
0.000545308
0.000405975
0.000305459
0.000563128
0.00057177
0.000356941
0.000450038
0.000587416
0.000538985
0.000427634
0.000467435
0.000543741
0.000911331
0.000783615
0.000735089
0.000743964
0.000794275
0.000564261
0.0006601
0.000603252
0.00057986
0.00101652
0.00109525
0.00118145
0.00123591
0.00127906
0.00129805
0.00130531
0.00129745
0.00126121
0.00121248
0.00118474
0.00118656
0.000391349
0.000109688
0.000391207
0.000114293
0.00102375
0.00106062
0.00106354
0.00115291
0.00113451
0.00111078
0.000851219
0.000963261
0.000729756
0.000749079
0.000660735
0.000831584
0.00104205
0.00110348
0.00117117
0.00121226
0.00124354
0.00125728
0.0012582
0.00124579
0.00121486
0.00119072
0.00121032
0.00128171
0.00102659
0.00107619
0.00111672
0.00122945
0.00119755
0.00118425
0.000400433
0.000142142
0.000437521
0.000128968
0.00102284
0.000991199
0.0010808
0.000437886
0.000844889
0.000677301
0.000670468
0.000545465
0.000405014
0.000305355
0.000563203
0.00057185
0.000365382
0.000448305
0.000581333
0.000539769
0.000435634
0.000470952
0.000546922
0.000914399
0.000644469
0.000425092
0.000447462
0.000841267
0.000341599
0.000810291
0.000444526
0.00040434
0.000277702
0.00040012
0.000277111
0.000530149
0.000375361
0.000426466
0.000529627
0.000851965
0.000963597
0.000729957
0.000750462
0.000660815
0.000832735
0.0004013
0.000143421
0.000438725
0.000129534
0.00104215
0.00110353
0.0011712
0.00121228
0.00124355
0.0012573
0.00125821
0.00124577
0.00121479
0.00119063
0.00121052
0.00128221
0.0010264
0.00107634
0.00111625
0.00122022
0.00119727
0.00117594
0.000845157
0.000829395
0.000372309
0.000831678
0.000900082
0.000998134
0.00085442
0.000164251
0.000513155
0.0002117
0.00106166
0.00110807
0.00116009
0.00118924
0.00121076
0.00121668
0.00121289
0.00120052
0.00119188
0.00121062
0.00128642
0.00126061
0.00134672
0.00125174
0.00135196
0.0012575
0.00122111
0.00116857
0.00122522
0.000914156
0.000644301
0.000424351
0.000447343
0.000841167
0.000341718
0.000810609
0.000444017
0.000404889
0.000284741
0.000397871
0.000282557
0.000530349
0.000379884
0.000428565
0.000530376
0.000642596
0.00096984
0.000966249
0.00095734
0.00103649
0.000410788
0.000461508
0.000425811
0.00034901
0.00045861
0.000300416
0.000462179
0.00110732
0.000462921
0.000413554
0.000344543
0.00040116
0.000355029
0.000847447
0.000829673
0.000373621
0.000831915
0.000900635
0.000998352
0.000855991
0.000166476
0.000515426
0.000213074
0.00106172
0.00110811
0.00116011
0.00118925
0.00121077
0.00121669
0.00121289
0.00120049
0.00119185
0.00121074
0.00128761
0.0012604
0.00132867
0.00125117
0.00133594
0.00124248
0.00122055
0.00116776
0.00121145
0.000800829
0.00048167
0.000659478
0.000261118
0.000414039
0.000942655
0.0010249
0.00107716
0.00111058
0.0011454
0.00116398
0.00117319
0.00117188
0.00116612
0.00116695
0.0011859
0.00121584
0.0012379
0.00121994
0.00131447
0.00130842
0.00122006
0.00121479
0.00130339
0.000642034
0.000970722
0.000966329
0.000957252
0.00103631
0.000410647
0.000461356
0.000425609
0.000353114
0.000457251
0.000306808
0.000461597
0.0011076
0.000462008
0.000416754
0.0003491
0.000403447
0.000362645
0.000834223
0.000471985
0.00102812
0.000945116
0.000949491
0.00104293
0.000350206
0.00047849
0.000380946
0.000477747
0.000383981
0.00047747
0.000378003
0.000506856
0.000446974
0.000429932
0.000417447
0.000463054
0.00037097
0.000402574
0.000501101
0.0004979
0.000939373
0.00051364
0.00080172
0.000483602
0.000660046
0.000262296
0.000414882
0.000943045
0.00102503
0.0010772
0.0011106
0.00114541
0.00116398
0.0011732
0.00117188
0.0011661
0.00116691
0.00118594
0.00121589
0.00123718
0.00121926
0.0012966
0.00128996
0.00121395
0.00121907
0.00128736
0.00085245
0.000718602
0.00050823
0.000612113
0.000586606
0.000382889
0.000471568
0.000982462
0.00104674
0.00108923
0.00110834
0.0011288
0.00113605
0.00113748
0.00113805
0.00114545
0.00116589
0.00119282
0.00120106
0.00121859
0.00117964
0.00120034
0.0011766
0.00115728
0.00122009
0.000833852
0.000471756
0.00102852
0.000945265
0.000949487
0.00104288
0.000350211
0.00047917
0.000377643
0.000477352
0.000378634
0.000478945
0.000389804
0.000505589
0.000448024
0.000433291
0.000419889
0.000464388
0.000379638
0.000410032
0.000500164
0.000496303
0.000939797
0.000512975
0.000846027
0.000691922
0.000503481
0.000978562
0.000896235
0.000918228
0.00100417
0.000327143
0.000480017
0.00049242
0.000446572
0.000483186
0.000455964
0.00045059
0.000483913
0.000468255
0.000449943
0.000505264
0.000525515
0.000471476
0.000536359
0.000844752
0.000546656
0.000852787
0.000719422
0.000503843
0.000612683
0.000583579
0.000386441
0.000472008
0.000982681
0.00104682
0.00108925
0.00110835
0.00112881
0.00113605
0.00113747
0.00113804
0.00114542
0.0011659
0.00119292
0.0012008
0.00122354
0.00117917
0.00120019
0.00117651
0.00115684
0.0012124
0.00067835
0.000908737
0.000729323
0.000484634
0.000845612
0.00054702
0.00101727
0.00106614
0.00109701
0.00110557
0.00111276
0.0011135
0.0011137
0.00112228
0.0011388
0.0011568
0.00117389
0.00113025
0.00116267
0.00112526
0.0011482
0.00110142
0.00110827
0.00116984
0.000845905
0.000692135
0.000502759
0.0009787
0.000896427
0.000918275
0.00100413
0.000327478
0.000480545
0.000491524
0.000440177
0.000482084
0.000457039
0.000445724
0.000483895
0.000464614
0.000449052
0.000504005
0.000525087
0.000465578
0.000536811
0.000845083
0.000547242
0.00073114
0.000870519
0.000938002
0.000830096
0.000643536
0.00056131
0.000897105
0.000834661
0.000345811
0.000517796
0.000486681
0.000524509
0.000516837
0.000430147
0.000500409
0.000506314
0.000457032
0.000525836
0.000531247
0.000547296
0.000752653
0.000478952
0.000677482
0.000908889
0.000724988
0.000496403
0.000844311
0.000537323
0.00101739
0.00106618
0.00109702
0.00110557
0.00111275
0.00111348
0.00111367
0.00112224
0.00113877
0.00115679
0.00117376
0.00112961
0.00116341
0.00112506
0.00114739
0.00110121
0.00110788
0.00116553
0.000596205
0.000765801
0.000965116
0.000703572
0.000479405
0.000740991
0.000464436
0.00104915
0.00108284
0.00110277
0.0011015
0.00110204
0.0011011
0.00110751
0.0011194
0.00113048
0.00113852
0.00114481
0.00111273
0.00108993
0.00109715
0.00114857
0.00110558
0.00105703
0.00110693
0.00105333
0.000731031
0.000870571
0.000937837
0.000830012
0.000643831
0.000561963
0.000896772
0.000834858
0.000346801
0.000517138
0.000480632
0.000523786
0.000508783
0.000499899
0.000423288
0.000506185
0.000449106
0.000525764
0.000523756
0.000546214
0.000752899
0.000478595
0.000598643
0.000804418
0.000710953
0.000721716
0.000835962
0.000780247
0.00082652
0.000666763
0.000497628
0.000787477
0.000765108
0.000271347
0.000565194
0.000535766
0.000426597
0.000480938
0.000473637
0.00039623
0.000435013
0.000376278
0.000505856
0.000392667
0.000468456
0.000510096
0.000515263
0.000534304
0.000561884
0.000599797
0.000659729
0.00046945
0.000337153
0.000434185
0.000595298
0.00076581
0.000965129
0.000695492
0.000497681
0.000738842
0.000452277
0.0010492
0.00108286
0.00110277
0.00110148
0.00110201
0.00110105
0.00110745
0.00111933
0.00113042
0.00113834
0.00114433
0.00110677
0.00108978
0.00109685
0.00114227
0.00110177
0.00105681
0.00110421
0.001053
0.000822397
0.00069769
0.000481323
0.000683209
0.000854354
0.00101534
0.000395377
0.000577299
0.0010765
0.00109532
0.00110456
0.00109875
0.00109642
0.00109907
0.00110094
0.00110095
0.0010961
0.00107545
0.00105332
0.00107967
0.00102602
0.00105631
0.0010989
0.0010794
0.00101724
0.000598539
0.000804456
0.000710237
0.000721753
0.00083559
0.000780238
0.000826461
0.000667885
0.000498341
0.00078675
0.00076535
0.000271788
0.000563845
0.00052588
0.000421087
0.000474923
0.000389402
0.000433889
0.000368546
0.000505935
0.00039219
0.000468253
0.000469629
0.000507655
0.000504483
0.000532226
0.000553205
0.000597971
0.000656931
0.0004675
0.000326784
0.000434309
0.000460648
0.000588205
0.000617558
0.000649143
0.000529989
0.00063754
0.000699051
0.000697851
0.000822691
0.000866522
0.000638183
0.000474509
0.000222227
0.000462278
0.000379251
0.000372494
0.000430347
0.000410127
0.000515294
0.000431242
0.000500174
0.000539292
0.000579055
0.000545483
0.000453208
0.000409559
0.00047917
0.000452096
0.000450456
0.000371473
0.000451131
0.000407118
0.000822717
0.000697654
0.000478971
0.000683517
0.000854446
0.00101528
0.000388048
0.000578134
0.00107651
0.00109532
0.00110454
0.00109871
0.00109635
0.00109899
0.00110084
0.00110084
0.00109585
0.00107455
0.00105165
0.00107251
0.00102574
0.00105586
0.00109216
0.00107304
0.00101687
0.000791272
0.000871166
0.000955597
0.000782539
0.000932183
0.0010548
0.000453267
0.000451714
0.00109527
0.00110244
0.00110368
0.00109435
0.00109153
0.00108505
0.00107097
0.00105936
0.0010461
0.00102544
0.0009698
0.0010068
0.000946903
0.00100203
0.00103012
0.000980326
0.000983102
0.000998714
0.000460485
0.000588295
0.000616508
0.000649217
0.000528895
0.000637767
0.000697932
0.000698132
0.000822692
0.000866849
0.000640706
0.000474245
0.000222619
0.000454552
0.000368022
0.000367837
0.000406924
0.000428841
0.000513751
0.000431701
0.000500159
0.000527053
0.000575851
0.000541578
0.000450031
0.000395824
0.000478653
0.000437071
0.00044914
0.000359333
0.000451382
0.000394763
0.000315325
0.000509088
0.000411026
0.000444184
0.000422
0.000483852
0.000588236
0.000634851
0.000640076
0.000552071
0.000682226
0.000880347
0.000904803
0.00059518
0.00044905
0.000289084
0.000358334
0.000400625
0.000420037
0.000447102
0.000511056
0.000437032
0.000455443
0.00037886
0.000413513
0.000443049
0.000447687
0.000467364
0.000419536
0.000791815
0.000871394
0.000955712
0.000782864
0.000932201
0.00105473
0.000456788
0.000451605
0.00109527
0.00110243
0.00110365
0.00109429
0.00109143
0.00108494
0.00107081
0.00105907
0.00104542
0.00102411
0.000976158
0.00100509
0.000952441
0.00100093
0.0010253
0.000979827
0.000982574
0.000997158
0.000870449
0.00086563
0.00052608
0.000670632
0.000926836
0.000924123
0.000987139
0.00102063
0.000874022
0.000991281
0.00108097
0.00110527
0.00110141
0.00109474
0.00108113
0.00106575
0.00104824
0.00102161
0.00100631
0.00100788
0.000949838
0.00091957
0.000952475
0.000913252
0.000938208
0.000944721
0.00094993
0.000314728
0.000509043
0.000410948
0.000444186
0.00042173
0.000483978
0.000588498
0.000633554
0.00064031
0.000550342
0.000682372
0.000880436
0.000905724
0.000599609
0.000448093
0.000290649
0.000388908
0.00034876
0.000443086
0.000416416
0.00050661
0.000433813
0.000452379
0.00036125
0.000413399
0.000427867
0.00043536
0.00046317
0.000409892
0.000256059
0.000369231
0.000395309
0.000391881
0.000381195
0.000335684
0.000521485
0.000334804
0.00043736
0.000398315
0.000539849
0.000461243
0.000470423
0.000767623
0.000982341
0.00089191
0.000490946
0.000352349
0.000372863
0.000368062
0.000415059
0.000433412
0.000461725
0.00037866
0.000385288
0.000435704
0.000457197
0.000870848
0.000865697
0.000528081
0.000670802
0.000927032
0.000987148
0.000924349
0.00102034
0.000874196
0.00099124
0.00108091
0.00110527
0.00110139
0.00109469
0.00108105
0.00106562
0.00104808
0.00102132
0.0010057
0.001007
0.000948271
0.000916596
0.000952004
0.00091407
0.000937648
0.000944189
0.000948929
0.0008997
0.000400819
0.000875225
0.000292884
0.000494529
0.00100132
0.000971664
0.00102235
0.00103549
0.00107304
0.00094415
0.00103103
0.00109438
0.00110468
0.00108728
0.00106982
0.00104231
0.00101458
0.000989143
0.000964705
0.000955112
0.000954251
0.000922335
0.000848332
0.000912956
0.000882194
0.000877112
0.000905699
0.000256119
0.000369207
0.000394789
0.000391847
0.000380135
0.000336444
0.000521751
0.000334404
0.000437379
0.000396584
0.000540277
0.000461418
0.000470906
0.000767755
0.00098261
0.000894788
0.000495939
0.000343308
0.000370522
0.000357005
0.000413248
0.000431156
0.000458333
0.000369693
0.000383661
0.00042631
0.000443891
0.000281596
0.0003618
0.000374858
0.000358927
0.00037668
0.000305627
0.000408517
0.000352414
0.000408458
0.000392576
0.00042371
0.000455813
0.00040862
0.000430264
0.000473353
0.000638758
0.000882576
0.00106961
0.000784414
0.000416924
0.000280046
0.00032893
0.000265786
0.000370959
0.000304032
0.000354447
0.000899912
0.000402498
0.000875343
0.000294467
0.00049583
0.00100116
0.00102231
0.00103511
0.000971768
0.0010725
0.000944185
0.00103097
0.00109435
0.00110468
0.00108727
0.00106977
0.00104221
0.00101442
0.00098887
0.000964151
0.000954099
0.000952908
0.000922916
0.000831238
0.000913721
0.000870642
0.000865439
0.000905722
0.000967809
0.000840227
0.000919314
0.000789384
0.00087638
0.000224764
0.000908659
0.00105426
0.00100868
0.00105528
0.00105212
0.00108538
0.00110311
0.000990642
0.00105237
0.00109531
0.00108996
0.00105443
0.00102349
0.000981947
0.000947227
0.000937544
0.000931857
0.000903947
0.000932613
0.000877564
0.000930725
0.000894662
0.000853127
0.000846585
0.000863827
0.000873502
0.000282538
0.000361839
0.000373954
0.000358992
0.000375511
0.000307403
0.000408449
0.000351961
0.000408374
0.000391594
0.000425938
0.000456138
0.000410259
0.00043049
0.000473507
0.000639349
0.000882787
0.00107045
0.00079094
0.000418672
0.000280752
0.000328341
0.000260777
0.000370539
0.000305467
0.000354584
0.00032767
0.000342386
0.000372891
0.000355102
0.000362249
0.000382548
0.000408454
0.000429181
0.000401952
0.000420895
0.000420209
0.00038053
0.000213061
0.000402677
0.000154447
0.000525713
0.000764046
0.00102666
0.00107841
0.000729329
0.000586368
0.000276466
0.000357451
0.000379823
0.000512146
0.000250178
0.000343751
0.000967809
0.000840273
0.00091904
0.000789525
0.000877333
0.000226262
0.000910042
0.00105397
0.00105524
0.00105172
0.00108462
0.00100871
0.00110265
0.000990612
0.00105232
0.0010953
0.00108996
0.00105441
0.00102345
0.000981825
0.000946976
0.000937138
0.000931236
0.000902186
0.000932183
0.000879861
0.000929609
0.000891711
0.000852983
0.00083292
0.000863947
0.000864991
0.000909011
0.00102522
0.000806154
0.000867326
0.000734155
0.000837122
0.000171088
0.000564825
0.00109052
0.00103188
0.00108088
0.00106938
0.00109479
0.00111202
0.0011679
0.00101481
0.00105787
0.00108114
0.00105923
0.0010074
0.000962652
0.000914646
0.000899001
0.000908838
0.00090555
0.000849817
0.000862711
0.000828993
0.00088147
0.000874809
0.000817054
0.000845127
0.00032906
0.000342436
0.00037199
0.000355138
0.000361172
0.000384285
0.000408571
0.000428371
0.000402202
0.000419835
0.000423322
0.000380833
0.000214146
0.000402864
0.000156287
0.000528517
0.000764652
0.00102703
0.00108022
0.000736715
0.000586339
0.000269995
0.000354703
0.000374163
0.00050632
0.000248438
0.000343064
0.000370248
0.000330085
0.000308472
0.000318915
0.000341594
0.000461464
0.000356948
0.000422574
0.000385149
0.000409216
0.000500143
0.000236936
6.57727e-05
0.000164104
9.77157e-05
0.000518644
0.000659167
0.00088238
0.00111206
0.0010743
0.000735434
0.000711207
0.000767752
0.000625342
0.000679899
0.000433511
0.000546764
0.000377183
0.000477963
0.000909204
0.00102514
0.000806219
0.000866906
0.000734268
0.000838429
0.000173453
0.000567297
0.00109042
0.00108086
0.00106904
0.00109392
0.00111111
0.00103188
0.00116763
0.00101477
0.00105784
0.00108115
0.00105924
0.00100736
0.000962568
0.000914487
0.000898695
0.000908433
0.0009047
0.000848241
0.000862376
0.000830174
0.00088071
0.000871106
0.000816608
0.000838167
0.000823251
0.0009839
0.0010747
0.000758318
0.000798192
0.000683905
0.000770115
0.000152328
0.000465923
0.00117
0.00104019
0.00109612
0.00108531
0.00110353
0.00111616
0.00116518
0.00123222
0.00102404
0.00105104
0.0010522
0.00101569
0.000953169
0.000904434
0.000873088
0.000875861
0.000898149
0.000887118
0.000757624
0.000851373
0.00079111
0.000875933
0.000801354
0.000770152
0.00080703
0.000818784
0.000372027
0.000330285
0.000307479
0.000319095
0.000340599
0.000462877
0.000357039
0.000421724
0.000385228
0.000407829
0.000502254
0.000236291
6.56031e-05
0.000162035
9.70388e-05
0.000522466
0.000661772
0.000882938
0.00111262
0.00107677
0.000737666
0.000699997
0.000765722
0.00060904
0.000675893
0.000422242
0.00054053
0.000361253
0.000470542
0.00039492
0.000345284
0.000268128
0.000326354
0.000237744
0.000511497
0.000319387
0.00033717
0.000278199
0.000384736
0.000576861
9.96751e-05
4.99327e-05
0.000125592
4.14219e-05
0.000603879
0.000619359
0.000773493
0.000997361
0.00114272
0.000952959
0.000874555
0.000759414
0.000792404
0.000704938
0.000575662
0.000728379
0.00063411
0.000823695
0.00098398
0.0010748
0.000758377
0.000797758
0.000684069
0.000771478
0.000154219
0.000467598
0.00117003
0.00109611
0.00108506
0.0011027
0.00111488
0.00116437
0.00104019
0.0012322
0.001024
0.00105102
0.00105221
0.00101569
0.000953126
0.000904322
0.000872897
0.000875583
0.00089781
0.000886027
0.000761729
0.000849878
0.000803056
0.000872885
0.000800938
0.000769933
0.000806437
0.000814838
0.00075815
0.000732847
0.000713626
0.00093827
0.00105734
0.00117101
0.000726804
0.00064071
0.000136754
0.000421818
0.00124781
0.00103597
0.00109713
0.00109703
0.00110873
0.00111789
0.00115736
0.00121758
0.00130831
0.00102474
0.00103426
0.00101534
0.000970339
0.000910298
0.000865749
0.000852326
0.000878011
0.000893165
0.000857289
0.000754709
0.00080309
0.000764682
0.000859285
0.000746504
0.000774076
0.00039701
0.000345369
0.00026658
0.000326256
0.000235965
0.000512827
0.000319641
0.000334728
0.000278461
0.000382866
0.000578217
9.86714e-05
4.9952e-05
0.00012409
4.13384e-05
0.000606332
0.000623237
0.000775641
0.000997903
0.00114327
0.000953946
0.000874654
0.000748983
0.000791294
0.000688279
0.00055403
0.000725911
0.000629471
0.000406035
0.000384285
0.000209016
0.000410237
0.000215097
0.000525523
0.00021305
0.000276375
0.000240048
0.00022238
0.000600646
8.54857e-05
3.33137e-05
7.96805e-05
3.61711e-05
0.000641673
0.000678389
0.000732153
0.000877345
0.00105677
0.00106653
0.000989408
0.000847446
0.000820482
0.000863019
0.000884722
0.000807289
0.000770959
0.000773637
0.000746339
0.000758825
0.000732893
0.000714925
0.000938461
0.0010575
0.00117114
0.00072586
0.000640904
0.000137711
0.000423092
0.00124793
0.00109712
0.00109686
0.00110806
0.00111648
0.00115592
0.00121719
0.00103598
0.00130844
0.00102471
0.00103425
0.00101536
0.000970333
0.000910252
0.00086562
0.000852121
0.000877874
0.000892791
0.000856269
0.000755796
0.000802452
0.000770427
0.00085796
0.000743737
0.000773728
0.000687865
0.000696191
0.000574476
0.000673784
0.00063897
0.000900306
0.00104571
0.00117424
0.00126086
0.000648865
0.000598767
0.000119377
0.00039683
0.001337
0.00102528
0.00108366
0.00109843
0.00110977
0.00111755
0.00114546
0.00120267
0.00127714
0.00138304
0.00101882
0.00101359
0.000980009
0.000934893
0.000873811
0.000840612
0.000851025
0.000878007
0.00090365
0.000861822
0.000912081
0.000897293
0.00081115
0.000755006
0.000791969
0.000773575
0.000824513
0.000408266
0.000384345
0.00020803
0.000409298
0.000214062
0.000526762
0.00021342
0.000275751
0.000240269
0.000220156
0.000601609
8.44265e-05
3.3563e-05
7.74268e-05
3.60522e-05
0.000643041
0.000681268
0.000735746
0.000879024
0.00105726
0.00106677
0.000989589
0.000844333
0.000820038
0.00086309
0.000884788
0.000799203
0.000769976
0.000761212
0.000744829
0.000447792
0.000449671
0.000203678
0.00043034
0.000211507
0.000544664
0.000209086
0.000176697
0.000222977
0.000194145
0.000612199
7.35988e-05
3.07718e-05
7.34164e-05
3.13914e-05
0.000643877
0.000727344
0.000751497
0.000831502
0.000925396
0.00102589
0.00102562
0.000895583
0.000826171
0.000802673
0.000853987
0.000867265
0.00081113
0.000775957
0.000688893
0.00069615
0.000576184
0.000673694
0.000640118
0.000900582
0.00104588
0.00117435
0.00126098
0.000648341
0.000598897
0.000122281
0.000399308
0.00133712
0.00108366
0.00109831
0.00110927
0.00111623
0.00114353
0.00120164
0.0012772
0.00102528
0.00138316
0.00101881
0.00101359
0.000980025
0.000934882
0.000873723
0.000840396
0.000850747
0.000877791
0.00090335
0.000862015
0.000902302
0.00089734
0.000801317
0.000754288
0.00079148
0.000771396
0.000824115
0.000639393
0.000622036
0.000494841
0.000635483
0.000449571
0.000875616
0.000576623
0.000562883
0.00104872
0.00118833
0.00127844
0.00136064
0.000112124
0.000390211
0.00142312
0.00101436
0.00105933
0.00108654
0.00110589
0.00111553
0.00113438
0.00118254
0.00124994
0.0013366
0.00145337
0.00100935
0.00099293
0.000946322
0.000895754
0.000837641
0.000817194
0.000822451
0.000919141
0.000954414
0.00102925
0.000949431
0.00107386
0.000860021
0.000965198
0.000892065
0.000869737
0.000449965
0.000449225
0.000203509
0.000428994
0.000211703
0.000545689
0.000209635
0.000176103
0.000223074
0.000191137
0.000612917
7.23051e-05
3.10133e-05
7.15972e-05
3.15279e-05
0.000644642
0.000728771
0.000754412
0.000834568
0.000926734
0.00102628
0.00102591
0.000895767
0.000824209
0.000802545
0.000854043
0.000866679
0.000806533
0.000775493
0.000518256
0.000463297
0.000219056
0.000478025
0.000214447
0.000611644
0.000289564
0.000160678
0.000264345
0.000160726
0.000662053
9.31973e-05
4.05226e-05
0.000127215
3.51672e-05
0.000670533
0.000710199
0.000791269
0.000836407
0.000873975
0.000916768
0.000959648
0.000905789
0.00113084
0.00108263
0.00102595
0.000990871
0.000861982
0.000855877
0.000907296
0.000926484
0.000640609
0.000621983
0.000495996
0.000635433
0.000450746
0.000876033
0.000576444
0.000562979
0.00104889
0.00118842
0.00127851
0.00136071
0.000115219
0.000392738
0.00142321
0.00105935
0.00108647
0.00110555
0.00111446
0.00113229
0.00118076
0.00124975
0.00133671
0.00101436
0.00145348
0.00100934
0.000992935
0.000946329
0.000895697
0.000837368
0.000816576
0.000821424
0.000920096
0.000955569
0.00101039
0.000950294
0.00104602
0.000859753
0.000952031
0.00089143
0.000858598
0.000589884
0.000598544
0.000351898
0.000587932
0.000390717
0.000853632
0.000508761
0.00050323
0.000529421
0.000444246
0.00106624
0.00122208
0.00131008
0.00138554
0.00145672
0.000104823
0.00038745
0.00150656
0.0010035
0.00103289
0.00106049
0.00109064
0.00111115
0.00112545
0.00115992
0.00122251
0.00129408
0.00139589
0.00151372
0.000996721
0.00096442
0.00090203
0.000844064
0.000781757
0.000765792
0.000814466
0.000883759
0.000956743
0.00105825
0.000938336
0.00107618
0.000520453
0.000463261
0.000219421
0.000477375
0.00021476
0.000612419
0.000289583
0.000158419
0.000264272
0.000159482
0.000662599
9.01278e-05
4.21267e-05
0.000122286
3.5767e-05
0.000671113
0.000710891
0.000792823
0.000839268
0.000876521
0.000918017
0.000960212
0.000906357
0.00112963
0.00108257
0.00102531
0.000990785
0.000860964
0.000855801
0.00090722
0.000925055
0.000523262
0.000231078
0.000509392
0.000237319
0.000719463
0.000341083
0.000170979
0.000355118
0.00016398
0.000783292
0.000183524
5.31896e-05
0.000171945
6.78028e-05
0.000768492
0.000743507
0.000808806
0.000843555
0.000872203
0.000865595
0.000828181
0.000871295
0.00116797
0.001158
0.00111443
0.00106898
0.00103332
0.000970038
0.00099281
0.000591209
0.000598221
0.000354041
0.000587515
0.000392231
0.000854118
0.000508942
0.000502384
0.000529574
0.000443172
0.00106643
0.00122216
0.00131012
0.00138559
0.00145678
0.000106012
0.000388771
0.00150664
0.00103291
0.00106046
0.00109041
0.00111035
0.00112354
0.00115757
0.00122192
0.00129406
0.00139598
0.0010035
0.00151382
0.000996717
0.000964425
0.000902007
0.000843754
0.000780662
0.00076389
0.000812877
0.000882121
0.000956665
0.00103651
0.000937991
0.00104575
0.000558921
0.000299353
0.000563249
0.000277486
0.000813929
0.00048627
0.00032495
0.00046804
0.000376107
0.0010837
0.000395289
0.000107285
0.0012739
0.00136526
0.00142246
0.00148432
0.00155191
0.00158028
0.000989835
0.00101174
0.00102788
0.00105899
0.00109719
0.00111666
0.00114066
0.00118986
0.00125914
0.00134047
0.00144745
0.0015655
0.000975846
0.000923072
0.000841587
0.000763012
0.00070747
0.000725067
0.000752985
0.000759599
0.000870758
0.000820994
0.000878245
0.000919659
0.00104783
0.000925523
0.00101089
0.00052288
0.000232343
0.000508782
0.000237692
0.000720174
0.000341294
0.000170485
0.000354977
0.000163349
0.000783705
0.000184043
5.50944e-05
0.000172626
6.86503e-05
0.000768955
0.000744132
0.000809379
0.000845333
0.000874849
0.000867796
0.000829318
0.000872206
0.0011685
0.0011561
0.00111435
0.00106753
0.00103309
0.000969658
0.000991178
0.000406795
0.000192023
0.000397256
0.000210156
0.000949307
0.000219926
9.77791e-05
0.000233934
9.19087e-05
0.000982834
0.000803352
0.000747461
0.000836361
0.00086977
0.000852364
0.000773111
0.000831854
0.00115752
0.00116662
0.00128241
0.00117038
0.00127022
0.0012416
0.00113941
0.00116535
0.00108534
0.000558837
0.000300908
0.000562949
0.000278658
0.000814498
0.000486261
0.000325261
0.000467893
0.000375647
0.0010839
0.000395543
0.000107471
0.00127396
0.0013653
0.0014225
0.00148437
0.00155197
0.00158038
0.00101175
0.00102787
0.00105884
0.00109663
0.00111512
0.00113816
0.00118877
0.00125881
0.00134047
0.00144755
0.000989836
0.00156562
0.000975848
0.000923032
0.000841319
0.000761674
0.000704556
0.000721339
0.000750315
0.000737631
0.000874996
0.000790994
0.000881728
0.000919417
0.00102331
0.000924777
0.000978987
0.000435787
0.000275903
0.000448386
0.000244109
0.00106174
0.00038253
0.00010384
0.000359335
9.9561e-05
0.00131864
0.00144185
0.00148397
0.00151643
0.00158294
0.00163614
0.00164193
0.000962592
0.000992592
0.000998888
0.00101656
0.00106358
0.00110462
0.00112555
0.00115942
0.00122084
0.00129594
0.00138259
0.00149281
0.00159354
0.00093753
0.00087239
0.000767025
0.000675046
0.000634964
0.000623047
0.000630109
0.000811536
0.000577885
0.000820197
0.000745059
0.000809763
0.000803725
0.000848738
0.000406623
0.000192449
0.000396608
0.000209596
0.000949595
0.000220097
0.00010068
0.000234031
9.34574e-05
0.000983158
0.000804414
0.000748058
0.000837304
0.000871796
0.000854708
0.000774997
0.000833207
0.00115881
0.00116675
0.00127806
0.00117026
0.00126624
0.0012373
0.00113905
0.00116198
0.0010849
0.000287925
0.000108548
0.00026975
0.000110884
0.00120532
0.0012794
0.00102216
0.00075145
0.000818757
0.000832326
0.000777593
0.000805369
0.00102206
0.00112056
0.00117531
0.00133891
0.00118329
0.00131621
0.000435986
0.000275366
0.000448371
0.000242744
0.00106195
0.000383524
0.000107296
0.00036016
0.000102028
0.00131871
0.00144188
0.001484
0.00151648
0.00158301
0.00163623
0.00164206
0.0009926
0.000998878
0.00101646
0.00106319
0.00110349
0.00112331
0.00115791
0.0012201
0.00129571
0.00138267
0.00149291
0.000962597
0.0015937
0.000937493
0.000872176
0.000766015
0.000671404
0.000628149
0.000617475
0.000619669
0.000815577
0.000573188
0.000822934
0.000727404
0.000811659
0.000777412
0.000851007
0.00031458
0.000105274
0.000337281
0.000114229
0.00131592
0.00151765
0.00156967
0.00156926
0.00160914
0.00167287
0.00170602
0.00167554
0.000923432
0.000962363
0.000975861
0.000975017
0.00101312
0.0010752
0.00111388
0.00113492
0.00118134
0.00125348
0.00132987
0.00142117
0.00151745
0.00160033
0.000892385
0.000812517
0.000689169
0.000566815
0.000515912
0.000508415
0.000790708
0.00052307
0.000779127
0.000659434
0.000734211
0.000652768
0.000717413
0.000288767
0.000114046
0.000270476
0.000113479
0.00120546
0.00127957
0.00102368
0.000755023
0.00082049
0.000834643
0.000779754
0.000807318
0.00102279
0.00112127
0.001175
0.00133315
0.00118282
0.00130985
0.00148594
0.00158519
0.00144442
0.0011234
0.000861601
0.000753978
0.000772247
0.000804301
0.00084468
0.000750476
0.00100779
0.000789184
0.00103495
0.00108398
0.0010731
0.000314897
0.000107103
0.000337589
0.000113898
0.00131601
0.00151769
0.00156969
0.0015693
0.0016092
0.00167297
0.00170616
0.00167574
0.000962369
0.000975853
0.000974951
0.00101285
0.0010744
0.0011121
0.00113321
0.0011802
0.00125294
0.00132986
0.00142126
0.00151757
0.000923408
0.00160056
0.00089222
0.000811844
0.000686601
0.000558298
0.000506398
0.000510703
0.000778921
0.000524695
0.000777932
0.000654192
0.000735585
0.000650639
0.000717974
0.00154528
0.00166526
0.00164527
0.00164457
0.0016993
0.00175137
0.00175139
0.00169181
0.000872236
0.000914449
0.000949535
0.000946356
0.000959218
0.00102583
0.00109085
0.00112129
0.00114912
0.00120632
0.00128263
0.00136063
0.00144706
0.00151758
0.001564
0.000836879
0.00075217
0.000619262
0.000461677
0.000485755
0.000742432
0.000457956
0.000728704
0.000569024
0.000679944
0.000606837
0.000688835
0.000619322
0.000670275
0.001486
0.00158515
0.00144485
0.00112733
0.000868352
0.000758712
0.000775469
0.000804571
0.000844233
0.000749133
0.0010074
0.000780609
0.00103599
0.00108389
0.00106449
0.00171543
0.00176453
0.0016449
0.00140672
0.00115365
0.00101891
0.00100796
0.00104211
0.000906019
0.00096724
0.0010452
0.000994067
0.00100921
0.00108562
0.000778084
0.00104891
0.00154534
0.00166529
0.0016453
0.00164462
0.00169939
0.00175152
0.00175161
0.00169214
0.000914389
0.000949526
0.000946302
0.000959033
0.00102526
0.00108954
0.00111966
0.00114773
0.00120549
0.00128244
0.00136064
0.00144712
0.00151771
0.000872033
0.00156437
0.000836279
0.000750404
0.000614817
0.000444448
0.000488125
0.000726864
0.000452289
0.00071933
0.000559288
0.000676997
0.000604086
0.000688427
0.000615909
0.000670092
0.0017214
0.00174197
0.00169531
0.00171786
0.00178264
0.00181078
0.00178105
0.00167138
0.000816296
0.00085804
0.000903151
0.000923636
0.000920434
0.000962052
0.00104476
0.00110117
0.00113052
0.00116492
0.00123387
0.00130761
0.00137893
0.00144724
0.00147927
0.00146404
0.000782199
0.000681575
0.000551765
0.000344748
0.000514818
0.000668118
0.000440746
0.000738262
0.000483619
0.000597329
0.000562322
0.000625683
0.00171543
0.00176449
0.00164484
0.00140732
0.00115457
0.00101927
0.00100773
0.00104218
0.000905357
0.000967015
0.00104384
0.000993703
0.00100859
0.00108533
0.000778466
0.00104982
0.00182897
0.00183783
0.00172917
0.00155029
0.00134857
0.0012032
0.00111111
0.00109646
0.00108877
0.00105984
0.0011195
0.00105259
0.00172142
0.00174199
0.00169535
0.00171794
0.00178279
0.00181102
0.00178145
0.00167199
0.000857728
0.000903051
0.000923591
0.000920287
0.000961646
0.00104381
0.00109979
0.0011291
0.00116389
0.00123346
0.00130749
0.00137887
0.00144727
0.00147942
0.000815635
0.00146476
0.00078072
0.000677813
0.000544782
0.000342168
0.000504731
0.000666714
0.000436537
0.000748328
0.000471137
0.000596613
0.000556486
0.000625216
0.00181351
0.00177011
0.00174065
0.00179173
0.00185061
0.00185603
0.00178353
0.00159728
0.000757775
0.000785576
0.000844423
0.000887116
0.000895529
0.000909083
0.000979196
0.00106094
0.00111408
0.00114283
0.0011842
0.00125751
0.00132814
0.00137808
0.00140794
0.00137044
0.00129652
0.000713772
0.000628131
0.000509734
0.000719278
0.000373078
0.000718721
0.000355478
0.000355167
0.000560424
0.000317672
0.000604352
0.00182894
0.00183767
0.00172887
0.00154991
0.00134796
0.00120282
0.00111095
0.00109639
0.00108847
0.0010597
0.00111981
0.00105249
0.00187146
0.00184575
0.00174108
0.00155733
0.00137684
0.00123061
0.00112426
0.0011073
0.00116919
0.00108695
0.00117532
0.00117068
0.00114349
0.00117436
0.00111541
0.00181351
0.00177013
0.00174071
0.00179187
0.00185086
0.00185647
0.00178429
0.00159854
0.000784542
0.000843987
0.000886989
0.000895406
0.000908783
0.000978517
0.00105986
0.00111281
0.00114173
0.00118359
0.0012572
0.00132792
0.00137792
0.00140786
0.00137072
0.00075611
0.00129844
0.000710506
0.000622747
0.000499607
0.000727637
0.000371717
0.000723352
0.000358946
0.000353635
0.000560439
0.000319645
0.000607824
0.00184282
0.00177826
0.00179237
0.00186261
0.00190589
0.00188286
0.0017512
0.00145535
0.00069298
0.000714416
0.000765673
0.000833474
0.000870301
0.000876342
0.000917922
0.00099131
0.00107813
0.00112633
0.00115759
0.00120688
0.00127187
0.00132598
0.00135539
0.00131966
0.00120304
0.00060319
0.000652624
0.000616117
0.000671532
0.000431123
0.00073408
0.000490596
0.000681094
0.000399749
0.000669132
0.000359931
0.00187139
0.00184558
0.00174091
0.00155697
0.00137652
0.00123045
0.00112405
0.00110721
0.00116864
0.00108675
0.00117586
0.00117097
0.00114337
0.00117522
0.00111525
0.00185914
0.00180604
0.0016708
0.00150008
0.00132369
0.00119855
0.0010663
0.00116119
0.00106841
0.00115712
0.00117789
0.00120073
0.00113793
0.00122824
0.00122176
0.00117846
0.00184281
0.00177829
0.00179249
0.00186284
0.00190631
0.00188369
0.00175275
0.0014584
0.00071197
0.000764193
0.000832957
0.00087013
0.000876104
0.000917419
0.000990471
0.0010771
0.0011253
0.00115685
0.0012064
0.00127143
0.00132554
0.00135501
0.0013194
0.00120246
0.000689533
0.000612295
0.000647663
0.000610817
0.000690587
0.000424849
0.000743777
0.000461279
0.000686578
0.000392441
0.000671863
0.000357428
0.00182647
0.00179003
0.00185359
0.00192652
0.00195272
0.00189709
0.00166998
0.00104151
0.000634235
0.000617903
0.000690623
0.000762331
0.000825875
0.000859774
0.000875471
0.000927975
0.00101708
0.00109655
0.00114606
0.00117132
0.00123068
0.00127648
0.00130488
0.00127921
0.00115515
0.000859334
0.000286343
0.00063101
0.000700546
0.000559806
0.000709207
0.000570857
0.000662866
0.000493235
0.00070587
0.000524134
0.00185907
0.00180595
0.00167065
0.00149995
0.00132348
0.00119847
0.00106634
0.00116042
0.00106839
0.00115731
0.00117773
0.00120002
0.00113773
0.00122876
0.00122291
0.00117823
0.00180907
0.00172176
0.00159655
0.00143817
0.00127097
0.00118742
0.00110534
0.00118277
0.0011068
0.00118699
0.0012404
0.00120285
0.00182647
0.00179011
0.00185378
0.00192688
0.00195347
0.00189871
0.00167338
0.00105247
0.000612026
0.000687513
0.000760783
0.000825338
0.000859564
0.000875084
0.000927306
0.00101625
0.0010957
0.00114533
0.00117073
0.00123006
0.00127575
0.00130411
0.00127835
0.00115313
0.000848842
0.000629212
0.000292351
0.00062662
0.000708404
0.000549863
0.000710783
0.00054557
0.000674346
0.000484165
0.000710853
0.000502543
0.00179963
0.00182172
0.00192241
0.00198233
0.00199925
0.00188367
0.00148533
0.000285711
0.000609673
0.000528499
0.000614037
0.0006836
0.000770343
0.000830743
0.000861758
0.000883807
0.000947174
0.00103771
0.00112358
0.00116087
0.00119934
0.00121947
0.00127809
0.00125044
0.00116667
0.00089824
0.000439476
0.000262782
0.00041742
0.000264699
0.00041656
0.000711597
0.000552335
0.000718553
0.000567562
0.000684346
0.000580077
0.000690563
0.000588122
0.00180904
0.00172172
0.00159657
0.00143822
0.00127081
0.00118746
0.00110532
0.00118218
0.00110677
0.00118743
0.00123966
0.00120272
0.00175189
0.00166781
0.00155346
0.00141493
0.00123637
0.00126027
0.00118925
0.00123641
0.00117124
0.00116758
0.00121378
0.00116326
0.00122536
0.00179967
0.00182187
0.00192271
0.00198291
0.00200061
0.00188679
0.00149332
0.000293189
0.000520853
0.000608068
0.000680271
0.00076887
0.000830239
0.000861494
0.000883277
0.000946408
0.00103694
0.00112293
0.00116029
0.00119868
0.00121851
0.00127701
0.00124905
0.00116446
0.000893967
0.000439827
0.000604487
0.000260175
0.000414942
0.000256829
0.000406407
0.000716749
0.000548144
0.000718559
0.000550677
0.000690299
0.000568876
0.000692152
0.000565718
0.00178401
0.00188481
0.00198525
0.00205147
0.00203524
0.0017995
0.000855684
0.000363717
0.000390779
0.00029453
0.000414703
0.000419868
0.000702441
0.000516756
0.00071461
0.000555481
0.000526455
0.000614734
0.000693044
0.000793822
0.000840457
0.000867742
0.000901056
0.000977702
0.00107376
0.00114626
0.00118076
0.00121166
0.00123404
0.00122097
0.00116157
0.00098131
0.000770801
0.00061851
0.000791241
0.000613854
0.000299883
0.000440394
0.000380751
0.000474452
0.000501903
0.000656737
0.000283025
0.000375397
0.000273868
0.000350691
0.000692437
0.000569925
0.000696109
0.000582362
0.00175193
0.0016679
0.00155371
0.00141531
0.00123628
0.00126009
0.00118914
0.00123681
0.00117107
0.00116745
0.00121348
0.00116321
0.00122618
0.00173829
0.00165538
0.00154619
0.0014149
0.00127136
0.0011971
0.0012869
0.00122078
0.00133661
0.00128638
0.00130422
0.0012557
0.00125871
0.0012954
0.00178411
0.00188504
0.00198568
0.0020524
0.00203767
0.00180503
0.000849964
0.000347028
0.000375338
0.000280194
0.000395252
0.000412651
0.000517774
0.000608896
0.000689555
0.000792653
0.000839978
0.000867391
0.000900435
0.000976968
0.00107311
0.00114575
0.00118016
0.00121079
0.00123281
0.00121926
0.00115933
0.000978504
0.000769861
0.000630889
0.000788628
0.000613603
0.000299149
0.000441171
0.00038223
0.000474874
0.000503381
0.000656945
0.00071033
0.00050034
0.000721097
0.000532613
0.000280828
0.000372841
0.000270432
0.000345388
0.000695906
0.000564976
0.000696191
0.00056873
0.00181785
0.00195657
0.00206173
0.0021261
0.00200331
0.00128184
0.000584139
0.00054798
0.00083833
0.000714599
0.000358183
0.000417034
0.000282864
0.000350884
0.000722058
0.000407446
0.000688893
0.000370811
0.000694077
0.000447044
0.000703253
0.000461673
0.000685494
0.000547565
0.000694867
0.000576285
0.00046329
0.00048696
0.000728933
0.000637138
0.000743514
0.00081434
0.000855162
0.000878042
0.000926124
0.00100682
0.00110533
0.00117118
0.0012092
0.00119878
0.00122759
0.00117043
0.0010415
0.000898381
0.00073841
0.000879922
0.00078524
0.000547222
0.000672345
0.000315127
0.000414509
0.000468361
0.00037106
0.000570999
0.000457885
0.00173843
0.00165565
0.00154684
0.00141585
0.00127126
0.00119697
0.00128685
0.00122031
0.00133635
0.00128632
0.00130467
0.00125543
0.00125848
0.00129671
0.00177074
0.00167931
0.00155743
0.00147351
0.00134604
0.0012868
0.00137811
0.00130237
0.00144716
0.00142056
0.00181802
0.00195688
0.00206235
0.00212761
0.00200735
0.00128711
0.000564713
0.000543267
0.000829395
0.00071227
0.000350191
0.000408508
0.000278169
0.000342236
0.00072359
0.000402227
0.000689279
0.000372351
0.000696159
0.000460316
0.000673848
0.000459036
0.000474878
0.000479828
0.000700234
0.0006321
0.000741105
0.000813315
0.000854725
0.000877561
0.00092541
0.00100606
0.00110478
0.00117073
0.00120861
0.0011976
0.00122614
0.00116835
0.00103929
0.000897467
0.0007443
0.000878228
0.000780389
0.000557171
0.000671567
0.000314171
0.000413911
0.000472149
0.000372276
0.000570935
0.000457899
0.000690842
0.000534013
0.000699065
0.000557522
0.00188507
0.00204438
0.00216161
0.00214845
0.00158951
0.00113298
0.00102492
0.000953873
0.000867832
0.000561186
0.000550403
0.00072786
0.000685403
0.000635715
0.000690229
0.0004736
0.000667788
0.000376399
0.000448132
0.00066167
0.000497316
0.000438585
0.000487115
0.000765981
0.000426754
0.000768671
0.000736594
0.000776398
0.000829766
0.000856184
0.000903898
0.000956404
0.00105458
0.00113557
0.00119044
0.00121708
0.00123561
0.00117174
0.00106815
0.000960798
0.000898627
0.000970014
0.000886651
0.000801331
0.000650247
0.000757697
0.000737408
0.000525608
0.000614022
0.000451684
0.000544685
0.00177098
0.00167978
0.00155866
0.0014752
0.00134681
0.00128675
0.00138058
0.00130224
0.00144698
0.00142055
0.00184431
0.00173403
0.00160786
0.00144377
0.00171289
0.00150082
0.00164292
0.00146498
0.00141422
0.00150368
0.00140513
0.00188531
0.00204481
0.00216263
0.00215097
0.00159229
0.00112587
0.00101881
0.000947228
0.000864165
0.000547419
0.00054541
0.000718955
0.000682737
0.000637877
0.000691285
0.000467728
0.000667672
0.000380312
0.000447718
0.000654398
0.000498103
0.000439539
0.000478458
0.000741141
0.000425718
0.000760912
0.000735394
0.000774537
0.000828681
0.000855434
0.000903378
0.000955589
0.00105389
0.00113504
0.00118998
0.00121641
0.00123479
0.00117032
0.00106702
0.000960056
0.00090036
0.000969203
0.000882125
0.00080101
0.000656314
0.000756915
0.00073242
0.000532625
0.000613675
0.0004548
0.000544583
0.00198175
0.00216107
0.0022362
0.00174779
0.00128177
0.0011811
0.00156314
0.00136822
0.000993144
0.00095232
0.000887733
0.000832287
0.000584531
0.000626187
0.000697487
0.000712973
0.000589749
0.000395496
0.000656787
0.000480841
0.000433858
0.000602231
0.000747864
0.000430389
0.00075807
0.000464338
0.000654057
0.000775656
0.000793561
0.000817739
0.000887785
0.000912261
0.000997496
0.00108107
0.00117332
0.0012167
0.00120937
0.00124663
0.00111389
0.00111658
0.00111433
0.00111454
0.00100498
0.000958801
0.00100392
0.000979342
0.00105133
0.00105739
0.000867791
0.00085089
0.000893891
0.000833644
0.000754684
0.000631908
0.000696979
0.000700761
0.00184465
0.00173464
0.00160972
0.00144334
0.00171575
0.00150017
0.00164675
0.00146647
0.00141412
0.00150713
0.00140482
0.00196005
0.00182006
0.00155978
0.0017535
0.00152156
0.0018218
0.0014883
0.00197711
0.00150886
0.0019131
0.00198211
0.00216182
0.00223852
0.00174933
0.00127278
0.00117304
0.00155162
0.00136033
0.000987596
0.000949028
0.000880709
0.000829854
0.000578604
0.000623221
0.000692138
0.000710975
0.0005872
0.000399648
0.000648431
0.000480003
0.000432192
0.000589292
0.000754734
0.000428902
0.000759615
0.000462727
0.000650691
0.000774275
0.000791587
0.000815934
0.000887215
0.000911302
0.000996722
0.00108031
0.00117298
0.00121613
0.00120847
0.00124604
0.00111588
0.00111601
0.00112294
0.00111388
0.00100446
0.000962094
0.00100315
0.00097885
0.00105113
0.00106578
0.000867382
0.000854769
0.000893443
0.000830227
0.000754297
0.000634902
0.000696503
0.000696145
0.00211608
0.00228319
0.00167878
0.00204998
0.00152264
0.00178195
0.00148664
0.00116184
0.00110594
0.00135555
0.00126794
0.000941037
0.000939305
0.000837217
0.000839345
0.000579314
0.00039459
0.000471779
0.000431047
0.000765247
0.000772424
0.000726833
0.000826477
0.00077086
0.000476804
0.000775403
0.00064193
0.000428777
0.000633647
0.000390927
0.000581442
0.000770576
0.000845706
0.000814716
0.000765001
0.000843099
0.000892306
0.000962371
0.00101791
0.00117801
0.00116331
0.00115755
0.00121532
0.00124762
0.00118725
0.00128185
0.0012115
0.00118627
0.00121263
0.00119092
0.00126532
0.0011924
0.00108096
0.00104302
0.000996
0.000977255
0.000922835
0.000952734
0.00103375
0.000952867
0.000836366
0.0008064
0.00196042
0.00182055
0.00155969
0.00175735
0.00152116
0.00182557
0.00148752
0.00198116
0.00150793
0.00191839
0.00211283
0.00166511
0.00216079
0.00178264
0.00193485
0.00149274
0.00203759
0.00150919
0.00204258
0.00211688
0.00228532
0.00168905
0.00204413
0.00151797
0.00177265
0.00148058
0.00115629
0.00110164
0.00134783
0.00126349
0.000937767
0.00093774
0.000832993
0.000837869
0.000575611
0.000400937
0.000468241
0.000417733
0.000781495
0.000470953
0.000788247
0.000769034
0.000713232
0.000727171
0.000769667
0.000646811
0.000420662
0.000634294
0.000391591
0.000579483
0.000769089
0.000801149
0.000818613
0.000763522
0.000841754
0.000891308
0.00096158
0.00101702
0.00117854
0.00116305
0.00115706
0.00121489
0.00124545
0.00118703
0.00127351
0.00120647
0.00118573
0.0012046
0.00119033
0.00125613
0.00119205
0.0010834
0.00104267
0.000995842
0.000976744
0.000926823
0.00095207
0.00103823
0.000952737
0.000835955
0.000802958
0.00228492
0.00193555
0.00192869
0.00135173
0.00119701
0.00101413
0.00181304
0.00150327
0.00160565
0.00142705
0.00108391
0.00108056
0.00126784
0.00123267
0.000463646
0.000851319
0.000596655
0.000764931
0.000727687
0.000691499
0.000491304
0.000732822
0.00038079
0.000573172
0.000815754
0.000814565
0.000822258
0.000746875
0.000800323
0.000744402
0.000812661
0.000747494
0.000695761
0.000707259
0.0008123
0.000798608
0.000730509
0.000840017
0.000836347
0.000849884
0.000749807
0.000891432
0.00095837
0.00103765
0.00118341
0.00114694
0.00112998
0.0011623
0.00115233
0.00110965
0.00118704
0.00113765
0.00110362
0.00111407
0.00112256
0.00122201
0.00113859
0.00117583
0.00110775
0.00124416
0.00117387
0.00114266
0.00113206
0.00105027
0.0010064
0.00211238
0.00166431
0.00215842
0.00177851
0.00193771
0.00149295
0.00204308
0.00150904
0.00204719
0.0019785
0.00227515
0.00178421
0.0025834
0.00161582
0.00250142
0.0017479
0.00218416
0.000730709
0.00126848
0.00228806
0.00194901
0.00192484
0.00134973
0.00118941
0.00101314
0.00180806
0.00149984
0.00159804
0.00142337
0.00108132
0.00107847
0.00126282
0.00123017
0.000448913
0.000698357
0.000556687
0.000478378
0.000734661
0.000741694
0.000805921
0.00076502
0.00037388
0.000572649
0.00081814
0.000784377
0.000824466
0.00072376
0.00079922
0.000756588
0.000809303
0.000749005
0.000707339
0.000721539
0.00080988
0.000795317
0.000750715
0.000834875
0.000834472
0.00084797
0.000760237
0.000890112
0.000957472
0.00103542
0.00118318
0.00115895
0.00112979
0.00117918
0.00115168
0.00110949
0.00118838
0.00113738
0.0010999
0.00111412
0.00113757
0.00122019
0.00113865
0.00116982
0.00110721
0.00123584
0.00116523
0.00114221
0.0011315
0.00105179
0.00100602
0.00233555
0.00029412
0.000374652
0.000571301
0.000619305
0.00211707
0.0015087
0.00169555
0.00127749
0.00169436
0.00151055
0.00147875
0.00139064
0.00075611
0.000858241
0.000736912
0.000782652
0.000784684
0.000793067
0.000745099
0.000809202
0.000768478
0.000747047
0.000675776
0.000745089
0.000753729
0.000778042
0.000829224
0.000845834
0.000727052
0.000843158
0.00076372
0.000884606
0.000788434
0.00085061
0.000798055
0.000880196
0.000909481
0.000909977
0.000940667
0.000954911
0.000973365
0.000995929
0.000957741
0.000960724
0.000925916
0.00094099
0.00111123
0.00108172
0.00104482
0.00117856
0.000940044
0.000988922
0.00118328
0.00117568
0.00112148
0.00114601
0.00116513
0.00114793
0.00111129
0.00106461
0.0010564
0.00105468
0.00114339
0.00108093
0.00108802
0.00107189
0.00122184
0.00110807
0.00114065
0.00107315
0.00121729
0.00112424
0.00196782
0.00227472
0.00177987
0.00257389
0.00161514
0.00249838
0.00174195
0.00218668
0.000731609
0.00127401
0.00069834
0.00246107
0.00130817
0.00123939
0.000529516
0.000658229
0.00031505
0.0010313
0.00235594
0.00029346
0.000373466
0.000566803
0.000617791
0.00211237
0.00150651
0.00168753
0.00127685
0.00169131
0.00150856
0.00147261
0.00138835
0.000712409
0.000737955
0.00082391
0.000782467
0.000785085
0.000793626
0.000731614
0.000781634
0.000767578
0.000748914
0.000687461
0.000752894
0.000751644
0.00077678
0.00083027
0.00088317
0.000781345
0.000850524
0.000846497
0.00071771
0.000845643
0.000761591
0.000797941
0.000879616
0.000904194
0.000909666
0.000940611
0.000948585
0.00097938
0.000994668
0.000955709
0.000960399
0.000918532
0.000941201
0.000946392
0.000988193
0.00111121
0.0010696
0.00104401
0.00115635
0.00117984
0.00114576
0.00115234
0.00114767
0.00115215
0.00112124
0.00112179
0.00106457
0.00105643
0.00105455
0.00114546
0.00108066
0.0010988
0.00106742
0.00121818
0.00110805
0.00113582
0.00107251
0.00120901
0.00112368
0.000203475
0.000254442
0.000196003
0.000242154
0.000492846
0.000672502
0.000857931
0.00088394
0.000760737
0.000745842
0.000735688
0.00070367
0.000687607
0.000780761
0.000724032
0.000771998
0.000765594
0.000743185
0.000785444
0.000822783
0.000784983
0.000833088
0.00082271
0.000853255
0.000902999
0.000881591
0.000920372
0.00094159
0.00090672
0.000927601
0.00111183
0.000941113
0.00105398
0.00096171
0.00115677
0.001167
0.00111052
0.00109083
0.00115592
0.0011159
0.00109048
0.00103651
0.00103503
0.00116129
0.0010735
0.00106571
0.000701341
0.0024941
0.00131068
0.00126495
0.000529595
0.000660765
0.00031368
0.00103285
0.000117099
0.000323965
0.000144175
0.000128135
0.000205024
0.000255068
0.000198025
0.000243723
0.00049164
0.000672732
0.000852758
0.000884797
0.000760271
0.000740357
0.00073463
0.000708168
0.000696113
0.000780479
0.000723004
0.000771813
0.000732796
0.00077799
0.000823766
0.000832932
0.000760447
0.000786005
0.000818481
0.000853127
0.000896658
0.000881447
0.00091376
0.000939561
0.000906623
0.000927396
0.000944314
0.00096106
0.0010952
0.00105339
0.00115426
0.00109024
0.00114584
0.00114533
0.00110982
0.00111526
0.00110107
0.00103642
0.00103497
0.0011612
0.0010732
0.00107118
0.000106608
0.000418321
5.03636e-05
0.000358756
0.000734524
0.000733608
0.000793388
0.000825375
0.000849827
0.000840929
0.000902476
0.000869477
0.000919645
0.000934225
0.000891712
0.000921549
0.000115714
0.00033015
0.000144001
0.000130626
0.000123048
1.88012e-05
0.000105823
0.000418113
4.99824e-05
0.000358494
0.000736709
0.000733018
0.000786793
0.000825117
0.000844088
0.000840575
0.000895398
0.00086924
0.000913896
0.000934155
0.000891425
0.000921214
0.0001243
1.882e-05
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform List<scalar>
15
(
1.02204e-09
3.66949e-08
4.60476e-08
5.8147e-08
6.86335e-08
3.26513e-08
1.67182e-08
6.42029e-09
6.93854e-09
6.04886e-10
1.51927e-09
1.17763e-08
2.0937e-09
2.52404e-09
3.65317e-09
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
15
(
5.73462e-08
8.37007e-08
7.96423e-08
1.48467e-09
9.43549e-09
3.74887e-08
4.0323e-08
3.80331e-08
2.62181e-08
2.21366e-08
2.42231e-08
2.89478e-08
3.74575e-08
4.15168e-08
4.31833e-08
)
;
}
wall1
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value nonuniform List<scalar>
170
(
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1.6567e-07
7.00953e-07
3.69877e-07
1.33209e-07
6.74237e-08
9.2563e-08
8.53526e-08
0
0
0
0
0
0
0
0
1.6567e-07
1.94935e-06
4.67984e-06
8.44369e-06
1.35342e-05
2.02167e-05
2.86186e-05
3.87259e-05
5.03189e-05
6.27818e-05
7.52056e-05
8.73631e-05
9.85392e-05
0.000107102
0.000110078
0.000104269
7.6305e-05
5.38046e-05
8.48038e-05
0.000127566
0.000147227
0.000116203
7.58886e-05
5.939e-05
0.000101565
0.000118185
0.000117755
0.000108868
9.67987e-05
8.3496e-05
6.98633e-05
5.6298e-05
4.37067e-05
3.26188e-05
2.33102e-05
1.58344e-05
1.0051e-05
5.69382e-06
2.49026e-06
3.77639e-07
3.77639e-07
7.85906e-07
3.23003e-07
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
)
;
}
atmosphere
{
type calculated;
value nonuniform List<scalar>
140
(
9.56607e-09
2.24968e-09
1.27885e-08
1.09e-08
7.68498e-08
1.26316e-07
6.34593e-08
1.81301e-08
1.42546e-08
1.66816e-08
5.77198e-08
1.50998e-08
6.39924e-09
4.2312e-09
8.10019e-09
8.07769e-09
8.8873e-09
1.04587e-08
1.28816e-08
1.64697e-08
2.20845e-08
3.18307e-08
5.2416e-08
1.10586e-07
2.06021e-07
6.99449e-08
3.70914e-08
2.41662e-08
1.732e-08
1.31683e-08
1.03991e-08
8.46128e-09
7.10354e-09
6.23759e-09
5.85833e-09
2.75228e-09
3.16939e-09
3.95084e-09
4.91696e-09
5.85662e-09
1.13271e-08
4.0785e-08
9.53105e-09
7.47015e-09
7.46747e-09
8.3228e-09
8.55391e-09
7.57706e-09
5.97805e-09
7.46614e-09
5.26652e-09
3.94672e-09
1.01453e-08
2.66934e-07
5.93792e-06
0.000159724
0.00114347
0.00131822
0.00138546
0.00140759
0.00136287
9.72978e-10
2.30567e-09
1.72529e-09
8.3269e-10
8.53625e-10
6.48014e-10
8.72867e-10
2.18132e-09
0.000628675
4.42757e-08
2.19176e-09
4.63867e-10
9.0992e-10
5.54235e-10
5.22483e-10
9.24011e-10
1.74308e-09
9.53382e-10
0.00134044
0.00135598
0.00131211
0.00123004
0.00100644
6.65365e-05
1.49808e-06
1.87463e-08
1.4345e-09
1.71825e-09
2.45445e-09
3.96702e-09
9.6891e-09
3.02566e-08
1.43968e-08
8.50104e-09
6.19961e-09
5.52218e-09
4.20496e-09
2.87975e-09
2.26426e-09
2.85508e-09
7.30931e-09
8.20485e-09
4.4212e-09
4.50721e-09
4.52008e-09
5.51641e-09
8.30362e-09
1.47695e-08
1.07486e-08
4.59074e-09
3.28082e-09
2.48147e-09
5.81776e-09
7.43852e-09
2.80619e-09
3.18972e-09
9.5038e-09
2.47719e-08
4.65634e-09
1.76234e-09
1.81807e-09
1.5381e-08
2.77549e-08
5.13064e-08
2.66016e-08
1.61138e-08
9.13843e-09
2.50244e-08
1.13355e-08
7.55059e-09
1.69286e-08
1.04935e-08
1.86846e-08
1.70457e-08
5.97409e-09
3.41903e-09
7.48123e-09
3.28871e-10
4.31833e-08
)
;
}
defaultFaces
{
type empty;
}
flap
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value nonuniform List<scalar>
368
(
6.61736e-05
4.48369e-05
3.25012e-05
2.3009e-05
1.72752e-05
1.95485e-05
3.00893e-05
4.84126e-05
6.31752e-05
0.000114286
7.69918e-05
6.65412e-05
4.84866e-05
4.90461e-05
5.90859e-05
5.94045e-05
4.05654e-05
4.11039e-05
4.50095e-05
3.49873e-05
3.5386e-05
3.72667e-05
3.73683e-05
2.9157e-05
2.95513e-05
3.25723e-05
2.50473e-05
2.52614e-05
2.71556e-05
2.71683e-05
2.18243e-05
2.1912e-05
2.30107e-05
1.85158e-05
1.86142e-05
1.9668e-05
1.97038e-05
1.68626e-05
1.68876e-05
1.72936e-05
1.78995e-05
1.78045e-05
1.69949e-05
1.69601e-05
2.14357e-05
2.13114e-05
1.94269e-05
2.65842e-05
2.649e-05
2.36415e-05
2.35155e-05
3.5882e-05
3.58916e-05
2.9955e-05
4.42188e-05
4.4282e-05
4.17364e-05
4.16885e-05
5.23514e-05
5.25443e-05
4.84627e-05
5.40962e-05
5.41056e-05
5.43547e-05
5.44488e-05
5.57451e-05
5.57797e-05
6.3123e-05
9.8369e-05
9.84874e-05
6.26616e-05
6.27309e-05
9.57791e-05
9.5921e-05
0.000114431
0.000108697
0.000108833
7.195e-05
7.11523e-05
8.4957e-05
8.42716e-05
7.74952e-05
7.11852e-05
7.17055e-05
6.02364e-05
5.93045e-05
4.57876e-05
4.17837e-05
3.65356e-05
2.99659e-05
2.61717e-05
2.17427e-05
1.78697e-05
1.68285e-05
2.29616e-05
2.15737e-05
3.53739e-05
3.49405e-05
4.74543e-05
5.21339e-05
6.28052e-05
7.39242e-05
9.82606e-05
0.000142177
6.93323e-05
0.000101104
6.03316e-05
5.95104e-05
4.86219e-05
5.33062e-05
4.87192e-05
5.38817e-05
5.51499e-05
5.202e-05
5.52425e-05
5.22025e-05
4.31027e-05
4.52545e-05
4.32035e-05
4.57282e-05
4.58369e-05
4.18143e-05
3.87022e-05
3.79363e-05
3.87833e-05
3.83225e-05
4.03052e-05
3.45896e-05
4.03449e-05
3.45829e-05
3.36975e-05
3.1587e-05
3.37789e-05
3.19097e-05
3.65661e-05
2.99041e-05
2.9801e-05
2.71409e-05
2.98747e-05
2.7403e-05
3.11139e-05
2.54685e-05
3.11327e-05
2.54285e-05
2.45627e-05
2.33697e-05
2.46313e-05
2.34569e-05
2.61814e-05
2.17451e-05
1.97236e-05
1.9541e-05
1.9796e-05
1.96299e-05
2.10982e-05
1.84322e-05
2.11225e-05
1.8468e-05
1.76768e-05
1.72221e-05
1.76875e-05
1.72764e-05
1.7877e-05
1.68136e-05
2.01889e-05
1.68662e-05
2.01577e-05
1.68151e-05
1.84908e-05
1.78753e-05
1.84662e-05
1.78206e-05
2.64823e-05
1.94133e-05
2.64694e-05
1.93289e-05
2.29351e-05
2.14777e-05
3.2333e-05
2.38993e-05
3.23168e-05
2.38137e-05
2.96548e-05
2.61023e-05
2.96523e-05
2.60076e-05
3.88475e-05
2.97529e-05
3.88367e-05
2.97303e-05
3.53556e-05
3.48512e-05
4.39623e-05
3.9724e-05
4.39689e-05
3.98334e-05
4.1543e-05
4.6197e-05
4.15256e-05
4.62503e-05
4.87354e-05
4.973e-05
4.87972e-05
4.98937e-05
4.74733e-05
5.21452e-05
5.44357e-05
5.20558e-05
5.44389e-05
5.21077e-05
5.19404e-05
5.52087e-05
5.198e-05
5.51853e-05
5.33981e-05
5.4856e-05
5.34183e-05
5.48667e-05
6.2801e-05
7.39598e-05
8.7368e-05
8.44522e-05
8.74238e-05
8.45393e-05
6.13569e-05
7.38921e-05
6.13889e-05
7.39729e-05
8.59403e-05
8.4524e-05
8.59926e-05
8.46484e-05
9.8282e-05
0.000142259
9.50735e-05
0.000133853
9.51089e-05
0.000133917
7.47664e-05
7.45691e-05
8.42905e-05
8.4172e-05
6.94507e-05
0.000101463
5.50291e-05
5.23545e-05
5.50965e-05
6.36217e-05
6.44829e-05
9.5587e-05
6.46055e-05
9.60188e-05
5.69655e-05
5.70106e-05
5.22084e-05
5.57089e-05
4.3443e-05
3.42815e-05
2.47379e-05
1.75196e-05
2.61751e-05
3.83825e-05
5.0318e-05
7.21439e-05
0.000116257
8.44679e-05
9.83702e-05
6.6594e-05
5.73211e-05
5.78206e-05
6.71791e-05
9.00744e-05
6.34883e-05
5.58046e-05
5.17867e-05
5.19166e-05
5.04322e-05
5.05287e-05
4.63027e-05
4.64269e-05
4.34986e-05
4.09726e-05
4.10699e-05
3.80825e-05
3.81348e-05
3.58036e-05
3.58972e-05
3.43133e-05
3.16393e-05
3.1724e-05
2.93378e-05
2.9363e-05
2.61962e-05
2.62695e-05
2.47554e-05
2.09412e-05
2.09963e-05
1.96023e-05
1.9627e-05
1.7857e-05
1.78896e-05
1.7512e-05
1.82252e-05
1.82039e-05
2.04985e-05
2.04678e-05
2.33113e-05
2.32851e-05
2.61579e-05
2.93581e-05
2.93456e-05
3.2765e-05
3.27654e-05
3.59632e-05
3.59614e-05
3.83822e-05
4.12934e-05
4.13169e-05
4.36839e-05
4.37012e-05
4.58616e-05
4.5924e-05
5.03564e-05
5.00422e-05
5.00695e-05
5.2448e-05
5.24815e-05
5.23546e-05
5.23875e-05
7.21592e-05
7.99303e-05
7.99722e-05
7.03209e-05
7.03714e-05
7.84033e-05
7.84601e-05
6.02316e-05
5.54696e-05
5.37027e-05
6.46663e-05
0.000116278
8.45047e-05
9.8484e-05
6.02433e-05
5.54736e-05
5.37029e-05
6.46983e-05
0.000111654
8.71009e-05
9.61181e-05
6.65944e-05
5.73155e-05
5.78133e-05
6.71794e-05
0.000111664
8.71248e-05
9.6192e-05
9.01994e-05
4.76709e-05
4.76606e-05
8.51747e-05
8.53172e-05
5.38648e-05
4.95676e-05
5.37819e-05
6.249e-05
4.96098e-05
6.26872e-05
)
;
}
AMI1
{
type cyclicAMI;
value nonuniform List<scalar>
1024
(
0.00144264
0.00203207
0.000981235
0.000806593
0.000359402
0.000553732
0.000589178
0.000393615
0.000968295
0.000755372
0.00107278
0.00109534
0.000969702
0.000834969
0.000472281
0.000149569
0.000152131
0.00144595
0.00144829
0.000361816
0.000363263
0.00132385
0.00132558
0.00144374
0.00126792
0.00123294
0.00123302
0.000808832
0.000810144
0.00124837
0.0012477
0.00098206
0.000780855
0.000780956
0.000863484
0.00086161
0.0003622
0.000358763
0.00035371
0.00034451
0.000342459
0.000298366
0.000296955
0.000397402
0.000386378
0.000608112
0.000349941
0.0004576
0.000451115
0.000356198
0.000439287
0.000360082
0.000432343
0.00037631
0.000439709
0.0003973
0.00065928
0.000738209
0.000696563
0.00104373
0.00101945
0.000830205
0.00102413
0.00101918
0.000890315
0.0012877
0.00115494
0.00115362
0.00100206
0.000999134
0.00119987
0.00119637
0.000962922
0.000324634
0.000324906
0.000615158
0.000616997
0.000278468
0.000334305
0.000332114
0.000543616
0.000548568
0.000471815
0.00123339
0.00122629
0.00153186
0.000920936
0.00199875
0.00150288
0.00188559
0.00158073
0.0016613
0.00138808
0.00141913
0.00141719
0.00192693
0.00148221
0.00120401
0.00123149
0.00125522
0.00121871
0.00108136
0.000853639
0.000969388
0.000958967
0.000823324
0.00107566
0.000738652
0.00077004
0.000766946
0.00043418
0.000367758
0.000258441
0.000295643
0.000369812
0.000426647
0.000376879
0.000493165
0.000539336
0.000609117
0.000590806
0.000605238
0.000592069
0.000555402
0.000614982
0.000679689
0.000583378
0.000676655
0.000678402
0.00058921
0.000670699
0.00064298
0.000351974
0.000650024
0.000607213
0.00077124
0.000884763
0.000864871
0.000850531
0.000772516
0.0010453
0.00100749
0.00110464
0.00103934
0.00106211
0.00102974
0.00102436
0.000846216
0.000900096
0.000971267
0.000862901
0.000709993
0.000524209
0.00130234
0.00117096
0.00113125
0.00140659
0.000857831
0.00123126
0.0013882
0.00138608
0.000212419
0.000209067
0.000121793
0.00012169
0.00122227
0.00153204
0.000911626
0.00201582
0.00162792
0.00208429
0.00166417
0.002454
0.00161004
0.0020762
0.0016519
0.00244874
0.000128145
0.000107039
0.000107522
0.00149927
0.00188222
0.00157298
0.00166039
0.00144394
0.00137554
0.00144237
0.00137508
0.00155331
0.000181003
0.000687722
0.000180499
0.000688825
0.00118144
0.00118694
0.00125867
0.00125853
0.00138792
0.00141876
0.00193242
0.00148142
0.00147595
0.00147565
0.00120315
0.00127392
0.0012165
0.00123666
0.00123658
0.00118853
0.00127028
0.00118853
0.00126237
0.0012039
0.00123188
0.00126338
0.00121425
0.00107554
0.00119939
0.00121409
0.00107591
0.0011997
0.00121463
0.00121454
0.00118194
0.00119983
0.00112677
0.0011461
0.00107089
0.00126281
0.00113744
0.00108166
0.00107203
0.000837278
0.00107254
0.000785224
0.000785306
0.000853429
0.000969829
0.000958872
0.0008226
0.000768887
0.000767283
0.00107525
0.000857078
0.000856857
0.000718456
0.000718442
0.000739367
0.000605953
0.000606258
0.000605838
0.00044814
0.000694832
0.000673069
0.000737084
0.000753139
0.000691533
0.000652995
0.000545016
0.000408324
0.000406974
0.000438991
0.000422834
0.000434586
0.00036778
0.00043936
0.000423092
0.000395134
0.00039609
0.00032809
0.000430672
0.000330904
0.000423459
0.000465031
0.000465096
0.000421141
0.000471982
0.000461609
0.000460512
0.000411753
0.00054243
0.00063783
0.000533618
0.000578585
0.000539683
0.000404845
0.000251387
0.00029375
0.000287353
0.000503266
0.000465519
0.000533252
0.000373387
0.000503266
0.000457275
0.00053142
0.000430639
0.000480655
0.000536013
0.000582445
0.000619556
0.000579029
0.000617391
0.000496694
0.000498112
0.000496193
0.000497078
0.000496851
0.000449395
0.000495336
0.000431924
0.000370857
0.000443228
0.000491366
0.000398716
0.000462431
0.000434008
0.000378375
0.000446797
0.000486654
0.000531813
0.000538138
0.000445052
0.000509555
0.000524711
0.00049034
0.00053518
0.000539179
0.000500204
0.000565708
0.000474582
0.000418526
0.000503124
0.000566327
0.000623944
0.000634157
0.000616079
0.000632635
0.000696947
0.000700213
0.000697471
0.000699128
0.000694857
0.000642634
0.000607816
0.000590073
0.000605178
0.000585563
0.000691691
0.000627519
0.000604981
0.000567951
0.000562384
0.000554792
0.000561039
0.000615836
0.000571646
0.000654099
0.000572349
0.000661824
0.000606285
0.00066156
0.000919628
0.000974198
0.000918715
0.000945358
0.000731576
0.000689187
0.000732549
0.000694409
0.000771253
0.000812233
0.00085407
0.000811801
0.000781265
0.000803715
0.000838488
0.000799013
0.000831155
0.000816482
0.000830626
0.000848798
0.000863333
0.00093629
0.00096921
0.000968662
0.000853367
0.000853017
0.0010449
0.00100702
0.00110108
0.00109846
0.00119944
0.00115714
0.00114807
0.00107961
0.00114147
0.00107905
0.00120839
0.00106776
0.00106745
0.00101538
0.000992182
0.00095488
0.000988646
0.000954631
0.000936769
0.000936467
0.0011142
0.0010885
0.00111364
0.00108825
0.00084551
0.000899682
0.00079788
0.000792749
0.000797293
0.000786579
0.000970984
0.000562662
0.000562765
0.000441097
0.000441084
0.000480266
0.000795431
0.000671077
0.000699622
0.000670617
0.000695817
0.000382388
0.000263952
0.000401387
0.000272398
0.000399106
0.000273835
0.000617658
0.000617246
0.000707567
0.000520879
0.000675362
0.000861391
0.00102453
0.00101723
0.000851586
0.000859377
0.00101999
0.00101563
0.000848142
0.0012969
0.0011674
0.00112878
0.00140289
0.00145899
0.0020374
0.0015187
0.00172676
0.0014488
0.00203163
0.0015067
0.00171749
0.000856849
0.000726099
0.000724466
0.000752357
0.000753
0.00102554
0.0010241
0.00108776
0.00126557
0.00145636
0.00123193
0.000255438
0.000623102
0.000671791
0.000436418
0.000372041
0.000389215
0.000393467
0.000466466
0.000743563
0.000843062
0.000874139
0.00129433
0.00108765
0.00106238
0.000278176
0.000262979
0.000939284
0.001086
0.00169354
0.00169065
5.57751e-05
5.53379e-05
0.000396288
0.000411651
0.00191193
0.00191855
0.00138517
0.00138483
0.00203669
0.00152882
0.00153097
0.00127242
0.00127334
0.00145619
0.00122794
0.00118154
0.00122913
0.00126373
0.00113817
0.00131727
0.00105528
0.00131098
0.00104759
0.00122785
0.000775329
0.00077578
0.000801457
0.000372672
0.000568781
0.000252622
0.000458211
0.000445267
0.000404061
0.000293413
0.000547139
0.000536916
0.000503545
0.000496675
0.000601709
0.00060548
0.000617129
0.000625305
0.000482408
0.000477383
0.000580533
0.000540694
0.00057406
0.000483903
0.000576575
0.0004721
0.000384776
0.000826262
0.000792377
0.00039033
0.000396312
0.000395142
0.000393806
0.000393539
0.00045694
0.000953102
0.000753068
0.000751611
0.000844353
0.000837796
0.00088335
0.000745001
0.000749656
0.00073529
0.00106663
0.000979324
0.00108055
0.000976747
0.00130522
0.00120725
0.00119917
0.00115663
0.00113667
0.00127616
0.00109528
0.00107336
0.0010721
0.00112578
0.00112112
0.000681441
0.000682131
0.000902463
0.000904622
0.00106173
0.000554788
0.000558793
0.000798327
0.000836684
0.000936604
0.000255538
0.000253081
0.00108688
0.00125702
0.00132451
0.00207453
0.00151369
0.00154874
0.00175502
0.000367395
0.000141771
0.000466292
6.79999e-05
0.00136392
0.00120314
0.00127282
0.00121656
0.00143115
0.00131809
0.00135154
0.00120044
0.00112685
0.00110021
0.00115975
0.00114766
0.00112653
0.00116872
0.00115383
0.000448403
0.000349076
0.000464438
0.000345889
0.000446949
0.000430251
0.000641831
0.000550646
0.000583199
0.000489759
0.000390175
0.000458606
0.000442882
0.000507316
0.000523833
0.00046997
0.000413446
0.000372298
0.00038959
0.000582133
0.000584898
0.000389011
0.00044596
0.000678048
0.000575211
0.000547113
0.000843763
0.000739543
0.000784656
0.000811627
0.000754207
0.000763715
0.00074576
0.000762847
0.000816814
0.000792407
0.00089186
0.000913489
0.000897939
0.000882412
0.000913346
0.000929338
0.00120274
0.00120039
0.00122234
0.00101804
0.000879701
0.0010094
0.00100712
0.000949456
0.000349722
0.000382496
0.00053831
0.000451392
0.000675646
0.000364733
0.000298899
0.000384939
0.000286694
0.000944886
0.000844666
0.00108517
0.00125262
0.00146219
0.0015118
0.00145601
0.000247885
3.95673e-05
0.000245832
4.23593e-05
0.000148279
0.000151985
0.000149145
0.00016042
0.00132413
0.0020711
0.0015473
0.00174767
0.000935679
0.000465434
0.000683675
0.000915302
0.000936438
0.000464396
0.000683887
0.000910818
0.000367207
0.000141127
0.000466335
6.76873e-05
1.92102e-05
0.000128922
1.92391e-05
0.00155227
0.000349236
0.000349259
0.000682929
0.00119124
0.000683609
0.00119095
0.00136396
0.00132358
0.00132342
0.00141595
0.00146661
0.00160965
0.00146653
0.00161388
0.00121606
0.00129196
0.00121592
0.00129238
0.0013178
0.00143116
0.00135153
0.00127048
0.00130504
0.00130635
0.00120668
0.00120659
0.00125563
0.00121857
0.00118801
0.0011878
0.00115966
0.00114599
0.00107073
0.00110002
0.00114749
0.000836511
0.00108801
0.00108769
0.00116827
0.000796124
0.000795981
0.00112616
0.00115052
0.000964221
0.000990336
0.000963869
0.000988316
0.000762181
0.000739535
0.000762266
0.000604145
0.000769532
0.000620221
0.000615336
0.000456515
0.000348402
0.000347819
0.000422517
0.000422686
0.000374698
0.00043571
0.00034799
0.000375289
0.000433615
0.00046028
0.000463717
0.000446515
0.000435092
0.000467675
0.000480247
0.000480158
0.000481186
0.000468764
0.000397059
0.00034291
0.000370021
0.000393664
0.000422817
0.000445672
0.000540561
0.000590312
0.000574517
0.000528168
0.000588469
0.000565935
0.00054005
0.000465784
0.000454001
0.000539057
0.000465983
0.000644589
0.000499243
0.000645823
0.000500175
0.000658672
0.000675387
0.000688554
0.000661
0.000676596
0.000682169
0.00065839
0.00065535
0.00066097
0.000660938
0.000683545
0.000587874
0.00068192
0.000682506
0.000566333
0.00068031
0.000683681
0.000575866
0.0006842
0.000678594
0.000530867
0.000658909
0.000679601
0.000568148
0.000675021
0.000683004
0.000511467
0.00066659
0.000645244
0.000349912
0.0007283
0.00076236
0.000808866
0.000786178
0.000729108
0.000761944
0.000711696
0.000431459
0.000647236
0.000414303
0.000652645
0.000714071
0.000483523
0.000718807
0.000719517
0.000468405
0.000576132
0.00037768
0.000365618
0.000374575
0.000584965
0.000573649
0.000376916
0.000582942
0.000390341
0.000445971
0.000678809
0.000558711
0.000340929
0.000557975
0.000345216
0.000614153
0.000656228
0.000706537
0.000574512
0.000540022
0.000609937
0.000649727
0.000707088
0.000845458
0.00072307
0.000785845
0.000785803
0.000895535
0.000895021
0.000883956
0.000850172
0.000699461
0.00070292
0.000738001
0.000723184
0.000728597
0.000724057
0.000711711
0.000728042
0.000710882
0.000753707
0.00074852
0.000781856
0.00078646
0.000781739
0.000781641
0.000777721
0.000741967
0.00076243
0.000782833
0.000809973
0.000848888
0.000782336
0.000809507
0.000831055
0.00080071
0.000811087
0.000775358
0.00081081
0.000801283
0.00077277
0.000767279
0.000785152
0.00091298
0.000891669
0.000896491
0.000935724
0.000945036
0.000946689
0.00091601
0.000882035
0.000913007
0.000910177
0.000966589
0.000965919
0.00103861
0.000929346
0.00109888
0.00113353
0.00116477
0.00113302
0.00115991
0.00109237
0.00115166
0.00109153
0.00110543
0.00113191
0.00106326
0.00110463
0.0011312
0.00106262
0.00114043
0.0012016
0.00115624
0.00101896
0.00106701
0.00108606
0.00104191
0.00108311
0.00104167
0.0010295
0.00102424
0.00101925
0.000982565
0.000982306
0.00120622
0.00119812
0.00105873
0.00110721
0.00117121
0.00105809
0.00110662
0.00116317
0.000871049
0.000698902
0.000698563
0.000921738
0.000965062
0.000921105
0.000949308
0.000964557
0.0010089
0.00100939
0.000604245
0.000496464
0.000366863
0.000480103
0.000604172
0.000500711
0.000367691
0.00082576
0.000825363
0.000862459
0.000740281
0.000739899
0.000349316
0.000345007
0.000343791
0.000538188
0.000454277
0.000460522
0.00032561
0.000413679
0.00037952
0.000460381
0.000325181
0.000412889
0.000380766
0.000360531
0.000297643
0.000383041
0.000284099
0.000380373
0.000370908
0.000580813
0.000450119
0.000627518
0.000299547
0.000373793
0.000367151
0.000575248
0.000443784
0.000296851
0.00176372
0.00135106
0.001771
0.000943954
0.000841062
0.000705243
0.000624629
0.000700414
0.000544461
0.000579268
0.000544648
0.000580539
0.00105148
0.00134477
0.00105979
)
;
}
AMI2
{
type cyclicAMI;
value nonuniform List<scalar>
1040
(
0.00194185
0.00144046
0.00124007
0.00092898
0.000748027
0.000445041
0.000412712
0.000354706
0.000410556
0.000610834
0.000372146
0.000357412
0.000717335
0.000799245
0.00113352
0.0011881
0.000848503
0.000500043
0.00164543
0.00193991
0.000679252
0.000677327
0.00164266
0.00165154
0.000207152
0.000204972
0.00160671
0.00161085
0.00144629
0.00149177
0.00130177
0.00130336
0.00130716
0.00130941
0.00124035
0.00126171
0.00126386
0.000895125
0.000890243
0.000836059
0.000837561
0.00107604
0.00107338
0.000927232
0.000828984
0.000638215
0.000336468
0.000338035
0.000320366
0.000319318
0.000385836
0.000374651
0.000280359
0.000273282
0.000363769
0.000436282
0.000454856
0.000448882
0.000455944
0.000450399
0.000686803
0.000678769
0.000620889
0.000613311
0.000393321
0.000395174
0.000536455
0.000388565
0.000525425
0.000586722
0.000561061
0.00057662
0.00057429
0.000745049
0.000738622
0.000391281
0.00037608
0.000364426
0.000407975
0.00039803
0.000354044
0.000775401
0.0007711
0.000720196
0.0010021
0.000984186
0.000739832
0.000736367
0.000929575
0.000930124
0.000809723
0.000891737
0.00115105
0.00114045
0.00108804
0.00108357
0.00111889
0.00112163
0.00118575
0.00126203
0.00124533
0.000913704
0.000915268
0.000959303
0.000952022
0.000639806
0.000640074
0.00085101
0.00088478
0.000875843
0.000548982
0.000553715
0.00164185
0.00106104
0.00105929
0.00203115
0.00202902
0.00128583
0.00128284
0.00155043
0.00205437
0.000420032
0.000199702
0.000505435
8.86033e-05
0.000233189
0.000216885
0.000118233
0.000465715
0.00148905
0.00139034
0.00140995
0.00135274
0.00121255
0.00119617
0.00122593
0.00121069
0.00117906
0.00121687
0.00113007
0.00134178
0.000916402
0.000855068
0.000726074
0.000464895
0.000445974
0.000412842
0.000546506
0.000488239
0.00032404
0.00039836
0.000431997
0.000401487
0.000461394
0.000478147
0.000393391
0.000477962
0.000651531
0.000620257
0.000660649
0.000480425
0.00060976
0.000553713
0.000375187
0.000651778
0.000331028
0.000645788
0.00052884
0.000598166
0.000596408
0.000718539
0.00068902
0.000882991
0.000856566
0.000855196
0.000894473
0.000813979
0.000782218
0.00107394
0.00114026
0.00113007
0.00107168
0.00108176
0.00119813
0.00113095
0.000973612
0.00101748
0.00101551
0.00087506
0.000809277
0.0004823
0.000565547
0.00036467
0.000286638
0.000683149
0.000545528
0.000600247
0.000656607
0.00149583
0.0014241
0.0015489
0.00204743
0.000818903
0.00120379
0.000819353
0.00119741
0.00129155
0.000939597
0.00128642
0.000946641
0.000496453
0.000496743
0.000496361
0.000496635
0.000419975
8.81511e-05
0.00016737
8.34991e-05
0.000132292
2.4067e-05
0.000167564
8.47252e-05
0.000132897
2.40086e-05
0.000232691
0.000219148
0.000118657
0.000467197
0.000463779
0.000860886
0.000464163
0.000863582
0.00205102
0.00145628
0.00145499
0.0014894
0.00147514
0.00148871
0.00147485
0.00148612
0.00143872
0.00137639
0.00143729
0.00145944
0.00145341
0.00142836
0.00126723
0.00135039
0.00126701
0.0012423
0.00124217
0.00137164
0.00121248
0.00119617
0.00124604
0.00122183
0.00125746
0.00122171
0.00125769
0.00123076
0.00120026
0.00120028
0.00126841
0.0011477
0.00115657
0.000924348
0.00110632
0.000924068
0.00110668
0.0010612
0.00106114
0.00106808
0.00106855
0.00117861
0.00120917
0.00112974
0.00133581
0.00102413
0.00102373
0.00111542
0.000853254
0.000810831
0.000770224
0.000775259
0.000806228
0.000756842
0.000776695
0.000774974
0.000782372
0.00068091
0.000380328
0.000351859
0.00038063
0.00061304
0.000432377
0.000465475
0.000461386
0.000443371
0.000461988
0.000471431
0.000457754
0.000357911
0.000453238
0.000349111
0.000419835
0.000388526
0.000384878
0.000425627
0.000436058
0.000412535
0.000425926
0.000508522
0.000542996
0.000491979
0.000533567
0.000480787
0.000496755
0.000455729
0.000523123
0.000477831
0.000495553
0.000455737
0.000497507
0.000429171
0.000486054
0.000496503
0.000434026
0.000488316
0.000696162
0.000694744
0.000682278
0.000631458
0.000589978
0.000589572
0.000629998
0.000588922
0.000627597
0.000583143
0.00058313
0.000389851
0.000575968
0.000580973
0.000395904
0.000573592
0.000675308
0.000463958
0.000665416
0.000608981
0.000436247
0.000672502
0.00067733
0.000461544
0.000665473
0.000680477
0.000581025
0.000683621
0.000680959
0.000574429
0.00068344
0.00068112
0.000573985
0.000684298
0.000677738
0.000537063
0.000665803
0.00075638
0.000707695
0.000729667
0.000755933
0.000709794
0.00072884
0.000754828
0.000741244
0.000726865
0.000814475
0.000754557
0.000699097
0.000727401
0.000778545
0.000785665
0.000785878
0.000584985
0.000437493
0.000466127
0.00057355
0.000587945
0.000420567
0.000553294
0.000372786
0.000558583
0.000647627
0.00065009
0.000369384
0.000437806
0.000565963
0.000655666
0.000332257
0.000374216
0.000430233
0.000645346
0.000520444
0.000597081
0.000591788
0.000838308
0.000904509
0.000882233
0.000747806
0.000744977
0.000751738
0.000801209
0.000813027
0.000793335
0.000801752
0.00081273
0.000793815
0.000717853
0.000693884
0.000898746
0.000897854
0.00101755
0.00087135
0.000856165
0.000814369
0.000782087
0.0007627
0.000813948
0.000781611
0.000762276
0.000916726
0.00091636
0.000844073
0.000821553
0.000870577
0.000854859
0.000887465
0.000843666
0.000821153
0.000864034
0.000843858
0.000838828
0.000813547
0.000781732
0.000832909
0.000843784
0.000825958
0.000852895
0.000910347
0.0010338
0.00107318
0.00112137
0.00110429
0.00115819
0.0011035
0.00113964
0.000972066
0.0010248
0.00102807
0.00107216
0.00102765
0.00106565
0.00102289
0.00105091
0.00102277
0.00105041
0.00107783
0.00102479
0.00106113
0.00102462
0.00110746
0.00105236
0.00106315
0.00112957
0.00120897
0.0012006
0.00110938
0.0011153
0.00108148
0.00118443
0.00118335
0.000973342
0.00101988
0.00108788
0.00096879
0.000932225
0.000968335
0.00093161
0.000962515
0.00101272
0.000893061
0.000935276
0.000892604
0.000689932
0.000728953
0.0007646
0.000689492
0.000725102
0.000764235
0.000874582
0.000807456
0.000837609
0.000848667
0.000801307
0.000847937
0.000794984
0.000801374
0.000541113
0.00054099
0.000621559
0.000485073
0.000484981
0.000482471
0.000457112
0.000457166
0.000360628
0.000284049
0.000301054
0.000376602
0.000354297
0.000435304
0.000295711
0.000370185
0.00035102
0.000428808
0.000293004
0.000267113
0.000681103
0.000539983
0.000596741
0.000651329
0.000813144
0.000910331
0.000918441
0.00079558
0.000811963
0.000907186
0.00091761
0.000791588
0.00106727
0.00105488
0.00149384
0.00141799
0.0010601
0.00120724
0.00105841
0.00120357
0.00149123
0.00186712
0.00148037
0.00185706
0.00121419
0.00152419
0.00121037
0.00151875
0.00180009
0.00149097
0.00125282
0.000658692
0.000519795
0.00047374
0.000387341
0.000577989
0.0005929
0.000778962
0.000816659
0.000894737
0.000951909
0.000266563
0.00148532
0.00149185
0.00205868
0.00210679
0.00211262
0.00144858
0.00179849
0.00144108
0.0012296
0.0012674
0.00118946
0.00114772
0.00119006
0.00125376
0.00122623
0.00102863
0.00102875
0.000828319
0.000782878
0.000496074
0.000436123
0.000363861
0.00074795
0.000610963
0.000436632
0.000463397
0.000371338
0.000377206
0.000511224
0.000358007
0.000515408
0.000511819
0.00041856
0.000512657
0.000615082
0.000499127
0.000412709
0.000485208
0.000773512
0.000755514
0.000800156
0.000716417
0.000703103
0.000916774
0.000911154
0.00079456
0.000865656
0.00102553
0.000950036
0.00112985
0.00118948
0.00113328
0.00118116
0.00112762
0.00105453
0.0011131
0.00105375
0.00109017
0.00060089
0.000604087
0.000340121
0.000340182
0.000504296
0.000291794
0.000292087
0.000302149
0.00147164
0.000204774
3.69357e-05
0.000208069
7.26275e-05
0.00126213
0.00157854
0.000947887
0.00205007
0.00154419
0.00162065
0.00145944
0.00145367
0.00142834
0.00124672
0.00121977
0.00127561
0.00120041
0.0011501
0.00111557
0.00110809
0.00127082
0.000851754
0.000775714
0.000582824
0.000446301
0.000350343
0.000427312
0.000311134
0.000459836
0.000375226
0.00031897
0.00040395
0.00053903
0.00050465
0.000577181
0.000586193
0.000657118
0.000677319
0.000701196
0.000638205
0.000713202
0.000715792
0.000559728
0.000608406
0.000435472
0.000671597
0.000677372
0.000588235
0.000680638
0.000674597
0.000558224
0.000497663
0.000658991
0.000592218
0.000715803
0.000751872
0.000836649
0.000933373
0.00104299
0.000882298
0.00084076
0.000938443
0.000972609
0.00102995
0.00120359
0.00110997
0.00120813
0.00105261
0.00110986
0.000980854
0.000950952
0.000991226
0.00083801
0.000621979
0.000369611
0.00036129
0.000340831
0.000264049
0.000746422
0.000591649
0.000636636
0.000722865
0.00136003
0.00147065
0.00106519
0.00106569
0.000198995
0.000505556
0.000969789
0.000968922
0.000697075
0.000697687
3.75093e-05
0.000205883
0.000201283
7.69511e-05
0.000107247
0.000584335
0.000277393
0.000219536
0.000108413
0.000595786
0.000276034
0.000230805
0.000910701
0.000910989
0.0012584
0.00157932
0.00093884
0.0020693
0.00165575
0.00165656
0.00248384
0.00164478
0.00163689
0.00247658
0.00131842
0.00198956
0.00131762
0.00199417
0.00192092
0.00192665
0.00137594
0.00153832
0.00161997
0.00154523
0.00154646
0.0013505
0.0013172
0.00131746
0.00137172
0.0013903
0.00140946
0.00130841
0.00135273
0.00130858
0.00118968
0.00118947
0.00121971
0.00127646
0.00121119
0.00123962
0.00129459
0.00121104
0.00123954
0.00129498
0.00115906
0.00115673
0.00115899
0.00114324
0.00113514
0.00119985
0.00114378
0.00113499
0.00119974
0.00120036
0.00121054
0.00112045
0.00122358
0.00112007
0.00121959
0.000916123
0.000999813
0.00085848
0.000999679
0.000858296
0.00115
0.00110809
0.00127003
0.00121119
0.00121217
0.000851537
0.000740667
0.00068444
0.000739183
0.000808434
0.000773252
0.000808197
0.000772421
0.000777782
0.0007895
0.000777879
0.000789495
0.00072606
0.000353459
0.000437464
0.000577236
0.000331409
0.000251841
0.000255943
0.000432068
0.000436457
0.00061118
0.000456655
0.000379429
0.000427421
0.000611057
0.000456289
0.000375666
0.00030898
0.000445098
0.000416855
0.000446335
0.000433754
0.000407503
0.000467033
0.000423406
0.000508655
0.000389155
0.000460776
0.000387384
0.000460185
0.000260129
0.000336651
0.000254496
0.000323971
0.000334489
0.000399699
0.000398365
0.000374916
0.000315136
0.000401591
0.000399623
0.000594801
0.000574062
0.000619644
0.000553221
0.000536697
0.000591641
0.000565903
0.000617708
0.000541563
0.000575395
0.00051033
0.00049259
0.000510109
0.000492901
0.000443424
0.000372905
0.000445234
0.000446333
0.000382272
0.000449537
0.000526205
0.00053516
0.000538364
0.000433737
0.000405654
0.000463515
0.000527718
0.000537461
0.000539048
0.000575668
0.000424557
0.000508931
0.00048241
0.000400623
0.000482194
0.000576146
0.000428861
0.000511417
0.000682578
0.000701507
0.000652888
0.00062822
0.000662938
0.000701672
0.000642152
0.000658866
0.000604895
0.000606413
0.000604765
0.000655885
0.000605129
0.000556129
0.000557531
0.000581579
0.000653323
0.000665429
0.000698128
0.000540662
0.000623791
0.000552631
0.000488861
0.000775295
0.000812812
0.000775409
0.000785029
0.000656219
0.000721202
0.000720389
0.00066203
0.000678838
0.000484254
0.000684209
0.000569
0.000594167
0.000568755
0.000565557
0.000692132
0.000641785
0.000763166
0.000692485
0.000764202
0.00063636
0.000745334
0.000750831
0.000735488
0.000742481
0.000714965
0.000920129
0.000919219
0.00078735
0.000753544
0.000782965
0.00075242
0.000883848
0.000883467
0.00088138
0.000910781
0.000881224
0.00100276
0.001002
0.00109774
0.00109685
0.000937874
0.00100534
0.00100485
0.00107006
0.00107128
0.00119576
0.00120079
0.00130987
0.00130788
0.00119986
0.00129155
0.00120788
0.00129018
0.00111591
0.00106815
0.00106751
0.0011865
0.00113023
0.00111683
0.00105486
0.00100414
0.00105443
0.0010039
0.00103113
0.00103055
0.000962192
0.000980591
0.000950709
0.000987711
0.000935583
0.0010021
0.00099908
0.000801974
0.000637996
0.000685786
0.000701729
0.000637848
0.000686386
0.000701387
0.000454223
0.000457122
0.000426725
0.000402503
0.000426237
0.000404349
0.000565635
0.000370485
0.000401881
0.000340363
0.000401865
0.000340813
0.000388682
0.000387002
0.000361011
0.000339987
0.000265446
0.000377298
0.000406457
0.000464908
0.000307289
0.000375397
0.000405826
0.000461905
0.000305725
0.000744123
0.000591571
0.000633687
0.000721537
0.000906891
0.000901279
0.00090493
0.00106288
0.00105331
0.000897213
0.0013579
0.00119351
0.00119147
0.00150303
0.0014914
0.00136812
0.00136092
)
;
}
}
// ************************************************************************* //
| |
ce07f302160a549ff203b74a2417269102a99ed1 | ffdc77394c5b5532b243cf3c33bd584cbdc65cb7 | /mindspore/ccsrc/pybind_api/ir/py_execute_py.h | 7e372b13d6c3cbeecf98197cadd76abd54023d48 | [
"Apache-2.0",
"LicenseRef-scancode-proprietary-license",
"MPL-1.0",
"OpenSSL",
"LGPL-3.0-only",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause-Open-MPI",
"MIT",
"MPL-2.0-no-copyleft-exception",
"NTP",
"BSD-3-Clause",
"GPL-1.0-or-later",
"0BSD",
"MPL-2.0",
"LicenseRef-scancode-free-unknown",
"AGPL-3.0-only",
"Libpng",
"MPL-1.1",
"IJG",
"GPL-2.0-only",
"BSL-1.0",
"Zlib",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-python-cwi",
"BSD-2-Clause",
"LicenseRef-scancode-gary-s-brown",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"Python-2.0",
"LicenseRef-scancode-mit-nagy",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense"
] | permissive | mindspore-ai/mindspore | ca7d5bb51a3451c2705ff2e583a740589d80393b | 54acb15d435533c815ee1bd9f6dc0b56b4d4cf83 | refs/heads/master | 2023-07-29T09:17:11.051569 | 2023-07-17T13:14:15 | 2023-07-17T13:14:15 | 239,714,835 | 4,178 | 768 | Apache-2.0 | 2023-07-26T22:31:11 | 2020-02-11T08:43:48 | C++ | UTF-8 | C++ | false | false | 10,614 | h | py_execute_py.h | /**
* Copyright 2022-2023 Huawei Technologies Co., Ltd
*
* 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.
*/
// NOTICE: This header file should only be included once in the whole project.
// We change the cpp file to header file, to avoid MSVC compiler problem.
#ifndef MINDSPORE_CCSRC_PYBINDAPI_IR_PY_EXECUTE_PY_H_
#define MINDSPORE_CCSRC_PYBINDAPI_IR_PY_EXECUTE_PY_H_
#include <vector>
#include <string>
#include <memory>
#include <utility>
#include "pybind11/pybind11.h"
#include "pybind_api/pybind_patch.h"
#include "include/common/fallback.h"
#include "mindspore/core/ops/py_execute.h"
#include "mindspore/ccsrc/include/common/utils/convert_utils_py.h"
#include "mindspore/ccsrc/include/common/utils/python_utils.h"
#include "mindspore/ccsrc/include/common/utils/python_adapter.h"
#include "mindspore/ccsrc/include/common/utils/python_fallback_running.h"
#include "mindspore/ccsrc/include/backend/optimizer/helper.h"
#include "mindspore/ccsrc/pipeline/jit/parse/data_converter.h"
#include "mindspore/ccsrc/pybind_api/ir/tensor_py.h"
#include "mindspore/ccsrc/plugin/device/cpu/kernel/pyexecute/py_execute_cpu_kernel.h"
#include "mindspore/ccsrc/pipeline/jit/parse/resolve.h"
#include "include/common/utils/convert_utils_py.h"
namespace py = pybind11;
namespace mindspore {
namespace abstract {
using PyObjectWrapperPtr = std::shared_ptr<parse::PyObjectWrapper>;
namespace pyexecute_user_data_catcher {
std::pair<bool, ValuePtr> PyExecuteUserDataCatcher(const AbstractBasePtr &element_abs) {
MS_EXCEPTION_IF_NULL(element_abs);
if (element_abs->has_user_data<kernel::PyExecuteOutputUserData>()) {
const auto &data = element_abs->user_data<kernel::PyExecuteOutputUserData>();
MS_EXCEPTION_IF_NULL(data);
auto python_obj = std::make_shared<parse::PyObjectWrapper>(data->obj, "graph python obj");
return {true, python_obj};
}
return {false, nullptr};
}
struct PyExecuteUserDataCatcherRegister {
PyExecuteUserDataCatcherRegister() noexcept {
abstract::AbstractBase::set_pyexecute_user_data_catcher(
[](const AbstractBasePtr &element_abs) { return PyExecuteUserDataCatcher(element_abs); });
}
~PyExecuteUserDataCatcherRegister() {}
} pyexecute_user_data_catcher_register;
} // namespace pyexecute_user_data_catcher
} // namespace abstract
static py::object CallPythonGetGlobalParams() {
py::module mod = python_adapter::GetPyModule(parse::PYTHON_MOD_PARSE_MODULE);
constexpr auto python_get_dict = "get_global_params";
return python_adapter::CallPyModFn(mod, python_get_dict);
}
bool ContainStubTensor(const py::object &obj) {
if (py::isinstance<py::list>(obj)) {
auto list_obj = py::cast<py::list>(obj);
return std::any_of(list_obj.begin(), list_obj.end(),
[](const auto &e) { return ContainStubTensor(py::cast<py::object>(e)); });
}
if (py::isinstance<py::tuple>(obj)) {
auto tuple_obj = py::cast<py::tuple>(obj);
return std::any_of(tuple_obj.begin(), tuple_obj.end(),
[](const auto &e) { return ContainStubTensor(py::cast<py::object>(e)); });
}
if (py::isinstance<py::dict>(obj)) {
auto dict_obj = py::cast<py::dict>(obj);
return std::any_of(dict_obj.begin(), dict_obj.end(), [](const auto &e) {
return ContainStubTensor(py::cast<py::object>(e.first)) || ContainStubTensor(py::cast<py::object>(e.second));
});
}
return IsStubTensor(obj);
}
class PyExecuteInitializer {
public:
PyExecuteInitializer() {
mindspore::ops::PyExecuteInfer::set_infer_handler(PyExecuteInferPy);
mindspore::opt::SetCppInferPyHanbdler(CppInferShapeAndTypePy);
}
~PyExecuteInitializer() = default;
private:
static abstract::AbstractBasePtr PyExecuteInferPy(const std::vector<AbstractBasePtr> &input_args) {
const auto &script_abs = input_args[0];
const auto &script = script_abs->BuildValue();
const auto &script_str = dyn_cast<StringImm>(script);
const auto &keys_tuple_abs = input_args[1];
const auto &keys_tuple = keys_tuple_abs->BuildValue();
const auto &keys = dyn_cast<ValueSequence>(keys_tuple);
if (keys == nullptr) {
MS_LOG(DEBUG) << "The keys is not tuple value, but got " << keys_tuple->ToString();
const auto &infer_shape = std::make_shared<abstract::Shape>(ShapeVector({1}));
return abstract::MakeAbstract(infer_shape, kFloat64);
}
constexpr auto number_two = 2;
const auto &values_tuple_abs = input_args[number_two];
const auto &values_tuple = values_tuple_abs->BuildValue();
if (values_tuple == kValueAny) {
MS_LOG(EXCEPTION) << "Value tuple should not be anyvalue.";
}
const auto &values = dyn_cast<ValueSequence>(values_tuple);
if (values == nullptr) {
MS_LOG(DEBUG) << "The values is not tuple value, but got " << keys_tuple->ToString();
const auto &infer_shape = std::make_shared<abstract::Shape>(ShapeVector({1}));
return abstract::MakeAbstract(infer_shape, kFloat64);
}
MS_LOG(DEBUG) << "The script is: " << script->ToString() << ", keys_tuple: " << keys_tuple->ToString()
<< ", values_tuple: " << values_tuple->ToString();
if (keys->size() != values->size()) {
MS_LOG(EXCEPTION) << "The length of keys(" << keys->size() << ") is not equal of the length of values("
<< values->size() << ").";
}
py::gil_scoped_acquire gil_acquire;
py::dict local_dict;
for (size_t i = 0; i < keys->size(); ++i) {
const auto &key = (*keys)[i];
const auto &key_str = dyn_cast<StringImm>(key);
MS_EXCEPTION_IF_NULL(key_str);
const auto &value = (*values)[i];
MS_LOG(DEBUG) << "input[" << i << "], value : " << value->ToString();
const auto &tuple_abs = values_tuple_abs->cast<abstract::AbstractSequencePtr>();
const auto &value_abs = (*tuple_abs)[i];
if (value_abs->has_user_data<kernel::PyExecuteOutputUserData>()) {
const auto &output_data = value_abs->user_data<kernel::PyExecuteOutputUserData>();
auto obj = output_data->obj;
MS_LOG(DEBUG) << "input[" << i << "] convert value from user data, obj: " << obj;
local_dict[py::str(key_str->value())] = obj;
} else {
auto obj = ValueToPyData(value, value_abs);
local_dict[py::str(key_str->value())] = obj;
MS_LOG(DEBUG) << "input[" << i << "] convert value from abstract, obj: " << obj;
}
}
const auto &py_script = py::str(script_str->value());
const auto &global_dict = CallPythonGetGlobalParams();
auto params = py::tuple(number_two);
params[0] = global_dict;
params[1] = local_dict;
MS_LOG(DEBUG) << "Python script: " << py_script << ", local_dict: " << local_dict;
try {
mindspore::ScopedFallbackRunning fallback_running;
const auto &output = parse::data_converter::CallPythonScript(py_script, params);
if (ContainStubTensor(output)) {
MS_EXCEPTION(TypeError) << "PyExecute node output can not contain stub tensor.";
}
MS_LOG(DEBUG) << "Python output type: " << py::str(output.get_type()) << ", output: " << output;
fallback::PushPyExecuteOutput(output);
if (py::isinstance<tensor::Tensor>(output) || IsStubTensor(output)) {
const auto &tensor = IsStubTensor(output) ? ConvertStubTensor(output) : output.cast<tensor::TensorPtr>();
const auto &infer_shape = std::make_shared<abstract::Shape>(tensor->shape());
return tensor->ToAbstract();
}
static const auto allow_inplace_ops = common::GetEnv("MS_DEV_FALLBACK_SUPPORT_LIST") != "0";
if (allow_inplace_ops && py::isinstance<py::list>(output)) {
// Runtime can not handle real operator with nested output.
// Hence, the abstract should be AbstractAny for nested sequence.
ValuePtr converted_res = nullptr;
bool converted = parse::ConvertData(output, &converted_res);
if (converted) {
auto ret_list = converted_res->ToAbstract();
auto filter_ret_list = fallback::GenerateAbstractList(ret_list->BuildShape(), ret_list->BuildType(), false);
auto ret = std::make_shared<abstract::AbstractTuple>(filter_ret_list->elements());
MS_LOG(DEBUG) << "Result abstract is: " << ret->ToString();
return ret;
}
}
} catch (const py::error_already_set &e) {
auto error_type_name = py::cast<std::string>(python_adapter::GetPyObjAttr(e.type(), "__name__"));
auto error_iter = exception_types_map.find(error_type_name);
if (error_iter != exception_types_map.end()) {
auto &handler = LogWriter::GetExceptionHandler();
if (handler != nullptr) {
handler(error_iter->second, py::str(e.value()));
}
}
throw std::runtime_error(py::str(e.value()));
}
const auto &infer_shape = std::make_shared<abstract::Shape>(ShapeVector({1}));
return abstract::MakeAbstract(infer_shape, kFloat64);
}
static abstract::AbstractBasePtr CppInferShapeAndTypePy(const CNodePtr &cnode, const PrimitivePtr &primitive,
const AbstractBasePtrList &args_abs_list) {
// We can't catch the pybind11 exception by py::builtin_exception or its base class,
// so we have to list all pybind11 exceptions and catch one by one here.
AbstractBasePtr res;
std::function<void(void)> already_set_error_handler;
std::function<void(void)> other_error_handler;
std::function<void(void)> default_error_handler;
HandleExceptionRethrow(
[&res, &cnode, &primitive, &args_abs_list]() {
res = opt::CppInferShapeAndType(primitive, args_abs_list);
MS_LOG(DEBUG) << "The abstract of " << cnode->fullname_with_scope() << " changes from " << cnode->abstract()
<< " to " << res;
return res;
},
already_set_error_handler, other_error_handler, default_error_handler,
cnode->debug_info()); // Use debug_info to re-throw.
return res;
}
};
static PyExecuteInitializer py_execute_initializer;
} // namespace mindspore
#endif // MINDSPORE_CCSRC_PYBINDAPI_IR_PY_EXECUTE_PY_H_
|
a404017e0e3dc2b2414719a9330c4efd6307e3ae | 3d3fc6704b61e9ae0a738b51d756eb4a17dbaebf | /src/ast/timeimpl.h | 5807271fb0415e3a35c46020dd88adff1eb23908 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JackWolfard/cash | 6704715a4bea3308dc8a4b891929b9c8fd9b7bb6 | a646c0b94d075fa424a93904b7499a0dee90ac89 | refs/heads/master | 2022-04-24T14:13:42.956529 | 2020-04-30T01:44:52 | 2020-04-30T01:44:52 | 257,402,286 | 0 | 0 | NOASSERTION | 2020-04-20T20:58:34 | 2020-04-20T20:58:33 | null | UTF-8 | C++ | false | false | 295 | h | timeimpl.h | #pragma once
#include "ioimpl.h"
namespace ch {
namespace internal {
class timeimpl : public ioimpl {
public:
lnodeimpl* clone(context* ctx, const clone_map& cloned_nodes) const override;
protected:
timeimpl(context* ctx, const source_location& sloc);
friend class context;
};
}
}
|
1b0c5fbe1ea5d8b639ee1861020996afe1fb05d0 | 534b34d9d4817ffbb3a5ded0fdbdf76e79e5cbcf | /gametable.cpp | 6cccaf49ff7caf9ef109f68e19c2c40de2925830 | [] | no_license | levongh/Game | 30a2fc259e744c3c265bbed37d1a64429970f8ea | 5e8a5fb21ce7f7474a98640292d2cdc282c67bb5 | refs/heads/master | 2020-03-23T20:25:13.584507 | 2018-09-20T06:22:23 | 2018-09-20T06:22:23 | 142,040,119 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,254 | cpp | gametable.cpp | #include <QHeaderView>
#include <QtWidgets>
#include "gametable.h"
#include "inventarItem.h"
GameTable::GameTable(QWidget* parent)
: QTableWidget(parent)
{
setRowCount(3);
setColumnCount(3);
horizontalHeader()->setVisible(false);
horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
verticalHeader()->setVisible(false);
verticalHeader()->setSectionResizeMode( QHeaderView::Stretch );
setEditTriggers(QAbstractItemView::NoEditTriggers);
setSelectionMode(QAbstractItemView::SingleSelection);
setAcceptDrops(true);
}
GameTable::~GameTable()
{
}
void GameTable::dragEnterEvent(QDragEnterEvent *event)
{
qDebug() << __FUNCTION__;
if (event->mimeData()->hasFormat("application/x-dnditemdata"))
event->accept();
else
event->ignore();
}
void GameTable::dragLeaveEvent(QDragLeaveEvent *event)
{
qDebug() << __FUNCTION__;
QTableWidget::dragLeaveEvent(event);
}
void GameTable::dragMoveEvent(QDragMoveEvent *event)
{
qDebug() << __FUNCTION__;
QModelIndex index = indexAt(event->pos());
if (event->mimeData()->hasFormat(InventarItem::inventarMimeType())) {
event->setDropAction(Qt::CopyAction);
event->accept();
} else {
event->ignore();
}
update(index);
}
void GameTable::dropEvent(QDropEvent *event)
{
qDebug() << __FUNCTION__;
if (event->mimeData()->hasFormat(InventarItem::inventarMimeType())) {
QByteArray itemData = event->mimeData()->data(InventarItem::inventarMimeType());
QDataStream dataStream(&itemData, QIODevice::ReadOnly);
QPixmap pixmap;
dataStream >> pixmap;
QLabel *newIcon = new QLabel(this);
newIcon->setPixmap(pixmap);
newIcon->show();
newIcon->setAttribute(Qt::WA_DeleteOnClose);
QModelIndex index = indexAt(event->pos());
setCellWidget(index.row(), index.column(), newIcon);
++m_indexToImage[index];
qDebug() << m_indexToImage[index];
if (event->source() == this) {
//event->setDropAction(Qt::CopyAction);
//event->accept();
} else {
//event->acceptProposedAction();
}
} else {
event->ignore();
}
}
void GameTable::mousePressEvent(QMouseEvent *event)
{
qDebug() << __FUNCTION__;
QLabel *child = dynamic_cast<QLabel*>(childAt(event->pos()));
if (!child) {
QTableWidget::mousePressEvent(event);
return;
}
QPixmap pixmap = *child->pixmap();
QByteArray itemData;
QDataStream dataStream(&itemData, QIODevice::WriteOnly);
dataStream << pixmap;
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-dnditemdata", itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
drag->setPixmap(pixmap);
drag->setHotSpot(event->pos() - child->pos());
QPixmap tempPixmap = pixmap;
QPainter painter;
painter.begin(&tempPixmap);
painter.fillRect(pixmap.rect(), QColor(127, 127, 127, 127));
painter.end();
child->setPixmap(tempPixmap);
if (drag->exec(Qt::MoveAction) == Qt::MoveAction) {
child->setPixmap(pixmap);
} else {
child->show();
child->setPixmap(pixmap);
}
}
|
5af3ec0d51a227a40bbc375eb76cb973507675f3 | 77cab51d8312710b22907c787b0357aef46a710a | /TwoPointers/ShortestWordDistanceII.cpp | b024aa2c884fb4132f23c335f9f2a3eb6e82008f | [] | no_license | rockieCao/LeetCodeSolution | 994b82bd62b29953fa888a8bdf6b8932093971a7 | 0a4279a78669fd0c8c56a3ea0da7452f6494f8cb | refs/heads/master | 2021-01-19T02:54:36.990712 | 2016-09-26T15:55:43 | 2016-09-26T15:55:43 | 47,871,071 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,078 | cpp | ShortestWordDistanceII.cpp | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
/*Problem: Shortest Word Distance II
This is a follow up of Shortest Word Distance. The only difference is now you are given the list of words and your method will be called repeatedly many times with different parameters. How would you optimize it?
Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest distance between these two words in the list.
For example,
Assume that words = ["practice", "makes", "perfect", "coding", "makes"].
Given word1 = “coding”, word2 = “practice”, return 3.
Given word1 = "makes", word2 = "coding", return 1.
Note:
You may assume that word1 does not equal to word2, and word1 and word2 are both in the list.
Solution: two-pointers traverse two lists
*/
class WordDistance {
private:
unordered_map<string,vector<int>> wordidx;
public:
WordDistance(vector<string>& words) {
for(int i=0;i<words.size();++i) {
if(wordidx.find(words[i])==wordidx.end())
wordidx[words[i]]=vector<int>();
wordidx[words[i]].push_back(i);
}
}
//word1!=word2
int shortest(string word1, string word2) {
vector<int>& idx1 = wordidx[word1];
vector<int>& idx2 = wordidx[word2];
int cnt1=idx1.size(), cnt2=idx2.size();
int res=INT_MAX, i1=0,i2=0;
while(i1<cnt1&&i2<cnt2) { // two-pointers pursuit each other
res=min(res,abs(idx1[i1]-idx2[i2]));
if (idx1[i1]>idx2[i2]) ++i2;
else ++i1;
}
return res;
}
};
class Solution {
public:
static void test() {
int n;
cin>>n;
vector<string> vec;
string word1,word2;
for(int i=0;i<n;++i) {
cin>>word1;
vec.push_back(word1);
}
WordDistance wd(vec);
while(cin>>word1>>word2) {
cout<<"ans="<<wd.shortest(word1, word2)<<endl;
}
}
};
|
e711939d029cf21ba7a667ae4bb2fad737d6018c | faadeeebc471ddbab3912571aecef5274a956390 | /hal/hal_led.cpp | 609a8690a2e7caead13c0cf271cf387d83e289e9 | [] | no_license | kwarc93/stm32f7-cpp-tests | df465a134527d596719dc22a8dc7cab1b8d2a240 | 3f7b58476b4f0a013d1bdb23640a1d3de3a502c2 | refs/heads/master | 2023-06-06T10:40:31.773138 | 2021-06-26T14:53:40 | 2021-06-26T14:53:40 | 305,626,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,587 | cpp | hal_led.cpp | /*
* hal_led.cpp
*
* Created on: 25 paź 2020
* Author: kwarc
*/
#include "hal_led.hpp"
#include <cmath>
#include <functional>
using namespace hal;
// Gamma brightness lookup table <https://victornpb.github.io/gamma-table-generator>
// gamma = 2.00 steps = 256 range = 0-255
static const uint8_t gamma_lut[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4,
4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9,
9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 24,
25, 26, 26, 27, 28, 28, 29, 30, 30, 31, 32, 32, 33, 34, 35, 35,
36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48,
49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80,
81, 82, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 97, 98, 99,
100, 102, 103, 104, 105, 107, 108, 109, 111, 112, 113, 115, 116, 117, 119, 120,
121, 123, 124, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139, 140, 142, 143,
145, 146, 148, 149, 151, 152, 154, 155, 157, 158, 160, 162, 163, 165, 166, 168,
170, 171, 173, 175, 176, 178, 180, 181, 183, 185, 186, 188, 190, 192, 193, 195,
197, 199, 200, 202, 204, 206, 207, 209, 211, 213, 215, 217, 218, 220, 222, 224,
226, 228, 230, 232, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255,
};
led::led(interface::led *interface)
{
this->interface = interface;
this->brightness = 0;
}
led::~led()
{
}
void led::set(uint8_t brightness)
{
this->brightness = gamma_lut[brightness];
this->interface->set(this->brightness);
}
void led::set(bool state)
{
uint8_t brightness = state ? 255 : 0;
this->set(brightness);
}
//---------------------------------------------------------------------------
rgb_led::rgb_led(const std::array<interface::led *, 3> &interface)
{
this->r = new led {interface[0]};
this->g = new led {interface[1]};
this->b = new led {interface[2]};
}
rgb_led::~rgb_led()
{
delete this->r;
delete this->g;
delete this->b;
}
void rgb_led::set(uint8_t r, uint8_t g, uint8_t b)
{
this->r->set(r);
this->g->set(g);
this->b->set(b);
}
void rgb_led::set(bool r, bool g, bool b)
{
this->r->set(r);
this->g->set(g);
this->b->set(b);
}
void rgb_led::set(float h, float s, float v)
{
if (h > 360.0f || h < 0.0f || s > 1.0f || s < 0.0f || v > 1.0f || v < 0.0f)
return;
/* Convert HSV to RGB */
auto k = [ &h ](float n) { return fmod((n + h / 60.0f), 6); };
auto f = [ &k, &s, &v ](float n) { return v - v * s * fmax(0, fmin(fmin(k(n), 4 - k(n)), 1));};
uint8_t r = f(5) * UINT8_MAX;
uint8_t g = f(3) * UINT8_MAX;
uint8_t b = f(1) * UINT8_MAX;
this->set(r, g, b);
}
//---------------------------------------------------------------------------
led_chain::led_chain(uint32_t leds, uint8_t colors, interface::led *interface) :
led_count {leds}, led_colors {colors}
{
this->leds = new led {interface};
const std::vector<uint8_t> color(colors, 0);
this->colors.assign(leds, color);
}
led_chain::~led_chain()
{
delete this->leds;
}
void led_chain::update(void)
{
for (auto &color : this->colors)
for (auto &component : color)
this->leds->set(component);
}
|
f0ee758d71464ffff03a14a2f6e5ad01da4c14fe | bb61c1bbb179a699e1c921f7fd75fbaa12c71c22 | /object-oriented-design/jukebox.cpp | 56e706552a91cd34a1f2c7783422e198d88700e0 | [
"MIT"
] | permissive | mayankamencherla/cracking-the-coding-interview-solutions | f31457e964dc0dd2383843667020500700c0d476 | 3cccad728cd4d41154eed9e93dd0546923a23fda | refs/heads/master | 2020-03-31T21:17:18.301764 | 2018-11-26T22:33:16 | 2018-11-26T22:33:16 | 152,574,685 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 15,637 | cpp | jukebox.cpp | /**
* Design a jukebox using object oriented principles
*/
#include <iostream>
#include <vector>
#include <limits>
#include <queue>
using namespace std;
class JukeBox;
class Song;
class CD;
class CDPlayer;
class Album;
class Artist;
class PlayList;
class Artist
{
private:
/**
* Name of the artist
* @param string name
*/
string name;
public:
Artist() {}
Artist(string name)
{
this->name = name;
}
/**
* Returns name of the artist
* @return string
*/
string getName()
{
return this->name;
}
};
class Album
{
private:
/**
* Name of the album
* @param string name
*/
string name;
public:
Album() {}
Album(string name)
{
this->name = name;
}
/**
* Returns name of the album
* @return string
*/
string getName()
{
return this->name;
}
};
class Song
{
private:
/**
* Artist of the song
* @param Artist artist
*/
Artist artist;
/**
* Album of the song
* @param Album album
*/
Album album;
/**
* Name of the song
* @param string name
*/
string name;
/**
* Duration of the song in seconds
* @param int duration
*/
int duration;
/**
* Returns the artist of the song
* @return Artist
*/
Artist getArtist()
{
return this->artist;
}
/**
* Returns the album of the song
* @return Album
*/
Album getAlbum()
{
return this->album;
}
/**
* Returns the name of the song
* @return string
*/
string getName()
{
return this->name;
}
public:
Song(Artist& artist, Album& album, string name, int duration)
{
this->artist = artist;
this->album = album;
this->name = name;
this->duration = duration;
}
/**
* Returns the duration of the song in seconds
* @return int
*/
int getDuration()
{
return this->duration;
}
/**
* Prints the song in a human readable way
* @return void
*/
void print()
{
printf("The name of the song is : %s.\nThe song is by the artist : %s.\nThe song is in the album : %s.\nThe song lasts for %d seconds.\n",
this->getName().c_str(),
this->getArtist().getName().c_str(),
this->getAlbum().getName().c_str(),
this->getDuration());
}
};
/**
* Disk of songs
*/
class CD
{
private:
/**
* Artist of the CD
* @param Artist artist
*/
Artist artist;
/**
* Album name of the CD
* @param Album album
*/
Album album;
/**
* Duration of all songs in seconds
* @param int duration
*/
int duration;
/**
* vector containing list of songs in the CD
* @param vector<Song> songs
*/
vector<Song> songs;
/**
* Returns the artist of the CD
* @return Artist
*/
Artist getArtist()
{
return this->artist;
}
/**
* Returns the album of the CD
* @return Album
*/
Album getAlbum()
{
return this->album;
}
/**
* Returns the duration of the CD in seconds
* @return int
*/
int getDuration()
{
return this->duration;
}
/**
* Computes the duration of the CD
* @return void
*/
void computeDuration()
{
this->duration = 0;
for (Song s : songs)
{
this->duration += s.getDuration();
}
}
public:
CD(Artist& artist, Album& album, vector<Song>& songs)
{
this->artist = artist;
this->album = album;
this->songs = songs;
this->computeDuration();
}
/**
* Returns all the songs in the CD
* @return vector<Song>
*/
vector<Song> getSongs()
{
return this->songs;
}
/**
* Returns the number of songs in the CD
* @return int
*/
int numSongs()
{
return this->getSongs().size();
}
/**
* Prints the CD in a human readable way
* @return void
*/
void print()
{
printf("The CD is by the artist : %s.\nThe CD has the album title : %s.\nThe CD lasts for %d seconds.\n",
this->getArtist().getName().c_str(),
this->getAlbum().getName().c_str(),
this->getDuration());
}
};
/**
* Playlist of songs
*/
class PlayList
{
private:
/**
* Duration of all songs in seconds
* @param int duration
*/
int duration;
/**
* vector containing list of songs in the PlayList
* @param vector<Song> songs
*/
vector<Song> songs;
/**
* Returns the duration of the PlayList in seconds
* @return int
*/
int getDuration()
{
return this->duration;
}
/**
* Computes the duration of the CD
* @return void
*/
void computeDuration()
{
this->duration = 0;
for (Song s : songs)
{
this->duration += s.getDuration();
}
}
public:
PlayList(vector<Song>& songs)
{
this->songs = songs;
this->computeDuration();
}
/**
* Returns all the songs in the CD
* @return vector<Song>
*/
vector<Song> getSongs()
{
return this->songs;
}
/**
* Returns the number of songs in the PlayList
* @return int
*/
int numSongs()
{
return this->getSongs().size();
}
/**
* Prints the playlist in a human readable way
* @return void
*/
void print()
{
printf("The playlist has %d songs.\nThe playlist lasts for %d duration. \n",
this->numSongs(),
this->getDuration());
}
};
/**
* Plays digital playlists / songs
*/
class DigitalPlayer
{
private:
/**
* Queue of songs to be played
* @param queue<Song> songQ
*/
queue<Song> songQ;
public:
DigitalPlayer(){}
/**
* Empties the queue of songs to be played
* @return void
*/
void emptyQueue()
{
while (!this->empty()) songQ.pop();
}
/**
* Plays the selected song
* @param Song& s
* @return void
*/
void selectSong(Song& s)
{
this->emptyQueue();
this->enqueueSong(s);
this->play();
}
/**
* Plays the selected playlist
* @param PlayList& pl
* @return void
*/
void selectPlaylist(PlayList& pl)
{
this->emptyQueue();
for (Song s : pl.getSongs()) this->enqueueSong(s);
this->play();
}
/**
* Stops playing whatever it is playing now
* @return void
*/
void stopPlaying()
{
this->emptyQueue();
}
/**
* Returns whether there are songs left in the queue
* @return bool
*/
bool empty()
{
return this->songQ.empty();
}
/**
* Enqueues the next song
* @param Song& s
* @return void
*/
void enqueueSong(Song& s)
{
this->songQ.push(s);
}
/**
* Dequeues the first song to be played
* @return Song
*/
Song dequeueSong()
{
Song s = songQ.front();
songQ.pop();
return s;
}
/**
* Plays the songs in the queue
* @return void
*/
void play()
{
while (!this->empty())
{
printf("Playing the next song in the playlist\n\n");
Song s = this->dequeueSong();
s.print();
}
}
};
/**
* Plays songs on a CD
*/
class CDPlayer
{
private:
/**
* Queue of songs to be played
* @param queue<Song> songQ
*/
queue<Song> songQ;
public:
CDPlayer(){}
/**
* Empties the queue of songs to be played
* @return void
*/
void emptyQueue()
{
while (!this->empty()) songQ.pop();
}
/**
* Plays the selected CD
* @param CD& cd
* @return void
*/
void select(CD& cd)
{
this->emptyQueue();
for (Song s : cd.getSongs()) songQ.push(s);
this->play();
}
/**
* Stops playing whatever it is playing now
* @return void
*/
void stopPlaying()
{
this->emptyQueue();
}
/**
* Returns whether there are songs left in the queue
* @return bool
*/
bool empty()
{
return songQ.empty();
}
/**
* Dequeues the first song to be played
* @return Song
*/
Song dequeueSong()
{
Song s = songQ.front();
songQ.pop();
return s;
}
/**
* Plays the songs in the queue
* @return void
*/
void play()
{
while (!this->empty())
{
printf("\nPlaying the next song in the playlist\n");
Song s = this->dequeueSong();
s.print();
}
}
};
class JukeBox
{
private:
/**
* The digital player attached to the JukeBox
* @param DigitalPlayer dp
*/
DigitalPlayer dp;
/**
* The CD player attached to the JukeBox
* @param CDPlayer cp
*/
CDPlayer cp;
/**
* Returns the disk player attached to the JukeBox
* @return DigitalPlayer
*/
DigitalPlayer getDigitalPlayer()
{
return this->dp;
}
/**
* Returns the digital player attached to the JukeBox
* @return CDPlayer
*/
CDPlayer getCDPlayer()
{
return this->cp;
}
public:
JukeBox() {}
JukeBox(DigitalPlayer& dp, CDPlayer& cp)
{
this->dp = dp;
this->cp = cp;
}
/**
* Changes state of the jukebox
* @param CD& cd
* @return void
*/
void selectDisk(CD& cd)
{
this->stopPlaying();
this->getCDPlayer().select(cd);
}
/**
* Changes state of the jukebox
* @param PlayList& pl
* @return void
*/
void selectPlaylist(PlayList& pl)
{
this->stopPlaying();
this->getDigitalPlayer().selectPlaylist(pl);
}
/**
* Changes state of the jukebox
* @param Song& s
* @return void
*/
void selectSong(Song& s)
{
this->stopPlaying();
this->getDigitalPlayer().selectSong(s);
}
/**
* Clears the state of the playing items
* @return void
*/
void stopPlaying()
{
this->getDigitalPlayer().stopPlaying();
this->getCDPlayer().stopPlaying();
}
// TODO: Enqueue functionality
};
class User
{
private:
/**
* ID of the user
* @param int ID
*/
int ID;
/**
* A reference to the jukeBox, that the user can interact with
* @param JukeBox box
*/
JukeBox box;
/**
* Generates a unique ID for the user
* @returns void
*/
void generateId()
{
this->ID = rand() % numeric_limits<int>::max();
}
/**
* Returns the JukeBox instance
* @return JukeBox
*/
JukeBox getJukeBox()
{
return this->box;
}
public:
User(JukeBox& J)
{
this->generateId();
this->box = J;
}
/**
* User plays a song on the JukeBox
* @param Song& s
* @return void
*/
void selectSong(Song& s)
{
this->getJukeBox().selectSong(s);
}
/**
* User plays a play list on the JukeBox
* @param PlayList& pl
* @return void
*/
void selectPlaylist(PlayList& pl)
{
this->getJukeBox().selectPlaylist(pl);
}
/**
* User selects a CD on the JukeBox
* @param CD& cd
* @return void
*/
void selectDisk(CD& cd)
{
this->getJukeBox().selectDisk(cd);
}
// Add play and pause feature
};
vector<Song> getSongs(Artist& a, Album& al)
{
vector<Song> res;
string list = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (int i=0; i<10; i++)
{
string name;
int len = 15 + rand() % 20;
while (len > 0)
{
int x = rand() % list.size();
name += list[x];
len--;
}
int duration = 180 + rand() % 1000;
Song s = Song(a, al, name, duration);
res.push_back(s);
}
return res;
}
int main()
{
CDPlayer cp = CDPlayer();
DigitalPlayer dp = DigitalPlayer();
JukeBox jb = JukeBox(dp, cp);
User u1 = User(jb);
User u2 = User(jb);
Artist a1 = Artist("Paul Harrison");
Artist a2 = Artist("Govinda Dasu");
Album alb1 = Album("Application to Simplifield");
Album alb2 = Album("Stanford Univeristy");
vector<Song> s1 = getSongs(a1, alb1);
vector<Song> s2 = getSongs(a2, alb2);
CD cd1 = CD(a1, alb1, s1);
CD cd2 = CD(a2, alb2, s2);
int num = (s1.size() + s2.size()) / 3;
int ind1 = 0, ind2 = 0;
vector<Song> s3;
for (int i=0; i<num; i++)
{
if (ind2 >= s2.size() || i % 2 == 0)
{
Song s = s1[ind1];
s3.push_back(s);
ind1++;
}
else
{
Song s = s2[ind2];
s3.push_back(s);
ind2++;
}
}
PlayList pl = PlayList(s3);
u1.selectPlaylist(pl);
u2.selectDisk(cd2);
}
|
6f9aaa9940bc3fbb182f508adaa67661330c921f | 1746d2ff02cfd9544c1676a1b49006b275d7536e | /infinite-evolution-master/06_产品验收/产品包/源代码及可执行文件/infiniteEvolution/skill.h | 9666dd710f862f94a173088a376e413ba5e4925e | [] | no_license | ZifeiMo96/Infinite-evolution | c2d5af08eaf3e9118237690fb1f29033702e4d51 | 32cbd26e3d6dee94411f1d691af664ffe82771fa | refs/heads/master | 2023-01-21T15:30:42.609574 | 2020-12-05T08:25:46 | 2020-12-05T08:25:46 | 318,730,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 413 | h | skill.h | #ifndef SKILL_H
#define SKILL_H
#include"prop.h"
class Skill:public Prop
{
public:
Skill();
void init(double x,double y,int skillKind,int width=40,int height=40);
bool ifUsable=0;
int skillKind; //0治疗 1抗拒光环 2腐蚀 3昏睡 4yuan形吐息 5无敌 6强化普攻
void beGot(Obj&obj);
int cdOfSkill;
int skillTime;
void hide();
int SkillRange;
};
#endif // SKILL_H
|
15a57ad58d26555e0e26e6ad9f6f70eb10f264d2 | d87b3704802173c7c9cdd53546f13854310dc153 | /tools/sim65/ByteRegister.cpp | 78eb3c7b164dde2f150272d2d000890f92bd251f | [] | no_license | tub/photokeychain | d2d6251a30435f8b04557068589edcfbec4ca8a2 | e3786dff0584557acb4a4ffb05b78e5e1f426a4d | refs/heads/master | 2020-04-09T04:29:56.662203 | 2010-02-19T21:32:16 | 2010-02-19T21:32:16 | 32,686,729 | 2 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 675 | cpp | ByteRegister.cpp | //
// ByteRegister.cpp
// Copyright © 2003 William Sheldon Simms III
//
#include <cstdio>
#include "ByteRegister.h"
ByteRegister::ByteRegister (unsigned char * rptr)
{
ptr = rptr;
num_listeners = 0;
}
unsigned char ByteRegister::Read (void)
{
return *ptr;
}
void ByteRegister::Write (unsigned char b)
{
unsigned char old = *ptr;
*ptr = b;
if (old != b)
{
for (int idx = 0; idx < num_listeners; ++idx)
listeners[idx]->TellNewValue(b);
}
}
bool ByteRegister::AddListener (ByteRegisterListener * new_listener)
{
if (num_listeners >= MAX_NUM_LISTENERS)
return false;
listeners[num_listeners++] = new_listener;
return true;
}
// end
|
f1f8eb8666f3e3316ad7acfc02a6451bf4dfdce4 | 24bbb38a2fae7182c54d2e994c5a9ef0be7e0d20 | /2014省赛模板/New folder/2013工管5班英语听力/2013210127李茜/双百/数据结构/网络流/最小费用流/poj2135.cpp | da56aa6497e5d3d10fb317cf4f3eadb9d4b48fe7 | [] | no_license | pentium3/2014-ICPC-Regional | 7bf0719fed7393d6f7f096c1a023a11ebb72c206 | 561583f8f71f7e323cf884ad4164fbd30aa6cbe6 | refs/heads/master | 2020-06-03T20:33:47.876601 | 2015-01-13T10:16:01 | 2015-01-13T10:16:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,658 | cpp | poj2135.cpp | #include "iostream"
#include "cstdio"
#include "vector"
#include "queue"
#include "cstring"
using namespace std;
const int inf=200000000;
struct edge
{
int u,v,cap,flow,cost;
};
vector<edge> Edge;
vector<int> G[1005];
bool inq[1005];
int d[1005],p[1005],a[1005];
int N,M,U,V,w;
void add(int u,int v,int cap,int cost)
{
edge tmp;
tmp.u=u;tmp.v=v;tmp.cap=cap;tmp.flow=0;tmp.cost=cost;
Edge.push_back(tmp);
tmp.u=v;tmp.v=u;tmp.cap=0;tmp.cost=-cost;
Edge.push_back(tmp);
int m=Edge.size();
G[u].push_back(m-2);
G[v].push_back(m-1);
}
bool spfa(int s,int t,int &flow,int &cost)
{
for(int i=0;i<=t;i++) d[i]=(i==s?0:inf);
memset(p,0,sizeof(p));
a[s]=inf;
queue<int> Q;
Q.push(s);
while(!Q.empty())
{
int u=Q.front();Q.pop();
inq[u]=false;
for(int i=0;i<G[u].size();i++)
{
edge &e=Edge[G[u][i]];
if(e.cap>e.flow&&d[e.v]>d[u]+e.cost)
{
d[e.v]=d[u]+e.cost;
p[e.v]=G[u][i];
a[e.v]=min(a[u],e.cap-e.flow);
if(!inq[e.v]) {Q.push(e.v);inq[e.v]=true;}
}
}
}
if(d[t]==inf) return false;
flow+=a[t];
cost+=d[t]*a[t];
int u=t;
while(u!=s)
{
Edge[p[u]].flow+=a[t];
Edge[p[u]^1].flow-=a[t];
u=Edge[p[u]].u;
}
return true;
}
int main()
{
scanf("%d%d",&N,&M);
for(int i=1;i<=M;i++)
{
scanf("%d%d%d",&U,&V,&w);
add(U,V,1,w);
add(V,U,1,w);
}
add(0,1,2,0);
add(N,N+1,2,0);
int flow=0,cost=0;
while(spfa(0,N+1,flow,cost));
printf("%d\n",cost);
}
|
9326db3fa97058418a6281959780bcae6d895591 | d93e2829c19ac16f745c74f7e5fd319b02a479d8 | /C++/program8.cpp | 36d1fd9fc2555a77ead07ef4fa9716115adc9c45 | [] | no_license | SrushtiDeshmukh/CPP-Programs | df4662250c6865d8d7544281fdeef0f88682671d | 16e8d3c1d5a10f4c0e0a42bd463d559988e2789b | refs/heads/main | 2023-07-10T23:42:43.352942 | 2021-08-17T07:56:27 | 2021-08-17T07:56:27 | 381,909,610 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 644 | cpp | program8.cpp | #include<iostream>
using namespace std;
//input : _ _ _Abc_ _ _pqr_ _ _A_ _AB_ _
//output:4
class StringX
{
public:
char ptr[30];
void Accept()
{
cout<<"Enter String\n";
scanf("%[^'\n']s",ptr);
}
int WordCount()
{
int iCnt=0;
char *str=ptr;
while(*str!='\0')
{
if(*str==' ')
{
while((*str==' ') && (*str!='\0'))
{
str++;
}
}
else
{
while((*str!=' ') && (*str!='\0'))
{
str++;
if(*str==' ')
iCnt++;
}
}
}
return iCnt;
}
};
int main()
{
int ret=0;
StringX obj;
obj.Accept();
ret=obj.WordCount();
cout<<"Word Count is :"<<ret<<"\n";
return 0;
}
|
1c1672fa2ec465f8e83dc31d4d84875c445a69e0 | 4c2b5e4619d0a3447052304a7ecd2e49f9ed462d | /assignment5/SortingLab/heapsort.cpp | 8ac5cfbdbd8ec79ed07b53225324f536d2e40291 | [] | no_license | sergeynikiforov/CS106B | 0a974db6551f5a616a1b9713dca7d45e3edef38b | a308d51cbdd10e78cceb1530e5740188398c1db6 | refs/heads/master | 2021-01-21T13:21:07.374611 | 2016-04-23T09:32:42 | 2016-04-23T09:32:42 | 51,618,951 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,078 | cpp | heapsort.cpp | //
// heapsort.cpp
// SortingLab
//
// Created by Sergey Nikiforov on 04/03/16.
// Copyright © 2016 Sergey Nikiforov. All rights reserved.
//
#include "heapsort.hpp"
#include <iostream>
using namespace std;
// set of ints compare function: compares by the set sum
bool intSetSumCmp(const set<int> &lhs, const set<int> &rhs) {
int lhsSum = accumulate(lhs.cbegin(), lhs.cend(), 0);
int rhsSum = accumulate(rhs.cbegin(), rhs.cend(), 0);
return lhsSum > rhsSum;
}
// string compare function: first compare by length, in case of ties order by alphabet
bool strLenCmp(const string &lhs, const string &rhs) {
return (lhs.length() == rhs.length()) ? (lhs > rhs) : (lhs.length() > rhs.length());
}
// returns index of a parent in a heap for a particluar node
// doesn't check for bounds, assumes index < vector size
size_t parent(const size_t index) {
if (index > 0) {
return (index - 1) / 2;
} else throw out_of_range("It's a root node, no parents");
}
// returns index of a right child in a heap for a particular node
// checks for bounds, throws out_of_range
size_t rightChild(const size_t up_to, const size_t node_index) {
if (node_index <= lastParent(up_to)) {
auto result = 2 * (node_index + 1);
if (result < up_to) {
return result;
} else throw out_of_range("There's no right child for this node");
} else throw out_of_range("There's no children, it's a leaf");
}
// returns index of a left child in a heap for a particular node
// checks for bounds, throws out_of_range
size_t leftChild(const size_t up_to, const size_t node_index) {
if (node_index <= lastParent(up_to)) {
auto result = 2 * node_index + 1;
if (result < up_to) {
return result;
} else throw out_of_range("There's no left child for this node");
} else throw out_of_range("There's no children, it's a leaf");
}
// returns index of a last parent in a heap
// returns 0 for a vec of size < 2
size_t lastParent(const size_t size) {
return ((size < 2) ? 0 : (size - 2) / 2);
} |
c002f8b0d21be20d9537e1b1aa25578405e87d4a | f7389ede7c743b8ce3d174eee24ebcab316354f6 | /Software/SumoBot/Tests/AttackSensorIF_test.cpp | 9eb96e78372bc2428c340746a1671a767b410173 | [] | no_license | Solvgraa-mager/E3PRJ3 | 7e2b70775c0d8b8312bc893e0c9014fd766af9b0 | fb507b5528417459714c00b73c75378d6465af19 | refs/heads/master | 2023-01-31T11:01:30.966313 | 2020-12-18T10:28:55 | 2020-12-18T10:28:55 | 294,479,612 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 351 | cpp | AttackSensorIF_test.cpp | #include <string.h>
#include <iostream>
#include <unistd.h>
#include "AttackSensorIF.h"
using namespace std;
int main(void)
{
AttackSensorIF Sensor;
while(1)
{
cout << "getAttackStatus called. New interrupt?";
if(Sensor.getAttackStatus() == 1)
{
cout << " yes" << endl;
}
else
{
cout << " no" << endl;
}
sleep(2);
}
return 0;
} |
48dc8e9e0cc4fbf29374249cc74302f7eac3ef3e | 1044696afb3ca6a802a7308c317878a614ffdecf | /Programme_principal/recoverers/utile.cpp | 313777fb80b2cf5cb6cbae1f8994eb3044517590 | [] | no_license | radtek/PI-Ransomware | a53e6c92db7e40054ac3b67ddbe83517b44927f6 | 77f83e06ace64a29a0f87f17d7838c5a1c31a95f | refs/heads/master | 2021-02-12T18:03:03.623901 | 2019-03-08T13:32:47 | 2019-03-08T13:32:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,370 | cpp | utile.cpp | //#include "stdafx.h"
#include "utile.h"
#include <iostream>
#include "stdlib.h"
#include <stdint.h>
#include <time.h>
#include <string.h>
#include <math.h>
string executer(string commande)
{
char iRes[1024];
string res = "";
FILE *pipe = popen(commande.c_str(), "r");
while (fgets(iRes, 1024, pipe)) res += iRes;
pclose(pipe);
return res;
}
//https://github.com/floyernick/fleep-py/blob/master/fleep/__init__.py
string getExtension(string path)
{
ifstream fExtensions;
int const nbExtensions = 100;
fExtensions.open("extensions.json");
if (!fExtensions)
{
cout << "erreur extensions non trouvees" << endl;
fExtensions.close();
return "";
}
fExtensions.seekg(0, ios::beg);
char caractere;
int offset[nbExtensions];
string extensions[nbExtensions];
uint8_t *signature[nbExtensions];
int taillesSignatures[nbExtensions];
for (int i=0; i<nbExtensions; i++)
{
extensions[i] = "";
for (int j=0; j<7; j++) while (fExtensions.get(caractere) && caractere != '"');
while (fExtensions.get(caractere) && caractere != '"') extensions[i] += caractere;
offset[i] = 0;
for (int j=0; j<6; j++) while (fExtensions.get(caractere) && caractere != '"');
fExtensions.get(caractere);
fExtensions.get(caractere);
while (fExtensions.get(caractere) && caractere != ',') offset[i] = offset[i]*10+(caractere-'0');
taillesSignatures[i] = 0;
for (int j=0; j<3; j++) while (fExtensions.get(caractere) && caractere != '"');
long debut = fExtensions.tellg();
fExtensions.get(caractere);
while (caractere != '"')
{
while (fExtensions.get(caractere) && caractere != ' ' && caractere != '"');
taillesSignatures[i]++;
}
fExtensions.seekg(debut, fExtensions.beg);
signature[i] = new uint8_t[taillesSignatures[i]];
for (int j=0; j<taillesSignatures[i]; j++)
{
string iSignature = "";
while (fExtensions.get(caractere) && caractere != ' ' && caractere != '"') iSignature += caractere;
signature[i][j] = strtol(iSignature.c_str(), NULL, 16);
}
while (fExtensions.get(caractere) && caractere != '}');
}
fExtensions.close();
ifstream fichier;
fichier.open(path.c_str(), ios::binary);
for (int i=0; i<nbExtensions; i++)
{
int j = 0;
fichier.seekg(offset[i], ios::beg);
while (j < taillesSignatures[i] && fichier.get(caractere) && static_cast<uint8_t>(caractere) == signature[i][j]) j++;
if (j == taillesSignatures[i]) return extensions[i];
}
fichier.close();
return "txt";
}
long nbElementsDans(string path)
{
long res = -2;
#ifdef WINDOWS
path += "\\";
HANDLE hSearch;
WIN32_FIND_DATA File;
string pathAdapte = path+"*.*";
hSearch = FindFirstFile(wstring(pathAdapte.begin(), pathAdapte.end()).c_str(), &File);
if (hSearch != INVALID_HANDLE_VALUE)
{
do
{
res++;
}
while (FindNextFile(hSearch, &File));
FindClose(hSearch);
}
#else
DIR *dossier = opendir(path.c_str());
if (dossier)
{
struct dirent *lien;
while ((lien = readdir(dossier))) res++;
closedir(dossier);
}
#endif
return res;
}
string* fichiersEtDossiersDans(string path)
{
int nbFichiers = nbElementsDans(path);
string *res = new string[nbFichiers];
#ifdef WINDOWS
path += "\\";
HANDLE hSearch;
WIN32_FIND_DATA File;
string pathAdapte = path+"*.*";
FILETIME *dateFichiers = new FILETIME[nbFichiers];
hSearch = FindFirstFile(wstring(pathAdapte.begin(), pathAdapte.end()).c_str(), &File);
int nFichier = 0;
if (hSearch != INVALID_HANDLE_VALUE)
{
do
{
wstring iFichier = File.cFileName;
string fichier(iFichier.begin(), iFichier.end());
if (fichier == "." || fichier == "..") continue;
fichier = path+fichier;
HANDLE hFile = CreateFile(wstring(fichier.begin(), fichier.end()).c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
GetFileTime(hFile, NULL, NULL, &dateFichiers[nFichier]);
if (hFile == INVALID_HANDLE_VALUE) continue;
res[nFichier] = fichier;
FILETIME dateFichier = dateFichiers[nFichier];
for (int i=0; i<nFichier; i++)
{
if (CompareFileTime(&dateFichier, &dateFichiers[i]) < 0)
{
for (int j=nFichier; j>i; j--)
{
res[j] = res[j-1];
dateFichiers[j] = dateFichiers[j-1];
}
res[i] = fichier;
dateFichiers[i] = dateFichier;
break;
}
}
nFichier++;
}
while (FindNextFile(hSearch, &File));
FindClose(hSearch);
}
#else
string iRes = executer("ls -atr \""+path+"\"");
long i = 0;
long fin = iRes.find('\n');
while (fin != -1)
{
string element = iRes.substr(0, fin);
if (element != ".." && element != ".")
{
res[i] = path+"/"+iRes.substr(0, fin);
i++;
}
iRes = iRes.substr(fin+1);
fin = iRes.find('\n');
}
#endif //WINDOWS
return res;
}
ifstream loadFile(char const *path){
ifstream file;
file.open(path, ios::binary);
if (!file) {
cerr << "Error while opening files...";
exit(1); // call system to stop
} else {
return file;
}
}
bool loadFileAndLoadBuffer(char const *path, char *dst, int size){
ifstream file;
file.open(path, ios::binary);
if (!file) {
cerr << "Error while opening files...";
file.close();
return false; // call system to stop
} else {
if(file.read (dst, size))
printf("%s has been loaded...\n", path);
else {
file.close();
return false;
}
}
file.close();
return true;
}
void intToChars(int number, char res[4])
{
res[3] = number >> 24;
res[2] = (number%(1<<24)) >> 16;
res[1] = (number%(1<<16)) >> 8;
res[0] = number%(1<<8);
}
void regenerateHeader(ofstream &file, string path, char begin[768], long length)
{
long iPos = file.tellp();
string extension = path.substr(static_cast<int>(strrchr(path.c_str(), '.')-path.c_str()+1));
if (extension == "bmp")
{
begin[0] = 0x42;
begin[1] = 0x4d;
intToChars(length, begin+2); //Length of the file
//Start of the pixels
begin[10] = 0x7a;
begin[11] = 0x00;
begin[12] = 0x00;
begin[13] = 0x00;
//Length of the header
begin[14] = 0x6c;
begin[15] = 0x00;
begin[16] = 0x00;
begin[17] = 0x00;
int const nbPxs = (length-122)/3;
//A determiner selon nbPxs (produit qui tombe juste)
int const tx = 640;
int const ty = 400;
intToChars(tx, begin+18);
intToChars(ty, begin+22);
}
else if (extension == "jpg" || extension == "jpeg")
{
//static
begin[0] = 0xff;
begin[1] = 0xd8;
begin[2] = 0xff;
begin[3] = 0xe0;
//segment length
begin[4] = 0x00;
begin[5] = 0x10;
//static id
begin[6] = 0x4a;
begin[7] = 0x46;
begin[8] = 0x49;
begin[9] = 0x46;
begin[10] = 0x00;
//version
begin[11] = 0x01;
begin[12] = 0x01;
begin[13] = 0x01; //type px/cm
//width px/cm
begin[14] = 0x00;
begin[15] = 0x48;
//height px/cm
begin[16] = 0x00;
begin[17] = 0x48;
//width, height of icon
begin[18] = 0x00;
begin[19] = 0x00;
begin[20] = 0xff;
}
file.seekp(iPos, file.beg);
}
void testFichier()
{
ifstream file = loadFile("Tests/save/lancement3/image.jpg");
//ifstream file = loadFile("/home/phyrs/Modèles 3D/fourtout/Slasher.jpg");
file.seekg(0, file.beg);
for (long i=0; i<100; i++)
{
char buff;
file.get(buff);
printf("%d %02x\n", i, buff);
}
char iLength[4];
intToChars(768122, iLength);
printf("%02x %02x %02x %02x\n", iLength[0], iLength[1], iLength[2], iLength[3]);
intToChars(640, iLength);
printf("%02x %02x %02x %02x\n", iLength[0], iLength[1], iLength[2], iLength[3]);
intToChars(400, iLength);
printf("%02x %02x %02x %02x\n", iLength[0], iLength[1], iLength[2], iLength[3]);
}
|
3741671255267aba7bd4834df0167b56f1f01332 | 09f17137f947c8fd5d01f6d9623bc1d69a3768ca | /include/Settings.h | 001d5f33c44c0a5f36f63b9b0f1ca00babedc01f | [] | no_license | buensons/totally_not_cummc | 9a141b4d126766a30e28495dd0ce1be4e765f058 | 8ebd91bf3ace91025dcfb792eb41470446549f80 | refs/heads/main | 2023-08-05T04:41:34.531311 | 2021-08-16T20:08:56 | 2021-08-16T20:08:56 | 401,485,553 | 0 | 0 | null | 2021-08-30T21:03:35 | 2021-08-30T21:03:35 | null | UTF-8 | C++ | false | false | 4,652 | h | Settings.h | /*
* Settings.h
*
* Created on: Aug 4, 2013
* Author: psz
*/
#ifndef SETTINGS_H_
#define SETTINGS_H_
#include <stdio.h>
#include <string>
#include "../src/lib/INIReader.h"
#include "../src/lib/common.h"
class Settings {
public:
Settings();
void init();
void print(int level = 0);
bool loadFromINI(std::string ini_path);
static bool initialized;
static bool use2D;
static int debug;
static bool randomWalk;
static bool useInputCache;
static int outputLevel;
// 5 - milestone info
static int loopDensity;
// cuda
static int milestoneFailsThreshold;
static int cudaBlocksMultiplier;
static int cudaThreadsPerBlock;
static std::string dataDirectory;
static std::string dataAnchors;
static std::string dataPetClusters;
static std::string dataSingletons;
static std::string dataSingletonsInter;
static std::string dataFactors;
static bool dataSplitSingletonFilesByChr;
static std::string dataCentromeres;
static std::string dataSegmentsSplit;
static std::string dataSegmentHeatmap;
// structural template
static std::string templateSegment;
static float templateScale;
// density
static bool useDensity;
static std::string densityMapFile;
static float densityScale;
static float densityInfluence;
static float densityWeight;
static bool useTelomerePositions;
static vector3 telomere_1_position;
static vector3 telomere_2_position;
static float ibRandomWalkJumps;
// distances matrix (segment level)
static std::string distHeatmap;
static float distHeatmapScale;
// rewiring
static bool rewiringEnabled;
static int rewiringCertaintyThreshold;
static bool useCTCFMotifOrientation;
static bool motifsSymmetric;
static float motifOrientationWeigth;
static bool useAnchorHeatmap;
static float anchorHeatmapInfluence;
static float anchorHeatmapDistWeight;
static bool useSubanchorHeatmap;
static float subanchorHeatmapInfluence;
static float subanchorHeatmapDistWeight;
static int subanchorEstimateDistancesReplicates;
static int subanchorEstimateDistancesSteps;
static float subanchorLoopLoopInteractionsScale;
static int maxPETClusterLength;
static float longPETClustersEffectPower;
static float longPETClustersEffectScale;
static int segmentSize;
static int simulationStepsLevelChr;
static int simulationStepsLevelSegment;
static int simulationStepsLevelAnchor;
static int simulationStepsLevelSubanchor;
static float noiseCoefficientLevelChr;
static float noiseCoefficientLevelSegment;
static float noiseCoefficientLevelAnchor;
static float noiseCoefficientLevelSubanchor;
// heatmaps
static float heatmapInterScaling;
static float heatmapDistanceHeatmapStretching; // how many averages the distance can be
// map frequency (from singleton heatmap) to spatial distance
static float freqToDistHeatmapScale;
static float freqToDistHeatmapPower;
static float freqToDistHeatmapScaleInter;
static float freqToDistHeatmapPowerInter;
// map count to spatial distance
static float countToDistA;
static float countToDistScale;
static float countToDistShift;
static float countToDistBaseLevel;
// map genomic distance to spatial distance
static float genomicLengthToDistPower;
static float genomicLengthToDistScale;
static float genomicLengthToDistBase;
// springs
static float springConstantStretch;
static float springConstantSqueeze;
static float springAngularConstant;
static float springConstantStretchArcs;
static float springConstantSqueezeArcs;
// MC simulation
static float maxTempHeatmap;
static float dtTempHeatmap;
static float tempJumpScaleHeatmap;
static float tempJumpCoefHeatmap;
static float MCstopConditionImprovementHeatmap;
static int MCstopConditionMinSuccessesHeatmap;
static int MCstopConditionStepsHeatmap;
static float maxTempHeatmapDensity;
static float dtTempHeatmapDensity;
static float tempJumpScaleHeatmapDensity;
static float tempJumpCoefHeatmapDensity;
static float MCstopConditionImprovementHeatmapDensity;
static int MCstopConditionMinSuccessesHeatmapDensity;
static int MCstopConditionStepsHeatmapDensity;
static float maxTemp;
static float dtTemp;
static float tempJumpScale;
static float tempJumpCoef;
static float MCstopConditionImprovement;
static int MCstopConditionMinSuccesses;
static int MCstopConditionSteps;
static float weightDistSmooth;
static float weightAngleSmooth;
static float maxTempSmooth;
static float dtTempSmooth;
static float tempJumpScaleSmooth;
static float tempJumpCoefSmooth;
static float MCstopConditionImprovementSmooth;
static int MCstopConditionMinSuccessesSmooth;
static int MCstopConditionStepsSmooth;
};
#endif /* SETTINGS_H_ */
|
0718fb0de47957dac1308587c31d80a7b6ef1a19 | 54adc4d554dce2769103a50d0af5aa20f8200aeb | /UVA Solutions/UVA/UVA 10051.cpp | 0e2b5ed704e5ae8cffff3f63935aed793122a5b5 | [] | no_license | MoustafaHussien/UVA | d75ac2b5231edde18c493919b4c50122ab247139 | 13fddf04901a536fc4a5ed6fac9eb0541e0085cf | refs/heads/master | 2020-07-03T19:48:34.518417 | 2016-11-19T21:23:04 | 2016-11-19T21:23:04 | 74,235,468 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,436 | cpp | UVA 10051.cpp | //============================================================================
// Name : UVA.cpp
// Author : moustafa
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <vector>
#include <map>
using namespace std;
int cubs[101][6], n, dp[501][101], choices[501][7];
map<int, int> opposite;
void setup() {
opposite[0] = 1;
opposite[1] = 0;
opposite[2] = 3;
opposite[3] = 2;
opposite[4] = 5;
opposite[5] = 4;
}
int solve(int i, int c) {
if (dp[i][c] != -1) {
return dp[i][c];
}
if (i == n - 1) {
return 1;
}
int ans = solve(i + 1, c);
for (int j = 0; j < 6; j++) {
if (cubs[i + 1][j] == c) {
if (ans < solve(i + 1, cubs[i + 1][opposite[j]]) + 1) {
ans = solve(i + 1, cubs[i + 1][opposite[j]]) + 1;
}
}
}
return dp[i][c] = ans;
}
int main() {
setup();
freopen("input.txt", "r", stdin);
cin >> n;
vector<int> temp;
for (int i = 0; i < n; i++) {
temp.push_back(-1);
for (int j = 0; j < 6; j++) {
cin >> cubs[i][j];
}
}
int ans = 0;
memset(dp, -1, sizeof dp);
for (int i = 0; i < 6; i++) {
if (ans < solve(0, cubs[0][i])) {
ans = solve(0, cubs[0][i]);
}
}
cout << "ans = " << ans << endl;
return 0;
}
|
7627fe7cf7ced56331f06e4e7a994ca53816caf7 | 022033d4c0c029d1761779270c58d774801b6e3c | /src/bind/uio/Embind.cpp | ffb3f9d9371cade7f9fa5a98c4854460c184228c | [
"Zlib"
] | permissive | hoelzl/mud | 3ce05416b743de92c0ca21fdde42ab22b964caa9 | 426497a097970350f215575057150cb48a7240d4 | refs/heads/master | 2020-04-15T03:42:01.824151 | 2019-01-11T14:00:10 | 2019-01-11T14:00:10 | 164,357,416 | 0 | 0 | null | 2019-01-07T00:18:53 | 2019-01-07T00:18:53 | null | UTF-8 | C++ | false | false | 1,363 | cpp | Embind.cpp | #include <uio/Api.h>
#include <emscripten/bind.h>
using namespace emscripten;
EMSCRIPTEN_BINDINGS(mud_uio)
{
// Enums
enum_<mud::EditNestMode>("mud::EditNestMode")
.value("Inline", mud::EditNestMode::Inline)
.value("Modal", mud::EditNestMode::Modal)
.value("Embed", mud::EditNestMode::Embed)
;
enum_<mud::EditorHint>("mud::EditorHint")
.value("Table", mud::EditorHint::Table)
.value("Rows", mud::EditorHint::Rows)
.value("Inline", mud::EditorHint::Inline)
;
// Sequences
// Arrays
// Structs
// Classes
class_<mud::ScriptEditor>("ScriptEditor")
;
// Functions
function("object_edit_inline", &mud::object_edit_inline);
function("object_edit_rows", &mud::object_edit_rows);
function("object_edit_columns", &mud::object_edit_columns);
function("object_edit_table", &mud::object_edit_table);
function("object_edit_expandbox", &mud::object_edit_expandbox);
function("object_edit", &mud::object_edit);
function("entity_edit", &mud::entity_edit);
function("inspector", &mud::inspector);
function("inspector", &mud::inspector);
function("inspector", &mud::inspector);
function("multi_inspector", &mud::multi_inspector);
function("multi_object_edit", &mud::multi_object_edit);
}
|
ff9eca75d9b87a485ab784cfbbde377ee24379e7 | f9e6d3a1c5dd6ff6f51aad3c75bd84a89446f0f8 | /work_SNAProj/UIScreen.h | e320b159b9423c77a8a26a3ac59d645253e6c047 | [] | no_license | Rikuya-Matsuo/SNAproj | 8966932b78e038acf076d5d64496a686e6a09c02 | d688e97914c98b652b685d1c4235a1282b7e7c3a | refs/heads/master | 2021-07-07T11:04:18.029906 | 2020-11-16T01:34:22 | 2020-11-16T01:34:22 | 221,169,099 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 983 | h | UIScreen.h | #pragma once
#include <SDL/SDL.h>
#include <string>
#include <functional>
#include "Vector.h"
class Shader;
class Texture;
class Font;
class UIScreen
{
public:
UIScreen();
virtual ~UIScreen();
virtual void Update();
virtual void Draw(Shader * shader) const;
virtual void ProcessInput(const uint8_t * keys); //入力を受け取る処理
virtual void HandleKeyPress(int key);
void Close();
void SetTitle(const std::string & text,
const Vector3D & color,
int pointSize = 40);
void AddButton(const std::string & name,
std::function<void()> onClick);
protected:
typedef uint8_t FlagType;
FlagType mFlags_base;
Font * mFont;
Texture * mTitle;
Texture * mBackGround;
Texture * mButtonOn;
Texture * mButtonOff;
Vector2D mTitlePos;
Vector2D mNextButtonPos;
Vector2D mBGPos;
void DrawTexture(Shader * shader, Texture * texture,
const Vector2D & offset = Vector2D::zero,
float scale = 1.0f) const;
void SetRelativeMouseMode(bool relativeFlag);
};
|
d61672d1c66840b4bf95b6b078e8f93b285830b9 | 734970826c8d7909b026a0acb813fb5d45a85d6e | /test/test_config_tuple.ipp | 8e5f02c700605c0c893b590ce1c625d0d6545fa5 | [] | no_license | yak1ex/cpp_utils | 970e5ad7ce305e0d9daaae4a7c471587119317cb | dce4b04b0c73f121907ed164a0b1ada118deab90 | refs/heads/master | 2016-09-06T16:57:00.900956 | 2014-02-25T09:11:57 | 2014-02-25T09:11:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 630 | ipp | test_config_tuple.ipp | // Automatically generated file, do not edit!
#include "config.hpp"
#include <boost/type_traits/is_same.hpp>
const int yak_boost_tuple_included =
#if defined(YAK_BOOST_TUPLE_INCLUDED)
1
#else
0
#endif
;
const int yak_std_tuple_included =
#if defined(YAK_STD_TUPLE_INCLUDED)
1
#else
0
#endif
;
const int yak_use_boost_tuple =
#if defined(YAK_USE_BOOST_TUPLE)
1
#else
0
#endif
;
const int yak_use_std_tuple =
#if defined(YAK_USE_STD_TUPLE)
1
#else
0
#endif
;
const int yak_using_boost_tuple =
#if defined(YAK_USING_BOOST_TUPLE)
1
#else
0
#endif
;
const int yak_using_std_tuple =
#if defined(YAK_USING_STD_TUPLE)
1
#else
0
#endif
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.