blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
c24f5714f47bcf036faf3b938d6da7b32404124e
8555f0a26c2563f4ad1e3f525b12166b1bb66366
/TripleX/TripleX/TripleX.cpp
9bb86c35480db43dc95b877e5802f4017d9dbfd2
[]
no_license
Aaronoftheages/Unreal_CPP_Tuts
aef9a68e6a94c4700b189ad098599dbe1b71b593
6071488dab2c219e4e41ef7476055b72e1498757
refs/heads/main
2023-01-31T01:45:15.529037
2020-12-08T17:18:28
2020-12-08T17:18:28
319,650,691
0
0
null
null
null
null
UTF-8
C++
false
false
3,862
cpp
#include <iostream> #include <ctime> void IntroductionMessage(int Difficulty) { std::cout << "Cybertron Command \n Access to Database 'LEVEL - " << Difficulty << "' Restricted behind Code."; std::cout << "\nERROR\n"; std::cout << "\nBiometrics failed, enter code manually.\n"; } bool PlayGame(int Difficulty) { IntroductionMessage(Difficulty); #pragma region Math //Numerical Values int CodeAlpha = rand() % Difficulty + Difficulty; int CodeBeta = rand() % Difficulty + Difficulty; int CodeCharlie = rand() % Difficulty + Difficulty; //Addition and Samples int CodeSum = CodeAlpha + CodeBeta + CodeCharlie; int CodeProduct = CodeAlpha * CodeBeta * CodeCharlie; #pragma endregion //Display results std::cout << "3 Numbers are in the access code. \n"; std::cout << "\n The codes added up give: " << CodeSum; std::cout << "\n Multiplied, these codes add up to give: " << CodeProduct << std::endl; //Player Guesses int GuessA, GuessB, GuessC; std::cin >> GuessA; std::cin >> GuessB; std::cin >> GuessC; std::cout << "You entered: " << GuessA << GuessB << GuessC; int GuessSum = GuessA + GuessB + GuessC; int GuessProduct = GuessA * GuessB * GuessC; // Check for Guess if (GuessSum == CodeSum && GuessProduct == CodeProduct) { std::cout << "\n ACCESS - GRANTED - FURTHER ACCESS WILL REQUIRE MORE DETAILED CODES. \n"; return true; } else { std::cout << "\n ACCESS - DENIED - SUSPECT ACTIVITY WILL BE LOGGED BY TELETRAAN 1. \n"; return false; } } int main() { srand(time(NULL)); //Reconfigures seed std::cout << "-------------------------------" << std::endl; std::cout << "---------|||||||||||||---------" << std::endl; std::cout << "|||||--|||||||||||||||||--|||||" << std::endl; std::cout << "-|||||--|||---------|||---|||||" << std::endl; std::cout << "-|||||----|||-----|||----|||||-" << std::endl; std::cout << "--||-|||----|||-|||----|||-|||-" << std::endl; std::cout << "--|||--|||----|||----|||--|||--" << std::endl; std::cout << "---|--|--|||-------|||--|--||--" << std::endl; std::cout << "---|||--|-||-||-||-||-|--|||---" << std::endl; std::cout << "-----|||--||-|||||-||--|||-----" << std::endl; std::cout << "---|---|||||-|||||-|||||---|---" << std::endl; std::cout << "---|||--------|||--------|||---" << std::endl; std::cout << "---|||------|-|||-|------|||---" << std::endl; std::cout << "---|||||--|||-|||-|||--|||||---" << std::endl; std::cout << "---|||||-||||-|||-||||-|||||---" << std::endl; std::cout << "---|||||-||||-|||-||||-|||||---" << std::endl; std::cout << "---|||||-||||-|||-||||-|||||---" << std::endl; std::cout << "---|||||-||||-----||||-|||||---" << std::endl; std::cout << "-----|||-|||||||||||||-|||-----" << std::endl; std::cout << "-------|-|||-------|||-|-------" << std::endl; std::cout << "----------||-||||||-|----------" << std::endl; std::cout << "------------|||||||------------" << std::endl; std::cout << "Connecting to Cybertron Command Database - Welcome Autobot!" << std::endl; int LevelDifficulty = 1; const int MaxStage = 4; while (LevelDifficulty <= MaxStage) // Loop game untill all levels are finished { //std::cout << rand() % 10 << "\n"; Modulus example bool bLevelComplete = PlayGame(LevelDifficulty); std::cin.clear(); //Clears any errors std::cin.ignore(); // Discards the buffer if (bLevelComplete) { ++LevelDifficulty; } } std::cout << "DATABASE ACCESSED - HACK DETECTED!" << std::endl; std::cout << "ALL HAIL MEGATRON" << std::endl; std::cout << "Good job Decepticon! Retreat with the new intel!" << std::endl; return 0; }
[ "aaronmccracken1996@outlook.com" ]
aaronmccracken1996@outlook.com
fb441c301108f53fbe1f23852b4d579c5ae4ba47
051ee8974ba920bf92c4456ce7fd92154068764f
/test/sync/syncoutTest.h
bc74717dffc753dd04c5476e5327c55419c13097
[]
no_license
k06a/boolib
ab0f379ad9079434e91452d7287509b843dc2641
9b154e6d54b7e54b6fe847d53580ec61fd358c20
refs/heads/master
2016-09-06T18:25:02.912776
2010-12-26T19:11:21
2010-12-26T19:11:21
32,887,618
0
0
null
null
null
null
UTF-8
C++
false
false
1,122
h
#ifndef SYNCOUT_CPP #define SYNCOUT_CPP #include "sync.h" #include <iostream> #include <sstream> #include <windows.h> DWORD WINAPI syncoutFunc(LPVOID p) { std::stringstream & mystream = *(std::stringstream*&)p; for (int i = 0; i < 100; i++) { syncout_t(mystream) << "a" << "b" << "c" << "d" << "e" << 'A' << 'B' << 'C' << 'D' << 'E' << 1 << 2 << 3 << 4 << 5 << std::endl; } return 0; } void syncoutTest() { std::stringstream stream; HANDLE th[2]; th[0] = CreateThread(NULL, 0, syncoutFunc, (LPVOID)&stream, 0, NULL); th[1] = CreateThread(NULL, 0, syncoutFunc, (LPVOID)&stream, 0, NULL); WaitForMultipleObjects(2, th, TRUE, INFINITE); std::string text = stream.str(); const char * data = text.c_str(); for (int i = 0; i < 200; i++) { const char *temp = data + 16*i; if (memcmp(temp, "abcdeABCDE12345\n", 16) != 0) { std::cout << "syncoutTest() failed" << std::endl; break; } } } #endif // SYNCOUT_CPP
[ "k06a@localhost" ]
k06a@localhost
e001954209ecd266f19918c9c0f74548b35594a2
7069c4dbc65c88144d2f89bfe433febaf0a57e2a
/src/appleseed.studio/meta/tests/test_projectmanager.cpp
2ddbea32324188a0de8470feb844e5f7501acc41
[ "MIT" ]
permissive
tomcodes/appleseed
4d39965f168be1fd8540b635b5f32c2e8da188b6
e8ae4823158d7d40beb35c745eb6e9bee164dd2d
refs/heads/master
2021-01-17T22:45:50.384490
2012-01-20T17:54:49
2012-01-20T17:54:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,440
cpp
// // This source file is part of appleseed. // Visit http://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2012 Francois Beaune, Jupiter Jazz // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // appleseed.studio headers. #include "mainwindow/project/projectmanager.h" // appleseed.renderer headers. #include "renderer/api/project.h" // appleseed.foundation headers. #include "foundation/utility/test.h" // Standard headers. #include <string> TEST_SUITE(Studio_ProjectManager) { using namespace appleseed::studio; using namespace renderer; using namespace std; TEST_CASE(GetProject_GivenProjectManagerInDefaultState_ReturnsNull) { ProjectManager manager; const Project* project = manager.get_project(); EXPECT_EQ(0, project); } TEST_CASE(CreateProject_GivenProjectManagerInDefaultState_CreatesNewProject) { ProjectManager manager; manager.create_project(); const Project* project = manager.get_project(); EXPECT_NEQ(0, project); } TEST_CASE(CloseProject_GivenProjectManagerWithOpenedProject_ClosesProject) { ProjectManager manager; manager.create_project(); manager.close_project(); const Project* project = manager.get_project(); EXPECT_EQ(0, project); } TEST_CASE(IsProjectOpen_GivenProjectManagerInDefaultState_ReturnsFalse) { ProjectManager manager; const bool is_open = manager.is_project_open(); EXPECT_FALSE(is_open); } TEST_CASE(IsProjectOpen_AfterCreateProject_ReturnsTrue) { ProjectManager manager; manager.create_project(); const bool is_open = manager.is_project_open(); EXPECT_TRUE(is_open); } TEST_CASE(IsProjectOpen_AfterCloseProject_ReturnsFalse) { ProjectManager manager; manager.create_project(); manager.close_project(); const bool is_open = manager.is_project_open(); EXPECT_FALSE(is_open); } TEST_CASE(IsProjectDirty_GivenProjectManagerInDefaultState_ReturnsFalse) { ProjectManager manager; const bool is_dirty = manager.is_project_dirty(); EXPECT_FALSE(is_dirty); } TEST_CASE(IsProjectDirty_AfterCreateProject_ReturnsFalse) { ProjectManager manager; manager.create_project(); const bool is_dirty = manager.is_project_dirty(); EXPECT_FALSE(is_dirty); } TEST_CASE(IsProjectDirty_AfterCloseProject_ReturnsFalse) { ProjectManager manager; manager.create_project(); manager.close_project(); const bool is_dirty = manager.is_project_dirty(); EXPECT_FALSE(is_dirty); } TEST_CASE(GetProjectDisplayName_GivenProjectWithoutPath_ReturnsUntitled) { ProjectManager manager; manager.create_project(); const string name = manager.get_project_display_name(); EXPECT_EQ("Untitled", name); } TEST_CASE(GetProjectDisplayName_GivenProjectWithPath_ReturnsProjectFilename) { ProjectManager manager; manager.create_project(); manager.get_project()->set_path("directory/filename.ext"); const string name = manager.get_project_display_name(); EXPECT_EQ("filename.ext", name); } }
[ "beaune@aist.enst.fr" ]
beaune@aist.enst.fr
a619129d56b2a916e92205700a8d4a79c5e54f44
77972df564f83532bc1db08cd3d8c3ffaca32c0e
/Leetcode/N-997.cpp
e2eb21c6126a3ea763192ef9637dea02a2b26542
[]
no_license
vibhutimishra/DSA
21296b1f1b5b73e30348d78c90fcb31074e94bc7
a4b9dc34a219c7767e32e55c6e20f56d6b75ab2c
refs/heads/master
2023-01-10T21:12:46.800706
2020-11-19T22:48:23
2020-11-19T22:48:23
293,320,806
0
0
null
null
null
null
UTF-8
C++
false
false
882
cpp
class Solution { public: int findJudge(int N, vector<vector<int>>& trust) { int i,j,flag=0; map<int,vector<int>> dict,dict1; vector<int>demo; for (i=0;i<N;i++){ demo.push_back(0); dict.insert({i+1,demo}); dict1.insert({i+1,demo}); demo.clear(); } for (i=0;i<trust.size();i++){ auto itr=dict.find(trust[i][0]); itr->second.push_back(trust[i][1]); itr=dict1.find(trust[i][1]); itr->second.push_back(trust[i][0]); } demo.clear(); demo.push_back(0); for(auto itr:dict){ if (itr.second==demo){ auto itr1= dict1.find(itr.first); if(itr1->second.size()==N){ return itr.first; } } } return -1; } };
[ "vibhuti.mishra09@gmail.com" ]
vibhuti.mishra09@gmail.com
3921ebbc60f66d55ec7b97896474572a37b34462
f58be962a33a8b782ecf9b2a901d8f65e95b190f
/mfc_detect_object/stdafx.cpp
91afd5756e496b1fc8502523720a7ee82f853c05
[]
no_license
CUGLSF/mfc_detect_object
37c666ba9d04d6c2e6bca3e42271c2069159b233
ca0ca172095256acda77e5056f4fa98a96ee0c71
refs/heads/master
2021-01-10T18:12:12.518863
2015-12-25T11:55:42
2015-12-25T11:55:42
48,576,885
1
1
null
null
null
null
GB18030
C++
false
false
172
cpp
// stdafx.cpp : 只包括标准包含文件的源文件 // mfc_detect_object.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h"
[ "lsfzq@sina.cn" ]
lsfzq@sina.cn
2b02a77eeb68b821f7b8189be76dd42c92e25188
b677894966f2ae2d0585a31f163a362e41a3eae0
/ns3/ns-3.26/src/aodv/model/aodv-rtable.cc
c0545c2492db6e4e2d2227881f87e9f69ec45bd0
[ "LicenseRef-scancode-free-unknown", "GPL-2.0-only", "Apache-2.0" ]
permissive
cyliustack/clusim
667a9eef2e1ea8dad1511fd405f3191d150a04a8
cbedcf671ba19fded26e4776c0e068f81f068dfd
refs/heads/master
2022-10-06T20:14:43.052930
2022-10-01T19:42:19
2022-10-01T19:42:19
99,692,344
7
3
Apache-2.0
2018-07-04T10:09:24
2017-08-08T12:51:33
Python
UTF-8
C++
false
false
12,310
cc
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2009 IITP RAS * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * 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 * * Based on * NS-2 AODV model developed by the CMU/MONARCH group and optimized and * tuned by Samir Das and Mahesh Marina, University of Cincinnati; * * AODV-UU implementation by Erik Nordström of Uppsala University * http://core.it.uu.se/core/index.php/AODV-UU * * Authors: Elena Buchatskaia <borovkovaes@iitp.ru> * Pavel Boyko <boyko@iitp.ru> */ #include "aodv-rtable.h" #include <algorithm> #include <iomanip> #include "ns3/simulator.h" #include "ns3/log.h" namespace ns3 { NS_LOG_COMPONENT_DEFINE ("AodvRoutingTable"); namespace aodv { /* The Routing Table */ RoutingTableEntry::RoutingTableEntry (Ptr<NetDevice> dev, Ipv4Address dst, bool vSeqNo, uint32_t seqNo, Ipv4InterfaceAddress iface, uint16_t hops, Ipv4Address nextHop, Time lifetime) : m_ackTimer (Timer::CANCEL_ON_DESTROY), m_validSeqNo (vSeqNo), m_seqNo (seqNo), m_hops (hops), m_lifeTime (lifetime + Simulator::Now ()), m_iface (iface), m_flag (VALID), m_reqCount (0), m_blackListState (false), m_blackListTimeout (Simulator::Now ()) { m_ipv4Route = Create<Ipv4Route> (); m_ipv4Route->SetDestination (dst); m_ipv4Route->SetGateway (nextHop); m_ipv4Route->SetSource (m_iface.GetLocal ()); m_ipv4Route->SetOutputDevice (dev); } RoutingTableEntry::~RoutingTableEntry () { } bool RoutingTableEntry::InsertPrecursor (Ipv4Address id) { NS_LOG_FUNCTION (this << id); if (!LookupPrecursor (id)) { m_precursorList.push_back (id); return true; } else return false; } bool RoutingTableEntry::LookupPrecursor (Ipv4Address id) { NS_LOG_FUNCTION (this << id); for (std::vector<Ipv4Address>::const_iterator i = m_precursorList.begin (); i != m_precursorList.end (); ++i) { if (*i == id) { NS_LOG_LOGIC ("Precursor " << id << " found"); return true; } } NS_LOG_LOGIC ("Precursor " << id << " not found"); return false; } bool RoutingTableEntry::DeletePrecursor (Ipv4Address id) { NS_LOG_FUNCTION (this << id); std::vector<Ipv4Address>::iterator i = std::remove (m_precursorList.begin (), m_precursorList.end (), id); if (i == m_precursorList.end ()) { NS_LOG_LOGIC ("Precursor " << id << " not found"); return false; } else { NS_LOG_LOGIC ("Precursor " << id << " found"); m_precursorList.erase (i, m_precursorList.end ()); } return true; } void RoutingTableEntry::DeleteAllPrecursors () { NS_LOG_FUNCTION (this); m_precursorList.clear (); } bool RoutingTableEntry::IsPrecursorListEmpty () const { return m_precursorList.empty (); } void RoutingTableEntry::GetPrecursors (std::vector<Ipv4Address> & prec) const { NS_LOG_FUNCTION (this); if (IsPrecursorListEmpty ()) return; for (std::vector<Ipv4Address>::const_iterator i = m_precursorList.begin (); i != m_precursorList.end (); ++i) { bool result = true; for (std::vector<Ipv4Address>::const_iterator j = prec.begin (); j != prec.end (); ++j) { if (*j == *i) result = false; } if (result) prec.push_back (*i); } } void RoutingTableEntry::Invalidate (Time badLinkLifetime) { NS_LOG_FUNCTION (this << badLinkLifetime.GetSeconds ()); if (m_flag == INVALID) return; m_flag = INVALID; m_reqCount = 0; m_lifeTime = badLinkLifetime + Simulator::Now (); } void RoutingTableEntry::Print (Ptr<OutputStreamWrapper> stream) const { std::ostream* os = stream->GetStream (); *os << m_ipv4Route->GetDestination () << "\t" << m_ipv4Route->GetGateway () << "\t" << m_iface.GetLocal () << "\t"; switch (m_flag) { case VALID: { *os << "UP"; break; } case INVALID: { *os << "DOWN"; break; } case IN_SEARCH: { *os << "IN_SEARCH"; break; } } *os << "\t"; *os << std::setiosflags (std::ios::fixed) << std::setiosflags (std::ios::left) << std::setprecision (2) << std::setw (14) << (m_lifeTime - Simulator::Now ()).GetSeconds (); *os << "\t" << m_hops << "\n"; } /* The Routing Table */ RoutingTable::RoutingTable (Time t) : m_badLinkLifetime (t) { } bool RoutingTable::LookupRoute (Ipv4Address id, RoutingTableEntry & rt) { NS_LOG_FUNCTION (this << id); Purge (); if (m_ipv4AddressEntry.empty ()) { NS_LOG_LOGIC ("Route to " << id << " not found; m_ipv4AddressEntry is empty"); return false; } std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = m_ipv4AddressEntry.find (id); if (i == m_ipv4AddressEntry.end ()) { NS_LOG_LOGIC ("Route to " << id << " not found"); return false; } rt = i->second; NS_LOG_LOGIC ("Route to " << id << " found"); return true; } bool RoutingTable::LookupValidRoute (Ipv4Address id, RoutingTableEntry & rt) { NS_LOG_FUNCTION (this << id); if (!LookupRoute (id, rt)) { NS_LOG_LOGIC ("Route to " << id << " not found"); return false; } NS_LOG_LOGIC ("Route to " << id << " flag is " << ((rt.GetFlag () == VALID) ? "valid" : "not valid")); return (rt.GetFlag () == VALID); } bool RoutingTable::DeleteRoute (Ipv4Address dst) { NS_LOG_FUNCTION (this << dst); Purge (); if (m_ipv4AddressEntry.erase (dst) != 0) { NS_LOG_LOGIC ("Route deletion to " << dst << " successful"); return true; } NS_LOG_LOGIC ("Route deletion to " << dst << " not successful"); return false; } bool RoutingTable::AddRoute (RoutingTableEntry & rt) { NS_LOG_FUNCTION (this); Purge (); if (rt.GetFlag () != IN_SEARCH) rt.SetRreqCnt (0); std::pair<std::map<Ipv4Address, RoutingTableEntry>::iterator, bool> result = m_ipv4AddressEntry.insert (std::make_pair (rt.GetDestination (), rt)); return result.second; } bool RoutingTable::Update (RoutingTableEntry & rt) { NS_LOG_FUNCTION (this); std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.find (rt.GetDestination ()); if (i == m_ipv4AddressEntry.end ()) { NS_LOG_LOGIC ("Route update to " << rt.GetDestination () << " fails; not found"); return false; } i->second = rt; if (i->second.GetFlag () != IN_SEARCH) { NS_LOG_LOGIC ("Route update to " << rt.GetDestination () << " set RreqCnt to 0"); i->second.SetRreqCnt (0); } return true; } bool RoutingTable::SetEntryState (Ipv4Address id, RouteFlags state) { NS_LOG_FUNCTION (this); std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.find (id); if (i == m_ipv4AddressEntry.end ()) { NS_LOG_LOGIC ("Route set entry state to " << id << " fails; not found"); return false; } i->second.SetFlag (state); i->second.SetRreqCnt (0); NS_LOG_LOGIC ("Route set entry state to " << id << ": new state is " << state); return true; } void RoutingTable::GetListOfDestinationWithNextHop (Ipv4Address nextHop, std::map<Ipv4Address, uint32_t> & unreachable ) { NS_LOG_FUNCTION (this); Purge (); unreachable.clear (); for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = m_ipv4AddressEntry.begin (); i != m_ipv4AddressEntry.end (); ++i) { if (i->second.GetNextHop () == nextHop) { NS_LOG_LOGIC ("Unreachable insert " << i->first << " " << i->second.GetSeqNo ()); unreachable.insert (std::make_pair (i->first, i->second.GetSeqNo ())); } } } void RoutingTable::InvalidateRoutesWithDst (const std::map<Ipv4Address, uint32_t> & unreachable) { NS_LOG_FUNCTION (this); Purge (); for (std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.begin (); i != m_ipv4AddressEntry.end (); ++i) { for (std::map<Ipv4Address, uint32_t>::const_iterator j = unreachable.begin (); j != unreachable.end (); ++j) { if ((i->first == j->first) && (i->second.GetFlag () == VALID)) { NS_LOG_LOGIC ("Invalidate route with destination address " << i->first); i->second.Invalidate (m_badLinkLifetime); } } } } void RoutingTable::DeleteAllRoutesFromInterface (Ipv4InterfaceAddress iface) { NS_LOG_FUNCTION (this); if (m_ipv4AddressEntry.empty ()) return; for (std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.begin (); i != m_ipv4AddressEntry.end ();) { if (i->second.GetInterface () == iface) { std::map<Ipv4Address, RoutingTableEntry>::iterator tmp = i; ++i; m_ipv4AddressEntry.erase (tmp); } else ++i; } } void RoutingTable::Purge () { NS_LOG_FUNCTION (this); if (m_ipv4AddressEntry.empty ()) return; for (std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.begin (); i != m_ipv4AddressEntry.end ();) { if (i->second.GetLifeTime () < Seconds (0)) { if (i->second.GetFlag () == INVALID) { std::map<Ipv4Address, RoutingTableEntry>::iterator tmp = i; ++i; m_ipv4AddressEntry.erase (tmp); } else if (i->second.GetFlag () == VALID) { NS_LOG_LOGIC ("Invalidate route with destination address " << i->first); i->second.Invalidate (m_badLinkLifetime); ++i; } else ++i; } else { ++i; } } } void RoutingTable::Purge (std::map<Ipv4Address, RoutingTableEntry> &table) const { NS_LOG_FUNCTION (this); if (table.empty ()) return; for (std::map<Ipv4Address, RoutingTableEntry>::iterator i = table.begin (); i != table.end ();) { if (i->second.GetLifeTime () < Seconds (0)) { if (i->second.GetFlag () == INVALID) { std::map<Ipv4Address, RoutingTableEntry>::iterator tmp = i; ++i; table.erase (tmp); } else if (i->second.GetFlag () == VALID) { NS_LOG_LOGIC ("Invalidate route with destination address " << i->first); i->second.Invalidate (m_badLinkLifetime); ++i; } else ++i; } else { ++i; } } } bool RoutingTable::MarkLinkAsUnidirectional (Ipv4Address neighbor, Time blacklistTimeout) { NS_LOG_FUNCTION (this << neighbor << blacklistTimeout.GetSeconds ()); std::map<Ipv4Address, RoutingTableEntry>::iterator i = m_ipv4AddressEntry.find (neighbor); if (i == m_ipv4AddressEntry.end ()) { NS_LOG_LOGIC ("Mark link unidirectional to " << neighbor << " fails; not found"); return false; } i->second.SetUnidirectional (true); i->second.SetBalcklistTimeout (blacklistTimeout); i->second.SetRreqCnt (0); NS_LOG_LOGIC ("Set link to " << neighbor << " to unidirectional"); return true; } void RoutingTable::Print (Ptr<OutputStreamWrapper> stream) const { std::map<Ipv4Address, RoutingTableEntry> table = m_ipv4AddressEntry; Purge (table); *stream->GetStream () << "\nAODV Routing table\n" << "Destination\tGateway\t\tInterface\tFlag\tExpire\t\tHops\n"; for (std::map<Ipv4Address, RoutingTableEntry>::const_iterator i = table.begin (); i != table.end (); ++i) { i->second.Print (stream); } *stream->GetStream () << "\n"; } } }
[ "you@example.com" ]
you@example.com
5cf76afdfa518eb006d1ef5443309fe6f5fd31f0
2f7b1e5376481896d02b14591b0a45e138c122c3
/include/Networking/Message.h
95fbfc746633f7ac78850b5a5344ecf759261ea3
[]
no_license
Ramneet-Singh/Pacman-Multiplayer
a5f36f2428d3d38384bf9c0ea09d7393be01697a
c0c2aa00273ab532c11354afdb3249a19c271753
refs/heads/master
2023-07-13T07:12:51.269131
2021-08-15T18:32:10
2021-08-15T18:32:10
368,476,955
1
0
null
null
null
null
UTF-8
C++
false
false
496
h
#pragma once #include <cstdint> #include "Networking/Networking.h" #include "Game/Utils/Vector2D.h" enum class GameMsg : uint32_t { Client_InitMap, Client_AssignID, Game_UserInput }; enum class UserInput { DUMMY, ONE, TWO, THREE, FOUR, W, A, S, D, UP, LEFT, RIGHT, DOWN, W_UP, A_UP, S_UP, D_UP, UP_UP, LEFT_UP, RIGHT_UP, DOWN_UP }; struct initMessage { int playerID; time_t randomSeed; };
[ "ramneet2001@gmail.com" ]
ramneet2001@gmail.com
2c6d69c813edf745c5f9320864f09ff0132b9ec9
2be7c87ec0a9cc03b0a944379b8485a8f5a2f93c
/bams_Arduino/bams_Arduino.ino
2dd22737b02fdb1760a4136d90c8bd7dac1e0417
[]
no_license
alphonse/bams
85a6b3dfc4c1c8c39d56a1ed9665eef714855116
53d708da368b2aaf4580b5e105528a3016271332
refs/heads/master
2020-04-10T03:10:14.148714
2016-02-19T19:17:40
2016-02-19T19:17:40
40,276,964
0
0
null
null
null
null
UTF-8
C++
false
false
5,471
ino
// ------------------------------------------------------------------------- // bams: Bicycle-based Air Monitoring System // v. 1.0 | AF | 2015-08-11 // ------------------------------------------------------------------------- // Contains code for Adafruit GPS modules using MTK3329/MTK3339 driver // and reads data from GPS, MQ-135 VOC sensor, and Shinyei PPD42 dust sensor // ------------------------------------------------------------------------- #include <SPI.h> #include <Adafruit_GPS.h> #include <SoftwareSerial.h> #include <SD.h> #include <avr/sleep.h> SoftwareSerial mySerial(8, 7); Adafruit_GPS GPS(&mySerial); #define GPSECHO true #define chipSelect 10 #define ledPin 13 File logfile; char filename[15]; unsigned long INTERVAL = 1000; unsigned long acc = 0.0; float raw = 0.0; float filtered = 1.0; float ALPHA = 0.9; float voc; // this keeps track of whether we're using the interrupt // off by default! boolean usingInterrupt = false; void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy // read a Hex value and return the decimal equivalent uint8_t parseHex(char c) { if (c < '0') return 0; if (c <= '9') return c - '0'; if (c < 'A') return 0; if (c <= 'F') return (c - 'A')+10; } // blink out an error code void error(uint8_t errno) { /* if (SD.errorCode()) { putstring("SD error: "); Serial.print(card.errorCode(), HEX); Serial.print(','); Serial.println(card.errorData(), HEX); } */ while(1) { uint8_t i; for (i=0; i<errno; i++) { digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(100); } for (i=errno; i<10; i++) { delay(200); } } } void setup() { pinMode(9, INPUT); // Shinyei on Pin 9 Serial.begin(115200); // see if the card is present and can be initialized: if (!SD.begin(chipSelect)) { error(2); } strcpy(filename, "GPSLOG00.TXT"); for (uint8_t i = 0; i < 100; i++) { filename[6] = '0' + i/10; filename[7] = '0' + i%10; // create if does not exist, do not open existing, write, sync after write if (! SD.exists(filename)) { break; } } logfile = SD.open(filename, FILE_WRITE); if( ! logfile ) { Serial.print("Couldnt create "); Serial.println(filename); error(3); } logfile.println("time, lat, lon, speed, angle, alt, satellites, pm_raw, pm_filt, voc"); logfile.close(); Serial.print("Writing to "); Serial.println(filename); GPS.begin(9600); GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); // Set the update rate GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); useInterrupt(true); delay(1000); // Ask for firmware version mySerial.println(PMTK_Q_RELEASE); } // Interrupt is called once a millisecond, looks for any new GPS data, and stores it SIGNAL(TIMER0_COMPA_vect) { char c = GPS.read(); // if you want to debug, this is a good time to do it! #ifdef UDR0 if (GPSECHO) if (c) UDR0 = c; // writing direct to UDR0 is much much faster than Serial.print // but only one character can be written at a time. #endif } void useInterrupt(boolean v) { if (v) { // Timer0 is already used for millis() - we'll just interrupt somewhere // in the middle and call the "Compare A" function above OCR0A = 0xAF; TIMSK0 |= _BV(OCIE0A); usingInterrupt = true; } else { // do not call the interrupt function COMPA anymore TIMSK0 &= ~_BV(OCIE0A); usingInterrupt = false; } } uint32_t timer = millis(); void loop() // run over and over again { acc += pulseIn(9, LOW); // Shinyei on Pin 9 // if a sentence is received, we can check the checksum, parse it... if (GPS.newNMEAreceived()) { if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false return; // we can fail to parse a sentence in which case we should just wait for another } // if millis() or timer wraps around, we'll just reset it if (timer > millis()) timer = millis(); // approximately every 2 seconds or so, print out the current stats if (millis() - timer > INTERVAL) { raw = acc / (timer * 10.0); // Shinyei reading expressed as percentage if (isnan(raw) || isinf(raw)) raw = 0.0; // nan creates propagating error filtered = ALPHA * filtered + (1 - ALPHA) * raw; // smooth data voc = analogRead(A0) * (5000.0 / 1023.0); // get VOC sensor reading timer = millis(); // reset the timer File logfile = SD.open(filename, FILE_WRITE); if (logfile) { logfile.print("20"); logfile.print(GPS.year, DEC); logfile.print("-"); logfile.print(GPS.month, DEC); logfile.print("-"); logfile.print(GPS.day, DEC); logfile.print(" "); logfile.print(GPS.hour, DEC); logfile.print(":"); logfile.print(GPS.minute, DEC); logfile.print(':'); logfile.print(GPS.seconds, DEC); logfile.print(", "); if (GPS.fix) { logfile.print(GPS.latitudeDegrees, 4); logfile.print(", "); logfile.print(GPS.longitudeDegrees, 4); logfile.print(", "); logfile.print(GPS.speed); logfile.print(", "); logfile.print(GPS.angle); logfile.print(", "); logfile.print(GPS.altitude); logfile.print(", "); logfile.print((int)GPS.satellites); logfile.print(", "); } logfile.print(raw, 4); logfile.print(", "); logfile.print(filtered, 4); logfile.print(", "); logfile.println(voc); logfile.close(); } acc = 0; } }
[ "alphonse.fisch@gmail.com" ]
alphonse.fisch@gmail.com
739586615dce5626782a925ab1c8b0a5aa5a1776
e5ec93a45eecf20095d52d013dd1f94e293aa48b
/vsdk/VisVFWCamera/VisVFWCamDLL.cpp
f224565022b278562634f2a0e7dda631ff46ac0e
[]
no_license
Ethan-Zhou/Portrait
6342f13e5263fe735f12801140e36adc5772123c
9b8cc97d470274c1a57656f61d06bf7dd9972b21
refs/heads/master
2020-12-29T00:41:36.816002
2013-03-10T08:21:26
2013-03-10T08:21:26
null
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
1,662
cpp
//////////////////////////////////////////////////////////////////////////// // // @doc INTERNAL EXTERNAL VISVFWCAMDLL // // @module VisVFWCamDLL.cpp | // // This file implements the exported function <f VisGetImSrcProvider>, which // is used to create a <c CVisVFWProvider> object. It also implements // the DLL entry point, DllMain, and contains global variables used in the // DLL. // // <nl> // // Copyright © 1997-2000 Microsoft Corporation, All Rights Reserved // <nl> // // @xref <l VisVFWCamDLL\.h> // //////////////////////////////////////////////////////////////////////////// // Warning that some STL type names are too long. (Debug info is truncated.) #pragma warning( disable : 4786 ) // Define INITGUID here to get GUIDs defined in the header files. // (We'll also need to link with uuid.lib to get some standard // GUIDs, like IID_IUnknown.) #ifndef VIS_SDK_LIBS #define INITGUID #endif //!VIS_SDK_LIBS #include "VisVFWCamPch.h" #include "VisVFWCamProj.h" // Global variables. #ifndef VIS_VFW_LIB // The handle of this DLL. HANDLE g_hModule = 0; //#else // #include "VisCore.h" #endif //!VIS_VFW_LIB #ifndef VIS_VFW_LIB BOOL APIENTRY DllMain(HANDLE hModule, DWORD ulReasonForCall, LPVOID lpReserved) { switch(ulReasonForCall) { case DLL_PROCESS_ATTACH: if (hModule != 0) { g_hModule = hModule; DisableThreadLibraryCalls((HINSTANCE) hModule); } break; case DLL_THREAD_ATTACH: if (g_hModule == 0) g_hModule = hModule; break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: break; } return TRUE; } #endif // VIS_VFW_LIB
[ "fish_wsr@hotmail.com" ]
fish_wsr@hotmail.com
536544ae0a32ea37f76ac9f2658180865376699b
988c8499c97c83099f193e6c0450636716fe685d
/question/cpp/base/d2-2-函数重载.cpp
1a16d5863437bd524fa8e6994db84ffb52c06047
[]
no_license
ueumd/clang
febfd9b1567eaf021b69f4c807afafa6228f6b2a
a98a6eddb41647a22b5d148c2dd523ef13985885
refs/heads/master
2021-02-22T16:50:30.072296
2020-04-24T12:41:22
2020-04-24T12:41:22
247,006,609
1
0
null
null
null
null
GB18030
C++
false
false
601
cpp
#include "iostream" using namespace std; /* 至少满足下面一个条件: 参数个数不同 参数类型不同 参数顺序不同 函数返回值不是函数重载的判断标准 */ void myFunPrint(int a) { cout << a << endl; } void myFunPrint(char *a) { cout << a << endl; } void myFunPrint(int a,int b) { cout << a+b << endl; } //函数重载和函数参数默认编译是可以通过,但是调用时非产生二义性 不知道该调哪个 void myFunPrint(int a, int b, int c = 0) { cout << a + b << endl; } void main() { cout << "hello..." << endl; system("pause"); return; }
[ "51134642@qq.com" ]
51134642@qq.com
6f30d1fe54198d5cea00aaa6cbf71cbe69c3fa93
dc007d392a935b5dffd2812c79a28914aaaff0b4
/src/address.cpp
64d722c59f4f6a72b531d623627d366720051ba5
[]
no_license
nullcatalyst/cpp-http
aafef6c4543793ffc04ac66ca77164970f687913
ad31208a4f07f3fab61e4c79b27bd7c2b19b236e
refs/heads/master
2021-04-06T09:00:11.338760
2018-03-21T16:23:23
2018-03-21T16:23:23
124,931,549
3
0
null
null
null
null
UTF-8
C++
false
false
1,845
cpp
#include "address.h" #include <cstring> // memcmp namespace http { Address Address::fromIPv4(const std::string & ip4, uint16_t port) { Address address; if (uv_ip4_addr(ip4.c_str(), port, (struct sockaddr_in *) &address.sock)) { // Error } return address; } Address Address::fromIPv6(const std::string & ip6, uint16_t port) { Address address; if (uv_ip6_addr(ip6.c_str(), port, (struct sockaddr_in6 *) &address.sock)) { // Error } return address; } std::string Address::toString() const { char buffer[INET6_ADDRSTRLEN]; return inet_ntop(sock.ss_family, &((struct sockaddr_in *) &sock)->sin_addr, buffer, INET6_ADDRSTRLEN); } bool Address::operator == (const Address & other) const { if (sock.ss_family == other.sock.ss_family) { if (isIPv4()) { return memcmp(&((struct sockaddr_in *) &sock)->sin_addr, &((struct sockaddr_in *) &other.sock)->sin_addr, sizeof(struct in_addr)) == 0; } else if (isIPv6()) { return memcmp(&((struct sockaddr_in6 *) &sock)->sin6_addr, &((struct sockaddr_in6 *) &other.sock)->sin6_addr, sizeof(struct in6_addr)) == 0; } } return false; } bool Address::operator != (const Address & other) const { if (sock.ss_family == other.sock.ss_family) { if (isIPv4()) { return memcmp(&((struct sockaddr_in *) &sock)->sin_addr, &((struct sockaddr_in *) &other.sock)->sin_addr, sizeof(struct in_addr)) != 0; } else if (isIPv6()) { return memcmp(&((struct sockaddr_in6 *) &sock)->sin6_addr, &((struct sockaddr_in6 *) &other.sock)->sin6_addr, sizeof(struct in6_addr)) != 0; } } return true; } }
[ "scottbennett912@gmail.com" ]
scottbennett912@gmail.com
7fb69408ea17f06e91d2a777406e317ad1c7f9c0
793d0548102f1fca145f6b5366199ab6e182209f
/ch04/stack_stl.cpp
1f5331263ce2d9e5bc17bcb3601655454fa709fc
[]
no_license
ht0919/ALDS
7ef558e2e760a5e4c008ecdcca53fc9e6acf51f2
0fcd022d5e3f5f29a2ba2fab14369abb28bf618c
refs/heads/master
2021-02-17T12:45:52.828097
2020-03-11T12:17:43
2020-03-11T12:17:43
245,098,270
0
0
null
null
null
null
UTF-8
C++
false
false
617
cpp
#include<iostream> #include<cstdlib> #include<stack> using namespace std; int main() { // 標準ライブラリからstackを使用 stack<int> S; int a, b, x; string s; while( cin >> s ){ if ( s[0] == '+' ) { a = S.top(); S.pop(); b = S.top(); S.pop(); S.push(a + b); } else if ( s[0] == '-' ) { b = S.top(); S.pop(); a = S.top(); S.pop(); S.push(a - b); } else if ( s[0] == '*' ) { a = S.top(); S.pop(); b = S.top(); S.pop(); S.push(a * b); } else { S.push(atoi(s.c_str())); } } cout << S.top() << endl; return 0; }
[ "ht0919@gmail.com" ]
ht0919@gmail.com
175898203ea11d2a1c39b5ee747a4a506a68f79f
148b61252764fdd95aa17e52179d801bdd20ee15
/mars/comm/socket/udpserver.cc
8132651ebec99eba2e237e4b0810813703f4cb69
[ "MIT", "Zlib", "BSD-3-Clause", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "BSL-1.0", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "OpenSSL" ]
permissive
Lynnnnnn/mars
8c7ab4b6e193de5e83ba79668f9461fea017f9a7
2b87cceec445b649b5c0190c119e9cbb30e5dc85
refs/heads/master
2021-04-29T08:17:35.555275
2016-12-29T14:32:28
2016-12-29T14:32:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,453
cc
// Tencent is pleased to support the open source community by making GAutomator available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. // Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT // 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. /* * UdpServer.cpp * * Created on: 2014-9-9 * Author: zhouzhijie */ #include "udpserver.h" #include "boost/bind.hpp" #include "xlogger/xlogger.h" #include "socket/socket_address.h" #include "socket/udpclient.h" #define DELETE_AND_NULL(a) {if (a) delete a; a = NULL;} #define MAX_DATAGRAM 65536 struct UdpServerSendData { explicit UdpServerSendData(struct sockaddr_in* _addr) { memcpy(&addr, _addr, sizeof(sockaddr_in)); } UdpServerSendData(const UdpServerSendData& rhs): addr(rhs.addr) { } AutoBuffer data; struct sockaddr_in addr; }; UdpServer::UdpServer(int _port, IAsyncUdpServerEvent* _event) : fd_socket_(INVALID_SOCKET) , event_(_event) , selector_(breaker_, true) { thread_ = new Thread(boost::bind(&UdpServer::__RunLoop, this)); __InitSocket(_port); thread_->start(); } UdpServer::~UdpServer() { if (thread_->isruning()) { event_ = NULL; breaker_.Break(); thread_->join(); } breaker_.Break(); DELETE_AND_NULL(thread_); list_buffer_.clear(); if (fd_socket_ != INVALID_SOCKET) socket_close(fd_socket_); } void UdpServer::SendBroadcast(int _port, void* _buf, size_t _len) { sockaddr_in dstAddr; bzero(&dstAddr, sizeof(dstAddr)); dstAddr = *(struct sockaddr_in*)(&socket_address(IPV4_BROADCAST_IP, _port).address()); if (!__SetBroadcastOpt()) return; SendAsync(&dstAddr, _buf, _len); } void UdpServer::SendAsync(const std::string& _ip, int _port, void* _buf, size_t _len) { sockaddr_in dstAddr; bzero(&dstAddr, sizeof(dstAddr)); dstAddr = *(struct sockaddr_in*)(&socket_address(_ip.c_str(), _port).address()); if (IPV4_BROADCAST_IP == _ip && !__SetBroadcastOpt()) return; SendAsync(&dstAddr, _buf, _len); } void UdpServer::SendAsync(struct sockaddr_in* _addr, void* _buf, size_t _len) { xassert2((fd_socket_ != INVALID_SOCKET && event_ != NULL), "socket invalid"); if (fd_socket_ == INVALID_SOCKET || event_ == NULL) return; ScopedLock lock(mutex_); list_buffer_.push_back(UdpServerSendData(_addr)); list_buffer_.back().data.Write(_buf, _len); if (!thread_->isruning()) thread_->start(); breaker_.Break(); } void UdpServer::__InitSocket(int _port) { int errCode = 0; struct sockaddr_in servAddr; bzero(&servAddr, sizeof(servAddr)); servAddr.sin_family = AF_INET; servAddr.sin_addr.s_addr = htonl(INADDR_ANY); servAddr.sin_port = (uint16_t)htons(_port); fd_socket_ = socket(AF_INET, SOCK_DGRAM, 0); if (fd_socket_ == INVALID_SOCKET) { errCode = socket_errno; xerror2(TSF"udp socket create error, error: %0", socket_strerror(errCode)); return; } if (bind(fd_socket_, (struct sockaddr*)&servAddr, sizeof(servAddr)) != 0) { errCode = socket_errno; xerror2(TSF"udp bind error, error: %0", socket_strerror(errCode)); } } void UdpServer::__RunLoop() { xassert2(fd_socket_ != INVALID_SOCKET, "socket invalid"); if (fd_socket_ == INVALID_SOCKET) return; char* readBuffer = new char[MAX_DATAGRAM]; void* buf = NULL; size_t len = 0; int ret = 0; struct sockaddr_in addr; while (true) { mutex_.lock(); bool bWriteSet = list_buffer_.size() > 0; if (bWriteSet) { buf = list_buffer_.front().data.Ptr(); len = list_buffer_.front().data.Length(); memcpy(&addr, &list_buffer_.front().addr, sizeof(sockaddr_in)); } else { bzero(readBuffer, MAX_DATAGRAM); buf = readBuffer; len = MAX_DATAGRAM - 1; bzero(&addr, sizeof(sockaddr_in)); } mutex_.unlock(); int err = 0; ret = __DoSelect(bWriteSet ? false : true, bWriteSet, buf, len, &addr, err); // only read or write can be true if (ret == -1) { xerror2(TSF"select error"); if (event_) event_->OnError(this, err); break; } if (ret == -2 && event_ == NULL) { xinfo2(TSF"normal break"); break; } if (ret == -2) continue; if (bWriteSet) { ScopedLock lock(mutex_); list_buffer_.pop_front(); continue; } } delete[] readBuffer; } bool UdpServer::__SetBroadcastOpt() { int on = 1; if (setsockopt(fd_socket_, SOL_SOCKET, SO_BROADCAST, (const char*)&on, sizeof(on)) != 0) { int errCode = socket_errno; xerror2(TSF"udp set broadcast error: %0", socket_strerror(errCode)); return false; } return true; } /* * return -2 break, -1 error, 0 timeout, else handle size */ int UdpServer::__DoSelect(bool _bReadSet, bool _bWriteSet, void* _buf, size_t _len, struct sockaddr_in* _addr, int& _errno) { xassert2((!(_bReadSet && _bWriteSet) && (_bReadSet || _bWriteSet)), "only read or write can be true, not both"); selector_.PreSelect(); if (_bWriteSet) selector_.Write_FD_SET(fd_socket_); if (_bReadSet) selector_.Read_FD_SET(fd_socket_); selector_.Exception_FD_SET(fd_socket_); int ret = selector_.Select(); if (ret < 0) { xerror2(TSF"udp select error: %0", socket_strerror(selector_.Errno())); _errno = selector_.Errno(); return -1; } // if (ret == 0) // { // xinfo2(TSF"udp select timeout:%0 ms", _timeoutMs); // return 0; // } // user break if (selector_.IsException()) { _errno = selector_.Errno(); xerror2(TSF"sel exception"); return -1; } if (selector_.IsBreak()) { xinfo2(TSF"sel breaker"); return -2; } if (selector_.Exception_FD_ISSET(fd_socket_)) { _errno = socket_errno; xerror2(TSF"socket exception error"); return -1; } if (selector_.Write_FD_ISSET(fd_socket_)) { int ret = (int)sendto(fd_socket_, (const char*)_buf, _len, 0, (sockaddr*)_addr, sizeof(sockaddr_in)); if (ret == -1) { _errno = socket_errno; xerror2(TSF"sendto error: %0", socket_strerror(_errno)); return -1; } return ret; } if (selector_.Read_FD_ISSET(fd_socket_)) { socklen_t len = sizeof(sockaddr_in); int ret = (int)recvfrom(fd_socket_, (char*)_buf, _len, 0, (sockaddr*)_addr, &len); if (ret == -1) { _errno = socket_errno; xerror2(TSF"recvfrom error: %0", socket_strerror(_errno)); return -1; } if (event_) event_->OnDataGramRead(this, _addr, _buf, ret); return ret; } return -1; }
[ "garryyan@tencent.com" ]
garryyan@tencent.com
33a1f47cee578794034b826c8ca8f10762d756a5
ac5442020a5247231ede042926530e500b16b501
/compilers/frontend/src/syntax/task/environment_section.cc
abb2e3701f537dd58346706bb98a4322ed0de14d
[]
no_license
MuhammadNurYanhaona/ITandPCubeS
e8a42d8d50f56eb76954bdf2cb786377cb5a8ee5
8928c56587db8293f0ec02c7cb030cfb540ce2b4
refs/heads/master
2021-01-24T06:22:37.089569
2017-04-22T15:57:04
2017-04-22T15:57:04
15,794,818
1
1
null
null
null
null
UTF-8
C++
false
false
2,156
cc
#include "../ast.h" #include "../ast_type.h" #include "../ast_def.h" #include "../ast_stmt.h" #include "../ast_type.h" #include "../ast_task.h" #include "../ast_partition.h" #include "../../common/errors.h" #include "../../common/location.h" #include "../../common/constant.h" #include "../../semantics/scope.h" #include "../../semantics/symbol.h" #include "../../semantics/helper.h" #include "../../semantics/computation_flow.h" #include "../../../../common-libs/utils/list.h" #include "../../../../common-libs/utils/hashtable.h" #include "../../../../common-libs/utils/string_utils.h" #include <sstream> //----------------------------------------------------- Environment Section -------------------------------------------------------/ //------------------------------------------------------------------------------------------------------------------Environment Link EnvironmentLink::EnvironmentLink(Identifier *v, LinkageType m) : Node(*v->GetLocation()) { Assert(v != NULL); var = v; var->SetParent(this); mode = m; } List<EnvironmentLink*> *EnvironmentLink::decomposeLinks(List<Identifier*> *idList, LinkageType mode) { List<EnvironmentLink*> *links = new List<EnvironmentLink*>; for (int i = 0; i < idList->NumElements(); i++) { links->Append(new EnvironmentLink(idList->Nth(i), mode)); } return links; } void EnvironmentLink::PrintChildren(int indentLevel) { var->Print(indentLevel + 1); } const char *EnvironmentLink::GetPrintNameForNode() { return (mode == TypeCreate) ? "Create" : (mode == TypeLink) ? "Link" : "Create if Not Linked"; } //---------------------------------------------------------------------------------------------------------------Environment Config EnvironmentSection::EnvironmentSection(List<EnvironmentLink*> *l, yyltype loc) : Node(loc) { Assert(l != NULL); links = l; for (int i = 0; i < links->NumElements(); i++) { links->Nth(i)->SetParent(this); } } void EnvironmentSection::PrintChildren(int indentLevel) { links->PrintAll(indentLevel + 1); }
[ "mny9md@virginia.edu" ]
mny9md@virginia.edu
cde597a11a215efa6ab5896e376e06b0d675dfd0
c690cc401fac423c7aa573a3a12c961850751be1
/src/uint256_t.h
13c4339758ae6bb7dad945beec2ab87e987965df
[ "MIT" ]
permissive
kimseonghui/MercyCoin
9cb5c8746492d95436be295712cb7b7ba9336b1f
b051db796c5d0cca637056916a558bd55ce19de1
refs/heads/master
2021-01-20T09:21:31.005075
2017-08-28T01:04:10
2017-08-28T01:04:10
101,590,630
0
0
null
null
null
null
UTF-8
C++
false
false
31,952
h
// Copyright (c) 2009-2015 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin developers // Copyright (c) 2015 The MercyCoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UINT256_H #define BITCOIN_UINT256_H #include <limits.h> #include <stdio.h> #include <string.h> #include <inttypes.h> #include <string> #include <vector> typedef long long int64; typedef unsigned long long uint64; inline int Testuint256AdHoc(std::vector<std::string> vArg); /** Base class without constructors for uint256 and uint160. * This makes the compiler let you use it in a union. */ template<unsigned int BITS> class base_uint { protected: enum { WIDTH=BITS/32 }; uint32_t pn[WIDTH]; public: bool operator!() const { for (int i = 0; i < WIDTH; i++) if (pn[i] != 0) return false; return true; } const base_uint operator~() const { base_uint ret; for (int i = 0; i < WIDTH; i++) ret.pn[i] = ~pn[i]; return ret; } const base_uint operator-() const { base_uint ret; for (int i = 0; i < WIDTH; i++) ret.pn[i] = ~pn[i]; ret++; return ret; } double getdouble() const { double ret = 0.0; double fact = 1.0; for (int i = 0; i < WIDTH; i++) { ret += fact * pn[i]; fact *= 4294967296.0; } return ret; } base_uint& operator=(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; return *this; } base_uint& operator^=(const base_uint& b) { for (int i = 0; i < WIDTH; i++) pn[i] ^= b.pn[i]; return *this; } base_uint& operator&=(const base_uint& b) { for (int i = 0; i < WIDTH; i++) pn[i] &= b.pn[i]; return *this; } base_uint& operator|=(const base_uint& b) { for (int i = 0; i < WIDTH; i++) pn[i] |= b.pn[i]; return *this; } base_uint& operator^=(uint64 b) { pn[0] ^= (unsigned int)b; pn[1] ^= (unsigned int)(b >> 32); return *this; } base_uint& operator|=(uint64 b) { pn[0] |= (unsigned int)b; pn[1] |= (unsigned int)(b >> 32); return *this; } base_uint& operator<<=(unsigned int shift) { base_uint a(*this); for (int i = 0; i < WIDTH; i++) pn[i] = 0; int k = shift / 32; shift = shift % 32; for (int i = 0; i < WIDTH; i++) { if (i+k+1 < WIDTH && shift != 0) pn[i+k+1] |= (a.pn[i] >> (32-shift)); if (i+k < WIDTH) pn[i+k] |= (a.pn[i] << shift); } return *this; } base_uint& operator>>=(unsigned int shift) { base_uint a(*this); for (int i = 0; i < WIDTH; i++) pn[i] = 0; int k = shift / 32; shift = shift % 32; for (int i = 0; i < WIDTH; i++) { if (i-k-1 >= 0 && shift != 0) pn[i-k-1] |= (a.pn[i] << (32-shift)); if (i-k >= 0) pn[i-k] |= (a.pn[i] >> shift); } return *this; } base_uint& operator+=(const base_uint& b) { uint64 carry = 0; for (int i = 0; i < WIDTH; i++) { uint64 n = carry + pn[i] + b.pn[i]; pn[i] = n & 0xffffffff; carry = n >> 32; } return *this; } base_uint& operator-=(const base_uint& b) { *this += -b; return *this; } base_uint& operator+=(uint64 b64) { base_uint b; b = b64; *this += b; return *this; } base_uint& operator-=(uint64 b64) { base_uint b; b = b64; *this += -b; return *this; } base_uint& operator++() { // prefix operator int i = 0; while (++pn[i] == 0 && i < WIDTH-1) i++; return *this; } const base_uint operator++(int) { // postfix operator const base_uint ret = *this; ++(*this); return ret; } base_uint& operator--() { // prefix operator int i = 0; while (--pn[i] == -1 && i < WIDTH-1) i++; return *this; } const base_uint operator--(int) { // postfix operator const base_uint ret = *this; --(*this); return ret; } friend inline bool operator<(const base_uint& a, const base_uint& b) { for (int i = base_uint::WIDTH-1; i >= 0; i--) { if (a.pn[i] < b.pn[i]) return true; else if (a.pn[i] > b.pn[i]) return false; } return false; } friend inline bool operator<=(const base_uint& a, const base_uint& b) { for (int i = base_uint::WIDTH-1; i >= 0; i--) { if (a.pn[i] < b.pn[i]) return true; else if (a.pn[i] > b.pn[i]) return false; } return true; } friend inline bool operator>(const base_uint& a, const base_uint& b) { for (int i = base_uint::WIDTH-1; i >= 0; i--) { if (a.pn[i] > b.pn[i]) return true; else if (a.pn[i] < b.pn[i]) return false; } return false; } friend inline bool operator>=(const base_uint& a, const base_uint& b) { for (int i = base_uint::WIDTH-1; i >= 0; i--) { if (a.pn[i] > b.pn[i]) return true; else if (a.pn[i] < b.pn[i]) return false; } return true; } friend inline bool operator==(const base_uint& a, const base_uint& b) { for (int i = 0; i < base_uint::WIDTH; i++) if (a.pn[i] != b.pn[i]) return false; return true; } friend inline bool operator==(const base_uint& a, uint64 b) { if (a.pn[0] != (unsigned int)b) return false; if (a.pn[1] != (unsigned int)(b >> 32)) return false; for (int i = 2; i < base_uint::WIDTH; i++) if (a.pn[i] != 0) return false; return true; } friend inline bool operator!=(const base_uint& a, const base_uint& b) { return (!(a == b)); } friend inline bool operator!=(const base_uint& a, uint64 b) { return (!(a == b)); } std::string GetHex() const { char psz[sizeof(pn)*2 + 1]; for (unsigned int i = 0; i < sizeof(pn); i++) sprintf(psz + i*2, "%02x", ((unsigned char*)pn)[sizeof(pn) - i - 1]); return std::string(psz, psz + sizeof(pn)*2); } void SetHex(const char* psz) { for (int i = 0; i < WIDTH; i++) pn[i] = 0; // skip leading spaces while (isspace(*psz)) psz++; // skip 0x if (psz[0] == '0' && tolower(psz[1]) == 'x') psz += 2; // hex string to uint static const unsigned char phexdigit[256] = { 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,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,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,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; const char* pbegin = psz; while (phexdigit[(unsigned char)*psz] || *psz == '0') psz++; psz--; unsigned char* p1 = (unsigned char*)pn; unsigned char* pend = p1 + WIDTH * 4; while (psz >= pbegin && p1 < pend) { *p1 = phexdigit[(unsigned char)*psz--]; if (psz >= pbegin) { *p1 |= (phexdigit[(unsigned char)*psz--] << 4); p1++; } } } void SetHex(const std::string& str) { SetHex(str.c_str()); } std::string ToString() const { return (GetHex()); } unsigned char* begin() { return (unsigned char*)&pn[0]; } unsigned char* end() { return (unsigned char*)&pn[WIDTH]; } const unsigned char* begin() const { return (unsigned char*)&pn[0]; } const unsigned char* end() const { return (unsigned char*)&pn[WIDTH]; } unsigned int size() const { return sizeof(pn); } uint64 Get64(int n=0) const { return pn[2*n] | (uint64)pn[2*n+1] << 32; } // unsigned int GetSerializeSize(int nType=0, int nVersion=PROTOCOL_VERSION) const unsigned int GetSerializeSize(int nType, int nVersion) const { return sizeof(pn); } template<typename Stream> // void Serialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) const void Serialize(Stream& s, int nType, int nVersion) const { s.write((char*)pn, sizeof(pn)); } template<typename Stream> // void Unserialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) void Unserialize(Stream& s, int nType, int nVersion) { s.read((char*)pn, sizeof(pn)); } friend class uint160; friend class uint256; friend class uint512; friend inline int Testuint256AdHoc(std::vector<std::string> vArg); }; typedef base_uint<160> base_uint160; typedef base_uint<256> base_uint256; typedef base_uint<512> base_uint512; // // uint160 and uint256 could be implemented as templates, but to keep // compile errors and debugging cleaner, they're copy and pasted. // ////////////////////////////////////////////////////////////////////////////// // // uint160 // /** 160-bit unsigned integer */ class uint160 : public base_uint160 { public: typedef base_uint160 basetype; uint160() { for (int i = 0; i < WIDTH; i++) pn[i] = 0; } uint160(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; } uint160& operator=(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; return *this; } uint160(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; } uint160& operator=(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; return *this; } explicit uint160(const std::string& str) { SetHex(str); } explicit uint160(const std::vector<unsigned char>& vch) { if (vch.size() == sizeof(pn)) memcpy(pn, &vch[0], sizeof(pn)); else *this = 0; } }; inline bool operator==(const uint160& a, uint64 b) { return (base_uint160)a == b; } inline bool operator!=(const uint160& a, uint64 b) { return (base_uint160)a != b; } inline const uint160 operator<<(const base_uint160& a, unsigned int shift) { return uint160(a) <<= shift; } inline const uint160 operator>>(const base_uint160& a, unsigned int shift) { return uint160(a) >>= shift; } inline const uint160 operator<<(const uint160& a, unsigned int shift) { return uint160(a) <<= shift; } inline const uint160 operator>>(const uint160& a, unsigned int shift) { return uint160(a) >>= shift; } inline const uint160 operator^(const base_uint160& a, const base_uint160& b) { return uint160(a) ^= b; } inline const uint160 operator&(const base_uint160& a, const base_uint160& b) { return uint160(a) &= b; } inline const uint160 operator|(const base_uint160& a, const base_uint160& b) { return uint160(a) |= b; } inline const uint160 operator+(const base_uint160& a, const base_uint160& b) { return uint160(a) += b; } inline const uint160 operator-(const base_uint160& a, const base_uint160& b) { return uint160(a) -= b; } inline bool operator<(const base_uint160& a, const uint160& b) { return (base_uint160)a < (base_uint160)b; } inline bool operator<=(const base_uint160& a, const uint160& b) { return (base_uint160)a <= (base_uint160)b; } inline bool operator>(const base_uint160& a, const uint160& b) { return (base_uint160)a > (base_uint160)b; } inline bool operator>=(const base_uint160& a, const uint160& b) { return (base_uint160)a >= (base_uint160)b; } inline bool operator==(const base_uint160& a, const uint160& b) { return (base_uint160)a == (base_uint160)b; } inline bool operator!=(const base_uint160& a, const uint160& b) { return (base_uint160)a != (base_uint160)b; } inline const uint160 operator^(const base_uint160& a, const uint160& b) { return (base_uint160)a ^ (base_uint160)b; } inline const uint160 operator&(const base_uint160& a, const uint160& b) { return (base_uint160)a & (base_uint160)b; } inline const uint160 operator|(const base_uint160& a, const uint160& b) { return (base_uint160)a | (base_uint160)b; } inline const uint160 operator+(const base_uint160& a, const uint160& b) { return (base_uint160)a + (base_uint160)b; } inline const uint160 operator-(const base_uint160& a, const uint160& b) { return (base_uint160)a - (base_uint160)b; } inline bool operator<(const uint160& a, const base_uint160& b) { return (base_uint160)a < (base_uint160)b; } inline bool operator<=(const uint160& a, const base_uint160& b) { return (base_uint160)a <= (base_uint160)b; } inline bool operator>(const uint160& a, const base_uint160& b) { return (base_uint160)a > (base_uint160)b; } inline bool operator>=(const uint160& a, const base_uint160& b) { return (base_uint160)a >= (base_uint160)b; } inline bool operator==(const uint160& a, const base_uint160& b) { return (base_uint160)a == (base_uint160)b; } inline bool operator!=(const uint160& a, const base_uint160& b) { return (base_uint160)a != (base_uint160)b; } inline const uint160 operator^(const uint160& a, const base_uint160& b) { return (base_uint160)a ^ (base_uint160)b; } inline const uint160 operator&(const uint160& a, const base_uint160& b) { return (base_uint160)a & (base_uint160)b; } inline const uint160 operator|(const uint160& a, const base_uint160& b) { return (base_uint160)a | (base_uint160)b; } inline const uint160 operator+(const uint160& a, const base_uint160& b) { return (base_uint160)a + (base_uint160)b; } inline const uint160 operator-(const uint160& a, const base_uint160& b) { return (base_uint160)a - (base_uint160)b; } inline bool operator<(const uint160& a, const uint160& b) { return (base_uint160)a < (base_uint160)b; } inline bool operator<=(const uint160& a, const uint160& b) { return (base_uint160)a <= (base_uint160)b; } inline bool operator>(const uint160& a, const uint160& b) { return (base_uint160)a > (base_uint160)b; } inline bool operator>=(const uint160& a, const uint160& b) { return (base_uint160)a >= (base_uint160)b; } inline bool operator==(const uint160& a, const uint160& b) { return (base_uint160)a == (base_uint160)b; } inline bool operator!=(const uint160& a, const uint160& b) { return (base_uint160)a != (base_uint160)b; } inline const uint160 operator^(const uint160& a, const uint160& b) { return (base_uint160)a ^ (base_uint160)b; } inline const uint160 operator&(const uint160& a, const uint160& b) { return (base_uint160)a & (base_uint160)b; } inline const uint160 operator|(const uint160& a, const uint160& b) { return (base_uint160)a | (base_uint160)b; } inline const uint160 operator+(const uint160& a, const uint160& b) { return (base_uint160)a + (base_uint160)b; } inline const uint160 operator-(const uint160& a, const uint160& b) { return (base_uint160)a - (base_uint160)b; } ////////////////////////////////////////////////////////////////////////////// // // uint256 // /** 256-bit unsigned integer */ class uint256 : public base_uint256 { public: typedef base_uint256 basetype; uint256() { for (int i = 0; i < WIDTH; i++) pn[i] = 0; } uint256(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; } uint256& operator=(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; return *this; } uint256(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; } uint256& operator=(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; return *this; } explicit uint256(const std::string& str) { SetHex(str); } explicit uint256(const std::vector<unsigned char>& vch) { if (vch.size() == sizeof(pn)) memcpy(pn, &vch[0], sizeof(pn)); else *this = 0; } }; inline bool operator==(const uint256& a, uint64 b) { return (base_uint256)a == b; } inline bool operator!=(const uint256& a, uint64 b) { return (base_uint256)a != b; } inline const uint256 operator<<(const base_uint256& a, unsigned int shift) { return uint256(a) <<= shift; } inline const uint256 operator>>(const base_uint256& a, unsigned int shift) { return uint256(a) >>= shift; } inline const uint256 operator<<(const uint256& a, unsigned int shift) { return uint256(a) <<= shift; } inline const uint256 operator>>(const uint256& a, unsigned int shift) { return uint256(a) >>= shift; } inline const uint256 operator^(const base_uint256& a, const base_uint256& b) { return uint256(a) ^= b; } inline const uint256 operator&(const base_uint256& a, const base_uint256& b) { return uint256(a) &= b; } inline const uint256 operator|(const base_uint256& a, const base_uint256& b) { return uint256(a) |= b; } inline const uint256 operator+(const base_uint256& a, const base_uint256& b) { return uint256(a) += b; } inline const uint256 operator-(const base_uint256& a, const base_uint256& b) { return uint256(a) -= b; } inline bool operator<(const base_uint256& a, const uint256& b) { return (base_uint256)a < (base_uint256)b; } inline bool operator<=(const base_uint256& a, const uint256& b) { return (base_uint256)a <= (base_uint256)b; } inline bool operator>(const base_uint256& a, const uint256& b) { return (base_uint256)a > (base_uint256)b; } inline bool operator>=(const base_uint256& a, const uint256& b) { return (base_uint256)a >= (base_uint256)b; } inline bool operator==(const base_uint256& a, const uint256& b) { return (base_uint256)a == (base_uint256)b; } inline bool operator!=(const base_uint256& a, const uint256& b) { return (base_uint256)a != (base_uint256)b; } inline const uint256 operator^(const base_uint256& a, const uint256& b) { return (base_uint256)a ^ (base_uint256)b; } inline const uint256 operator&(const base_uint256& a, const uint256& b) { return (base_uint256)a & (base_uint256)b; } inline const uint256 operator|(const base_uint256& a, const uint256& b) { return (base_uint256)a | (base_uint256)b; } inline const uint256 operator+(const base_uint256& a, const uint256& b) { return (base_uint256)a + (base_uint256)b; } inline const uint256 operator-(const base_uint256& a, const uint256& b) { return (base_uint256)a - (base_uint256)b; } inline bool operator<(const uint256& a, const base_uint256& b) { return (base_uint256)a < (base_uint256)b; } inline bool operator<=(const uint256& a, const base_uint256& b) { return (base_uint256)a <= (base_uint256)b; } inline bool operator>(const uint256& a, const base_uint256& b) { return (base_uint256)a > (base_uint256)b; } inline bool operator>=(const uint256& a, const base_uint256& b) { return (base_uint256)a >= (base_uint256)b; } inline bool operator==(const uint256& a, const base_uint256& b) { return (base_uint256)a == (base_uint256)b; } inline bool operator!=(const uint256& a, const base_uint256& b) { return (base_uint256)a != (base_uint256)b; } inline const uint256 operator^(const uint256& a, const base_uint256& b) { return (base_uint256)a ^ (base_uint256)b; } inline const uint256 operator&(const uint256& a, const base_uint256& b) { return (base_uint256)a & (base_uint256)b; } inline const uint256 operator|(const uint256& a, const base_uint256& b) { return (base_uint256)a | (base_uint256)b; } inline const uint256 operator+(const uint256& a, const base_uint256& b) { return (base_uint256)a + (base_uint256)b; } inline const uint256 operator-(const uint256& a, const base_uint256& b) { return (base_uint256)a - (base_uint256)b; } inline bool operator<(const uint256& a, const uint256& b) { return (base_uint256)a < (base_uint256)b; } inline bool operator<=(const uint256& a, const uint256& b) { return (base_uint256)a <= (base_uint256)b; } inline bool operator>(const uint256& a, const uint256& b) { return (base_uint256)a > (base_uint256)b; } inline bool operator>=(const uint256& a, const uint256& b) { return (base_uint256)a >= (base_uint256)b; } inline bool operator==(const uint256& a, const uint256& b) { return (base_uint256)a == (base_uint256)b; } inline bool operator!=(const uint256& a, const uint256& b) { return (base_uint256)a != (base_uint256)b; } inline const uint256 operator^(const uint256& a, const uint256& b) { return (base_uint256)a ^ (base_uint256)b; } inline const uint256 operator&(const uint256& a, const uint256& b) { return (base_uint256)a & (base_uint256)b; } inline const uint256 operator|(const uint256& a, const uint256& b) { return (base_uint256)a | (base_uint256)b; } inline const uint256 operator+(const uint256& a, const uint256& b) { return (base_uint256)a + (base_uint256)b; } inline const uint256 operator-(const uint256& a, const uint256& b) { return (base_uint256)a - (base_uint256)b; } ////////////////////////////////////////////////////////////////////////////// // // uint512 // /** 512-bit unsigned integer */ class uint512 : public base_uint512 { public: typedef base_uint512 basetype; uint512() { for (int i = 0; i < WIDTH; i++) pn[i] = 0; } uint512(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; } uint512& operator=(const basetype& b) { for (int i = 0; i < WIDTH; i++) pn[i] = b.pn[i]; return *this; } uint512(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; } uint512& operator=(uint64 b) { pn[0] = (unsigned int)b; pn[1] = (unsigned int)(b >> 32); for (int i = 2; i < WIDTH; i++) pn[i] = 0; return *this; } explicit uint512(const std::string& str) { SetHex(str); } explicit uint512(const std::vector<unsigned char>& vch) { if (vch.size() == sizeof(pn)) memcpy(pn, &vch[0], sizeof(pn)); else *this = 0; } uint256 trim256() const { uint256 ret; for (unsigned int i = 0; i < uint256::WIDTH; i++){ ret.pn[i] = pn[i]; } return ret; } }; inline bool operator==(const uint512& a, uint64 b) { return (base_uint512)a == b; } inline bool operator!=(const uint512& a, uint64 b) { return (base_uint512)a != b; } inline const uint512 operator<<(const base_uint512& a, unsigned int shift) { return uint512(a) <<= shift; } inline const uint512 operator>>(const base_uint512& a, unsigned int shift) { return uint512(a) >>= shift; } inline const uint512 operator<<(const uint512& a, unsigned int shift) { return uint512(a) <<= shift; } inline const uint512 operator>>(const uint512& a, unsigned int shift) { return uint512(a) >>= shift; } inline const uint512 operator^(const base_uint512& a, const base_uint512& b) { return uint512(a) ^= b; } inline const uint512 operator&(const base_uint512& a, const base_uint512& b) { return uint512(a) &= b; } inline const uint512 operator|(const base_uint512& a, const base_uint512& b) { return uint512(a) |= b; } inline const uint512 operator+(const base_uint512& a, const base_uint512& b) { return uint512(a) += b; } inline const uint512 operator-(const base_uint512& a, const base_uint512& b) { return uint512(a) -= b; } inline bool operator<(const base_uint512& a, const uint512& b) { return (base_uint512)a < (base_uint512)b; } inline bool operator<=(const base_uint512& a, const uint512& b) { return (base_uint512)a <= (base_uint512)b; } inline bool operator>(const base_uint512& a, const uint512& b) { return (base_uint512)a > (base_uint512)b; } inline bool operator>=(const base_uint512& a, const uint512& b) { return (base_uint512)a >= (base_uint512)b; } inline bool operator==(const base_uint512& a, const uint512& b) { return (base_uint512)a == (base_uint512)b; } inline bool operator!=(const base_uint512& a, const uint512& b) { return (base_uint512)a != (base_uint512)b; } inline const uint512 operator^(const base_uint512& a, const uint512& b) { return (base_uint512)a ^ (base_uint512)b; } inline const uint512 operator&(const base_uint512& a, const uint512& b) { return (base_uint512)a & (base_uint512)b; } inline const uint512 operator|(const base_uint512& a, const uint512& b) { return (base_uint512)a | (base_uint512)b; } inline const uint512 operator+(const base_uint512& a, const uint512& b) { return (base_uint512)a + (base_uint512)b; } inline const uint512 operator-(const base_uint512& a, const uint512& b) { return (base_uint512)a - (base_uint512)b; } inline bool operator<(const uint512& a, const base_uint512& b) { return (base_uint512)a < (base_uint512)b; } inline bool operator<=(const uint512& a, const base_uint512& b) { return (base_uint512)a <= (base_uint512)b; } inline bool operator>(const uint512& a, const base_uint512& b) { return (base_uint512)a > (base_uint512)b; } inline bool operator>=(const uint512& a, const base_uint512& b) { return (base_uint512)a >= (base_uint512)b; } inline bool operator==(const uint512& a, const base_uint512& b) { return (base_uint512)a == (base_uint512)b; } inline bool operator!=(const uint512& a, const base_uint512& b) { return (base_uint512)a != (base_uint512)b; } inline const uint512 operator^(const uint512& a, const base_uint512& b) { return (base_uint512)a ^ (base_uint512)b; } inline const uint512 operator&(const uint512& a, const base_uint512& b) { return (base_uint512)a & (base_uint512)b; } inline const uint512 operator|(const uint512& a, const base_uint512& b) { return (base_uint512)a | (base_uint512)b; } inline const uint512 operator+(const uint512& a, const base_uint512& b) { return (base_uint512)a + (base_uint512)b; } inline const uint512 operator-(const uint512& a, const base_uint512& b) { return (base_uint512)a - (base_uint512)b; } inline bool operator<(const uint512& a, const uint512& b) { return (base_uint512)a < (base_uint512)b; } inline bool operator<=(const uint512& a, const uint512& b) { return (base_uint512)a <= (base_uint512)b; } inline bool operator>(const uint512& a, const uint512& b) { return (base_uint512)a > (base_uint512)b; } inline bool operator>=(const uint512& a, const uint512& b) { return (base_uint512)a >= (base_uint512)b; } inline bool operator==(const uint512& a, const uint512& b) { return (base_uint512)a == (base_uint512)b; } inline bool operator!=(const uint512& a, const uint512& b) { return (base_uint512)a != (base_uint512)b; } inline const uint512 operator^(const uint512& a, const uint512& b) { return (base_uint512)a ^ (base_uint512)b; } inline const uint512 operator&(const uint512& a, const uint512& b) { return (base_uint512)a & (base_uint512)b; } inline const uint512 operator|(const uint512& a, const uint512& b) { return (base_uint512)a | (base_uint512)b; } inline const uint512 operator+(const uint512& a, const uint512& b) { return (base_uint512)a + (base_uint512)b; } inline const uint512 operator-(const uint512& a, const uint512& b) { return (base_uint512)a - (base_uint512)b; } #ifdef TEST_UINT256 inline int Testuint256AdHoc(std::vector<std::string> vArg) { uint256 g(0); printf("%s\n", g.ToString().c_str()); g--; printf("g--\n"); printf("%s\n", g.ToString().c_str()); g--; printf("g--\n"); printf("%s\n", g.ToString().c_str()); g++; printf("g++\n"); printf("%s\n", g.ToString().c_str()); g++; printf("g++\n"); printf("%s\n", g.ToString().c_str()); g++; printf("g++\n"); printf("%s\n", g.ToString().c_str()); g++; printf("g++\n"); printf("%s\n", g.ToString().c_str()); uint256 a(7); printf("a=7\n"); printf("%s\n", a.ToString().c_str()); uint256 b; printf("b undefined\n"); printf("%s\n", b.ToString().c_str()); int c = 3; a = c; a.pn[3] = 15; printf("%s\n", a.ToString().c_str()); uint256 k(c); a = 5; a.pn[3] = 15; printf("%s\n", a.ToString().c_str()); b = 1; b <<= 52; a |= b; a ^= 0x500; printf("a %s\n", a.ToString().c_str()); a = a | b | (uint256)0x1000; printf("a %s\n", a.ToString().c_str()); printf("b %s\n", b.ToString().c_str()); a = 0xfffffffe; a.pn[4] = 9; printf("%s\n", a.ToString().c_str()); a++; printf("%s\n", a.ToString().c_str()); a++; printf("%s\n", a.ToString().c_str()); a++; printf("%s\n", a.ToString().c_str()); a++; printf("%s\n", a.ToString().c_str()); a--; printf("%s\n", a.ToString().c_str()); a--; printf("%s\n", a.ToString().c_str()); a--; printf("%s\n", a.ToString().c_str()); uint256 d = a--; printf("%s\n", d.ToString().c_str()); printf("%s\n", a.ToString().c_str()); a--; printf("%s\n", a.ToString().c_str()); a--; printf("%s\n", a.ToString().c_str()); d = a; printf("%s\n", d.ToString().c_str()); for (int i = uint256::WIDTH-1; i >= 0; i--) printf("%08x", d.pn[i]); printf("\n"); uint256 neg = d; neg = ~neg; printf("%s\n", neg.ToString().c_str()); uint256 e = uint256("0xABCDEF123abcdef12345678909832180000011111111"); printf("\n"); printf("%s\n", e.ToString().c_str()); printf("\n"); uint256 x1 = uint256("0xABCDEF123abcdef12345678909832180000011111111"); uint256 x2; printf("%s\n", x1.ToString().c_str()); for (int i = 0; i < 270; i += 4) { x2 = x1 << i; printf("%s\n", x2.ToString().c_str()); } printf("\n"); printf("%s\n", x1.ToString().c_str()); for (int i = 0; i < 270; i += 4) { x2 = x1; x2 >>= i; printf("%s\n", x2.ToString().c_str()); } for (int i = 0; i < 100; i++) { uint256 k = (~uint256(0) >> i); printf("%s\n", k.ToString().c_str()); } for (int i = 0; i < 100; i++) { uint256 k = (~uint256(0) << i); printf("%s\n", k.ToString().c_str()); } return (0); } #endif #endif
[ "ksh21tprld@naver.com" ]
ksh21tprld@naver.com
322b8b52dc64f857794dcd834a56c0053230bef1
59d26f54e985df3a0df505827b25da0c5ff586e8
/OJ_LEETCODE/Accepted/3887 - Group Anagrams_AC.cpp
6f002baff70a79db8489ff24b45a5a2f81612b45
[]
no_license
minhaz1217/My-C-Journey
820f7b284e221eff2595611b2e86dc9e32f90278
3c8d998ede172e9855dc6bd02cb468d744a9cad6
refs/heads/master
2022-12-06T06:12:30.823678
2022-11-27T12:09:03
2022-11-27T12:09:03
160,788,252
2
1
null
null
null
null
UTF-8
C++
false
false
1,483
cpp
/* Minhazul Hayat Khan Website: www.minhazul.com EWU, Bangladesh Problem Name: Problem Link: Date : 12 / August / 2021 Comment: */ #include<bits/stdc++.h> //#include<iostream> using namespace std; #define DEBUG 1 #define check(a) DEBUG==1?(cout << a << endl):null; #define cc(a) DEBUG==1?(cout << a << endl):cout<<""; #define msg(a,b) DEBUG==1?(cout << a << " : " << b << endl):cout<<""; #define msg2(a,b,c) DEBUG==1?(cout << a << " : " << b << " : " << c << endl):cout<<""; #define msg3(a,b,c,d) DEBUG==1?(cout << a << " : " << b << " : " << c << " : " << d << endl):cout<<""; #define msg4(a,b,c,d,e) DEBUG==1?(cout << a << " : " << b << " : " << c << " : " << d << " : " << e << endl):cout<<""; #define _INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); class Solution { public: vector<vector<string>> groupAnagrams(vector<string>& strs) { vector<pair<string, int> > sortedStrings; map<string, vector<string> > mp; for(int i=0;i<strs.size();i++){ string str = strs[i]; sort(str.begin(), str.end()); if(mp.find(str) == mp.end()){ vector<string> vec; mp[ str ] = vec; } mp[ str ].push_back(strs[i]); } vector<vector<string> > result; for(map<string, vector<string> >::iterator it = mp.begin();it!=mp.end();it++){ result.push_back(it->second); } return result; } }; int main(){ return 0; }
[ "minhaz1217@gmail.com" ]
minhaz1217@gmail.com
7691c686a076acf8a712c4dd0cea1de0ea4a306b
49022e7430be70ab6880c28b759f9c68e1e2edf8
/RetCode251/Game/GameUtil.h
813be43384f5bcfe400704b334dd20c9ad480f52
[]
no_license
f3db43f4g443/SimpleSample11
61a634afa664676f94bf51f58c38640ee7ee1b64
e6aa0ceb34843defd0433b09f42f2de036d443d7
refs/heads/master
2022-03-10T18:21:42.698566
2022-02-18T06:42:18
2022-02-18T06:42:18
68,726,252
0
1
null
2021-04-15T18:51:36
2016-09-20T15:30:41
C++
UTF-8
C++
false
false
579
h
#pragma once #include "Common/Math3D.h" #include <vector> using namespace std; enum ERangeType { eRangeType_Normal, }; void GetRange( ERangeType eRangeType, uint32 nRange, uint32 nRange1, vector<TVector2<int32> >& result, bool bExcludeSelf = false ); bool IsInRange( ERangeType eRangeType, uint32 nRange, uint32 nRange1, const TVector2<int32>& pos, bool bExcludeSelf = false ); const TVector2<int32>& GetDirOfs( uint8 nDir ); TVector2<int32> RotateDir( const TVector2<int32>& dir, uint8 nCharDir ); TVector2<int32> RotateDirInv( const TVector2<int32>& dir, uint8 nCharDir );
[ "654656040@qq.com" ]
654656040@qq.com
94f53a215259b794bce5fc4472b2d44ce98469c1
5326421d3d4b272b63d3a64a99438203dba88e95
/VolMagick/RawV.cpp
1dfa867de33b789f182e9e900e62dc03a7119676
[]
no_license
transfix/cvc-mesher
2d7eb953bb351a388e02d2e0a3f68a6c5dfa70cb
466c507b622d5c397326ad03f73aad42d8cc2ba3
refs/heads/master
2021-01-10T20:56:08.732959
2014-01-11T22:52:33
2014-01-11T22:52:33
15,577,133
3
0
null
null
null
null
UTF-8
C++
false
false
23,572
cpp
/* $Id: RawV.cpp,v 1.2 2008/02/01 20:12:12 transfix Exp $ */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <math.h> #include <iostream> #include <fstream> #include <vector> #include <string> #include "VolMagick.h" #include "endians.h" #ifdef __WINDOWS__ #define SNPRINTF _snprintf #define FSEEK fseek #else #define SNPRINTF snprintf #define FSEEK fseeko #endif static inline void geterrstr(int errnum, char *strerrbuf, size_t buflen) { #ifdef HAVE_STRERROR_R strerror_r(errnum,strerrbuf,buflen); #else SNPRINTF(strerrbuf,buflen,"%s",strerror(errnum)); /* hopefully this is thread-safe on the target system! */ #endif } typedef struct header_t { unsigned int magic; unsigned int dim[3]; unsigned int numTimesteps; unsigned int numVariables; float min[4]; float max[4]; /* variable records come next */ } header_t; typedef struct var_record_t { unsigned char varType; char varName[64]; } var_record_t; namespace VolMagick { void VolumeFileInfo::readRawV(const std::string& file) { char buf[256]; VoxelType rawv_type_conv[] = { UChar, UChar, UShort, UInt, Float, Double }; uint64 rawv_type_sizes[] = { 0, 1, 2, 4, 4, 8 }; header_t header; var_record_t *var_records; FILE *input; struct stat s; uint64 dataBytes; unsigned int i,j; memset(buf,0,256); if((input = fopen(file.c_str(),"rb")) == NULL) { geterrstr(errno,buf,256); std::string errStr = "Error opening file '" + file + "': " + buf; throw ReadError(errStr); } if(fread(&header, sizeof(header_t), 1, input) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error reading header in file '" + file + "': " + buf; fclose(input); throw ReadError(errStr); } if(!big_endian()) { SWAP_32(&(header.magic)); for(i=0; i<3; i++) SWAP_32(&(header.dim[i])); SWAP_32(&(header.numTimesteps)); SWAP_32(&(header.numVariables)); for(i=0; i<4; i++) SWAP_32(&(header.min[i])); for(i=0; i<4; i++) SWAP_32(&(header.max[i])); } stat(file.c_str(), &s); /* error checking */ if(header.magic != 0xBAADBEEF) // check for magic number { fclose(input); throw InvalidRawVHeader("Magic number not present"); } if(header.numVariables == 0) // make sure there is more than 1 variable { fclose(input); throw InvalidRawVHeader("numVariables == 0"); } // make sure the file size is bigger than potential header data size if(sizeof(header_t)+sizeof(var_record_t)*uint64(header.numVariables)>=uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size is smaller than potential header size!"); } // make sure that the file size not greater than the largest possible volume // according to the header. if((uint64(sizeof(header_t))+uint64(sizeof(var_record_t))*header.numVariables+ uint64(header.dim[0]*header.dim[1]*header.dim[2])*rawv_type_sizes[5]* header.numTimesteps*header.numVariables)<uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size does not match header info"); } // make sure that the file size is at least as big as the smallest possible // volume according to the header if((uint64(sizeof(header_t))+uint64(sizeof(var_record_t))*header.numVariables+ uint64(header.dim[0]*header.dim[1]*header.dim[2])*rawv_type_sizes[1]* header.numTimesteps*header.numVariables)>uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size does not match header info"); } // now we should be safe to allocate based on the numVariables value in the header var_records = new var_record_t[header.numVariables]; if(var_records == NULL) { fclose(input); throw MemoryAllocationError("Cannot allocate memory for RawV variable records"); } /* read variable records */ dataBytes = 0; for(i = 0; i<header.numVariables; i++) { // read a single record if(fread(&(var_records[i]), sizeof(var_record_t), 1, input) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error reading variable record in file '" + file + "': " + buf; fclose(input); delete [] var_records; throw ReadError(errStr); } // check for null byte in variable name for(j=0; j<64; j++) if(var_records[i].varName[j] == '\0') break; if(j==64) { fclose(input); delete [] var_records; throw InvalidRawVHeader("Non null terminated variable name for variable"); } // make sure that the variable type specified is legal if(var_records[i].varType > 5) { fclose(input); delete [] var_records; throw InvalidRawVHeader("Invalid variable type"); } //count how many bytes this variable uses up so we can check this against the whole file size dataBytes += header.dim[0]*header.dim[1]*header.dim[2]*rawv_type_sizes[var_records[i].varType]*header.numTimesteps; } if(sizeof(header_t)+sizeof(var_record_t)*uint64(header.numVariables)+dataBytes != uint64(s.st_size)) { SNPRINTF(buf,255,"File size does not match header info: %llu %llu", dataBytes, uint64(s.st_size)); fclose(input); delete [] var_records; throw InvalidRawVHeader(buf); } /* At this point we can be sure that this RawV file is correct. We can now trust header values. */ _numVariables = header.numVariables; _numTimesteps = header.numTimesteps; _dimension = Dimension(header.dim); _boundingBox = BoundingBox(header.min[0],header.min[1],header.min[2], header.max[0],header.max[1],header.max[2]); _tmin = header.min[3]; _tmax = header.max[3]; _voxelTypes.clear(); _names.clear(); for(i=0; i<header.numVariables; i++) { _voxelTypes.push_back(rawv_type_conv[var_records[i].varType]); _names.push_back(var_records[i].varName); } /* new volume, so min/max is now unset */ _minIsSet.clear(); _minIsSet.resize(_numVariables); for(i=0; i<_minIsSet.size(); i++) _minIsSet[i].resize(_numTimesteps); _min.clear(); _min.resize(_numVariables); for(i=0; i<_min.size(); i++) _min[i].resize(_numTimesteps); _maxIsSet.clear(); _maxIsSet.resize(_numVariables); for(i=0; i<_maxIsSet.size(); i++) _maxIsSet[i].resize(_numTimesteps); _max.clear(); _max.resize(_numVariables); for(i=0; i<_max.size(); i++) _max[i].resize(_numTimesteps); fclose(input); delete [] var_records; } void readRawV(Volume& vol, const std::string& filename, unsigned int var, unsigned int time, uint64 off_x, uint64 off_y, uint64 off_z, const Dimension& subvoldim) { char buf[256]; VoxelType rawv_type_conv[] = { UChar, UChar, UShort, UInt, Float, Double }; uint64 rawv_type_sizes[] = { 0, 1, 2, 4, 4, 8 }; header_t header; var_record_t *var_records; FILE *input; struct stat s; uint64 dataBytes; uint64 i,j,k,v; memset(buf,0,256); if(subvoldim.isNull()) throw IndexOutOfBounds("Specified subvolume dimension is null."); if((input = fopen(filename.c_str(),"rb")) == NULL) { geterrstr(errno,buf,256); std::string errStr = "Error opening file '" + filename + "': " + buf; throw ReadError(errStr); } if(fread(&header, sizeof(header_t), 1, input) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error reading header in file '" + filename + "': " + buf; fclose(input); throw ReadError(errStr); } if(!big_endian()) { SWAP_32(&(header.magic)); for(i=0; i<3; i++) SWAP_32(&(header.dim[i])); SWAP_32(&(header.numTimesteps)); SWAP_32(&(header.numVariables)); for(i=0; i<4; i++) SWAP_32(&(header.min[i])); for(i=0; i<4; i++) SWAP_32(&(header.max[i])); } stat(filename.c_str(), &s); /* error checking */ if(header.magic != 0xBAADBEEF) // check for magic number { fclose(input); throw InvalidRawVHeader("Magic number not present"); } if(header.numVariables == 0) // make sure there is more than 1 variable { fclose(input); throw InvalidRawVHeader("numVariables == 0"); } // make sure the file size is bigger than potential header data size if(sizeof(header_t)+sizeof(var_record_t)*uint64(header.numVariables)>=uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size is smaller than potential header size!"); } // make sure that the file size not greater than the largest possible volume // according to the header. if((uint64(sizeof(header_t))+uint64(sizeof(var_record_t))*header.numVariables+ uint64(header.dim[0]*header.dim[1]*header.dim[2])*rawv_type_sizes[5]* header.numTimesteps*header.numVariables)<uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size is greater than the largest possible volume according to the header"); } // make sure that the file size is at least as big as the smallest possible // volume according to the header if((uint64(sizeof(header_t))+uint64(sizeof(var_record_t))*header.numVariables+ uint64(header.dim[0]*header.dim[1]*header.dim[2])*rawv_type_sizes[1]* header.numTimesteps*header.numVariables)>uint64(s.st_size)) { fclose(input); throw InvalidRawVHeader("File size is smaller than the smallest possible volume according to the header"); } // now we should be safe to allocate based on the numVariables value in the header var_records = new var_record_t[header.numVariables]; if(var_records == NULL) { fclose(input); throw MemoryAllocationError("Cannot allocate memory for RawV variable records"); } /* read variable records */ dataBytes = 0; for(i = 0; i<header.numVariables; i++) { // read a single record if(fread(&(var_records[i]), sizeof(var_record_t), 1, input) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error reading variable record in file '" + filename + "': " + buf; fclose(input); delete [] var_records; throw ReadError(errStr); } // check for null byte in variable name for(j=0; j<64; j++) if(var_records[i].varName[j] == '\0') break; if(j==64) { fclose(input); delete [] var_records; throw InvalidRawVHeader("Non null terminated variable name for variable"); } // make sure that the variable type specified is legal if(var_records[i].varType > 5) { fclose(input); delete [] var_records; throw InvalidRawVHeader("Invalid variable type"); } //count how many bytes this variable uses up so we can check this against the whole file size dataBytes += header.dim[0]*header.dim[1]*header.dim[2]*rawv_type_sizes[var_records[i].varType]*header.numTimesteps; } if(sizeof(header_t)+sizeof(var_record_t)*header.numVariables+dataBytes != uint64(s.st_size)) { SNPRINTF(buf,255,"File size does not match header info: %lld %lld", sizeof(header_t)+sizeof(var_record_t)*header.numVariables+dataBytes, uint64(s.st_size)); fclose(input); delete [] var_records; throw InvalidRawVHeader(buf); } // make sure function arguments are correct if((off_x + subvoldim[0] - 1 >= header.dim[0]) || (off_y + subvoldim[1] - 1 >= header.dim[1]) || (off_z + subvoldim[2] - 1 >= header.dim[2])) { fclose(input); delete [] var_records; throw IndexOutOfBounds("Subvolume specified is outside volume dimensions"); } if(var >= header.numVariables || time >= header.numTimesteps) { fclose(input); delete [] var_records; throw IndexOutOfBounds("Requested variable/timestep is larger than the number of variables/timesteps"); } /* At this point we can be sure that this RawV file and function arguments are correct, so we may now modify 'vol'. */ try { vol.dimension(subvoldim); BoundingBox subvolbox; subvolbox.setMin(header.min[0]+((header.max[0] - header.min[0])/(header.dim[0] - 1))*off_x, header.min[1]+((header.max[1] - header.min[1])/(header.dim[1] - 1))*off_y, header.min[2]+((header.max[2] - header.min[2])/(header.dim[2] - 1))*off_z); subvolbox.setMax(header.min[0]+((header.max[0] - header.min[0])/(header.dim[0] - 1))*(off_x+subvoldim[0]-1), header.min[1]+((header.max[1] - header.min[1])/(header.dim[1] - 1))*(off_y+subvoldim[1]-1), header.min[2]+((header.max[2] - header.min[2])/(header.dim[2] - 1))*(off_z+subvoldim[2]-1)); vol.boundingBox(subvolbox); vol.voxelType(rawv_type_conv[var_records[var].varType]); vol.desc(var_records[var].varName); } catch(MemoryAllocationError& e) { fclose(input); delete [] var_records; throw e; } /* Finally read the requested volume data. */ try { off_t offset = sizeof(header_t)+sizeof(var_record_t)*uint64(header.numVariables); off_t file_offx, file_offy, file_offz; // set offset to the requested variable for(v=0; v<var; v++) offset += header.dim[0]*header.dim[1]*header.dim[2]* rawv_type_sizes[var_records[v].varType]*header.numTimesteps; //set offset to the requested timestep offset += header.dim[0]*header.dim[1]*header.dim[2]* rawv_type_sizes[var_records[var].varType]*time; for(k=off_z; k<=(off_z+subvoldim[2]-1); k++) { file_offz = offset+k*header.dim[0]*header.dim[1]*rawv_type_sizes[var_records[var].varType]; for(j=off_y; j<=(off_y+subvoldim[1]-1); j++) { file_offy = j*header.dim[0]*rawv_type_sizes[var_records[var].varType]; file_offx = off_x*rawv_type_sizes[var_records[var].varType]; //seek and read a scanline at a time if(FSEEK(input,file_offx+file_offy+file_offz,SEEK_SET) == -1) { geterrstr(errno,buf,256); std::string errStr = "Error reading volume data in file '" + filename + "': " + buf; throw ReadError(errStr); } if(fread(*vol+ (k-off_z)*vol.XDim()*vol.YDim()*vol.voxelSize()+ (j-off_y)*vol.XDim()*vol.voxelSize(), vol.voxelSize(),vol.XDim(),input) != vol.XDim()) { geterrstr(errno,buf,256); std::string errStr = "Error reading volume data in file '" + filename + "': " + buf; throw ReadError(errStr); } } } } catch(ReadError& e) { fclose(input); delete [] var_records; throw e; } /* swap the volume data if on little endian machine */ if(!big_endian()) { size_t len = vol.XDim()*vol.YDim()*vol.ZDim(); switch(vol.voxelType()) { case UShort: for(i=0;i<len;i++) SWAP_16(*vol+i*vol.voxelSize()); break; case Float: for(i=0;i<len;i++) SWAP_32(*vol+i*vol.voxelSize()); break; case Double: for(i=0;i<len;i++) SWAP_64(*vol+i*vol.voxelSize()); break; default: break; /* no swapping needed for unsigned char data, and unsigned int is not defined for rawiv */ } } fclose(input); delete [] var_records; } void createRawV(const std::string& filename, const BoundingBox& boundingBox, const Dimension& dimension, const std::vector<VoxelType>& voxelTypes, unsigned int numVariables, unsigned int numTimesteps, double min_time, double max_time) { char buf[256]; unsigned char rawv_inv_type_conv[] = { 1, 2, 3, 4, 5 }; header_t header; var_record_t var_record; FILE *output; size_t i,j,k,v,t; memset(buf,0,256); if(boundingBox.isNull()) throw InvalidBoundingBox("Bounding box must not be null"); if(dimension.isNull()) throw InvalidBoundingBox("Dimension must not be null"); if(voxelTypes.size() != numVariables) throw InvalidRawVHeader("Number of variables must match number of supplied voxel types"); if((output = fopen(filename.c_str(),"wb")) == NULL) { geterrstr(errno,buf,256); std::string errStr = "Error opening file '" + filename + "': " + buf; throw WriteError(errStr); } header.magic = 0xBAADBEEF; header.dim[0] = dimension[0]; header.dim[1] = dimension[1]; header.dim[2] = dimension[2]; header.numTimesteps = numTimesteps; header.numVariables = numVariables; header.min[0] = boundingBox.minx; header.min[1] = boundingBox.miny; header.min[2] = boundingBox.minz; header.min[3] = min_time; header.max[0] = boundingBox.maxx; header.max[1] = boundingBox.maxy; header.max[2] = boundingBox.maxz; header.max[3] = max_time; if(!big_endian()) { SWAP_32(&(header.magic)); for(i=0; i<3; i++) SWAP_32(&(header.dim[i])); SWAP_32(&(header.numTimesteps)); SWAP_32(&(header.numVariables)); for(i=0; i<4; i++) SWAP_32(&(header.min[i])); for(i=0; i<4; i++) SWAP_32(&(header.max[i])); } if(fwrite(&header,sizeof(header),1,output) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error writing header to file '" + filename + "': " + buf; fclose(output); throw WriteError(errStr); } // write the variable records for(i=0; i<numVariables; i++) { memset(&var_record,0,sizeof(var_record_t)); var_record.varType = rawv_inv_type_conv[voxelTypes[i]]; if(fwrite(&var_record,sizeof(var_record),1,output) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error writing header to file '" + filename + "': " + buf; fclose(output); throw WriteError(errStr); } } //write a scanline at a time for(v=0; v<numVariables; v++) { // each variable may have its own type, so scanline size may differ unsigned char * scanline = (unsigned char *)calloc(dimension[0]*VoxelTypeSizes[voxelTypes[v]],1); if(scanline == NULL) { fclose(output); throw MemoryAllocationError("Unable to allocate memory for write buffer"); } for(t=0; t<numTimesteps; t++) for(k=0; k<dimension[2]; k++) for(j=0; j<dimension[1]; j++) { if(fwrite(scanline,VoxelTypeSizes[voxelTypes[v]],dimension[0],output) != dimension[0]) { geterrstr(errno,buf,256); std::string errStr = "Error writing volume data to file '" + filename + "': " + buf; free(scanline); fclose(output); throw WriteError(errStr); } } free(scanline); } fclose(output); } void writeRawV(const Volume& wvol, const std::string& filename, unsigned int var, unsigned int time, uint64 off_x, uint64 off_y, uint64 off_z) { char buf[256]; unsigned char rawv_inv_type_conv[] = { 1, 2, 3, 4, 5 }; VolumeFileInfo volinfo; FILE *output; size_t i,j,k,v; memset(buf,0,256); Volume vol(wvol); //check if the file exists and we can write the specified subvolume to it try { volinfo.read(filename); //if(!(Dimension(off_x+vol.XDim(),off_y+vol.YDim(),off_z+vol.ZDim()) <= volinfo.dimension())) if(off_x+vol.XDim() > volinfo.dimension()[0] && off_y+vol.YDim() > volinfo.dimension()[1] && off_z+vol.ZDim() > volinfo.dimension()[2]) { std::string errStr = "File '" + filename + "' exists but is too small to write volume at specified offset"; throw IndexOutOfBounds(errStr); } if(var >= volinfo.numVariables()) { std::string errStr = "Variable index exceeds number of variables in file '" + filename + "'"; throw IndexOutOfBounds(errStr); } if(time >= volinfo.numTimesteps()) { std::string errStr = "Timestep index exceeds number of timesteps in file '" + filename + "'"; throw IndexOutOfBounds(errStr); } vol.voxelType(volinfo.voxelTypes(var)); //change the volume's voxel type to match that of the file } catch(ReadError e) { //create a blank file since file doesn't exist (or there was an error reading the existing file) BoundingBox box(vol.boundingBox()); box.minx -= off_x * vol.XSpan(); box.miny -= off_y * vol.YSpan(); box.minz -= off_z * vol.ZSpan(); Dimension dim(vol.dimension()); dim[0] += off_x; dim[1] += off_y; dim[2] += off_z; createRawV(filename,box,dim,std::vector<VoxelType>(1,vol.voxelType()),1,1,0.0,0.0); volinfo.read(filename); if(var >= volinfo.numVariables()) { std::string errStr = "Variable index exceeds number of variables in file '" + filename + "'"; throw IndexOutOfBounds(errStr); } if(time >= volinfo.numTimesteps()) { std::string errStr = "Timestep index exceeds number of timesteps in file '" + filename + "'"; throw IndexOutOfBounds(errStr); } } if((output = fopen(filename.c_str(),"r+b")) == NULL) { geterrstr(errno,buf,256); std::string errStr = "Error opening file '" + filename + "': " + buf; throw WriteError(errStr); } //write the volume record for this volume { var_record_t var_record; if(FSEEK(output,sizeof(header_t)+sizeof(var_record_t)*var,SEEK_SET) == -1) { geterrstr(errno,buf,256); std::string errStr = "Error seeking in file '" + filename + "': " + buf; fclose(output); throw WriteError(errStr); } memset(&var_record,0,sizeof(var_record_t)); var_record.varType = rawv_inv_type_conv[vol.voxelType()]; strncpy(var_record.varName,vol.desc().c_str(),64); var_record.varName[63] = '\0'; if(fwrite(&var_record,sizeof(var_record),1,output) != 1) { geterrstr(errno,buf,256); std::string errStr = "Error writing header to file '" + filename + "': " + buf; fclose(output); throw WriteError(errStr); } } unsigned char * scanline = (unsigned char *)malloc(vol.XDim()*vol.voxelSize()); if(scanline == NULL) { fclose(output); throw MemoryAllocationError("Unable to allocate memory for write buffer"); } /* write the volume data. */ off_t offset = sizeof(header_t)+sizeof(var_record_t)*volinfo.numVariables(); off_t file_offx, file_offy, file_offz; // set offset to the requested variable for(v=0; v<var; v++) offset += volinfo.XDim()*volinfo.YDim()*volinfo.ZDim()* volinfo.voxelSizes(v)*volinfo.numTimesteps(); //set offset to the requested timestep offset += volinfo.XDim()*volinfo.YDim()*volinfo.ZDim()* volinfo.voxelSizes(var)*time; for(k=off_z; k<=(off_z+vol.ZDim()-1); k++) { file_offz = offset+k*volinfo.XDim()*volinfo.YDim()*volinfo.voxelSizes(var); for(j=off_y; j<=(off_y+vol.YDim()-1); j++) { file_offy = j*volinfo.XDim()*volinfo.voxelSizes(var); file_offx = off_x*volinfo.voxelSizes(var); //seek and read a scanline at a time if(FSEEK(output,file_offx+file_offy+file_offz,SEEK_SET) == -1) { geterrstr(errno,buf,256); std::string errStr = "Error seeking in file '" + filename + "': " + buf; fclose(output); throw WriteError(errStr); } memcpy(scanline,*vol+ ((k-off_z)*vol.XDim()*vol.YDim()*vol.voxelSize())+ ((j-off_y)*vol.XDim()*vol.voxelSize()), vol.XDim()*vol.voxelSize()); /* swap the volume data if on little endian machine */ if(!big_endian()) { size_t len = vol.XDim(); switch(vol.voxelType()) { case UShort: for(i=0;i<len;i++) SWAP_16(scanline+i*vol.voxelSize()); break; case Float: for(i=0;i<len;i++) SWAP_32(scanline+i*vol.voxelSize()); break; case Double: for(i=0;i<len;i++) SWAP_64(scanline+i*vol.voxelSize()); break; default: break; /* no swapping needed for unsigned char data, and unsigned int is not defined for rawiv */ } } if(fwrite(scanline,vol.voxelSize(),vol.XDim(),output) != vol.XDim()) { geterrstr(errno,buf,256); std::string errStr = "Error writing volume data to file '" + filename + "': " + buf; free(scanline); fclose(output); throw WriteError(errStr); } } } free(scanline); fclose(output); } };
[ "transfix@sublevels.net" ]
transfix@sublevels.net
578568d19105572531489667f3fde9a4a7905975
f0b7bcc41298354b471a72a7eeafe349aa8655bf
/codebase/libs/Radx/src/include/Radx/RayxData.hh
1ba84aa845461aa0c3ef1b09b7e49c9c91c44b58
[ "BSD-3-Clause" ]
permissive
NCAR/lrose-core
23abeb4e4f1b287725dc659fb566a293aba70069
be0d059240ca442883ae2993b6aa112011755688
refs/heads/master
2023-09-01T04:01:36.030960
2023-08-25T00:41:16
2023-08-25T00:41:16
51,408,988
90
53
NOASSERTION
2023-08-18T21:59:40
2016-02-09T23:36:25
C++
UTF-8
C++
false
false
22,959
hh
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1990 - 2016 // ** University Corporation for Atmospheric Research (UCAR) // ** National Center for Atmospheric Research (NCAR) // ** Boulder, Colorado, USA // ** BSD licence applies - redistribution and use in source and binary // ** forms, with or without modification, are permitted provided that // ** the following conditions are met: // ** 1) If the software is modified to produce derivative works, // ** such modified software should be clearly marked, so as not // ** to confuse it with the version available from UCAR. // ** 2) Redistributions of source code must retain the above copyright // ** notice, this list of conditions and the following disclaimer. // ** 3) Redistributions in binary form must reproduce the above copyright // ** notice, this list of conditions and the following disclaimer in the // ** documentation and/or other materials provided with the distribution. // ** 4) Neither the name of UCAR nor the names of its contributors, // ** if any, may be used to endorse or promote products derived from // ** this software without specific prior written permission. // ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS // ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED // ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* /** * @file RayxData.hh * @brief RayxData is one ray typically from radar data, one field * @class RayxData * @brief RayxData is one ray typically from radar data, one field */ #ifndef RayxData_H #define RayxData_H #include <Radx/Radx.hh> #include <Radx/RadxFuzzyF.hh> #include <Radx/RadxFuzzy2d.hh> #include <string> #include <vector> class RadxField; class RayxData { public: /** * An empty ray constructor */ RayxData (void); /** * A ray with specific data, but no values yet * * @param[in] name field name * @param[in] units data units * @param[in] npt Number of points in the ray * @param[in] missing Missing data value * @param[in] az Azimuth (degrees) * @param[in] elev Elevation (degrees) * @param[in] gate_spacing Km between gates * @param[in] start_range Km to first gate * * Initializes to missing data value along the ray */ RayxData (const std::string &name, const std::string &units, const int npt, const double missing, const double az, const double elev, const double gate_spacing, const double start_range); /** * A ray with specific data, and values from a RadxField object * * @param[in] name field name * @param[in] units data units * @param[in] npt Number of points in the ray * @param[in] missing Missing data value * @param[in] az Azimuth (degrees) * @param[in] elev Elevation (degrees) * @param[in] gate_spacing Km between gates * @param[in] start_range Km to first gate * @param[in] data Data array contained within * */ RayxData(const std::string &name, const std::string &units, const int npt, const double missing, const double az, const double elev, const double gate_spacing, const double start_range, const RadxField &data); /** * Destructor */ virtual ~RayxData(void); /** * Copy data contents from input into local, including missing data value */ bool transferData(const RayxData &r); /** * Change name to input value * @param[in] name Name to change to */ inline void changeName(const string &name) {_name = name;} /** * Change units to input value * @param[in] units Name to change to */ inline void changeUnits(const std::string &units) { _units = units;} /** * Change missing data value * @param[in] missing New value * * Changes all data that was missing to the new missing data value */ void changeMissing(const double missing); /** * Retrieve the data values into an array * @param[in] data The array to fill * @param[in] npt The length of the array * * @return false if npt not equal to local _npt */ bool retrieveData(Radx::fl32 *data, const int npt) const; /** * Retrieve the data values into an array, where the array can be bigger * than the local ray. * @param[in] data The array to fill * @param[in] npt The length of the array passed in * * If npt is larger than local ray, the data array is padded with missing * * @return false if npt is smaller than local ray */ bool retrieveSubsetData(Radx::fl32 *data, const int npt) const; /** * Store the local data values from an array into local state * @param[in] data The array to use * @param[in] npt The length of the array * * @note if npt not equal to local _npt, either not all data is stored, * or the surplus positions are set to missing */ void storeData(const Radx::fl32 *data, const int npt); /** * Set the data value at an index * @param[in] index The index into the data * @param[in] value The data value to set */ void setV(const int index, const double value); /** * Get data value at an index * @param[in] index The index into the data * @param[out] value The data value to get * * @return true if data was set into value and is not the missing value */ bool getV(const int index, double &value) const; /** * Multiply the data at each point by a fixed value * @param[in] v The value */ void multiply(const double v); /** * Multiply the data at each point by the value from another ray * @param[in] inp The other ray * @param[in] missing_ok True to pass through one value if the other is missing */ void multiply(const RayxData &inp, const bool missing_ok); /** * Modify the data at each point to be the min of that value and the * value from another ray * @param[in] inp The other ray */ void min(const RayxData &inp); /** * Modify the data at each point to be the max of that value and the * value from another ray * @param[in] inp The other ray */ void max(const RayxData &inp); /** * Divide the data at each point by a value from another RayxData * * @param[in] w The values to divide by */ void divide(const RayxData &w); /** * Divide the data at each point by a constant value * * @param[in] w The value to divide by */ void divide(const double w); /** * Add data from an input ray point by point to local RayxData * @param[in] i Data values to add * @param[in] missing_ok True to pass through one value if the other is missing */ void inc(const RayxData &i, const bool missing_ok); /** * Increment each data value by one fixed value * @param[in] v The fixed value */ void inc(const double v); /** * Subtract input data from local ray point by point to local RayxData * @param[in] i Data values to add * @param[in] missing_ok True to pass through one value if the other is missing */ void dec(const RayxData &i, const bool missing_ok); /** * Decrement each data value by one fixed value * @param[in] v The fixed value */ void dec(const double v); /** * at each point replace with absolute value * @param[in] v The fixed value */ void abs(void); /** * Increment one data value by one fixed value * @param[in] i index at which to increment * @param[in] v The fixed value */ void incAtPoint(const int i, const double v); /** * Subtract data from an input ray point by point to local RayxData * @param[in] i Data values to subtract */ void subtract(const RayxData &i); /** * At each point linearly remap the data * @param[in] scale * @param[in] offset * * Result = data*scale + offset */ void remap(const double scale, const double offset); /** * @return data at i minus data from other at i. * @param[in] other The Other ray * @param[in] i Index */ double differenceAtPoint(const RayxData &other, const int i) const; /** * Set the data values at each point to one fixed value * @param[in] v The fixed value */ void setAllToValue(const double v); /** * @return the name */ inline const std::string &getName() const {return _name;} /** * @return true if name matches input * @param[in] n */ inline bool namesMatch(const std::string &n) const {return _name == n;} /** * @return the units */ inline const std::string &getUnits() const {return _units;} /** * @return the number of points */ inline int getNpoints() const {return _npt;} /** * @return the missing data value */ inline double getMissing() const {return _missing;} /** * @return azimuth degrees */ inline double getAzimuth() const {return _az;} /** * @return true if input azimuth and elevation match local values * @param[in] az * @param[in] elev */ inline bool match(const double az, const double elev) const { return az == _az && _elev == elev; } /** * @return true if input beam location and resolution are constant * @param[in] x0 * @param[in] dx */ bool matchBeam(const double x0, const double dx) const; /** * Mask the local data into two values, those that are 1 or two point * outliers, and those that are not. * @param[in] outlierThresh Difference value that defines an outlier * @param[in] maskOutputValue The value to set at points where outliers are * @param[in] nonMaskOutputValue The value to set at points where not outlier. * @param[in] up True if outliers are larger than surroundings, * false if outliers can be either larger or smaller. * * The nth bin is declared to be a speckle point if its value * is different than both its second nearest neighbors by a threshold * value outlierThresh. * * If up=true, the bin must exceed its second nearest neighbor values, * in other words: * * if _data[n] > outlierThresh + _data[n-2] * and _data[n] > outlierThresh + _data[n+2] * * If up=false, the bin can either be larger or smaller than its second * nearest neighbor values, in other words: * * if _data[n] > outlierThresh + _data[n-2] * and _data[n] > outlierThresh + _data[n+2] * or * if _data[n] < outlierThresh + _data[n-2] * and _data[n] < outlierThresh + _data[n+2] * * The algorithm detects runs of one and two point outliers. If up=false, * runs of two point outliers must have the same sign, i.e. be either both * bigger or both smaller than the surrounding points * */ void speckleMask(const double outlierThresh, const double maskOutputValue, const double nonMaskOutputValue, const bool up); /** * Mask the local data into two values, those that are within tolerance * of a value, and those that aren't, with two output mask values * @param[in] maskValue The value to look for * @param[in] tolerance The allowed diff between maskValue and local values * @param[in] maskOutputValue The value to set at points where within * tolerance of maskValue * @param[in] nonMaskOutputValue The value to set at points where not within * tolerance of maskValue */ void maskWhenEqual(const double maskValue, const double tolerance, const double maskOutputValue, const double nonMaskOutputValue); /** * Mask local data when values are < threshold * @param[in] threshold * @param[in] replacement value to replace with * @param[in] replaceWithMissing true to replace with the misssing value */ void maskWhenLessThan(double threshold, double replacement, bool replaceWithMissing); /** * Mask local data when values are <= threshold * @param[in] threshold * @param[in] replacement value to replace with * @param[in] replaceWithMissing true to replace with the misssing value */ void maskWhenLessThanOrEqual(double threshold, double replacement, bool replaceWithMissing); /** * Mask local data when values are > threshold * @param[in] threshold * @param[in] replacement value to replace with * @param[in] replaceWithMissing true to replace with the misssing value */ void maskWhenGreaterThan(double threshold, double replacement, bool replaceWithMissing); /** * Mask local data when values are >= threshold * @param[in] threshold * @param[in] replacement value to replace with * @param[in] replaceWithMissing true to replace with the misssing value */ void maskWhenGreaterThanOrEqual(double threshold, double replacement, bool replaceWithMissing); /** * Mask local data when values are missing * @param[in] replacement value to replace with when missing */ void maskWhenMissing(double replacement); /** * Mask the local data where an input mask does not have a value. * * @param[in] mask The data to use as masking * @param[in] maskValue The value to look for * @param[in] nonMaskOutputValue The value to set at points where mask not * equal to maskValue */ void maskRestrict(const RayxData &mask, const double maskValue, const double nonMaskOutputValue); /** * Mask the local data where an input mask does not have a value, * setting data there to the missing value. * * @param[in] mask The data to use as masking * @param[in] maskValue The value to look for */ void maskToMissing(const RayxData &mask, const double maskValue); /** * Where mask data = maskvalue, set data to datavalue * @param[in] mask * @param[in] maskValue * @param[in] dataValue */ void maskFilter(const RayxData &mask, double maskValue, double dataValue); /** * Where mask data < maskvalue, set data to datavalue * @param[in] mask * @param[in] maskValue * @param[in] dataValue */ void maskFilterLessThan(const RayxData &mask, double maskValue, double dataValue); /** * Where mask data = missing, set data to datavalue * @param[in] mask * @param[in] dataValue */ void maskMissingFilter(const RayxData &mask, double dataValue); /** * Modify data whenever mask data < threshold, set to dataValue or missing * @param[in] mask The mask data * @param[in] thresh The mask threshold * @param[in] dataValue replacement data value * @param[in] replaceWithMissing True to replace with data missing value * when condition is satified */ void modifyWhenMaskLessThan(const RayxData &mask, double thresh, double dataValue, bool replaceWithMissing); /** * Modify data whenever mask data <= threshold, set to dataValue or missing * @param[in] mask The mask data * @param[in] thresh The mask threshold * @param[in] dataValue replacement data value * @param[in] replaceWithMissing True to replace with data missing value * when condition is satified */ void modifyWhenMaskLessThanOrEqual(const RayxData &mask, double thresh, double dataValue, bool replaceWithMissing); /** * Modify data whenever mask data > threshold, set to dataValue or missing * @param[in] mask The mask data * @param[in] thresh The mask threshold * @param[in] dataValue replacement data value * @param[in] replaceWithMissing True to replace with data missing value * when condition is satified */ void modifyWhenMaskGreaterThan(const RayxData &mask, double thresh, double dataValue, bool replaceWithMissing); /** * Modify data whenever mask data >= threshold, set to dataValue or missing * @param[in] mask The mask data * @param[in] thresh The mask threshold * @param[in] dataValue replacement data value * @param[in] replaceWithMissing True to replace with data missing value * when condition is satified */ void modifyWhenMaskGreaterThanOrEqual(const RayxData &mask, double thresh, double dataValue, bool replaceWithMissing); /** * Modify data whenever mask data is missing, set to dataValue or missing * @param[in] mask The mask data * @param[in] dataValue replacement data value * @param[in] replaceWithMissing True to replace with data missing value * when condition is satified */ void modifyWhenMaskMissing(const RayxData &mask, double dataValue, bool replaceWithMissing); /** * Apply a fuzzy function to remap the data at each point * @param[in] f Fuzzy function * * At each point i d[i] = f(d[i]) */ void fuzzyRemap(const RadxFuzzyF &f); /** * Apply a 2 dimensional fuzzy function to remap the data at each point * The local data is 'x', the input data is 'y' in the fuzzy remap * * @param[in] f Fuzzy function of two variables * @param[in] y Second dataset in the 2nd dimension * * At each point i x[i] = f(x[i], y[i]) */ void fuzzy2dRemap(const RadxFuzzy2d &f, const RayxData &y); /** * Convert from db to linear units */ void db2linear(void); /** * Convert from linear to db units */ void linear2db(void); /** * Remap input ray using a gaussian function of two variables, with the other * variable stored in input ray y. * * At each ray point set output value to: * 1.0 - exp(-scale*(x*xfactor + y*yfactor)), where x and y may or may not be absolute * values of input based on the the absX and absY settings * * @param[in] y The second variable * @param[in] xfactor For the equation * @param[in] yfactor For the equation * @param[in] absX If true absolute value of x goes into the equation * @param[in] absY If true absolute value of y goes into the equation * @param[in] scale For the equation */ void gaussian2dRemap(const RayxData &y, const double xfactor, const double yfactor, const bool absX, const bool absY, const double scale); /** * At each ray point, if value = V, set output value to: * exp(-scale*(V/topv - lowv/topv)^2). * If invert = true set the output value to * 1 - exp(-scale*(V/topv - lowv/topv)^2). * * @param[in] scale For the equation * @param[in] topv * @param[in] lowv * @param[in] invert True to subtract result from 1 */ void qscale(double scale, double topv, double lowv, bool invert); /** * At each ray point, if value = V, set output value to: * exp(-scale*(V)) * If invert = true set the output value to * 1 - exp(-scale*(V)) * * @param[in] scale For the equation * @param[in] invert True to subtract result from 1 */ void qscale1(double scale, bool invert); /** * Set data to 1.0/data */ void invert(void); /** * Set data to sqrt */ void squareRoot(void); /** * Set data to log10 of data */ void logBase10(void); /** * FIR filter edge extension techniques */ typedef enum { FIR_EDGE_CLOSEST, FIR_EDGE_MIRROR, FIR_EDGE_MEAN, FIR_EDGE_INTERP } FirFilter_t; /** * Apply FIR (finite impulse response) filter to a beam * @param[in] coeff The filter coefficients, with output index * assumed at the center coefficient point, which implies * an odd number of coefficients. Warning given if even. * @param[in] type When the range of values extends outside the range of * valid data, one of several techniques is used to extend * the data so the filter can be applied. * @param[out] quality A measure of quality for each point in the beam * * If there are any problems, no filtering is done. */ void FIRfilter(const std::vector<double> coeff, FirFilter_t type, RayxData &quality); /** * Constrain data to a range of gates, set to missing outside that range * * @param[in] minGateIndex Minimum gate index with valid data * @param[in] maxGateIndex Maximum gate index with valid data */ void constrain(int minGateIndex, int maxGateIndex); void variance(double npt, double maxPctMissing); /** * Set debugging on */ void setDebug(bool state) { _debug = state; } protected: private: std::string _name; /**< Field name */ std::string _units; /**< Units */ int _npt; /**< Number of points */ double _missing; /**< Missing data value */ std::vector<double> _data; /**< Storage for the data */ double _az; /**< Azimuth of the ray (degrees)*/ double _elev; /**< Elevation of ray (degrees) */ double _gate_spacing; /**< distance between gates (km) */ double _start_range; /**< distance to first gate (km) */ bool _debug; /**< Debugging flag */ /** * Set output at index to either input or local value if non missing. * and missing_ok = true, otherwise set output at index to missing */ void _passthrough(const RayxData &inp, const int i, const bool missing_ok); bool _isOnePointOutlier(int i, double outlierThresh) const; bool _isTwoPointOutlier(int i, double outlierThresh) const; double _FIRquality(int centerCoeff, const vector<double> &tmpData, const vector<double> &gapFilledData, int tindex); void _fillGaps(std::vector<double> &data) const; void _interp(double d0, double d1, int i0, int i1, std::vector<double> &iData) const; std::vector<double> _extendData(int i0, int i1, int centerCoeff, int nCoeff, FirFilter_t type, bool allbad0, double m0, double int0, bool allbad1, double m1, double int1) const; double _extend(int mirrorIndex, int interpIndex, int boundaryDataIndex, int otherAveIndex, FirFilter_t type, double m, double intercept, bool allbad) const; double _sumProduct(const std::vector<double> &coeff, double sumCoeff, const std::vector<double> &data, int i0) const; int _firstValidIndex(void) const; int _lastValidIndex(void) const; bool _linearRegression(int i0, int i1, int npt, bool up, double &slope, double &intercept) const; double _applyFIR(int j, int i0, int i1, int centerCoeff, FirFilter_t type, const std::vector<double> &tmpData, const std::vector<double> &gapFilledData, const std::vector<double> &coeff, double sumCoeff); double _mean(int i0, int i1) const; }; #endif
[ "dixon@ucar.edu" ]
dixon@ucar.edu
defcfccb78bca3fcf03877b37ba5db3082adb450
a21cade1dc20ad1dafae410017eee14eee45f505
/Data_structures/tree/right_view.cpp
0ddba5380490464134b2c9da67ac4d6496fe56ca
[]
no_license
pranit-yawalkar/C_plus_plus_practice
302f2ac737318dbbba95dcc52cf79ed14fa67204
f7007fe2485e359304cd5e1bc230d4cb93b784c9
refs/heads/master
2023-06-03T18:02:49.299573
2021-06-21T14:38:32
2021-06-21T14:38:32
378,959,956
2
0
null
null
null
null
UTF-8
C++
false
false
1,121
cpp
#include<bits/stdc++.h> using namespace std; class Node{ public: int data; Node* left; Node* right; Node(int val){ data = val; left = NULL; right = NULL; } }; // O(n) complexity void rightView(Node* root){ if(root==NULL) return; queue<Node*>q; q.push(root); while(!q.empty()){ int n = q.size(); for(int i=0;i<n;i++){ Node* curr = q.front(); q.pop(); if(i==0){ cout<<curr->data<<" "; } if(curr->left!=NULL){ q.push(curr->left); } if(curr->right!=NULL){ q.push(curr->right); } } } } int main(){ Node* root = new Node(15); root->left = new Node(11); root->right = new Node(18); root->left->left = new Node(10); root->left->right = new Node(13); root->right->left = new Node(17); root->right->right = new Node(20); rightView(root); return 0; }
[ "pranityawalkar10@gmail.com" ]
pranityawalkar10@gmail.com
6fe0f8d566961a8366822a66db6dc9f6b57366a8
9a3522f8e5f713bf6d59bb3177d64f5f0c3821f1
/DMOJAndWCIPEG/coci14c2p1.cpp
0140e31622852f7b5d2a3dee6ec88b41a929fd64
[]
no_license
BenjaminBLi/ccc-with-c
6cbce36ed2cf23949a8ab1a74e85f768096853d8
277428e76d45cddf854cc4213f9c97d9099d5466
refs/heads/master
2020-06-09T23:44:38.015491
2018-04-15T02:13:16
2018-04-15T02:13:16
76,123,105
8
3
null
2017-11-17T18:27:20
2016-12-10T16:08:58
C++
UTF-8
C++
false
false
1,165
cpp
#include "bits/stdc++.h" using namespace std; map<int, int> behaviour; map<int, string> flip; char line[110]; void gen(){ flip[2] = "abc"; flip[3] = "def"; flip[4] = "ghi"; flip[5] = "jkl"; flip[6] = "mno"; flip[7] = "pqrs"; flip[8] = "tuv"; flip[9] = "wxyz"; } int main(){ gen(); for(int i = 1; i <= 9; i++){ int id; scanf("%d", &id); behaviour[id] = i; } scanf(" %s", line); bool found; int prev = -1; int len = strlen(line); for(int i =0 ; i < len; i++){ char ch = line[i]; //cout << ch << endl; for(auto it : flip){ found = false; int fIdx = -1, idx = 0; for(char let : it.second){ ++idx; if(let == ch) fIdx = idx, found = true; } if(found){ if(prev == it.first){ printf("#"); } for(int i = 0; i < fIdx; i++){ printf("%d", behaviour[it.first]); } prev = it.first; break; } } } return 0; }
[ "li.benjamin.b@gmail.com" ]
li.benjamin.b@gmail.com
3f6fb08293c8337dc18862d7453f205d4383b1cb
d3bf068ac90138457dd23649736f95a8793c33ae
/AutoPFA/DlgGraphRef.h
708298e166e59d9dcf220e4586fed42a8150721e
[]
no_license
xxxmen/uesoft-AutoPFA
cab49bfaadf716de56fef8e9411c070a4b1585bc
f9169e203d3dc3f2fd77cde39c0bb9b4bdf350a6
refs/heads/master
2020-03-13T03:38:50.244880
2013-11-12T05:52:34
2013-11-12T05:52:34
130,947,910
1
2
null
null
null
null
GB18030
C++
false
false
1,725
h
#if !defined(AFX_DLGGRAPHREF_H__3BA2BC07_5CB5_4B08_B6E0_6D80D20ED815__INCLUDED_) #define AFX_DLGGRAPHREF_H__3BA2BC07_5CB5_4B08_B6E0_6D80D20ED815__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // DlgGraphRef.h : header file /* * Copyright (C), 2006,长沙优易软件公司CAE开发部 * All rights reserved. * 文件名称:DlgGraphRef.h 摘要: author : LSP */ #include "WorkSpaceRef.h" #include "BaseDlg.h" ///////////////////////////////////////////////////////////////////////////// // DlgGraphRef dialog class DlgGraphRef : public BaseDlg { // Construction public: DlgGraphRef(CWnd* pParent = NULL); // standard constructor BOOL Updata(); void Init(WorkSpaceRef &ref); // Dialog Data //{{AFX_DATA(DlgGraphRef) enum { IDD = IDD_GRAPHICSREF }; CButton m_Radio75; CButton m_Radio50; CButton m_Radio25; CComboBox m_pipeThick; CButton m_Radio100; CStatic m_Bitmap; //}}AFX_DATA private: void UnCheck(); int m_nJunSize; CBitmap m_bitmap; WorkSpaceRef *m_pWorkSpaceRef; // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(DlgGraphRef) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(DlgGraphRef) virtual BOOL OnInitDialog(); afx_msg void OnRadio25(); afx_msg void OnRadio50(); afx_msg void OnRadio75(); afx_msg void OnRadio100(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DLGGRAPHREF_H__3BA2BC07_5CB5_4B08_B6E0_6D80D20ED815__INCLUDED_)
[ "uesoft@163.com" ]
uesoft@163.com
61c471ca75f4519316b4922f4e9f292ecf61cc17
2b575a874daf99beeffc4e24290d48373068ff32
/api/ShippingsApi.h
1fa8cdb9dfd3f80252ecc404c794b8852d42e3d7
[]
no_license
facestorept/api-sdk-cpprest
669febedea1c37c79e0c793a3be06d1727aa65f4
195ab61d2099e4d6d08a2f5c59bf4b58315df5a2
refs/heads/master
2021-08-26T04:38:59.844262
2017-11-21T14:46:46
2017-11-21T14:46:46
111,561,687
0
0
null
null
null
null
UTF-8
C++
false
false
10,797
h
/** * Facestore API * This is a reference to Facestore API. # Introduction This API is documented in **OpenAPI format** and provided by [facestore.pt](http://facestore.pt) team. # About the API Through the Facestore API your applications can retrieve and manage Facestore platform content in your store. The base address of the API is `https://api.facestore.pt`. There are several endpoints at that address, each with its own unique path. All endpoints are private and you need the permissions to access them. To get an API Token you have to be client of Facestore and access your personal account to request it (see the next topic). # Get API Token To consume the Facestore API is take the unique token to identify your requests. You can do that accessing the store manager admin and doing the following steps: 1. Go to ``configurations > API`` section. 2. Copy the unique token. # Requests The API is based on REST principles: data resources are accessed via standard HTTPS requests in UTF-8 format to an API endpoint. Where possible, the API strives to use appropriate HTTP verbs for each action: | VERB | DESCRIPTION | | -------- |:-------------: | | GET | Used for retrieving resources. | | POST | Used for creating resources. | | PUT | Used for changing/replacing resources or collections. | | PATCH | Used for changing/replacing partial resources. | | DELETE | Used for deleting resources. | # Responses Response Status Codes The API uses the following response status codes, as defined in the RFC 2616 and RFC 6585: | STATUS CODE | DESCRIPTION | |:-----------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| | 200 | OK - The request has succeeded. The client can read the result of the request in the body and the headers of the response. | | 201 | Created - The request has been fulfilled and resulted in a new resource being created. | | 202 | Accepted - The request has been accepted for processing, but the processing has not been completed. | | 204 | No Content - The request has succeeded but returns no message body. | | 304 | Not Modified. See Conditional requests. | | 400 | Bad Request - The request could not be understood by the server due to malformed syntax. The message body will contain more information; see Error Details. | | 401 | Unauthorized - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials. | | 403 | Forbidden - The server understood the request, but is refusing to fulfill it. | | 404 | Not Found - The requested resource could not be found. This error can be due to a temporary or permanent condition. | | 429 | Too Many Requests - Rate limiting has been applied. | | 500 | Internal Server Error. You should never receive this error because our clever coders catch them all ... but if you are unlucky enough to get one, please report it to us through a comment at the bottom of this page. | | 502 | Bad Gateway - The server was acting as a gateway or proxy and received an invalid response from the upstream server. | | 503 | Service Unavailable - The server is currently unable to handle the request due to a temporary condition which will be alleviated after some delay. You can choose to resend the request again. | # Rate limiting To make the API fast for everybody, rate limits apply. Rate limiting is applied on an application basis (based on client id), regardless of how many users are using it. If you get status code 429, it means that you have sent too many requests. If this happens, have a look in the Retry-After header, where you will see a number displayed. This is the amount of seconds that you need to wait, before you can retry sending your requests. You can check the returned HTTP headers of any API request to see your current rate limit status: ``` curl -i https://api.facestore.pt/v1/sample HTTP/1.1 200 OK Date: Mon, 01 Dec 2016 17:27:06 GMT Status: 200 OK X-RateLimit-Limit: 60 X-RateLimit-Remaining: 56 X-RateLimit-Reset: 1372700873 ``` The headers tell you everything you need to know about your current rate limit status: | HEADER NAME | DESCRIPTION | |:---------------------:|:-------------------------------------------------------------------------------:| | X-RateLimit-Limit | The maximum number of requests that the consumer is permitted to make per hour. | | X-RateLimit-Remaining | The number of requests remaining in the current rate limit window. | | X-RateLimit-Reset | The time at which the current rate limit window resets in UTC epoch seconds. | # Timestamps Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an product is created), an additional field will show the precision; see for example, created_at in an product object. # Error Details The API uses the following format to describe unsuccessful responses, return information about the error as an error JSON object containing the following information:: | KEY | VALUE TYPE | VALUE DESCRIPTION | |:-----------:|:------------:|:-----------------:| | status_code | integer | The HTTP status code (also returned in the response header; see Response Status Codes for more information). | | message | string | A short description of the cause of the error. | * * OpenAPI spec version: 0.1.4 * Contact: apihelp@facestore.pt * * NOTE: This class is auto generated by the swagger code generator 3.0.0-SNAPSHOT. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ /* * ShippingsApi.h * * */ #ifndef IO_SWAGGER_CLIENT_API_ShippingsApi_H_ #define IO_SWAGGER_CLIENT_API_ShippingsApi_H_ #include "ApiClient.h" #include "Inline_response_200_3.h" #include "Inline_response_201_3.h" #include "Object.h" #include "Shipping.h" #include <cpprest/details/basic_types.h> namespace io { namespace swagger { namespace client { namespace api { using namespace io::swagger::client::model; class ShippingsApi { public: ShippingsApi( std::shared_ptr<ApiClient> apiClient ); virtual ~ShippingsApi(); /// <summary> /// /// </summary> /// <remarks> /// Creates a new shipping in the store. /// </remarks> /// <param name="shipping">Shipping to add to the store</param> pplx::task<std::shared_ptr<Inline_response_201_3>> addShipping(std::shared_ptr<Shipping> shipping); /// <summary> /// /// </summary> /// <remarks> /// deletes a single shipping based on the ID supplied /// </remarks> /// <param name="id">ID of shipping to delete</param> pplx::task<void> deleteShippingById(int64_t id); /// <summary> /// /// </summary> /// <remarks> /// Returns a shipping based on a single ID /// </remarks> /// <param name="id">ID of shipping to fetch</param>/// <param name="limit">max records to return (optional)</param> pplx::task<std::shared_ptr<Inline_response_201_3>> getShippingById(int64_t id, int32_t limit); /// <summary> /// /// </summary> /// <remarks> /// Returns all shippings from the system that the user has access to /// </remarks> /// <param name="includes">Include associated objects within response (optional)</param>/// <param name="limit">max records to return (optional)</param>/// <param name="orderBy">Specify the field to be sorted, examples: - &#x60;?order_by&#x3D;id|desc&#x60; - &#x60;?order_by&#x3D;updated_at|desc,position|asc&#x60; (optional)</param> pplx::task<std::shared_ptr<Inline_response_200_3>> getShippings(std::vector<utility::string_t> includes, int32_t limit, std::vector<utility::string_t> orderBy); /// <summary> /// /// </summary> /// <remarks> /// update a single shipping based on the ID supplied /// </remarks> /// <param name="id">ID of shipping to update</param>/// <param name="tax">Shipping to update in store</param> pplx::task<std::shared_ptr<Inline_response_201_3>> updateShippingById(int64_t id, std::shared_ptr<Shipping> tax); /// <summary> /// /// </summary> /// <remarks> /// update a single shipping based on the ID supplied /// </remarks> /// <param name="id">ID of shipping to update</param>/// <param name="tax">Shipping to update in store</param> pplx::task<std::shared_ptr<Inline_response_201_3>> updateShippingById_0(int64_t id, std::shared_ptr<Shipping> tax); protected: std::shared_ptr<ApiClient> m_ApiClient; }; } } } } #endif /* IO_SWAGGER_CLIENT_API_ShippingsApi_H_ */
[ "luciano.goncalves@facestore.pt" ]
luciano.goncalves@facestore.pt
549cda4a8399ab02397dae3f862061a38873be6d
0958cceb81de1c7ee74b0c436b800a1dc54dd48a
/wincewebkit/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
25729f9de237087e9f4bc3e74d5b0abec991c302
[ "BSD-2-Clause" ]
permissive
datadiode/WinCEWebKit
3586fac69ba7ce9efbde42250266ddbc5c920c5e
d331d103dbc58406ed610410736b59899d688632
refs/heads/master
2023-03-15T23:47:30.374484
2014-08-14T14:41:13
2014-08-14T14:41:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
17,544
cpp
/* * Copyright (C) 2008 Jan Michael C. Alonzo * Copyright (C) 2009 Igalia S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "config.h" #include "webkitwebbackforwardlist.h" #include "BackForwardListImpl.h" #include "HistoryItem.h" #include "webkitprivate.h" #include "webkitwebhistoryitem.h" #include "webkitwebview.h" #include <glib.h> /** * SECTION:webkitwebbackforwardlist * @short_description: The history of a #WebKitWebView * @see_also: #WebKitWebView, #WebKitWebHistoryItem * * <informalexample><programlisting> * /<!-- -->* Get the WebKitWebBackForwardList from the WebKitWebView *<!-- -->/ * WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view); * WebKitWebHistoryItem *item = webkit_web_back_forward_list_get_current_item (back_forward_list); * * /<!-- -->* Do something with a WebKitWebHistoryItem *<!-- -->/ * g_print("%p", item); * * /<!-- -->* Control some parameters *<!-- -->/ * WebKitWebBackForwardList *back_forward_list = webkit_web_view_get_back_forward_list (my_web_view); * webkit_web_back_forward_list_set_limit (back_forward_list, 30); * </programlisting></informalexample> * */ using namespace WebKit; struct _WebKitWebBackForwardListPrivate { WebCore::BackForwardListImpl* backForwardList; gboolean disposed; }; #define WEBKIT_WEB_BACK_FORWARD_LIST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, WebKitWebBackForwardListPrivate)) G_DEFINE_TYPE(WebKitWebBackForwardList, webkit_web_back_forward_list, G_TYPE_OBJECT); static void webkit_web_back_forward_list_dispose(GObject* object) { WebKitWebBackForwardList* list = WEBKIT_WEB_BACK_FORWARD_LIST(object); WebCore::BackForwardListImpl* backForwardList = core(list); WebKitWebBackForwardListPrivate* priv = list->priv; if (!priv->disposed) { priv->disposed = true; WebCore::HistoryItemVector items = backForwardList->entries(); GHashTable* table = webkit_history_items(); for (unsigned i = 0; i < items.size(); i++) g_hash_table_remove(table, items[i].get()); } G_OBJECT_CLASS(webkit_web_back_forward_list_parent_class)->dispose(object); } static void webkit_web_back_forward_list_class_init(WebKitWebBackForwardListClass* klass) { GObjectClass* object_class = G_OBJECT_CLASS(klass); object_class->dispose = webkit_web_back_forward_list_dispose; webkit_init(); g_type_class_add_private(klass, sizeof(WebKitWebBackForwardListPrivate)); } static void webkit_web_back_forward_list_init(WebKitWebBackForwardList* webBackForwardList) { webBackForwardList->priv = WEBKIT_WEB_BACK_FORWARD_LIST_GET_PRIVATE(webBackForwardList); } /** * webkit_web_back_forward_list_new_with_web_view: (skip) * @web_view: the back forward list's #WebKitWebView * * Creates an instance of the back forward list with a controlling #WebKitWebView * * Return value: a #WebKitWebBackForwardList * * Deprecated: 1.3.4: Instances of #WebKitWebBackForwardList are * created and owned by #WebKitWebView instances only. */ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL); WebKitWebBackForwardList* webBackForwardList; webBackForwardList = WEBKIT_WEB_BACK_FORWARD_LIST(g_object_new(WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, NULL)); WebKitWebBackForwardListPrivate* priv = webBackForwardList->priv; priv->backForwardList = static_cast<WebCore::BackForwardListImpl*>(core(webView)->backForwardList()); priv->backForwardList->setEnabled(TRUE); return webBackForwardList; } /** * webkit_web_back_forward_list_go_forward: * @web_back_forward_list: a #WebKitWebBackForwardList * * Steps forward in the back forward list */ void webkit_web_back_forward_list_go_forward(WebKitWebBackForwardList* webBackForwardList) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (backForwardList->enabled()) backForwardList->goForward(); } /** * webkit_web_back_forward_list_go_back: * @web_back_forward_list: a #WebKitWebBackForwardList * * Steps backward in the back forward list */ void webkit_web_back_forward_list_go_back(WebKitWebBackForwardList* webBackForwardList) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (backForwardList->enabled()) backForwardList->goBack(); } /** * webkit_web_back_forward_list_contains_item: * @web_back_forward_list: a #WebKitWebBackForwardList * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to check * * Checks if @web_history_item is in the back forward list * * Return value: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't */ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), FALSE); g_return_val_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem), FALSE); WebCore::HistoryItem* historyItem = core(webHistoryItem); g_return_val_if_fail(historyItem != NULL, FALSE); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); return (backForwardList->enabled() ? backForwardList->containsItem(historyItem) : FALSE); } /** * webkit_web_back_forward_list_go_to_item: * @web_back_forward_list: a #WebKitWebBackForwardList * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to go to * * Go to the specified @web_history_item in the back forward list */ void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); g_return_if_fail(WEBKIT_IS_WEB_HISTORY_ITEM(webHistoryItem)); WebCore::HistoryItem* historyItem = core(webHistoryItem); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (backForwardList->enabled() && historyItem) backForwardList->goToItem(historyItem); } /** * webkit_web_back_forward_list_get_forward_list_with_limit: * @web_back_forward_list: a #WebKitWebBackForwardList * @limit: the number of items to retrieve * * Returns a list of items that succeed the current item, limited by @limit * * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items succeeding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return NULL; WebCore::HistoryItemVector items; GList* forwardItems = { 0 }; backForwardList->forwardListWithLimit(limit, items); for (unsigned i = 0; i < items.size(); i++) { WebKitWebHistoryItem* webHistoryItem = kit(items[i]); forwardItems = g_list_prepend(forwardItems, webHistoryItem); } return forwardItems; } /** * webkit_web_back_forward_list_get_back_list_with_limit: * @web_back_forward_list: a #WebKitWebBackForwardList * @limit: the number of items to retrieve * * Returns a list of items that precede the current item, limited by @limit * * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items preceding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return NULL; WebCore::HistoryItemVector items; GList* backItems = { 0 }; backForwardList->backListWithLimit(limit, items); for (unsigned i = 0; i < items.size(); i++) { WebKitWebHistoryItem* webHistoryItem = kit(items[i]); backItems = g_list_prepend(backItems, webHistoryItem); } return backItems; } /** * webkit_web_back_forward_list_get_back_item: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the item that precedes the current item * * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem preceding the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return NULL; WebCore::HistoryItem* historyItem = backForwardList->backItem(); return (historyItem ? kit(historyItem) : NULL); } /** * webkit_web_back_forward_list_get_current_item: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the current item. * * Returns a NULL value if the back forward list is empty * * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return NULL; WebCore::HistoryItem* historyItem = backForwardList->currentItem(); return (historyItem ? kit(historyItem) : NULL); } /** * webkit_web_back_forward_list_get_forward_item: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the item that succeeds the current item. * * Returns a NULL value if there nothing that succeeds the current item * * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return NULL; WebCore::HistoryItem* historyItem = backForwardList->forwardItem(); return (historyItem ? kit(historyItem) : NULL); } /** * webkit_web_back_forward_list_get_nth_item: * @web_back_forward_list: a #WebKitWebBackForwardList * @index: the index of the item * * Returns the item at a given index relative to the current item. * * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem located at the specified index relative to the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_nth_item(WebKitWebBackForwardList* webBackForwardList, gint index) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList) return NULL; WebCore::HistoryItem* historyItem = backForwardList->itemAtIndex(index); return (historyItem ? kit(historyItem) : NULL); } /** * webkit_web_back_forward_list_get_back_length: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the number of items that preced the current item. * * Return value: a #gint corresponding to the number of items preceding the current item */ gint webkit_web_back_forward_list_get_back_length(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return 0; return backForwardList->backListCount(); } /** * webkit_web_back_forward_list_get_forward_length: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the number of items that succeed the current item. * * Return value: a #gint corresponding to the nuber of items succeeding the current item */ gint webkit_web_back_forward_list_get_forward_length(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return 0; return backForwardList->forwardListCount(); } /** * webkit_web_back_forward_list_get_limit: * @web_back_forward_list: a #WebKitWebBackForwardList * * Returns the maximum limit of the back forward list. * * Return value: a #gint indicating the number of #WebKitWebHistoryItem the back forward list can hold */ gint webkit_web_back_forward_list_get_limit(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), 0); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled()) return 0; return backForwardList->capacity(); } /** * webkit_web_back_forward_list_set_limit: * @web_back_forward_list: a #WebKitWebBackForwardList * @limit: the limit to set the back forward list to * * Sets the maximum limit of the back forward list. If the back forward list * exceeds its capacity, items will be removed everytime a new item has been * added. */ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (backForwardList) backForwardList->setCapacity(limit); } /** * webkit_web_back_forward_list_add_item: * @web_back_forward_list: a #WebKitWebBackForwardList * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to add * * Adds the item to the #WebKitWebBackForwardList. * * The @webBackForwardList will add a reference to the @webHistoryItem, so you * don't need to keep a reference once you've added it to the list. * * Since: 1.1.1 */ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForwardList, WebKitWebHistoryItem *webHistoryItem) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); g_object_ref(webHistoryItem); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); WebCore::HistoryItem* historyItem = core(webHistoryItem); backForwardList->addItem(historyItem); } /** * webkit_web_back_forward_list_clear: * @web_back_forward_list: the #WebKitWebBackForwardList to be cleared * * Clears the @webBackForwardList by removing all its elements. Note that not even * the current page is kept in list when cleared so you would have to add it later. * * Since: 1.3.1 **/ void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForwardList) { g_return_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList)); WebCore::BackForwardListImpl* backForwardList = core(webBackForwardList); if (!backForwardList || !backForwardList->enabled() || !backForwardList->entries().size()) return; // Clear the current list by setting capacity to 0 int capacity = backForwardList->capacity(); backForwardList->setCapacity(0); backForwardList->setCapacity(capacity); } WebCore::BackForwardListImpl* WebKit::core(WebKitWebBackForwardList* webBackForwardList) { g_return_val_if_fail(WEBKIT_IS_WEB_BACK_FORWARD_LIST(webBackForwardList), NULL); return webBackForwardList->priv ? webBackForwardList->priv->backForwardList : 0; }
[ "achellies@163.com" ]
achellies@163.com
b9d50ea4195e4877c4361dbab4098f401cad3a4e
c415b67b1c6585eadc5cb1b110af401b0e3efc29
/cpp/TopologySort/Basic.cpp
5b038aa6adb40193da145c842d9e1e8ece998644
[]
no_license
ASHD27/algorithmBasic
6eab42feeffadeafc126cb8c67a268749897cf16
0a6519466a2ddba2425388a7bd93824454bb80ed
refs/heads/master
2022-12-24T01:15:49.848226
2020-10-01T04:55:21
2020-10-01T04:55:21
300,148,572
0
0
null
2020-10-01T04:55:32
2020-10-01T04:55:31
null
UTF-8
C++
false
false
4,445
cpp
/* Topology Sort (위상 정렬) 위상 정렬이란 순서가 정해져 있는 작업을 차례로 수행해야 할 때, 그 순서를 결정해주기 위해 사용하는 알고리즘을 말한다. 위상정렬은 순서를 결정해주는 알고리즘으로 꼭 하나의 순서만 존재하는 것은 아님 다른 방식의 순서가 존재할 수 있다. 위상정렬의 특징은 DAG(Directed Acyclic Graph) 에만 적용이 가능하다 DAG 란 용어를 보면 알겠지만, 방향성이 존재하지만 cycle 은 존재하지 않는 그래프 에서만 적용이 가능하다. 중요한 것은 "사이클이 존재하면 위상 정렬을 수행할 수 없다는 것이다." 사이클이 발생하면 시작점이 존재하지 않기 때문임 위상 정렬 알고리즘은 두가지 답을 제시하는데 현재 그래프가 위상 정렬이 가능한가? 가능한 경우 그 결과가 어떻게 되는가? 이다 위상정렬을 구현할 때는 스택 또는 큐를 이용해서 구현하며 여기 코드에서는 큐를 사용해서 구현함 위상 정렬을 사용할 때 '진입 차수' 라는 개념이 등장하는데 이 진입차수란 어떤 노드를 가기 위해서 이전에 거쳐가야할 필요성이 있는 노드의 총 갯수가 몇개냐를 의미함 나동빈 블로그 보면 6번 노드가 4번과 5번 노드와 연결되었음을 볼 수 있음 그래서 6번 노드의 차수는 2임 위상정렬의 정렬법은 아래의 4가지 수행을 따름 1. 진입차수가 0인 정점을 큐에 삽입 (초기 수행시 당연히 시작 노드가 될 것) 2. 큐에서 원소를 꺼내서 연결된 모든 간선을 제거함 3. 간선 제거 이후에 진입 차수가 0이 된 정점을 큐에 삽입함. 4. 큐가 empty 가 될 때 까지 2,3 번의 과정을 반복한다. 만약 4번 하는 중에 모든 원소를 방문 하기도 전에 큐가 비어 있다면 사이클이 존재한다는 것이며, 모든 원소를 방문 했다면 큐에서 꺼낸 순서가 위상 정렬의 결과가 된다. */ #include <iostream> #include <vector> #include <queue> #define MAX 10 using namespace std; int n, inDegree[MAX]; // n 은 전체 노드 수, inDegree 는 진입 차수를 담고 있는 배열 vector<int> a[MAX]; // 벡터에 배열을 붙이면 2차원 배열이랑 똑같다 // a 배열은 인접 행렬과 동일한 의미를 갖는다 // a[1] 은 노드 1 이 연결된 노드가 무엇들이 있는지 알려줌 void topologySort() { int result[MAX]; // result 는 위상정렬을 한 이후 노드 순서 결과를 담는 배열 queue<int> q; // 노드 번호를 넣을 큐 for (int i = 1; i <= n; i++) { if (inDegree[i] == 0) q.push(i); // 진입 차수가 0 일 때 큐에 넣음 } for (int i = 1; i <= n; i++) { // 위상 정렬이 전부 수행되려면 n 개의 노드 전부를 탐색해야함 if (q.empty()) { // n 개의 노드를 전부 방문하기도 전에 queue 가 비어 있다면 // 사이클이 있다는 뜻 printf("사이클이 발생"); return; } int x = q.front(); // 큐의 맨 앞 원소를 담고 q.pop(); // 큐에서 원소를 뺌 result[i] = x; // 큐에서 얻은 원소를 결과 배열에 넣는다. for (int i = 0; i < a[x].size(); i++) // 인접행렬을 돌림 { int y = a[x][i]; // 연결된 노드의 번호를 가져옴 if (--inDegree[y] == 0) // 진입차수를 줄여서 0이 되면 { q.push(y); // 큐에 삽입 } } } for (int i = 1; i <= n; i++) { printf("%d ", result[i]); } } int main() { n = 7; a[1].push_back(2); inDegree[2]++; a[1].push_back(5); inDegree[5]++; a[2].push_back(3); inDegree[3]++; a[3].push_back(4); inDegree[4]++; a[4].push_back(6); inDegree[6]++; a[5].push_back(6); inDegree[6]++; a[6].push_back(7); inDegree[7]++; topologySort(); return 0; } /* 참고로 위상 정렬의 시간 복잡도는 O(V + E) 라고 한다 V 는 정점의 갯수 E 는 간선의 값을 의미한다 */
[ "vel1024@khu.ac.kr" ]
vel1024@khu.ac.kr
80f0ea927d9000b01775c949b9522d8d19bd5c56
30f530277d108cb1901b54a633acf9bdac8eaef3
/inc/obj/Material.h
78a41524edb1575acc13e26f0468141c24935ec6
[]
no_license
davtwal/gproj
26781ff8fb5a09250bdd52d5a04efd6d6dc73ab8
389fda53d5994776540aee210cda3e2fe5fd13d5
refs/heads/master
2020-06-25T19:07:47.298231
2020-02-27T04:13:32
2020-02-27T04:13:32
199,397,402
0
0
null
null
null
null
UTF-8
C++
false
false
3,204
h
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // * gproj : Material.h // * Copyright (C) DigiPen Institute of Technology 2019 // * // * Created : 2019y 11m 04d // * Last Altered: 2019y 11m 04d // * // * Author : David Walker // * E-mail : d.walker\@digipen.edu // * // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // * Description : #ifndef DW_MATERIAL_H #define DW_MATERIAL_H #include "render/Image.h" #include "render/Buffer.h" #include "render/Texture.h" #include "util/Utils.h" #include "util/MyMath.h" #include "tiny_obj_loader.h" #include <unordered_map> #include <array> namespace dw { class Renderer; class CommandBuffer; class Material { public: Material() = default; ~Material() = default; MOVE_CONSTRUCT_ONLY(Material); static constexpr unsigned MTL_MAP_COUNT = 4; NO_DISCARD uint32_t getID() const; // struct MaterialUBO { alignas(16) glm::vec3 kd; alignas(16) glm::vec3 ks; alignas(04) float metallic; alignas(04) float roughness; alignas(04) int hasAlbedo; alignas(04) int hasNormal; alignas(04) int hasMetallic; alignas(04) int hasRoughness; }; NO_DISCARD MaterialUBO getAsUBO() const { return { m_kd, m_ks, m_metallic, m_roughness, m_useMap[0],//m_textures[0] != nullptr, m_useMap[1],//m_textures[1] != nullptr, m_useMap[2],//m_textures[2] != nullptr, m_useMap[3]//m_textures[3] != nullptr, }; } NO_DISCARD std::array<util::ptr<Texture>, MTL_MAP_COUNT> const& getTextures() const; NO_DISCARD util::ptr<Texture> getTexture(size_t i) const; private: friend class MaterialManager; class RawImage { public: RawImage() = default; ~RawImage(); MOVE_CONSTRUCT_ONLY(RawImage); void Load(std::string const& filename); uint64_t m_width{ 0 }; uint64_t m_height{ 0 }; uint64_t m_channels{ 0 }; uint64_t m_bitsPerChannel{ 0 }; unsigned char* m_raw{ nullptr }; }; //std::vector<RawImage> m_raws; //std::vector<DependentImage> m_images; //std::vector<ImageView> m_views; std::array<util::ptr<Texture>, MTL_MAP_COUNT> m_textures; std::array<bool, MTL_MAP_COUNT> m_useMap; glm::vec3 m_kd {1}; glm::vec3 m_ks { 1 }; float m_metallic{ 1 }; float m_roughness{ 1 }; uint32_t m_id{ 0 }; }; class MaterialManager { public: static constexpr const char* DEFAULT_MTL_NAME = "default"; static constexpr const char* SKYBOX_MTL_NAME = "skybox"; MaterialManager(TextureManager& textureStorage); using MtlKey = std::string; using MtlMap = std::unordered_map<MtlKey, util::ptr<Material>>; MtlKey load(tinyobj::material_t const& mtl); NO_DISCARD util::ptr<Material> getMtl(MtlKey key); NO_DISCARD util::ptr<Material> getDefaultMtl(); NO_DISCARD util::ptr<Material> getSkyboxMtl(); void clear(); void uploadMaterials(Renderer& renderer); MtlMap const& getMaterials() const; private: TextureManager& m_textureStorage; MtlMap m_loadedMtls; uint32_t m_curID {0}; }; } #endif
[ "davtwal@gmail.com" ]
davtwal@gmail.com
4664d716958f896255cafae718723b471b38afcd
70e426a976da6c4ba9cb8e74ee63c8e5ada57f75
/bullet/GameManager.h
5f533618514d8dbea98899120dbc2c8c79447d48
[]
no_license
Roxasispoor/bullethell
4b6c0e6538df5e09c2f2873361e6161a2fba5ec1
4eba170226a4765175d3e6e7a6f7cc5ccb2bb3f0
refs/heads/master
2021-07-17T17:02:49.943632
2018-11-10T10:02:22
2018-11-10T10:02:22
135,216,120
0
0
null
null
null
null
UTF-8
C++
false
false
1,305
h
#pragma once #include "Body.h" #include "Character.h" #include <vector> #include "Ennemy.h" #include "Player.h" #include <chrono> #include "MyContactListenner.h" #include "const.h" class GameManager { public: GameManager(); void mainLoop(); void render(double timeOnNextFrame); void createPatternsFromXml(std::string patternsFile); b2World& getWorld() { return world; }; std::vector<Pattern>& getPatternsPossibles() { return patternsPossibles; }; std::map<std::string, sf::Texture>& getTextureMap(){ return textureMap; }; std::vector<Player>& getJoueurs() { return joueurs; }; std::vector<Ennemy>& getEnnemisPossibles(){return ennemisPossibles; }; std::vector<Ennemy>& getEnnemisEnVie() { return ennemisEnVie; }; MyContactListener& getListenner() { return listenner; }; private: std::map<std::string, std::string> aliasFichierNames = { {"../joueur.png","joueur"},{"../bullets.png","bullet"},{ "../laser.png","laser"},{"../ghostmaiden.png","ghostmaiden"} }; b2World world; std::vector<Pattern> patternsPossibles; std::map<std::string, sf::Texture> textureMap; std::vector<Player> joueurs; std::vector<Ennemy> ennemisPossibles; std::vector<Ennemy> ennemisEnVie; b2Vec2 gravity; //nogravity MyContactListener listenner; sf::RenderWindow window; bool doSleep = true; };
[ "manzanoalban@gmail.com" ]
manzanoalban@gmail.com
5c1db353ff7ce9a8887894d4fd2459273cd92d30
5742956215201e4558bdeaf272d42ab3f39ad7bc
/src/cetech/gfx/private/debugdraw.cpp
81f10295507a284b9d0327f19e113cd1c68937ce
[ "CC0-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
qipa/cetech
8fcdd677f241d16285034125706d398a8022d3c7
6a06291498c38e67607c29369c6e4f56f70a5f8f
refs/heads/master
2020-04-05T19:48:46.705757
2018-11-11T20:01:03
2018-11-11T20:01:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,641
cpp
extern "C" { #include <celib/bounds.h> #include "celib/api_system.h" #include "celib/module.h" #include "celib/memory.h" #include <celib/hashlib.h> #include <celib/array.inl> #include <celib/log.h> #include <cetech/gfx/renderer.h> #include <cetech/gfx/debugdraw.h> } #include <cetech/gfx/private/debugdraw/debugdraw.h> #define _G DebugDrawGLobal static struct _G { ce_alloc *allocator; } _G; static ct_dd_sprite _ddCreateSprite(uint16_t _width, uint16_t _height, const void *_data) { return {.idx = ddCreateSprite(_width, _height, _data).idx}; } static void _ddDestroySprite(ct_dd_sprite _handle) { SpriteHandle sh = {.idx=_handle.idx}; ddDestroy(sh); } static ct_dd_geometry _ddCreateGeometry(uint32_t _numVertices, const ct_dd_vertex *_vertices, uint32_t _numIndices = 0, const uint16_t *_indices = NULL) { return {.idx=ddCreateGeometry( _numVertices, reinterpret_cast<const DdVertex *>(_vertices), _numIndices, _indices).idx}; } static void _ddDestroyGeometry(ct_dd_geometry _handle) { GeometryHandle gh = {.idx=_handle.idx}; ddDestroy(gh); } void _ddDraw_aabb(const struct ce_aabb _aabb) { Aabb *aabb = (Aabb *) &_aabb; ddDraw(*aabb); }; void _ddDraw_cylinder(const struct ce_cylinder _cylinder) { Cylinder *tmp = (Cylinder *) &_cylinder; ddDraw(*tmp); } void _ddDraw_capsule(const struct ce_capsule _capsule) { Capsule *tmp = (Capsule *) &_capsule; ddDraw(*tmp); } void _ddDraw_disk(const struct ce_disk _disk) { Disk *tmp = (Disk *) &_disk; ddDraw(*tmp); } void _ddDraw_obb(const struct ce_obb _obb) { Obb *tmp = (Obb *) &_obb; ddDraw(*tmp); } void _ddDraw_sphere(const struct ce_sphere _sphere) { Sphere *tmp = (Sphere *) &_sphere; ddDraw(*tmp); } void _ddDraw_cone(const struct ce_cone _cone) { Cone *tmp = (Cone *) &_cone; ddDraw(*tmp); } void _ddDraw_handle(ct_dd_geometry _handle) { GeometryHandle gh = {.idx = _handle.idx}; ddDraw(gh); } void _ddDrawArc(ct_dd_axis _axis, float _x, float _y, float _z, float _radius, float _degrees) { Axis::Enum a = static_cast<Axis::Enum>(_axis); ddDrawArc(a, _x, _y, _z, _radius, _degrees); } void _ddDrawCircle_axis(ct_dd_axis _axis, float _x, float _y, float _z, float _radius, float _weight = 0.0f) { Axis::Enum a = static_cast<Axis::Enum>(_axis); ddDrawCircle(a, _x, _y, _z, _radius, _weight); } void _ddDrawQuad_sprite(ct_dd_sprite _handle, const float *_normal, const float *_center, float _size) { SpriteHandle sh = {.idx = _handle.idx}; ddDrawQuad(sh, _normal, _center, _size); } void _ddDrawQuad_texture(ct_render_texture_handle _handle, const float *_normal, const float *_center, float _size) { bgfx::TextureHandle th = {.idx = _handle.idx}; ddDrawQuad(th, _normal, _center, _size); } void _ddDrawAxis(float _x, float _y, float _z, float _len, ct_dd_axis _highlight, float _thickness) { Axis::Enum a = static_cast<Axis::Enum>(_highlight); ddDrawAxis(_x, _y, _z, _len, a, _thickness); } void _ddDrawGrid_axis(ct_dd_axis _axis, const void *_center, uint32_t _size = 20, float _step = 1.0f) { Axis::Enum a = static_cast<Axis::Enum>(_axis); ddDrawGrid(a, _center, _size, _step); } void _ddDrawOrb(float _x, float _y, float _z, float _radius, ct_dd_axis _highlight) { ddDrawOrb(_x, _y, _z, _radius, static_cast<Axis::Enum>(_highlight)); } void _ddDrawLineList(uint32_t _numVertices, const ct_dd_vertex *_vertices, uint32_t _numIndices = 0, const uint16_t *_indices = NULL) { ddDrawLineList(_numVertices, reinterpret_cast<const DdVertex *>(_vertices), _numIndices, _indices); } void _ddDrawTriList(uint32_t _numVertices, const ct_dd_vertex *_vertices, uint32_t _numIndices = 0, const uint16_t *_indices = NULL) { ddDrawTriList(_numVertices, reinterpret_cast<const DdVertex *>(_vertices), _numIndices, _indices); } static struct ct_dd_a0 debugdraw_api = { .begin = ddBegin, .end = ddEnd, .push = ddPush, .pop = ddPop, .set_state = ddSetState, .set_color = ddSetColor, .set_lod = ddSetLod, .set_wireframe = ddSetWireframe, .set_stipple = ddSetStipple, .set_spin = ddSetSpin, .set_transform_mtx = ddSetTransform, .set_translate = ddSetTranslate, .move_to = ddMoveTo, .move_to_pos = ddMoveTo, .line_to = ddLineTo, .line_to_pos = ddLineTo, .close = ddClose, .draw_frustum = ddDrawFrustum, .draw_circle = ddDrawCircle, .draw_quad = ddDrawQuad, .draw_cone2 = ddDrawCone, .draw_cylinder2 = ddDrawCylinder, .draw_capsule2 = ddDrawCapsule, .draw_grid = ddDrawGrid, .create_sprite = _ddCreateSprite, .destroy_sprite = _ddDestroySprite, .create_geometry = _ddCreateGeometry, .destroy_geometry = _ddDestroyGeometry, .draw_aabb = _ddDraw_aabb, .draw_cylinder = _ddDraw_cylinder, .draw_capsule = _ddDraw_capsule, .draw_disk = _ddDraw_disk, .draw_obb = _ddDraw_obb, .draw_sphere = _ddDraw_sphere, .draw_cone = _ddDraw_cone, .draw_geometry = _ddDraw_handle, .draw_line_list = _ddDrawLineList, .draw_tri_list = _ddDrawTriList, .draw_arc = _ddDrawArc, .draw_axis = _ddDrawAxis, .draw_circle_axis = _ddDrawCircle_axis, .draw_quad_sprite = _ddDrawQuad_sprite, .draw_quad_texture = _ddDrawQuad_texture, .draw_grid_axis = _ddDrawGrid_axis, .draw_orb = _ddDrawOrb, }; struct ct_dd_a0 *ct_dd_a0 = &debugdraw_api; static void _init(struct ce_api_a0 *api) { api->register_api("ct_dd_a0", &debugdraw_api); _G = (struct _G){ .allocator = ce_memory_a0->system }; ddInit(); } static void _shutdown() { ddShutdown(); _G = (struct _G){}; } CE_MODULE_DEF( debugdraw, { CE_INIT_API(api, ce_memory_a0); CE_INIT_API(api, ce_id_a0); CE_INIT_API(api, ce_log_a0); }, { CE_UNUSED(reload); _init(api); }, { CE_UNUSED(reload); CE_UNUSED(api); _shutdown(); } )
[ "ondra.voves@cyberego.org" ]
ondra.voves@cyberego.org
dc49c66dddb45e63a9050bb74f443115d48a1d5d
fef750f91e71daa54ed4b7ccbb5274e77cab1d8f
/UVA/1200-1299/1203.cpp
beb517c265290b47e41bc6e357df7d4805261a87
[]
no_license
DongChengrong/ACM-Program
e46008371b5d4abb77c78d2b6ab7b2a8192d332b
a0991678302c8d8f4a7797c8d537eabd64c29204
refs/heads/master
2021-01-01T18:32:42.500303
2020-12-29T11:29:02
2020-12-29T11:29:02
98,361,821
2
1
null
null
null
null
UTF-8
C++
false
false
731
cpp
#include <stdio.h> #include <queue> using namespace std; #define N 20 char cmd[N]; struct Node { int id, t, p; Node() {} Node (int id, int t, int p) { this->id = id; this->t = t; this->p = p; } bool operator < (const Node & a) const { return p > a.p || (p == a.p && id > a.id); } }; int main() { int n; priority_queue<Node> que; while (scanf("%s",cmd) == 1) { int id, t; if (cmd[0] == '#') break; scanf("%d%d", &id, &t); que.push(Node(id, t, t)); } scanf("%d",&n); while (n--) { Node u = que.top(); que.pop(); printf("%d\n",u.id); que.push(Node(u.id, u.t, u.p + u.t)); } return 0; }
[ "qazxswh111@163.com" ]
qazxswh111@163.com
4253c09ac1ea8085208c53d7a375debf8a0ae54f
238e46a903cf7fac4f83fa8681094bf3c417d22d
/VTK/vtk_7.1.1_x64_Debug/include/vtk-7.1/vtkArrayInterpolate.h
57aed36fc323818f761c5e1b9cf780dbdfb25052
[ "BSD-3-Clause" ]
permissive
baojunli/FastCAE
da1277f90e584084d461590a3699b941d8c4030b
a3f99f6402da564df87fcef30674ce5f44379962
refs/heads/master
2023-02-25T20:25:31.815729
2021-02-01T03:17:33
2021-02-01T03:17:33
268,390,180
1
0
BSD-3-Clause
2020-06-01T00:39:31
2020-06-01T00:39:31
null
UTF-8
C++
false
false
2,309
h
/*========================================================================= Program: Visualization Toolkit Module: vtkArrayInterpolate.h ------------------------------------------------------------------------- Copyright 2008 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. ------------------------------------------------------------------------- Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /** * @class vtkArrayInterpolate * * Computes the weighted sum of a collection of slices from a source * array, and stores the results in a slice of a target array. Note that * the number of source slices and weights must match, and the extents of * each source slice must match the extents of the target slice. * * Note: The implementation assumes that operator*(T, double) is defined, * and that there is an implicit conversion from its result back to T. * * If you need to interpolate arrays of T other than double, you will * likely want to create your own specialization of this function. * * The implementation should produce correct results for dense and sparse * arrays, but may perform poorly on sparse. * * @par Thanks: * Developed by Timothy M. Shead (tshead@sandia.gov) at Sandia National * Laboratories. */ #ifndef vtkArrayInterpolate_h #define vtkArrayInterpolate_h #include "vtkTypedArray.h" class vtkArrayExtents; class vtkArraySlices; class vtkArrayWeights; // template<typename T> void vtkInterpolate( vtkTypedArray<T>* source_array, const vtkArraySlices& source_slices, const vtkArrayWeights& source_weights, const vtkArrayExtents& target_slice, vtkTypedArray<T>* target_array); #include "vtkArrayInterpolate.txx" #endif // VTK-HeaderTest-Exclude: vtkArrayInterpolate.h
[ "l”ibaojunqd@foxmail.com“" ]
l”ibaojunqd@foxmail.com“
2ae57beef81662688b7266ef0f1dafdd2286e906
31ac07ecd9225639bee0d08d00f037bd511e9552
/externals/OCCTLib/inc/Graphic3d_CBitFields20.hxx
22fdb02faa7e9afb1467189db2ff5b9bcd2550dc
[]
no_license
litao1009/SimpleRoom
4520e0034e4f90b81b922657b27f201842e68e8e
287de738c10b86ff8f61b15e3b8afdfedbcb2211
refs/heads/master
2021-01-20T19:56:39.507899
2016-07-29T08:01:57
2016-07-29T08:01:57
64,462,604
1
0
null
null
null
null
UTF-8
C++
false
false
1,998
hxx
// Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. /*============================================================================*/ /*==== Titre: Graphic3d_CBitFields20.hxx */ /*==== Role : The header file of primitive type "CBitFields20" from Graphic3d */ /*==== */ /*==== Implementation: This is a primitive type implemented with typedef */ /*============================================================================*/ #ifndef _Graphic3d_CBitFields20_HeaderFile #define _Graphic3d_CBitFields20_HeaderFile typedef struct { unsigned bool1 :1; unsigned bool2 :1; unsigned bool3 :1; unsigned bool4 :1; unsigned bool5 :1; unsigned bool6 :1; unsigned bool7 :1; unsigned bool8 :1; unsigned bool9 :1; unsigned bool10 :1; unsigned bool11 :1; unsigned bool12 :1; unsigned bool13 :1; unsigned bool14 :1; unsigned bool15 :1; unsigned bool16 :1; unsigned bool17 :1; unsigned bool18 :1; unsigned bool19 :1; unsigned bool20 :1; } Graphic3d_CBitFields20; #if defined(__cplusplus) || defined(c_plusplus) /*==== Definition de Type ====================================================*/ #include <Standard_Type.hxx> const Handle(Standard_Type)& STANDARD_TYPE(Graphic3d_CBitFields20); /*============================================================================*/ #endif #endif /*Graphic3d_CBitFields20_HeaderFile*/
[ "litao1009@gmail.com" ]
litao1009@gmail.com
03dd22ac470baded678fae96e59a0a2b443c5cf4
a28ccadc85e1d356743f5f23b7a9945c7e3ee20f
/OpenCVNetwork/src/main/c++/native/network/properties/protocol/in/GetAllPropertiesPacket.cpp
f024c0ffb5ecd12ba45daf80df1c1a0a231e45b3
[ "MIT" ]
permissive
hesitationer/OpenCVClient
2e8b2db538c92a05f3a62e5b78d04a1d23a44885
a7119b1b108b8f15090751218851b8852241d274
refs/heads/master
2021-06-11T22:29:49.622612
2017-03-09T19:37:57
2017-03-09T19:37:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
502
cpp
// // Created by dialight on 01.11.16. // #include "network/properties/protocol/in/GetAllPropertiesPacket.hpp" using namespace std; GetAllPropertiesPacket::GetAllPropertiesPacket() : InPacket() {} void GetAllPropertiesPacket::read(TCPSocketClient *client) { } PacketType GetAllPropertiesPacket::getType() { return PacketType::GET_ALL_PROPERTIES; } int GetAllPropertiesPacket::getId() { return 0x00; } string GetAllPropertiesPacket::toString() { return "GetAllPropertiesPacket{}"; }
[ "light_01@rambler.ru" ]
light_01@rambler.ru
5bffb882e41ffda91a5eae39f3dc1314a2346154
76a5814b43ffb285e5c02b7b727b1ffeaab60957
/CommandBasedv10/src/Subsystems/MecanumDrive.cpp
25ccbca1c75f93653c4809e17c5e786fca4805bc
[]
no_license
Team135BlackKnights/2015-Code2
e73a31c7348f2279718f45a7c1b7e2d8a10d8760
90200ff2a8796d863911eafb076b4852388bbe6d
refs/heads/master
2021-01-02T22:51:09.701959
2016-02-01T20:57:50
2016-02-01T20:57:50
29,403,901
0
0
null
null
null
null
UTF-8
C++
false
false
3,769
cpp
#include "MecanumDrive.h" #include "../RobotMap.h" #include "../Commands/DriveJ.h" #include <cmath> MecanumDrive::MecanumDrive() : Subsystem("MecanumDrive") { motors[FRONT_LEFT] = new CANTalon(MOTOR_FRONT_LEFT); motors[REAR_LEFT] = new CANTalon(MOTOR_REAR_LEFT); motors[FRONT_RIGHT] = new CANTalon(MOTOR_FRONT_RIGHT); motors[REAR_RIGHT] = new CANTalon(MOTOR_REAR_RIGHT); chassis = new RobotDrive(motors[FRONT_LEFT], motors[REAR_LEFT], motors[FRONT_RIGHT], motors[REAR_RIGHT]); chassis->SetInvertedMotor(RobotDrive::kFrontRightMotor, true); chassis->SetInvertedMotor(RobotDrive::kRearRightMotor, true); gyroAngle = 0; lidarValueOne = 0; lidarValueTwo = 0; chassis->SetSafetyEnabled(false); useSetRobotAngle = false;//SmartDashboard::GetBoolean(T_USE_SET_ROBOT_ANGLE, false); setRobotAngle = 0;//SmartDashboard::GetNumber(T_SET_ROBOT_ANGLE, 0); /* for (int i = 0; i < NUM_MOTORS; i++) { motors[i]->SetPID(PIDValues[i][0], PIDValues[i][1], PIDValues[i][2]); } */ gyro = new Gyro(ANALOG_GYRO_A); gyro->Reset(); accel = new BuiltInAccelerometer(Accelerometer::kRange_8G); timer = new Timer(); lastVelocityX = 0; distanceX = 0; lidar = new AnalogInput(ANALOG_LIDAR); } void MecanumDrive::InitDefaultCommand() { SetDefaultCommand(new DriveJ()); timer->Start(); gyro->Reset(); } void MecanumDrive::Drive(float x, float y, float z, float angle) { GetSensorValues(); //SynthesizeAccel(); SmartDashboard::PutNumber(T_GYRO_ANGLE, gyroAngle); SmartDashboard::PutBoolean(T_USE_SET_ROBOT_ANGLE, useSetRobotAngle); SmartDashboard::PutBoolean(T_SET_ROBOT_ANGLE, setRobotAngle); //float angle = oi. ? gyroAngle : 0; SmartDashboard::PutNumber("ANGLE FIELD THING", angle); chassis->MecanumDrive_Cartesian(x, y, z, angle); //std::ofstream outfile ("EncoderTest.txt",std::ofstream::out); //outfile.write((const char*)motors[FRONT_LEFT]->GetEncVel() + '\n', 5); //outfile.close(); SmartDashboard::PutNumber("Delta Time Max", 0); } void MecanumDrive::GetSensorValues() { gyroAngle = gyro->GetAngle(); lidarValueOne = lidar->GetValue(); } void MecanumDrive::SynthesizeAccel() { double currentVelocityX, accelerationX; double deltaTime; //X DISTANCE deltaTime = timer->Get(); SmartDashboard::PutNumber("Delta Time Max", fmax(SmartDashboard::GetNumber("Delta Time Max", 0), deltaTime)); timer->Stop(); timer->Reset(); timer->Start(); accelerationX = accel->GetX(); //distanceX = (lastVelocityX * deltaTime) + (.5 * accelerationX * deltaTime * deltaTime); currentVelocityX = lastVelocityX + accelerationX * deltaTime; distanceX = (currentVelocityX + lastVelocityX) * deltaTime / 2; SmartDashboard::PutNumber("Distance X", distanceX); lastVelocityX = currentVelocityX; } float MecanumDrive::GetGyroAngle() { gyroAngle = gyro->GetAngle(); return gyroAngle; } float MecanumDrive::SetGyroAngle(float angle) { //SmartDashboard::PutNumber(T_GYRO_ANGLE, angle); return 0; //gyroAngle = angle; } int MecanumDrive::GetLidarValue() { return lidarValueOne; } void MecanumDrive::SetLidarValue(int valueOne) { int jump = valueOne - lidarValueOne; SmartDashboard::PutNumber("LIDAR Jump", fmax(SmartDashboard::GetNumber("LIDAR Jump", 0), jump)); lidarValueOne = valueOne; } void MecanumDrive::Rotate(float power) { chassis->MecanumDrive_Cartesian(0, 0, power); } void MecanumDrive::SetSafetyEnabled(bool enabled) { chassis->SetSafetyEnabled(enabled); } void MecanumDrive::GetDriveVelocties(float* velocityArray) { for (int i = 0; i < NUM_MOTORS; i++) { velocityArray[i] = abs(motors[i]->GetEncVel()); } } void MecanumDrive::GetMotorPIDValues(int index, double* values) { values[0] = motors[index]->GetP(); values[1] = motors[index]->GetI(); values[2] = motors[index]->GetD(); }
[ "robotics@phm.k12.in.us" ]
robotics@phm.k12.in.us
95dda852ca52fb0307e27383be2cfc93567dba82
feceebb980e460ee6553f9024af3ba2bcfad930e
/0.org/alpha1
4d838b9f917ad0aad86f070834bcd8dcc5969153
[]
no_license
eloic/openFOAM-wall
f0f2b999100873ef857fc99862dfc0d9e877be93
422a778fcec9f59afba53232928c09109aefa3c1
refs/heads/master
2021-01-22T09:32:42.698731
2011-08-02T08:59:54
2011-08-02T08:59:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,275
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha1; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { stationaryWalls { type zeroGradient; } frontBack { type symmetryPlane; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } floatingObject { type zeroGradient; } } // ************************************************************************* //
[ "nickmcclendon@gmail.com" ]
nickmcclendon@gmail.com
8f2d5badfd6cb8bb94539f85d3be867715bb0d69
38b9daafe39f937b39eefc30501939fd47f7e668
/tutorials/2WayCouplingOceanWave3D/EvalResults180628-oneWay/59.8/uniform/time
697ef996eb8a5bba578ad66dbb18e9ce6368eede
[]
no_license
rubynuaa/2-way-coupling
3a292840d9f56255f38c5e31c6b30fcb52d9e1cf
a820b57dd2cac1170b937f8411bc861392d8fbaa
refs/heads/master
2020-04-08T18:49:53.047796
2018-08-29T14:22:18
2018-08-29T14:22:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,005
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "59.8/uniform"; object time; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // value 59.8000000000000043; name "59.8"; index 7823; deltaT 0.00630542; deltaT0 0.00630542; // ************************************************************************* //
[ "abenaz15@etudiant.mines-nantes.fr" ]
abenaz15@etudiant.mines-nantes.fr
65678d998e86f8e3968fe656ad7f14008baa053a
c153d5da1ca7e0e7e74a9f4a05c6f240f82312b0
/src/emitters/collimated.cpp
79f5af135e3b049fa37d5ef1d0dde2e203ee425b
[]
no_license
zhoub/mitsuba
4649239b60854c514c1be2d59e62e1dd6e0f140a
1cfdd2ed0989379c13218933b5ac79feaccb9f2a
refs/heads/master
2021-01-22T23:43:23.109918
2014-05-08T10:29:00
2014-05-08T10:29:00
19,692,894
2
0
null
null
null
null
UTF-8
C++
false
false
5,044
cpp
/* This file is part of Mitsuba, a physically based rendering system. Copyright (c) 2007-2012 by Wenzel Jakob and others. Mitsuba is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Mitsuba is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <mitsuba/render/emitter.h> #include <mitsuba/render/medium.h> #include <mitsuba/core/track.h> MTS_NAMESPACE_BEGIN /*!\plugin{collimated}{Collimated beam emitter} * \icon{emitter_collimated} * \order{5} * \parameters{ * \parameter{toWorld}{\Transform\Or\Animation}{ * Specifies an optional emitter-to-world transformation. * \default{none (i.e. emitter space $=$ world space)} * } * \parameter{power}{\Spectrum}{ * Specifies the amount of power radiated along the beam * \default{1} * } * \parameter{samplingWeight}{\Float}{ * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * * This emitter plugin implements a collimated beam source, which * radiates a specified amount of power along a fixed ray. * It can be thought of as the limit of a spot light as its field * of view tends to zero. * * Such a emitter is useful for conducting virtual experiments and * testing the renderer for correctness. * * By default, the emitter is located at the origin and radiates * into the positive Z direction $(0,0,1)$. This can * be changed by providing a custom \code{toWorld} transformation. */ class CollimatedBeamEmitter : public Emitter { public: CollimatedBeamEmitter(const Properties &props) : Emitter(props) { m_type |= EDeltaPosition | EDeltaDirection; m_power = props.getSpectrum("power", Spectrum::getD65()); if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the emitter-to-world " "transformation are not allowed!"); } CollimatedBeamEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { configure(); m_power = Spectrum(stream); } void serialize(Stream *stream, InstanceManager *manager) const { Emitter::serialize(stream, manager); m_power.serialize(stream); } Spectrum samplePosition(PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { const Transform &trafo = m_worldTransform->eval(pRec.time); pRec.p = trafo(Point(0.0f)); pRec.n = trafo(Vector(0.0f, 0.0f, 1.0f)); pRec.pdf = 1.0f; pRec.measure = EDiscrete; return m_power; } Spectrum evalPosition(const PositionSamplingRecord &pRec) const { return (pRec.measure == EDiscrete) ? m_power : Spectrum(0.0f); } Float pdfPosition(const PositionSamplingRecord &pRec) const { return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { dRec.d = pRec.n; dRec.pdf = 1.0f; dRec.measure = EDiscrete; return Spectrum(1.0f); } Float pdfDirection(const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const { return (dRec.measure == EDiscrete) ? 1.0f : 0.0f; } Spectrum evalDirection(const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const { return Spectrum((dRec.measure == EDiscrete) ? 1.0f : 0.0f); } Spectrum sampleRay(Ray &ray, const Point2 &spatialSample, const Point2 &directionalSample, Float time) const { const Transform &trafo = m_worldTransform->eval(time); ray.setTime(time); ray.setOrigin(trafo.transformAffine(Point(0.0f))); ray.setDirection(trafo(Vector(0.0f, 0.0f, 1.0f))); return m_power; } Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { /* Direct sampling always fails for a response function on a 0D space */ dRec.pdf = 0.0f; return Spectrum(0.0f); } Float pdfDirect(const DirectSamplingRecord &dRec) const { return 0.0f; } AABB getAABB() const { return m_worldTransform->getTranslationBounds(); } std::string toString() const { std::ostringstream oss; oss << "CollimatedBeamEmitter[" << endl << " power = " << m_power.toString() << "," << endl << " samplingWeight = " << m_samplingWeight << "," << endl << " worldTransform = " << indent(m_worldTransform.toString()) << "," << endl << " medium = " << indent(m_medium.toString()) << endl << "]"; return oss.str(); } MTS_DECLARE_CLASS() private: Spectrum m_power; }; MTS_IMPLEMENT_CLASS_S(CollimatedBeamEmitter, false, Emitter) MTS_EXPORT_PLUGIN(CollimatedBeamEmitter, "Collimated beam emitter"); MTS_NAMESPACE_END
[ "wenzel@cs.cornell.edu" ]
wenzel@cs.cornell.edu
bc20909018720d64621166cd960fa2d1ff96ff5a
8326bfed5d6fe646bf7ef1dff62b963641536580
/uva/11780-Miles-2-Km/11780-Miles-2-Km.cpp
fc8b4d190c02e5c8d40d98e1ad8429decca47e6a
[]
no_license
mehranagh20/ACM-ICPC
04ddbaf7ade9f266b6e74a19b2bd966d19ea442e
76eb30b5df8545b04efc1df9c2e557ab0f83d2fb
refs/heads/master
2018-10-20T02:59:43.070665
2018-08-10T16:53:56
2018-08-10T16:54:12
59,946,269
15
4
null
null
null
null
UTF-8
C++
false
false
1,187
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long llu; typedef pair<int, int> ii; typedef pair<int, ii> iii; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef vector<ii> vii; typedef vector<iii> viii; typedef vector<vii> vvii; #define inf 1000000000 #define eps 1e-9 vi fib; vector<pair<double, int>> memo; int n; double tot; double sol(int val, int sum) { if(val < 0) return inf; if(val == 0) return 0; if(memo[val].first != -1) return memo[val].first; double ans = inf; for(int i = 2; i < fib.size(); i++) ans = min(ans, sol(val - fib[i], sum + fib[i + 1]) + abs(fib[i + 1] - fib[i] * 1.6)); memo[val].first = ans; memo[val].second = sum; return memo[val].first; } int main() { ios::sync_with_stdio(0); fib.push_back(0); fib.push_back(1); while(true) { if(fib.back() <= 1000) fib.push_back(fib.back() + fib[fib.size() - 2]); else break; } memo.resize(1010, make_pair(-1, inf)); while(cin >> n && n) { tot = n * 1.6; cout << fixed << setprecision(2) << sol(n, 0) << endl; } return 0; }
[ "mehranagh200@gmail.com" ]
mehranagh200@gmail.com
53bd4b424f2700a10a165d2571466647a8c3743f
3ed684f77dda3a153c8379005a5baae4d0409f27
/D_Platform_Ver3.020/SDK/MJFrame/Include/Common/Frame/MJ.cpp
f73e6dab4e9edd112b4e94a4a2d6cab0dce68c67
[]
no_license
StarKnowData/robinerp
c3f36259ef0f2efc6a3e2a516b40c632e25832f9
65bae698466bad45488971d07ccb9455c0d7d3d9
refs/heads/master
2021-05-30T07:35:35.803122
2012-12-17T13:42:33
2012-12-17T13:42:33
null
0
0
null
null
null
null
GB18030
C++
false
false
60,713
cpp
#include "MJ.h" namespace MyGame { CMJHand::CMJHand() { m_nCurrentLength = 0; } CMJHand::~CMJHand() { m_nCurrentLength = 0; } /** * @brief 重载CMJHand操作符 * @param[in] mjHands 给定的手牌 * @return 操作后的手牌 * @sa */ CMJHand CMJHand::operator + (const CMJHand& mjHands) { CMJHand mjResult; mjResult.AddTiles(*this); mjResult.AddTiles((CMJHand)mjHands); return mjResult; } CMJHand CMJHand::operator - (const CMJHand& mjHands) { CMJHand mjResult, mjTmp; mjTmp.AddTiles((CMJHand)mjHands); for (BYTE i = 0; i < m_nCurrentLength; i++) { if (!mjTmp.IsHave(m_ucTile[i])) { mjResult.AddTile(m_ucTile[i]); } else { mjTmp.DelTile(m_ucTile[i]); } } return mjResult; } CMJHand CMJHand::operator += (const CMJHand& mjHands) { AddTiles((CMJHand)mjHands); return *this; } CMJHand CMJHand::operator -= (const CMJHand& mjHands) { DelTiles((CMJHand)mjHands); return *this; } /** * @brief 设置指定位置上的手牌 * @param[in] nPos 需要设置的位置 * @param[in] ucTile 设置的牌数据 * @warning 如果设置的位置超过当前手牌的实际长度,或者设置的牌数据超过最大值TILE_END都会设置失败 */ void CMJHand::SetTile( int nPos, TILE ucTile ) { if (nPos < 0 || nPos >= m_nCurrentLength || nPos >= MAX_TOTAL_TILES || ucTile >= TILE_END) { return ; } m_ucTile[nPos] = ucTile; } /** * @brief 获取指定位置上的牌 * @param[in] nPos 需要获取的位置 * @return 如果获取的位置超过当前手牌的实际长度,就会返回TILE_BEGIN */ TILE CMJHand::GetTile( int nPos ) { if (nPos < 0 || nPos >= m_nCurrentLength) { return TILE_BEGIN; } return m_ucTile[nPos]; } /** * @brief 添加一张手牌 * @param[in] ucTile 添加的牌数据 * @param[in] nNbr 添加的牌数 * @param[in] bIncrease 是否要增序增加 * @return 如果设置的位置超过手牌的实际最大长度,或者设置的牌数据超过最大值TILE_END都会添加失败 */ BOOL CMJHand::AddTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength + nNbr > MAX_TOTAL_TILES || ucTile >= TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } // 添加相应的连续牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile + i; } m_nCurrentLength += nNbr; } else { //if (nNbr > 4) //{ // return FALSE; //} // 添加nNbr张相同的牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile; } m_nCurrentLength += nNbr; } return TRUE; } /** * @brief 删除一张手牌 * @param[in] ucTile 指定要删除的牌 * @param[in] nNbr 删除的牌数 * @param[in] bIncrease 是否要增序删除 * @return 如果没有这张牌就会返回FALSE * @warning 删除操作会打乱牌的顺序 */ BOOL CMJHand::DelTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength - nNbr < 0) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } CMJHand mjHand; for (int i = 0; i < nNbr; i++) { mjHand.AddTile(ucTile + i, 1, FALSE); } return DelTiles(mjHand); } else { TILE ucTileArray[MAX_TOTAL_TILES] = {0}; int nCount = 0; for (int i = 0, j = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile && nCount < nNbr) { nCount++; } else { ucTileArray[j] = m_ucTile[i]; j++; } } if (nCount > 0) { memcpy(m_ucTile, ucTileArray, sizeof(m_ucTile)); m_nCurrentLength -= nCount; return TRUE; } } return FALSE; } /** * @brief 添加一组手牌 * @param[in] tiles 手牌数据 * @return 如果添加中途长度超过最大长度,返回FALSE */ BOOL CMJHand::AddTiles( CMJHand &tiles ) { int nLenTiles = tiles.CurrentLength(); if (m_nCurrentLength + nLenTiles > MAX_TOTAL_TILES) { return FALSE; } for (int i = 0; i < nLenTiles; i++) { m_ucTile[m_nCurrentLength + i] = tiles.GetTile(i); } m_nCurrentLength += nLenTiles; return TRUE; } /** * @brief 删除一组手牌 * @param[in] tiles 手牌数据 * @return 如果找不到牌组中的牌, 返回FALSE */ BOOL CMJHand::DelTiles( CMJHand &tiles ) { TILE tmp; BYTE ucTile[MAX_TOTAL_TILES] = {0}; int i, j, nDelCount = 0; int nLenTiles = tiles.CurrentLength(); for (i = 0; i < nLenTiles; i++) { tmp = tiles.GetTile(i); for (j = 0; j < m_nCurrentLength; j++) { if (tmp == m_ucTile[j] && 0 == ucTile[j]) { ucTile[j] = 1; nDelCount++; break; } } } for (i = 0, j = 0; i < m_nCurrentLength; i++) { if (0 == ucTile[i]) { m_ucTile[j] = m_ucTile[i]; j++; } } m_nCurrentLength -= nDelCount; return TRUE; } /** * @brief 是否被指定的手牌对象包含 * @param[in] tiles 手牌对象 * @return 如果本身手牌全部存在于对象tiles中, 返回TRUE, 否则返回FALSE */ BOOL CMJHand::IsSubSet( CMJHand &tiles ) { BOOL bFind = TRUE; TILE tmp; BYTE ucTile[MAX_TOTAL_TILES] = {0}; int i, j, nLenTiles = tiles.CurrentLength(); for (i = 0; i < nLenTiles; i++) { bFind = FALSE; tmp = tiles.GetTile(i); for (j = 0; j < m_nCurrentLength; j++) { if (tmp == m_ucTile[j] && 0 == ucTile[j]) { ucTile[j] = 1; bFind = TRUE; break; } } if (!bFind) { return FALSE; } } return TRUE; } /** * @brief 是否包含指定的手牌 * @param[in] ucTile 指定的牌 * @param[in] nNbr 包含的数量 * @param[in] bIncrease 是否是增序,最高可查连续数为9,如果检测一个顺子,可以传入参数nNbr = 3, bIncrease = TRUE * @return 如果包含指定数量的牌,返回TRUE,否则返回FALSE */ BOOL CMJHand::IsHave( TILE ucTile, int nNbr, int bIncrease) { if (ucTile > TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } BOOL bFind; int i, j; for (i = 0; i < nNbr; i++) { bFind = FALSE; for (j = 0; j < m_nCurrentLength; j++) { if (m_ucTile[j] == ucTile + i) { bFind = TRUE; break; } } if (!bFind) { return FALSE; } } return TRUE; } else { if (nNbr > 4) { return FALSE; } int nCount = 0; for (int i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile) { nCount++; if (nCount == nNbr) { return TRUE; } } } } return FALSE; } /** * @brief 是否有花牌 * @return 花牌的数量 */ int CMJHand::IsHaveFlower() { int nCount = 0; for (int i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] >= TILE_FLOWER_CHUN && m_ucTile[i] <= TILE_FLOWER_JU) { nCount++; } } return nCount; } /** * @brief 排序 * @param[in] nMod 0:升序,1:降序 * @param[in] nGod 0:万能牌不做特殊排序处理,1:万能牌放在序列的头部,2:万能牌放在序列的尾部 * @param[in] tilesGod 万能牌组 */ void CMJHand::Sort( int nMod, int nGod, CMJHand* tilesGod) { int i, j; int nGodCount = 0; TILE tempTile; if (tilesGod != NULL) { if (1 == nGod || 2 == nGod) { // 万能牌放到序列的头部 for (i = 0; i < m_nCurrentLength; i++) { if (tilesGod->IsHave(m_ucTile[i])) { tempTile = m_ucTile[nGodCount]; m_ucTile[nGodCount] = m_ucTile[i]; m_ucTile[i] = tempTile; nGodCount++; } } // 万能牌放到序列的尾部 if (2 == nGod) { for (i = 0; i < nGodCount; i++) { Swap(i, m_nCurrentLength-i-1); } } } } if (0 == nMod) { // 升序 if (1 == nGod) { // 万能牌在前头部 // 万能牌排序 for (i = 0; i < nGodCount; i++) { for (j = 0; j < nGodCount - i - 1; j++) { if (m_ucTile[j] > m_ucTile[j+1]) { Swap(j, j+1); } } } // 非万能牌排序 for (i = 0; i < m_nCurrentLength - nGodCount; i++) { for (j = 0; j < m_nCurrentLength - nGodCount - i - 1; j++) { if (m_ucTile[j+nGodCount] > m_ucTile[j+nGodCount+1]) { Swap(j+nGodCount, j+nGodCount+1); } } } } else { // 万能牌在前尾部 // 万能牌排序 for (i = 0; i < nGodCount; i++) { for (j = 0; j < nGodCount - i - 1; j++) { if (m_ucTile[j+m_nCurrentLength-nGodCount] > m_ucTile[j+m_nCurrentLength-nGodCount+1]) { Swap(j+m_nCurrentLength-nGodCount, j+m_nCurrentLength-nGodCount+1); } } } // 非万能牌排序 for (i = 0; i < m_nCurrentLength - nGodCount; i++) { for (j = 0; j < m_nCurrentLength - nGodCount - i - 1; j++) { if (m_ucTile[j] > m_ucTile[j+1]) { Swap(j, j+1); } } } } } else if (1 == nMod) { // 降序 if (1 == nGod) { // 万能牌在前头部 // 万能牌排序 for (i = 0; i < nGodCount; i++) { for (j = 0; j < nGodCount - i - 1; j++) { if (m_ucTile[j] < m_ucTile[j+1]) { Swap(j, j+1); } } } // 非万能牌排序 for (i = 0; i < m_nCurrentLength - nGodCount; i++) { for (j = 0; j < m_nCurrentLength - nGodCount - i - 1; j++) { if (m_ucTile[j+nGodCount] < m_ucTile[j+nGodCount+1]) { Swap(j+nGodCount, j+nGodCount+1); } } } } else { // 万能牌在前尾部 // 万能牌排序 for (i = 0; i < nGodCount; i++) { for (j = 0; j < nGodCount - i - 1; j++) { if (m_ucTile[j+m_nCurrentLength-nGodCount] < m_ucTile[j+m_nCurrentLength-nGodCount+1]) { Swap(j+m_nCurrentLength-nGodCount, j+m_nCurrentLength-nGodCount+1); } } } // 非万能牌排序 for (i = 0; i < m_nCurrentLength - nGodCount; i++) { for (j = 0; j < m_nCurrentLength - nGodCount - i - 1; j++) { if (m_ucTile[j] < m_ucTile[j+1]) { Swap(j, j+1); } } } } } else if (2 == nMod) { // 按牌张数进行升序排序 int temp, nNum[TILE_END] = {0}; for (i = 0; i < m_nCurrentLength; i++) { nNum[i] = GetTileCount(m_ucTile[i]); } for (i = 0; i < m_nCurrentLength; i++) { for (j = i + 1; j < m_nCurrentLength; j++) { if (nNum[i] > nNum[j]) { temp = nNum[i]; nNum[i] = nNum[j]; nNum[j] = temp; Swap(i, j); } else if (nNum[i] == nNum[j]) { // 牌张数相等, 比较牌点大小 if (m_ucTile[i] > m_ucTile[j]) { temp = nNum[i]; nNum[i] = nNum[j]; nNum[j] = temp; Swap(i, j); } } } } } else if (3 == nMod) { // 按牌张数进行降序排序 int temp, nNum[TILE_END] = {0}; for (i = 0; i < m_nCurrentLength; i++) { nNum[i] = GetTileCount(m_ucTile[i]); } for (i = 0; i < m_nCurrentLength; i++) { for (j = i + 1; j < m_nCurrentLength; j++) { if (nNum[i] < nNum[j]) { temp = nNum[i]; nNum[i] = nNum[j]; nNum[j] = temp; Swap(i, j); } else if (nNum[i] == nNum[j]) { // 牌张数相等, 比较牌点大小 if (m_ucTile[i] < m_ucTile[j]) { temp = nNum[i]; nNum[i] = nNum[j]; nNum[j] = temp; Swap(i, j); } } } } } } /** * @brief 清空数据 */ void CMJHand::ReleaseAll() { m_nCurrentLength = 0; for (int i = 0; i < MAX_TOTAL_TILES; i++) { m_ucTile[i] = TILE_BEGIN; } } /** * @brief 是否可吃牌 * @param[in] ucTile 指定吃的牌 * @param[in] bWind 风牌是否可吃 * @param[in] bArrow 箭头牌是否可吃 * @param[in/out] mjSet 返回可以吃的牌数据 * @return 100:头, 10:中, 1:尾 * * 返回的是10进制数据,如果同时可以做头和尾吃,就会返回101. */ int CMJHand::IsCanCollect( TILE ucTile, int bWind, int bArrow, CMJSet & mjSet ) { if (!bWind && !bArrow && ucTile >= TILE_EAST && ucTile <= TILE_BAI) { // 风牌和箭头牌不可吃 return 0; } int nReValue = 0; int nValue = GetTileNumber(ucTile); BYTE byTile[4]; if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_BALL_9) { // 万、条、筒 1-9吃牌判断 if (nValue <= 7) { // 头 if (IsHave(ucTile+1) && IsHave(ucTile+2)) { nReValue += 100; byTile[0] = ucTile; byTile[1] = ucTile + 1; byTile[2] = ucTile + 2; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } if (nValue >= 2 && nValue <= 8) { // 中 if (IsHave(ucTile-1) && IsHave(ucTile+1)) { nReValue += 10; byTile[0] = ucTile - 1; byTile[1] = ucTile; byTile[2] = ucTile + 1; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } if (nValue >= 3) { // 尾 if (IsHave(ucTile-1) && IsHave(ucTile-2)) { nReValue += 1; byTile[0] = ucTile - 2; byTile[1] = ucTile - 1; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } } if (nReValue > 0) { return nReValue; } if (bWind && ucTile >= TILE_EAST && ucTile <= TILE_NORTH) { BOOL bIsHave = FALSE; // 东、南、西、北吃牌判断(可以随变吃, 但必须保证吃牌中的3张牌都不一样) switch (ucTile) { case TILE_EAST: // 东 { if (IsHave(ucTile+1) && IsHave(ucTile+2)) { byTile[0] = ucTile; byTile[1] = ucTile + 1; byTile[2] = ucTile + 2; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (IsHave(ucTile+1) && IsHave(ucTile+3)) { byTile[0] = ucTile; byTile[1] = ucTile + 1; byTile[2] = ucTile + 3; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (IsHave(ucTile+2) && IsHave(ucTile+3)) { byTile[0] = ucTile; byTile[1] = ucTile + 2; byTile[2] = ucTile + 3; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (bIsHave) { nReValue += 100; } /*if (IsHave(ucTile+1) && IsHave(ucTile+2) || IsHave(ucTile+1) && IsHave(ucTile+3) || IsHave(ucTile+2) && IsHave(ucTile+3)) { nReValue += 100; }*/ } break; case TILE_SOUTH: // 南 { if (IsHave(ucTile+1) && IsHave(ucTile+2)) { byTile[0] = ucTile; byTile[1] = ucTile + 1; byTile[2] = ucTile + 2; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 头 nReValue += 100; } if (IsHave(ucTile-1) && IsHave(ucTile+1)) { byTile[0] = ucTile - 1; byTile[1] = ucTile; byTile[2] = ucTile + 1; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 中 bIsHave = TRUE; } if (IsHave(ucTile-1) && IsHave(ucTile+2)) { byTile[0] = ucTile - 1; byTile[1] = ucTile; byTile[2] = ucTile + 2; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 中 bIsHave = TRUE; } //if (IsHave(ucTile+1) && IsHave(ucTile+2)) //{ // // 头 // nReValue += 100; //} //if (IsHave(ucTile-1) && IsHave(ucTile+1) // || IsHave(ucTile-1) && IsHave(ucTile+2)) //{ // // 中 // nReValue += 10; //} if (bIsHave) { nReValue += 10; } } break; case TILE_WEST: // 西 { if (IsHave(ucTile-1) && IsHave(ucTile+1)) { byTile[0] = ucTile - 1; byTile[1] = ucTile; byTile[2] = ucTile + 1; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 中 nReValue += 100; } if (IsHave(ucTile-2) && IsHave(ucTile+1)) { byTile[0] = ucTile - 2; byTile[1] = ucTile; byTile[2] = ucTile + 1; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 中 bIsHave = TRUE; } if (IsHave(ucTile-1) && IsHave(ucTile-2)) { byTile[0] = ucTile - 2; byTile[1] = ucTile - 1; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); // 尾 nReValue += 1; } //if (IsHave(ucTile-1) && IsHave(ucTile+1) // || IsHave(ucTile-2) && IsHave(ucTile+1)) //{ // // 中 // nReValue += 10; //} //if (IsHave(ucTile-1) && IsHave(ucTile-2)) //{ // // 尾 // nReValue += 1; //} if (bIsHave) { nReValue += 10; } } break; case TILE_NORTH: // 北 { if (IsHave(ucTile-1) && IsHave(ucTile-2)) { byTile[0] = ucTile - 2; byTile[1] = ucTile - 1; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (IsHave(ucTile-1) && IsHave(ucTile-3)) { byTile[0] = ucTile - 3; byTile[1] = ucTile - 1; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (IsHave(ucTile-2) && IsHave(ucTile-3)) { byTile[0] = ucTile - 3; byTile[1] = ucTile - 2; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); bIsHave = TRUE; } if (bIsHave) { nReValue += 1; } //if (IsHave(ucTile-1) && IsHave(ucTile-2) // || IsHave(ucTile-1) && IsHave(ucTile-3) // || IsHave(ucTile-2) && IsHave(ucTile-3)) //{ // // 尾 // nReValue += 1; //} } break; } if (nReValue > 0) { return nReValue; } } if (bArrow && ucTile >= TILE_ZHONG && ucTile <= TILE_BAI) { // 中、发、白吃牌判断(吃牌中必须是中发白) switch (ucTile) { case TILE_ZHONG: // 中 { if (IsHave(ucTile+1) && IsHave(ucTile+2)) { // 头 nReValue += 100; byTile[0] = ucTile; byTile[1] = ucTile + 1; byTile[2] = ucTile + 2; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } break; case TILE_FA: // 发 { if (IsHave(ucTile-1) && IsHave(ucTile+1)) { // 中 nReValue += 10; byTile[0] = ucTile - 1; byTile[1] = ucTile; byTile[2] = ucTile + 1; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } break; case TILE_BAI: // 白 { if (IsHave(ucTile-1) && IsHave(ucTile-2)) { // 尾 nReValue += 1; byTile[0] = ucTile - 2; byTile[1] = ucTile - 1; byTile[2] = ucTile; byTile[3] = ucTile; mjSet.AddSet(byTile, ACTION_COLLECT, 0); } } break; } } return nReValue; } /** * @brief 交换 * @param[in] nPos1 第一个位置 * @param[in] nPos2 第二个位置 * @return 交换成功返回TRUE,否则返回FALSE * * 交换必须在实际的长度中进行,否则失败 */ BOOL CMJHand::Swap( int nPos1, int nPos2 ) { if (nPos1 < 0 || nPos2 < 0 || nPos1 >= m_nCurrentLength || nPos2 >= m_nCurrentLength || nPos1 == nPos2) { return FALSE; } TILE tempTile; tempTile = m_ucTile[nPos1]; m_ucTile[nPos1] = m_ucTile[nPos2]; m_ucTile[nPos2] = tempTile; return TRUE; } /** * @brief 设置当前长度 * @param[in] nCurLength 长度 */ void CMJHand::CurrentLength( const int& nCurLength ) { if (nCurLength > MAX_TOTAL_TILES) { return ; } m_nCurrentLength = nCurLength; } /** * @brief 获取指定牌的类型 * @param[in] ucTile 牌数据 * @return 万:0,筒:1,条:2,字:3,花:4,其他:5 * * 返回值有宏定义可参考 */ int CMJHand::GetTileGenre( TILE ucTile ) { if (ucTile % 10 == 0 || ucTile > TILE_BAI && ucTile < TILE_FLOWER_CHUN || ucTile > TILE_FLOWER_JU) { return TILE_GENRE_OTHER; } int nKind = ucTile/10; if (nKind >= TILE_GENRE_CHAR && nKind <= TILE_GENRE_FLOWER) { return nKind; } return TILE_GENRE_OTHER; } /** * @brief 获取指定牌的牌点 * @param[in] ucTile 牌数据 * @return 去除类型的牌值 * * 返回值有宏定义可参考 */ int CMJHand::GetTileNumber( TILE ucTile ) { return ucTile%10; } /** * @brief 获取指定牌的拥有的数量 * @param[in] ucTile 牌数据 * @return 此牌的数量 */ int CMJHand::GetTileCount( TILE ucTile ) { int nCount = 0; for (int i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile) { nCount++; } } return nCount; } /** * @brief 弹出手牌的最后一张 * @return 如果没牌了返回TILE_BEGIN */ TILE CMJHand::PopTile() { if (m_nCurrentLength <= 0) { return TILE_BEGIN; } m_nCurrentLength--; TILE tile = m_ucTile[m_nCurrentLength]; m_ucTile[m_nCurrentLength] = TILE_BEGIN; return tile; } /** * @brief 添加一个刻子 * @param[in] ucTile 刻子的数据 * * 相当于执行了3次添加同一张牌 */ void CMJHand::AddTriplet( TILE ucTile ) { AddTile(ucTile, 3); } /** * @brief 添加一个顺子 * @param[in] ucTile 顺子第一张牌数据 * @warning 如果越界依然会添加进去,比如添加9万,会实际添加9,10,11(一条)这3个数据 */ void CMJHand::AddCollect( TILE ucTile ) { AddTile(ucTile, 3, TRUE); } /** * @brief 获取所有牌数据 * @param[in] nHandTiles 牌数据 * @return 牌长度 */ int CMJHand::GetAllTile( int nHandTiles[] ) { memset(nHandTiles, 0, sizeof(nHandTiles)); for (int i = 0; i < m_nCurrentLength; i++) { nHandTiles[i] = m_ucTile[i]; } return m_nCurrentLength; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* CMJSet */ CMJSet::CMJSet() { m_nCurrentLength = 0; for (int i = 0; i < MAX_SET_TILES; i++) { m_pParam[i] = NULL; } } CMJSet::~CMJSet() { m_nCurrentLength = 0; // 检测附属信息是否需要释放内存 for (int i = 0; i < MAX_SET_TILES; i++) { if (m_pParam[i] != NULL) { delete m_pParam[i]; m_pParam[i] = NULL; } } } /** * @brief 添加一组拦牌 * @param[in] ucTile 吃碰杠的牌数据 * @param[in] ucFlag 拦牌标记(吃,碰,杠) * @param[in] ucChair 拦的目标玩家(如果是吃牌就标记的是吃的哪一张) * @return 成功TRUE,失败FALSE */ BOOL CMJSet::AddSet( TILE ucTile[4], BYTE ucFlag, BYTE ucChair) { if (m_nCurrentLength >= MAX_SET_TILES) { return FALSE; } TILE_SET tileSet; /*tileSet.m_ucTile = ucTile;*/ memcpy(tileSet.m_ucTile, ucTile, sizeof(tileSet.m_ucTile)); tileSet.m_ucFlag = ucFlag; tileSet.m_ucChair = ucChair; m_TileSet[m_nCurrentLength] = tileSet; m_nCurrentLength++; return TRUE; } /** * @brief 添加一组拦牌 * @param[in] tagSet 拦牌属性 * @return 成功TRUE,失败FALSE */ BOOL CMJSet::AddSet( TILE_SET tagSet ) { if (m_nCurrentLength >= MAX_SET_TILES) { return FALSE; } m_TileSet[m_nCurrentLength] = tagSet; m_nCurrentLength++; return TRUE; } /** * @brief 添加一组拦牌 * @param[in] mjSet 要添加的拦牌数据结构 * @return 成功TRUE,失败FALSE */ BOOL CMJSet::AddSet( CMJSet& mjSet ) { int nLen = mjSet.CurrentLength(); if (nLen <= 0 || m_nCurrentLength + nLen > MAX_SET_TILES) { return FALSE; } TILE_SET tileSet; for (int i = 0; i < nLen; i++) { mjSet.GetSet(i, tileSet); m_TileSet[m_nCurrentLength + i] = tileSet; } m_nCurrentLength += nLen; return TRUE; } /** * @brief 获取一组拦牌 * @param[in] nPos 要获取的位置 * @param[out] tileset 获取的数据结构 * @return 成功TRUE,失败FALSE */ BOOL CMJSet::GetSet( int nPos, TILE_SET &tileSet ) { if (nPos < 0 || nPos >= m_nCurrentLength) { memset(&tileSet, 0, sizeof(tileSet)); return FALSE; } tileSet = m_TileSet[nPos]; return TRUE; } /** * @brief 设定一组拦牌 * @param[in] nPos 要设定的位置 * @param[in] tileset 设定的数据结构 * @return 成功TRUE,失败FALSE * * 位置不能超过MAX_SET_TILES, 否则设定失败 */ void CMJSet::SetSet( int nPos, TILE_SET &tileSet ) { if (nPos < 0 || nPos >= m_nCurrentLength || nPos >= MAX_SET_TILES) { return ; } m_TileSet[nPos] = tileSet; } /** * @brief 将拦牌数据中的碰牌升级到明杠 * @param[in] ucTile 碰升到杠的牌 * @return 如果拦牌中存在这个牌的碰就成功TRUE,否则失败FALSE */ BOOL CMJSet::TripletToQuadruplet( TILE ucTile ) { for (int i = 0; i < m_nCurrentLength; i++) { if (m_TileSet[i].m_ucTile[0] == ucTile && m_TileSet[i].m_ucFlag == ACTION_TRIPLET) { // 碰升级为杠(补) m_TileSet[i].m_ucTile[3] = ucTile; m_TileSet[i].m_ucFlag = ACTION_QUADRUPLET_PATCH; return TRUE; } } return FALSE; } /** * @brief 清空数据 */ void CMJSet::ReleaseAll() { m_nCurrentLength = 0; TILE_SET tileSet; memset(&tileSet, 0, sizeof(tileSet)); for (int i = 0; i < MAX_SET_TILES; i++) { m_TileSet[i] = tileSet; // 检测附属信息是否需要释放内存 if (m_pParam[i] != NULL) { delete m_pParam[i]; m_pParam[i] = NULL; } } } /** * @brief 设置当前长度 * @param[in] nCurLength 长度 */ void CMJSet::CurrentLength( const int& nCurLength ) { if (nCurLength > MAX_SET_TILES) { return ; } m_nCurrentLength = nCurLength; } /** * @brief 设置拦牌中的附属信息 * @param[in] nPos 要设定的位置 * @param[in] pParam 要设置的拦牌附属信息 * @return 成功TRUE, 失败FALSE */ BOOL CMJSet::SetParam( int nPos, void * pParam ) { if (nPos < 0 || nPos >= MAX_SET_TILES) { return FALSE; } if (m_pParam[nPos] != NULL) { delete m_pParam[nPos]; m_pParam[nPos] = NULL; } m_pParam[nPos] = pParam; return TRUE; } /** * @brief 获取拦牌中设置的附属信息 * @param[in] nPos 要获取的位置 * @return 失败返回NULL */ void * CMJSet::GetParam( int nPos) { if (nPos < 0 || nPos >= MAX_SET_TILES) { return NULL; } return m_pParam[nPos]; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //// CMJGive /// CMJGive::CMJGive() { m_nCurrentLength = 0; memset(&m_TileSet, 0 , sizeof(m_TileSet)); } CMJGive::~CMJGive() { m_nCurrentLength = 0; } /** * @brief 设置出牌数据 * @sa CMJGive */ void CMJGive::SetTile( int nPos, TILE ucTile ) { if (nPos < 0 || nPos >= m_nCurrentLength || nPos >= MAX_GIVE_TILES || ucTile >= TILE_END) { return; } m_ucTile[nPos] = ucTile; } /** * @brief 获取出牌数据 * @sa CMJGive */ TILE CMJGive::GetTile( int nPos ) { if (nPos < 0 || nPos >= m_nCurrentLength) { return TILE_BEGIN; } return m_ucTile[nPos]; } /** * @brief 设置X位置的拦牌信息 * @sa CMJGive */ void CMJGive::SetBlock(int nPos, TILE_SET &tileSet) { if (nPos < 0 || nPos >= m_nCurrentLength) { return ; } m_TileSet[nPos] = tileSet; } /** * @brief 获取X位置的拦牌信息 * @sa CMJGive */ void CMJGive::GetBlock(int nPos, TILE_SET &tileSet) { if (nPos < 0 || nPos >= m_nCurrentLength) { memset(&tileSet, 0, sizeof(tileSet)); return ; } tileSet = m_TileSet[nPos]; } /** * @brief 添加一张牌 * @param[in] ucTile 添加的牌数据 * @param[in] nNbr 添加的牌数 * @param[in] bIncrease 是否要增序增加 * @return 如果设置的位置超过牌的实际最大长度,或者设置的牌数据超过最大值TILE_END都会添加失败 */ BOOL CMJGive::AddTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength + nNbr > MAX_GIVE_TILES || ucTile >= TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } // 添加相应的连续牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile + i; } m_nCurrentLength += nNbr; } else { if (nNbr > 4) { return FALSE; } // 添加nNbr张相同的牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile; } m_nCurrentLength += nNbr; } return TRUE; } /** * @brief 删除一张手牌 * @param[in] ucTile 指定要删除的牌 * @param[in] nNbr 删除的牌数 * @param[in] bIncrease 是否要增序删除 * @return 如果没有这张牌就会返回FALSE * @warning 删除操作会打乱牌的顺序 */ BOOL CMJGive::DelTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength - nNbr < 0) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } CMJGive mjGive; for (int i = 0; i < nNbr; i++) { mjGive.AddTile(ucTile + i, 1, FALSE); } return DelTiles(mjGive); } else { TILE ucTileArray[MAX_GIVE_TILES] = {0}; int nCount = 0; for (int i = 0, j = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile && nCount < nNbr) { nCount++; } else { ucTileArray[j] = m_ucTile[i]; j++; } } if (nCount > 0) { memcpy(m_ucTile, ucTileArray, sizeof(m_ucTile)); m_nCurrentLength -= nCount; return TRUE; } } return FALSE; } /** * @brief 添加一组出牌 * @sa CMJHand */ BOOL CMJGive::AddTiles( CMJGive &tiles ) { int nLenTiles = tiles.CurrentLength(); if (m_nCurrentLength + nLenTiles > MAX_GIVE_TILES) { return FALSE; } for (int i = 0; i < nLenTiles; i++) { m_ucTile[m_nCurrentLength + i] = tiles.GetTile(i); } m_nCurrentLength += nLenTiles; return TRUE; } /** * @brief 删除一组出牌数据 * @sa CMJHand */ BOOL CMJGive::DelTiles( CMJGive &tiles ) { TILE tmp; BYTE ucTile[MAX_GIVE_TILES] = {0}; int i, j, nDelCount = 0; int nLenTiles = tiles.CurrentLength(); for (i = 0; i < nLenTiles; i++) { tmp = tiles.GetTile(i); for (j = 0; j < m_nCurrentLength; j++) { if (tmp == m_ucTile[j] && 0 == ucTile[j]) { ucTile[j] = 1; nDelCount++; break; } } } for (i = 0, j = 0; i < m_nCurrentLength; i++) { if (0 == ucTile[i]) { m_ucTile[j] = m_ucTile[i]; j++; } } m_nCurrentLength -= nDelCount; return TRUE; } /** * @brief 是否包含指定的牌 * @param[in] ucTile 指定的牌 * @param[in] nNbr 包含的数量 * @param[in] bIncrease 是否是增序,最高可查连续数为9,如果检测一个顺子,可以传入参数nNbr = 3, bIncrease = TRUE * @return 如果包含指定数量的牌,返回TRUE,否则返回FALSE */ BOOL CMJGive::IsHave( TILE ucTile, int nNbr, int bIncrease) { if (ucTile > TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } BOOL bFind; int i, j; for (i = 0; i < nNbr; i++) { bFind = FALSE; for (j = 0; j < m_nCurrentLength; j++) { if (m_ucTile[j] == ucTile + i) { bFind = TRUE; break; } } if (!bFind) { return FALSE; } } return TRUE; } else { if (nNbr > 4) { return FALSE; } int nCount = 0; for (int i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile) { nCount++; if (nCount == nNbr) { return TRUE; } } } } return FALSE; } /** * @brief 清空数据 */ void CMJGive::ReleaseAll() { m_nCurrentLength = 0; memset(&m_TileSet, 0 , sizeof(m_TileSet)); for (int i = 0; i < MAX_GIVE_TILES; i++) { m_ucTile[i] = TILE_BEGIN; } } /** * @brief 设置出牌的长度 * @sa CMJHand */ void CMJGive::CurrentLength( const int& nCurLength ) { if (nCurLength > MAX_GIVE_TILES) { return ; } m_nCurrentLength = nCurLength; } /** * @brief 交换指定2个位置上的牌数据 * @sa CMJHand */ BOOL CMJGive::Swap( int nPos1, int nPos2 ) { if (nPos1 < 0 || nPos2 < 0 || nPos1 >= m_nCurrentLength || nPos2 >= m_nCurrentLength || nPos1 == nPos2) { return FALSE; } TILE tempTile; tempTile = m_ucTile[nPos1]; m_ucTile[nPos1] = m_ucTile[nPos2]; m_ucTile[nPos2] = tempTile; return TRUE; } /** * @brief 获取所有牌数据 * @param[in] nGiveTiles 牌数据 * @return 牌长度 */ int CMJGive::GetAllTile( int nGiveTiles[] ) { memset(nGiveTiles, 0, sizeof(nGiveTiles)); for (int i = 0; i < m_nCurrentLength; i++) { nGiveTiles[i] = m_ucTile[i]; } return m_nCurrentLength; } ///// CMJWall //// CMJWall::CMJWall() { m_nCurrentLength = 0; m_nStartPos = 0; m_nEndPos = 0; } CMJWall::~CMJWall() { m_nCurrentLength = 0; } /** * @brief 清空数据 */ void CMJWall::ReleaseAll() { m_nCurrentLength = 0; m_nStartPos = 0; m_nEndPos = 0; for (int i = 0; i < MAX_TOTAL_TILES; i++) { m_ucTile[i] = TILE_BEGIN; } } /** * @brief 填充数据 * @param[in] nLength 要填充的长度 * @param[in] ucClear 是否要全部填充成指定的牌,为0表示自动按顺序填充 * * 如果ucClear是默认为0就会将指定长度的牌按万,条,筒,字,花的顺序填充144张,但当前长度会设置为指定的nLength */ void CMJWall::FillTiles( int nLength, BYTE ucClear) { ReleaseAll(); int i, j; int nCurrentLength = nLength; if (0 == nLength || nLength > MAX_TOTAL_TILES) { // 所有牌 nCurrentLength = MAX_TOTAL_TILES; } if (ucClear != 0) { // 填充指定的牌 for (i = 0; i < nCurrentLength; i++) { AddTile(ucClear); } } else { // 自动按顺序填充 // 万 for (i = 0; i < 9; i++) { for (j = 0; j < 4; j++) { AddTile(TILE_CHAR_1 + i); if (m_nCurrentLength >= nCurrentLength) { return ; } } } // 条 for (i = 0; i < 9; i++) { for (j = 0; j < 4; j++) { AddTile(TILE_BAMBOO_1 + i); if (m_nCurrentLength >= nCurrentLength) { return ; } } } // 筒 for (i = 0; i < 9; i++) { for (j = 0; j < 4; j++) { AddTile(TILE_BALL_1 + i); if (m_nCurrentLength >= nCurrentLength) { return ; } } } // 增加字牌东南西北中发白 for (i = 0; i < 7; i++) { for (j = 0; j < 4; j++) { AddTile(TILE_EAST + i); if (m_nCurrentLength >= nCurrentLength) { return ; } } } // 增加花牌春夏秋冬梅兰竹菊 for (i = 0; i < 8; i++) { AddTile(TILE_FLOWER_CHUN + i); if (m_nCurrentLength >= nCurrentLength) { return ; } } } } /** * @brief 洗牌 * * 打乱当前长度的牌的顺序 */ void CMJWall::RandomTiles() { int nIndex = 0; TILE tmp; /*time_t rawtime; time (&rawtime); srand((GULONG)rawtime);*/ //srand(GetTickCount()); srand((unsigned)time(NULL)); for (int i = 0; i < m_nCurrentLength; i++) { nIndex = rand()%m_nCurrentLength; tmp = m_ucTile[i]; m_ucTile[i] = m_ucTile[nIndex]; m_ucTile[nIndex] = tmp; } } /** * @brief 交换指定2个位置的牌 * @sa CMJHand */ BOOL CMJWall::Swap( int nPos1, int nPos2 ) { if (nPos1 < 0 || nPos2 < 0 || nPos1 >= m_nCurrentLength || nPos2 >= m_nCurrentLength || nPos1 == nPos2) { return FALSE; } TILE tempTile; tempTile = m_ucTile[nPos1]; m_ucTile[nPos1] = m_ucTile[nPos2]; m_ucTile[nPos2] = tempTile; return TRUE; } /** * @brief 添加一张牌 * @param[in] ucTile 添加的牌数据 * @param[in] nNbr 添加的牌数 * @param[in] bIncrease 是否要增序增加 * @return 如果设置的位置超过牌的实际最大长度,或者设置的牌数据超过最大值TILE_END都会添加失败 */ BOOL CMJWall::AddTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength + nNbr > MAX_TOTAL_TILES || ucTile >= TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } // 添加相应的连续牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile + i; } m_nCurrentLength += nNbr; } else { if (nNbr > 4) { return FALSE; } // 添加nNbr张相同的牌 for (int i = 0; i < nNbr; i++) { m_ucTile[m_nCurrentLength + i] = ucTile; } m_nCurrentLength += nNbr; } return TRUE; } /** * @brief 删除一张手牌 * @param[in] ucTile 指定要删除的牌 * @param[in] nNbr 删除的牌数 * @param[in] bIncrease 是否要增序删除 * @return 如果没有这张牌就会返回FALSE * @warning 删除操作会打乱牌的顺序 */ BOOL CMJWall::DelTile( TILE ucTile, int nNbr, int bIncrease) { if (m_nCurrentLength - nNbr < 0) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } CMJWall mjWall; for (int i = 0; i < nNbr; i++) { mjWall.AddTile(ucTile + i, 1, FALSE); } return DelTiles(mjWall); } else { TILE ucTileArray[MAX_TOTAL_TILES] = {0}; int nCount = 0; for (int i = 0, j = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile && nCount < nNbr) { nCount++; } else { ucTileArray[j] = m_ucTile[i]; j++; } } if (nCount > 0) { memcpy(m_ucTile, ucTileArray, sizeof(m_ucTile)); m_nCurrentLength -= nCount; return TRUE; } } return FALSE; } /** * @brief 添加一组牌 * @sa CMJHand */ BOOL CMJWall::AddTiles( CMJWall &tiles ) { int nLenTiles = tiles.CurrentLength(); if (m_nCurrentLength + nLenTiles > MAX_TOTAL_TILES) { return FALSE; } for (int i = 0; i < nLenTiles; i++) { m_ucTile[m_nCurrentLength + i] = tiles.GetTile(i); } m_nCurrentLength += nLenTiles; return TRUE; } /** * @brief 删除一组牌 * @sa CMJHand */ BOOL CMJWall::DelTiles( CMJWall &tiles ) { TILE tmp; BYTE ucTile[MAX_TOTAL_TILES] = {0}; int i, j, nDelCount = 0; int nLenTiles = tiles.CurrentLength(); for (i = 0; i < nLenTiles; i++) { tmp = tiles.GetTile(i); for (j = 0; j < m_nCurrentLength; j++) { if (tmp == m_ucTile[j] && 0 == ucTile[j]) { ucTile[j] = 1; nDelCount++; break; } } } for (i = 0, j = 0; i < m_nCurrentLength; i++) { if (0 == ucTile[i]) { m_ucTile[j] = m_ucTile[i]; j++; } } m_nCurrentLength -= nDelCount; return TRUE; } /** * @brief 设定指定位置上的牌 * @sa CMJHand */ void CMJWall::SetTile( int nPos, TILE ucTile ) { if (nPos < 0 || nPos >= m_nCurrentLength || nPos >= MAX_TOTAL_TILES /*|| ucTile >= TILE_END*/) { return; } m_ucTile[nPos] = ucTile; } /** * @brief 获取指定位置上的牌 * @sa CMJHand */ TILE CMJWall::GetTile( int nPos ) { if (nPos < 0 || nPos >= m_nCurrentLength) { return TILE_BEGIN; } return m_ucTile[nPos]; } /** * @brief 是否包含指定的牌 * @param[in] ucTile 指定的牌 * @param[in] nNbr 包含的数量 * @param[in] bIncrease 是否是增序,最高可查连续数为9,如果检测一个顺子,可以传入参数nNbr = 3, bIncrease = TRUE * @return 如果包含指定数量的牌,返回TRUE,否则返回FALSE */ BOOL CMJWall::IsHave( TILE ucTile, int nNbr, int bIncrease) { if (ucTile > TILE_END) { return FALSE; } if (bIncrease) { if (ucTile >= TILE_CHAR_1 && ucTile <= TILE_CHAR_9) // 万 { if (ucTile + nNbr - 1 > TILE_CHAR_9) { return FALSE; } } else if (ucTile >= TILE_BAMBOO_1 && ucTile <= TILE_BAMBOO_9) // 条 { if (ucTile + nNbr - 1 > TILE_BAMBOO_9) { return FALSE; } } else if (ucTile >= TILE_BALL_1 && ucTile <= TILE_BALL_9) // 筒 { if (ucTile + nNbr - 1 > TILE_BALL_9) { return FALSE; } } else if (ucTile >= TILE_EAST && ucTile <= TILE_BAI) // 字 { if (ucTile + nNbr - 1 > TILE_BAI) { return FALSE; } } else if (ucTile >= TILE_FLOWER_CHUN && ucTile <= TILE_FLOWER_JU) // 花 { if (ucTile + nNbr - 1 > TILE_FLOWER_JU) { return FALSE; } } BOOL bFind; int i, j; for (i = 0; i < nNbr; i++) { bFind = FALSE; for (j = 0; j < m_nCurrentLength; j++) { if (m_ucTile[j] == ucTile + i) { bFind = TRUE; break; } } if (!bFind) { return FALSE; } } return TRUE; } else { if (nNbr > 4) { return FALSE; } int nCount = 0; for (int i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == ucTile) { nCount++; if (nCount == nNbr) { return TRUE; } } } } return FALSE; } /** * @brief 弹出最后一张牌 * @sa CMJHand */ TILE CMJWall::PopTile() { #ifdef WINDOWS_LOGIC // 客户端, 抓牌使用 int nPos = m_nStartPos; TILE tile = m_ucTile[nPos]; SetTile(nPos, -1); m_nStartPos++; if (m_nStartPos >= m_nCurrentLength) { // 最大数量与0接轨 m_nStartPos = m_nStartPos - m_nCurrentLength; } if (tile == 255) { // 这个位置的牌可能被杠(花)补走了, 查找下一个可用的牌 for (BYTE i = 0; i < MAX_TOTAL_TILES; i++) { tile = m_ucTile[m_nStartPos]; SetTile(m_nStartPos, -1); m_nStartPos++; if (m_nStartPos >= m_nCurrentLength) { // 最大数量与0接轨 m_nStartPos = m_nStartPos - m_nCurrentLength; } if (tile != 255) { break; } } } return nPos; #else // 服务端使用 //if (m_nCurrentLength <= 0) //{ // return TILE_BEGIN; //} //m_nCurrentLength--; //TILE tile = m_ucTile[m_nCurrentLength]; //m_ucTile[m_nCurrentLength] = TILE_BEGIN; TILE tile = m_ucTile[m_nStartPos]; int nPos = m_nStartPos; SetTile(nPos, -1); m_nStartPos++; if (m_nStartPos >= m_nCurrentLength) { // 最大数量与0接轨 m_nStartPos = m_nStartPos - m_nCurrentLength; } if (tile == TILE_BEGIN || tile == 255) { _DOUT2("dxhout-Server: PopTile(), 牌值位置: %d, 牌值错误: %d", tile, nPos); // 这个位置的牌可能被杠(花)补走了, 查找下一个可用的牌 for (BYTE i = 0; i < MAX_TOTAL_TILES; i++) { tile = m_ucTile[m_nStartPos]; SetTile(m_nStartPos, -1); m_nStartPos++; if (m_nStartPos >= m_nCurrentLength) { // 最大数量与0接轨 m_nStartPos = m_nStartPos - m_nCurrentLength; } if (tile != TILE_BEGIN && tile != 255) { break; } } } return tile; #endif } /** * @brief 弹出最前一张牌 * @param[in] nPos 弹牌的位置 * @sa CMJWall */ TILE CMJWall::PopFrontTile(int nPos) { #ifdef WINDOWS_LOGIC // 客户端, 补牌使用 if (nPos > 1) { // 指定到弹起位置的牌 nPos = GetEndPos(nPos); // 指定弹出位置的牌 SetTile(nPos, -1); } else { nPos = m_nEndPos; SetTile(nPos, -1); m_nEndPos--; if (m_nEndPos < 0) { // 0与最大数量接轨 m_nEndPos = m_nCurrentLength - abs(m_nEndPos); } } return nPos; #else // 服务端使用 //if (m_nCurrentLength <= 0) //{ // return TILE_BEGIN; //} //// 取最前一张牌 //TILE tile = m_ucTile[0]; //// 删除这张牌 //DelTile(tile); //return tile; int nSrcPos = nPos; if (nPos > 1) { // 指定到弹起位置的牌 nSrcPos = nPos; nPos = GetEndPos(nSrcPos); } else { nPos = m_nEndPos; m_nEndPos--; if (m_nEndPos < 0) { // 0与最大数量接轨 m_nEndPos = m_nCurrentLength - abs(m_nEndPos); } } TILE tile = m_ucTile[nPos]; // 指定弹出位置的牌 SetTile(nPos, -1); _DOUT3("dxhout-Server: 补牌 PopFrontTile(%d), 牌值位置: %d, 牌值: %d", nSrcPos, nPos, tile); return tile; #endif } /** * @brief 设置城墙长度 * @sa CMJHand */ void CMJWall::CurrentLength( const int &nCurLength ) { if (nCurLength > MAX_TOTAL_TILES) { return ; } m_nCurrentLength = nCurLength; } /** * @brief 设置城墙长度 * @sa CMJHand */ int CMJWall::CurrentLength() { int nLen = 0; for (BYTE i = 0; i < m_nCurrentLength; i++) { if (m_ucTile[i] == 255 || m_ucTile[i] == TILE_BEGIN) { continue; } nLen++; } return nLen; } /** * @brief 设置抓牌与补牌的位置 * @param[in] nStartPos 抓牌位置 * @param[in] nEndPos 补牌位置 * @sa CMJWall */ void CMJWall::SetPos(int nStartPos, int nEndPos) { SetStartPos(nStartPos); SetEndPos(nEndPos); } /** * @brief 设置抓牌位置 * @sa CMJWall */ void CMJWall::SetStartPos(int nPos) { if (nPos < 0) { return ; // 没有往后退的可能 } if (nPos >= m_nCurrentLength) { // 最大数量与0接轨 m_nStartPos = nPos - m_nCurrentLength; } else { m_nStartPos = nPos; } } /** * @brief 设置补牌位置 * @sa CMJWall */ void CMJWall::SetEndPos(int nPos) { if (nPos >= m_nCurrentLength) { return ; // 没有往前走的可能 } if (nPos < 0) { // 0与最大数量接轨 m_nEndPos = m_nCurrentLength - abs(nPos); } else { m_nEndPos = nPos; } } /** * @brief 获取抓牌位置 * @sa CMJWall */ int CMJWall::GetStartPos() { return m_nStartPos; } /** * @brief 设置补牌位置 * @param[in] nOffset 获取补牌的偏移位置 * @sa CMJWall */ int CMJWall::GetEndPos(int nOffset) { if (nOffset == 0) { return m_nEndPos; } int nPos, nCount = 0; if (m_nEndPos % 2 == 0) { // 上面一排 for (int i = 0; i < MAX_TOTAL_TILES; i += 2) { nPos = m_nEndPos - i; if (nPos < 0) { // 0与最大数量接轨 nPos = m_nCurrentLength - abs(nPos); } if (m_ucTile[nPos] != 255 || m_ucTile[nPos + 1] != 255) { nCount++; } if (nCount == nOffset) { if (m_ucTile[nPos] == 255) { return nPos + 1; // 如果上面这张牌被抓了则抓下面这张牌 } return nPos; } } } else { // 下面一排 for (int i = 0; i < MAX_TOTAL_TILES; i += 2) { nPos = m_nEndPos - i; if (nPos < 0) { // 0与最大数量接轨 nPos = m_nCurrentLength - abs(nPos); } if (m_ucTile[nPos] != 255 || m_ucTile[nPos - 1] != 255) { nCount++; } if (nCount == nOffset) { if (m_ucTile[nPos - 1] != 255) { return nPos - 1; // 优先抓上面这张牌 } return nPos; } } } return m_nEndPos; } }
[ "china.jeffery@gmail.com" ]
china.jeffery@gmail.com
06124ab494b93be299c908a0f604b7554797ae91
4aee0c6651f68083430a568417a4e6c9c86d88ca
/Source/BuildingEscape/OpenDoor.cpp
6287d1663db1e5eec8b82bdc3082a701bbe5ff82
[ "MIT" ]
permissive
dawsonc623/building-escape
510b59f1e02183504b35bec5c67c7c187ba63fc5
b4dcf41f890425347e73a43b3ee5a98a1dfb35a2
refs/heads/master
2020-09-24T10:09:11.199751
2019-12-07T16:04:37
2019-12-07T16:04:37
225,736,618
0
0
null
null
null
null
UTF-8
C++
false
false
1,540
cpp
// Copyright Cyle Ven Dawson 2019 #include "Components/PrimitiveComponent.h" #include "Engine/World.h" #include "GameFramework/Actor.h" #include "GameFramework/PlayerController.h" #include "OpenDoor.h" // Sets default values for this component's properties UOpenDoor::UOpenDoor() { // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // off to improve performance if you don't need them. PrimaryComponentTick.bCanEverTick = true; // ... } // Called when the game starts void UOpenDoor::BeginPlay() { Super::BeginPlay(); if (!PressurePlate) { UE_LOG(LogTemp, Error, TEXT("%s is missing a PressurePlate"), *(GetOwner()->GetName())) } } float UOpenDoor::GetMassOnPlate() { float TotalMass = 0.0f; if (PressurePlate) { TArray<AActor*> OverlappingActors; PressurePlate->GetOverlappingActors( OverlappingActors ); for (AActor* Actor : OverlappingActors) { TotalMass += Actor->FindComponentByClass<UPrimitiveComponent>()->GetMass(); } } return TotalMass; } // Called every frame void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); if (GetMassOnPlate() >= TriggerMass) { if (!DoorIsOpen) { OnOpenRequest.Broadcast(); DoorIsOpen = true; } } else if (DoorIsOpen) { OnClose.Broadcast(); DoorIsOpen = false; } }
[ "dawsonc623@gmail.com" ]
dawsonc623@gmail.com
453a53b097a9b5bb8435bf959397cf463a5aa48c
74decd580bb41c597a4f16553d3c170e4c9d99f2
/main.cpp
5e26291b544cc74273ade72760549e611266f88d
[]
no_license
Lanilor53/9-LAB
7b96a8858d737cc4a1ea20d1408154fc8405124b
07d903372247f9b8bb188e560341902373e2cc74
refs/heads/master
2022-11-14T02:46:41.368682
2020-07-08T16:59:35
2020-07-08T16:59:35
278,146,956
0
0
null
null
null
null
UTF-8
C++
false
false
3,497
cpp
#include <iostream> #include <array> #include <random> #include <ctime> // some globals // global variables are bad practice btw // but I don't care here :^) std::array<std::array<std::string,3>,3> field; enum GameState { PLAYING, X_WIN, O_WIN, DRAW }; int turnCount; //Setup random std::mt19937 mt(time(nullptr)); // I love Mersenne Twister, best prng ever (maybe I like lcg better, dunno) int RANDOM_MIN = 0; int RANDOM_MAX = 2; std::uniform_int_distribution<int> uid(RANDOM_MIN,RANDOM_MAX); /** * Draw the game field */ void draw_field(){ // Get rid of the space in front of output // Could be a CLion terminal-only bug std::cout << "\b"; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ std::cout << "|" << field[i][j]; } std::cout << "|" << std::endl; } } /** * Get a move from player * Move must come from stdin in format "%d %d" */ void get_move(){ int x,y; std::cout << "Input your move (format: 1 3): "; scanf("%d %d", &x,&y); while(x<1 or x>3 or y<1 or y>3 or field[x-1][y-1]!=" "){ std::cout << "Wrong move!" << std::endl; scanf("%d %d", &x,&y); } field[x-1][y-1] = "X"; turnCount+=1; }; /** * The Great If Tree of Win Checking * @return PLAYING if nobody won, X_WIN if x won, O_WIN if o won, DRAW if field is full */ GameState check_for_end() { // pls no UML // I can break it into 4 different functions, but it would just be stupid std::string winner = " "; // Check diagonals if ((field[0][0] != " " and field[0][0] == field[1][1] and field[1][1] == field[2][2]) or (field[0][2] != " " and field[0][2] == field[1][1] and field[1][1] == field[2][0])) { winner = field[1][1]; } // Check horizontals else if (field[0][0] != " " and field[0][0] == field[0][1] and field[0][1] == field[0][2]) { winner = field[0][0]; } else if (field[1][0] != " " and field[1][0] == field[1][1] and field[1][1] == field[1][2]) { winner = field[1][0]; } else if (field[2][0] != " " and field[2][0] == field[2][1] and field[2][1] == field[2][2]) { winner = field[2][0]; } // Check verticals else if (field[0][0] != " " and field[0][0] == field[1][0] and field[1][0] == field[2][0]) { winner = field[0][0]; } else if (field[0][1] != " " and field[0][1] == field[1][1] and field[1][1] == field[2][1]) { winner = field[0][1]; } else if (field[0][2] != " " and field[0][2] == field[1][2] and field[1][2] == field[2][2]) { winner = field[0][2]; } if (winner == "X") { return X_WIN; } else if (winner == "O") { return O_WIN; } else if (turnCount == 9){ return DRAW; } else{ return PLAYING; } } /** * Make a random AI move */ void ai_move(){ int x,y; x = uid(mt); y = uid(mt); while(field[x][y]!=" "){ x = uid(mt); y = uid(mt); } field[x][y] = "O"; turnCount+=1; } int main() { // and I can break this into more functions too, but it would just be stupid // and barely readable // pls no UML GameState state = PLAYING; turnCount = 0; // Fill the field with empty spaces for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ field[i][j] = " "; } } // REPL while(state==PLAYING) { draw_field(); get_move(); state = check_for_end(); if (state==PLAYING){ ai_move(); state = check_for_end(); } } draw_field(); if(state==X_WIN){ std::cout << "X wins!"; }else if(state==O_WIN){ std::cout << "O wins!"; }else if(state==DRAW){ std::cout << "Draw!"; } return 0; }
[ "lanilor53@gmail.com" ]
lanilor53@gmail.com
73a6f2e75766acf26bb782ec298e5934c6447210
edc6bb870a453226cebed8e82ff421351cdf1778
/cplusplus/C++标准程序库/10.特殊容器.cpp
74fa4658eedc02b118fde50d350f4e73e110bcf7
[]
no_license
evelio521/Books
6984b6364c227154acae149e05c9a2f6e5d6be2c
558fd6da4392ae08a379c52ac7a658212240112f
refs/heads/master
2022-03-23T08:05:51.121884
2019-12-08T12:23:40
2019-12-08T12:23:40
193,418,837
1
2
null
null
null
null
UTF-8
C++
false
false
130
cpp
version https://git-lfs.github.com/spec/v1 oid sha256:ea01698a0712dced3c18423b7da4b3511e8497f93a8acaa4704a061c8b8abc44 size 10446
[ "evelio@126.com" ]
evelio@126.com
eefb11279f1b1a3bcb947f8d7658feece1a8ab8c
238a48db95e4592cf2e45d05637fa7f9ef001730
/ast/include/Expressions.h
841d47e8dd64a6421769c103760a584104c07be4
[]
no_license
xingfancn/GHouan
25012e0548b120186914a005f8f0bf77afb00b03
85f97b6d3381d51b28a628434d97a01af2069fd4
refs/heads/master
2021-05-28T12:22:19.357116
2015-04-20T06:36:37
2015-04-20T06:36:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
76
h
#include <iostream> #include <list> #include <string> using namespace std;
[ "x.fan.cn@gmail.com" ]
x.fan.cn@gmail.com
f13a93a3e4eb88b9667fbecb16d058df76b5cd82
6c4c94b559516be975c7fba00e663a82dd4bb522
/source/examples/codeStyle/headerCodeTemplate.hpp
806d3ed9537ddaa7f3176974a9f05df9b7ab13c5
[]
no_license
Zeke133/stm32
cf0e99f1472d46a2622d244876f64bb922bd516b
3e98299b38226130857b36b200eb54f6c9967752
refs/heads/master
2021-06-26T02:05:35.284377
2019-05-12T18:24:30
2019-05-12T18:24:30
124,997,584
2
1
null
2018-04-19T07:10:57
2018-03-13T05:33:36
C
UTF-8
C++
false
false
1,746
hpp
/** * @file headerCodeTemplate.hpp * @author Denis Homutovski * @version V1.0.0 * @date 12-12-2018 * @brief Class header template. * @details Class header code-style template. * @pre - * @bug - * @warning - * @copyright GNU Public License. */ #ifndef _HEADER_CODE_TEMPLATE_H #define _HEADER_CODE_TEMPLATE_H // using #include <stdint.h> extern "C" { //#include <stdint.h> } // IRQ handlers. Extern "C" macro is needed for correct link procedure. extern "C" { void InterruptHandlerFunction(void); } /** * Class header code-style template. * Here put detailed description ... * ... */ class ClassTempate { // Interrupt handlers need access to 'callbacks'. friend void InterruptHandlerFunction(void); public: /** * Enumeration */ enum class Enumeration : uint8_t { element1 = 0xF4, /// element1 description LAST_ELEMENT }; ClassTempate(/*args*/); ClassTempate(const ClassTempate&) = delete; /**< Delete copy constructor. */ ClassTempate& operator=(const ClassTempate&) = delete; /**< Delete assignment operator. */ void publicFunction(void) const; private: void privateFunction(void); /** * Private struct or bit-field example */ struct PrivateBitField { uint32_t element1 : 2; /**< description of element1 */ }; /** Private constant. */ const uint32_t constant = 1000; static uint8_t staticAtribute1; /**< Description. */ static uint8_t staticAtribute2; /**< Description. */ /** * long description * of attribute */ uint8_t * someAttribute; PrivateBitField structAtribute; /**< Attribute. */ }; #endif
[ "denishomutovski@gmail.com" ]
denishomutovski@gmail.com
a2e5e5e321be9ffd843b015e3f96ca77ad89fd24
647fd50e4a8a0f29470599ac725eea6ee9a3c60e
/fractalCreator/main.cpp
faad9f6e2691b2896036452fbe3955ee99aa30a9
[]
no_license
kazoo-kmt/fractalCreator
1dce6d7b2879f39204e0e16e085a6dbb5ddc57c3
09aec830a44b53470f8c399d31947a6950a6d8c9
refs/heads/master
2021-01-19T06:40:16.417813
2016-06-23T15:42:44
2016-06-23T15:42:44
61,763,839
0
0
null
null
null
null
UTF-8
C++
false
false
757
cpp
// // main.cpp // fractalCreator // // Created by 小林和宏 on 6/21/16. // Copyright © 2016 mycompany. All rights reserved. // #include <iostream> #include "FractalCreator.hpp" #include "RGB.hpp" #include "Zoom.hpp" using namespace std; using namespace caveofprogramming; int main() { FractalCreator fractalCreator(800, 600); fractalCreator.addRange(0.0, RGB(0, 0, 0)); fractalCreator.addRange(0.3, RGB(255, 0, 0)); fractalCreator.addRange(0.5, RGB(255, 255, 0)); fractalCreator.addRange(1.0, RGB(255, 255, 255)); fractalCreator.addZoom(Zoom(295, 202, 0.1)); fractalCreator.addZoom(Zoom(312, 304, 0.1)); fractalCreator.run("test.bmp"); cout << "Finished." << endl; return 0; }
[ "kazuhiro.komoto@students.makeschool.com" ]
kazuhiro.komoto@students.makeschool.com
999d70cfa94fb8f31a8841b9a6bbe6fc53fbad2d
911729e019762ed93b14f49d19c1b7d817c29af6
/Cmodel/CmodelAlg/Still/CmBoxStill/bmp2rgbbox.cpp
283ecaac966e9782902056a9132988916340a025
[]
no_license
JackBro/DragonVer1.0
59590809df749540f70b904f83c4093890031fbb
31b3a97f2aa4a66d2ee518b8e6ae4245755009b1
refs/heads/master
2020-06-19T21:02:17.248852
2014-05-08T02:19:33
2014-05-08T02:19:33
74,833,772
0
1
null
2016-11-26T15:29:10
2016-11-26T15:29:10
null
UTF-8
C++
false
false
655
cpp
#include "internal.h" static const int g_BoxFormats[] = { BMP | (VIDEOCLASS << CLASSSHIFT) }; CBmp2rgbBox::CBmp2rgbBox(void) : CImageUnit(1, 1, "Bmp2Rgb", 0) { this->SetAlgStr(1, (char **)gDefaultAlgType); this->m_pAlg = &this->m_alg1; this->SetInportFormat(0, sizeof(g_BoxFormats) / sizeof(int), (int *)g_BoxFormats); } CBmp2rgbBox::~CBmp2rgbBox(void) { } int CBmp2rgbBox::GetID(void) { return BMP2RGB_BOX | (STILLCLASS << CLASSSHIFT);; } void CBmp2rgbBox::UpdateConfig(void) { //body config } void CBmp2rgbBox::ChoiceAlg(int sel) { sel = 0; this->m_pAlg = &this->m_alg1; CBaseUnit::ChoiceAlg(sel); }
[ "ranger.su@gmail.com" ]
ranger.su@gmail.com
e6bb5cf1f0eca9144761b66b723e9dc198645f12
275de18444d493ad2bde5b6fb41578f87bc65fae
/Engine/src/Core/Layer.h
94faf38501f7425b8c0f3b7fdaba6fb7849d3525
[ "MIT", "LicenseRef-scancode-public-domain" ]
permissive
00mjk/Cross-Platform-Game-Engine
4eda739d4dd43287e4204ea51cdd16edc2d14865
a2743314d2ca71fc7f722d03994e7850d26d83a3
refs/heads/master
2023-04-14T10:18:37.128338
2021-04-14T16:09:47
2021-04-14T16:09:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
735
h
#pragma once #include "Core/core.h" #include "Events/Event.h" class Layer { public: Layer(const std::string& name = "Layer"); virtual ~Layer(); /** * Called when the layer is added to the layer stack */ virtual void OnAttach() {} /** * Called when the layer is removed from the layer stack */ virtual void OnDetach() {} /** * Called 100 times a second */ virtual void OnFixedUpdate() {} /** * Called each frame * @param deltaTime */ virtual void OnUpdate(float deltaTime) {} /** * Called during the ImGui frame */ virtual void OnImGuiRender() {} /** * Called when an event is triggered * @param event */ virtual void OnEvent(Event& event) {} protected: std::string m_debugName; };
[ "thomas_jowett@hotmail.co.uk" ]
thomas_jowett@hotmail.co.uk
23bf3ffb0bd8c7bdf7afb4fa97e3482df22f902e
b72989976e21a43752510146101a11e7184a6476
/GraphIVM-generated-code/Q1/TweetProjectedTupleMapManager.cpp
41e9137049c814a5413c681d6e319d281d45bc4e
[]
no_license
gauravsaxena81/GraphIVM
791c2f90d7a24943664f0e3427ffb26bded20029
d3d1d18206910a41ed6ce4e338488bf53f56ac54
refs/heads/master
2021-01-21T21:54:54.679396
2015-11-20T00:11:24
2015-11-20T00:11:24
34,547,806
0
0
null
null
null
null
UTF-8
C++
false
false
4,224
cpp
#include "DataStructures.hpp" #include "Functions.hpp" #include <string> #include <stdlib.h> #include <iostream> inline static void hashCode(int&h, int& userIdTweetUserId, int& tweetId, std::string& tweetDate ) __attribute__((always_inline)); static void increaseArraySize(TweetProjectedTupleMap* tweetProjectedTupleEntryArray); static void ensureSize(TweetProjectedTupleMap* tweetProjectedTupleMap); extern std::vector<TweetProjectedTupleEntry*> tVector; __inline static void ensureSize(TweetProjectedTupleMap* tweetProjectedTupleMap) { if(tweetProjectedTupleMap->size >= tweetProjectedTupleMap->capacity * 0.8) { increaseArraySize(tweetProjectedTupleMap); } } static void increaseArraySize(TweetProjectedTupleMap* tweetProjectedTupleMap) { int newcapacity = tweetProjectedTupleMap->capacity * 16; TweetProjectedTupleEntry** newprojectedTupleEntryArray = new TweetProjectedTupleEntry*[newcapacity](); for(int i = 0; i < tweetProjectedTupleMap->capacity; i++) { TweetProjectedTupleEntry* p = tweetProjectedTupleMap->tweetProjectedTupleEntryArray[i]; if(p) { do { int h = 31; hashCode(h , p->userIdTweetUserId , p->tweetId , p->tweetDate ); h = h & (newcapacity - 1); TweetProjectedTupleEntry* nextP = p->next; p->next = newprojectedTupleEntryArray[h]; newprojectedTupleEntryArray[h] = p; p = nextP; } while (p); } } delete(tweetProjectedTupleMap->tweetProjectedTupleEntryArray); tweetProjectedTupleMap->tweetProjectedTupleEntryArray = newprojectedTupleEntryArray; tweetProjectedTupleMap->capacity = newcapacity; } __inline static void hashCode(int& h, int& userIdTweetUserId, int& tweetId, std::string& tweetDate ) { h ^= userIdTweetUserId + 0x9e3779b9 + (h<<6) + (h>>2); h ^= tweetId + 0x9e3779b9 + (h<<6) + (h>>2); h ^= std::hash<std::string>()(tweetDate) + 0x9e3779b9 + (h<<6) + (h>>2); } TweetProjectedTupleEntry* putTweetProjectedTuple(TweetProjectedTupleMap* tweetProjectedTupleMap, int& userIdTweetUserId, int& tweetId, std::string& tweetDate ) { int h = 31; hashCode(h , userIdTweetUserId , tweetId , tweetDate ); h = h & (tweetProjectedTupleMap->capacity - 1); TweetProjectedTupleEntry* candidate = tweetProjectedTupleMap->tweetProjectedTupleEntryArray[h]; TweetProjectedTupleEntry* lastP = NULL; while(candidate) { if( candidate->userIdTweetUserId == (userIdTweetUserId) && candidate->tweetId == (tweetId) && candidate->tweetDate .compare (tweetDate) ) { candidate->count++; return candidate; } else { lastP = candidate; candidate = candidate->next; } } TweetProjectedTupleEntry* p = new TweetProjectedTupleEntry; //TweetProjectedTupleEntry* p = tVector.back(); //tVector.pop_back(); p->userIdTweetUserId = userIdTweetUserId; p->tweetId = tweetId; p->tweetDate = tweetDate; if(!lastP) tweetProjectedTupleMap->tweetProjectedTupleEntryArray[h] = p; else lastP->next = p; tweetProjectedTupleMap->size++; ensureSize(tweetProjectedTupleMap); return p; } int deleteTweetProjectedTupleIfZero(TweetProjectedTupleMap* tweetProjectedTupleMap , int& userIdTweetUserId , int& tweetId , std::string& tweetDate ) { int h = 31; hashCode(h , userIdTweetUserId , tweetId , tweetDate ); h = h & (tweetProjectedTupleMap->capacity - 1); TweetProjectedTupleEntry* candidate = tweetProjectedTupleMap->tweetProjectedTupleEntryArray[h]; TweetProjectedTupleEntry* lastP = NULL; while(candidate) { if( candidate->userIdTweetUserId == userIdTweetUserId && candidate->tweetId == tweetId && candidate->tweetDate == tweetDate ) { if(--candidate->count == 0) { if(lastP) { lastP->next = candidate->next; } else tweetProjectedTupleMap->tweetProjectedTupleEntryArray[h] = NULL; delete candidate; } return --(tweetProjectedTupleMap->size); } else { candidate = candidate->next; } } return -1; }
[ "gsaxena81@gmail.com" ]
gsaxena81@gmail.com
0414c238ee922ad09225e389cedbcab4dceec781
fd0c132f979ecd77168511c6f4d276c480147e57
/ios/Classes/Native/mscorlib_System_Collections_Generic_List_1_Enumera2453438371.h
f1620247ae7edfc6ead3205b0da279cf5bb32a0c
[]
no_license
ping203/gb
9a4ab562cc6e50145660d2499f860e07a0b6e592
e1f69a097928c367042192619183d7445de90d85
refs/heads/master
2020-04-23T02:29:53.957543
2017-02-17T10:33:25
2017-02-17T10:33:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,467
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Collections.Generic.List`1<SettingItem> struct List_1_t2918708697; // SettingItem struct SettingItem_t3549587565; #include "mscorlib_System_ValueType3507792607.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Collections.Generic.List`1/Enumerator<SettingItem> struct Enumerator_t2453438371 { public: // System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::l List_1_t2918708697 * ___l_0; // System.Int32 System.Collections.Generic.List`1/Enumerator::next int32_t ___next_1; // System.Int32 System.Collections.Generic.List`1/Enumerator::ver int32_t ___ver_2; // T System.Collections.Generic.List`1/Enumerator::current SettingItem_t3549587565 * ___current_3; public: inline static int32_t get_offset_of_l_0() { return static_cast<int32_t>(offsetof(Enumerator_t2453438371, ___l_0)); } inline List_1_t2918708697 * get_l_0() const { return ___l_0; } inline List_1_t2918708697 ** get_address_of_l_0() { return &___l_0; } inline void set_l_0(List_1_t2918708697 * value) { ___l_0 = value; Il2CppCodeGenWriteBarrier(&___l_0, value); } inline static int32_t get_offset_of_next_1() { return static_cast<int32_t>(offsetof(Enumerator_t2453438371, ___next_1)); } inline int32_t get_next_1() const { return ___next_1; } inline int32_t* get_address_of_next_1() { return &___next_1; } inline void set_next_1(int32_t value) { ___next_1 = value; } inline static int32_t get_offset_of_ver_2() { return static_cast<int32_t>(offsetof(Enumerator_t2453438371, ___ver_2)); } inline int32_t get_ver_2() const { return ___ver_2; } inline int32_t* get_address_of_ver_2() { return &___ver_2; } inline void set_ver_2(int32_t value) { ___ver_2 = value; } inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t2453438371, ___current_3)); } inline SettingItem_t3549587565 * get_current_3() const { return ___current_3; } inline SettingItem_t3549587565 ** get_address_of_current_3() { return &___current_3; } inline void set_current_3(SettingItem_t3549587565 * value) { ___current_3 = value; Il2CppCodeGenWriteBarrier(&___current_3, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "nguyenhaian@outlook.com" ]
nguyenhaian@outlook.com
44e92b06a1c745e61a19fd3c6e6d2a98f5373b7c
e198d6305f2b6264fbb1a7bdfafdf88454143bb4
/contests/srm/MaxTriangle.cpp
463a3fa7698647f14a7dc63b9dd84cecbeb1d639
[]
no_license
Yan-Song/burdakovd
e4ba668b5db19026dbf505fb715be0456d229527
0b3b90943b3f8e2341ed96a99e25c1dc314b3095
refs/heads/master
2021-01-10T14:39:45.788552
2013-01-02T10:51:02
2013-01-02T10:51:02
43,729,389
0
0
null
null
null
null
UTF-8
C++
false
false
422
cpp
#line 48 "MaxTriangle.cpp" #include <string> #include <vector> #include <iostream> #include <vector> #include <map> #include <queue> #include <deque> #include <set> #include <algorithm> using namespace std; class MaxTriangle { public: double calculateArea(int A, int B) { return 0; } }; // Powered by FileEdit // Powered by TZTester 1.01 [25-Feb-2003] // Powered by CodeProcessor
[ "icqkill@gmail.com" ]
icqkill@gmail.com
e6250086fb358517ed57abe879cf84e0afb09872
9a0d361d26ea092972a689663b9a8228f9018caa
/AlgorithmC++/Algorithm/ProblemSolving/BaekJoon/Sort/BaekJoon2230.cpp
92fe28d2ce0a15b877bd9e56c1d166c38a0af26a
[]
no_license
Dev-RubinJo/AlgorithmCpp
b555e3e2b39565d92a64cfeed9890d26589647e3
cac74f7a3bdb4797b28ca4d3bc7f1618fc56c1f4
refs/heads/master
2023-06-03T08:52:35.733749
2021-06-22T14:32:04
2021-06-22T14:32:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,065
cpp
// // BaekJoon2230.cpp // Algorithm // // Created by YooBin Jo on 2020/07/31. // Copyright © 2020 YooBin Jo. All rights reserved. // #include <stdio.h> #include <iostream> #include <algorithm> using namespace std; int main(void) { int n, first = 0, second = 1; int m, ans = 1000000001; int a[100001] = {0, }; cin >> n >> m; for(int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); while(first < n) { int temp = a[second] - a[first]; if(temp < m) { second += 1; continue; } if(temp == m) { cout << m; return 0; } ans = min(ans, temp); first += 1; } cout << ans; return 0; } // for(int i = 0; i < n; i++) { // for(int j = i; j < n; j++) { // if(a[j] - a[i] < min && i != j && a[j] - a[i] >= m) // min = a[j] - a[i]; // if(min == m) { // cout << m; // return 0; // } // } // }
[ "dbqlsdl1234@naver.com" ]
dbqlsdl1234@naver.com
aa0b20ff1a14d84dfe85f4728a7ede5d43323643
1ec55de30cbb2abdbaed005bc756b37eafcbd467
/Nacro/SDK/FN_BrickSimple_Window_F_classes.hpp
7b57d30255dab15eb6dbcb08995ab9ce8dc87e46
[ "BSD-2-Clause" ]
permissive
GDBOI101/Nacro
6e91dc63af27eaddd299b25351c82e4729013b0b
eebabf662bbce6d5af41820ea0342d3567a0aecc
refs/heads/master
2023-07-01T04:55:08.740931
2021-08-09T13:52:43
2021-08-09T13:52:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
653
hpp
#pragma once // Fortnite (1.8) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass BrickSimple_Window_F.BrickSimple_Window_F_C // 0x0000 (0x10D8 - 0x10D8) class ABrickSimple_Window_F_C : public AParent_BuildingWall_C { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass BrickSimple_Window_F.BrickSimple_Window_F_C"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "68667854+Pakchunk@users.noreply.github.com" ]
68667854+Pakchunk@users.noreply.github.com
b1b353d76b7d41e071cbdfcd0867beaf834f2786
83c439bf68736a6fb331283397c559ba56b4d6b6
/Window/통신프로그램/통신프로그램/Form1.h
02c8e1bbc63873bec45983f375b49a45cb57db97
[]
no_license
5-SH/PREZENTAINER
03b61a8b94709fb1f993a37a88c3082d393b6f2f
0609e4c9fa8cc057da05bcca3c2d569d8b1051c4
refs/heads/master
2021-05-29T07:05:30.656733
2015-08-09T10:19:52
2015-08-09T10:19:52
null
0
0
null
null
null
null
UHC
C++
false
false
8,459
h
#pragma once #include <stdio.h> #include "stdafx.h" #include "SerialPort.h" #include <windows.h> #include <msclr\marshal_cppstd.h> #include <boost/thread/thread.hpp> #include "shellapi.h" //#include <assert.h> CSerialPort com1; char name[20]="\\\\.\\COM"; bool check=false; bool overlap_check=false; void PressVirtualKeyboad(BYTE vk) { // Simulate a key press keybd_event( vk, vk, 0, 0 ); // Simulate a key release keybd_event( vk, vk, KEYEVENTF_KEYUP, 0); } void PressLeft() { PressVirtualKeyboad(VK_RETURN); } void PressRight() { PressVirtualKeyboad(VK_RIGHT); } void run_program() { com1.Open (name, CBR_115200, 8, ONESTOPBIT, NOPARITY); com1.SetTimeout (10, 10, 1); char buff[6]="0"; //int n; while (1) { //printf ("\nWRITE: "); //scanf ("%s", buff); //n = strlen(buff); // com1.Write (buff, n); if(check==false) { break; } com1.Read (buff, 6); if(strcmp(buff,"0")==0) {} else { PressVirtualKeyboad(VK_RIGHT); // printf ("READ: %s\n", buff); strcpy(buff,"0"); } } com1.Close(); } /* http://stackoverflow.com/questions/4666635/run-threads-of-class-member-function-in-c 참조사이트 class runnable { public: virtual ~runnable() {} static DWORD WINAPI run_thread(LPVOID args) { runnable *prunnable = static_cast<runnable*>(args); return prunnable->run(); } protected: virtual DWORD run() = 0; //derived class must implement this! }; class Thread : public runnable //derived from runnable! { public: void newthread() { CreateThread(NULL, 0, &runnable::run_thread, this, 0, NULL); } protected: DWORD run() //implementing the virtual function! { // .....your thread execution code..... while(1) { printf("asd\n"); } } }; */ namespace 통신프로그램 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Form1에 대한 요약입니다. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: 생성자 코드를 여기에 추가합니다. // } protected: /// <summary> /// 사용 중인 모든 리소스를 정리합니다. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Label^ label1; protected: private: System::Windows::Forms::TextBox^ textBox1; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Button^ button4; private: /// <summary> /// 필수 디자이너 변수입니다. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// 디자이너 지원에 필요한 메서드입니다. /// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오. /// </summary> void InitializeComponent(void) { System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid)); this->label1 = (gcnew System::Windows::Forms::Label()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->label2 = (gcnew System::Windows::Forms::Label()); this->button4 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // label1 // this->label1->AccessibleName = L""; this->label1->Font = (gcnew System::Drawing::Font(L"굴림", 9, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(129))); this->label1->Location = System::Drawing::Point(12, 15); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(100, 23); this->label1->TabIndex = 0; this->label1->Text = L"Port_number"; this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click); // // textBox1 // this->textBox1->Location = System::Drawing::Point(107, 17); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(127, 21); this->textBox1->TabIndex = 1; // // button1 // this->button1->Location = System::Drawing::Point(12, 60); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(69, 51); this->button1->TabIndex = 2; this->button1->Text = L"입력"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // button2 // this->button2->Location = System::Drawing::Point(87, 60); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(69, 51); this->button2->TabIndex = 2; this->button2->Text = L"실행"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // label2 // this->label2->Location = System::Drawing::Point(12, 38); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(100, 19); this->label2->TabIndex = 3; this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; // // button4 // this->button4->Location = System::Drawing::Point(166, 60); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(68, 51); this->button4->TabIndex = 4; this->button4->Text = L"중지"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click_1); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(7, 12); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(246, 131); this->Controls->Add(this->button4); this->Controls->Add(this->label2); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Controls->Add(this->textBox1); this->Controls->Add(this->label1); this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon"))); this->Name = L"Form1"; this->Text = L"블루투스 통신"; this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion String^ firstName; private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { firstName = textBox1->Text; label2->Text = "Port :"+firstName; check=false; overlap_check=false; // WinExec("C:/Windows/System32/rundll32.EXE",SW_SHOW); WinExec("C:/Windows/System32/rundll32.exe shell32.dll,Control_RunDLL bthprops.cpl,,2",SW_SHOW); // C:\Windows\System32 } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { // CSerialPort com1; // char name[20]="\\\\.\\COM"; if(overlap_check==false) { check=true; msclr::interop::marshal_context context; std::string num = context.marshal_as<std::string>(firstName); //http://www.cplusplus.com/forum/windows/137117/ 참고자료 strcat(name, num.c_str()); //포트입력버튼에서 입력한 포트번호로 포트통로열기! label2->Text = "Port :"+firstName+" 연결중"; boost::thread t(&run_program); overlap_check=true; } else { } } private: System::Void button4_Click_1(System::Object^ sender, System::EventArgs^ e) { check=false; overlap_check=false; label2->Text = "Port :"+firstName+" 연결 중지"; } private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) { } private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { } }; }
[ "darkstars77@naver.com" ]
darkstars77@naver.com
cec8ff43d53caf1a47fbf57787530fa01a142a82
8a87f5b889a9ce7d81421515f06d9c9cbf6ce64a
/3rdParty/boost/1.78.0/boost/fusion/sequence/intrinsic/at_c.hpp
327798c0ce0719d29c0d43b0fef6bb2fd810ea69
[ "BSL-1.0", "Apache-2.0", "BSD-3-Clause", "ICU", "Zlib", "GPL-1.0-or-later", "OpenSSL", "ISC", "LicenseRef-scancode-gutenberg-2020", "MIT", "GPL-2.0-only", "CC0-1.0", "LicenseRef-scancode-autoconf-simple-exception", "LicenseRef-scancode-pcre", "Bison-exception-2.2", "LicenseRef-scancode...
permissive
arangodb/arangodb
0980625e76c56a2449d90dcb8d8f2c485e28a83b
43c40535cee37fc7349a21793dc33b1833735af5
refs/heads/devel
2023-08-31T09:34:47.451950
2023-08-31T07:25:02
2023-08-31T07:25:02
2,649,214
13,385
982
Apache-2.0
2023-09-14T17:02:16
2011-10-26T06:42:00
C++
UTF-8
C++
false
false
537
hpp
/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(FUSION_AT_C_08252008_0308) #define FUSION_AT_C_08252008_0308 #include <boost/fusion/support/config.hpp> #include <boost/fusion/sequence/intrinsic/at.hpp> #endif
[ "frank@arangodb.com" ]
frank@arangodb.com
1b77a784848ec0fb291f191a02a80a681a88e8ec
337e351f12c583c6c86e6a8e7d6edeb0e0a43107
/C++/RecordingAudioSolution/RecordingAudio/Content/ModelRenderer.h
bd1dcbeae57dcd2fd6ec0998b60ec73d71e1e94b
[]
no_license
dngoins/HololensDXTutorials
de7d3ba8f25f633557b98f51828ac73d671266a4
532907a7be6005e9f3483e26727324b3392c02f3
refs/heads/master
2020-04-02T06:11:29.362302
2018-10-27T21:16:03
2018-10-27T21:16:03
64,985,100
30
5
null
2016-10-01T00:17:51
2016-08-05T03:16:10
C++
UTF-8
C++
false
false
4,057
h
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once #include "..\Common\DeviceResources.h" #include "..\Common\DeviceResourcesWindowed.h" #include "..\Common\StepTimer.h" #include "ShaderStructures.h" namespace MatMeshModLibrary { class Mesh; } namespace RecordingAudio { // This sample renderer instantiates a basic rendering pipeline. class ModelRenderer { public: ModelRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources, const std::wstring& filename, bool useRelativePath); void CreateWindowSizeDependentResources(); void CreateDeviceDependentResources(); void ReleaseDeviceDependentResources(); void Update(const DX::StepTimer& timer); void SetColorFilter(DirectX::XMFLOAT4 color); void Render(bool isStereo); // Repositions the sample hologram. void PositionHologram(Windows::UI::Input::Spatial::SpatialPointerPose^ pointerPose); // Repositions the sample hologram, using direct measures. void PositionHologram(Windows::Foundation::Numerics::float3 pos, Windows::Foundation::Numerics::float3 dir); // Property accessors. void SetPosition(Windows::Foundation::Numerics::float3 pos) { m_position = pos; } Windows::Foundation::Numerics::float3 GetPosition() { return m_position; } void Pause() { m_pauseState = PauseState::Pausing; } void Unpause() { m_pauseState = PauseState::Unpausing; } bool IsLoaded() { return m_modelLoaded; } private: void CreateVertexBuffer(ID3D11Device* device, const MatMeshModLibrary::Mesh& mesh, ID3D11Buffer** vertexBuffer) const; private: enum class PauseState { Unpaused = 0, Pausing, Paused, Unpausing, }; // Cached pointer to device resources. std::shared_ptr<DX::DeviceResources> m_deviceResources; // Direct3D resources for cube geometry. Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout; Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer; Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer; Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader; Microsoft::WRL::ComPtr<ID3D11GeometryShader> m_geometryShader; Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader; Microsoft::WRL::ComPtr<ID3D11Buffer> m_modelConstantBuffer; Microsoft::WRL::ComPtr<ID3D11Buffer> m_filterColorBuffer; // System resources for cube geometry. RecordingAudio::Mesh::ModelConstantBuffer m_modelConstantBufferData; uint32 m_indexCount = 0; DirectX::XMFLOAT4 m_filterColorData = { 1, 1, 1, 1 }; // Variables used with the rendering loop. bool m_loadingComplete = false; float m_degreesPerSecond = 45.f; Windows::Foundation::Numerics::float3 m_position = { 0.f, 0.f, -2.f }; PauseState m_pauseState = PauseState::Unpaused; double m_rotationOffset = 0; // If the current D3D Device supports VPRT, we can avoid using a geometry // shader just to set the render target array index. bool m_usingVprtShaders = false; std::wstring m_filename; bool m_modelLoaded = false; bool m_useRelativePath = true; Platform::String ^ m_modelFileName; // Get the gaze direction relative to the given coordinate system. Windows::Foundation::Numerics::float3 m_headPosition = { 1.f, 1.f, 1.f }; Windows::Foundation::Numerics::float3 m_headDirection = { 1.f, 1.f, 1.f }; Windows::Foundation::Numerics::float3 m_up = { 0.f, 1.f, 0.f }; }; }
[ "dngoins@hotmail.com" ]
dngoins@hotmail.com
5bf48d9469f233ff9e7b9695ba23ac61ce84334c
447eaed2be4b70609d79cbdbd9e12a97ac7a4900
/Week06/lfoyh6591/ITES/main.cpp
b8e7b7f7ea39d6729d57f94170a4cca22ce040e1
[]
no_license
ps-snu/21-book-study
a143f5cec68085e4343fa720f8ecf47e2673cc1b
b1febfbca4dc78a03965226cbb470d3779bbfcb2
refs/heads/main
2023-08-04T12:51:05.904100
2021-09-27T06:59:06
2021-09-27T06:59:06
368,067,928
0
0
null
null
null
null
UTF-8
C++
false
false
837
cpp
#include <bits/stdc++.h> using namespace std; int n, k; int process(){ queue<int> input; int sum =0; int ret = 0; long long before = 1983; for(int i=0; i<n; i++){ int x; if(i==0){ x = 1984; } else{ before = (long long)(before*214013 + 2531011)%(long long )pow(2, 32); x = before%10000 + 1; } sum += x; input.push(x); if(sum>k){ while(sum>k){ sum-=input.front(); input.pop(); } } if(sum==k){ ret++; sum-=input.front(); input.pop(); } } return ret; } int main(){ int C; cin >> C; for(int c=0; c<C; c++){ cin >> k >> n; cout << process() << endl; } }
[ "lfoyh6591@naver.com" ]
lfoyh6591@naver.com
a9093a2530cbe9e4bfd3add44ab12df5a1d92f6e
8aa6ce9d32f52050687d6f9cac142a49901b996a
/WindowAdm/admproperty.cpp
6eaf605ec067fdc7d9734a80e6dd0ce7ee31f44d
[]
no_license
stellaem/PsyCenterFive_06
acae02ed17cdd21e63ec34c6c7b5f7aa48f56c4d
cc72dcbb85f7b9f9c513e8a5ecc4d1172959b938
refs/heads/master
2023-07-04T01:02:21.949021
2021-08-03T06:12:38
2021-08-03T06:12:41
384,893,210
0
0
null
null
null
null
UTF-8
C++
false
false
1,620
cpp
#include "admproperty.h" #include "objects/cellclass.h" #include <QSqlQuery> #include <QDebug> AdmProperty::AdmProperty(QObject *parent) : QObject(parent), modelPlace(new ModelPlace), modelTask(new ModelTasks), modelSpecialist(new ModelSpecialist), date (QDate().currentDate()) { reloadListVCellClass(date); setModelTask(date); } QList<QVariant> AdmProperty::getListVCellClass() { return listVCellClass; } void AdmProperty::reloadListVCellClass(QDate date) { listVCellClass.clear(); QSqlQuery *q = new QSqlQuery(); q->prepare("select id from class where DATE(date_and_time) = :date"); q->bindValue(":date", date.toString("yyyy-MM-dd")); q->exec(); if(q->next()) { CellClass *c = new CellClass(q->value("id").toInt()); QVariant var = QVariant::fromValue(c); listVCellClass.append(var); } } QVariant AdmProperty::getModelPlace() { QVariant var = QVariant::fromValue(modelPlace); return var; } QVariant AdmProperty::getModelTask() { QVariant var = QVariant::fromValue(modelTask); return var; } QVariant AdmProperty::getModelSpecialist() { QVariant var = QVariant::fromValue(modelSpecialist); return var; } void AdmProperty::setModelTask(QDate date) { modelTask->refresh(date); } QDate &AdmProperty::getDate() { return date; } void AdmProperty::setDate(QDate newDate) { if (date == newDate) return; date = newDate; reloadListVCellClass(date); setModelTask(date); emit dateChanged(); } QString AdmProperty::getStrDate() { return date.toString("dddd dd.MM.yyyy"); }
[ "37835683+stellaem@users.noreply.github.com" ]
37835683+stellaem@users.noreply.github.com
a2c755ff7392e6279cdf3a7539b8b8be3451d37f
a29fddee35ea576cab64f2fe0f10de1a97abc981
/src/billie/src/billie.cpp
0cc1389f79e63f96bf798a3573ec2dec6faa1048
[]
no_license
lp02781/skripsi_billie
e3f9378c29731eed40d7914421ff105e9fac758d
0c527aaac0cdc5a1f935727b4f090b047d1212b4
refs/heads/master
2022-01-13T19:59:55.533252
2019-03-05T03:50:31
2019-03-05T03:50:31
173,869,067
0
0
null
null
null
null
UTF-8
C++
false
false
6,532
cpp
#include <ros/ros.h> #include <geometry_msgs/PoseStamped.h> #include <geometry_msgs/TwistStamped.h> #include <mavros_msgs/SetMode.h> #include <mavros_msgs/CommandBool.h> #include <std_msgs/String.h> #include <mavros_msgs/State.h> #include <termios.h> #include <stdio.h> #include <math.h> #include <stdlib.h> #include <unistd.h> #include <std_msgs/Float64.h> namespace plant_sim { // Global so it can be passed from the callback fxn to main static double control_effort = 0.0; static bool reverse_acting = false; } using namespace plant_sim; FILE *velocity_data; void keyboardCommands(); void keyCommandIndicator(const std_msgs::String::ConstPtr& msg); void velocity_callback(const geometry_msgs::TwistStamped::ConstPtr& msg); void velocity_trajectory(const ros::TimerEvent& event); void ControlEffortCallback(const std_msgs::Float64& control_effort_input); geometry_msgs::TwistStamped velocity; geometry_msgs::TwistStamped qc_velocity; geometry_msgs::PoseStamped position; mavros_msgs::CommandBool arm_cmd; mavros_msgs::SetMode offb_set_mode; mavros_msgs::State current_state; std_msgs::Float64 setpoint; std_msgs::Float64 plant_state; ros::ServiceClient set_mode_client; ros::ServiceClient arming_client; ros::Publisher position_publisher; ros::Publisher setpoint_pub; ros::Publisher servo_state_pub; void state_callback(const mavros_msgs::State::ConstPtr& msg); void doTakeOff(); int velocity_ctrl = 0; int position_ctrl = 0; int velocity_trajectory_begin = 0; ros::Time last_keyboard_command; ros::Time starting_trajectory; char g_key_command; bool g_key_command_allow = true; double gain_constant = 0; double waktu_mulai = 0; double waktu_sekarang = 0; double velocity_reff = 0; double current_error = 0; double total_error = 0; double error_prv = 0; double dt = 0.01; double current_velocity = 0; double dv = 0; const double KEYBOARD_CALL_DURATION = 0.5; const double SAMPLING_TIME = 0.01; int main(int argc, char **argv) { ros::init(argc,argv, "velocity_trapezium"); ros::NodeHandle nh; position_publisher = nh.advertise<geometry_msgs::PoseStamped>("mavros/setpoint_position/local", 10); ros::Publisher velocity_publisher = nh.advertise<geometry_msgs::TwistStamped>("mavros/setpoint_velocity/cmd_vel",10); setpoint_pub = nh.advertise<std_msgs::Float64>("setpoint",1); ros::Subscriber key_command_subscriber = nh.subscribe<std_msgs::String>("key_commands", 1000, keyCommandIndicator); ros::Subscriber state_subscriber = nh.subscribe<mavros_msgs::State>("mavros/state",10, state_callback); ros::Subscriber velocity_subscriber = nh.subscribe<geometry_msgs::TwistStamped>("mavros/local_position/velocity",100,velocity_callback); ros::Subscriber sub = nh.subscribe("control_effort", 1, ControlEffortCallback ); servo_state_pub = nh.advertise<std_msgs::Float64>("state", 1); set_mode_client = nh.serviceClient<mavros_msgs::SetMode>("mavros/set_mode"); arming_client = nh.serviceClient<mavros_msgs::CommandBool>("mavros/cmd/arming"); ros::Timer velocity_trajectory_interrupt = nh.createTimer(ros::Duration(SAMPLING_TIME),velocity_trajectory); ros::Rate rate(100); ROS_INFO_STREAM("Program dimulai "); while(ros::ok()) { ros::spinOnce(); if(position_ctrl == 1) { position_publisher.publish(position); } if(velocity_ctrl == 1) { velocity_publisher.publish(velocity); rate.sleep(); fprintf(velocity_data, "%f, %f, %f\n",velocity_reff, current_velocity, velocity.twist.linear.x); } //The rate at which the program will be able to receive keyboard commands. if (ros::Time::now() - last_keyboard_command > ros::Duration(KEYBOARD_CALL_DURATION)) { last_keyboard_command = ros::Time::now(); keyboardCommands(); } } fclose(velocity_data); } void keyboardCommands(){ if (g_key_command_allow) { switch(g_key_command){ case 'a': ROS_INFO_STREAM("Tombol A telah ditekan"); position_ctrl = 0; velocity_ctrl = 1; velocity_trajectory_begin = 1; starting_trajectory = ros::Time::now(); waktu_mulai = starting_trajectory.toSec(); g_key_command = 'x'; break; case ']': ROS_INFO_STREAM("Take off ke ketinggian 3 meter"); doTakeOff(); break; } } return; } void doTakeOff() { position_ctrl = 1; velocity_ctrl = 0; position.pose.position.x = 0; position.pose.position.y = 0; position.pose.position.z = 3; velocity_data = fopen("velocity_data.dat","w"); while(current_state.mode != "OFFBOARD") { arm_cmd.request.value = true; arming_client.call(arm_cmd); offb_set_mode.request.custom_mode = "OFFBOARD"; set_mode_client.call(offb_set_mode); position_publisher.publish(position); ros::spinOnce(); } } void state_callback(const mavros_msgs::State::ConstPtr& msg) { current_state = *msg; } void keyCommandIndicator(const std_msgs::String::ConstPtr& msg){ g_key_command = *msg->data.c_str(); } void velocity_trajectory(const ros::TimerEvent& event) { ros::spinOnce(); if(velocity_trajectory_begin == 1) { waktu_sekarang = ros::Time::now().toSec(); gain_constant = waktu_sekarang- waktu_mulai; if(gain_constant < 5) { velocity_reff = 0; } else if(gain_constant >= 5 && gain_constant < 15) { velocity_reff = exp(gain_constant-10)/(exp(gain_constant-10)+1); } else if(gain_constant >= 15 && gain_constant <=25) { velocity_reff = 1; } else if(gain_constant > 25 && gain_constant <= 35) { velocity_reff = 1 - (exp(gain_constant-30)/(exp(gain_constant-30)+1)); } else if(gain_constant > 35 && gain_constant <= 40) { velocity_reff = 0; } else if(gain_constant > 40) { velocity_reff = 0; velocity.twist.linear.x = 0; velocity_trajectory_begin = 0; position_ctrl = 1; velocity_ctrl = 0; } setpoint.data = velocity_reff; setpoint_pub.publish(setpoint); current_velocity = qc_velocity.twist.linear.x; plant_state.data = current_velocity; servo_state_pub.publish(plant_state); velocity.twist.linear.x = current_velocity + control_effort; ROS_INFO_STREAM("besarnya kecepatan kendali " << velocity.twist.linear.x); ROS_INFO_STREAM("besarnya referensi adalah " << velocity_reff); ROS_INFO_STREAM("besarnya kecepatan sekarang " << current_velocity); } } void velocity_callback(const geometry_msgs::TwistStamped::ConstPtr& msg) { qc_velocity = *msg; } void ControlEffortCallback(const std_msgs::Float64& control_effort_input) { // the stabilizing control effort if (reverse_acting) { control_effort = -control_effort_input.data; } else { control_effort = control_effort_input.data; } }
[ "lp02781@gmail.com" ]
lp02781@gmail.com
6490f3bb3ee7d4f9fdb7120cd7cb310eb03f9dde
b1fe97794d2d42c66a9a63d862274108dc838a7b
/Yellow/week_2/1Decompose/main.cpp
064919b79a562a0378fd18138fa51f2446006e46
[]
no_license
zinjkov/erayacpp
3833613d7f68ed60f1f4c1a4804cebca13c653ea
cecf2cd1ada9bc3e68b10f8d3d2862b8fa93a6d2
refs/heads/master
2020-05-17T01:30:46.378103
2019-09-21T15:12:40
2019-09-21T15:12:40
183,428,382
0
0
null
null
null
null
UTF-8
C++
false
false
4,318
cpp
#include <string> #include <iostream> #include <cassert> #include <vector> #include <map> #include <algorithm> using namespace std; enum class QueryType { NewBus, BusesForStop, StopsForBus, AllBuses }; struct Query { QueryType type; string bus; string stop; vector<string> stops; }; istream& operator >> (istream& is, Query& q) { // Реализуйте эту функцию string operation_code; is >> operation_code; if (operation_code == "NEW_BUS") { q.type = QueryType::NewBus; string bus; is >> q.bus; int stop_count; is >> stop_count; q.stops.resize(stop_count); for (int i = 0; i < stop_count; i++) { string stop; is >> stop; q.stops[i] = stop; } } else if (operation_code == "BUSES_FOR_STOP") { q.type = QueryType::BusesForStop; is >> q.stop; } else if (operation_code == "STOPS_FOR_BUS") { q.type = QueryType::StopsForBus; cin >> q.bus; } else if (operation_code == "ALL_BUSES") { q.type = QueryType::AllBuses; } return is; } struct BusesForStopResponse { // Наполните полями эту структуру string stop; vector<string> buses; }; ostream& operator << (ostream& os, const BusesForStopResponse& r) { if (!r.stop.empty()) { os << "Stop " << r.stop << ":"; for (auto &&bus : r.buses) { os << " " << bus; } } else { os << "No stop"; } return os; } struct StopsForBusResponse { // Наполните полями эту структуру string bus; vector<string> stops; }; ostream& operator << (ostream& os, const StopsForBusResponse& r) { if (!r.bus.empty()) { os << "Bus " << r.bus << ":"; for(auto &&stop : r.stops) { os << " " << stop; } }else { os << "No bus"; } return os; } struct AllBusesResponse { // Наполните полями эту структуру map<string, vector<string>> all_busses; }; ostream& operator << (ostream& os, const AllBusesResponse& r) { if (!r.all_busses.empty()) { for (auto && bus : r.all_busses) { os << "Bus " << bus.first << ":"; for (auto &&stop : bus.second) { os << " " << stop; } os << "\n"; } } else { os << "No buses"; } return os; } class BusManager { public: void AddBus(const string& bus, const vector<string>& stops) { // Реализуйте этот метод m_bus_to_stop.emplace(bus, stops); for (auto &&stop : stops) { m_stop_to_bus[stop].emplace_back(bus); } } BusesForStopResponse GetBusesForStop(const string& stop) const { // Реализуйте этот метод BusesForStopResponse buses{}; try { buses.buses = m_stop_to_bus.at(stop); buses.stop = stop; } catch (...) {} return buses; } StopsForBusResponse GetStopsForBus(const string& bus) const { StopsForBusResponse stops = {}; try { stops.stops = m_bus_to_stop.at(bus); stops.bus = bus; } catch (...) {} return stops; } AllBusesResponse GetAllBuses() const { return {m_bus_to_stop}; } private: map<string, vector<string>> m_bus_to_stop; map<string, vector<string>> m_stop_to_bus; }; // Не меняя тела функции main, реализуйте функции и классы выше int main() { int query_count; Query q; cin >> query_count; BusManager bm; for (int i = 0; i < query_count; ++i) { cin >> q; switch (q.type) { case QueryType::NewBus: bm.AddBus(q.bus, q.stops); break; case QueryType::BusesForStop: cout << bm.GetBusesForStop(q.stop) << endl; break; case QueryType::StopsForBus: cout << bm.GetStopsForBus(q.bus) << endl; break; case QueryType::AllBuses: cout << bm.GetAllBuses() << endl; break; } } return 0; }
[ "zinjkov.su@gmail.com" ]
zinjkov.su@gmail.com
0a4e9d14c3a6754d2bff7e57c2280e37ed3bd838
4e62733f42024b74809fe79d8e08110a5f001ec8
/SECONDO ANNO/II SEMESTRE/Calcolatori elettronici/Esami passati/Assembly/2016-07-06_22/es1.cpp
ce05f7d3ef6877ae41fdcb6bf413e9d0572e41dd
[]
no_license
Guray00/IngegneriaInformatica
f8f56a310ac7585f105cbf1635240df2d7a43095
752ac634bb7f03556fd8587bf5f5a295843a76b9
refs/heads/master
2023-08-31T12:23:44.354698
2023-08-28T15:19:22
2023-08-28T15:19:22
234,406,145
233
80
null
2023-07-04T14:02:14
2020-01-16T20:31:24
C++
UTF-8
C++
false
false
407
cpp
#include "cc.h" cl::cl(st1 ss) { for (int i = 0; i < 4; i++) { v1[i] = v2[i] = ss.vi[i]; v3[i] = ss.vi[i] + ss.vi[i]; } } cl::cl(st1 s1, long ar2[]) { for (int i=0; i<4; i++) { v1[i] = v2[i] = s1.vi[i]; v3[i] = ar2[i]; } } cl cl::elab1(char ar1[], st2 s2) { st1 s1; for (int i = 0; i < 4; i++) s1.vi[i] = ar1[i]; cl cla(s1); for (int i = 0; i < 4; i++) cla.v3[i] = s2.vd[i]; return cla; }
[ "g.loni1@studenti.unipi.it" ]
g.loni1@studenti.unipi.it
521c3d1d63838b20b5fc196bd21ea3a08aa6ffb0
10e61da5f747a8d7de6493fcd67514dcadce46ad
/lib/header_format_counter_dif.cc
c1a5ab032cec6d67088235d1c0f794c5ffd46665
[]
no_license
apruhd/gr-TFMv3
55239d90c442ff3d86e1c6713269d6c97c391b41
e071ec975d501a72acea2205ba30c83772d58d2a
refs/heads/master
2023-04-12T02:09:37.749822
2021-04-22T23:37:33
2021-04-22T23:37:33
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,732
cc
/* -*- c++ -*- */ /* * Copyright 2021 gr-TFMv2 author. * * SPDX-License-Identifier: GPL-3.0-or-later */ #include <gnuradio/digital/header_buffer.h> #include <gnuradio/math.h> #include <string.h> #include <volk/volk_alloc.hh> #include <iomanip> #include <iostream> #include <gnuradio/io_signature.h> #include <TFMv3/header_format_counter_dif.h> namespace gr { namespace TFMv3 { header_format_counter_dif::sptr header_format_counter_dif::make(const std::string& access_code, int threshold, int bps) { return header_format_counter_dif::sptr( new header_format_counter_dif(access_code, threshold, bps)); } header_format_counter_dif::header_format_counter_dif(const std::string& access_code, int threshold, int bps) : header_format_default(access_code, threshold, bps) { d_counter = 0; } header_format_counter_dif::~header_format_counter_dif() {} bool header_format_counter_dif::format(int nbytes_in, const unsigned char* input, pmt::pmt_t& output, pmt::pmt_t& info) { // Creating the output pmt copies data; free our own here when done. volk::vector<uint8_t> bytes_out(header_nbytes()); digital::header_buffer header(bytes_out.data()); header.add_field64(d_access_code, d_access_code_len); header.add_field16((uint16_t)(nbytes_in)); header.add_field16((uint16_t)(nbytes_in)); header.add_field16((uint16_t)(d_bps)); header.add_field16((uint16_t)(d_counter)); // Package output data into a PMT vector output = pmt::init_u8vector(header_nbytes(), bytes_out.data()); d_counter++; return true; } size_t header_format_counter_dif::header_nbits() const { return d_access_code_len + 8 * 4 * sizeof(uint16_t); } bool header_format_counter_dif::header_ok() { // confirm that two copies of header info are identical uint16_t len0 = d_hdr_reg.extract_field16(0); uint16_t len1 = d_hdr_reg.extract_field16(16); return (len0 ^ len1) == 0; } int header_format_counter_dif::header_payload() { uint16_t len = d_hdr_reg.extract_field16(0); uint16_t bps = d_hdr_reg.extract_field16(32); uint16_t counter = d_hdr_reg.extract_field16(48); d_bps = bps; d_info = pmt::make_dict(); d_info = pmt::dict_add( d_info, pmt::intern("payload symbols"), pmt::from_long(8 * len / d_bps)); d_info = pmt::dict_add(d_info, pmt::intern("bps"), pmt::from_long(bps)); d_info = pmt::dict_add(d_info, pmt::intern("counter"), pmt::from_long(counter)); return static_cast<int>(len); } } /* namespace TFMv3 */ } /* namespace gr */
[ "apruhd@gmail.com" ]
apruhd@gmail.com
d857bc680bc4a309765e89e14cb30270ceadd4dc
ec68c973b7cd3821dd70ed6787497a0f808e18e1
/Cpp/SDK/BP_BasicLight_A_parameters.h
b86739acbdb28068dd335b83e2a884c6b99a405b
[]
no_license
Hengle/zRemnant-SDK
05be5801567a8cf67e8b03c50010f590d4e2599d
be2d99fb54f44a09ca52abc5f898e665964a24cb
refs/heads/main
2023-07-16T04:44:43.113226
2021-08-27T14:26:40
2021-08-27T14:26:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
931
h
#pragma once // Name: Remnant, Version: 1.0 /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Parameters //--------------------------------------------------------------------------- // Function BP_BasicLight_A.BP_BasicLight_A_C.Destroy All Light Components struct ABP_BasicLight_A_C_Destroy_All_Light_Components_Params { }; // Function BP_BasicLight_A.BP_BasicLight_A_C.UserConstructionScript struct ABP_BasicLight_A_C_UserConstructionScript_Params { }; // Function BP_BasicLight_A.BP_BasicLight_A_C.ReceiveBeginPlay struct ABP_BasicLight_A_C_ReceiveBeginPlay_Params { }; // Function BP_BasicLight_A.BP_BasicLight_A_C.ExecuteUbergraph_BP_BasicLight_A struct ABP_BasicLight_A_C_ExecuteUbergraph_BP_BasicLight_A_Params { }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
d009094336dd9455d9457b7ca39c242c580054e2
6605c134bf5d60774c88edfd9eefb176776d561a
/VytlaEashan_Rectangle.h
bceca3fb0764b5a9f7d82d61974f7f1d7356f4f4
[]
no_license
EashanVytla/Circle
2788f316334c9d5962632b9398be1785ea99cf3f
0ac935e6376582171b2c8287711f544749898d51
refs/heads/master
2022-07-04T11:48:19.736003
2020-05-06T00:20:03
2020-05-06T00:20:03
261,611,698
0
0
null
null
null
null
UTF-8
C++
false
false
1,220
h
// Eashan Vytla // Grade: 9 // 3/30/2020 // Honors Computer Programming 3 // Project: Checkbook // File: circle.h // More Projects on Github: https://github.com/EashanVytla // The purpose of this program is to introduce object oriented programming to calculate the circumfrence of a circle #ifndef _Rectangle_H #define _Rectangle_H class Rectangle { public: //constructors Rectangle(); Rectangle(const Rectangle&); //member functions void SetLength(float); void SetWidth(float); double Area(); double Perimeter(); private: //data float length; float width; }; //default constructor Rectangle::Rectangle() { length = 0; width = 0; } //copy constructor Rectangle::Rectangle(const Rectangle& Object) { length = Object.length; width = Object.width; } //Method to set the length of the rectangle void Rectangle::SetLength(float UserLength) { length = UserLength; } //Method to set the width of the rectangle void Rectangle::SetWidth(float UserWidth) { width = UserWidth; } //Method to find the area of the rectangle double Rectangle::Area() { return length * width; } //Project 12-3: Method to find perimeter of the rectangle double Rectangle::Perimeter() { return 2 * (length + width); } #endif
[ "40774462+Eashan1234@users.noreply.github.com" ]
40774462+Eashan1234@users.noreply.github.com
17d1b86b455a60a3834d9dc3e3450727c420694f
ce37a5b4208319a6e917447f89f4930224e88f42
/source/ashes/renderer/RendererCommon/IcdObject.cpp
d2b1796ae915a5e1db413668d924dc573aa33053
[ "MIT" ]
permissive
DragonJoker/Ashes
916e63a759b2130d65ae40f3cfdd3d896774894b
6ceaf2b452c9778cbeafc8fb52ad97f8a02d4997
refs/heads/master
2023-08-03T07:04:25.952879
2023-06-23T23:10:30
2023-07-20T16:42:55
116,478,178
284
16
MIT
2023-07-20T16:42:57
2018-01-06T11:40:03
C++
UTF-8
C++
false
false
137
cpp
/** *\file * InlineUniformBlocks.cpp *\author * Sylvain Doremus */ #include "renderer/RendererCommon/IcdObject.hpp" namespace ashes { }
[ "dragonjoker59@hotmail.com" ]
dragonjoker59@hotmail.com
d59d76bf3bcab182fac2c198508dbf9410676cca
d7dd9be1814517298c6f2f6b801d5f7e8187aa0f
/solutions/2Sum.cpp
181e89358e552cedc0670d3bd07f26995384ecb1
[]
no_license
chang-yu0928/algorithms
18f5116e1229f754b0d21749bf767ee48d516328
f4cea9d61578d2f0886f605a1047bffad4ba4739
refs/heads/master
2021-04-12T04:51:06.538497
2015-09-11T06:58:29
2015-09-11T06:58:29
41,877,149
1
0
null
null
null
null
UTF-8
C++
false
false
840
cpp
#include <iostream> #include <unordered_map> #include <vector> using namespace std; vector<int> twoSum(vector<int> &numbers, int target) { unordered_map<int, int> container; vector<int> result; for(int i = 0;i < numbers.size();i ++) { int temp = target-numbers[i]; if(container.find(temp) != container.end()){ result.push_back(i+1); result.push_back(container[temp]+1); break; }else{ container[numbers[i]] = i; } } return result; } int main(){ vector<int> input; input.push_back(3); input.push_back(2); input.push_back(4); input.push_back(5); vector<int> output = twoSum(input, 6); for(int i = 0;i < output.size();i ++){ cout<<output[i]<<" "; } cout<<endl; return 0; }
[ "chang.yu@west.cmu.edu" ]
chang.yu@west.cmu.edu
594266c01a181d32569ebb4dee4dffbd20219d10
8de4524c7b23a12acd20f4d594a813ad74dcbaa4
/DeviceAdapters/WieneckeSinske/WS.cpp
4ad50afdf2af23df8c389458e12bc31d8d31b9e0
[]
no_license
haiimz1234/mmCoreAndDevices
1de2efc063a2e3dfb48e25487c6f2a86bb45a64e
f3550dc754d0fdc3e51fd34159bf30365691c777
refs/heads/main
2023-08-22T01:48:06.590268
2023-08-10T21:44:13
2023-08-10T21:44:13
370,597,847
0
0
null
2021-05-25T07:07:03
2021-05-25T07:07:03
null
UTF-8
C++
false
false
9,782
cpp
/////////////////////////////////////////////////////////////////////////////// // FILE: WS.cpp // PROJECT: Micro-Manager // SUBSYSTEM: DeviceAdapters //----------------------------------------------------------------------------- // DESCRIPTION: Wienecke & Sinske protcol communication // // // AUTHOR: S3L GmbH, info@s3l.de, www.s3l.de, 08/27/2021 // COPYRIGHT: S3L GmbH, Rosdorf, 2021 // LICENSE: This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation. // // You should have received a copy of the GNU Lesser General Public // License along with the source distribution; if not, write to // the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // Boston, MA 02111-1307 USA // // This file 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. // // IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES. // #ifdef WIN32 #include <windows.h> #else #include <arpa/inet.h> #endif #include "FixSnprintf.h" #include "WS.h" #include <string> #include <math.h> #include "ModuleInterface.h" #include <sstream> #include <assert.h> /////////////////////////////////////////////////////////////////////////////// // WSComponent // WSComponent::WSComponent(WS* ws): ws_(ws) { ws_->AddReceiveMessageHandler(this); } WSComponent::~WSComponent() { ws_->RemoveReceiveMessageHandler(this); } /////////////////////////////////////////////////////////////////////////////// // WSMessageTools: Class containing WS message tools // int WSMessageTools::GetNumber(std::string& msg, int& result) { result = 0; size_t startNumber = msg.find('='); if(startNumber == std::string::npos) return ERR_INVALID_MESSAGE_DATA; std::string tmp = ""; for (unsigned int i=(unsigned int)startNumber+1; i < msg.length()-1; i++) tmp += msg[i]; result = std::stoi(tmp, nullptr, 10); return DEVICE_OK; } /////////////////////////////////////////////////////////////////////////////// // WS // WS::WS(): port_("Undefined"), portInitialized_(false), receiveThread_(0), hasSendReadAnswer_(false), sendReadAnswer_(), sendReadMessage_() { } WS::~WS() { if (receiveThread_ != 0) delete(receiveThread_); } int WS::Initialize(MM::Device* device, MM::Core* core) { device_ = device; core_ = core; ClearPort(); receiveThread_ = new WSReceiveThread(this); receiveThread_->Start(); return DEVICE_OK; } int WS::Send(std::string msg) { // Prepare command according to WS Protocol std::vector<unsigned char> preparedCommand = std::vector<unsigned char>(msg.data(), msg.data() + msg.length()); // send command int ret = core_->WriteToSerial(device_, port_.c_str(), &(preparedCommand[0]), (unsigned long)msg.length()); if (ret != DEVICE_OK) return ret; return DEVICE_OK; } int WS::SendRead(std::string msg, std::string& answer, int timeoutMilliSec) { sendReadMessage_ = msg; hasSendReadAnswer_ = false; // send message out int res = Send(msg); if(res != DEVICE_OK) return res; // wait for answer MM::MMTime dTimeout = MM::MMTime (timeoutMilliSec*1000); MM::MMTime start = core_->GetCurrentMMTime(); while(!hasSendReadAnswer_ && ((core_->GetCurrentMMTime() - start) < dTimeout)) { CDeviceUtils::SleepMs(20); } if (!hasSendReadAnswer_) return ERR_TIMEOUT; // return answer answer = sendReadAnswer_; return DEVICE_OK; } int WS::Receive(std::string msg) { // check if it is an expected answer for SendRead function if(IsAnswer(sendReadMessage_, msg)) { sendReadAnswer_ = msg; hasSendReadAnswer_ = true; } // call all registered ReceiveMessageHandlers for(unsigned int i= 0; i< receiveMessageCallbackClasses_.size(); i++) receiveMessageCallbackClasses_[i]->ReceiveMessageHandler(msg); return DEVICE_OK; } bool WS::IsAnswer(std::string& question, std::string& answer) { return (question.compare(0,3,answer,0,3) == 0); } /* Appends a data byte to the WS command array. */ int WS::AppendByte(std::vector<unsigned char>& command, int& nextIndex, unsigned char byte) { // add data byte command[nextIndex++] = byte; return DEVICE_OK; } int WS::ClearPort() { // Clear contents of serial port const unsigned int bufSize = 255; unsigned char clear[bufSize]; unsigned long read = bufSize; int ret; while (read == bufSize) { ret = core_->ReadFromSerial(device_, port_.c_str(), clear, bufSize, read); if (ret != DEVICE_OK) return ret; } return DEVICE_OK; } int WS::AddReceiveMessageHandler(WSComponent* component) { receiveMessageCallbackClasses_.push_back(component); return DEVICE_OK; } int WS::RemoveReceiveMessageHandler(WSComponent* component) { for(unsigned int i = 0; i< receiveMessageCallbackClasses_.size(); i++) { if(receiveMessageCallbackClasses_[i] == component) { receiveMessageCallbackClasses_.erase(receiveMessageCallbackClasses_.begin()+i); return DEVICE_OK; } } return DEVICE_OK; } /////////////////////////////////////////////////////////////////////////////// // WSMessageParser // // Utility class for WSReceiveThread // Takes an input stream and returns WS messages in the GetNextMessage method // WSMessageParser::WSMessageParser(unsigned char* inputStream, long inputStreamLength) : index_(0) { inputStream_ = inputStream; inputStreamLength_ = inputStreamLength; } /* * Find a message starting with '[' and ends with ']'. */ int WSMessageParser::GetNextMessage(unsigned char* nextMessage, int& nextMessageLength) { bool startFound = false; bool endFound = false; nextMessageLength = 0; long remainder = index_; while ( (endFound == false) && (index_ < inputStreamLength_) && (nextMessageLength < messageMaxLength_) ) { if (inputStream_[index_] == '[') { startFound = true; } else if (inputStream_[index_] == ']' ) { endFound = true; } if (startFound) { nextMessage[nextMessageLength] = inputStream_[index_]; nextMessageLength++; } index_++; } if (endFound) { nextMessage[nextMessageLength] = 0; nextMessageLength++; return 0; } else { // no more complete message found, return the whole stretch we were considering: for (long i = remainder; i < inputStreamLength_; i++) nextMessage[i-remainder] = inputStream_[i]; nextMessageLength = inputStreamLength_ - remainder; return -1; } } /////////////////////////////////////////////////////////////////////////////// // WSReceiveThread // // Thread that continuously monitors messages from WS. // WSReceiveThread::WSReceiveThread(WS* ws) : ws_ (ws), stop_ (true), debug_(true), intervalUs_(10000) // check every 10 ms for new messages, { } WSReceiveThread::~WSReceiveThread() { Stop(); wait(); ws_->core_->LogMessage(ws_->device_, "Destructing WSReceiveThread", true); } void WSReceiveThread::interpretMessage(unsigned char* message) { std::string msg(reinterpret_cast<char*>(message)); ws_->Receive(msg); } int WSReceiveThread::svc() { ws_->core_->LogMessage(ws_->device_, "Starting WSReceiveThread", true); unsigned long dataLength; unsigned long charsRead = 0; unsigned long charsRemaining = 0; unsigned char rcvBuf[WS_RCV_BUF_LENGTH]; memset(rcvBuf, 0, WS_RCV_BUF_LENGTH); while (!stop_) { do { dataLength = WS_RCV_BUF_LENGTH - charsRemaining; int ret = ws_->core_->ReadFromSerial(ws_->device_, ws_->port_.c_str(), rcvBuf + charsRemaining, dataLength, charsRead); if (ret != DEVICE_OK) { std::ostringstream oss; oss << "WSReceiveThread: ERROR while reading from serial port, error code: " << ret; ws_->core_->LogMessage(ws_->device_, oss.str().c_str(), false); } else if (charsRead > 0) { WSMessageParser parser(rcvBuf, charsRead + charsRemaining); do { unsigned char message[WS_RCV_BUF_LENGTH]; int messageLength; ret = parser.GetNextMessage(message, messageLength); if (ret == 0) { // Report if (debug_) { std::ostringstream os; os << "WSReceiveThread incoming message: "; for (int i=0; i< messageLength; i++) { os << std::hex << (unsigned int)message[i] << " "; } ws_->core_->LogMessage(ws_->device_, os.str().c_str(), true); } // and do the real stuff interpretMessage(message); } else { // no more messages, copy remaining (if any) back to beginning of buffer if (debug_ && messageLength > 0) { std::ostringstream os; os << "WSReceiveThread no message found!: "; for (int i = 0; i < messageLength; i++) { os << std::hex << (unsigned int)message[i] << " "; rcvBuf[i] = message[i]; } ws_->core_->LogMessage(ws_->device_, os.str().c_str(), true); } memset(rcvBuf, 0, WS_RCV_BUF_LENGTH); for (int i = 0; i < messageLength; i++) { rcvBuf[i] = message[i]; } charsRemaining = messageLength; } } while (ret == 0); } } while ((charsRead != 0) && (!stop_)); CDeviceUtils::SleepMs(intervalUs_/1000); } ws_->core_->LogMessage(ws_->device_, "WSReceiveThread finished", true); return 0; } void WSReceiveThread::Start() { stop_ = false; activate(); }
[ "steffen.leidenbach@s3l.de" ]
steffen.leidenbach@s3l.de
124c6da76e169dd01e216549256091d81bf9c3b2
2a9ba22e3cc5f5d337ece346fdabe4a41d717506
/Sparky-core/src/graphics/layers/tilelayer.h
866dc74b7a1751769264576c240ade527643186d
[]
no_license
LordRhys/Sparky
8e3b9702b34482e6cd051002326ac5ed45ce3d3a
3685d3b6bfa5820803b91d3160adcc2a26c89293
refs/heads/master
2021-01-21T12:03:29.603919
2015-08-30T13:37:48
2015-08-30T13:37:48
33,830,268
0
0
null
null
null
null
UTF-8
C++
false
false
221
h
#pragma once #include "layer.h" #include "..\batchrenderer2D.h" namespace sparky{ namespace graphics{ class TileLayer : public Layer { public: TileLayer(Shader* shader); virtual ~TileLayer(); }; } }
[ "lordrhystower@gmail.com" ]
lordrhystower@gmail.com
bd0e07934dd076d1b99468f061677c270acc3dc2
9d17a9914edb2349ef8b633635bf32ea92c95e94
/10394 Twin Primes.cpp
06adee471641286dee0d1b8a3c97252c07d565a0
[ "Apache-2.0" ]
permissive
Diusrex/UVA-Solutions
b17886ef32b78758cb372d164f439f7558a14831
54c46a96078dbe6d7bd4d403244cdd3378c3dcff
refs/heads/master
2023-09-06T08:16:25.911161
2023-08-18T20:36:38
2023-08-18T20:36:38
15,208,914
106
122
Apache-2.0
2023-01-29T15:46:28
2013-12-15T19:00:57
C++
UTF-8
C++
false
false
840
cpp
#include <cstdio> #include <vector> #include <utility> using namespace std; int main() { vector<pair<int, int> > pairs(100001); vector<bool> isPrime(18409202, true); int pos = 1; int previous = 0; for (long long i = 3; pos <= 100000; i += 2) { if (isPrime[i]) { for (long long j = i * i; j < 18409202; j += i) { isPrime[j] = false; } if (i == previous + 2) { pairs[pos].first = previous; pairs[pos].second = i; ++pos; } previous = i; } } int num; while (scanf("%d", &num) == 1) { printf("(%d, %d)\n", pairs[num].first, pairs[num].second); } }
[ "killakan002@hotmail.com" ]
killakan002@hotmail.com
e5cc508939a853f80102a8cbd8dc06f355c62670
d3851d88332e5f2b87c40bcc7634ce0c013b555a
/test/test_list.cc
2e191483c3b32510ffc051cf22aedd455450b1f8
[]
no_license
archilleu/ldb
e0c4fe2d8526ba3cdc77c779e63e740540ac32f9
6690cd29202e17a98e7d01b8780ef44118fd7faf
refs/heads/master
2021-01-24T09:19:26.288204
2020-04-02T09:02:12
2020-04-02T09:02:12
69,447,957
0
0
null
null
null
null
UTF-8
C++
false
false
7,493
cc
//--------------------------------------------------------------------------- #include "test_inc.h" #include "../src/string_value.h" #include "../src/list_value.h" //--------------------------------------------------------------------------- using namespace db; using namespace db::test; //--------------------------------------------------------------------------- int main(int, char**) { TestTitle(); //构造 { ListValue list; TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //拷贝移动等构造 { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { list.PushBack(ObjectPtr(new StringValue(std::to_string(i)))); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); ListValue copy(list); ListValue copy1 = list; TEST_ASSERT(false == copy.Empty()); TEST_ASSERT(size == copy.Size()); TEST_ASSERT(false == copy1.Empty()); TEST_ASSERT(size == copy1.Size()); ListValue move(std::move(copy)); ListValue move1 = std::move(copy1); TEST_ASSERT(false == move.Empty()); TEST_ASSERT(size == move.Size()); TEST_ASSERT(false == move1.Empty()); TEST_ASSERT(size == move1.Size()); ListValue assgin = move; ListValue assgin_move = std::move(move); TEST_ASSERT(false == assgin.Empty()); TEST_ASSERT(size == assgin.Size()); TEST_ASSERT(false == assgin_move.Empty()); TEST_ASSERT(size == assgin_move.Size()); for(size_t i=0; i<size; i++) { TEST_ASSERT(static_cast<long>(i) == assgin_move.Front().AsStringPtr()->AsInt()); assgin_move.PopFront(); } } //iterator { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { list.PushFront(ObjectPtr(new StringValue(std::to_string(i)))); } size_t num = 0; for(ListValue::ConstIterator it=list.Begin(); it!=list.End(); it++) { TEST_ASSERT(static_cast<long>(num++)==it->AsStringPtr()->AsInt()); } num = 0; for(ListValue::Iterator it=list.Begin(); it!=list.End(); it++) { long test = static_cast<long>((num++)*2); std::string s = std::to_string(test); ObjectPtr sp = *it; *sp.AsStringPtr() = s; } num = 0; for(ListValue::ConstIterator it=list.Begin(); it!=list.End(); it++) { long test = static_cast<long>((num++)*2); TEST_ASSERT(test==it->AsStringPtr()->AsInt()); } num = --size; for(ListValue::ReverseIterator it=list.RBegin(); it!=list.REnd(); it++) { long test = static_cast<long>((num--)*2); TEST_ASSERT(static_cast<long>(test)==it->AsStringPtr()->AsInt()); } } //font back { ListValue list; list.PushBack(ObjectPtr(new StringValue("a"))); TEST_ASSERT(std::string("a") == list.Front().AsStringPtr()->val()); *list.Front().AsStringPtr() = "b"; TEST_ASSERT(std::string("b") == list.Front().AsStringPtr()->val()); *list.Back().AsStringPtr() = "a"; TEST_ASSERT(std::string("a") == list.Back().AsStringPtr()->val()); } //push pop front { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { list.PushFront(ObjectPtr(new StringValue(std::to_string(i)))); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); for(size_t i=0; i<size; i++) { TEST_ASSERT(static_cast<long>(i) == list.Front().AsStringPtr()->AsInt()); list.PopFront(); } TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //push pop back { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { list.PushBack(ObjectPtr(new StringValue(std::to_string(i)))); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); for(size_t i=size-1; static_cast<ssize_t>(i)>=0; i--) { TEST_ASSERT(static_cast<long>(i) == list.Back().AsStringPtr()->AsInt()); list.PopBack(); } TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //insert erase { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { ListValue::Iterator it = list.Insert(list.Begin(), ObjectPtr(new StringValue(std::to_string(i)))); TEST_ASSERT(static_cast<long>(i) == it->AsStringPtr()->AsInt()); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); for(size_t i=size-1; static_cast<ssize_t>(i)>=0; i--) { ListValue::Iterator it = list.Erase(--list.End()); TEST_ASSERT(list.End() == it); } TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //insert erase { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { ListValue::Iterator it = list.Insert(list.Begin(), ObjectPtr(new StringValue(std::to_string(i)))); TEST_ASSERT(static_cast<long>(i) == it->AsStringPtr()->AsInt()); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); list.Erase(list.Begin(), list.End()); TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //clear { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { ListValue::Iterator it = list.Insert(list.Begin(), ObjectPtr(new StringValue(std::to_string(i)))); TEST_ASSERT(static_cast<long>(i) == it->AsStringPtr()->AsInt()); } TEST_ASSERT(false == list.Empty()); TEST_ASSERT(size == list.Size()); list.Clear(); TEST_ASSERT(true == list.Empty()); TEST_ASSERT(0 == list.Size()); } //sort { ListValue list; size_t size = 1024; for(size_t i=0; i<size; i++) { list.PushBack(ObjectPtr(new StringValue(std::to_string(std::rand())))); } list.Sort([](const ObjectPtr& left, const ObjectPtr& right)-> bool { return left.AsStringPtr()->AsInt()<right.AsStringPtr()->AsInt(); }); for(ListValue::ConstIterator it=list.Begin(); it!=--list.End(); it++) { double v1 = it->AsStringPtr()->AsDouble(); double v2 = (++it)->AsStringPtr()->AsDouble(); it--; TEST_ASSERT(v1 <= v2); } } //modifiers { std::string k1 = "1"; std::string k2 = "2"; std::string k3 = "3"; std::string k4 = "4"; std::string k5 = "5"; ListValue list; ObjectPtr o1(new StringValue(k1)); list.PushFront(o1); list.PushFront(new StringValue(k2)); list.PushFront(k3); list.PushFront(k4.c_str()); list.PushFront(std::move(k5)); list.PushFront(6); list.PushFront(7L); list.PushFront(8.0); while(!list.Empty()) { list.PopFront(); } list.PushBack(o1); list.PushBack(new StringValue(k2)); list.PushBack(k3); list.PushBack(k4.c_str()); list.PushBack(std::move(k5)); list.PushBack(6); list.PushBack(7L); list.PushBack(8.0); while(!list.Empty()) { list.PopBack(); } list.Insert(list.Begin(), o1); list.Insert(list.Begin(), new StringValue(k2)); list.Insert(list.Begin(), k3); list.Insert(list.Begin(), k4.c_str()); list.Insert(list.Begin(), std::move(k5)); list.Insert(list.Begin(), 6); list.Insert(list.Begin(), 7L); list.Insert(list.Begin(), 8.0); while(!list.Empty()) { list.PopFront(); } } return 0; } //---------------------------------------------------------------------------
[ "archilleu9527@gmail.com" ]
archilleu9527@gmail.com
01216b2d6d16e78600f56a23fd80cf1ff83894d2
69b9cb379b4da73fa9f62ab4b51613c11c29bb6b
/submissions/agc031_a/main.cpp
1ae28e9179069049e6db5d2dfe8b2720e816313f
[]
no_license
tatt61880/atcoder
459163aa3dbbe7cea7352d84cbc5b1b4d9853360
923ec4d5d4ae5454bc6da2ac877946672ff807e7
refs/heads/main
2023-07-16T16:19:22.404571
2021-08-15T20:54:24
2021-08-15T20:54:24
118,358,608
0
0
null
null
null
null
UTF-8
C++
false
false
816
cpp
//{{{ #include <bits/stdc++.h> using namespace std; #define repX(a,b,c,x,...) x #define repN(a) repX a #define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__) #define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__) #define loop(n) rep2(i_,n) #define rep2(i,n) rep3(i,0,n) #define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i) #define rrep2(i,n) rrep3(i,n,0) #define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i) #define foreach(x,a) for(auto&x:a) using ll=long long; const ll mod=(ll)1e9+7; //}}} int main(){ int N; cin >> N; string s; cin >> s; ll nums[26] = {0}; rep(i, N){ nums[s[i] - 'a']++; } ll ans = 1; rep(i, 26){ ans *= (nums[i] + 1); ans %= mod; } ans--; cout << ans << endl; return 0; }
[ "tatt61880@gmail.com" ]
tatt61880@gmail.com
a206130be368183d806e63e9e8a77eb2b11b38db
dc9c6f34e15ae60cdecd503117334f5db2276ecd
/052_offer_49_nthUglyNumber.cpp
3b10833f09b7117c5cba7ce7e18b893e10ccdaa7
[]
no_license
z2z23n0/Algorithm
43c669958972b73dab95adf8314bbf219690c4d2
6582688bd387b2bb04eb39bafa58e0180f665bb4
refs/heads/master
2022-06-09T22:43:25.914800
2020-05-07T16:27:03
2020-05-08T16:27:13
null
0
0
null
null
null
null
UTF-8
C++
false
false
788
cpp
// // Created by Zeno on 2020/4/24. // #include <iostream> #include <vector> #include <cmath> using namespace std; class Ugly { public: int *nums = new int[1690](); Ugly() { nums[0] = 1; int ugly, i2 = 0, i3 = 0, i5 = 0; for (int i = 1; i < 1690; i++){ ugly = std::min({nums[i2] * 2, nums[i3] * 3, nums[i5] * 5}); nums[i] = ugly; if (nums[i2] * 2 == ugly) i2++; if (nums[i3] * 3 == ugly) i3++; if (nums[i5] * 5 == ugly) i5++; } } }; class Solution { public: static Ugly* u; int nthUglyNumber(int n) { return u->nums[n - 1]; } }; Ugly *Solution::u = new Ugly(); int main(){ int *nums = new int[100](); cout << nthUglyNumber(10) << endl; return 0; }
[ "zhangyuzechn@foxmail.com" ]
zhangyuzechn@foxmail.com
8d2ac6ba82f901a106f99c1b80598d5488f841de
89dbaf6b4e7e79441a1bcfdce7b645179209d2ea
/src/univalue/univalue_write.cpp
4a77d4d80bbdb9dda70ad9ec4240b61792e67759
[ "MIT" ]
permissive
dzcoin/DzCoinMiningAlgorithm
cd7f7af778f350442e3b1154ae34ec1916a46b2a
b0294cf5ac893fe907b08105f1aa826c3da464cf
refs/heads/master
2021-01-09T20:57:23.439272
2016-08-14T17:33:38
2016-08-14T17:33:38
65,678,189
0
0
null
null
null
null
UTF-8
C++
false
false
3,133
cpp
// copyright 2014 bitpay inc. // distributed under the mit software license, see the accompanying // file copying or http://www.opensource.org/licenses/mit-license.php. #include <ctype.h> #include <iomanip> #include <sstream> #include <stdio.h> #include "univalue.h" #include "univalue_escapes.h" // todo: using utf8 using namespace std; static string json_escape(const string& ins) { string outs; outs.reserve(ins.size() * 2); for (unsigned int i = 0; i < ins.size(); i++) { unsigned char ch = ins[i]; const char *escstr = escapes[ch]; if (escstr) outs += escstr; else if (isprint(ch)) outs += ch; else { char tmpesc[16]; sprintf(tmpesc, "\\u%04x", ch); outs += tmpesc; } } return outs; } string univalue::write(unsigned int prettyindent, unsigned int indentlevel) const { string s; s.reserve(1024); unsigned int modindent = indentlevel; if (modindent == 0) modindent = 1; switch (typ) { case vnull: s += "null"; break; case vobj: writeobject(prettyindent, modindent, s); break; case varr: writearray(prettyindent, modindent, s); break; case vstr: s += "\"" + json_escape(val) + "\""; break; case vreal: { std::stringstream ss; ss << std::showpoint << std::fixed << std::setprecision(8) << get_real(); s += ss.str(); } break; case vnum: s += val; break; case vbool: s += (val == "1" ? "true" : "false"); break; } return s; } static void indentstr(unsigned int prettyindent, unsigned int indentlevel, string& s) { s.append(prettyindent * indentlevel, ' '); } void univalue::writearray(unsigned int prettyindent, unsigned int indentlevel, string& s) const { s += "["; if (prettyindent) s += "\n"; for (unsigned int i = 0; i < values.size(); i++) { if (prettyindent) indentstr(prettyindent, indentlevel, s); s += values[i].write(prettyindent, indentlevel + 1); if (i != (values.size() - 1)) { s += ","; if (prettyindent) s += " "; } if (prettyindent) s += "\n"; } if (prettyindent) indentstr(prettyindent, indentlevel - 1, s); s += "]"; } void univalue::writeobject(unsigned int prettyindent, unsigned int indentlevel, string& s) const { s += "{"; if (prettyindent) s += "\n"; for (unsigned int i = 0; i < keys.size(); i++) { if (prettyindent) indentstr(prettyindent, indentlevel, s); s += "\"" + json_escape(keys[i]) + "\":"; if (prettyindent) s += " "; s += values[i].write(prettyindent, indentlevel + 1); if (i != (values.size() - 1)) s += ","; if (prettyindent) s += "\n"; } if (prettyindent) indentstr(prettyindent, indentlevel - 1, s); s += "}"; }
[ "dzgrouphelp@foxmail.com" ]
dzgrouphelp@foxmail.com
1b905831fcd0d45b0374b2865f1b0d50562facaa
643cff3866309a434f320e3889c359e2a75ce662
/Assignment_4/Code.ino
252c395d5e9c21272029d4c7b3118314c8c99dea
[]
no_license
sakshitantak/CL-X
1081cf13d3e35928fb754f14297eaee62ad5c1f7
cdea2d6986ce5f0395207d722e94a50a56b88136
refs/heads/master
2023-06-04T06:37:23.864467
2021-06-13T04:03:46
2021-06-13T04:03:46
373,409,297
0
0
null
null
null
null
UTF-8
C++
false
false
361
ino
// Name - Nilambari Rathi // Roll No - 43154 int out_pin = 9; void setup() { pinMode(out_pin, OUTPUT); pinMode(A0, INPUT); Serial.begin(9600); } void loop() { int inputLight = analogRead(A0); Serial.println(inputLight); if (inputLight < 450) { digitalWrite(out_pin, HIGH); } else { digitalWrite(out_pin, LOW); } delay(5); }
[ "sakshi99tantak@gmail.com" ]
sakshi99tantak@gmail.com
ddf84ce1cb3655a2c89876e43c600eff9a51eb03
975826d14e0ce906a54287ed10e0f879166fd2cd
/sorting/presubmissions/presubmission4.cpp
b34f74eae1e2c420b397deb64d390a5ba482b788
[ "MIT" ]
permissive
wolframalexa/dsa-i
c95d7d0ffdbc3d5d59cf1e76407ecfc67211e7a1
2a29263ac189e2056ff5006c194f26602d4d58d7
refs/heads/master
2020-09-04T16:41:47.665868
2019-12-10T19:59:14
2019-12-10T19:59:14
219,806,339
1
0
null
null
null
null
UTF-8
C++
false
false
6,625
cpp
// THIS IS THE PROVIDED CODE FOR PROGRAM #2, DSA 1, FALL 2019 #include <iostream> #include <fstream> #include <sstream> #include <list> #include <vector> #include <string> #include <algorithm> #include <ctime> #include <cmath> #include <cstring> #include <cctype> #include <cstdlib> using namespace std; // A simple class; each object holds four public fields class Data { public: string lastName; string firstName; string ssn; }; // Load the data from a specified input file void loadDataList(list<Data *> &l, const string &filename) { ifstream input(filename); if (!input) { cerr << "Error: could not open " << filename << "\n"; exit(1); } // The first line indicates the size string line; getline(input, line); stringstream ss(line); int size; ss >> size; // Load the data for (int i = 0; i < size; i++) { getline(input, line); stringstream ss2(line); Data *pData = new Data(); ss2 >> pData->lastName >> pData->firstName >> pData->ssn; l.push_back(pData); } input.close(); } // Output the data to a specified output file void writeDataList(const list<Data *> &l, const string &filename) { ofstream output(filename); if (!output) { cerr << "Error: could not open " << filename << "\n"; exit(1); } // Write the size first int size = l.size(); output << size << "\n"; // Write the data for (auto pData:l) { output << pData->lastName << " " << pData->firstName << " " << pData->ssn << "\n"; } output.close(); } // Sort the data according to a specified field // (Implementation of this function will be later in this file) void sortDataList(list<Data *> &); // The main function calls routines to get the data, sort the data, // and output the data. The sort is timed according to CPU time. int main() { string filename; cout << "Enter name of input file: "; cin >> filename; list<Data *> theList; loadDataList(theList, filename); cout << "Data loaded.\n"; cout << "Executing sort...\n"; clock_t t1 = clock(); sortDataList(theList); clock_t t2 = clock(); double timeDiff = ((double) (t2 - t1)) / CLOCKS_PER_SEC; cout << "Sort finished. CPU time was " << timeDiff << " seconds.\n"; cout << "Enter name of output file: "; cin >> filename; writeDataList(theList, filename); return 0; } // ------------------------------------------------- // YOU MAY NOT CHANGE OR ADD ANY CODE ABOVE HERE !!! // ------------------------------------------------- // You may add global variables, functions, and/or // class defintions here if you wish. #include <array> struct Node { Data* ptr; char first; string smallSSN; Node(Data* ptr1, char first1, string smallSSN) { ptr = ptr1; first = first1; smallSSN = smallSSN; } }; int determineCase(list<Data *> &l); void initializeArraySSN(list<Data *> &l); void initializeArrayList(list<Data *> &l); bool comparatorT3(Node* a, Node* b); bool comparatorT12(Node* a, Node* b); void copySSNToList(list<Data *> &l, string A[]); void copyGeneralToList(list<Data *> &l, Data* A[]); bool nameIsSame(Node *p1, Node *p2); void SortInPlaceNew(list<Data *> &l, Node* A[], int N); void initializeNodeArray(list<Data *> &l); Data* GeneralList[1100000] = {}; string SSNList[1100000] = {}; Node* NodeArray[1100000] = {}; void sortDataList(list<Data *> &l) { // Fill this in int listsize = l.size(); switch(determineCase(l)) { case 1: case 2: initializeNodeArray(l); SortInPlaceNew(l, NodeArray, listsize); break; case 3: { initializeNodeArray(l); int start = 0; int end = 0; while (end < l.size()-1) { ++end; if(!nameIsSame(NodeArray[end], NodeArray[end-1])) { sort(NodeArray+start, NodeArray + end, comparatorT3); start = end; } } break; } case 4: { initializeArraySSN(l); sort(SSNList,SSNList+listsize); copySSNToList(l,SSNList); break; } } } // determine which list we're sorting, to use different strategies for each int determineCase(list<Data *> &l) { list<string> firstFewFN; int i = 0; // I considered the first 15 lines as representative of the case for (list<Data *>::iterator it = l.begin(); i != 15; it++) { firstFewFN.push_back((*it)->firstName); i++; } firstFewFN.unique(); // find number of distinct names if (l.size() < 110000) { return 1; } else if (firstFewFN.size() == 1) { return 4; } // possible for it to be 2 or 3 else if (firstFewFN.size() < 4) { return 3; } else { return 2; } } void copySSNToList(list<Data *> &l, string A[]) { int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { (*it)->ssn = A[i]; i++; } } void copyGeneralToList(list<Data *> &l, Data* A[]) { int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { (*it) = (A[i]); i++; } } void initializeArraySSN(list<Data *> &l) { int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { SSNList[i] = (*it)->ssn; i++; } } void initializeArrayList(list<Data *> &l) { int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { GeneralList[i] = (*it); i++; } } void initializeNodeArray(list<Data *> &l) { int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { string first = (*it)->lastName; char letter = first[0]; string smallSSN = (*it)->ssn; smallSSN = smallSSN.substr(0,3); Node *nodeptr = new Node( (*it) , letter, smallSSN); NodeArray[i] = nodeptr; i++; } } bool nameIsSame(Node* p1, Node* p2) { if (p1->ptr->firstName == p2->ptr->firstName) { return true; } return false; } bool comparatorT3(Node* a, Node* b) { if (a->smallSSN != b->smallSSN) return a->smallSSN < b->smallSSN; else return a->ptr->ssn < b->ptr->ssn; } bool comparatorT12(Node* a, Node* b) { if (a->first != b->first) { return a->first < b->first; } else if ((a->ptr)->lastName != (b->ptr)->lastName) { return (a->ptr)->lastName < (b->ptr)->lastName; } else if ((a->ptr)->firstName != (b->ptr)->firstName) { return a->ptr->firstName < (b->ptr)->firstName; } else { return (a->ptr)->ssn < (b->ptr)->ssn; } } void SortInPlaceNew(list<Data *> &l, Node* A[], int N) { sort(A, A+N, comparatorT12); int i = 0; for (list<Data *>::iterator it = l.begin(); it != l.end(); it++) { (*it) = (A[i])->ptr; i++; } }
[ "alexa.jakob4@gmail.com" ]
alexa.jakob4@gmail.com
c3a6557ddf01e79eb61eb634a1faec92df7677ad
286ac32f8c995b1cd9d6f087c1e790abb37c5ee0
/Lab4b/console.h
6b482ae7c779b9d99cf9bb55017d313640337eb9
[]
no_license
medhanie-weldemariam-git/All_C-_Programming_Lab_Assignments
6f7ce55a1b640651b442cc92c3c7ce58886d8d73
968e1ba47cc949b81e856f8d2d8e1dc93889c8b1
refs/heads/master
2021-07-25T07:30:55.977499
2017-11-02T18:33:57
2017-11-02T18:33:57
109,303,875
0
0
null
null
null
null
UTF-8
C++
false
false
2,303
h
#ifndef CONSOLE_H #define CONSOLE_H #include <exception> #include <string> #ifdef _SOLARIS_ #include <ncursesw/ncurses.h> #else #include <ncurses.h> #endif /** * This is the color constants you can use where a color is expected: * * COLOR_BLACK * COLOR_RED * COLOR_GREEN * COLOR_YELLOW * COLOR_BLUE * COLOR_MAGENTA * COLOR_CYAN * COLOR_WHITE */ typedef short color; /** * Provide "C++" access to elementary ncurses functions. * * ** Not meant to be efficient, but simple to grasp fast * * **NOTE** Console restore the screen on exit. If your * program exit without delay you will not have * time to see any of your output! * * Version 0.3 */ class Console { public: Console(); ~Console(); /* you are not allowed to copy console objects, you can only have * one console, make sure to pass references, not copies */ Console(Console&) = delete; Console& operator=(Console&) = delete; /* get input from keyboard */ int get() const; // returns ERR after 1/10 second bool get(char& c) const; // returns false if a character was not // available within 1/10 second /* write character(s) at current position */ void put(char c); // put the character for ascii code c void put(int i); // put the integer i void put(unsigned int i); void put(std::string const& str); // put a string /* set/get position where next character will end up * must be (0 <= x < width) and (0 <= y < height) */ void setPos(int x, int y); void getPos(int& x, int& y) const; /* get the size of the screen */ int getWidth() const; int getHeight() const; /* set/get the current color for characters and background */ void setForegroundColor(color c); void setBackgroundColor(color c); color getForegroundColor() const; color getBackgroundColor() const; private: bool _has_colors; color _fg_color, _bg_color; int co; // color offset static bool instantiated; }; /** * Thrown when something goes amiss */ class ConsoleError : public std::exception { public: ConsoleError(std::string const& msg) : std::exception(), _what(msg) {} ~ConsoleError() noexcept {} const char* what() const noexcept { return _what.c_str(); } private: std::string _what; }; #endif
[ "medwe277@student.liu.se" ]
medwe277@student.liu.se
d74ca1553c4ed5c7fe06d24507ef2198888237d6
86509c4124a1eb7311efc155869974835b1e7178
/leetcode/editor/en/292.nim-game.cpp
6b77a45dc0ac58d9ec894535cf3e0cbb5bfa902e
[]
no_license
limoiie/algorithm-dojo
3ddd2fe58d1a3c7a648f5d6ec170dc58a35cbcc2
5158e889568f108b0a6fc2c2224265b3b870a8c4
refs/heads/master
2023-07-11T15:22:33.439864
2021-08-20T16:12:13
2021-08-20T16:12:13
271,736,789
0
0
null
null
null
null
UTF-8
C++
false
false
1,564
cpp
#pragma clang diagnostic push #pragma ide diagnostic ignored "cert-err58-cpp" #pragma ide diagnostic ignored "readability-convert-member-functions-to-static" #include <gtest/gtest.h> #include "base.h" //You are playing the following Nim Game with your friend: There is a heap of st //ones on the table, each time one of you take turns to remove 1 to 3 stones. The //one who removes the last stone will be the winner. You will take the first turn //to remove the stones. // // Both of you are very clever and have optimal strategies for the game. Write a // function to determine whether you can win the game given the number of stones i //n the heap. // // Example: // // //Input: 4 //Output: false //Explanation: If there are 4 stones in the heap, then you will never win the ga //me; //  No matter 1, 2, or 3 stones you remove, the last stone will alway //s be //  removed by your friend. Related Topics Brainteaser Minimax //leetcode submit region begin(Prohibit modification and deletion) class Solution { public: bool canWinNim(int n) { return n % 4; } }; //leetcode submit region end(Prohibit modification and deletion) TEST(TestNimGame, testcase) { auto sol = Solution(); auto cases = vector<tuple<int, bool>>{ {4, false}, {10, true}, {22, true}, }; for (auto & c : cases) { cout << "testing " << c << "..." << endl; auto result = sol.canWinNim(get<0>(c)); auto expect = get<1>(c); ASSERT_EQ(result, expect); } }
[ "limo.iie4@gmail.com" ]
limo.iie4@gmail.com
191b9cd79f248f2ccba5b594f8992ba82a9ea17e
600df3590cce1fe49b9a96e9ca5b5242884a2a70
/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.h
7b35fc8165a37859de2c989df20e0cbe685a6423
[ "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-only", "GPL-1.0-or-later", "GPL-2.0-only", "LGPL-2.0-only", "BSD-2-Clause", "LicenseRef-scancode-other-copyleft", "MIT", "Apache-2.0" ]
permissive
metux/chromium-suckless
efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a
72a05af97787001756bae2511b7985e61498c965
refs/heads/orig
2022-12-04T23:53:58.681218
2017-04-30T10:59:06
2017-04-30T23:35:58
89,884,931
5
3
BSD-3-Clause
2022-11-23T20:52:53
2017-05-01T00:09:08
null
UTF-8
C++
false
false
2,192
h
/* * Copyright (C) 2013 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef DeviceAcceleration_h #define DeviceAcceleration_h #include "bindings/core/v8/ScriptWrappable.h" #include "modules/device_orientation/DeviceMotionData.h" #include "platform/heap/Handle.h" namespace blink { class DeviceAcceleration final : public GarbageCollected<DeviceAcceleration>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: static DeviceAcceleration* create( DeviceMotionData::Acceleration* acceleration) { return new DeviceAcceleration(acceleration); } DECLARE_TRACE(); double x(bool& isNull) const; double y(bool& isNull) const; double z(bool& isNull) const; private: explicit DeviceAcceleration(DeviceMotionData::Acceleration*); Member<DeviceMotionData::Acceleration> m_acceleration; }; } // namespace blink #endif // DeviceAcceleration_h
[ "enrico.weigelt@gr13.net" ]
enrico.weigelt@gr13.net
016c3895a543503b976154ab774fae928ce40c4a
ed5669151a0ebe6bcc8c4b08fc6cde6481803d15
/test/magma-1.6.0/src/sgelqf.cpp
1a0ed17b060fc52a0d4571cda668f6abae72d265
[]
no_license
JieyangChen7/DVFS-MAGMA
1c36344bff29eeb0ce32736cadc921ff030225d4
e7b83fe3a51ddf2cad0bed1d88a63f683b006f54
refs/heads/master
2021-09-26T09:11:28.772048
2018-05-27T01:45:43
2018-05-27T01:45:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,006
cpp
/* -- MAGMA (version 1.6.0) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date November 2014 @generated from zgelqf.cpp normal z -> s, Sat Nov 15 19:54:09 2014 */ #include "common_magma.h" /** Purpose ------- SGELQF computes an LQ factorization of a REAL M-by-N matrix A: A = L * Q. Arguments --------- @param[in] m INTEGER The number of rows of the matrix A. M >= 0. @param[in] n INTEGER The number of columns of the matrix A. N >= 0. @param[in,out] A REAL array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and below the diagonal of the array contain the m-by-min(m,n) lower trapezoidal matrix L (L is lower triangular if m <= n); the elements above the diagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors (see Further Details). \n Higher performance is achieved if A is in pinned memory, e.g. allocated using magma_malloc_pinned. @param[in] lda INTEGER The leading dimension of the array A. LDA >= max(1,M). @param[out] tau REAL array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details). @param[out] work (workspace) REAL array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the optimal LWORK. \n Higher performance is achieved if WORK is in pinned memory, e.g. allocated using magma_malloc_pinned. @param[in] lwork INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize. \n If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued. @param[out] info INTEGER - = 0: successful exit - < 0: if INFO = -i, the i-th argument had an illegal value if INFO = -10 internal GPU memory allocation failed. Further Details --------------- The matrix Q is represented as a product of elementary reflectors Q = H(k) . . . H(2) H(1), where k = min(m,n). Each H(i) has the form H(i) = I - tau * v * v' where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n), and tau in TAU(i). @ingroup magma_sgelqf_comp ********************************************************************/ extern "C" magma_int_t magma_sgelqf( magma_int_t m, magma_int_t n, float *A, magma_int_t lda, float *tau, float *work, magma_int_t lwork, magma_int_t *info) { float *dA, *dAT; float c_one = MAGMA_S_ONE; magma_int_t maxm, maxn, maxdim, nb; magma_int_t iinfo, ldda; int lquery; /* Function Body */ *info = 0; nb = magma_get_sgelqf_nb(m); work[0] = MAGMA_S_MAKE( (float)(m*nb), 0 ); lquery = (lwork == -1); if (m < 0) { *info = -1; } else if (n < 0) { *info = -2; } else if (lda < max(1,m)) { *info = -4; } else if (lwork < max(1,m) && ! lquery) { *info = -7; } if (*info != 0) { magma_xerbla( __func__, -(*info) ); return *info; } else if (lquery) { return *info; } /* Quick return if possible */ if (min(m, n) == 0) { work[0] = c_one; return *info; } maxm = ((m + 31)/32)*32; maxn = ((n + 31)/32)*32; maxdim = max(maxm, maxn); if (maxdim*maxdim < 2*maxm*maxn) { ldda = maxdim; if (MAGMA_SUCCESS != magma_smalloc( &dA, maxdim*maxdim )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } magma_ssetmatrix( m, n, A, lda, dA, ldda ); dAT = dA; magmablas_stranspose_inplace( ldda, dAT, ldda ); } else { ldda = maxn; if (MAGMA_SUCCESS != magma_smalloc( &dA, 2*maxn*maxm )) { *info = MAGMA_ERR_DEVICE_ALLOC; return *info; } magma_ssetmatrix( m, n, A, lda, dA, maxm ); dAT = dA + maxn * maxm; magmablas_stranspose( m, n, dA, maxm, dAT, ldda ); } magma_sgeqrf2_gpu(n, m, dAT, ldda, tau, &iinfo); if (maxdim*maxdim < 2*maxm*maxn) { magmablas_stranspose_inplace( ldda, dAT, ldda ); magma_sgetmatrix( m, n, dA, ldda, A, lda ); } else { magmablas_stranspose( n, m, dAT, ldda, dA, maxm ); magma_sgetmatrix( m, n, dA, maxm, A, lda ); } magma_free( dA ); return *info; } /* magma_sgelqf */
[ "cjy7117@gmail.com" ]
cjy7117@gmail.com
6ca59df0c549d26bf3deb6f79af89682c2f9c0b9
8a13626dcd5724331353249c4d5aa06f2d79d47f
/ex3_eliyhoTsuri/Log.h
e15e0acb76b0c3e2393aa6da3ebdeb4a9b219a57
[]
no_license
elitsuri/ex3_eliyhoTsuri_OOP_B
09bb6029130f03799f96d79287545325ff8ef52d
440538d0f5cb4bdcf8175f4b4b6816a9e31b09bc
refs/heads/master
2023-07-01T09:46:50.340397
2021-08-04T08:45:24
2021-08-04T08:45:24
392,614,829
0
0
null
null
null
null
UTF-8
C++
false
false
298
h
#pragma once #include "CompOperation.h" class Log :public CompOperation { public: Log(int log_num, shared_ptr<Function> func); Log(Log &log_func, double num); const double getCalc(); const string getDimens(); private: shared_ptr <Function> m_func; int m_log; double m_num; double m_calc; };
[ "zelitesuri@gmail.com" ]
zelitesuri@gmail.com
6963fea06bd0a31043f8dbabec53cf544915d378
f01c9fe998f1c972e948f899fc87da2a0780d607
/dasT64/dasgetnoise.cpp
7d735718380dd86ed6c8d8ae90275d625c4fb70c
[]
no_license
VisionandCognition/Tracker-MRI
8224a3ddf0168b8f06559c536c8aeeb51c02c1ea
c434fb498e2c773d2eea3f62139e5283de1d6d12
refs/heads/master
2023-06-09T11:23:38.087129
2023-06-01T16:23:27
2023-06-01T16:23:27
64,005,109
2
0
null
null
null
null
UTF-8
C++
false
false
339
cpp
#include "mex.h" #include "DasControl.h" void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *avg, *Out; plhs[0] = mxCreateDoubleMatrix(2, 1, mxREAL); Out = mxGetPr(plhs[0]); avg = get_Noise( ); Out[0] = avg[0]; Out[1] = avg[1]; }
[ "sjoerd.r.murris@gmail.com" ]
sjoerd.r.murris@gmail.com
dd32414a5979fa96a998a4257f276701565006d0
07047a045b522e94726189e8d73707d95858ed2f
/topcoder/722-div1/TCPhoneHome.cpp
5ffab422ba45185bdc914fa666ae78bc41433b8f
[]
no_license
lyoz/contest
c4f8542c2be39be6c3568c76df479c137e4fde12
43d9d4787ec89a7d4171979387437fc75ebb85c2
refs/heads/main
2023-04-28T22:16:16.809496
2023-04-15T18:13:59
2023-04-15T18:13:59
56,969,366
1
0
null
null
null
null
UTF-8
C++
false
false
7,738
cpp
#include <bits/stdc++.h> using namespace std; #define repi(i,a,b) for(int i=int(a);i<int(b);i++) #define peri(i,a,b) for(int i=int(b);i-->int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #define mp make_pair #define mt make_tuple using uint=unsigned; using ll=long long; using ull=unsigned long long; using vi=vector<int>; using vvi=vector<vi>; using vl=vector<ll>; using vvl=vector<vl>; using vd=vector<double>; using vvd=vector<vd>; using vs=vector<string>; // BEGIN CUT HERE #define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0) void print_vars(ostream&){} template<typename Car,typename... Cdr> void print_vars(ostream& os,const Car& car,const Cdr&... cdr){ print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...); } template<typename T1,typename T2> ostream& operator<<(ostream& os,const pair<T1,T2>& p){ return os<<'('<<p.first<<','<<p.second<<')'; } template<int I,typename Tuple> void print_tuple(ostream&,const Tuple&){} template<int I,typename Car,typename... Cdr,typename Tuple> void print_tuple(ostream& os,const Tuple& t){ os<<get<I>(t)<<(sizeof...(Cdr)?",":""); print_tuple<I+1,Cdr...>(os,t); } template<typename... Args> ostream& operator<<(ostream& os,const tuple<Args...>& t){ print_tuple<0,Args...>(os<<'(',t); return os<<')'; } template<typename Ch,typename Tr,typename C> basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){ os<<'['; for(auto i=begin(c);i!=end(c);++i) os<<(i==begin(c)?"":" ")<<*i; return os<<']'; } // END CUT HERE constexpr int INF=1e9; constexpr int MOD=1e9+7; constexpr double EPS=1e-9; struct TCPhoneHome{ ll ten(int n){ ll res=1; rep(i,n) res*=10; return res; } long long validNumbers(int digits, vector <string> specialPrefixes){ int n=specialPrefixes.size(); vs pres; rep(i,n){ string s=specialPrefixes[i]; bool flg=false; rep(j,n) if(j!=i){ string t=specialPrefixes[j]; if(t.size()<s.size()&&t==s.substr(0,t.size())) flg=true; } if(!flg) pres.push_back(s); } ll res=ten(digits); for(auto pre:pres) res-=ten(digits-pre.size()); return res; } }; // BEGIN CUT HERE #include <cstdio> #include <ctime> #include <iostream> #include <string> #include <vector> namespace moj_harness { using std::string; using std::vector; int run_test_case(int); void run_test(int casenum = -1, bool quiet = false) { if (casenum != -1) { if (run_test_case(casenum) == -1 && !quiet) { std::cerr << "Illegal input! Test case " << casenum << " does not exist." << std::endl; } return; } int correct = 0, total = 0; for (int i=0;; ++i) { int x = run_test_case(i); if (x == -1) { if (i >= 100) break; continue; } correct += x; ++total; } if (total == 0) { std::cerr << "No test cases run." << std::endl; } else if (correct < total) { std::cerr << "Some cases FAILED (passed " << correct << " of " << total << ")." << std::endl; } else { std::cerr << "All " << total << " tests passed!" << std::endl; } } int verify_case(int casenum, const long long &expected, const long long &received, std::clock_t elapsed) { std::cerr << "Example " << casenum << "... "; string verdict; vector<string> info; char buf[100]; if (elapsed > CLOCKS_PER_SEC / 200) { std::sprintf(buf, "time %.2fs", elapsed * (1.0/CLOCKS_PER_SEC)); info.push_back(buf); } if (expected == received) { verdict = "PASSED"; } else { verdict = "FAILED"; } std::cerr << verdict; if (!info.empty()) { std::cerr << " ("; for (size_t i=0; i<info.size(); ++i) { if (i > 0) std::cerr << ", "; std::cerr << info[i]; } std::cerr << ")"; } std::cerr << std::endl; if (verdict == "FAILED") { std::cerr << " Expected: " << expected << std::endl; std::cerr << " Received: " << received << std::endl; } return verdict == "PASSED"; } int run_test_case(int casenum__) { switch (casenum__) { case 0: { int digits = 7; string specialPrefixes[] = {"0", "1", "911"}; long long expected__ = 7990000; std::clock_t start__ = std::clock(); long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); return verify_case(casenum__, expected__, received__, clock()-start__); } case 1: { int digits = 10; string specialPrefixes[] = {"0", "1", "911"}; long long expected__ = 7990000000LL; std::clock_t start__ = std::clock(); long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); return verify_case(casenum__, expected__, received__, clock()-start__); } case 2: { int digits = 8; string specialPrefixes[] = {"1", "12", "123"}; long long expected__ = 90000000; std::clock_t start__ = std::clock(); long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); return verify_case(casenum__, expected__, received__, clock()-start__); } case 3: { int digits = 9; string specialPrefixes[] = {"12", "13", "14"}; long long expected__ = 970000000; std::clock_t start__ = std::clock(); long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); return verify_case(casenum__, expected__, received__, clock()-start__); } case 4: { int digits = 3; string specialPrefixes[] = {"411"}; long long expected__ = 999; std::clock_t start__ = std::clock(); long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); return verify_case(casenum__, expected__, received__, clock()-start__); } // custom cases //case 5: { // int digits = ; // string specialPrefixes[] = ; // long long expected__ = ; // std::clock_t start__ = std::clock(); // long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); // return verify_case(casenum__, expected__, received__, clock()-start__); //} //case 6: { // int digits = ; // string specialPrefixes[] = ; // long long expected__ = ; // std::clock_t start__ = std::clock(); // long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); // return verify_case(casenum__, expected__, received__, clock()-start__); //} //case 7: { // int digits = ; // string specialPrefixes[] = ; // long long expected__ = ; // std::clock_t start__ = std::clock(); // long long received__ = TCPhoneHome().validNumbers(digits, vector <string>(specialPrefixes, specialPrefixes + (sizeof specialPrefixes / sizeof specialPrefixes[0]))); // return verify_case(casenum__, expected__, received__, clock()-start__); //} default: return -1; } } } #include <cstdlib> int main(int argc, char *argv[]) { if (argc == 1) { moj_harness::run_test(); } else { for (int i=1; i<argc; ++i) moj_harness::run_test(std::atoi(argv[i])); } } // END CUT HERE
[ "lyoz@users.noreply.github.com" ]
lyoz@users.noreply.github.com
20ff58f0974862ff483f19b7e42ef05ba4c76ec3
d44b555d3cccb428eb0a5d348207fd5095245f58
/src/qt/clientmodel.cpp
b854b14e558e6040829f8c26a3c77c837ff71c91
[ "MIT" ]
permissive
zeusthealmighty/Yeah
6c423a21c3bab336b911b2dae6b16d21120791f6
8b057854f4c7603f09932747b54d47cdda914400
refs/heads/master
2020-03-08T22:18:32.405702
2018-04-06T18:25:42
2018-04-06T18:25:42
128,427,269
0
1
null
null
null
null
UTF-8
C++
false
false
12,793
cpp
// Copyright (c) 2011-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The GoSuperSayayinCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "clientmodel.h" #include "bantablemodel.h" #include "guiconstants.h" #include "peertablemodel.h" #include "alert.h" #include "chainparams.h" #include "checkpoints.h" #include "clientversion.h" #include "validation.h" #include "net.h" #include "txmempool.h" #include "ui_interface.h" #include "util.h" #include "masternodeman.h" #include "masternode-sync.h" #include "privatesend.h" #include <stdint.h> #include <QDebug> #include <QTimer> class CBlockIndex; static const int64_t nClientStartupTime = GetTime(); static int64_t nLastHeaderTipUpdateNotification = 0; static int64_t nLastBlockTipUpdateNotification = 0; ClientModel::ClientModel(OptionsModel *optionsModel, QObject *parent) : QObject(parent), optionsModel(optionsModel), peerTableModel(0), cachedMasternodeCountString(""), banTableModel(0), pollTimer(0) { cachedBestHeaderHeight = -1; cachedBestHeaderTime = -1; peerTableModel = new PeerTableModel(this); banTableModel = new BanTableModel(this); pollTimer = new QTimer(this); connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer())); pollTimer->start(MODEL_UPDATE_DELAY); pollMnTimer = new QTimer(this); connect(pollMnTimer, SIGNAL(timeout()), this, SLOT(updateMnTimer())); // no need to update as frequent as data for balances/txes/blocks pollMnTimer->start(MODEL_UPDATE_DELAY * 4); subscribeToCoreSignals(); } ClientModel::~ClientModel() { unsubscribeFromCoreSignals(); } int ClientModel::getNumConnections(unsigned int flags) const { CConnman::NumConnections connections = CConnman::CONNECTIONS_NONE; if(flags == CONNECTIONS_IN) connections = CConnman::CONNECTIONS_IN; else if (flags == CONNECTIONS_OUT) connections = CConnman::CONNECTIONS_OUT; else if (flags == CONNECTIONS_ALL) connections = CConnman::CONNECTIONS_ALL; if(g_connman) return g_connman->GetNodeCount(connections); return 0; } QString ClientModel::getMasternodeCountString() const { // return tr("Total: %1 (PS compatible: %2 / Enabled: %3) (IPv4: %4, IPv6: %5, TOR: %6)").arg(QString::number((int)mnodeman.size())) return tr("Total: %1 (PS compatible: %2 / Enabled: %3)") .arg(QString::number((int)mnodeman.size())) .arg(QString::number((int)mnodeman.CountEnabled(MIN_PRIVATESEND_PEER_PROTO_VERSION))) .arg(QString::number((int)mnodeman.CountEnabled())); // .arg(QString::number((int)mnodeman.CountByIP(NET_IPV4))) // .arg(QString::number((int)mnodeman.CountByIP(NET_IPV6))) // .arg(QString::number((int)mnodeman.CountByIP(NET_TOR))); } int ClientModel::getNumBlocks() const { LOCK(cs_main); return chainActive.Height(); } int ClientModel::getHeaderTipHeight() const { if (cachedBestHeaderHeight == -1) { // make sure we initially populate the cache via a cs_main lock // otherwise we need to wait for a tip update LOCK(cs_main); if (pindexBestHeader) { cachedBestHeaderHeight = pindexBestHeader->nHeight; cachedBestHeaderTime = pindexBestHeader->GetBlockTime(); } } return cachedBestHeaderHeight; } int64_t ClientModel::getHeaderTipTime() const { if (cachedBestHeaderTime == -1) { LOCK(cs_main); if (pindexBestHeader) { cachedBestHeaderHeight = pindexBestHeader->nHeight; cachedBestHeaderTime = pindexBestHeader->GetBlockTime(); } } return cachedBestHeaderTime; } quint64 ClientModel::getTotalBytesRecv() const { if(!g_connman) return 0; return g_connman->GetTotalBytesRecv(); } quint64 ClientModel::getTotalBytesSent() const { if(!g_connman) return 0; return g_connman->GetTotalBytesSent(); } QDateTime ClientModel::getLastBlockDate() const { LOCK(cs_main); if (chainActive.Tip()) return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime()); return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network } long ClientModel::getMempoolSize() const { return mempool.size(); } size_t ClientModel::getMempoolDynamicUsage() const { return mempool.DynamicMemoryUsage(); } double ClientModel::getVerificationProgress(const CBlockIndex *tipIn) const { CBlockIndex *tip = const_cast<CBlockIndex *>(tipIn); if (!tip) { LOCK(cs_main); tip = chainActive.Tip(); } return Checkpoints::GuessVerificationProgress(Params().Checkpoints(), tip); } void ClientModel::updateTimer() { // no locking required at this point // the following calls will acquire the required lock Q_EMIT mempoolSizeChanged(getMempoolSize(), getMempoolDynamicUsage()); Q_EMIT bytesChanged(getTotalBytesRecv(), getTotalBytesSent()); } void ClientModel::updateMnTimer() { QString newMasternodeCountString = getMasternodeCountString(); if (cachedMasternodeCountString != newMasternodeCountString) { cachedMasternodeCountString = newMasternodeCountString; Q_EMIT strMasternodesChanged(cachedMasternodeCountString); } } void ClientModel::updateNumConnections(int numConnections) { Q_EMIT numConnectionsChanged(numConnections); } void ClientModel::updateNetworkActive(bool networkActive) { Q_EMIT networkActiveChanged(networkActive); } void ClientModel::updateAlert(const QString &hash, int status) { // Show error message notification for new alert if(status == CT_NEW) { uint256 hash_256; hash_256.SetHex(hash.toStdString()); CAlert alert = CAlert::getAlertByHash(hash_256); if(!alert.IsNull()) { Q_EMIT message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR); } } Q_EMIT alertsChanged(getStatusBarWarnings()); } bool ClientModel::inInitialBlockDownload() const { return IsInitialBlockDownload(); } enum BlockSource ClientModel::getBlockSource() const { if (fReindex) return BLOCK_SOURCE_REINDEX; else if (fImporting) return BLOCK_SOURCE_DISK; else if (getNumConnections() > 0) return BLOCK_SOURCE_NETWORK; return BLOCK_SOURCE_NONE; } void ClientModel::setNetworkActive(bool active) { if (g_connman) { g_connman->SetNetworkActive(active); } } bool ClientModel::getNetworkActive() const { if (g_connman) { return g_connman->GetNetworkActive(); } return false; } QString ClientModel::getStatusBarWarnings() const { return QString::fromStdString(GetWarnings("gui")); } OptionsModel *ClientModel::getOptionsModel() { return optionsModel; } PeerTableModel *ClientModel::getPeerTableModel() { return peerTableModel; } BanTableModel *ClientModel::getBanTableModel() { return banTableModel; } QString ClientModel::formatFullVersion() const { return QString::fromStdString(FormatFullVersion()); } QString ClientModel::formatSubVersion() const { return QString::fromStdString(strSubVersion); } bool ClientModel::isReleaseVersion() const { return CLIENT_VERSION_IS_RELEASE; } QString ClientModel::clientName() const { return QString::fromStdString(CLIENT_NAME); } QString ClientModel::formatClientStartupTime() const { return QDateTime::fromTime_t(nClientStartupTime).toString(); } QString ClientModel::dataDir() const { return QString::fromStdString(GetDataDir().string()); } void ClientModel::updateBanlist() { banTableModel->refresh(); } // Handlers for core signals static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress) { // emits signal "showProgress" QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(title)), Q_ARG(int, nProgress)); } static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections) { // Too noisy: qDebug() << "NotifyNumConnectionsChanged: " + QString::number(newNumConnections); QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection, Q_ARG(int, newNumConnections)); } static void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive) { QMetaObject::invokeMethod(clientmodel, "updateNetworkActive", Qt::QueuedConnection, Q_ARG(bool, networkActive)); } static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, ChangeType status) { qDebug() << "NotifyAlertChanged: " + QString::fromStdString(hash.GetHex()) + " status=" + QString::number(status); QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection, Q_ARG(QString, QString::fromStdString(hash.GetHex())), Q_ARG(int, status)); } static void BannedListChanged(ClientModel *clientmodel) { qDebug() << QString("%1: Requesting update for peer banlist").arg(__func__); QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection); } static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CBlockIndex *pIndex, bool fHeader) { // lock free async UI updates in case we have a new block tip // during initial sync, only update the UI if the last update // was > 250ms (MODEL_UPDATE_DELAY) ago int64_t now = 0; if (initialSync) now = GetTimeMillis(); int64_t& nLastUpdateNotification = fHeader ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification; if (fHeader) { // cache best headers time and height to reduce future cs_main locks clientmodel->cachedBestHeaderHeight = pIndex->nHeight; clientmodel->cachedBestHeaderTime = pIndex->GetBlockTime(); } // if we are in-sync, update the UI regardless of last update time if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) { //pass a async signal to the UI thread QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection, Q_ARG(int, pIndex->nHeight), Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())), Q_ARG(double, clientmodel->getVerificationProgress(pIndex)), Q_ARG(bool, fHeader)); nLastUpdateNotification = now; } } static void NotifyAdditionalDataSyncProgressChanged(ClientModel *clientmodel, double nSyncProgress) { QMetaObject::invokeMethod(clientmodel, "additionalDataSyncProgressChanged", Qt::QueuedConnection, Q_ARG(double, nSyncProgress)); } void ClientModel::subscribeToCoreSignals() { // Connect signals to client uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyNetworkActiveChanged.connect(boost::bind(NotifyNetworkActiveChanged, this, _1)); uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2)); uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this)); uiInterface.NotifyBlockTip.connect(boost::bind(BlockTipChanged, this, _1, _2, false)); uiInterface.NotifyHeaderTip.connect(boost::bind(BlockTipChanged, this, _1, _2, true)); uiInterface.NotifyAdditionalDataSyncProgressChanged.connect(boost::bind(NotifyAdditionalDataSyncProgressChanged, this, _1)); } void ClientModel::unsubscribeFromCoreSignals() { // Disconnect signals from client uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1)); uiInterface.NotifyNetworkActiveChanged.disconnect(boost::bind(NotifyNetworkActiveChanged, this, _1)); uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2)); uiInterface.BannedListChanged.disconnect(boost::bind(BannedListChanged, this)); uiInterface.NotifyBlockTip.disconnect(boost::bind(BlockTipChanged, this, _1, _2, false)); uiInterface.NotifyHeaderTip.disconnect(boost::bind(BlockTipChanged, this, _1, _2, true)); uiInterface.NotifyAdditionalDataSyncProgressChanged.disconnect(boost::bind(NotifyAdditionalDataSyncProgressChanged, this, _1)); }
[ "admin@polispay.org" ]
admin@polispay.org
7cfce4a0d1bdcbfa0f411985051c793b70156766
11c3ebc1f229d50ad78214a9566119e73361b2ac
/Tests/Conformance/C7.4.5.1.CC
8aa3f49f42b64513dca61fdb6335e30325abefd5
[]
no_license
cbmeeks/ORCA-C
185e77d38de9c9b8e41b57115bade92cf5ef4d46
bc5e49739568b1a8091d9742e4b1a65752b0d3b2
refs/heads/master
2021-07-06T00:22:28.347364
2017-10-02T03:19:30
2017-10-02T03:19:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
738
cc
/* Conformance Test 7.4.5.1: Verification of postdecrement operator */ #include <stdio.h> main () { int i = 5; long L = 32777; char ch = 'y'; unsigned int ui = 65534; unsigned long ul = 0x7FFFFFFF; unsigned char uch = 0x80; comp c = 4294967295ul; float f = 3.5; double d = 87.65; extended e = 92.33; i--; L--; ch--; ui--; ul--; uch--; c--; f--; d--; e--; if ((i != 4) || (L != 32776) || (ch != 'x') || (ui != 65533) || (ul != 0x7fFFffFE) || (uch != 0x7f) || (c != 4294967294ul) || (f != 2.5) || (d != 86.65) || (e != 91.33)) goto Fail; printf ("Passed Conformance Test 7.4.5.1\n"); return; Fail: printf ("Failed Conformance Test 7.4.5.1\n"); }
[ "mikew50@aol.com" ]
mikew50@aol.com
ee3fa5c7b00feef657768c7d648860daab040d46
498da5600672998b3b8889ee2d487b0131a4cdd5
/GCJ/2016/DR1/winning_move.cpp
02a9e2d04724870c6d71897ce909c7220db7ce5c
[]
no_license
heyihong/algorithm-contest-solution
783e1a6b7b7e7610f2728d215525c693cac3797f
566571f558e9b8733b59b417fcec03d4057222d4
refs/heads/master
2020-04-05T03:55:56.426095
2017-01-08T02:19:25
2017-01-08T02:19:25
32,659,825
0
0
null
null
null
null
UTF-8
C++
false
false
1,993
cpp
#include <message.h> #include <stdio.h> #include <algorithm> #include <functional> #include <vector> #include <unordered_map> #include "winning_move.h" using namespace std; int main() { int n = GetNumPlayers(); int nodes = NumberOfNodes(); int my_id = MyNodeId(); if (my_id == 0) { int l = 0; for (int i = 1; i != nodes; ++i) { PutInt(i, l); l += n / (nodes - i); PutInt(i, l - 1); Send(i); n -= n / (nodes - i); } long long res = 0; for (int i = 1; i != nodes; ++i) { Receive(i); long long tmp = GetLL(i); if (tmp) { if (!res || res > tmp) { res = tmp; } } } printf("%lld\n", res); } else { Receive(0); int left = GetInt(0); int right = GetInt(0); //printf("%d %d\n", left, right); unordered_map<long long, int> um; for (int i = left; i <= right; ++i) { long long num = GetSubmission(i); um[num] += 1; } vector<vector<pair<long long, int>>> numbers = vector<vector<pair<long long, int>>>(nodes - 1); hash<long long> ll_hash; for (auto p : um) { numbers[ll_hash(p.first) % (nodes - 1)].push_back(p); } for (int i = 1; i != nodes; ++i) { PutInt(i, numbers[i - 1].size()); for (auto p : numbers[i - 1]) { //printf("Send to %d, %d %lld %d\n", i, my_id, p.first, p.second); PutLL(i, p.first); PutInt(i, p.second); } Send(i); } um.clear(); for (int i = 1; i != nodes; ++i) { int from = Receive(-1); int total = GetInt(from); for (int j = 0; j != total; ++j) { long long num = GetLL(from); int cnt = GetInt(from); //printf("Receive from %d, %d %lld %d\n", from, my_id, num, cnt); um[num] += cnt; } } long long res = 0; for (auto p : um) { if (p.second == 1 && (!res || res > p.first)) { res = p.first; } } PutLL(0, res); Send(0); } return 0; }
[ "heyihong.cn@gmail.com" ]
heyihong.cn@gmail.com
e5dbb8f39d12c01d1fed6239ac6be77b75ba4717
97aab27d4410969e589ae408b2724d0faa5039e2
/SDK/EXES/INSTALL VISUAL 6 SDK/INPUT/6.0_980820/MSDN/VCPP/SMPL/MSDN98/98VSa/1036/SAMPLES/VC98/sdk/com/inole2/chap20/patron/pages.h
9c70e5687a53bd0c7a7a95d4d3b02865b7168e8c
[]
no_license
FutureWang123/dreamcast-docs
82e4226cb1915f8772418373d5cb517713f858e2
58027aeb669a80aa783a6d2cdcd2d161fd50d359
refs/heads/master
2021-10-26T00:04:25.414629
2018-08-10T21:20:37
2018-08-10T21:20:37
null
0
0
null
null
null
null
UTF-8
C++
false
false
12,588
h
/* * PAGES.H * Patron Chapter 20 * * Definitions and function prototypes for the Pages window control * as well as the CPage class. * * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved * * Kraig Brockschmidt, Microsoft * Internet : kraigb@microsoft.com * Compuserve: >INTERNET:kraigb@microsoft.com */ #ifndef _PAGES_H_ #define _PAGES_H_ //Versioning. #define VERSIONMAJOR 2 #define VERSIONMINOR 0 #define VERSIONCURRENT 0x00020000 //Classname #define SZCLASSPAGES TEXT("pages") #define HIMETRIC_PER_INCH 2540 #define LOMETRIC_PER_INCH 254 #define LOMETRIC_BORDER 60 //Border around page //Window extra bytes and offsets #define CBPAGESWNDEXTRA (sizeof(LONG)) #define PAGEWL_STRUCTURE 0 #include "tenant.h" typedef struct tagTENANTLIST { DWORD cTenants; DWORD dwIDNext; } TENANTLIST, *PTENANTLIST; #define SZSTREAMTENANTLIST OLETEXT("Tenant List") //Delay timer used in mouse debouncing #define IDTIMER_DEBOUNCE 120 /* * Page class describing an individual page and what things it * contains, managing an IStorage for us. * * A DWORD is used to identify this page as the name of the storage * is the string form of this ID. If we added a page every second, * it would take 136 years to overrun this counter, so we can * get away with saving it persistently. I hope this software is * obsolete by then. */ class CPage { //CHAPTER20MOD friend class CIOleUILinkContainer; //End CHAPTER20MOD private: DWORD m_dwID; //Persistent identifier LPSTORAGE m_pIStorage; //Substorage for this page HWND m_hWnd; //Pages window DWORD m_cOpens; //Calls to Open class CPages *m_pPG; //Pages window DWORD m_dwIDNext; DWORD m_cTenants; HWND m_hWndTenantList; //Listbox; our tenant list UINT m_iTenantCur; PCTenant m_pTenantCur; UINT m_uHTCode; //Last hit-test/mouse move UINT m_uSizingFlags; //Restrictions on sizing BOOL m_fTracking; //Tracking resize? RECTL m_rclOrg; //Original before tracking RECTL m_rcl; //Tracking rectangle RECTL m_rclBounds; //Boundaries f/size tracking HDC m_hDC; //Tracking hDC BOOL m_fDragPending; //Waiting for drag? BOOL m_fSizePending; //Waiting for debounce? int m_cxyDist; //Debounce distance UINT m_cDelay; //Debounce delay POINTS m_ptDown; //Point of click to debounce UINT m_uKeysDown; //Keys when click happens DWORD m_fTimer; //Timer active? //CHAPTER20MOD BOOL m_fReopen; //Did we just close? //End CHAPTER20MOD protected: BOOL TenantGet(UINT, PCTenant *, BOOL); BOOL TenantAdd(UINT, DWORD, PCTenant *); LPDATAOBJECT TransferObjectCreate(PPOINTL); //PAGEMOUS.CPP BOOL SelectTenantAtPoint(UINT, UINT); UINT TenantFromPoint(UINT, UINT, PCTenant *); BOOL DragDrop(UINT, UINT, UINT); public: CPage(DWORD, HWND, class CPages *); ~CPage(void); DWORD GetID(void); BOOL Open(LPSTORAGE); void Close(BOOL); BOOL Update(void); void Destroy(LPSTORAGE); UINT GetStorageName(LPOLESTR); void Draw(HDC, int, int, BOOL, BOOL); BOOL TenantCreate(TENANTTYPE, LPVOID, LPFORMATETC , PPATRONOBJECT, DWORD); BOOL TenantDestroy(void); BOOL TenantClip(BOOL); BOOL FQueryObjectSelected(HMENU); void ActivateObject(LONG); //CHAPTER20MOD void ShowObjectTypes(BOOL); void NotifyTenantsOfRename(LPTSTR, LPMONIKER); BOOL FQueryLinksInPage(void); //End CHAPTER20MOD BOOL ConvertObject(HWND, BOOL); //PAGEMOUSE.CPP BOOL OnRightDown(UINT, UINT, UINT); BOOL OnLeftDown(UINT, UINT, UINT); BOOL OnLeftDoubleClick(UINT, UINT, UINT); BOOL OnLeftUp(UINT, UINT, UINT); void OnMouseMove(UINT, int, int); void OnTimer(UINT); void StartSizeTracking(void); void OnNCHitTest(UINT, UINT); BOOL OnSetCursor(UINT); }; typedef CPage *PCPage; /* * Structures to save with the document describing the device * configuration and pages that we have. This is followed by * a list of DWORD IDs for the individual pages. */ typedef struct tagDEVICECONFIG { DWORD cb; //Size of structure TCHAR szDriver[CCHDEVICENAME]; TCHAR szDevice[CCHDEVICENAME]; TCHAR szPort[CCHDEVICENAME]; DWORD cbDevMode; //Size of actual DEVMODE DEVMODE dm; //Variable } DEVICECONFIG, *PDEVICECONFIG; //Offset to cbDevMode #define CBSEEKOFFSETCBDEVMODE (sizeof(DWORD) \ +(3*CCHDEVICENAME*sizeof(TCHAR))) //Combined OLE and Patron device structures. typedef struct tagCOMBINEDEVICE { DVTARGETDEVICE td; DEVICECONFIG dc; } COMBINEBDEVICE, *PCOMBINEDEVICE; typedef struct tagPAGELIST { DWORD cPages; DWORD iPageCur; DWORD dwIDNext; } PAGELIST, *PPAGELIST; //PRINT.CPP BOOL APIENTRY PrintDlgProc(HWND, UINT, WPARAM, LPARAM); BOOL APIENTRY AbortProc(HDC, int); //PAGEWIN.CPP LRESULT APIENTRY PagesWndProc(HWND, UINT, WPARAM, LPARAM); void RectConvertMappings(LPRECT, HDC, BOOL); class CPages : public CWindow { friend LRESULT APIENTRY PagesWndProc(HWND, UINT, WPARAM, LPARAM); friend BOOL APIENTRY PrintDlgProc(HWND, UINT, WPARAM, LPARAM); friend class CPage; friend class CTenant; friend class CDropTarget; friend class CImpIAdviseSink; protected: PCPage m_pPageCur; //Current page UINT m_iPageCur; //Current page UINT m_cPages; //Number of pages HWND m_hWndPageList; //Listbox with page list HFONT m_hFont; //Page font BOOL m_fSystemFont; //m_hFont system object? UINT m_cx; //Page size in LOMETRIC UINT m_cy; UINT m_xMarginLeft; //Unusable margins, UINT m_xMarginRight; //in LOMETRIC UINT m_yMarginTop; UINT m_yMarginBottom; UINT m_xPos; //Viewport scroll pos, UINT m_yPos; //both in *PIXELS* DWORD m_dwIDNext; //Next ID for a page. LPSTORAGE m_pIStorage; //Root storage UINT m_cf; //Clipboard format BOOL m_fDirty; BOOL m_fDragSource; //Source==target? BOOL m_fMoveInPage; //Moving in same page //CHAPTER20MOD BOOL m_fLinkAllowed; //Linking in drag-drop? //End CHAPTER20MOD POINTL m_ptDrop; //Where to move object BOOL m_fDragRectShown; //Is rect on the screen? UINT m_uScrollInset; //Hit-test for drag-drop UINT m_uScrollDelay; //Delay before repeat DWORD m_dwTimeLast; //Ticks on last DragOver UINT m_uHScrollCode; //L/R on scroll repeat? UINT m_uVScrollCode; //U/D on scroll repeat? UINT m_uLastTest; //Last test result POINTL m_ptlRect; //Last feedback rectangle SIZEL m_szlRect; //CHAPTER20MOD BOOL m_fShowTypes; //Show Object active? //End CHAPTER20MOD private: void Draw(HDC, BOOL, BOOL); void UpdateScrollRanges(void); BOOL ConfigureForDevice(void); BOOL PageGet(UINT, PCPage *, BOOL); BOOL PageAdd(UINT, DWORD, BOOL); void CalcBoundingRect(LPRECT, BOOL); //DRAGDROP.CPP UINT UTestDroppablePoint(PPOINTL); void DrawDropTargetRect(PPOINTL, LPSIZEL); void AdjustPosition(PPOINTL, LPSIZEL); public: CPages(HINSTANCE, UINT); ~CPages(void); BOOL Init(HWND, LPRECT, DWORD, UINT, LPVOID); BOOL StorageSet(LPSTORAGE, BOOL, BOOL); BOOL StorageUpdate(BOOL); BOOL Print(HDC, LPTSTR, DWORD, UINT, UINT, UINT); void RectGet(LPRECT); void RectSet(LPRECT, BOOL); void SizeGet(LPRECT); void SizeSet(LPRECT, BOOL); PCPage ActivePage(void); UINT PageInsert(UINT); UINT PageDelete(UINT); UINT CurPageGet(void); UINT CurPageSet(UINT); UINT NumPagesGet(void); BOOL DevModeSet(HGLOBAL, HGLOBAL); HGLOBAL DevModeGet(void); BOOL FIsDirty(void); BOOL DevReadConfig(PCOMBINEDEVICE *, HDC *); BOOL TenantCreate(TENANTTYPE, LPVOID, LPFORMATETC , PPATRONOBJECT, DWORD); BOOL TenantDestroy(void); BOOL TenantClip(BOOL); BOOL FQueryObjectSelected(HMENU); void ActivateObject(LONG); //CHAPTER20MOD void ShowObjectTypes(BOOL); void NotifyTenantsOfRename(LPTSTR, LPMONIKER); BOOL FQueryLinksInPage(void); BOOL GetUILinkContainer(class CIOleUILinkContainer **); //End CHAPTER20MOD BOOL ConvertObject(HWND); }; typedef CPages *PCPages; //Fixed names of streams in the Pages IStorage #define SZSTREAMPAGELIST OLETEXT("Page List") #define SZSTREAMDEVICECONFIG OLETEXT("Device Configuration") //Return values for UTestDroppablePoint #define UDROP_NONE 0x0000 //Exclusive #define UDROP_CLIENT 0x0001 //Inclusive #define UDROP_INSETLEFT 0x0002 //L/R are exclusive #define UDROP_INSETRIGHT 0x0004 #define UDROP_INSETHORZ (UDROP_INSETLEFT | UDROP_INSETRIGHT) #define UDROP_INSETTOP 0x0008 //T/B are exclusive #define UDROP_INSETBOTTOM 0x0010 #define UDROP_INSETVERT (UDROP_INSETTOP | UDROP_INSETBOTTOM) //CHAPTER20MOD //Object used for the Links dialog class CIOleUILinkContainer : public IOleUILinkContainer { private: ULONG m_cRef; PCPage m_pPage; UINT m_iTenant; LPOLEUILINKCONTAINER m_pDelIUILinks; public: BOOL m_fDirty; //No reason to hide it protected: STDMETHODIMP GetObjectInterface(DWORD, REFIID, PPVOID); public: CIOleUILinkContainer(PCPage); ~CIOleUILinkContainer(void); BOOL Init(void); BOOL IsDirty(void); STDMETHODIMP QueryInterface(REFIID, PPVOID); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void); STDMETHODIMP_(DWORD) GetNextLink(DWORD); STDMETHODIMP SetLinkUpdateOptions(DWORD, DWORD); STDMETHODIMP GetLinkUpdateOptions(DWORD, LPDWORD); STDMETHODIMP SetLinkSource(DWORD, LPTSTR, ULONG , ULONG *, BOOL); STDMETHODIMP GetLinkSource(DWORD, LPTSTR *, ULONG * , LPTSTR *, LPTSTR *, BOOL * , BOOL *); STDMETHODIMP OpenLinkSource(DWORD); STDMETHODIMP UpdateLink(DWORD, BOOL, BOOL); STDMETHODIMP CancelLink(DWORD); }; typedef CIOleUILinkContainer *PCIOleUILinkContainer; //End CHAPTER20MOD #endif //_PAGES_H_
[ "david.koch@9online.fr" ]
david.koch@9online.fr
83757e723d9304adbd866ff5c7966dd9df826eeb
9ea41f6f3c778153955e0721d6e0946a825a3cd1
/LoreEngine3D/src/graphics/buffers/GLBuffers.cpp
83db1244708e4f627e6a500a4c8330a2a8e1f4d6
[ "Apache-2.0" ]
permissive
Nebulous03/LoreEngine3D-V2
6a984266c68e7aecb367c34c53a762fcf67d3e4b
e140b4183edc1e5e6837e97e5559405be0cec3a7
refs/heads/master
2021-06-22T18:17:48.519584
2017-08-10T20:11:05
2017-08-10T20:11:05
99,972,770
1
0
null
null
null
null
UTF-8
C++
false
false
1,559
cpp
#include "GLBuffers.h" #include <iostream> /* VAO */ VAO::VAO() { glGenVertexArrays(1, &vao); } VAO::~VAO() { glDeleteBuffers(1, &vao); } GLuint VAO::get() { return vao; } void VAO::attach(GLuint location, VBO vbo, GLsizei vecSize) { bind(); vbo.bind(); glEnableVertexAttribArray(location); glVertexAttribPointer(location, vecSize, GL_FLOAT, GL_FALSE, 0, 0); vbo.unbind(); unbind(); } void VAO::bind() const { glBindVertexArray(vao); } void VAO::unbind() const { glBindVertexArray(0); } /* VBO */ VBO::VBO(GLfloat* data, GLsizei length) : size(length) { glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, length * sizeof(GL_FLOAT), data, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); } VBO::~VBO() { glDeleteBuffers(1, &vbo); } GLuint VBO::get() const { return vbo; } void VBO::bind() const { glBindBuffer(GL_ARRAY_BUFFER, vbo); } void VBO::unbind() const { glBindBuffer(GL_ARRAY_BUFFER, 0); } GLsizei VBO::getSize() const { return size; } /* IBO */ IBO::IBO(GLuint* data, GLsizei length) : size(length) { glGenBuffers(1, &ibo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); glBufferData(GL_ELEMENT_ARRAY_BUFFER, length * sizeof(GLuint), data, GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } IBO::~IBO() { glDeleteBuffers(1, &ibo); } GLuint IBO::get() { return ibo; } void IBO::bind() const { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); } void IBO::unbind() const { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } GLsizei IBO::getSize() const { return size; }
[ "nebulousdev@gmail.com" ]
nebulousdev@gmail.com
ea76f501e6c16d3bd2dbf3224da66eda9c1d70f9
9ea87c10180665db0db6fa36997704acc001692d
/prodtools/src/prodtools/prodtools.hpp
71fc0f2ca4642258fcfa407ebb899288acf09ffa
[ "MIT" ]
permissive
ToraNova/library
8af942f4657ebc07043848616e5b75cdace67212
20b321302868e8c2ce8723c808aa9e7a313e2cb8
refs/heads/master
2021-07-13T07:57:40.631816
2020-07-02T18:41:08
2020-07-02T18:41:08
159,255,786
0
0
MIT
2019-05-17T05:43:34
2018-11-27T01:16:08
Python
UTF-8
C++
false
false
856
hpp
/* Prodtools main header file FOR C/CXX USE this file consist of all the important headers for the prodtools project include this file to use all of prodtools functions @author ToraNova chia_jason96@live.com */ #ifndef PRODTOOLS_HPP #define PRODTOOLS_HPP #define TRUE 1 #define FALSE 0 //CXX headers (C/C++ projects should include this file for a "all include") //SUPPORT modules #include <prodtools/support/suprint.hpp> #include <prodtools/support/convert.hpp> #include <prodtools/support/turegex.hpp> //NETWORK modules #include <prodtools/network/tcpsock.hpp> //ARRAYUTIL modules #include <prodtools/arrayutil/all.hpp> //#include <prodtools/arrayutil/doubles.hpp> //minimal include //MATH modules #include <prodtools/math/linear.hpp> //CSV modules #include <prodtools/csv/reader.hpp> #include <prodtools/csv/writer.hpp> #endif
[ "chia_jason96@live.com" ]
chia_jason96@live.com
324131917b069e1c8bea8a44b8848883c8e28d90
69a22a21b7df8a23c74ce34d75a375936e3b426f
/coline/smartlib/Smart/scintilla/LexMPT.cxx
a69cec9dfe88c8a56498697a865c0c46d2957de6
[]
no_license
lanyawu/coline
ba8681c1b2242365cccef2b95bcb771c18af45fa
b63b997002e2e1d14674cde9a8ff1c95a6a299aa
refs/heads/master
2021-05-04T05:16:10.474229
2016-10-15T05:52:47
2016-10-15T05:52:47
70,963,112
0
0
null
null
null
null
UTF-8
C++
false
false
5,341
cxx
// Scintilla source code edit control /** @file LexMPT.cxx ** Lexer for MPT specific files. Based on LexOthers.cxx ** LOT = the text log file created by the MPT application while running a test program ** Other MPT specific files to be added later. **/ // Copyright 2003 by Marius Gheorghe <mgheorghe@cabletest.com> // The License.txt file describes the conditions under which this software may be distributed. #include <string.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string> #include <scintilla/Platform.h> #include "PropSet.h" #include "Accessor.h" #include "KeyWords.h" #include "Scintilla.h" #include "SciLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static int GetLotLineState(std::string &line) { if (line.length()) { // Most of the time the first non-blank character in line determines that line's type // Now finds the first non-blank character unsigned i; // Declares counter here to make it persistent after the for loop for (i = 0; i < line.length(); ++i) { if (!(isascii(line[i]) && isspace(line[i]))) break; } // Checks if it was a blank line if (i == line.length()) return SCE_LOT_DEFAULT; switch (line[i]) { case '*': // Fail measurement return SCE_LOT_FAIL; case '+': // Header case '|': // Header return SCE_LOT_HEADER; case ':': // Set test limits return SCE_LOT_SET; case '-': // Section break return SCE_LOT_BREAK; default: // Any other line // Checks for message at the end of lot file if (line.find("PASSED") != std::string::npos) { return SCE_LOT_PASS; } else if (line.find("FAILED") != std::string::npos) { return SCE_LOT_FAIL; } else if (line.find("ABORTED") != std::string::npos) { return SCE_LOT_ABORT; } else { return i ? SCE_LOT_PASS : SCE_LOT_DEFAULT; } } } else { return SCE_LOT_DEFAULT; } } static void ColourizeLotDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { styler.StartAt(startPos); styler.StartSegment(startPos); bool atLineStart = true;// Arms the 'at line start' flag char chNext = styler.SafeGetCharAt(startPos); std::string line(""); line.reserve(256); // Lot lines are less than 256 chars long most of the time. This should avoid reallocations // Styles LOT document unsigned int i; // Declared here because it's used after the for loop for (i = startPos; i < startPos + length; ++i) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); line += ch; atLineStart = false; // LOT files are only used on the Win32 platform, thus EOL == CR+LF // Searches for the end of line if (ch == '\r' && chNext == '\n') { line += chNext; // Gets the '\n' ++i; // Advances past the '\n' chNext = styler.SafeGetCharAt(i + 1); // Gets character of next line styler.ColourTo(i, GetLotLineState(line)); line = ""; atLineStart = true; // Arms flag for next line } } // Last line may not have a line ending if (!atLineStart) { styler.ColourTo(i - 1, GetLotLineState(line)); } } // Folds an MPT LOT file: the blocks that can be folded are: // sections (headed by a set line) // passes (contiguous pass results within a section) // fails (contiguous fail results within a section) static void FoldLotDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 0) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); char chNext = styler.SafeGetCharAt(startPos); int style = SCE_LOT_DEFAULT; int styleNext = styler.StyleAt(startPos); int lev = SC_FOLDLEVELBASE; // Gets style of previous line if not at the beginning of the document if (startPos > 1) style = styler.StyleAt(startPos - 2); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (ch == '\r' && chNext == '\n') { // TO DO: // Should really get the state of the previous line from the styler int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 2); switch (style) { /* case SCE_LOT_SET: lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; break; */ case SCE_LOT_FAIL: /* if (stylePrev != SCE_LOT_FAIL) lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; else lev = SC_FOLDLEVELBASE + 1; */ lev = SC_FOLDLEVELBASE; break; default: if (lineCurrent == 0 || stylePrev == SCE_LOT_FAIL) lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; else lev = SC_FOLDLEVELBASE + 1; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; break; } if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, lev | flagsNext); } static const char * const emptyWordListDesc[] = { 0 }; LexerModule lmLot(SCLEX_LOT, ColourizeLotDoc, "lot", FoldLotDoc, emptyWordListDesc);
[ "lanya.wu@foxmail.com" ]
lanya.wu@foxmail.com
f58e65d49baead5a42e69db30cb021ecf28a5d89
81a4d5e0a6875fc0d03331861c60871fbb011c82
/Programmers/Level1/Level1-23.cc
9d33c7364a3c1696fd58fae71ebfabe81cb0e9fd
[]
no_license
parksangji/Coding-Test
37cb4fd1c56cefb19871a07cff04bdbf7942ef5f
00900e1ea4311a19dfcebcb9b5283dd23c97e618
refs/heads/main
2023-08-27T17:12:50.689472
2021-10-12T08:17:30
2021-10-12T08:17:30
363,352,381
1
0
null
null
null
null
UTF-8
C++
false
false
242
cc
#include <string> #include <vector> #include <cmath> using namespace std; long long solution(long long n) { long long answer = 0; if(floor(sqrt(n)) == sqrt(n)) answer = pow(sqrt(n) + 1, 2); else {return -1;} return answer; }
[ "parksangji1109@gmail.com" ]
parksangji1109@gmail.com
43c4a7a6278a557f44e04b318f118910e63921fb
9a6774b22e862626b1747876d12c8ba243ca4952
/rectangle/main.cpp
3b249faa18b599a10bd0eb1596d502ad1395fe45
[]
no_license
Goolory/CProjects
e5252b962d02fa5a483750cdfb167adf9d8dd2f2
1f2828ae78864c4048350f503629e0e9d13828d8
refs/heads/master
2021-09-10T01:33:35.293078
2018-03-20T15:19:24
2018-03-20T15:19:24
113,868,468
0
0
null
null
null
null
UTF-8
C++
false
false
345
cpp
#include<iostream> using namespace std; #ifndef MYEXAMPLECLASS_H #define MYEXAMPLECLASS_H #include "/Users/xiesheng/Cprojects/MyExampleClass.h" #endif int main(){ float al = (float)8.2; MyRectangle<int> d1; MyRectangle<float> d2, d3; d1.setNo(1); d2.setNo(2); d3.setNo(3); cout<<d1<<d2<<d3<<endl; cin>>d1>>d2; cout<<d1<<d2; }
[ "xiesheng@xieshengdeMacBook-Pro-2.local" ]
xiesheng@xieshengdeMacBook-Pro-2.local
18b487cbf09043379f57096f92dbb316ceaa5dc1
c59784458e4dcb34eadd6941bc4297c28c1a7e53
/Contrib/at67/validater.cpp
396038f3f520c4e4d63ce247728697539f8a15b6
[ "BSD-2-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
kervinck/gigatron-rom
42af9ce548d34d64ee667f662337ea7aa6d331e8
5d24889a661793ef0a9fb8d714bab9127307ee30
refs/heads/master
2023-07-30T02:11:24.748356
2023-07-07T06:27:20
2023-07-07T06:27:20
106,879,621
216
85
BSD-2-Clause
2023-08-08T09:40:32
2017-10-13T22:40:14
C
UTF-8
C++
false
false
22,431
cpp
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string> #include <vector> #include <algorithm> #include "memory.h" #include "cpu.h" #include "assembler.h" #include "compiler.h" #include "validater.h" namespace Validater { bool initialise(void) { return true; } void adjustLabelAddresses(uint16_t address, int offset) { // Adjust addresses for any non page jump labels with addresses higher than start label, (labels can be stored out of order) for(int i=0; i<int(Compiler::getLabels().size()); i++) { if(!Compiler::getLabels()[i]._pageJump && Compiler::getLabels()[i]._address >= address) { Compiler::getLabels()[i]._address += int16_t(offset); } } for(int i=0; i<int(Compiler::getInternalLabels().size()); i++) { if(Compiler::getInternalLabels()[i]._address >= address) { Compiler::getInternalLabels()[i]._address += int16_t(offset); } } } void adjustVasmAddresses(int codeLineIndex, uint16_t address, int offset) { for(int i=codeLineIndex; i<int(Compiler::getCodeLines().size()); i++) { for(int j=0; j<int(Compiler::getCodeLines()[i]._vasm.size()); j++) { // Don't adjust page jump's if(!Compiler::getCodeLines()[i]._vasm[j]._pageJump && Compiler::getCodeLines()[i]._vasm[j]._address >= address) { Compiler::getCodeLines()[i]._vasm[j]._address += int16_t(offset); } } } } auto insertPageJumpInstruction(const std::vector<Compiler::CodeLine>::iterator& itCode, const std::vector<Compiler::VasmLine>::iterator& itVasm, const std::string& opcode, const std::string& operand, const std::string& code, uint16_t address, int vasmSize) { if(itVasm >= itCode->_vasm.end()) { fprintf(stderr, "Validater::insertPageJumpInstruction() : Trying to insert a PAGE JUMP into lala land, in '%s'", itCode->_code.c_str()); _EXIT_(EXIT_FAILURE); } Memory::takeFreeRAM(address, vasmSize, true); return itCode->_vasm.insert(itVasm, {address, opcode, operand, code, "", true, vasmSize}); } // TODO: make this more flexible, (e.g. sound channels off etc) bool checkForRelocation(const std::string& opcode, uint16_t vPC, uint16_t& nextPC, uint16_t& numThunks, uint16_t& totalThunkSize, bool& print) { #define CALL_PAGE_JUMP_SIZE 7 #define CALLI_PAGE_JUMP_SIZE 3 #define CALL_PAGE_JUMP_OFFSET 2 #define CALLI_PAGE_JUMP_OFFSET 0 int opcodeSize = 0; if(opcode.size()) { // Macro if(opcode[0] == '%') { std::string macro = opcode; macro.erase(0, 1); if(Compiler::getMacroIndexEntries().find(macro) != Compiler::getMacroIndexEntries().end()) { opcodeSize = Compiler::getMacroIndexEntries()[macro]._byteSize; } } // VASM else { opcodeSize = Assembler::getAsmOpcodeSize(opcode); } if(opcodeSize) { // Increase opcodeSize by size of page jump prologue int opSize = (Compiler::getCodeRomType() >= Cpu::ROMv5a) ? opcodeSize + CALLI_PAGE_JUMP_SIZE : opcodeSize + CALL_PAGE_JUMP_SIZE; // Code can't straddle page boundaries if(HI_BYTE(vPC) == HI_BYTE(vPC + opSize) && Memory::isFreeRAM(vPC, opSize)) { // Code relocation is not required if requested RAM address is free Memory::takeFreeRAM(vPC, opcodeSize, true); return false; } // Get next free code address after page jump prologue and relocate code, (return true) if(!Memory::getNextCodeAddress(Memory::FitAscending, vPC, opSize, nextPC)) { fprintf(stderr, "Validater::checkForRelocation(): Memory alloc at 0x%0x4 of size %d failed\n", vPC, opSize); return false; } if(!print) { print = true; fprintf(stderr, "\n*******************************************************\n"); fprintf(stderr, "* Relocating \n"); fprintf(stderr, "*******************************************************\n"); fprintf(stderr, "* Opcode : Address : Size : New \n"); fprintf(stderr, "*******************************************************\n"); } numThunks++; uint16_t newPC = nextPC; if(Compiler::getCodeRomType() >= Cpu::ROMv5a) { newPC += CALLI_PAGE_JUMP_OFFSET; totalThunkSize += CALLI_PAGE_JUMP_SIZE + CALLI_PAGE_JUMP_OFFSET; } else { newPC += CALL_PAGE_JUMP_OFFSET; totalThunkSize += CALL_PAGE_JUMP_SIZE + CALL_PAGE_JUMP_OFFSET; } fprintf(stderr, "* %-20s : 0x%04x : %2d bytes : 0x%04x\n", opcode.c_str(), vPC, opcodeSize, newPC); return true; } } return false; } bool checkForRelocations(void) { std::string line; bool print = false; uint16_t numThunks = 0, totalThunkSize = 0; for(auto itCode=Compiler::getCodeLines().begin(); itCode!=Compiler::getCodeLines().end();) { if(itCode->_vasm.size() == 0) { itCode++; continue; } int codeLineIndex = int(itCode - Compiler::getCodeLines().begin()); for(auto itVasm=itCode->_vasm.begin(); itVasm!=itCode->_vasm.end();) { uint16_t nextPC; bool excluded = checkForRelocation(itVasm->_opcode, itVasm->_address, nextPC, numThunks, totalThunkSize, print); if(!itVasm->_pageJump && excluded) { std::vector<std::string> tokens; uint16_t currPC = itVasm->_address; // Insert PAGE JUMP int restoreOffset = 0; std::string nextPClabel = "_page_" + Expression::wordToHexString(nextPC); if(Compiler::getCodeRomType() >= Cpu::ROMv5a) { // CALLI PAGE JUMP std::string codeCALLI; int sizeCALLI = Compiler::createVcpuAsm("CALLI", nextPClabel, codeLineIndex, codeCALLI); itVasm = insertPageJumpInstruction(itCode, itVasm, "CALLI", nextPClabel, codeCALLI, uint16_t(currPC), sizeCALLI); } else { // ROMS that don't have CALLI save and restore vAC std::string codeSTW, codeLDWI, codeCALL, codeLDW; #define VAC_SAVE_STACK #ifdef VAC_SAVE_STACK int sizeSTW = Compiler::createVcpuAsm("STLW", "0xFE", codeLineIndex, codeSTW); int sizeLDWI = Compiler::createVcpuAsm("LDWI", nextPClabel, codeLineIndex, codeLDWI); int sizeCALL = Compiler::createVcpuAsm("CALL", "giga_vAC", codeLineIndex, codeCALL); int sizeLDW = Compiler::createVcpuAsm("LDLW", "0xFE", codeLineIndex, codeLDW); itVasm = insertPageJumpInstruction(itCode, itVasm + 0, "STLW", "0xFE", codeSTW, uint16_t(currPC), sizeSTW); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "LDWI", nextPClabel, codeLDWI, uint16_t(currPC + sizeSTW), sizeLDWI); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "CALL", "giga_vAC", codeCALL, uint16_t(currPC + sizeSTW + sizeLDWI), sizeCALL); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "LDLW", "0xFE", codeLDW, uint16_t(nextPC), sizeLDW); #else #define VAC_SAVE_START 0x00D6 int sizeSTW = Compiler::createVcpuAsm("STW", Expression::byteToHexString(VAC_SAVE_START), codeLineIndex, codeSTW); int sizeLDWI = Compiler::createVcpuAsm("LDWI", nextPClabel, codeLineIndex, codeLDWI); int sizeCALL = Compiler::createVcpuAsm("CALL", "giga_vAC", codeLineIndex, codeCALL); int sizeLDW = Compiler::createVcpuAsm("LDW", Expression::byteToHexString(VAC_SAVE_START), codeLineIndex, codeLDW); itVasm = insertPageJumpInstruction(itCode, itVasm + 0, "STW", Expression::byteToHexString(VAC_SAVE_START), codeSTW, uint16_t(currPC), sizeSTW); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "LDWI", nextPClabel, codeLDWI, uint16_t(currPC + sizeSTW), sizeLDWI); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "CALL", "giga_vAC", codeCALL, uint16_t(currPC + sizeSTW + sizeLDWI), sizeCALL); itVasm = insertPageJumpInstruction(itCode, itVasm + 1, "LDW", Expression::byteToHexString(VAC_SAVE_START), codeLDW, uint16_t(nextPC), sizeLDW); #endif // New page address is offset by size of vAC restore restoreOffset = sizeLDW; } // Fix labels and addresses int offset = nextPC + restoreOffset - currPC; adjustLabelAddresses(currPC, offset); adjustVasmAddresses(codeLineIndex, currPC, offset); // Check for existing label, (after label adjustments) int labelIndex = -1; std::string labelName; Compiler::VasmLine* vasmCurr = &itCode->_vasm[itVasm - itCode->_vasm.begin()]; // points to CALLI and LDW Compiler::VasmLine* vasmNext = &itCode->_vasm[itVasm + 1 - itCode->_vasm.begin()]; // points to instruction after CALLI and after LDW if(Compiler::findLabel(nextPC) >= 0) { labelIndex = Compiler::findLabel(nextPC); labelName = Compiler::getLabels()[labelIndex]._name; } if(labelIndex == -1) { // Create CALLI page jump label, (created later in outputCode()) if(Compiler::getCodeRomType() >= Cpu::ROMv5a) { // Code referencing these labels must be fixed later in outputLabels, (discarded label addresses must be updated if they match page jump address) if(vasmNext->_internalLabel.size()) { Compiler::getDiscardedLabels().push_back({vasmNext->_address, vasmNext->_internalLabel}); Compiler::adjustDiscardedLabels(vasmNext->_internalLabel, vasmNext->_address); } vasmNext->_internalLabel = nextPClabel; } // Create pre-CALLI page jump label, (created later in outputCode()) else { // Code referencing these labels must be fixed later in outputLabels, (discarded label addresses must be updated if they match page jump address) if(vasmCurr->_internalLabel.size()) { Compiler::getDiscardedLabels().push_back({vasmCurr->_address, vasmCurr->_internalLabel}); Compiler::adjustDiscardedLabels(vasmCurr->_internalLabel, vasmCurr->_address); } vasmCurr->_internalLabel = nextPClabel; } } // Existing label at the PAGE JUMP address, so use it else { // Update CALLI page jump label if(Compiler::getCodeRomType() >= Cpu::ROMv5a) { // Macro labels are underscored by default vasmCurr->_code = (labelName[0] == '_') ? "CALLI" + std::string(OPCODE_TRUNC_SIZE - 4, ' ') + labelName : "CALLI" + std::string(OPCODE_TRUNC_SIZE - 4, ' ') + "_" + labelName; } // Update pre-CALLI page jump label else { // Macro labels are underscored by default Compiler::VasmLine* vasm = &itCode->_vasm[itVasm - 2 - itCode->_vasm.begin()]; // points to LDWI vasm->_code = (labelName[0] == '_') ? "LDWI" + std::string(OPCODE_TRUNC_SIZE - 4, ' ') + labelName : "LDWI" + std::string(OPCODE_TRUNC_SIZE - 4, ' ') + "_" + labelName; } } } itVasm++; } itCode++; } if(print) { fprintf(stderr, "*******************************************************\n"); fprintf(stderr, "* Number of page jumps = %4d, RAM used = %5d bytes *\n", numThunks, totalThunkSize); fprintf(stderr, "*******************************************************\n"); } return true; } bool opcodeHasBranch(const std::string& opcode) { if(opcode == "BRA") return true; if(opcode == "BEQ") return true; if(opcode == "BNE") return true; if(opcode == "BGE") return true; if(opcode == "BLE") return true; if(opcode == "BGT") return true; if(opcode == "BLT") return true; if(opcode == "%ForNextInc") return true; if(opcode == "%ForNextDec") return true; if(opcode == "%ForNextDecZero") return true; if(opcode == "%ForNextAdd") return true; if(opcode == "%ForNextSub") return true; if(opcode == "%ForNextVarAdd") return true; if(opcode == "%ForNextVarSub") return true; return false; } bool checkBranchLabels(void) { for(int i=0; i<int(Compiler::getCodeLines().size()); i++) { // Line number taking into account modules int codeLineStart = Compiler::getCodeLineStart(i); for(int j=0; j<int(Compiler::getCodeLines()[i]._vasm.size()); j++) { uint16_t opcAddr = Compiler::getCodeLines()[i]._vasm[j]._address; std::string opcode = Compiler::getCodeLines()[i]._vasm[j]._opcode; const std::string& code = Compiler::getCodeLines()[i]._vasm[j]._code; const std::string& basic = Compiler::getCodeLines()[i]._text; Expression::stripWhitespace(opcode); if(opcodeHasBranch(opcode)) { std::vector<std::string> tokens = Expression::tokenise(code, ' ', false); if(tokens.size() < 2) continue; // Normal branch std::string operand; if(tokens.size() == 2) { Expression::stripWhitespace(tokens[1]); operand = tokens[1]; } // Branch embedded in a FOR NEXT macro else if(tokens.size() > 2) { Expression::stripWhitespace(tokens[2]); operand = tokens[2]; } // Remove underscores from BASIC labels for matching if(operand.size() > 1 && operand[0] == '_') operand.erase(0, 1); // Is operand a label? int labelIndex = Compiler::findLabel(operand); if(labelIndex >= 0) { uint16_t labAddr = Compiler::getLabels()[labelIndex]._address; if(HI_MASK(opcAddr) != HI_MASK(labAddr)) { fprintf(stderr, "\nValidater::checkBranchLabels() : *** Error ***, %s is branching from 0x%04x to 0x%04x, for '%s' on line %d\n\n", opcode.c_str(), opcAddr, labAddr, basic.c_str(), codeLineStart); return false; } } // Check internal label else { // Internal labels always have underscores, so put it back operand.insert(0, 1, '_'); labelIndex = Compiler::findInternalLabel(operand); if(labelIndex >= 0) { uint16_t labAddr = Compiler::getInternalLabels()[labelIndex]._address; if(HI_MASK(opcAddr) != HI_MASK(labAddr)) { fprintf(stderr, "\nValidater::checkBranchLabels() : *** Error ***, %s is branching from 0x%04x to 0x%04x, for '%s' on line %d\n\n", opcode.c_str(), opcAddr, labAddr, basic.c_str(), codeLineStart); return false; } } } } } } return true; } bool checkStatementBlocks(void) { bool success = true; // Check FOR NEXT blocks while(!Compiler::getForNextDataStack().empty()) { success = false; Compiler::ForNextData forNextData = Compiler::getForNextDataStack().top(); int codeLineIndex = forNextData._codeLineIndex; const std::string& code = Compiler::getCodeLines()[codeLineIndex]._code; fprintf(stderr, "Validater::checkStatementBlocks() : Syntax error, missing NEXT statement, for '%s' on line %d\n", code.c_str(), codeLineIndex); Compiler::getForNextDataStack().pop(); } // Check ELSE ELSEIF blocks while(!Compiler::getElseIfDataStack().empty()) { success = false; Compiler::ElseIfData elseIfData = Compiler::getElseIfDataStack().top(); int codeLineIndex = elseIfData._codeLineIndex; const std::string& code = Compiler::getCodeLines()[codeLineIndex]._code; fprintf(stderr, "Validater::checkStatementBlocks() : Syntax error, missing ELSE or ELSEIF statement, for '%s' on line %d\n", code.c_str(), codeLineIndex); Compiler::getElseIfDataStack().pop(); } // Check WHILE WEND blocks while(!Compiler::getWhileWendDataStack().empty()) { success = false; Compiler::WhileWendData whileWendData = Compiler::getWhileWendDataStack().top(); int codeLineIndex = whileWendData._codeLineIndex; const std::string& code = Compiler::getCodeLines()[codeLineIndex]._code; fprintf(stderr, "Validater::checkStatementBlocks() : Syntax error, missing WEND statement, for '%s' on line %d\n", code.c_str(), codeLineIndex); Compiler::getWhileWendDataStack().pop(); } // Check DO UNTIL blocks while(!Compiler::getRepeatUntilDataStack().empty()) { success = false; Compiler::RepeatUntilData repeatUntilData = Compiler::getRepeatUntilDataStack().top(); int codeLineIndex = repeatUntilData._codeLineIndex; const std::string& code = Compiler::getCodeLines()[codeLineIndex]._code; fprintf(stderr, "Validater::checkStatementBlocks() : Syntax error, missing UNTIL statement, for '%s' on line %d\n", code.c_str(), codeLineIndex); Compiler::getRepeatUntilDataStack().pop(); } return success; } bool checkCallProcFuncData(void) { bool success = true; // Check PROC's corresponding CALL's for(auto it=Compiler::getCallDataMap().begin(); it!=Compiler::getCallDataMap().end(); ++it) { int numParams = it->second._numParams; int codeLineIndex = it->second._codeLineIndex; const std::string& procName = it->second._name; const std::string& code = Compiler::getCodeLines()[codeLineIndex]._code; if(Compiler::getProcDataMap().find(procName) == Compiler::getProcDataMap().end()) { fprintf(stderr, "Validator::checkCallProcFuncData() : Syntax error, 'CALL <NAME>' cannot find a corresponding 'PROC <NAME>', in '%s' on line %d\n", code.c_str(), codeLineIndex); success = false; continue; } if(Compiler::getProcDataMap()[procName]._numParams != numParams) { fprintf(stderr, "Validator::checkCallProcFuncData() : Syntax error, 'CALL <NAME>' has incorrect number of parameters compared to 'PROC <NAME>', in '%s' on line %d\n", code.c_str(), codeLineIndex); success = false; continue; } } return success; } bool checkRuntimeVersion(void) { int16_t runtimeVersion = Assembler::getRuntimeVersion(); if(runtimeVersion != RUNTIME_VERSION) { fprintf(stderr, "\n*************************************************************************************************\n"); fprintf(stderr, "* Expected runtime version %04d : Found runtime version %04d\n", RUNTIME_VERSION, runtimeVersion); fprintf(stderr, "*************************************************************************************************\n\n"); return false; } return true; } }
[ "at67@internode.on.net" ]
at67@internode.on.net
a9bf1b8b6200ad2f2de53c8216ef5e4c4cf9c0cb
2860e9958323db038f7b83d05f89959b853c4406
/think_in_cpp/ch3/prac1.cpp
d21676e579ba3100e4894def7293e60ad03eb297
[]
no_license
shanwu/cpp_review
a922e853076901f147a6a7cb72333ab67b49fdf6
2ea5ef9f008e54bbdc482f8d6ecc55fa0a9aa080
refs/heads/master
2021-01-19T03:40:51.236906
2018-07-02T13:31:40
2018-07-02T13:31:40
87,332,727
0
0
null
null
null
null
UTF-8
C++
false
false
222
cpp
#include "prac1.h" #include <iostream> using namespace std; void function(int num, bool flag) { string flag_text = (flag)? "true": "false"; cout << "function( "<< num << ", "<< flag_text << ") called..."<< endl; }
[ "sungzheguang@hotmail.com" ]
sungzheguang@hotmail.com
280415c47753e2316fc56bc3343215843655fbe1
4c20b5105d7770e8f1520a62cdf459ecc8f02992
/test/smart_contract/java_query_repo_domain_test.cpp
15d49f7a3a417cf4c65eb9e55bc69b1278a8513e
[ "Apache-2.0" ]
permissive
yantao006/iroha
b2fca37c3ecef55c1778542245199c8ac9a7a111
77d2f0965c6e34c9f87bfd7cbbbde7dc6842b7e2
refs/heads/master
2021-01-22T20:25:08.396693
2017-03-11T04:08:15
2017-03-11T04:08:15
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,995
cpp
/* Copyright Soramitsu Co., Ltd. 2016 All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <gtest/gtest.h> #include <../smart_contract/repository/jni_constants.hpp> #include <infra/virtual_machine/jvm/java_data_structure.hpp> #include <repository/domain/domain_repository.hpp> #include <virtual_machine/virtual_machine.hpp> const std::string PackageName = "test"; const std::string ContractName = "TestDomain"; namespace tag = jni_constants; /********************************************************************************************************* * Test Account *********************************************************************************************************/ TEST(JavaQueryRepoDomain, initializeVM) { virtual_machine::initializeVM(PackageName, ContractName); } TEST(JavaQueryRepoDomain, invokeAddDomain) { /***************************************************************** * Remove chache *****************************************************************/ const auto uuid = "eeeada754cb39bff9f229bca75c4eb8e743f0a77649bfedcc47513452c9324f5"; if (repository::domain::exists(uuid)) { repository::domain::remove(uuid); } /***************************************************************** * Invoke Java method *****************************************************************/ const std::string FunctionName = "testAddDomain"; std::map<std::string, std::string> params; { params[tag::OwnerPublicKey] = "MPTt3ULszCLGQqAqRgHj2gQHVnxn/DuNlRXR/iLMAn4="; params[tag::DomainName] = "domain name"; } virtual_machine::invokeFunction(PackageName, ContractName, FunctionName, params); const auto domain = repository::domain::findByUuid(uuid); ASSERT_STREQ(params[tag::OwnerPublicKey].c_str(), domain.ownerpublickey().c_str()); ASSERT_STREQ(params[tag::DomainName].c_str(), domain.name().c_str()); // Remove cache again ASSERT_TRUE(repository::domain::remove(uuid)); } TEST(JavaQueryRepoDomain, invokeUpdateDomain) { /***************************************************************** * Remove cache & initialize *****************************************************************/ const auto uuid = "eeeada754cb39bff9f229bca75c4eb8e743f0a77649bfedcc47513452c9324f5"; if (repository::domain::exists(uuid)) { repository::domain::remove(uuid); } repository::domain::add("MPTt3ULszCLGQqAqRgHj2gQHVnxn/DuNlRXR/iLMAn4=", "domain name"); ASSERT_TRUE(repository::domain::exists(uuid)); /***************************************************************** * Invoke Java method *****************************************************************/ const std::string FunctionName = "testUpdateDomain"; std::map<std::string, std::string> params; { params[tag::Uuid] = uuid; params[tag::DomainName] = "Updated Domain Name"; } virtual_machine::invokeFunction(PackageName, ContractName, FunctionName, params); const auto domain = repository::domain::findByUuid(uuid); ASSERT_STREQ("MPTt3ULszCLGQqAqRgHj2gQHVnxn/DuNlRXR/iLMAn4=", domain.ownerpublickey().c_str()); ASSERT_STREQ(params[tag::DomainName].c_str(), domain.name().c_str()); // Remove chache again repository::domain::remove(uuid); } TEST(JavaQueryRepoDomain, invokeRemoveDomain) { /***************************************************************** * Remove cache & initialize *****************************************************************/ const std::string uuid = "eeeada754cb39bff9f229bca75c4eb8e743f0a77649bfedcc47513452c9324f5"; if (repository::domain::exists(uuid)) { repository::domain::remove(uuid); } repository::domain::add("MPTt3ULszCLGQqAqRgHj2gQHVnxn/DuNlRXR/iLMAn4=", "domain name"); ASSERT_TRUE(repository::domain::exists(uuid)); /***************************************************************** * Invoke Java method *****************************************************************/ const std::string FunctionName = "testRemoveDomain"; std::map<std::string, std::string> params; { params[tag::Uuid] = uuid; } virtual_machine::invokeFunction(PackageName, ContractName, FunctionName, params); ASSERT_FALSE(repository::domain::exists(uuid)); } TEST(JavaQueryRepoDomain, finishVM) { virtual_machine::finishVM(PackageName, ContractName); }
[ "motohiko.ave@gmail.com" ]
motohiko.ave@gmail.com
fd574848aa5166cab0122dd5ff1955be9bbfc345
02b68f3587417f81aa233de017de0aa950c16733
/Developer/include/Game.hpp
61ef6158083d21da5a7b5b9d426a224df487b6df
[]
no_license
CS-RPG/BADASSLAND
cb524474faaf92c11c1e1d7e206feef7761a0b4c
9066ca4135a595cb338d78b63603e0b01e5ee0b5
refs/heads/master
2020-12-24T16:14:49.400007
2014-05-22T05:30:59
2014-05-22T05:30:59
17,319,484
1
1
null
2014-05-03T15:49:48
2014-03-01T16:59:47
C++
UTF-8
C++
false
false
882
hpp
//Game.hpp #ifndef _Game_hpp_included_ #define _Game_hpp_included_ #include <DataTypes.hpp> #include <World.hpp> //============Game========================== // class Game { public: Game(); void run(); void update(sf::Time); void processEvents(); void render(); void loadConfigFile(config&); private: sf::RenderWindow mWindow; int mScreenWidth; int mScreenHeight; float mInvincibilityTime; sf::Clock mGameClock; sf::Clock mInvincibilityClock; sf::Clock mSpawnClock; sf::Time mTimePerFrame; config mConfig; std::vector<std::vector<int>> mLevelMap; int mTileSize; int mGameSpeed; float mOffsetX; //Map scrolling float mOffsetY; //offset. World mWorld; }; // //========================================== #endif
[ "pavel.pushmin@yahoo.co.uk" ]
pavel.pushmin@yahoo.co.uk
6bd5f6d238c7b2086b5541bfce22c22b83c2ae65
154edcee481abc9888ebf0c6479018f24ed1c411
/bin/data/robots/snail/include/fetController.h
5bafa42686109b233e3580f7d576ca9e9816720a
[]
no_license
scimusmn/Animation-Lab
9e21515811380284dd5282aaf2270d78a78850e8
2108ec8e3c51d45c9dc7308e274c4892b2c2b6c0
refs/heads/master
2020-04-10T16:55:53.971293
2014-10-03T12:58:50
2014-10-03T12:58:50
3,335,891
1
0
null
null
null
null
UTF-8
C++
false
false
1,117
h
/* * fishMove.h * robotBlocksVectors * * Created by Exhibits on 5/11/2554. * Copyright 2011 Science Museum of Minnesota. All rights reserved. * */ #ifndef _FET_CONTROL #define _FET_CONTROL #include "WProgram.h" class fetController { int fetPin; bool bAnalogPin; bool bRunning; int switchSpeed; public: fetController(){ bRunning=bAnalogPin=false; } void setup(int pin){ if(pin==3||pin==5||pin==6||(pin>=9&&pin<=11)) bAnalogPin=true; fetPin=pin; pinMode(fetPin,OUTPUT); } void start(){ bRunning=false; } void end(){ if(bRunning) off(); } void setSpeed(String speed){ bRunning=true; int switchSpeed=0; if(speed.equals("SLOW")) switchSpeed = 100; else if(speed.equals("MED")) switchSpeed = 175; else if(speed.equals("FAST")) switchSpeed=255; else bRunning=false; if(bAnalogPin) analogWrite(fetPin,switchSpeed); else digitalWrite(fetPin,((switchSpeed)?1:0)); } void on(){ bRunning=true; digitalWrite(fetPin,HIGH); } void off(){ bRunning=false; if(bAnalogPin) setSpeed("OFF"); else digitalWrite(fetPin,LOW); } }; #endif
[ "aheidgerken@smm.org" ]
aheidgerken@smm.org
1e63a2c0467b73a26dc281fba5a839d12bb2bfe9
cb80a8562d90eb969272a7ff2cf52c1fa7aeb084
/inletTest3/0.137/alphat
342182398e2be7eb0dc037a3339bffc25ac6a10c
[]
no_license
mahoep/inletCFD
eb516145fad17408f018f51e32aa0604871eaa95
0df91e3fbfa60d5db9d52739e212ca6d3f0a28b2
refs/heads/main
2023-08-30T22:07:41.314690
2021-10-14T19:23:51
2021-10-14T19:23:51
314,657,843
0
0
null
null
null
null
UTF-8
C++
false
false
177,747
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2006 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.137"; object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; internalField nonuniform List<scalar> 16277 ( 31.313 20.4896 91.6212 15.0871 22.6869 14.4939 6.27214 2.60737 1.412 0.953784 0.750111 0.646815 0.585069 0.540227 0.502454 0.468463 0.43754 0.409736 0.38508 0.363398 0.344352 0.327544 0.312591 0.299168 0.287018 0.275944 0.265798 0.256462 0.247845 0.239872 0.232478 0.225611 0.219224 0.213277 0.207736 0.202571 0.197755 0.193266 0.189085 0.185191 0.181571 0.178209 0.175093 0.172212 0.169557 0.167121 0.164894 0.162873 0.161052 0.159427 0.157998 0.156762 0.155719 0.15487 0.154215 0.15376 0.15351 0.15347 0.153649 0.15405 0.154687 0.155573 0.156723 0.158157 0.159895 0.161963 0.164393 0.167221 0.170494 0.174274 0.178642 0.183703 0.189593 0.196472 0.204497 0.213778 0.224319 0.236042 0.249052 0.264489 0.286346 0.325962 0.412459 0.621692 1.1579 2.43423 4.29746 4.59552 2.72342 1.79906 0.885884 0.403964 0.219661 0.10364 0.0245576 0.00441851 0.0001464 0.000127054 0.00207673 0.0095644 0.00527016 0.00134567 0.00011128 9.96371e-05 0.00122688 0.00443177 0.00353617 0.00105454 9.20691e-05 8.61344e-05 0.00102197 0.00335343 0.00290157 0.000920534 8.10802e-05 7.76731e-05 0.000904698 0.00282632 0.00257244 0.000843076 7.43146e-05 7.24988e-05 0.000848156 0.00254625 0.00238183 0.000803045 7.02804e-05 6.90878e-05 0.000810252 0.00236724 0.00224243 0.000773928 6.74511e-05 6.66268e-05 0.000781082 0.0022359 0.00213273 0.000750272 6.53481e-05 6.47502e-05 0.000757222 0.00213071 0.00204133 0.00073011 6.37119e-05 6.32626e-05 0.000737035 0.0020422 0.00196267 0.000712412 6.23847e-05 6.20307e-05 0.000719367 0.00196543 0.00189328 0.000696439 6.12596e-05 6.09712e-05 0.000703313 0.00189731 0.00183098 0.000681712 6.02782e-05 6.00359e-05 0.000688501 0.00183591 0.0017744 0.000668009 5.93999e-05 5.919e-05 0.000674729 0.00178 0.00172256 0.000655202 5.85971e-05 5.84111e-05 0.000661861 0.00172874 0.00167471 0.000643181 5.78519e-05 5.76841e-05 0.000649777 0.00168141 0.00163039 0.000631843 5.71521e-05 5.69984e-05 0.000638374 0.00163754 0.00158921 0.000621111 5.64884e-05 5.63459e-05 0.000627577 0.00159675 0.00155086 0.000610929 5.58543e-05 5.57207e-05 0.000617344 0.00155876 0.0015151 0.000601272 5.52449e-05 5.51189e-05 0.00060764 0.00152328 0.00148163 0.0005921 5.46566e-05 5.45373e-05 0.000598416 0.00149002 0.00145017 0.000583359 5.40866e-05 5.39731e-05 0.00058962 0.00145872 0.00142048 0.000575001 5.35319e-05 5.34233e-05 0.000581202 0.00142913 0.00139234 0.000566979 5.29901e-05 5.28855e-05 0.000573115 0.00140106 0.00136558 0.000559246 5.24584e-05 5.23571e-05 0.000565311 0.00137432 0.00134001 0.000551759 5.19345e-05 5.18356e-05 0.000557747 0.00134875 0.00131551 0.000544476 5.1416e-05 5.13188e-05 0.000550381 0.00132422 0.00129195 0.000537362 5.09007e-05 5.08045e-05 0.000543183 0.00130061 0.00126922 0.000530389 5.03865e-05 5.02908e-05 0.000536121 0.0012778 0.00124722 0.00052353 4.98716e-05 4.97757e-05 0.000529172 0.00125571 0.00122588 0.000516763 4.93542e-05 4.92575e-05 0.000522314 0.00123428 0.00120514 0.000510073 4.88325e-05 4.87347e-05 0.000515534 0.00121344 0.00118495 0.000503448 4.83051e-05 4.82059e-05 0.000508823 0.00119316 0.00116529 0.000496881 4.77707e-05 4.76699e-05 0.00050219 0.00117341 0.00114613 0.000490378 4.7228e-05 4.71257e-05 0.000495676 0.00115417 0.00112746 0.00048396 4.66766e-05 4.65727e-05 0.00048923 0.00113545 0.0011093 0.000477602 4.61158e-05 4.60103e-05 0.000482867 0.00111724 0.00109163 0.000471328 4.55449e-05 4.54381e-05 0.000476609 0.00109955 0.0010745 0.000465164 4.49642e-05 4.48565e-05 0.000470489 0.00108244 0.00105796 0.000459149 4.4374e-05 4.42661e-05 0.000464549 0.00106597 0.00104209 0.000453328 4.37756e-05 4.36685e-05 0.00045885 0.00105038 0.00102705 0.000447774 4.3171e-05 4.30661e-05 0.000453469 0.0010358 0.001013 0.000442572 4.25632e-05 4.24625e-05 0.000448495 0.00102226 0.00100004 0.000437812 4.19566e-05 4.18624e-05 0.00044403 0.00101 0.000988435 0.00043361 4.13562e-05 4.1272e-05 0.000440205 0.000999277 0.000978482 0.000430108 4.0769e-05 4.06994e-05 0.000437168 0.000990423 0.000970516 0.000427485 4.02029e-05 4.0156e-05 0.000434987 0.000983773 0.000964925 0.000425863 3.96758e-05 3.96449e-05 0.000433491 0.00097958 0.000961827 0.000424853 3.92088e-05 3.91827e-05 0.000432717 0.000978331 0.000961702 0.000424687 3.88008e-05 3.87785e-05 0.000432786 0.000980046 0.000964508 0.000425432 3.84853e-05 3.84465e-05 0.000433671 0.000984545 0.000970148 0.000427075 3.82584e-05 3.82076e-05 0.000435265 0.000991449 0.000978094 0.000429198 3.80413e-05 3.80701e-05 0.000437242 0.00100058 0.000988143 0.000431396 3.79024e-05 3.79813e-05 0.000439112 0.00101139 0.000999782 0.000433592 3.78367e-05 3.80004e-05 0.000440752 0.00102298 0.00101182 0.000435571 3.78782e-05 3.80923e-05 0.000442088 0.00103402 0.00102306 0.000436975 3.7996e-05 3.82513e-05 0.000443356 0.00104407 0.00103332 0.000438086 3.81802e-05 3.8472e-05 0.000444357 0.0010529 0.0010424 0.000439103 3.84255e-05 3.87462e-05 0.00044526 0.00106044 0.00105013 0.000439651 3.87203e-05 3.90583e-05 0.000445921 0.00106681 0.00105628 0.000439994 3.90515e-05 3.93979e-05 0.000446356 0.00107174 0.00106056 0.000440156 3.94073e-05 3.97528e-05 0.000446564 0.00107589 0.00106352 0.000440197 3.97754e-05 4.01116e-05 0.000446629 0.00107839 0.00106481 0.000439897 4.01448e-05 4.04647e-05 0.000446558 0.00107914 0.00106359 0.00043914 4.05052e-05 4.08022e-05 0.000445833 0.00107773 0.00106103 0.000438155 4.08448e-05 4.11125e-05 0.000444863 0.00107488 0.00105743 0.000437062 4.11545e-05 4.13896e-05 0.000443758 0.00107083 0.00105282 0.000435939 4.14285e-05 4.163e-05 0.000442555 0.00106565 0.00104731 0.000434825 4.16643e-05 4.18316e-05 0.000441319 0.00105951 0.00104109 0.00043373 4.18576e-05 4.19928e-05 0.000440066 0.00105261 0.00103429 0.000432699 4.20111e-05 4.21219e-05 0.000438844 0.00104504 0.00102697 0.000431705 4.21364e-05 4.22079e-05 0.0004376 0.00103704 0.00101927 0.000430674 4.22164e-05 4.22622e-05 0.000436347 0.00102897 0.00101148 0.000429672 4.22742e-05 4.23054e-05 0.000435086 0.00102074 0.0010034 0.000428532 4.23134e-05 4.23305e-05 0.000433702 0.00101246 0.00099544 0.000427299 4.23152e-05 4.23357e-05 0.000432404 0.00100429 0.000987255 0.000425945 4.23144e-05 4.23152e-05 0.000430904 0.000995918 0.000979108 0.000424601 4.22879e-05 4.22815e-05 0.000429408 0.000987629 0.000970872 0.000423067 4.22389e-05 4.22513e-05 0.000427882 0.000979302 0.000962825 0.000421473 4.21918e-05 4.22005e-05 0.000426286 0.000971076 0.000954704 0.000419989 4.21568e-05 4.21398e-05 0.000424689 0.000962887 0.00094658 0.000418549 4.20856e-05 4.20872e-05 0.000423171 0.000954776 0.000938519 0.000416793 4.20048e-05 4.20166e-05 0.000421392 0.000946496 0.000930349 0.000415073 4.1955e-05 4.19354e-05 0.0004196 0.00093838 0.000922463 0.000413421 4.18614e-05 4.18808e-05 0.000418008 0.000930642 0.000914045 0.000411597 4.1741e-05 4.17984e-05 0.000415743 0.000923072 0.00090679 0.000408553 4.15868e-05 4.18499e-05 0.000415917 0.000920418 0.000909262 0.000415441 4.17432e-05 4.24258e-05 0.000416194 0.000919423 0.00096302 0.000437584 4.27388e-05 4.5522e-05 0.000410397 0.000936351 0.00142989 0.000596295 5.13454e-05 5.54145e-05 0.000309262 0.000709947 0.00175132 0.00401379 0.00750351 0.0106977 0.0128831 0.016934 0.0195203 0.0218412 0.0231479 0.0237729 0.0235974 0.0225476 0.021053 0.0186557 0.0163053 0.0127418 0.0111332 0.00810097 0.00606089 0.0041167 0.00233997 0.00107418 0.000391795 0.000162914 3.14063e-05 2.04839e-05 0.000150946 0.000355291 0.00033514 0.000143233 1.97132e-05 1.89402e-05 0.000138207 0.0003176 0.000319167 0.000136281 1.87317e-05 1.86061e-05 0.000135439 0.000313995 0.000314066 0.00013407 1.84222e-05 1.84063e-05 0.000133999 0.000313687 0.000314569 0.000134072 1.84336e-05 1.84358e-05 0.000134258 0.000315227 0.000315713 0.000134485 1.84652e-05 1.84796e-05 0.000134694 0.000316661 0.000317109 0.000134909 1.84959e-05 1.85261e-05 0.00013516 0.000318133 0.000318685 0.000135406 1.85172e-05 1.85486e-05 0.000135703 0.000319723 0.000320284 0.000135893 1.85643e-05 1.85975e-05 0.00013619 0.000321326 0.000321821 0.000136334 1.85984e-05 1.86059e-05 0.000136758 0.000323001 0.000323581 0.000136877 1.86478e-05 1.8656e-05 0.000137305 0.000324731 0.000325275 0.000137472 1.86737e-05 1.86804e-05 0.000137879 0.0003265 0.000327077 0.000138038 1.87257e-05 1.87323e-05 0.000138434 0.000328306 0.000328876 0.000138635 1.87518e-05 1.87582e-05 0.000139046 0.000330111 0.000330684 0.000139207 1.88033e-05 1.88099e-05 0.000139613 0.000331984 0.000332604 0.000139849 1.883e-05 1.88392e-05 0.000140294 0.000333894 0.000334466 0.000140449 1.88842e-05 1.88919e-05 0.000140864 0.000335777 0.000336439 0.000141107 1.89128e-05 1.89211e-05 0.000141564 0.000337796 0.000338424 0.000141831 1.89553e-05 1.89911e-05 0.000142195 0.000339836 0.000340509 0.000142465 1.89994e-05 1.90108e-05 0.000142993 0.000341963 0.000342633 0.00014326 1.90457e-05 1.90837e-05 0.000143648 0.000344063 0.000344736 0.000143898 1.90889e-05 1.91029e-05 0.000144461 0.000346182 0.000346835 0.000144708 1.91362e-05 1.91735e-05 0.000145102 0.000348239 0.000348897 0.000145337 1.91783e-05 1.91902e-05 0.000145902 0.000350388 0.000351078 0.000146178 1.92243e-05 1.92644e-05 0.000146621 0.000352544 0.000353219 0.000146869 1.92701e-05 1.92837e-05 0.000147446 0.000354693 0.000355366 0.000147693 1.93175e-05 1.93564e-05 0.000148116 0.000356791 0.00035743 0.00014834 1.93607e-05 1.93736e-05 0.000148909 0.000358846 0.000359448 0.000149107 1.94042e-05 1.94407e-05 0.000149511 0.000360847 0.000361464 0.000149729 1.94444e-05 1.94564e-05 0.000150266 0.000362804 0.000363312 0.000150395 1.94844e-05 1.95175e-05 0.000150704 0.000364521 0.000364992 0.000150801 1.95159e-05 1.95201e-05 0.000151205 0.000366079 0.000366383 0.000151123 1.95542e-05 1.95546e-05 0.000151381 0.000367303 0.000367535 0.000151305 1.95596e-05 1.95537e-05 0.000151453 0.000368267 0.000368393 0.000151225 1.95833e-05 1.95707e-05 0.000151201 0.000368889 0.000368957 0.000150911 1.95693e-05 1.95511e-05 0.000150755 0.000369241 0.000369226 0.00015034 1.95585e-05 1.95626e-05 0.000149886 0.000369326 0.000369012 0.000149333 1.95372e-05 1.95096e-05 0.000148812 0.000368986 0.000368103 0.000147952 1.95057e-05 1.94968e-05 0.00014698 0.000367758 0.000366494 0.000145784 1.94541e-05 1.94211e-05 0.000144864 0.000366096 0.000364586 0.000143475 1.94201e-05 1.93894e-05 0.000142387 0.000364284 0.000362729 0.000140928 1.9375e-05 1.93529e-05 0.00013966 0.000362321 0.000360298 0.000137984 1.93632e-05 1.93848e-05 0.000136451 0.000359768 0.000357871 0.00013483 1.93835e-05 1.9433e-05 0.000133655 0.000358449 0.000357119 0.000132178 1.9494e-05 1.95753e-05 0.000130937 0.000356992 0.000356682 0.000129638 1.96899e-05 1.9858e-05 0.000129061 0.000359172 0.00036101 0.000127721 2.004e-05 2.02177e-05 0.000126774 0.000364586 0.00037027 0.000128309 2.04336e-05 2.06355e-05 0.000128948 0.000375038 0.000377855 0.000128162 2.06892e-05 2.08338e-05 0.000125753 0.000383256 0.000389477 0.00013245 2.11285e-05 2.13308e-05 0.000128548 0.000394791 0.000400216 0.000131768 2.16828e-05 2.19447e-05 0.000133619 0.000410283 0.000413174 0.000136738 2.23209e-05 2.28447e-05 0.000143726 0.000426075 0.000427825 0.000147241 2.33467e-05 2.37786e-05 0.000153132 0.000438524 0.000441703 0.000158452 2.4654e-05 2.64941e-05 0.000183642 0.000460834 0.000459188 0.000193876 1.98807e-05 1.52612e-05 4.7257e-05 0.000129487 0.00036008 0.000111715 1.79867e-05 1.89057e-05 0.000100074 0.000330942 0.000348762 0.000103886 1.9344e-05 1.9657e-05 9.81379e-05 0.000333178 0.000358572 0.000105782 2.02384e-05 2.08307e-05 0.000104322 0.000353528 0.000388311 0.000118738 2.15533e-05 2.22767e-05 0.000117763 0.000380701 0.000417342 0.000137234 2.31756e-05 2.44113e-05 0.000141205 0.000420202 0.000469415 0.000170768 2.70012e-05 2.06028e-05 0.000188077 0.000480943 0.000129602 4.4348e-05 1.63961e-05 1.96005e-05 0.00012067 0.000403317 0.000394418 0.000112654 2.13548e-05 2.27301e-05 0.000147834 0.000488337 0.000498182 0.000149248 2.36149e-05 2.49834e-05 0.000174055 0.000554013 0.000569689 0.000186209 2.67191e-05 2.98808e-05 0.000222192 0.000622969 0.000604413 0.000240903 2.33421e-05 1.76418e-05 5.48213e-05 0.000159297 0.000492025 0.000145476 2.09167e-05 2.26387e-05 0.000135191 0.000482139 0.000554142 0.000166555 2.41695e-05 2.58438e-05 0.000166833 0.000546691 0.000618922 0.000212947 2.98093e-05 2.37604e-05 0.000243912 0.000622638 0.000168667 5.35057e-05 1.75551e-05 2.1853e-05 0.000151784 0.000555699 0.000573354 0.000160344 2.4743e-05 2.88306e-05 0.000228946 0.000740097 0.000773463 0.000265783 3.3476e-05 2.7488e-05 0.000307546 0.00078306 0.000217211 6.28953e-05 1.8504e-05 2.40006e-05 0.000204085 0.000693034 0.000689261 0.000198513 2.80371e-05 3.52341e-05 0.000296965 0.000875156 0.000890635 0.000343212 2.9184e-05 1.95138e-05 7.12316e-05 0.000271274 0.000900102 0.000264585 2.79404e-05 3.53536e-05 0.00028041 0.00096931 0.00134546 0.000473141 4.82788e-05 4.02357e-05 0.000504449 0.00129258 0.000456771 0.000119856 2.6254e-05 4.67873e-05 0.000490636 0.00140767 0.00140786 0.0005255 4.36841e-05 2.97465e-05 0.000135783 0.000555829 0.00194841 0.000648232 6.49519e-05 6.40951e-05 0.00074737 0.00211759 0.000964437 0.000266403 4.07556e-05 6.49226e-05 0.000867594 0.00252806 0.00166999 0.000553869 4.32306e-05 8.02897e-05 0.000976821 0.00196965 0.00168942 0.000817167 6.60143e-05 6.67795e-05 0.000778173 0.00185154 0.00237196 0.00085763 7.64794e-05 0.000105526 0.00159892 0.00394796 0.000879047 0.000273254 5.9926e-05 6.13528e-05 0.00076604 0.00175546 0.000542597 0.000193881 4.27651e-05 4.63772e-05 0.000473191 0.00113723 0.000971978 0.000348029 4.66751e-05 2.55022e-05 8.87107e-05 0.000278591 0.000656226 0.000352793 3.06849e-05 2.90053e-05 0.000114895 0.000297361 0.000723653 0.000316485 3.31377e-05 3.53736e-05 0.000258152 0.000655725 0.000212851 7.99198e-05 2.33721e-05 2.78232e-05 0.000251045 0.000565432 0.00051877 0.000210451 3.12974e-05 2.18256e-05 6.85143e-05 0.000173756 0.000481328 0.000214327 2.53218e-05 2.9096e-05 0.000185946 0.00044265 0.000153146 6.38624e-05 2.11281e-05 2.3795e-05 0.000190079 0.000424574 0.000383712 0.000167721 2.80056e-05 2.0806e-05 5.92009e-05 0.000136672 0.000372815 0.000171011 2.25615e-05 2.70257e-05 0.000151043 0.000339894 0.000123946 5.59092e-05 2.051e-05 2.19393e-05 0.00015949 0.000337735 0.000304883 0.000140209 2.6247e-05 2.01351e-05 5.26855e-05 0.000114731 0.000308949 0.000147599 2.10354e-05 2.56062e-05 0.000130674 0.000281508 0.000110207 5.20016e-05 2.0089e-05 2.10477e-05 0.000149092 0.000300695 0.000255878 0.000121501 2.65444e-05 2.20568e-05 9.51407e-05 0.000207708 8.20292e-05 3.69397e-05 1.79565e-05 1.74909e-05 9.9205e-05 0.000201316 0.000192763 9.28833e-05 2.25532e-05 1.8329e-05 3.84827e-05 7.88325e-05 0.000190796 9.73566e-05 1.75173e-05 2.2287e-05 8.88171e-05 0.000175693 7.37909e-05 3.63997e-05 1.78442e-05 1.66184e-05 8.87182e-05 0.000166827 0.000160202 8.49222e-05 2.15574e-05 1.79611e-05 3.60162e-05 7.01789e-05 0.000161025 8.71563e-05 1.69603e-05 2.17166e-05 8.19067e-05 0.000150767 6.66648e-05 3.46333e-05 1.75897e-05 1.63537e-05 8.0745e-05 0.000146884 0.000140696 7.7827e-05 2.12544e-05 1.75246e-05 3.34647e-05 6.32746e-05 0.000137153 7.7121e-05 1.58895e-05 2.08887e-05 7.23335e-05 0.000130958 6.08484e-05 3.35288e-05 1.72568e-05 1.55197e-05 7.1715e-05 0.000124845 0.000120618 6.66735e-05 2.04992e-05 1.68919e-05 3.07816e-05 5.41217e-05 0.000107627 7.75264e-05 1.47829e-05 1.91555e-05 3.81638e-05 6.27172e-05 0.00014276 8.294e-05 1.72493e-05 2.17948e-05 7.61981e-05 0.000132076 6.39391e-05 3.68312e-05 1.78154e-05 1.62813e-05 7.90156e-05 0.000132252 0.000125234 7.32512e-05 2.14006e-05 1.77889e-05 3.67405e-05 6.22145e-05 0.000130626 7.8493e-05 1.6211e-05 2.12068e-05 7.30055e-05 0.000123399 6.08443e-05 3.67345e-05 1.76842e-05 1.60777e-05 7.41927e-05 0.0001188 0.00011222 6.69519e-05 2.12863e-05 1.76982e-05 3.60258e-05 5.71099e-05 0.000109811 6.92388e-05 1.56479e-05 2.06478e-05 6.26714e-05 0.000102988 5.05329e-05 3.29396e-05 1.6935e-05 1.44761e-05 6.78184e-05 9.09329e-05 5.5414e-05 3.78352e-05 1.89941e-05 1.68422e-05 6.85102e-05 0.000108969 9.951e-05 6.19044e-05 2.14694e-05 1.75247e-05 3.65603e-05 5.31795e-05 9.89304e-05 6.46463e-05 1.55928e-05 2.06459e-05 5.95763e-05 8.99032e-05 4.80777e-05 3.42305e-05 1.71293e-05 1.45253e-05 6.36691e-05 8.23158e-05 5.21825e-05 3.76245e-05 1.91952e-05 1.67387e-05 6.58478e-05 0.000100386 9.05906e-05 5.94258e-05 2.12501e-05 1.74533e-05 3.70315e-05 5.066e-05 9.35209e-05 6.23448e-05 1.55427e-05 2.06442e-05 5.66079e-05 8.4888e-05 4.61092e-05 3.43265e-05 1.70333e-05 1.45191e-05 5.95115e-05 7.57781e-05 4.89904e-05 3.69244e-05 1.92175e-05 1.65262e-05 6.12586e-05 9.2611e-05 8.3186e-05 5.58651e-05 2.11107e-05 1.73852e-05 3.69069e-05 4.72176e-05 8.43428e-05 5.75058e-05 1.55129e-05 2.06079e-05 5.27986e-05 7.67187e-05 4.35872e-05 3.4584e-05 1.72352e-05 1.46517e-05 5.5606e-05 6.75706e-05 4.50564e-05 3.66266e-05 1.92395e-05 1.62324e-05 5.45461e-05 8.2397e-05 7.37628e-05 4.99298e-05 2.07874e-05 1.6811e-05 3.46228e-05 4.22428e-05 6.62262e-05 5.48303e-05 1.40741e-05 1.89788e-05 3.68153e-05 4.47644e-05 8.13273e-05 5.43063e-05 1.60608e-05 2.10089e-05 5.00854e-05 7.29674e-05 4.26505e-05 3.58841e-05 1.72217e-05 1.4528e-05 5.37899e-05 6.53917e-05 4.48791e-05 3.79083e-05 1.90615e-05 1.59081e-05 5.41242e-05 8.0287e-05 7.19701e-05 4.98284e-05 2.07791e-05 1.7071e-05 3.60278e-05 4.23155e-05 6.47709e-05 5.48399e-05 1.42281e-05 1.91195e-05 3.8247e-05 4.45399e-05 7.89228e-05 5.28273e-05 1.6131e-05 2.10459e-05 4.90643e-05 7.08018e-05 4.20732e-05 3.65517e-05 1.72724e-05 1.44194e-05 5.42171e-05 6.36317e-05 4.43085e-05 3.85863e-05 1.91842e-05 1.61243e-05 5.29521e-05 7.76254e-05 6.94392e-05 4.88422e-05 2.08691e-05 1.73122e-05 3.6549e-05 4.15883e-05 6.07304e-05 5.40897e-05 1.44293e-05 1.88677e-05 3.97915e-05 4.39789e-05 6.69987e-05 5.14757e-05 1.51664e-05 1.96577e-05 3.99344e-05 4.63456e-05 7.89925e-05 5.26403e-05 1.64865e-05 2.09507e-05 4.90593e-05 7.04306e-05 4.26674e-05 3.77132e-05 1.70892e-05 1.42402e-05 5.42721e-05 6.30798e-05 4.45306e-05 4.02363e-05 1.92781e-05 1.61691e-05 5.21405e-05 7.61263e-05 6.83935e-05 4.86736e-05 2.10415e-05 1.73976e-05 3.7713e-05 4.18307e-05 6.01801e-05 5.36347e-05 1.46524e-05 1.91793e-05 4.07681e-05 4.42652e-05 6.58987e-05 5.14968e-05 1.55218e-05 1.961e-05 4.07951e-05 4.62418e-05 7.76578e-05 5.19508e-05 1.62388e-05 2.10082e-05 4.87989e-05 6.92451e-05 4.26442e-05 3.89542e-05 1.72537e-05 1.42466e-05 5.43856e-05 6.19867e-05 4.58715e-05 4.2287e-05 1.92958e-05 1.54832e-05 5.27946e-05 6.7564e-05 4.7827e-05 4.30577e-05 1.9798e-05 1.65217e-05 5.29281e-05 7.91895e-05 7.07187e-05 4.98619e-05 2.13779e-05 1.74294e-05 4.00167e-05 4.38273e-05 6.23936e-05 5.60515e-05 1.44866e-05 1.92345e-05 4.30961e-05 4.65182e-05 6.77497e-05 5.37059e-05 1.54766e-05 1.98241e-05 4.3785e-05 4.8336e-05 7.93449e-05 5.35498e-05 1.65307e-05 2.12766e-05 5.05468e-05 7.08899e-05 4.45173e-05 4.12652e-05 1.75037e-05 1.45937e-05 5.63639e-05 6.36893e-05 4.77405e-05 4.44512e-05 1.95987e-05 1.5869e-05 5.45341e-05 6.89834e-05 4.95497e-05 4.5026e-05 1.99048e-05 1.6469e-05 5.41293e-05 7.9932e-05 7.13488e-05 5.09223e-05 2.11165e-05 1.7377e-05 4.08182e-05 4.43295e-05 6.29088e-05 5.60362e-05 1.45305e-05 1.95792e-05 4.36976e-05 4.70146e-05 6.70486e-05 5.32289e-05 1.57754e-05 2.0005e-05 4.45627e-05 4.84671e-05 7.72301e-05 5.30117e-05 1.65823e-05 2.13824e-05 5.02228e-05 6.92133e-05 4.40427e-05 4.13629e-05 1.76357e-05 1.45735e-05 5.59136e-05 6.2337e-05 4.71157e-05 4.40745e-05 1.94731e-05 1.54203e-05 5.2706e-05 6.64348e-05 4.94203e-05 4.50379e-05 1.96446e-05 1.56293e-05 5.38144e-05 6.91469e-05 5.08402e-05 4.77872e-05 1.9943e-05 1.66365e-05 5.51949e-05 7.95449e-05 7.10753e-05 5.24077e-05 2.13277e-05 1.75437e-05 4.34559e-05 4.58527e-05 6.32455e-05 5.79551e-05 1.48123e-05 1.95698e-05 4.55145e-05 4.82451e-05 6.70158e-05 5.37538e-05 1.57786e-05 1.98958e-05 4.6032e-05 5.03673e-05 6.94417e-05 5.47328e-05 1.57777e-05 2.00137e-05 4.86318e-05 5.15068e-05 7.93635e-05 5.54355e-05 1.66162e-05 2.13166e-05 5.27137e-05 7.11348e-05 4.63647e-05 4.40643e-05 1.76513e-05 1.45678e-05 5.86831e-05 6.44542e-05 4.94532e-05 4.66881e-05 1.97719e-05 1.58697e-05 5.44848e-05 6.85312e-05 5.16569e-05 4.76078e-05 2.00558e-05 1.6005e-05 5.60754e-05 7.08761e-05 5.30299e-05 5.03664e-05 2.02606e-05 1.6887e-05 5.71971e-05 8.08998e-05 7.26115e-05 5.4326e-05 2.15331e-05 1.76532e-05 4.50942e-05 4.78187e-05 6.49696e-05 5.97193e-05 1.46544e-05 1.9877e-05 4.75343e-05 5.03802e-05 6.85929e-05 5.51296e-05 1.5804e-05 2.00435e-05 4.77874e-05 5.19716e-05 7.03359e-05 5.57168e-05 1.592e-05 2.03521e-05 5.04881e-05 5.30737e-05 7.95496e-05 5.65273e-05 1.68454e-05 2.1673e-05 5.43615e-05 7.21144e-05 4.85464e-05 4.66279e-05 1.79729e-05 1.52926e-05 5.96367e-05 6.47162e-05 5.09436e-05 4.87415e-05 1.99912e-05 1.58369e-05 5.61138e-05 6.88015e-05 5.27192e-05 4.89456e-05 2.00043e-05 1.57789e-05 5.60799e-05 7.05873e-05 5.41907e-05 5.02993e-05 2.00539e-05 1.60738e-05 5.85797e-05 7.247e-05 5.50871e-05 5.311e-05 2.0277e-05 1.68564e-05 5.90061e-05 8.15563e-05 7.38277e-05 5.6233e-05 2.15339e-05 1.77605e-05 4.65171e-05 4.96243e-05 6.53149e-05 6.0598e-05 1.47146e-05 2.01425e-05 4.90722e-05 5.19268e-05 6.88764e-05 5.59445e-05 1.61141e-05 2.03244e-05 4.97939e-05 5.35551e-05 7.04539e-05 5.62538e-05 1.59564e-05 2.01716e-05 5.13032e-05 5.46954e-05 7.28977e-05 5.9191e-05 1.61476e-05 2.04112e-05 5.43418e-05 5.59314e-05 8.28508e-05 6.01706e-05 1.69627e-05 2.18145e-05 5.77634e-05 7.51526e-05 5.16061e-05 4.94092e-05 1.80536e-05 1.48673e-05 6.37446e-05 6.7966e-05 5.4076e-05 5.17449e-05 2.00329e-05 1.58618e-05 5.88695e-05 7.21235e-05 5.60148e-05 5.19733e-05 2.02747e-05 1.61178e-05 5.91589e-05 7.37072e-05 5.72619e-05 5.36393e-05 2.02617e-05 1.61489e-05 6.20252e-05 7.57992e-05 5.83764e-05 5.64956e-05 2.04886e-05 1.71584e-05 6.21803e-05 8.49051e-05 7.72482e-05 5.95025e-05 2.18107e-05 1.80589e-05 5.03086e-05 5.32642e-05 6.84691e-05 6.41075e-05 1.5062e-05 2.0347e-05 5.27404e-05 5.55657e-05 7.20926e-05 5.95165e-05 1.62651e-05 2.06034e-05 5.2807e-05 5.71737e-05 7.33538e-05 5.88627e-05 1.62807e-05 2.05403e-05 5.43406e-05 5.79408e-05 7.55131e-05 6.18188e-05 1.64765e-05 2.07154e-05 5.77907e-05 5.88942e-05 8.48243e-05 6.32229e-05 1.71709e-05 2.20985e-05 6.09126e-05 7.78222e-05 5.46536e-05 5.23212e-05 1.82715e-05 1.51399e-05 6.63851e-05 7.01628e-05 5.71101e-05 5.46156e-05 2.03615e-05 1.62331e-05 6.12545e-05 7.39353e-05 5.89909e-05 5.48269e-05 2.0648e-05 1.6357e-05 6.11573e-05 7.58148e-05 6.02366e-05 5.62334e-05 2.05182e-05 1.64491e-05 6.40771e-05 7.76559e-05 6.08891e-05 5.92273e-05 2.06836e-05 1.71899e-05 6.44111e-05 8.63878e-05 7.90509e-05 6.20068e-05 2.21412e-05 1.83172e-05 5.27859e-05 5.56797e-05 6.97114e-05 6.65872e-05 1.51393e-05 2.05825e-05 5.51825e-05 5.78247e-05 7.2541e-05 6.06391e-05 1.63613e-05 2.0795e-05 5.54366e-05 5.9137e-05 7.41105e-05 6.07513e-05 1.64472e-05 2.06197e-05 5.66197e-05 6.00808e-05 7.60964e-05 6.29079e-05 1.64218e-05 2.05489e-05 5.87554e-05 6.1677e-05 7.89308e-05 6.62949e-05 1.6416e-05 2.07618e-05 6.16779e-05 6.26739e-05 8.88863e-05 6.67805e-05 1.72986e-05 2.24683e-05 6.47766e-05 8.18283e-05 5.88151e-05 5.70493e-05 1.86035e-05 1.55191e-05 7.0495e-05 7.39635e-05 6.1266e-05 5.91677e-05 2.0626e-05 1.64517e-05 6.54155e-05 7.77396e-05 6.31103e-05 5.92836e-05 2.08024e-05 1.64962e-05 6.59811e-05 8.00106e-05 6.47423e-05 6.10517e-05 2.06676e-05 1.65275e-05 6.91474e-05 8.2867e-05 6.61032e-05 6.41448e-05 2.09123e-05 1.7501e-05 6.9432e-05 9.18539e-05 8.41685e-05 6.70682e-05 2.26334e-05 1.87107e-05 5.84578e-05 6.07342e-05 7.54931e-05 7.24963e-05 1.55038e-05 2.08115e-05 6.07385e-05 6.34156e-05 7.82308e-05 6.689e-05 1.66575e-05 2.09959e-05 6.04042e-05 6.45236e-05 7.92957e-05 6.61331e-05 1.67582e-05 2.08646e-05 6.17767e-05 6.53656e-05 8.13285e-05 6.85321e-05 1.66705e-05 2.11238e-05 6.49675e-05 6.60647e-05 9.04105e-05 6.92934e-05 1.75858e-05 2.30398e-05 6.76173e-05 8.35266e-05 6.19162e-05 6.06246e-05 1.89886e-05 1.57451e-05 7.34606e-05 7.60477e-05 6.44796e-05 6.2793e-05 2.09748e-05 1.675e-05 6.86066e-05 7.95811e-05 6.62238e-05 6.27325e-05 2.10631e-05 1.66793e-05 6.85044e-05 8.14277e-05 6.74513e-05 6.43973e-05 2.097e-05 1.68491e-05 7.10706e-05 8.42232e-05 6.89019e-05 6.78654e-05 2.14271e-05 1.78314e-05 7.21273e-05 9.33914e-05 8.5949e-05 7.0306e-05 2.31629e-05 1.91152e-05 6.26129e-05 6.41436e-05 7.82336e-05 7.64567e-05 1.57658e-05 2.10275e-05 6.43781e-05 6.67187e-05 8.07778e-05 6.99898e-05 1.68076e-05 2.13491e-05 6.4375e-05 6.79793e-05 8.19889e-05 6.97863e-05 1.68927e-05 2.13686e-05 6.61184e-05 6.90173e-05 8.41882e-05 7.1921e-05 1.70128e-05 2.18373e-05 6.97922e-05 6.99255e-05 9.34687e-05 7.32529e-05 1.82932e-05 2.38403e-05 7.19679e-05 8.67207e-05 6.63755e-05 6.58551e-05 1.96315e-05 1.6319e-05 7.84523e-05 8.03702e-05 6.91675e-05 6.79211e-05 2.14001e-05 1.70598e-05 7.43461e-05 8.42476e-05 7.11407e-05 6.82771e-05 2.16996e-05 1.70516e-05 7.4227e-05 8.66373e-05 7.19742e-05 7.08867e-05 2.20195e-05 1.85005e-05 7.41108e-05 9.49025e-05 8.76399e-05 7.28419e-05 2.42473e-05 1.98851e-05 6.59966e-05 6.71644e-05 7.95031e-05 7.84021e-05 1.6328e-05 2.17328e-05 6.81956e-05 6.95224e-05 8.25948e-05 7.35341e-05 1.73907e-05 2.21759e-05 6.8639e-05 7.11617e-05 8.46806e-05 7.30656e-05 1.7469e-05 2.25454e-05 7.20191e-05 7.18852e-05 9.29176e-05 7.41165e-05 1.86645e-05 2.4597e-05 7.34051e-05 8.65556e-05 6.82362e-05 6.86265e-05 2.00702e-05 1.66546e-05 7.98308e-05 8.05194e-05 7.07527e-05 7.03888e-05 2.19453e-05 1.72824e-05 7.4453e-05 8.41992e-05 7.27462e-05 7.08657e-05 2.2326e-05 1.77378e-05 7.51691e-05 8.66616e-05 7.40087e-05 7.41486e-05 2.28132e-05 1.8903e-05 7.61225e-05 9.45201e-05 8.80306e-05 7.54263e-05 2.50355e-05 2.03954e-05 6.91715e-05 7.01491e-05 8.0623e-05 8.08788e-05 1.65406e-05 2.23656e-05 7.17044e-05 7.20025e-05 8.40197e-05 7.56518e-05 1.78122e-05 2.28333e-05 7.24925e-05 7.39275e-05 8.66049e-05 7.56405e-05 1.79979e-05 2.33635e-05 7.63213e-05 7.49704e-05 9.52118e-05 7.73972e-05 1.94419e-05 2.55686e-05 7.7012e-05 8.91425e-05 7.20556e-05 7.28716e-05 2.07906e-05 1.69639e-05 8.37875e-05 8.35241e-05 7.46853e-05 7.54394e-05 2.28525e-05 1.81798e-05 7.94e-05 8.80099e-05 7.74195e-05 7.64972e-05 2.35129e-05 1.87212e-05 7.9476e-05 9.12358e-05 7.92179e-05 8.05953e-05 2.42534e-05 2.0144e-05 8.15862e-05 9.97659e-05 9.3476e-05 8.14096e-05 2.65879e-05 2.1638e-05 7.66521e-05 7.64304e-05 8.70726e-05 8.78997e-05 1.76236e-05 2.34734e-05 7.89981e-05 7.84992e-05 9.11742e-05 8.2358e-05 1.87003e-05 2.46877e-05 8.17444e-05 8.03506e-05 9.94656e-05 8.19327e-05 2.05413e-05 2.69705e-05 8.12707e-05 9.35654e-05 7.69312e-05 7.80514e-05 2.21906e-05 1.78734e-05 8.83101e-05 8.76688e-05 7.96857e-05 8.10072e-05 2.40453e-05 1.91847e-05 8.40422e-05 9.2504e-05 8.26178e-05 8.26543e-05 2.49265e-05 1.98416e-05 8.46504e-05 9.6541e-05 8.51288e-05 8.76616e-05 2.58102e-05 2.14576e-05 8.80353e-05 0.000105978 9.95006e-05 8.81924e-05 2.83697e-05 2.31537e-05 8.50836e-05 8.33658e-05 9.41972e-05 9.57029e-05 1.88029e-05 2.51096e-05 8.73782e-05 8.62128e-05 9.92151e-05 8.99885e-05 2.00826e-05 2.63592e-05 9.03939e-05 8.80479e-05 0.000108393 8.98863e-05 2.15575e-05 2.87941e-05 9.01373e-05 0.000102417 8.64723e-05 8.87314e-05 2.42626e-05 1.99419e-05 9.7788e-05 9.72293e-05 8.93975e-05 9.18878e-05 2.65024e-05 2.12393e-05 9.37694e-05 0.000103203 9.22629e-05 9.55971e-05 2.78856e-05 2.3258e-05 9.44641e-05 0.000113001 0.000106727 9.49493e-05 3.07372e-05 2.51089e-05 9.2933e-05 9.07096e-05 0.000101923 0.000102551 2.03505e-05 2.76951e-05 9.75842e-05 9.34492e-05 0.000112397 9.57315e-05 2.30964e-05 3.08327e-05 9.5626e-05 0.000106951 9.09307e-05 9.22117e-05 2.50693e-05 2.00103e-05 0.000103254 0.000101291 9.35534e-05 9.51836e-05 2.72455e-05 2.1851e-05 9.62611e-05 0.000105769 9.56426e-05 9.90096e-05 2.90095e-05 2.41718e-05 9.68453e-05 0.000114778 0.000109201 9.81369e-05 3.21176e-05 2.63104e-05 9.70901e-05 9.46879e-05 0.000104429 0.000105156 2.1576e-05 2.9246e-05 0.000102538 9.7177e-05 0.000114569 9.93789e-05 2.4516e-05 3.27275e-05 9.96393e-05 0.000109518 9.6009e-05 9.88798e-05 2.69611e-05 2.17809e-05 0.000106833 0.000105299 9.78595e-05 0.000103481 2.93641e-05 2.3953e-05 9.94274e-05 0.000114958 0.000110075 0.000100243 3.26724e-05 2.72994e-05 9.92807e-05 9.66252e-05 0.000105713 0.000106305 2.24047e-05 3.04879e-05 0.000105389 9.93553e-05 0.00011513 0.000100938 2.5304e-05 3.40528e-05 0.000101738 0.000110415 9.84039e-05 0.000101999 2.80097e-05 2.26328e-05 0.000108505 0.000106686 0.000100696 0.000107232 3.07129e-05 2.53376e-05 0.000102356 0.000116635 0.000111966 0.000102951 3.41122e-05 2.80011e-05 0.000103 9.97129e-05 0.000108122 0.000111653 2.18228e-05 3.05557e-05 0.000108366 0.000101982 0.000117432 0.000102621 2.57927e-05 3.5218e-05 0.000103733 0.000112926 0.000102173 0.000107776 2.93654e-05 2.40881e-05 0.000111781 0.000110485 0.00010555 0.000114385 3.26285e-05 2.71762e-05 0.000108254 0.000121844 0.000117143 0.000109336 3.63276e-05 2.9964e-05 0.000111537 0.000106349 0.000114681 0.000116536 2.42047e-05 3.3042e-05 0.000118477 0.000109418 0.00012683 0.00011291 2.71959e-05 3.61389e-05 0.00011253 0.000122106 0.000110546 0.000119938 3.14184e-05 2.71728e-05 0.000119528 0.000124977 0.000121035 0.000119068 3.77656e-05 3.19421e-05 0.000119021 0.00011258 0.000121907 0.000122661 2.62998e-05 3.55419e-05 0.00012569 0.000116843 0.000132949 0.000118437 2.96961e-05 3.95268e-05 0.000119989 0.000128066 0.000117609 0.000127851 3.32668e-05 2.8254e-05 0.000126936 0.000132163 0.000128286 0.000124004 3.85296e-05 3.3162e-05 0.00012555 0.000117937 0.000131109 0.000125091 2.84024e-05 4.01333e-05 0.000123079 0.000127543 0.000118692 0.000125233 3.42788e-05 2.80134e-05 0.000127035 0.00012702 0.000122325 0.000133494 3.79175e-05 3.15221e-05 0.000125068 0.000139798 0.000134983 0.000127217 4.21033e-05 3.54985e-05 0.000138593 0.000125463 0.000141671 0.000136498 2.9968e-05 4.07365e-05 0.000133154 0.000137513 0.000127117 0.000137435 3.53279e-05 3.04606e-05 0.000135774 0.000142238 0.000138394 0.000135301 4.30979e-05 3.79969e-05 0.000144206 0.000130778 0.000146833 0.000141655 3.24643e-05 4.49391e-05 0.0001394 0.000143157 0.00013511 0.000147504 3.87837e-05 3.28618e-05 0.000144374 0.000149624 0.000145441 0.000141773 4.48111e-05 3.83066e-05 0.000147924 0.000136233 0.000150584 0.000144372 3.21991e-05 4.67747e-05 0.000156383 0.000149862 0.000144341 0.000150771 4.4413e-05 4.02011e-05 0.000146675 0.000139568 0.000150041 0.00014317 3.46439e-05 4.83609e-05 0.000140273 0.0001472 0.000139542 0.000152701 4.16185e-05 3.50927e-05 0.000145422 0.000151574 0.000150123 0.000155352 4.88923e-05 4.51723e-05 0.000148811 0.000143501 0.000139917 0.000151628 4.1893e-05 3.702e-05 0.000145001 0.000151335 0.000151526 0.000159206 5.34365e-05 4.95451e-05 0.000153468 0.000146071 0.000143308 0.000153889 4.37302e-05 3.55386e-05 0.000146592 0.0001531 0.000150566 0.000155598 5.10666e-05 4.83382e-05 0.000149569 0.000145519 0.000143811 0.000157132 4.54576e-05 4.00233e-05 0.000149924 0.000154403 0.000152737 0.000147529 5.80561e-05 5.73519e-05 0.000168405 0.000148831 0.000145361 0.000152159 4.99999e-05 4.50553e-05 0.000156009 0.000143396 0.000153132 0.000146596 4.06123e-05 6.09725e-05 0.000149778 0.000150581 0.000148122 0.000162431 6.16251e-05 6.0943e-05 0.000152502 0.000147483 0.000144049 0.000157408 6.21359e-05 6.16597e-05 0.000148161 0.000141213 0.000145837 0.000166298 5.64511e-05 4.55516e-05 0.000152161 0.000153007 0.000150138 0.000151345 6.57841e-05 6.93857e-05 0.000168686 0.000148514 0.00014778 0.000168428 7.40525e-05 7.92678e-05 0.000170048 0.00014822 0.000149448 0.000175804 8.25031e-05 8.60542e-05 0.000182475 0.000150667 0.000152923 0.000189399 8.75578e-05 8.67681e-05 0.000199748 0.000155245 0.000157975 0.000209143 8.48004e-05 8.25079e-05 0.000222212 0.000161675 0.000165433 0.000234681 8.00335e-05 7.75186e-05 0.000248933 0.000171018 0.000175602 0.000254869 7.51098e-05 7.28485e-05 0.000261167 0.000182951 0.000188603 0.000267754 7.07559e-05 6.88525e-05 0.000274633 0.000197391 0.000204151 0.000281845 6.71308e-05 6.5606e-05 0.000289251 0.000214025 0.000223361 0.000295791 6.4243e-05 6.30448e-05 0.00030247 0.00023577 0.000247117 0.000308517 6.19857e-05 6.10721e-05 0.000314926 0.000261149 0.000272878 0.000321379 6.02831e-05 5.96136e-05 0.000328157 0.000287425 0.000299699 0.00033491 5.90455e-05 5.85818e-05 0.000341983 0.00031502 0.000328319 0.000349012 5.81888e-05 5.78832e-05 0.000356307 0.00034487 0.000359311 0.00036345 5.76442e-05 5.74787e-05 0.00037078 0.000376981 0.000392976 0.000377873 5.73612e-05 5.72951e-05 0.000385091 0.000411809 0.000428799 0.000391993 5.72589e-05 5.72587e-05 0.000398905 0.000447116 0.000461156 0.000405532 5.72768e-05 5.73233e-05 0.000412193 0.000478356 0.000492382 0.000418567 5.73816e-05 5.7461e-05 0.000424995 0.00050952 0.000523441 0.000431114 5.75442e-05 5.76401e-05 0.00043725 0.000540307 0.000553768 0.000443031 5.77352e-05 5.78347e-05 0.000448674 0.000569981 0.000582657 0.000454134 5.79291e-05 5.80321e-05 0.000459486 0.000598045 0.000609816 0.000464367 5.81243e-05 5.82192e-05 0.000469391 0.000624226 0.000635018 0.000473829 5.83101e-05 5.8398e-05 0.000478435 0.000648421 0.000658247 0.000482458 5.84838e-05 5.85611e-05 0.000486598 0.000670612 0.000679576 0.000490168 5.86359e-05 5.86987e-05 0.000493803 0.000690792 0.000698873 0.000496913 5.87606e-05 5.88081e-05 0.000500043 0.000709181 0.000716412 0.000502713 5.88568e-05 5.88888e-05 0.000505364 0.000725632 0.00073225 0.000507647 5.89251e-05 5.89426e-05 0.000509858 0.000740542 0.000746628 0.000511792 5.89677e-05 5.89723e-05 0.000513601 0.000754144 0.000759783 0.000515221 5.89874e-05 5.89813e-05 0.000516667 0.000766648 0.000771951 0.000517994 5.8987e-05 5.89728e-05 0.000519121 0.000777998 0.000783008 0.000520185 5.89707e-05 5.89507e-05 0.000521042 0.000788494 0.000793165 0.000521858 5.89413e-05 5.89162e-05 0.000522507 0.000798256 0.000802603 0.000523102 5.8901e-05 5.88723e-05 0.000523583 0.000807183 0.000810843 0.000523996 5.88526e-05 5.88214e-05 0.000524356 0.000813538 0.000816655 0.000524628 5.87993e-05 5.87664e-05 0.00052486 0.000819094 0.000821801 0.000525005 5.87426e-05 5.8708e-05 0.000525117 0.000824006 0.000826397 0.000525165 5.8683e-05 5.86471e-05 0.000525167 0.00082843 0.000830602 0.000525142 5.8621e-05 5.85843e-05 0.000525054 0.000832469 0.000834504 0.000524979 5.85583e-05 5.85208e-05 0.000524806 0.000836219 0.000838193 0.000524707 5.84942e-05 5.84573e-05 0.00052448 0.000839769 0.000841727 0.00052436 5.84315e-05 5.83946e-05 0.000524088 0.000843202 0.00084516 0.000523961 5.83691e-05 5.83337e-05 0.000523679 0.000846563 0.000848527 0.00052354 5.83101e-05 5.82753e-05 0.000523253 0.00084989 0.00085188 0.000523122 5.82532e-05 5.82202e-05 0.000522856 0.000853228 0.000855249 0.000522743 5.82004e-05 5.81696e-05 0.000522506 0.000856588 0.000858645 0.000522414 5.81525e-05 5.81234e-05 0.000522213 0.000859996 0.000862091 0.000522156 5.81091e-05 5.80823e-05 0.000521999 0.000863453 0.000865584 0.000521975 5.8071e-05 5.80466e-05 0.000521861 0.000866968 0.000869134 0.000521883 5.80379e-05 5.80169e-05 0.000521815 0.000870535 0.000872737 0.000521878 5.80105e-05 5.79932e-05 0.000521858 0.000874158 0.000876393 0.000521965 5.79884e-05 5.79752e-05 0.000521994 0.000877836 0.000880094 0.000522138 5.79716e-05 5.79623e-05 0.000522212 0.000881529 0.000883834 0.00052239 5.79601e-05 5.79545e-05 0.000522514 0.000885248 0.000887586 0.000522711 5.79535e-05 5.7952e-05 0.000522888 0.000888982 0.000891343 0.000523101 5.79521e-05 5.79532e-05 0.00052333 0.000892715 0.000895095 0.000523553 5.79553e-05 5.79576e-05 0.000523828 0.000896446 0.00089884 0.000524065 5.7963e-05 5.79665e-05 0.000524384 0.000900165 0.00090257 0.00052463 5.79748e-05 5.79793e-05 0.000524994 0.000903871 0.000906283 0.000525254 5.79902e-05 5.79964e-05 0.000525649 0.000907555 0.000909972 0.000525917 5.80092e-05 5.80167e-05 0.000526322 0.000911215 0.000913629 0.000526616 5.80311e-05 5.80398e-05 0.000527032 0.000914839 0.000917248 0.000527341 5.80556e-05 5.80653e-05 0.000527763 0.000918428 0.000920822 0.00052809 5.80824e-05 5.80931e-05 0.000528518 0.000921966 0.000924341 0.000528853 5.81112e-05 5.81227e-05 0.000529282 0.000925454 0.000927798 0.000529628 5.81418e-05 5.81542e-05 0.00053006 0.000928877 0.000931186 0.00053041 5.81741e-05 5.81871e-05 0.000530841 0.000932238 0.000934503 0.000531196 5.82076e-05 5.82212e-05 0.000531628 0.000935529 0.000937752 0.000531984 5.82423e-05 5.82564e-05 0.000532414 0.00093875 0.000940926 0.000532772 5.8278e-05 5.82927e-05 0.000533201 0.000941897 0.000944028 0.000533557 5.83147e-05 5.83298e-05 0.000533982 0.000944968 0.000947049 0.000534335 5.83521e-05 5.83676e-05 0.000534755 0.000947959 0.00094999 0.000535102 5.83901e-05 5.84059e-05 0.000535517 0.000950868 0.000952844 0.000535858 5.84285e-05 5.84446e-05 0.000536266 0.00095369 0.000955614 0.000536598 5.84671e-05 5.84834e-05 0.000536998 0.000956427 0.000958294 0.00053732 5.8506e-05 5.85224e-05 0.000537712 0.000959076 0.000960891 0.000538023 5.8545e-05 5.85612e-05 0.000538406 0.000961639 0.000963397 0.000538707 5.85837e-05 5.85999e-05 0.000539081 0.000964114 0.000965819 0.00053937 5.86225e-05 5.86386e-05 0.000539734 0.000966505 0.000968156 0.000540014 5.8661e-05 5.8677e-05 0.000540369 0.000968811 0.00097041 0.000540637 5.8699e-05 5.87149e-05 0.000540982 0.000971034 0.000972581 0.000541241 5.87367e-05 5.87526e-05 0.000541578 0.000973176 0.000974676 0.000541825 5.87741e-05 5.87898e-05 0.000542152 0.000975243 0.000976693 0.000542389 5.88111e-05 5.88264e-05 0.000542708 0.000977233 0.00097864 0.000542932 5.88477e-05 5.88626e-05 0.000543242 0.000979152 0.000980512 0.000543456 5.88837e-05 5.88982e-05 0.000543756 0.000980997 0.000982315 0.000543957 5.89192e-05 5.89334e-05 0.000544249 0.000982774 0.000984047 0.00054444 5.89543e-05 5.89682e-05 0.000544724 0.000984481 0.000985716 0.000544903 5.89889e-05 5.90026e-05 0.000545176 0.000986125 0.000987317 0.000545345 5.90232e-05 5.90365e-05 0.000545607 0.000987704 0.000988859 0.000545764 5.90571e-05 5.90701e-05 0.000546016 0.000989221 0.000990335 0.000546164 5.90907e-05 5.91036e-05 0.000546405 0.000990673 0.000991749 0.000546541 5.91242e-05 5.91369e-05 0.000546771 0.000992062 0.000993096 0.000546898 5.91574e-05 5.91697e-05 0.000547118 0.000993385 0.00099437 0.000547233 5.91901e-05 5.92018e-05 0.000547442 0.000994635 0.000995479 0.000547547 5.92225e-05 5.9233e-05 0.000547766 0.000995958 0.000996769 0.000547742 5.93027e-05 5.92646e-05 0.000548027 0.000996994 0.000997899 0.000548181 5.92357e-05 5.9292e-05 0.000548306 0.000998007 0.000999056 0.000548344 5.93162e-05 5.93214e-05 0.000548512 0.000999059 0.00100022 0.000548963 5.93875e-05 5.93662e-05 0.00054902 0.00100051 0.00100244 0.000550039 5.94929e-05 5.93465e-05 0.000549056 0.00099978 0.000998758 0.000549233 5.93613e-05 5.86138e-05 0.000543308 0.000990444 0.000984169 0.000543461 5.93305e-05 5.98844e-05 0.000544259 0.0010098 0.00102209 0.000554901 6.11177e-05 0.00160264 0.00172594 0.00215828 0.00327661 0.00359324 0.00548232 0.00866584 0.0116699 0.0128155 0.01811 0.0278206 0.03614 0.0478457 0.0651958 0.0913456 0.130327 0.184938 0.257941 0.350543 0.463294 0.595671 0.746256 0.912587 1.09133 1.27797 1.46748 1.65204 1.82518 1.97492 2.09595 2.18182 2.23481 2.25955 2.28446 2.33069 2.39738 2.48294 2.58424 2.70155 2.83326 2.98267 3.15245 3.34885 3.58012 3.85974 2.7502 1.82486 1.36047 1.13727 1.01674 0.932454 0.857343 0.784545 0.714811 0.649626 0.589383 0.533526 0.481538 0.433143 0.388325 0.347185 0.309778 0.276067 0.245886 0.219043 0.195184 0.174032 0.155285 0.138679 0.12398 0.110968 0.0994887 0.0893422 0.080395 0.072513 0.0655875 0.0595104 0.0541721 0.0495096 0.0454362 0.0418828 0.0387991 0.0361191 0.0338003 0.0317985 0.030075 0.0285986 0.027338 0.0262698 0.02537 0.0246211 0.0240049 0.0235084 0.0231176 0.0228231 0.0226147 0.0224872 0.0224279 0.0224364 0.0225063 0.0226305 0.0228087 0.0230358 0.0233086 0.0236286 0.0239893 0.0243901 0.0248323 0.0253112 0.0258274 0.026379 0.026966 0.027589 0.0282462 0.0289386 0.0296648 0.0304258 0.0312188 0.0320497 0.0329136 0.0338139 0.0347488 0.0357195 0.0367275 0.0377724 0.0388582 0.0399788 0.0411415 0.0423435 0.0435884 0.0448765 0.0462058 0.0475857 0.0490101 0.0504817 0.052006 0.0535827 0.0552115 0.0568968 0.058638 0.0604375 0.0623036 0.0642315 0.0662294 0.0682958 0.0704316 0.0726491 0.0749459 0.0773237 0.0797909 0.0823477 0.0850019 0.0877568 0.0906166 0.0935889 0.0966735 0.0998873 0.10323 0.10671 0.110338 0.114119 0.118062 0.122181 0.126485 0.130987 0.1357 0.14064 0.145822 0.151266 0.156991 0.163018 0.169375 0.176088 0.183189 0.190713 0.198702 0.2072 0.216263 0.225949 0.236329 0.247487 0.259517 0.272535 0.286674 0.302096 0.318997 0.337618 0.358253 0.381276 0.407156 0.436506 0.470132 0.509124 0.555 0.609962 0.677334 0.762427 0.874239 1.02926 1.2602 1.63461 2.29541 3.60944 6.77521 15.1909 48.7733 41.398 57.3062 23.7411 65.7968 19.5722 7.80369 3.23453 1.71905 1.13848 0.893705 0.781198 0.720525 0.676875 0.636479 0.595945 0.556132 0.518714 0.48479 0.454682 0.428183 0.40485 0.384193 0.365781 0.349264 0.334369 0.320882 0.308624 0.297449 0.287231 0.277864 0.269254 0.261322 0.253999 0.247226 0.240954 0.235139 0.229743 0.224734 0.220086 0.215776 0.211782 0.208087 0.204677 0.201538 0.198659 0.196032 0.19365 0.191506 0.189597 0.187919 0.186472 0.185253 0.184264 0.183508 0.18299 0.182708 0.182659 0.182875 0.183383 0.184183 0.185287 0.18672 0.188512 0.1907 0.193315 0.196387 0.199968 0.204119 0.208915 0.214449 0.220846 0.228257 0.236843 0.246716 0.257813 0.26973 0.281646 0.292706 0.30344 0.318611 0.352305 0.436943 0.645973 1.14062 2.05384 2.29323 1.56051 0.76602 0.240429 0.04879 0.0157894 0.012535 0.0122357 0.0104429 0.0104235 0.00922197 0.00926735 0.00838327 0.00846381 0.00774685 0.00784563 0.00724036 0.00734892 0.00682341 0.00693708 0.00647123 0.00658737 0.00616765 0.00628482 0.00590194 0.00601898 0.00566694 0.00578258 0.00545595 0.00557015 0.00526531 0.00537804 0.00509203 0.00520339 0.00493391 0.00504381 0.00478866 0.004897 0.00465433 0.00476094 0.00452923 0.00463403 0.00441209 0.00451496 0.00430174 0.00440266 0.00419732 0.00429628 0.00409812 0.00419514 0.00400355 0.00409863 0.00391305 0.00400619 0.00382613 0.00391733 0.00374244 0.00383172 0.00366162 0.00374917 0.00358341 0.00366942 0.00350784 0.00359225 0.00343463 0.00351743 0.00336356 0.00344476 0.00329448 0.00337412 0.0032273 0.00330542 0.00316198 0.00323867 0.00309856 0.00317395 0.00303716 0.0031114 0.00297796 0.00305126 0.00292127 0.00299389 0.00286758 0.00293985 0.00281735 0.00288974 0.00277129 0.00284431 0.00273024 0.00280448 0.00269515 0.00277129 0.00266715 0.00274623 0.00264747 0.00273169 0.00263701 0.00272561 0.00263508 0.00272842 0.00264208 0.00274003 0.00265767 0.00276052 0.00268177 0.00278884 0.00271356 0.0028239 0.0027511 0.00286323 0.00279218 0.00290545 0.00283565 0.00294929 0.0028803 0.00299357 0.00292488 0.00303707 0.00296815 0.00307864 0.00300797 0.00311689 0.00304445 0.00315309 0.00307752 0.00318527 0.00310556 0.00321134 0.00312681 0.0032298 0.00314039 0.00324009 0.00314617 0.00324237 0.00314451 0.00323721 0.00313613 0.0032255 0.00312075 0.00320781 0.00310017 0.0031855 0.00307637 0.0031601 0.00304999 0.00313191 0.00302101 0.00310148 0.00299084 0.00306995 0.00295943 0.00303706 0.00292725 0.00300388 0.00289495 0.0029701 0.00286182 0.00293583 0.00282825 0.00290177 0.00279557 0.00286778 0.00276267 0.0028334 0.00272899 0.00279958 0.00269694 0.0027674 0.00266232 0.00273529 0.00262629 0.00270647 0.00259855 0.00272102 0.00259571 0.00293264 0.00291009 0.0039891 0.00685068 0.00622945 0.00556019 0.0106564 0.00502712 0.00562896 0.0106779 0.00503718 0.00569547 0.0107245 0.00507798 0.00574518 0.010886 0.00514018 0.00582025 0.0110537 0.00521323 0.00590124 0.011236 0.00528417 0.005982 0.0114218 0.00535422 0.0060635 0.0116081 0.00542612 0.00614536 0.0117948 0.0054972 0.00622603 0.0119804 0.00556655 0.00630569 0.0121653 0.00563571 0.00638341 0.0123478 0.00570334 0.00645949 0.0125252 0.00576781 0.00653207 0.0126963 0.00583056 0.00660063 0.0128578 0.00589032 0.00666606 0.0130077 0.00594488 0.00672699 0.0131436 0.00599318 0.00677945 0.0132681 0.00603324 0.00682131 0.0133751 0.00606285 0.00685047 0.0134593 0.00608014 0.00686489 0.0135111 0.00608365 0.00686286 0.0135296 0.00607186 0.00684277 0.0135126 0.00604357 0.00680358 0.013457 0.00599838 0.00674536 0.0133547 0.00593808 0.00667025 0.0132103 0.00586477 0.00658087 0.0130309 0.00578075 0.00648003 0.012821 0.00568896 0.00637111 0.0125919 0.00559219 0.00625794 0.0123541 0.0054936 0.00614449 0.0121176 0.0053964 0.00603452 0.0118928 0.00530368 0.0059317 0.0116853 0.00521846 0.00583916 0.0114999 0.00514333 0.00575903 0.0113367 0.00508348 0.00569856 0.0112359 0.00503687 0.005663 0.0111883 0.00501041 0.00564998 0.0111976 0.00500331 0.00565765 0.0112546 0.00501482 0.00568566 0.0113592 0.00504476 0.00573392 0.0115122 0.0050919 0.0058006 0.0117054 0.0051547 0.00588336 0.0119237 0.00523171 0.00598045 0.0121745 0.00532064 0.00608965 0.0124537 0.0054196 0.0062091 0.0127582 0.00552701 0.00633716 0.0130851 0.00564149 0.00647246 0.013432 0.00576198 0.00661398 0.0137966 0.00588764 0.006761 0.0141774 0.0060179 0.00691254 0.0145743 0.00615233 0.0070683 0.0149868 0.00629068 0.00722842 0.0154147 0.00643288 0.00739292 0.0158586 0.00657898 0.00756193 0.016319 0.00672917 0.00773575 0.016797 0.00688379 0.00791484 0.0172936 0.00704333 0.00809991 0.0178101 0.0072086 0.00829197 0.0183474 0.00738064 0.00849251 0.0189074 0.00756117 0.00870333 0.0194908 0.00775167 0.00892562 0.0200984 0.00795148 0.00915888 0.0207387 0.00816091 0.00940392 0.0214186 0.00838118 0.00966235 0.0221437 0.00861378 0.00993601 0.0229207 0.00886062 0.0102274 0.0237574 0.00912392 0.0105394 0.024663 0.00940638 0.0108753 0.0256487 0.00971079 0.0112378 0.0267277 0.0100402 0.0116298 0.0279164 0.0103979 0.0120599 0.029236 0.0107893 0.0125365 0.0307112 0.0112242 0.0130702 0.0323704 0.0117106 0.0136722 0.0342546 0.0122622 0.014363 0.0365282 0.0128927 0.0151588 0.0392553 0.0136197 0.0160854 0.0425665 0.01447 0.0171823 0.0466815 0.0154828 0.018507 0.0519305 0.0167155 0.0201449 0.0588114 0.0182561 0.0222307 0.0681289 0.0202568 0.025022 0.081501 0.0230173 0.0291026 0.103072 0.0272412 0.0357965 0.143839 0.0346813 0.428549 0.289762 0.219866 0.178392 0.150788 0.130956 0.115995 0.104373 0.0950742 0.0874613 0.0811116 0.0757618 0.0711644 0.0671554 0.0636192 0.06047 0.0576399 0.0550764 0.0527385 0.0505938 0.0486157 0.0467825 0.0450757 0.04348 0.041982 0.0405685 0.0392291 0.0379562 0.0367424 0.0355838 0.0344733 0.0334061 0.0323795 0.0313918 0.0304421 0.0295306 0.0286576 0.0278254 0.027035 0.0262937 0.0256018 0.024966 0.0243866 0.0238831 0.0234431 0.0231142 0.0228717 0.022713 0.0226801 0.0227618 0.0229458 0.0232215 0.0235377 0.0238996 0.0242921 0.0247033 0.0250848 0.0254166 0.025659 0.0257976 0.0258441 0.0258076 0.0256827 0.0254904 0.0252352 0.0249364 0.0246043 0.0242484 0.023876 0.0234941 0.0231067 0.022717 0.0223276 0.0219405 0.0215573 0.0211792 0.0208074 0.0204414 0.0200852 0.0197304 0.019395 0.0190452 0.0187849 0.018445 0.0187264 0.0172064 0.0122233 0.0104219 0.0105303 0.0125229 0.0170434 0.0195464 0.0195274 0.0221504 0.0219832 0.0232482 0.0233449 0.0232089 0.0233751 0.0238474 0.0242639 0.0247407 0.025211 0.0257071 0.0262148 0.0267428 0.0272871 0.0278516 0.0284345 0.0290379 0.0296609 0.0303042 0.0328986 0.0320824 0.0313074 0.0305707 0.0298694 0.0292006 0.0285629 0.0279519 0.0273696 0.0268069 0.0262761 0.0257462 0.0252707 0.0247434 0.0244798 0.0240384 0.0238951 0.0237324 0.0238991 0.0227021 0.022617 0.021165 0.0213288 0.0224572 0.0226555 0.0231152 0.017918 0.0175243 0.0177251 0.0185265 0.0185743 0.0162707 0.0163402 0.0117748 0.0121088 0.0101032 0.00999564 0.0103034 0.010327 0.0105029 0.0106993 0.0181949 0.0235439 0.0240401 0.0245324 0.0250588 0.0193598 0.0189555 0.0185892 0.010926 0.0111479 0.0113907 0.00584203 0.00527656 0.00572718 0.00517372 0.0056169 0.00507437 0.00550933 0.00497885 0.00540586 0.00488813 0.00530874 0.00486279 0.00513596 0.00578296 0.00587615 0.00651878 0.005547 0.00548715 0.00357572 0.00376526 0.002097 0.00200927 0.00186832 0.00317495 0.00290363 0.00182334 0.00184629 0.00314811 0.0028812 0.0017969 0.00183829 0.00315362 0.00293661 0.00181549 0.000879089 0.000877425 0.000875335 0.000872549 0.00088511 0.000876654 0.000936279 0.000956516 0.000883894 0.00185855 0.00322844 0.00291872 0.00182373 0.0018723 0.00320371 0.00299095 0.00184594 0.00189274 0.00328539 0.00297205 0.00185773 0.00190343 0.00325995 0.00304642 0.00187985 0.000904734 0.00090373 0.000896896 0.000897398 0.000890662 0.000890954 0.000884164 0.000911538 0.00192786 0.00334616 0.00302676 0.00189218 0.00193908 0.00332071 0.00310344 0.00191502 0.00196413 0.00340919 0.00308348 0.00192765 0.00197577 0.00338251 0.00316235 0.00195138 0.000934675 0.000933306 0.000926385 0.000926452 0.000919404 0.000918108 0.000911459 0.000941994 0.00200183 0.0034744 0.00314266 0.00196471 0.00201411 0.00344724 0.00322356 0.00198925 0.00204093 0.00354199 0.00320362 0.002003 0.00205364 0.00351394 0.00538307 0.00328674 0.00202831 0.000967014 0.000965527 0.00095809 0.00095809 0.000950553 0.000949125 0.000941958 0.000974785 0.00208138 0.00361203 0.00596075 0.0116363 0.0197748 0.0256071 0.0261849 0.0267921 0.0274335 0.0211694 0.0206793 0.0202169 0.0118978 0.0121685 0.0124543 0.0127536 0.0216876 0.0281111 0.0288304 0.0295945 0.03041 0.023457 0.0228269 0.022239 0.01307 0.0134047 0.0137611 0.00695182 0.00626652 0.0067889 0.00612238 0.00663471 0.0059849 0.00648743 0.00585381 0.00634728 0.00572891 0.00621322 0.00560884 0.00608437 0.00549377 0.00358349 0.00326715 0.00204276 0.00209484 0.00206906 0.00335264 0.00368476 0.0033328 0.00208391 0.00212346 0.000992116 0.000984096 0.000982527 0.000974796 0.000992136 0.00100014 0.00213729 0.0036552 0.0034207 0.00211102 0.00100178 0.00100999 0.00216696 0.00376039 0.00340149 0.00212673 0.00218172 0.00373051 0.00349217 0.00215501 0.00221242 0.00383938 0.00347287 0.00217122 0.00222766 0.00380842 0.00356609 0.0022004 0.00103858 0.00103686 0.00102837 0.00102838 0.00101995 0.00101827 0.00101 0.00104721 0.00225935 0.00392135 0.0035471 0.00221724 0.00227527 0.00388972 0.0036434 0.0022475 0.00230822 0.00400727 0.00362521 0.00226531 0.00232523 0.00397539 0.00372491 0.00229702 0.00107692 0.00107519 0.00106635 0.00106642 0.0010576 0.00105587 0.00104718 0.00108595 0.00235952 0.00409721 0.00370689 0.00231551 0.00237703 0.00406454 0.00380951 0.00234811 0.00241244 0.00419089 0.00379226 0.00236742 0.00243087 0.00415819 0.00641968 0.00389842 0.00240124 0.0011156 0.00111409 0.00110524 0.0011055 0.00109641 0.00109476 0.00108585 0.00112468 0.00246745 0.00428949 0.00712604 0.0141434 0.0241359 0.031283 0.0337592 0.0309666 0.031648 0.0323454 0.033056 0.0337747 0.0344934 0.0352017 0.0358842 0.0365223 0.0370902 0.0375372 0.0378592 0.0380469 0.0379909 0.0377555 0.0373273 0.0474307 0.0490724 0.0483284 0.047333 0.046252 0.0450512 0.0437821 0.0425016 0.0412387 0.0400118 0.0388329 0.037708 0.0366396 0.0356269 0.0346675 0.0322218 0.0332362 0.034338 0.0265655 0.0256772 0.0248725 0.0145566 0.0150006 0.0154866 0.0160283 0.0275562 0.0355422 0.036864 0.0383225 0.039937 0.0314683 0.0299618 0.0286769 0.0166488 0.0173696 0.0183413 0.0091152 0.00809133 0.00865497 0.00772399 0.00829744 0.00742904 0.00800142 0.00717859 0.00774458 0.00695769 0.0075176 0.00676239 0.00731436 0.0065846 0.00425697 0.003882 0.00242116 0.00248674 0.00245664 0.00399258 0.00439528 0.00397909 0.00247862 0.00252574 0.00114371 0.00113443 0.00113305 0.00112428 0.00114318 0.0011521 0.00254692 0.00436396 0.00409394 0.00251589 0.00115338 0.00116277 0.00258721 0.00450789 0.00408127 0.00253816 0.0026087 0.00447622 0.0042001 0.00257655 0.00265112 0.0046281 0.00419146 0.00260072 0.00267488 0.00459928 0.00431667 0.002642 0.00119135 0.00119012 0.00118064 0.00118157 0.00117203 0.00117095 0.00116201 0.00120205 0.00272079 0.00476094 0.0043133 0.00266911 0.00274787 0.00473609 0.00444687 0.00271454 0.00279904 0.00491096 0.00445244 0.00274642 0.00283152 0.00489385 0.00459856 0.00279854 0.00124401 0.00124098 0.00122694 0.00122672 0.00121406 0.00121237 0.00120143 0.00126106 0.0028916 0.00508925 0.00462212 0.00284011 0.00293628 0.00509176 0.0047884 0.00290683 0.00301772 0.00532639 0.00484356 0.00296611 0.00308462 0.00535701 0.00857351 0.00505493 0.00305915 0.00135606 0.00135219 0.00131895 0.00131774 0.00128972 0.00128377 0.00126279 0.00139915 0.00319459 0.00564166 0.00970579 0.0195509 0.0332185 0.041721 0.0436934 0.045853 0.0481596 0.0408125 0.037792 0.0352883 0.020997 0.0229051 0.0257801 0.028657 0.04407 0.0505458 0.0529843 0.0554172 0.0526753 0.0567553 0.0522461 0.0478594 0.0321421 0.0372158 0.0425708 0.0252961 0.0213923 0.0212812 0.0173971 0.0174707 0.0147102 0.0152057 0.0133739 0.0133342 0.0112088 0.011488 0.0100314 0.010485 0.00919928 0.0057249 0.00515751 0.00315208 0.00330362 0.00329107 0.00542424 0.00608275 0.00561584 0.00344715 0.00346832 0.00151369 0.00146263 0.00144884 0.0014045 0.00153544 0.00159911 0.0036477 0.00622946 0.00595597 0.00365814 0.00162079 0.00170597 0.00390244 0.00668454 0.00628501 0.00392464 0.00431739 0.00702035 0.00684779 0.00457753 0.00540122 0.00763302 0.007011 0.0072231 0.00558893 0.00305257 0.0030849 0.00212121 0.00192581 0.00174607 0.000911353 0.00135592 0.00128992 0.00133814 0.00315119 0.00291626 0.00128639 0.00141 0.00354033 0.00737501 0.00782927 0.00872238 0.00973541 0.00476337 0.00378467 0.00414153 0.0033794 0.00377786 0.0031119 0.00136407 0.00151834 0.00147618 0.00166431 0.00165343 0.00200556 0.00219505 0.00461943 0.00639579 0.0119186 0.0132441 0.0151714 0.0168721 0.0259635 0.0306036 0.0493122 0.0533108 0.0475043 0.0457637 0.0368391 0.0364319 0.0360711 0.0357845 0.0355936 0.0355391 0.0356707 0.0359294 0.0363719 0.0369755 0.0377322 0.0386183 0.0396238 0.0407247 0.0419073 0.0431632 0.058312 0.0579339 0.0563899 0.0547398 0.053271 0.0520074 0.0509525 0.0500845 0.0493717 0.0488449 0.0484925 0.0483015 0.048285 0.048498 0.0465259 0.0446909 0.0439976 0.0443801 0.0362368 0.0395783 0.045435 0.0475456 0.0373043 0.0302207 0.0269377 0.0349487 0.0464947 0.0513508 0.0558955 0.0590548 0.0403827 0.0375958 0.0358321 0.0259068 0.0263233 0.0283347 0.0204876 0.0182876 0.0183362 0.0209392 0.0268629 0.0364434 0.0339726 0.0319662 0.0233403 0.0199433 0.0114852 0.00976467 0.00970098 0.00822102 0.00840309 0.00712892 0.00742303 0.00607165 0.00351164 0.00352544 0.00154731 0.000940113 0.00150574 0.00182836 0.00414416 0.0042187 0.00185806 0.00209289 0.00478441 0.00494612 0.00569683 0.00621103 0.00278453 0.00254286 0.00218454 0.00118322 0.00186605 0.00434539 0.00775109 0.00827825 0.0112314 0.0115982 0.00480765 0.00444793 0.00183943 0.0020486 0.00203502 0.00461412 0.00590489 0.012398 0.0153628 0.008357 0.00581471 0.00275818 0.00251649 0.00464984 0.00487305 0.00846197 0.0109278 0.0203889 0.023097 0.0136122 0.0110399 0.00661362 0.00614685 0.00276929 0.00210706 0.00205481 0.00121427 0.00295862 0.00361088 0.00830639 0.0102519 0.01452 0.0155498 0.0295908 0.0237741 0.0204923 0.00889889 0.00656102 0.00587429 0.00568056 0.00247643 0.00150186 0.00248454 0.00315967 0.00395138 0.00662888 0.0110328 0.0138859 0.0193766 0.0192254 0.0164309 0.0158639 0.0128491 0.0139608 0.0142563 0.0139077 0.0118649 0.00892909 0.0112871 0.0138956 0.0160625 0.0167949 0.0101621 0.00781015 0.00341901 0.00310925 0.00171005 0.00497233 0.00568091 0.012393 0.0134372 0.0101888 0.00516811 0.00252121 0.00596193 0.0102292 0.00863869 0.00829013 0.0068517 0.00764806 0.00698305 0.00611443 0.00493013 0.00603113 0.00671983 0.00277268 0.00476304 0.00415602 0.0031946 0.00311528 0.00370031 0.0048256 0.0060161 0.00666697 0.00864426 0.00918561 0.00732644 0.00726738 0.00660754 0.00523429 0.00427161 0.00486292 0.00563807 0.00636045 0.00727488 0.00643145 0.00476441 0.00388866 0.0031365 0.00264711 0.00260917 0.0022725 0.00252182 0.0026035 0.00238101 0.00283415 0.00299094 0.00371029 0.00403694 0.00577347 0.00294482 0.00633345 0.00229876 0.00458894 0.00357212 0.00119327 0.00313321 0.00144914 0.00309628 0.00262875 0.00108467 0.00245216 0.00214694 0.000918802 0.00209385 0.00187828 0.000800344 0.00186386 0.00165727 0.000702944 0.00168731 0.00151234 0.000636625 0.00156502 0.00138169 0.000577223 0.00146175 0.00129491 0.000537686 0.00159894 0.00105273 0.000852532 0.000376218 0.000968999 0.000873445 0.000346393 0.000978997 0.000822047 0.000311136 0.000898742 0.000784992 0.000292858 0.000894087 0.000738275 0.000270093 0.000828406 0.000711038 0.000257856 0.00082238 0.000665448 0.000230846 0.000734413 0.000620003 0.000189114 0.000795399 0.00028755 0.000960641 0.000753997 0.000250294 0.000863266 0.000690569 0.000247108 0.000775464 0.000634901 0.000213324 0.000728548 0.000580712 0.000196986 0.000658076 0.000476745 0.000155356 0.000613805 0.000208147 0.000687086 0.00047943 0.000167979 0.000599586 0.000394141 0.000136305 0.000571656 0.000185783 0.000712756 0.000468909 0.000159245 0.000572925 0.000355619 0.000125854 0.000491614 0.00016699 0.00057751 0.000355487 0.000134774 0.000465424 0.000290043 0.000111998 0.00041209 0.000143644 0.00054971 0.000302705 0.000110164 0.000390989 0.000138337 0.000507947 0.000287632 0.000107577 0.000384421 0.000135689 0.000507716 0.000279261 0.000106246 0.000355874 0.000130971 0.000450982 0.000256836 0.000102712 0.000342052 0.000127223 0.00043063 0.000240686 9.87664e-05 0.00029497 0.00010991 0.000368786 0.00012802 0.000435337 0.000241876 9.96545e-05 0.000311088 0.000122045 0.000354548 0.000209527 9.454e-05 0.000261553 0.000104851 0.000330217 0.000121023 0.000380599 0.000218024 9.59977e-05 0.000275235 0.000108113 0.000331733 0.000123014 0.000351928 0.000204974 9.60037e-05 0.000251247 0.000105333 0.000314409 0.000120569 0.00036023 0.000209251 9.70574e-05 0.000255258 0.000107217 0.000302175 0.000120033 0.000317894 0.000189147 9.48154e-05 0.000224908 0.000102321 0.000273395 0.000113698 0.000310913 0.000186775 9.34092e-05 0.000218755 0.000100694 0.000255215 0.000104343 0.000287177 0.000116982 0.000308238 0.000182919 9.4718e-05 0.000208063 9.95767e-05 0.000236877 0.000102318 0.00026483 0.000113749 0.000294539 0.00018023 9.45593e-05 0.000209045 0.000101844 0.00023927 0.000104688 0.000263633 0.000115655 0.000277989 0.00017418 9.22651e-05 0.000191135 9.92581e-05 0.000217728 0.000101124 0.000236867 0.00011074 0.000254996 0.00016791 8.9054e-05 0.000185238 9.77109e-05 0.000210392 0.000100874 0.000226786 0.000103707 0.000240477 0.000113511 0.000238403 0.000160242 8.77224e-05 0.000176695 9.34141e-05 0.000197669 9.83924e-05 0.000218672 0.000102934 0.000237975 0.000114087 0.000253306 0.000170136 9.18401e-05 0.000186611 9.82495e-05 0.000206768 0.000103304 0.000222291 0.00010696 0.00023478 0.000116949 0.000231333 0.000161185 9.00145e-05 0.000175266 9.36452e-05 0.000191877 9.67348e-05 0.000206702 0.000102943 0.000223138 0.000115861 0.000238193 0.000168326 9.22359e-05 0.000180551 9.66857e-05 0.000197214 9.96549e-05 0.000207658 0.000103857 0.000218864 0.000115787 0.000216185 0.000157859 8.96533e-05 0.000168744 9.24866e-05 0.000184835 9.39275e-05 0.000196817 9.77318e-05 0.000206906 0.000103026 0.000224266 0.000118823 0.000236137 0.000171124 9.55455e-05 0.000185183 0.000100526 0.000201512 0.000102655 0.000213012 0.000107042 0.000224993 0.000120373 0.000230635 0.000170211 9.65013e-05 0.000176711 9.84485e-05 0.000190259 9.93702e-05 0.000199742 0.000102342 0.000214991 0.000115862 0.000221972 0.000167793 9.60388e-05 0.000181548 0.000100355 0.000196033 0.000102295 0.000207779 0.000106771 0.000220871 0.000119488 0.000224486 0.000170315 9.83382e-05 0.000177404 0.000100037 0.000190987 0.000100966 0.00020135 0.000104439 0.000217578 0.000118813 0.00022476 0.000173348 0.000100089 0.000187414 0.000104959 0.000203439 0.000107984 0.000214373 0.000118332 0.000206406 0.000163704 9.7449e-05 0.000174501 9.99605e-05 0.000190156 0.000102643 0.000206399 0.000115124 0.000209529 0.000167292 9.76772e-05 0.000180378 0.000102625 0.000195912 0.000105624 0.000206512 0.000116083 0.00019932 0.000160465 9.66027e-05 0.000172106 9.98319e-05 0.00018964 0.000103423 0.000207756 0.000116969 0.000212442 0.000171236 0.000100226 0.000185292 0.000105969 0.000202883 0.00011008 0.000215401 0.000122338 0.00020969 0.000170325 0.000102584 0.000184243 0.000107928 0.000206419 0.000120281 0.000215325 0.000177474 0.000104412 0.000190076 0.000109882 0.0002092 0.00011542 0.000226614 0.000129554 0.000230267 0.000187416 0.00011148 0.000198782 0.00011685 0.000222238 0.00013077 0.0002296 0.000190908 0.000113371 0.000209646 0.000122158 0.000234089 0.00013802 0.00024017 0.000199772 0.000119803 0.000213308 0.000134569 0.000226894 0.00019487 0.000117196 0.000208083 0.00012285 0.000230467 0.000137914 0.000227178 0.000193464 0.000119473 0.000211871 0.000134955 0.000227096 0.000196477 0.000119297 0.000214941 0.000136134 0.000218043 0.000191208 0.000118819 0.000208905 0.000133852 0.00022407 0.000195275 0.000120146 0.000214387 0.000136539 0.000219029 0.00019254 0.000120709 0.00021328 0.000136048 0.000229674 0.000201094 0.000123609 0.000223364 0.000142287 0.000230394 0.000203666 0.000128056 0.000228518 0.000147374 0.000250937 0.000223314 0.000142166 0.000236022 0.000214895 0.000136276 0.000235286 0.000153241 0.000258397 0.000227876 0.000148574 0.000235032 0.000218157 0.000146145 0.000233851 0.000215845 0.000139531 0.000250959 0.000162326 0.000275767 0.000247214 0.000160397 0.000261728 0.000243254 0.000160521 0.000264187 0.000246445 0.000165571 0.000264121 0.00024656 0.000167107 0.000272022 0.000253255 0.000170341 0.000289788 0.000223746 0.000212779 0.000161024 0.000251947 0.000238054 0.000166475 0.000304895 0.000239442 0.000226413 0.000165322 0.000294791 0.000233709 0.000220411 0.000166159 0.000277877 0.000224441 0.000216812 0.000166028 0.000279402 0.000272054 0.0002172 0.000213993 0.000164018 0.000260425 0.000248975 0.000215221 0.000218444 0.000199287 0.000204695 0.000158974 0.000304995 0.000283151 0.000261824 0.000253934 0.000248522 0.00024404 0.00024027 0.000237485 0.000234563 0.00023246 0.00022982 0.000228665 0.000226444 0.000226018 0.000224254 0.000224342 0.000223329 0.000223799 0.00022346 0.000224449 0.000224788 0.000226681 0.00022763 0.000229564 0.000231904 0.000234054 0.000237255 0.00023984 0.000243979 0.000247038 0.000252215 0.00025582 0.000262213 0.000266418 0.000274097 0.000278882 0.000287794 0.000293152 0.000302526 0.000303255 0.000312756 0.000314158 0.000324807 0.000326848 0.000338519 0.000341088 0.000353678 0.000356785 0.000370261 0.000373799 0.000388185 0.000392035 0.000406813 0.00041129 0.000426987 0.000431491 0.000447537 0.000452422 0.000468839 0.000473985 0.000490776 0.000496222 0.000513717 0.000519074 0.000536732 0.000542484 0.000560607 0.000566281 0.000584749 0.000590412 0.000609009 0.000614717 0.000633541 0.000639135 0.000657924 0.00066347 0.000682355 0.000687699 0.000706413 0.000711657 0.000730396 0.000735392 0.000753999 0.000758786 0.0007771 0.000781854 0.000800063 0.000804523 0.000822671 0.00082686 0.000844741 0.000848803 0.000866531 0.000870269 0.000887803 0.000891445 0.000908761 0.000912045 0.000929185 0.000932383 0.000949283 0.000952098 0.000968821 0.000971565 0.000988095 0.000990461 0.00100681 0.00100911 0.00102526 0.00102718 0.00104315 0.00104502 0.00106078 0.00106225 0.00107782 0.00107926 0.00109463 0.00109568 0.00111085 0.00111188 0.00112684 0.0011275 0.00114229 0.00114298 0.00115759 0.00115791 0.00117239 0.00117274 0.00118706 0.00118705 0.00120125 0.00120128 0.00121532 0.00121498 0.0012289 0.0012286 0.00124236 0.00124169 0.00125534 0.00125472 0.00126823 0.00126722 0.00128061 0.00127965 0.0012929 0.00129156 0.00130471 0.00130342 0.00131643 0.00131476 0.00132765 0.00132604 0.0013388 0.00133681 0.00134948 0.00134756 0.00136009 0.00135778 0.00137022 0.00136798 0.00138027 0.00137765 0.00138984 0.00138732 0.00139936 0.00139648 0.00140844 0.00140567 0.00141748 0.00141436 0.00142608 0.00142308 0.00143467 0.00143131 0.00144282 0.00143959 0.00145095 0.00144736 0.00145864 0.00145519 0.00146635 0.00146254 0.00147364 0.00146998 0.00148094 0.00147691 0.00148781 0.00148394 0.00149473 0.00149056 0.00150123 0.00149736 0.00150765 0.00150327 0.0015135 0.00150953 0.00151976 0.00151542 0.00152556 0.00152142 0.00153159 0.00152714 0.00153865 0.00153467 0.00154778 0.00154455 0.00156183 0.00156956 0.00160932 0.00170365 0.00211927 0.001942 0.00163818 0.00166561 0.00182654 0.00332938 0.00329275 0.00311987 0.00682308 0.0114974 0.0116836 0.0110987 0.00642257 0.00291356 0.00191919 0.0016034 0.00165114 0.00183653 0.00190439 0.00159489 0.00163754 0.00181362 0.00281483 0.00534077 0.0057427 0.00273915 0.00188281 0.00158953 0.00162944 0.00179522 0.00186405 0.00158236 0.00161858 0.00178796 0.00262476 0.0052489 0.00884513 0.0090518 0.00568095 0.00266851 0.00185205 0.00157066 0.00160837 0.00177026 0.00183691 0.00156022 0.00159556 0.00176139 0.00258749 0.00521077 0.00567764 0.00262908 0.00182543 0.00154693 0.00158331 0.00174596 0.00181398 0.00153511 0.00156937 0.00173986 0.00256705 0.0052301 0.00868598 0.0192648 0.0191883 0.0208176 0.0217328 0.032581 0.0311066 0.0299707 0.0298165 0.0296221 0.01903 0.00879591 0.00568875 0.0026032 0.00180544 0.00152154 0.00155749 0.00172572 0.00179196 0.00150975 0.00154296 0.00171526 0.00254573 0.00523058 0.00570007 0.00258026 0.00177942 0.00149541 0.00153066 0.00169946 0.00176784 0.00148307 0.0015155 0.00169328 0.00252487 0.00524072 0.00879126 0.00886433 0.00571652 0.00255947 0.00176072 0.00146849 0.00150283 0.00168132 0.00174956 0.00145579 0.00148727 0.00167256 0.00250503 0.00525027 0.00573325 0.00253883 0.00173814 0.00144076 0.00147408 0.00165712 0.00172634 0.00142749 0.00145798 0.0016503 0.00248546 0.00526278 0.00888456 0.0192689 0.0191745 0.0191456 0.0297611 0.029779 0.0298932 0.0425527 0.04246 0.0424906 0.0423971 0.042636 0.0428747 0.0439731 0.0453238 0.0632336 0.0620277 0.0610259 0.0606984 0.0880839 0.0883962 0.0891323 0.0901496 0.129847 0.129269 0.12904 0.129037 0.129177 0.0879 0.0604382 0.0604249 0.0603405 0.0603583 0.0877804 0.0877964 0.0878569 0.12937 0.12957 0.129777 0.190829 0.18992 0.189011 0.188114 0.187239 0.18647 0.18585 0.185625 0.259853 0.261378 0.263332 0.265447 0.365406 0.361216 0.357316 0.353909 0.468216 0.474049 0.480665 0.487805 0.495204 0.369751 0.267666 0.269911 0.272185 0.274492 0.383245 0.378648 0.374159 0.50276 0.510495 0.518462 0.526704 0.387974 0.276844 0.19174 0.129966 0.087728 0.0603097 0.0425778 0.0299694 0.0193377 0.0089531 0.00575034 0.00251953 0.00171903 0.00141198 0.00144429 0.00163863 0.00170904 0.0013983 0.00142784 0.00163127 0.00246721 0.0052724 0.00576639 0.00250084 0.00169939 0.00138247 0.00141373 0.00161735 0.00168886 0.00136836 0.00139689 0.00161143 0.00244927 0.00528484 0.00897971 0.00904595 0.0057841 0.00248341 0.0016826 0.00135216 0.00138236 0.00160092 0.00167419 0.0013377 0.00136522 0.00159507 0.00243217 0.00529584 0.0058017 0.00246628 0.00166575 0.0013212 0.00135028 0.00158151 0.00165514 0.00130632 0.00133275 0.00157545 0.00241501 0.00530874 0.00907888 0.0196082 0.0195109 0.0194324 0.0300852 0.0301735 0.0302941 0.0303929 0.0196945 0.0091441 0.00581921 0.00245031 0.00164936 0.00128948 0.00131744 0.00156612 0.00164378 0.00127431 0.00129967 0.00156397 0.00239984 0.00531924 0.00583575 0.00243528 0.00163926 0.00125728 0.0012841 0.00155328 0.00163032 0.00124181 0.00126604 0.00154783 0.00238366 0.00533175 0.0091826 0.00924816 0.00585416 0.00241963 0.00162407 0.00122446 0.00125013 0.00153761 0.00161849 0.00120865 0.0012318 0.00153669 0.00236796 0.00534449 0.00587383 0.00240475 0.00161641 0.00119112 0.00121568 0.00152865 0.00161068 0.00117513 0.0011972 0.00152638 0.00235222 0.00535948 0.00929292 0.0199939 0.0198889 0.0197952 0.0305185 0.0306277 0.0307587 0.0308783 0.0200953 0.00936007 0.00589387 0.00238949 0.00160697 0.00115747 0.0011809 0.00151784 0.0016031 0.00114132 0.0011623 0.00151905 0.00233679 0.00537263 0.00591257 0.00237547 0.00160343 0.00112357 0.00114587 0.00151321 0.00160043 0.00110728 0.00112715 0.00151389 0.00232087 0.00538643 0.00941052 0.00948005 0.00593222 0.00236035 0.00159891 0.00108943 0.00111058 0.00150625 0.00159583 0.00107302 0.00109181 0.00150888 0.0023038 0.00540038 0.00595352 0.00234506 0.00159775 0.00105521 0.00107525 0.00150455 0.00159756 0.00103882 0.00105654 0.00150909 0.00228671 0.00541678 0.00953731 0.0204318 0.0203151 0.0202056 0.031016 0.0311462 0.0312914 0.0314328 0.0205497 0.00961081 0.00597602 0.00232919 0.00159947 0.00102111 0.00104004 0.00150337 0.00159775 0.00100479 0.00102147 0.00150735 0.00226791 0.00543281 0.00599867 0.00231191 0.00159972 0.000987245 0.0010051 0.00150176 0.00159849 0.000971064 0.000986734 0.00150593 0.00224806 0.00545004 0.00967495 0.00975313 0.00602255 0.00229414 0.00159915 0.000953767 0.000970609 0.00149736 0.00159452 0.000937855 0.000952594 0.0014986 0.0022285 0.0054682 0.00604856 0.00227773 0.00159407 0.000920883 0.000936797 0.00149021 0.00159071 0.00090524 0.000919095 0.00149035 0.00220871 0.00548914 0.00982487 0.0209332 0.0208007 0.0206737 0.0315862 0.0317386 0.0319015 0.044037 0.0438997 0.0437716 0.0436474 0.0435332 0.0434187 0.0433189 0.0432132 0.0431271 0.0430284 0.0429556 0.042862 0.0428035 0.0427122 0.04267 0.0603181 0.060283 0.060284 0.0875768 0.0876311 0.0876931 0.130145 0.130309 0.130454 0.13059 0.0875012 0.0602573 0.0602566 0.0602385 0.0602396 0.0872486 0.0873385 0.0874276 0.130699 0.130793 0.130864 0.198038 0.197157 0.196265 0.195367 0.194465 0.193557 0.19265 0.279243 0.281695 0.284202 0.403097 0.397887 0.39285 0.535253 0.544131 0.553396 0.56302 0.408498 0.286768 0.289397 0.292093 0.294859 0.426054 0.419954 0.414111 0.573128 0.583724 0.594888 0.606695 0.43244 0.2977 0.198908 0.130912 0.0871467 0.0602304 0.0602376 0.0602386 0.0602543 0.0868138 0.0869289 0.0870422 0.130937 0.130934 0.130898 0.130833 0.0866936 0.060269 0.0602965 0.0603269 0.0603705 0.0863351 0.0864522 0.086574 0.130749 0.13062 0.130462 0.204115 0.20353 0.202874 0.202154 0.201388 0.20059 0.199755 0.300617 0.303611 0.306681 0.453614 0.446182 0.439136 0.61925 0.632622 0.646968 0.662404 0.461442 0.309826 0.31303 0.316293 0.319569 0.487828 0.478541 0.469764 0.679103 0.697246 0.717064 1.01163 0.976192 0.944395 0.915678 0.889495 0.865458 0.843252 0.822611 0.803297 0.785146 0.767953 0.751692 0.736137 0.721323 0.70711 0.693482 0.680389 0.667786 0.655603 0.643759 0.632226 0.621167 0.611003 0.60226 0.754584 0.766638 0.781134 0.797149 0.979906 0.957914 0.938391 0.922726 1.10322 1.12265 1.14777 1.17667 1.20781 1.00329 0.813996 0.831405 0.8494 0.868097 1.07939 1.05296 1.02764 1.24051 1.27475 1.31071 1.55707 1.50969 1.46487 1.42245 1.38249 1.34589 1.31481 1.29153 1.48223 1.50929 1.54657 1.59138 1.79663 1.74331 1.69962 1.66862 1.84316 1.87836 1.92845 1.99034 2.06091 1.85661 1.64108 1.69442 1.75131 1.81205 2.06794 1.9921 1.92182 2.13848 2.22305 2.31528 2.54128 2.43221 2.33329 2.2434 2.16251 2.09238 2.03612 1.99641 2.11951 2.16275 2.22411 2.30138 2.39914 2.31671 2.2519 2.20666 2.25969 2.30568 2.37218 2.45723 2.55775 2.49598 2.39145 2.49239 2.6044 2.72902 2.86443 2.72747 2.6053 2.67226 2.8009 2.946 3.11091 3.01922 2.86851 2.66187 2.41595 2.14969 1.87687 1.60723 1.34853 1.10705 0.887586 0.907929 0.929182 0.951398 1.198 1.1663 1.136 1.38827 1.42997 1.47364 1.51932 1.23118 0.974666 0.999094 1.02483 1.05208 1.3411 1.3025 1.26596 1.56707 1.61704 1.66951 2.03599 1.96665 1.90013 1.83611 1.77477 1.71612 1.66024 1.94593 2.01917 2.09653 2.43255 2.33207 2.2377 2.52574 2.64515 2.77422 2.91208 2.53854 2.17754 2.26195 2.34925 2.4394 2.88125 2.76254 2.64898 3.05664 3.02152 2.49559 1.85026 2.53187 2.5307 2.10832 1.72485 1.38207 1.08108 1.11214 1.14567 1.18212 1.52451 1.47308 1.42587 1.78375 1.84666 1.91546 1.99034 1.5808 1.22207 1.26626 1.31578 1.37018 1.46517 1.71603 1.64302 1.86478 1.3246 0.924191 0.652972 0.84661 1.17705 1.67851 2.24336 2.26457 2.18517 2.60198 2.08116 1.50529 1.01635 1.3895 1.93547 1.33449 1.00904 0.823096 0.719119 0.799202 1.07228 0.804144 0.653421 0.566003 0.553065 0.60515 0.677388 0.654901 0.604348 0.554886 0.551311 0.606263 0.659367 0.711998 0.774335 0.870323 1.04109 1.34682 1.84944 2.53281 3.15728 3.28538 3.10671 2.94335 2.79541 3.02549 3.20305 3.40452 3.63719 3.39953 3.19584 3.30082 3.52297 3.78824 2.89699 3.17639 3.4361 2.72014 1.95571 1.42587 1.23071 1.59486 2.2454 1.94993 1.42344 1.15848 1.01768 1.03438 1.11331 0.940188 0.841716 0.775476 0.782259 0.846975 0.922696 0.927759 0.854169 0.784475 0.716635 0.719039 0.718119 0.660397 0.601674 0.544045 0.538098 0.595423 0.65615 0.651812 0.591217 0.534831 0.482456 0.484788 0.489491 0.49674 0.503662 0.505657 0.507683 0.542064 0.679018 1.02045 1.4429 1.05229 0.738751 0.497663 0.322844 0.204608 0.13027 0.0862217 0.06042 0.044179 0.0320659 0.0210702 0.0099095 0.00607718 0.00225978 0.00158793 0.000888574 0.000903543 0.00148106 0.0015804 0.000873233 0.000886253 0.00147784 0.0021882 0.00551153 0.0061061 0.00224041 0.00157585 0.000857008 0.000871073 0.00146717 0.00156645 0.000842079 0.000854276 0.00146422 0.0021673 0.00553474 0.00999012 0.0100826 0.0061358 0.00222159 0.00156385 0.000826418 0.000839629 0.00145538 0.00155684 0.000812054 0.000823442 0.00145505 0.00214735 0.00555849 0.00616723 0.0022032 0.00155556 0.000797078 0.000809487 0.00144573 0.00154793 0.000783418 0.000794073 0.00144519 0.00212711 0.00558479 0.0101738 0.0215156 0.0213611 0.0212127 0.0322397 0.0324166 0.0326034 0.0327969 0.021678 0.0102764 0.00620145 0.00218445 0.00154491 0.00076934 0.000780964 0.00143366 0.00153883 0.000756404 0.000766404 0.00143321 0.00210687 0.00561303 0.00623771 0.00216692 0.00153473 0.000743449 0.00075435 0.00141998 0.00152441 0.000731193 0.000740476 0.00141925 0.00208871 0.00564284 0.0103797 0.0104943 0.00627518 0.00215165 0.00152119 0.000719375 0.000729822 0.00140767 0.00151406 0.000708045 0.000716672 0.0014088 0.00207297 0.00567349 0.00631426 0.0021387 0.00151075 0.000697896 0.000707074 0.00139447 0.00149912 0.000688283 0.000696025 0.00139053 0.00205924 0.00570674 0.0106119 0.022207 0.0220209 0.0218456 0.0329977 0.0332045 0.0334249 0.0336517 0.0224008 0.0107414 0.00635624 0.00212843 0.00149093 0.000679405 0.00068795 0.00137146 0.00147575 0.000671546 0.000678811 0.00136371 0.0020515 0.00574272 0.0064003 0.0021245 0.00146378 0.000664629 0.000672871 0.00133934 0.00144324 0.000659103 0.00066642 0.00132545 0.00205058 0.00578017 0.0108767 0.0110253 0.00644412 0.00212898 0.00142677 0.000654856 0.000663435 0.00129663 0.00140544 0.000652117 0.00065988 0.00128304 0.00205669 0.00581647 0.006486 0.00213346 0.00139244 0.000650622 0.000660076 0.00125904 0.00137672 0.000650449 0.000658869 0.00125258 0.00205885 0.00585109 0.0111804 0.0230539 0.0228231 0.0226066 0.0338926 0.0341433 0.0344103 0.0346906 0.0232994 0.0113468 0.00652864 0.00213261 0.00137107 0.000652151 0.000661958 0.00123661 0.00136189 0.000654909 0.0006514 0.00123453 0.00205369 0.00588625 0.00657703 0.00212683 0.00135977 0.000655321 0.000638041 0.00122336 0.00135309 0.000643765 0.000624736 0.00122467 0.00204918 0.00592613 0.0115269 0.0117224 0.00663241 0.0021243 0.00135252 0.000632406 0.000612643 0.00121505 0.00134723 0.000620498 0.000601234 0.00121736 0.00204873 0.00597227 0.00669529 0.00212566 0.00134753 0.000609649 0.000590339 0.00120856 0.00134307 0.000598729 0.000579963 0.00121157 0.00205158 0.00602568 0.0119352 0.0241533 0.0238464 0.0235631 0.0349914 0.0353102 0.0356541 0.047758 0.0473789 0.0470359 0.0467139 0.0464234 0.0461453 0.0458959 0.0456563 0.0454304 0.0452196 0.0450214 0.0448334 0.0446575 0.0444884 0.0443312 0.0604827 0.060555 0.0606413 0.0859494 0.0860243 0.0861184 0.130049 0.129802 0.129536 0.129262 0.0858901 0.0607403 0.060854 0.0609844 0.0611311 0.0858795 0.0858484 0.0858578 0.128992 0.128737 0.128512 0.204256 0.204841 0.205142 0.20532 0.20536 0.20525 0.204993 0.326059 0.32915 0.331966 0.530683 0.519004 0.508006 0.762108 0.788186 0.82225 0.628415 0.541101 0.334259 0.336105 0.339875 0.302939 0.294067 0.373127 0.487693 0.467185 0.357787 0.283409 0.230497 0.236907 0.242916 0.204179 0.128352 0.0859475 0.0613048 0.0614902 0.0616892 0.0619295 0.086372 0.0861747 0.0860288 0.128191 0.127945 0.128284 0.129309 0.0865434 0.0621825 0.0624716 0.062779 0.0630873 0.0871154 0.086797 0.0866144 0.115096 0.0949988 0.0788039 0.0719471 0.0851013 0.101353 0.12112 0.145377 0.176207 0.206223 0.198159 0.163537 0.136025 0.134162 0.159985 0.19321 0.190723 0.160137 0.13602 0.116533 0.113699 0.11396 0.0963047 0.0821308 0.0707737 0.0727803 0.0838102 0.0972024 0.100477 0.0871544 0.0758902 0.0660867 0.0632291 0.0616233 0.0618546 0.0659005 0.0769577 0.0633276 0.0481696 0.0360226 0.0244868 0.0121694 0.00676775 0.00213144 0.00134392 0.000588544 0.000570539 0.001203 0.00133965 0.000579164 0.000561649 0.00120627 0.00205896 0.00608883 0.00685342 0.00214276 0.00134103 0.000571023 0.000553404 0.00119839 0.00133825 0.000563142 0.000545096 0.00120341 0.00207304 0.00616542 0.0124267 0.0127117 0.00695657 0.00216138 0.00134188 0.000555569 0.000537536 0.00119759 0.0013416 0.000548308 0.000529887 0.00120488 0.00209525 0.00625966 0.00708112 0.00218923 0.00134802 0.000541225 0.000523124 0.00120166 0.00135072 0.000534651 0.000516333 0.00121143 0.0021277 0.00637492 0.0130272 0.0257023 0.0252537 0.0248519 0.0364241 0.0368603 0.0373461 0.0378857 0.02621 0.0133768 0.00723092 0.00222961 0.00135993 0.000528306 0.000510824 0.00121044 0.00136404 0.000524294 0.000506051 0.00122111 0.00217556 0.00651384 0.00740872 0.00228538 0.00137379 0.000521597 0.000503385 0.00122072 0.00137947 0.000520473 0.000502453 0.00123182 0.00224419 0.00667576 0.0137953 0.0143349 0.00762653 0.00236202 0.00139086 0.000521389 0.000504085 0.00123268 0.00139845 0.000524701 0.000508245 0.00124402 0.00234252 0.00687334 0.00789551 0.00246715 0.0014118 0.000530819 0.000515602 0.00124744 0.00142244 0.000539912 0.00052627 0.00125998 0.00247784 0.00711815 0.0149748 0.0214217 0.026215 0.0267808 0.0384403 0.0325056 0.0253372 0.0181925 0.0181481 0.0148289 0.00823845 0.0026115 0.00143901 0.000552529 0.000540888 0.00126465 0.0014502 0.000569989 0.000560095 0.00127816 0.00264734 0.00744894 0.00759624 0.00282853 0.0014693 0.000592245 0.00058366 0.00128521 0.0014856 0.000621004 0.000613674 0.00129982 0.0029068 0.00683583 0.0118886 0.00880191 0.0055402 0.00318377 0.00151486 0.000660696 0.000655709 0.00131733 0.0015642 0.000724143 0.000732748 0.00137892 0.00317027 0.00509823 0.00500543 0.00316226 0.00168788 0.000870505 0.000959704 0.00150454 0.00179669 0.00128182 0.000482049 0.000502895 0.00136598 0.0017623 0.00157008 0.00312311 0.00509746 0.00785566 0.0108064 0.0115118 0.013364 0.0147821 0.0133854 0.0120862 0.0109613 0.0102359 0.00752975 0.00496463 0.00372023 0.00418112 0.00231562 0.000703622 0.000506472 0.000560341 0.000633655 0.00113247 0.000409912 0.000451208 0.00102022 0.00274089 0.00603502 0.00314181 0.00163997 0.000610779 0.000743086 0.00157528 0.0024103 0.00116678 0.000462853 0.000542958 0.000738992 0.00265019 0.000923956 0.000405891 0.000504306 0.000737901 0.00158867 0.00389673 0.00156561 0.0045644 0.00256228 0.0011364 0.000458806 0.000554344 0.00147645 0.00307926 0.00251301 0.000786221 0.00104114 0.000493474 0.000674528 0.00118203 0.000430905 0.00052306 0.00200606 0.000719795 0.00131398 0.000475054 0.000637524 0.00164565 0.00444582 0.00586127 0.00832962 0.00584432 0.00427323 0.00167884 0.00165904 0.00698432 0.00565562 0.00627683 0.0076638 0.00731137 0.00703512 0.00556102 0.00465461 0.00602397 0.00398843 0.0021886 0.00141991 0.00837089 0.00797826 0.00966362 0.0102989 0.00979067 0.00939871 0.00934481 0.00871461 0.00893677 0.00915047 0.00901391 0.00935879 0.0082652 0.0072611 0.00557169 0.00323512 0.00126659 0.00049419 0.000677161 0.00124356 0.000465594 0.000622153 0.00166387 0.00444161 0.00191763 0.00337376 0.00587073 0.0032074 0.00127633 0.00049297 0.000691413 0.00136619 0.000490905 0.000698969 0.00194373 0.00461335 0.0019693 0.00333319 0.00703522 0.00921317 0.00886296 0.0080691 0.00997831 0.0102783 0.00930905 0.00831486 0.00628545 0.00376041 0.00160478 0.00060111 0.00101292 0.0004248 0.000580941 0.00117737 0.00043076 0.000587104 0.00283773 0.00115149 0.000447294 0.000694767 0.00155318 0.000576054 0.000975385 0.000391864 0.000544912 0.00156721 0.00401333 0.00280224 0.0063535 0.00220621 0.00774025 0.0102262 0.00780643 0.00535404 0.00163046 0.00201791 0.0025644 0.00401973 0.009556 0.00895744 0.0104601 0.00955327 0.00838126 0.0105409 0.00706346 0.00335915 0.00124104 0.000469564 0.000713843 0.00156495 0.000565479 0.000997418 0.000405932 0.000576992 0.00346672 0.0013284 0.000507879 0.000992339 0.000406399 0.000620736 0.00141213 0.000508889 0.000905755 0.000376165 0.000536013 0.00343542 0.00199192 0.00487576 0.00178448 0.00308732 0.00708726 0.00266273 0.0115082 0.0101541 0.00539757 0.00208941 0.00213778 0.00372155 0.0092822 0.0114603 0.00947588 0.0102124 0.012257 0.0118725 0.0113629 0.011098 0.0107327 0.0111705 0.0116539 0.0109782 0.0109397 0.0106341 0.010207 0.00972018 0.00987388 0.00955198 0.00944572 0.00942854 0.00933224 0.0090871 0.00940537 0.00889863 0.00930424 0.0099425 0.0108336 0.0121815 0.0139372 0.0155918 0.017634 0.0228034 0.0316855 0.0408219 0.0499891 0.0496916 0.0491417 0.0486325 0.0636735 0.0640677 0.0533977 0.0471851 0.0537987 0.0633848 0.0564634 0.049676 0.0421521 0.0326598 0.0393895 0.045682 0.0366573 0.0261376 0.0193728 0.0187202 0.0219444 0.0291996 0.0255967 0.0219378 0.0195058 0.0207563 0.0235388 0.0266491 0.0309263 0.0379147 0.0462638 0.0538098 0.0532716 0.0448698 0.0380796 0.0407923 0.0472908 0.0547699 0.0574534 0.0499503 0.0435137 0.0381061 0.0355121 0.0331631 0.0288925 0.0253111 0.0224649 0.0246373 0.0275898 0.0311911 0.033628 0.0299011 0.026805 0.0242329 0.0221968 0.0201261 0.0184271 0.0172522 0.0167665 0.0167364 0.0150277 0.0131898 0.0115972 0.0117158 0.0129973 0.0147823 0.01527 0.0137456 0.0126137 0.0118059 0.0108151 0.0104814 0.00973096 0.00927076 0.00901882 0.00972508 0.00988427 0.0102378 0.0112568 0.0109076 0.0107221 0.0119282 0.0121346 0.0125161 0.0131023 0.0139389 0.0150762 0.0165541 0.0182311 0.0167263 0.0155573 0.0173155 0.0185925 0.0202026 0.0221226 0.0204066 0.019025 0.0179334 0.0163246 0.0146758 0.0140337 0.0135863 0.0132967 0.0146466 0.0150271 0.0155766 0.0170887 0.0164485 0.0159813 0.0156588 0.0144057 0.0131405 0.011858 0.0106684 0.00970579 0.00895502 0.00869075 0.00862864 0.00888142 0.00874459 0.0088328 0.00937076 0.0093124 0.0101197 0.0101171 0.0100202 0.00999681 0.00971397 0.00949605 0.00935063 0.00921349 0.00893282 0.00919073 0.00890688 0.00871254 0.00920237 0.00902118 0.00979145 0.0107314 0.0108923 0.00996221 0.0101995 0.00945914 0.00977274 0.0101327 0.00954881 0.00995297 0.00953507 0.00994308 0.0104035 0.0100906 0.0101695 0.0108336 0.0119451 0.0122776 0.0122713 0.0124249 0.0130943 0.0119276 0.0107966 0.00923831 0.0113175 0.00716903 0.0025975 0.000938881 0.000388034 0.000594201 0.00172326 0.00491768 0.00313767 0.00133841 0.000490989 0.000877362 0.00037039 0.000530807 0.00336904 0.00128507 0.000482732 0.000973238 0.000396733 0.000627343 0.0015055 0.000517108 0.000966067 0.000387827 0.000581261 0.00397645 0.00223796 0.00524998 0.00182217 0.0032303 0.00711671 0.00264852 0.0130339 0.010318 0.0121875 0.0107136 0.0130614 0.00845125 0.00337234 0.00123242 0.000480271 0.000940328 0.000373988 0.000568314 0.00137862 0.000534974 0.0010329 0.000392542 0.000631749 0.0019198 0.00463675 0.00283956 0.00625217 0.0018249 0.00245129 0.00410595 0.0119777 0.0148086 0.012498 0.0148703 0.0124499 0.0131468 0.0136863 0.0160305 0.0161799 0.0163382 0.0171922 0.0156491 0.0141166 0.01305 0.00616022 0.00212428 0.000682119 0.000403885 0.00103163 0.000511149 0.00143901 0.000630622 0.0018556 0.00352702 0.00724717 0.00282077 0.00387863 0.00507083 0.00938369 0.00436822 0.0124682 0.00181652 0.000596378 0.00127386 0.000491431 0.000992414 0.000372168 0.000625697 0.00199134 0.00474916 0.002775 0.0120085 0.0145248 0.0168073 0.0149571 0.0139081 0.00956375 0.00468364 0.00196458 0.000644288 0.00158976 0.000540111 0.0012072 0.000452357 0.000944113 0.000358202 0.000588279 0.0015457 0.000583529 0.00124921 0.000439536 0.000876356 0.000353809 0.000581543 0.00386831 0.00202526 0.00505246 0.00305256 0.00635138 0.0019262 0.00247922 0.00416097 0.00789074 0.00313984 0.00384994 0.00559904 0.0143263 0.0170463 0.0145013 0.01206 0.0168763 0.0106951 0.0140529 0.00825059 0.0038165 0.00151687 0.000530057 0.00127266 0.000451394 0.000958732 0.000368695 0.000657047 0.00181338 0.000592046 0.0013584 0.000520824 0.00116387 0.000406105 0.000832135 0.000332313 0.000555108 0.00394487 0.00164646 0.000544885 0.00144647 0.000511462 0.00123728 0.00043767 0.000931964 0.000359807 0.00064892 0.00179655 0.000585907 0.00134999 0.000523689 0.00117443 0.000412389 0.000844447 0.000342847 0.000584803 0.00394733 0.00176927 0.000585675 0.00161107 0.000554729 0.0014035 0.000475844 0.00105565 0.000390936 0.000734061 0.00211094 0.000674777 0.00165636 0.000610931 0.00149878 0.000505356 0.00118266 0.000451312 0.000995622 0.000356539 0.000652251 0.00209538 0.00471259 0.00254457 0.00551988 0.00323525 0.00651915 0.00230235 0.00403023 0.00756212 0.00329648 0.00505026 0.00843872 0.00395382 0.0150242 0.0195611 0.0104795 0.00488579 0.00200548 0.00278682 0.00585919 0.00198985 0.00361154 0.00718416 0.00256245 0.00305511 0.00474985 0.00826634 0.00373414 0.0140972 0.0196214 0.0174237 0.0196042 0.0153628 0.0104307 0.0048193 0.00279348 0.00595461 0.00203801 0.0036631 0.00708162 0.00315571 0.00477375 0.00262372 0.0136603 0.0167848 0.014852 0.0164008 0.0181724 0.0173137 0.0192618 0.0161709 0.0115403 0.016554 0.0170578 0.021599 0.0222569 0.0220809 0.0228397 0.0222393 0.0237666 0.0211098 0.0190456 0.0150849 0.0193733 0.0141284 0.0190837 0.0122984 0.0178573 0.0114757 0.0165644 0.00961845 0.00487681 0.00219208 0.000701611 0.00195965 0.000614742 0.0016081 0.000549459 0.00141287 0.000466365 0.00105116 0.000385673 0.000733643 0.00211231 0.000674603 0.0016718 0.000613519 0.00151594 0.000510343 0.00121119 0.000461557 0.00103694 0.000366282 0.000678561 0.00213387 0.00470821 0.00254029 0.00532146 0.00317762 0.00656222 0.00228701 0.00403455 0.00733902 0.00282412 0.00314528 0.00494209 0.0085928 0.00371183 0.00413849 0.0060503 0.0146861 0.0226637 0.0187407 0.0129853 0.0228469 0.0121086 0.0161801 0.0107534 0.0229951 0.00963225 0.00484523 0.00227845 0.000734288 0.00208659 0.000652526 0.0017532 0.000588514 0.00155872 0.00050451 0.00119162 0.000413804 0.000807406 0.00235673 0.000749033 0.00193596 0.000688898 0.0017852 0.000588548 0.00150156 0.000560553 0.00138276 0.000449359 0.00102974 0.000371784 0.000686388 0.00448809 0.00232775 0.00505206 0.00286883 0.00582668 0.0035065 0.00676029 0.00245759 0.00422049 0.00777039 0.0033043 0.00517924 0.00847786 0.00383134 0.00414871 0.00593231 0.015428 0.0220464 0.0148538 0.0201397 0.0140561 0.0191524 0.0123579 0.0178164 0.011729 0.0168439 0.0103579 0.0151017 0.00917179 0.00439057 0.00200941 0.00065142 0.00186188 0.000585575 0.00152938 0.000507712 0.00125183 0.000407664 0.000773049 0.0022304 0.000788708 0.00199014 0.000643269 0.00165162 0.00060643 0.00150311 0.000490484 0.00113827 0.000406646 0.000775787 0.0044727 0.00224738 0.000740333 0.00222476 0.00072161 0.00207176 0.000651243 0.00175368 0.000566082 0.00145181 0.000451661 0.000894435 0.00246761 0.000882116 0.00221323 0.000719851 0.00186485 0.000665648 0.00169712 0.000531526 0.00129115 0.000435518 0.000851566 0.00483006 0.00265659 0.00544121 0.00328726 0.00633211 0.00409441 0.00736004 0.00265174 0.00306769 0.00487252 0.00828387 0.00396208 0.00576748 0.00902983 0.0045976 0.0151993 0.0241457 0.0107512 0.00527562 0.00239344 0.0030644 0.00594009 0.00381366 0.00725874 0.00246718 0.00290273 0.00470785 0.00787246 0.00342345 0.00375239 0.00549681 0.0135101 0.0265704 0.0190944 0.0265791 0.0149056 0.0213238 0.0262307 0.0234694 0.0259267 0.0236272 0.0245878 0.0292884 0.0303116 0.0294141 0.0308709 0.0299001 0.0313951 0.0302795 0.0317531 0.0302818 0.0324925 0.0287071 0.0229113 0.0152286 0.0205145 0.0145212 0.0193215 0.012724 0.0179532 0.0120501 0.0170129 0.0106691 0.0151492 0.00940417 0.00468568 0.00236445 0.000768049 0.00218041 0.000679599 0.00181023 0.000580815 0.00150075 0.000461448 0.000921683 0.00241756 0.00088559 0.00214537 0.00069616 0.00174259 0.000617713 0.00150963 0.000478569 0.000979912 0.00258503 0.00519456 0.00313306 0.00596152 0.00396569 0.00735739 0.00262969 0.00308603 0.00489875 0.0080468 0.00362562 0.00397722 0.00574102 0.0133721 0.026029 0.0188876 0.0289889 0.0148479 0.0212821 0.0303064 0.0240543 0.0299985 0.0267622 0.0339314 0.0355895 0.0344337 0.0360911 0.0348118 0.0364577 0.0348722 0.0234149 0.00976405 0.00520228 0.00278984 0.00101117 0.00255117 0.000847481 0.00215762 0.00069801 0.00179846 0.000548163 0.001134 0.00268717 0.00110123 0.00244174 0.000829516 0.0020325 0.00070775 0.00172457 0.000543509 0.00113086 0.00278135 0.00551406 0.00347166 0.00645115 0.00434542 0.00770254 0.00341146 0.00528715 0.00850223 0.0040014 0.00443858 0.00616522 0.0150384 0.0215669 0.0143147 0.0189378 0.0130813 0.0180931 0.011476 0.0161148 0.0102551 0.00544113 0.00297744 0.00116394 0.00268066 0.000963561 0.00224144 0.000777429 0.00187037 0.000593107 0.00119437 0.00263995 0.00113589 0.00228251 0.000817686 0.00180273 0.000616755 0.00121487 0.00511653 0.00268788 0.00112671 0.00252096 0.000986305 0.00215262 0.000749106 0.00140422 0.00303564 0.001359 0.00255635 0.000991045 0.00201919 0.000730849 0.00135965 0.00547464 0.00294629 0.00128631 0.00271223 0.00111556 0.00227648 0.000842705 0.00148958 0.00311121 0.00143123 0.00254755 0.00103858 0.00198826 0.000771836 0.00134234 0.00526716 0.00273592 0.00121723 0.00237598 0.000991402 0.00166661 0.00336496 0.00153476 0.00266938 0.00122794 0.00219425 0.000876045 0.0014612 0.00318169 0.00608165 0.0042764 0.0075557 0.00344913 0.00536524 0.00896766 0.00455176 0.0231346 0.0140774 0.0197178 0.0121594 0.0168255 0.0105053 0.00554907 0.00313393 0.00145112 0.0025249 0.00104936 0.00161207 0.00324389 0.00149963 0.00247795 0.00106765 0.00161597 0.00344218 0.00635572 0.0047592 0.00818788 0.00358703 0.00429156 0.00632978 0.0126798 0.0254373 0.0107203 0.00582329 0.00337837 0.00163707 0.00273191 0.00120155 0.0017396 0.00346225 0.00162663 0.00259936 0.00116148 0.00168436 0.00356523 0.00657352 0.00501589 0.00848967 0.00381171 0.00452674 0.00651779 0.0152098 0.0214072 0.0131773 0.0178521 0.0111506 0.00592725 0.00342457 0.00167325 0.00268535 0.00119569 0.00167696 0.00320201 0.00136283 0.00186664 0.00608976 0.00341115 0.00168604 0.00276386 0.00134493 0.00184098 0.00340043 0.0015426 0.00211553 0.0042173 0.00783763 0.00373659 0.00590754 0.0102664 0.00509706 0.0258783 0.0127342 0.00829752 0.00368877 0.00468446 0.00452871 0.00662985 0.0157336 0.0319605 0.0194329 0.0252832 0.0375343 0.0536409 0.0550441 0.0518552 0.0445684 0.0303742 0.0236768 0.0347906 0.0468613 0.0408891 0.0271091 0.0129689 0.00630989 0.00341962 0.00463794 0.00829965 0.00337833 0.00404179 0.00603508 0.0096079 0.00504087 0.014414 0.0204098 0.0308928 0.016144 0.0119813 0.00664463 0.00468379 0.00796037 0.00326648 0.00381715 0.00562959 0.00926845 0.00473247 0.0229899 0.0109334 0.00600251 0.0031577 0.00417772 0.00765552 0.00289242 0.00347835 0.0053411 0.00853976 0.00461245 0.0064288 0.00410854 0.0137182 0.0261786 0.0125284 0.0163571 0.0193869 0.0295812 0.022318 0.0329814 0.0254847 0.0329415 0.0385393 0.0398885 0.0372566 0.0387652 0.0407412 0.0418258 0.0414054 0.0400473 0.0387727 0.040503 0.0392498 0.0409424 0.0393303 0.0419825 0.0347132 0.0203932 0.0130487 0.0180789 0.0242716 0.0144428 0.0434529 0.0450738 0.0438141 0.0455269 0.0480503 0.0488931 0.0470254 0.0478607 0.046425 0.0447727 0.045592 0.0433693 0.0443317 0.0425081 0.0434018 0.0419208 0.0426199 0.042738 0.0435059 0.043658 0.0445905 0.0446372 0.045742 0.0457966 0.046887 0.0469175 0.0480201 0.0490326 0.0491677 0.0503933 0.0505093 0.0503613 0.0497926 0.0484899 0.0501799 0.0515383 0.0533644 0.0528344 0.0552251 0.0551045 0.056548 0.0569867 0.0570429 0.0559547 0.0466493 0.0582791 0.0383963 0.0208241 0.0120036 0.00681749 0.0040385 0.00207464 0.00313343 0.00149312 0.00195553 0.00359707 0.00160587 0.00212096 0.00646374 0.00375625 0.00192658 0.0029933 0.00150759 0.00198405 0.00398105 0.00815893 0.00635796 0.0107742 0.00548706 0.0183939 0.0317535 0.0168906 0.00929006 0.00419077 0.00516485 0.00520353 0.00756005 0.0138154 0.0248363 0.045249 0.0255619 0.0159948 0.0205371 0.0123389 0.00662316 0.00365487 0.00182589 0.00235471 0.00458999 0.00904611 0.00732991 0.00398882 0.00189393 0.00241753 0.00477487 0.00748706 0.00428551 0.00219669 0.00287924 0.00536182 0.0101827 0.00832959 0.0132598 0.0218088 0.0373239 0.0173104 0.0298375 0.0524457 0.0297392 0.0190392 0.0238946 0.0149998 0.00696794 0.00219338 0.00177288 0.00349387 0.00251922 0.00477676 0.00547754 0.00363971 0.00185264 0.00248274 0.00421955 0.00197201 0.0024311 0.00721886 0.00388883 0.00199775 0.00263761 0.00443193 0.0021022 0.00257316 0.00757748 0.00412783 0.00212065 0.00279566 0.00467776 0.00220586 0.00264916 0.0080792 0.00411005 0.002108 0.00269596 0.00409929 0.00728659 0.0132365 0.00579307 0.0389318 0.0187091 0.0103399 0.00599494 0.00310084 0.00383496 0.00620248 0.00315812 0.00389402 0.00744137 0.014521 0.00739459 0.0118104 0.0223076 0.0117429 0.00666801 0.00343656 0.00430908 0.00839551 0.0170704 0.0134758 0.00707555 0.00365126 0.0045339 0.00863456 0.013901 0.00794317 0.00408965 0.00518241 0.0102192 0.0214973 0.0163497 0.0272671 0.0387534 0.0645827 0.0505288 0.0361944 0.0186537 0.0109505 0.00568506 0.00770719 0.0149006 0.0300099 0.0234668 0.0144189 0.00771618 0.0125182 0.00693942 0.00957908 0.0159554 0.0106818 0.0103271 0.00783749 0.00652526 0.00567445 0.00461181 0.00507853 0.00414469 0.00357221 0.00324648 0.00321564 0.0033237 0.00415423 0.0048023 0.00578145 0.00706532 0.00903315 0.00618842 0.00583342 0.00492355 0.00405014 0.00405921 0.00437941 0.0048247 0.00529383 0.00531417 0.00498237 0.00656245 0.00863606 0.0125776 0.00885447 0.00641492 0.00603798 0.00731128 0.00584365 0.0066569 0.00798027 0.0058308 0.00713316 0.00788419 0.0110336 0.00868972 0.0112645 0.0144306 0.00889821 0.0110919 0.00920362 0.0146929 0.0187957 0.0170032 0.0173244 0.0202107 0.0243723 0.0297454 0.0373866 0.0482329 0.0611258 0.0614105 0.0445124 0.0326243 0.0247454 0.0181849 0.0145956 0.0102193 0.013056 0.0159293 0.0103639 0.00777995 0.00866562 0.0131273 0.0591428 0.0572239 0.0519344 0.0506572 0.041864 0.0457 0.0488487 0.0528306 0.0562265 0.0562105 0.0569426 0.0582438 0.0577175 0.0556062 0.0539812 0.051564 0.0542488 0.057097 0.0559146 0.052284 0.0485217 0.0444522 0.0398697 0.0348436 0.0297751 0.0351856 0.0317718 0.0260846 0.0237834 0.0296569 0.035609 0.0375329 0.0405174 0.045545 0.050185 0.0545827 0.0534492 0.0484143 0.0431206 0.0415518 0.0472931 0.0527582 0.0579796 0.0582771 0.0588613 0.0595656 0.0601319 0.0601481 0.0600172 0.059362 0.0445331 0.0459935 0.0475412 0.0491718 0.0508844 0.0526787 0.054555 0.0565127 0.0585488 0.0606621 0.062894 0.0652492 0.0677443 0.0703958 0.0732242 0.0762534 0.111379 0.106529 0.10202 0.0978097 0.093866 0.09016 0.0866664 0.0833687 0.079275 0.075359 0.0717857 0.0685582 0.0656799 0.0631629 0.0610357 0.0621954 0.0647291 0.0675915 0.0690101 0.0657975 0.0628417 0.0633499 0.0667601 0.0703718 0.0741964 0.0724717 0.0707611 0.0742235 0.0779736 0.0820209 0.0843957 0.080143 0.0761791 0.0782506 0.0825604 0.087164 0.0892133 0.0843299 0.0797158 0.075336 0.0711587 0.0671556 0.0633007 0.0631128 0.0674038 0.0717827 0.0723682 0.0676638 0.0629878 0.0630324 0.0679955 0.0729371 0.077913 0.0771512 0.0762888 0.080958 0.0858247 0.090924 0.0923799 0.0871187 0.0820552 0.08297 0.0881493 0.0934902 0.0990312 0.0978776 0.0962912 0.0943986 0.0920996 0.0889956 0.0863766 0.0910712 0.0961693 0.101732 0.105209 0.099398 0.0940036 0.0973846 0.103022 0.109048 0.115523 0.111496 0.107804 0.114429 0.121664 0.129586 0.133856 0.125745 0.118319 0.122516 0.130098 0.138354 0.142241 0.133755 0.125945 0.118727 0.112025 0.105772 0.0999102 0.101962 0.107971 0.114364 0.116192 0.109742 0.103652 0.10481 0.110861 0.117218 0.123911 0.123051 0.121194 0.128527 0.136437 0.145008 0.146655 0.13822 0.130373 0.13097 0.138417 0.146258 0.142801 0.136132 0.129573 0.123175 0.116967 0.110962 0.105159 0.0995477 0.0941086 0.0888156 0.0836378 0.078541 0.0734865 0.0684293 0.0633155 0.0580823 0.0526649 0.0470136 0.0411146 0.0350222 0.0289493 0.0230472 0.0243462 0.0301108 0.032583 0.0273647 0.0222383 0.0174078 0.0230615 0.0209158 0.0203495 0.0223579 0.0184241 0.0140981 0.0141155 0.0334163 0.0330753 0.035372 0.0249223 0.0441738 0.0668168 0.0954085 0.0512722 0.0332073 0.0442678 0.0649221 0.0370074 0.0637521 0.0288257 0.10692 0.0769058 0.0504858 0.0239699 0.0123282 0.00582648 0.0067192 0.0177263 0.0291314 0.0158971 0.032297 0.0113465 0.00546401 0.0062364 0.0153584 0.010533 0.00519923 0.00598481 0.0198874 0.0428676 0.0346481 0.0246423 0.0630116 0.085237 0.0744789 0.0787768 0.0738301 0.0644514 0.0689849 0.0650585 0.0556528 0.0619292 0.0651399 0.068047 0.0709586 0.072946 0.076573 0.0797953 0.0835515 0.0872968 0.0920926 0.0870282 0.103524 0.101969 0.0849871 0.094302 0.0658223 0.0495866 0.0539244 0.0657943 0.0652103 0.0785412 0.0915572 0.0959863 0.0881154 0.0829963 0.0732034 0.0690051 0.0760963 0.0809525 0.081773 0.0764394 0.0757004 0.073644 0.0705944 0.0687733 0.0665591 0.064192 0.0617734 0.05902 0.0590471 0.0611552 0.063078 0.0617705 0.0602703 0.0586421 0.0578882 0.0591483 0.0602281 0.0611631 0.0630637 0.064899 0.0664514 0.0676519 0.0682036 0.0717721 0.0717372 0.0700086 0.0748762 0.0708233 0.0657927 0.0615944 0.062807 0.06407 0.0581329 0.0566832 0.0521555 0.0480234 0.0421866 0.035157 0.0283437 0.0266497 0.0332665 0.0396759 0.0452754 0.0447636 0.0401075 0.0349685 0.0292891 0.032392 0.0270527 0.0311998 0.0357679 0.0405368 0.0379571 0.0359562 0.0418334 0.0475975 0.0531856 0.054152 0.0488399 0.0434213 0.0454416 0.0503684 0.0552522 0.0563126 0.051968 0.0476329 0.0433762 0.0392851 0.035445 0.039767 0.0374014 0.0419748 0.0458789 0.0473309 0.0438146 0.0459419 0.0427321 0.0461311 0.0497481 0.0534799 0.057267 0.0581587 0.0548819 0.0517097 0.0486955 0.0510351 0.048923 0.051587 0.0503025 0.0490817 0.0487025 0.0497213 0.0528755 0.0547692 0.0563158 0.0587093 0.0588452 0.0572222 0.0563117 0.0549408 0.0541366 0.0517948 0.0517236 0.0526857 0.0538849 0.0558681 0.0545854 0.0539052 0.0557767 0.0558786 0.0572077 0.0573123 0.0578152 0.0588241 0.0605846 0.0633391 0.0668264 0.0638346 0.0661519 0.0677489 0.064431 0.065 0.0648704 0.0641518 0.0618701 0.0622613 0.0622595 0.0600703 0.0600095 0.0597042 0.0592034 0.0585661 0.0577741 0.0568813 0.055859 0.0546744 0.053348 0.0519211 0.0518065 0.052931 0.0540192 0.0530468 0.0523054 0.0514005 0.0507513 0.0499853 0.0492663 0.0486009 0.0477538 0.0472702 0.0465587 0.0460056 0.0454024 0.0447564 0.0442359 0.0434876 0.0430823 0.0424592 0.0417844 0.0408906 0.0396337 0.0380025 0.0387165 0.0373813 0.0379133 0.0367281 0.0351318 0.0338403 0.0349378 0.0361528 0.0371301 0.0370889 0.0363458 0.0354916 0.0338347 0.03441 0.0330151 0.0334431 0.032334 0.0325999 0.0316077 0.0318267 0.0309851 0.0300399 0.0281212 0.0261258 0.0272852 0.0260011 0.0268494 0.0257003 0.022602 0.0203367 0.0152652 0.0199739 0.0223175 0.0201768 0.0252179 0.0262309 0.0273753 0.0283184 0.0281078 0.0292643 0.0290098 0.0303111 0.0301613 0.0297029 0.0291003 0.0286454 0.02806 0.0274333 0.026567 0.0255456 0.0249027 0.0251295 0.0258474 0.0265887 0.0262244 0.0257098 0.0251848 0.0241443 0.0241959 0.0232098 0.0231928 0.0224327 0.0215795 0.0212499 0.0210855 0.020088 0.0189928 0.0191138 0.0186285 0.0184307 0.0182629 0.0179542 0.0184871 0.0182678 0.0177763 0.0171219 0.0169552 0.0162541 0.0157355 0.0150499 0.014264 0.0130241 0.0106158 0.0108479 0.0102122 0.0114791 0.0140005 0.014099 0.0149816 0.0155812 0.0160931 0.0164091 0.016345 0.0173917 0.017526 0.015983 0.0159378 0.0172268 0.0185662 0.019094 0.0192484 0.0200213 0.0201572 0.0210056 0.021446 0.0216877 0.0222746 0.0228462 0.0219966 0.0218536 0.0207715 0.0208256 0.020618 0.0197774 0.0196101 0.0185783 0.0170414 0.0160312 0.0163189 0.0169769 0.0181703 0.018082 0.0194366 0.0192159 0.0191555 0.0203831 0.0202795 0.0216454 0.0231206 0.0238456 0.0242252 0.0248212 0.0252496 0.0254132 0.0251511 0.0264915 0.0271276 0.0275679 0.0277246 0.0273747 0.0288827 0.0286782 0.0299833 0.0306514 0.031027 0.0315713 0.0320899 0.0324977 0.0330909 0.0334446 0.0340953 0.0344312 0.0351333 0.0354839 0.0361324 0.0366932 0.0359193 0.035663 0.0347556 0.0345925 0.0335136 0.0334642 0.0322159 0.0323431 0.0309132 0.031209 0.0310647 0.0299724 0.02965 0.0295496 0.0296417 0.0307893 0.0307919 0.0320238 0.0319805 0.0332642 0.0332053 0.0345296 0.0344627 0.0358292 0.0370485 0.0376771 0.0379802 0.0386466 0.0388755 0.0396823 0.0398408 0.0407668 0.0403683 0.0396088 0.0392664 0.0383901 0.0381609 0.0371236 0.0370039 0.0370126 0.038286 0.0382985 0.0395929 0.0407766 0.0414266 0.0419282 0.0422095 0.0422431 0.0410206 0.0409118 0.0409037 0.0395945 0.0397131 0.0399954 0.0392258 0.0387474 0.0384367 0.0375328 0.0371954 0.0363607 0.0359741 0.0357613 0.0357269 0.0345293 0.0347867 0.0352119 0.0358051 0.0365336 0.0369079 0.0376097 0.0380504 0.0387126 0.0384326 0.0383455 0.0373943 0.0373476 0.0363875 0.0355012 0.0347308 0.0341019 0.0336226 0.0333343 0.0324976 0.032154 0.0314 0.0310075 0.0303388 0.0298886 0.0293054 0.0288176 0.0284964 0.0283479 0.0284169 0.0271811 0.0272008 0.0260606 0.0259931 0.0261056 0.0264622 0.0248873 0.0248171 0.024967 0.0242945 0.0239104 0.0236876 0.0237007 0.0238492 0.02427 0.0226126 0.0229821 0.0214455 0.020346 0.0205902 0.0213864 0.0215883 0.0225212 0.0226228 0.0228857 0.0233728 0.0240141 0.0239446 0.0231834 0.0224954 0.0219371 0.0216724 0.0210569 0.0208901 0.020228 0.0196871 0.0193462 0.01886 0.0184028 0.0181299 0.017554 0.0172109 0.0168019 0.0173928 0.0180618 0.0180942 0.0187378 0.0194437 0.0194592 0.0201496 0.0208884 0.020972 0.0201795 0.0203283 0.0195175 0.0187724 0.0189056 0.018136 0.0174274 0.016747 0.0161145 0.0155691 0.0151965 0.01489 0.0149191 0.0150215 0.0153539 0.0152168 0.0148512 0.0141397 0.0136738 0.0135732 0.0130123 0.0128903 0.0120846 0.0118909 0.0131501 0.0130973 0.0139907 0.0142687 0.0140754 0.0138617 0.0138844 0.0133334 0.0129845 0.01287 0.0128817 0.012 0.011883 0.011322 0.0110082 0.0108683 0.0104019 0.0107904 0.0112836 0.0115449 0.0110197 0.0105294 0.0108913 0.0114148 0.0119606 0.0125656 0.0121217 0.0118442 0.0117296 0.0122283 0.0122909 0.0127112 0.0132407 0.0133929 0.0127912 0.0130249 0.0124254 0.0127423 0.0132511 0.01396 0.0134027 0.0141258 0.0136625 0.0143538 0.0140199 0.0138292 0.0137739 0.0140582 0.0144056 0.0149126 0.0155016 0.0156054 0.0149521 0.0143325 0.0144554 0.0151102 0.0158174 0.0165942 0.0162935 0.0161538 0.0168322 0.0175575 0.0183464 0.0187229 0.0178622 0.0170375 0.0174233 0.0182536 0.0190997 0.0194966 0.0186551 0.0178294 0.0170216 0.0162228 0.0154193 0.0146888 0.0151164 0.0158856 0.0166625 0.0171164 0.0163508 0.0155982 0.0148603 0.0153673 0.0146578 0.0151969 0.0145123 0.0138398 0.0132013 0.0125754 0.0119528 0.0113807 0.0108687 0.0103911 0.0109888 0.0105326 0.0113209 0.0108791 0.0105075 0.0114525 0.0111459 0.0121978 0.0120152 0.0118942 0.0130902 0.0131313 0.0132493 0.0143047 0.0142518 0.0142814 0.0154616 0.0153646 0.0153569 0.0154246 0.0144312 0.0134344 0.0124439 0.0127357 0.0118111 0.0121913 0.0126184 0.0117885 0.0122881 0.011507 0.0120667 0.0126491 0.0132331 0.0138938 0.0133403 0.0127958 0.0135455 0.0130646 0.0138595 0.01345 0.013072 0.013962 0.0136736 0.0146173 0.0155558 0.0157459 0.0148568 0.0151442 0.0142944 0.0146651 0.0150711 0.0143049 0.0147762 0.0140511 0.014583 0.0151422 0.0144834 0.0138335 0.0144434 0.0150866 0.0157557 0.0163266 0.0156912 0.0150707 0.0157127 0.0163096 0.0169204 0.0175247 0.0169285 0.0163595 0.0158053 0.0152779 0.0159807 0.0155102 0.0162458 0.0158416 0.0154745 0.0162791 0.0159888 0.0168162 0.0166201 0.0164781 0.0164003 0.0163901 0.016459 0.0166239 0.0168957 0.0172943 0.0178424 0.0185677 0.0195013 0.0206842 0.0221587 0.0239682 0.0261741 0.0288466 0.0320454 0.0358706 0.0404369 0.0458766 0.0523035 0.0598199 0.0685011 0.078425 0.0898618 0.103193 0.118915 0.1375 0.159681 0.186587 0.220028 0.263255 0.322458 0.40773 0.535954 0.731909 1.01666 1.09508 1.07402 0.756443 0.554688 0.436216 0.54551 0.724041 0.536275 0.447743 0.38586 0.337071 0.362882 0.428648 0.345302 0.287325 0.24426 0.233676 0.267877 0.309448 0.296015 0.260425 0.229147 0.226466 0.257058 0.291573 0.330037 0.372181 0.418294 0.471553 0.459299 0.413255 0.36853 0.363684 0.409574 0.457642 0.452238 0.403044 0.357735 0.316889 0.321553 0.326349 0.28797 0.253907 0.223972 0.221891 0.250868 0.283939 0.280608 0.248637 0.220491 0.195622 0.196408 0.197722 0.199499 0.201512 0.204468 0.21028 0.182088 0.158114 0.137547 0.137155 0.156648 0.178981 0.177134 0.155661 0.136859 0.120449 0.120175 0.119837 0.104624 0.0915232 0.0802004 0.0815893 0.092686 0.105463 0.106165 0.0937048 0.0828366 0.0839796 0.0946507 0.106859 0.120812 0.136759 0.154992 0.175808 0.174735 0.154522 0.13677 0.136959 0.15433 0.174036 0.173709 0.154359 0.137272 0.122224 0.121683 0.121215 0.107554 0.0955679 0.0850529 0.0860368 0.0964127 0.108228 0.108947 0.0972499 0.0869624 0.0877703 0.0979957 0.109589 0.122746 0.137658 0.15455 0.173646 0.19524 0.219691 0.247266 0.278451 0.313593 0.352934 0.396634 0.444727 0.438829 0.392333 0.349946 0.348333 0.389973 0.435439 0.433795 0.388809 0.34752 0.310008 0.310548 0.311625 0.277203 0.246497 0.219281 0.219112 0.246109 0.276522 0.276197 0.24595 0.219077 0.195159 0.195104 0.195105 0.173727 0.154799 0.138059 0.138371 0.155031 0.173858 0.173984 0.155211 0.138595 0.12388 0.123624 0.123249 0.110159 0.0986304 0.0884386 0.0889229 0.0990915 0.110582 0.110864 0.0993894 0.0892252 0.0802784 0.0799706 0.0794657 0.0787619 0.0779049 0.0769088 0.0758215 0.0746311 0.0733351 0.071917 0.0703517 0.0617643 0.0543417 0.0479617 0.0498513 0.0561646 0.0634734 0.0650284 0.0578186 0.0515735 0.046184 0.044439 0.0425324 0.0379279 0.0340425 0.0307699 0.0325707 0.0358956 0.0398206 0.0415632 0.0376065 0.0342345 0.0357613 0.0391689 0.04314 0.0477636 0.0531278 0.0593191 0.066444 0.06773 0.0606746 0.0545273 0.0557781 0.0618912 0.0688927 0.0699424 0.0629787 0.0568847 0.0515586 0.0504486 0.0491827 0.0445578 0.0405703 0.0371353 0.0383574 0.0418202 0.0458221 0.046928 0.04291 0.0394261 0.0364125 0.035372 0.0341844 0.032848 0.0313695 0.0297574 0.0280187 0.0257315 0.0238391 0.02228 0.0237968 0.0254329 0.0273988 0.0289517 0.0269208 0.0252148 0.0238026 0.022452 0.0210121 0.019996 0.0191901 0.0185645 0.0197793 0.0204764 0.0213582 0.0226387 0.0216858 0.0209226 0.0219808 0.0228071 0.0238212 0.0250478 0.0265225 0.0282898 0.0303782 0.0316694 0.0295311 0.0277101 0.0287676 0.0306355 0.0328175 0.0338219 0.0315999 0.0296903 0.0280693 0.0271888 0.0261803 0.0248966 0.0238291 0.0229477 0.0238086 0.0247377 0.0258551 0.0266927 0.0255325 0.0245613 0.0251905 0.0261969 0.0273932 0.028806 0.030464 0.0324069 0.0346597 0.0372811 0.0403179 0.0438239 0.0478645 0.0525003 0.0578197 0.0638988 0.0708405 0.0715748 0.0646389 0.0585558 0.0590701 0.0651611 0.0720944 0.0723998 0.0654756 0.0593945 0.0540552 0.0537382 0.0532396 0.0485991 0.0445436 0.0410154 0.0414866 0.0450284 0.0490925 0.0494109 0.0453428 0.0417974 0.0387216 0.0384211 0.0379625 0.0353128 0.0330323 0.0310658 0.0314631 0.0334492 0.0357513 0.0360386 0.0337288 0.0317319 0.0300158 0.0297571 0.0293792 0.0279382 0.0267139 0.02568 0.0260008 0.0270534 0.0282968 0.028544 0.0272902 0.0262264 0.0253326 0.0251171 0.0248144 0.0243514 0.0237565 0.0230447 0.0222302 0.0213184 0.0203174 0.0192375 0.0180925 0.0177514 0.0175218 0.0173937 0.0183543 0.0185414 0.0188324 0.019851 0.0195042 0.0192613 0.0191096 0.018254 0.0173486 0.0173735 0.0174696 0.0176193 0.018387 0.0182795 0.0182294 0.0190386 0.019043 0.0191102 0.0197815 0.0197521 0.019791 0.0199043 0.0201005 0.0203927 0.0207932 0.0216561 0.0212075 0.0208693 0.0215555 0.0219335 0.0224253 0.023098 0.0225688 0.0221566 0.02184 0.0212751 0.0206291 0.020474 0.020398 0.0203932 0.0209398 0.020977 0.0210855 0.0216219 0.0214844 0.0214158 0.0214156 0.020968 0.0204515 0.0198724 0.0192367 0.0185518 0.0178238 0.0170633 0.0173521 0.0166077 0.0169761 0.0173795 0.0166837 0.0171519 0.0164804 0.0170072 0.0175573 0.018129 0.0187238 0.0181753 0.0176478 0.0182832 0.0178147 0.0184614 0.0180562 0.017685 0.0183731 0.0180768 0.0187675 0.0194167 0.0196457 0.0190297 0.0193356 0.0187109 0.0190835 0.0194956 0.0189029 0.0193767 0.018783 0.0193085 0.019862 0.0193009 0.0187268 0.0181482 0.0175727 0.0170028 0.0164388 0.0158914 0.0166055 0.0160914 0.0168332 0.0175882 0.0183635 0.0178964 0.017448 0.0182516 0.0190753 0.0199116 0.0203453 0.0195126 0.0186943 0.0191544 0.0199651 0.0207946 0.0216412 0.0211975 0.0207664 0.020351 0.0199546 0.0195779 0.0192189 0.0200969 0.0197454 0.0206508 0.021555 0.0212277 0.0221559 0.0218348 0.0216566 0.0216214 0.0223883 0.0223865 0.0231584 0.0239578 0.0241062 0.0232127 0.0234294 0.0225014 0.0227829 0.0230907 0.0240467 0.0237298 0.0246996 0.0243979 0.0253727 0.0250879 0.0248351 0.0247442 0.0247594 0.0248822 0.0252792 0.0257949 0.0263069 0.0267566 0.0273869 0.0277627 0.0273808 0.0272553 0.0264761 0.0263955 0.0256021 0.0255654 0.0263981 0.0273139 0.0272312 0.0281288 0.0280944 0.0281352 0.0283233 0.029042 0.0298596 0.0299806 0.0307748 0.0309496 0.0317166 0.0319646 0.0326855 0.0330105 0.0336901 0.034499 0.034441 0.0335275 0.0334979 0.0325769 0.0325641 0.0316497 0.0316553 0.0307384 0.0307776 0.0298405 0.0289664 0.0289652 0.029923 0.0309601 0.0320419 0.0317917 0.032883 0.0326511 0.0337353 0.0335448 0.0346044 0.034457 0.0355039 0.0353999 0.0354021 0.0363661 0.0373758 0.0384725 0.0383531 0.0394321 0.0393563 0.0393707 0.0395072 0.0398595 0.0404452 0.0412891 0.0423752 0.0436157 0.0437505 0.0449996 0.0451547 0.0463888 0.046603 0.0478002 0.0481227 0.048435 0.0496995 0.050056 0.0513216 0.0517822 0.0504666 0.0492908 0.0488067 0.0477293 0.0472469 0.0468824 0.0457655 0.0453946 0.0443476 0.0439762 0.0429947 0.042611 0.0416963 0.0410371 0.0417719 0.0422617 0.0429704 0.0435339 0.0442172 0.0448675 0.0455203 0.0462602 0.0468898 0.0476433 0.0483407 0.0490627 0.0498792 0.0509519 0.0522388 0.0536242 0.0548864 0.055597 0.0562391 0.0568313 0.0552506 0.0546893 0.0541443 0.0527411 0.0533124 0.0539337 0.0545891 0.055816 0.0573707 0.0578418 0.0582022 0.0584191 0.0572466 0.0568385 0.056354 0.0552425 0.0558765 0.0564784 0.0560325 0.0552595 0.0544758 0.0536925 0.0529211 0.0521948 0.0515296 0.0505726 0.0513584 0.0522062 0.0517527 0.0507926 0.0498889 0.0494491 0.0484987 0.0481651 0.0471879 0.0462992 0.0459363 0.0450232 0.0447411 0.0438034 0.0435927 0.0426296 0.0424879 0.0415024 0.0406208 0.0404167 0.0414168 0.0424772 0.0425614 0.0414317 0.0403761 0.0404156 0.0415646 0.042775 0.0440205 0.043763 0.0435866 0.0435434 0.0446496 0.04464 0.0457412 0.0457712 0.0468603 0.0469394 0.0480204 0.0491458 0.0492182 0.0503143 0.05046 0.0515178 0.0526048 0.0527528 0.0530984 0.0540069 0.0549184 0.0558283 0.0558173 0.054785 0.0537665 0.0536986 0.0548314 0.0559752 0.0562465 0.0550174 0.0538056 0.0526105 0.0514434 0.051523 0.0503013 0.0504397 0.0491976 0.0480023 0.0481173 0.0468867 0.0470563 0.0458196 0.0460248 0.0447834 0.0450183 0.0453107 0.0466252 0.0462974 0.047622 0.047309 0.0486285 0.0483385 0.0496464 0.0493812 0.0506751 0.0520025 0.0517202 0.0530163 0.0527639 0.0540257 0.0553069 0.0566084 0.0570422 0.0556782 0.0543354 0.054718 0.0533481 0.0537437 0.0523536 0.0509864 0.0513545 0.0499768 0.0503568 0.0489744 0.0493679 0.0479832 0.0483839 0.0469971 0.0456528 0.04433 0.0430474 0.0418024 0.0405881 0.0408448 0.0396407 0.039908 0.0387095 0.0375392 0.0364286 0.0366281 0.0377901 0.038986 0.0393074 0.0380844 0.0368886 0.0357342 0.0360076 0.0348545 0.0351371 0.033993 0.0342847 0.0331489 0.0334485 0.0323213 0.0312181 0.030153 0.0290962 0.0293555 0.028313 0.0285765 0.0275495 0.0265312 0.0256028 0.0257956 0.0268027 0.0278223 0.028869 0.0299413 0.0296354 0.0307136 0.0304195 0.0315089 0.0318255 0.0321671 0.0310393 0.0313867 0.0302718 0.029186 0.0281234 0.027092 0.0260753 0.0263772 0.0274009 0.0284476 0.0287966 0.0277358 0.026703 0.0256833 0.0260193 0.0250226 0.0253695 0.0243857 0.023419 0.0224815 0.0228273 0.0218965 0.0209913 0.021348 0.0204562 0.0208335 0.0217265 0.0226431 0.0222603 0.0231925 0.0241426 0.023771 0.0247447 0.0257342 0.0261141 0.0251211 0.0255116 0.0245316 0.0235757 0.0239743 0.0230412 0.0221241 0.0212298 0.0216433 0.0225371 0.0234529 0.0238756 0.0229624 0.0220709 0.0225098 0.0233975 0.024307 0.025236 0.0248073 0.0243859 0.0253434 0.024932 0.0259128 0.02691 0.0265059 0.0275284 0.0271322 0.0267471 0.0263753 0.0274102 0.0270481 0.0280887 0.0291582 0.030254 0.0298832 0.0295267 0.0306243 0.0317502 0.0329013 0.0325277 0.0336926 0.0333189 0.0329641 0.0326309 0.0337775 0.0349588 0.0346085 0.0357989 0.0354557 0.0366538 0.0363142 0.0375245 0.0371928 0.0384114 0.0396566 0.040037 0.0387647 0.0391486 0.0378866 0.0382688 0.0370165 0.0374 0.0361653 0.0365455 0.0353256 0.0341279 0.034499 0.0357097 0.036948 0.0382154 0.0377986 0.0390834 0.0386681 0.0399621 0.0395456 0.0408516 0.0404382 0.0417606 0.0413438 0.0409423 0.0405684 0.040219 0.0414877 0.041147 0.0424215 0.0420902 0.0433677 0.0437288 0.0441216 0.0427884 0.0431839 0.0418599 0.0422572 0.0436032 0.044981 0.0445403 0.0459282 0.0454873 0.0450704 0.0446823 0.0460323 0.0474058 0.0488221 0.0492854 0.0478446 0.0464464 0.0468871 0.0483101 0.0497748 0.0502868 0.0487971 0.0473506 0.047833 0.0463899 0.046872 0.0454418 0.0440431 0.0426769 0.0431142 0.0444998 0.0459192 0.0473684 0.0488509 0.0483351 0.0498277 0.0493022 0.0508143 0.0513625 0.051927 0.0503701 0.0509257 0.0493833 0.0478783 0.0464116 0.0449728 0.043568 0.042195 0.0426492 0.0412896 0.0417357 0.0403942 0.0408387 0.039511 0.0399505 0.0386407 0.0373614 0.0361126 0.0348878 0.0352845 0.0340787 0.0344798 0.03329 0.032129 0.030991 0.0313734 0.0325197 0.0336909 0.0348924 0.0361199 0.0356977 0.0369444 0.0365201 0.0377822 0.0382221 0.0386617 0.0373732 0.0378126 0.036544 0.0353088 0.0341008 0.0329209 0.0317676 0.0306424 0.0295375 0.0284584 0.0288439 0.0277863 0.0281752 0.0285742 0.0296402 0.0292386 0.0303265 0.0299287 0.0310388 0.0321708 0.0333314 0.0345206 0.0349465 0.0337518 0.0325825 0.0314399 0.0318562 0.0307359 0.031152 0.0300533 0.0289839 0.0279348 0.0283482 0.0273224 0.0263243 0.0267433 0.0257632 0.0261894 0.0271682 0.028165 0.0277411 0.028767 0.0298183 0.0293992 0.0304708 0.0315726 0.0319975 0.030892 0.0313183 0.0302433 0.0291899 0.0296155 0.028591 0.027596 0.0266197 0.0256697 0.0247444 0.0238397 0.022957 0.0220945 0.0212547 0.0204323 0.0196302 0.0188479 0.0180799 0.0173343 0.0178538 0.0171371 0.0176806 0.018235 0.018924 0.0183853 0.0191035 0.0185887 0.0193441 0.0201145 0.0209076 0.0217212 0.0221945 0.02139 0.0206086 0.0198483 0.0203579 0.0196272 0.0201528 0.019465 0.0187943 0.0193512 0.020002 0.0206749 0.0211896 0.020536 0.0199046 0.0204466 0.0210572 0.0216901 0.022354 0.0218698 0.021371 0.020866 0.021599 0.0211045 0.0218746 0.0226697 0.0231376 0.0223563 0.0228351 0.0220888 0.0225734 0.0230436 0.0237587 0.0233054 0.0240599 0.0236034 0.0243945 0.0239428 0.0234836 0.0230175 0.0225532 0.0234099 0.0242862 0.0251854 0.0256271 0.0247343 0.0238651 0.0243188 0.025181 0.0260663 0.0269745 0.0265418 0.0261059 0.0270516 0.0280245 0.0290164 0.0294403 0.0284516 0.0274827 0.0279095 0.0288735 0.0298579 0.0302666 0.0292873 0.028329 0.0274007 0.0264998 0.0256219 0.0247678 0.0252122 0.0260562 0.0269241 0.0273346 0.0264793 0.0256458 0.0248353 0.025264 0.0244976 0.0249195 0.0241963 0.0234923 0.0228185 0.0221746 0.0215542 0.0209675 0.0204075 0.0198782 0.0204204 0.0199432 0.0204858 0.0200668 0.0196815 0.0202373 0.0199204 0.0204632 0.0202173 0.0200192 0.0205663 0.0207362 0.0209567 0.0213958 0.0212015 0.0210572 0.0214811 0.0216056 0.0217778 0.0219977 0.021638 0.0212228 0.0207535 0.0210856 0.020594 0.0209894 0.0214215 0.0209385 0.0214259 0.0209294 0.0214718 0.0220381 0.0226415 0.0230748 0.022493 0.0219459 0.0223876 0.0218876 0.0223114 0.0218663 0.0214571 0.0218815 0.0215309 0.0219272 0.0222745 0.0225875 0.0222577 0.0226286 0.0222705 0.0226963 0.0231629 0.0227929 0.0233046 0.0229157 0.0234788 0.024077 0.0236879 0.0232691 0.0239224 0.0246099 0.0253209 0.0256974 0.0249969 0.0243258 0.0247019 0.0253593 0.0260469 0.0263649 0.0256901 0.0250446 0.0244366 0.0238546 0.0241913 0.0236571 0.0239724 0.0234899 0.0230394 0.0233402 0.0229423 0.0231998 0.0228589 0.0225606 0.0223046 0.0220975 0.0219407 0.021837 0.0217934 0.0218137 0.021902 0.022065 0.0223112 0.0226561 0.0230988 0.0236597 0.0240973 0.0235121 0.0230455 0.0232986 0.0237814 0.0243828 0.0245877 0.0239768 0.0234839 0.0230978 0.0229219 0.0226809 0.0224119 0.0222282 0.0221246 0.022324 0.0224415 0.0226385 0.0228066 0.0226024 0.0224782 0.0224193 0.0222713 0.0220865 0.0221179 0.0222034 0.0223458 0.0225001 0.0223693 0.0222919 0.022435 0.0225065 0.0226296 0.0228162 0.0226895 0.0225433 0.0227811 0.0230666 0.023401 0.0235321 0.0232026 0.0229232 0.023046 0.023322 0.0236464 0.0240036 0.0238959 0.0237738 0.0235841 0.0240061 0.0237723 0.0242428 0.0247463 0.0244894 0.025043 0.0247608 0.0253554 0.0259863 0.0266497 0.0269015 0.0262478 0.0256286 0.0258655 0.025287 0.0254952 0.0249627 0.0244656 0.0246401 0.0241871 0.0243024 0.0244075 0.0248558 0.0247508 0.0252303 0.0251278 0.0256552 0.0262148 0.0260628 0.0266646 0.0264766 0.0271199 0.0277958 0.02759 0.0273441 0.0270671 0.0267632 0.0264248 0.0260627 0.0256756 0.0264579 0.0260619 0.0268825 0.0277304 0.0286068 0.02822 0.0278171 0.0287381 0.02969 0.0306637 0.0310459 0.0300784 0.0291334 0.029512 0.0304495 0.0314102 0.0317543 0.0308008 0.0298711 0.0289745 0.0281084 0.027266 0.0276335 0.0268356 0.0271877 0.0275137 0.0282893 0.0279736 0.0287922 0.0284637 0.0293202 0.030208 0.03113 0.0320763 0.0323738 0.0314349 0.0305209 0.0296415 0.0299371 0.0290981 0.0293759 0.0285757 0.0278053 0.0280699 0.0288316 0.0296251 0.0298403 0.0290559 0.0283065 0.028506 0.0292493 0.0300264 0.0308366 0.0306541 0.0304441 0.0302031 0.0310673 0.0308086 0.0317147 0.0326466 0.0328895 0.0319654 0.0321947 0.0313033 0.0315047 0.0316785 0.0325537 0.0323873 0.0333023 0.0331139 0.0340724 0.0338548 0.0336169 0.0333505 0.03306 0.0327444 0.0324069 0.0320488 0.031672 0.0312797 0.0308753 0.0304608 0.0300394 0.0310891 0.0306696 0.0317426 0.0328487 0.0324221 0.0335545 0.0331282 0.0327001 0.0322759 0.033427 0.0330024 0.0341764 0.0353769 0.0358145 0.0346051 0.0350366 0.0338553 0.0342862 0.0347159 0.0359079 0.0354742 0.0366978 0.0362543 0.0375011 0.0370573 0.0366117 0.0361738 0.035738 0.0369857 0.0382635 0.0395713 0.0391148 0.0404416 0.039979 0.0395278 0.0390762 0.0404021 0.0417592 0.0412927 0.0426634 0.0421952 0.0435858 0.0431099 0.0445178 0.044037 0.0454602 0.046917 0.0474318 0.0459584 0.0464679 0.0450129 0.045516 0.0440701 0.0445691 0.0431457 0.0436301 0.0422316 0.0408631 0.0413252 0.0427103 0.0441271 0.0455812 0.0450699 0.046542 0.0460269 0.0475123 0.0469849 0.0484959 0.0479605 0.0494888 0.0489398 0.048405 0.0499293 0.0514897 0.0530855 0.0524988 0.0541098 0.053513 0.052928 0.0523546 0.0518044 0.051268 0.0507539 0.0502636 0.0497993 0.0512429 0.0507826 0.0522279 0.0517707 0.0532092 0.0527565 0.0541888 0.0556468 0.0551598 0.0566028 0.0561144 0.0575318 0.0580679 0.0586421 0.0571315 0.0576978 0.0561734 0.0546793 0.0552037 0.0536999 0.0542215 0.0527172 0.0532369 0.0517334 0.05225 0.0527892 0.0543513 0.0537832 0.0553475 0.0547727 0.0563382 0.0557566 0.0573216 0.0567342 0.0582954 0.0598904 0.0592539 0.0608434 0.0601896 0.0595683 0.0589824 0.0584357 0.0579381 0.0575022 0.0571431 0.0568819 0.0567454 0.0567976 0.0570591 0.0575975 0.0585093 0.0598841 0.0618265 0.0610465 0.0632061 0.0616719 0.0602829 0.0615403 0.0598323 0.0588058 0.0582933 0.0581492 0.058931 0.0587624 0.0588724 0.0593424 0.0590931 0.059466 0.0601708 0.0591864 0.0595319 0.0585339 0.0586053 0.0588164 0.0590023 0.0590587 0.0593535 0.0590539 0.0592727 0.0597043 0.0603221 0.0593475 0.0583243 0.058796 0.0574084 0.0578961 0.0562652 0.0575106 0.0589837 0.057168 0.0552114 0.0531748 0.0552832 0.0535347 0.0562466 0.0591116 0.0602226 0.0576552 0.0591472 0.0570032 0.0587197 0.06049 0.0623248 0.0607161 0.0629677 0.0615199 0.0640866 0.0629552 0.0620936 0.0614951 0.0610571 0.0606105 0.0600422 0.0593257 0.0585822 0.0638089 0.0689089 0.0739301 0.0740857 0.0692683 0.0643578 0.0647209 0.0692894 0.0737595 0.0781465 0.0788387 0.0789162 0.0839033 0.0889208 0.0939918 0.0929163 0.0882395 0.0835508 0.0824639 0.0867222 0.0909288 0.0886073 0.0847937 0.0809345 0.0770184 0.0730348 0.0689751 0.0648346 0.0648204 0.0685419 0.072218 0.0716369 0.0682445 0.0648623 0.0651658 0.0683116 0.0715236 0.0748013 0.075043 0.0758546 0.0794612 0.0830498 0.0866355 0.0854402 0.0819307 0.0784707 0.0781468 0.0815718 0.0850844 0.0886949 0.0890146 0.0902353 0.0923871 0.0950882 0.0975862 0.0991332 0.104354 0.109654 0.115021 0.111497 0.106888 0.102246 0.0992018 0.10327 0.107292 0.11127 0.116052 0.120431 0.125847 0.131222 0.136496 0.129174 0.124909 0.12053 0.115211 0.119128 0.123048 0.119247 0.115205 0.111281 0.107441 0.103654 0.0998955 0.0961452 0.0938679 0.0975536 0.101314 0.100297 0.0964265 0.0926711 0.0924135 0.0962489 0.100208 0.104297 0.104299 0.105172 0.109153 0.11328 0.117579 0.117215 0.112748 0.108446 0.108519 0.112874 0.117361 0.117568 0.113166 0.108865 0.104671 0.100587 0.0966145 0.0927557 0.0890105 0.0853779 0.0818554 0.078439 0.0751281 0.0719237 0.0688211 0.0658275 0.066825 0.0697123 0.0727367 0.0738259 0.0708656 0.0680581 0.0654214 0.0668647 0.0644863 0.0660302 0.0639638 0.0622343 0.0605743 0.0589591 0.0604545 0.0594826 0.0609204 0.0600206 0.0611546 0.0622186 0.0634779 0.0619984 0.0633514 0.0619425 0.0637843 0.0656383 0.0676072 0.0692092 0.0671612 0.0651321 0.0665029 0.0648786 0.0663463 0.0648137 0.0634484 0.0622732 0.0612865 0.0604736 0.0598318 0.060441 0.0597443 0.059197 0.0594657 0.0588383 0.0583382 0.0579395 0.057652 0.0582926 0.0590229 0.0598571 0.0607964 0.0602303 0.0611135 0.0621029 0.0612735 0.0622507 0.0633708 0.0646472 0.0660866 0.0673335 0.0658219 0.0644501 0.0632134 0.064178 0.0629519 0.061827 0.0625763 0.0614227 0.0603465 0.0593512 0.058428 0.0575893 0.057709 0.0587135 0.0597786 0.0602809 0.0591028 0.0579716 0.0583376 0.0595725 0.0608486 0.0621718 0.0615132 0.0609028 0.0620971 0.0633607 0.0646975 0.0638165 0.0651449 0.0665734 0.0655164 0.0669743 0.0685564 0.070266 0.0689893 0.0676918 0.0694468 0.0680053 0.0698389 0.0684687 0.0706601 0.0728973 0.071357 0.0698477 0.0683578 0.0708627 0.069432 0.0721686 0.0750553 0.0780776 0.0769209 0.0758921 0.0791677 0.082557 0.0860578 0.0869201 0.0834748 0.0801396 0.0812247 0.0844888 0.0878608 0.0888494 0.0855529 0.0823641 0.079291 0.0763437 0.0735293 0.074906 0.0722981 0.0737229 0.0751915 0.0776602 0.076281 0.0789815 0.0776545 0.0805355 0.0835411 0.0866624 0.0898923 0.0909952 0.0878214 0.0847566 0.0818079 0.0831065 0.0803185 0.0816839 0.0791108 0.0766755 0.0742676 0.0719388 0.0733324 0.0713264 0.0727358 0.0707919 0.0721062 0.0740804 0.0761855 0.074805 0.0769659 0.0755452 0.0779747 0.0805233 0.0831309 0.0844598 0.0818112 0.0792783 0.0807331 0.0784037 0.0797756 0.0775325 0.0754082 0.0734045 0.0715213 0.069757 0.0681089 0.0692307 0.0676239 0.0661148 0.0670877 0.0655894 0.064167 0.0628101 0.0635557 0.0649928 0.0664915 0.0680649 0.0697162 0.0686706 0.0703438 0.0721124 0.0709407 0.0727579 0.0746851 0.0767231 0.0788719 0.0802009 0.0780238 0.0759504 0.0739804 0.0751923 0.0732756 0.0714514 0.072556 0.0707627 0.0690484 0.0674075 0.0658362 0.064326 0.0628676 0.0614658 0.0601068 0.058785 0.0592942 0.06069 0.0621232 0.0628132 0.061315 0.0598565 0.0604619 0.0619765 0.0635326 0.0651262 0.0643473 0.0635936 0.0651219 0.0666999 0.0683354 0.0692738 0.0675797 0.0659396 0.0667759 0.0684727 0.0702235 0.071185 0.0693793 0.0676289 0.0659266 0.0642782 0.062669 0.0611 0.0617704 0.0633906 0.0650483 0.0658372 0.0641354 0.0624673 0.0631861 0.061522 0.0622218 0.0605506 0.0589202 0.0595703 0.0579364 0.0585706 0.0569392 0.0575638 0.0559447 0.0565556 0.0549372 0.0533517 0.0539284 0.0555426 0.0571908 0.0578369 0.0561663 0.0545267 0.0551366 0.0567977 0.058498 0.0602407 0.0595457 0.058873 0.0582101 0.0599059 0.059227 0.0609309 0.0602408 0.0619425 0.0612386 0.062945 0.0646897 0.0639299 0.0656836 0.0648967 0.0666426 0.0684383 0.0675848 0.0667482 0.0684992 0.0702963 0.0721539 0.0731347 0.0712288 0.0693842 0.0702837 0.0721744 0.0741272 0.0761349 0.075096 0.0740677 0.0730492 0.0720384 0.071035 0.0700384 0.0718113 0.0736589 0.0755854 0.0744326 0.076396 0.0784489 0.0772041 0.0793129 0.0815198 0.082832 0.0805937 0.0818696 0.0796879 0.077594 0.0787891 0.076736 0.0747617 0.0728628 0.0739178 0.0758659 0.0778869 0.0799843 0.0821609 0.0809242 0.0831439 0.0854501 0.0841411 0.0865038 0.0851653 0.0838258 0.0824819 0.0811314 0.0835022 0.0821345 0.0845985 0.0831667 0.0857429 0.0884936 0.0871895 0.0858001 0.0844265 0.087295 0.086011 0.0890293 0.0921558 0.0953849 0.094272 0.0932248 0.0922474 0.0913332 0.0904699 0.089668 0.0933846 0.0972044 0.101124 0.1017 0.097864 0.0941195 0.0949032 0.0985653 0.102316 0.106152 0.105624 0.105139 0.109246 0.113443 0.117725 0.117893 0.113721 0.109631 0.110071 0.114072 0.118153 0.118547 0.114541 0.110613 0.106768 0.103006 0.0993295 0.0957423 0.0966549 0.100178 0.103791 0.104674 0.101116 0.097647 0.0987119 0.102132 0.10564 0.109233 0.108317 0.107491 0.111274 0.115136 0.119075 0.119721 0.115846 0.112043 0.112904 0.116651 0.120466 0.121295 0.117537 0.113844 0.110222 0.106677 0.103214 0.0998381 0.0965535 0.0933659 0.0902791 0.0915604 0.088608 0.090007 0.0913258 0.0942482 0.0928892 0.0958959 0.0946132 0.0977675 0.101015 0.104352 0.107775 0.108926 0.105539 0.102232 0.0990188 0.10032 0.0972645 0.0985604 0.095559 0.092619 0.089825 0.0871633 0.088565 0.0859822 0.0873568 0.0848674 0.0862313 0.0887357 0.0913382 0.0899484 0.092641 0.0912467 0.09403 0.0968899 0.0998557 0.10128 0.098305 0.0954298 0.0968317 0.0940378 0.095448 0.0927363 0.0901179 0.087594 0.0889583 0.0915047 0.0941426 0.0955591 0.0928986 0.0903269 0.0878442 0.0891888 0.0867616 0.0844194 0.0856987 0.0834008 0.0811823 0.0790409 0.0769738 0.0749777 0.0760444 0.0780875 0.0802002 0.0813666 0.0792088 0.0771196 0.0782045 0.0803391 0.0825415 0.0848142 0.0835956 0.0823855 0.084646 0.086984 0.0894014 0.0880779 0.0905399 0.0930857 0.091702 0.0943017 0.0969878 0.0997596 0.0983076 0.0968709 0.0996881 0.0982511 0.101144 0.0997173 0.102694 0.105749 0.104335 0.102974 0.101646 0.104841 0.10349 0.106774 0.110127 0.113559 0.112391 0.111277 0.114853 0.118497 0.122203 0.123185 0.119526 0.115925 0.117059 0.12062 0.124239 0.125362 0.121776 0.118253 0.114785 0.111375 0.10807 0.109361 0.106152 0.107457 0.108884 0.112115 0.110699 0.114032 0.112692 0.116101 0.119514 0.122991 0.126557 0.127845 0.12429 0.120802 0.117394 0.118714 0.11539 0.11682 0.113545 0.110326 0.107185 0.104124 0.10558 0.102592 0.104062 0.101143 0.102615 0.105553 0.108569 0.107062 0.11014 0.108648 0.111793 0.11501 0.118292 0.119803 0.116516 0.113293 0.114826 0.111661 0.113211 0.110101 0.107066 0.104107 0.101228 0.0984303 0.0957159 0.0971429 0.0944802 0.0918998 0.0932703 0.0907341 0.0882773 0.0858984 0.0871598 0.0895803 0.0920776 0.0946528 0.0973066 0.0958868 0.0985837 0.101361 0.0998877 0.102713 0.105619 0.108601 0.111659 0.113244 0.11016 0.10715 0.104216 0.105738 0.10285 0.100039 0.101509 0.09874 0.096048 0.093433 0.0908945 0.0884316 0.0860429 0.0837263 0.0814794 0.0792999 0.077185 0.0751318 0.0731333 0.0711977 0.0693082 0.0674694 0.0683116 0.0664848 0.0673016 0.0654689 0.0636864 0.0644459 0.0626655 0.0634081 0.0616415 0.0623622 0.0605943 0.0613053 0.0620288 0.0638536 0.0631035 0.0649352 0.0641658 0.0660118 0.0652185 0.0670789 0.066265 0.0681355 0.0700478 0.0691704 0.0710938 0.0701935 0.0721264 0.0741059 0.076149 0.0771789 0.075092 0.0730691 0.0740259 0.0720096 0.0729389 0.070938 0.0689889 0.069849 0.0679062 0.0687455 0.0668134 0.0676331 0.0657188 0.0665154 0.0646162 0.0627605 0.0609448 0.0591775 0.057446 0.0557598 0.0563966 0.0547221 0.0553449 0.0536871 0.0520687 0.0504831 0.0510495 0.0526567 0.0542966 0.0549151 0.0532531 0.051625 0.0500466 0.0506113 0.0490441 0.0495986 0.0480489 0.0485898 0.047066 0.0475953 0.0460927 0.0446297 0.0432005 0.0417991 0.0422789 0.0409074 0.0413797 0.0400294 0.0387115 0.0374291 0.0378747 0.0391667 0.0404949 0.0418535 0.0432491 0.0427648 0.0441849 0.0436921 0.0451322 0.0456373 0.0461488 0.0446807 0.045179 0.0437366 0.0423305 0.0409605 0.0396248 0.0383261 0.0387706 0.0400828 0.0414306 0.0418993 0.040547 0.0392266 0.0379474 0.0383903 0.0371354 0.0375723 0.0363427 0.0351475 0.0339841 0.0344078 0.0332725 0.0321617 0.0325807 0.0315076 0.031919 0.0329928 0.0340995 0.0336885 0.0348225 0.0359902 0.0355718 0.03677 0.0380013 0.0384275 0.0371905 0.0376018 0.0364 0.0352302 0.0356242 0.0344947 0.0333902 0.0323198 0.0327081 0.033775 0.0348768 0.0352414 0.0341442 0.0330805 0.0334344 0.0344916 0.0355842 0.0367078 0.0363663 0.0360055 0.037176 0.0367937 0.037993 0.0392286 0.0388351 0.0401027 0.0396956 0.0392671 0.0388328 0.0401227 0.0396784 0.0410045 0.0423633 0.0437608 0.0432861 0.0428088 0.0442248 0.0456785 0.0471711 0.0466591 0.0481791 0.0476551 0.0471305 0.0466088 0.0481296 0.0496867 0.0491378 0.0507168 0.0501538 0.0517503 0.051177 0.0527967 0.0522078 0.0538564 0.055541 0.0561747 0.0544668 0.0550848 0.0533977 0.0539986 0.0523314 0.0529137 0.0512787 0.0518451 0.0502363 0.0486643 0.0492002 0.0507889 0.0524139 0.0540877 0.0535009 0.0552027 0.0545993 0.0563222 0.055699 0.0574472 0.0568134 0.0585819 0.057921 0.0572669 0.0566194 0.0559774 0.057699 0.0570429 0.0587791 0.058107 0.0598657 0.0605662 0.0612763 0.0594604 0.0601507 0.0583646 0.0590355 0.0608489 0.0627185 0.0619939 0.0638704 0.0631273 0.062391 0.0616624 0.0635078 0.0653943 0.0673231 0.0681428 0.0661798 0.0642638 0.0650277 0.0669758 0.0689712 0.069807 0.0677817 0.0658014 0.0665825 0.0646236 0.0653792 0.0634469 0.0615568 0.059713 0.0603936 0.0622656 0.0641788 0.0661426 0.0681637 0.0673691 0.0694081 0.0685904 0.0706483 0.0715033 0.0723566 0.0702275 0.0710513 0.0689563 0.0669066 0.0649164 0.0629771 0.0610791 0.0592428 0.0599069 0.0580904 0.058737 0.0569458 0.0575669 0.0558037 0.0564154 0.0546777 0.0529863 0.0513438 0.0497391 0.0502786 0.0487042 0.0492282 0.0476823 0.0461773 0.0447123 0.0451974 0.0466742 0.0481926 0.0486936 0.0471652 0.0456764 0.0442307 0.042826 0.0414562 0.041904 0.0405644 0.040994 0.041412 0.042764 0.0423407 0.0437247 0.0432798 0.0446918 0.0461465 0.0476461 0.0491824 0.0496611 0.0481147 0.0466059 0.0451429 0.0455743 0.0441479 0.0445497 0.043169 0.0418189 0.0405025 0.0408848 0.0396097 0.0383729 0.0387277 0.0375311 0.0378704 0.0390661 0.0403022 0.0399681 0.0412427 0.0425487 0.0421952 0.0435469 0.0449342 0.0453011 0.0439037 0.0442428 0.0428831 0.0415748 0.0418787 0.0406087 0.0393784 0.0381851 0.0370275 0.035905 0.0348162 0.0337666 0.0340765 0.0351215 0.0362053 0.0364781 0.0353985 0.0343603 0.0346195 0.0356541 0.0367291 0.037836 0.037592 0.0373225 0.038476 0.0396667 0.0408958 0.0411541 0.0399282 0.0387414 0.0389813 0.0401638 0.0413849 0.0415948 0.0403741 0.0391961 0.0380535 0.036954 0.0358847 0.0348526 0.0350601 0.0360853 0.0371502 0.0373224 0.0362625 0.0352379 0.034254 0.0344152 0.0334664 0.0336065 0.0326977 0.0318243 0.0309862 0.0301822 0.0294112 0.0286743 0.0279706 0.0273009 0.0274402 0.0268102 0.0269016 0.0263096 0.0257544 0.0258483 0.0253304 0.0264014 0.0269907 0.0276144 0.0275279 0.0281887 0.0281044 0.0288026 0.0295348 0.030301 0.0303764 0.029613 0.0288836 0.0289655 0.028273 0.0296928 0.0304542 0.0312477 0.0311718 0.0310995 0.0319358 0.032802 0.0337052 0.0337739 0.0328704 0.0320091 0.0320832 0.0329421 0.0338441 0.0347794 0.03471 0.0346429 0.0345498 0.0355252 0.0353926 0.0364134 0.0374679 0.0385547 0.0384142 0.0382468 0.0393862 0.04056 0.0417813 0.0419359 0.04072 0.0395482 0.039688 0.0408563 0.0420644 0.0433148 0.0431871 0.0430349 0.0428536 0.0426463 0.0424189 0.0421632 0.0434741 0.043188 0.0445406 0.0459366 0.0456389 0.0470741 0.0467405 0.0463751 0.0459868 0.0474611 0.0470445 0.0485603 0.0501178 0.0505539 0.0489846 0.0493855 0.0478582 0.0482266 0.0485622 0.0500939 0.0497537 0.0513269 0.0509569 0.0525816 0.0521695 0.0517274 0.0512601 0.0507697 0.0502668 0.0497522 0.0513565 0.0508186 0.0524525 0.0518995 0.0535597 0.0541275 0.0546995 0.0530056 0.0535525 0.0518851 0.0524022 0.0540836 0.0558168 0.0552647 0.0570318 0.0564526 0.0558558 0.0552664 0.0570234 0.0588284 0.0581989 0.0600337 0.0593842 0.0612388 0.0605707 0.0624589 0.0617683 0.0636898 0.0656554 0.0663968 0.0644068 0.0651254 0.0631541 0.0638503 0.0619106 0.0625876 0.0606844 0.0613435 0.0594625 0.0576326 0.058248 0.0600955 0.0619996 0.0639546 0.0632691 0.065266 0.0645563 0.0665756 0.0658475 0.0678885 0.0671382 0.0692153 0.0684433 0.0676739 0.0697502 0.0718798 0.0740762 0.0732161 0.0754386 0.0745454 0.0736605 0.0727733 0.0718979 0.0710259 0.0701652 0.0693104 0.0684677 0.0704697 0.0696004 0.0716223 0.0707289 0.0727567 0.0718379 0.0738797 0.0759765 0.0749951 0.0771033 0.0760914 0.0782215 0.079277 0.0803457 0.0781295 0.0791718 0.0769734 0.0748334 0.0758027 0.0736893 0.074626 0.0725239 0.0734366 0.0713454 0.0722329 0.0731322 0.0752956 0.0743591 0.0765388 0.0755794 0.0777705 0.0767799 0.0790025 0.0779836 0.0802215 0.0825152 0.0814265 0.0837406 0.0826175 0.0815062 0.0804072 0.0793208 0.0782469 0.0804064 0.0826306 0.084922 0.0861295 0.0837936 0.0815247 0.0826554 0.0849687 0.0873491 0.0897983 0.0885345 0.0872828 0.0897151 0.0922207 0.0948008 0.0961811 0.0935591 0.0910106 0.092318 0.0949096 0.0975743 0.0989809 0.0962727 0.0936374 0.0910739 0.0885806 0.086156 0.0837984 0.0849534 0.0873551 0.0898238 0.0910783 0.0885655 0.08612 0.0872976 0.0848743 0.0860193 0.0836175 0.0812825 0.0823538 0.0800344 0.0810754 0.0787721 0.0797831 0.0775084 0.0784817 0.0762295 0.0740363 0.0749465 0.0771791 0.0794719 0.0804655 0.0781299 0.0758619 0.0767843 0.0790899 0.0814616 0.083894 0.0828576 0.0818255 0.080798 0.0831774 0.0821214 0.0845173 0.0834318 0.0858508 0.084729 0.0871744 0.0896856 0.088486 0.0910199 0.089787 0.0923445 0.0949721 0.0936603 0.0923612 0.094969 0.0976488 0.100402 0.101839 0.0990391 0.0963134 0.0976716 0.100445 0.103294 0.104767 0.101867 0.0990448 0.0962973 0.093623 0.0949146 0.0922648 0.0935222 0.0908966 0.0883402 0.0895175 0.0869852 0.0881274 0.0856159 0.0867258 0.0842441 0.0853126 0.0863957 0.0889688 0.0878389 0.090442 0.0892804 0.0919031 0.0907048 0.0933534 0.0921192 0.0947923 0.0975391 0.0962199 0.0989917 0.097637 0.100434 0.103307 0.106258 0.107769 0.104765 0.101839 0.103261 0.100361 0.101745 0.0988718 0.096075 0.09737 0.0945991 0.0958562 0.093112 0.0943312 0.0916147 0.0927947 0.0901022 0.087482 0.0849411 0.0824689 0.0800578 0.0777158 0.0786415 0.0763297 0.077222 0.0749363 0.0727119 0.0705476 0.0713489 0.073545 0.0758038 0.0766742 0.0743867 0.0721573 0.0699902 0.070779 0.0686462 0.0694169 0.0673108 0.0680558 0.065983 0.0666917 0.0646378 0.0626506 0.0607216 0.0588497 0.0594405 0.057602 0.0581519 0.0563498 0.0546014 0.052906 0.053385 0.0550935 0.0568561 0.0586742 0.0605498 0.0600098 0.0619257 0.0613349 0.0632885 0.0639037 0.064483 0.0624842 0.0630054 0.0610547 0.0591618 0.0573295 0.0555561 0.0538367 0.0542579 0.0559871 0.0577739 0.0581705 0.0563753 0.0546422 0.0529614 0.0533088 0.0516718 0.0519821 0.0504025 0.0488666 0.0473753 0.0476602 0.0462236 0.044826 0.0450785 0.0437271 0.0439514 0.0452968 0.0466883 0.0464691 0.0479058 0.049394 0.0491447 0.0506813 0.0522608 0.0525092 0.0509286 0.0511494 0.0496122 0.0481244 0.0483254 0.0468916 0.0455006 0.0441582 0.044329 0.0456738 0.0470594 0.0472048 0.0458269 0.0444809 0.0446116 0.0459537 0.0473305 0.0487614 0.0486378 0.0484934 0.0499737 0.0498065 0.051341 0.0529178 0.0527277 0.054366 0.0541491 0.0539004 0.0536215 0.0553125 0.0549971 0.0567365 0.0585351 0.0603993 0.0600248 0.0596167 0.0615176 0.0634828 0.065522 0.0650269 0.0671081 0.0665434 0.0659457 0.0653029 0.0673807 0.0695156 0.06879 0.0709658 0.0701922 0.0723961 0.0715869 0.0738163 0.0729809 0.0752408 0.0775595 0.078479 0.076117 0.0770083 0.0746653 0.0755263 0.0732141 0.0740178 0.0717344 0.0724733 0.0702225 0.0680519 0.0686745 0.0708756 0.0731559 0.0755095 0.074787 0.0771748 0.076367 0.0787959 0.0779077 0.0803581 0.0794111 0.0818908 0.0809141 0.0799569 0.0790312 0.0781232 0.0805101 0.0795727 0.0819928 0.0810231 0.0834718 0.0844808 0.0854936 0.082966 0.083947 0.0814539 0.0824152 0.0849512 0.0875638 0.0865172 0.0891532 0.0880921 0.0870394 0.0859867 0.0885763 0.0912412 0.0939807 0.0951677 0.0923782 0.0896733 0.0907679 0.093518 0.0963565 0.0975537 0.0946712 0.0918728 0.0930053 0.0902403 0.0913762 0.0886546 0.0860022 0.0834183 0.0844453 0.0870775 0.0897834 0.0925687 0.0954482 0.0941887 0.0970876 0.0958501 0.0987769 0.100067 0.101442 0.0984061 0.0997996 0.0967666 0.0938221 0.0909651 0.0881922 0.0855028 0.0828901 0.0838901 0.0813022 0.082206 0.0796496 0.0804598 0.0779384 0.0786372 0.0761757 0.0737925 0.0714905 0.0692636 0.0697913 0.0676206 0.0680676 0.065961 0.0639139 0.0619355 0.0623168 0.0643014 0.0663587 0.0684754 0.0706838 0.0702568 0.0725238 0.0720376 0.0743637 0.0748694 0.0753188 0.0729621 0.0733243 0.0710432 0.0688312 0.0667029 0.0646408 0.0626441 0.0607217 0.0588585 0.0570553 0.057336 0.0555903 0.0558459 0.0560608 0.0578056 0.0575954 0.0593997 0.0591444 0.0610112 0.0629388 0.06494 0.0670041 0.0672636 0.0651956 0.0631967 0.0612697 0.0614838 0.0596072 0.0598009 0.0579984 0.0562523 0.0545572 0.0547187 0.0530833 0.0515056 0.0516439 0.0501149 0.0502394 0.0517633 0.0533462 0.0532286 0.0548583 0.0565509 0.0564144 0.0581595 0.0599613 0.0600973 0.0582957 0.0584079 0.0566637 0.0549756 0.0550742 0.0534433 0.0518655 0.0503407 0.048861 0.0474357 0.0460556 0.0447187 0.0434269 0.0421773 0.0409761 0.0398083 0.0386774 0.0375904 0.0365381 0.0366316 0.0356217 0.0356818 0.0357512 0.036759 0.0366911 0.0377375 0.0376806 0.038769 0.0398891 0.0410596 0.042261 0.042314 0.0411105 0.0399417 0.0388251 0.0388904 0.0378044 0.0400062 0.0411748 0.0423757 0.0436208 0.0435604 0.043509 0.0447962 0.0461281 0.0475103 0.0475641 0.0461801 0.0448493 0.0449086 0.0462382 0.0476254 0.0490427 0.0489845 0.0489305 0.0504094 0.051938 0.0535127 0.0535576 0.0519863 0.0504584 0.0505127 0.0520424 0.0536132 0.0552356 0.0551814 0.0551398 0.0568289 0.0567607 0.0585007 0.0603034 0.0602086 0.0620805 0.0619728 0.0618354 0.0616757 0.0636066 0.0634171 0.0654177 0.0674875 0.0676773 0.0656069 0.0657657 0.0637657 0.0639023 0.0640121 0.066011 0.0659019 0.0679712 0.0678362 0.0699796 0.0698207 0.0696303 0.069405 0.0691432 0.0713557 0.0736443 0.0760207 0.0756899 0.0781436 0.0777548 0.0772925 0.0767711 0.0792634 0.0818473 0.0811926 0.0838401 0.0830624 0.0857518 0.0848489 0.0875869 0.0865657 0.0893151 0.0921594 0.0933212 0.0904019 0.0914242 0.0885472 0.0894129 0.0865729 0.0872991 0.084532 0.0851243 0.082423 0.0798135 0.0802854 0.0829163 0.0856343 0.0884587 0.0879265 0.0908345 0.0901741 0.0931608 0.0923482 0.095402 0.0944146 0.0975094 0.0963385 0.0950939 0.0981179 0.101243 0.104457 0.102916 0.106128 0.104571 0.103131 0.101791 0.100517 0.0992717 0.0980331 0.0967951 0.0955597 0.0984037 0.0971246 0.0999963 0.098677 0.101576 0.100217 0.103144 0.10615 0.104698 0.107731 0.106239 0.109298 0.110845 0.11241 0.109238 0.110761 0.107617 0.104555 0.105982 0.102948 0.104334 0.101328 0.102669 0.099691 0.100982 0.102273 0.105363 0.104016 0.107137 0.105732 0.10888 0.107424 0.1106 0.109099 0.112303 0.115593 0.113992 0.117309 0.115666 0.114042 0.112438 0.110853 0.109288 0.107744 0.10622 0.104715 0.10323 0.101764 0.100313 0.0988777 0.0974562 0.100187 0.102995 0.105878 0.104355 0.107278 0.110276 0.108702 0.111742 0.114857 0.118044 0.116401 0.114791 0.117993 0.116392 0.119641 0.118059 0.121357 0.124714 0.123151 0.121635 0.120159 0.123578 0.122152 0.125647 0.129151 0.130503 0.127034 0.128489 0.125041 0.126556 0.128125 0.131581 0.130006 0.133492 0.131969 0.135493 0.134034 0.132685 0.131404 0.130153 0.128988 0.127902 0.126893 0.125962 0.125111 0.124343 0.123664 0.123086 0.122628 0.122311 0.122143 0.122091 0.122067 0.121975 0.121851 0.122069 0.123445 0.127007 0.133324 0.141607 0.1495 0.154478 0.155741 0.154339 0.151504 0.147381 0.142753 0.138295 0.116615 0.0795102 0.0830263 0.0868394 0.0909937 0.0955421 0.100548 0.10609 0.112273 0.11925 0.127204 0.136372 0.147071 0.159737 0.174953 0.193602 0.21703 0.34121 0.303158 0.2728 0.247937 0.227188 0.209625 0.194576 0.181541 0.17014 0.160034 0.150922 0.142696 0.135249 0.128478 0.122292 0.147916 0.158618 0.170605 0.175505 0.163423 0.15256 0.157295 0.168233 0.180361 0.193897 0.189007 0.18413 0.199526 0.216785 0.232737 0.241103 0.221431 0.204211 0.209179 0.226762 0.247423 0.254341 0.233414 0.215207 0.199338 0.185352 0.172884 0.161668 0.16455 0.175778 0.188182 0.187373 0.176083 0.165538 0.163028 0.171806 0.180647 0.189316 0.199333 0.201935 0.217188 0.234 0.252183 0.236474 0.224332 0.21177 0.197515 0.204927 0.211262 0.216335 0.247496 0.271188 0.278117 0.27176 0.264085 0.249182 0.268048 0.28986 0.315314 0.366795 0.32525 0.291629 0.300488 0.334588 0.374973 0.422125 0.418582 0.345309 0.381006 0.423985 0.477171 0.613068 0.546855 0.481909 0.47516 0.530751 0.58356 0.457138 0.444839 0.422937 0.395055 0.364478 0.333785 0.304699 0.290135 0.307853 0.323001 0.267903 0.263541 0.25669 0.220139 0.222893 0.225016 0.227045 0.270062 0.334353 0.341098 0.34292 0.340298 0.269912 0.270328 0.270634 0.229504 0.232784 0.237143 0.242813 0.270342 0.335107 0.45858 0.627204 0.697012 0.545429 0.390468 0.247376 0.288141 0.345882 0.434392 0.586022 0.884867 1.38328 0.933884 0.693305 0.55047 0.456711 0.636157 0.762066 0.947262 1.02112 0.953661 0.80647 0.656097 0.664696 0.653562 0.640774 1.05145 1.24769 1.76496 1.09571 0.639051 0.428742 0.423918 0.42869 0.440368 0.451907 0.329977 0.326503 0.325673 0.283183 0.276696 0.27252 0.249921 0.258278 0.268268 0.280853 0.293596 0.330423 0.341081 0.307019 0.294044 0.286678 0.275657 0.263386 0.252639 0.242976 0.233781 0.225337 0.217795 0.211227 0.205679 0.201081 0.197232 0.19384 0.190589 0.18719 0.183403 0.179069 0.174119 0.168573 0.162527 0.15612 0.146494 0.15111 0.155439 0.145348 0.141361 0.137373 0.131053 0.135243 0.139641 0.144312 0.149419 0.159504 0.163378 0.167193 0.171107 0.163191 0.158233 0.153677 0.149314 0.154695 0.160483 0.159864 0.153803 0.148024 0.142542 0.137361 0.132468 0.12784 0.126769 0.131688 0.136829 0.13674 0.131621 0.126655 0.12671 0.131558 0.136509 0.141555 0.141999 0.142187 0.147748 0.153494 0.1594 0.158459 0.152874 0.147382 0.146686 0.151895 0.157175 0.162517 0.164121 0.165437 0.166177 0.166681 0.168633 0.175297 0.17993 0.185158 0.191097 0.188239 0.181153 0.174614 0.173271 0.180207 0.187435 0.194889 0.195826 0.197815 0.205307 0.21348 0.222188 0.220606 0.212131 0.203831 0.202493 0.210166 0.217839 0.213765 0.206902 0.199996 0.19308 0.186197 0.17939 0.172701 0.171576 0.177789 0.184052 0.18143 0.17562 0.169846 0.167915 0.173358 0.178833 0.184323 0.187262 0.190344 0.196641 0.202917 0.209146 0.204653 0.198901 0.193094 0.189803 0.195242 0.200605 0.197064 0.192051 0.186932 0.181748 0.176534 0.171319 0.166126 0.160971 0.155867 0.150821 0.145841 0.140931 0.136094 0.131335 0.126658 0.126536 0.13106 0.135659 0.13535 0.130874 0.126471 0.126546 0.130852 0.135226 0.139663 0.139895 0.140332 0.145074 0.149882 0.15475 0.153891 0.149173 0.144505 0.144155 0.148696 0.153274 0.152856 0.148415 0.143998 0.139617 0.135282 0.131001 0.126781 0.127163 0.1313 0.13549 0.135827 0.131724 0.127667 0.128275 0.132256 0.136276 0.140326 0.139967 0.139726 0.143999 0.148296 0.152605 0.152502 0.148317 0.144135 0.144394 0.14847 0.152537 0.156579 0.156671 0.156911 0.157307 0.157876 0.158648 0.159669 0.164628 0.169611 0.174597 0.172987 0.168216 0.163429 0.162485 0.167083 0.171646 0.176146 0.177715 0.179562 0.184473 0.189294 0.193979 0.191275 0.1869 0.182365 0.180547 0.184812 0.188896 0.186809 0.182994 0.178981 0.174814 0.170531 0.166167 0.161751 0.161197 0.16544 0.169616 0.16889 0.164889 0.160807 0.160577 0.164508 0.168348 0.172067 0.172782 0.173696 0.177646 0.181426 0.184996 0.183445 0.180099 0.176531 0.175632 0.179006 0.182151 0.185037 0.186536 0.188316 0.190383 0.192749 0.195433 0.198467 0.201905 0.205823 0.210287 0.215276 0.220536 0.225451 0.229148 0.23129 0.240574 0.249763 0.259693 0.254302 0.245657 0.237564 0.232835 0.23991 0.247381 0.254639 0.263203 0.270413 0.278768 0.269181 0.258774 0.248599 0.245831 0.239907 0.233367 0.227072 0.221177 0.226883 0.232672 0.226064 0.220918 0.215691 0.210803 0.215601 0.220169 0.223394 0.230031 0.237524 0.239276 0.231013 0.223782 0.217471 0.217539 0.214938 0.210895 0.206498 0.202699 0.206719 0.210289 0.206154 0.203002 0.199332 0.196342 0.199695 0.202484 0.203797 0.20781 0.21237 0.211958 0.207142 0.202943 0.1993 0.200289 0.19925 0.196768 0.193699 0.191381 0.194202 0.196429 0.194001 0.19198 0.189376 0.187676 0.190088 0.191936 0.192465 0.194659 0.197253 0.196161 0.193484 0.191236 0.189388 0.190641 0.190206 0.18851 0.186275 0.183812 0.181106 0.178142 0.174944 0.171547 0.167987 0.164295 0.160502 0.156631 0.152707 0.148748 0.144772 0.140795 0.136829 0.132886 0.128977 0.129768 0.133611 0.137483 0.138237 0.134429 0.130644 0.131603 0.135336 0.139088 0.142844 0.142056 0.141372 0.145266 0.14915 0.15301 0.153444 0.149674 0.145873 0.146592 0.150318 0.154006 0.154696 0.151081 0.147422 0.143735 0.140034 0.136332 0.132645 0.133768 0.137412 0.141074 0.142211 0.138574 0.134967 0.136249 0.13984 0.14345 0.147033 0.145827 0.144728 0.14836 0.15196 0.15551 0.156448 0.152952 0.149406 0.150559 0.154054 0.157508 0.16088 0.159868 0.15899 0.158246 0.157636 0.157162 0.156827 0.16058 0.164247 0.167802 0.167792 0.16436 0.160808 0.161185 0.164632 0.167952 0.171118 0.171076 0.171218 0.174462 0.177501 0.180304 0.179737 0.177078 0.174182 0.174099 0.176868 0.179399 0.179285 0.176866 0.174211 0.17134 0.168281 0.165062 0.161709 0.162377 0.165646 0.168776 0.169438 0.166386 0.163188 0.164147 0.16728 0.170263 0.173076 0.172321 0.171742 0.174515 0.17707 0.179391 0.179713 0.177478 0.175009 0.175691 0.178085 0.180249 0.180996 0.178892 0.17656 0.174004 0.17125 0.168329 0.165252 0.162026 0.158695 0.155289 0.151817 0.148298 0.144751 0.141194 0.137618 0.139053 0.142607 0.146133 0.147633 0.144102 0.140556 0.137012 0.138597 0.135074 0.136719 0.133215 0.129748 0.126324 0.122953 0.124594 0.121262 0.122922 0.119628 0.1213 0.124623 0.128008 0.126278 0.129691 0.127983 0.131424 0.134908 0.138428 0.140202 0.136661 0.133154 0.134939 0.131448 0.133256 0.129783 0.126365 0.123009 0.119719 0.116499 0.11335 0.114986 0.111874 0.108838 0.110421 0.10742 0.104497 0.101649 0.103127 0.106017 0.108983 0.112027 0.115147 0.113497 0.11665 0.119877 0.118172 0.12143 0.124757 0.12815 0.131604 0.133472 0.129977 0.126543 0.123175 0.124957 0.121614 0.118344 0.120068 0.116825 0.113658 0.110568 0.107556 0.104622 0.106135 0.109117 0.112177 0.113811 0.110701 0.107669 0.109224 0.112307 0.115469 0.118711 0.117 0.115316 0.118531 0.121824 0.125191 0.123386 0.126776 0.130235 0.128369 0.131847 0.135386 0.138982 0.137022 0.135113 0.138673 0.136778 0.140343 0.138472 0.14204 0.145632 0.143768 0.141975 0.140251 0.1438 0.142139 0.145685 0.149219 0.152734 0.15115 0.149657 0.15318 0.15664 0.160011 0.161442 0.158083 0.154644 0.156215 0.15964 0.162987 0.16466 0.161315 0.157891 0.15441 0.150891 0.147351 0.1491 0.145536 0.147349 0.149239 0.152849 0.150933 0.154505 0.152653 0.156183 0.159674 0.163105 0.166458 0.168381 0.165011 0.161562 0.158054 0.160024 0.156448 0.158484 0.15485 0.151207 0.147568 0.143943 0.145912 0.142275 0.144267 0.140623 0.142629 0.146321 0.15005 0.147947 0.151654 0.149575 0.153253 0.156937 0.160611 0.162833 0.15911 0.155379 0.157585 0.153808 0.156037 0.152222 0.148438 0.144693 0.140995 0.137349 0.133761 0.135719 0.132141 0.128631 0.130524 0.12703 0.123611 0.120267 0.122031 0.12543 0.128904 0.132454 0.136077 0.134088 0.137722 0.14142 0.13936 0.14306 0.146815 0.150619 0.154463 0.156776 0.152865 0.148997 0.145181 0.147356 0.143532 0.139771 0.141867 0.138109 0.134424 0.130814 0.127281 0.123826 0.120449 0.117153 0.113937 0.1108 0.112399 0.11559 0.118862 0.120596 0.117266 0.114019 0.115661 0.118967 0.122357 0.125832 0.124009 0.122215 0.12565 0.129165 0.13276 0.134743 0.131083 0.127505 0.129391 0.133036 0.136766 0.138828 0.135026 0.131311 0.127684 0.124144 0.120691 0.117324 0.119009 0.122439 0.125957 0.127798 0.124211 0.120715 0.122445 0.118974 0.120663 0.117217 0.113863 0.115445 0.112118 0.113649 0.110347 0.111816 0.108543 0.109951 0.106714 0.10357 0.104894 0.10809 0.111381 0.11288 0.109535 0.106286 0.107791 0.111103 0.114511 0.118016 0.116324 0.114771 0.113285 0.116718 0.115184 0.11865 0.117044 0.120535 0.118865 0.12238 0.125991 0.124203 0.127838 0.126009 0.129668 0.133421 0.131478 0.129566 0.133264 0.137053 0.140932 0.143077 0.139116 0.13525 0.137271 0.141218 0.145263 0.149406 0.147131 0.144901 0.142718 0.140579 0.138485 0.136434 0.140185 0.144012 0.147911 0.145695 0.149589 0.153545 0.15124 0.155177 0.159162 0.161622 0.157558 0.160008 0.155914 0.15188 0.154231 0.150182 0.146207 0.142307 0.144476 0.148453 0.15251 0.156644 0.16085 0.158348 0.16253 0.166772 0.164158 0.168356 0.16573 0.163186 0.160724 0.158342 0.162244 0.159873 0.16372 0.16137 0.165151 0.168914 0.166537 0.164264 0.162093 0.165663 0.163558 0.167034 0.17043 0.173728 0.171651 0.169711 0.167906 0.166235 0.164698 0.163297 0.166475 0.169519 0.172407 0.173728 0.170861 0.167838 0.169367 0.172366 0.175205 0.177854 0.1764 0.175114 0.177616 0.179896 0.181953 0.183106 0.181102 0.178863 0.180295 0.182509 0.184477 0.186073 0.184113 0.181913 0.179486 0.17685 0.174025 0.171035 0.172845 0.175838 0.178664 0.180648 0.177808 0.174801 0.176905 0.179938 0.182803 0.185473 0.183294 0.1813 0.183723 0.185918 0.187873 0.189888 0.187928 0.185727 0.187927 0.190146 0.192122 0.193864 0.191619 0.1896 0.187801 0.186232 0.184907 0.183793 0.182879 0.182187 0.181718 0.181475 0.181462 0.181685 0.182146 0.182852 0.185162 0.18723 0.188798 0.187706 0.186246 0.18432 0.183739 0.18555 0.186922 0.187217 0.188038 0.189173 0.187909 0.186769 0.18595 0.185436 0.186688 0.18642 0.185129 0.183415 0.183343 0.184981 0.186188 0.186232 0.185095 0.183517 0.183927 0.185454 0.186545 0.186679 0.186413 0.18642 0.1852 0.185205 0.185454 0.185967 0.187209 0.187107 0.186053 0.184569 0.185444 0.186893 0.187912 0.188963 0.187984 0.186551 0.187859 0.189304 0.19027 0.190271 0.189006 0.187988 0.186733 0.187735 0.18897 0.190443 0.191787 0.191816 0.190826 0.189381 0.191154 0.192576 0.19358 0.195572 0.194573 0.193164 0.195411 0.196811 0.197803 0.197755 0.195525 0.193539 0.192157 0.194114 0.196315 0.198757 0.200229 0.200287 0.199301 0.197899 0.19634 0.194577 0.192575 0.190325 0.187838 0.185132 0.18223 0.179159 0.175944 0.172608 0.169174 0.171434 0.167877 0.170203 0.172643 0.17632 0.173816 0.177354 0.174916 0.1783 0.181565 0.184686 0.187637 0.190322 0.187308 0.184124 0.180798 0.183441 0.179927 0.182634 0.178949 0.175197 0.171396 0.167566 0.170079 0.166161 0.168694 0.1647 0.167243 0.171321 0.17541 0.172693 0.176686 0.173987 0.177868 0.181705 0.18548 0.188466 0.184591 0.180658 0.183569 0.179498 0.182423 0.178232 0.174045 0.169874 0.172595 0.176867 0.18116 0.184199 0.17979 0.175409 0.171067 0.173866 0.169467 0.165126 0.167798 0.163422 0.15912 0.154897 0.150753 0.146693 0.14896 0.153108 0.157343 0.159851 0.155519 0.151278 0.153647 0.157985 0.16242 0.166951 0.164273 0.161663 0.166066 0.170549 0.175108 0.172244 0.176756 0.181326 0.178319 0.182816 0.18735 0.191909 0.188626 0.185465 0.189766 0.186604 0.19076 0.187608 0.191596 0.195512 0.192264 0.189171 0.186232 0.189717 0.186841 0.1901 0.193191 0.196085 0.19314 0.190393 0.192927 0.195219 0.197258 0.200172 0.198083 0.195735 0.198754 0.201173 0.203325 0.206724 0.204494 0.201991 0.199231 0.196246 0.193064 0.196205 0.192755 0.195959 0.199332 0.203028 0.199525 0.202932 0.199491 0.202584 0.205449 0.208055 0.210378 0.214296 0.211861 0.209135 0.206147 0.209927 0.206571 0.210415 0.20672 0.202877 0.198919 0.194872 0.198297 0.194049 0.19748 0.193057 0.196482 0.201054 0.20561 0.201875 0.206224 0.202488 0.206599 0.210603 0.214468 0.218736 0.214684 0.210502 0.214592 0.21013 0.214212 0.209507 0.204778 0.200043 0.195318 0.190616 0.185949 0.189193 0.184435 0.179738 0.182817 0.178059 0.17338 0.168784 0.171576 0.176293 0.181101 0.184232 0.179289 0.174444 0.169698 0.165052 0.160509 0.156068 0.15173 0.147495 0.143362 0.13933 0.1354 0.13157 0.13351 0.129701 0.1316 0.127811 0.124123 0.125882 0.122215 0.123893 0.120253 0.121863 0.118264 0.119872 0.121623 0.125335 0.123527 0.127294 0.125571 0.129392 0.127639 0.131495 0.129652 0.133527 0.13751 0.135492 0.139489 0.137421 0.141435 0.145554 0.149778 0.152124 0.147804 0.143592 0.145802 0.141601 0.143734 0.139541 0.135461 0.137383 0.133328 0.135181 0.131177 0.133094 0.129157 0.131283 0.12739 0.123601 0.119913 0.116323 0.11283 0.109433 0.111186 0.107773 0.109433 0.105998 0.102677 0.0994525 0.100709 0.104031 0.107461 0.108779 0.105251 0.101842 0.0985658 0.0994877 0.0962667 0.0970053 0.0938616 0.0944526 0.0913944 0.0918604 0.0889088 0.0860681 0.0833342 0.0806932 0.0810411 0.0784828 0.0787638 0.0763019 0.073914 0.0716227 0.0718496 0.0741429 0.0765325 0.0789927 0.0815547 0.0813202 0.0839735 0.0836827 0.0864276 0.0867262 0.0869704 0.0842177 0.0844183 0.0817558 0.0791902 0.0767265 0.0743357 0.0720411 0.0722002 0.0744949 0.0768853 0.0770148 0.0746264 0.0723336 0.0701144 0.070222 0.0680797 0.0681645 0.066096 0.0640976 0.0621687 0.0622429 0.0603735 0.0585697 0.0586167 0.0568742 0.0569273 0.0586673 0.0604653 0.0604157 0.0622888 0.0642113 0.0641659 0.0661651 0.068232 0.068277 0.0662106 0.066255 0.0642572 0.0623371 0.068321 0.0704566 0.0704144 0.0703711 0.070305 0.0725232 0.0724399 0.0747381 0.0771232 0.0795868 0.0794784 0.0793508 0.0819136 0.0845756 0.0873301 0.0871685 0.0900395 0.0898349 0.089584 0.0892801 0.0922441 0.0953313 0.0949349 0.0981244 0.0976195 0.100908 0.100265 0.103657 0.102827 0.106307 0.109917 0.110866 0.107193 0.107919 0.104344 0.104902 0.101439 0.101867 0.098534 0.098864 0.0956522 0.0925555 0.092812 0.0959094 0.0991259 0.102474 0.102207 0.105689 0.105344 0.108962 0.108504 0.112252 0.111637 0.11552 0.114697 0.113676 0.112446 0.111017 0.114695 0.112976 0.116629 0.114699 0.118311 0.120393 0.122433 0.1185 0.120199 0.116251 0.117586 0.121655 0.125889 0.124295 0.128543 0.126495 0.124268 0.122023 0.125835 0.129745 0.133756 0.136538 0.132342 0.128252 0.130686 0.135004 0.139447 0.142219 0.137504 0.132945 0.134885 0.130297 0.131722 0.12719 0.122849 0.118688 0.11957 0.123798 0.128215 0.132835 0.137668 0.136454 0.141397 0.13966 0.144626 0.146562 0.148035 0.14273 0.143722 0.138582 0.133681 0.129003 0.124534 0.120261 0.11617 0.116677 0.112735 0.113111 0.109319 0.109599 0.105962 0.106174 0.10268 0.0993314 0.0961118 0.0930184 0.0931825 0.0902016 0.0903294 0.0874616 0.084699 0.0820352 0.0821508 0.08481 0.0875653 0.0876414 0.0848871 0.0822371 0.0796753 0.077205 0.0748231 0.0748782 0.0725877 0.072636 0.0726835 0.0749732 0.0749257 0.0773028 0.0772633 0.0797368 0.0822863 0.0849406 0.0877002 0.0877425 0.0849872 0.0823292 0.0797753 0.0798123 0.0773388 0.0823706 0.0850254 0.0877788 0.0906382 0.0906025 0.0905624 0.090505 0.090427 0.0933995 0.0933059 0.0963995 0.0962778 0.0994959 0.0996191 0.0997152 0.0964926 0.0965712 0.0934798 0.093535 0.0966239 0.0998385 0.0997892 0.103135 0.103064 0.102966 0.10284 0.106339 0.109981 0.109815 0.113611 0.113397 0.117357 0.117065 0.121195 0.120792 0.125094 0.129595 0.130032 0.125513 0.12582 0.121494 0.121712 0.117573 0.117732 0.11377 0.113887 0.110099 0.10646 0.106554 0.110189 0.113974 0.117931 0.117848 0.121983 0.12187 0.126198 0.126041 0.130572 0.130348 0.135093 0.134767 0.13431 0.139252 0.14444 0.14989 0.149118 0.154788 0.153599 0.151959 0.149788 0.147087 0.144008 0.140834 0.137866 0.135284 0.139398 0.13715 0.141334 0.13931 0.143568 0.141559 0.145858 0.150281 0.148044 0.15247 0.150115 0.154541 0.157015 0.159507 0.15483 0.157154 0.152487 0.147959 0.150107 0.14565 0.147991 0.143631 0.146396 0.142079 0.145228 0.148682 0.15346 0.149718 0.154301 0.150824 0.155369 0.152486 0.157126 0.154709 0.159464 0.164376 0.161962 0.166912 0.164311 0.161679 0.159082 0.156556 0.154109 0.158549 0.163096 0.167752 0.170532 0.165759 0.161101 0.16374 0.168516 0.173412 0.17843 0.175421 0.172517 0.17739 0.18237 0.187457 0.190781 0.185546 0.180425 0.183571 0.188836 0.194226 0.197822 0.19227 0.186852 0.181564 0.176405 0.171373 0.166465 0.169243 0.174304 0.179496 0.182614 0.177238 0.172004 0.174687 0.16945 0.172024 0.166885 0.161922 0.164853 0.160041 0.163751 0.158978 0.163292 0.158333 0.16255 0.157263 0.152105 0.155147 0.160701 0.166445 0.169637 0.16349 0.157599 0.159438 0.16557 0.17201 0.178777 0.176043 0.172368 0.16795 0.173445 0.168328 0.173434 0.168629 0.173623 0.169819 0.174956 0.180282 0.177348 0.182865 0.180089 0.185656 0.191386 0.188131 0.184819 0.190275 0.195867 0.201597 0.205535 0.19959 0.19379 0.197276 0.203326 0.209532 0.213403 0.206907 0.200602 0.194491 0.188579 0.191569 0.185814 0.189496 0.184032 0.17875 0.183855 0.178608 0.184635 0.179014 0.184674 0.178452 0.182703 0.185883 0.193341 0.189608 0.196736 0.191 0.197394 0.190288 0.195959 0.189187 0.194625 0.200202 0.19517 0.201085 0.197559 0.203794 0.210278 0.217012 0.220542 0.213749 0.207269 0.211939 0.205957 0.213102 0.20735 0.201644 0.210207 0.203811 0.211512 0.204054 0.209315 0.201153 0.204135 0.195865 0.188048 0.180657 0.173663 0.167037 0.160754 0.161665 0.155624 0.156195 0.150427 0.144947 0.139733 0.140069 0.145294 0.150787 0.151018 0.145523 0.140296 0.135318 0.13547 0.130726 0.13083 0.126306 0.126379 0.122061 0.122115 0.117988 0.114036 0.110254 0.106623 0.10667 0.103179 0.103216 0.0998797 0.0966604 0.0935741 0.0936094 0.0966931 0.0999182 0.103256 0.106723 0.106697 0.110327 0.110301 0.114078 0.114107 0.114134 0.110349 0.118079 0.118053 0.118026 0.12215 0.12646 0.126429 0.130942 0.130898 0.13563 0.135568 0.140537 0.140445 0.145668 0.151158 0.151235 0.145753 0.145799 0.140591 0.140621 0.135668 0.135688 0.130967 0.130985 0.12648 0.122175 0.122198 0.126501 0.131003 0.135717 0.135701 0.140645 0.140635 0.145827 0.14582 0.151283 0.151271 0.157028 0.157004 0.156937 0.156803 0.156569 0.162665 0.162274 0.168692 0.168036 0.174767 0.175476 0.175907 0.169101 0.169337 0.1629 0.163027 0.169456 0.176253 0.176145 0.183356 0.183117 0.182661 0.181889 0.189437 0.19745 0.205972 0.207032 0.198393 0.190286 0.19077 0.198911 0.207591 0.207832 0.199152 0.19101 0.191092 0.183452 0.18346 0.176279 0.169498 0.163083 0.163094 0.169494 0.176257 0.183417 0.191009 0.191077 0.199174 0.199216 0.207875 0.207801 0.20767 0.199077 0.198961 0.190921 0.183352 0.176213 0.169467 0.163082 0.157029 0.157018 0.151282 0.151279 0.145831 0.145841 0.140657 0.151284 0.15701 0.157009 0.163044 0.16306 0.169433 0.176165 0.176129 0.169408 0.169398 0.16304 0.176113 0.183216 0.18324 0.183287 0.190837 0.198855 0.207388 0.207521 0.216656 0.216842 0.217015 0.217127 0.217111 0.21687 0.216259 0.215051 0.212887 0.22214 0.217807 0.226588 0.219048 0.226585 0.216544 0.222794 0.228954 0.218943 0.224934 0.218198 0.224786 0.231152 0.24112 0.235044 0.248371 0.241323 0.234038 0.24473 0.235594 0.242171 0.231904 0.235082 0.224737 0.226141 0.226816 0.237511 0.236749 0.248169 0.246136 0.257938 0.252902 0.264021 0.253872 0.26287 0.271563 0.255142 0.261644 0.247272 0.23768 0.231748 0.22766 0.22399 0.220084 0.215895 0.211626 0.20747 0.203509 0.199741 0.196132 0.192648 0.18927 0.185994 0.19097 0.187649 0.19255 0.197513 0.194003 0.198857 0.203745 0.208654 0.21357 0.217805 0.212689 0.207593 0.202531 0.206343 0.201151 0.196025 0.199618 0.1944 0.19794 0.203332 0.208819 0.204919 0.210297 0.215746 0.211592 0.216888 0.222219 0.22757 0.222925 0.218475 0.223349 0.218872 0.223458 0.218967 0.223225 0.227327 0.222621 0.218157 0.213928 0.217219 0.213056 0.215921 0.218487 0.222962 0.220243 0.224836 0.221629 0.226296 0.231228 0.234873 0.229709 0.232809 0.227732 0.230304 0.225369 0.220753 0.216442 0.212424 0.208685 0.205216 0.202008 0.199052 0.200637 0.20205 0.203032 0.206043 0.205064 0.20363 0.206886 0.20835 0.209329 0.209206 0.205944 0.202956 0.201445 0.204391 0.207607 0.211103 0.212754 0.212903 0.211919 0.210416 0.214232 0.215787 0.21678 0.220974 0.219967 0.218347 0.222771 0.224474 0.225508 0.225275 0.22077 0.216603 0.214895 0.218998 0.223432 0.228221 0.230143 0.2304 0.229327 0.22752 0.232611 0.234542 0.235675 0.241351 0.240137 0.23806 0.235573 0.241193 0.238205 0.243932 0.240338 0.236432 0.232281 0.227941 0.232892 0.228165 0.233093 0.22803 0.232922 0.238252 0.243533 0.238086 0.242971 0.237492 0.24192 0.246114 0.250003 0.256432 0.252215 0.247701 0.253788 0.248726 0.25477 0.249242 0.243651 0.238033 0.232415 0.226817 0.221256 0.225796 0.220058 0.214396 0.218642 0.212854 0.20717 0.201596 0.205382 0.211147 0.217035 0.223044 0.229171 0.22453 0.230512 0.236582 0.231603 0.237466 0.243371 0.249298 0.255222 0.261484 0.255199 0.24894 0.242728 0.248209 0.24176 0.235412 0.240514 0.234004 0.22763 0.221392 0.215293 0.209332 0.213487 0.219654 0.225973 0.230825 0.224266 0.217868 0.222415 0.229097 0.235945 0.242966 0.23755 0.232446 0.239075 0.245862 0.252806 0.247155 0.253922 0.260808 0.254748 0.261363 0.268035 0.274739 0.267766 0.261113 0.266928 0.260192 0.265447 0.258655 0.263237 0.267456 0.260287 0.253534 0.247175 0.250109 0.243885 0.246132 0.247455 0.247217 0.24108 0.2354 0.233392 0.23898 0.245023 0.25155 0.253845 0.254033 0.252566 0.259473 0.25675 0.263834 0.271381 0.274815 0.26688 0.268775 0.261128 0.261003 0.258602 0.266234 0.268739 0.277111 0.277016 0.285895 0.283309 0.279416 0.275062 0.270434 0.278042 0.272607 0.28015 0.274008 0.281443 0.288091 0.294564 0.286079 0.291669 0.283126 0.287965 0.292395 0.295461 0.305765 0.302106 0.297052 0.306702 0.300715 0.310287 0.303515 0.296445 0.289248 0.282046 0.274889 0.267803 0.274548 0.267154 0.259904 0.266221 0.258781 0.251524 0.244448 0.250169 0.257563 0.265157 0.272959 0.280978 0.273847 0.281655 0.289639 0.282073 0.289712 0.297448 0.305239 0.31296 0.322942 0.314516 0.306089 0.297788 0.30636 0.29768 0.289219 0.297336 0.288628 0.280173 0.271957 0.263965 0.256183 0.248598 0.241201 0.233984 0.226945 0.231204 0.238645 0.246304 0.250942 0.242869 0.235104 0.23912 0.246925 0.255171 0.263855 0.259308 0.254172 0.262249 0.270536 0.279042 0.286018 0.276856 0.267951 0.272959 0.28246 0.292332 0.297726 0.287382 0.277628 0.268485 0.259952 0.252007 0.244605 0.253616 0.260289 0.267435 0.280482 0.274161 0.267942 0.28748 0.279803 0.29814 0.286856 0.275401 0.283831 0.270508 0.273809 0.26049 0.26154 0.249048 0.249292 0.237752 0.227057 0.227041 0.237696 0.249186 0.248902 0.237481 0.226883 0.22666 0.237198 0.248545 0.260806 0.261253 0.261624 0.26179 0.275384 0.275115 0.289924 0.288218 0.303794 0.297832 0.312358 0.32715 0.308969 0.319054 0.294561 0.301111 0.307303 0.28712 0.275189 0.283664 0.292944 0.303077 0.311186 0.302266 0.294307 0.313409 0.319769 0.326749 0.334703 0.32121 0.314074 0.308629 0.302554 0.295438 0.287779 0.296768 0.306028 0.315582 0.306307 0.315549 0.325073 0.315257 0.324356 0.333541 0.344877 0.334883 0.346236 0.335658 0.325449 0.336013 0.325385 0.315099 0.305125 0.313113 0.324008 0.335252 0.346869 0.358908 0.347027 0.358482 0.370331 0.357104 0.367959 0.354774 0.342558 0.331146 0.320415 0.327807 0.316943 0.323535 0.312475 0.316856 0.318236 0.306667 0.296007 0.286179 0.283498 0.27451 0.293276 0.303934 0.315569 0.328293 0.330794 0.328789 0.341618 0.335323 0.34789 0.339342 0.351627 0.361312 0.370255 0.35541 0.359241 0.344429 0.342231 0.357526 0.374355 0.375357 0.392942 0.386285 0.375711 0.364784 0.378985 0.391259 0.403683 0.422669 0.408153 0.39441 0.382261 0.397679 0.384474 0.371446 0.384516 0.370586 0.357229 0.344368 0.331976 0.320057 0.32592 0.338576 0.352 0.358573 0.344886 0.33243 0.343936 0.354687 0.36712 0.381323 0.373458 0.366148 0.381004 0.396612 0.412994 0.399039 0.413845 0.428902 0.411129 0.426522 0.443426 0.456888 0.433446 0.412216 0.413567 0.392939 0.436581 0.462345 0.49111 0.482638 0.465925 0.446232 0.466639 0.446937 0.429829 0.444244 0.425065 0.406702 0.3895 0.397333 0.415187 0.434897 0.456133 0.478378 0.463866 0.486459 0.51345 0.489667 0.510371 0.522788 0.556643 0.53907 0.566989 0.535486 0.504117 0.519065 0.490846 0.466971 0.445158 0.425923 0.409467 0.395617 0.384141 0.374754 0.367075 0.360623 0.354846 0.349172 0.343075 0.336148 0.328155 0.35593 0.341832 0.357462 0.338515 0.320572 0.323927 0.306134 0.306553 0.290238 0.289906 0.275143 0.274664 0.274105 0.288593 0.289292 0.305328 0.306114 0.324012 0.324566 0.34456 0.343478 0.364927 0.388325 0.377083 0.396834 0.368922 0.380333 0.389861 0.397482 0.448799 0.433574 0.415962 0.440226 0.413553 0.419726 0.391804 0.366858 0.366181 0.343908 0.342634 0.323009 0.321903 0.30445 0.303629 0.28793 0.273568 0.260369 0.24819 0.23691 0.226427 0.226225 0.216491 0.216372 0.207293 0.198779 0.190775 0.190743 0.198737 0.20724 0.216306 0.225998 0.22608 0.236487 0.236663 0.247889 0.247676 0.247553 0.236386 0.259595 0.259744 0.260003 0.273122 0.287385 0.302961 0.302496 0.287003 0.272807 0.272625 0.286781 0.302224 0.319152 0.319485 0.320056 0.32088 0.339945 0.34123 0.362789 0.364578 0.389325 0.391297 0.419814 0.452365 0.450857 0.485207 0.467602 0.49454 0.522397 0.532142 0.489613 0.487375 0.449849 0.417488 0.414573 0.387037 0.384946 0.361158 0.359871 0.33892 0.338216 0.337806 0.358483 0.358992 0.382198 0.383306 0.409743 0.411864 0.442651 0.446183 0.482906 0.526107 0.531221 0.582672 0.580258 0.561468 0.519584 0.461006 0.403505 0.408537 0.413388 0.418942 0.480543 0.476236 0.470023 0.541216 0.558245 0.570197 0.577513 0.484175 0.426044 0.435443 0.447803 0.463685 0.504541 0.494857 0.488489 0.581489 0.584065 0.587443 0.732908 0.726776 0.715431 0.696942 0.670804 0.638048 0.600772 0.633716 0.69139 0.751053 0.793282 0.713127 0.642991 0.639389 0.577541 0.570212 0.5202 0.478308 0.474591 0.439864 0.438012 0.408324 0.407514 0.381559 0.436965 0.470728 0.472116 0.511811 0.515198 0.563494 0.622087 0.630918 0.705776 0.714193 0.804636 0.913125 0.882455 0.809449 0.862849 0.908091 0.943459 1.17543 1.07716 0.978224 1.04139 1.19062 1.36216 1.48487 1.25072 1.06477 0.916807 0.799254 0.787051 0.694773 0.685507 0.615427 0.558766 0.556111 0.509922 0.611575 0.679793 0.766297 0.77476 0.892224 0.906744 1.06477 1.2765 1.56381 1.60975 1.27885 1.05238 1.03788 0.880281 1.26878 1.62847 2.22144 2.10795 1.96003 1.78283 1.55749 1.26826 0.968154 0.736037 0.593305 0.51826 0.483215 0.506074 0.534615 0.572667 0.554543 0.592494 0.62447 0.591147 0.656192 0.616255 0.645222 0.598929 0.56145 0.536193 0.602748 0.620631 0.653481 0.698261 0.746233 0.691215 0.859773 0.814703 0.773706 0.747396 0.738248 0.982249 0.995985 1.02784 1.53596 1.42958 1.35025 1.78063 2.05666 2.44627 2.91684 1.65733 1.07543 1.11704 1.72679 3.24418 6.9676 5.37894 3.76618 2.77156 2.17833 2.53852 3.52154 5.51861 7.74944 4.45713 2.91288 3.29924 5.60922 12.5648 20.8084 18.1797 9.26637 17.4139 24.4686 70.597 0.0203919 0.00590013 0.00461034 0.0087991 0.0112162 0.00204974 0.00159355 0.00345306 0.00413752 0.0147429 0.0153652 0.00349321 0.0111394 0.0167423 0.0152466 0.0189125 0.00289967 0.0110641 0.0163414 0.0124349 0.000791769 0.00237349 0.0126679 0.0166878 0.0113313 0.00360191 0.000668285 0.00205118 0.00296637 0.00199742 0.0132011 0.0168691 0.0113606 0.00285678 0.00057314 0.00171131 0.015283 0.0149307 0.0005499 0.00154824 0.00190195 0.000477434 0.00126501 0.00923237 0.00554371 0.00574211 0.0168035 0.0507146 0.0795466 0.0237362 0.030559 0.105028 0.57814 1.74222 3.22979 3.53999 2.2544 1.1649 0.647585 0.439373 0.355387 0.319513 0.300694 0.286555 0.273185 0.260141 0.247935 0.237006 0.227501 0.219348 0.212375 0.206396 0.201247 0.196803 0.192968 0.189666 0.18684 0.184444 0.182438 0.180788 0.179468 0.178454 0.177721 0.177254 0.17705 0.177111 0.177432 0.177966 0.1787 0.179657 0.180836 0.182234 0.18385 0.185684 0.187739 0.19002 0.192532 0.195281 0.198275 0.201524 0.205038 0.208831 0.212917 0.217313 0.22204 0.22712 0.232578 0.238447 0.244761 0.251562 0.258898 0.266826 0.275413 0.284737 0.294892 0.305989 0.318157 0.331564 0.346412 0.362969 0.381572 0.402653 0.42672 0.454293 0.485775 0.521238 0.560255 0.601983 0.646085 0.695315 0.760844 0.872374 1.10023 1.62091 2.97483 7.12718 22.9595 26.3284 0.475063 0.240448 0.0650061 0.959132 ) ; boundaryField { bottomEmptyFaces { type empty; } topEmptyFaces { type empty; } inlet { type calculated; value nonuniform List<scalar> 95 ( 6.12633 28.5011 10.5717 5.87608 2.41853 1.29328 0.862849 0.671912 0.575849 0.519324 0.479436 0.446656 0.417534 0.391106 0.367265 0.346007 0.327199 0.310581 0.295831 0.282632 0.270716 0.259869 0.249929 0.240774 0.232313 0.224471 0.217191 0.210421 0.204118 0.198246 0.192772 0.187666 0.182903 0.178461 0.174321 0.170463 0.166873 0.163535 0.160436 0.157566 0.154914 0.152471 0.150231 0.148185 0.146329 0.144658 0.14317 0.141861 0.140732 0.13978 0.139005 0.138407 0.13801 0.137805 0.137777 0.137946 0.138321 0.138915 0.139736 0.140799 0.14212 0.143718 0.145615 0.147838 0.150417 0.153394 0.156823 0.160773 0.165339 0.170639 0.176811 0.183989 0.192263 0.201642 0.212103 0.223906 0.23839 0.259779 0.29945 0.386778 0.60014 1.16514 2.62962 4.95308 0.864529 1.44205 0.364639 0.190812 0.0898289 5.17566 2.9214 6.50669 0.000156434 0.0138891 0.043963 ) ; } outlet { type calculated; value nonuniform List<scalar> 36 ( 2.23463 2.18165 2.09578 1.97475 1.82502 1.65188 1.46734 1.27785 1.09122 0.912497 0.746183 0.595614 0.46325 0.350511 0.257918 0.184922 0.130315 0.0913356 0.065186 0.0478355 0.0361276 0.0278089 0.0128152 0.0177821 0.0116674 0.00866116 0.00359363 0.00530509 0.00327626 0.00215768 0.00172698 0.0015979 6.59985e-05 0.000554414 0.00102185 2.25937 ) ; } walls { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 1055 ( 2.52926e-05 2.43562e-05 2.34958e-05 2.27099e-05 2.19997e-05 2.13516e-05 2.07669e-05 2.02399e-05 1.97728e-05 1.93577e-05 1.89909e-05 1.86656e-05 1.83799e-05 1.81244e-05 1.79064e-05 1.77194e-05 1.75645e-05 1.7433e-05 1.73248e-05 1.72331e-05 1.71583e-05 1.70951e-05 1.70459e-05 1.70056e-05 1.69763e-05 1.69527e-05 1.69365e-05 1.69238e-05 1.69154e-05 1.6909e-05 1.6908e-05 1.69068e-05 1.69088e-05 1.69121e-05 1.69164e-05 1.6922e-05 1.69268e-05 1.69324e-05 1.69359e-05 1.69404e-05 1.69422e-05 1.69452e-05 1.69444e-05 1.69453e-05 1.6942e-05 1.69412e-05 1.69353e-05 1.69327e-05 1.69253e-05 1.69214e-05 1.69126e-05 1.69073e-05 1.68978e-05 1.68913e-05 1.6881e-05 1.68734e-05 1.68628e-05 1.68546e-05 1.68435e-05 1.68349e-05 1.68238e-05 1.68151e-05 1.68037e-05 1.67947e-05 1.67833e-05 1.67743e-05 1.67627e-05 1.67537e-05 1.67421e-05 1.67333e-05 1.67219e-05 1.67131e-05 1.67019e-05 1.66936e-05 1.66829e-05 1.66752e-05 1.66648e-05 1.66578e-05 1.66483e-05 1.66421e-05 1.66332e-05 1.6628e-05 1.66199e-05 1.66156e-05 1.66084e-05 1.66052e-05 1.65989e-05 1.65968e-05 1.65915e-05 1.65903e-05 1.65864e-05 1.65859e-05 1.65833e-05 1.65835e-05 1.65823e-05 1.65831e-05 1.65832e-05 1.65847e-05 1.65862e-05 1.65882e-05 1.65907e-05 1.65936e-05 1.65967e-05 1.66007e-05 1.66044e-05 1.66095e-05 1.66138e-05 1.66198e-05 1.66248e-05 1.66315e-05 1.66371e-05 1.66445e-05 1.66507e-05 1.66586e-05 1.66653e-05 1.66738e-05 1.66809e-05 1.66898e-05 1.66973e-05 1.67066e-05 1.67145e-05 1.67242e-05 1.67324e-05 1.67424e-05 1.67508e-05 1.67612e-05 1.67699e-05 1.67805e-05 1.67896e-05 1.68004e-05 1.68097e-05 1.68207e-05 1.68302e-05 1.68414e-05 1.68511e-05 1.68624e-05 1.68722e-05 1.68836e-05 1.68936e-05 1.6905e-05 1.69151e-05 1.69266e-05 1.69366e-05 1.69481e-05 1.69582e-05 1.69698e-05 1.69798e-05 1.69913e-05 1.70014e-05 1.70128e-05 1.70229e-05 1.70343e-05 1.70444e-05 1.70557e-05 1.70658e-05 1.70771e-05 1.70871e-05 1.70984e-05 1.71084e-05 1.71197e-05 1.71296e-05 1.71409e-05 1.71508e-05 1.71621e-05 1.7172e-05 1.71834e-05 1.71933e-05 1.72047e-05 1.72145e-05 1.7226e-05 1.72358e-05 1.72473e-05 1.72571e-05 1.72686e-05 1.72782e-05 1.72896e-05 1.7299e-05 1.73103e-05 1.73194e-05 1.73306e-05 1.73392e-05 1.7361e-05 1.73591e-05 1.73595e-05 1.73778e-05 1.73896e-05 1.73962e-05 1.74298e-05 1.7441e-05 1.74767e-05 1.74235e-05 1.73445e-05 1.70617e-05 1.72685e-05 1.78012e-05 0 0 0 0 0 0 0 9.61785e-06 2.68317e-06 8.05396e-08 0 1.77611e-06 0 0 1.41366e-06 0 3.11184e-06 3.07773e-06 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 3.07551e-08 0 0 0 0 0 0 5.0614e-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 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 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 0 0 0 0 0 0 0 0 0 0 0 2.4917e-06 0 0 0 0 2.39114e-07 0 0 0 0 0 1.07578e-06 0 1.97766e-05 1.78442e-05 0 0 0 1.86772e-05 1.33655e-05 1.33893e-05 1.2243e-05 0 1.1924e-05 0 1.88189e-05 0 1.25916e-05 0 0 1.18299e-05 1.36244e-05 1.29294e-05 0 0 0 0 0 0 2.2117e-05 2.01682e-05 1.41299e-05 1.35448e-05 1.44493e-05 1.37384e-05 1.83102e-05 1.43455e-05 1.29472e-05 2.09693e-05 1.59777e-05 1.47716e-05 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 3.54038e-06 0 0 0 0 0 0 7.0904e-07 0 7.79219e-07 1.43048e-06 0 0 2.82007e-06 1.99352e-07 9.67322e-07 0 0 0 2.81622e-07 0 0 0 0 0 0 0 0 4.58891e-06 0 0 1.59039e-06 2.39994e-06 8.35527e-08 1.69987e-06 0 0 0 0 0 0 0 0 2.95545e-06 3.82842e-06 1.26871e-06 2.83902e-06 0 0 0 0 0 0 0 0 3.32462e-06 3.96462e-06 2.50155e-06 4.10981e-06 1.50676e-06 2.92152e-06 6.53573e-06 1.37242e-07 1.23017e-06 0 6.11847e-06 0 0 0 7.51242e-07 0 0 1.1159e-06 2.3959e-06 0 0 0 5.29906e-06 4.64226e-07 2.06629e-06 2.24145e-06 3.00125e-06 4.2373e-07 1.81788e-06 0 1.33756e-07 0 1.09772e-06 0 1.18864e-06 9.64364e-07 1.66077e-06 0 9.84854e-07 3.73959e-06 0 0 0 3.35637e-07 4.22284e-06 0 7.91276e-07 0 0 1.26354e-06 2.0445e-06 0 2.04103e-07 0 0 1.07858e-05 4.08201e-06 4.88657e-06 0 0 0 0 1.27729e-05 0 0 0 1.18329e-05 0 4.26512e-06 5.6005e-06 8.19831e-06 8.30163e-06 1.1614e-05 7.55505e-06 8.08349e-06 4.40409e-06 5.46754e-06 7.36257e-06 7.74167e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5.59052e-06 0 6.00035e-06 6.73403e-06 7.46971e-06 4.1649e-06 5.54948e-06 9.43876e-06 2.30799e-06 3.46576e-06 0 0 0 0 0 0 0 0 8.42733e-06 3.56235e-06 4.93528e-06 2.00337e-06 3.06342e-06 2.64055e-06 3.97103e-06 7.94866e-06 4.48634e-06 5.2865e-06 1.07297e-06 2.18956e-06 4.72133e-06 5.61137e-06 9.69665e-06 5.98781e-06 6.67729e-06 2.56871e-06 3.65758e-06 1.08314e-05 1.05667e-05 3.50463e-06 4.45822e-06 6.7704e-06 7.06561e-06 6.56609e-06 7.22689e-06 0 3.7417e-06 0 4.82575e-06 0 0 0 0 0 0 1.36717e-05 0 0 6.17849e-06 7.19837e-06 0 0 0 0 0 1.47083e-05 0 1.43497e-05 9.24386e-06 8.94123e-06 1.0054e-05 1.0318e-05 1.1578e-05 1.17148e-05 1.64678e-05 0 1.0206e-05 0 1.00026e-05 0 0 0 1.54258e-05 0 0 1.00862e-05 9.60033e-06 0 1.5729e-05 8.92226e-06 9.61838e-06 7.50629e-06 8.23379e-06 9.23087e-06 9.5996e-06 5.70886e-06 6.56624e-06 0 0 0 0 0 0 0 0 2.36202e-05 1.94315e-05 2.47682e-05 1.65466e-05 1.44349e-05 2.42719e-05 2.07783e-05 2.05149e-05 1.59199e-05 1.47394e-05 0 0 2.84658e-05 2.71106e-05 2.55978e-05 2.79611e-05 1.87359e-05 1.61096e-05 2.55642e-05 2.04532e-05 1.85553e-05 1.51317e-05 1.48556e-06 2.50215e-05 0 0 0 0 2.32947e-05 3.12245e-05 2.11721e-05 1.84667e-05 0 0 0 0 3.16263e-05 1.86236e-06 0 9.01476e-08 0 0 3.23274e-05 0 0 0 0 3.29025e-05 3.29019e-05 3.31039e-05 3.27753e-05 3.18867e-05 2.38839e-06 3.0773e-05 0 2.70091e-07 0 0 0 0 0 0 0 0 0 3.65099e-07 0 0 2.96264e-05 2.84786e-05 2.73605e-05 2.62965e-05 0 0 6.64197e-07 0 0 0 0 0 0 1.84271e-05 0 3.34633e-05 2.93247e-05 2.65268e-05 2.46346e-05 2.31979e-05 2.18537e-05 2.08969e-05 1.99645e-05 1.94422e-05 1.88147e-05 1.84397e-05 1.79511e-05 1.76675e-05 1.72679e-05 1.70443e-05 1.6705e-05 1.65207e-05 1.62222e-05 1.60643e-05 1.57948e-05 1.5656e-05 1.54073e-05 1.52819e-05 1.50485e-05 1.49325e-05 1.47106e-05 1.46018e-05 1.43888e-05 1.42851e-05 1.4079e-05 1.39792e-05 1.37786e-05 1.36817e-05 1.34854e-05 1.33905e-05 1.31977e-05 1.31044e-05 1.29144e-05 1.28222e-05 1.26343e-05 1.25428e-05 1.23564e-05 1.22653e-05 1.20797e-05 1.19885e-05 1.18033e-05 1.17116e-05 1.15261e-05 1.14336e-05 1.12472e-05 1.11536e-05 1.09658e-05 1.08707e-05 1.0681e-05 1.05841e-05 1.0392e-05 1.0293e-05 1.00981e-05 9.99662e-06 9.79848e-06 9.69443e-06 9.49269e-06 9.38586e-06 9.1802e-06 9.07052e-06 8.86068e-06 8.74822e-06 8.53416e-06 8.41904e-06 8.20072e-06 8.08315e-06 7.86071e-06 7.74105e-06 7.51482e-06 7.39367e-06 7.16421e-06 7.0424e-06 6.81059e-06 6.68925e-06 6.45633e-06 6.33698e-06 6.10464e-06 5.98924e-06 5.75966e-06 5.65064e-06 5.4265e-06 5.3269e-06 5.11143e-06 5.02507e-06 4.82177e-06 4.75378e-06 4.56803e-06 4.52094e-06 4.36263e-06 4.33641e-06 4.21028e-06 4.20683e-06 4.12374e-06 4.13846e-06 4.10289e-06 4.13554e-06 4.12488e-06 4.19921e-06 4.20981e-06 4.32179e-06 4.35678e-06 4.50325e-06 4.55401e-06 4.72144e-06 4.78442e-06 4.96667e-06 5.03836e-06 5.23095e-06 5.30831e-06 5.50647e-06 5.58573e-06 5.78379e-06 5.86238e-06 6.05597e-06 6.1315e-06 6.31663e-06 6.38707e-06 6.56036e-06 6.62429e-06 6.78326e-06 6.83983e-06 6.98229e-06 7.0303e-06 7.15467e-06 7.19361e-06 7.29949e-06 7.32942e-06 7.41753e-06 7.43897e-06 7.5103e-06 7.5234e-06 7.57966e-06 7.58607e-06 7.63041e-06 7.63136e-06 7.66202e-06 7.6585e-06 7.67964e-06 7.67367e-06 7.68686e-06 7.67899e-06 7.68779e-06 7.67474e-06 7.68221e-06 7.66332e-06 7.66856e-06 7.64804e-06 7.64772e-06 7.62318e-06 7.62663e-06 7.59891e-06 7.60214e-06 7.57636e-06 7.57501e-06 7.54431e-06 7.54539e-06 7.51173e-06 7.51432e-06 7.48242e-06 7.48043e-06 7.44617e-06 7.4514e-06 7.4042e-06 7.41865e-06 7.35465e-06 7.46021e-06 7.50026e-06 7.78408e-06 8.17857e-06 9.62967e-06 1.32432e-05 1.05502e-05 3.77883e-05 ) ; } rightWall { type calculated; value nonuniform List<scalar> 28 ( 0.00107415 0.00233993 0.00411665 0.00606083 0.0081009 0.0111331 0.0127418 0.0163052 0.0186557 0.021053 0.0225476 0.0235973 0.0237729 0.0231479 0.0218412 0.0195203 0.0169339 0.0128831 0.0106976 0.00750353 0.00401391 0.00175148 4.68049e-05 0.000309308 0.000710046 2.16175e-05 0.000163011 0.00039179 ) ; } symmetryLine { type symmetryPlane; } } // ************************************************************************* //
[ "mhoeper3234@gmail.com" ]
mhoeper3234@gmail.com
3cdaf0f2613a288933fa99dc87ddc7b61af7577c
b5d73eb3fd01c14253df57707bef7fa32455cc0a
/src/FontManager.h
28c7c49d718733debea6cbf7eaa2262269e68f9f
[]
no_license
nugurejeil/2dGameEngine
a660a68403f1ad66f10adaa6e4f7123b3aa0ebb5
2e1ee03caa8d8990c29f5f22d7ae1f9d3a76831c
refs/heads/master
2022-11-25T12:20:11.845881
2020-07-24T08:06:12
2020-07-24T08:06:12
280,333,028
0
0
null
null
null
null
UTF-8
C++
false
false
233
h
#ifndef FONTMANAGER_H #define FONTMANAGER_H #include "./Game.h" class FontManager{ public: static TTF_Font* LoadFont(const char* fileName, int fontSize); static void Draw(SDL_Texture* texture, SDL_Rect position); }; #endif
[ "user@userui-MacBookPro.local" ]
user@userui-MacBookPro.local
561f210a74c6f0aab7545de8d3da552764c4ce2c
0fa5aec8016399a8003ad552fb993af4994291a5
/agg_vcgen_smooth_poly1.h
00bb6c4556d4632df5e5c30faba040a8b89c97ea
[ "BSD-3-Clause", "LicenseRef-scancode-boost-original", "LicenseRef-scancode-unknown-license-reference" ]
permissive
projectitis/agg_t3
69c49aeb458a1b24bb51c2c4ed5b2988a7a6463e
22fb60a272ef1fe03da4cbef561607313b4f076a
refs/heads/master
2022-12-15T19:34:22.912456
2020-09-05T08:28:27
2020-09-05T08:28:27
293,017,169
0
0
null
null
null
null
UTF-8
C++
false
false
2,576
h
//---------------------------------------------------------------------------- // Anti-Grain Geometry - Version 2.4 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // //---------------------------------------------------------------------------- // Contact: mcseem@antigrain.com // mcseemagg@yahoo.com // http://www.antigrain.com //---------------------------------------------------------------------------- #ifndef AGG_VCGEN_SMOOTH_POLY1_INCLUDED #define AGG_VCGEN_SMOOTH_POLY1_INCLUDED #include "agg_basics.h" #include "agg_vertex_sequence.h" namespace agg { //======================================================vcgen_smooth_poly1 // // See Implementation agg_vcgen_smooth_poly1.cpp // Smooth polygon generator // //------------------------------------------------------------------------ class vcgen_smooth_poly1 { enum status_e { initial, ready, polygon, ctrl_b, ctrl_e, ctrl1, ctrl2, end_poly, stop }; public: typedef vertex_sequence<vertex_dist, 6> vertex_storage; vcgen_smooth_poly1(); void smooth_value(float64 v) { m_smooth_value = v * 0.5; } float64 smooth_value() const { return m_smooth_value * 2.0; } // Vertex Generator Interface void remove_all(); void add_vertex(float64 x, float64 y, unsigned cmd); // Vertex Source Interface void rewind(unsigned path_id); unsigned vertex(float64* x, float64* y); private: vcgen_smooth_poly1(const vcgen_smooth_poly1&); const vcgen_smooth_poly1& operator = (const vcgen_smooth_poly1&); void calculate(const vertex_dist& v0, const vertex_dist& v1, const vertex_dist& v2, const vertex_dist& v3); vertex_storage m_src_vertices; float64 m_smooth_value; unsigned m_closed; status_e m_status; unsigned m_src_vertex; float64 m_ctrl1_x; float64 m_ctrl1_y; float64 m_ctrl2_x; float64 m_ctrl2_y; }; } #endif
[ "peter@projectitis.com" ]
peter@projectitis.com
213ceac9a0aa5e922bdc8f155c4fec4b33d24e87
0efc9cba519517d9cfdb1e05ebc26805a1645aff
/usr/pkg/include/ETL/_mutex_null.h
a42a75a237df2cd9c73a8daed2a68afe84dee63d
[ "MIT" ]
permissive
CyberSys/Python-2.7-for-QNX6.5.0-x86
05e1eeb54c390a954741af2df6b94162b919011b
f24ff021f9f64e85adc4f3e5d057a0463a9af725
refs/heads/master
2021-05-28T12:26:22.927759
2014-11-06T02:02:42
2014-11-06T02:02:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,052
h
/*! ======================================================================== ** Extended Template and Library ** NULL Mutex Abstraction Class Implementation ** $Id: _mutex_null.h 631 2007-09-08 15:33:07Z dooglus $ ** ** Copyright (c) 2002 Robert B. Quattlebaum Jr. ** ** This package 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 package 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. ** ** === N O T E S =========================================================== ** ** This is an internal header file, included by other ETL headers. ** You should not attempt to use it directly. ** ** ========================================================================= */ /* === S T A R T =========================================================== */ #ifndef __ETL__MUTEX_NULL_H_ #define __ETL__MUTEX_NULL_H_ /* === H E A D E R S ======================================================= */ /* === M A C R O S ========================================================= */ /* === C L A S S E S & S T R U C T S ======================================= */ _ETL_BEGIN_NAMESPACE class mutex_null { public: mutex_null(){} ~mutex_null(){} //! Exception-safe mutex lock class /* class lock { mutex *_mtx; public: lock(mutex &x):_mtx(&x) { _mtx->lock_mutex(); } ~lock() { _mtx->unlock_mutex(); } mutex &get() { return *_mtx; } }; */ class lock { public: lock(mutex_null &/*x*/) { } }; void lock_mutex(){} bool try_lock_mutex(){return true;} void unlock_mutex(){} }; _ETL_END_NAMESPACE /* === E X T E R N S ======================================================= */ /* === E N D =============================================================== */ #endif
[ "info@symmetry.com.au" ]
info@symmetry.com.au
21a4c4c03899ec2fc799de6aff8bec6baf32f05a
c77147987cf47155cb65664acd5104b83b8d76cc
/audioplayer.cpp
304a8ba52f17d43eb0dfbbf781ed10293190fcec
[ "Apache-2.0" ]
permissive
cagdasc/CacaTube
f39524f4e3dbbc85828f86ef0103094dc7ad1ece
dfacd89aab9930d6698f2b6ae525e7927f0f5170
refs/heads/master
2016-09-11T02:05:45.988932
2015-02-16T00:10:08
2015-02-16T00:10:08
29,970,290
1
0
null
null
null
null
UTF-8
C++
false
false
4,111
cpp
/* * Copyright 2015 Cagdas Caglak * * 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 "audioplayer.h" #include <iostream> //QString AudioPlayer::cacatube_api_url = "http://api.caglak.cc:8080/cacatubeapi/v1/eURL"; AudioPlayer::AudioPlayer(QObject *parent) : QObject(parent) { _instance = new VlcInstance(VlcCommon::args(), this); _player = new VlcMediaPlayer(_instance); connect(_player, SIGNAL(playing()), this, SLOT(started())); connect(_player, SIGNAL(error()), this, SLOT(errorSomething())); connect(_player, SIGNAL(end()), this, SLOT(ended())); _volume = new VlcAudio(_player); } AudioPlayer::AudioPlayer(QString raw_url) { this->raw_url = raw_url; is_playing = false; is_paused = true; } void AudioPlayer::setRawURL(QString raw_url) { this->raw_url = raw_url; } QString AudioPlayer::getEmbeddedMediaURLWithAPI() { QEventLoop loop; QNetworkAccessManager *access = new QNetworkAccessManager(); QUrlQuery query; query.addQueryItem("url", raw_url); QUrl url(cacatube_api_url); url.setQuery(query.query()); QNetworkRequest request(url); QNetworkReply *reply = access->get(request); QObject::connect(access, SIGNAL(finished(QNetworkReply*)), &loop, SLOT(quit())); loop.exec(); QString embedded; if (reply->error() == QNetworkReply::NoError) { QByteArray bytes = reply->readAll(); QString json(bytes); VideoInfo video_info = Utils::parseAPIReqJson(json); duration = video_info.getDuration() * 1000; embedded = video_info.getEmbeddedUrl(); } delete reply; delete access; return embedded; } QString AudioPlayer::getEmbeddedMediaURLWithLocal() { QEventLoop loop; link_process = new QProcess(); connect(link_process, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit())); link_process->start("/usr/local/bin/youtube-dl -g " + raw_url); loop.exec(); return link_process->readAllStandardOutput(); } void AudioPlayer::play() { if (!is_playing) { QString embedded_url = getEmbeddedMediaURLWithAPI(); //QString embedded_url = getEmbeddedMediaURLWithLocal(); _media = new VlcMedia(embedded_url, _instance); _player->open(_media); } } void AudioPlayer::started() { if (!is_playing) { is_playing = true; is_paused = false; emit is_pplaying(); } } void AudioPlayer::ended() { is_playing = false; is_paused = true; std::cout << "Stopped baby" << std::endl; emit is_pstop(); } void AudioPlayer::pause() { if (!is_paused) { _player->pause(); is_paused = true; } else { _player->resume(); is_paused = false; } } void AudioPlayer::stop() { if (is_playing || is_paused) { _player->stop(); is_playing = false; emit is_pstop(); } } void AudioPlayer::setIsPlaying(bool is_playing) { this->is_playing = is_playing; } void AudioPlayer::setIsPaused(bool is_paused) { this->is_paused = is_paused; } bool AudioPlayer::isPlaying() { return is_playing; } void AudioPlayer::setVolume(int volume) { _volume->setVolume(volume); } float AudioPlayer::getCurrentPosition() { return _player->position(); } double AudioPlayer::getDuration() { return duration; } void AudioPlayer::errorSomething() { stop(); emit is_perror(); } void AudioPlayer::release() { delete _player; delete _media; delete _instance; delete _volume; //delete link_process; } AudioPlayer::~AudioPlayer() { release(); }
[ "cagdascaglak@gmail.com" ]
cagdascaglak@gmail.com
19186b19c0b871e1c6626f6514bee93a9ef261f2
39ab8bd2238e55d4da5b7a04b6bc32668f42df27
/munkres.cpp
ed27a301a132edf64dab8503813cb80cf747d355
[]
no_license
Mihai-Ionut-Aurel/BotTribalWars
bf4de3ec6337838040c4a9ca24b259ab085ea039
cdb4602cafd864b59e1f0e98be9b71f2ebd2d932
refs/heads/master
2021-01-01T18:17:41.273659
2014-06-05T18:35:36
2014-06-05T18:35:36
null
0
0
null
null
null
null
UTF-8
C++
false
false
9,563
cpp
/* * Copyright (c) 2007 John Weaver * * 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 */ #include "munkres.h" #include <iostream> #include <cmath> #include <limits> bool Munkres::find_uncovered_in_matrix(double item, int &row, int &col) { for ( row = 0 ; row < matrix.rows() ; row++ ) if ( !row_mask[row] ) for ( col = 0 ; col < matrix.columns() ; col++ ) if ( !col_mask[col] ) if ( matrix(row,col) == item ) return true; return false; } bool Munkres::pair_in_list(const std::pair<int,int> &needle, const std::list<std::pair<int,int> > &haystack) { for ( std::list<std::pair<int,int> >::const_iterator i = haystack.begin() ; i != haystack.end() ; i++ ) { if ( needle == *i ) return true; } return false; } int Munkres::step1(void) { for ( int row = 0 ; row < matrix.rows() ; row++ ) for ( int col = 0 ; col < matrix.columns() ; col++ ) if ( matrix(row,col) == 0 ) { bool isstarred = false; for ( int nrow = 0 ; nrow < matrix.rows() ; nrow++ ) if ( mask_matrix(nrow,col) == STAR ) { isstarred = true; break; } if ( !isstarred ) { for ( int ncol = 0 ; ncol < matrix.columns() ; ncol++ ) if ( mask_matrix(row,ncol) == STAR ) { isstarred = true; break; } } if ( !isstarred ) { mask_matrix(row,col) = STAR; } } return 2; } int Munkres::step2(void) { int rows = matrix.rows(); int cols = matrix.columns(); int covercount = 0; for ( int row = 0 ; row < rows ; row++ ) for ( int col = 0 ; col < cols ; col++ ) if ( mask_matrix(row,col) == STAR ) { col_mask[col] = true; covercount++; } int k = matrix.minsize(); if ( covercount >= k ) { #ifdef DEBUG std::cout << "Final cover count: " << covercount << std::endl; #endif return 0; } #ifdef DEBUG std::cout << "Munkres matrix has " << covercount << " of " << k << " Columns covered:" << std::endl; for ( int row = 0 ; row < rows ; row++ ) { for ( int col = 0 ; col < cols ; col++ ) { std::cout.width(8); std::cout << matrix(row,col) << ","; } std::cout << std::endl; } std::cout << std::endl; #endif return 3; } int Munkres::step3(void) { /* Main Zero Search 1. Find an uncovered Z in the distance matrix and prime it. If no such zero exists, go to Step 5 2. If No Z* exists in the row of the Z', go to Step 4. 3. If a Z* exists, cover this row and uncover the column of the Z*. Return to Step 3.1 to find a new Z */ if ( find_uncovered_in_matrix(0, saverow, savecol) ) { mask_matrix(saverow,savecol) = PRIME; // prime it. } else { return 5; } for ( int ncol = 0 ; ncol < matrix.columns() ; ncol++ ) if ( mask_matrix(saverow,ncol) == STAR ) { row_mask[saverow] = true; //cover this row and col_mask[ncol] = false; // uncover the column containing the starred zero return 3; // repeat } return 4; // no starred zero in the row containing this primed zero } int Munkres::step4(void) { int rows = matrix.rows(); int cols = matrix.columns(); std::list<std::pair<int,int> > seq; // use saverow, savecol from step 3. std::pair<int,int> z0(saverow, savecol); std::pair<int,int> z1(-1,-1); std::pair<int,int> z2n(-1,-1); seq.insert(seq.end(), z0); int row, col = savecol; /* Increment Set of Starred Zeros 1. Construct the ``alternating sequence'' of primed and starred zeros: Z0 : Unpaired Z' from Step 4.2 Z1 : The Z* in the column of Z0 Z[2N] : The Z' in the row of Z[2N-1], if such a zero exists Z[2N+1] : The Z* in the column of Z[2N] The sequence eventually terminates with an unpaired Z' = Z[2N] for some N. */ bool madepair; do { madepair = false; for ( row = 0 ; row < rows ; row++ ) if ( mask_matrix(row,col) == STAR ) { z1.first = row; z1.second = col; if ( pair_in_list(z1, seq) ) continue; madepair = true; seq.insert(seq.end(), z1); break; } if ( !madepair ) break; madepair = false; for ( col = 0 ; col < cols ; col++ ) if ( mask_matrix(row,col) == PRIME ) { z2n.first = row; z2n.second = col; if ( pair_in_list(z2n, seq) ) continue; madepair = true; seq.insert(seq.end(), z2n); break; } } while ( madepair ); for ( std::list<std::pair<int,int> >::iterator i = seq.begin() ; i != seq.end() ; i++ ) { // 2. Unstar each starred zero of the sequence. if ( mask_matrix(i->first,i->second) == STAR ) mask_matrix(i->first,i->second) = NORMAL; // 3. Star each primed zero of the sequence, // thus increasing the number of starred zeros by one. if ( mask_matrix(i->first,i->second) == PRIME ) mask_matrix(i->first,i->second) = STAR; } // 4. Erase all primes, uncover all columns and rows, for ( int row = 0 ; row < mask_matrix.rows() ; row++ ) for ( int col = 0 ; col < mask_matrix.columns() ; col++ ) if ( mask_matrix(row,col) == PRIME ) mask_matrix(row,col) = NORMAL; for ( int i = 0 ; i < rows ; i++ ) { row_mask[i] = false; } for ( int i = 0 ; i < cols ; i++ ) { col_mask[i] = false; } // and return to Step 2. return 2; } int Munkres::step5(void) { int rows = matrix.rows(); int cols = matrix.columns(); /* New Zero Manufactures 1. Let h be the smallest uncovered entry in the (modified) distance matrix. 2. Add h to all covered rows. 3. Subtract h from all uncovered columns 4. Return to Step 3, without altering stars, primes, or covers. */ double h = 0; for ( int row = 0 ; row < rows ; row++ ) { if ( !row_mask[row] ) { for ( int col = 0 ; col < cols ; col++ ) { if ( !col_mask[col] ) { if ( (h > matrix(row,col) && matrix(row,col) != 0) || h == 0 ) { h = matrix(row,col); } } } } } for ( int row = 0 ; row < rows ; row++ ) if ( row_mask[row] ) for ( int col = 0 ; col < cols ; col++ ) matrix(row,col) += h; for ( int col = 0 ; col < cols ; col++ ) if ( !col_mask[col] ) for ( int row = 0 ; row < rows ; row++ ) matrix(row,col) -= h; return 3; } void Munkres::solve(Matrix<double> &m) { // Linear assignment problem solution // [modifies matrix in-place.] // matrix(row,col): row major format assumed. // Assignments are remaining 0 values // (extra 0 values are replaced with -1) #ifdef DEBUG std::cout << "Munkres input matrix:" << std::endl; for ( int row = 0 ; row < m.rows() ; row++ ) { for ( int col = 0 ; col < m.columns() ; col++ ) { std::cout.width(8); std::cout << m(row,col) << ","; } std::cout << std::endl; } std::cout << std::endl; #endif double highValue = 0; for ( int row = 0 ; row < m.rows() ; row++ ) { for ( int col = 0 ; col < m.columns() ; col++ ) { if ( m(row,col) != std::numeric_limits<double>::infinity( ) && m(row,col) > highValue ) highValue = m(row,col); } } highValue++; for ( int row = 0 ; row < m.rows() ; row++ ) for ( int col = 0 ; col < m.columns() ; col++ ) if ( m(row,col) == std::numeric_limits<double>::infinity( ) ) m(row,col) = highValue; bool notdone = true; int step = 1; this->matrix = m; // STAR == 1 == starred, PRIME == 2 == primed mask_matrix.resize(matrix.rows(), matrix.columns()); row_mask = new bool[matrix.rows()]; col_mask = new bool[matrix.columns()]; for ( int i = 0 ; i < matrix.rows() ; i++ ) { row_mask[i] = false; } for ( int i = 0 ; i < matrix.columns() ; i++ ) { col_mask[i] = false; } while ( notdone ) { switch ( step ) { case 0: notdone = false; break; case 1: step = step1(); break; case 2: step = step2(); break; case 3: step = step3(); break; case 4: step = step4(); break; case 5: step = step5(); break; } } // Store results for ( int row = 0 ; row < matrix.rows() ; row++ ) for ( int col = 0 ; col < matrix.columns() ; col++ ) if ( mask_matrix(row,col) == STAR ) matrix(row,col) = 0; else matrix(row,col) = -1; #ifdef DEBUG std::cout << "Munkres output matrix:" << std::endl; for ( int row = 0 ; row < matrix.rows() ; row++ ) { for ( int col = 0 ; col < matrix.columns() ; col++ ) { std::cout.width(1); std::cout << matrix(row,col) << ","; } std::cout << std::endl; } std::cout << std::endl; #endif m = matrix; delete [] row_mask; delete [] col_mask; }
[ "freaky_jo777@yahoo.com" ]
freaky_jo777@yahoo.com