blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
247
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
4
111
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
58
visit_date
timestamp[ns]date
2015-07-25 18:16:41
2023-09-06 10:45:08
revision_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
committer_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
github_id
int64
3.89k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
25 values
gha_event_created_at
timestamp[ns]date
2012-06-07 00:51:45
2023-09-14 21:58:52
gha_created_at
timestamp[ns]date
2008-03-27 23:40:48
2023-08-24 19:49:39
gha_language
stringclasses
159 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
10.5M
extension
stringclasses
111 values
filename
stringlengths
1
195
text
stringlengths
7
10.5M
a0326628952ca95a1c286fb84037b87a2c018aa3
da99225787e5f49af3f5bf332b219e913e7cd5e3
/udp/UDPTest/CRCCheck.cpp
5f9108ff16fb5c54d9c951faf363bfdb776b67dd
[]
no_license
jiangjinggen/net
a66e081bf99e2340751a386b8df2a3adaeaa7aca
64ec673419e6e1d64da0c4f1d724ed714624dc68
refs/heads/master
2020-07-17T06:01:04.322880
2019-09-03T01:28:43
2019-09-03T01:28:43
205,962,291
0
0
null
null
null
null
UTF-8
C++
false
false
3,059
cpp
CRCCheck.cpp
// CRCCheck.cpp: implementation of the CCRCCheck class. // ////////////////////////////////////////////////////////////////////// //#include "stdafx.h" #include "CRCCheck.h" //#ifdef _DEBUG //#define new DEBUG_NEW //#undef THIS_FILE //static char THIS_FILE[] = __FILE__; //#endif //unsigned long CCRCCheck::m_pdwCrcTab[256]; bool CCRCCheck::m_bCrcTableGenerated = false; ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CCRCCheck::CCRCCheck() :m_nOrder(16), m_dwPolynom(0x1002), m_bRefIn(false), m_bRefOut(false), m_dwCrcInit(0), m_dwCrcXOR(0) { } CCRCCheck::CCRCCheck(int nOrder, unsigned long dwPolynom, bool bRefIn, bool bRefOut, unsigned long dwCrcInit, unsigned long dwCrcXOR) : m_nOrder(nOrder), m_dwPolynom(dwPolynom), m_bRefIn(bRefIn), m_bRefOut(bRefOut), m_dwCrcInit(dwCrcInit), m_dwCrcXOR(dwCrcXOR) { m_dwCrcMask = ((unsigned long)1<<m_nOrder)-1; Generate_crc_table(m_dwPolynom, m_dwCrcMask, m_bRefIn, m_nOrder); } CCRCCheck::~CCRCCheck() { delete []m_pdwCrcTab; } void CCRCCheck::Init(int nOrder, unsigned long dwPolynom, bool bRefIn, bool bRefOut, unsigned long dwCrcInit, unsigned long dwCrcXOR) { m_nOrder = nOrder; m_dwPolynom = dwPolynom; m_bRefIn = bRefIn; m_bRefOut = bRefOut; m_dwCrcInit = dwCrcInit; m_dwCrcXOR = dwCrcXOR; m_dwCrcMask = ((unsigned long)1<<m_nOrder)-1; Generate_crc_table(m_dwPolynom, m_dwCrcMask, m_bRefIn, m_nOrder); } unsigned long CCRCCheck::GetCRC(unsigned char* p, unsigned long len) { // fast lookup table algorithm without augmented zero bytes, e.g. used in pkzip. // only usable with polynom orders of 8, 16, 24 or 32. unsigned long crc = m_dwCrcInit; if (m_bRefIn) crc = Reflect(crc, m_nOrder); if (!m_bRefIn) while (len--) crc = (crc << 8) ^ m_pdwCrcTab[ ((crc >> (m_nOrder-8)) & 0xff) ^ *p++]; else while (len--) crc = (crc >> 8) ^ m_pdwCrcTab[ (crc & 0xff) ^ *p++]; if (m_bRefOut^m_bRefIn) crc = Reflect(crc, m_nOrder); crc^= m_dwCrcXOR; crc&= m_dwCrcMask; return(crc); } void CCRCCheck::Generate_crc_table(unsigned long dwPolynom, unsigned long dwCrcMask, bool bRefIn, int nOrder) { if (m_bCrcTableGenerated) return; m_pdwCrcTab = new unsigned long [256]; // make CRC lookup table used by table algorithms unsigned long crchighbit = (unsigned long)1<<(nOrder-1); int i, j; unsigned long bit, crc; for (i=0; i<256; i++) { crc=(unsigned long)i; if (bRefIn) crc=Reflect(crc, 8); crc<<= m_nOrder-8; for (j=0; j<8; j++) { bit = crc & crchighbit; crc<<= 1; if (bit) crc^= dwPolynom; } if (bRefIn) crc = Reflect(crc, nOrder); crc&= dwCrcMask; m_pdwCrcTab[i]= crc; } m_bCrcTableGenerated = true; } unsigned long CCRCCheck::Reflect (unsigned long crc, int bitnum) { // reflects the lower 'bitnum' bits of 'crc' unsigned long i, j=1, crcout=0; for (i=(unsigned long)1<<(bitnum-1); i; i>>=1) { if (crc & i) crcout|=j; j<<= 1; } return (crcout); }
a1e8191d825c00888694dff6f150a50973d30efc
1cfd777c6518b4e379f5fc50dfe5416f90c76abf
/src/boundaryScheme.hpp
9088c156c18f8dc8ff075a1cd24828d9ebe7c0cf
[]
no_license
juncas/NUC3d
931f27588ddca008ae66dccc791a259af7c6d605
47556e1d801c15dd864d2dcd0e76587350626147
refs/heads/master
2021-01-10T09:27:11.186430
2018-04-27T11:42:51
2018-04-27T11:42:51
44,386,549
9
1
null
null
null
null
UTF-8
C++
false
false
1,751
hpp
boundaryScheme.hpp
// // boundaryScheme.hpp // NUC3d // // Created by Jun Peng on 16/1/9. // Copyright © 2016年 Jun Peng. All rights reserved. // #ifndef boundaryScheme_hpp #define boundaryScheme_hpp #include <stdio.h> #include "fieldOperator.h" namespace nuc3d { class boundaryScheme: public differential { typedef void (boundaryScheme::*pBCscheme)(double *,double *,int &); public: pBCscheme myBCschemeL[4]={&boundaryScheme::firstOrderL, &boundaryScheme::secondOrder, &boundaryScheme::fourthOrder, &boundaryScheme::sixthOrder }; pBCscheme myBCschemeR[4]={&boundaryScheme::firstOrderR, &boundaryScheme::secondOrder, &boundaryScheme::fourthOrder, &boundaryScheme::sixthOrder }; boundaryScheme(); ~boundaryScheme(); // 6th order central difference functions void differentialInner(const Field &, Field &, const int); void differentialBoundaryL(const Field &, const Field &, Field &, const int); void differentialBoundaryR(const Field &, const Field &, Field &, const int); private: void firstOrderL(double *,double *,int &); void firstOrderR(double *,double *,int &); void secondOrder(double *,double *,int &); void fourthOrder(double *,double *,int &); void sixthOrder(double *,double *,int &); }; } #endif /* boundaryScheme_hpp */
2fbcc203cc158a91b7cfba9d92248722dc9b486a
ecaa8d976ca35082d38bca8df2109249574ac43d
/src/CJsonValidatorAdapter.hpp
9c69aa6981f9d2dc74798f7b63ffa40676737078
[]
no_license
isergeyam/Kingdom-Fall
98335060f54c304860beeba959b053c8c22ce7ca
b91c209c229919d4c638cddeca08c683999068ba
refs/heads/master
2021-04-06T20:43:58.887742
2018-05-20T00:51:25
2018-05-20T00:51:25
125,379,046
0
0
null
null
null
null
UTF-8
C++
false
false
254
hpp
CJsonValidatorAdapter.hpp
// // Created by sg on 18.04.18. // #pragma once #include "json-validator.hpp" #include <istream> class CJsonValidatorAdapter { private: json_validator m_validator; public: void set_schema(const json &val); void validate(const json &obj_); };
3c32e2311e6484a6ba248f51f7275cd5817bb04d
54a14840a27f8f955ea0b9ff79e3ef3d84465e9f
/Recursion/Fibonacci.cpp
e73fe24da091f9b4f7017ee20fa7f1ce0c86eec6
[]
no_license
guptavarun619/Data-Structure
5cea85e5d6ff5bfc71b33d9ff42068634c4c23bf
ee6141b5a2541dce1e4675db079e322b1537124f
refs/heads/master
2023-06-23T14:37:39.513019
2021-07-21T07:00:07
2021-07-21T07:00:07
251,252,265
0
0
null
2020-07-19T03:08:21
2020-03-30T08:58:53
C++
UTF-8
C++
false
false
400
cpp
Fibonacci.cpp
// 0, 1, 1, 2, 3, 5, 8 .... // 0, 1, 2, 3, 4, 5, 6th // Place /\ #include<iostream> using namespace std; int fibo(int n) { if(n == 0) return 0; else if (n == 1) return 1; else return fibo(n-1) + fibo(n-2); } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); #endif int n; cin >> n; cout << fibo(n); return 0; }
40dfbcdb8982feaec61429180a20aab8571e3cd0
2370dbd731ec6da5a3791932043c39a97d5acaa2
/lut/assets/project/src/Foo.cpp
6f5ac6792ba8d60ba2ed5f4fe3324acf0b521eb6
[ "MIT" ]
permissive
lubyk/lut
1583c9016c532d19c38bb94d2433bde1904e0d03
2e7b8859e852316390821bb1fca8b7f8bf80a5dd
refs/heads/master
2020-04-15T11:37:41.267549
2015-05-11T13:06:54
2015-05-11T14:15:51
8,930,893
2
0
null
2013-04-03T00:57:22
2013-03-21T14:42:03
Lua
UTF-8
C++
false
false
97
cpp
Foo.cpp
#include "{{type}}/Foo.h" using namespace {{type}}; float Foo::doSomething() { return 1.0; }
94e4161adbc3950613bad3b1bcc828e3f4c4ea93
792367914f4b3aae9eac8e0ece52dfbd0ecb5f8a
/MFCApplication1Dlg.h
4b0dca00a63a1a1acf7d77b1d9178d2407a138f4
[]
no_license
marcozille/Various
2169d1a3c7a331e7fbd5af6fe6b697cedff15724
3e8d305a76d1200a762ffe71b0f1ea7975832599
refs/heads/master
2016-08-03T03:20:40.199070
2013-09-04T12:05:45
2013-09-04T12:05:54
12,455,245
1
1
null
null
null
null
UTF-8
C++
false
false
1,120
h
MFCApplication1Dlg.h
// MFCApplication1Dlg.h : file di intestazione // #pragma once #include "afxwin.h" #include "MDVSEdit.h" // finestra di dialogo CMFCApplication1Dlg class CMFCApplication1Dlg : public CDialogEx { // Costruzione public: CMFCApplication1Dlg(CWnd* pParent = NULL); // costruttore standard // Dati della finestra di dialogo enum { IDD = IDD_MFCAPPLICATION1_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // supporto DDX/DDV // Implementazione protected: HICON m_hIcon; HWND m_hWndHoveredControl; // Funzioni generate per la mappa dei messaggi virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: CMDVSEdit M_EDT; virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); LRESULT OnSetColors(HDC hDC, HWND hWnd); afx_msg BOOL OnEraseBkgnd(CDC* pDC); CMDVSEdit m_edt2; CMDVSEdit m_edt3; CMDVSEdit m_edt4; afx_msg void OnMove(int x, int y); afx_msg void OnMouseMove(UINT nFlags, CPoint point); virtual BOOL PreTranslateMessage(MSG* pMsg); };
26b6b5f4bb10696f7a24847d9ac31909d60346af
88ae8695987ada722184307301e221e1ba3cc2fa
/buildtools/third_party/libc++/trunk/test/std/iterators/predef.iterators/counted.iterator/iter_move.pass.cpp
1494a9d649980dde45af08ddec0733796c51a71c
[ "BSD-3-Clause", "NCSA", "MIT", "LLVM-exception", "Apache-2.0" ]
permissive
iridium-browser/iridium-browser
71d9c5ff76e014e6900b825f67389ab0ccd01329
5ee297f53dc7f8e70183031cff62f37b0f19d25f
refs/heads/master
2023-08-03T16:44:16.844552
2023-07-20T15:17:00
2023-07-23T16:09:30
220,016,632
341
40
BSD-3-Clause
2021-08-13T13:54:45
2019-11-06T14:32:31
null
UTF-8
C++
false
false
2,768
cpp
iter_move.pass.cpp
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // friend constexpr iter_rvalue_reference_t<I> // iter_move(const counted_iterator& i) // noexcept(noexcept(ranges::iter_move(i.current))) // requires input_iterator<I>; #include <iterator> #include "test_macros.h" #include "test_iterators.h" template<bool IsNoexcept> class HasNoexceptIterMove { int *it_; public: typedef std::input_iterator_tag iterator_category; typedef int value_type; typedef typename std::iterator_traits<int *>::difference_type difference_type; typedef int * pointer; typedef int & reference; constexpr int *base() const {return it_;} HasNoexceptIterMove() = default; explicit constexpr HasNoexceptIterMove(int *it) : it_(it) {} constexpr reference operator*() const noexcept(IsNoexcept) { return *it_; } constexpr HasNoexceptIterMove& operator++() {++it_; return *this;} constexpr HasNoexceptIterMove operator++(int) {HasNoexceptIterMove tmp(*this); ++(*this); return tmp;} }; constexpr bool test() { int buffer[8] = {1, 2, 3, 4, 5, 6, 7, 8}; { auto iter1 = cpp17_input_iterator<int*>(buffer); auto commonIter1 = std::counted_iterator<decltype(iter1)>(iter1, 8); assert(std::ranges::iter_move(commonIter1) == 1); ASSERT_SAME_TYPE(decltype(std::ranges::iter_move(commonIter1)), int&&); } { auto iter1 = forward_iterator<int*>(buffer); auto commonIter1 = std::counted_iterator<decltype(iter1)>(iter1, 8); assert(std::ranges::iter_move(commonIter1) == 1); ASSERT_SAME_TYPE(decltype(std::ranges::iter_move(commonIter1)), int&&); } { auto iter1 = random_access_iterator<int*>(buffer); auto commonIter1 = std::counted_iterator<decltype(iter1)>(iter1, 8); assert(std::ranges::iter_move(commonIter1) == 1); ASSERT_SAME_TYPE(decltype(std::ranges::iter_move(commonIter1)), int&&); } // Test noexceptness. { static_assert( noexcept(std::ranges::iter_move(std::declval<std::counted_iterator<HasNoexceptIterMove<true>>>()))); static_assert(!noexcept(std::ranges::iter_move(std::declval<std::counted_iterator<HasNoexceptIterMove<false>>>()))); } return true; } int main(int, char**) { test(); static_assert(test()); return 0; }
2a61617d11b5dcf28566d0706c2316eb539fa7c9
095fe9acd81d382c9543150495254bdf08a28cc6
/dial.cpp
6d229d1c93e0a7c54508d5b8223377a3857c97f5
[]
no_license
fwmiller/openglDial
96d3fc0d6fa32986fdd5cca3a8230753ac0e67f6
c4a24bfd86dc9ac4fdc362721471fe8f80fc13fe
refs/heads/master
2020-04-06T12:30:07.963708
2018-12-25T22:50:50
2018-12-25T22:50:50
157,458,102
0
0
null
null
null
null
UTF-8
C++
false
false
2,873
cpp
dial.cpp
#include <GL/glut.h> #include <math.h> static int windowWidth = 800; static int windowHeight = 800; static GLfloat x; static GLfloat y; static GLfloat z; static GLfloat radius; static GLint numberOfSides; static GLfloat pos = 0.0; void DisplayNeedle() { GLfloat twicePi = 2.0f * M_PI; glColor3f(0, 0.5, 0.5); glLineWidth(64); glEnable(GL_LINE_SMOOTH); glBegin(GL_LINES); glVertex3f(0.0, 0.0, 0.0); glVertex3f(radius * 0.92 * cos(pos * twicePi), radius * 0.92 * sin(pos * twicePi), 0.0); glEnd(); glFlush(); } void DisplayDial() { int numberOfVertices = numberOfSides + 2; GLfloat twicePi = 2.0f * M_PI; GLfloat circleVerticesX[numberOfVertices]; GLfloat circleVerticesY[numberOfVertices]; GLfloat circleVerticesZ[numberOfVertices]; circleVerticesX[0] = x; circleVerticesY[0] = y; circleVerticesZ[0] = z; for ( int i = 1; i < numberOfVertices; i++ ) { circleVerticesX[i] = x + (radius * cos(i * twicePi / numberOfSides)); circleVerticesY[i] = y + (radius * sin(i * twicePi / numberOfSides)); circleVerticesZ[i] = z; } GLfloat allCircleVertices[( numberOfVertices ) * 3]; for ( int i = 0; i < numberOfVertices; i++ ) { allCircleVertices[i * 3] = circleVerticesX[i]; allCircleVertices[( i * 3 ) + 1] = circleVerticesY[i]; allCircleVertices[( i * 3 ) + 2] = circleVerticesZ[i]; } glClear(GL_COLOR_BUFFER_BIT); glColor3f(0.8, 0.8, 0.8); glEnableClientState( GL_VERTEX_ARRAY ); glVertexPointer( 3, GL_FLOAT, 0, allCircleVertices ); glDrawArrays( GL_TRIANGLE_FAN, 0, numberOfVertices); glDisableClientState( GL_VERTEX_ARRAY ); for ( int i = 1; i < numberOfVertices; i++ ) { circleVerticesX[i] = x + (radius * 0.92 * cos(i * twicePi / numberOfSides)); circleVerticesY[i] = y + (radius * 0.92 * sin(i * twicePi / numberOfSides)); circleVerticesZ[i] = z; } for ( int i = 0; i < numberOfVertices; i++ ) { allCircleVertices[i * 3] = circleVerticesX[i]; allCircleVertices[( i * 3 ) + 1] = circleVerticesY[i]; allCircleVertices[( i * 3 ) + 2] = circleVerticesZ[i]; } glColor3f(0.95, 0.95, 0.95); glEnableClientState( GL_VERTEX_ARRAY ); glVertexPointer( 3, GL_FLOAT, 0, allCircleVertices ); glDrawArrays( GL_TRIANGLE_FAN, 0, numberOfVertices); glDisableClientState( GL_VERTEX_ARRAY ); } void DisplayGauge() { DisplayDial(); DisplayNeedle(); glFlush(); } void TimerEvent(int te) { /* Update needle position */ pos += 0.02; if (pos > 1.0) pos = 0.0; glutPostRedisplay(); glutTimerFunc(20, TimerEvent, 1); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE); glutInitWindowSize(windowWidth, windowHeight); glutInitWindowPosition(100, 100); glutCreateWindow("Dial"); x = 0.0; y = 0.0; z = 0.0; radius = 0.75; numberOfSides = 256; glutDisplayFunc(DisplayGauge); glutTimerFunc(20, TimerEvent, 1); glutMainLoop(); return 0; }
c2417fff53eb54caa3b1b34cebed9f67b2218591
f81ce7b39b4af9b233db8061cad4e312582e2420
/src/pddl/instance.cc
8fb148c06256b2a8af04a1014a6e3cfe98dbb58e
[]
no_license
lillanes/pddl_parser
6debb2fe0486b80784f9f4fe8e2514370d83675d
5a3d7810059391657325d31bb1b160528390a40c
refs/heads/master
2022-12-24T03:02:26.306503
2020-09-30T21:23:11
2020-09-30T21:23:11
218,558,219
0
0
null
null
null
null
UTF-8
C++
false
false
2,420
cc
instance.cc
#include <iterator> #include <map> #include <set> #include <utility> #include <pddl_parser/instance.hh> namespace pddl_parser { void Instance::set_name(std::string &&name) { this->name = std::move(name); } void Instance::set_domain_name(std::string &&domain_name) { this->domain_name = std::move(domain_name); } void Instance::set_requirements(std::deque<std::string> &&requirements) { this->requirements = std::unordered_set<std::string>( std::make_move_iterator(requirements.begin()), std::make_move_iterator(requirements.end())); } void Instance::set_objects(std::deque<TypedName> &&objects) { for (TypedName &object : objects) { std::string key(object.name); this->objects[key] = std::move(object); } } void Instance::add_init_predicate(std::string &&name, std::deque<std::string> &&parameters) { init.add_predicate(std::move(name), std::move(parameters)); } void Instance::add_init_function(std::string &&name, std::deque<std::string> &&parameters, double value) { init.add_function(std::move(name), std::move(parameters), value); } void Instance::set_goal(Condition &&goal) { this->goal = std::move(goal); } std::ostream& operator<<(std::ostream &stream, Instance const &instance) { stream << "( define ( problem " << instance.name << " )" << std::endl; stream << " ( :domain " << instance.domain_name << " )" << std::endl; if (!instance.requirements.empty()) { stream << " ( :requirements "; std::set<std::string> ordered_requirements( instance.requirements.begin(), instance.requirements.end()); for (auto const &r : ordered_requirements) { stream << r << " "; } stream << ")" << std::endl; } stream << " ( :objects"; std::map<std::string,TypedName> ordered_objects(instance.objects.begin(), instance.objects.end()); for (auto const &o : ordered_objects) { stream << std::endl << " " << o.second; } stream << " )" << std::endl; stream << " ( :init"; stream << instance.init << " )" << std::endl; stream << " ( :goal " << instance.goal << " )" << std::endl; stream << " )" << std::endl; return stream; } } // namespace pddl_parser
d3b5e48a820df5c2b3e69a2c9c3b8575ed644c60
3753588aa125026f994a99421ad67fc40bbe574c
/src/Geometry/Vector3.cpp
c609b8ab3c6f5fb0c10766ee961d0046a1608d86
[]
no_license
peterix/Khazad
1cda26c34c91bdaa6cfe214f85b3a96d8d1024cf
6849bbf69d10c8ce73a822f3033556a6537db908
refs/heads/master
2021-01-04T14:45:36.818935
2020-02-14T21:10:43
2020-02-14T21:13:24
240,596,045
0
0
null
2020-02-14T20:48:32
2020-02-14T20:48:32
null
UTF-8
C++
false
false
2,957
cpp
Vector3.cpp
#include <stdafx.h> #include <Vector3.h> Vector3::Vector3( float x_, float y_, float z_ ) { x = x_; y = y_; z = z_; } Vector3::~Vector3() { } void Vector3::set( float x_, float y_, float z_ ) { x = x_; y = y_; z = z_; } float Vector3::length( void ) { return((float) sqrt( x * x + y * y + z * z )); } void Vector3::normalize( void ) { float fLength = length(); x = x / fLength; y = y / fLength; z = z / fLength; } // Static utility methods... static float distance( const Vector3 &v1, const Vector3 &v2 ) { float dx = v1.x - v2.x; float dy = v1.y - v2.y; float dz = v1.z - v2.z; return (float)sqrt( dx * dx + dy * dy + dz * dz ); } static float dotProduct( const Vector3 &v1, const Vector3 &v2 ) { return( v1.x * v2.x + v1.y * v2.y + v1.z * v2.z ); } Vector3 Vector3::crossProduct( const Vector3 &other ) { Vector3 New; New.x = y * other.z - z * other.y; New.y = z * other.x - x * other.z; New.z = x * other.y - y * other.x; return New; } float Vector3::innerProduct( Vector3 &other ) { return (x * other.x + y * other.y + z * other.z); } // Operators... Vector3 Vector3::operator + ( const Vector3 &other ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = x + other.x; vResult.y = y + other.y; vResult.z = z + other.z; return vResult; } Vector3 Vector3::operator + ( void ) const { return *this; } Vector3 Vector3::operator - ( const Vector3 &other ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = x - other.x; vResult.y = y - other.y; vResult.z = z - other.z; return vResult; } Vector3 Vector3::operator - ( void ) const { Vector3 vResult(-x, -y, -z); return vResult; } Vector3 Vector3::operator * ( const Vector3 &other ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = x * other.x; vResult.y = y * other.y; vResult.z = z * other.z; return vResult; } Vector3 Vector3::operator * ( const float scalar ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = x * scalar; vResult.y = y * scalar; vResult.z = z * scalar; return vResult; } Vector3 operator * ( const float scalar, const Vector3 &other ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = other.x * scalar; vResult.y = other.y * scalar; vResult.z = other.z * scalar; return vResult; } Vector3 Vector3::operator / ( const Vector3 &other ) { Vector3 vResult(0.0f, 0.0f, 0.0f); vResult.x = x / other.x; vResult.y = y / other.y; vResult.z = z / other.z; return vResult; } Vector3& Vector3::operator = ( const Vector3 &other ) { x = other.x; y = other.y; z = other.z; return *this; } Vector3& Vector3::operator += ( const Vector3 &other ) { x += other.x; y += other.y; z += other.z; return *this; } Vector3& Vector3::operator -= ( const Vector3 &other ) { x -= other.x; y -= other.y; z -= other.z; return *this; }
602264e8f8152fcf5a1eb0576b1cbda15e39633b
cc62d037a96ddd95cc3fb1af33455076c35a561a
/APA/Maxima Cobertura/main.cpp
b0b70cbfcc4eedc3d5a44221d83e1742db332a70
[]
no_license
gabrielgoncalves95/UFPB
5c444ac77c2627804b1cc80fe27944277b22dbb3
354597af3374f110a6c822f51ed1b7ccc3b58a66
refs/heads/master
2020-04-29T11:54:33.252903
2019-03-17T15:05:40
2019-03-17T15:05:40
176,117,713
1
0
null
null
null
null
ISO-8859-1
C++
false
false
18,519
cpp
main.cpp
#include <iostream> #include <fstream> #include <vector> #include <map> #include <math.h> #include <climits> #include <cstdlib> #include <time.h> #include "include/Conjunto.h" #define ALPHA 0.75 #define GRASP_ITERACOES 15 using namespace std; // Função que carrega a instância no vetor de objetos vector <Conjunto> CarregaArquivo(string arquivo, int *range, int *facilidades) { ifstream file; try { file.open(arquivo, ios::in); Conjunto auxiliar; vector <Conjunto> retorno; file >> (*facilidades) >> (*range); while (!file.eof()) { file >> auxiliar.coord_x >> auxiliar.coord_y; auxiliar.visitado = false; auxiliar.facilidade = false; retorno.push_back(auxiliar); } return retorno; } catch (bad_alloc& e) { cerr << "Erro ao tentar acessar arquivo!" << endl; } } //Função geradora de solução com fator de aleatoriedade void Heuristica_Construtora_Grasp (int facilidades, int range, vector <Conjunto> &pontos, vector <int> *solucao) { for (int i = 0; i < facilidades; i++) { //cout << "Gerando solucao da facilitadora: " << i << endl; //Esse vetor vai salvar o numero de nós que cada nó consegue cobrir caso ele fosse uma facilitadora map <int, int> cobertura; map <int, int>::iterator it; int valor_cobertura = 0; //gera vetor com quantidade de nós que cada nó cobre for (int k = 0; k < pontos.size(); k++) { valor_cobertura = 0; for (int l = 0; l < pontos.size(); l++) { if(pontos[k].visitado == false) { //Calculo da hipotenusa para a distância entre dois pontos no plano 2D float distancia = sqrt(pow((pontos[k].coord_x - pontos[l].coord_x), 2) + pow((pontos[k].coord_y - pontos[l].coord_y), 2)); //Se o nó analisado estiver dentro do range, incrementa o vetor correspondente if (distancia <= range) valor_cobertura++; } } cobertura.insert(make_pair(valor_cobertura, k)); } int maior_cobertura = 0, menor_cobertura = INT_MAX; int no_maior, no_menor; //pesquisa e salva no vetor, os nós com a maior e a menor cobertura for (it = cobertura.end(); it != cobertura.begin(); it--){ if(it->first > maior_cobertura && pontos[it->second].visitado == false){ maior_cobertura = it->first; no_maior = it->second; break; } if(it->first < menor_cobertura && pontos[it->second].visitado == false){ menor_cobertura = it->first; no_menor = it->second; } } //a variável terá influencia na geração da solucao int valor_intermediario = (menor_cobertura + (maior_cobertura - menor_cobertura)) *ALPHA; int contador = 0; int random = 0; for (it = cobertura.end(); it != cobertura.begin(); it--){ contador ++; if(it->first <= valor_intermediario){ random = rand()%contador; advance(it, random); break; } } //Gera um valor aleatório entre o primeiro e ultimo nó int nova_facilidade = it->second; //achado um elemento que satisfaça a condição de parada, ele é adicionada a solucao como facilitadora (sempre o primeiro) solucao[i].push_back(nova_facilidade); pontos[nova_facilidade].facilidade = true; //e marcado como facilidade pontos[nova_facilidade].visitado = true; //e visitado //Então adicionada a facilitadora, os demais pontos que estao cobertos pelo seu range e que não pertencerem à uma solução prévia sao adicionados à solução for (int j = 0; j < pontos.size(); j++) { if (pontos[j].visitado == false) { float distancia = sqrt(pow((pontos[nova_facilidade].coord_x - pontos[j].coord_x), 2) + pow((pontos[nova_facilidade].coord_y - pontos[j].coord_y), 2)); if (distancia <= range) { solucao[i].push_back(j); pontos[j].visitado = true; } } } } } //Função geradora de solução void Heuristica_Construtora_Gulosa (int facilidades, int range, vector <Conjunto> &pontos, vector <int> *solucao) { for (int i = 0; i < facilidades; i++) { //cout << "Gerando solucao da facilitadora: " << i << endl; //Esse vetor vai salvar o numero de nós que cada nó consegue cobrir caso ele fosse uma facilitadora int cobertura[pontos.size()]; //Inicializa o vetor com 0 para todos os valores for (int j = 0; j < pontos.size(); j++) { cobertura[j] = 0; } for (int k = 0; k < pontos.size(); k++) { for (int l = 0; l < pontos.size(); l++) { if(pontos[k].visitado == false) { //Calculo da hipotenusa para a distância entre dois pontos no plano 2D float distancia = sqrt(pow((pontos[k].coord_x - pontos[l].coord_x), 2) + pow((pontos[k].coord_y - pontos[l].coord_y), 2)); //Se o nó analisado estiver dentro do range, incrementa o vetor correspondente if (distancia <= range) cobertura[k]++; } } } int maior_cobertura = 0; int nova_facilidade; //pesquisa e salva no vetor, os nós com a maior e a menor cobertura for (int j = 0; j < pontos.size(); j++) { if(cobertura[j] > maior_cobertura && pontos[j].visitado == false) { maior_cobertura = cobertura[j]; nova_facilidade = j; } } //achado o elemento de maior cobertura, ele é adicionada a solucao como facilitadora (sempre o primeiro) solucao[i].push_back(nova_facilidade); pontos[nova_facilidade].facilidade = true; //e marcado como facilidade pontos[nova_facilidade].visitado = true; //e visitado //Então adicionada a facilitadora, os demais pontos que estao cobertos pelo seu range e que não pertencerem à uma solução prévia sao adicionados à solução for (int j = 0; j < pontos.size(); j++) { if (pontos[j].visitado == false) { float distancia = sqrt(pow((pontos[nova_facilidade].coord_x - pontos[j].coord_x), 2) + pow((pontos[nova_facilidade].coord_y - pontos[j].coord_y), 2)); if (distancia <= range) { solucao[i].push_back(j); pontos[j].visitado = true; } } } } } //Função de movimentação que busca uma nova facilidade a partir dos nós que sobraram (não foram visitados e nem são facilidades) void Movimentacao_Local (int facilidades, int range, vector <Conjunto> &pontos, vector <int> *solucao) { for (int i = 0; i < facilidades; i++) { //remove a facilidade i do conjunto de soluções pontos[solucao[i][0]].facilidade = false; for (int j = 0; j < solucao[i].size(); j++) { //limpa completamente o conjunto de nós cobertos pela facilidade i pontos[solucao[i][j]].visitado = false; } solucao[i].clear(); //Esse vetor vai salvar o numero de nós que cada nó consegue cobrir caso ele fosse uma facilitadora int cobertura[pontos.size()]; //Inicializa o vetor com 0 para todos os valores for (int j = 0; j < pontos.size(); j++) { cobertura[j] = 0; } for (int k = 0; k < pontos.size(); k++) { if (pontos[k].visitado == false) { for (int l = 0; l < pontos.size(); l++) { if(pontos[k].visitado == false) { //Calculo da hipotenusa para a distância entre dois pontos no plano 2D float distancia = sqrt(pow((pontos[k].coord_x - pontos[l].coord_x), 2) + pow((pontos[k].coord_y - pontos[l].coord_y), 2)); //Se o nó analisado estiver dentro do range, incrementa o map correspondente if (distancia <= range) cobertura[k]++; } } } } int maior_cobertura = 0; int nova_facilidade; //pesquisa e salva no vetor, os nós com a maior e a menor cobertura for (int j = 0; j < pontos.size(); j++) { if(cobertura[j] > maior_cobertura && pontos[j].visitado == false) { maior_cobertura = cobertura[j]; nova_facilidade = j; } } //achado o elemento de maior cobertura, ele é adicionada a solucao como facilitadora (sempre o primeiro) solucao[i].push_back(nova_facilidade); pontos[nova_facilidade].facilidade = true; //e marcado como facilidade pontos[nova_facilidade].visitado = true; //e visitado //Então adicionada a facilitadora, os demais pontos que estao cobertos pelo seu range e que não pertencerem à uma solução prévia sao adicionados à solução for (int j = 0; j < pontos.size(); j++) { if (pontos[j].visitado == false) { float distancia = sqrt(pow((pontos[nova_facilidade].coord_x - pontos[j].coord_x), 2) + pow((pontos[nova_facilidade].coord_y - pontos[j].coord_y), 2)); if (distancia <= range) { solucao[i].push_back(j); pontos[j].visitado = true; } } } } } //Função de movimentação que busca uma nova facilidade em todos os nós, exceto os que já são facilidades void Movimentacao_Global (int facilidades, int range, vector <Conjunto> &pontos, vector <int> *solucao) { for (int i = 0; i < facilidades; i++) { //remove a facilidade i do conjunto de soluções pontos[solucao[i][0]].facilidade = false; for (int j = 0; j < solucao[i].size(); j++) { //limpa completamente o conjunto de nós cobertos pela facilidade i pontos[solucao[i][j]].visitado = false; } solucao[i].clear(); //Esse vetor vai salvar o numero de nós que cada nó consegue cobrir caso ele fosse uma facilitadora int cobertura[pontos.size()]; //Inicializa o mapa com 0 para todos os valores for (int j = 0; j < pontos.size(); j++) { cobertura[j] = 0; } for (int k = 0; k < pontos.size(); k++) { if (pontos[k].facilidade == false) { for (int l = 0; l < pontos.size(); l++) { if(pontos[l].visitado == false) { //Calculo da hipotenusa para a distância entre dois pontos no plano 2D float distancia = sqrt(pow((pontos[k].coord_x - pontos[l].coord_x), 2) + pow((pontos[k].coord_y - pontos[l].coord_y), 2)); //Se o nó analisado estiver dentro do range, incrementa o map correspondente if (distancia <= range) cobertura[k]++; } } } } int maior_cobertura = 0; int nova_facilidade; //pesquisa e salva no map, os nós com a maior e a menor cobertura for (int j = 0; j < pontos.size(); j++) { if(cobertura[j] > maior_cobertura && pontos[j].visitado == false) { maior_cobertura = cobertura[j]; nova_facilidade = j; } } //remove a facilidade da solução if (pontos[nova_facilidade].visitado == true) { for (int j = 0; j < facilidades; j++) { for (int k = 0; k < solucao[j].size(); k++) { if(solucao[j][k] == nova_facilidade) { //remove a nova facilidade de uma solução prévia caso esse ponto já tenha sido mapeado solucao[j].erase(solucao[j].begin() + k); pontos[nova_facilidade].visitado = false; break; } } } } //achado o elemento de maior cobertura, ele é adicionada a solucao como facilitadora (sempre o primeiro) solucao[i].push_back(nova_facilidade); pontos[nova_facilidade].facilidade = true; //e marcado como facilidade pontos[nova_facilidade].visitado = true; //e visitado //Então adicionada a facilitadora, os demais pontos que estao cobertos pelo seu range e que não pertencerem à uma solução prévia sao adicionados à solução for (int j = 0; j < pontos.size(); j++) { if (pontos[j].visitado == false) { float distancia = sqrt(pow((pontos[nova_facilidade].coord_x - pontos[j].coord_x), 2) + pow((pontos[nova_facilidade].coord_y - pontos[j].coord_y), 2)); if (distancia <= range) { solucao[i].push_back(j); pontos[j].visitado = true; } } } } } //Função que executa o VND(Variable Neighborhood Descent) int VND (int facilidades, int range, vector <Conjunto> pontos, vector <int> *solucao) { vector <Conjunto> solucao_inicial = pontos; int solucao1_valor = 0; //Geração de uma solução inicial qualquer Heuristica_Construtora_Grasp(facilidades, range, solucao_inicial, solucao); //salva o numero de pontos que foram cobertos pela solução inicial for (int i = 0; i < facilidades; i++) { solucao1_valor += solucao[i].size() - 1; } //cout << "Solucao 1: " << solucao1_valor << endl; //Contante do VND que representa o numero de movimentações sem sucesso sucessivas máximas que podem ser feitas int k = 0; while (k < 2) { vector <int> solucao_candidata [facilidades]; for (int i = 0; i < facilidades; i++) { solucao_candidata[i] = solucao[i]; } vector <Conjunto> pontos_candidatos = solucao_inicial; int solucao2_valor = 0; //Verifica o numero de erros consecutivos, se foi baixo, efetua uma movimentação local, se foi alto, uma movimentação global if (k == 0) { //cout << "Fazendo movimentacao local!" << endl; Movimentacao_Local(facilidades, range, pontos_candidatos, solucao_candidata); } else { //cout << "Fazendo movimentacao global!" << endl; Movimentacao_Global(facilidades, range, pontos_candidatos, solucao_candidata); } //salva o numero de pontos que foram cobertos pela solução candidata for (int i = 0; i < facilidades; i++) { solucao2_valor += solucao_candidata[i].size() - 1; } if (solucao2_valor > solucao1_valor) { for (int i = 0; i < facilidades; i++) { solucao[i] = solucao_candidata[i]; } solucao_inicial = pontos_candidatos; solucao1_valor = solucao2_valor; k = 0; //cout << "melhorou!" << endl; //cout << "Solucao nova: " << solucao2_valor << endl; } else { k++; } } return solucao1_valor; } //Meta-heurística Grasp void Grasp (int facilidades, int range, vector <Conjunto> pontos, vector <int> *solucao_final){ //usa o tempo atual como semente da randomização time_t tempo; srand(time(&tempo)); //gera primeira solução com VND, usando fator de randomicidade ALPHA int valor_final = VND(facilidades, range, pontos, solucao_final); cout << "\nEncontrou solucao de cobertura: " << valor_final << endl; //Inicia o loop do Grasp for (int i = 0; i < GRASP_ITERACOES; i++){ vector <int> solucao_candidata [facilidades]; //Procura uma nova solução aleatória e faz movimento de vizinhança pra melhorar int valor_candidato = VND(facilidades, range, pontos, solucao_candidata); cout << "\nEncontrou solucao de cobertura: " << valor_candidato << endl; //Se a solução for melhor que a anterior, troca, se não, mantém if (valor_candidato > valor_final){ for (int j = 0; j < facilidades; j++){ solucao_final[j] = solucao_candidata[j]; } cout << "\nTrocando! " << valor_final << " -> " << valor_candidato << endl; valor_final = valor_candidato; } } } int main() { vector <Conjunto> pontos; int range, facilidades; //Carrega arquivo no vector de objetos "pontos" pontos = CarregaArquivo("instancia324.txt", &range, &facilidades); vector <int> solucao[facilidades]; clock_t tempo = clock(); Grasp(facilidades, range, pontos, solucao); //Heuristica_Construtora_Gulosa(facilidades, range, pontos, solucao); //Heuristica_Construtora_Grasp(facilidades, range, pontos, solucao); cout << "\nDuracao da execucao: " << (clock() - tempo) / (double)CLOCKS_PER_SEC << " segundos." << endl; cout << "\nSOLUCAO: " << endl; int cobertura = 0; for(int i = 0; i < facilidades; i++) { /*cout << "\n\nFacilidade no ponto: " << solucao[i][0] << " \nDe coordenadas: (" <<pontos[ ((solucao[i])[0]) ].coord_x << ", " << pontos[ ((solucao[i])[0]) ].coord_y << ")\nPontos Cobertos pela Facilidade: "; for(int j = 1; j < solucao[i].size(); j++) { cout<< ((solucao[i])[j]) << ", "; }*/ cobertura += (solucao[i]).size()-1; } cout << "\n\nTotal obtido: "<< cobertura <<" pontos cobertos!\n"; return 0; }
358ca63014f563b37b0ca9a8d9948c008a6cc0b5
435bea0ce60f07d6f8191db28873e621e1fb2aac
/bvh.cpp
82c8ed7ecf87988a182256713b38615106e04452
[]
no_license
lizardxcc/ray_tracer
cc5efc118291ba3aa7a0f4576186cf7364713437
c8a6d3e20befddd22e844a15bf6ce42f7eba520a
refs/heads/master
2022-04-10T13:04:18.853141
2020-03-18T07:53:55
2020-03-18T07:53:55
183,452,178
2
0
null
null
null
null
UTF-8
C++
false
false
6,431
cpp
bvh.cpp
#include <algorithm> #include <assert.h> #include "bvh.h" //bool box_x_compare(const Hittable& a, const Hittable& b); //bool box_y_compare(const Hittable& a, const Hittable& b); //bool box_z_compare(const Hittable& a, const Hittable& b); bool box_x_compare(const std::shared_ptr<Hittable> a, const std::shared_ptr<Hittable> b) { AABB box_left, box_right; if (!a->BoundingBox(box_left) || !b->BoundingBox(box_right)) { std::cerr << "no bounding box in box_x_compare()" << std::endl; } return (box_left.center.x() < box_right.center.x()); } bool box_y_compare(const std::shared_ptr<Hittable> a, const std::shared_ptr<Hittable> b) { AABB box_left, box_right; if (!a->BoundingBox(box_left) || !b->BoundingBox(box_right)) { std::cerr << "no bounding box in box_x_compare()" << std::endl; } return (box_left.center.y() < box_right.center.y()); } bool box_z_compare(const std::shared_ptr<Hittable> a, const std::shared_ptr<Hittable> b) { AABB box_left, box_right; if (!a->BoundingBox(box_left) || !b->BoundingBox(box_right)) { std::cerr << "no bounding box in box_x_compare()" << std::endl; } return (box_left.center.z() < box_right.center.z()); } BVHNode::BVHNode(std::vector<std::shared_ptr<Hittable> >& l) { int axis = int(3*drand48()); if (axis == 0) { std::sort(l.begin(), l.end(), box_x_compare); } else if (axis == 1) { std::sort(l.begin(), l.end(), box_y_compare); } else if (axis == 2) { std::sort(l.begin(), l.end(), box_z_compare); } if (l.size() == 1) { left = l[0]; right = l[0]; } else if (l.size() == 2) { left = l[0]; right = l[1]; } else { std::vector<std::shared_ptr<Hittable> > left_l(l.begin(), l.begin()+l.size()/2); std::vector<std::shared_ptr<Hittable> > right_l(l.begin()+l.size()/2, l.end()); left = std::shared_ptr<Hittable>(new BVHNode(left_l)); right = std::shared_ptr<Hittable>(new BVHNode(right_l)); } AABB box_left, box_right; if(!left->BoundingBox(box_left) || !right->BoundingBox(box_right)) { std::cerr << "no bounding box in BVHNode constructor\n" << std::endl; } box = SurroundingBox(box_left, box_right); } bool BVHNode::BoundingBox(AABB& b) const { b = box; return true; } bool BVHNode::Hit(const ray& r, double t_min, double t_max, HitRecord& rec) const { if (box.Hit(r, t_min, t_max)) { HitRecord left_rec, right_rec; bool hit_left = left->Hit(r, t_min, t_max, left_rec); bool hit_right = right->Hit(r, t_min, t_max, right_rec); if (hit_left && hit_right) { if (left_rec.t < right_rec.t) { rec = left_rec; } else { rec = right_rec; } return true; } else if (hit_left) { rec = left_rec; return true; } else if (hit_right) { rec = right_rec; return true; } else { return false; } } return false; } bool BVHNode::Occluded(const ray& r, double t_min, double t_max) const { if (box.Hit(r, t_min, t_max)) { bool hit_left = left->Occluded(r, t_min, t_max); if (hit_left) return true; bool hit_right = right->Occluded(r, t_min, t_max); if (hit_right) return true; } return false; } //void BVHNode::SetMaterial(std::shared_ptr<Material> mat) void BVHNode::SetMaterial(NodeMaterial *mat) { if (left != nullptr) left->SetMaterial(mat); if (right != nullptr) right->SetMaterial(mat); } SAHBVHNode::SAHBVHNode(void) { } SAHBVHNode::SAHBVHNode(std::vector<std::shared_ptr<Hittable>>& list) { assert(list.size() > 0); if (list.size() == 1) { left = list[0]; right = list[0]; assert(left->BoundingBox(box)); return; } else if (list.size() == 2) { left = list[0]; right = list[1]; AABB left_box; AABB right_box; assert(left->BoundingBox(left_box)); assert(right->BoundingBox(right_box)); box = SurroundingBox(left_box, right_box); return; } double best_cost = std::numeric_limits<double>::max(); int best_axis = -1; int best_split_index = -1; const double T_aabb = 1.0; const double T_triangle = 1.0; for (int axis = 0; axis < 3; axis++) { std::sort(list.begin(), list.end(), [axis](std::shared_ptr<Hittable>& h0, std::shared_ptr<Hittable>& h1){ AABB aabb0, aabb1; h0->BoundingBox(aabb0); h1->BoundingBox(aabb1); return (aabb0.center[axis] < aabb1.center[axis]); }); double all_surface_area; std::vector<double> surfaces_area_0(list.size()-1); std::vector<int> triangle_size_0(list.size()-1); std::vector<double> surfaces_area_1(list.size()-1); std::vector<int> triangle_size_1(list.size()-1); list[0]->BoundingBox(box); surfaces_area_0[0] = box.SurfaceArea(); triangle_size_0[0] = 1; for (int i = 1; i < list.size()-1; i++) { AABB tmp_box; list[i]->BoundingBox(tmp_box); box = SurroundingBox(box, tmp_box); surfaces_area_0[i] = box.SurfaceArea(); triangle_size_0[i] = triangle_size_0[i-1]+1; } list[list.size()-1]->BoundingBox(box); surfaces_area_1[list.size()-2] = box.SurfaceArea(); triangle_size_1[list.size()-2] = 1; for (int i = list.size()-3; i >= 0; i--) { AABB tmp_box; list[i]->BoundingBox(tmp_box); box = SurroundingBox(box, tmp_box); surfaces_area_1[i] = box.SurfaceArea(); triangle_size_1[i] = triangle_size_1[i+1] + 1; } { AABB tmp_box; list[0]->BoundingBox(tmp_box); this->box = SurroundingBox(box, tmp_box); all_surface_area = box.SurfaceArea(); } for (int i = 0; i < list.size()-1; i++) { double cost = T_aabb + surfaces_area_0[i]/all_surface_area * triangle_size_0[i] * T_triangle + surfaces_area_1[i]/all_surface_area * triangle_size_1[i] * T_triangle; if (cost < best_cost) { best_cost = cost; best_axis = axis; best_split_index = i; } } } std::vector<std::shared_ptr<Hittable>> polygons0, polygons1; if (best_axis == -1) { assert(false); } std::sort(list.begin(), list.end(), [best_axis](std::shared_ptr<Hittable>& h0, std::shared_ptr<Hittable>& h1){ AABB aabb0, aabb1; h0->BoundingBox(aabb0); h1->BoundingBox(aabb1); return (aabb0.center[best_axis] < aabb1.center[best_axis]); }); std::copy(list.begin(), list.begin() + best_split_index+1, std::back_inserter(polygons0)); std::copy(list.begin()+best_split_index+1, list.end(), std::back_inserter(polygons1)); left = std::shared_ptr<Hittable>(new SAHBVHNode(polygons0)); right = std::shared_ptr<Hittable>(new SAHBVHNode(polygons1)); AABB box_left, box_right; assert(left->BoundingBox(box_left)); assert(right->BoundingBox(box_right)); box = SurroundingBox(box_left, box_right); }
ba71a250b4f804cfe42d68986ea306025367fb2c
02249b7efb396c5ab9d62810e5cec8a50258764c
/Project4/NP_4/httpServer.cpp
af8178dfbdfaf544f3b428bf6f5dafe4f13fd959
[]
no_license
tnmichael309/Network-Programming
6e56b54df8aabddd01a979c062ce4a9d8c77be0d
d523c24e4bf9ec413798b2d61e7010970e1e4e01
refs/heads/master
2016-09-05T09:18:03.361368
2015-06-02T02:29:36
2015-06-02T02:29:36
33,771,644
2
0
null
null
null
null
UTF-8
C++
false
false
5,203
cpp
httpServer.cpp
#include "httpServer.h" static void splitString(string originalString, vector<string>& resultString){ stringstream ss(originalString); string subString; while(getline(ss,subString,'&')) // divide string by '&' resultString.push_back(subString); return; } int server::staticListenerD = 0; void copyStringToCharArray(string s, char* c){ int size = s.length()+1 > 1024 ? 1023 : s.length(); for(int i = 0; i < size; i++){ c[i] = s[i]; } c[size] = '\0'; } void server::handleShutdown(int sig){ if(staticListenerD) close(staticListenerD); exit(0); } void server::handleClientClosed(int sig){ if(staticListenerD) close(staticListenerD); } void server::sigchldHandler(int sig){ int status; wait(&status); } server::server(){;} server::~server(){;} void server::start(int port) { // create listener socket if(catchSignal(SIGINT, server::handleShutdown) == -1) error("Can't set the SIGINT handler"); if(catchSignal(SIGPIPE, server::handleClientClosed) == -1) error("Can't set the SIGPIPE pipe handler"); if(catchSignal(SIGCHLD, SIG_IGN) == -1) cerr << "Can't set the SIGCHLD handler" << endl; staticListenerD = openListenerSocket(); bindToPort(staticListenerD, port); if(listen(staticListenerD, 30) < 0) error("Can't listen"); struct sockaddr_in client_addr; /* the from address of a client*/ unsigned int address_size = sizeof(client_addr); cout << "Start listen" << endl; while(1){ int newsockfd = accept(staticListenerD, (struct sockaddr *) &client_addr, (socklen_t*)&address_size); //cout << newsockfd << endl; // no new socket received if (newsockfd < 0){ close(newsockfd); continue; } int childpid; if ( (childpid = fork()) < 0) cerr << "server: fork error" << endl; else if (childpid == 0) { // child process // process the request // ignore SIGCHLD signal(SIGCHLD, NULL); cout << "connected fd: " << newsockfd << endl; handleClient(newsockfd); if(staticListenerD) close(staticListenerD); exit(0); }else{// parent process // do nothing close(newsockfd); } } } void server::error(const char *msg) { cerr << msg << ": " << strerror(errno) << endl; exit(1); } int server::openListenerSocket() { int s = socket(AF_INET, SOCK_STREAM, 0); if(s == -1) error("Can't open socket"); return s; } void server::bindToPort(int socket, int port) { struct sockaddr_in name; name.sin_family = AF_INET; name.sin_port = (in_port_t)htons(port); name.sin_addr.s_addr = htonl(INADDR_ANY); int reuse = 1; if(setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(int)) == -1) error("Can't set the reuse option on the socket"); int c = bind(socket, (struct sockaddr *)&name, sizeof(name)); if(c == -1) error("Can't bind to socket"); } int server::catchSignal(int sig, void (*handler)(int)) { struct sigaction action; action.sa_handler = handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; return sigaction(sig, &action, NULL); } int server::handleClient(int sockfd) { int tempStdinFd = dup(0); int tempStdoutFd = dup(1); dup2(sockfd, 0); dup2(sockfd, 1); char buf[1024]; // deal with request string receiveMessage; string requestType; string queryString; if(recv(sockfd,buf,1024,0) > 0){ receiveMessage = string(buf); stringstream ss(receiveMessage); string subString; if(getline(ss,subString,'\n')) receiveMessage = subString; //cerr << receiveMessage << endl; stringstream sss(receiveMessage); if(getline(sss,subString,'/') && getline(sss,subString,' ')) requestType = subString; //cerr << requestType << endl; if(requestType.find(".htm")!=string::npos); else if(requestType.find("cgi")!=string::npos){ cerr << "original request: " << requestType << endl; stringstream ssss(requestType); getline(ssss,subString,'?'); requestType = subString; cerr << "new request: " << requestType << endl; getline(ssss,subString,' '); queryString = subString; cerr << "query string: " << queryString << endl; }else{ goto finish; } //cout << requestType << "\t" << queryString << endl; }else goto finish; if(requestType.find(".htm")!=string::npos){ // html request ifstream htmlFile(requestType.c_str()); string webpage = string("<!DOCTYPE html>"); if (htmlFile.is_open()) { char c; while (htmlFile.get(c)) // loop getting single characters webpage += c; htmlFile.close(); }else{ webpage = "<html><head>404 Not Found : Invalid web page requested.</head><body></body></html>"; } cout << webpage << endl; }else if(requestType.find("cgi")!=string::npos){ // cgi //cout << "<html>" << receiveMessage << "<br>" << requestType << "<br>" << queryString << "</html>" << endl; if(chdir("./CGI") != 0){ cerr << "Change working directory failed" << endl; exit(0); } setenv("PATH","CGI:.",1); setenv("QUERY_STRING", queryString.c_str(),1); int returnStatus = execvp(requestType.c_str(),NULL); if(returnStatus == -1) cerr << "Unknown command: [" << "cgi" << "]." << endl; }else; finish: dup2(tempStdinFd, 0); dup2(tempStdoutFd, 1); close(tempStdinFd); close(tempStdoutFd); }
53c62229a6e6394fa86733baa61fd3f0f8308f11
e65e6b345e98633cccc501ad0d6df9918b2aa25e
/Contests/Andrew Stankevich Contests/ASC13/A.cpp
5d52ded83f5f0f4ff1e6e1a74a18ef56572d321b
[]
no_license
wcysai/CodeLibrary
6eb99df0232066cf06a9267bdcc39dc07f5aab29
6517cef736f1799b77646fe04fb280c9503d7238
refs/heads/master
2023-08-10T08:31:58.057363
2023-07-29T11:56:38
2023-07-29T11:56:38
134,228,833
5
2
null
null
null
null
UTF-8
C++
false
false
2,136
cpp
A.cpp
#include<bits/stdc++.h> #define MAXN 205 #define INF 1000000000 #define MOD 1000000007 #define F first #define S second using namespace std; typedef long long ll; typedef pair<int,int> P; struct edge{ll to,cap,cost,rev;}; ll dist[MAXN],h[MAXN],prevv[MAXN],preve[MAXN]; ll V; vector<edge> G[MAXN]; void add_edge(ll from,ll to,ll cap,ll cost) { G[from].push_back((edge){to,cap,cost,(int)G[to].size()}); G[to].push_back((edge){from,0,-cost,(int)G[from].size()-1}); } ll min_cost_flow(ll s,ll t,ll f) { ll res=0; fill(h+1,h+V+1,0); while(f>0) { priority_queue<P,vector<P>,greater<P> >que; fill(dist+1,dist+V+1,INF); dist[s]=0; que.push(P(0,s)); while(!que.empty()) { P p=que.top(); que.pop(); ll v=p.S; if(dist[v]<p.F) continue; for(ll i=0;i<(int)G[v].size();i++) { edge &e=G[v][i]; if(e.cap>0&&dist[e.to]>dist[v]+e.cost+h[v]-h[e.to]) { dist[e.to]=dist[v]+e.cost+h[v]-h[e.to]; prevv[e.to]=v; preve[e.to]=i; que.push(P(dist[e.to],e.to)); } } } if(dist[t]==INF) return -1; for(ll v=1;v<=V;v++) h[v]+=dist[v]; ll d=f; for(ll v=t;v!=s;v=prevv[v]) d=min(d,G[prevv[v]][preve[v]].cap); f-=d; res+=d*h[t]; for(ll v=t;v!=s;v=prevv[v]) { edge &e=G[prevv[v]][preve[v]]; e.cap-=d; G[v][e.rev].cap+=d; } } return res; } ll n,k; ll w[MAXN][MAXN]; int main() { freopen("assignment.in","r",stdin); freopen("assignment.out","w",stdout); scanf("%lld%lld",&n,&k); for(ll i=1;i<=n;i++) for(ll j=1;j<=n;j++) scanf("%lld",&w[i][j]); ll s=2*n+1,t=2*n+2; V=2*n+2; for(ll i=1;i<=n;i++) for(ll j=1;j<=n;j++) add_edge(i,n+j,1,w[i][j]+2000); for(ll i=1;i<=n;i++) add_edge(s,i,k,0); for(ll i=1;i<=n;i++) add_edge(i+n,t,k,0); printf("%lld\n",min_cost_flow(s,t,k*n)-k*n*2000); }
767c55626db0693c087f671fbd0d9935190d8254
bdc4e54c9a76a6b51e8d60900b04ed55270a6eb8
/multiple3and5/multiple3and5.cpp
ca39d1716ff262ec55061e8a10d3346fe14b9cb0
[]
no_license
lmontigny/project_euler
1988ff0e1ecf6edbc5a310e4f15e3d0490d0c319
57f1be52e41e85adec810b0d8e60e0c54e2e20c8
refs/heads/master
2021-01-24T07:27:23.873368
2017-06-09T18:06:37
2017-06-09T18:06:37
93,343,861
0
0
null
null
null
null
UTF-8
C++
false
false
312
cpp
multiple3and5.cpp
// ConsoleApplication13.cpp : Defines the entry point for the console application. // #include <iostream> int main() { int sum=0; int limit = 1000; for(int i=1; i<limit; i++){ if (i%3==0 || i%5==0){ sum+=i; } } std::cout << sum << std::endl; return 0; }
607ebbf54dd239d1284dc263b60726f62e76c6ff
3f7028cc89a79582266a19acbde0d6b066a568de
/test/mocks/http/stream.h
c2001816e617821e52ab0dbc624cd00ac881c46c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
envoyproxy/envoy
882d3c7f316bf755889fb628bee514bb2f6f66f0
72f129d273fa32f49581db3abbaf4b62e3e3703c
refs/heads/main
2023-08-31T09:20:01.278000
2023-08-31T08:58:36
2023-08-31T08:58:36
65,214,191
21,404
4,756
Apache-2.0
2023-09-14T21:56:37
2016-08-08T15:07:24
C++
UTF-8
C++
false
false
1,945
h
stream.h
#pragma once #include "envoy/http/codec.h" #include "source/common/network/socket_impl.h" #include "gmock/gmock.h" namespace Envoy { namespace Http { class MockStream : public Stream { public: MockStream(); ~MockStream() override; // Http::Stream MOCK_METHOD(void, addCallbacks, (StreamCallbacks & callbacks)); MOCK_METHOD(void, removeCallbacks, (StreamCallbacks & callbacks)); MOCK_METHOD(CodecEventCallbacks*, registerCodecEventCallbacks, (CodecEventCallbacks * adapter)); MOCK_METHOD(void, resetStream, (StreamResetReason reason)); MOCK_METHOD(void, readDisable, (bool disable)); MOCK_METHOD(void, setWriteBufferWatermarks, (uint32_t)); MOCK_METHOD(uint32_t, bufferLimit, (), (const)); MOCK_METHOD(const Network::ConnectionInfoProvider&, connectionInfoProvider, ()); MOCK_METHOD(void, setFlushTimeout, (std::chrono::milliseconds timeout)); MOCK_METHOD(Buffer::BufferMemoryAccountSharedPtr, account, (), (const)); MOCK_METHOD(void, setAccount, (Buffer::BufferMemoryAccountSharedPtr)); // Use the same underlying structure as StreamCallbackHelper to insure iteration stability // if we remove callbacks during iteration. absl::InlinedVector<StreamCallbacks*, 8> callbacks_; Network::ConnectionInfoSetterImpl connection_info_provider_; Buffer::BufferMemoryAccountSharedPtr account_; void runHighWatermarkCallbacks() { for (auto* callback : callbacks_) { if (callback) { callback->onAboveWriteBufferHighWatermark(); } } } void runLowWatermarkCallbacks() { for (auto* callback : callbacks_) { if (callback) { callback->onBelowWriteBufferLowWatermark(); } } } const StreamInfo::BytesMeterSharedPtr& bytesMeter() override { return bytes_meter_; } CodecEventCallbacks* codec_callbacks_{nullptr}; StreamInfo::BytesMeterSharedPtr bytes_meter_{std::make_shared<StreamInfo::BytesMeter>()}; }; } // namespace Http } // namespace Envoy
7209d06e45d634acb70f7eba9be47e476c1f513f
8a1fe9c7cd29a097be3472f5af801886ff9e947b
/Lab2OOP/Lab2OOP/Furie.cpp
c34562ac4e2878eabe4fe0bb20bca551de87dab2
[]
no_license
Don4ikkryt/OOPLab2
09f32ba70ed53e4eb1ccb4f7b2e5d33c5f87c997
97af67235677b8fa908260f42486f6fa1cb1d899
refs/heads/master
2020-08-04T13:56:58.777955
2019-10-10T15:12:00
2019-10-10T15:12:00
212,159,639
0
0
null
null
null
null
UTF-8
C++
false
false
1,148
cpp
Furie.cpp
#include "Furie.h" #include <vector> #include <complex> #define PI 3.14159265358979323846 #include <cmath> #include <algorithm> using namespace std; typedef complex<double> base; void FurieTransfomation::fft(vector<base> & a, bool invert) { int n = (int)a.size(); if (n == 1) return; vector<base> a0(n / 2), a1(n / 2); for (int i = 0, j = 0; i < n; i += 2, ++j) { a0[j] = a[i]; a1[j] = a[i + 1]; } fft(a0, invert); fft(a1, invert); double ang = 2 * PI / n * (invert ? -1 : 1); base w(1), wn(cos(ang), sin(ang)); for (int i = 0; i < n / 2; ++i) { a[i] = a0[i] + w * a1[i]; a[i + n / 2] = a0[i] - w * a1[i]; if (invert) a[i] /= 2, a[i + n / 2] /= 2; w *= wn; } } void FurieTransfomation::multiply(const vector<int> & a, const vector<int> & b, vector<int> & res) { vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end()); size_t n = 1; while (n < max(a.size(), b.size())) n <<= 1; n <<= 1; fa.resize(n), fb.resize(n); fft(fa, false), fft(fb, false); for (size_t i = 0; i < n; ++i) fa[i] *= fb[i]; fft(fa, true); res.resize(n); for (size_t i = 0; i < n; ++i) res[i] = int(fa[i].real() + 0.5); }
5c094227d99be559fb4de010fc64d754adb454b6
8d385ec39e64e015e1035a89141332d7d55fe016
/src/opt/gm_opt_remove_unused_scalar.cc
27b66d63d34b54adf42be4946b09e2d77b67498c
[]
no_license
omsn/Green-Marl
ace523476264c45460207aeaafa5d28ce6d463ba
1bcf23e81792cffd0039aa5f122af1265e30d545
refs/heads/master
2021-01-18T04:58:32.095509
2013-01-13T22:09:40
2013-01-13T22:09:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,982
cc
gm_opt_remove_unused_scalar.cc
#include "gm_ind_opt.h" #include "gm_misc.h" #include "gm_traverse.h" #include "gm_transform_helper.h" #include "gm_rw_analysis.h" #include "gm_check_if_constant.h" //------------------------------------------------------------------- // Remove unused scalar variables // targets: // type - primitive or node or edge // is not iterator // is not used at all //------------------------------------------------------------------- class gm_opt_check_used_t : public gm_apply { public: gm_opt_check_used_t() { set_for_id(true); } virtual bool apply(ast_id* i) { gm_symtab_entry* z = i->getSymInfo(); assert(z!=NULL); used.insert(z); return true; } std::set<gm_symtab_entry*> & get_used_set() {return used;} private: std::set<gm_symtab_entry*> used; }; class gm_opt_remove_unused_t : public gm_apply { public: gm_opt_remove_unused_t(std::set<gm_symtab_entry*>& U) : used(U) { set_for_symtab(true); } virtual bool apply(gm_symtab* tab, int symtab_type) { if (symtab_type != GM_SYMTAB_VAR) return true; std::set<gm_symtab_entry*>::iterator I; std::set<gm_symtab_entry*> to_remove; std::set<gm_symtab_entry*> v = tab->get_entries(); for (I = v.begin(); I != v.end(); I++) { gm_symtab_entry* z = *I; if (!z->getType()->is_primitive() && !z->getType()->is_nodeedge()) continue; if (used.find(z) == used.end()) { to_remove.insert(z); } } for (I = to_remove.begin(); I != to_remove.end(); I++) { tab->remove_entry_in_the_tab(*I); } return true; } private: std::set<gm_symtab_entry*>& used; }; void gm_ind_opt_remove_unused_scalar::process(ast_procdef* proc) { gm_opt_check_used_t T; proc->traverse_pre(&T); gm_opt_remove_unused_t T2(T.get_used_set()); proc->traverse_pre(&T2); }
d488350d9f528b80d881dfe8f8658aebf5bc9d60
294c7cca849cda6e5b40481748ce69c649be78cb
/code force/Round#499/Div.2/c.cpp11.cpp
9ef5c0022a752ef478464a9ae1e1db7c93ee2ef6
[]
no_license
dgu14/cbs
06b7a686dc84ce5d77cc6c9fe101738430665053
1eb4e3de5e91507364cf5840f2c4f432df5504d8
refs/heads/master
2021-07-10T18:41:39.155115
2019-02-24T05:07:08
2019-02-24T05:07:08
142,029,094
0
0
null
null
null
null
UHC
C++
false
false
1,048
cpp
c.cpp11.cpp
#include <bits/stdc++.h> using namespace std; int n,m,a[1005],b[1005]; bool canfly(double fuel, bool test) { double tot = fuel+m; for(int i=0;i<n-1;i++) { fuel -= tot/a[i]; tot -= tot/a[i]; if(fuel < 0) return false; fuel -= tot/b[i+1]; tot -= tot/b[i+1]; if(fuel < 0) return false; } fuel -= tot/a[n-1]; tot -= tot/a[n-1]; if(fuel < 0) return false; fuel -= tot/b[0]; tot -= tot/b[0]; if(fuel < 0) return false; return true; } int main() { cin >> n >> m; for(int i=0;i<n;i++) cin >> a[i]; for(int i=0;i<n;i++) cin >> b[i]; double left = 0, right = 1e9, ret = -1; for(int i=0;i<1000;i++) { double mid = (left+right)/2; if(canfly(mid, false)) { ret = mid; right = mid; } else { left = mid; } } cout << fixed; cout.precision(7); // 병신 이거 안해줘서 틀리네 ㅎ cout << ret << endl; return 0; }
9397ede1f20a1d35b3a79e14f38cd2f908bb8cc4
3b6d1533615bfc95518774bd551316fe37300364
/tutorial/lesson7/demo1_7.cpp
b94285f9a07d96f657c67bb54d1e0da058c36851
[]
no_license
ljwwwiop/C_multithread_code
14a6d7d927a11334e7692b8f4d89b42a4d160773
221fc3dc9067ccd3c8169fec4319bae9f223e502
refs/heads/master
2023-07-11T13:04:05.342055
2021-08-19T09:15:24
2021-08-19T09:15:24
294,396,294
1
0
null
null
null
null
UTF-8
C++
false
false
627
cpp
demo1_7.cpp
#include <iostream> #include <string> #include <thread> #include <mutex> #include <fstream> #include <future> using namespace std; // 将子线程中的变量传入主线程 int factorial(int N) { int res = 1; for(int i = N;i > 1;i--) res *= i; cout<<"res : "<<res<<endl; return res; } int main() { int x ; // future<int> fu = async(launch::async| launch::deferred, factorial,4); future<int> fu = async(launch::deferred, factorial,4); x = fu.get(); // get() 函数会等待子线程结束,然后将返回值传给x,并且future对象只能被调用一次 return 0; }
e1d28930ce750de74b5f317f89aa3fd37e40088a
4352b5c9e6719d762e6a80e7a7799630d819bca3
/tutorials/eulerVortex.twitch.alternative.numerics/eulerVortex.cyclic.twitch.moving/2.83/p
d96a57e60f38bda8e8d2a5af3c03908faa0a9357
[]
no_license
dashqua/epicProject
d6214b57c545110d08ad053e68bc095f1d4dc725
54afca50a61c20c541ef43e3d96408ef72f0bcbc
refs/heads/master
2022-02-28T17:20:20.291864
2019-10-28T13:33:16
2019-10-28T13:33:16
184,294,390
1
0
null
null
null
null
UTF-8
C++
false
false
161,745
p
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "2.83"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField nonuniform List<scalar> 22500 ( 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 0.999999 1 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999998 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999998 0.999998 0.999997 0.999997 0.999997 0.999997 0.999997 0.999998 0.999998 0.999998 0.999998 0.999998 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 0.999998 0.999999 0.999999 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999998 0.999997 0.999997 0.999996 0.999996 0.999996 0.999996 0.999996 0.999997 0.999997 0.999997 0.999997 0.999997 0.999997 0.999997 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999998 0.999999 0.999998 0.999999 1 1 1 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 0.999999 0.999998 0.999997 0.999996 0.999995 0.999994 0.999994 0.999993 0.999993 0.999993 0.999993 0.999995 0.999996 0.999997 0.999997 0.999997 0.999997 0.999997 0.999997 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999998 0.999998 0.999998 0.999998 0.999998 0.999998 0.999999 0.999998 0.999999 1 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1 1 1 1 0.999998 0.999996 0.999995 0.999993 0.999992 0.999992 0.999992 0.999991 0.99999 0.999989 0.99999 0.999992 0.999995 0.999997 0.999997 0.999997 0.999996 0.999996 0.999997 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 1 1 1 0.999999 1 1 0.999999 0.999999 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999998 0.999998 0.999998 0.999997 0.999998 0.999997 0.999997 0.999999 0.999998 0.999999 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1 0.999997 0.999995 0.999995 0.999993 0.99999 0.999987 0.999989 0.999991 0.999991 0.999988 0.999985 0.999985 0.999988 0.999993 0.999997 0.999998 0.999997 0.999996 0.999996 0.999996 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 1 1 0.999998 0.999999 1 1 0.999998 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999998 0.999998 0.999997 0.999997 0.999997 0.999997 0.999997 0.999997 0.999998 0.999997 0.999999 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00002 1.00002 1.00002 1.00002 1.00001 1.00001 1.00001 1.00001 1 0.999993 0.999991 0.999993 0.99999 0.999982 0.999978 0.999983 0.999991 0.999993 0.999989 0.999982 0.999979 0.999983 0.99999 0.999997 0.999999 0.999999 0.999997 0.999996 0.999996 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 1 1 0.999994 0.999997 1.00001 0.999998 0.999995 1 1 1 0.999996 0.999993 0.999996 0.999997 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999998 0.999998 0.999997 0.999996 0.999996 0.999996 0.999996 0.999996 0.999997 0.999998 0.999998 1 1 1 1.00001 1.00001 1.00002 1.00002 1.00002 1.00002 1.00003 1.00003 1.00002 1.00003 1.00003 1.00002 1.00001 1.00001 1.00001 0.999999 0.999985 0.999987 0.999994 0.999989 0.999973 0.999963 0.999971 0.999989 1 0.999995 0.999983 0.999974 0.999976 0.999986 0.999996 1 1 0.999999 0.999997 0.999996 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999998 1 1 0.999998 1 0.999999 1.00001 0.999993 1 1.00002 0.999999 0.99999 1 1.00001 1 0.999987 0.999997 1.00001 1.00001 1.00001 1.00001 1 0.999998 0.999997 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999998 0.999998 0.999997 0.999996 0.999996 0.999995 0.999996 0.999996 0.999996 0.999999 0.999999 1 1.00001 1.00001 1.00001 1.00002 1.00003 1.00003 1.00004 1.00004 1.00005 1.00005 1.00005 1.00004 1.00005 1.00005 1.00002 1.00001 1.00003 1.00003 0.999998 0.999974 0.999981 1 0.999997 0.999969 0.999943 0.999947 0.999977 1 1.00001 0.999991 0.999972 0.999967 0.999977 0.999992 1 1 1 0.999999 0.999997 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1 0.999998 1 1 0.999998 1 0.999996 1.00001 0.999988 1 1.00001 0.999987 0.999974 0.999999 1.00002 0.999989 0.99997 1.00001 1.00002 1 0.999981 0.999973 0.999981 0.999994 1 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999998 0.999998 0.999997 0.999996 0.999996 0.999995 0.999996 0.999997 0.999997 1 1 1.00001 1.00001 1.00002 1.00003 1.00004 1.00005 1.00006 1.00007 1.00007 1.00007 1.00009 1.0001 1.00007 1.00007 1.00009 1.00008 1.00003 1.00002 1.00005 1.00005 1 0.999958 0.999966 1.00001 1.00002 0.999987 0.999931 0.999908 0.999944 0.999997 1.00003 1.00001 0.999979 0.99996 0.999963 0.999981 0.999998 1.00001 1.00001 1 1 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999998 1 1 0.999998 1 0.999995 1 0.999994 1.00001 0.99999 1 1.00001 0.999999 0.999988 1.00002 1.00006 0.999987 0.999966 1.00004 1.00004 0.999983 0.999965 0.999996 1.00004 1.00004 1.00002 1 0.999986 0.99998 0.999985 0.999991 0.999997 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999997 0.999998 0.999996 0.999996 0.999997 0.999997 0.999999 1 1.00001 1.00001 1.00002 1.00003 1.00004 1.00006 1.00007 1.00009 1.0001 1.00012 1.00014 1.00014 1.00014 1.00017 1.00016 1.00012 1.00012 1.00016 1.00013 1.00004 1.00002 1.00007 1.00009 1.00003 0.999937 0.999914 0.999986 1.00006 1.00005 0.999955 0.999871 0.999877 0.999962 1.00003 1.00004 1 0.999962 0.999949 0.999963 0.999986 1 1.00001 1.00001 1 1 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.999994 1.00001 0.999997 1 1 1 0.999994 1 1 0.999995 0.999983 0.999987 1.00004 0.999917 0.999918 1.00004 1.00001 0.999934 0.999946 1.00003 1.00006 0.999997 0.999947 0.99995 0.999974 1.00001 1.00003 1.00003 1.00002 1.00001 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999997 0.999998 0.999998 0.999998 1 1 1.00001 1.00001 1.00002 1.00003 1.00005 1.00007 1.00009 1.00012 1.00014 1.00017 1.0002 1.00022 1.00025 1.00027 1.00026 1.00025 1.0003 1.00028 1.00018 1.00018 1.00025 1.00022 1.00007 0.999998 1.00007 1.00015 1.00011 0.999941 0.999808 0.999874 1.00007 1.00018 1.00006 0.999874 0.999794 0.999877 1.00001 1.00008 1.00005 0.999991 0.999949 0.999946 0.999966 0.999988 1 1.00001 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999999 1 1 0.999995 1.00001 0.99999 1.00001 0.999995 0.999998 0.999995 1.00001 0.999998 1.00001 0.999978 1.00009 0.999949 0.999995 1.00015 1.00007 0.999982 1 1.00011 1.00007 0.999929 0.999937 1.00001 1.00004 1.00005 1.00001 0.999967 0.999951 0.999959 0.999974 0.999991 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 1 1 1.00001 1.00001 1.00002 1.00004 1.00006 1.00008 1.00011 1.00015 1.00018 1.00023 1.00028 1.00032 1.00037 1.00041 1.00043 1.00047 1.0005 1.00044 1.00044 1.00051 1.00045 1.00028 1.00025 1.00038 1.00037 1.00015 0.999932 0.999968 1.0002 1.00033 1.00007 0.999687 0.999596 0.999955 1.00029 1.00029 0.999983 0.999744 0.999754 0.999929 1.00008 1.00011 1.00005 0.999985 0.999949 0.99995 0.99997 0.999989 0.999999 1 1 0.999999 0.999999 0.999998 0.999998 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999996 1.00001 0.999991 1.00001 0.999986 1.00001 0.999989 1.00001 1.00001 0.999987 1.00001 1 0.999998 1.00001 0.999945 1.00008 0.999923 0.999936 1.00008 0.999894 0.999859 0.999866 1.00004 0.999929 0.999824 0.999994 1.00006 1.00006 1.00002 0.999969 0.999976 1.00002 1.00005 1.00005 1.00004 1.00002 1 0.999999 0.999999 0.999996 0.999998 1 1 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00001 1.00001 1.00002 1.00004 1.00006 1.00008 1.00012 1.00017 1.00022 1.00029 1.00036 1.00043 1.00052 1.0006 1.00066 1.00075 1.00078 1.00078 1.00086 1.00087 1.00072 1.00069 1.00082 1.00073 1.00039 1.00027 1.00048 1.00064 1.00037 0.999843 0.999643 1.00012 1.00069 1.00051 0.999696 0.999184 0.999569 1.00028 1.00055 1.00026 0.999812 0.999643 0.999773 0.999996 1.00013 1.00013 1.00006 0.999988 0.999958 0.99996 0.999976 0.99999 0.999997 1 1 0.999999 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999993 1.00001 0.999983 1.00002 0.99997 1.00003 0.999962 1.00003 0.999983 0.999995 1.00001 0.999954 1.00009 0.999975 0.999937 1.00018 0.999936 1.0001 1.00003 1.00029 1.00009 0.999998 1.00024 1.00007 1 0.999974 0.999911 0.999962 0.999983 0.999978 0.999968 0.999953 0.999954 0.999974 0.999997 0.999999 1 1.00001 1 0.999998 1 1 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00001 1.00001 1.00002 1.00003 1.00005 1.00008 1.00012 1.00017 1.00024 1.00032 1.00042 1.00053 1.00066 1.00079 1.00092 1.00107 1.00117 1.00126 1.00139 1.00139 1.00134 1.00146 1.00143 1.00109 1.001 1.00125 1.00117 1.00058 1.00014 1.00043 1.00106 1.00095 0.999853 0.998949 0.999644 1.001 1.00137 1.00008 0.998897 0.998888 0.999913 1.00066 1.00061 1.00009 0.999658 0.9996 0.999801 1.00003 1.00014 1.00013 1.00006 0.999997 0.999971 0.999971 0.999982 0.999992 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.999991 1.00001 0.999984 1.00002 0.999981 1.00001 0.999997 0.99999 1.00003 0.999955 1.00005 0.999974 1.00005 0.999994 0.999848 1.00017 0.999845 1.00003 0.999802 1.00005 0.99981 0.999659 1.00007 0.999673 0.999867 1 0.999947 1.00003 1.00006 1.00009 1.00008 1.00003 1.00003 1.00004 1.00001 1 1 0.999996 0.999992 0.999999 1 0.999996 1 1 0.999998 0.999999 1 1 1 0.999999 0.999999 1 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00004 1.00006 1.0001 1.00016 1.00023 1.00033 1.00044 1.00058 1.00076 1.00094 1.00115 1.00138 1.00158 1.00181 1.00202 1.00212 1.00226 1.00241 1.00227 1.00215 1.00234 1.00223 1.00156 1.00129 1.00177 1.00192 1.00098 0.999748 0.999941 1.00149 1.00216 1.00027 0.998067 0.998362 1.00085 1.00234 1.00119 0.999067 0.998299 0.999118 1.00035 1.00084 1.00053 0.999944 0.999576 0.99958 0.999807 1.00003 1.00013 1.00011 1.00005 1 0.999981 0.999982 0.999989 0.999995 0.999997 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1 0.999992 1.00001 0.999981 1.00003 0.999963 1.00005 0.99994 1.00007 0.999928 1.00007 0.999923 1.00006 0.999962 1 1.00002 0.999848 1.00025 0.999935 0.99999 1.00004 1.00009 1.00028 0.999772 1.00062 0.999853 1.00031 1.00029 1.00001 1.00001 0.999998 1.00008 0.9999 0.999842 0.999954 0.999977 0.99998 1 1 1 1 1.00001 1 0.999999 1.00001 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00003 1.00004 1.00008 1.00012 1.00019 1.00029 1.00041 1.00057 1.00078 1.00101 1.0013 1.00161 1.00194 1.00231 1.00267 1.00296 1.0033 1.00355 1.0036 1.00378 1.00392 1.00351 1.00321 1.00355 1.00338 1.00214 1.00136 1.0022 1.00318 1.00188 0.999041 0.99857 1.00155 1.00401 1.00166 0.997644 0.996355 0.999651 1.00264 1.00275 1.00025 0.998304 0.9983 0.999491 1.00063 1.00093 1.0005 0.999882 0.99954 0.999582 0.99982 1.00003 1.00011 1.00009 1.00004 1 0.99999 0.99999 0.999993 0.999997 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999995 1.00001 0.999992 1.00001 0.999984 1.00002 0.999973 1.00004 0.999949 1.00008 0.999902 1.00014 0.999862 1.00011 0.999924 1.00015 0.999963 0.999749 1.00016 0.999839 1.00033 0.999193 1.00052 0.999415 0.99997 0.999944 0.999576 0.999956 0.999864 1.00024 0.999812 0.999927 1.00021 1.00007 1.00002 1.00004 0.999965 0.999997 1.00002 0.999976 0.999996 0.999999 0.999995 0.999998 0.999996 1.00001 0.999997 0.999996 1 1 1 0.999999 0.999999 1 1 1 1 1.00001 1.00001 1.00001 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00003 1.00005 1.00008 1.00013 1.00022 1.00033 1.00049 1.0007 1.00097 1.0013 1.00169 1.00213 1.00264 1.00316 1.00369 1.00428 1.00476 1.00516 1.00563 1.00582 1.00572 1.00597 1.00601 1.00507 1.00443 1.00507 1.00507 1.00285 1.00085 1.00221 1.00502 1.0037 0.998576 0.996019 1.00052 1.00552 1.00467 0.99857 0.994843 0.996886 1.0016 1.0036 1.00225 0.999539 0.998035 0.998417 0.99976 1.00087 1.00105 1.00049 0.999841 0.999557 0.999643 0.999865 1.00002 1.00007 1.00005 1.00002 1 0.999994 0.999995 0.999998 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999997 1.00001 0.999988 1.00002 0.999971 1.00004 0.999947 1.00007 0.99993 1.00007 0.999954 1.00002 0.999981 0.999981 1.00004 0.999932 1.00013 0.999604 1.00046 0.999953 1.00017 0.999534 1.00049 1.00021 0.9998 1.00062 0.999548 1.00069 0.999691 1.00049 0.999645 1 1.00021 0.999839 0.999959 0.999929 0.999971 1.00004 1 0.999978 1.00001 1.00002 0.999999 1.00001 1.00001 0.999987 1 1.00001 0.999996 0.999995 1 1.00001 1 0.999995 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00002 1.00003 1.00005 1.00008 1.00014 1.00022 1.00036 1.00055 1.00081 1.00115 1.00157 1.00208 1.0027 1.00337 1.00413 1.00495 1.00575 1.00654 1.00737 1.00793 1.00842 1.00899 1.00895 1.00855 1.00886 1.00883 1.00693 1.00551 1.00685 1.00759 1.00389 0.999432 1.00126 1.00706 1.00704 0.999216 0.992935 0.997387 1.00522 1.00823 1.00185 0.99542 0.993989 0.998278 1.00277 1.00374 1.00178 0.999025 0.997737 0.998473 1.00006 1.00109 1.00104 1.00038 0.99982 0.999649 0.999758 0.999922 1.00002 1.00004 1.00003 1.00001 1 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999997 1.00001 0.99999 1.00002 0.999974 1.00004 0.999947 1.00007 0.999904 1.00012 0.99985 1.00018 0.999796 1.00026 0.999707 1.00037 0.999668 1.00024 0.999826 1.00022 0.999996 0.999715 0.999975 0.999824 1.00084 0.998589 1.00105 0.998793 1.00095 0.999048 1.0006 0.99958 1.00008 1.00034 0.9996 1.00041 0.999913 1 1.00014 0.999944 0.999978 1.00007 0.999958 0.999984 1.00001 0.999949 1.00001 1.00002 0.999987 0.999994 1.00001 1.00001 0.999989 0.999997 1.00001 0.999997 0.999998 1 1 1.00001 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00002 1.00002 1.00002 1.00003 1.00005 1.00008 1.00013 1.00022 1.00037 1.00058 1.00088 1.00128 1.0018 1.00246 1.00323 1.00414 1.00517 1.00625 1.00743 1.00864 1.00973 1.01085 1.01185 1.01237 1.01293 1.01353 1.01295 1.01196 1.01253 1.01249 1.00893 1.00604 1.00868 1.01121 1.00571 0.997357 0.998768 1.00764 1.01175 1.00218 0.991971 0.991494 1.00186 1.00941 1.00756 0.998796 0.993468 0.994232 0.999308 1.00353 1.00381 1.00114 0.998293 0.997499 0.998748 1.00037 1.00107 1.00081 1.00023 0.999851 0.999785 0.999873 0.999966 1.00001 1.00002 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999997 1.00001 0.999991 1.00001 0.999984 1.00002 0.999976 1.00003 0.999959 1.00006 0.999916 1.00013 0.999819 1.00028 0.999598 1.00043 0.999523 1.00052 0.999461 1.00057 0.999146 1.00092 0.999593 1.00059 0.998995 1.00106 0.999529 1.00039 0.999892 1.00013 1.00026 0.999213 1.00095 0.998891 1.00077 0.999441 0.999898 1.00006 0.999925 1.00002 0.999913 1.00004 1 1.00001 1.00004 1.00002 1.00003 0.999972 1.00001 1.00003 0.999968 0.999996 1.00001 0.999992 1 1 1 1 0.999994 1 1.00001 1.00001 1 0.999998 1 1.00001 1.00002 1.00002 1.00002 1.00003 1.00003 1.00005 1.00007 1.00012 1.00021 1.00035 1.00058 1.00091 1.00136 1.00198 1.00275 1.00371 1.00486 1.00615 1.00762 1.00918 1.01078 1.01245 1.01405 1.0154 1.0168 1.01784 1.01813 1.01867 1.01928 1.0177 1.01557 1.0169 1.01722 1.01084 1.00557 1.00999 1.01574 1.00892 0.995963 0.993997 1.00522 1.01556 1.0087 0.995143 0.986358 0.994444 1.00618 1.01154 1.00581 0.996426 0.99249 0.994949 1.00067 1.00436 1.00346 1.00012 0.997748 0.997776 0.99924 1.00049 1.0008 1.00049 1.0001 0.999914 0.999899 0.999947 0.999987 1 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 0.999991 1.00002 0.99997 1.00004 0.999938 1.00008 0.999906 1.00011 0.99987 1.00014 0.999848 1.0002 0.999764 1.00043 0.999594 1.00013 0.999999 1.00029 0.999914 0.999402 1.00026 0.99997 1.00093 0.997911 1.00179 0.99858 1.00172 0.99745 1.00254 0.998347 1.00142 0.999117 1.00058 1.00034 0.999697 1.00049 0.999675 1.00013 1.00014 0.999822 0.999994 1.00002 0.999881 1 1.00006 0.99995 0.999998 1.00002 1.00002 1 0.999981 1.00002 1 0.999987 1.00001 1.00001 1 0.999992 0.999993 1 1 0.999999 1.00001 1.00001 1.00002 1.00003 1.00003 1.00004 1.00005 1.00007 1.00011 1.00019 1.00033 1.00055 1.00089 1.00138 1.00206 1.00295 1.00408 1.00544 1.00706 1.00887 1.01085 1.01299 1.01514 1.01727 1.01942 1.02125 1.02276 1.02434 1.02521 1.02488 1.0255 1.02621 1.02268 1.01898 1.02186 1.0229 1.01292 1.00388 1.00964 1.01991 1.01392 0.998363 0.987884 0.998627 1.01346 1.01871 1.00299 0.986975 0.984777 0.99892 1.01018 1.01165 1.00354 0.994465 0.992412 0.996767 1.00245 1.00456 1.00242 0.999265 0.997904 0.998491 0.999676 1.00039 1.00045 1.00024 1.00004 0.999962 0.999961 0.999981 0.999996 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999991 1.00002 0.999974 1.00004 0.999944 1.00008 0.9999 1.00013 0.999826 1.00024 0.999663 1.00048 0.999341 1.0009 0.998785 1.0014 0.998407 1.00163 0.998507 1.00172 0.997565 1.00217 0.999228 1.00113 0.997513 1.00219 0.999273 1.00117 0.99794 1.00177 0.999193 1.00045 0.999487 0.99948 1.00098 0.99835 1.00097 0.999323 1.00026 0.999787 1.00002 1.00017 0.999851 1.00018 1.00004 0.999965 1.00003 0.999966 1.00006 0.999973 0.999931 1.00004 0.999995 0.999992 1.00002 0.999998 0.999991 0.999987 1.00002 1.00003 0.999996 0.999995 0.999993 0.999997 1.00001 1.00001 1.00002 1.00003 1.00004 1.00004 1.00005 1.00007 1.0001 1.00017 1.00028 1.00049 1.00083 1.00133 1.00205 1.00302 1.00429 1.00587 1.00776 1.00993 1.01238 1.01497 1.0177 1.02048 1.02313 1.02564 1.02809 1.02988 1.03135 1.03307 1.03339 1.03198 1.03313 1.03418 1.02736 1.02152 1.02693 1.02927 1.01582 1.00157 1.00692 1.0206 1.0211 1.00583 0.985277 0.987112 1.00466 1.02431 1.01563 0.994092 0.981159 0.987691 1.00375 1.01176 1.00957 1.00056 0.99322 0.993727 0.999202 1.00345 1.00363 1.00119 0.999057 0.998593 0.99922 0.999913 1.00022 1.0002 1.00009 1.00001 0.999986 0.999988 0.999994 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 0.999998 1.00001 1.00001 0.999987 1.00002 0.999981 1.00002 0.999966 1.00006 0.999901 1.00018 0.999725 1.00042 0.999423 1.00075 0.999199 1.00092 0.999245 1.00072 0.999018 1.00127 0.998844 1.00104 0.999105 1.00048 0.99902 1.00173 0.998291 1.00161 0.997522 1.00245 0.997727 1.00324 0.996025 1.00358 0.997531 1.00289 0.998054 1.00117 0.999617 0.999983 1.00068 0.999241 1.00012 1.00022 0.999673 1.00002 1.00015 0.999863 0.999984 1.00009 0.999992 1.00004 0.999975 0.999952 1.00001 0.999999 1.00002 0.999988 0.99997 1.00001 1.00001 1.00001 1.00001 0.999992 1.00001 1.00002 1.00003 1.00003 1.00003 1.00004 1.00005 1.00006 1.00009 1.00014 1.00024 1.00042 1.00073 1.00122 1.00194 1.00296 1.00433 1.00608 1.00822 1.01075 1.01359 1.01669 1.01999 1.02328 1.02659 1.02974 1.03254 1.03516 1.03755 1.03894 1.0402 1.0423 1.04142 1.03857 1.04133 1.04252 1.03143 1.02309 1.03073 1.03563 1.02088 1.0004 1.00179 1.01336 1.02857 1.01758 0.993269 0.972096 0.991667 1.01961 1.02767 1.00487 0.986364 0.982365 0.992524 1.00634 1.01079 1.00581 0.997603 0.993533 0.996089 1.00085 1.00302 1.00216 1.00037 0.999337 0.999301 0.999687 0.999989 1.00009 1.00007 1.00003 1 0.999995 0.999995 0.999996 0.999998 0.999999 1 1 1 1 0.999999 1 0.999997 1 0.999993 1.00001 0.999985 1.00002 0.999979 1.00002 1 0.999979 1.00005 0.99996 1.00001 1.00012 0.999647 1.00078 0.998599 1.00175 0.997983 1.00244 0.997452 1.0026 0.996356 1.00485 0.996208 1.00184 0.997773 1.00467 0.996006 1.00068 0.999579 1.00445 0.994908 1.00169 0.998924 1.00295 0.997042 0.999568 1.00132 0.999136 1.00076 0.998727 1.00098 0.99969 1.00014 1.00012 0.999757 1.00022 0.999974 0.999931 1.00011 0.999843 0.999965 1.00011 1.00004 1.00003 0.999946 0.999989 1.00004 0.999991 1.00001 0.999979 0.999971 1.00001 1 1.00001 1.00003 1.00003 1.00003 1.00003 1.00003 1.00004 1.00006 1.00008 1.00012 1.0002 1.00034 1.00062 1.00106 1.00175 1.00277 1.00418 1.00605 1.0084 1.01121 1.01444 1.01803 1.02179 1.02569 1.0295 1.03309 1.03644 1.03948 1.04185 1.04422 1.04625 1.04679 1.04819 1.05101 1.04809 1.04377 1.04942 1.0509 1.03506 1.02374 1.0315 1.0404 1.02756 1.00509 0.994242 0.999115 1.02805 1.03354 1.00821 0.967473 0.974587 1.00869 1.02711 1.01813 0.996345 0.986838 0.987186 0.99627 1.00695 1.00831 1.00196 0.996155 0.995334 0.99827 1.00117 1.00185 1.00099 1.00006 0.999683 0.999735 0.999899 1 1.00003 1.00002 1 0.999997 0.999995 0.999997 0.999998 1 1 1 1 1 1 0.999999 1 0.999995 0.999986 1.00001 0.999987 1.00001 0.999975 1.00007 0.999843 1.00034 0.9994 1.00102 0.998462 1.00224 0.997195 1.00328 0.996949 1.00308 0.995792 1.00507 0.995671 1.00427 0.994425 1.0044 0.999281 1.00094 0.994673 1.00431 1.0011 0.999883 0.994468 1.00426 0.999856 1.00313 0.993424 1.005 0.997974 1.00332 0.99568 1.00308 0.99892 0.999831 1.00058 0.999367 1.00016 1.00024 0.999744 0.999925 1.00021 0.999969 1.00005 0.999984 0.999761 1.00006 1.00013 0.999985 1.00001 0.999961 1.00004 1.00006 0.999976 0.999994 1 1.00001 1.00004 1.00003 1.00002 1.00003 1.00002 1.00004 1.00006 1.00007 1.00011 1.00016 1.00028 1.0005 1.00088 1.00151 1.00247 1.00388 1.00579 1.00826 1.0113 1.01488 1.01886 1.02313 1.02751 1.03176 1.03581 1.0394 1.04248 1.04516 1.04732 1.04879 1.05082 1.05231 1.05168 1.0543 1.05821 1.05249 1.04742 1.0563 1.05832 1.03939 1.02376 1.02768 1.04167 1.03422 1.02007 0.985843 0.983452 1.01174 1.05182 1.02179 0.977273 0.963534 0.996656 1.01608 1.01856 1.01046 0.996225 0.989731 0.991734 0.99963 1.00628 1.00512 0.999642 0.996645 0.997438 0.999512 1.00078 1.00084 1.00036 0.999995 0.99989 0.999923 0.999975 1 1 1 0.999997 0.999997 0.999998 1 1 1 0.999999 1 0.999997 1.00001 0.999991 1.00001 1.00004 0.999927 1.00013 0.999769 1.00039 0.99938 1.00093 0.998752 1.00164 0.998096 1.00216 0.997949 1.00129 0.999688 0.999812 1.00007 1.00047 1.00043 0.996676 1.00508 0.996627 1.00306 0.993359 1.00737 0.997488 1.00173 0.996001 1.0016 0.99965 1.00582 0.993418 1.00011 0.998855 1.00682 0.994378 0.99962 1.00102 1.00069 1.00035 0.998114 1.00176 0.999071 1.0004 1.0001 0.999647 1.00032 0.999859 0.999724 1.00036 1.00014 0.999889 0.999848 0.999882 1.00014 1.00001 0.999886 1.00004 1.00001 0.999985 0.999999 0.999985 1.00004 1.00003 1.00002 1.00001 1.00001 1.00003 1.00005 1.00008 1.0001 1.00015 1.00023 1.00039 1.0007 1.00124 1.00211 1.00344 1.00531 1.00783 1.01102 1.01485 1.01919 1.0239 1.0287 1.03342 1.03772 1.04147 1.04455 1.04689 1.04843 1.04989 1.05061 1.05114 1.05331 1.05408 1.05262 1.05809 1.06357 1.05465 1.04902 1.06074 1.0637 1.04579 1.02446 1.02123 1.03313 1.04052 1.04073 0.98835 0.965326 0.991793 1.05193 1.03809 0.988204 0.971929 0.984197 1.00404 1.00703 1.01149 1.00948 0.996867 0.991258 0.995917 1.00224 1.00448 1.00226 0.999077 0.998058 0.998928 0.999946 1.00034 1.00029 1.00011 0.999997 0.999972 0.99998 0.99999 0.999994 0.999996 0.999997 0.999999 1 1 1 1 0.999997 1.00001 0.99999 1.00002 0.999975 0.999843 1.00025 0.99962 1.00054 0.999313 1.00081 0.999215 1.00067 0.999759 0.999687 1.00142 0.99728 1.00459 0.994941 1.00407 0.995631 1.00733 0.990402 1.00968 0.990503 1.00972 0.991274 1.00665 0.995324 1.00507 0.993916 1.00078 1.00476 1.00239 0.989902 1.00263 1.00504 1.00382 0.989565 1.00358 1.00107 1.00511 0.991213 1.00434 0.999652 1.00024 0.999551 0.999734 1.00037 0.999933 1.00013 0.999908 1.00001 0.999652 1.00007 1.00056 0.999898 0.99981 1.00008 0.999943 1.00003 0.999993 0.999943 1.00001 0.999973 0.999962 0.999992 0.999977 0.999985 1.00001 1.00002 1.00006 1.00008 1.0001 1.00014 1.00019 1.00031 1.00054 1.00098 1.00172 1.0029 1.00468 1.00714 1.01038 1.01437 1.019 1.02407 1.02931 1.03439 1.03897 1.04284 1.04567 1.04751 1.04846 1.04854 1.04817 1.04829 1.04753 1.04789 1.05122 1.05117 1.04988 1.05958 1.06686 1.05554 1.04953 1.06164 1.06621 1.05441 1.02592 1.0165 1.01105 1.04824 1.05278 1.01055 0.943966 0.984556 1.03365 1.04264 0.997256 0.988312 0.991218 0.988585 0.996002 1.00351 1.00962 1.00634 0.996224 0.993653 0.998844 1.00269 1.00245 1.00066 0.999381 0.999199 0.999642 1.00001 1.00011 1.00008 1.00003 0.999996 0.999987 0.999988 0.999992 0.999996 0.999998 1 0.999999 1.00001 0.999993 1.00001 0.99998 1.00003 0.999944 1.00009 0.999965 1.0001 0.999762 1.0005 0.99908 1.00157 0.997675 1.00335 0.995724 1.00549 0.993449 1.00715 0.99346 1.00474 0.997231 1.00499 0.991216 1.00595 1.00233 0.996793 0.996662 1.00106 1.01191 0.986767 0.997932 1.00768 1.00622 0.990459 0.992983 1.01016 1.0057 0.99279 0.993925 1.0024 1.01155 0.990963 0.99758 1.00242 1.00332 0.998072 0.997056 1.00384 0.998293 1.00024 1.00015 0.999448 1.00058 1.00032 0.999391 0.999758 1.00003 1.00019 1.0003 0.999844 0.999941 1.00017 0.99998 1.00004 1.00008 1.00004 1.00005 0.999957 0.999947 0.999984 1.00003 1.00006 1.00009 1.00011 1.00013 1.00017 1.00025 1.00042 1.00075 1.00134 1.00236 1.00394 1.00625 1.00942 1.01346 1.01828 1.02367 1.02929 1.03473 1.03964 1.04353 1.04622 1.04754 1.04745 1.0463 1.04464 1.0422 1.04064 1.03985 1.03846 1.04003 1.04572 1.04459 1.04431 1.05945 1.06888 1.0568 1.05002 1.0573 1.06498 1.06192 1.03561 1.01233 0.982749 1.04476 1.06309 1.02967 0.946601 0.972255 1.02577 1.02216 1.00694 0.998841 1.00916 0.993465 0.98097 0.995737 1.0074 1.00626 1.00082 0.996649 0.996961 1.00009 1.00167 1.00101 1.00008 0.999732 0.99976 0.999903 1.00001 1.00003 1.00001 0.999996 0.999989 0.999991 0.999994 1 1 1 1 1 1 0.999998 1 0.999996 1.00001 1.00079 0.998797 1.00175 0.997593 1.00316 0.996183 1.00445 0.995298 1.00486 0.99561 1.00375 0.998901 0.998411 1.00291 0.998283 1.00043 0.997804 1.00974 0.983423 1.01246 0.996255 1.00955 0.978631 1.01389 1.00342 0.999279 0.989111 1.00342 1.00731 1.00547 0.98359 1.00044 1.01076 1.00663 0.983658 1.00082 1.00621 1.00705 0.986688 1.00481 1.00112 1.00061 0.998028 1.00051 1.00096 0.998903 1.00029 1.00011 1.00058 1.00003 0.999059 1.00001 1.00026 0.999873 1.00004 0.999911 0.999916 1.00003 1.00003 1.00011 1.0001 1.00001 1.00003 1.00005 1.00006 1.0001 1.00011 1.00012 1.00015 1.0002 1.00032 1.00055 1.00101 1.00182 1.00316 1.00525 1.00821 1.01218 1.01708 1.0227 1.02866 1.03451 1.0397 1.04377 1.04639 1.04717 1.04631 1.04386 1.04025 1.03629 1.03249 1.02871 1.02747 1.02677 1.02564 1.03028 1.03871 1.03698 1.03806 1.05835 1.06937 1.05876 1.05206 1.04873 1.06252 1.05995 1.05712 1.00228 0.974681 1.01481 1.08276 1.01814 0.974329 0.971719 1.02056 1.00172 0.992711 1.01373 1.01561 1.00712 0.988601 0.98475 1.0003 1.00773 1.00262 0.998177 0.997977 0.99914 1.00024 1.00065 1.00032 0.999979 0.999914 0.999953 0.99998 0.999993 0.999994 0.999991 0.999994 0.999993 1.00001 0.999991 1.00002 0.999971 1.00005 0.999922 1.00012 0.999801 1.00032 0.999492 0.999355 1.00076 0.999247 1.00056 0.999961 0.999253 1.00197 0.996768 1.00503 0.993255 1.0091 0.988822 1.01175 0.992728 1.00445 0.991907 1.01376 0.988496 1.00419 0.999826 1.00224 0.99668 0.995535 1.01099 0.999115 0.988978 1.00442 1.00658 1.0059 0.971745 1.02147 1.00446 0.999219 0.979148 1.01015 1.01562 0.990704 0.990237 1.00446 1.0086 0.995756 0.993932 1.00643 0.998362 0.999474 1.00079 0.999237 0.999537 1.00073 1.00055 1.0001 0.99979 0.999595 1.00017 1.00017 0.999818 0.999884 0.999806 0.999874 0.999971 0.999946 1.00005 1.00011 1.0001 1.00009 1.0001 1.00009 1.00011 1.00017 1.00024 1.00042 1.00074 1.00135 1.00245 1.0042 1.00687 1.0106 1.01543 1.02118 1.02746 1.03369 1.03927 1.04364 1.04623 1.04685 1.04527 1.04167 1.03665 1.03068 1.02445 1.01937 1.01477 1.01192 1.01215 1.0128 1.01221 1.02195 1.03302 1.03038 1.03313 1.05581 1.06939 1.06403 1.05437 1.03916 1.05154 1.05382 1.08539 0.99243 0.974462 0.990832 1.07851 1.01832 0.973479 1.00317 1.00915 0.995867 0.970155 1.00379 1.03031 1.00927 0.993733 0.992418 0.995504 1.00175 1.00395 1.00071 0.998525 0.999144 0.999926 1.00009 1.00013 1.0001 1.00001 0.999977 0.999983 0.999984 0.999991 0.999989 1 0.999991 1.00002 0.999981 1.00004 0.999947 1.00009 0.999856 1.00023 0.999653 1.00049 0.998296 1.00261 0.996203 1.00528 0.993116 1.00864 0.989948 1.01152 0.987565 1.01359 0.987009 1.01148 0.993062 1.00269 0.996842 1.01105 0.989429 0.994784 1.01657 0.995125 0.992609 0.993061 1.02596 0.987013 0.988535 1.00871 1.01059 0.984326 1.00207 1.00531 1.01451 0.97138 1.00487 1.01003 1.01614 0.974851 0.995526 1.01336 1.01091 0.981389 1.002 1.00559 1.00155 0.994927 1.0008 1.00287 0.998106 1.00007 0.999367 0.999477 1.00139 1.00024 0.999504 1.00012 1.00023 1.00029 1.00018 0.999967 0.999934 0.999829 0.999873 1.00006 1.00006 1.00006 1.00007 1.00005 1.00008 1.00012 1.00021 1.00032 1.00054 1.00099 1.00179 1.00323 1.0055 1.00885 1.01345 1.01916 1.02566 1.03231 1.03836 1.0431 1.04597 1.04653 1.04456 1.0403 1.0339 1.02631 1.01828 1.01063 1.00412 0.999913 0.996228 0.996087 0.999119 1.00091 1.00193 1.01601 1.03059 1.02648 1.03226 1.05403 1.06573 1.07143 1.05392 1.04174 1.02609 1.05309 1.08348 1.01538 0.951614 1.01988 1.0319 1.02008 0.968989 1.02317 1.0262 0.981872 0.973659 0.981972 1.01463 1.02406 1.00003 0.990168 0.997244 1.00112 1.00111 1.00108 1.00023 0.999373 0.999618 1.00005 1.00007 1.00001 1.00001 0.999995 0.999982 0.999986 0.999988 1.00001 0.999987 1.00003 0.999963 1.00006 0.999906 1.00015 0.999759 1.0004 0.999343 1.00107 1.00278 0.996495 1.00415 0.995485 1.00461 0.995839 1.00342 0.997698 1.00112 1.00094 0.996294 1.0082 0.991491 1.00581 1.00019 0.998064 0.996222 1.01372 0.992315 0.988101 1.01385 1.00346 0.997075 0.988016 1.00759 1.00561 0.990855 1.01576 0.980142 1.0247 0.957202 1.0378 0.994316 1.01374 0.955994 1.0207 1.01709 0.999641 0.976275 1.00481 1.01547 0.996429 0.988429 1.00769 1.00114 0.997233 1.00082 1.00179 0.998986 0.998444 1.00007 1.00044 1.0002 0.999597 0.999653 1.00026 1.00038 1.00036 1.00014 0.999974 1.00004 1.00004 0.999956 0.999987 1.00003 1.00004 1.00015 1.00021 1.00027 1.00043 1.0007 1.0013 1.00238 1.0042 1.0071 1.01124 1.01673 1.0233 1.0303 1.03692 1.04222 1.04552 1.04628 1.04435 1.03959 1.03248 1.02362 1.0138 1.00427 0.99578 0.98876 0.984469 0.981973 0.981302 0.983855 0.991181 0.992396 0.996011 1.01389 1.03117 1.02845 1.03211 1.05221 1.062 1.07863 1.05509 1.04618 0.988763 1.06942 1.05677 1.0426 0.938556 1.034 1.03285 0.97766 0.987907 1.01694 1.05032 0.991506 0.961278 0.993048 1.00368 1.00625 1.00793 0.998739 0.994614 0.99945 1.00175 1.00027 0.999766 1.00011 0.999994 0.999881 0.999976 1.00002 0.999988 0.999986 0.999977 1.00001 0.999977 1.00004 0.99995 1.00009 0.999856 1.00025 0.9996 1.00064 0.999007 1.00147 0.99792 1.00165 0.997138 1.00453 0.993426 1.00894 0.988684 1.01377 0.984339 1.01811 0.98025 1.02193 0.979251 1.01512 0.993372 1.00867 0.984482 1.01727 0.993656 0.995112 1.0014 1.01313 0.992409 0.989878 0.996456 1.02664 0.98587 0.999868 0.99779 0.990252 1.01365 0.995769 1.03292 0.943717 1.01784 1.00035 1.0387 0.964387 0.985198 1.01636 1.01998 0.982653 0.990315 1.00978 1.00646 0.99202 0.997846 1.00472 0.998876 1.00089 1.00125 0.99802 0.999634 1.00099 0.99978 0.999245 0.99949 0.999778 1.0001 1.00014 1.00015 1.00015 0.999976 0.999962 1 1.00005 1.00014 1.00022 1.00027 1.00033 1.00053 1.00092 1.00168 1.00311 1.00542 1.009 1.01405 1.02042 1.02769 1.03487 1.0409 1.04486 1.04612 1.04441 1.03968 1.03224 1.02247 1.01156 1.00014 0.989657 0.980659 0.973974 0.969343 0.96843 0.967932 0.970588 0.976498 0.987217 0.989511 0.993004 1.01604 1.03152 1.03412 1.03995 1.04743 1.06017 1.06853 1.07021 1.04728 0.975057 1.05415 1.0604 0.995379 0.99876 1.0129 1.0509 0.951434 0.971079 1.02705 1.03266 1.02636 0.977389 0.970509 1.00604 1.0103 0.999797 1.00014 1.00022 0.997907 0.999153 1.00097 1.00045 0.99975 0.999898 1.00005 0.999997 0.999969 0.999981 0.999989 0.999996 0.999999 1.00001 1.00001 0.999993 1.00003 0.999961 1.00005 0.999987 0.999902 1.00036 0.999157 0.994018 1.00767 0.990667 1.01086 0.988088 1.0127 0.986983 1.01302 0.986944 1.01239 0.990703 1.00592 0.999409 1.00307 0.985668 1.02401 0.986083 1.00127 0.989945 1.03756 0.959037 1.01445 0.988888 1.03603 0.972528 0.999337 1.00039 0.985945 1.04526 0.965275 1.02972 0.933853 1.05544 0.987507 1.03967 0.927931 1.02548 1.00815 1.02727 0.961008 0.997774 1.0192 1.00454 0.985156 1.00193 1.00658 0.996947 0.995478 1.00254 1.00293 0.999096 0.999379 1.00039 1.00074 1.00052 0.999514 0.999299 0.999636 0.999915 1.00011 1.00011 0.999978 1.00008 1.00013 1.00014 1.00023 1.0002 1.00025 1.00039 1.00064 1.0012 1.00219 1.00399 1.00692 1.01126 1.01724 1.02447 1.03212 1.03902 1.04387 1.04593 1.04475 1.04037 1.03292 1.02296 1.01111 0.998443 0.986117 0.974822 0.965787 0.959043 0.954819 0.953917 0.955169 0.95835 0.962525 0.973788 0.985992 0.990635 0.993101 1.01847 1.03779 1.03871 1.05043 1.04154 1.06138 1.05523 1.09271 1.01502 1.00907 1.00686 1.09181 0.944764 1.00693 1.04768 1.01801 0.976289 0.940669 1.0246 1.03612 0.997982 1.00397 0.994016 0.987715 1.00418 1.00658 0.997647 0.997845 1.00142 1.00047 0.999171 0.999802 1.00027 1.00008 0.99995 0.999977 0.999977 0.999998 0.999978 1.00004 0.999956 1.0001 0.999847 1.00028 0.99951 1.00083 0.998643 1.00211 0.996861 1.00444 1.0007 1.00025 0.998331 1.00359 0.99415 1.0081 0.989644 1.01262 0.985629 1.01741 0.97994 1.0203 0.985694 1.0066 1.00193 1.00325 0.98657 1.0134 1.00534 0.988896 0.988103 1.02822 0.98581 1.01965 0.947606 1.04612 0.980107 1.03415 0.971818 0.983522 1.02014 0.982295 1.07043 0.917469 1.03089 0.965207 1.07164 0.968197 0.976405 1.00575 1.02138 1.00223 0.976219 1.00534 1.01335 0.995678 0.99554 1.00311 0.997391 0.998201 1.00282 1.00001 0.998352 1.00069 1.00138 1.0005 1.00015 0.999792 0.999786 1.00001 0.999929 1.00002 1.00017 1.00018 1.00016 1.00017 1.00018 1.00027 1.00049 1.00081 1.00152 1.00284 1.00506 1.00869 1.01393 1.02078 1.02871 1.03636 1.04239 1.04554 1.04522 1.04145 1.03439 1.02454 1.01237 0.998937 0.98492 0.971771 0.959819 0.950406 0.943476 0.939446 0.937893 0.941363 0.944493 0.951709 0.957426 0.972201 0.988884 0.99261 1.00084 1.01899 1.03975 1.04853 1.05975 1.04993 1.04306 1.03999 1.10795 0.990596 1.03185 1.0336 1.02124 0.979069 0.961336 1.08923 1.01955 0.973269 0.96647 0.97065 1.03668 1.02406 0.982991 0.996586 1.00342 0.994624 0.999892 1.00531 1.00034 0.997243 0.999501 1.00084 1.00021 0.999833 0.99994 0.999991 0.999985 0.999979 1.00002 0.999975 1.00007 0.999889 1.00022 0.999652 1.00054 0.999225 1.00103 0.998765 1.00132 0.998819 1.00813 0.98937 1.01323 0.984273 1.01797 0.98032 1.02116 0.977331 1.02359 0.975661 1.02417 0.981315 1.01366 0.984823 1.02624 0.962298 1.04039 0.96587 1.03893 0.939156 1.07844 0.936345 1.05204 0.926412 1.07489 0.968786 1.01243 0.985791 0.975063 1.0496 0.972365 1.04312 0.923401 1.04709 0.97266 1.07343 0.919054 1.03201 0.969849 1.06201 0.962091 0.990038 1.01148 1.00805 0.99326 0.992488 1.00791 1.00619 0.9947 0.996988 1.00208 0.999969 0.998977 0.999289 0.999427 1.00073 1.00096 1.00024 1.00007 0.999916 0.999786 1.00012 1.00012 1.00003 1.00011 1.00012 1.00025 1.00037 1.0006 1.00106 1.00193 1.0036 1.00639 1.01075 1.01695 1.02463 1.03291 1.04013 1.04467 1.04567 1.04277 1.03641 1.02694 1.01496 1.0011 0.986206 0.971175 0.956704 0.944133 0.933501 0.92645 0.922104 0.920794 0.92393 0.930214 0.937986 0.946983 0.956209 0.971664 0.994704 0.996575 1.00706 1.02778 1.03643 1.05963 1.05619 1.05974 1.02589 1.05237 1.06757 1.02129 0.971249 1.11728 0.973566 0.972705 0.985552 1.03984 1.06148 0.956945 0.98462 1.00731 0.985125 1.01404 1.01131 0.986391 0.997961 1.00887 0.998839 0.994614 1.00038 1.00234 1.00017 0.999357 0.999852 1.00006 0.999997 0.999978 0.999993 1 1.00001 1.00001 0.999993 1.00007 0.99981 1.00044 0.999121 1.00158 0.997377 1.00406 0.994095 0.995151 1.0048 0.995757 1.00328 0.998016 1.0004 1.00077 0.998071 1.00332 0.994856 1.00669 0.991388 1.00431 1.0089 0.981202 1.01956 0.991937 1.00857 0.980599 1.02598 0.995815 0.973207 1.03222 0.967058 1.06798 0.90584 1.07572 0.930415 1.08306 0.954144 0.99734 1.01213 0.959817 1.09291 0.910043 1.06467 0.916681 1.08132 0.979811 0.983226 1.00254 0.996513 1.02926 0.977118 0.993377 1.01193 0.996071 0.996069 1.00678 1.00165 0.996098 1.00073 1.00205 0.998493 0.998237 0.999853 1.00003 1.00031 1.00032 0.999845 1.00008 1.00019 0.999965 1.00001 1.00016 1.00021 1.00033 1.0005 1.00074 1.00135 1.00247 1.00452 1.00798 1.01316 1.02026 1.02866 1.03686 1.04309 1.0457 1.04419 1.03875 1.02993 1.01845 1.00465 0.989397 0.973067 0.956675 0.940592 0.926507 0.914895 0.906725 0.902787 0.902335 0.904485 0.914017 0.922448 0.936117 0.946566 0.957251 0.975017 0.996198 1.00894 1.01552 1.03438 1.03312 1.06051 1.07063 1.06351 1.00092 1.08689 0.990178 1.03291 1.001 1.07903 1.02808 0.904091 1.01666 1.01465 1.04158 1.02494 0.949302 0.996512 1.01847 0.989181 1.00506 1.01231 0.990996 0.99037 1.00442 1.00523 0.999012 0.998071 0.999922 1.00041 1.00008 0.99994 0.999952 0.999999 0.999985 1.00007 0.999894 1.00025 0.999563 1.00075 0.998807 1.00177 0.997544 1.00321 0.996065 1.00453 0.992844 1.00982 0.987279 1.01555 0.981742 1.02052 0.977504 1.02386 0.973818 1.02729 0.973187 1.02519 0.980339 1.01829 0.97286 1.04303 0.94389 1.05627 0.937445 1.08398 0.889095 1.11817 0.891652 1.11524 0.873683 1.09822 0.946322 1.04306 0.97178 0.986316 1.02731 0.982357 1.03577 0.95181 1.03205 0.9569 1.0804 0.919791 1.06476 0.923716 1.07371 0.971189 0.987632 1.01432 1.00057 1.00506 0.990774 0.994326 1.00623 1.00129 0.998003 1.0016 1.00098 1.00005 1.00054 0.99922 0.998942 0.999906 0.999942 1.00011 1.00039 0.99998 0.999958 1.00023 1.00024 1.00031 1.0004 1.00058 1.00093 1.00165 1.00312 1.00566 1.00981 1.01592 1.02383 1.03264 1.04035 1.04499 1.04536 1.04122 1.03339 1.02246 1.0092 0.993958 0.977206 0.959349 0.940742 0.922763 0.906356 0.893942 0.884659 0.880867 0.881875 0.886197 0.894314 0.908287 0.920709 0.937642 0.95166 0.959889 0.983852 0.998928 1.01565 1.0334 1.03795 1.04606 1.05169 1.07069 1.05611 1.00648 1.08639 1.02173 0.921557 1.07853 1.02258 1.04256 0.943501 0.966849 1.05791 0.981218 1.00388 1.01779 0.975836 1.00695 1.0161 0.982671 0.990525 1.01322 1.00662 0.994448 0.996273 1.00105 1.00124 1.00005 0.999756 0.999883 0.999997 0.999998 1.00006 0.999931 1.00015 0.999801 1.00026 0.999741 1.00015 1.00014 0.999286 1.00165 0.996984 1.00486 1.0083 0.99075 1.00983 0.990034 1.00978 0.990576 1.0089 0.991253 1.00882 0.991458 1.00695 0.991202 1.01104 0.976056 1.0364 0.957608 1.04189 0.963221 1.04466 0.955911 1.03053 1.00196 0.971746 1.04295 0.927516 1.11825 0.862051 1.12792 0.869148 1.12851 0.917972 1.03407 0.994936 0.962255 1.08638 0.899757 1.10092 0.894776 1.07544 0.985272 0.979401 1.02877 0.961285 1.03243 0.993874 0.985858 1.01731 1.00196 0.988061 0.99908 1.00474 0.998837 0.9983 1.00217 1.0016 0.999643 0.999812 0.999694 0.999687 1.00028 1.00001 0.999847 1.00022 1.00026 1.00017 1.0003 1.00042 1.0006 1.00111 1.00206 1.00388 1.00702 1.0119 1.01894 1.02759 1.03638 1.04313 1.04574 1.04361 1.03701 1.02696 1.01434 0.999495 0.982919 0.964431 0.944409 0.922998 0.902282 0.883996 0.869826 0.860762 0.856135 0.858637 0.866375 0.875428 0.891184 0.907123 0.924581 0.942314 0.960031 0.969259 0.98793 1.0077 1.02056 1.05104 1.03973 1.04009 1.05697 1.0701 1.01882 1.07837 1.01511 1.05045 0.909769 1.04238 1.08297 0.976932 1.01456 0.937779 1.00391 1.05725 0.98003 0.998489 1.0075 0.972657 1.00042 1.0268 1.00177 0.985115 0.99633 1.00475 1.00222 0.999315 0.999272 0.999849 1.00007 1.00005 1.00003 0.999985 1.00001 1.00007 0.999817 1.00044 0.999167 1.00143 0.997768 1.00325 0.995548 1.00577 0.992907 1.00333 0.994557 1.00786 0.98957 1.01279 0.985008 1.01658 0.981599 1.01847 0.979127 1.01987 0.981838 1.01562 0.987956 1.02096 0.964444 1.04929 0.938043 1.07063 0.902156 1.12325 0.853199 1.15008 0.847178 1.15993 0.846207 1.1168 0.919257 1.06916 0.953575 1.01285 0.99405 1.01581 0.992857 0.997947 1.00445 0.970691 1.07147 0.905641 1.09978 0.902063 1.06902 0.99405 0.966582 1.02082 0.993442 1.00063 1.00638 0.998391 1.00027 0.999109 0.996815 1.00013 1.00098 0.9995 1.00056 1.001 1.00013 1.00014 0.999957 0.999697 1.00017 1.0003 1.00008 1.00019 1.00031 1.00041 1.00071 1.00137 1.00262 1.00482 1.00858 1.01433 1.02218 1.03137 1.03973 1.04494 1.04531 1.04059 1.03178 1.01984 1.00573 0.989539 0.971356 0.950799 0.927615 0.903015 0.879027 0.858995 0.842981 0.83339 0.829208 0.831616 0.841446 0.856565 0.871427 0.893422 0.911164 0.931019 0.951467 0.965521 0.98461 0.994684 1.01117 1.02984 1.04977 1.05515 1.04111 1.05336 1.06701 0.962364 1.09858 1.06972 0.966558 1.00493 0.963326 1.08855 0.982544 0.973928 1.05118 0.966126 0.993811 1.01527 0.974572 1.01417 1.03188 0.985098 0.97639 1.00407 1.01078 1.0009 0.997117 0.998971 1.00024 1.0003 1.00007 0.999935 0.999985 0.999951 1.00016 0.999754 1.00043 0.999383 1.00082 0.999028 1.00101 0.999142 1.00042 1.00039 0.998367 0.991207 1.01037 0.988263 1.01272 0.986697 1.01354 0.986225 1.01386 0.985973 1.01529 0.984549 1.01664 0.976238 1.02972 0.951496 1.05456 0.940963 1.05979 0.939486 1.06499 0.951854 1.02519 1.01067 0.961538 1.07107 0.884198 1.15968 0.822389 1.17726 0.815131 1.17215 0.873524 1.08046 0.959929 0.983023 1.0781 0.890647 1.12013 0.887485 1.06445 1.00587 0.944175 1.06345 0.962753 1.00924 1.01627 0.974864 0.998848 1.01404 1.0011 0.995924 1.00072 1.00041 0.997632 0.99903 1.00077 1.00025 1.00018 1.00024 0.999856 1.00014 1.00033 1.00006 1.00013 1.00034 1.00037 1.00054 1.001 1.00177 1.00327 1.00595 1.01037 1.01703 1.02564 1.03495 1.04248 1.04573 1.04369 1.03657 1.02574 1.0123 0.996791 0.979304 0.959114 0.935758 0.908746 0.880335 0.853371 0.830539 0.813274 0.801606 0.798648 0.801437 0.812715 0.831274 0.852489 0.874238 0.89885 0.920738 0.937682 0.961948 0.975705 0.995523 1.00984 1.01307 1.0491 1.05482 1.04309 1.05459 1.054 1.02723 1.01158 1.01571 1.1309 0.928358 0.990156 1.00884 1.00618 1.08027 0.938918 0.967776 1.03386 0.990079 1.02478 1.02172 0.961164 0.978263 1.02151 1.01403 0.99434 0.994432 1.00004 1.00116 1.00044 0.999925 0.999773 0.999961 0.999995 1.00013 0.999905 1.00011 0.999967 0.999868 1.00045 0.999038 1.00171 0.997286 1.00398 0.994535 1.0071 1.00092 1.00026 0.998213 1.00358 0.994553 1.00716 0.991547 1.00916 0.989534 1.00826 0.98925 1.00618 0.994926 1.00544 0.993038 1.02421 0.963452 1.05127 0.932591 1.08756 0.878891 1.14016 0.839916 1.16174 0.828595 1.16896 0.847446 1.11775 0.904912 1.08383 0.938482 1.04666 0.94258 1.07114 0.931612 1.06088 0.956333 0.992417 1.0741 0.8867 1.12189 0.904524 1.02276 1.04081 0.9562 1.01127 1.01571 0.990721 0.99228 0.999539 1.00563 1.00422 0.998425 0.998192 1.00046 0.9998 0.999192 0.999768 0.999898 1.00013 1.00033 1.00001 1.00002 1.00028 1.00033 1.00043 1.00074 1.00124 1.00217 1.00398 1.00724 1.01244 1.01992 1.02918 1.03822 1.04443 1.04552 1.04098 1.03177 1.01917 1.00446 0.987683 0.968587 0.945994 0.918876 0.887677 0.854996 0.824901 0.798752 0.779097 0.766339 0.762737 0.768822 0.781931 0.802206 0.829933 0.854952 0.883265 0.90722 0.931897 0.950657 0.968624 0.991062 1.00578 1.02255 1.02717 1.04443 1.06386 1.03467 1.05963 1.09536 0.948506 1.03241 1.01761 1.04939 1.03068 0.939001 1.06216 0.955459 0.982069 1.06558 0.985122 1.00743 1.00357 0.951416 0.999737 1.03976 1.00481 0.983073 0.995508 1.0036 1.00169 0.99993 0.999601 0.999634 0.999995 1.00013 1.00005 1.00003 0.999876 1.00026 0.99955 1.00072 0.998956 1.0014 0.998249 1.00203 0.997829 1.00208 0.998315 1.0064 0.991941 1.0096 0.98905 1.01191 0.987489 1.01256 0.987026 1.01307 0.987028 1.0161 0.983263 1.02249 0.966545 1.0408 0.941788 1.05649 0.936666 1.06326 0.935212 1.05777 0.967621 1.00701 1.02821 0.942696 1.09978 0.856028 1.17877 0.804062 1.20462 0.785411 1.19426 0.842865 1.11598 0.939952 0.984327 1.08652 0.870554 1.14093 0.891114 1.02593 1.0654 0.910756 1.04369 1.00297 0.974084 1.01901 1.00702 0.990595 0.996788 1.00062 0.99979 1.00149 1.00253 1.00032 0.998956 0.99977 1.00016 1.00005 1.00012 0.999956 0.999968 1.00026 1.00029 1.00028 1.0005 1.00082 1.00136 1.00256 1.00485 1.00872 1.01476 1.02302 1.0326 1.04105 1.0455 1.04432 1.03745 1.02632 1.01235 0.996393 0.978397 0.957262 0.931646 0.900106 0.864221 0.827277 0.792945 0.763469 0.740327 0.727195 0.723213 0.731866 0.748962 0.773981 0.803035 0.83739 0.865314 0.89475 0.921858 0.941158 0.96467 0.976559 1.00123 1.02089 1.01668 1.04627 1.05657 1.04633 1.03847 1.04204 1.09016 0.982111 0.963104 1.10474 0.979735 1.03235 0.951402 0.985349 1.09709 0.969914 0.979051 0.998697 0.962889 1.02759 1.04297 0.982593 0.976317 1.00399 1.00688 0.999877 0.999178 0.999699 0.999664 1.00008 1.00024 0.999958 1.00001 0.999876 1.0002 0.999781 1.00025 0.999785 1.00009 1.00018 0.999372 1.0013 0.997778 1.0034 0.995179 0.996675 1.00305 0.997584 1.00148 0.999715 0.999121 1.0021 0.997555 1.00241 0.99693 0.998691 0.99858 0.995329 1.00217 1.00251 0.990709 1.0287 0.963363 1.05481 0.928973 1.09623 0.878898 1.13368 0.853804 1.14707 0.846041 1.14315 0.874991 1.10283 0.907772 1.08598 0.922265 1.0885 0.885313 1.12995 0.866571 1.12011 0.930778 0.979165 1.10411 0.858299 1.10975 0.976852 0.952935 1.05288 0.994406 0.970424 1.00779 1.01513 1.0011 0.992039 0.995549 1.00168 1.00166 0.999641 1.00013 1.00072 1.0003 1.00006 1.00001 1.00005 1.00028 1.0003 1.00025 1.00039 1.00059 1.0009 1.00165 1.00319 1.00596 1.01047 1.01727 1.02624 1.03582 1.04326 1.04575 1.0422 1.03328 1.02047 1.00534 0.988243 0.968782 0.94526 0.915811 0.879533 0.838505 0.797005 0.757683 0.724098 0.69864 0.684149 0.682025 0.690972 0.713152 0.74295 0.777327 0.81506 0.850377 0.883484 0.907482 0.935642 0.954423 0.974302 0.992807 1.00729 1.03392 1.031 1.04243 1.07205 1.01815 1.02951 1.08589 1.02373 1.04422 0.940208 1.04002 1.0275 0.982569 1.07476 0.938885 0.970919 1.02946 0.983622 1.03614 1.02437 0.960415 0.984396 1.01693 1.00471 0.995947 0.999855 1.0003 0.999437 1.00017 1.0003 0.999842 0.9999 1.00002 1.00004 1.00007 0.999843 1.00031 0.999465 1.00084 0.998782 1.00166 0.997852 1.00263 0.996964 1.0033 0.996933 1.00431 0.994373 1.00685 0.992143 1.00852 0.991103 1.00855 0.991102 1.00916 0.991042 1.01397 0.983921 1.02492 0.964718 1.04057 0.948288 1.04651 0.946384 1.04942 0.951775 1.03151 0.991381 0.984601 1.04269 0.928822 1.10865 0.857554 1.16579 0.815935 1.19507 0.798532 1.18135 0.849707 1.10353 0.969053 0.942381 1.13091 0.836199 1.13932 0.953191 0.933139 1.09945 0.958968 0.97516 1.03522 0.999519 0.984594 0.999675 1.00486 1.00404 1.00098 0.997325 0.997252 0.999962 1.00113 1.00018 0.999571 0.999833 1.00012 1.00025 1.00021 1.00013 1.00024 1.00045 1.00064 1.00111 1.00213 1.004 1.00721 1.01241 1.01998 1.02946 1.03875 1.04476 1.04517 1.03937 1.02859 1.01444 0.99821 0.98004 0.958765 0.932419 0.898562 0.857165 0.810887 0.76393 0.71958 0.681636 0.654673 0.639468 0.638471 0.649935 0.674579 0.708932 0.750578 0.790507 0.834306 0.86825 0.901003 0.926895 0.948464 0.972717 0.982071 1.00611 1.03181 1.02619 1.04154 1.04919 1.07463 1.03039 0.992764 1.09583 1.00642 0.989785 1.04142 0.983436 1.06471 0.939876 0.977369 1.0605 0.984984 1.02196 1.00483 0.955473 1.00398 1.02286 0.995065 0.994482 1.00337 1.00005 0.998474 1.00051 1.00038 0.999615 0.999844 1.00017 1 1.00009 0.999826 1.00023 0.999699 1.00036 0.99961 1.00036 0.999769 0.99997 1.00047 0.998889 1.00198 1.00347 0.996251 1.00379 0.996468 1.00302 0.99773 1.00172 0.99916 1.00127 0.998106 1.00167 0.99348 1.00328 0.992619 1.00063 1.0068 0.984308 1.03159 0.963118 1.055 0.933113 1.0886 0.900576 1.10676 0.890098 1.11155 0.889434 1.09963 0.913122 1.07984 0.921752 1.08331 0.90385 1.12323 0.845615 1.1696 0.836317 1.11463 0.981853 0.908214 1.14823 0.896017 1.0052 1.05463 0.960287 0.985122 1.03027 1.00166 0.986155 0.997055 1.00475 1.00323 0.999991 0.999779 1.00029 0.999614 0.999346 0.999955 1.00025 1.00008 0.99996 1.00001 1.00018 1.00035 1.00045 1.00072 1.00137 1.00261 1.00479 1.00854 1.01449 1.02283 1.03258 1.04122 1.04557 1.0438 1.03601 1.02358 1.00832 0.991089 0.971697 0.948378 0.91863 0.880117 0.833216 0.781496 0.72854 0.679084 0.637837 0.608808 0.593905 0.592866 0.607966 0.634917 0.674754 0.720294 0.769008 0.813344 0.854279 0.891889 0.917446 0.945642 0.96167 0.983897 1.00075 1.00865 1.04506 1.03424 1.03874 1.07263 1.04336 1.02082 1.01104 1.04221 1.0724 0.9502 1.02987 0.980457 1.00118 1.07118 0.96217 1.00131 1.00451 0.967179 1.02027 1.01638 0.984858 0.999564 1.00657 0.996788 0.997857 1.00189 1.00029 0.999136 0.999967 1.00032 1.00001 0.999958 0.999975 1 1.00006 0.999862 1.00027 0.99954 1.00072 0.998933 1.00149 0.998016 1.00251 0.996965 1.00059 0.99873 1.00209 0.997042 1.00378 0.995636 1.00472 0.99516 1.00447 0.995327 1.00565 0.993926 1.0117 0.984847 1.02305 0.970489 1.03108 0.964603 1.03038 0.965695 1.02782 0.976457 1.00619 1.00881 0.973092 1.04416 0.933096 1.09122 0.887714 1.12757 0.857412 1.15109 0.850091 1.13179 0.904032 1.03667 1.04655 0.871528 1.16857 0.861232 1.03564 1.06822 0.916664 1.01845 1.04079 0.973005 0.982056 1.01525 1.00723 0.997294 0.994788 0.997608 1.00172 1.00216 1.00011 0.999283 1.00007 1.00059 1.00027 0.999981 1.00008 1.00026 1.00035 1.00039 1.00053 1.00094 1.00171 1.00312 1.0057 1.01008 1.01679 1.02575 1.03553 1.04315 1.0457 1.04183 1.0322 1.01844 1.00217 0.984033 0.963207 0.937582 0.904042 0.860623 0.808178 0.750542 0.691793 0.637516 0.593693 0.563063 0.547662 0.54765 0.563778 0.595541 0.639073 0.690205 0.745136 0.794448 0.842109 0.876723 0.91111 0.934709 0.957964 0.983535 0.99137 1.00879 1.0314 1.04568 1.04344 1.02075 1.07453 1.05476 0.997978 1.0496 0.99463 1.03125 1.00713 0.991492 1.05851 0.952519 0.999584 1.02006 0.975605 1.02179 1.00506 0.982971 1.00887 1.00471 0.991829 1.00003 1.00372 0.999011 0.998594 1.00053 1.00047 0.999861 0.999852 1.00006 0.999965 1.0001 0.999844 1.00022 0.999702 1.00038 0.999541 1.00051 0.999479 1.00045 0.999739 0.999923 0.997637 1.0028 0.996863 1.00332 0.996716 1.00309 0.997331 1.00266 0.997881 1.00298 0.996163 1.00367 0.993122 1.00303 0.996541 0.994974 1.01187 0.98041 1.02941 0.966512 1.04627 0.947109 1.06522 0.933321 1.06922 0.93238 1.06792 0.936628 1.05716 0.946967 1.05521 0.936512 1.07834 0.89606 1.13288 0.844247 1.15299 0.893818 1.01487 1.08647 0.873161 1.07017 1.01545 0.952632 1.01121 1.03022 0.983541 0.990376 1.00576 1.0027 1.00046 0.999448 0.9988 0.998883 0.999656 1.00053 1.00052 0.999875 0.999731 1.00015 1.0004 1.00032 1.00024 1.00035 1.00064 1.00115 1.00204 1.00374 1.00683 1.01187 1.01928 1.02869 1.03818 1.04456 1.0452 1.03939 1.02814 1.01326 0.996107 0.977009 0.954643 0.926371 0.888901 0.840385 0.782455 0.718797 0.654669 0.596592 0.550329 0.518953 0.502964 0.504081 0.521638 0.5569 0.604133 0.66105 0.718557 0.777201 0.826049 0.867896 0.90295 0.928103 0.955591 0.970573 0.995247 1.01294 1.01284 1.04811 1.0433 1.04103 1.0428 1.0553 1.04804 0.986396 1.03009 1.04573 0.985626 1.03507 0.959222 1.00843 1.03509 0.973521 1.01541 1.00056 0.98827 1.01405 0.997206 0.990104 1.00552 1.00356 0.996389 0.999092 1.00159 1.00022 0.999471 0.999896 1.00013 1.00003 0.999999 0.999985 0.999992 1.00003 0.999912 1.00017 0.999702 1.00048 0.999271 1.00105 0.998555 1.00189 1.00047 0.999755 0.999898 1.00054 0.998981 1.00149 0.998263 1.00197 0.998107 1.00205 0.997798 1.00393 0.994761 1.00965 0.986899 1.01691 0.980642 1.01796 0.981929 1.01501 0.984689 1.01025 0.994733 0.994501 1.01334 0.976671 1.0331 0.953506 1.0601 0.929062 1.08201 0.910749 1.09317 0.916292 1.06006 0.984634 0.950195 1.11204 0.862285 1.09804 0.992265 0.942818 1.04662 1.00717 0.964361 1.00568 1.02159 0.993631 0.994288 0.999224 1.00188 1.00236 1.0002 0.999288 0.999975 1.00026 0.99984 0.999676 1 1.0002 1.00006 1.00002 1.0002 1.00046 1.00075 1.00128 1.00238 1.00449 1.0081 1.01377 1.02181 1.03151 1.04046 1.04541 1.04416 1.03657 1.02397 1.00811 0.9902 0.970059 0.946018 0.914913 0.873413 0.819928 0.756494 0.687274 0.618464 0.557427 0.509262 0.477017 0.461209 0.462732 0.483069 0.520037 0.572315 0.632532 0.69614 0.756998 0.810504 0.859262 0.893554 0.927019 0.946407 0.966416 0.991049 1.00515 1.02246 1.02328 1.05465 1.06058 1.02163 1.04039 1.04835 1.03343 1.02532 0.987489 1.03781 0.986976 1.00935 1.0339 0.967522 1.01309 1.00538 0.992432 1.0121 0.990598 0.994328 1.01009 0.99938 0.994591 1.00165 1.0022 0.999081 0.999174 1.00024 1.00024 0.999991 0.999941 1.00002 0.999959 1.00007 0.99989 1.00016 0.999771 1.00031 0.999601 1.00049 0.999433 1.00061 0.999414 1.00116 0.998504 1.00184 0.997874 1.00234 0.997565 1.0025 0.997662 1.00278 0.997525 1.00349 0.99606 1.00356 0.995661 1.00033 1.00153 0.991447 1.01278 0.982599 1.02195 0.975738 1.03086 0.96694 1.03736 0.964523 1.03515 0.96714 1.03135 0.971314 1.02693 0.969918 1.03679 0.948764 1.06928 0.909032 1.10732 0.899215 1.06163 1.00684 0.928959 1.07863 0.972362 0.979889 1.0228 1.01042 0.975496 1.00164 1.00733 1.0003 1.00057 0.997945 0.998429 1.00058 1.00108 1.00037 0.99977 0.999856 1.00031 1.00038 1.00008 0.999975 1.00018 1.0004 1.00055 1.00084 1.00153 1.00294 1.00541 1.0095 1.01578 1.02439 1.03417 1.04233 1.04572 1.04268 1.03352 1.01977 1.00312 0.984458 0.963259 0.937385 0.903425 0.857911 0.799719 0.73108 0.656969 0.584543 0.521013 0.47167 0.438738 0.423105 0.425449 0.447124 0.486683 0.541735 0.606144 0.675011 0.738522 0.798172 0.845784 0.886485 0.918108 0.942897 0.967735 0.979333 1.00253 1.0218 1.02575 1.04139 1.0465 1.05382 1.02915 1.03942 1.04523 0.999762 1.02752 1.00731 1.00891 1.03058 0.969164 1.01412 1.01077 0.99053 1.0081 0.99049 1.00083 1.00971 0.993969 0.996598 1.00483 1.00063 0.997516 0.999769 1.00086 1.00016 0.999819 0.999937 1.00002 1 1 0.999993 0.999997 1.00001 0.999962 1.00008 0.999855 1.00025 0.999608 1.00059 0.999151 0.999442 1.00056 0.999497 1.00038 0.999809 1 1.00025 0.999731 1.0006 0.999602 1.00127 0.998564 1.00343 0.995087 1.00725 0.990651 1.00936 0.990424 1.00699 0.993796 1.00487 0.996278 1.00184 1.00179 0.994256 1.00951 0.986431 1.01907 0.974843 1.03275 0.96245 1.04395 0.956158 1.03989 0.976146 0.993979 1.0445 0.923092 1.0816 0.956053 0.991175 1.02843 0.988674 0.986231 1.01608 1.00689 0.988086 1.00044 1.00026 1.00101 1.00114 0.999309 0.999374 0.999821 0.99979 0.99987 1.00012 1.00016 1.00001 1.00004 1.00029 1.00042 1.00041 1.00053 1.00099 1.00193 1.00359 1.00641 1.01101 1.01792 1.02698 1.03661 1.04378 1.04559 1.04088 1.03035 1.01565 0.998327 0.978949 0.956641 0.928894 0.892096 0.842828 0.780263 0.707073 0.628969 0.553793 0.488475 0.438443 0.405523 0.390096 0.393565 0.416191 0.458025 0.514352 0.582045 0.65273 0.722967 0.784557 0.835873 0.879148 0.909907 0.940979 0.961182 0.98099 0.997728 1.01313 1.03756 1.02594 1.04397 1.05954 1.04375 1.02397 1.02606 1.04328 1.0139 1.00113 1.02732 0.981464 1.01607 1.01271 0.986645 1.00771 0.995083 1.00335 1.00537 0.992054 1.00154 1.00522 0.997097 0.997497 1.00152 1.00104 0.9996 0.999672 1.00003 1.00005 1 0.999982 1.00001 0.999976 1.00004 0.999939 1.00009 0.999863 1.00019 0.999733 1.00035 0.999566 1.00051 0.9996 1.00058 0.999219 1.001 0.998786 1.00142 0.998434 1.00183 0.998202 1.00255 0.997792 1.00325 0.997124 1.00237 0.998456 0.998186 1.00352 0.992052 1.0091 0.988799 1.01227 0.987143 1.01565 0.984871 1.01622 0.98599 1.01328 0.988235 1.01095 0.988718 1.01303 0.980962 1.02695 0.961602 1.04973 0.945863 1.04648 0.979477 0.984172 1.0385 0.971975 1.00495 1.00631 0.998019 0.988077 1.01018 1.00264 0.9985 0.999498 0.997749 1.00073 1.00141 1.00011 0.999684 0.999957 1.00016 1.00008 0.999876 0.999878 1.00008 1.00019 1.00018 1.00029 1.00065 1.00127 1.00234 1.00421 1.00744 1.01261 1.02011 1.02948 1.03875 1.0448 1.04505 1.03885 1.02717 1.01169 0.993782 0.973727 0.950283 0.920694 0.881196 0.828552 0.762183 0.685238 0.60418 0.526923 0.460618 0.41039 0.377712 0.362864 0.367176 0.391333 0.434023 0.492316 0.560963 0.634349 0.706808 0.771059 0.827597 0.871141 0.907576 0.933415 0.956289 0.980233 0.993045 1.01193 1.02544 1.04139 1.04143 1.04099 1.05115 1.03629 1.03245 1.02511 1.01365 1.02711 0.991966 1.0136 1.01372 0.987334 1.01043 0.998965 1.00135 1.00274 0.994732 1.00466 1.00165 0.994776 1.0002 1.00293 0.99991 0.998913 0.999896 1.00023 1.00004 0.999959 0.99998 0.999998 0.999995 1 0.999995 1 0.999998 0.999993 1.00002 0.999954 1.00009 0.999841 1.00026 1.00032 0.999627 1.00041 0.999568 1.00042 0.99962 1.00036 0.999788 1.00031 1.00023 1.00008 1.00131 0.998711 1.00308 0.996012 1.00453 0.994644 1.00352 0.996681 1.00091 0.999161 1.00033 1.0006 0.999654 1.00283 0.996894 1.00554 0.993233 1.00999 0.987967 1.01543 0.983867 1.01663 0.988021 1.00309 1.01114 0.972816 1.0367 0.969628 1.01165 1.00134 0.998505 0.999486 1.00472 0.997078 0.994396 1.00345 0.999702 1.00181 1.00033 0.998783 0.99973 1.00011 1.00012 1.0002 1.00016 1.00007 1.0001 1.00022 1.00022 1.00012 1.00017 1.00044 1.00085 1.00151 1.00272 1.00493 1.00862 1.01434 1.02233 1.03184 1.04057 1.04542 1.0442 1.03668 1.02404 1.00794 0.989542 0.968841 0.944296 0.912936 0.871015 0.81547 0.746041 0.666285 0.583178 0.504611 0.43796 0.387955 0.355559 0.341461 0.346539 0.37141 0.414517 0.47375 0.543652 0.619256 0.692185 0.760225 0.817236 0.864127 0.901779 0.929266 0.954245 0.971896 0.994395 1.00779 1.01944 1.04257 1.04073 1.03928 1.04539 1.05014 1.0253 1.01816 1.03365 1.00549 1.01256 1.01527 0.99108 1.01198 1.00059 0.999104 1.00395 0.997778 1.00338 0.998078 0.996556 1.0036 1.00191 0.998005 0.999104 1.00057 1.00028 0.999891 0.99992 0.999994 1 0.999996 0.999993 1 0.99999 1.00001 0.999975 1.00004 0.999936 1.0001 0.999861 1.00019 0.999747 1.00008 0.999859 1.00022 0.999675 1.00045 0.999414 1.00076 0.999096 1.00127 0.998774 1.00214 0.998479 1.00261 0.998455 1.00117 0.999891 0.997807 1.00266 0.9951 1.00409 0.994908 1.00435 0.995473 1.00556 0.995579 1.00548 0.996124 1.00438 0.996104 1.00473 0.993679 1.00909 0.986998 1.01712 0.980239 1.01951 0.986824 1.00324 1.00589 0.99278 1.00491 0.993657 1.00449 0.998791 1.00479 0.996966 0.998955 0.999753 0.999471 1.00119 0.999975 0.999628 1.0001 1.00006 0.999853 0.99983 0.999945 1.00007 1.00012 1.00012 1.0002 1.00039 1.00062 1.00098 1.00175 1.00323 1.00579 1.00993 1.01613 1.02451 1.03402 1.04208 1.04569 1.04312 1.03448 1.02106 1.00445 0.985646 0.964356 0.938781 0.905811 0.861805 0.803957 0.732286 0.650723 0.566393 0.487278 0.420802 0.371119 0.339225 0.325833 0.33164 0.356634 0.400014 0.458779 0.529255 0.604984 0.680522 0.749839 0.808824 0.85755 0.894937 0.927176 0.950102 0.970119 0.989794 1.00567 1.02267 1.02781 1.0453 1.04755 1.03995 1.03758 1.03842 1.0322 1.01104 1.01739 1.02041 0.996614 1.01156 1.0024 0.999594 1.00621 0.998009 1.00048 0.998358 1.00038 1.00404 0.998872 0.997422 1.00053 1.00097 0.999878 0.999714 0.999966 1.00003 0.999998 0.999989 0.999993 0.999996 0.999996 0.999999 0.999996 1 0.999995 1 0.999997 0.999997 1.00002 0.999959 0.999887 1.00015 0.999809 1.00023 0.999729 1.00031 0.999676 1.00037 0.999747 1.00041 1.00027 1.00018 1.00141 0.999027 1.00243 0.997364 1.00222 0.997439 1.00049 0.999275 0.998717 1.00044 0.99867 1.00134 0.998829 1.0026 0.997963 1.00365 0.996443 1.00483 0.995413 1.00475 0.996754 1.00121 1.00244 0.993836 1.00885 0.991139 1.00722 0.99298 1.00866 0.996335 0.996897 1.00036 1.00112 1.00224 0.99891 1.00044 0.99909 0.999744 1.00051 1.00002 0.999929 1.00005 1.00004 1.00003 1.00005 1.00001 0.999977 1.00003 1.00017 1.00033 1.00058 1.0011 1.0021 1.00385 1.00673 1.01126 1.01791 1.0266 1.03596 1.04324 1.04566 1.04188 1.0323 1.01827 1.00127 0.982126 0.960338 0.933848 0.899503 0.853808 0.794302 0.721264 0.63883 0.5541 0.475115 0.409098 0.359758 0.328389 0.315519 0.321633 0.346729 0.389885 0.448261 0.517939 0.593692 0.670009 0.740083 0.801787 0.851461 0.891095 0.921774 0.946884 0.96932 0.984292 1.00482 1.01896 1.02924 1.04066 1.04688 1.04258 1.03865 1.04087 1.02445 1.02185 1.02307 1.00222 1.01277 1.00685 1.00121 1.00669 0.997423 1.00028 1.00168 1.002 1.00134 0.997043 0.99919 1.00185 1.00035 0.999329 0.999817 1.00011 1.00003 0.999974 0.999982 0.999992 0.999994 0.999996 0.999996 0.999998 0.999997 1 0.999992 1.00001 0.999978 1.00003 0.999946 1.00008 1 1.00001 0.999974 1.00005 0.999906 1.00015 0.999769 1.00037 0.999534 1.00084 0.999295 1.00162 0.999262 1.00191 0.999477 1.00055 1.00009 0.99845 1.00088 0.99783 1.00067 0.998442 1.0002 0.999011 1.00091 0.99908 1.0019 0.998388 1.00267 0.997278 1.00356 0.995805 1.005 0.994813 1.00499 0.996023 1.00331 0.996729 1.00413 0.997604 0.995608 1.00858 0.997509 0.998324 0.998249 1.00152 1.00044 1.00002 1.00023 0.999636 1.00011 1.00011 0.99986 0.999925 1.00006 1.00009 1.00008 1.00008 1.00012 1.00019 1.00025 1.00037 1.00069 1.00134 1.0025 1.00446 1.00766 1.01261 1.01968 1.02857 1.03765 1.0441 1.04538 1.04055 1.03021 1.01572 0.998424 0.979025 0.956833 0.929621 0.894173 0.847238 0.786711 0.713158 0.630726 0.546379 0.468079 0.402593 0.353598 0.32256 0.309984 0.316046 0.340742 0.382915 0.440555 0.509682 0.585402 0.661247 0.732346 0.79418 0.845709 0.886809 0.917741 0.943916 0.964708 0.98443 0.999922 1.01519 1.03216 1.03547 1.04288 1.04887 1.04233 1.02924 1.03398 1.02915 1.00787 1.01636 1.01181 1.00245 1.00707 0.999018 1.00238 1.00385 1.00044 0.999114 0.998328 1.00142 1.00149 0.999157 0.999345 1.00022 1.00016 0.999948 0.999949 0.999986 0.999993 0.999992 0.999994 0.999995 0.999997 0.999997 0.999999 0.999998 1 0.999997 1 0.999994 1.00001 0.999995 1.00002 0.999964 1.00005 0.999924 1.0001 0.999861 1.00018 0.999787 1.00028 0.99983 1.00036 1.00032 1.00027 1.00128 0.999636 1.00167 0.998603 1.00072 0.998687 0.999406 0.999884 0.998495 1.00059 0.998178 1.00122 0.998276 1.00191 0.998385 1.0019 0.99879 1.00098 0.999791 0.999782 1.00053 0.999578 1.0001 1.00027 1.00072 0.995952 1.00814 0.993315 0.998694 1.00425 1.00069 0.998614 0.998736 1.00057 1.00008 1.00024 0.999867 0.999778 1.00012 1.00014 1.00001 0.99997 0.999972 0.999979 1.00002 1.00007 1.00014 1.00024 1.00047 1.00089 1.00163 1.00293 1.00512 1.00866 1.014 1.02141 1.03038 1.03908 1.0447 1.04494 1.0392 1.02827 1.01345 0.995952 0.976363 0.953893 0.926186 0.88998 0.842261 0.781326 0.707992 0.626364 0.543099 0.465851 0.40095 0.352223 0.321375 0.308893 0.314751 0.338589 0.379472 0.435607 0.503645 0.578404 0.654269 0.725682 0.78811 0.840315 0.88184 0.915254 0.94057 0.961699 0.981984 0.997492 1.01399 1.02629 1.03781 1.04248 1.04436 1.04211 1.03912 1.03153 1.0189 1.02357 1.01595 1.00443 1.00938 1.00274 1.00417 1.00386 0.998952 0.999733 1.00084 1.00178 1 0.998821 1.0001 1.00047 0.999975 0.999866 0.999973 1 0.999989 0.999988 0.999991 0.999994 0.999995 0.999997 0.999997 0.999998 0.999998 1 0.999998 1 0.999995 1.00001 0.999985 0.999995 1.00001 0.999993 1.00001 0.999997 0.999993 1.00003 0.999932 1.00016 0.999795 1.0005 0.999693 1.00109 0.99986 1.0014 1.00009 1.00049 0.999879 0.999122 0.999618 0.999086 0.999381 0.999647 0.999209 0.999693 0.999938 0.999177 1.00119 0.998444 1.00176 0.998461 1.00118 0.999191 1.00051 0.999386 1.00122 0.997253 1.00457 0.995547 0.999958 1.00568 0.995428 0.998606 1.00164 1.00142 0.999314 0.999464 1.00002 1.00014 1.00017 0.999885 0.999886 1.00001 1.00003 1.00002 1.00001 1.00003 1.00004 1.00006 1.00011 1.00025 1.00052 1.00101 1.00187 1.00337 1.00583 1.0097 1.01539 1.02305 1.03199 1.04025 1.04505 1.04437 1.03788 1.02651 1.01149 0.993885 0.974167 0.951552 0.923608 0.887046 0.839014 0.778216 0.705725 0.625537 0.543929 0.46799 0.403778 0.355306 0.324566 0.311987 0.317322 0.340069 0.379551 0.433992 0.500152 0.573516 0.648542 0.719717 0.783143 0.835786 0.878029 0.911459 0.937908 0.960022 0.977627 0.996621 1.01154 1.02386 1.03672 1.04219 1.04245 1.04451 1.04026 1.02744 1.02918 1.02119 1.00944 1.01409 1.00661 1.00481 1.00424 0.99986 1.00187 1.00205 1.00062 0.999315 0.999672 1.00072 1.00021 0.999743 0.999922 1.00003 0.999994 0.999977 0.999984 0.999989 0.999991 0.999993 0.999995 0.999997 0.999998 0.999998 0.999999 0.999999 1 0.999999 1 0.999997 1 0.999998 1 0.999993 1.00001 0.999976 1.00004 0.999937 1.0001 0.999879 1.00018 0.999901 1.00028 1.00025 1.00037 1.00095 1.00025 1.00114 0.99957 1.00013 0.999133 0.999081 0.999725 0.998602 1.00043 0.998368 1.00073 0.998704 1.00054 0.999467 1.00004 1.00002 0.999836 0.999863 1.0004 0.998884 1.0015 0.998711 0.999206 1.00403 0.994795 1.00127 1.00304 0.998323 0.998557 1.00053 1.00082 0.999829 0.99975 0.99991 1.00014 1.0001 0.999942 0.999948 0.999991 0.999998 0.999996 1.00002 1.00005 1.0001 1.00019 1.00035 1.00064 1.00118 1.00217 1.00385 1.00656 1.01072 1.01672 1.02456 1.0334 1.04116 1.04522 1.04375 1.03665 1.02496 1.00987 0.992245 0.97247 0.949819 0.92192 0.885437 0.837601 0.777423 0.70626 0.62798 0.548414 0.474033 0.410657 0.362522 0.331824 0.318947 0.323468 0.344905 0.382566 0.434855 0.499074 0.570874 0.644703 0.715192 0.778196 0.8315 0.874626 0.908075 0.935186 0.957184 0.976189 0.993236 1.0087 1.02373 1.03303 1.04161 1.04531 1.04238 1.03741 1.0374 1.02627 1.01672 1.01994 1.01002 1.00662 1.00672 1.00202 1.0034 1.00203 1.00001 1.00012 1.00068 1.00064 0.999836 0.999814 1.00009 1.00004 0.999963 0.999972 0.999985 0.999987 0.999989 0.999991 0.999993 0.999995 0.999997 0.999998 0.999998 0.999999 0.999999 1 0.999999 1 0.999999 1 1 0.999998 1 0.999995 1.00001 0.99999 1.00001 0.999997 0.999992 1.00006 0.999937 1.00025 0.999925 1.00065 1.00015 1.00104 1.0004 1.00072 0.999993 0.999695 0.999305 0.999271 0.999177 0.999477 0.999402 0.999441 0.999906 0.999228 1.00028 0.99938 1.0001 0.999873 0.999711 1.00006 1.00015 0.99883 1.00226 0.996994 1.00139 1.0019 0.996687 1.0006 1.00165 0.999625 0.999096 1.00012 1.00035 1.00002 0.999833 0.999917 1.00008 1.00005 0.999986 0.999988 1 1.00001 1.00001 1.00003 1.00007 1.00017 1.00036 1.00072 1.00137 1.0025 1.00437 1.00731 1.01173 1.01798 1.02594 1.03459 1.04186 1.04525 1.04314 1.03556 1.02365 1.00859 0.991057 0.971305 0.948712 0.9211 0.885152 0.838064 0.778989 0.709505 0.633434 0.556117 0.483524 0.421182 0.373496 0.342842 0.329578 0.333241 0.353236 0.388694 0.438394 0.500114 0.56978 0.642187 0.711761 0.774277 0.827614 0.870981 0.90554 0.932504 0.954473 0.974269 0.990589 1.00681 1.02075 1.03229 1.04006 1.04442 1.04322 1.04097 1.03425 1.02675 1.02531 1.01453 1.01104 1.01047 1.00445 1.00471 1.00256 1.00082 1.00136 1.00099 1.00027 0.999876 1.00012 1.00017 0.999978 0.999954 0.999988 0.999988 0.999984 0.999986 0.999989 0.999992 0.999994 0.999995 0.999997 0.999998 0.999998 0.999999 0.999999 0.999999 1 1 1 0.999999 1 0.999999 1 0.999998 1 0.999992 1.00002 0.999972 1.00005 0.999937 1.00011 0.999938 1.0002 1.00011 1.00037 1.00057 1.00055 1.00087 1.0003 1.00028 0.999663 0.999354 0.999586 0.998974 0.999928 0.99904 1.00001 0.999432 0.999784 0.999851 0.999767 0.999731 1.00028 0.999194 1.00088 0.998935 1.00028 1.00114 0.997501 1.00161 1.00079 0.998369 0.999976 1.0008 0.999998 0.999639 0.999967 1.00017 1.00009 0.999906 0.999926 1.00001 1.00002 0.999991 0.999983 0.999992 1.00001 1.00004 1.0001 1.00021 1.00042 1.00083 1.00156 1.00281 1.00486 1.00803 1.0127 1.01914 1.02715 1.03558 1.04234 1.04515 1.04256 1.03465 1.02262 1.00765 0.99033 0.970708 0.948255 0.921107 0.88611 0.840352 0.782908 0.715442 0.641723 0.566794 0.496128 0.435062 0.388005 0.357447 0.343791 0.346502 0.364863 0.398036 0.444972 0.503572 0.570559 0.640862 0.709199 0.77122 0.824394 0.867953 0.90263 0.930073 0.952549 0.97121 0.988976 1.00469 1.0184 1.0308 1.039 1.0431 1.04474 1.04105 1.03429 1.03179 1.02167 1.01717 1.01487 1.00746 1.00689 1.00434 1.00229 1.00237 1.00114 1.00041 1.00037 1.00038 1.00013 0.999968 1.00001 1.00001 0.999987 0.999982 0.999985 0.999988 0.99999 0.999992 0.999994 0.999996 0.999997 0.999998 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 0.999998 1 0.999994 1.00001 0.99999 1.00001 1.00001 1 1.00009 1.00002 1.00031 1.00018 1.00068 1.00046 1.00082 1.00036 1.00029 0.999826 0.999655 0.99956 0.999521 0.999654 0.999602 0.999808 0.999733 0.999787 0.999965 0.999691 1.0001 0.999799 0.999715 1.00073 0.998667 1.00105 1.00008 0.998675 1.00093 1.00037 0.999374 0.999902 1.00025 1.00004 0.999893 0.99994 1.00005 1.00004 0.999995 0.999984 0.999986 0.999981 0.999983 0.999992 1 1.00004 1.00011 1.00025 1.0005 1.00097 1.00178 1.00314 1.00536 1.00874 1.01361 1.02019 1.02819 1.03637 1.04266 1.04498 1.04206 1.03397 1.02189 1.00707 0.990053 0.970703 0.948487 0.921912 0.888168 0.844292 0.789086 0.724043 0.652851 0.58036 0.511755 0.452144 0.40592 0.375575 0.361529 0.363124 0.379588 0.410281 0.454131 0.509475 0.573291 0.641139 0.707835 0.768843 0.821517 0.865161 0.899998 0.927755 0.950213 0.969269 0.98648 1.00225 1.01692 1.02864 1.03806 1.04296 1.04412 1.04148 1.03811 1.02933 1.0246 1.02017 1.01196 1.01066 1.00703 1.00412 1.00362 1.00176 1.00111 1.00093 1.00051 1.00017 1.00009 1.0001 1.00003 0.999991 0.999989 0.999988 0.999987 0.999989 0.999991 0.999993 0.999995 0.999996 0.999997 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.999987 1.00002 0.99997 1.00005 0.99996 1.00011 1.00002 1.00024 1.00026 1.00046 1.00059 1.00055 1.00054 1.00024 1.00003 0.999938 0.999658 0.999902 0.999671 0.999913 0.999837 0.999875 0.999947 0.999972 0.999713 1.00038 0.999449 1.00033 1.00005 0.999319 1.00083 0.999758 0.999496 1.00038 1.00013 0.999818 0.999961 1.00007 1.00002 0.999948 0.999977 1.00001 1 0.99998 0.999988 0.999996 0.999994 0.999994 1.00001 1.00004 1.00012 1.00026 1.00055 1.00107 1.00198 1.00346 1.00583 1.0094 1.01445 1.02111 1.02905 1.03697 1.04285 1.04476 1.04164 1.03353 1.0215 1.00685 0.990199 0.971285 0.949453 0.923518 0.891175 0.849608 0.797257 0.735187 0.666841 0.596917 0.530492 0.47248 0.427235 0.397187 0.382661 0.383001 0.397504 0.42548 0.465989 0.517632 0.577912 0.642903 0.707462 0.767202 0.819212 0.862495 0.897633 0.925536 0.947988 0.967308 0.984245 1.00006 1.01445 1.02721 1.03647 1.04271 1.04395 1.04271 1.03769 1.03215 1.02642 1.01857 1.01566 1.01057 1.00693 1.00562 1.00307 1.00224 1.00155 1.0008 1.00045 1.00033 1.00019 1.00006 1.00003 1.00001 0.999996 0.999989 0.999989 0.99999 0.999992 0.999994 0.999995 0.999996 0.999997 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999994 1.00001 0.999988 1.00002 0.999985 1.00003 1.00001 1.00004 1.0001 1.00011 1.00032 1.00029 1.00057 1.00041 1.00051 1.00027 1.00015 1.00008 0.9999 0.999986 0.999918 0.999932 1.00005 0.999858 1.00011 0.999906 0.999992 1.0001 0.999713 1.00039 0.99974 0.999859 1.00037 0.999839 0.999839 1.00011 1.00005 0.999958 0.999987 1.00003 1.00001 0.999981 0.999976 0.99999 0.999991 0.999985 0.999979 0.999973 0.999987 1.00001 1.00005 1.00014 1.00031 1.00062 1.00119 1.00217 1.00377 1.00628 1.01 1.01518 1.02189 1.02972 1.03739 1.04293 1.04454 1.04132 1.03333 1.02148 1.00703 0.99075 0.972399 0.951163 0.925967 0.895053 0.855987 0.806997 0.748536 0.683554 0.616539 0.552457 0.496202 0.452008 0.422238 0.407101 0.405948 0.418251 0.44338 0.480557 0.528286 0.584604 0.646091 0.708156 0.766221 0.817377 0.860399 0.89531 0.923335 0.94611 0.965144 0.982243 0.997967 1.01242 1.02509 1.03523 1.04165 1.04433 1.04299 1.03876 1.03386 1.02625 1.0216 1.01559 1.01102 1.00855 1.0052 1.0038 1.0025 1.00145 1.00096 1.00063 1.00033 1.00017 1.0001 1.00005 1.00001 0.999999 0.999994 0.999992 0.999992 0.999993 0.999995 0.999996 0.999997 0.999998 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999993 1.00002 0.999988 1.00004 0.999997 1.0001 1.00007 1.00024 1.00023 1.00039 1.00036 1.00036 1.00029 1.00017 1.00013 1.00005 1.00002 1.00004 0.999996 1.00004 0.999997 1.00007 0.99991 1.00015 0.99992 0.999963 1.00016 0.999853 1 1.00011 0.999967 0.99996 1.00002 1 0.999993 1 1 1 0.999996 0.999992 0.999988 0.99998 0.999983 0.999985 0.999988 1.00001 1.00006 1.00015 1.00034 1.00069 1.0013 1.00235 1.00405 1.00667 1.01052 1.01581 1.02253 1.03022 1.03764 1.04292 1.04434 1.04111 1.03335 1.02183 1.00766 0.991718 0.973975 0.953545 0.929285 0.899808 0.863225 0.81783 0.763519 0.702541 0.638962 0.577578 0.52323 0.480148 0.450539 0.434594 0.431797 0.441669 0.463775 0.497368 0.54122 0.593361 0.65097 0.710051 0.766114 0.816071 0.858493 0.893318 0.921332 0.944092 0.963252 0.980149 0.995808 1.0105 1.02324 1.03381 1.04076 1.04419 1.04332 1.04023 1.03414 1.02872 1.02205 1.01653 1.01269 1.00833 1.00613 1.00411 1.00258 1.00176 1.0011 1.00063 1.00038 1.00023 1.00012 1.00005 1.00002 1.00001 0.999997 0.999994 0.999994 0.999994 0.999995 0.999996 0.999997 0.999998 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1.00001 0.999992 1.00001 0.999987 1.00002 0.999988 1.00003 1.00001 1.00005 1.00007 1.00013 1.00019 1.00023 1.00028 1.00023 1.00024 1.00015 1.00011 1.0001 1.00004 1.00004 1.00008 0.999978 1.00006 1.00005 0.999971 1.00006 0.999984 1.00003 1.00001 0.999973 1.00002 1.00002 0.999982 1.00001 1.00001 0.99999 0.999997 0.999995 1 0.999996 0.999988 0.999985 0.999982 0.999982 0.999981 0.999989 1.00001 1.00006 1.00017 1.00037 1.00074 1.0014 1.00251 1.00429 1.00701 1.01095 1.0163 1.02301 1.03056 1.03775 1.04284 1.04419 1.04105 1.03358 1.0225 1.00873 0.993149 0.975981 0.956473 0.933396 0.905465 0.871265 0.829407 0.779498 0.723059 0.663523 0.605299 0.553152 0.511252 0.481732 0.464805 0.460173 0.467494 0.486537 0.516467 0.556191 0.603991 0.657548 0.713158 0.766895 0.815392 0.856947 0.891426 0.919486 0.942247 0.961313 0.978178 0.993759 1.00817 1.02154 1.03218 1.03994 1.04366 1.04408 1.04076 1.03577 1.0296 1.02335 1.01808 1.01283 1.00956 1.00651 1.00432 1.003 1.00188 1.00119 1.00074 1.00044 1.00025 1.00014 1.00007 1.00003 1.00001 1 0.999997 0.999995 0.999995 0.999996 0.999997 0.999998 0.999998 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999996 1 0.999995 1.00001 0.999995 1.00001 1 1 1.00002 1.00001 1.00006 1.00006 1.00013 1.00012 1.00017 1.00014 1.00013 1.00013 1.00006 1.00009 1.00005 1.00001 1.00007 1.00002 1 1.00003 1.00003 0.999996 1.00001 1.00002 0.999999 0.999991 1.00002 1.00001 0.999997 1.00001 0.999993 0.999994 1 0.999996 0.999986 0.999986 0.99999 0.999986 0.99998 0.999979 0.999992 1.00002 1.00007 1.00018 1.0004 1.0008 1.00148 1.00264 1.00449 1.00729 1.01129 1.01666 1.02333 1.03074 1.03773 1.04268 1.04407 1.04113 1.03402 1.02344 1.01021 0.995081 0.978438 0.959842 0.938121 0.911942 0.880112 0.841601 0.796006 0.744348 0.689303 0.634723 0.585147 0.544599 0.51517 0.497225 0.490659 0.495383 0.511184 0.537511 0.573119 0.616504 0.665648 0.717589 0.768554 0.815217 0.855855 0.889819 0.917683 0.940474 0.959516 0.976276 0.991726 1.0062 1.01936 1.03069 1.0389 1.04335 1.04414 1.04169 1.03695 1.0307 1.02484 1.0188 1.01416 1.01004 1.007 1.00489 1.00317 1.00209 1.00132 1.00082 1.00048 1.00028 1.00016 1.00008 1.00004 1.00002 1 0.999999 0.999997 0.999996 0.999997 0.999997 0.999998 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999998 1 1 0.999997 1.00001 0.999993 1.00001 0.999989 1.00002 0.999999 1.00004 1.00003 1.00006 1.00007 1.00008 1.00009 1.00005 1.00008 1.00005 1.00002 1.00006 1.00002 1.00001 1.00003 1.00002 1.00002 1 1.00001 1.00002 1 0.999998 1.00001 1.00001 0.999988 0.999995 1.00001 1 0.999987 0.999991 1 0.999994 0.999982 0.999977 0.999983 0.999989 0.999997 1.00002 1.00008 1.0002 1.00042 1.00083 1.00155 1.00274 1.00463 1.00748 1.01152 1.01689 1.02348 1.03077 1.03761 1.04248 1.04398 1.04135 1.03468 1.02464 1.01202 0.997479 0.981398 0.963627 0.943266 0.919006 0.889662 0.854381 0.812874 0.765893 0.715495 0.664892 0.618216 0.579292 0.550083 0.531192 0.522733 0.524883 0.53748 0.560095 0.591645 0.630682 0.67533 0.723279 0.77115 0.81581 0.855111 0.888496 0.916087 0.938755 0.957818 0.974466 0.989721 1.00426 1.01746 1.02895 1.03765 1.04302 1.04429 1.04245 1.03795 1.03232 1.02581 1.02015 1.01497 1.01081 1.00768 1.00518 1.0035 1.00227 1.00146 1.0009 1.00055 1.00032 1.00018 1.0001 1.00005 1.00002 1.00001 1 0.999999 0.999998 0.999998 0.999998 0.999998 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999996 1.00001 0.999991 1.00001 0.999989 1.00001 0.999992 1.00001 1.00001 1.00001 1.00003 1.00002 1.00004 1.00002 1.00005 1.00003 1.00002 1.00004 1.00001 1 1.00003 1.00002 0.999989 1.00001 1.00003 0.999995 1 1.00001 1.00001 0.999992 1 1.00001 1 0.999991 0.999994 1.00001 0.999999 0.999989 0.999984 0.99999 0.999989 0.999981 0.999984 0.999997 1.00003 1.00009 1.00021 1.00044 1.00086 1.00159 1.0028 1.00471 1.00758 1.01163 1.01697 1.02347 1.03063 1.03737 1.04224 1.04391 1.04168 1.03555 1.0261 1.01412 1.00025 0.984839 0.967868 0.948749 0.926395 0.899627 0.867583 0.829996 0.787482 0.741635 0.695106 0.651594 0.614514 0.58575 0.566055 0.555887 0.555524 0.565019 0.583994 0.61149 0.646163 0.686482 0.730259 0.774769 0.817067 0.854919 0.887429 0.91468 0.937241 0.956135 0.972674 0.987891 1.00212 1.0156 1.02727 1.03647 1.04223 1.04445 1.043 1.039 1.03338 1.02728 1.0212 1.01595 1.01168 1.00818 1.00567 1.0038 1.00249 1.00159 1.001 1.0006 1.00036 1.0002 1.00011 1.00006 1.00003 1.00001 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999994 1.00001 0.999993 1.00001 0.999995 1 1 0.999997 1.00001 0.999994 1.00002 1 1.00002 1.00001 1 1.00003 1 1 1.00003 0.999999 0.999994 1.00002 1.00001 0.999999 1 1.00001 1 1 1 1.00001 0.999999 0.999993 0.999997 1 0.999998 0.999988 0.999994 0.999997 0.999991 0.999987 0.999985 0.999993 1 1.00003 1.00009 1.00021 1.00045 1.00087 1.0016 1.00282 1.00473 1.00759 1.01161 1.0169 1.0233 1.03034 1.03701 1.04194 1.04387 1.04209 1.03657 1.02779 1.01648 1.00331 0.988664 0.972543 0.954579 0.93397 0.909694 0.880862 0.847122 0.80891 0.767456 0.724992 0.684741 0.649688 0.621554 0.601281 0.58957 0.586876 0.593389 0.608842 0.632391 0.662827 0.698765 0.738431 0.779448 0.819045 0.855224 0.886775 0.91345 0.935784 0.954629 0.971023 0.986042 1.00024 1.01356 1.02554 1.03517 1.04155 1.04431 1.04361 1.04005 1.03458 1.02848 1.02243 1.01701 1.0124 1.00886 1.00611 1.00412 1.00271 1.00175 1.00109 1.00067 1.0004 1.00023 1.00013 1.00007 1.00004 1.00002 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999997 1 0.999996 1 0.999998 1 1 0.999996 1.00001 0.999991 1.00001 0.999993 1.00001 1 0.999999 1.00002 0.99999 1 1.00002 0.999991 0.999999 1.00002 1 0.999995 1 1.00001 0.999999 0.999994 1.00001 1.00001 0.999992 0.999995 1.00001 1.00001 0.99999 0.999991 1 0.999999 0.999989 0.999987 0.999992 0.999994 0.999993 1.00001 1.00003 1.00009 1.00021 1.00044 1.00086 1.00159 1.00279 1.00468 1.0075 1.01146 1.01666 1.02297 1.02989 1.03652 1.04158 1.04383 1.04256 1.0377 1.02966 1.01908 1.00663 0.992758 0.977549 0.960725 0.94171 0.919699 0.893894 0.863866 0.829808 0.792626 0.754175 0.717225 0.684291 0.656949 0.636323 0.623315 0.618529 0.622245 0.634305 0.654056 0.680423 0.712108 0.747662 0.785045 0.821915 0.856095 0.886426 0.912526 0.934525 0.953161 0.969483 0.984295 0.998393 1.01169 1.02379 1.03372 1.04075 1.04413 1.04398 1.04085 1.03583 1.02971 1.02361 1.01799 1.0133 1.00948 1.00659 1.00446 1.00295 1.0019 1.00119 1.00074 1.00044 1.00026 1.00014 1.00008 1.00004 1.00002 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999999 1 1 0.999997 1 0.999993 1.00001 0.999995 1 1 0.999995 1.00001 0.99999 1 1.00001 0.999988 1 1.00001 0.999997 0.999991 1.00001 1.00001 0.999992 1 1.00001 0.999998 0.999993 1 1.00001 0.999994 0.999991 1 1.00001 0.999994 0.999991 0.999997 0.999999 0.999995 0.999996 0.999999 1.00001 1.00004 1.00009 1.00021 1.00043 1.00084 1.00155 1.00272 1.00456 1.00731 1.01118 1.01626 1.02245 1.02927 1.03589 1.04112 1.04376 1.04306 1.0389 1.03164 1.02186 1.01017 0.997063 0.982751 0.967069 0.949556 0.92959 0.906519 0.879904 0.849761 0.816683 0.782184 0.748525 0.717762 0.691398 0.670671 0.656661 0.650054 0.65124 0.660156 0.676272 0.698656 0.726297 0.75786 0.791621 0.825507 0.857619 0.886583 0.911823 0.933434 0.951913 0.967977 0.982689 0.996557 1.00985 1.02202 1.03233 1.03981 1.04387 1.04432 1.04172 1.03689 1.03098 1.02477 1.01907 1.01412 1.01015 1.00709 1.00482 1.00318 1.00206 1.0013 1.0008 1.00048 1.00028 1.00016 1.00009 1.00005 1.00003 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1 0.999996 1 1 0.999994 1.00001 0.999989 1.00001 1.00001 0.999987 1.00001 1.00001 0.999989 0.999996 1.00001 0.999999 0.999992 1 1.00001 0.999996 0.999998 1 1 0.999992 0.999999 1.00001 1 0.999994 0.999999 1 1 0.999995 0.999997 1 1.00001 1.00001 1.00004 1.00009 1.0002 1.00041 1.0008 1.00148 1.00261 1.00438 1.00703 1.01077 1.01571 1.02175 1.02848 1.0351 1.04052 1.04362 1.04356 1.04015 1.0337 1.02475 1.01386 1.00154 0.988087 0.973471 0.957377 0.939288 0.918668 0.895107 0.868514 0.83928 0.808555 0.778096 0.749555 0.724355 0.703841 0.689163 0.681075 0.680009 0.686043 0.698769 0.717439 0.741154 0.768833 0.799042 0.829941 0.85976 0.887178 0.911495 0.932586 0.950749 0.966671 0.981151 0.994885 1.00802 1.02027 1.03086 1.03882 1.04343 1.04452 1.04242 1.03794 1.03214 1.02598 1.02009 1.01501 1.01084 1.00759 1.00518 1.00345 1.00223 1.00141 1.00087 1.00052 1.00031 1.00018 1.0001 1.00005 1.00003 1.00002 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999997 1 0.999999 0.999998 1.00001 0.999993 1.00001 1 0.999991 1.00001 1 0.999989 1 1.00001 0.999994 0.999995 1.00001 1 0.999994 0.999999 1.00001 0.999997 0.999993 1 1.00001 0.999995 0.999997 1 1 0.999999 1 1.00001 1.00001 1.00001 1.00001 1.00002 1.00004 1.0001 1.00019 1.00039 1.00075 1.00139 1.00245 1.00413 1.00666 1.01024 1.015 1.02087 1.02748 1.03413 1.03978 1.04334 1.04398 1.04139 1.0358 1.0277 1.01765 1.00614 0.993511 0.979873 0.965051 0.948666 0.930245 0.909403 0.885987 0.860248 0.833022 0.805586 0.779287 0.755463 0.735486 0.720477 0.711237 0.708254 0.711686 0.721287 0.736485 0.756517 0.780509 0.807217 0.835122 0.862568 0.888292 0.911527 0.931994 0.949789 0.965481 0.979762 0.993276 1.00629 1.01859 1.02937 1.03775 1.04295 1.04462 1.04302 1.03893 1.03329 1.02711 1.02116 1.01588 1.01152 1.00812 1.00555 1.0037 1.00241 1.00152 1.00094 1.00057 1.00034 1.00019 1.00011 1.00006 1.00003 1.00002 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999999 1 1 0.999999 1 0.999999 0.999997 1.00001 0.999992 1.00001 1 0.999992 1.00001 1 0.999989 1.00001 1.00001 0.99999 1 1.00001 0.999998 0.999994 1 1 0.999994 1 1.00001 1 0.999993 1 1.00001 1 0.999999 1 1.00001 1.00001 1.00001 1.00001 1.00002 1.00003 1.00005 1.00009 1.00018 1.00035 1.00069 1.00128 1.00227 1.00384 1.00621 1.00959 1.01413 1.0198 1.02628 1.03294 1.03883 1.04288 1.04426 1.04256 1.03787 1.03066 1.02146 1.01078 0.998971 0.986234 0.972539 0.957633 0.941148 0.922702 0.902123 0.879533 0.855476 0.830868 0.806812 0.784559 0.765384 0.750364 0.740289 0.735687 0.736843 0.743621 0.755596 0.772203 0.792703 0.81608 0.840998 0.866032 0.889952 0.911972 0.931671 0.949065 0.964448 0.978502 0.991809 1.00469 1.01693 1.02789 1.03665 1.04236 1.04461 1.04355 1.03981 1.03439 1.02824 1.02218 1.01676 1.01223 1.00864 1.00593 1.00396 1.00258 1.00164 1.00101 1.00061 1.00036 1.00021 1.00012 1.00007 1.00004 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 1 1 0.999999 1 0.999999 1 1 1 0.999994 1.00001 0.999996 0.999997 1.00001 0.999993 0.999997 1.00001 1 0.999991 1.00001 1.00001 0.999996 0.999994 1.00001 1 0.999994 1 1 0.999998 0.999998 1 1 0.999997 1 1.00001 1.00001 1 1.00001 1.00002 1.00002 1.00003 1.00003 1.00005 1.00009 1.00016 1.00032 1.00062 1.00115 1.00206 1.0035 1.00569 1.00884 1.01313 1.01856 1.02488 1.03152 1.03763 1.0422 1.04433 1.04356 1.03986 1.03359 1.02527 1.01541 1.00441 0.992528 0.979821 0.966184 0.951338 0.934974 0.916886 0.897084 0.875881 0.853912 0.832102 0.811549 0.793395 0.778604 0.767978 0.762088 0.761266 0.765535 0.77461 0.788053 0.805287 0.825494 0.847531 0.870121 0.892169 0.912854 0.931704 0.948545 0.963624 0.977408 0.990484 1.00317 1.01536 1.02644 1.03551 1.04171 1.04452 1.04396 1.04063 1.03541 1.02932 1.0232 1.01763 1.01292 1.00917 1.00631 1.00423 1.00276 1.00175 1.00108 1.00066 1.00039 1.00023 1.00013 1.00007 1.00004 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 1 1 1 1 1 0.999999 1 0.999997 1 1 0.999992 1.00001 0.999999 0.999994 1.00001 1 0.999994 1 1.00001 0.999992 1 1 0.999996 1 1 1 0.999991 1 1.00001 1 0.999996 0.999999 1.00001 1.00001 1.00001 1.00001 1.00001 1.00002 1.00003 1.00004 1.00004 1.00005 1.00008 1.00015 1.00029 1.00055 1.00102 1.00183 1.00314 1.00513 1.00802 1.01201 1.01715 1.02326 1.02986 1.03615 1.04121 1.04413 1.04433 1.04166 1.03641 1.02903 1.02001 1.00981 0.99872 0.986899 0.974337 0.96087 0.946258 0.930304 0.912918 0.894254 0.874749 0.855156 0.836381 0.819364 0.805023 0.7941 0.787218 0.784763 0.786846 0.793324 0.803905 0.818142 0.835363 0.854625 0.874815 0.894941 0.914202 0.932086 0.948322 0.962992 0.976502 0.989317 1.00179 1.01388 1.02504 1.03438 1.04102 1.04433 1.04429 1.04134 1.03637 1.03035 1.02419 1.01849 1.01362 1.0097 1.00669 1.00449 1.00293 1.00186 1.00115 1.0007 1.00041 1.00024 1.00014 1.00008 1.00004 1.00003 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 0.999999 1 0.999997 1 0.999998 1 1 0.999999 0.999998 1.00001 0.999991 1 1.00001 0.999987 1.00001 1.00001 0.999983 1.00001 1.00001 0.999994 0.999993 1.00001 1.00001 0.999995 0.999995 1 1 1 1 0.999997 0.999998 1.00001 1.00001 1 0.999996 1.00001 1.00002 1.00002 1.00002 1.00002 1.00003 1.00004 1.00005 1.00006 1.00008 1.00014 1.00025 1.00047 1.00089 1.0016 1.00276 1.00454 1.00716 1.01081 1.01561 1.02145 1.02794 1.03438 1.03989 1.04357 1.04477 1.0432 1.03903 1.03264 1.02452 1.01513 1.0048 0.993777 0.982139 0.969816 0.956653 0.942471 0.927147 0.910713 0.893489 0.876014 0.858982 0.8432 0.829462 0.81849 0.810912 0.807137 0.807368 0.811592 0.819604 0.831106 0.84559 0.862204 0.880057 0.898262 0.916042 0.932854 0.948394 0.962612 0.975789 0.988337 1.00058 1.01253 1.02372 1.03327 1.04027 1.04409 1.04453 1.04197 1.03725 1.03134 1.02513 1.01931 1.01429 1.01021 1.00707 1.00475 1.0031 1.00197 1.00122 1.00074 1.00043 1.00025 1.00014 1.00008 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999996 1 0.999998 0.999999 1 0.999995 1 1 0.999992 1.00001 0.999995 0.999998 1.00001 0.999997 1 0.999998 1 1 0.999997 0.999992 1.00001 1 0.999988 0.999999 1.00001 1.00001 0.999995 0.999992 1 1.00002 1.00001 1 1 1.00001 1.00003 1.00004 1.00004 1.00003 1.00004 1.00006 1.00007 1.00009 1.00013 1.00022 1.0004 1.00076 1.00137 1.00238 1.00395 1.00628 1.00957 1.01397 1.01948 1.02578 1.03229 1.03819 1.04259 1.04478 1.04436 1.04135 1.03604 1.02888 1.02032 1.01076 1.00048 0.989641 0.978273 0.966286 0.953552 0.939948 0.92546 0.910262 0.894729 0.879368 0.864852 0.851853 0.841055 0.83304 0.828251 0.826966 0.829241 0.835012 0.844079 0.856028 0.870189 0.885805 0.902102 0.91835 0.934041 0.9488 0.962508 0.975301 0.98754 0.999547 1.01132 1.02247 1.03219 1.03954 1.04379 1.04468 1.04252 1.03806 1.03225 1.02603 1.02011 1.01494 1.01071 1.00743 1.005 1.00327 1.00207 1.00128 1.00077 1.00045 1.00026 1.00015 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999998 1 0.999999 0.999999 1 0.999994 1.00001 0.999998 0.999993 1.00002 0.999979 1.00001 1.00001 0.999982 1 1.00002 0.999977 0.999998 1.00001 1 0.999999 0.999983 1.00001 1.00002 0.999987 0.999995 0.999999 1.00001 1.00003 1 0.999977 1 1.00003 1.00002 1 0.999997 1.00002 1.00004 1.00005 1.00005 1.00005 1.00006 1.00007 1.00009 1.00012 1.0002 1.00034 1.00063 1.00115 1.00201 1.00338 1.00541 1.00833 1.0123 1.01738 1.02341 1.0299 1.0361 1.04115 1.04429 1.04503 1.04324 1.0391 1.03299 1.02534 1.01657 1.00702 0.996899 0.986327 0.975291 0.963732 0.951547 0.938689 0.925238 0.911417 0.897615 0.884346 0.872199 0.861743 0.853526 0.848024 0.845525 0.846177 0.850014 0.85692 0.866588 0.878486 0.891997 0.906412 0.921127 0.935655 0.949586 0.962696 0.975058 0.986963 0.998691 1.01028 1.02137 1.0312 1.03881 1.04344 1.04476 1.04298 1.03878 1.03309 1.02687 1.02087 1.01557 1.01119 1.00778 1.00524 1.00342 1.00217 1.00134 1.00081 1.00047 1.00027 1.00015 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1 0.999997 1 1 0.999995 1.00001 0.999999 0.999991 1.00002 0.999978 1.00001 1.00002 0.999958 1.00003 1.00002 0.999958 1.00002 1.00001 0.999999 0.999963 1.00002 1.00004 0.999982 0.999937 1.00005 1.00004 0.999969 0.999982 0.999999 1.00002 1.00004 1 0.999967 0.999996 1.00004 1.00004 1.00002 0.999991 1.00002 1.00005 1.00007 1.00008 1.00007 1.00007 1.00009 1.00012 1.00018 1.0003 1.00053 1.00095 1.00167 1.00283 1.00458 1.00712 1.01063 1.01524 1.02088 1.02722 1.03361 1.03921 1.04325 1.04513 1.04461 1.04171 1.03674 1.0301 1.02218 1.01336 1.00393 0.994057 0.983811 0.973187 0.962138 0.950605 0.938609 0.926278 0.913893 0.901825 0.890546 0.880559 0.872356 0.866381 0.862951 0.8623 0.864509 0.869533 0.877173 0.887021 0.898537 0.911154 0.924374 0.937714 0.95073 0.963203 0.975092 0.986609 0.99807 1.00944 1.0204 1.03028 1.03813 1.04308 1.04479 1.04337 1.03941 1.03385 1.02765 1.02158 1.01615 1.01164 1.0081 1.00546 1.00357 1.00226 1.00139 1.00083 1.00049 1.00028 1.00016 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999995 1.00001 0.999988 1.00001 0.999995 0.999993 1.00002 0.999972 1.00002 1.00001 0.999958 1.00005 0.999975 0.999969 1.00005 1 0.999936 1.00004 1.00006 0.999945 0.99995 1.00004 1.00011 0.999889 0.999912 1.00013 1.00004 0.999943 0.999976 1.00001 1.00002 1.00007 1.00002 0.999956 0.999979 1.00003 1.00006 1.00003 0.999996 1.00001 1.00006 1.00009 1.0001 1.00009 1.00009 1.00011 1.00016 1.00027 1.00046 1.00079 1.00138 1.00233 1.00381 1.00598 1.00903 1.01312 1.01828 1.02432 1.03074 1.03677 1.04161 1.04458 1.04532 1.04374 1.04001 1.03447 1.02749 1.01947 1.01074 1.00151 0.991938 0.982081 0.971925 0.961441 0.950624 0.939553 0.92841 0.917447 0.907033 0.8976 0.889554 0.883327 0.879243 0.877548 0.878407 0.881842 0.887689 0.895675 0.905386 0.916291 0.928042 0.940197 0.952248 0.964026 0.975457 0.986562 0.997632 1.00881 1.01963 1.02947 1.0375 1.04276 1.04477 1.04366 1.03997 1.03453 1.02833 1.02221 1.01669 1.01205 1.0084 1.00567 1.0037 1.00234 1.00143 1.00086 1.0005 1.00029 1.00016 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.999993 1.00001 0.999999 0.999994 1.00002 0.999978 1.00002 1.00001 0.999956 1.00007 0.999947 0.999973 1.00012 0.99989 0.999969 1.00016 0.999912 0.999894 1.00009 1.00015 0.999851 0.999803 1.00026 1.00019 0.999653 0.999921 1.00029 1.00004 0.999856 0.999999 1.00004 0.999998 1.00005 1.00006 0.999979 0.999935 0.999992 1.00009 1.00006 0.999999 1.00001 1.00005 1.0001 1.00012 1.00012 1.00011 1.00014 1.00022 1.00038 1.00066 1.00113 1.00191 1.00313 1.00495 1.00755 1.01109 1.01569 1.02129 1.02755 1.03384 1.03935 1.04333 1.04531 1.04506 1.04264 1.03831 1.03239 1.02527 1.01728 1.0087 0.999741 0.990523 0.981084 0.971423 0.961554 0.951516 0.941422 0.931442 0.921834 0.912982 0.905213 0.89889 0.894375 0.891908 0.891648 0.893762 0.898077 0.904369 0.912432 0.921811 0.932127 0.943062 0.954185 0.965199 0.976113 0.986802 0.997471 1.00835 1.01908 1.02881 1.03691 1.04246 1.04474 1.04386 1.04042 1.03514 1.02895 1.02275 1.01716 1.01244 1.00867 1.00584 1.00381 1.00241 1.00147 1.00087 1.0005 1.00029 1.00016 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999999 0.999999 1 0.999989 1.00002 0.999978 1.00002 1 0.999959 1.00008 0.999921 1.00001 1.00011 0.999806 1.00012 1.00011 0.999765 1.00002 1.0003 0.999824 0.999663 1.00037 1.00031 0.999499 0.999634 1.00079 1.00017 0.999186 1.00003 1.00062 0.999931 0.999627 1.00011 1.00019 0.999897 0.999932 1.00012 1.00009 0.999887 0.999908 1.00008 1.0001 1.00003 1 1.00004 1.00009 1.00015 1.00015 1.00015 1.00018 1.0003 1.00052 1.00091 1.00155 1.00254 1.00404 1.00622 1.00923 1.01323 1.01827 1.02418 1.03048 1.03647 1.04135 1.0445 1.04558 1.04453 1.04148 1.03673 1.03061 1.02346 1.01559 1.00724 0.998595 0.989757 0.980753 0.971631 0.962424 0.953184 0.94404 0.935173 0.926851 0.919431 0.913168 0.90837 0.905353 0.904238 0.905222 0.908251 0.913079 0.919621 0.927585 0.936547 0.946325 0.956533 0.966779 0.977002 0.987355 0.997624 1.00814 1.01872 1.0284 1.0364 1.04216 1.04479 1.04408 1.04073 1.03562 1.02951 1.02324 1.01753 1.01274 1.00891 1.006 1.0039 1.00245 1.0015 1.00088 1.0005 1.00028 1.00016 1.00009 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.99999 1.00001 0.999986 1.00001 1.00001 0.999968 1.00006 0.999938 1.00002 1.00009 0.999803 1.0002 1.00002 0.999675 1.00035 1.00011 0.999417 1.00028 1.00056 0.999459 0.999378 1.00088 1.00074 0.998486 0.999613 1.00181 0.999934 0.998373 1.0003 1.00129 0.999639 0.999133 1.00036 1.00055 0.999736 0.999635 1.00019 1.00029 0.999868 0.999796 1.00005 1.00014 1.00009 1.00002 1.00002 1.00008 1.00015 1.00018 1.00021 1.00027 1.00042 1.00071 1.00122 1.00203 1.00325 1.00505 1.00757 1.01097 1.01538 1.02076 1.02684 1.03305 1.03862 1.04284 1.04523 1.04556 1.04388 1.04039 1.03538 1.02917 1.02208 1.0144 1.00632 0.998021 0.989576 0.981039 0.972481 0.963917 0.95547 0.947261 0.939449 0.93237 0.926251 0.921328 0.917907 0.916165 0.916186 0.918107 0.921782 0.926929 0.93355 0.941323 0.949906 0.959256 0.96876 0.978252 0.988102 0.998187 1.00816 1.01849 1.02824 1.03611 1.04179 1.04475 1.04433 1.04104 1.03596 1.02994 1.02367 1.01785 1.01294 1.00906 1.00611 1.00397 1.00249 1.00151 1.00088 1.0005 1.00028 1.00015 1.00008 1.00005 1.00003 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 0.999996 1 0.999999 0.999995 1.00002 0.999968 1.00004 0.999958 1.00001 1.00007 0.99983 1.00021 0.999918 0.999755 1.00053 0.999652 0.999656 1.00077 0.999935 0.998917 1.00067 1.00129 0.998473 0.99879 1.00241 1.00097 0.996591 0.999937 1.00359 0.999362 0.99679 1.00099 1.00256 0.999086 0.998129 1.00072 1.0013 0.99961 0.999101 1.00019 1.00058 0.999954 0.999668 0.999955 1.00018 1.00015 1.00005 1.00001 1.00006 1.00014 1.00022 1.00027 1.00038 1.00057 1.00095 1.00159 1.00258 1.00404 1.00612 1.00896 1.01273 1.01747 1.02309 1.02922 1.03521 1.04032 1.04392 1.04564 1.04538 1.04322 1.03941 1.03427 1.02807 1.02112 1.01367 1.00589 0.997962 0.98992 0.981881 0.97387 0.965968 0.958311 0.950978 0.944226 0.93827 0.933331 0.929606 0.927408 0.926742 0.927617 0.930298 0.934358 0.939669 0.946403 0.953881 0.962137 0.971138 0.979991 0.989085 0.998998 1.00869 1.01831 1.02819 1.03625 1.04155 1.04453 1.04458 1.0414 1.0362 1.03021 1.02403 1.01816 1.01311 1.00913 1.00616 1.004 1.0025 1.00151 1.00088 1.0005 1.00027 1.00014 1.00008 1.00005 1.00003 1.00002 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999993 1.00001 0.999981 1.00002 0.999986 0.999989 1.00006 0.99988 1.00015 0.999922 0.999847 1.00045 0.999492 1.00001 1.0008 0.999113 0.9996 1.00171 0.99935 0.997961 1.00187 1.00211 0.996834 0.997626 1.0056 1.00084 0.993351 1.00067 1.00665 0.998381 0.994092 1.00188 1.00484 0.998475 0.996424 1.00091 1.00254 0.999704 0.998358 1 1.00093 1.00016 0.999559 0.999806 1.00018 1.00024 1.00012 1.00001 1.00003 1.00012 1.00023 1.00034 1.0005 1.00078 1.00125 1.00202 1.00318 1.00487 1.00722 1.01037 1.01444 1.01946 1.02522 1.03129 1.037 1.04164 1.04469 1.04585 1.04511 1.04262 1.03863 1.03343 1.02732 1.02056 1.01336 1.00591 0.998358 0.990736 0.983222 0.975738 0.968491 0.961622 0.955144 0.94937 0.944502 0.940559 0.937965 0.93683 0.936915 0.938534 0.941742 0.945977 0.951583 0.958378 0.965411 0.973607 0.982239 0.990518 0.999698 1.00973 1.01871 1.02783 1.03647 1.04184 1.04425 1.04442 1.04173 1.03651 1.03032 1.02417 1.0184 1.01331 1.0092 1.00614 1.00396 1.00246 1.00149 1.00087 1.00049 1.00026 1.00014 1.00007 1.00003 1.00002 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999996 1.00001 0.999994 1 1.00001 0.999975 1.00005 0.999919 1.00009 0.999966 0.999885 1.00033 0.999556 1.00019 1.00051 0.998856 1.0007 1.00096 0.998131 0.999894 1.00303 0.998384 0.996205 1.0041 1.004 0.992598 0.997098 1.01059 1.00027 0.988284 1.00167 1.01176 0.997054 0.989772 1.0027 1.00839 0.998278 0.993864 1.00062 1.00421 1.00021 0.997498 0.999525 1.00133 1.00056 0.999484 0.999574 1.00014 1.00035 1.00021 1.00005 1.00002 1.00011 1.00024 1.00041 1.00064 1.001 1.00158 1.00249 1.00383 1.00573 1.00833 1.01174 1.01608 1.02128 1.0271 1.03304 1.03844 1.04265 1.04521 1.04594 1.04485 1.04213 1.03804 1.03288 1.02689 1.02036 1.01343 1.00634 0.999157 0.991999 0.984975 0.978006 0.97152 0.965315 0.959689 0.95491 0.950894 0.947886 0.946358 0.945991 0.946676 0.948966 0.952476 0.956907 0.962888 0.9695 0.9762 0.984617 0.992613 1.00064 1.01057 1.02005 1.02776 1.03618 1.04252 1.04446 1.04404 1.04174 1.03683 1.03042 1.02409 1.01837 1.0134 1.00931 1.00617 1.00393 1.00243 1.00144 1.00083 1.00047 1.00026 1.00014 1.00006 1.00003 1.00002 1.00001 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999997 1.00001 0.999983 1.00003 0.999968 1.00002 1.00002 0.999893 1.00022 0.999714 1.00016 1.00029 0.999118 1.00099 1.00004 0.998366 1.00161 1.00128 0.99622 1.00079 1.00532 0.995952 0.994156 1.00756 1.007 0.985438 0.996868 1.01785 1.00007 0.980204 1.00284 1.01893 0.99654 0.983449 1.00267 1.01317 0.999055 0.990702 0.999601 1.00612 1.00117 0.996585 0.998787 1.00172 1.00115 0.999501 0.999278 0.99999 1.00042 1.00032 1.0001 1.00004 1.00012 1.00026 1.00047 1.00079 1.00124 1.00195 1.00299 1.00449 1.0066 1.00942 1.01307 1.0176 1.02293 1.02874 1.0345 1.03958 1.04339 1.04557 1.04596 1.04464 1.04179 1.03767 1.03259 1.02675 1.0205 1.01384 1.00716 1.00029 0.993626 0.987093 0.980702 0.974902 0.969409 0.96455 0.960671 0.957537 0.955228 0.954664 0.954856 0.956015 0.959032 0.962642 0.96731 0.973752 0.979785 0.986514 0.995311 1.00262 1.0109 1.02138 1.02927 1.0355 1.04242 1.04543 1.04405 1.04115 1.03683 1.03071 1.02404 1.01815 1.01327 1.00926 1.00617 1.00396 1.00241 1.00138 1.00077 1.00043 1.00024 1.00013 1.00008 1.00004 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999996 1 1 0.999984 1.00005 0.99991 1.00014 0.999856 1.00005 1.0002 0.999439 1.00073 0.999764 0.998972 1.00199 0.999123 0.997835 1.0032 1.00126 0.993596 1.0023 1.00851 0.9928 0.989485 1.0156 1.00855 0.976682 0.99584 1.02799 1.00057 0.969431 1.00287 1.02839 0.997474 0.975685 1.00111 1.01868 1.00107 0.987264 0.997832 1.00805 1.00266 0.995673 0.997657 1.00195 1.00193 0.999714 0.998988 0.999741 1.0004 1.0004 1.00016 1.00007 1.00015 1.00031 1.00056 1.00094 1.00149 1.00232 1.0035 1.00517 1.00745 1.01048 1.01432 1.019 1.02438 1.03012 1.03567 1.04046 1.04394 1.04583 1.04598 1.0445 1.04161 1.03751 1.03254 1.02694 1.0209 1.01458 1.00825 1.00175 0.995704 0.989466 0.983813 0.978736 0.97364 0.96971 0.966802 0.964067 0.962507 0.962995 0.963338 0.965109 0.968806 0.972287 0.977395 0.984061 0.989363 0.99711 1.00564 1.01208 1.02147 1.03126 1.03639 1.04138 1.04581 1.04477 1.04077 1.03637 1.03072 1.02411 1.018 1.01295 1.00898 1.00604 1.00388 1.00235 1.00135 1.00072 1.00036 1.00019 1.00011 1.00007 1.00005 1.00003 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 1 0.999989 1.00002 0.999965 1.00004 0.999982 0.999947 1.00019 0.999641 1.00043 0.99983 0.999413 1.00147 0.998618 0.999525 1.00269 0.998266 0.996712 1.00604 1.00057 0.989995 1.00514 1.01207 0.988679 0.98344 1.02597 1.01089 0.966218 0.992238 1.04187 1.00187 0.957522 1.00003 1.03946 1.00048 0.967496 0.997999 1.02421 1.00407 0.983794 0.995395 1.00996 1.00467 0.99497 0.996136 1.00178 1.00273 1.00019 0.998826 0.999448 1.00031 1.00042 1.00019 1.00011 1.00019 1.00038 1.00066 1.0011 1.00176 1.00269 1.00401 1.00583 1.00829 1.01147 1.01547 1.02025 1.02564 1.03126 1.03662 1.04113 1.04436 1.046 1.04601 1.04447 1.04153 1.03762 1.03268 1.0274 1.02155 1.01565 1.00963 1.00355 0.998035 0.992214 0.987272 0.982701 0.978269 0.975072 0.972966 0.970627 0.970036 0.971075 0.971361 0.974216 0.978177 0.981606 0.987658 0.993745 0.998656 1.0081 1.01544 1.02148 1.03186 1.03908 1.04126 1.04456 1.04558 1.04127 1.03546 1.02998 1.0241 1.01795 1.0127 1.00877 1.00581 1.00365 1.00225 1.00135 1.00071 1.00032 1.00013 1.00006 1.00004 1.00003 1.00003 1.00002 1.00002 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999998 1 0.999998 0.999991 1.00003 0.999921 1.00014 0.999804 1.00019 0.999984 0.999618 1.00087 0.999078 0.999912 1.0019 0.997417 1.0001 1.00383 0.996782 0.995715 1.00943 0.999325 0.986799 1.00628 1.02013 0.97901 0.980985 1.03393 1.01657 0.953873 0.987546 1.05545 1.00637 0.945012 0.995192 1.05017 1.0051 0.959812 0.993747 1.02964 1.0078 0.980384 0.992053 1.01147 1.00739 0.994979 0.994426 1.00101 1.00329 1.00086 0.998929 0.999246 1.00015 1.00039 1.00022 1.00015 1.00024 1.00045 1.00079 1.00129 1.00202 1.00306 1.00451 1.00647 1.00907 1.0124 1.01651 1.02136 1.0267 1.0322 1.03734 1.04164 1.04463 1.04617 1.04601 1.04457 1.04163 1.03781 1.03315 1.0281 1.02241 1.0171 1.0111 1.00581 1.00072 0.99501 0.991161 0.987011 0.982867 0.980751 0.979516 0.97683 0.977499 0.978849 0.979446 0.983752 0.987121 0.990602 0.997604 1.0024 1.00904 1.01907 1.02383 1.03093 1.04068 1.04334 1.0434 1.04475 1.04174 1.03526 1.02918 1.02335 1.01757 1.01268 1.00871 1.00555 1.00341 1.0021 1.00126 1.00071 1.00036 1.00014 1.00004 1 1 1.00001 1.00002 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999998 1 1 0.999994 1.00002 0.999971 1.00004 0.99997 0.999982 1.00013 0.999675 1.00052 0.999506 0.999918 1.00122 0.997949 1.00108 1.00174 0.996771 0.999752 1.0062 0.994344 0.995328 1.01203 0.998835 0.983708 1.00667 1.02775 0.972234 0.975741 1.04072 1.02613 0.940062 0.98286 1.06659 1.01397 0.932922 0.989441 1.05982 1.01051 0.952427 0.988534 1.03488 1.01278 0.977563 0.987479 1.01173 1.01057 0.996271 0.993142 0.999687 1.00331 1.00151 0.999264 0.999187 1 1.00033 1.00024 1.00019 1.00031 1.00055 1.00092 1.00148 1.0023 1.00343 1.00499 1.00708 1.00981 1.01326 1.01744 1.02231 1.02759 1.03296 1.03788 1.04202 1.04483 1.04627 1.04619 1.04455 1.04202 1.0382 1.0338 1.02895 1.02362 1.01877 1.0129 1.00841 1.00335 0.998295 0.995284 0.991433 0.98797 0.986638 0.98523 0.983107 0.986209 0.986554 0.987339 0.992674 0.995252 1.00051 1.00762 1.01077 1.02041 1.02838 1.03132 1.03996 1.04609 1.0441 1.04258 1.0415 1.03594 1.02838 1.02207 1.01702 1.01237 1.00833 1.00537 1.00325 1.00177 1.00098 1.00065 1.00041 1.0002 1.00006 0.999981 0.999971 0.999992 1 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 1 0.999998 1 0.999995 0.999999 1.00002 0.999941 1.00012 0.999809 1.00023 0.99984 0.999846 1.00072 0.998833 1.00066 1.00125 0.996879 1.00199 1.00245 0.995353 0.999198 1.00884 0.992758 0.99495 1.01051 1.00554 0.974842 1.0112 1.02816 0.975819 0.964635 1.04748 1.0344 0.931963 0.974786 1.07739 1.02123 0.922076 0.98352 1.06913 1.01707 0.944702 0.981284 1.03907 1.01967 0.976926 0.982074 1.00965 1.01322 0.998925 0.992958 0.998201 1.00265 1.00182 0.999683 0.999265 0.99987 1.00023 1.00025 1.00025 1.00038 1.00065 1.00107 1.00168 1.00257 1.0038 1.00546 1.00766 1.01049 1.01403 1.01827 1.02309 1.02833 1.03349 1.03834 1.04217 1.04511 1.0462 1.04639 1.04487 1.04232 1.03866 1.03496 1.02977 1.02535 1.0205 1.01474 1.01153 1.00614 1.00206 0.999765 0.99558 0.992668 0.99334 0.991797 0.989932 0.993467 0.992886 0.996996 1.00185 1.00328 1.01104 1.01549 1.02002 1.03219 1.03525 1.03823 1.04614 1.04629 1.04197 1.03974 1.03534 1.02817 1.0218 1.01616 1.01112 1.00765 1.00525 1.0031 1.00153 1.00074 1.0004 1.00026 1.00019 1.0001 1.00003 1 0.999988 0.999981 0.999988 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999997 1 0.999997 0.999999 1.00001 0.999979 1.00003 0.999972 0.999993 1.0001 0.999722 1.00052 0.999346 1.00032 1.00083 0.997715 1.00225 1.00065 0.996141 1.0017 1.00573 0.992079 0.998207 1.01098 0.996395 0.988571 1.00856 1.0161 0.97024 1.00307 1.0365 0.980818 0.951836 1.05517 1.04004 0.926402 0.966362 1.0896 1.02725 0.910151 0.975961 1.07928 1.02665 0.938209 0.970537 1.0395 1.02804 0.980344 0.977579 1.00507 1.0139 1.00205 0.994142 0.99717 1.00156 1.00172 1.00005 0.999439 0.999778 1.00011 1.00021 1.00029 1.00046 1.00076 1.00122 1.00189 1.00284 1.00415 1.00591 1.00819 1.01113 1.01469 1.01901 1.02372 1.02893 1.03385 1.03869 1.04226 1.04511 1.04653 1.04632 1.04517 1.04298 1.03936 1.03608 1.03068 1.02759 1.02212 1.01752 1.01465 1.00876 1.00613 1.00419 1.00067 0.998737 0.999146 0.995596 0.998285 1.0028 1.00004 1.00586 1.00821 1.01287 1.0219 1.02245 1.03192 1.04037 1.0382 1.04407 1.04889 1.04285 1.03661 1.03367 1.02864 1.02141 1.01501 1.01047 1.00708 1.00452 1.00296 1.00188 1.00083 1.00017 1.00004 1.00009 1.00013 1.00013 1.00008 1.00002 0.999996 1 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999997 1 0.999999 0.999999 1.00001 0.999993 1 1.00001 0.999961 1.00009 0.999845 1.00021 0.999803 0.999985 1.00054 0.998771 1.00127 1.00046 0.996496 1.00414 1.00094 0.993329 1.00192 1.01133 0.987879 0.993484 1.01476 1.00989 0.965688 1.01513 1.02591 0.973786 0.980004 1.05361 0.983741 0.943318 1.05899 1.05053 0.913774 0.959411 1.10503 1.03539 0.895505 0.963033 1.08821 1.04114 0.936769 0.957437 1.03361 1.0351 0.988341 0.976419 0.999331 1.01198 1.00445 0.996282 0.99698 1.00051 1.00133 1.00029 0.999655 0.999756 1 1.00016 1.0003 1.00052 1.00086 1.00136 1.00209 1.00311 1.00448 1.00633 1.00868 1.01169 1.01531 1.01955 1.0243 1.02929 1.03424 1.03863 1.04262 1.04493 1.04648 1.04666 1.04583 1.04295 1.04058 1.03731 1.03218 1.03019 1.02296 1.02095 1.0176 1.01275 1.0111 1.00797 1.00394 1.00429 1.00761 1.00255 1.00665 1.00621 1.00833 1.01664 1.01541 1.02502 1.02883 1.02886 1.04315 1.04438 1.0417 1.0468 1.04401 1.03641 1.03176 1.02658 1.02 1.01515 1.01079 1.00622 1.00354 1.00275 1.00203 1.00106 1.00039 1.00004 0.999943 1.00003 1.00009 1.00007 1.00005 1.00005 1.00004 1.00002 1.00001 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 1 0.999998 1 1 0.999997 1.00001 0.999994 1 1 0.999986 1.00002 0.999976 0.999999 1.00007 0.999777 1.00046 0.999308 1.00063 1.00025 0.997905 1.00342 0.998681 0.995755 1.00584 1.00383 0.985476 1.00425 1.02039 0.983056 0.97745 1.03392 1.02052 0.936795 1.01537 1.0577 0.956769 0.969845 1.06984 0.977997 0.938429 1.07064 1.06051 0.890919 0.949725 1.12526 1.0507 0.881307 0.942222 1.08927 1.05881 0.945263 0.946593 1.02123 1.03744 0.998544 0.979769 0.994779 1.00821 1.00527 0.998479 0.997487 0.999753 1.00081 1.00037 0.999868 0.999812 0.999952 1.00011 1.0003 1.00056 1.00094 1.0015 1.00228 1.00335 1.00482 1.00667 1.0092 1.01208 1.01592 1.01992 1.02482 1.02937 1.03463 1.03858 1.0423 1.04525 1.04666 1.0463 1.04648 1.04351 1.04285 1.0372 1.03396 1.03223 1.02575 1.02625 1.01864 1.01573 1.01424 1.0147 1.0114 1.01136 1.00927 1.00668 1.01864 1.01346 1.01936 1.02069 1.02384 1.03637 1.03227 1.04132 1.05098 1.04021 1.0411 1.04678 1.03879 1.0281 1.02289 1.01949 1.01473 1.00983 1.00628 1.00376 1.00184 1.00101 1.00099 1.00072 1.00017 0.999863 0.999827 0.999866 0.999956 1.00004 1.00006 1.00003 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999996 1 0.999995 1 1 0.999994 1.00001 1 0.999973 1.00007 0.999879 1.00017 0.999823 1.00004 1.00037 0.998887 1.00173 0.999136 0.997407 1.00627 0.996399 0.993074 1.01073 1.00773 0.971238 1.00953 1.0364 0.973054 0.947264 1.08086 1.01368 0.910251 1.01592 1.09448 0.929111 0.974926 1.08641 0.961382 0.922804 1.10324 1.0713 0.857936 0.930408 1.14634 1.0757 0.875944 0.916801 1.07727 1.07339 0.963559 0.943795 1.0061 1.03315 1.00704 0.986166 0.992734 1.0041 1.00462 1.00004 0.998313 0.999403 1.00035 1.00033 1.00002 0.999903 0.99997 1.00012 1.00032 1.00061 1.00104 1.00162 1.0025 1.00354 1.00518 1.00697 1.00961 1.01253 1.01628 1.02028 1.02511 1.02963 1.03426 1.03889 1.04231 1.04475 1.04625 1.04755 1.04719 1.04304 1.04407 1.03726 1.04032 1.03274 1.02748 1.02701 1.02202 1.02572 1.01923 1.01734 1.00942 1.02187 1.0183 1.01902 1.01977 1.01708 1.0319 1.02599 1.03847 1.04191 1.03483 1.04983 1.04804 1.03861 1.0424 1.0382 1.02792 1.02246 1.01739 1.01126 1.00848 1.0073 1.00427 1.00125 1.00039 1.00056 1.00049 1.00027 1.00007 0.999872 0.999825 0.999899 0.999944 0.999948 0.999966 0.999994 1.00001 1.00001 1 1 1 1 1 1 1 1 0.999999 1 1 0.999997 1 0.999997 1 1 0.999994 1.00001 0.999999 0.999992 1.00002 0.999978 1 1.00005 0.999833 1.00035 0.999412 1.00071 0.999715 0.998743 1.00354 0.996242 0.998392 1.00923 0.994436 0.985353 1.0241 1.00911 0.949362 1.01936 1.06708 0.936757 0.931924 1.12846 1.00939 0.863576 1.06088 1.08631 0.908793 1.00662 1.09765 0.921174 0.904395 1.14733 1.09012 0.823914 0.899385 1.1557 1.10557 0.888282 0.896478 1.05205 1.07773 0.986634 0.950971 0.993579 1.0239 1.01109 0.992898 0.993112 1.00094 1.00326 1.00083 0.999102 0.999337 1.00001 1.00021 1.00008 0.999983 1.00002 1.00014 1.00037 1.00065 1.00114 1.00173 1.00265 1.00383 1.00531 1.00746 1.00978 1.01297 1.01649 1.02075 1.0248 1.03001 1.03438 1.03816 1.04173 1.0459 1.04584 1.04752 1.04508 1.04643 1.04738 1.03756 1.04128 1.02871 1.03885 1.03149 1.02827 1.02044 1.02085 1.02867 1.02281 1.02889 1.01012 1.0296 1.0277 1.03503 1.03287 1.0311 1.05107 1.03747 1.04291 1.05732 1.03885 1.03051 1.03686 1.03212 1.02148 1.01395 1.00978 1.00708 1.00517 1.00389 1.00268 1.00107 0.999839 0.999785 1.00024 1.00035 1.00019 1.00005 0.999943 0.999895 0.999923 0.999976 1 1 1 0.999999 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999998 1 1 0.999994 1.00001 0.999997 0.999999 1 1 0.999984 1.00005 0.999908 1.00013 0.999858 1.00006 1.00021 0.999203 1.00161 0.998206 0.999597 1.00538 0.991997 0.999647 1.01574 0.988212 0.974177 1.04988 1.00236 0.920197 1.03957 1.10918 0.864102 0.956581 1.15852 0.991461 0.84402 1.11175 1.04981 0.87776 1.06842 1.1184 0.846182 0.8826 1.19687 1.11938 0.802525 0.864177 1.14287 1.12795 0.918079 0.89179 1.02282 1.06914 1.00605 0.965106 0.987223 1.01374 1.01103 0.997957 0.994794 0.999145 1.00181 1.00098 0.999641 0.999416 0.9998 1.00005 1.00006 0.999988 1.00005 1.00017 1.00039 1.00076 1.00113 1.002 1.00264 1.00419 1.00547 1.00771 1.01008 1.01334 1.01643 1.02105 1.02516 1.02926 1.03398 1.03882 1.04165 1.04423 1.04397 1.05146 1.04528 1.0497 1.03911 1.04209 1.04751 1.03556 1.04189 1.01879 1.03948 1.02669 1.04298 1.01638 1.02451 1.03215 1.03117 1.03914 1.02421 1.04403 1.03329 1.05011 1.05124 1.03225 1.05155 1.04809 1.02763 1.02979 1.02994 1.02014 1.01476 1.01085 1.00478 1.00159 1.00245 1.00272 1.00097 0.9995 0.999379 0.999795 1.00009 1.0002 1.00019 1.00013 1.0001 1.00008 1.00005 1.00002 1 0.999998 1 1 1 1 0.999999 1 0.999999 1 1 0.999997 1 1 0.999995 1.00001 0.999996 0.999999 1 0.999997 0.999997 1.00001 0.99998 1.00001 1.00003 0.999891 1.00024 0.999581 1.00057 0.999545 0.999563 1.00249 0.995546 1.00231 1.00668 0.986039 1.00097 1.02968 0.96953 0.967254 1.08687 0.983755 0.880923 1.0934 1.11682 0.805989 0.989547 1.19465 0.90773 0.920628 1.13289 0.968492 0.860347 1.14355 1.13619 0.775265 0.850667 1.22954 1.15469 0.809175 0.837398 1.10709 1.13241 0.957449 0.906087 0.999052 1.05166 1.01659 0.980112 0.986664 1.00572 1.00857 1.00078 0.996711 0.998497 1.00075 1.00082 0.999962 0.999556 0.999716 0.999928 1.00001 1.00001 1.00003 1.00027 1.00036 1.0009 1.00118 1.00207 1.00293 1.00415 1.00584 1.00789 1.01021 1.01342 1.01704 1.02038 1.02496 1.02987 1.03405 1.03605 1.04157 1.04537 1.0468 1.04839 1.0388 1.05606 1.04055 1.05739 1.03052 1.03945 1.03982 1.04066 1.04646 1.01491 1.04544 1.01738 1.05819 1.02178 1.03721 1.03369 1.04934 1.04544 1.03248 1.06239 1.0373 1.03399 1.05565 1.03546 1.01886 1.02287 1.02049 1.01401 1.01051 1.00669 1.00206 0.999445 0.999354 1.00005 1.00024 0.999874 0.999478 0.999449 0.999772 1.00011 1.00023 1.00017 1.00009 1.00003 1.00001 1.00001 1.00001 1.00001 1 1 1 0.999999 1 1 0.999997 1 0.999998 0.999995 1.00001 0.999997 0.999999 1.00001 0.999993 1.00001 0.999999 1 0.999992 1.00003 0.999937 1.0001 0.999887 1.00007 1.00009 0.99954 1.00109 0.998329 1.001 1.00259 0.992066 1.00701 1.00844 0.974328 1.00822 1.04904 0.931419 0.978256 1.12502 0.950981 0.84281 1.18154 1.05919 0.802638 1.03784 1.16987 0.836568 1.01906 1.17049 0.838129 0.83896 1.24213 1.1477 0.723999 0.825494 1.22923 1.17625 0.845195 0.835822 1.06244 1.11526 0.99091 0.932402 0.986583 1.03229 1.01816 0.991251 0.989164 1.00088 1.00565 1.00187 0.998312 0.998602 1.00015 1.00058 1.00011 0.999742 0.999719 0.999913 0.999924 1.00004 1.00003 1.00023 1.00054 1.00074 1.00154 1.00193 1.00318 1.00436 1.00589 1.00797 1.01078 1.01297 1.0169 1.02107 1.02483 1.0275 1.03417 1.037 1.04417 1.03742 1.04733 1.04643 1.05227 1.05289 1.03087 1.058 1.02836 1.074 1.01773 1.055 1.01699 1.05583 1.04262 1.02607 1.04989 1.02825 1.05619 1.03231 1.05751 1.03101 1.05574 1.05701 1.01671 1.04249 1.04979 1.01993 1.01327 1.01672 1.01126 1.00882 1.00906 1.00534 1.00027 0.998643 0.999942 1.00123 1.00102 1.00005 0.99965 0.999842 0.999926 0.999827 0.999831 0.999926 0.999988 1 1.00001 1.00001 1 1 0.999999 1 1 0.999998 1 0.999998 1 1 0.999997 0.999998 1.00001 0.999991 1.00001 0.999997 0.999999 1 1 0.999988 1.00001 1 0.999948 1.00014 0.99975 1.00036 0.999658 0.999919 1.00137 0.996548 1.00413 1.0011 0.987477 1.01597 1.00836 0.954562 1.0309 1.06124 0.880612 1.01086 1.1593 0.888119 0.860318 1.23169 0.982548 0.823647 1.15574 1.00163 0.835217 1.13653 1.16385 0.739331 0.819008 1.29967 1.17682 0.717289 0.806379 1.19178 1.17589 0.89795 0.859481 1.02466 1.08567 1.01086 0.95967 0.983975 1.01662 1.01461 0.997695 0.992542 0.998651 1.00318 1.0019 0.999319 0.998954 0.999861 1.00037 1.00011 0.999856 0.999746 0.999857 0.999965 0.999892 1.00023 1.00005 1.00073 1.00077 1.00148 1.00229 1.00304 1.00447 1.00628 1.0078 1.01051 1.01384 1.01654 1.01962 1.02458 1.02969 1.03311 1.03177 1.04305 1.03881 1.05876 1.03117 1.0567 1.03399 1.06423 1.04903 1.03651 1.05326 1.01783 1.08722 1.00307 1.08326 0.999839 1.07077 1.03514 1.04681 1.03919 1.05744 1.05108 1.02074 1.068 1.03331 1.01547 1.04641 1.03044 1.00922 1.01286 1.01093 1.00299 1.00364 1.007 1.00538 1.00194 1.00102 1.00132 1.00097 1.00068 1.00074 1.00031 0.999672 0.999579 0.999861 1.00001 1 0.999989 0.999996 1 0.999999 1 1 0.999998 1 0.999998 1 1 0.999995 1.00001 1.00001 0.999992 1.00001 0.999998 0.999996 1.00001 0.999992 1.00001 0.999994 1.00001 0.999965 1.00006 0.999919 1.00007 1.00001 0.999794 1.00056 0.998984 1.00104 1.00067 0.994882 1.00911 0.997073 0.981483 1.03334 0.999078 0.930737 1.07716 1.04408 0.842499 1.05619 1.17413 0.807045 0.963938 1.18484 0.913625 0.906735 1.23132 0.840864 0.794417 1.2951 1.14642 0.650939 0.836366 1.3119 1.17714 0.758917 0.817937 1.13175 1.14561 0.949383 0.901803 1.00278 1.05423 1.01646 0.979529 0.986666 1.00699 1.01009 1.00059 0.995382 0.998096 1.00151 1.00143 0.999803 0.999283 0.999743 1.00014 1.00011 0.999823 0.9999 0.999746 1.00006 0.999861 1.00015 1.00029 1.00045 1.00112 1.00142 1.00219 1.00349 1.00438 1.00592 1.00873 1.01006 1.01298 1.01638 1.02195 1.0217 1.02768 1.02975 1.04038 1.03931 1.03483 1.0489 1.03416 1.0768 1.01603 1.07966 0.999997 1.09737 1.01499 1.07611 1.02289 1.04009 1.07272 1.01154 1.08084 1.02375 1.06345 1.02882 1.06592 1.0159 1.05175 1.06704 0.995591 1.01515 1.04418 1.01828 1.00448 1.00831 1.00346 0.997637 0.999342 1.00311 1.00423 1.00218 0.999338 0.998898 1.00027 1.0006 0.999875 0.99981 1.00028 1.00035 1.0001 0.999973 0.999993 1.00001 1 1 0.999998 1 0.999999 1 1 0.999996 1 0.999997 0.999999 1.00001 0.999999 0.999996 1.00001 0.99999 1.00001 0.999997 1 0.999997 1.00001 0.999998 0.999982 1.00006 0.999878 1.00018 0.999828 0.999968 1.0007 0.997908 1.0036 0.997592 0.994695 1.01652 0.986422 0.980085 1.05686 0.97362 0.91777 1.1346 0.995309 0.831495 1.11626 1.12298 0.779757 1.09375 1.08432 0.795165 1.136 1.16852 0.733489 0.815478 1.34185 1.16396 0.644003 0.825344 1.28192 1.17155 0.820012 0.848027 1.07914 1.10665 0.98255 0.941466 0.99475 1.02951 1.01419 0.991595 0.990908 1.00193 1.00606 1.0015 0.997508 0.998322 1.00055 1.00087 1.00002 0.999479 0.999803 0.999943 1.00012 0.999839 0.999872 0.999907 0.999797 1.00017 0.999913 1.0004 1.00068 1.00071 1.00196 1.00213 1.00308 1.00514 1.00579 1.00774 1.01062 1.01421 1.0142 1.01983 1.02113 1.03394 1.02224 1.04043 1.02503 1.05979 1.03181 1.05013 1.03623 1.04216 1.0801 1.01063 1.09776 0.967105 1.13335 0.970541 1.12536 0.990014 1.06994 1.04664 1.04245 1.03398 1.05739 1.0556 0.995096 1.06806 1.03154 0.989234 1.02836 1.02521 1.00092 1.00695 1.01161 0.998924 0.99196 0.997102 1.001 0.998765 0.997115 0.998576 0.999367 0.998863 0.999402 1.00056 1.00066 1.00008 0.999857 0.999974 1.00004 1.00002 0.999998 1 0.999999 1 1 0.999996 1 0.999997 0.999999 1 0.999994 0.999997 1.00001 0.999991 1.00001 1 0.999993 1.00001 0.999987 1.00001 0.99998 1.00003 0.999957 1.00004 0.99999 0.999928 1.00022 0.999573 1.00051 1.00016 0.997357 1.00693 0.991656 0.997541 1.02598 0.964841 0.993028 1.07775 0.927597 0.941763 1.16399 0.939177 0.857103 1.1729 0.987133 0.87212 1.16608 0.966316 0.71569 1.3062 1.17512 0.589421 0.882993 1.36734 1.12064 0.706712 0.859894 1.19615 1.13212 0.896013 0.899928 1.03622 1.06361 1.00084 0.971438 0.993864 1.01448 1.00972 0.996762 0.99388 0.999777 1.00345 1.00142 0.998799 0.998837 1.00018 1.0005 1.00013 0.999689 0.999779 0.999962 0.999848 1.00005 0.999632 1.00008 0.999783 0.999976 1.00032 1.00001 1.0009 1.001 1.00137 1.00264 1.00349 1.00373 1.00699 1.00801 1.00966 1.01144 1.01751 1.02003 1.01882 1.02629 1.02438 1.04817 1.01478 1.05948 1.00221 1.1009 0.994297 1.10353 0.970962 1.10059 1.02006 1.0743 1.05158 0.999408 1.11066 0.97701 1.1047 1.01448 1.05932 1.01735 1.07493 0.988388 1.02331 1.08603 0.991154 0.983055 1.03129 1.01866 0.997501 1.00414 1.01118 1.00593 0.997418 0.993112 0.995477 1.00025 1.00106 0.999043 0.999062 1.00057 1.00057 0.999604 0.999453 0.999908 1.00011 1.00004 0.999986 0.999988 1 1 0.999997 1 0.999997 1 1 0.999994 1.00001 0.999998 0.999992 1.00001 1 0.999992 1.00001 0.999986 1.00001 0.999996 0.999998 1.00001 0.999982 1.00003 0.999944 1.00007 0.999951 0.999933 1.00039 0.998902 1.00219 0.997311 0.999915 1.0084 0.983283 1.00764 1.02901 0.939793 1.02148 1.0836 0.875055 1.00539 1.14197 0.892106 0.93872 1.17558 0.823196 1.03365 1.23042 0.745539 0.829885 1.31992 1.15673 0.631666 0.862263 1.33055 1.12562 0.759335 0.88988 1.14003 1.09123 0.938332 0.941645 1.02148 1.03496 1.00285 0.987571 0.995356 1.00539 1.00542 0.999423 0.99679 0.999247 1.00171 1.00112 0.999613 0.999377 0.999976 1.00034 0.99999 0.999967 0.999641 1.00005 0.999759 0.999951 0.999866 0.999752 1.00006 0.999926 0.999994 1.0007 1.0002 1.00124 1.00205 1.00136 1.00427 1.00432 1.00591 1.00601 1.01334 1.00964 1.01678 1.0113 1.03122 1.01839 1.03197 1.01901 1.04218 1.04795 1.0234 1.0573 0.982627 1.12926 0.961797 1.16652 0.897175 1.17225 0.923343 1.15792 0.988811 1.04462 1.05682 1.03276 1.01853 1.04458 1.06077 0.951936 1.05794 1.05147 0.974905 1.00796 1.0251 0.994399 0.992378 1.01282 1.01388 1.00094 0.997322 1.00245 1.00379 1.00078 1.00021 1.00162 1.00094 0.999198 0.999104 1.00002 1.00032 1.00008 0.999934 0.999967 1.00001 1 1 0.999997 1 1 0.999995 1 0.999998 0.999998 1.00001 1 0.999993 1.00001 0.999988 1.00001 1 0.999985 1.00002 0.999972 1.00003 0.999978 1.00001 1.00001 0.999955 1.00009 0.999875 1.00009 1.00025 0.998581 1.00405 0.992718 1.00622 1.00625 0.973082 1.02977 1.0127 0.927911 1.059 1.05527 0.857777 1.07263 1.07433 0.867371 1.07984 1.06386 0.761473 1.13926 1.285 0.60477 0.866885 1.40248 1.04875 0.699846 0.937194 1.21319 1.08755 0.868485 0.923648 1.0659 1.05542 0.983344 0.972536 1.00248 1.0157 1.00496 0.995064 0.996785 1.0025 1.00354 1.0001 0.997983 0.99925 1.00077 1.00068 0.999761 0.999699 0.999793 1.00022 0.999959 0.999975 0.999897 0.99977 1.00006 0.999715 0.999911 1 0.999549 1.00051 0.999684 1.00051 1.0009 1.00068 1.00165 1.00307 1.00239 1.004 1.00766 1.00632 1.00923 1.00781 1.02272 1.00726 1.02795 1.00117 1.0591 0.996703 1.07156 0.965219 1.10589 0.984214 1.11841 0.966927 1.06267 1.02574 1.04344 1.10797 0.938617 1.15181 0.920761 1.11542 1.01219 1.04014 0.988873 1.09565 0.977594 0.958271 1.09379 1.01611 0.958457 1.00847 1.02412 0.995866 0.983259 0.993476 1.00643 1.01109 1.00593 0.999206 0.998916 1.00165 1.00106 0.998852 0.99905 1.00052 1.00076 1.00012 0.999823 0.999933 1.00002 1.00003 0.999999 0.999998 1 0.999996 1 0.999998 0.999999 1.00001 0.999993 1.00001 1.00001 0.99999 1 1.00001 0.999983 1.00002 0.99998 1.00001 1.00001 0.999969 1.00005 0.999946 1.00004 0.999998 0.999914 1.00026 0.99944 1.00105 0.998447 1.00108 1.00233 0.99069 1.01361 0.998628 0.968502 1.05444 0.980745 0.93665 1.095 0.986858 0.90662 1.10388 0.982952 0.87709 1.23988 0.8794 0.769473 1.2786 1.14253 0.702992 0.867803 1.31662 1.09548 0.739739 0.940905 1.1734 1.04519 0.909125 0.970022 1.04567 1.0216 0.98426 0.993318 1.00697 1.00508 1.001 0.998964 0.998755 1.0003 1.00109 1.00017 0.99911 0.999436 1.0001 1.00032 0.999934 0.999797 0.999945 0.999905 1.00018 0.999735 1.00008 0.999751 0.99987 1 0.999646 1.00007 0.999872 0.999877 1.00033 1.00048 0.999908 1.00248 1.00011 1.00305 1.00298 1.00573 1.00176 1.00991 1.00904 1.01242 1.0074 1.01737 1.02529 1.0149 1.02528 0.996424 1.07402 0.984559 1.11168 0.901938 1.1687 0.884467 1.24372 0.841047 1.21047 0.854912 1.15958 1.01085 0.997785 1.06306 1.01954 0.995751 1.02857 1.10082 0.910143 1.00024 1.07556 0.981327 0.978955 1.0256 1.01205 0.982408 0.986627 1.00223 1.00259 0.996093 0.9965 1.00042 1.00005 0.997857 0.998817 1.00104 1.00111 0.999944 0.999561 0.999877 1.00009 1.00005 0.999999 0.999992 0.999995 1 0.999997 1 1 0.999994 1.00001 0.999999 0.999995 1 1 0.999986 1.00002 0.999987 0.999998 1.00002 0.99996 1.00005 0.999965 1.00001 1.00003 0.999933 1.00009 0.999933 0.999967 1.00029 0.999119 1.00216 0.995675 1.00621 0.996104 0.993126 1.02132 0.980589 0.984811 1.05725 0.954348 0.96576 1.10381 0.913014 1.00294 1.09353 0.8724 0.976495 1.26829 0.808867 0.752785 1.37294 1.06279 0.692732 1.00587 1.18673 1.03374 0.882934 0.951838 1.07456 1.04323 0.966977 0.975654 1.01097 1.01873 1.00392 0.99272 0.997264 1.0033 1.00212 0.998898 0.998546 1.00037 1.00116 1.00033 0.99961 0.999728 1.00015 1.00008 1.00018 0.999753 1.00006 0.999807 1.00003 0.999918 0.999823 0.999934 0.999864 0.999688 1.0002 0.999439 1.00026 1.00001 0.999712 1.00109 1.0001 1.00112 1.00155 1.00353 0.999531 1.00771 1.00257 1.01128 0.996096 1.02327 0.999851 1.03248 0.982013 1.05516 0.98901 1.08266 0.954236 1.07692 0.968463 1.10005 1.00254 1.02061 1.04574 0.956035 1.17944 0.85582 1.21836 0.861139 1.08802 1.03096 1.03105 0.928998 1.10699 1.03963 0.890802 1.05103 1.06087 0.966424 0.975537 1.02264 1.02646 1.00488 0.989002 0.987173 0.99491 1.00154 1.00061 0.997748 0.999063 1.00164 1.00124 0.999476 0.999149 0.999869 1.00022 1.0001 0.999981 0.999971 1 1 1 1 0.999995 1.00001 0.999998 0.999997 1.00001 0.999991 0.999989 1.00002 0.99999 0.999996 1.00002 0.999967 1.00003 0.99999 0.999977 1.00006 0.999921 1.00007 0.999972 0.999944 1.00017 0.999679 1.00049 0.999358 1.00055 1.00051 0.996346 1.00845 0.990432 0.997966 1.02657 0.9582 1.01865 1.03359 0.940882 1.02194 1.04982 0.895309 1.08277 1.07566 0.748563 1.14894 1.18604 0.764499 0.892137 1.2266 1.10236 0.76452 0.955478 1.18274 1.00949 0.897564 1.00196 1.04883 1.00045 0.981035 1.00631 1.011 0.992974 0.995134 1.00522 1.00298 0.998576 0.998956 1.00032 1.00052 1.00023 1.00023 1.00012 1.00008 0.99987 1.00009 0.999967 1.00008 0.999991 0.99986 1.00006 0.999834 0.999974 0.999958 0.999654 1.00017 0.999499 1.00013 0.999721 1.00007 0.999681 1.00096 0.999065 1.00202 1.00033 1.00121 1.0021 1.00432 1.00289 1.00125 1.01105 1.00489 1.01344 0.992904 1.03269 0.991627 1.05162 0.946141 1.09298 0.924659 1.17708 0.846439 1.221 0.779128 1.29315 0.77644 1.26286 0.824136 1.09367 1.07542 0.931874 1.06974 1.03098 0.958016 0.949945 1.16806 0.963388 0.915442 1.06434 1.02617 0.96237 0.988658 1.02111 1.01297 0.998273 0.999342 1.00425 1.00204 0.998537 0.999992 1.0024 1.00121 0.998877 0.998821 1.00004 1.00048 1.00017 0.999923 0.999944 0.999995 1.00001 1.00001 0.999995 1 0.999997 0.999998 1.00001 0.999992 1 1 0.999992 0.999996 1.00002 0.999975 1.00002 1 0.999969 1.00006 0.99994 1.00004 1.00001 0.999929 1.00011 0.999886 1.00004 1.00015 0.999503 1.0011 0.997871 1.00354 0.995669 1.002 1.0053 0.986938 1.00871 1.01514 0.958557 1.03725 1.00681 0.937975 1.09009 0.947115 0.938351 1.13767 1.00402 0.754373 1.18918 1.17128 0.711421 0.994225 1.18625 0.981206 0.918294 0.97401 1.05563 1.03554 0.961085 0.977612 1.02153 1.01492 0.994529 0.988624 1.00214 1.01049 1.00108 0.995033 0.99893 1.00199 1.00077 0.999017 0.999138 0.999928 1.00024 1 0.999921 0.999943 0.999873 1.0001 0.999872 1.00014 0.999861 0.999992 0.999965 0.999855 0.99996 0.999866 0.999794 0.999912 0.999919 0.999511 1.00073 0.998889 1.00138 0.999311 1.00165 0.998978 1.00526 0.997059 1.00621 0.999054 1.01324 0.992642 1.01628 0.996399 1.03355 0.983588 1.0382 0.981082 1.06714 0.972392 1.0478 0.967479 1.03211 1.04935 0.963295 1.13527 0.818721 1.27992 0.723166 1.28352 0.87896 0.996845 1.04968 1.08513 0.866212 1.01157 1.13891 0.912528 0.957741 1.06972 1.0173 0.962289 0.973243 1.00144 1.013 1.01065 1.00287 0.998422 1.00022 1.00241 1.00061 0.998192 0.99872 1.00046 1.00084 1.00018 0.99981 0.999885 1.00001 1.00003 1 1 0.999997 0.999998 1.00001 0.999993 1 1 0.999991 1.00001 1.00001 0.999981 1.00001 1 0.999973 1.00004 0.999964 1.00001 1.00004 0.999919 1.0001 0.999921 1.00001 1.00009 0.999795 1.00029 0.999702 1.00017 1.00028 0.998506 1.00394 0.993174 1.00649 1.00195 0.982918 1.02605 0.984744 0.989192 1.03089 0.975466 0.976468 1.10079 0.886611 0.967881 1.20695 0.862796 0.878749 1.16372 1.07259 0.853472 0.935963 1.15805 1.006 0.891299 1.02103 1.04833 0.984529 0.985941 1.01137 1.00576 0.990332 1.00067 1.01268 0.999128 0.990827 0.999564 1.00481 1.00166 0.998591 0.998721 0.999922 1.00036 1.00013 0.999837 0.999985 0.999918 1.00014 0.999888 1.00004 0.99995 0.999968 0.999973 0.999952 0.999846 1.00009 0.99964 1.00017 0.999597 1.00003 0.99973 1.00005 0.999592 1.00058 0.999669 1.00016 1.00191 0.998809 1.00295 0.999562 1.00799 0.993185 1.01261 0.993024 1.02436 0.975035 1.0373 0.961817 1.07818 0.920021 1.1256 0.85978 1.22064 0.788542 1.29065 0.693493 1.31596 0.731148 1.2464 0.919345 0.923364 1.18528 0.881508 1.0135 1.09312 1.03228 0.81746 1.09349 1.0949 0.905992 0.982105 1.05483 1.01407 0.980111 0.987636 0.999557 0.998836 0.996813 0.999339 1.0014 0.999586 0.997732 0.999031 1.00108 1.00113 1.00004 0.999584 0.999817 1.00005 1.00005 1.00001 0.999992 0.999995 1 0.999995 1 1 0.999993 1.00001 0.999993 0.999997 1.00001 1 0.99998 1.00003 0.999979 0.999995 1.00004 0.999936 1.00006 0.999971 0.999967 1.0001 0.999858 1.00012 0.999978 0.999821 1.00049 0.999062 1.00156 0.997763 1.00231 0.999517 0.996401 1.00654 0.998237 0.987213 1.02823 0.968748 1.01375 1.02703 0.926877 1.06362 1.03737 0.884609 1.00844 1.18422 0.843648 0.91084 1.18521 0.976176 0.913937 1.01341 1.02692 1.03041 0.970876 0.975173 1.02561 1.01102 0.987244 0.99486 1.00672 1.00683 0.9929 0.992748 1.00575 1.00588 0.99776 0.996761 1.00061 1.00196 1.00061 0.99967 0.999713 1.00015 1.00005 1.00009 1.00001 1.00002 1.00003 0.999911 1.00001 0.99995 0.999917 1.00004 0.999767 1.00008 0.999674 1.00014 0.999464 1.00048 0.998928 1.00112 0.998536 1.00139 0.998849 1.00193 0.997789 1.00435 0.998144 1.00332 0.997971 1.00904 0.997783 1.00796 0.996342 1.01981 0.994548 1.02145 0.981123 1.02552 0.989753 1.01326 1.02068 0.944005 1.13577 0.827936 1.29214 0.642333 1.40894 0.650607 1.19171 1.03937 0.902347 0.957998 1.17637 0.972545 0.857896 1.11371 1.03343 0.917058 0.994617 1.04462 1.02091 0.994745 0.989365 0.993793 0.998773 1.00058 0.998984 0.998029 0.999854 1.00168 1.00113 0.999669 0.99929 0.999792 1.00013 1.00011 1.00001 0.99998 0.999997 0.999996 1 1 0.999994 1.00001 0.999995 0.999998 1.00001 0.999986 0.999986 1.00002 0.999988 0.999994 1.00003 0.999958 1.00003 1 0.999952 1.00009 0.999897 1.00007 1.00001 0.999891 1.0002 0.999778 1.00014 1.00012 0.999344 1.0017 0.996615 1.00501 0.995553 0.999661 1.00768 0.988305 1.00821 1.00195 0.984046 1.02161 1.01103 0.916409 1.10948 0.996726 0.866178 1.10178 1.0609 0.907241 0.959229 1.08409 1.03392 0.908008 1.01345 1.04892 0.973179 0.987687 1.01479 1.00058 0.991354 1.00102 1.00914 0.996729 0.992659 1.00562 1.00557 0.996298 0.995901 1.00055 1.0019 1.00059 0.999563 0.99943 0.999926 1.00019 1.00011 0.999982 0.99983 1.00002 0.999936 1.00007 0.99996 0.999994 0.999954 0.999968 0.999907 0.999982 0.999838 0.999907 0.999923 0.999713 1.00009 0.999595 1.00021 0.999443 1.0011 0.998033 1.00353 0.99682 1.00479 0.994803 1.01108 0.989774 1.01484 0.983271 1.02964 0.969131 1.04766 0.942218 1.09393 0.90063 1.16177 0.81376 1.24388 0.721495 1.32191 0.685701 1.27398 0.826514 1.04052 1.1819 0.714549 1.21254 0.993679 0.883765 0.990793 1.19613 0.897616 0.909373 1.11038 1.0156 0.938445 0.985347 1.01696 1.01115 1.00218 1.00117 1.00169 1.00014 0.999527 1.00098 1.00187 1.00065 0.999123 0.999087 0.999902 1.00031 1.00018 0.99999 0.999962 0.999984 1 1 0.999996 1.00001 0.999996 0.999999 1.00001 0.99999 1.00001 1 0.999992 0.999995 1.00002 0.999973 1.00002 1.00001 0.999959 1.00006 0.999945 1.00002 1.00005 0.99989 1.00014 0.999883 1.00002 1.00015 0.999636 1.00062 0.999127 1.00102 0.99932 0.999317 1.00277 0.996622 0.999655 1.00824 0.983054 1.0233 0.979409 0.995704 1.04422 0.953604 0.977529 1.08074 0.984946 0.889139 1.10762 1.02783 0.907065 1.02741 1.02352 0.997059 0.994291 0.976017 1.02196 1.01264 0.983261 0.998866 1.00901 1.00261 0.994816 0.997785 1.00768 1.00116 0.992824 0.998853 1.00466 1.00154 0.997729 0.998284 1.00019 1.00073 1.00025 0.99977 0.999927 0.999923 1.00009 0.999928 1.00001 0.999964 1.00001 0.999973 1.00002 0.999886 1.00008 0.999759 1.00018 0.999584 1.00031 0.999314 1.00059 0.99897 1.00086 0.998957 1.00069 0.999356 1.00101 0.998806 1.00128 1.0006 0.999947 1.00016 1.001 1.00274 1.00046 1.00064 1.00203 1.0011 1.00228 1.00023 0.987615 1.03035 0.951928 1.12227 0.827281 1.27726 0.631019 1.44729 0.541803 1.37801 0.864063 0.892268 1.17078 1.02888 0.816504 1.03255 1.15398 0.895701 0.96311 1.08246 1.00509 0.961448 0.987074 1.00518 1.00589 1.00254 1.00063 1.00044 1.00123 1.00118 0.99975 0.99869 0.999184 1.00021 1.00052 1.0002 0.999933 0.999915 0.999981 1.00001 1 1 0.999997 0.999998 1.00001 0.999993 1 1 0.99999 1.00001 1.00001 0.999983 1.00001 1.00001 0.999972 1.00004 0.999975 0.999992 1.00005 0.999914 1.00009 0.99995 0.999976 1.00011 0.999826 1.00017 0.999932 0.999823 1.00062 0.998657 1.00234 0.99687 1.0027 0.999428 0.998112 1.00265 0.99846 0.997965 1.01101 0.982204 0.996709 1.05656 0.917783 1.02202 1.06416 0.942175 0.979071 1.03901 1.02032 0.959764 0.985945 1.0458 0.984996 0.986165 1.01706 0.996726 0.992836 1.00431 1.00575 0.996379 0.99321 1.00435 1.0033 0.996146 0.999616 1.00294 1.0006 0.998892 0.999595 1.00029 1.00033 1.00026 0.999947 0.999898 0.999899 1.00011 1.0001 1.00006 1.00001 0.999946 0.999992 0.999981 0.999982 1.00001 0.999912 1.00004 0.999817 1.00011 0.999641 1.00027 0.999387 1.00048 0.999136 1.00083 0.998581 1.00204 0.997045 1.0039 0.996123 1.00567 0.993073 1.01065 0.989278 1.01619 0.980235 1.03013 0.965858 1.05561 0.932821 1.10102 0.877138 1.16932 0.791505 1.23959 0.734421 1.25841 0.834655 1.06083 1.11303 0.690331 1.38169 0.779754 0.962817 1.15618 1.01879 0.814612 1.07884 1.09506 0.904889 0.978589 1.0561 1.01429 0.987769 0.992418 0.998121 0.999302 0.999511 0.99978 0.999583 0.998826 0.998702 0.999668 1.00062 1.00063 1.00011 0.999812 0.999866 0.999991 1.00002 1.00001 1 0.999996 1 0.999995 1 1 0.999993 1.00001 0.999995 0.999996 1 1.00001 0.999982 1.00002 0.99999 0.999987 1.00004 0.999948 1.00004 0.999999 0.999945 1.00011 0.999873 1.0001 0.999984 0.999894 1.00024 0.999652 1.00039 0.999741 0.999771 1.00124 0.997658 1.00232 0.999764 0.996725 1.00765 0.986613 1.01607 0.995732 0.980616 1.02198 1.01678 0.950653 1.01537 1.05062 0.942601 1.00149 1.03098 0.985836 1.00409 0.99351 0.99859 1.01328 0.986071 0.999369 1.00909 0.996478 0.995004 1.00109 1.00572 0.999275 0.994572 1.00198 1.00352 0.998309 0.997537 1.00056 1.00168 1.00045 0.999442 0.999427 0.999936 1.00021 1.00009 0.999984 0.999888 1.00004 0.999986 1.00006 0.999962 1.00001 0.999955 1.00001 0.999927 1.00004 0.999841 1.0001 0.999708 1.0002 0.999539 1.0003 0.999465 1.0002 0.999808 0.999743 1.00028 0.99972 1.00058 0.998658 1.00244 0.997411 1.0031 0.995726 1.00581 0.994164 1.0079 0.990321 1.01453 0.981697 1.03781 0.948799 1.10059 0.859096 1.22618 0.682352 1.39843 0.559297 1.41933 0.753228 0.982641 1.21595 0.809756 0.958708 1.17905 0.988273 0.858162 1.07445 1.04895 0.936049 0.988133 1.02602 1.00725 0.996772 0.997907 0.999427 0.999584 0.999239 0.999138 0.999601 1.00047 1.00091 1.00051 0.99989 0.999685 0.99986 1.00003 1.00005 1.00002 0.999995 0.999999 0.999996 1 1 0.999995 1.00001 0.999997 0.999997 1.00001 0.99999 0.999989 1.00001 0.999996 0.999989 1.00002 0.999972 1.00001 1.00002 0.99995 1.00007 0.999935 1.00003 1.00004 0.99989 1.00015 0.999857 1.00006 1.00012 0.999596 1.0008 0.998747 1.00148 0.998886 1.0003 1.00004 1.00053 0.998681 1.00324 0.990829 1.01423 0.997809 0.970975 1.04665 0.978263 0.982317 1.0201 1.0052 0.994007 0.98726 1.01317 1.00442 0.981778 1.01182 1.00147 0.993585 1.00505 1.00251 0.997817 0.998637 1.00365 1.00204 0.996214 0.999873 1.00146 0.999553 0.999815 1.00015 0.999766 0.999753 1.00009 1.00011 0.999961 1.00005 1.00002 1.00006 0.999916 0.999985 0.999902 1.00002 0.999989 1.00002 0.999997 0.999999 0.999966 1.00002 0.99989 1.0001 0.99975 1.00023 0.999547 1.0004 0.999326 1.00057 0.999083 1.00094 0.998457 1.00203 0.997319 1.0032 0.996359 1.00518 0.993303 1.00897 0.988988 1.0157 0.979285 1.02878 0.96195 1.05336 0.928567 1.09271 0.879418 1.1432 0.840519 1.16775 0.881018 1.04442 1.09923 0.734704 1.38271 0.661987 1.12613 1.11005 0.842368 0.973083 1.15362 0.960634 0.915946 1.06236 1.02773 0.962125 0.988501 1.0071 1.0037 1.00092 1.00001 1.00002 1.00026 1.00068 1.00095 1.00074 1.00012 0.999626 0.999638 0.999922 1.00009 1.00008 1.00001 0.999988 0.99999 0.999998 1 0.999997 1 0.999999 0.999998 1.00001 0.999994 1 1.00001 0.999999 0.999992 1.00001 0.999986 1 1.00002 0.999967 1.00004 0.999979 0.999987 1.00006 0.999909 1.0001 0.999935 0.999997 1.00009 0.999831 1.00021 0.99984 0.999974 1.00044 0.998914 1.00165 0.9984 1.00085 1.00014 0.998233 1.00511 0.992423 1.00292 1.00678 0.994429 0.986318 1.02749 0.988103 0.986377 1.01813 0.992873 0.999088 1.00197 0.993809 1.01084 0.999644 0.993331 1.00698 0.997755 0.997733 1.00282 1.00072 0.997175 0.997497 1.00325 1.00211 0.997762 0.999271 1.00096 1.0006 0.999805 0.999516 0.999844 1.00021 1.00029 0.999989 0.999873 0.999935 1.00007 1.00006 1.00001 0.999982 0.999963 1.00001 0.999982 1.00001 0.999988 0.999996 0.999979 0.999978 0.999951 0.999978 0.999898 1 0.999841 0.999973 0.999948 0.999701 1.0004 0.999288 1.00083 0.999033 1.00166 0.997711 1.00331 0.996142 1.00542 0.993292 1.00999 0.988938 1.01857 0.979433 1.03646 0.954789 1.07647 0.895184 1.15332 0.788334 1.27256 0.67196 1.33359 0.770566 1.04641 1.15852 0.757935 1.14067 1.06207 0.863977 1.00273 1.10099 0.961287 0.95559 1.0379 1.0145 0.986258 0.99733 1.00166 1.0003 1 1.00038 1.0006 1.00046 1.00001 0.999579 0.999467 0.999725 1.00005 1.00016 1.00008 0.999993 0.999973 0.999988 1 1 1 1 0.999998 1 0.999997 1 1 0.999993 1.00001 1.00001 0.999994 0.999999 1.00001 0.999982 1.00002 0.999997 0.99998 1.00004 0.99995 1.00004 1 0.999948 1.0001 0.999875 1.00011 0.999956 0.999931 1.00022 0.999612 1.00051 0.999549 1.00013 1.00019 0.999939 0.999551 1.00096 0.997584 1.00634 0.990464 1.00402 1.00981 0.982878 1.01009 0.998513 1.00155 0.997125 0.995363 1.01208 0.996053 0.996525 1.00434 0.99357 1.00313 1.00173 0.996543 0.99859 1.00143 1.00107 0.998861 1.00018 1.00091 0.999088 1.00018 0.999891 0.999701 1.00046 1.00027 0.99984 0.999803 0.999972 1.00001 0.999987 1.00002 0.999983 1.00002 0.999987 1.00007 0.999985 1.00003 0.999968 1 0.999988 0.999989 0.999984 1.00001 0.999924 1.00008 0.999796 1.0002 0.999629 1.00032 0.999488 1.00043 0.999311 1.00077 0.998766 1.00162 0.997931 1.00259 0.996614 1.00452 0.99363 1.00774 0.988753 1.0138 0.980044 1.02439 0.966014 1.04177 0.946726 1.06372 0.935575 1.06699 0.959956 1.01239 1.07145 0.812055 1.27915 0.702396 1.18422 1.003 0.87562 1.11366 1.01774 0.908027 1.0223 1.05186 0.969921 0.977422 1.01952 1.00666 0.996229 0.999127 1.00002 1.00023 1.00027 0.999867 0.999548 0.999467 0.999673 1 1.00021 1.00018 1.00005 0.999964 0.999963 0.999992 1 1 1 0.999998 1 0.999999 0.999999 1 0.999996 1 1 0.999995 0.999998 1.00001 0.99999 1.00001 1 0.999985 1.00002 0.999979 1.00001 1.00002 0.999952 1.00006 0.999941 1.00003 1.00003 0.999914 1.00013 0.999857 1.00009 1.00004 0.999709 1.00061 0.999173 1.00082 0.99926 1.00076 0.999602 0.999111 1.00152 1.00082 0.996616 0.99993 1.00843 0.987746 1.00717 0.997926 1.00359 1.00013 0.991994 1.0046 1.00265 0.993614 1.00383 1.00086 0.997413 1.00299 1.0009 0.999072 1 1.00156 0.999848 0.997839 1.00058 1.00122 0.999906 0.999722 0.999496 0.999903 1.00042 1.00026 0.999906 0.999825 1.00002 1.00005 1.00004 0.999947 0.999991 0.999964 1.00003 0.999995 1.00001 1 0.99999 1.00001 0.999979 0.999995 0.999991 0.999961 1.00001 0.999922 1.00001 0.999905 1 0.999843 1.00015 0.999618 1.00053 0.99935 1.00099 0.998872 1.00205 0.997376 1.00399 0.994867 1.00762 0.990276 1.0149 0.981886 1.02798 0.965391 1.05082 0.931743 1.09081 0.882966 1.13661 0.835844 1.1859 0.857703 1.04816 1.08564 0.824131 1.14676 0.943916 0.963991 1.0798 0.981906 0.954469 1.02215 1.02466 0.98292 0.990223 1.00645 1.0006 0.998904 1.00014 0.999959 0.999697 0.999588 0.999767 1.00004 1.00024 1.00025 1.00012 0.99998 0.999933 0.999963 1 1.00001 1.00001 0.999999 0.999999 1 0.999999 1 0.999998 1 1 0.999997 1 0.999998 0.999995 1 1 0.999991 1.00001 0.999993 0.999996 1.00002 0.999972 1.00003 0.999986 0.999985 1.00005 0.999924 1.00008 0.999935 1.00002 1.00005 0.99987 1.00019 0.999807 1.00008 1.00012 0.999747 1.00022 0.999824 1.00009 1.00086 0.996998 1.00427 0.997738 0.998708 1.0016 1.00031 1.00298 0.992479 1.00245 1.00546 0.992219 1.00399 1.00161 0.998831 1.00206 0.99815 1.0006 1.00106 0.99982 0.99818 0.999639 1.00066 1.00013 1.00045 1.00001 0.99928 1.00036 1.00016 0.999941 1.00016 0.999958 0.999892 1.00003 1.0001 1.00001 0.999978 0.999997 1.00001 1 0.999979 0.999995 0.999987 1.00001 0.999993 1 1 0.999994 0.999996 1 0.999957 1.00004 0.999872 1.00012 0.999763 1.0002 0.999671 1.00031 0.999501 1.00068 0.999048 1.00144 0.998278 1.00243 0.996831 1.00399 0.994329 1.00634 0.991029 1.00984 0.987241 1.01398 0.985065 1.017 0.988501 1.00775 1.01384 0.976662 1.04488 0.904505 1.14751 0.828891 1.13079 0.971232 0.958406 1.06095 0.937062 1.02014 1.04208 0.972284 0.982157 1.01402 1.01127 0.991869 0.997117 1.00228 0.99996 0.99973 0.999793 0.999804 1.00002 1.00022 1.00024 1.00013 0.999986 0.999909 0.999924 0.999977 1.00001 1.00001 1 0.999999 0.999999 0.999999 1 1 1 1 0.999998 1 1 0.999998 1 1 0.999995 1 0.999999 0.999995 1.00001 0.999986 1.00001 1 0.99998 1.00003 0.999961 1.00003 0.999999 0.999963 1.00008 0.999899 1.0001 0.999935 0.999986 1.00013 0.999754 1.00031 0.999658 1.00044 0.999429 1.00045 0.999819 1.00066 0.997815 1.00253 1.00034 0.997099 1.00163 0.998581 1.00524 0.991557 1.00579 1.0034 0.993719 1.00128 1.002 0.997019 1.00173 0.998517 0.998394 1.00079 1.00115 1.00012 0.999058 1.00044 1.00047 0.999187 0.999989 1.00017 1.00004 1.00013 0.999756 0.999766 0.999989 1.00002 1.00001 0.999983 0.999997 0.999983 1.00003 0.999997 1.00003 0.999977 1.00002 0.999979 1.00001 0.999994 0.999989 1.00001 0.999976 1.00001 0.999985 0.999976 1.00001 0.999932 1.00003 0.999918 1.00004 0.999878 1.00017 0.999737 1.00052 0.999466 1.00115 0.998672 1.00244 0.996672 1.00485 0.993038 1.00948 0.987084 1.01763 0.977504 1.02902 0.96438 1.04375 0.947406 1.05218 0.95246 1.0585 0.947563 1.01806 1.03612 0.916238 1.07853 0.962175 1.02872 0.993897 0.955441 1.03818 1.01449 0.982028 0.992463 1.00659 1.00462 0.996985 0.999855 1.00069 0.999886 1.00009 1.00026 1.00025 1.00016 1.00001 0.999918 0.999913 0.999963 1.00001 1.00003 1.00002 1 0.999997 0.999998 1 1 1 1 0.999999 1 1 0.999999 1 0.999999 1 1 1 0.999996 1.00001 0.999994 1 1.00001 0.999986 1.00002 0.999987 1 1.00002 0.999963 1.00005 0.999953 1.00003 1.00001 0.999946 1.0001 0.999879 1.00011 0.999954 0.999964 1.00011 0.999793 1.0004 0.999519 1.00001 1.00076 0.999398 0.999677 0.999684 1.00239 0.997489 0.999033 1.00483 0.998222 0.995026 1.00523 0.997404 1.00047 1.00002 0.999054 1.00075 1.00134 1.00019 0.999789 1.00074 0.999574 0.999632 0.99988 0.999941 1.00055 1.00023 0.999599 0.999937 0.999986 1.00014 1.00027 1.00006 0.999939 0.999939 1 1.00002 1.00001 0.999978 1 0.999994 1.00001 0.999994 1.00001 0.999994 1.00001 0.999995 0.999997 0.999997 0.999991 1.00001 0.99997 1.00003 0.99992 1.00008 0.999844 1.00016 0.999749 1.00033 0.999578 1.00074 0.999225 1.00141 0.998577 1.00212 0.997559 1.00272 0.996532 1.00291 0.996825 1.00195 1.00024 0.997346 1.00801 0.989026 1.02315 0.969598 1.0293 0.966811 1.05249 0.937401 1.04723 0.986015 0.986339 1.00691 0.99565 1.04295 0.964412 0.980053 1.02765 1.00292 0.993582 0.996432 1.00282 1.00136 0.998857 1.00012 1.00023 1.00009 1.00009 0.999977 0.9999 0.999891 0.999941 0.999997 1.00003 1.00002 1.00001 0.999996 0.999995 0.999998 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999998 0.999998 1 0.999999 0.999999 1 0.999993 1.00001 0.999998 0.999994 1.00002 0.999979 1.00002 0.999992 0.999989 1.00003 0.999945 1.00006 0.999943 1.00003 1.00001 0.999933 1.00011 0.999849 1.0002 0.999729 1.00024 0.999932 1.0001 0.999286 1.00132 0.999072 0.999904 0.999881 1.00239 0.997481 0.997399 1.00611 0.995626 1.00063 1.00241 0.997545 1.00158 1.00147 0.998108 1.00132 0.999252 0.999152 0.999595 1.00045 1.00069 0.999735 0.999856 1.00004 0.99973 1.00015 1.00013 1.00004 1 0.999843 0.999961 1.00008 1.00005 0.999995 0.999982 1.00001 1 1 0.999985 1.00001 0.999988 1.00001 0.99999 1.00001 1 0.999992 1.00001 0.999975 1.00001 0.99998 0.999996 0.999997 0.999972 1.00001 0.999958 1.00005 0.999918 1.00023 0.999793 1.00068 0.99941 1.00147 0.998296 1.00282 0.995978 1.00521 0.992466 1.00895 0.988356 1.01352 0.985468 1.01493 0.985098 1.01349 0.996459 1.00086 0.994031 1.00033 1.02058 0.971252 1.02008 0.996966 1.00299 0.971116 1.0211 1.02853 0.968057 0.997047 1.01082 1.00023 0.998614 0.998217 1.0011 1.00024 0.999669 1.00008 0.999981 0.999891 0.999892 0.999937 0.999992 1.00003 1.00003 1.00002 1 0.999994 0.999996 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 1 0.999998 1 0.999997 1 1 0.999994 1.00001 0.999992 1 1.00001 0.999984 1.00002 0.999974 1.00002 0.999997 0.999978 1.00005 0.99993 1.00008 0.999927 1.00005 0.999985 0.999943 1.0002 0.999645 1.00036 0.999811 1.0002 0.999309 1.00107 0.999989 0.998303 1.00084 1.00176 0.997763 1.00039 1.00251 0.996381 1.00285 0.998912 0.999609 0.999989 0.999296 0.998672 1.00144 1.00046 0.999625 1.00018 0.999908 0.999944 0.999999 0.999981 1.00023 1.00005 0.999842 0.999935 0.999918 0.999993 1 0.999965 1 1.00001 0.999993 0.999988 1.00001 0.999998 1.00001 0.999987 1.00001 0.999985 1.00001 0.999986 1.00001 0.999994 1 1.00001 0.999986 1.00001 0.999965 1.00004 0.999925 1.00009 0.999861 1.00018 0.99978 1.00038 0.999686 1.00074 0.999535 1.00112 0.999234 1.00109 0.99907 1.00022 1 0.998082 1.00331 0.994064 1.00912 0.989721 1.01319 0.984671 1.01455 0.993268 1.00979 0.981538 1.00738 1.01038 0.990409 0.997654 1.01749 0.99516 0.97143 1.02545 1.00882 0.984044 1.00277 1.00156 1.00028 0.999626 0.999295 1.00044 0.999977 0.999859 0.999963 0.999966 1.00001 1.00004 1.00005 1.00003 1.00001 0.999996 0.999995 0.999998 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 1 0.999997 1 0.999998 0.999998 1.00001 0.999991 1.00001 0.999993 0.999998 1.00001 0.999975 1.00003 0.999968 1.00002 0.999997 0.999977 1.00005 0.999914 1.00012 0.999842 1.00014 0.999974 0.999898 1.00003 1.00023 0.999824 0.999546 1.00047 1.0009 0.997945 1.00164 1.00043 0.997634 1.00205 0.999389 0.999019 1.0012 0.998196 1.00084 1.00178 0.999345 1.00012 1.00017 0.999907 0.999569 0.999917 1.00029 1.00001 0.999861 0.999891 0.999855 1.00003 1.00004 1.00011 1.00009 0.999971 0.99996 0.99998 1.00001 1.00002 1 0.999993 0.999999 1 1 1 1 1 1 0.999996 1 0.999988 1.00001 0.999984 1.00002 0.999983 1 0.999994 0.999984 1.00002 0.999952 1.00012 0.9999 1.00038 0.999782 1.00089 0.99936 1.00158 0.998245 1.00248 0.99649 1.00358 0.995117 1.0043 0.995905 1.00253 0.999864 0.999821 1.00389 0.993463 1.00381 1.00081 1.01017 0.982778 1.00125 1.01359 0.990192 0.995386 1.02162 0.987748 0.986808 1.01685 0.997947 0.995667 1.00215 0.999617 1.00055 0.999847 0.999787 1.00012 0.999973 0.999996 1.00003 1.00003 1.00002 1 0.999991 0.999989 0.999993 0.999998 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 1 0.999999 1 1 0.999998 1 0.999996 1 1 0.999994 1.00001 0.999988 1.00001 0.999996 0.999993 1.00002 0.999967 1.00004 0.999955 1.00004 0.999976 0.999985 1.00009 0.999822 1.00022 0.99984 1.00014 0.999635 1.0006 0.999677 0.999722 1.00043 1.00038 0.998338 1.00153 0.999927 0.998943 1.00125 0.998597 1.00173 1.0004 0.999345 0.999754 1.00045 0.998702 1.00025 1.00039 1.0001 1.00001 0.999948 0.999979 1.00006 1.00008 1.0002 1.00008 0.99997 0.999931 0.99995 1.00006 1.00005 0.999997 0.999988 0.999998 1.00001 1 0.999996 0.999989 1 0.999994 1.00001 0.999992 1.00001 0.999991 1.00001 0.999994 0.999997 1 0.999982 1.00003 0.999956 1.00005 0.999921 1.0001 0.999886 1.00018 0.99988 1.00034 0.999943 1.00055 1.00004 1.0005 1.0001 0.999721 1.00058 0.998041 1.00207 0.995905 1.00452 0.995165 1.00439 0.996778 1.00389 1.00022 0.999273 0.994459 1.00491 1.01132 0.98472 0.99985 1.0125 0.987975 1.00156 1.01331 0.9879 0.998815 1.00717 0.996609 0.99994 1.00054 0.999661 1.00034 0.999917 0.999963 1.00005 1.00002 1.00002 1.00001 1 0.999995 0.999997 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999996 1 0.999996 1 1 0.999991 1.00001 0.999985 1.00001 0.999995 0.999992 1.00002 0.999955 1.00007 0.999914 1.00008 0.999984 0.999939 1.00008 0.999947 1.00014 0.999592 1.0006 0.999701 0.999458 1.00089 0.999912 0.999308 1.00061 0.999677 1.00063 1.00018 0.998759 1.00067 0.999032 0.999761 1.0006 1.00043 0.999641 1.00009 0.999972 0.999843 0.999929 1.0001 1.00003 0.999902 0.999863 0.99994 1.00001 0.999993 0.999998 0.999982 0.999993 1.00001 0.999996 0.99999 0.999995 1.00001 1.00001 1 0.999994 1 0.999993 1 0.999993 1.00001 0.999992 1.00001 0.999988 1.00001 0.999987 1 0.999999 0.999988 1.00002 0.999963 1.00007 0.999932 1.0002 0.999913 1.00048 0.999881 1.00088 0.999595 1.00114 0.998873 1.00105 0.998348 1.00044 0.999104 0.998861 1.00177 0.998185 1.00193 0.998139 1.00217 1.00188 1.00172 0.989755 1.0059 1.01007 0.987758 1.00238 1.00614 0.990671 1.0055 1.00418 0.992652 1.00252 1.00168 0.998377 1.00058 0.99987 0.999872 1.0001 0.999973 1.00001 1.00001 0.999993 0.999992 0.999992 0.999996 0.999999 1 1 1 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 1 1 0.999998 1 0.999995 1.00001 0.999997 0.999999 1.00001 0.999987 1.00002 0.999978 1.00002 0.999988 0.999991 1.00004 0.999916 1.0001 0.999917 1.00007 0.999879 1.00019 0.999912 0.999723 1.00051 0.999973 0.999304 1.00076 0.9997 1.00009 1.00012 0.999311 1.00033 0.999523 1.00019 1.00102 0.999894 0.999641 1.00046 0.999704 0.999842 1.00025 1.00021 0.999965 0.999953 0.999956 1.00002 1.00002 1.00002 1.00002 1.00003 0.999993 0.999966 0.999983 0.999999 1.00001 1 0.999995 0.999995 1 1.00001 1 1 0.999996 1 0.999995 1 0.999997 1 1 0.999996 1.00001 0.999979 1.00003 0.999959 1.00005 0.999944 1.00007 0.999957 1.00012 1.00005 1.00023 1.00026 1.00033 1.00046 1.00001 1.00052 0.999058 1.0007 0.998053 1.00092 0.998068 1.00007 1.00027 1.00027 1.00022 0.999453 0.999081 1.00433 1.00215 0.989808 1.00548 1.00572 0.992766 1.00376 1.00049 0.995425 1.00505 0.999668 0.997142 1.00187 0.999811 0.999584 1.00027 0.999903 0.999989 1.00002 0.999985 0.999996 0.999997 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999998 1 1 0.999997 1.00001 0.999993 1.00001 0.999997 0.999998 1.00001 0.999979 1.00003 0.999963 1.00003 0.999996 0.999971 1.00004 0.999954 1.00009 0.999758 1.00037 0.999796 0.999806 1.00031 1.00002 0.999626 1.00044 0.999621 0.99998 1.0001 1.00032 1.00051 0.999615 0.999856 0.999921 0.999896 0.999666 1.00052 0.999776 0.999809 0.999903 1 0.999938 1.00006 1.00006 1.00003 0.999995 0.999985 0.999997 1.00002 1.00003 1.00001 0.999994 1 1.00001 1.00001 0.999999 0.999995 0.999995 1 1 1.00001 0.999997 1.00001 0.999992 1.00001 0.999989 1.00001 0.999989 1.00001 0.999999 0.999991 1.00002 0.99997 1.00004 0.999953 1.00009 0.999956 1.00021 1.00003 1.00045 1.00015 1.00063 1.00002 1.00039 0.999668 0.999659 0.999698 0.998761 1.00024 0.998525 0.99965 1.00013 1.00062 1.00042 0.999555 0.997367 1.00507 1.0013 0.993234 1.00405 1.0015 0.997266 1.00297 0.998263 0.998801 1.0027 0.998842 0.999421 1.00072 0.999724 0.99993 1.00006 0.999965 1.00001 1 0.999997 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999998 1 0.999998 1 1 0.999995 1.00001 0.999991 1.00001 0.999996 0.999994 1.00002 0.999964 1.00004 0.999968 1.00003 0.999948 1.00007 1.00003 0.999768 1.00034 0.999812 0.999892 1.00027 0.99984 0.999821 1.00032 1.0001 1.00008 0.999617 0.999869 0.999877 0.999849 1.00023 1.00006 1.00004 0.999873 1.00021 0.999969 1.00007 1.00012 1.00004 0.999941 0.999953 0.999982 0.999998 0.999994 0.999994 0.999996 0.999995 1 0.999999 0.999992 0.999996 1 1 1 0.999999 0.999997 0.999998 0.999999 1 1 1 0.999998 1 0.999995 1.00001 0.99999 1.00001 0.999986 1.00002 0.999981 1.00002 0.999985 1.00003 1.00003 1.00007 1.00019 1.00021 1.00044 1.00031 1.00053 0.999951 1.00024 0.999335 0.999794 0.999213 0.99918 0.999716 0.999068 0.999143 1.00003 1.00027 1.00119 0.999187 0.997549 1.00396 1.0001 0.997048 1.00231 0.999494 0.999642 1.00141 0.998469 1.00011 1.00089 0.999327 1.00001 1.00019 0.999899 1.00002 1.00001 0.999993 1 1 1 1 1 1 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999999 1 0.999997 1 0.999999 0.999999 1 0.999991 1.00001 0.999987 1.00001 1 0.999988 1.00002 0.99998 1.00005 0.999879 1.00015 0.999942 0.999879 1.00025 0.99984 0.999873 1.00031 0.999923 0.999924 0.999889 0.999832 1.00012 1.00004 1.00022 1.00017 0.999842 1.00006 0.999978 0.999858 1.00012 1.00003 0.999918 0.999903 1.00005 1.00001 1.00001 1.00001 1.00001 1 0.999992 0.999985 0.999994 1 1 1 0.999995 0.999995 0.999998 1 1 1 1 0.999997 0.999999 0.999997 1 0.999997 1.00001 0.999996 1 0.999997 0.999997 1.00001 0.999984 1.00002 0.999971 1.00004 0.99997 1.00007 1.00002 1.00017 1.00019 1.00039 1.00041 1.00048 1.00029 0.999991 0.999891 0.999357 0.999614 0.999198 0.999213 0.99958 0.999289 0.999116 0.999623 0.999993 1.00139 0.999003 0.998691 1.00219 0.99947 0.999238 1.00093 0.999319 1.0003 1.00034 0.999258 1.00027 1.00017 0.999767 1.00006 1.00001 0.999975 1.00001 1.00001 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999998 1 0.999997 1 0.999999 0.999997 1.00001 0.999988 1.00001 0.999989 1.00001 0.999975 1.00002 1.00004 0.999875 1.00017 0.999883 0.999946 1.00018 0.999936 0.999873 1.00008 0.999875 1.00013 1.00013 1.00003 1.00006 0.999892 0.99984 1.00015 0.99992 1.00009 1.00012 0.999744 1.00008 1.00001 0.999978 0.999934 1.00003 0.999983 0.999983 1 1 1.00001 1.00001 0.999998 0.999997 1 1.00001 1.00001 1 0.999998 0.999997 0.999999 1 1 1 1 1 0.999997 1 0.999996 1 0.999995 1.00001 0.999993 1 0.999997 0.999999 1 0.999996 1.00001 1 1.00007 1.00007 1.00022 1.00028 1.00047 1.00046 1.0005 1.00016 0.99994 0.999666 0.999408 0.999483 0.999272 0.999203 0.999539 0.999406 0.999339 0.99928 0.999933 1.00093 0.99919 0.999613 1.00088 0.999527 0.999944 1.0002 0.999668 1.00028 0.999966 0.999766 1.00014 1.00001 0.99996 1.00003 1 0.999994 1 0.999999 0.999999 1 1 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999997 1 0.999996 1 1 0.999998 1 0.99999 1.00003 0.999945 1.00006 0.999998 0.999908 1.00015 0.999907 0.999957 1.00008 0.999961 1.00003 1.00011 0.999937 1.00001 0.99987 0.999913 1.00004 1.00002 0.999873 1.00004 0.999892 0.99995 1.00016 0.999893 1.00007 1.00007 1.00001 0.999984 1.00003 1.00002 0.999994 1 1.00001 1 1 0.999999 0.999994 0.999997 1 1 1 1 0.999998 0.999998 0.999999 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999995 1.00001 0.999989 1.00001 0.999986 1.00002 0.999998 1.00003 1.00007 1.00014 1.00026 1.00039 1.00051 1.00053 1.00046 1.00012 0.999869 0.999608 0.999427 0.999453 0.99935 0.999307 0.999507 0.999536 0.999525 0.999298 0.999949 1.00036 0.99952 0.999979 1.00025 0.999784 1.00007 0.999953 0.99992 1.00013 0.999954 0.999958 1.00004 0.999997 0.999997 1.00001 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999999 1 0.999997 1 0.999994 1.00001 0.999989 1 1.00003 0.999933 1.00007 0.999976 0.999944 1.00009 0.999954 0.999995 1.00006 0.999939 0.999977 0.999939 0.999972 1.00013 0.999992 1.00005 1.00005 1.00005 1.00003 1.00005 1.00003 0.999942 1.00005 0.999926 0.999957 1.00003 0.999981 0.999983 0.999996 1.00001 0.99999 0.999986 0.999997 1 1 1 0.999997 0.999995 0.999997 0.999999 1 1 1 0.999999 0.999998 0.999999 0.999999 1 0.999999 1 0.999997 1 0.999997 1 1 0.999997 1.00001 0.999991 1.00001 0.999988 1.00002 1 1.00005 1.00009 1.00018 1.00031 1.00047 1.00054 1.00056 1.00044 1.00012 0.999857 0.999636 0.999473 0.99948 0.99947 0.999488 0.999568 0.999666 0.99964 0.999536 0.999986 1.00007 0.999791 1.00005 1.00003 0.999962 1.00005 0.999964 0.999999 1.00005 0.999993 1.00001 1.00002 1 1.00001 1 0.999999 1 1 1 1 1 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 0.999999 1 1 0.999991 1.00002 0.999977 1.00001 1.00002 0.999941 1.00006 0.999974 0.999988 1.00004 0.999975 0.999979 1.00001 0.999999 1.0001 0.999973 0.999966 1.00005 0.999894 1.00001 0.99999 0.999968 1.00004 0.999978 1.00003 1.00001 1.00004 1.00001 0.999973 1.00003 0.999992 0.999995 1 1.00001 1.00001 0.999994 0.999993 1 1 1 1 1 0.999998 0.999999 1 1 1 1 1 1 0.999999 1 1 1 0.999999 1 0.999997 1 0.999996 1 0.999999 1 1 0.999999 1.00001 1.00002 1.00006 1.00012 1.00021 1.00034 1.0005 1.00056 1.00056 1.00044 1.00018 0.999915 0.999702 0.999558 0.999567 0.999628 0.999664 0.999698 0.999793 0.99976 0.999769 1.00001 0.999999 0.999952 1.00003 1.00001 1.00001 1.00003 1 1.00002 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999996 1 1 0.999991 1.00002 0.999972 1.00002 1.00001 0.999965 1.00004 0.999968 1 1.00001 1 1.00003 0.999986 0.999957 1.00005 0.999954 0.999972 1.00006 0.999933 1 0.999988 0.999911 1.00002 0.999955 0.999967 0.999996 0.999999 1.00001 0.99998 1.00002 1 0.999994 0.999999 1 1.00001 1 0.999997 0.999996 0.999998 1 1 1 1 0.999999 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999998 1 0.999995 1.00001 0.999995 1 0.999997 1 1.00001 1.00002 1.00006 1.00013 1.00022 1.00035 1.00048 1.00054 1.00054 1.00045 1.00024 0.999999 0.999792 0.999671 0.999696 0.999785 0.999806 0.999825 0.999894 0.999885 0.999923 1.00001 1.00001 1.00001 1.00002 1.00002 1.00002 1.00002 1.00001 1.00001 1.00001 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999998 1 0.999994 1.00001 0.999997 0.999993 1.00002 0.999974 1.00002 1 0.999983 1.00003 0.999977 1.00002 0.999996 0.999971 1.00002 0.99999 0.99998 1.00006 1.00001 0.999998 1.00007 1.00002 1.00005 1.00008 0.999986 1.00006 1.00003 0.99999 1.00001 1.00001 1 0.999989 1 1.00001 0.999997 0.999994 0.999997 1 1 1 0.999999 0.999998 0.999999 1 1 1 0.999999 1 0.999999 1 0.999999 1 1 1 0.999999 1 0.999998 1 0.999999 0.999999 1 0.999997 1 0.999996 1 0.999998 1 1.00001 1.00003 1.00006 1.00013 1.00021 1.00032 1.00042 1.00048 1.00048 1.00043 1.00027 1.00006 0.999881 0.999792 0.999826 0.999896 0.999903 0.999919 0.999954 0.999966 0.999993 1.00001 1.00001 1.00002 1.00002 1.00001 1.00002 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999994 1.00001 0.999996 0.999995 1.00002 0.999981 1.00002 0.999997 0.999992 1.00002 0.999978 1.00001 1.00001 0.999981 1.00002 0.999986 0.999957 0.999982 0.999972 0.999948 0.999968 0.999956 0.999949 1.00001 0.999955 0.999983 1.00001 0.99999 0.999992 1.00001 1 0.999998 0.999992 1 1 0.999997 0.999995 0.999998 1 1 1 1 0.999999 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 0.999999 1 0.999998 1 1 0.999999 1 0.999999 1 0.999999 1 1.00001 1.00002 1.00006 1.00012 1.00017 1.00025 1.00034 1.00038 1.00039 1.00036 1.00025 1.00009 0.99995 0.999891 0.999921 0.999956 0.999956 0.999969 0.999987 0.999995 1.00001 1.00001 1.00001 1.00002 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999995 1.00001 0.999998 0.999997 1.00001 0.999987 1.00001 0.999994 1 1.00001 0.999998 1.00002 1.00001 0.999996 1.00003 1.00003 1.00003 1.00003 1.00004 1.00003 1.00003 1.00003 0.999996 1.00002 1.00001 0.999986 1.00001 1 0.999994 1 1 1 0.999998 1 1 1 0.999999 0.999998 0.999998 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999998 1 0.999998 1 0.999999 1 1 1 1 1.00001 1.00002 1.00004 1.00009 1.00013 1.00018 1.00023 1.00027 1.00029 1.00026 1.00019 1.00008 0.999993 0.999955 0.999971 0.999986 0.999982 0.99999 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999996 1 0.999997 1 1 0.999994 1.00001 0.99999 0.999994 0.999995 0.999975 0.999989 0.999985 0.999959 0.999971 0.999965 0.999967 0.999962 0.999975 0.999982 0.999983 1 0.99999 0.999994 1.00001 0.999991 1 1 0.999998 1 0.999999 1 1 0.999998 1 1 1 1 0.999999 1 1 1 1 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 0.999999 1 0.999999 0.999999 1 0.999998 1 0.999998 1 0.999999 0.999999 1 1 1 1.00001 1.00002 1.00003 1.00005 1.00008 1.00011 1.00014 1.00017 1.00018 1.00016 1.00011 1.00005 1.00001 0.999988 0.999992 0.999998 0.999996 0.999999 1 1.00001 1 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 1 1 0.999998 1 0.999997 1 1 0.999996 1.00001 1 1.00001 1.00003 1.00001 1.00002 1.00004 1.00003 1.00003 1.00003 1.00003 1.00001 1.00001 1.00001 0.999998 1 1.00001 0.999991 1.00001 0.999999 1 1 0.999999 1 1 1 1 0.999998 0.999998 0.999999 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 0.999999 1 1 0.999999 1 1 1 1.00001 1.00001 1.00002 1.00003 1.00004 1.00006 1.00008 1.00009 1.00009 1.00009 1.00006 1.00003 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999998 1 0.999998 1 1 0.999991 0.999999 0.99999 0.999979 0.999986 0.999981 0.999972 0.999973 0.999982 0.999976 0.999981 0.999997 0.999989 0.999991 1 0.999999 0.999992 1.00001 0.999997 1 0.999997 1 0.999999 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999999 1 1 1 1 1 1 0.999999 1 1 1 1 0.999999 1 1 0.999999 1 1 1 1 1 1 1 0.999999 1 1 1 1 1.00001 1.00001 1.00002 1.00002 1.00003 1.00003 1.00004 1.00004 1.00004 1.00002 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999998 1 0.999999 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00002 1.00002 1.00001 1.00002 1.00001 0.999998 1.00001 1.00001 0.999997 0.999999 1.00001 0.999996 1 0.999999 1 0.999998 1 0.999999 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999999 1 1 1 1 0.999999 1 0.999999 1 1 1 1 1 0.999999 1 0.999999 1 1 1 1 1 0.999999 1 1 1 1 1 1 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999998 0.999998 0.999998 0.999995 0.99999 0.99999 0.999994 0.999989 0.999984 0.999997 0.99999 0.999995 1 0.999998 0.999997 1 1 0.999996 1 1 1 0.999999 1 0.999999 1 1 1 1 0.999999 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 0.999999 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1.00001 1.00001 1 1.00001 1.00001 1 1 1 0.999999 1 1 0.999999 0.999999 1 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 0.999999 1 1 1 1 0.999999 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 0.999998 0.999997 0.999996 1 0.999996 0.999995 1 0.999998 0.999999 1 1 0.999999 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 0.999999 0.999999 1 0.999999 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 1 1 1 1 0.999999 1 1 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0.999999 0.999999 0.999999 0.999999 0.999998 0.999998 0.999998 0.999998 0.999998 0.999998 0.999998 0.999999 0.999999 0.999999 0.999999 0.999999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ) ; boundaryField { emptyPatches_empt { type empty; } top_cyc { type cyclic; } bottom_cyc { type cyclic; } inlet_cyc { type cyclic; } outlet_cyc { type cyclic; } } // ************************************************************************* //
617091f3380a28c66e640dfd79de89222343e272
c7d98beb689410cbba2c712a01c25863f267b5dc
/src/Include_lines/new/isotropic_exponential_similarity.cpp
62efc96af680641055a0a622a595096d3b918563
[]
no_license
ml4ai/hamlet_experiment_py2
2b8d5b21e9c3c62bc17409da4971869aaf13f705
2d49f797d0ee0baa0447e0965468e7c15e796bb7
refs/heads/master
2021-03-27T11:41:43.494446
2017-11-06T14:31:18
2017-11-06T14:31:18
61,496,702
0
1
null
null
null
null
UTF-8
C++
false
false
139
cpp
isotropic_exponential_similarity.cpp
"hdp_hmm_lt.h" "isotropic_exponential_similarity.h" "state_model.h" "util.h" <boost/bind.hpp> <boost/make_shared.hpp> <third_party/arms.h>
461aec1704f53ddd61631db3aa58ebf3a10cb5ce
865ce9523e1f7ed17491adac1b841fe2428ad041
/2018-9/9-15(ICPC Interner JiaoZuo)/K.cpp
3a5bea84fe0d68388fc5301f04e35ad6d62fc689
[]
no_license
Hydrogen5/ACM
a1ed3139c287fbd90bdbe91adc45a9015e74664e
7b19f253308793b176e8e942e0ae1d5d998d2057
refs/heads/master
2021-07-16T02:29:38.267256
2018-12-12T04:38:30
2018-12-12T04:38:30
129,661,683
0
0
null
null
null
null
UTF-8
C++
false
false
1,102
cpp
K.cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> #define MOD 1000000007 #define ll long long using namespace std; int c[2200]; ll dp[10010]; int main() { int T; scanf("%d", &T); while (T--) { int cnt = 0; int N, Q; scanf("%d%d", &N, &Q); for (int i = 1; i <= N; i++) { int tmp1, tmp2; scanf("%d%d", &tmp1, &tmp2); for (int i = 0; i < tmp2; i++) c[cnt++] = (1 << i) * tmp1; } memset(dp, 0, sizeof(dp)); dp[0] = 1; for (int i = 0; i < cnt; i++) { for (int j = 10000; j >= c[i]; j--) { if (j >= c[i]) { dp[j] += dp[j - c[i]]; dp[j] %= MOD; } } } while (Q--) { int m; scanf("%d", &m); printf("%lld\n", dp[m]); } } return 0; }
275f50e293338cacac6d305502957c5b2ec80cf1
e60112ee47d6887f00512e01d2c919495d578335
/iriclib_init.cpp
433972f0e892b8c29865f96b641f2555e8eae41f
[ "MIT" ]
permissive
usgs-coupled/iriclib-test
85ef24ef493d6caf8973405fffe1d2f387606a00
f89e03024788d3ae8d8b751007fe38f341b9196f
refs/heads/develop_v4
2023-08-14T19:20:20.815199
2021-09-14T21:22:35
2021-09-14T21:22:35
406,461,481
0
1
MIT
2021-09-14T21:22:00
2021-09-14T17:25:28
C++
UTF-8
C++
false
false
2,797
cpp
iriclib_init.cpp
#include "error_macros.h" #include "h5cgnsfile.h" #include "h5cgnsfilesolutionwriter.h" #include "iriclib.h" #include "iriclib_errorcodes.h" #include "internal/iric_h5cgnsfiles.h" #include "internal/iric_logger.h" #include <Poco/Environment.h> #include <Poco/File.h> #include <sstream> using namespace iRICLib; namespace { const std::string IRIC_SEPARATE_OUTPUT = "IRIC_SEPARATE_OUTPUT"; H5CgnsFileSolutionWriter::Mode writerMode = H5CgnsFileSolutionWriter::Mode::Standard; H5CgnsFileSolutionWriter::Mode setupWriterMode() { auto wm = writerMode; if (wm == H5CgnsFileSolutionWriter::Mode::Separate) {return wm;} if (! Poco::Environment::has(IRIC_SEPARATE_OUTPUT)) {return wm;} if (Poco::Environment::get(IRIC_SEPARATE_OUTPUT) == "1") { return H5CgnsFileSolutionWriter::Mode::Separate; } return wm; } int _checkFileIsOpen(int fid) { H5CgnsFile* file; int ier = _iric_h5cgnsfiles_get(fid, &file); RETURN_IF_ERR; if (file == nullptr) { return IRIC_INVALID_FILEID; } return IRIC_NO_ERROR; } } // namespace int cg_iRIC_Open(const char* filename, int mode, int* fid) { _IRIC_LOGGER_TRACE_ENTER(); _iric_logger_init(); _IRIC_LOGGER_TRACE_ENTER(); H5CgnsFile::Mode m = H5CgnsFile::Mode::OpenReadOnly; if (mode == IRIC_MODE_WRITE) { m = H5CgnsFile::Mode::Create; } else if (mode == IRIC_MODE_MODIFY) { m = H5CgnsFile::Mode::OpenModify; } auto myWriterMode = setupWriterMode(); try { auto f = new H5CgnsFile(filename, m); f->setWriterMode(myWriterMode); int ier = _iric_h5cgnsfiles_register(f, fid); RETURN_IF_ERR; _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; } catch (...) { std::ostringstream ss; ss << "In cg_iRIC_Open(), opening " << filename << " failed"; _iric_logger_error(ss.str()); _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_H5_OPEN_FAIL; } } int cg_iRIC_Close(int fid) { _IRIC_LOGGER_TRACE_ENTER(); H5CgnsFile* file; int ier = _iric_h5cgnsfiles_get(fid, &file); RETURN_IF_ERR; ier = _iric_h5cgnsfiles_unregister(fid); RETURN_IF_ERR; _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; } int iRIC_InitOption(int option) { _IRIC_LOGGER_TRACE_ENTER(); if (option == IRIC_OPTION_CANCEL) { try { Poco::File f(".cancel_ok"); f.createFile(); _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; } catch (...) { std::ostringstream ss; ss << "Creating .cancel_ok failed"; _iric_logger_error(ss.str()); } } else if (option == IRIC_OPTION_DIVIDESOLUTIONS) { writerMode = H5CgnsFileSolutionWriter::Mode::Separate; _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; } else if (option == IRIC_OPTION_STDSOLUTION) { writerMode = H5CgnsFileSolutionWriter::Mode::Standard; _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; } _IRIC_LOGGER_TRACE_LEAVE(); return IRIC_NO_ERROR; }
77d6b122045cbbb83a0bcd71ff01503945fe1497
0d439569aab54d66062006501214e0ff745dc192
/mainwindow.cpp
6008449f471b1c526e9f7c73be65c55e0f38a4bb
[ "MIT" ]
permissive
Mintpasokon/Flying-chess-qt
8adb3901c438f98e7f1461301ca96941b86c0d36
6ed0d651046fee74d2526ddca02ca7eebcd21e10
refs/heads/master
2020-08-11T18:35:04.045107
2019-10-12T11:17:15
2019-10-12T11:17:15
214,609,210
1
0
null
null
null
null
UTF-8
C++
false
false
5,031
cpp
mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)//, //ui(new Ui::MainWindow) { //ui->setupUi(this); this->planes = new plane*[16]; this->messageLabel = new QLabel(this); this->maps = new map(); //connect to server through soc this->soc = new socketconnect(); //be a server through ser this->ser = new socketserver(); //buttons this->startButton = new QPushButton(this); this->diceButton = new QPushButton(this); this->connectButton = new QPushButton(this); this->diceButton->setGeometry(startPixX + 16 * recWidth - 200, startPixY + 14 * recWidth, 300, 50); this->diceButton->setText("dice"); connect(this->diceButton, &QPushButton::clicked, this->diceButton, [=](){this->diceButton->setText(this->soc->hostOfServer.toString());}); this->startButton->setGeometry(900, 300, 60, 30); this->startButton->setText("start"); this->connectButton->setGeometry(900, 260, 90, 40); this->connectButton->setText("connect"); //the $isServer checkbox this->isServer = new QCheckBox(this); this->isServer->setGeometry(900,200,20,20); this->isServerLabel = new QLabel(this); this->isServerLabel->setGeometry(915,195,60,25); this->isServerLabel->setText("server"); connect(this->isServer, &QCheckBox::stateChanged, this, &MainWindow::isServerChanged); //init planes for(int i = 0; i < 16; i++){ this->planes[i] = new plane(this,i); this->planes[i]->setGeometry(this->maps->airport[i+i/4].x,this->maps->airport[i+i/4].y,recWidth,recWidth); } //when plane clicked for(int i = 0; i < 16; i++) connect(this->planes[i], &plane::send, this, &MainWindow::planeClicked); //when press $connect button connect(this->connectButton, &QPushButton::clicked, this, &MainWindow::on_connectButton_clicked); } MainWindow::~MainWindow() { //delete ui; for(int i = 0; i < 16; i++){ delete planes[i]; } delete[] planes; delete maps; delete soc; delete ser; delete messageLabel; delete isServer; delete isServerLabel; delete startButton; delete connectButton; delete diceButton; } void MainWindow::paintEvent(QPaintEvent* event){ Q_UNUSED(event); QPainter painter(this); QPixmap pix[4]; pix[0].load("yellow.png"); pix[1].load("blue.png"); pix[2].load("green.png"); pix[3].load("red.png"); QPixmap pixPlane[4]; pixPlane[0].load("yellowplane.png"); pixPlane[1].load("blueplane.png"); pixPlane[2].load("greenplane.png"); pixPlane[3].load("redplane.png"); for(int i = 0; i < 52; i++){ painter.drawPixmap(this->maps->route[i].x,this->maps->route[i].y,recWidth,recWidth,pix[(i+color+3)%4]); } for(int i = 0; i < 20; i++){ painter.drawPixmap(this->maps->finalroad[i].x,this->maps->finalroad[i].y,recWidth,recWidth,pix[(i/5+color)%4]); painter.drawPixmap(this->maps->airport[i].x,this->maps->airport[i].y,recWidth,recWidth,pix[(i/5+color)%4]); } for(int i = 0; i < 16; i++){ painter.drawPixmap(this->planes[i]->x(),this->planes[i]->y(),recWidth,recWidth,pixPlane[(i/4+color)%4]); } } void MainWindow::planeClicked(int number){ this->deg(number); if(status == 2 && number <= 3){ this->movePlaneBy(number,diceNumber); //status = 0; } } void MainWindow::movePlaneBy(int Plane, int steps){ if(this->planes[Plane]->region == 0 && steps >= 5){ this->planes[Plane]->move(this->maps->airport[(Plane/4+1)*5-1].x, this->maps->airport[(Plane/4+1)*5-1].y); this->planes[Plane]->region = ready; //tell the server }else if(this->planes[Plane]->region == 1){ for(int i = 1;i <= steps; i++) this->planes[Plane]->move(this->maps->route[i].x,this->maps->route[i].y); this->planes[Plane]->locationNum += steps; this->planes[Plane]->region = route; }else if(this->planes[Plane]->region == 2){ for(int i = this->planes[Plane]->locationNum;i <= this->planes[Plane]->locationNum + steps; i++) this->planes[Plane]->move(this->maps->route[i].x,this->maps->route[i].y); this->planes[Plane]->locationNum += steps; }; //if the plane moves, tell server } void MainWindow::on_connectButton_clicked(){ this->connectButton->setText("connecting"); this->soc->connectToServer(); } //when this computer is server, hide the connect button void MainWindow::isServerChanged(){ qDebug()<<"isServer state:"<<this->isServer->isChecked(); if(!this->isServer->isChecked()){ //this->connectButton->show(); this->ser->setActive(false); this->soc->active = true; } else{ //this->connectButton->hide(); this->ser->setActive(true); this->soc->active = false; } }
347683ad10ad45874cbbbe2adef091642fb474c0
36147a67342ff00faaa27151fd36af2650603c3b
/audio/source/Audio.cpp
1cd66b013404bfba826ecb835ff61a6739d57065
[]
no_license
cthornsb/OtterGB
5eda3c1715d322fbaafa1e7912c44a7a87accca3
aa2495b7e1a604b4842bebff5e1bd6b2764b4235
refs/heads/master
2023-06-26T09:05:35.075680
2021-02-19T23:36:03
2021-02-19T23:36:03
303,243,408
1
0
null
null
null
null
UTF-8
C++
false
false
1,794
cpp
Audio.cpp
#include <cmath> #include <iostream> #include "SoundManager.hpp" #include "SimpleSynthesizers.hpp" #include "WavFile.hpp" typedef struct{ float left; float right; } paTestData; /* This routine will be called by the PortAudio engine when audio is needed. * It may called at interrupt level on some machines so don't do anything * that could mess up the system like calling malloc() or free(). */ static int patestCallback( const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData ) { paTestData *data = static_cast<paTestData*>(userData); float *out = static_cast<float*>(outputBuffer); for(unsigned int i=0; i<framesPerBuffer; i++ ) { out[2*i] = data->left; /* left */ out[2*i+1] = data->right; /* right */ data->left += 0.01f; if( data->left >= 1.0f ) data->left -= 2.0f; data->right += 0.03f; if( data->right >= 1.0f ) data->right -= 2.0f; } return 0; } using namespace PianoKeys; using namespace SimpleSynthesizers; int main(){ SoundManager proc(3); WavFile* wav = new WavFile("/home/kuras/Downloads/sample.wav"); wav->print(); proc[1].replaceInput(0, wav); SquareWave* swave = new SquareWave(); SawtoothWave* swave2 = new SawtoothWave(); TriangleWave* swave3 = new TriangleWave(); swave->setFrequency(Key::C, 4); swave2->setFrequency(Key::E, 4); swave3->setFrequency(Key::G, 4); proc[0].replaceInput(0, swave); proc[0].replaceInput(1, swave2); proc[0].replaceInput(2, swave3); proc.init(); proc.start(); // Main loop proc.sleep(5000); proc.stop(); return 0; }
d936e63556789468f2e532aa3f869a258287aa8c
0f2d80a5eb7661ff551a603a09697af39cb5223c
/xnsclientwebserver.h
8080f9d970a84aea15e80acf42c6154f311ad860
[ "MIT" ]
permissive
xnsense/xns-client
156a76e5d89225b9b4d25d72dee1d76d069dd042
ff819dc0ed0e0976afb98228b6c06054f37bf94b
refs/heads/master
2021-01-11T12:36:01.839110
2017-02-25T20:31:20
2017-02-25T20:31:20
79,482,020
0
0
null
null
null
null
UTF-8
C++
false
false
626
h
xnsclientwebserver.h
// xnsClientWebServer.h #ifndef _xnsClientWebServer_h #define _xnsClientWebServer_h #include <ESP8266WiFi.h> #include <ESP8266WebServer.h> #include "xnsclientconfig.h" class xnsClientWebServerClass { public: xnsClientWebServerClass() { } static void Setup(xnsClientConfig *pConfig); static void Handle(); static xnsClientConfig *config; protected: static void SetupWebServer(); static void WebServer_GetConfig(); static void WebServer_SaveConfig(); private: static const char* AP_SSID; static ESP8266WebServer gWebServer; static String getConfigPage(); static String saveConfigResponsePage(); }; #endif
b9a24f38691a70ecf756eca18da9d4cd0d96f248
dc5a9aba7f1c9c22bc2c6ae28316cfe106ba799a
/lang_trick/type_or_value.cpp
8d609eab2a1426699515aa4866257e9bd059e256
[ "WTFPL" ]
permissive
hczhcz/trick-n-trick
4e3dade3aea388986016183e5c379fbd7e1c31f9
5415741c40b836e9604a36409b47927a2dd6f865
refs/heads/master
2022-08-12T08:59:10.197879
2022-07-29T16:35:43
2022-07-29T16:35:43
17,470,002
7
6
null
null
null
null
UTF-8
C++
false
false
685
cpp
type_or_value.cpp
#include <iostream> #include <string> #include <typeinfo> class Magic { public: template <class T> Magic(const T &value) { std::cout << "Value: " << value << std::endl; } }; template <class T> void printType(Magic (*value)(T)) { std::cout << "Type: " << typeid(T).name() << std::endl; } void printType(Magic *) {} #define F(x) ( \ [&]() { \ Magic magic(x); \ printType(decltype(&magic)(0)); \ } () \ ) int main(int argc, char **argv) { F(1 + 3); F(std::cout); F(new std::string {"test"}); F(argv); F(int *); F(std::string); F(char (&&)[5]); F(char (&)(int)); F(decltype(main)); return 0; }
f3609f07641360416aac463f55a5b272065d1e5a
39cdb6ff35231538ef25c565181981ccf237cc30
/BOJ/16928.cpp
d3a6fd1f42d642848a553a84783db8f1f51bea67
[]
no_license
dittoo8/algorithm_cpp
51b35321f6cf16c8c1c259af746a9f35d5ba8b76
d9cdda322d3658ffc07744e4080c71faeee6370c
refs/heads/master
2023-08-03T14:49:08.808253
2021-02-16T04:13:53
2021-02-16T04:13:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
865
cpp
16928.cpp
#include <cstdio> #include <queue> using namespace std; int map[102]; int c[102]; int n,m; int main(){ for(int i=1;i<=100;i++){ map[i] = i; c[i] = -1; } scanf("%d %d", &n, &m); for(int i=0;i<n;i++){ int a, b; scanf("%d %d", &a, &b); map[a] = b; } for(int i=0;i<m;i++){ int a, b; scanf("%d %d", &a, &b); map[a] = b; } c[1] = 0; queue<int> q; q.push(1); while(!q.empty()){ int now = q.front(); q.pop(); if (now == 100){ printf("%d", c[now]); return 0; } for(int i=1;i<=6;i++){ int next = now+i; if(c[map[next]]==-1 && next <=100){ c[map[next]] = c[now]+1; q.push(map[next]); } } } return 0; }
1679da8f99e662675ccf3427c97e0626628721d3
da1500e0d3040497614d5327d2461a22e934b4d8
/cobalt/updater/updater_unittest.cc
fd2d7dd2b3011023c9c6fed3b57dd622bd4062f6
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
youtube/cobalt
34085fc93972ebe05b988b15410e99845efd1968
acefdaaadd3ef46f10f63d1acae2259e4024d383
refs/heads/main
2023-09-01T13:09:47.225174
2023-09-01T08:54:54
2023-09-01T08:54:54
50,049,789
169
80
BSD-3-Clause
2023-09-14T21:50:50
2016-01-20T18:11:34
null
UTF-8
C++
false
false
1,346
cc
updater_unittest.cc
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "base/files/file_path.h" #include "base/path_service.h" #include "base/process/launch.h" #include "base/process/process.h" #include "base/time/time.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) #define EXECUTABLE_EXTENSION ".exe" #else #define EXECUTABLE_EXTENSION "" #endif // Tests the updater process returns 0 when run with --test argument. TEST(UpdaterTest, UpdaterExitCode) { base::FilePath this_executable_path; ASSERT_TRUE(base::PathService::Get(base::FILE_EXE, &this_executable_path)); const base::FilePath updater = this_executable_path.DirName().Append( FILE_PATH_LITERAL("updater" EXECUTABLE_EXTENSION)); base::LaunchOptions options; #if defined(OS_WIN) options.start_hidden = true; #endif base::CommandLine command_line(updater); command_line.AppendSwitch("test"); auto process = base::LaunchProcess(command_line, options); ASSERT_TRUE(process.IsValid()); int exit_code = -1; EXPECT_TRUE(process.WaitForExitWithTimeout(base::TimeDelta::FromSeconds(60), &exit_code)); EXPECT_EQ(0, exit_code); }
24210a4f8de2f729957875a7da05e659f9a26fa0
e8916b1c395c3d20226cec21a74c49399ce6da01
/src/Public.cpp
0d995abb87b43bc37210c071abd51f047825b6d1
[]
no_license
santhosh-kumar/MultiCameraTracking
1b89b4850b5ee1150ff037df2e14da8e5b20a44a
1aaa0abe22d6832007db04e8828091606f74f12d
refs/heads/master
2021-01-01T16:20:05.155860
2018-02-16T00:45:08
2018-02-16T00:45:08
19,094,498
65
33
null
null
null
null
UTF-8
C++
false
false
2,436
cpp
Public.cpp
// MILTRACK // Copyright 2009 Boris Babenko (bbabenko@cs.ucsd.edu | http://vision.ucsd.edu/~bbabenko). Distributed under the terms of the GNU Lesser General Public License // (see the included gpl.txt and lgpl.txt files). Use at own risk. Please send me your feedback/suggestions/bugs. #include "Public.h" ////////////////////////////////////////////////////////////////////////////////////////////////////// // random functions void randinitalize( const int init ) { rng_state = cvRNG(init); } int randint( const int min, const int max ) { return cvRandInt( &rng_state )%(max-min+1) + min; } float randfloat( ) { return (float)cvRandReal( &rng_state ); } vectori randintvec( const int min, const int max, const uint num ) { vectori v(num); for( uint k=0; k<num; k++ ) v[k] = randint(min,max); return v; } vectorf randfloatvec( const uint num ) { vectorf v(num); for( uint k=0; k<num; k++ ) v[k] = randfloat(); return v; } float randgaus(const float mean, const float sigma) { double x, y, r2; do{ x = -1 + 2 * randfloat(); y = -1 + 2 * randfloat(); r2 = x * x + y * y; } while (r2 > 1.0 || r2 == 0); return (float) (sigma * y * sqrt (-2.0 * log (r2) / r2)) + mean; } vectorf randgausvec(const float mean, const float sigma, const int num) { vectorf v(num); for( int k=0; k<num; k++ ) v[k] = randgaus(mean,sigma); return v; } vectori sampleDisc(const vectorf &weights, const uint num) { vectori inds(num,0); int maxind = (int)weights.size()-1; // normalize weights vectorf nw(weights.size()); nw[0] = weights[0]; for( uint k=1; k<weights.size(); k++ ) nw[k] = nw[k-1]+weights[k]; // get uniform random numbers static vectorf r; r = randfloatvec(num); //#pragma omp parallel for for( int k=0; k<(int)num; k++ ) for( uint j=0; j<weights.size(); j++ ){ if( r[k] > nw[j] && inds[k]<maxind) inds[k]++; else break; } return inds; } string int2str( int i, int ndigits ) { ostringstream temp; temp << setfill('0') << setw(ndigits) << i; return temp.str(); }
7f220b461e7e6f7a819a6259f632169bd8a86759
790cca6b19cfec4be8d2f6c02313b9d3fdbdb09d
/Source/Bomberman1/PlayerCharacter.h
76d0d1732254d6a988d1371a5c11856ff75dc885
[]
no_license
chrcy/Bomberman
d05b63e8a6d6708dec62bf3b3b5d6e751c9616a1
aa2b2d88e10488f63b7d2c7918517abc3c28bcfb
refs/heads/master
2020-03-08T18:53:10.753042
2018-04-09T03:52:51
2018-04-09T03:52:51
128,325,468
0
0
null
null
null
null
UTF-8
C++
false
false
1,852
h
PlayerCharacter.h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Character.h" #include "DestroyInterface.h" #include "PowerUpInterface.h" #include "BombInterface.h" #include "PlayerCharacter.generated.h" UCLASS(blueprintable) class BOMBERMAN1_API APlayerCharacter : public ACharacter, public IDestroyInterface, public IPowerUpInterface, public IBombInterface { GENERATED_BODY() public: // Sets default values for this character's properties APlayerCharacter(); protected: // Called when the game starts or when spawned virtual void BeginPlay() override; public: // Called every frame virtual void Tick(float DeltaTime) override; // Called to bind functionality to input virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; // Called when a bomb has destroyed you void Destroyed_Implementation() override; // makes you go faster void IncreaseSpeed_Implementation() override; // can drop more bombs at once void IncreaseBombs_Implementation() override; // bombs explode further void IncreaseExplosion_Implementation() override; // Called to drob a bomb void DropBomb_Implementation() override; // Called when the bomb has exploded void BombExploded_Implementation() override; //Input functions void Player1MoveUp(float AxisValue); void Player1MoveRight(float AxisValue); void Player1DropBomb(); void Player2MoveUp(float AxisValue); void Player2MoveRight(float AxisValue); void Player2DropBomb(); protected: // how many bombs can be dropped at the same time UPROPERTY(transient) int32 MaxBombs = 1; // how many bombs are currently active UPROPERTY(transient) int32 NumBombs = 0; // how far damage will occur (in all directions) UPROPERTY(transient) float ExplosionLength = 100; };
76818156b241a4d975a5f6671edd1d2ade402eaa
dae907db0cf43b427fd1a456b338be3910fc5f90
/P17921_ca_Reines__2_.cc
d0d87d85e4b7a0a7422da0a3887f9fe978278552
[]
no_license
FranciOrtiz/jutge_problems
4c5c273ada09f20088b08287356bbb967a642e45
a838f6ad8995cf57ae6f11cc6beeb3f13fa7e55d
refs/heads/master
2022-12-23T20:33:43.775974
2020-09-24T09:49:10
2020-09-24T09:49:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
934
cc
P17921_ca_Reines__2_.cc
#include <iostream> #include <vector> using namespace std; int n; template <class T> inline T abs (const T& n) { return (n<0)? -n: n; } #define m int(v.size()) void back(vector <int> v = vector <int> (0), vector <bool> f = vector <bool> (n,0)) { if (m==n) { for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { if (j==v[i]) cout << 'Q'; else cout << '.'; } cout << endl; } cout << endl; return; } v.push_back(0); for (int i = 0; i < n; i++) { if (f[i]) continue; v[m-1]=i; bool t = true; for (int j = 0; j < m-1; j++) if (abs(v[m-1]-v[j])==abs(m-1-j)) { t = false; break; } if (!t) continue; v[m-1]=i; f[i]=1; back(v,f); f[i]=0; } } int main () { cin >> n; back(); }
99eb323380a7b9beb4097f738c6badec8eccb5bf
af180db27145eae7511360f11d51b796354bf4f9
/Extramen2012/EX_J12_2.CPP
ba90702b3ab6401616708603f3d3fd7972d82179
[]
no_license
Amnesthesia/Course-OOP
3577a2ee87ab6816d471382692e29029a37c5559
5a22dfa49def7cbcd26763f15994ca41b1ebe427
refs/heads/master
2020-04-27T15:03:01.314271
2014-11-29T01:56:28
2014-11-29T01:56:28
null
0
0
null
null
null
null
WINDOWS-1257
C++
false
false
17,324
cpp
EX_J12_2.CPP
// Fil: FRODEH \ OO \ EXTRAMEN \ EX_J12_2.CPP // L›sningsforslag til kontinuasjonseksamen i OOP, 5.januar 2012, oppgave 2. // Laget av Frode Haug, HiG, desember 2009. // Programmet holder orden p† ulike typer gjenstander (malerier, m›bler og // ting). Alle diss (arvede objektene) ligger i en og samme liste. // // Det er mulig †: // - Skrive alt om EN gitt/spesiell gjenstand (oppgave 2B) // - Skrive alle gjenstander av en viss type/kategori (oppgave 2C) // - Legge inn en ny (subklasse av en) gjenstand (oppgave 2D) // - Slette/fjerne en gitt gjenstand (oppgave 2E) // - Skrive hele datastrukturen TIL fil (oppgave 2F) // - Lese hele datastrukturen FRA fil (oppgave 2G) // INCLUDE: #include <iostream> // cin, cout #include <fstream> // i(f)stream, o(f)stream #include <cstring> // strlen, strcpy #include <cctype> // toupper #include <cstdlib> // atof #include "listtool.h" // "Verkt›ykasse" for listeh†ndtering. using namespace std; // CONST og ENUM: const int STRLEN = 80; // Standard streng-/tekstlengde. const int MINAAR = 1500; // Gjenstand ikke eldre enn dette. const int MAXAAR = 2030; // Gjenstand ikke yngre enn dette. const int MINANT = 1; // Min. antall av en gjenstand (jfr. Ting). const int MAXANT = 100; // Max. antall av en gjenstand (jfr. Ting). const int MINSUM = 1; // Min. verdi/betalt for en gjenstand. const int MAXSUM = 200000; // Max. verdi/betalt for en gjenstand. enum Type { maleri, mobel, ting }; // Aktuelle subklasse-typer. // KLASSER: class Gjenstand : public Text_element { private: // Text = navn int aar; // Gjenstanden er fra dette †ret (ca.) float verdi, betalt; // Dens (antatte ca.) verdi og kj›pesum. protected: Type type; // Brukes/settes av subklassene. public: Gjenstand(char* t); // Lag innmaten ifm. oppgave 2D. Gjenstand(char* t, istream* inn); // Lag innmaten ifm. oppgave 2G. virtual void display(); // Lag innmaten ifm. oppgave 2B. bool operator == (Type typ) { return (type == typ); } virtual void skriv_til_fil(ostream* ut); // Lag innmaten ifm. oppgave 2F. }; class Maleri : public Gjenstand { private: char* kunstner; // Kunstnerens navn. public: Maleri(char* t); // Lag innmaten ifm. oppgave 2D. Maleri(char* t, istream* inn); // Lag innmaten ifm. oppgave 2G. ~Maleri() { delete [] kunstner; } void display(); // Lag innmaten ifm. oppgave 2B. void skriv_til_fil(ostream* ut); // Lag innmaten ifm. oppgave 2F. }; class Mobel: public Gjenstand { private: char* beskrivelse; // Beskrivelse av m›belet. public: Mobel(char* t); // Lag innmaten ifm. oppgave 2D. Mobel(char* t, istream* inn); // Lag innmaten ifm. oppgave 2G. ~Mobel() { delete [] beskrivelse; } void display(); // Lag innmaten ifm. oppgave 2B. void skriv_til_fil(ostream* ut); // Lag innmaten ifm. oppgave 2F. }; class Ting : public Gjenstand { private: // Materialet tingen er laget av: char* stoff; // porselen, krystall, st†l, jern,... int antall; // Antall duplikater man har av gjenstanden. public: Ting(char* t); // Lag innmaten ifm. oppgave 2D. Ting(char* t, istream* inn); // Lag innmaten ifm. oppgave 2G. ~Ting() { delete [] stoff; } void display(); // Lag innmaten ifm. oppgave 2B. void skriv_til_fil(ostream* ut); // Lag innmaten ifm. oppgave 2F. }; // DEKLARASJON AV FUNKSJONER: void skriv_meny(); char les(const char* t); float les(const char* t, const int MIN, const int MAX); void les(const char t[], char s[], const int LEN); Type les(); // Lag innmaten ifm. oppgave 2A. void skriv_en_gjenstand(); // Lag innmaten ifm. oppgave 2B. void skriv_all_av_type(); // Lag innmaten ifm. oppgave 2C. void ny_gjenstand(); // Lag innmaten ifm. oppgave 2D. void slett_gjenstand(); // Lag innmaten ifm. oppgave 2E. void skriv_til_fil(); // Lag innmaten ifm. oppgave 2F. void les_fra_fil(); // Lag innmaten ifm. oppgave 2G. // GLOBALE VARIABLE: List* gjenstandene; // Liste med ALLE de ulike gjenstandene. int main() { // HOVEDPROGRAM: char valg; gjenstandene = new List(Sorted); // Initierer listen. les_fra_fil(); // Oppgave 2G skriv_meny(); valg = les("\n\nKommando"); while (valg != 'Q') { switch(valg) { case 'A': gjenstandene->display_list(); break; case 'E': skriv_en_gjenstand(); break; // Oppgave 2B case 'T': skriv_all_av_type(); break; // Oppgave 2C case 'N': ny_gjenstand(); break; // Oppgave 2D case 'S': slett_gjenstand(); break; // Oppgave 2E default: skriv_meny(); break; } valg = les("\n\nKommando"); } skriv_til_fil(); // Oppgave 2F cout << "\n\n"; return 0; } // ************************************************************************* // ****************** DEFINISJON AV MEDLEMS-FUNKSJONER: ****************** // ************************************************************************* // *************************** Gjenstand: ************************** Gjenstand::Gjenstand(char* t) : Text_element(t) { // Oppgave 2D: aar = int(les("¸r", MINAAR, MAXAAR)); // Leser inn de ulike verdi = les("Verdi", MINSUM, MAXSUM); // datamedlemmene vha. betalt = les("Betalt", MINSUM, MAXSUM); // en hjelpefunksjon. } // Oppgave 2G: Gjenstand::Gjenstand(char* t, istream* inn) : Text_element(t) { *inn >> aar >> verdi >> betalt; // Leser datamedlemmer fra fil. inn->ignore(); } void Gjenstand::display() { // Oppgave 2B: cout << '\t' << text << "\n\t\t" // Skriver/displayer objektet: << "¸r: " << aar << "\tVerdi kr." << verdi << "\tBetalt kr." << betalt << '\n'; } // Oppgave 2F - Skriver alt til fil: void Gjenstand::skriv_til_fil(ostream* ut) { *ut << text << '\n' << aar << ' ' << verdi << ' ' << betalt << '\n'; } // ******************************* Maleri: ********************************* Maleri::Maleri(char* t) : Gjenstand(t) { // Oppgave 2D: char buffer[STRLEN]; type = maleri; // Setter aktuell subklassetype. les("Kunstner", buffer, STRLEN); // Leser kunstnernavnet: kunstner = new char[strlen(buffer)+1]; strcpy(kunstner, buffer); } // Oppgave 2G: Maleri::Maleri(char* t, istream* inn) : Gjenstand(t, inn) { char buffer[STRLEN]; type = maleri; // Setter aktuell subklassetype. inn->getline(buffer, STRLEN); // Leser datamedlemmer fra fil: kunstner = new char[strlen(buffer)+1]; strcpy(kunstner, buffer); } void Maleri::display() { // Oppgave 2B: cout << "\n\tMALERI:"; Gjenstand::display(); // Skriver/displayer "mors" data: cout << "\t\tKunstner: " << kunstner << '\n'; // Skriver egne data. } void Maleri::skriv_til_fil(ostream* ut) { // Oppgave 2F: *ut << "A "; // Skriver alt til fil: Gjenstand::skriv_til_fil(ut); *ut << kunstner << '\n'; } // ******************************* M›bel: ********************************** Mobel::Mobel(char* t) : Gjenstand(t) { // Oppgave 2D: char buffer[STRLEN]; type = mobel; // Setter aktuell subklassetype. les("Beskrivelse", buffer, STRLEN); // Leser beskrivelsen: beskrivelse = new char[strlen(buffer)+1]; strcpy(beskrivelse, buffer); } // Oppgave 2G: Mobel::Mobel(char* t, istream* inn) : Gjenstand(t, inn) { char buffer[STRLEN]; type = mobel; // Setter aktuell subklassetype. inn->getline(buffer, STRLEN); // Leser datamedlemmer fra fil: beskrivelse = new char[strlen(buffer)+1]; strcpy(beskrivelse, buffer); } void Mobel::display() { // Oppgave 2B: cout << "\n\tM¯BEL:"; Gjenstand::display(); // Skriver/displayer "mors" data: cout << "\t\tBeskrivelse: " << beskrivelse << '\n'; // Skriver egne data. } void Mobel::skriv_til_fil(ostream* ut) { // Oppgave 2F: *ut << "O "; // Skriver alt til fil: Gjenstand::skriv_til_fil(ut); *ut << beskrivelse << '\n'; } // ******************************* Ting: ********************************** Ting::Ting(char* t) : Gjenstand(t) { // Oppgave 2D: char buffer[STRLEN]; type = ting; // Setter aktuell subklassetype. les("Stoff", buffer, STRLEN); // Leser stoff og antall: stoff = new char[strlen(buffer)+1]; strcpy(stoff, buffer); antall = les("Antall", MINANT, MAXANT); } // Oppgave 2G: Ting::Ting(char* t, istream* inn) : Gjenstand(t, inn) { char buffer[STRLEN]; type = ting; // Setter aktuell subklassetype. *inn >> antall; inn->ignore(); // Leser datamedlemmer fra fil: inn->getline(buffer, STRLEN); stoff = new char[strlen(buffer)+1]; strcpy(stoff, buffer); } void Ting::display() { // Oppgave 2B: cout << "\n\tTING:"; // Skriver/displayer "mors" og Gjenstand::display(); // egne data: cout << "\t\tAntall: " << antall << "\tStoff: " << stoff << '\n'; } void Ting::skriv_til_fil(ostream* ut) { // Oppgave 2F: *ut << "T "; // Skriver alt til fil: Gjenstand::skriv_til_fil(ut); *ut << antall << ' ' << stoff << '\n'; } // **************************************************************************** // ****************** DEFINISJON AV (GLOBALE) FUNKSJONER: ****************** // **************************************************************************** void skriv_meny() { // Skriver alle mulige menyvalg: cout << "\n\nF¯LGENDE KOMMANDOER ER TILGJENGELIGE:" << "\n A - skriv Alle gjenstandene" << "\n E - skriv alt om En spesiell gjenstand" << "\n T - skriv gjenstander av en viss Type (maleri, m›bel, ting)" << "\n N - Ny gjenstand" << "\n S - Slett/fjern en gjenstand" << "\n Q - Quit / avslutt"; } char les(const char* t) { // Leser og upcaser brukerens valg/›nske: char ch; cout << t << ": "; cin >> ch; cin.ignore(); return (toupper(ch)); } // Leser en FLOAT mellom MIN og MAX: float les(const char* t, const int MIN, const int MAX) { char text[STRLEN]; float n; do { cout << '\t' << t << " (" << MIN << '-' << MAX << "): "; cin.getline(text, STRLEN); n = atof(text); // Leser som tekst - omgj›r: } while (n < MIN || n > MAX); return n; } // Leser inn en ikke-blank tekst: void les(const char t[], char s[], const int LEN) { do { cout << '\t' << t << ": "; // Skriver ledetekst. cin.getline(s, LEN); // Leser inn tekst. } while (strlen(s) == 0); // Sjekker at tekstlengden er ulik 0. } // Oppgave 2A - Leser og returnerer lovlig Type les() { // type gjenstand: char tegn; do // Leser ALLTID 'A', 'O' eller 'T': tegn = les("\tGjenstand-type (m)A(leri), (m)O(bel), T(ing)"); while (tegn != 'A' && tegn != 'O' && tegn != 'T'); switch (tegn) { // Gj›r om til og returnerer aktuell type: case 'A': return maleri; case 'O': return mobel; case 'T': return ting; } } void skriv_en_gjenstand() { // Oppgave 2B - Skriv EN spesiell gjenstand: char navn[STRLEN]; les("Se gjenstand (navn)", navn, STRLEN); // Leser navn. if (!gjenstandene->display_element(navn)) // Finnes? Displayer, ellers: cout << "\n\tIngen gjenstand med dette navnet!\n\n"; // melding. } void skriv_all_av_type() { // Oppgave 2C - Skriv EN spesiell gjenstand: Gjenstand* gjenst; // Hjelpepeker. int i, ant = gjenstandene->no_of_elements(); // L›kkevar, antall i listen. Type type = les(); for (i = 1; i <= ant; i++) { // G†r gjennom hele listen: gjenst = (Gjenstand*) gjenstandene->remove_no(i); // Tar ut. if (*gjenst == type) gjenst->display(); // Av aktuell type? Display! gjenstandene->add(gjenst); // Legger tilbake/inn igjen. } } void ny_gjenstand() { // Oppgave 2D - Legg inn en ny gjenstand: char navn[STRLEN]; Type type; les("Ny gjenstand (navn)", navn, STRLEN); // Leser nytt(?) navn. if (!gjenstandene->in_list(navn)) { // Finnes IKKE allerede: type = les(); // Leser typen. switch (type) { // Lager og legger inn nytt case maleri: gjenstandene->add(new Maleri(navn)); break; // aktuelt case mobel: gjenstandene->add(new Mobel(navn)); break; // subklasse- case ting: gjenstandene->add(new Ting(navn)); break; // objekt: } } else // Finnes allerede: cout << "\n\tGjenstand med dette navnet finnes allerede!\n"; } void slett_gjenstand() { // Oppgave 2E - Slett/fjern en gjenstand: char navn[STRLEN]; les("Slett/fjern gjenstand (navn)", navn, STRLEN); // Leser navn. if (gjenstandene->in_list(navn)) { // Finnes: if (les("\tSikker (j/N)") == 'J') { // VIL slette? gjenstandene->destroy(navn); // Sletter/fjerner. cout << "\n\tGjenstanden er slettet/fjernet.\n\n"; } else // Ville ikke slette: cout << "\n\tGjenstanden ble IKKE slettet/fjernet.\n\n"; } else // Finnes IKKE: cout << "\n\tIngen gjenstand med dette navnet!\n\n"; } void skriv_til_fil() { // Oppgave 2F - Skriv HELE datastrukturen til fil: Gjenstand* gjenst; // Hjelpepeker. ofstream utfil("GJENSTANDER.DTA"); // ¸pner aktuell fil. int i, ant = gjenstandene->no_of_elements(); // L›kkevar, antallet i listen. for (i = 1; i <= ant; i++) { // G†r gjennom hele listen: gjenst = (Gjenstand*) gjenstandene->remove_no(i); // Tar ut. gjenst->skriv_til_fil(&utfil); // Skriver objektet til fil. gjenstandene->add(gjenst); // Legger tilbake/inn igjen. } } void les_fra_fil() { // Oppgave 2G - Leser HELE datastrukturen fra fil: ifstream innfil("GJENSTANDER.DTA"); // ¸pner aktuell fil: char nvn[STRLEN]; // Gjenstands-navn. char type; // 'A', 'O' eller 'T'. if (innfil) { // Filen finnes: innfil >> type; // Leser om mulig 'A', 'O', 'T'. while (!innfil.eof()) { // Mer p† filen: innfil.ignore(); // Skipper ' ' (EN blank). innfil.getline(nvn, STRLEN); // Leser gjenstandens navn. switch (type) { // Aktuell ny lages/legges inn: case 'A': gjenstandene->add(new Maleri(nvn, &innfil)); break; case 'O': gjenstandene->add(new Mobel(nvn, &innfil)); break; case 'T': gjenstandene->add(new Ting(nvn, &innfil)); break; } innfil >> type; // Leser om mulig 'A', 'O', 'T'. } } else // Filen finnes IKKE: cout << "\n\nFant ikke filen 'GJENSTANDER.DTA'!\n\n"; }
5835af196ef143897a8a3b934eb328ca22d9eb72
4d317369bd7de599e0364e9097e50f381845e22c
/Contests/CodeForces Global Round 5/Programs/Balanced Rating Changes.cpp
d2683bda0a3b8e763b762daf1aa0c43a552db036
[]
no_license
MathProgrammer/CodeForces
4865f0bad799c674ff9e6fde9a008b988af2aed0
e3483c1ac4a7c81662f6a0bc8af20be69e0c0a98
refs/heads/master
2023-04-07T11:27:31.766011
2023-04-01T06:29:19
2023-04-01T06:29:19
84,833,335
256
114
null
2021-10-02T21:14:47
2017-03-13T14:02:57
C++
UTF-8
C++
false
false
1,029
cpp
Balanced Rating Changes.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int no_of_students; cin >> no_of_students; vector <int> rating(no_of_students + 1); vector <int> was_odd(no_of_students + 1, false); int sum = 0; for(int i = 1; i <= no_of_students; i++) { cin >> rating[i]; was_odd[i] = (abs(rating[i])%2 == 1); rating[i] /= 2; sum += rating[i]; } if(sum < 0) { for(int i = 1; i <= no_of_students && sum != 0; i++) { if(was_odd[i] && rating[i] > 0) { rating[i]++; sum++; } } } else if(sum > 0) { for(int i = 1; i <= no_of_students && sum != 0; i++) { if(was_odd[i] && rating[i] < 0) { rating[i]--; sum--; } } } for(int i = 1; i <= no_of_students; i++) { cout << rating[i] << "\n"; } return 0; }
bf1e7bd4c1c57bf80a767bf2dbf5e6045ba212a8
229f25ccda6d721f31c6d4de27a7bb85dcc0f929
/solutions/codeforce/Codeforces Round #204 (Div. 2)/B. Jeff and Periods/solution.cpp
77bf5ab06352957a0747d95cc6159032538f26b8
[]
no_license
camil0palacios/Competitive-programming
e743378a8791a66c90ffaae29b4fd4cfb58fff59
4211fa61e516cb986b3404d87409ad1a49f78132
refs/heads/master
2022-11-01T20:35:21.541132
2022-10-27T03:13:42
2022-10-27T03:13:42
155,419,333
0
0
null
null
null
null
UTF-8
C++
false
false
957
cpp
solution.cpp
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n; while(cin >> n){ map<int, vector<int>> v; for(int i = 0; i < n; i++){ int tmp; cin >> tmp; v[--tmp].emplace_back(i); } vector<pair<int,int>> ans; for(auto & i : v){ bool f = 1; int px = 0; if(i.second.size() > 1){ px = (i.second[1] - i.second[0]); for(int j = 1; j < i.second.size(); j++){ if(px != i.second[j] - i.second[j-1]){ f = 0; break; } } } if(f)ans.emplace_back(i.first + 1, px); } cout << ans.size() << endl; for(auto & i : ans){ cout << i.first << " " << i.second << endl; } } return 0; }
d85d76d28827e001f295b2f160ac9f1b125b0cb0
ece8eb987e8edc81507d922dafea63965b833bf2
/build/vs2017/menu_state.cpp
734df8d4b0c8f0ebecbb1bc1e083df94302cffb3
[]
no_license
JojoXx1999/cAR
d88ccc3fa79276db7447c8f665ee3773d0cf4fbc
75780141f5060ac94a0b5f77b4fc2976eb2b34e8
refs/heads/main
2023-06-18T07:29:31.324491
2021-07-21T17:53:10
2021-07-21T17:53:10
387,905,064
0
0
null
null
null
null
UTF-8
C++
false
false
7,266
cpp
menu_state.cpp
//-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// #include "menu_state.h" #include <graphics\texture.h> #include <graphics\sprite.h> #include <graphics\sprite_renderer.h> //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// void MenuState::Init(gef::Platform& platform) { //texture to display to screen m_screen_texture = CreateTextureFromPNG("menu.png", platform); m_flag_texture = CreateTextureFromPNG("flag.png", platform); m_instructions_texture = CreateTextureFromPNG("instructions.png", platform); m_example1 = CreateTextureFromPNG("marker_example_1.png", platform); m_example2 = CreateTextureFromPNG("marker_example_2.png", platform); m_example3 = CreateTextureFromPNG("marker_example_3.png", platform); height = 660.f; } //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// bool MenuState::Update(gef::InputManager* input_manager, float dt, GameStates& game_state, ErrorCodes& error_code) { Input(input_manager, game_state); return true; } //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// void MenuState::Input(gef::InputManager* input_manager, GameStates& game_state) { //If user presses select go to splash screen if (input_handler.ControllerButtonPressed(*input_manager, gef_SONY_CTRL_SELECT)) { game_state = GameStates::SPLASH; } } //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// void MenuState::Render(gef::SpriteRenderer* sprite_renderer, gef::Renderer3D* renderer_3d_) { //Create sprite to render to screen sprite_renderer->Begin(); if (m_screen_texture) { gef::Sprite screen_sprite; screen_sprite.set_position(gef::Vector4(480.f, 272.f, 0.f)); screen_sprite.set_height(544); screen_sprite.set_width(960); screen_sprite.set_texture(m_screen_texture); sprite_renderer->DrawSprite(screen_sprite); //Render how to play text gef::Sprite m_instructions_sprite; m_instructions_sprite.set_position(gef::Vector4(480.f, height, 0.f)); m_instructions_sprite.set_height(1232); m_instructions_sprite.set_width(720); m_instructions_sprite.set_texture(m_instructions_texture); sprite_renderer->DrawSprite(m_instructions_sprite); gef::Sprite flag_sprite; flag_sprite.set_position(gef::Vector4(480.f, height + 600, 0.f)); flag_sprite.set_height(328); flag_sprite.set_width(480); flag_sprite.set_texture(m_flag_texture); sprite_renderer->DrawSprite(flag_sprite); //Render marker layout examples gef::Sprite example1_sprite; example1_sprite.set_position(gef::Vector4(480.f, height + 930, 0.f)); example1_sprite.set_height(340); example1_sprite.set_width(432); example1_sprite.set_texture(m_example1); sprite_renderer->DrawSprite(example1_sprite); gef::Sprite example2_sprite; example2_sprite.set_position(gef::Vector4(480.f, height + (1300), 0.f)); example2_sprite.set_height(340); example2_sprite.set_width(432); example2_sprite.set_texture(m_example2); sprite_renderer->DrawSprite(example2_sprite); gef::Sprite example3_sprite; example3_sprite.set_position(gef::Vector4(480.f, height + (1670), 0.f)); example3_sprite.set_height(340); example3_sprite.set_width(432); example3_sprite.set_texture(m_example3); sprite_renderer->DrawSprite(example3_sprite); } sprite_renderer->End(); } //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------// void MenuState::CleanUp() { if (m_screen_texture) { delete m_screen_texture; m_screen_texture = NULL; } if (m_flag_texture) { delete m_flag_texture; m_flag_texture = NULL; } if (m_instructions_texture) { delete m_instructions_texture; m_instructions_texture = NULL; } if (m_example1) { delete m_example1; m_example1 = NULL; } if (m_example2) { delete m_example2; m_example2 = NULL; } if (m_example3) { delete m_example3; m_example3 = NULL; } } //-----------------------------------------------------------------------------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------------------------------------------------------------------------//
7dcb746bd696797573e6e9c3c9af0cf87ca5ab34
69b7ee977a5d180b785280f2c5cf5b45895f5360
/include/open_coders.hpp
77f81cb8dd0de692a9ed1fe7417b649196fb9e13
[ "Apache-2.0" ]
permissive
bjzu/open_coders
d99fa7d0cd25e889caa7f7494a9c962b60aac02b
da2b659f7d89362d6b6c9e9fb5b35799479881d0
refs/heads/master
2021-01-21T00:29:19.341741
2012-01-05T19:33:36
2012-01-05T19:33:36
3,702,432
1
0
null
null
null
null
UTF-8
C++
false
false
3,533
hpp
open_coders.hpp
/*----------------------------------------------------------------------------- * open_coders.hpp - A header for global variables, or something. * * Coding-Style: * emacs) Mode: C, tab-width: 8, c-basic-offset: 8, indent-tabs-mode: nil * vi) tabstop: 8, expandtab * * Authors: * Takeshi Yamamuro <linguin.m.s_at_gmail.com> * Fabrizio Silvestri <fabrizio.silvestri_at_isti.cnr.it> * Rossano Venturini <rossano.venturini_at_isti.cnr.it> *----------------------------------------------------------------------------- */ #ifndef INTEGER_CODERS_HPP #define INTEGER_CODERS_HPP #define __STDC_LIMIT_MACROS #include <cstdio> #include <string> #include <cstring> #include <iomanip> #include <stdint.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <limits.h> #include <math.h> #include <errno.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/resource.h> #include <boost/shared_ptr.hpp> #define USE_BOOST_SHAREDPTR #include "utils/err_utils.hpp" #include "utils/int_utils.hpp" /* Configure parameters */ #define MAXLEN 200000000 #define SKIP 32 /* Magic numbers */ #define MAGIC_NUM 0x0f823cb4 #define VMAJOR 0 #define VMINOR 2 /* A extension for a location file */ #define TOCEXT ".TOC" #define DECEXT ".DEC" #define NFILENAME 256 #define NEXTNAME 32 /* * FIXME: Some encoders might overrun the length of given * memory. This makes a code simple but unobvious, so we * need to remove it. */ #define TAIL_MERGIN 128 /* * Macros for reading files. A header for each compressed list * is composed of three etnries: the total of integers, a first * integer, and the next posision of a list. * * NOTICE: We assume that the size of each entry is 4B, and * the alignment follows little-endian. */ #define EACH_HEADER_TOC_SZ 4 #define __next_read32(addr, len) addr[len++] #define __next_read64(addr, len) \ ({ \ uint64_t ret; \ \ ret = addr[len + 1]; \ ret = (ret << 32) | addr[len]; \ len += 2; \ \ ret; \ }) #define __next_pos64(addr, len) \ ({ \ uint64_t nxlen; \ uint64_t ret; \ \ nxlen = len + EACH_HEADER_TOC_SZ - 2; \ \ ret = addr[nxlen + 1]; \ ret = (ret << 32) | addr[nxlen]; \ \ ret; \ }) #if HAVE_DECL_POSIX_FADVISE && defined(HAVE_POSIX_FADVISE) #define __fadvise_sequential(fd, len) \ posix_fadvise(fd, 0, len, POSIX_FADV_SEQUENTIAL) #else #define __fadvise_sequential(fd, len) #endif /* Support for over 4GiB files on 32-bit platform */ #if __i386__ #define FILE_OFFSET_BITS 64 #endif /* For debugs */ #if defined(DEBUG) && defined(__linux__) #define MALLOC_CHECK 2 #endif /* Keywords for compiler optimization */ #define __compiler_opt__ #ifdef __compiler_opt__ #define __no_aliases__ __restrict__ #define __likely(x) __builtin_expect(!!(x), 1) #define __unlikely(x) __builtin_expect(!!(x), 0) #else #define __no_aliases__ #define __likely(x) (x) #define __unlikely(x) (x) #endif /* __compiler_opt__ */ #endif /* INTEGER_CODERS_HPP */
27313125c8377a47e22ff9482b48987f624153e6
7fc063d09eb9bd01155091b9331bf4282e6f1686
/EditorFotos/utils.h
b6ef36a2c322f6b2d4f46734fa472faa553c53eb
[]
no_license
BriggiRivera/ImageEditor
717970a655fe5f6ec533b8d433e25d1426693a03
2caddce966e1260d1aa0b1c5f9b99203e9ff062d
refs/heads/master
2020-03-23T17:09:34.966486
2018-11-10T02:03:27
2018-11-10T02:03:27
141,819,843
0
0
null
null
null
null
UTF-8
C++
false
false
7,982
h
utils.h
#ifndef UTILS_H #define UTILS_H #include "stdafx.h" #include "EditorFotos.h" #include "EditorFotosDlg.h" #include "afxdialogex.h" #include "BMP.h" #include "PixelRGB.h" #include <algorithm> #include <cmath> #include <vector> #define cimg_use_jpeg #include "CImg.h" #include <cstdio> using namespace std; using namespace cimg_library; int** crearMatriz(int width, int height) { int** matriz = new int*[width]; for (int index = 0; index < width; index++) { matriz[index] = new int[height]; } return matriz; } void BilinealInterpolationOnePixel(brg::BMP*& bmpOutput, int** coord, int x, int y) { int x0 = x, x1 = x, y0 = y, y1 = y; while (coord[x0][y] == -1) x0--; while (coord[x1][y] == -1) x1++; while (coord[x][y0] == -1) y0--; while (coord[x][y1] == -1) y1++; double Hfactor = 1.0 * (x - x0) / (x1 - x0); double Vfactor = 1.0 * (y - y0) / (y1 - y0); int hr = bmpOutput->getPixel(x0, y).r + (bmpOutput->getPixel(x1, y).r - bmpOutput->getPixel(x0, y).r) * Hfactor; int hg = bmpOutput->getPixel(x0, y).g + (bmpOutput->getPixel(x1, y).g - bmpOutput->getPixel(x0, y).g) * Hfactor; int hb = bmpOutput->getPixel(x0, y).b + (bmpOutput->getPixel(x1, y).b - bmpOutput->getPixel(x0, y).b) * Hfactor; int vr = bmpOutput->getPixel(x, y0).r + (bmpOutput->getPixel(x, y1).r - bmpOutput->getPixel(x, y0).r) * Vfactor; int vg = bmpOutput->getPixel(x, y0).g + (bmpOutput->getPixel(x, y1).g - bmpOutput->getPixel(x, y0).g) * Vfactor; int vb = bmpOutput->getPixel(x, y0).b + (bmpOutput->getPixel(x, y1).b - bmpOutput->getPixel(x, y0).b) * Vfactor; bmpOutput->setPixel(brg::PixelRGB((hb + vb) / 2, (hg + vg) / 2, (hr + vr) / 2), x, y); coord[x][y] = 1; } void projectiveTransformationBilinealInterpolation(string input, string output, brg::BMP*& bmpInput, brg::BMP*& bmpOutput, vector<vector<double>>& P) { CImg<unsigned char> imageInput(input.c_str()); imageInput.resize(512, 512); imageInput.save(output.c_str()); imageInput.save(input.c_str()); bmpInput = new brg::BMP(input.c_str()); bmpOutput = new brg::BMP(output.c_str()); int** coord = crearMatriz(bmpInput->getWidth(), bmpInput->getHeight()); /* Projection Matrix: P [ a11 a12 b1 a21 a22 b2 c1 c2 1 ] */ double a11 = P[0][0], a12 = P[0][1], b1 = P[0][2]; double a21 = P[1][0], a22 = P[1][1], b2 = P[1][2]; double c1 = P[2][0], c2 = P[2][1]; int x_, y_; for (int x = 0; x < bmpInput->getWidth(); x++) { for (int y = 0; y < bmpInput->getHeight(); y++) { coord[x][y] = -1; bmpOutput->setPixel(brg::PixelRGB(0, 0, 0), x, y); } } for (int y = 0; y<bmpInput->getHeight(); y++) { for (int x = 0; x<bmpInput->getWidth(); x++) { x_ = (a11 * x + a12 * y + b1) / (c1 * x + c2 * y + 1); y_ = (a21 * x + a22 * y + b2) / (c1 * x + c2 * y + 1); x_ = x_ < 0 ? 0 : x_; y_ = y_ < 0 ? 0 : y_; x_ = x_ >= bmpInput->getWidth() ? bmpInput->getWidth() - 1 : x_; y_ = y_ >= bmpInput->getHeight() ? bmpInput->getHeight() - 1 : y_; bmpOutput->setPixel(bmpInput->getPixel(x, y), x_, y_); coord[x_][y_] = 1; } } for (int y = 0; y < bmpInput->getHeight(); y++) { if (coord[0][y] == -1) { bmpOutput->setPixel(brg::PixelRGB(0, 0, 0), 0, y); coord[0][y] = 1; } if (coord[bmpInput->getWidth() - 1][y] == -1) { bmpOutput->setPixel(brg::PixelRGB(0, 0, 0), bmpInput->getWidth() - 1, y); coord[bmpInput->getWidth() - 1][y] = 1; } } for (int x = 0; x < bmpInput->getWidth(); x++) { if (coord[x][0] == -1) { bmpOutput->setPixel(brg::PixelRGB(128, 128, 128), x, 0); coord[x][0] = 1; } if (coord[x][bmpInput->getHeight() - 1] == -1) { bmpOutput->setPixel(brg::PixelRGB(128, 128, 128), x, bmpInput->getHeight() - 1); coord[x][bmpInput->getHeight() - 1] = 1; } } for (int y = 2; y<bmpInput->getHeight()-2; y++) { for (int x = 2; x<bmpInput->getWidth()-2; x++) { if (coord[x][y] == -1) { BilinealInterpolationOnePixel(bmpOutput, coord, x, y); } } } } void projectiveTransformation(string input, string output, brg::BMP*& bmpInput, brg::BMP*& bmpOutput, vector<vector<double>>& P) { CImg<unsigned char> imageInput(input.c_str()); imageInput.resize(512, 512); imageInput.save(output.c_str()); imageInput.save(input.c_str()); bmpInput = new brg::BMP(input.c_str()); bmpOutput = new brg::BMP(output.c_str()); /* Projection Matrix: P [ a11 a12 b1 a21 a22 b2 c1 c2 1 ] */ double a11 = P[0][0], a12 = P[0][1], b1 = P[0][2]; double a21 = P[1][0], a22 = P[1][1], b2 = P[1][2]; double c1 = P[2][0], c2 = P[2][1]; int x_, y_; for (int y = 0; y < bmpInput->getHeight(); y++) { for (int x = 0; x < bmpInput->getWidth(); x++) { bmpOutput->setPixel(brg::PixelRGB(0, 0, 0), x, y); } } for (int y = 0; y<bmpInput->getHeight(); y++) { for (int x = 0; x<bmpInput->getWidth(); x++) { x_ = ( a11 * x + a12 * y + b1 ) / (c1 * x + c2 * y + 1); y_ = ( a21 * x + a22 * y + b2 ) / (c1 * x + c2 * y + 1); x_ = x_ < 0 ? 0 : x_; y_ = y_ < 0 ? 0 : y_; x_ = x_ >= bmpInput->getWidth() ? bmpInput->getWidth()-1 : x_; y_ = y_ >= bmpInput->getHeight() ? bmpInput->getHeight()-1 : y_; bmpOutput->setPixel(bmpInput->getPixel(x, y), x_, y_); } } } void operacionConvolucion(string input, string output, vector<vector<float>>& mask, brg::BMP*& bmpInput, brg::BMP*& bmpOutput) { CImg<unsigned char> imageInput(input.c_str()); imageInput.resize(512, 512); imageInput.save(output.c_str()); imageInput.save(input.c_str()); bmpInput = new brg::BMP(input.c_str()); bmpOutput = new brg::BMP(output.c_str()); int maskMiddle = mask.size() / 2; int x0 = maskMiddle; int x1 = bmpInput->getWidth() - maskMiddle; int y0 = maskMiddle; int y1 = bmpInput->getHeight() - maskMiddle; for (int y = y0; y < y1; y++) { for (int x = x0; x < x1; x++) { int r = 0,g = 0,b = 0; brg::PixelRGB& center = bmpInput->getPixel(x, y); int i0 = x - maskMiddle; int i1 = x + maskMiddle; int j0 = y - maskMiddle; int j1 = y + maskMiddle; for (int i = i0, n = 0; i <= i1; i++, n++) { for (int j = j0, m = 0; j <= j1; j++, m++) { brg::PixelRGB& pixel = bmpInput->getPixel(i, j); r += mask[n][m] * pixel.r; g += mask[n][m] * pixel.g; b += mask[n][m] * pixel.b; } } b = b < 0 || b > 255 ? center.b : b; r = r < 0 || r > 255 ? center.r : r; g = g < 0 || g > 255 ? center.g : g; bmpOutput->setPixel(brg::PixelRGB(b, g, r), x, y); } } } brg::PixelRGB getMedian(brg::BMP* image, int x, int y, int neighbourhood) { int iniX = x - neighbourhood / 2; int finX = x + neighbourhood / 2; int iniY = y - neighbourhood / 2; int finY = y + neighbourhood / 2; vector<int> r; vector<int> g; vector<int> b; for (int y = iniY; y <= finY ;y++) { for (int x = iniX; x <= finX; x++) { brg::PixelRGB& pixel = image->getPixel(x, y); r.push_back(pixel.r); g.push_back(pixel.g); b.push_back(pixel.b); } } sort(r.begin(), r.end()); sort(g.begin(), g.end()); sort(b.begin(), b.end()); int pos = neighbourhood * neighbourhood / 2; return brg::PixelRGB(b[pos], g[pos], r[pos]); } int** crearMatrizEscalaGrises(brg::BMP* image) { int** matriz = crearMatriz(image->getWidth(), image->getHeight()); for (int y = 0; y < image->getHeight() ;y++) { for (int x = 0; x < image->getWidth(); x++) { brg::PixelRGB& pixel = image->getPixel(x, y); matriz[x][y] = ((0.3 * pixel.r) + (0.59 * pixel.g) + (0.11 * pixel.b));//sqrt(pixel.r * pixel.r + pixel.g * pixel.g + pixel.b * pixel.b); } } return matriz; } void destruirMatriz(int** matriz, int width) { for (int index = 0; index < width; index++) { delete[] matriz[index]; } delete[] matriz; } void borrarImagen(string path) { remove(path.c_str()); } #endif
eb6c8751fea209a335ea75107050fb264dce5309
ed70171946678f9d8f9f018aeb1a50cb71558446
/app/src/main/cpp/sample/ScratchCardSample.h
240509d8ab3b04ce46656e7851394e76fabcbbdc
[]
no_license
fdsajkl0724/OpenGlNDK
c9a364300f5f2d9e7615f3e4ee53640f4ac0b085
414ba5c5271ff3d3e44bf614b274f5be46c854cb
refs/heads/master
2023-06-27T06:44:30.398596
2021-08-02T00:52:56
2021-08-02T00:52:56
391,776,566
1
1
null
null
null
null
UTF-8
C++
false
false
1,393
h
ScratchCardSample.h
// // Created by Administrator on 2021-07-23. // #ifndef OPENGLNDK_SCRATCHCARDSAMPLE_H #define OPENGLNDK_SCRATCHCARDSAMPLE_H #include "GLSampleBase.h" #include <detail/type_mat.hpp> #include <detail/type_mat4x4.hpp> #include <vector> #include <vec2.hpp> #include <vec3.hpp> #define TRIANGLE_NUM 43 #define EFFECT_RADIUS 0.03 using namespace glm; class ScratchCardSample: public GLSampleBase { public: ScratchCardSample(); virtual ~ScratchCardSample(); virtual void LoadImage(NativeImage *pImage); virtual void Init(); virtual void Draw(int screenW, int screenH); virtual void Destroy(); virtual void UpdateTransformMatrix(float rotateX, float rotateY, float scaleX, float scaleY); virtual void SetTouchLocation(float x, float y); void UpdateMVPMatrix(mat4 &mvpMatrix, int angleX, int angleY, float ratio); void CalculateMesh(vec2 pre, vec2 cur); private: GLuint m_TextureId; GLint m_SamplerLoc; GLint m_MVPMatLoc; GLuint m_VaoId; GLuint m_VboIds[2]; NativeImage m_RenderImage; mat4 m_MVPMatrix; int m_AngleX; int m_AngleY; float m_ScaleX; float m_ScaleY; vec3 m_pVtxCoords[TRIANGLE_NUM * 3]; vec2 m_pTexCoords[TRIANGLE_NUM * 3]; std::vector<vec4> m_PointVector; vec2 m_CurTouchPoint; vec2 m_PreTouchPoint; bool m_bReset; }; #endif //OPENGLNDK_SCRATCHCARDSAMPLE_H
89a14c2c2daa163b115d5591f70f77516d68ca01
e8ab6a8108801dfedb694557626fd847651564e2
/Dragon/src/operators/arithmetic/inner_product_op.cc
136f9273bd9b8221375f5da2048d82095193be1c
[ "BSD-2-Clause" ]
permissive
Spark001/Dragon-1
87f722bcb0feaec7fad29d923c60681cf9584267
310bcb5f6d9a6623bb58ed3d1ad02d1f440da474
refs/heads/master
2020-03-09T22:52:08.171500
2018-04-01T10:13:50
2018-04-01T10:13:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,660
cc
inner_product_op.cc
#include "operators/arithmetic/inner_product_op.h" #include "core/workspace.h" #include "utils/filler.h" namespace dragon { template <class Context> template <typename T> void InnerProductOp<Context>::TransRunWithType() { vector<TIndex> weight_shape({ num_output, K }); vector<TIndex> bias_shape(1, num_output); TENSOR_FILL(Input(1), weight_shape); if (InputSize() > 2) TENSOR_FILL(Input(2), bias_shape); CHECK(Input(1).ndim() == 2 && Input(1).dim(1) == K) << "\nWeights should shape as [num_output, dim].\n" << "Input dims are (" << M << ", " << K << ").\n" << "Weights dims are " << Input(1).dim_string(); Output(0)->Reshape(vector<TIndex>({ M, num_output })); if (InputSize() > 2) INIT_MULTIPLIER(bias_multiplier, M); auto* Xdata = Input(0).template data<T, Context>(); auto* Wdata = Input(1).template data<T, Context>(); auto* Ydata = Output(0)->template mutable_data<T, Context>(); math::Gemm<T, Context>(CblasNoTrans, CblasTrans, M, num_output, K, 1.0, Xdata, Wdata, 0.0, Ydata); if (InputSize() > 2) { auto* Bdata = Input(2).template data<T, Context>(); math::Gemm<T, Context>(CblasNoTrans, CblasNoTrans, M, num_output, 1, 1.0, bias_multiplier->data<T, Context>(), Bdata, 1.0, Ydata); } } template <class Context> template <typename T> void InnerProductOp<Context>::NoTransRunWithType() { vector<TIndex> weight_shape({ K, num_output }); vector<TIndex> bias_shape(1, num_output); TENSOR_FILL(Input(1), weight_shape); if (InputSize() > 2) TENSOR_FILL(Input(2), bias_shape); CHECK(Input(1).ndim() == 2 && Input(1).dim(0) == K) << "\nWeights should shape as [num_output, dim].\n" << "Input dims are (" << M << ", " << K << ").\n" << "Weights dims are " << Input(1).dim_string(); Output(0)->Reshape(vector<TIndex>({ M, num_output })); if (InputSize() > 2) INIT_MULTIPLIER(bias_multiplier, M); auto* Xdata = Input(0).template data<T, Context>(); auto* Wdata = Input(1).template data<T, Context>(); auto* Ydata = Output(0)->template mutable_data<T, Context>(); math::Gemm<T, Context>(CblasNoTrans, CblasNoTrans, M, num_output, K, 1.0, Xdata, Wdata, 0.0, Ydata); if (InputSize() > 2) { auto* Bdata = Input(2).template data<T, Context>(); math::Gemm<T, Context>(CblasNoTrans, CblasNoTrans, M, num_output, 1, 1.0, bias_multiplier->data<T, Context>(), Bdata, 1.0, Ydata); } } template <class Context> void InnerProductOp<Context>::RunOnDevice() { M = Input(0).count(0, axis), K = Input(0).count(axis); if (transW) { if (Input(0).template IsType<float>()) TransRunWithType<float>(); else LOG(FATAL) << "Unsupported input types."; } else { if (Input(0).template IsType<float>()) NoTransRunWithType<float>(); else LOG(FATAL) << "Unsupported input types."; } } DEPLOY_CPU(InnerProduct); #ifdef WITH_CUDA DEPLOY_CUDA(InnerProduct); #endif OPERATOR_SCHEMA(InnerProduct).NumInputs(2, 3).NumOutputs(1); template <class Context> template <typename T> void InnerProductGradientOp<Context>::RunWithType() { auto* Xdata = Input(0).template data<T, Context>(); auto* Wdata = Input(1).template data<T, Context>(); auto* dYdata = Input(2).template data<T, Context>(); if (Output(1)->name() != "ignore") { Output(1)->ReshapeLike(Input(1)); auto* dWdata = Output(1)->template mutable_data<T, Context>(); if (transW) { math::Gemm<T, Context>(CblasTrans, CblasNoTrans, num_output, K, M, 1.0, dYdata, Xdata, 1.0, dWdata); } else { math::Gemm<T, Context>(CblasTrans, CblasNoTrans, K, num_output, M, 1.0, Xdata, dYdata, 1.0, dWdata); } } if (Output(2)->name() != "ignore") { INIT_MULTIPLIER(bias_multiplier, M); Output(2)->Reshape(vector<TIndex>(1, num_output)); auto* dBdata = Output(2)->template mutable_data<T, Context>(); auto* BMul_data = this->bias_multiplier->template data<T, Context>(); math::Gemv<T, Context>(CblasTrans, M, num_output, 1.0, dYdata, BMul_data, 1.0, dBdata); } if (Output(0)->name() != "ignore") { Output(0)->ReshapeLike(Input(0)); auto* dXdata = Output(0)->template mutable_data<T, Context>(); if (transW) { math::Gemm<T, Context>(CblasNoTrans, CblasNoTrans, M, K, num_output, 1.0, dYdata, Wdata, 0.0, dXdata); } else { math::Gemm<T, Context>(CblasNoTrans, CblasTrans, M, K, num_output, 1.0, dYdata, Wdata, 0.0, dXdata); } } } template <class Context> void InnerProductGradientOp<Context>::RunOnDevice() { M = Input(0).count(0, axis), K = Input(0).count(axis); if (Input(0).template IsType<float>()) RunWithType<float>(); else LOG(FATAL) << "unsupported input types."; } DEPLOY_CPU(InnerProductGradient); #ifdef WITH_CUDA DEPLOY_CUDA(InnerProductGradient); #endif OPERATOR_SCHEMA(InnerProductGradient).NumInputs(3).NumOutputs(3); class GetInnerProductGradient : public GradientMakerBase { public: GRADIENT_MAKER_CTOR(GetInnerProductGradient); vector<OperatorDef> MakeDefs() override { return SingleDef(def.type() + "Gradient", "", vector<string> {I(0), I(1), GO(0)}, vector<string> {GI(0), GI(1), GI(2)}); } }; REGISTER_GRADIENT(InnerProduct, GetInnerProductGradient); } // namespace dragon
0312c706d4a013e31802d3b2bfd4cb1aba69ed32
69ad5952942a1de9dae4528adee16d67e84b84be
/clickableBt.h
1dc9aead158e4848fa9944c4afd5bfa3e0729f02
[]
no_license
innkuika/CISC220LAB3beta
3f2aacd10c85f8ebc63d0bd8ae952b8107650a49
c4031d90b2a838380af5f229254396f75cb7f27d
refs/heads/master
2023-03-30T04:42:52.754970
2021-03-24T04:47:12
2021-03-24T04:47:12
249,096,536
0
0
null
null
null
null
UTF-8
C++
false
false
402
h
clickableBt.h
#include <QLabel> #include "QMessageBox" class CClickableLabel : public QLabel { Q_OBJECT public: CClickableLabel(QString text, int x, int y, QWidget *parent = 0); ~CClickableLabel() {} public: int x; public: int y; signals: void clicked(); public: QString text; public: void printBoard2(); protected: void mousePressEvent(QMouseEvent *event) { emit clicked();} };
5d2e0cd76103f6d2c3ec6304ae84efbf46c06f1c
f9823b937b589e07af236bdd111dcd95458d348f
/external/include/Window.h
ce637d719eb9cec31f686e6247bfb3189fa7b1ca
[]
no_license
jercypackson/ezg18-IdasDream
ff083bccf76e65be47d8eae253258dd28638b65f
c72f088f41cf2ad10597c90caea715b9c8b73a92
refs/heads/master
2022-03-29T05:08:03.997264
2019-01-18T19:45:25
2019-01-18T19:45:25
148,811,915
0
0
null
2020-01-18T09:42:40
2018-09-14T16:00:49
C++
UTF-8
C++
false
false
3,241
h
Window.h
#pragma once #include <string> #include <iostream> #include <sstream> #include <functional> #include <unordered_map> #include <GL/glew.h> #include <GLFW\glfw3.h> #include "IDManager.h" struct MouseInput { enum class Action { PRESSED, RELEASED, SCROLLED } action; enum class Button { LEFT, RIGHT, MIDDLE } button; float scrollDelta; }; struct KeyInput { enum class Action { PRESSED, RELEASED } action; enum class Key { F1 = GLFW_KEY_F1, F2 = GLFW_KEY_F2, F3 = GLFW_KEY_F3, F4 = GLFW_KEY_F4, F5 = GLFW_KEY_F5, F6 = GLFW_KEY_F6, F7 = GLFW_KEY_F7, F8 = GLFW_KEY_F8, F9 = GLFW_KEY_F9, F10 = GLFW_KEY_F10, F11 = GLFW_KEY_F11, F12 = GLFW_KEY_F12, W = GLFW_KEY_W, A = GLFW_KEY_A, S = GLFW_KEY_S, D = GLFW_KEY_D, Q = GLFW_KEY_Q, E = GLFW_KEY_E, UP = GLFW_KEY_UP, DOWN = GLFW_KEY_DOWN, LEFT = GLFW_KEY_LEFT, RIGHT = GLFW_KEY_RIGHT, ESCAPE = GLFW_KEY_ESCAPE, ENTER = GLFW_KEY_ENTER, TAB = GLFW_KEY_TAB, SPACE = GLFW_KEY_SPACE, LEFT_SHIFT = GLFW_KEY_LEFT_SHIFT } key; }; struct WindowParams { int width = 800; int height = 800; bool fullscreen = false; std::string title = "EzEngine"; int gl_version_major = 4; int gl_version_minor = 3; int samples = 1; }; typedef std::function<void(std::string)> DebugCallback; typedef std::function<void(const MouseInput&)> MouseInputCallback; typedef std::function<void(const KeyInput&)> KeyInputCallback; class Window { private: WindowParams _params; GLFWwindow* _window; bool _initialized; std::unordered_map<ID, MouseInputCallback> _mouseCBs; std::unordered_map<ID, KeyInputCallback> _keyCBs; public: Window(WindowParams params); ~Window(); int getWidth() const { return _params.width; } int getHeight() const { return _params.height; } std::string getTitle() const { return _params.title; } double getTime() const { return glfwGetTime(); } void getCursorPosition(int& x, int& y) const { double x_, y_; glfwGetCursorPos(_window, &x_, &y_); x = static_cast<int>(x_); y = static_cast<int>(y_); }; void getCursorPositionOfCenter(int& x, int&y) const { x = _params.width / 2; y = _params.height / 2; } void setCursorPosition(int x, int y) const { if (x < 0 || x >= _params.width || y < 0 || y >= _params.height) return; glfwSetCursorPos(_window, static_cast<double>(x), static_cast<double>(y)); } void setCursorPositionToCenter() const { setCursorPosition(_params.width / 2, _params.height / 2); } void hideCursor() const { glfwSetInputMode(_window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); } void showCursor() const { glfwSetInputMode(_window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); } bool isKeyPressed(KeyInput::Key key) const { int state = glfwGetKey(_window, static_cast<int>(key)); return state == GLFW_PRESS; } bool open(); void endFrame(); bool shouldClose(); void close(); void setFPSinTitle(int fps); void registerDebugCallback(DebugCallback cb); ID registerMouseInputHandler(MouseInputCallback cb); ID registerKeyInputHandler(KeyInputCallback cb); void unregisterMouseInputHandler(ID id); void unregisterKeyInputHandler(ID id); void mouseInputEvent(const MouseInput& inp); void keyInputEvent(const KeyInput& inp); void bindDefaultFramebuffer() const; };
eb68b6816d37dd3206c7bff03ec9727509084a55
53ee3c9e9d5aad21811d32a2cea83bbd929682e2
/testcurrent.ino
076ba5a29c747be024d2f1e20777a11bd36f009f
[ "Apache-2.0" ]
permissive
cristobal23/arduino-ups-12v
a112a861706a142f4b15732b41485a5392b181e1
11a5a7edad2ac185807e2e64d3a494b231cadc0d
refs/heads/master
2021-01-01T19:56:29.542216
2014-03-15T05:15:19
2014-03-15T05:15:19
17,768,585
0
1
null
null
null
null
UTF-8
C++
false
false
745
ino
testcurrent.ino
#include <Wire.h> #include <Adafruit_INA219.h> Adafruit_INA219 ina219; void setup(void) { uint32_t currentFrequency; Serial.begin(115200); Serial.println("Hello!"); Serial.println("Measuring voltage and current with INA219 ..."); ina219.begin(); } void loop(void) { float shuntvoltage = 0; float busvoltage = 0; float current_mA = 0; float loadvoltage = 0; shuntvoltage = ina219.getShuntVoltage_mV(); busvoltage = ina219.getBusVoltage_V(); current_mA = ina219.getCurrent_mA(); loadvoltage = busvoltage + (shuntvoltage / 1000); if(current_mA < 0) Serial.println("Opperating off of the battery!"); else Serial.println("Power normal from the grid"); Serial.println(""); delay(2000); }
44791904aef3d72ad9ac42559b16d288470f6612
8638ba6c20f396878aa03ca1f332b04de605afaf
/Dynamic Programming/Scramble String.cpp
d001eeddfc86a99b34971bf3d41a5b399a7e7193
[]
no_license
AnimeshMore/Data-Structures-and-Algorithms
d146f6b11fe294b3054b2194ed881f3c8c51d633
2b6d3d30fbe53d556e6ab0dc62806b100928f8c8
refs/heads/master
2023-08-06T14:04:46.348243
2021-10-05T14:35:29
2021-10-05T14:35:29
397,944,300
0
0
null
null
null
null
UTF-8
C++
false
false
978
cpp
Scramble String.cpp
//LeetCode Problem Link - https://leetcode.com/problems/scramble-string/ unordered_map<string,bool> mp; class Solution { public: bool isScramble(string s1, string s2) { if(s1.length()!=s2.length()){ return false; } int n=s1.length(); if(n==0){ return true; } if(s1==s2){ return true; } string key=(s1+" "+s2); if(mp.find(key)!=mp.end()){ return mp[key]; } bool flag=false; for(int i=1;i<n;i++){ if(isScramble(s1.substr(0,i),s2.substr(0,i)) && isScramble(s1.substr(i,n-i),s2.substr(i,n-i))){ flag = true; return true; } if(isScramble(s1.substr(0,i),s2.substr(n-i,i)) && isScramble(s1.substr(i,n-i),s2.substr(0,n-i))){ flag = true; return true; } } mp[key]=flag; return false; } };
d902abb1f9e36dc66061dc50e2648c7b09d876de
d7785d0fcb6ded7401c0fe569110c17296edf538
/Ruminate/include/HelperFiles/a_funcs.hpp
5ba2d7d57776526c8e3935a75c6cae15a1546216
[ "MIT" ]
permissive
AlexandreRouma/Ruminate
f3a33227757d57c3ae1fbb13fce91aa23a6e0484
7c87d78782fb7547929973ee92b05b85714f9773
refs/heads/main
2023-01-23T11:11:11.362451
2020-12-05T00:30:39
2020-12-05T00:30:39
318,660,043
1
0
MIT
2020-12-05T00:30:40
2020-12-04T23:36:46
null
UTF-8
C++
false
false
383
hpp
a_funcs.hpp
#pragma once #include <cmath> constexpr auto A = 0.0001; //relu float Relu(float x); float ReluPrime(float x); //leaky relu float ReluLeaky(float x); float ReluLeakyPrime(float x); //tanh float Tanh(float x); float TanhPrime(float x); //sigmoid float Sigmoid(float x); float SigmoidPrime(float x); //swish float Swish(float x); float SwishPrime(float x);
7c7605cd0520ffdfb8361e3c87a0442e5f6a7872
4464bd12408f155b7129bc62de465633caaf8f77
/A1/mainwindow.cpp
7cbd3cfaaf8900e79ed9b22d5f1b6d6e71b3723c
[]
no_license
minalhk/Computer-Graphics
ff2a6da826e53c16a123bc20a87d5ef8df839966
b5b5cf1bc4783f9a1d065e371fb1df64e04ed15d
refs/heads/master
2022-11-16T09:53:02.028412
2020-07-16T17:15:51
2020-07-16T17:15:51
279,947,597
0
0
null
null
null
null
UTF-8
C++
false
false
3,065
cpp
mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" QImage image(300,300,QImage::Format_RGB888); MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { float x1,y1,x2,y2,w,h; x1=ui->textEdit->toPlainText().toFloat(); y1=ui->textEdit_3->toPlainText().toFloat(); w=ui->textEdit_2->toPlainText().toFloat(); h=ui->textEdit_4->toPlainText().toFloat(); dda(x1,(2*y1+h)/2,(2*x1+w)/2,y1); // dda(x1,(2*y1+h)/2,(2*x1+w)/2,y1); dda((2*x1+w)/2,y1+h,x1+w,(2*y1+h)/2); dda((2*x1+w)/2,y1,x1+w,(2*y1+h)/2); dda(x1,(2*y1+h)/2,(2*x1+w)/2,y1+h); } int MainWindow::sign(float a) { if(a>0) return 1; else if(a==0) return 0; return -1; } void MainWindow::on_pushButton_2_clicked() { float x1,y1,x2,y2,w,h; x1=ui->textEdit->toPlainText().toFloat(); y1=ui->textEdit_3->toPlainText().toFloat(); w=ui->textEdit_2->toPlainText().toFloat(); h=ui->textEdit_4->toPlainText().toFloat(); bresenham(x1,y1+h,x1+w,y1+h); bresenham(x1,y1,x1,y1+h); bresenham(x1+w,y1,x1+w,y1+h); bresenham(x1,y1,x1+w,y1); // bresenham(x1,y1+h,x1+w,y1+h); bresenham((4*x1+w)/4,(4*y1+h)/4,(4*x1+3*w)/4,(4*y1+h)/4); bresenham((4*x1+w)/4,(4*y1+h)/4,(4*x1+w)/4,(4*y1+3*h)/4); bresenham((4*x1+3*w)/4,(4*y1+h)/4,(4*x1+3*w)/4,(4*y1+3*h)/4); bresenham((4*x1+w)/4,(4*y1+3*h)/4,(4*x1+3*w)/4,(4*y1+3*h)/4); } void MainWindow::dda(float x1,float y1,float x2,float y2) { float x,y,dx,dy; int delx,dely,length,i=1; QRgb value; value=qRgb(0,255,0); delx=abs(x2-x1); dely=abs(y2-y1); if(delx>dely) length=delx; else length=dely; dx=(x2-x1)/length; dy=(y2-y1)/length; x=x1+(0.5*sign(x2-x1)); y=y1+(0.5*sign(y2-y1)); image.setPixel(x1,y1,value); while(i<=length) { image.setPixel(int(x),int(y),value); x=x+dx; y=y+dy; i++; } ui->label->setPixmap(QPixmap::fromImage(image)); } void MainWindow::bresenham(float x1,float y1,float x2,float y2) { int i,interchange; float e,dx,dy,temp,x,y; dx=abs(x2-x1); dy=abs(y2-y1); //QImage image(300,300,QImage::Format_RGB888); QRgb value; value=qRgb(0,255,0); if(dx>=dy) interchange=0; else { temp=dx; dx=dy; dy=temp;\ interchange=1; } x=x1; y=y1; e=(2*dy)-dx; for(i=0;i<=dx;i++) { image.setPixel(x,y,value); while(e>=0) { if(interchange==1) { x=x+sign(x2-x1); } else { y=y+sign(y2-y1); } e=e-(2*dx); } if(interchange==1) { y=y+sign(y2-y1); } else { x=x+sign(x2-x1); } e=e+(2*dy); } ui->label->setPixmap(QPixmap::fromImage(image)); }
497888cd56630f9782b766ea7d8d88e153a01a41
f7b8fbcd8d24c5a15351930876f5e70eabc7bf6e
/compiler/symbolTable.cpp
027141fd3b524d655ba8bc427901d87b09923341
[]
no_license
jaeyeom/bubble
e7a6cbdbbd24731c9cb2496b264e8497f47c401b
acc61399ad21b89fd5bb8e73a6c885f4f668e795
refs/heads/master
2020-05-17T23:28:30.619736
2012-05-01T09:42:58
2012-05-01T09:42:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,673
cpp
symbolTable.cpp
#include <iostream> #include <set> #include "symbolTable.hpp" namespace Bubble { Env::Env() : lOffset(-16), pOffset(0) { } /* * 환경 내에 tok을 복사해 넣는다. 직접적으로 쓸 일이 없다. */ void Env::put(const string& id, const IDToken& tok) { *items[id] = tok; items[id]->setAddr(lOffset); lOffset -= items[id]->getSize(); } void Env::put(const string& id, IDToken* tok) { items[id] = tok; items[id]->setAddr(lOffset); lOffset -= items[id]->getSize(); } void Env::putParamFirst(const string& id, IDToken* tok) { items[id] = tok; items[id]->setAddr(pOffset); } void Env::setParamFirst(const string& id) { items[id]->setAddr(lOffset); lOffset -= items[id]->getSize(); } void Env::putParam(const string& id, IDToken* tok) { items[id] = tok; items[id]->setAddr(pOffset); pOffset += items[id]->getSize(); } /* * 환경 내에 IDToken을 가져와서 tok에 세팅한다. 직접적으로 쓸 일이 없다. * 부수효과: tok * 성공하면 0, 실패하면 -1을 반환한다. */ int Env::get(const string& id, IDToken& tok) const { SymbolMap::const_iterator found = items.find(id); if (found != items.end()) { tok = *(found->second); return 0; } return -1; } int Env::get(const string& id, IDToken*& tok) const { SymbolMap::const_iterator found = items.find(id); if (found != items.end()) { tok = found->second; return 0; } return -1; } /* * 환경 내에 심볼이 있는지 검사한다. 직접적으로 쓸 일이 없다. */ bool Env::exist(const string& id) const { return items.find(id) != items.end(); } unsigned int Env::count() const { return items.size(); } /* * 환경 내에 있는 심볼들을 모두 C 코드의 선언부로 바꾼다. */ std::string Env::ToCCode() const { std::ostringstream oss; for (SymbolMap::const_iterator itr=items.begin(); itr != items.end(); itr++) { oss << itr->second->getValueTypeStr() << " " << itr->first << ";" << std::endl; } return oss.str(); } SymbolTable::SymbolTable() : tmp_count(0) { push(); } SymbolTable::~SymbolTable() { typedef std::set<IDToken*> SSet; SSet s; //std::cout << "Destroying SymbolTable!\n"; for (unsigned int i = 0; i < owned.size(); i++) { s.insert(owned[i]); } for (SSet::iterator itr = s.begin(); itr != s.end(); itr++) { //std::cout << "Destroying " << (*itr)->toString() << std::endl; delete (*itr); } //std::cout << "Destroying SymbolTable! Finished.\n"; } Env& SymbolTable::top() { return envs.back(); } unsigned int SymbolTable::count() const { return envs.size(); } /* * 심볼 테이블 내에 특정 심볼이 있는지 검사한다. */ bool SymbolTable::exist(const string& id) const { for (SymbolTableEntry::const_reverse_iterator itr=envs.rbegin(); itr != envs.rend(); itr++) { if (itr->exist(id)) return true; } return false; } /* * 심볼 테이블에서 특정 심볼을 가져온다. * 맨 윗 환경부터 탐색하여 제일 먼저 나온 IDToken을 tok에 세팅한다. * 부수효과: tok * 성공하면 0, 실패하면 -1을 반환한다. */ int SymbolTable::get(const string& id, IDToken& tok) const { for (SymbolTableEntry::const_reverse_iterator itr=envs.rbegin(); itr != envs.rend(); itr++) { if (itr->exist(id)) { itr->get(id, tok); //std::cout << "SymbolTable::get(" << tok.getType() << ", " << id << ")" << std::endl; return 0; } } return -1; } int SymbolTable::get(const string& id, IDToken*& tok) const { for (SymbolTableEntry::const_reverse_iterator itr=envs.rbegin(); itr != envs.rend(); itr++) { if (itr->exist(id)) { itr->get(id, tok); //std::cout << "SymbolTable::get(" << tok->getType() << ", " << id << ")" << std::endl; return 0; } } return -1; } /* * 맨 윗 환경에 tok을 복사해 넣는다. * 같은 심볼이 이미 있으면 덮어쓴다. */ void SymbolTable::put(const string& id, const IDToken& tok) { if (exist(id)) update(id, tok); else { IDToken* copied = new IDToken(tok); owned.push_back(copied); envs.back().put(id, copied); } //std::cout << "SymbolTable::put(" << tok.getType() << ", " << id << ")" << std::endl; } void SymbolTable::putParam(const string& id, const IDToken& tok) { if (exist(id)) update(id, tok); else { IDToken* copied = new IDToken(tok); owned.push_back(copied); envs.back().putParam(id, copied); } //std::cout << "SymbolTable::put(" << tok.getType() << ", " << id << ")" << std::endl; } void SymbolTable::putParamFirst(const string& id, const IDToken& tok) { if (exist(id)) update(id, tok); else { IDToken* copied = new IDToken(tok); owned.push_back(copied); envs.back().putParamFirst(id, copied); } //std::cout << "SymbolTable::put(" << tok.getType() << ", " << id << ")" << std::endl; } void SymbolTable::setParamFirst(const string& id) { for (SymbolTableEntry::reverse_iterator itr=envs.rbegin(); itr != envs.rend(); itr++) { if (itr->exist(id)) { itr->setParamFirst(id); break; } } } int SymbolTable::update(const string& id, const IDToken& tok) { for (SymbolTableEntry::reverse_iterator itr=envs.rbegin(); itr != envs.rend(); itr++) { if (itr->exist(id)) { IDToken *target; itr->get(id, target); target->setValueType(tok.getValueType()); target->setValue(tok.getValue()); target->setAddr(tok.getAddr()); return 0; } } return -1; } /* * 새로운 환경 변수를 하나 반환한다. * 이름은 _temp_var_n 형식이고 n은 0부터 증가한다. */ std::string SymbolTable::temp() { std::ostringstream ostrm; ostrm << "_temp_var_" << tmp_count++; return ostrm.str(); } }
cb2794a653f79ed1176feeb1a01442e9ed412dee
7b6a09da65bc7ea3f7956fafd078841adb4f4c4c
/Lightning/sources/resource/AssimpModel.cpp
e8bf4fb2673c4c9c2c4681d74fd3ed4ecc3c8db4
[]
no_license
Labrasones/Lightning
909d9cf4ceb4e9b8b11ad6b93559d93d5a48c0db
c8de3953afcda269c7ea469f7cb233dc8cbaaa84
refs/heads/master
2021-01-10T19:14:02.254051
2015-10-04T15:25:15
2015-10-04T15:25:15
39,917,390
0
0
null
null
null
null
UTF-8
C++
false
false
845
cpp
AssimpModel.cpp
#include "resource/AssimpModel.hpp" using namespace Resource; AssimpModel::AssimpModel() { } AssimpModel::~AssimpModel() { } bool AssimpModel::load(Manager::ResourceManager* container, std::string path) { Assimp::Importer importer; importer.SetIOHandler(new File::AssimpIOSystem(container->file())); // Set the IO handler to a custom one to handle the sourced file system scene = importer.ReadFile(path, aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_CalcTangentSpace); // Read a file and process it if (!scene || scene->mFlags == AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) // Check if it failed to import { std::cout << "AssimpModel: Failed to load model..." << std::endl << importer.GetErrorString() << std::endl; _failed = true; return false; } // Process the scene into easily useable meshes return true; }
8530a1f8c746857887bcb184789dab5996bc5406
e815f3acb9c58e9ffe9234fcc5c1bcf3db505f76
/quol/red/include/Except.h
2d06bcc8d15ba83293ef1c392e0eac0740c4d592
[ "MIT" ]
permissive
zezax/one
7605400cf365706c60c95890f8f21e70f05be2bb
4d46d2324a7bfc024ae740785af48d6c9133cf5e
refs/heads/master
2023-08-31T22:06:25.080378
2023-08-30T22:53:05
2023-08-30T22:53:05
252,308,249
1
0
MIT
2023-09-04T04:32:15
2020-04-01T23:21:42
C++
UTF-8
C++
false
false
2,789
h
Except.h
/* Except.h - zezax::red exception header These are all the custom exceptions thrown by the regular expression code. All descend from std::runtime_error. The top-level custom exception is RedExcept. Exception hierarchy: RedExcept - superclass RedExceptInternal - programming errors RedExceptCompile - compilation errors RedExceptMinimize - minimization errors RedExceptSerialize - serialization errors RedExceptExec - execution errors RedExceptUser - caused by user input RedExceptParse - malformed regexes (with position) RedExceptApi - bad calls/arguments RedExceptLimit - limit reached */ #pragma once #include <string> #include <stdexcept> #include "Consts.h" namespace zezax::red { class RedExcept : public std::runtime_error { using std::runtime_error::runtime_error; }; /////////////////////////////////////////////////////////////////////////////// class RedExceptInternal : public RedExcept { using RedExcept::RedExcept; }; class RedExceptUser : public RedExcept { using RedExcept::RedExcept; }; class RedExceptLimit : public RedExcept { using RedExcept::RedExcept; }; /////////////////////////////////////////////////////////////////////////////// class RedExceptCompile : public RedExceptInternal { using RedExceptInternal::RedExceptInternal; }; class RedExceptMinimize : public RedExceptInternal { using RedExceptInternal::RedExceptInternal; }; class RedExceptSerialize : public RedExceptInternal { using RedExceptInternal::RedExceptInternal; }; class RedExceptExec : public RedExceptInternal { using RedExceptInternal::RedExceptInternal; }; /////////////////////////////////////////////////////////////////////////////// class RedExceptParse : public RedExceptUser { public: explicit RedExceptParse(const std::string &msg) : RedExceptUser(msg), pos_(gNoPos) {} explicit RedExceptParse(const char *msg) : RedExceptUser(msg), pos_(gNoPos) {} RedExceptParse(const std::string &msg, size_t pos) : RedExceptUser(msg + " near position " + std::to_string(pos)), pos_(pos) {} RedExceptParse(const char *msg, size_t pos) : RedExceptUser(std::string(msg) + " near position " + std::to_string(pos)), pos_(pos) {} RedExceptParse(const RedExceptParse &other) = default; RedExceptParse(RedExceptParse &&other) = default; virtual ~RedExceptParse() = default; RedExceptParse &operator=(const RedExceptParse &rhs) = default; RedExceptParse &operator=(RedExceptParse &&rhs) = default; size_t getPos() const { return pos_; } private: size_t pos_; }; class RedExceptApi : public RedExceptUser { using RedExceptUser::RedExceptUser; }; } // namespace zezax::red
06f327129ced0e04f1e947c03b234321dc5d2891
1025bc2aa5aaa40970ad1a51d8d0b1202a1ea11e
/PatTools/src/PhosphorCorrectorFunctor.cc
4e9ba1ab2688c8029f00a987b378f9c5e22d79ad
[]
no_license
uwcms/FinalStateAnalysis
f2be318546728621676a4b90ed2678b2560c94e6
bcb164a8e27d459a9ac438780f6c8730d3e856bf
refs/heads/miniAOD_9_4_0
2022-11-09T01:28:52.199025
2019-03-15T19:25:10
2019-03-15T19:25:10
5,201,989
5
32
null
2020-11-19T17:02:32
2012-07-27T07:51:18
Python
UTF-8
C++
false
false
23,625
cc
PhosphorCorrectorFunctor.cc
#include <iostream> #include <fstream> #include <sstream> #include <math.h> #include "stdio.h" #include "stdlib.h" #include "FinalStateAnalysis/PatTools/interface/PhosphorCorrectorFunctor.hh" namespace zgamma { using std::stringstream; using std::pair; PhosphorCorrectionFunctor::PhosphorCorrectionFunctor(){ }//default constructor PhosphorCorrectionFunctor::PhosphorCorrectionFunctor(const char* filename){ rand = new TRandom3(0); this->MapCat(); //this->MapFile.ifstream(filename); if( !SetMapFileName(filename) ){ std::cout << "[INFO]--> Problems openning the file" << std::endl; }else{ if( !CreateMap() ){ std::cout << "[INFO]--> Some Problem Filling the MAP Was Found, please check your MAP FILE" << std::endl; } } } PhosphorCorrectionFunctor::PhosphorCorrectionFunctor(const char* filename, bool R9Cat){ rand = new TRandom3(0); this->MapCat(); //this->MapFile.ifstream(filename); if( !SetMapFileName(filename) ){ std::cout << "[INFO]--> Problems openning the file" << std::endl; }else{ if( !CreateMap( true ) ){ std::cout << "[INFO]--> Some Problem Filling the MAP Was Found, please check your MAP FILE" << std::endl; } } } PhosphorCorrectionFunctor::~PhosphorCorrectionFunctor(){ delete rand; } double PhosphorCorrectionFunctor::FabSmear(double E, double eta, double r9){ float r9_bad_eb[] = { 8.91085e-03, 6.60522e-03, -2.86797e-02, 4.73330e-02, -1.95607e-02 }; float r9_gold_eb[] = { 7.62684e-03, 1.13788e-02, -4.14171e-02, 5.57636e-02, -1.93949e-02 }; float r9_gold_ee[] = { -4.64302e-01, 9.20859e-01, -5.54852e-01, 1.07274e-01, 0 }; float r9_bad_ee[] = { -1.47432e-01, 2.22487e-01, -1.26847e-02,-6.83499e-02, 1.99454e-02 }; float *par = 0; if( fabs(eta) < 1.5 && r9 > 0.94 ) par = r9_gold_eb; if( fabs(eta) < 1.5 && r9 <= 0.94 ) par = r9_bad_eb; if( fabs(eta) >= 1.5 && r9 > 0.94 ) par = r9_gold_ee; if( fabs(eta) >= 1.5 && r9 <= 0.94 ) par = r9_bad_ee; float res = 0; for( int ip = 4 ; ip >= 0; ip-- ) res = par[ip] + fabs(eta)*res; return ( 1 + rand->Gaus(0, res ) )*E; } bool PhosphorCorrectionFunctor::SetMapFileName(const char* filename){ this->filename = filename; return true; } bool PhosphorCorrectionFunctor::CreateMap(){ int year, dataType, detType, corrType, ptBin; double corrNumber; MapFile.open(filename); std::string line; std::string KeyMap; if( MapFile.is_open() ){ getline (MapFile, line); //getline (MapFile, line); //std::cout << line << std::endl; while( MapFile.good() ){ if( MapFile.eof() )break; MapFile >> year >> dataType >> detType >> ptBin >> corrType >> corrNumber; KeyMap = CreateMapKey( year, dataType, detType, corrType, ptBin); std::cout << "MAP Key: " << KeyMap << std::endl; CorrMap[KeyMap] = corrNumber; } }else{ std::cout << "[INFO]--> Unable to open MAP FILE" << std::endl; return false; } if( CorrMap.size() == 64) { return true; }else{ return false; } } bool PhosphorCorrectionFunctor::CreateMap(bool R9Cat){ int year, dataType, detType, r9Cat,corrType, ptBin; double corrNumber, Err; MapFile.open(filename); std::string line; std::string KeyMap; if( MapFile.is_open() ){ getline (MapFile, line); //getline (MapFile, line); //std::cout << line << std::endl; while( MapFile.good() ){ if( MapFile.eof() )break; MapFile >> year >> dataType >> detType >> r9Cat >> ptBin >> corrType >> corrNumber >> Err; KeyMap = CreateMapKey( year, dataType, detType, r9Cat, corrType, ptBin); //std::cout << "MAP Key: " << KeyMap << std::endl; CorrMap[KeyMap] = corrNumber; ErrMap[KeyMap] = Err; } }else{ std::cout << "[INFO]--> Unable to open MAP FILE" << std::endl; return false; } std::cout << "[INFO]--> MAP SIZE: " << CorrMap.size() << std::endl; if( CorrMap.size() == 128) { return true; }else{ return false; } } std::string PhosphorCorrectionFunctor:: CreateMapKey(int Year, int DataType, int DetType, int CorrType, int PtBin){ stringstream ss; ss << Year << DataType << DetType << CorrType << PtBin; return ss.str(); } std::string PhosphorCorrectionFunctor:: CreateMapKey(int Year, int DataType, int DetType, int R9Cat, int CorrType, int PtBin){ stringstream ss; ss << Year << DataType << DetType << R9Cat << CorrType << PtBin; return ss.str(); } double PhosphorCorrectionFunctor::GetScaleCorr(int year, double pt, double eta){ year == 2011 ? year = XX_XI : year = XX_XII; int dataType = Data; int corrType = Scale; int ptBin = -1; int detType = -1; if( fabs(eta) < 1.479){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } //std::cout << "debug2: " << year << " " << dataType << " " << detType << " " << corrType << " " << ptBin << std::endl; string KeyMap = CreateMapKey( year, dataType, detType, corrType, ptBin); //std::cout << "debug2: " << KeyMap << std::endl; if( CorrMap.find(KeyMap) == CorrMap.end() )return -999.; return CorrMap[KeyMap]; } double PhosphorCorrectionFunctor::GetCorrEnergyMC(int year, double pt, double etaReco, double Egen){ //int dataType = Data; //int corrType = Scale; int ptBin = -1; int detType = -1; if( year == 2011){ year = XX_XI; }else if( year == 2012){ year = XX_XII; }else std::cout << "[INFO]--> Unknown YEAR, please check, inputs are 2011 or 2012 only" << std::endl; if( fabs(etaReco) < 1.5){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } //if(pt>10 && pt <12)std::cout << "blah" << year << std::endl; string KeyMap_Smc = CreateMapKey( year, 0, detType, 0, ptBin);// CreateMapKey( year, dataType, detType, corrType, ptBin);MC=0 && Scale==0 string KeyMap_Rmc = CreateMapKey( year, 0, detType, 1, ptBin);//MC=0 && Resolution==1 string KeyMap_Rdata = CreateMapKey( year, 1, detType, 1, ptBin);//Data=1 && Resolution==1 std::map<std::string, double>::iterator it_Smc = CorrMap.find(KeyMap_Smc); std::map<std::string, double>::iterator it_Rmc = CorrMap.find(KeyMap_Rmc); std::map<std::string, double>::iterator it_Rdata = CorrMap.find(KeyMap_Rdata); if( it_Smc == CorrMap.end() ){ std::cout << "[INFO]-->Scale MC NOT found on the MAP, correction not applied" << "Pt = " << pt << " eta = " << etaReco << std::endl; return ETtoE( pt, etaReco); }else if( it_Rmc == CorrMap.end() ){ std::cout << "[INFO]-->Resolution MC NOT found on the MAP, correction not applied" << std::endl; return ETtoE( pt, etaReco); }else if( it_Rdata == CorrMap.end() ){ std::cout << "[INFO]-->Resolution data NOT found on the MAP, correction not applied" << std::endl; return ETtoE( pt, etaReco); }else{ //Actually now we apply the correction double Smc = 0.01*((*it_Smc).second) ;//Converting into number from % double Rmc = (*it_Rmc).second; double Rdata = (*it_Rdata).second; double E = ETtoE( pt, etaReco); double X_mc = E/Egen -1.0; double X_corr = (Rdata/Rmc)*( X_mc - Smc ); return (1.0 + X_corr)*Egen; } } double PhosphorCorrectionFunctor::GetCorrEnergyMC(float R9, int year, double pt, double etaReco, double Egen){ //int dataType = Data; //int corrType = Scale; int ptBin = -1; int detType = -1; int r9Cat = -1; if( year == 2011){ year = XX_XI; }else if( year == 2012){ year = XX_XII; }else std::cout << "[INFO]--> Unknown YEAR, please check, inputs are 2011 or 2012 only" << std::endl; if( fabs(etaReco) < 1.5){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } if ( R9 > 0.94 ){ r9Cat = 1;// }else if ( R9 <= 0.94 && R9 > -10. ){ r9Cat = 2;//Low R9 }else if ( R9 == -666. ){ r9Cat = 0;//Inclusive Category } //if(pt>10 && pt <12)std::cout << "blah" << year << std::endl; string KeyMap_Smc = CreateMapKey( year, 0, detType, r9Cat, 0, ptBin);// CreateMapKey( year, dataType, detType, corrType, ptBin);MC=0 && Scale==0 string KeyMap_Rmc = CreateMapKey( year, 0, detType, r9Cat, 1, ptBin);//MC=0 && Resolution==1 string KeyMap_Rdata = CreateMapKey( year, 1, detType, r9Cat, 1, ptBin);//Data=1 && Resolution==1 std::map<std::string, double>::iterator it_Smc = CorrMap.find(KeyMap_Smc); std::map<std::string, double>::iterator it_Rmc = CorrMap.find(KeyMap_Rmc); std::map<std::string, double>::iterator it_Rdata = CorrMap.find(KeyMap_Rdata); if( it_Smc == CorrMap.end() ){ std::cout << "[INFO]-->Scale MC NOT found on the MAP, correction not applied" << "Pt = " << pt << " eta = " << etaReco << std::endl; return ETtoE( pt, etaReco); }else if( it_Rmc == CorrMap.end() ){ std::cout << "[INFO]-->Resolution MC NOT found on the MAP, correction not applied" << std::endl; return ETtoE( pt, etaReco); }else if( it_Rdata == CorrMap.end() ){ std::cout << "[INFO]-->Resolution data NOT found on the MAP, correction not applied" << std::endl; return ETtoE( pt, etaReco); }else{ //Actually now we apply the correction double Smc = 0.01*((*it_Smc).second) ;//Converting into number from % double Rmc = (*it_Rmc).second; double Rdata = (*it_Rdata).second; double E = ETtoE( pt, etaReco); double X_mc = E/Egen -1.0; double X_corr = (Rdata/Rmc)*( X_mc - Smc ); return (1.0 + X_corr)*Egen; } } double PhosphorCorrectionFunctor::GetCorrEnergyData(int year, double pt, double etaReco){ int dataType = Data; int corrType = Scale; int ptBin = -1; int detType = -1; if( year == 2011){ year = XX_XI; }else if( year == 2012){ year = XX_XII; }else std::cout << "[INFO]--> Unknown YEAR, please check, inputs are 2011 or 2012 only" << std::endl; if( fabs(etaReco) < 1.5){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } // std::cout << "debug2: " << year << " " << dataType << " " << detType << " " << corrType << " " << ptBin << std::endl; string KeyMap = CreateMapKey( year, dataType, detType, corrType, ptBin); //std::cout << "debug2: " << KeyMap << std::endl; if( CorrMap.find(KeyMap) == CorrMap.end() ){ std::cout << "[INFO]-->Scale Data Not found, No correction applied. PT: " << pt <<std::endl; return ETtoE( pt, etaReco); }else{ double Sdata = 0.01*CorrMap[KeyMap];//Converting into number from % if(Sdata != -1.0){//avoid division by zero //std::cout << "Sdata: " << Sdata << std::endl; return ETtoE( pt, etaReco)/(1.0 + Sdata); }else{ std::cout << "[INFO]-->Scale equal to -1, Avoiding division by zero, No correction applied" << std::endl; return ETtoE( pt, etaReco); } } } double PhosphorCorrectionFunctor::GetCorrEnergyData(float R9, int year, double pt, double etaReco){ int dataType = Data; int corrType = Scale; int ptBin = -1; int detType = -1; int r9Cat = -1; if( year == 2011){ year = XX_XI; }else if( year == 2012){ year = XX_XII; }else std::cout << "[INFO]--> Unknown YEAR, please check, inputs are 2011 or 2012 only" << std::endl; if( fabs(etaReco) < 1.5){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } if ( R9 > 0.94 ){ r9Cat = 1;// }else if ( R9 <= 0.94 && R9 > -10. ){ r9Cat = 2;//Low R9 }else if ( R9 == -666 ){ r9Cat = 0;//Inclusive Category } // std::cout << "debug2: " << year << " " << dataType << " " << detType << " " << corrType << " " << ptBin << std::endl; string KeyMap = CreateMapKey( year, dataType, detType, r9Cat, corrType, ptBin); //std::cout << "debug2: " << KeyMap << std::endl; if( CorrMap.find(KeyMap) == CorrMap.end() ){ std::cout << "[INFO]-->Scale Data Not found, No correction applied. PT: " << pt <<std::endl; return ETtoE( pt, etaReco); }else{ double Sdata = 0.01*CorrMap[KeyMap];//Converting into number from % if(Sdata != -1.0){//avoid division by zero //std::cout << "Sdata: " << Sdata << std::endl; return ETtoE( pt, etaReco)/(1.0 + Sdata); }else{ std::cout << "[INFO]-->Scale equal to -1, Avoiding division by zero, No correction applied" << std::endl; return ETtoE( pt, etaReco); } } } /* double PhosphorCorrectionFunctor::GetCorrEnergy(int year, double pt, double etaReco, int datType){ int dataType = datType; int corrType = Scale; int ptBin = -1; int detType = -1; if( year == 2011){ year = XX_XI; }else if( year == 2012){ year = XX_XII; }else std::cout << "[INFO]--> Unknown YEAR, please check, inputs are 2011 or 2012 only" << std::endl; if( fabs(etaReco) < 1.5){ detType = EB; }else{ detType = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } // std::cout << "debug2: " << year << " " << dataType << " " << detType << " " << corrType << " " << ptBin << std::endl; string KeyMap = CreateMapKey( year, dataType, detType, corrType, ptBin); //std::cout << "debug2: " << KeyMap << std::endl; if( CorrMap.find(KeyMap) == CorrMap.end() ){ std::cout << "[INFO]-->Scale Data Not found, No correction applied. PT: " << pt << std::endl; return ETtoE( pt, etaReco); }else{ double Sdata = 0.01*CorrMap[KeyMap];//Converting into number from % if(Sdata != -1.0){//avoid division by zero //std::cout << "Sdata: " << Sdata << std::endl; return ETtoE( pt, etaReco)/(1.0 + Sdata); }else{ std::cout << "[INFO]-->Scale equal to -1, Avoiding division by zero, No correction applied" << std::endl; return ETtoE( pt, etaReco); } } } */ double PhosphorCorrectionFunctor::GetCorrEtMC(int year, double pt, double etaReco, double Egen){ double E = GetCorrEnergyMC(year, pt, etaReco, Egen); return EtoET(E, etaReco); } double PhosphorCorrectionFunctor::GetCorrEtMC(float R9, int year, double pt, double etaReco, double Egen){ double E = GetCorrEnergyMC(R9, year, pt, etaReco, Egen); return EtoET(E, etaReco); } double PhosphorCorrectionFunctor::GetCorrEtData(int year, double pt, double etaReco){ double E = GetCorrEnergyData(year, pt, etaReco); return EtoET(E, etaReco); } double PhosphorCorrectionFunctor::GetCorrEtData(float R9, int year, double pt, double etaReco){ double E = GetCorrEnergyData(R9, year, pt, etaReco); return EtoET(E, etaReco); } /* double PhosphorCorrectionFunctor::GetCorrEt(int year, double pt, double etaReco, int datType){ double E = GetCorrEnergy(year, pt, etaReco, datType); return EtoET(E, etaReco); } */ int PhosphorCorrectionFunctor::GetCategory(float R9, int year, double pt, double etaReco){ stringstream ss; int det = -1; int ptBin = -1; int yearBin = -1; int r9Bin = -1; if( year == 2011 ){ yearBin = XX_XI; }else if( year == 2012 ){ yearBin = XX_XII; } if( R9 >= 0.94){ r9Bin = 1; }else if(R9 < 0.94){ r9Bin = 2; } if( fabs(etaReco) <= 1.5 ){ det = EB; }else if( fabs(etaReco) > 1.5 ){ det = EE; } if(pt > 10 && pt <= 12){ ptBin = Pt0; }else if(pt > 12 && pt <= 15){ ptBin = Pt1; }else if(pt > 15 && pt <= 20){ ptBin = Pt2; }else if(pt > 20 && pt <= 999){ ptBin = Pt3; } //if( det == 1 )r9Bin = 1; ss << yearBin << det << r9Bin << ptBin; //std::cout << "det: " << det << std::endl; //std ::cout << "index: " << atoi( ss.str().c_str() ) << std::endl; return GetCatNumber( atoi( ss.str().c_str() ) ); } /* pair <int,double> PhosphorCorrectionFunctor::ScaleEnError(float R9, int year, double pt, double etaReco, double Egen){ int cat = GetCategory(R9, year, pt, etaReco); float ScaleError = 0.01;//1% int* c_in; c_in = CatIndex(R9, year, pt, etaReco);//cat[0]=R9,cat[1]=year, cat[2]=pt, cat[3]=det//Same order as arguments passed int cat_in[4] = {*c_in,*(c_in+1),*(c_in+2),*(c_in+3)}; std::cout << "C0: " << cat_in[0] << " C1: " << cat_in[1] << " C2: " << cat_in[2] << " C3: " << cat_in[3] << std::endl; string KeyMap_Smc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 0, cat_in[2]);// CreateMapKey( year, dataType, detType, corrType, ptBin);MC=0 && Scale==0 string KeyMap_Rmc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 1, cat_in[2]);//MC=0 && Resolution==1 string KeyMap_Rdata = CreateMapKey( cat_in[1], 1, cat_in[3], cat_in[0], 1, cat_in[2]);//Data=1 && Resolution==1 float SmcErr = ErrMap[KeyMap_Smc]; float Rmc = CorrMap[KeyMap_Rmc]; float Rdata = CorrMap[KeyMap_Rdata]; std::cout << "SmcErr: " << SmcErr << " Rmc: " << Rmc << " Rdata: " << Rdata << " factor: " << sqrt( ScaleError*ScaleError + pow( 0.01*Rdata*SmcErr/Rmc, 2 ) ) << std::endl; std::cout << "SmcErr: " << SmcErr << " Rmc: " << Rmc << " Rdata: " << Rdata << " factor: " << sqrt( pow( 0.01*Rdata*SmcErr/Rmc, 2 ) ) << std::endl; float sigmaE = sqrt( ScaleError*ScaleError + pow( 0.01*Rdata*SmcErr/Rmc, 2 ) )*Egen; return make_pair(cat, sigmaE); } pair <int,double> PhosphorCorrectionFunctor::ResEnError(float R9, int year, double pt, double etaReco, double Egen){ int cat = GetCategory(R9, year, pt, etaReco); float SigR_over_R = 0.02;//2% int* c_in; c_in = CatIndex(R9, year, pt, etaReco);//cat[0]=R9,cat[1]=year, cat[2]=pt, cat[3]=det//Same order as arguments passed int cat_in[4] = {*c_in,*(c_in+1),*(c_in+2),*(c_in+3)}; std::cout << "C0: " << cat_in[0] << " C1: " << cat_in[1] << " C2: " << cat_in[2] << " C3: " << cat_in[3] << std::endl; string KeyMap_Rmc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 1, cat_in[2]);//MC=0 && Resolution==1 float Rmc = CorrMap[KeyMap_Rmc]; float ErrRmc = ErrMap[KeyMap_Rmc]; std::cout << "Rmc: " << Rmc << " ErrRmc: " << ErrRmc << " factor: " << sqrt( SigR_over_R*SigR_over_R + pow( ErrRmc/Rmc, 2 ) ) << std::endl; std::cout << "Rmc: " << Rmc << " ErrRmc: " << ErrRmc << " factor: " << sqrt( pow( ErrRmc/Rmc, 2 ) ) << std::endl; float sigmaE = sqrt( SigR_over_R*SigR_over_R + pow( ErrRmc/Rmc, 2 ) )*( GetCorrEnergy(R9, year, pt, etaReco, Egen) - Egen ); return make_pair(cat, sigmaE); } */ double PhosphorCorrectionFunctor::ScaleEnError(float R9, int year, double pt, double etaReco, double Egen){ //int cat = GetCategory(R9, year, pt, etaReco); float ScaleError = 0.01;//1% int* c_in; c_in = CatIndex(R9, year, pt, etaReco);//cat[0]=R9,cat[1]=year, cat[2]=pt, cat[3]=det//Same order as arguments passed int cat_in[4] = {*c_in,*(c_in+1),*(c_in+2),*(c_in+3)}; //std::cout << "C0: " << cat_in[0] << " C1: " << cat_in[1] << " C2: " << cat_in[2] << " C3: " << cat_in[3] << std::endl; string KeyMap_Smc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 0, cat_in[2]);// CreateMapKey( year, dataType, detType, corrType, ptBin);MC=0 && Scale==0 string KeyMap_Rmc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 1, cat_in[2]);//MC=0 && Resolution==1 string KeyMap_Rdata = CreateMapKey( cat_in[1], 1, cat_in[3], cat_in[0], 1, cat_in[2]);//Data=1 && Resolution==1 float SmcErr = ErrMap[KeyMap_Smc]; float Rmc = CorrMap[KeyMap_Rmc]; float Rdata = CorrMap[KeyMap_Rdata]; //std::cout << "SmcErr: " << SmcErr << " Rmc: " << Rmc << " Rdata: " << Rdata << " factor: " << sqrt( ScaleError*ScaleError + pow( 0.01*Rdata*SmcErr/Rmc, 2 ) ) << std::endl; //std::cout << "SmcErr: " << SmcErr << " Rmc: " << Rmc << " Rdata: " << Rdata << " factor: " << sqrt( pow( 0.01*Rdata*SmcErr/Rmc, 2 ) ) << std::endl; double sigmaE = sqrt( ScaleError*ScaleError + pow( 0.01*Rdata*SmcErr/Rmc, 2 ) )*Egen; return sigmaE; } double PhosphorCorrectionFunctor::ResEnError(float R9, int year, double pt, double etaReco, double Egen){ //int cat = GetCategory(R9, year, pt, etaReco); float SigR_over_R = 0.02;//2% int* c_in; c_in = CatIndex(R9, year, pt, etaReco);//cat[0]=R9,cat[1]=year, cat[2]=pt, cat[3]=det//Same order as arguments passed int cat_in[4] = {*c_in,*(c_in+1),*(c_in+2),*(c_in+3)}; //std::cout << "C0: " << cat_in[0] << " C1: " << cat_in[1] << " C2: " << cat_in[2] << " C3: " << cat_in[3] << std::endl; string KeyMap_Rmc = CreateMapKey( cat_in[1], 0, cat_in[3], cat_in[0], 1, cat_in[2]);//MC=0 && Resolution==1 float Rmc = CorrMap[KeyMap_Rmc]; float ErrRmc = ErrMap[KeyMap_Rmc]; //std::cout << "Rmc: " << Rmc << " ErrRmc: " << ErrRmc << " factor: " << sqrt( SigR_over_R*SigR_over_R + pow( ErrRmc/Rmc, 2 ) ) << std::endl; //std::cout << "Rmc: " << Rmc << " ErrRmc: " << ErrRmc << " factor: " << sqrt( pow( ErrRmc/Rmc, 2 ) ) << std::endl; double sigmaE = sqrt( SigR_over_R*SigR_over_R + pow( ErrRmc/Rmc, 2 ) )*( GetCorrEnergyMC(R9, year, pt, etaReco, Egen) - Egen ); return sigmaE; } bool PhosphorCorrectionFunctor::MapCat(){ //map<int, int> Map; int R = -1, code = -1, code_aux = -1, ctr = 0; for(int y = 0; y < 2; y++){ for(int d = 0; d < 2; d++){ for(int r = 1; r < 3; r++){ for(int p = 0; p < 4; p++){ R = r; if( d == 1 && r == 2 ) R = 1; code = 1000*y + 100*d + 10*R + p; if( CatMap.find(code) != CatMap.end() ){ code_aux = code; if( d == 1) R = 1; code = 1000*y + 100*d + 10*r + p; CatMap.insert( pair<int, int>( code, CatMap.find(code_aux)->second ) ); //cerr << "Code Already exist found! skip event." << endl; //std::cout << "cat: " << code << " index: " << CatMap[code] << std::endl; continue; } CatMap.insert( pair<int, int>( code, ctr ) ); //std::cout << "cat: " << code << " index: " << CatMap[code] << std::endl; ctr = CatMap.find(code)->second + 1; } } } } if( CatMap.size() == 32 )return true; return false; } int PhosphorCorrectionFunctor::GetCatNumber(int index){ if( CatMap[index] >= 0 && CatMap[index] <= 24 )return CatMap[index]; return -66; } int* PhosphorCorrectionFunctor::CatIndex(float R9, int year, double pt, double etaReco){ int* cat_index = new int[4]; if( year == 2011 ){ cat_index[1] = XX_XI; }else if( year == 2012 ){ cat_index[1] = XX_XII; } if( R9 >= 0.94){ cat_index[0] = 1; }else if(R9 < 0.94){ cat_index[0] = 2; } if( etaReco <= fabs(1.5) ){ cat_index[3] = EB; }else if( etaReco > fabs(1.5) ){ cat_index[3] = EE; } if(pt > 10 && pt <= 12){ cat_index[2] = Pt0; }else if(pt > 12 && pt <= 15){ cat_index[2] = Pt1; }else if(pt > 15 && pt <= 20){ cat_index[2] = Pt2; }else if(pt > 20 && pt <= 999){ cat_index[2] = Pt3; } return (int*)cat_index; } }
d7d1d1786fd31341ddf897a25976992e789ef143
c8ee531a51c49f765d6bc92409ce50d82663d31e
/Code/Libs/Window/Application.hpp
c603c2c323481e1daa79528281f1665f132a1302
[ "Zlib" ]
permissive
NotKyon/Tenshi
8dcfdb0a7fdd80d2e40ef092af26984ab042a488
9bd298c6ef4e6ae446a866c2918e15b4ab22f9e7
refs/heads/master
2021-01-17T16:40:08.688678
2017-05-05T08:26:57
2017-05-05T08:26:57
63,018,850
0
0
null
null
null
null
UTF-8
C++
false
false
170
hpp
Application.hpp
#pragma once namespace Ax { namespace Window { void SubmitQuitEvent(); bool ReceivedQuitEvent(); bool WaitForAndProcessEvent(); bool ProcessAllQueuedEvents(); }}
ab7a4ef35856da14e5189a05b04c65d971d15191
e91646ac6e1f6c880203f86501a5fc93cd9e4acb
/src/shading/spherical_shading.cc
de3b8a928e9dd5e5bd73bb63aa35d7b45cd44309
[ "WTFPL" ]
permissive
stephenmcgruer/University-CG
c2bcf4d2253d4690c1fa4cea0dfe7365af921520
44000935da96dc74cce3622c68bd14601949f50a
refs/heads/master
2021-01-18T15:16:36.105175
2013-05-21T19:25:25
2013-05-21T19:25:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,254
cc
spherical_shading.cc
//! \author Stephen McGruer #include "./spherical_shading.h" namespace computer_graphics { //! A z-buffer approach is used to draw points in the correct order. Note that //! multiple entries may exist in points for a single coordinate, so the drawing //! must be done by iterating from the front of the points vector to the back. void SphericalShading::Shade(TriangleMesh object, TriangleMesh the_floor, WindowInfo window_info, Vertex light_position, Vertex view_position, std::vector<Vertex>& points, IplImage* image) { int window_width = std::abs(window_info.left) + std::abs(window_info.right); int window_height = std::abs(window_info.top) + std::abs(window_info.bottom); // Initialise the z-buffer. std::vector<std::vector<float> > z_buffer; for (int i = 0; i <= window_width; i++) { std::vector<float> line(window_height + 1, -1000.0f); z_buffer.push_back(line); } // Spherical environment mapping doesn't implement shadows. std::vector<std::vector<float> > shadow_buffer; RenderObject(object, window_info, light_position, view_position, z_buffer, points, image); RenderFloor(the_floor, window_info, light_position, view_position, z_buffer, shadow_buffer, points); } void SphericalShading::RenderObject(TriangleMesh the_object, WindowInfo window_info, Vertex light_position, Vertex view_position, std::vector<std::vector<float> >& z_buffer, std::vector<Vertex>& points, IplImage* image) { int window_width = std::abs(window_info.left) + std::abs(window_info.right); int window_height = std::abs(window_info.top) + std::abs(window_info.bottom); // Compute the triangle normals. std::vector<Vertex> triangle_normals; for (int i = 0; i < the_object.trigNum(); i++) { Vertex p1; Vertex p2; Vertex p3; Vertex trNormal; the_object.GetTriangleVertices(i, p1, p2, p3); ComputeSurfaceNormal(p1, p2, p3, trNormal); triangle_normals.push_back(trNormal); } // Compute the vertex normals std::vector<Vertex> vertex_normals; for (int i = 0; i < the_object.vNum(); i++) { Vertex vNormal; std::vector<int> triangles = the_object.GetTrianglesForVertex(i); for (std::vector<int>::iterator it = triangles.begin(); it != triangles.end(); it++) { vNormal[0] += triangle_normals[(*it)][0]; vNormal[1] += triangle_normals[(*it)][1]; vNormal[2] += triangle_normals[(*it)][2]; } vNormal[0] /= triangles.size(); vNormal[1] /= triangles.size(); vNormal[2] /= triangles.size(); vertex_normals.push_back(vNormal); } // Render the triangles in the object. for (int i = 0; i < the_object.trigNum(); i++) { std::vector<int> vertices; the_object.GetTriangleVerticesInt(i, vertices); Vertex p1 = the_object.v(vertices[0]); Vertex p2 = the_object.v(vertices[1]); Vertex p3 = the_object.v(vertices[2]); // For efficiency, establish a bounding box for the triangle. int left = clamp(std::min(p1[0], std::min(p2[0], p3[0])), window_info.left, window_info.right); int right = clamp(std::max(p1[0], std::max(p2[0], p3[0])), window_info.left, window_info.right); int top = clamp(std::min(p1[1], std::min(p2[1], p3[1])), window_info.top, window_info.bottom); int bottom = clamp(std::max(p1[1], std::max(p2[1], p3[1])), window_info.top, window_info.bottom); for (int y = top; y <= bottom; y++) { for (int x = left; x <= right; x++) { // Skip non-triangle pixels. if (!InTriangle(x, y, p1, p2, p3)) { continue; } float alpha; float beta; float gamma; CalculateBarycentricCoordinates(x, y, p1, p2, p3, alpha, beta, gamma); float z = alpha * p1[2] + beta * p2[2] + gamma * p3[2]; // Skip hidden pixels. if (z_buffer[x + window_width / 2][y + window_height / 2] > z) { continue; } z_buffer[x + window_width / 2][y + window_height / 2] = z; // Interpolate the normal vector for the point from the vertex normals. Vertex point_normal; point_normal[0] = (alpha * vertex_normals[vertices[0]][0]) + (beta * vertex_normals[vertices[1]][0]) + (gamma * vertex_normals[vertices[2]][0]); point_normal[1] = (alpha * vertex_normals[vertices[0]][1]) + (beta * vertex_normals[vertices[1]][1]) + (gamma * vertex_normals[vertices[2]][1]); point_normal[2] = (alpha * vertex_normals[vertices[0]][2]) + (beta * vertex_normals[vertices[1]][2]) + (gamma * vertex_normals[vertices[2]][2]); Vertex light(light_position[0] - x, light_position[1] - y, light_position[2] - z); Normalise(light); Vertex view(view_position[0] - x, view_position[1] - y, view_position[2] - z); Normalise(view); std::vector<float> colour; SphericalEnvironmentMap(point_normal, light, view, colour, image); points.push_back(Vertex(x, y, z, colour[0], colour[1], colour[2])); } } } } void SphericalShading::SphericalEnvironmentMap(Vertex normal, Vertex light, Vertex view, std::vector<float>& colour, IplImage* image) { // reflection = 2(light . normal)normal - light; float constant = 2 * DotProduct(light, normal); Vertex reflection; reflection[0] = constant * normal[0] - light[0]; reflection[1] = constant * normal[1] - light[1]; reflection[2] = constant * normal[2] - light[2]; Normalise(reflection); // m = sqrt(Rx^2 + Ry^2 + (Rz + 1)^2) // u = (Rx / 2m) + 1/2 // v = (Ry / 2m) + 1/2 float m = std::sqrt( std::pow(reflection[0], 2) + std::pow(reflection[1], 2) + std::pow(reflection[2] + 1, 2)); int u = (reflection[0] / (2 * m) + 0.5f) * image->height; int v = (1 - (reflection[1] / (2 * m) + 0.5f)) * image->width; // The imagedata is stored BGR, not RGB. uchar *data; data = (uchar *) image->imageData; colour.push_back((float) data[v * image->widthStep + u * image->nChannels + 2] / 255.0f); colour.push_back((float) data[v * image->widthStep + u * image->nChannels + 1] / 255.0f); colour.push_back((float) data[v * image->widthStep + u * image->nChannels + 0] / 255.0f); } }
d0e6190236ce7b98493384e8f1c856c2082bb48f
57ab0abe5071faa24cd547abe5980a06fdad9688
/ESP_CUBE/ESP_CUBE.ino
91a6109f53d312420ae793efb2fd4ef01cea860a
[]
no_license
TGC-TECH/ESP32-WiFi-LED-Cube-3x3-
695d9eec1d0235b101924606a9c5a9e006e8aaa1
d90dd63b804e3fbf338be77b5db9256df4d8516b
refs/heads/master
2020-06-13T05:08:02.477701
2019-12-01T15:08:14
2019-12-01T15:08:14
194,546,101
0
0
null
null
null
null
UTF-8
C++
false
false
13,232
ino
ESP_CUBE.ino
#include <WiFi.h> // Variables to store network name and password const char* ssid = "Cowles-WiFi"; // Enter your network name const char* password = "--------"; //Enter your network password // Set the server port nunber to deafualt 80 WiFiServer server(80); // this variable header stores the HTTP requests data String header; int ani_one = 1; int ani_two = 1; int ani_1 = 1; int ani_2 = 0; unsigned long Time; /* Blink Turns an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to the correct LED pin independent of which board is used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at: https://www.arduino.cc/en/Main/Products modified 8 May 2014 by Scott Fitzgerald modified 2 Sep 2016 by Arturo Guadalupi modified 8 Sep 2016 by Colby Newman This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Blink */ // the setup function runs once when you press reset or power the board void setup() { Serial.begin(115200); //define serial commuination with baud rate of 115200 Serial.print("Making connection to "); // it will display message on serial monitor Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } // These lines prints the IP address value on serial monitor Serial.println(""); Serial.println("WiFi connected."); Serial.println("IP address: "); Serial.println(WiFi.localIP()); server.begin(); // grid pins: //grid pins back pinMode(13, OUTPUT); //left pinMode(12, OUTPUT); //middle pinMode(14, OUTPUT); //right //grid pins middle pinMode(27, OUTPUT); //left pinMode(26, OUTPUT); //middle pinMode(25, OUTPUT); //right //grid pins front pinMode(33, OUTPUT); //left pinMode(32, OUTPUT); //middle pinMode(23, OUTPUT); //right //tranistor pins pinMode(15, OUTPUT); //middle layer pinMode(2, OUTPUT); //top layer pinMode(4, OUTPUT); //bottom layer } // the loop function runs over and over again forever void loop() { WiFiClient client = server.available(); //Checking if any client request is available or not if (client) { boolean currentLineIsBlank = true; String buffer = ""; while (client.connected()) { if (client.available()) // if there is some client data available { char c = client.read(); buffer+=c; // read a byte if (c == '\n' && currentLineIsBlank) // check for newline character, { client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(); client.print("<HTML><title>ESP32</title>"); client.print("<body><h1>ESP32 LED CONTROL </h1>"); client.print("<a href=\"/?off\"\"><button>DISABLE ALL</button></a>"); client.print("<p>Animation One</p>"); client.print("<a href=\"/?oneon\"\"><button>ON</button></a>"); client.print("<a href=\"/?oneoff\"\"><button>OFF</button></a>"); client.print("<p>Animation Two</p>"); client.print("<a href=\"/?twoon\"\"><button>ON</button></a>"); client.print("<a href=\"/?twooff\"\"><button>OFF</button></a>"); client.print("</body></HTML>"); break; // break out of the while loop: } if (c == '\n') { currentLineIsBlank = true; buffer=""; } else if (c == '\r') { if(buffer.indexOf("GET /?oneon")>=0){ ani_one = 1; ani_1 = 1; Time = millis() - 200; } if(buffer.indexOf("GET /?oneoff")>=0){ ani_one = 0; ani_1 = 0; } if(buffer.indexOf("GET /?twoon")>=0){ ani_two = 1; ani_2 = 1; Time = millis() - 200; } if(buffer.indexOf("GET /?twooff")>=0){ ani_two = 0; ani_2 = 0; } if(buffer.indexOf("GET /?off")>=0){ ani_2 = 0; ani_1 = 0; digitalWrite(13, LOW); digitalWrite(12, LOW); digitalWrite(14, LOW); digitalWrite(15, LOW); digitalWrite(4, LOW); digitalWrite(2, LOW); digitalWrite(27, LOW); digitalWrite(26, LOW); digitalWrite(25, LOW); digitalWrite(33, LOW); digitalWrite(32, LOW); } } else { currentLineIsBlank = false; } } } client.stop(); } if (ani_1 == 1){ if(millis() < Time+500){ //sets up layer digitalWrite(4, HIGH); digitalWrite(15, LOW); digitalWrite(2, LOW); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); } if(millis() >= Time+1000 && millis() < Time+1500){ digitalWrite(12, HIGH); digitalWrite(13, LOW); } if(millis() >= Time+2000 && millis() < Time+2500){ digitalWrite(14, HIGH); digitalWrite(12,LOW); } if(millis() >= Time+3000 && millis() < Time+3500){ digitalWrite(27, HIGH); digitalWrite(14,LOW); } if(millis() >= Time+4000 && millis() < Time+4500){ digitalWrite(26, HIGH); digitalWrite(27,LOW); } if(millis() >= Time+5000 && millis() < Time+5500){ digitalWrite(25, HIGH); digitalWrite(26,LOW); } if(millis() >= Time+6000 && millis() < Time+6500){ digitalWrite(33, HIGH); digitalWrite(25,LOW); } if(millis() >= Time+7000 && millis() < Time+7500){ digitalWrite(32, HIGH); digitalWrite(33,LOW); } if(millis() >= Time+8000 && millis() < Time+8500){ digitalWrite(23, HIGH); digitalWrite(32,LOW); } if(millis() >= Time+9000 && millis() < Time+9500){ //sets up layer digitalWrite(4, LOW); digitalWrite(15, HIGH); digitalWrite(2, LOW); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); digitalWrite(23, LOW); } if(millis() >= Time+10000 && millis() < Time+10500){ digitalWrite(12, HIGH); digitalWrite(13, LOW); } if(millis() >= Time+11000 && millis() < Time+11500){ digitalWrite(14, HIGH); digitalWrite(12,LOW); } if(millis() >= Time+12000 && millis() < Time+12500){ digitalWrite(27, HIGH); digitalWrite(14,LOW); } if(millis() >= Time+13000 && millis() < Time+13500){ digitalWrite(26, HIGH); digitalWrite(27,LOW); } if(millis() >= Time+14000 && millis() < Time+14500){ digitalWrite(25, HIGH); digitalWrite(26,LOW); } if(millis() >= Time+15000 && millis() < Time+15500){ digitalWrite(33, HIGH); digitalWrite(25,LOW); } if(millis() >= Time+16000 && millis() < Time+16500){ digitalWrite(32, HIGH); digitalWrite(33,LOW); } if(millis() >= Time+17000 && millis() < Time+17500){ digitalWrite(23, HIGH); digitalWrite(32,LOW); } if(millis() >= Time+18000 && millis() < Time+18500){ //sets up layer digitalWrite(4, LOW); digitalWrite(15, LOW); digitalWrite(2, HIGH); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); digitalWrite(23, LOW); } if(millis() >= Time+19000 && millis() < Time+19500){ digitalWrite(12, HIGH); digitalWrite(13, LOW); } if(millis() >= Time+20000 && millis() < Time+20500){ digitalWrite(14, HIGH); digitalWrite(12,LOW); } if(millis() >= Time+21000 && millis() < Time+21500){ digitalWrite(27, HIGH); digitalWrite(14,LOW); } if(millis() >= Time+22000 && millis() < Time+22500){ digitalWrite(26, HIGH); digitalWrite(27,LOW); } if(millis() >= Time+23000 && millis() < Time+23500){ digitalWrite(25, HIGH); digitalWrite(26,LOW); } if(millis() >= Time+24000 && millis() < Time+24500){ digitalWrite(33, HIGH); digitalWrite(25,LOW); } if(millis() >= Time+25000 && millis() < Time+25500){ digitalWrite(32, HIGH); digitalWrite(33,LOW); } if(millis() >= Time+26000 && millis() < Time+26500){ digitalWrite(23, HIGH); digitalWrite(32,LOW); } if(millis() >= Time+27000){ Time = millis()-200; digitalWrite(23, LOW); if(ani_two == 1){ ani_1 = 0; ani_2 = 1; } } } if(ani_2 == 1){ if(millis() < Time+500){ //sets up layer digitalWrite(4, HIGH); digitalWrite(15, LOW); digitalWrite(2, LOW); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); } if(millis() >= Time+1000 && millis() < Time+1500){ digitalWrite(12, HIGH); //digitalWrite(13, LOW); } if(millis() >= Time+2000 && millis() < Time+2500){ digitalWrite(14, HIGH); //digitalWrite(12,LOW); } if(millis() >= Time+3000 && millis() < Time+3500){ digitalWrite(27, HIGH); //digitalWrite(14,LOW); } if(millis() >= Time+4000 && millis() < Time+4500){ digitalWrite(26, HIGH); //digitalWrite(27,LOW); } if(millis() >= Time+5000 && millis() < Time+5500){ digitalWrite(25, HIGH); //digitalWrite(26,LOW); } if(millis() >= Time+6000 && millis() < Time+6500){ digitalWrite(33, HIGH); //digitalWrite(25,LOW); } if(millis() >= Time+7000 && millis() < Time+7500){ digitalWrite(32, HIGH); //digitalWrite(33,LOW); } if(millis() >= Time+8000 && millis() < Time+8500){ digitalWrite(23, HIGH); //digitalWrite(32,LOW); } if(millis() >= Time+9000 && millis() < Time+9500){ //sets up layer //digitalWrite(4, LOW); digitalWrite(15, HIGH); digitalWrite(2, LOW); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); digitalWrite(23, LOW); digitalWrite(27, LOW); digitalWrite(26, LOW); digitalWrite(25, LOW); digitalWrite(33,LOW); digitalWrite(32,LOW); digitalWrite(35,LOW); } if(millis() >= Time+10000 && millis() < Time+10500){ digitalWrite(12, HIGH); digitalWrite(13, LOW); } if(millis() >= Time+11000 && millis() < Time+11500){ digitalWrite(14, HIGH); digitalWrite(12,LOW); } if(millis() >= Time+12000 && millis() < Time+12500){ digitalWrite(27, HIGH); digitalWrite(14,LOW); } if(millis() >= Time+13000 && millis() < Time+13500){ digitalWrite(26, HIGH); digitalWrite(27,LOW); } if(millis() >= Time+14000 && millis() < Time+14500){ digitalWrite(25, HIGH); digitalWrite(26,LOW); } if(millis() >= Time+15000 && millis() < Time+15500){ digitalWrite(33, HIGH); digitalWrite(25,LOW); } if(millis() >= Time+16000 && millis() < Time+16500){ digitalWrite(32, HIGH); digitalWrite(33,LOW); } if(millis() >= Time+17000 && millis() < Time+17500){ digitalWrite(23, HIGH); digitalWrite(32,LOW); } if(millis() >= Time+18000 && millis() < Time+18500){ //sets up layer //digitalWrite(4, LOW); //digitalWrite(15, LOW); digitalWrite(2, HIGH); //sets up back row digitalWrite(13, HIGH); digitalWrite(12, LOW); digitalWrite(14,LOW); digitalWrite(23, LOW); digitalWrite(12, LOW); digitalWrite(14,LOW); digitalWrite(23, LOW); digitalWrite(27, LOW); digitalWrite(26, LOW); digitalWrite(25, LOW); digitalWrite(33,LOW); digitalWrite(32,LOW); digitalWrite(35,LOW); } if(millis() >= Time+19000 && millis() < Time+19500){ digitalWrite(12, HIGH); digitalWrite(13, LOW); } if(millis() >= Time+20000 && millis() < Time+20500){ digitalWrite(14, HIGH); digitalWrite(12,LOW); } if(millis() >= Time+21000 && millis() < Time+21500){ digitalWrite(27, HIGH); digitalWrite(14,LOW); } if(millis() >= Time+22000 && millis() < Time+22500){ digitalWrite(26, HIGH); digitalWrite(27,LOW); } if(millis() >= Time+23000 && millis() < Time+23500){ digitalWrite(25, HIGH); digitalWrite(26,LOW); } if(millis() >= Time+24000 && millis() < Time+24500){ digitalWrite(33, HIGH); digitalWrite(25,LOW); } if(millis() >= Time+25000 && millis() < Time+25500){ digitalWrite(32, HIGH); digitalWrite(33,LOW); } if(millis() >= Time+26000 && millis() < Time+26500){ digitalWrite(23, HIGH); digitalWrite(32,LOW); } if(millis() >= Time+27000){ Time = millis()-200; digitalWrite(23, LOW); if(ani_one == 1){ ani_1 = 1; ani_2 = 0; } if(ani_one == 0){ ani_2 = 1; } }} }
111fafec4dbeeb3f229c7de1f4a3ba580288242b
01f8171fdaf0177123866b9c8706d603e2f3c2e8
/io/image/image_writer_png.h
83d3864a30241c398a4cc0bf098270bd2ed131ce
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
ppearson/ImaginePartial
5176fb31927e09c43ece207dd3ae021274e4bd93
9871b052f2edeb023e2845578ad69c25c5baf7d2
refs/heads/master
2020-05-21T14:08:50.162787
2020-01-22T08:12:23
2020-01-22T08:12:23
46,647,365
1
0
null
null
null
null
UTF-8
C++
false
false
952
h
image_writer_png.h
/* Imagine Copyright 2011-2012 Peter Pearson. Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --------- */ #ifndef IMAGE_WRITER_PNG_H #define IMAGE_WRITER_PNG_H #include "io/image_writer.h" namespace Imagine { class ImageWriterPNG : public ImageWriter { public: ImageWriterPNG(); virtual bool writeImage(const std::string& filePath, const OutputImage& image, unsigned int channels, unsigned int flags); }; } // namespace Imagine #endif // IMAGE_WRITER_PNG_H
3e2601688c6690197240344dd60cc256abe6d3fb
71c1c86b30c1518e21728f7d5e0f09b5e602baac
/ROC.Window/APISRLab/APISRLab/CSync.h
2e2854451b70ad6f1f8b7db583a3c263b8aa42f9
[]
no_license
ssh352/ronin
3ddf360fec5f106015c6902b5107aedefe934836
33301b6c5e68fa9d02c7d54bc86f6b7732985fc2
refs/heads/master
2023-05-03T11:00:39.368460
2021-05-17T18:41:08
2021-05-17T18:41:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
764
h
CSync.h
class CSync { public: CSync() { InitializeCriticalSection(&m_CriticalSection); } ~CSync() { DeleteCriticalSection(&m_CriticalSection); } void Acquire() { EnterCriticalSection(&m_CriticalSection); } void Release() { LeaveCriticalSection(&m_CriticalSection); } private: CRITICAL_SECTION m_CriticalSection; // Synchronization object }; class CLockGuard { public: CLockGuard(CSync &refSync) : m_refSync(refSync) { Lock(); } ~CLockGuard() { Unlock(); } private: CSync &m_refSync; // Synchronization object CLockGuard(const CLockGuard &refcSource); CLockGuard &operator=(const CLockGuard &refcSource); void Lock() { m_refSync.Acquire(); } void Unlock() { m_refSync.Release(); } };
ad8cf977e7f4c569025838dae41bce722177522c
812d81c893443325d8cf5b9ca25ddf64f3009c45
/HTU21D_New.ino
38c420cd5fdbe2d2fa37a61b61c13ce87574a36d
[]
no_license
Luxorchegone/HTU21D-automatic-fan
c6935876dbfa1d9842b16bb414dba80dd709da3c
13079fc607b8284d76b3d25394bcdee9d7ea77a6
refs/heads/main
2023-01-09T03:19:12.975479
2020-11-10T07:50:03
2020-11-10T07:50:03
311,424,220
0
0
null
null
null
null
UTF-8
C++
false
false
8,950
ino
HTU21D_New.ino
/***************************************************************************************************/ /*Программа написана для управления вентилятором ванной комнаты. Для сборки схемы необходим датчик HTU21, LCD дисплей 160Х (в моем случае 1601, но можно любой другой из этой серии), пара кнопок, транзистор для управления самим вентилятором или готовый релейный модуль и конечно же Arduino UNO, Nano или Mini Pro.*/ /***************************************************************************************************/ #include <Wire.h> #include <HTU21D.h> #include <LiquidCrystal.h> #include "GyverButton.h" #include <EEPROM.h> #define INIT_ADDR 20 //Некий адрес в EEPROM, для механизма записи первоначального значения в EEPROM #define INIT_KEY 40.0 //Уставка влажности при первом запуске HTU21D myHTU21D(HTU21D_RES_RH11_TEMP11); // Что бы не нагружать дачтик, устанавливаем 11 битное разрешение на влажность и температуру const int rs = 3, en = 2, d4 = 6, d5 = 7, d6 = 8, d7 = 9; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); uint8_t humidity_icon[8] {0x04, 0x0E, 0x0E, 0x1F, 0x1F, 0x1F, 0x0E, 0x00}; uint8_t temperature_icon[8] {0x04, 0x0A, 0x0A, 0x0E, 0x0E, 0x1F, 0x1F, 0x0E}; uint8_t celsius_icon[8] {0x18, 0x18, 0x06, 0x09, 0x08, 0x09, 0x06, 0x00}; GButton button_inc(5, HIGH_PULL, NORM_OPEN); //Обе кнопки нормально открытые, посажены на землю и 5 пин (кнопка +), GButton button_dec(4, HIGH_PULL, NORM_OPEN); //землю и 4 пин (кнопка -). uint32_t homescreen_update_timing; uint32_t setpoint_setting_timing; boolean homescreen_template_flag = false; boolean setpoint_setting_flag = false; float current_temp; float current_humidity; float humidity_setpoint; float hysteresis_setpoint = 2.0; //При необходимости поменять на нужное число, не забывая, что оно вещественное. Т.е. если требуемый гистерезис 2, то нужно писать 2.0 void setup() { pinMode(13, OUTPUT); //При необходимости поменять на необходимый пин myHTU21D.begin(); lcd.begin(16, 2); lcd.createChar(0, humidity_icon); lcd.createChar(1, temperature_icon); lcd.createChar(2, celsius_icon); lcd.setCursor(0, 0); lcd.print(" Loadi"); lcd.setCursor(0, 1); lcd.print("ng..."); if ( EEPROM.read(INIT_ADDR) != INIT_KEY) { // Проверяем содержит ли EEPROM по адресу INIT_ADDR значение INIT_KEY, EEPROM.write(INIT_ADDR, INIT_KEY); // если не содержит, то записываем EEPROM.put(0, INIT_KEY); // в адрес 0 пишем INIT_KEY. Теперь при первом запуске устройства будет предустановлена уставка INIT_KEY } EEPROM.get(0, humidity_setpoint); // Считываем в переменную humidity_setpoint данные из 0 адреса EEPROM. Если включение не первое, то будет считано } // последнее установленное значение. Если же включение первое то значение будет = INIT_KEY void loop() { button_inc.tick(); button_dec.tick(); if ( button_inc.isPress()) { // Нажатие кнопки + setpointSetting( true ); } if ( button_dec.isPress()) { // Нажатие кнопки - setpointSetting( false ); } if ( setpoint_setting_flag ) {// Если отрисован экран настроек, начинаем проверять. if ( millis() - setpoint_setting_timing > 5000) { // Если прошло >5сек, убираем экран настроек. Если за это время было повторное нажатие кнопок + или -, то setpoint_setting_timing "обнуляется" и отсчет начинается заново. setpoint_setting_flag = false; // Убираем флаг экрана настроек EEPROM.put(0, humidity_setpoint); // Обновляем данные в EEPROM homescreenTemplate(); // Вызываем функцию отрисовки домашнего экрана homescreenUpdateData(); // Вызываем функцию вывода текущих показаний с датчика на экран } } if ( millis() - homescreen_update_timing > 12000 ) { // Каждые 12 секунд считываем показания с датчика. Автор библиотеки рекомендует опрашивать датчик не чаще 10-18 секунд homescreen_update_timing = millis(); current_temp = myHTU21D.readTemperature(); current_humidity = myHTU21D.readHumidity(); homescreenTemplate(); // Вызываем функцию отрисовки домашнего экрана homescreenUpdateData(); // Вызываем функцию вывода текущих показаний с датчика на экран hysteresisFan(humidity_setpoint, hysteresis_setpoint, current_humidity, 13); // Вызываем функцию гистерезиса, которая будет активировать пин, на котором у нас висит вентилятор. } } void homescreenTemplate(){ if ( !homescreen_template_flag && !setpoint_setting_flag ) { // Если не активен экран настроек и не активен домашний экран, то выводим на экран шаблон домашнего экрана lcd.clear(); lcd.setCursor(0, 0); lcd.write('\0'); lcd.setCursor(6, 0); lcd.print("%"); lcd.setCursor(1, 1); lcd.write('\1'); lcd.setCursor(7, 1); lcd.write('\2'); homescreen_template_flag = !homescreen_template_flag; // Домашний экран отрисован, ставим флаг -домашний экран активен } } void homescreenUpdateData(){ if ( !setpoint_setting_flag && homescreen_template_flag ) { // Если отрисован домашний экран и не активен экран настроек, то отрисовываем значения с датчика lcd.setCursor(1, 0); lcd.print(current_humidity); lcd.setCursor(2, 1); lcd.print(current_temp); } } void setpointSetting( boolean sign ) { if ( homescreen_template_flag && !setpoint_setting_flag ) { // Если домашний экран активен и не активен экран настроек homescreen_template_flag = !homescreen_template_flag; // Убираем домашний экран setpoint_setting_flag = !setpoint_setting_flag; // Активируем экран настроек и начинаем отрисовывать экран настроек и текущую уставку lcd.clear(); lcd.setCursor(0, 0); lcd.print("Setpoint"); lcd.setCursor(0, 1); lcd.print(":"); lcd.setCursor(1, 1); lcd.print(humidity_setpoint); setpoint_setting_timing = millis(); // "Обнуляем" отсчет времени } else { if ( !homescreen_template_flag && setpoint_setting_flag){ // Если домашний экран погашен и активен экран настроек, начинаем прибавлять уставку if ( sign ) { humidity_setpoint += 0.5; } else { humidity_setpoint -= 0.5; } lcd.setCursor(1, 1); lcd.print(humidity_setpoint); setpoint_setting_timing = millis(); // "Обнуляем" отсчет времени } } } void hysteresisFan(float setPoint, float hysteresis, float inputValue, uint8_t pinOutput) { // Функция простенького гистерезиса. Если inputValue > setPoint + hysteresis, то pinOutput ставим в HIGH, if ( inputValue > (setPoint + hysteresis) ) { // если inputValue < setPoint - hysteresis, то pinOutput ставим в LOW digitalWrite(pinOutput, HIGH); } else { if ( inputValue < (setPoint - hysteresis) ) { digitalWrite(pinOutput, LOW); } } }
f92fc83127c02d3e6821d2ff3eb457f05b3557d5
f4ad4581cffee0416b1dee2624467673337f6135
/src/competitorCategoryResultEditU.h
ba7c0f116ee09a43c2c0a260f52b4ad54206fe99
[]
no_license
agoffer/secretary
76fba58e33e39f4ba784590c7779d69f2be29ded
0c24719741f7796ae8231d1452c81466b7620ad2
refs/heads/master
2020-05-19T11:53:56.836823
2018-02-15T18:22:50
2018-02-15T18:22:50
6,301,848
0
0
null
null
null
null
WINDOWS-1251
C++
false
false
4,846
h
competitorCategoryResultEditU.h
//--------------------------------------------------------------------------- #ifndef competitorCategoryResultEditUH #define competitorCategoryResultEditUH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms.hpp> #include <dbcgrids.hpp> #include <DBGrids.hpp> #include <Grids.hpp> #include <Buttons.hpp> #include <map.h> #include "categoryCtrl.h" #include <DBCtrls.hpp> //--------------------------------------------------------------------------- class TfrmCompetitorCategoryResultEdit : public TForm { __published: // IDE-managed Components TGroupBox *grboxCompetitorSelection; TDBGrid *dbgrdCompetitors; TGroupBox *grboxSelectCategory; TLabel *lblAvailCategoryFirst; TLabel *lblFightVersionFirst; TComboBox *cmboxAvailCategory; TComboBox *cmboxFightVersion; TCheckBox *chboxFemaleCategory; TComboBox *cmboxFightWOKnifeRank; TComboBox *cmboxFightWKnifeRank; TBitBtn *bbtnClose; TLabel *lblFightWKnifeRank; TLabel *lblFightWOKnifeRank; TBitBtn *bbtnEnterResult; TLabel *lblModifiedShootRank; TGroupBox *grboxCompetitorResult; TDBText *dbtxtSurname; TDBText *dbtxtName; TDBText *dbtxtClubName; TLabel *lblShootRank; TComboBox *cmboxShootRank; TComboBox *cmboxCommonRank; TLabel *lblCommonRank; TBitBtn *bbtnAutoCalculateCommonRank; TBitBtn *bbtnAtoCalculateShootRank; TLabel *lblModifiedFightWOKnifeRank; TLabel *lblModifiedFightWKnifeRank; TLabel *lblModifiedCommonRank; TStaticText *sttxtShootScore; TStaticText *sttxtFightWOKnifeScore; TStaticText *sttxtFightWKnifeScore; TStaticText *sttxtCommonScore; TBitBtn *bbtnPrintCurrentCategory; void __fastcall FormShow(TObject *Sender); void __fastcall changeCompetitorList(TObject *Sender); void __fastcall chboxFemaleCategoryClick(TObject *Sender); void __fastcall bbtnCloseClick(TObject *Sender); void __fastcall FormClose(TObject *Sender, TCloseAction &Action); void __fastcall bbtnEnterResultClick(TObject *Sender); void __fastcall cmboxFightWOKnifeRankChange(TObject *Sender); void __fastcall cmboxShootRankChange(TObject *Sender); void __fastcall cmboxFightWKnifeRankChange(TObject *Sender); void __fastcall cmboxCommonRankChange(TObject *Sender); void __fastcall bbtnAtoCalculateShootRankClick(TObject *Sender); void __fastcall bbtnAutoCalculateCommonRankClick(TObject *Sender); void __fastcall cmboxFightVersionChange(TObject *Sender); void __fastcall bbtnPrintCurrentCategoryClick(TObject *Sender); private: // User declarations //-- Инициализация формы, заполнение полей void InitFields(void); //-- Спрятать признак того, что результат изменился void HideResultChange(void); //-- Заполняет выпадающие списки определяющие категории void createCategories(TList *category); //-- Отобразить список участников в категории void ShowCompetitorList(TCategory* category); //-- Создать список мест для категории void createRankList(TComboBox *cmboxRank, int rankCount); //Расчитать результаты стрельбы void calculateShootRanks(TList* compList, int categoryId); void calculateCommonRanks(TList *compList, int categoryId); void showResultScores(void); void setCallback(void); void resetCallback(void); //-- Список индексов категориий по ключу (строка представляющая категорию) map<AnsiString, TCategory*> categoryIndex; //Текущий участник, для которого устанавливаем результат TCompetitor currentCompetitor; //Текущая, выбранная категория TCategory *currentCategory; //Текущий список участников с результатами TList *currentCompetitorList; //Признак того, что результаты изменялись bool resultModified; public: // User declarations __fastcall TfrmCompetitorCategoryResultEdit(TComponent* Owner); //Сменить участника, пересчитать места, сохранить установленные void changeCompetitor(void); }; //--------------------------------------------------------------------------- extern PACKAGE TfrmCompetitorCategoryResultEdit *frmCompetitorCategoryResultEdit; //--------------------------------------------------------------------------- void competitorToCategoryResultRecordMoveAction(void); #endif
875a53e92becf200d56653384b51b95c5520382a
0df0ad2215e548e5eeed1b2e6fbda9fde4c15116
/ReadRED/show_red.cxx
d6b99a6c955b70e71512762e24498b0b2b13b6d4
[]
no_license
SuperNEMO-DBD/Commissioning
2f3a37be7f42ffb3b6c3672a653fa7ef51e06865
c63dbe03df01e7a8b9d4250048c63b6a4b7065f6
refs/heads/master
2023-07-07T19:21:50.706075
2023-06-28T13:28:28
2023-06-28T13:28:28
253,787,170
0
0
null
2020-04-07T19:35:07
2020-04-07T12:32:00
CMake
UTF-8
C++
false
false
11,403
cxx
show_red.cxx
#include <cstdlib> #include <cstdio> #include <iostream> #include <string> #include <vector> #include <snfee/snfee.h> #include <snfee/io/multifile_data_reader.h> #include <sncabling/om_id.h> #include <sncabling/gg_cell_id.h> #include <sncabling/label.h> #include <snfee/data/raw_event_data.h> #include <snfee/data/calo_digitized_hit.h> #include <snfee/data/tracker_digitized_hit.h> #include "sndisplay-demonstrator.cc" // color codes for tracker hits in sndisplay const float anode_and_two_cathodes = 1; const float anode_and_one_cathode = 0.85; const float anode_and_no_cathode = 0.7; const float two_cathodes_only = 0.5; const float one_cathode_only = 0.2; int main (int argc, char *argv[]) { const char *red_path = getenv("RED_PATH"); int run_number = -1; int event_number = -1; int tracker_area = -1; int tracker_crate = -1; std::string input_filename = ""; for (int iarg=1; iarg<argc; ++iarg) { std::string arg (argv[iarg]); if (arg[0] == '-') { if (arg=="-i" || arg=="--input") input_filename = std::string(argv[++iarg]); else if (arg=="-r" || arg=="--run") run_number = atoi(argv[++iarg]); else if (arg=="-e" || arg=="--event") event_number = atoi(argv[++iarg]); else if (arg=="-a" || arg=="--tracker-area") { tracker_area = atoi(argv[++iarg]); if ((tracker_area < 0) || (tracker_area >=8)) { std::cerr << "*** wrong tracker commissioning area ([0-7])" << std::endl; tracker_area = -1; } } else if (arg=="-c" || arg=="--tracker-crate") { tracker_crate = atoi(argv[++iarg]); if ((tracker_crate < 0) || (tracker_crate >=3)) { std::cerr << "*** wrong tracker commissioning crate ([0-2])" << std::endl; tracker_crate = -1; } } else if (arg=="-h" || arg=="--help") { std::cout << std::endl; std::cout << "Usage: " << argv[0] << " [options]" << std::endl; std::cout << std::endl; std::cout << "Options: -h / --help" << std::endl; // std::cout << " -i / --input RED_FILE" << std::endl; std::cout << " -r / --run RUN_NUMBER" << std::endl; std::cout << " -r / --event EVENT_NUMBER" << std::endl; std::cout << std::endl; std::cout << " -a / --tracker-area [0-7]" << std::endl; std::cout << " -c / --tracker-crate [0-2]" << std::endl; std::cout << std::endl; return 0; } else std::cerr << "*** unkown option " << arg << std::endl; } } if (event_number == -1) { std::cerr << "*** missing event_number (-e/--event EVENT_NUMBER)" << std::endl; return 1; } if (input_filename.empty()) { if (run_number == -1) { std::cerr << "*** missing run_number (-r/--run RUN_NUMBER)" << std::endl; return 1; } char input_filename_buffer[128]; snprintf(input_filename_buffer, sizeof(input_filename_buffer), "%s/snemo_run-%d_red-v2.data.gz", red_path, run_number); input_filename = std::string(input_filename_buffer); } snfee::initialize(); /// Configuration for raw data reader snfee::io::multifile_data_reader::config_type reader_cfg; reader_cfg.filenames.push_back(input_filename); // Instantiate a reader std::cout << "Opening " << input_filename << " ..." << std::endl; snfee::io::multifile_data_reader red_source (reader_cfg); // Working RED object snfee::data::raw_event_data red; // RED counter std::size_t red_counter = 0; bool event_found = false; std::cout << "Searching for event " << event_number << " ..." << std::endl; while (red_source.has_record_tag()) { // Check the serialization tag of the next record: DT_THROW_IF(!red_source.record_tag_is(snfee::data::raw_event_data::SERIAL_TAG), std::logic_error, "Unexpected record tag '" << red_source.get_record_tag() << "'!"); // Load the next RED object: red_source.load(red); red_counter++; // Event number int32_t red_event_id = red.get_event_id(); if (event_number != red_event_id) continue; event_found = true; // Container of merged TriggerID(s) by event builder const std::set<int32_t> & red_trigger_ids = red.get_origin_trigger_ids(); sndisplay::demonstrator *demonstrator_display = new sndisplay::demonstrator ("Demonstrator"); demonstrator_display->setrange(0, 1); // scan calorimeter hits const std::vector<snfee::data::calo_digitized_hit> red_calo_hits = red.get_calo_hits(); printf("\n=> %zd CALO HIT(s) :\n", red_calo_hits.size()); for (const snfee::data::calo_digitized_hit & red_calo_hit : red_calo_hits) { const snfee::data::timestamp & reference_time = red_calo_hit.get_reference_time(); const int64_t calo_tdc = reference_time.get_ticks(); const double calo_adc2mv = 2500./4096.; const float calo_amplitude = red_calo_hit.get_fwmeas_peak_amplitude() * calo_adc2mv / 8.0; const sncabling::om_id om_id = red_calo_hit.get_om_id(); int om_side, om_wall, om_column, om_row, om_num; if (om_id.is_main()) { om_side = om_id.get_side(); om_column = om_id.get_column(); om_row = om_id.get_row(); om_num = om_side*20*13 + om_column*13 + om_row; printf("M:%d.%02d.%02d (OM %3d) TDC = %12ld Amplitude = %5.1f mV ", om_side, om_column, om_row, om_num, calo_tdc, -calo_amplitude); } else if (om_id.is_xwall()) { om_side = om_id.get_side(); om_wall = om_id.get_wall(); om_column = om_id.get_column(); om_row = om_id.get_row(); om_num = 520 + om_side*64 + om_wall*32 + om_column*16 + om_row; printf("X:%d.%d.%d.%02d (OM %3d) TDC = %12ld Amplitude = %5.1f mV ", om_side, om_wall, om_column, om_row, om_num, calo_tdc, -calo_amplitude); } else if (om_id.is_gveto()) { om_side = om_id.get_side(); om_wall = om_id.get_wall(); om_column = om_id.get_column(); om_num = 520 + 128 + om_side*32 + om_wall*16 + om_column; printf("G:%d.%d.%02d (OM %3d) TDC = %12ld Ampl = %5.1f mV ", om_side, om_wall, om_column, om_num, calo_tdc, -calo_amplitude); } printf("%s %s\n", red_calo_hit.is_high_threshold() ? "[HT]" : " ", red_calo_hit.is_low_threshold_only() ? "[LT]" : ""); if (red_calo_hit.is_high_threshold() || red_calo_hit.is_low_threshold_only()) demonstrator_display->setomcontent(om_num, 1); } // scan tracker hits const std::vector<snfee::data::tracker_digitized_hit> red_tracker_hits = red.get_tracker_hits(); printf("\n=> %zd TRACKER HIT(s) :\n", red_tracker_hits.size()); for (const snfee::data::tracker_digitized_hit & red_tracker_hit : red_tracker_hits) { const sncabling::gg_cell_id gg_id = red_tracker_hit.get_cell_id(); int cell_side = gg_id.get_side(); int cell_row = gg_id.get_row(); int cell_layer = gg_id.get_layer(); int cell_num = 113*9*cell_side + 9*cell_row + cell_layer; const std::vector<snfee::data::tracker_digitized_hit::gg_times> & gg_timestamps_v = red_tracker_hit.get_times(); bool has_anode = false; bool has_bottom_cathode = false; bool has_top_cathode = false; bool first_timestamp = true; for (const snfee::data::tracker_digitized_hit::gg_times & gg_timestamps : red_tracker_hit.get_times()) { if (first_timestamp) { printf("GG:%d.%03d.%1d", cell_side, cell_row, cell_layer); first_timestamp = false; } else printf(" "); for (int r=0; r<5; r++) { const snfee::data::timestamp anode_timestamp = gg_timestamps.get_anode_time(r); const int64_t anode_tdc = anode_timestamp.get_ticks(); if (anode_tdc != snfee::data::INVALID_TICKS) { printf(" R%d = %12lu", r, anode_tdc); if (r == 0) has_anode = true; } else printf(" "); } { const snfee::data::timestamp bottom_cathode_timestamp = gg_timestamps.get_bottom_cathode_time(); const int64_t bottom_cathode_tdc = bottom_cathode_timestamp.get_ticks(); if (bottom_cathode_tdc != snfee::data::INVALID_TICKS) { printf(" R5 = %12lu", bottom_cathode_tdc); has_bottom_cathode = true; } else printf(" "); } { const snfee::data::timestamp top_cathode_timestamp = gg_timestamps.get_top_cathode_time(); const int64_t top_cathode_tdc = top_cathode_timestamp.get_ticks(); if (top_cathode_tdc != snfee::data::INVALID_TICKS) { printf(" R6 = %12lu", top_cathode_tdc); has_top_cathode = true; } else printf(" "); } printf("\n"); if (has_anode) { if (has_bottom_cathode && has_top_cathode) demonstrator_display->setggcontent(cell_num, anode_and_two_cathodes); else if (has_bottom_cathode || has_top_cathode) demonstrator_display->setggcontent(cell_num, anode_and_one_cathode); else demonstrator_display->setggcontent(cell_num, anode_and_no_cathode); } else { if (has_bottom_cathode && has_top_cathode) demonstrator_display->setggcontent(cell_num, two_cathodes_only); else if (has_bottom_cathode || has_top_cathode) demonstrator_display->setggcontent(cell_num, one_cathode_only); } } // for (gg_timestamps) } // for (red_tracker_hit) printf("\n"); std::string title = Form("RUN %d // EVENT %d // TRIGGER ID ", run_number, event_number); bool first_trigger_id = true; for (const int32_t trigger_id : red_trigger_ids) { if (first_trigger_id) first_trigger_id = false; else title += "+"; title += Form("%d", trigger_id); } demonstrator_display->settitle(title.c_str()); demonstrator_display->draw_top(); if (tracker_area != -1) { // put in gray color unused cells int first_row = 14*tracker_area; if (tracker_area >= 4) first_row++; int last_row = first_row + 14; for (int cell_side=0; cell_side<2; ++cell_side) for (int cell_row=0; cell_row<113; ++cell_row) { if ((cell_row >= first_row) && (cell_row < last_row)) continue; for (int cell_layer=0; cell_layer<9; ++cell_layer) demonstrator_display->setggcolor(cell_side, cell_row, cell_layer, kGray+1); } demonstrator_display->update_canvas(); } else if (tracker_crate != -1) { // put in gray color unused cells const int crate_rows[4] = {0, 38, 75, 113}; int first_row = crate_rows[tracker_crate]; int last_row = crate_rows[tracker_crate+1]; for (int cell_side=0; cell_side<2; ++cell_side) for (int cell_row=0; cell_row<113; ++cell_row) { if ((cell_row >= first_row) && (cell_row < last_row)) continue; for (int cell_layer=0; cell_layer<9; ++cell_layer) demonstrator_display->setggcolor(cell_side, cell_row, cell_layer, kGray+1); } demonstrator_display->update_canvas(); } demonstrator_display->canvas->SaveAs(Form("run-%d_event-%d.png", run_number, event_number)); break; } // (while red_source.has_record_tag()) if (!event_found) std::cerr << "=> Event was not found ! (only " << red_counter << " RED in this file)" << std::endl; snfee::terminate(); return 0; }
b26b870d3f0266471baf6bc25092f5ddd68f85fb
26797ca0efc0e8dce976eecccb1fe9c042a75692
/PrivateProfile.h
396c933736c711d0d67f8ca141ff276dc0445f5a
[]
no_license
xken/ImgAnaForDS
57cf1275ce6840442093248810e9fefa4ce88765
f0b814fae6c833e9e4d38dc6949c8b0d23553ba8
refs/heads/master
2022-04-05T01:47:51.222840
2019-10-29T01:41:55
2019-10-29T01:41:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
594
h
PrivateProfile.h
#pragma once class CPrivateProfile { public: CPrivateProfile(void); CPrivateProfile(LPCTSTR pszPath); ~CPrivateProfile(void); private: CString m_strPath; public: void set_path(LPCTSTR path); int read_int(LPCTSTR section, LPCTSTR entry, int def_val); double read_dbl(LPCTSTR section, LPCTSTR entry, double def_val); LPCTSTR read_str(LPCTSTR section, LPCTSTR entry, LPCTSTR def_txt); void write_int(LPCTSTR section, LPCTSTR entry, int val); void write_dbl(LPCTSTR section, LPCTSTR entry, double val); void write_str(LPCTSTR section, LPCTSTR entry, LPCTSTR txt); };
6704f7135e96d9fcc8fb21634a674d8e6860c89f
5d12283434dc723419fb05ae5303060cc309b044
/second semester/oop/test2/test2/UI.cpp
755c63141aa67be11450e8f1079c6ec260b741be
[]
no_license
alexresiga/courses
8b33591660c887dcea3b6a850aaacf90e204a94d
c1124a848e100f97ca3589f2f7bacc3c8434c220
refs/heads/master
2020-04-06T07:40:31.042062
2019-05-12T23:58:38
2019-05-12T23:58:38
157,281,121
1
0
null
null
null
null
UTF-8
C++
false
false
1,394
cpp
UI.cpp
// // UI.cpp // test2 // // Created by Alex Resiga on 17/05/2018. // Copyright © 2018 Alex Resiga. All rights reserved. // #include "UI.hpp" #include <iostream> void UI::run() { while (true) { cout<<"\n\n1.add new car\n2.show all cars\n"; int cmd{0}; cout<<"Enter command: "; cin>>cmd; if (cmd==0) break; if (cmd == 1) { int d, aut=0; string f="", e; cout<<"enter number of doors "; cin>>d; cout<<"enter engine type "; cin.ignore(); getline(cin, e); if (e == "electric") { cout<<"enter autonomy: "; cin>>aut; cin.ignore(); }else{ cout<<"enter fuel type: "; cin>>f;} Car* car = this->ctrl.addCar(d, e, f, aut); cout<<car->toString(); } else if (cmd == 2) { for(auto c: this->ctrl.getAll()) { cout<<c->toString()<<"\n"; } } else if (cmd == 3) { int price; cout<<"enter price: "; cin>>price; cin.ignore(); string filename; getline(cin, filename); this->ctrl.writeToFile(filename, this->ctrl.getCars(price)); } } }
1a3938b795ef02720d16eca20571ef2c9e3524e3
c51d671c9b52803060f537d54a231039be4b667c
/proyecto_final/interfaz.cpp
1554eb0bc6500ebdc791c613c76f2b016ea64670
[]
no_license
juan-suarez/calculadora-grafica-en-c
d8338b1a1dd635115f4d0d01342d6dc27f581dae
9d7b9b4a50a7bde4f91ec46afd01fffe5629e219
refs/heads/main
2023-04-19T06:31:11.370965
2021-05-12T00:27:52
2021-05-12T00:27:52
366,183,764
0
0
null
null
null
null
ISO-8859-10
C++
false
false
14,410
cpp
interfaz.cpp
#include<stdio.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<unistd.h> #include<time.h> #include "final.cpp" time_t tiempoahora; struct tm *mitiempo= localtime(&tiempoahora); typedef struct //estructura para modulo de usuarios { char username[20] = " "; char password[20] = " "; }cliente; void guardar(char cadena[20],FILE* archivo){ int i=0; while(i<20){ if(cadena[i]==-1) i++; fputc(cadena[i],archivo); i++; } return; } void cambiarcontra(char usuario[20],char contra[20],FILE* archivo){ int j; char nueva[20]=" "; char valor; rewind(archivo); while(!feof(archivo)){ for(j=0;j<20;j++){ nueva[j]=fgetc(archivo); } if( strcmp(nueva,usuario)==0){ for(j=0;j<=20;j++){ valor=contra[j]-2; fputc(valor,archivo); printf("1\n"); } } } return ; } void borrarcontra(char usuario[20],FILE* archivo){ int i=0,est=0,tam; char nueva[20]; char valor; rewind(archivo); FILE* auxiliar = fopen ("auxiliar.txt","w"); while(!feof(archivo)&&est!=1){ for(i=0;i<20;i++){ nueva[i]=fgetc(archivo); } if( strcmp(nueva,usuario)==0){ fwrite(nueva,1,20,auxiliar); for(i=0;i<20;i++){ fgetc(archivo); } } else fwrite(nueva,1,20,auxiliar); } fclose(auxiliar); auxiliar = fopen ("auxiliar.txt","r"); fseek(auxiliar,0,SEEK_END); tam=ftell(auxiliar); fseek(auxiliar,0,SEEK_SET); fclose(archivo); archivo=fopen("datos.txt","w"); for(i=0;i<tam;i++){ valor=fgetc(auxiliar); fputc(valor,archivo); } return ; } int buscarusu(char cadena[20],FILE* archivo){ int i=0,est=0; char nueva[20]; rewind(archivo); while(!feof(archivo)&&est!=1){ for(i=0;i<20;i++){ nueva[i]=fgetc(archivo); } if( strcmp(nueva,cadena)==0) est=1; } return est; } void listar() { char caracter,caracter2; printf("ingrese el ususario: "); char usuario[20]=" "; char usuariosistema[20]=" "; FILE *archivo = fopen("historial.txt","r"); int a=0,b,combrobante=0,i=0; scanf("%s",&usuario); for(a=0;a<20;a++) { usuariosistema[a]=fgetc(archivo); } if(strcmp(usuario,usuariosistema)==0) { while(b!=10&&!feof(archivo)) { caracter=fgetc(archivo); printf("%c",caracter); } } while(!feof(archivo)) { caracter2=fgetc(archivo); if(caracter2==13) { fgetc(archivo); for(a=0;a<20;a++) { usuariosistema[a]=fgetc(archivo); } if(strcmp(usuario,usuariosistema)==0) { while(b!=13&&!feof(archivo)) { caracter=fgetc(archivo); printf("%c",caracter); } } } a=0; } fclose(archivo); return; } void final(){ char* ecuacion=(char*)malloc(sizeof(ecuacion)); char valor; char numero[5]=" "; char anio[4]=" "; char dia[3]=" "; char mes[2]=" "; char valr[2]=" "; int nn; float s=0,d1=0,d2=0; FILE* archivo=fopen("historial.txt","a+"); FILE* nuevo=fopen("numeracion.txt","r"); printf("por favor ingrese la ecuacion : "); scanf("%s",ecuacion); printf("datos del dominio-desde que valor de x quiere la grafica : "); scanf("%f",&d1); printf("datos del dominio-desde que valor de x quiere la grafica : "); scanf("%f",&d2); printf("ingrese la separacion de los puntos : "); scanf("%f",&s); itoa(mitiempo->tm_year+1950,anio,10); itoa(mitiempo->tm_mon+1,mes,10); itoa(mitiempo->tm_yday,dia,10); fputc(anio[0],archivo); fputc(anio[1],archivo); fputc(anio[2],archivo); fputc(anio[3],archivo); fputc('/',archivo); fputc(mes[0],archivo); fputc(mes[1],archivo); fputc('/',archivo); fputc(dia[0],archivo); fputc(dia[1],archivo); fputc(' ',archivo); for(int i=0;!feof(nuevo);i++){ valor=fgetc(nuevo); if(valor!=-1) fputc(valor,archivo); numero[i]=valor; } fclose(nuevo); nuevo=fopen("numeracion.txt","w"); nn=atoi(numero)+1; printf("%i , ",nn); itoa(nn,numero,10); printf("%s",numero); for(int i=0;i<strlen(numero);i++){ fputc(numero[i],nuevo); } system("pause"); fputc('.',archivo); for(int i=0;i<strlen(ecuacion);i++){ valor=ecuacion[i]; if(valor!=-1){ fputc(valor,archivo); } } itoa(d1,valr,10); fputc('/',archivo); fputc(valr[0],archivo); fputc('/',archivo); itoa(d2,valr,10); fputc(valr[0],archivo); fputc('/',archivo); itoa(s,valr,10); fputc(valr[0],archivo); fputc('\n',archivo); grafica(ecuacion,d1,d2,s); getch(); } void Eliminar(FILE* archivo,char usuario[20]){ int i=0,est=0,tam; char nueva[20]; char valor; rewind(archivo); FILE* auxiliar = fopen ("auxiliar.txt","w"); while(!feof(archivo)&&est!=1){ for(i=0;i<20;i++){ nueva[i]=fgetc(archivo); } if( strcmp(nueva,usuario)==0){ for(i=0;i<20;i++){ fgetc(archivo); } } else fwrite(nueva,1,20,auxiliar); } fclose(auxiliar); auxiliar = fopen ("auxiliar.txt","r"); fseek(auxiliar,0,SEEK_END); tam=ftell(auxiliar)-20; fseek(auxiliar,0,SEEK_SET); archivo=fopen("datos.txt","w"); for(i=0;i<tam;i++){ valor=fgetc(auxiliar); fputc(valor,archivo); } return ; } void encriptar(char cadena[20],FILE* archivo){ int i=0; while(i<20){ if(cadena[i]==-1) i++; fputc(cadena[i]-2,archivo); i++; } return; } void menu(char nombre[20])//funcion del menu root, hay que hacer listado de ingresos { FILE *archivo=fopen("historial.txt","a+"); FILE *nuevo=fopen("datos.txt","r+"); char contra[20]; int op=0;//variable disponible para la opcion system("cls");//borra lo que hay en pantalla printf("Aplicativo-Graficador-UTP\nMenu principal para usuario: %s\n\n",nombre); printf("0.salir del aplicativo\n"); printf("1.Crear nuevo grafico\n"); printf("2.Listar accesos \n"); printf("3.Cambiar password \n\n"); printf("opcion: "); scanf("%i",&op); if(op==1){ system("cls"); guardar(nombre,archivo); final(); } if(op==2){ system("cls"); char valor; printf("nombre aa/mm/dd n° f(x)\n"); FILE* historial=fopen("historial.txt","r"); while(!feof(historial)){ valor=fgetc(historial); printf("%c",valor); } } if(op==3){ system("cls"); printf("ingrese la nueva contraseņa: "); scanf("%s",&contra); borrarcontra(nombre,nuevo); cambiarcontra(nombre,contra,nuevo); printf("\n\n\t\t --su contraseņa ha sido cambiada con exito-- "); } // switch(op) //{ // case 0: exit(0);break; // case 1:graficadora();break; // case 2:system("cls");borrarGrafico();getchar();menu(nombre);break; // case 3:system("cls");listarUsuario(nombre);getchar();menu(nombre);break; // case 4:printf("4");break; //case 5:CambiarUsuario(nombre);break; //} } void menuRoot(char usuario[20])//funcion del menu root { FILE *archivo=fopen("usuarios.dat","r+"); int op=0;//variable disponible para la opcion system("cls");//borra lo que hay en pantalla printf("Aplicativo-Graficador-UTP\nMenu principal para usuario: root\n\n"); printf("0.salir del aplicativo\n"); printf("1.Crear nuevo usuario\n"); printf("2.Borrar usuario\n"); printf("3.Listar accesos todos los usuarios\n"); printf("4.Cambiar password del usuario root\n"); printf("5.Cambiar password de un usuario\n\n"); printf("opcion: "); scanf("%i",&op); if(op==0){ return ; } if(op==1){ cliente usua; char caracter; char comprobante[20]=" "; int i=0,la; FILE* dats = fopen("datos.txt","a+"); system("CLS"); printf("ingrese el nombre ususario: "); scanf("%s",&usua.username); printf("ingrese la contraseņa del usuario nuevo: "); caracter = _getch(); while (i < 10 && caracter != 13) { if (caracter != 8) { usua.password[i] = caracter; i++; printf("*"); } else { la= strlen(usua.password); /* Longitud actual */ if (la > 0) { printf("\b \b");//se devuelve dos campos usua.password[la - 1] = '\0'; i++; } } caracter = _getch(); } printf("\n valide la contraseņa : "); caracter = _getch(); i=0; while (i < 10 && caracter != 13) { if (caracter != 8) { comprobante[i] = caracter; i++; printf("*"); } else { la= strlen(comprobante); /* Longitud actual */ if (la > 0) { printf("\b \b");//se devuelve dos campos comprobante[la - 1] = '\0'; i++; } } caracter = _getch(); } if(strcmp(comprobante,usua.password)==0){ guardar(usua.username,dats); encriptar(usua.password,dats); fclose(dats); printf("\n\t--el usuario ha sido registrado con exito--"); sleep(3); system("CLS"); menuRoot(usuario); } else{ printf("\n\t\t--las contraseņas no son correctas--"); sleep(2); menuRoot(usuario); } } if(op==2){ char usuario[20]; FILE* dats = fopen("datos.txt","r"); system("cls"); printf("usuario que desea borrar: "); scanf("%s",&usuario); if(buscarusu(usuario,dats)==1) { Eliminar(dats,usuario); printf("\n --el usuario ha sido eliminado-- \n"); } else printf("\n --usuario no encontrado -- \n"); sleep(5); menuRoot(usuario); } if(op==3){ system("cls"); char valor; printf("nombre aa/mm/dd n° f(x)\n"); FILE* historial=fopen("historial.txt","r"); while(!feof(historial)){ valor=fgetc(historial); printf("%c",valor); } } if(op==4){ FILE* nuevo=fopen("historial.txt","r"); cliente usuar; system("cls"); printf("ingrese la nueva contraseņa: "); scanf("%s",&usuar.password); borrarcontra(usuario,nuevo); cambiarcontra(usuario,usuar.password,nuevo); printf("\n\n\t\t --su contraseņa ha sido cambiada con exito-- "); } if(op==5){ FILE* nuevo=fopen("historial.txt","r"); cliente usuar; system("cls"); printf("ingrese el usuario: "); scanf("%s",&usuar.username); printf("ingrese la nueva contraseņa: "); scanf("%s",&usuar.password); borrarcontra(usuar.username,nuevo); cambiarcontra(usuar.username,usuar.password,nuevo); printf("\n\n\t\t --su contraseņa ha sido cambiada con exito-- "); } // switch(op) //{ // case 0:exit(0);break; // case 1:CrearUsuario();break; // case 2:EliminarUsuario();break; // case 3:system("cls");printf("usuario: "); scanf("%s",&u);listarUsuario(u);getchar();menuRoot();break; // case 4:system("cls");listar();menuRoot();break; //case 5:printf("5");break; //case 6:CambiarRoot();break; //case 7:cambiarUsuario();break; //} return ; } void entrar(){ cliente usu; char comprobante[20]=" "; char caracter; int i=0,la=0; FILE* dats = fopen("datos.txt","a+"); printf("\t\t\t\t\t---APLICATIVO-GRAFICADORA-UTP---\n\n"); printf("ingrese el ususario: "); scanf("%s",&usu.username); printf("ingrese la contraseņa: "); caracter = _getch(); while (i < 10 && caracter != 13) { if (caracter != 8) { usu.password[i] = caracter; i++; printf("*"); } else { la= strlen(usu.password); /* Longitud actual */ if (la > 0) { printf("\b \b");//se devuelve dos campos usu.password[la - 1] = '\0'; i++; } } caracter = _getch(); } int tamanio=0; fseek(dats,0,SEEK_END); tamanio=ftell(dats); if(strcmp(usu.username,"root")==0){ if(tamanio==0){ printf("\n valide la contraseņa: "); caracter = _getch(); i=0; while (i < 10 && caracter != 13) { if (caracter != 8) { comprobante[i] = caracter; i++; printf("*"); } else { la= strlen(comprobante); /* Longitud actual */ if (la > 0) { printf("\b \b");//se devuelve dos campos comprobante[la - 1] = '\0'; i++; } } caracter = _getch(); } if(strcmp(comprobante,usu.password)==0){ guardar(usu.username,dats); encriptar(usu.password,dats); fclose(dats); printf("\n\t\t\t--se ha registrado con exito-- "); sleep(2); menuRoot(usu.username); } else{ printf("\n --las contraseņas no son iguales--\n"); sleep(2); system("cls"); entrar(); } } else{ char contra[20]=" "; fseek(dats,20,SEEK_SET); for(i=0;i<=20;i++){ caracter = fgetc(dats)+2; contra[i]=caracter; } if(strcmp(usu.password,contra)==0) menuRoot(usu.username); else{ printf("\n --contraseņa erronea-- \n\t\t\t"); sleep(2); system("CLS"); entrar(); } } } else{ if(buscarusu(usu.username,dats)==1){ char contra[20]=" "; for(i=0;i<=20;i++){ caracter = fgetc(dats)+2; contra[i]=caracter; } if(strcmp(usu.password,contra)==0) menu(usu.username); else{ printf("\n --contraseņa erronea-- "); sleep(2); system("cls"); entrar(); } } else{ printf("\n usuario no encontrado \n "); sleep(2); system("cls"); entrar(); } } } int main(){ printf("%d/%d/%d",(mitiempo->tm_year)+1950,mitiempo->tm_mon+1,mitiempo->tm_mday); entrar(); }
401da3758150c5b9589d6b3cda16861ef80602e4
17e62b549499c33f19c6a6ca7b007c3e9ac4ecfa
/Engine/Src/Camera.h
e53588a67289accb271356a91eac07a82b257661
[]
no_license
mathias234/3DGameCpp
04f8daf0015d2394b0af5cf8a607201b1e5454b7
995492460918fda8cb184edb20aaa70abd634d06
refs/heads/master
2021-04-03T05:03:23.550926
2019-05-09T20:07:56
2019-05-09T20:07:56
124,404,300
0
0
null
null
null
null
UTF-8
C++
false
false
219
h
Camera.h
#pragma once #include "Common.h" #include <GLFW/glfw3.h> class Camera { private: public: Camera(); ~Camera(); Vector3f Rotation; Vector3f Position; Matrix4f GetViewMatrix(); void Input(GLFWwindow* window); };
07d6784b59c0d47e656171d1a0d32cc8bfe62dfa
b1f4330eff7f24b62e584c77a53285aa16d03319
/src-hlr-service/base/dbWaitress.h
e8f645ff7e7f2707bb5adb157d2a73821aa5da43
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
permissive
andreaguarise/dgas
62ea27ea850b8b7d8ba5c5cf796bedee80fef35a
523a0f57e5a4f5dc74ec0985e78051cbca501ac2
refs/heads/master
2016-09-06T08:25:58.189796
2013-04-19T13:17:55
2013-04-19T13:17:55
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,481
h
dbWaitress.h
#ifndef dbWaitress_h #define dbWaitress_h #include <string> #include <vector> #include <fstream> #include <unistd.h> #include "glite/dgas/hlr-service/base/db.h" #include "glite/dgas/common/base/stringSplit.h" #include "glite/dgas/common/base/int2string.h" #include "glite/dgas/common/base/libdgas_log.h" #include "glite/dgas/common/base/dgas_config.h" #define HLRDB_LOCK_FILE "/tmp/dgas-hlrdb.lock" #define HLRDB_BUFF_FILE "/tmp/dgas-hlrdb.buff" #define DBW_MT_DEF_MONTHS 12 #define DBW_MT_MTFILE "/etc/dgas/dgas_hlr_mt.buff" #define E_DBW_OPENFILE 71 #define E_DBW_BADDEF 72 #define E_DBW_DBERR 73 #define E_DBW_DROPMTABLE 74 #define E_DBW_SELECT 75 #define E_DBW_WRITE 75 #define E_DBW_FILEMISMATCH 76 #define E_DBW_DBLOCKED 77 #define E_DBW_LINESMISMATCH 78 #define E_DBW_REMOVE_RECORDS 79 #define E_DBW_GETDATE 80 #define E_DBW_UNLINK 81 #define E_DBW_CREATE 82 #define E_DBW_DELETE 83 #define E_DBW_GETUDEF 84 #define E_DBW_RESTORE 85 #define E_DBW_READ 86 extern ofstream logStream; class database { public: database(){}; database(std::string _sqlServer, std::string _sqlUser, std::string _sqlPassword, std::string _sqlDbName, std::string _lockFile = HLRDB_LOCK_FILE ) { sqlServer = _sqlServer; sqlUser = _sqlUser; sqlPassword = _sqlPassword; sqlDbName = _sqlDbName; lockFile = _lockFile; hlr_log("database()", &logStream, 7); }; int lock(); int unlock(); bool locked(); std::string lockFile; std::string sqlServer; std::string sqlUser; std::string sqlPassword; std::string sqlDbName; }; class table { public: table(database& _DB, std::string _tableName) { tableName = _tableName; DB = _DB; hlr_log("table()", &logStream, 7); tableLock = "/tmp/dgas-" + tableName + ".lock"; }; std::string tableName; database DB; int rename(std::string newLabel); bool exists(); int write(std::string& whereClause,int& writtenLines ,std::string fileBuff = HLRDB_BUFF_FILE); int read(std::string& writeWhereClause,int& readLines ,std::string fileBuff = HLRDB_BUFF_FILE); int removeRecords(std::string& whereClause); int unlinkBuffer(std::string fileBuff = HLRDB_BUFF_FILE); int addIndex( std::string index, bool primary = false); int dropIndex(string index); bool checkIndex(string index); int disableKeys(); int enableKeys(); int drop(); int checkAgainst(string &fieldList); int lock(); int unlock(); string lockOwner(); bool locked(); std::string getTableLock() const; void setTableLock(std::string tableLock); protected: std::string tableLock; }; class recordsTables { public: recordsTables ( database& _DB, bool _is2ndLevelHlr, int _monthsNumber = 3 ) { DB = _DB; monthsNumber = _monthsNumber; is2ndLevelHlr = _is2ndLevelHlr; hlr_log("recordsTables()", &logStream, 7); }; database DB; int monthsNumber; bool is2ndLevelHlr; int createCurrentMonth(); int createPastMonths(); int dropAll(); int addIndex( std::string field, std::string indexName); }; int getYearMonth(database& DB,std::string& yearMonth,int i = 0); int execTranslationRules(database& DB, string& rulesFile); class mergeTables { public: mergeTables( database& _DB, std::string _defFile, bool _is2ndLevelHlr, std::string _mergeTablesFile = dgasLocation() + DBW_MT_MTFILE, int _months = DBW_MT_DEF_MONTHS) { DB = _DB; defFile = _defFile; mergeTablesFile = _mergeTablesFile; months = _months; reset = false; is2ndLevelHlr = _is2ndLevelHlr; hlr_log("mergeTables()", &logStream, 8); }; database DB; bool reset; std::vector<std::string> definitions; int exec();//entry point //drop all MyISAM tables: oldRecords,records_* int dropAll() { recordsTables t(DB,months); return t.dropAll(); }; //drops merge tables listed in mergeTablesFile int drop(); int getDef(); int addIndex( std::string field, std::string indexName ) { recordsTables t(DB,months); return t.addIndex(field,indexName); } private: std::string defFile; std::string mergeTablesFile; int months; bool is2ndLevelHlr; //create the MERGE tables from the definitions in *defFile* //previously created *MERGE* tables found in *megeTablesFile* are //expunged. int create(); //defFile -> definitions int readDefFile(); //(def) entry in definitions -> unionDef int produceSqlUnionDefinition(std::string& def, std::string& unionDef); //unionDef -> JTS with unionDef; int createMergeTable(std::string& mergeTableName, std::string& unionDef); //drops a merge table, assuring it is really a MRG_MyISAM table. int dropMergeTable(std::string& mergeTableName); //if reset and jobTransSummary is merge, restore original MyISAM //jobransSummary definition and contents. int restoreMyISAMJTS(); }; class JTS { public: JTS(database& _DB, std::string _jtsTableName, bool _is2ndLevelHlr, std::string _engine = "ENGINE=MyISAM") { tableDef = "CREATE TABLE " +_jtsTableName; tableDef += " (dgJobId varchar(160), "; tableDef += "date datetime, "; tableDef += "gridResource varchar(160), "; tableDef += "gridUser varchar(160), "; tableDef += "userFqan varchar(255), "; tableDef += "userVo varchar(160), "; tableDef += "cpuTime int(10) unsigned default 0, "; tableDef += "wallTime int(10) unsigned default 0, "; tableDef += "pmem int(10) unsigned default 0, "; tableDef += "vmem int(10) unsigned default 0, "; tableDef += "amount smallint(5) unsigned default 0, "; tableDef += "start int(10) unsigned default 0, "; tableDef += "end int(10) unsigned default 0, "; tableDef += "iBench mediumint(8) unsigned, ";//! 3.3.0 tableDef += "iBenchType varchar(16), "; //!3.3.0 tableDef += "fBench mediumint(8) unsigned, "; //!/3.3.0 tableDef += "fBenchType varchar(16), "; //!3.3.0 tableDef += "acl varchar(160), "; tableDef += "id bigint(20) unsigned auto_increment, ";//! tableDef += "lrmsId varchar(160), ";//! 3.1.3 tableDef += "localUserId varchar(32), ";//! 3.1.3 tableDef += "hlrGroup varchar(128), ";//! 3.1.3 tableDef += "localGroup varchar(160), ";//! 3.1.3 tableDef += "endDate datetime, ";//! 3.1.3 tableDef += "siteName varchar(160), ";//! 3.1.3 tableDef += "urSourceServer varchar(255), ";//! 3.1.3 tableDef += "hlrTid bigint(20) unsigned, ";//! 3.1.10 tableDef += "accountingProcedure varchar(32), ";//! 3.1.10 tableDef += "voOrigin varchar(16), ";//! 3.1.10 tableDef += "GlueCEInfoTotalCPUs smallint(5) unsigned default 1, ";//! 3.1.10 tableDef += "executingNodes varchar(255), ";//! 3.4.0 tableDef += "numNodes smallint(5) unsigned default 1, ";//! 4.0.0 tableDef += "uniqueChecksum char(32), ";//! 3.3.0 tableDef += "primary key (dgJobId,uniqueChecksum), key(date), key(endDate), key(userVo), key (id), key(siteName), key(urSourceServer)"; if ( !_is2ndLevelHlr ) { tableDef += " , key(lrmsId), key(hlrTid)"; } tableDef += ") "; tableDef += _engine; engine = _engine; is2ndLevelHlr = _is2ndLevelHlr; DB = _DB; hlr_log("JTS()", &logStream, 8); }; database DB; //CREATE *jtsTableName* SQL table with JTS schema and *engine* //it can be also used to create a JTS based merge using //*engine* something like ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST int create(); private: //gets the current create definition from the jobTransSummary table. //int getCurrentDef(); std::string tableDef; std::string engine; bool is2ndLevelHlr; }; struct hlrLogRecords { int wallTime; int cpuTime; string mem; string vMem; int cePriceTime; string userVo; string processors; string urCreation; string lrmsId; string localUserId; string jobName; string start; string end; string ctime; string qtime; string etime; string fqan; string iBench; string iBenchType; string fBench; string fBenchType; string ceId; string atmEngineVersion; string accountingProcedure; string localGroupId; string siteName;//in th elog seacrh for SiteName string hlrTid;//trans_{in,out} original tid. string voOrigin;//trans_{in,out} original tid. string glueCEInfoTotalCPUs; //number of CPUs available in the cluster. string executingNodes; //hostname of the executing nodes. string ceCertificateSubject; }; class JTSManager { public: JTSManager (database& _DB, std::string _jtsTableName = "jobTransSummary") { DB = _DB; jtsTableName = _jtsTableName; hlr_log("JTSManager()", &logStream, 7); }; database DB; string jtsTableName; int removeDuplicated ( string whereClause = ""); int parseTransLog (string logString, hlrLogRecords& records); private: }; #endif
964e5174933c0ebf59b250709b78047ea1efe3d6
3894c1c0a265dfa91e114ff4df12236454efdb2c
/LeetCode/iter1/c++/InsertDeleteGetRandomO(1).cpp
b81823c7a09b8a31ae0fbd361d8ed3b0386fe595
[]
no_license
jonathenzc/Algorithm
d770802337a8f4f36b94e42722d4d1954b45f408
f6b3d1a3f987dd3f38aa38c6de4b37caef0880bc
refs/heads/master
2020-04-04T00:16:38.780515
2020-03-12T16:10:43
2020-03-12T16:10:43
33,028,640
2
0
null
null
null
null
UTF-8
C++
false
false
2,262
cpp
InsertDeleteGetRandomO(1).cpp
#include <iostream> #include <vector> #include <unordered_map> #include <time.h> using namespace std; class RandomizedSet { public: /** Initialize your data structure here. */ RandomizedSet() { srand((int)time(0)); } /** Inserts a value to the set. Returns true if the set did not already contain the specified element. */ bool insert(int val) { bool insertRet = false; if (num_map.find(val) == num_map.end()) //未找到 { v.push_back(val); num_map[val] = v.size()-1; insertRet = true; } return insertRet; } /** Removes a value from the set. Returns true if the set contained the specified element. */ bool remove(int val) { bool removeRet = false; if (num_map.find(val) != num_map.end()) //找到 { //将容器顶部元素的下标调整成要删除的元素的下标 int numIndex = num_map[val]; num_map[v.back()] = numIndex; //从map中删除该元素 num_map.erase(val); //从容器中删除该元素 v[numIndex] = v.back(); v.pop_back(); removeRet = true; } return removeRet; } /** Get a random element from the set. */ int getRandom() { return v[rand() % v.size()]; } private: unordered_map<int, int> num_map; vector<int> v; }; int main() { // Init an empty set. RandomizedSet randomSet; // Inserts 1 to the set. Returns true as 1 was inserted successfully. if (randomSet.insert(1)) cout << "insert 1 Yes\n"; else cout << "insert 1 No\n"; // Returns false as 2 does not exist in the set. if (randomSet.remove(2)) cout << "remove 2 Yes\n"; else cout << "remove 2 No\n"; // Inserts 2 to the set, returns true. Set now contains [1,2]. if (randomSet.insert(2)) cout << "insert 2 Yes\n"; else cout << "insert 2 No\n"; // getRandom should return either 1 or 2 randomly. cout << "Random " << randomSet.getRandom() << endl; // Removes 1 from the set, returns true. Set now contains [2]. if (randomSet.remove(1)) cout << "remove 1 Yes\n"; else cout << "remove 1 No\n"; // 2 was already in the set, so return false. if (randomSet.insert(2)) cout << "insert 2 Yes\n"; else cout << "insert 2 No\n"; // Since 2 is the only number in the set, getRandom always return 2. cout << "Random "<<randomSet.getRandom() << endl; return 0; }
e9f9d64a75ec8e54f1872a3831c7f3bde73f13d2
42a8c3839e21c54bc169085732dba27b84029726
/chap8/chap8-1.1.cpp
9ab671943b19a3e532bb23ecf6a6fdd8b0c1650d
[]
no_license
whaom/Liang_Aha-Algorithms
5746854eef3f65098c5f6ab1d43045f58d7d697b
b13b5ee85bbd96f7765d2764ca2b62ea5031c6cd
refs/heads/master
2022-03-19T11:17:17.074558
2019-11-14T04:14:40
2019-11-14T04:14:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,850
cpp
chap8-1.1.cpp
#define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <stdio.h> #include <string.h> //图的最小生成树 /* 首先,按照边的权值进行从小到大排序, 每次从剩余的边中选择权值较小且边的两个顶点不在同一个集合内的边(就是不会产生回路的边) 加入到生成树中,直到加入了n-1条边为止 */ struct edge { int u; int v; int w; };//为了方便创建,这里创建了一个结构体来存储边的关系 struct edge e[10];//数组大小根据实际情况来设置,要比m的最大值大1 int n, m; int f[7] = { 0 }, sum = 0, count = 0;//并查集需要用到的一些变量 //f数组大小根据实际情况来设置,要比n的最大值大1 // void quicksort(int left, int right) { int i, j; struct edge t; if (left > right) { return; } i = left; j = right; while (i != j) { //顺序很重要,要先从右边开始找 while (e[j].w >= e[left].w && i < j) { j--; } //再从左边开始找 while (e[i].w <= e[left].w && i < j) { i++; } //交换 if (i < j) { t = e[i]; e[i] = e[j]; e[j] = t; } } //最终将基准数归位,将left和i互换 t = e[left]; e[left] = e[i]; e[i] = t; //继续处理左边的,这里是一个递归的过程 quicksort(left, i - 1); quicksort(i + 1, right);//继续处理右边的,这里是一个递归的过程 return; } //并查集寻找祖先的函数 int getf(int v) { if (f[v] == v) { return v; } else { //这里是路径压缩 f[v] = getf(f[v]);//找它的父节点 return f[v]; } } //并查集合并两子集合的函数 int merge(int v, int u) { int t1, t2; t1 = getf(v); t2 = getf(u); //判断两个点是否在同一个集合中 if (t1 != t2) { f[t2] = t1; return 1; } return 0; } //请从此处开始阅读程序,从主函数开始阅读程序是一个好习惯 int main() { int i; //读入n和m,n表示顶点个数,m表示边的条数 scanf("%d %d", &n, &m); //读入边,这里用一个结构体来存储边的关系 for (i = 1; i <= m; i++) { scanf("%d %d %d", &e[i].u, &e[i].v, &e[i].w); } quicksort(1, m);// 按照权值从小到大金星快速排序 //并查集初始化 for (i = 1; i <= n; i++) { f[i] = i; } //Kruskal算法核心部分 //开始从小到大枚举每一条边 for (i = 1; i <= m; i++) { //判断一条边的两个顶点是否已经连通,即判断是否已在同一个集合中 //如果目前尚未连通,则选用这条边 if (merge(e[i].u, e[i].v)) { count++; sum = sum + e[i].w; } //直到选用了n-1条边之后退出循环 if (n - 1 == count) { break; } }//end for //打印结果 printf("sum=%d", sum); printf("\r\n"); system("pause"); return 0; } /* 6 9 2 4 11 3 5 13 4 6 3 5 6 4 2 3 6 4 5 7 1 2 1 3 4 9 1 3 2 */
7d10e4e3545128c75d0a6955593557436dd68625
d96ebf4dac46404a46253afba5ba5fc985d5f6fc
/gfx/skia/skia/src/effects/SkHighContrastFilter.cpp
3e93bb0119dede2e33e68a255da7dd21ad92967c
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
marco-c/gecko-dev-wordified-and-comments-removed
f9de100d716661bd67a3e7e3d4578df48c87733d
74cb3d31740be3ea5aba5cb7b3f91244977ea350
refs/heads/master
2023-08-04T23:19:13.836981
2023-08-01T00:33:54
2023-08-01T00:33:54
211,297,165
1
0
null
null
null
null
UTF-8
C++
false
false
2,856
cpp
SkHighContrastFilter.cpp
# include " include / effects / SkHighContrastFilter . h " # include " include / core / SkColorFilter . h " # include " include / core / SkRefCnt . h " # include " include / core / SkTypes . h " # ifdef SK_ENABLE_SKSL # include " include / core / SkAlphaType . h " # include " include / core / SkColorSpace . h " # include " include / core / SkData . h " # include " include / core / SkString . h " # include " include / effects / SkRuntimeEffect . h " # include " include / private / base / SkTPin . h " # include " modules / skcms / skcms . h " # include " src / core / SkColorFilterPriv . h " # include " src / core / SkRuntimeEffectPriv . h " # include < cfloat > sk_sp < SkColorFilter > SkHighContrastFilter : : Make ( const SkHighContrastConfig & config ) { if ( ! config . isValid ( ) ) { return nullptr ; } struct Uniforms { float grayscale invertStyle contrast ; } ; static constexpr char kHighContrastFilterCode [ ] = " uniform half grayscale invertStyle contrast ; " " half3 rgb_to_hsl ( half3 c ) { " " half mx = max ( max ( c . r c . g ) c . b ) " " mn = min ( min ( c . r c . g ) c . b ) " " d = mx - mn " " invd = 1 . 0 / d " " g_lt_b = c . g < c . b ? 6 . 0 : 0 . 0 ; " " half h = ( 1 / 6 . 0 ) * ( mx = = mn ? 0 . 0 : " " c . r > = c . g & & c . r > = c . b ? invd * ( c . g - c . b ) + g_lt_b : " " c . g > = c . b ? invd * ( c . b - c . r ) + 2 . 0 " " : invd * ( c . r - c . g ) + 4 . 0 ) ; " " half sum = mx + mn " " l = sum * 0 . 5 " " s = mx = = mn ? 0 . 0 " " : d / ( l > 0 . 5 ? 2 . 0 - sum : sum ) ; " " return half3 ( h s l ) ; " " } " " half4 main ( half4 inColor ) { " " half4 c = inColor ; " " if ( grayscale = = 1 ) { " " c . rgb = dot ( half3 ( 0 . 2126 0 . 7152 0 . 0722 ) c . rgb ) . rrr ; " " } " " if ( invertStyle = = 1 ) { " " c . rgb = 1 - c . rgb ; " " } else if ( invertStyle = = 2 ) { " " c . rgb = rgb_to_hsl ( c . rgb ) ; " " c . b = 1 - c . b ; " " c . rgb = hsl_to_rgb ( c . rgb ) ; " " } " " c . rgb = mix ( half3 ( 0 . 5 ) c . rgb contrast ) ; " " return half4 ( saturate ( c . rgb ) c . a ) ; " " } " ; static const SkRuntimeEffect * effect = SkMakeCachedRuntimeEffect ( SkRuntimeEffect : : MakeForColorFilter SkString ( kHighContrastFilterCode ) ) . release ( ) ; SkASSERT ( effect ) ; float c = SkTPin ( config . fContrast - 1 . 0f + FLT_EPSILON + 1 . 0f - FLT_EPSILON ) ; Uniforms uniforms = { config . fGrayscale ? 1 . 0f : 0 . 0f ( float ) config . fInvertStyle ( 1 + c ) / ( 1 - c ) } ; skcms_TransferFunction linear = SkNamedTransferFn : : kLinear ; SkAlphaType unpremul = kUnpremul_SkAlphaType ; return SkColorFilterPriv : : WithWorkingFormat ( effect - > makeColorFilter ( SkData : : MakeWithCopy ( & uniforms sizeof ( uniforms ) ) ) & linear nullptr & unpremul ) ; } # else sk_sp < SkColorFilter > SkHighContrastFilter : : Make ( const SkHighContrastConfig & config ) { return nullptr ; } # endif
f8f52945fa53c8222e46a0ff32b6f4d01881745d
5d071b1aee999038b2ee4d491c6590085506378f
/Data Structure and Algorithm/LeetCode/before21April/Letter Case Permutation.cpp
64a64e1c6bb935db1392a97ae4d6602e718a4058
[]
no_license
seock04/Uncertainty-Handler
78361056f8bbf505d8fd137a71534d71d447b8d2
981cb829ab3a7390e587548cc1eaee0027a7bd01
refs/heads/master
2023-09-01T06:29:33.853000
2023-08-29T08:01:08
2023-08-29T08:01:08
228,979,686
4
2
null
2020-11-05T11:45:07
2019-12-19T05:11:30
C++
UTF-8
C++
false
false
1,613
cpp
Letter Case Permutation.cpp
///////////////////using bit operation //////////////////////// class Solution { public: vector<string> letterCasePermutation(string S) { int count_alpha = 0; for(char c : S){ count_alpha += (isalpha(c) > 0); } vector<string> result; for(int mask=0; mask < (1<<count_alpha); mask++){ string s; int i = 0; for(char c : S){ if(isalpha(c) == 0){ s.push_back(c); } else{ s.push_back((mask & (1 << i))? toupper(c) : tolower(c)); i++; } } result.push_back(s); } return result; } }; ////////////// using backtracking /////////////////////////// class Solution { public: vector<string> letterCasePermutation(string S) { vector<string> result; string s; permute(S, 0, s, result); return result; } void permute(string S, int index, string & s, vector<string> & res) { if(index >= S.length()){ res.push_back(s); return; } char c = S[index]; if(isalpha(c)){ char cl = tolower(c); string lower = s + cl; char cu = toupper(c); string upper = s + cu; permute(S, index+1, lower, res); permute(S, index+1, upper, res); } else{ s+=c; permute(S, index + 1, s, res); } } };
334955c520f3fbad0834c2744a2d95dde31385d8
16be3a6fec1050d9fb71919c7fa2e77c9d2b0ab4
/DDProject/Client/Codes/Stage2_SkyBall.cpp
6cc1b2efe6440c11c416ddb3382752db4eb86355
[]
no_license
beckchul/Jusin3DTeamProject
3c5c7fd14d8309b57eaf79d20584ae24774a2cd6
f28fa0316911b19187b276da3e5e6055fed9953c
refs/heads/master
2021-04-20T20:48:45.439327
2020-03-24T13:28:39
2020-03-24T13:28:39
249,716,053
1
0
null
null
null
null
UHC
C++
false
false
3,447
cpp
Stage2_SkyBall.cpp
#include "stdafx.h" #include "Stage2_SkyBall.h" #include "Renderer.h" #include "DataManager.h" #include "TextureManager.h" USING(Engine) CStage2_SkyBall::CStage2_SkyBall(LPDIRECT3DDEVICE9 pGraphicDev) : CStaticObject(pGraphicDev) , m_fTime(0.f) { } CStage2_SkyBall::~CStage2_SkyBall() { } HRESULT CStage2_SkyBall::Ready_GameObject(void) { if (FAILED(Engine::CGameObject::Ready_GameObject())) return E_FAIL; if (FAILED(Add_Component())) return E_FAIL; m_pTransformCom->Set_Information(CTransform::INFO_POSITION, &(_vec3(0.f, 0.f, 0.f))); m_pTransformCom->Set_Information(CTransform::INFO_SCALE, &(_vec3(100.f, 100.f, 100.f))); if (FAILED(D3DXCreateTextureFromFile(m_pGraphicDev, L"../Resources/Texture/GlobalTexture/CloudMask0.tga", &m_pTexture))) MSG_BOX(L"SkyBall Texture initialize Failed"); //m_fTime = RandFloat; return NOERROR; } int CStage2_SkyBall::FirstUpdate_GameObject(const float & fTimeDelta) { return 0; } int CStage2_SkyBall::Update_GameObject(const float & fTimeDelta) { // 뷰행렬(카메라 월드행렬의 역행렬)을 얻어온다. _matrix matView; m_pGraphicDev->GetTransform(D3DTS_VIEW, &matView); D3DXMatrixInverse(&matView, 0, &matView); // 카메라의 월드행렬 m_pTransformCom->Set_Information(Engine::CTransform::INFO_POSITION, (_vec3*)&matView.m[3][0]); Engine::CGameObject::Update_GameObject(fTimeDelta); m_pTransformCom->Rotation(Engine::CTransform::ANGLE_Y, fTimeDelta * 0.1f); if (nullptr != m_pRendererCom) { m_pRendererCom->Add_RenderList(Engine::CRenderer::RENDER_ALPHA, this); } return 0; } void CStage2_SkyBall::Render_GameObject(LPD3DXEFFECT pArgEffect, _uint uPassIdx) { LPD3DXEFFECT pEffect = m_pShaderCom->Get_EffectHandle(); if (nullptr == pEffect) return; pEffect->AddRef(); if (FAILED(Set_ConstantTable(pEffect))) return; pEffect->Begin(nullptr, 0); m_pStaticMeshCom->Render_Mesh_Effect(pEffect, 1); pEffect->End(); Safe_Release(pEffect); } HRESULT CStage2_SkyBall::Add_Component(void) { Engine::CComponent* pComponent = nullptr; // For.Renderer AddComponent(m_pRendererCom, Engine::CRenderer*, SCENE_STATIC, L"Com_Renderer", Engine::CComponent::COM_STATIC, L"Com_Render"); // For.Transform AddComponent(m_pTransformCom, Engine::CTransform*, SCENE_STATIC, L"Com_Transform", Engine::CComponent::COM_DYNAMIC, L"Com_Transform"); // For.Mesh AddComponent(m_pStaticMeshCom, Engine::CStaticMesh*, SCENE_STAGE2, L"Com_Mesh_SkyBoxBall", Engine::CComponent::COM_STATIC, L"Com_Mesh"); // For.Shader AddComponent(m_pShaderCom, Engine::CShader*, SCENE_STATIC, L"Com_Shader_SkyBox", Engine::CComponent::COM_STATIC, L"Com_Shader"); return NOERROR; } HRESULT CStage2_SkyBall::Set_ConstantTable(LPD3DXEFFECT pEffect) { if (nullptr == pEffect) return E_FAIL; _matrix matView, matProj; m_pGraphicDev->GetTransform(D3DTS_VIEW, &matView); m_pGraphicDev->GetTransform(D3DTS_PROJECTION, &matProj); m_pTransformCom->SetUp_OnShader(pEffect, "g_matWorldViewProj", matView, matProj); pEffect->SetTexture("g_CloudMaskTexture", m_pTexture); return NOERROR; } CStage2_SkyBall * CStage2_SkyBall::Create(LPDIRECT3DDEVICE9 pGraphicDev) { CStage2_SkyBall* pInstance = new CStage2_SkyBall(pGraphicDev); if (FAILED(pInstance->Ready_GameObject())) { MessageBox(0, L"CStage2_SkyBall Created Failed", nullptr, MB_OK); pInstance->Release(); } return pInstance; } void CStage2_SkyBall::Free(void) { CStaticObject::Free(); }
5886cd9fb99ad29f0bbc3fb20a8f9cabd313ddcd
bf1c7016681b5b7c6569a5f20d037e9c5db37854
/II_semester/oop_1/U4/DigitalFile.h
61083e6d8a7f000d431b2fc47b3fe91f3b1be568
[ "Beerware" ]
permissive
dainiusjocas/labs
ae62d4672f4c43d27b4e9d23e126fa9fb9cf58a9
25aa0ae2032681dbaf0afd83f3d80bedddea6407
refs/heads/master
2021-01-23T23:03:10.271749
2011-12-13T15:38:48
2011-12-13T15:38:48
6,511,648
1
0
null
null
null
null
UTF-8
C++
false
false
478
h
DigitalFile.h
#ifndef DIGITALFILECLASS #define DIGITALFILECLASS /* Abstrakti klase : nera implementacijos, nera data member'iu */ class DigitalFile { public: DigitalFile(){}; virtual ~DigitalFile(){}; virtual void display() = 0; //spaudinti duomenis i console virtual void editDataFromConsole() = 0; //redaguoti duomenis pagal pageidavima virtual void fillDataFromConsole() = 0; //uzpildyti visus objekto duomenu laukus }; #endif
443618a6b4897990453bb13a5622898c6553b064
087e6c9cfb46ac72ec4347dcfbcfe1d1a7018b9f
/AutonomousTwoWheel/AutonomousTwoWheel.ino
95466dd0ae8bd4bb0f8c6957ac42800ded89d7ff
[]
no_license
rdockstader/Arduino
af4ddbbd9dfe9f3999056ab1903f74c7b8879381
0f7dceb1cad92273a31cd86d2e8047d8be22a7b7
refs/heads/master
2021-01-10T05:03:29.412530
2015-12-25T06:12:52
2015-12-25T06:12:52
46,595,297
0
0
null
null
null
null
UTF-8
C++
false
false
6,888
ino
AutonomousTwoWheel.ino
//Toggle Debug Mode (disables motors, and insteads outputs direction, etc. to the the serial monitor). bool debugMode = true; //True turns on debugMode, false disable debugMode, and will run the motors. //AFMotor.h will need to be downloaded. Instructions/Link to download @ https://learn.adafruit.com/adafruit-motor-shield/library-install #include <AFMotor.h> #include <Servo.h> //ping const int trigPin = 19; const int echoPin = 18; long duration, inches; int checkDistance = 6; //adjusting this int will adjust the distance the ping sensor will check before stopping the car. //Servo Servo servo1; //Dc Motors (using the AFMotor library from adafruit) AF_DCMotor leftMotor(4); AF_DCMotor rightMotor(3); int curSpeed = 255; const int maxSpeed = 255; const int minSpeed = 0; int beginDelay = 5; //delay in seconds prior to starting loop. void setup() { //DC Motors if(debugMode == false) { leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); } //servo servo1.attach(10); //ping pinMode(echoPin, INPUT); pinMode(trigPin, OUTPUT); if(debugMode == true) { Serial.begin(9600); Serial.println("Serial begin ----- Debug Mode Enabled"); } //pause for x seconds before begining loop if(debugMode == false) { delay(beginDelay*1000); } } void loop() { //uncomment to test motors //motorTest(); //uncomment to run without servo usage //basicCarMovement(); //uncomment to run with servo usage advancedCarMovement(); } //Car Movements void motorTest() { leftMotor.run(FORWARD); rightMotor.run(FORWARD); delay(5000); leftMotor.run(RELEASE); rightMotor.run(RELEASE); delay(3000); leftMotor.run(BACKWARD); rightMotor.run(BACKWARD); delay(5000); leftMotor.run(RELEASE); rightMotor.run(RELEASE); delay(3000); } void basicCarMovement() { ping(); if(inches <= 12) { carStop(); delay(1000); turnLeft(); } else { moveForward(); } } void advancedCarMovement() { if(canGoForward()) { moveForward(); } else { carStop(); if(canGoLeft()) { turnLeft(); } else if(canGoRight()) { turnRight(); } else { moveBackward(); delay(2000); carStop(); if(canGoLeft()) { turnLeft(); } else { turnRight(); } } } } //ping functions void ping() { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); inches = microsecondsToInches(duration); } long microsecondsToInches(long microseconds) { return microseconds / 74 / 2; } bool pingCheck() { ping(); if(inches >= checkDistance) //set in global variables at the top of file { return true; } else { return false; } } bool canGoForward() { bool goForward = false; //if(servo1.read() != 90) //{ // servo1.write(90); //} delay(100); goForward = pingCheck(); return goForward; } bool canGoLeft() { bool goLeft = false; servo1.write(180); delay(1000); goLeft = pingCheck(); servo1.write(90); return goLeft; } bool canGoRight() { bool goRight = false; servo1.write(0); delay(1000); goRight = pingCheck(); servo1.write(90); return goRight; } //basic car functions void moveForward() { if(debugMode == true) { Serial.println("Move Forward"); } else { leftMotor.run(FORWARD); rightMotor.run(FORWARD); } } void moveBackward() { if(debugMode == true) { Serial.println("Move Backward"); } else { leftMotor.run(BACKWARD); rightMotor.run(BACKWARD); } } void carStop() { if(debugMode == true) { Serial.println("Car Stop"); } leftMotor.run(RELEASE); rightMotor.run(RELEASE); } void setCurSpeed(int sp) { if(sp > maxSpeed) { curSpeed = maxSpeed; } else if(sp < minSpeed) { curSpeed = minSpeed; } else { curSpeed = sp; } if(debugMode == true) { Serial.print("Set Speed to: "); Serial.println(curSpeed); } else { leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } //left Turns void turnLeft() { if(debugMode == true) { Serial.println("Turn Left"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(BACKWARD); rightMotor.run(FORWARD); delay(200); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } void turnLeft180() { if(debugMode == true) { Serial.println("Turl Left 180"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(BACKWARD); rightMotor.run(FORWARD); delay(400); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } void turnLeft360() { if(debugMode == true) { Serial.println("Turn Left 360"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(BACKWARD); rightMotor.run(FORWARD); delay(800); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } //right turns void turnRight() { if(debugMode == true) { Serial.println("Turn Right"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(FORWARD); rightMotor.run(BACKWARD); delay(200); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } void turnRight180() { if(debugMode == true) { Serial.println("Turn Right 180"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(FORWARD); rightMotor.run(BACKWARD); delay(400); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } } void turnRight360() { if(debugMode == true) { Serial.println("Turn Right 360"); } else { leftMotor.setSpeed(maxSpeed); rightMotor.setSpeed(maxSpeed); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.run(FORWARD); rightMotor.run(BACKWARD); delay(800); leftMotor.run(RELEASE); rightMotor.run(RELEASE); leftMotor.setSpeed(curSpeed); rightMotor.setSpeed(curSpeed); } }
24f627be2b9d9101a8d990fc5e37553291c82179
00add89b1c9712db1a29a73f34864854a7738686
/packages/utility/distribution/src/Utility_HistogramDistribution.hpp
9dc27d879cec53b52ffeac16876bb2d8ca094b77
[ "BSD-3-Clause" ]
permissive
FRENSIE/FRENSIE
a4f533faa02e456ec641815886bc530a53f525f9
1735b1c8841f23d415a4998743515c56f980f654
refs/heads/master
2021-11-19T02:37:26.311426
2021-09-08T11:51:24
2021-09-08T11:51:24
7,826,404
11
6
NOASSERTION
2021-09-08T11:51:25
2013-01-25T19:03:09
C++
UTF-8
C++
false
false
11,523
hpp
Utility_HistogramDistribution.hpp
//---------------------------------------------------------------------------// //! //! \file Utility_HistogramDistribution.hpp //! \author Alex Robinson //! \brief Histogram distribution class declaration. //! //---------------------------------------------------------------------------// #ifndef UTILITY_HISTOGRAM_DISTRIBUTION_HPP #define UTILITY_HISTOGRAM_DISTRIBUTION_HPP // FRENSIE Includes #include "Utility_TabularUnivariateDistribution.hpp" #include "Utility_ArrayView.hpp" #include "Utility_Vector.hpp" #include "Utility_Tuple.hpp" namespace Utility{ /*! The unit-aware histogram distribution class * \ingroup univariate_distributions */ template<typename IndependentUnit, typename DependentUnit> class UnitAwareHistogramDistribution : public UnitAwareTabularUnivariateDistribution<IndependentUnit,DependentUnit> { // Typedef for base type typedef UnitAwareTabularUnivariateDistribution<IndependentUnit,DependentUnit> BaseType; // The unnormalized cdf quantity typedef typename QuantityTraits<typename BaseType::DistNormQuantity>::template GetQuantityToPowerType<-1>::type UnnormCDFQuantity; // The distribution normalization quantity type typedef typename BaseType::DistNormQuantity DistNormQuantity; // Typedef for QuantityTraits<double> typedef QuantityTraits<double> QT; // Typedef for QuantityTraits<IndepQuantity> typedef QuantityTraits<typename UnitAwareUnivariateDistribution<IndependentUnit,DependentUnit>::IndepQuantity> IQT; // Typedef for QuantityTraits<InverseIndepQuantity> typedef QuantityTraits<typename UnitAwareUnivariateDistribution<IndependentUnit,DependentUnit>::InverseIndepQuantity> IIQT; // Typedef for QuantityTraits<DepQuantity> typedef QuantityTraits<typename UnitAwareUnivariateDistribution<IndependentUnit,DependentUnit>::DepQuantity> DQT; // Typedef for QuantityTraits<DistNormQuantity> typedef QuantityTraits<DistNormQuantity> DNQT; public: //! This distribution type typedef UnitAwareHistogramDistribution<IndependentUnit,DependentUnit> ThisType; //! The independent quantity type typedef typename BaseType::IndepQuantity IndepQuantity; //! The inverse independent quantity type typedef typename BaseType::InverseIndepQuantity InverseIndepQuantity; //! The dependent quantity type typedef typename BaseType::DepQuantity DepQuantity; //! Basic constructor (potentially dangerous) UnitAwareHistogramDistribution( const std::vector<double>& bin_boundaries = ThisType::getDefaultBinBoundaries<double>(), const std::vector<double>& bin_values = ThisType::getDefaultBinValues<double>(), const bool interpret_dependent_values_as_cdf = false ); // Basic view constructor UnitAwareHistogramDistribution( const Utility::ArrayView<const double>& bin_boundaries, const Utility::ArrayView<const double>& bin_values, const bool interpret_dependent_values_as_cdf = false ); //! CDF constructor template<typename InputIndepQuantity> UnitAwareHistogramDistribution( const std::vector<InputIndepQuantity>& bin_boundaries, const std::vector<double>& cdf_values ); //! CDF view constructor template<typename InputIndepQuantity> UnitAwareHistogramDistribution( const Utility::ArrayView<const InputIndepQuantity>& bin_boundaries, const Utility::ArrayView<const double>& cdf_values ); //! Constructor template<typename InputIndepQuantity, typename InputDepQuantity> UnitAwareHistogramDistribution( const std::vector<InputIndepQuantity>& bin_boundaries, const std::vector<InputDepQuantity>& bin_values ); //! View constructor template<typename InputIndepQuantity, typename InputDepQuantity> UnitAwareHistogramDistribution( const Utility::ArrayView<const InputIndepQuantity>& bin_boundaries, const Utility::ArrayView<const InputDepQuantity>& bin_values ); //! Copy constructor template<typename InputIndepUnit, typename InputDepUnit> UnitAwareHistogramDistribution( const UnitAwareHistogramDistribution<InputIndepUnit,InputDepUnit>& dist_instance ); //! Construct distribution from a unitless dist. (potentially dangerous) static UnitAwareHistogramDistribution fromUnitlessDistribution( const UnitAwareHistogramDistribution<void,void>& unitless_distribution ); //! Assignment operator UnitAwareHistogramDistribution& operator=( const UnitAwareHistogramDistribution& dist_instance ); //! Destructor ~UnitAwareHistogramDistribution() { /* ... */ } //! Evaluate the distribution DepQuantity evaluate( const IndepQuantity indep_var_value ) const override; //! Evaluate the PDF InverseIndepQuantity evaluatePDF( const IndepQuantity indep_var_value ) const override; //! Evaluate the CDF double evaluateCDF( const IndepQuantity indep_var_value ) const override; //! Return a random sample from the distribution IndepQuantity sample() const override; //! Return a random sample and record the number of trials IndepQuantity sampleAndRecordTrials( DistributionTraits::Counter& trials ) const override; //! Return a random sample and bin index from the distribution IndepQuantity sampleAndRecordBinIndex( size_t& sampled_bin_index ) const override; //! Return a random sample from the distribution at the given CDF value IndepQuantity sampleWithRandomNumber( const double random_number ) const override; //! Return a random sample from the corresponding CDF in a subrange IndepQuantity sampleInSubrange( const IndepQuantity max_indep_var ) const override; //! Return a sample from the distribution at the given CDF value in a subrange IndepQuantity sampleWithRandomNumberInSubrange( const double random_number, const IndepQuantity max_indep_var ) const override; //! Return the upper bound of the distribution independent variable IndepQuantity getUpperBoundOfIndepVar() const override; //! Return the lower bound of the distribution independent variable IndepQuantity getLowerBoundOfIndepVar() const override; //! Return the distribution type UnivariateDistributionType getDistributionType() const override; //! Test if the distribution is continuous bool isContinuous() const override; //! Method for placing the object in an output stream void toStream( std::ostream& os ) const override; //! Equality comparison operator bool operator==( const UnitAwareHistogramDistribution& other ) const; //! Inequality comparison operator bool operator!=( const UnitAwareHistogramDistribution& other ) const; protected: //! Copy constructor (copying from unitless distribution only) UnitAwareHistogramDistribution( const UnitAwareHistogramDistribution<void,void>& unitless_dist_instance, int ); //! Test if the dependent variable can be zero within the indep bounds bool canDepVarBeZeroInIndepBounds() const override; //! Get the default bin boundaries template<typename InputIndepQuantity> static std::vector<InputIndepQuantity> getDefaultBinBoundaries() { return std::vector<InputIndepQuantity>({Utility::QuantityTraits<InputIndepQuantity>::zero(),Utility::QuantityTraits<InputIndepQuantity>::one()}); } //! Get the default bin values template<typename InputDepQuantity> static std::vector<InputDepQuantity> getDefaultBinValues() { return std::vector<InputDepQuantity>({Utility::QuantityTraits<InputDepQuantity>::one()}); } private: // Initialize the distribution void initializeDistribution( const Utility::ArrayView<const double>& bin_boundaries, const Utility::ArrayView<const double>& bin_values, const bool interpret_dependent_values_as_cdf ); // Initialize the distribution from a cdf template<typename InputIndepQuantity> void initializeDistributionFromCDF( const Utility::ArrayView<const InputIndepQuantity>& bin_boundaries, const Utility::ArrayView<const double>& cdf_values ); // Initialize the distribution template<typename InputIndepQuantity, typename InputDepQuantity> void initializeDistribution( const Utility::ArrayView<const InputIndepQuantity>& bin_boundaries, const Utility::ArrayView<const InputDepQuantity>& bin_values ); // Reconstruct original distribution void reconstructOriginalDistribution( std::vector<IndepQuantity>& bin_boundaries, std::vector<DepQuantity>& bin_values ) const; // Reconstruct original distribution w/o units void reconstructOriginalUnitlessDistribution( std::vector<double>& bin_boundaries, std::vector<double>& bin_values ) const; // Convert the unitless values to the correct units template<typename Quantity> static void convertUnitlessValues( const Utility::ArrayView<const double>& unitless_values, std::vector<Quantity>& quantities ); // Return a random sample using the random number and record the bin index IndepQuantity sampleImplementation( double random_number, size_t& sampled_bin_index ) const; // Verify that the values are valid template<typename InputIndepQuantity, typename InputDepQuantity> static void verifyValidValues( const Utility::ArrayView<const InputIndepQuantity>& independent_values, const Utility::ArrayView<const InputDepQuantity>& dependent_values, const bool cdf_bin_values ); // Save the distribution to an archive template<typename Archive> void save( Archive& ar, const unsigned version ) const; // Load the distribution from an archive template<typename Archive> void load( Archive& ar, const unsigned version ); BOOST_SERIALIZATION_SPLIT_MEMBER(); // Declare the boost serialization access object as a friend friend class boost::serialization::access; // All possible instantiations are friends template<typename FriendIndepUnit, typename FriendDepUnit> friend class UnitAwareHistogramDistribution; // The distribution type static const UnivariateDistributionType distribution_type = HISTOGRAM_DISTRIBUTION; // The distribution (first = bin_min, second = bin_PDF, third = bin_CDF) // Note: The bin_CDF value is the value of the CDF at the lower bin boundary typedef std::vector<std::tuple<IndepQuantity,DepQuantity,UnnormCDFQuantity> > DistributionArray; DistributionArray d_distribution; // The normalization constant DistNormQuantity d_norm_constant; }; /*! The histogram distribution (unit-agnostic) * \ingroup univariate_distributions */ typedef UnitAwareHistogramDistribution<void,void> HistogramDistribution; } // end Utility namespace BOOST_SERIALIZATION_DISTRIBUTION2_VERSION( UnitAwareHistogramDistribution, 0 ); BOOST_SERIALIZATION_DISTRIBUTION2_EXPORT_STANDARD_KEY( HistogramDistribution ); //---------------------------------------------------------------------------// // Template includes. //---------------------------------------------------------------------------// #include "Utility_HistogramDistribution_def.hpp" //---------------------------------------------------------------------------// #endif // end UTILITY_HISTOGRAM_DISTRIBUTION_HPP //---------------------------------------------------------------------------// // end Utility_HistogramDistribution.hpp //---------------------------------------------------------------------------//
4eae6ad0cbf8ee941c13d550e364b738ba9e803a
410f415bd30c0714ed4f6cace3dadda7f8ac414e
/FireBender.h
b5a1eb389a5271fe775006673cf76e5f8a5a06c5
[]
no_license
mikeen97/p3_lab5_MiguelFlores
02770410630a2844b4cbebdd61d437256797b0fb
2bc5016f8eaf0cb1eddb43a9bcf4c89ee7d9f4f2
refs/heads/master
2021-08-15T17:37:02.717440
2017-11-18T01:02:42
2017-11-18T01:02:42
111,141,095
0
0
null
null
null
null
UTF-8
C++
false
false
613
h
FireBender.h
#include <iostream> #include <string> #include <vector> #include "Persona.h" #include "PoderEspecial.h" using namespace std; #ifndef FIREBENDER_H #define FIREBENDER_H class FireBender : public Persona{ protected: int NumeroCicatrices; int NumeroVictorias; PoderEspecial* Poder; public: FireBender(string ,string ,int,string,int,int,PoderEspecial*); FireBender(int,int,PoderEspecial*); FireBender(); int getNumeroCicatrices(); void setNumeroCicatrices(int); int getNumeroVictorias(); void setNumeroVictorias(int); PoderEspecial* getPoder(); void setPoder(PoderEspecial*); }; #endif
71886484715b61f4f9ba0dfc9b6677f767eb104e
56649046304376279d71bf6fd82562f7efa293ca
/PracSim/include/filtfunc.h
6e2ac8e027a4fae2ebbd80dd1805f8940965d5c6
[]
no_license
zwm152/WirelessCommSystemSimuC-Model
b9b3de73956caa8e872c3d36580ec863962d8ef2
7be3562b5a516c73f06c4090b5806ffe7319fe8a
refs/heads/master
2021-09-23T15:41:08.088030
2018-09-25T12:04:04
2018-09-25T12:04:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,734
h
filtfunc.h
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // File = filtfunc.h // // #ifndef _FILTFUNC_H_ #define _FILTFUNC_H_ //#include <fstream> #include "poly_T.h" //#include "typedefs.h" class FilterTransFunc { public: FilterTransFunc( void ); FilterTransFunc( int order); void FilterFrequencyResponse(void); std::complex<double>* GetPrototypePoles( int *num_poles ); std::complex<double>* GetPoles( int *num_poles ); std::complex<double> GetPole(int pole_indx); std::complex<double>* GetPrototypeZeros( int *num_zeros ); std::complex<double>* GetZeros( int *num_zeros ); std::complex<double> GetZero(int zero_indx); void LowpassDenorm(double cutoff_freq_hz); int GetNumPoles(void); int GetNumZeros(void); float GetHSubZero( void ); void DumpBiquads( ofstream* output_stream); Polynomial GetDenomPoly( void ); Polynomial GetNumerPoly( void ); void FrequencyPrewarp( double sampling_interval ); protected: int Filter_Order; int Num_Denorm_Poles; int Num_Denorm_Zeros; int Degree_Of_Denom; int Degree_Of_Numer; int Num_Prototype_Poles; int Num_Prototype_Zeros; int Num_Biquad_Sects; bool Filter_Is_Denormalized; //double Denorm_Cutoff_Freq_Hz; double Denorm_Cutoff_Freq_Rad; double *A_Biquad_Coef; double *B_Biquad_Coef; double *C_Biquad_Coef; double H_Sub_Zero; std::complex<double> *Prototype_Pole_Locs; std::complex<double> *Prototype_Zero_Locs; std::complex<double> *Denorm_Pole_Locs; std::complex<double> *Denorm_Zero_Locs; Polynomial Denom_Poly; Polynomial Numer_Poly; ofstream *Response_File; }; #endif
b0d6e2094d169d6f67f3597186ccc6a1dc7d1de4
182322f4f2800f851754bb1bcb85fd4f9fc324ea
/pcca/2015_1/1002/pd.cpp
e04fa40ba4bb9eaa4e3a0f613cd4ebb6a44762f8
[]
no_license
Tocknicsu/oj
66100fe94d76b6fe8d1bd3019f5ada9d686c1753
e84d6c87f3e8c0443a27e8efc749ea4b569a6c91
refs/heads/master
2021-01-17T08:12:32.510731
2016-04-18T02:09:04
2016-04-18T02:09:16
32,704,322
2
1
null
null
null
null
UTF-8
C++
false
false
1,052
cpp
pd.cpp
#include <bits/stdc++.h> using namespace std; struct C{ int x, y, r; C(){} C(int _x, int _y, int _r):x(_x),y(_y),r(_r){} }; inline int squ(int x){ return x * x; } void Solve(int n){ vector<C> c; bool go[n][n]; memset(go, 0, sizeof(go)); for(int i = 0 ; i < n ; i++){ int x, y, r; scanf("%d%d%d", &x, &y, &r); for(int j = 0 ; j < i ; j++){ int dis = squ(c[j].x-x) + squ(c[j].y-y); go[i][j] = dis <= squ(r); go[j][i] = dis <= squ(c[j].r); } c.push_back(C(x, y, r)); } for(int k = 0 ; k < n ; k++) for(int i = 0 ; i < n ; i++) for(int j = 0 ; j < n ; j++) go[i][j] |= go[i][k] & go[k][j]; int ans = 0; for(int i = 0 ; i < n ; i++){ bool flag = true; for(int j = 0 ; j < n ; j++) if(i==j) continue; else flag &= go[j][i]; ans += flag; } printf("%d\n", ans); } int main(){ int n; while(scanf("%d", &n), n){ Solve(n); } }
482898803ca7ce55f866289030793ece9f42453c
38e285c91fe584aa5203b5eddd7c124303b2ce92
/05.chapter/frame.cpp
698fbd1cd38739211f15943eacbfea5ecf15ef54
[]
no_license
lookat23/studyAcceleratedCPP
bbab9e43b4c56bbe3f8cbbfc61b6d5cddf18c446
2f1c86ee221e340195b9b874c3ef6d426aefed49
refs/heads/master
2021-01-02T09:53:50.712119
2014-04-06T02:03:11
2014-04-06T02:03:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,035
cpp
frame.cpp
#include <iostream> #include <string> #include <vector> using std::endl; using std::cin; using std::cout; using std::istream; using std::string; using std::vector; using std::max; typedef vector<string>::size_type st; void read(istream& in, vector<string>& vec) { string s; while(getline(cin, s)) { vec.push_back(s); } cin.clear(); } void frame(vector<string>& vec) { // 找出字符串中,最大长度 st maxlen=0; for(st i=0; i<vec.size(); i++) { maxlen = max(maxlen, vec[i].size()); } // 填充图案 for(st i=0; i<vec.size();i++) { string& s = vec[i]; s += string(maxlen - s.size(), ' '); s.insert(0 , "* "); s += " *"; } vec.insert(vec.begin(), string(maxlen+4, '*')); vec.push_back(string(maxlen+4, '*')); } void print(const vector<string>& vec) { for(st i=0; i<vec.size(); i++) { cout << vec[i] << endl; } } int main() { cout << "Please in some line" << endl; vector<string> vec; // 输入一些字符串 read(cin, vec); // 加框 frame(vec); // 显示 print(vec); return 0; }
60f8bedd2003f3a50a96a96c1f9f8b43f8993c0b
dd52b00f1deed89fc3263056857dc096e9d593e9
/lattice.hpp
609449448a9b16768d6670db72cacface7950b1d
[]
no_license
fulkast/Cantilever_in_channel_flow
ca1aa48c957db024811fcf4b3ee95f2e232549a2
7d6c22657a13061ddd422ebdc8ca29d3e39ca9cd
refs/heads/master
2021-01-10T11:06:21.359923
2016-02-17T21:59:41
2016-02-17T21:59:41
51,243,996
1
1
null
null
null
null
UTF-8
C++
false
false
24,608
hpp
lattice.hpp
/** * @file * @author Fabian Bösch * @brief lattice and node */ #ifndef LB_LATTICE_HPP_INCLUDED #define LB_LATTICE_HPP_INCLUDED #include "velocity_set.hpp" //#include "distance.hpp" #include "property_array.hpp" #include <vector> #include <fstream> #include "geometry_2D.hpp" #include "cylinder_2D.hpp" #include <map> namespace lb { class lattice; // forward declaration /** * @brief Node representing one lattice site. * * Easy access to bundled quantities and properties (works as proxy to * the lattice class). */ struct node { public: // ctors /** @brief Default constructor */ node() {} /** * @brief Construct from lattice and position * @param[in] lat Pointer to the lattice * @param[in] i x coordinate * @param[in] j y coordinate * @pre coordinates are in domain */ node(lattice* lat, int i, int j); node(const node&) = default; public: // init /** * @brief Set lattice and position. * @param[in] lat Pointer to lattice * @param[in] i x coordinate * @param[in] j y coordinate * @pre coordinates are in domain */ void set(lattice* lat, int i, int j); public: // access populations and macroscopic quantities /** * @brief Get population. * @param i Population index * @return Value of distribution function * @pre population index exists */ inline float_type f(unsigned int i) const; /** * @brief Get/set population. * @param i Population index * @return Reference to value of distribution function * @pre population index exists */ inline float_type& f(unsigned int i); /** * @brief Get density. * @return Local density */ inline float_type rho() const; /** * @brief Get/set density. * @return Reference to local density */ inline float_type& rho(); /** * @brief Get x-velocity. * @return Local flow velocity in x direction */ inline float_type u() const; /** * @brief Get/set x-velocity. * @return Reference to local flow velocity in x direction */ inline float_type& u(); /** * @brief Get y-velocity. * @return Local flow velocity in y direction */ inline float_type v() const; /** * @brief Get/set y-velocity. * @return Reference to local flow velocity in y direction */ inline float_type& v(); public: // query and access properties /** * @brief Query for flag property. * Query whether a flag is set for the node. * @param[in] name Flag name * @return True if flag is set, otherwise false */ inline bool has_flag_property(std::string name) const; /** * @brief Set a flag * Set the flag "name" to true * @param[in] name Flag name * @return True if flag exists, otherwise false */ inline bool set_flag_property(std::string name); /** * @brief Unset a flag * Set the flag "name" to false * @param[in] name Flag name * @return True if flag exists, otherwise false */ inline bool unset_flag_property(std::string name); /** * @brief Query for data property. * Query whether data property (object) is stored for the node. * @param[in] name Data property name * @return True if thre is such a data property, otherwise false */ inline bool has_data_property(std::string name) const; /** * @brief Store a data property * @tparam T Type of the data property * @param[in] name Data property name * @param[in] property Data property object * @return True if data property exists, otherwise false */ template<typename T> inline bool set_data_property(std::string name, const T& property); /** * @brief Delete a data property * @param[in] name Data property name * @return True if data property exists, otherwise false */ bool unset_data_property(std::string name); /** * @brief Get data property * @tparam T Type of the data property * @param[in] name Data property name * @return Reference to data property object */ template <typename T> T& get_data_property(std::string name); /** * @brief Get data property * @tparam T Type of the data property * @param[in] name Data property name * @return Reference to data property object */ template <typename T> const T& get_data_property(std::string name) const; public: // members lattice* l; ///< Pointer to a lattice object unsigned int index; ///< Index for looking up data in the lattice coordinate<int> coord; ///< Coordinate of node's position }; /** * @brief Lattice containing the populations. * * The lattice is constructed using the function @ref velocity_set() * which returns a velocity set object. Hence, the number of * populations is defined through that function. Data structures are * set up accordingly. * * The basic data structure for the population and the macroscopic * qunatities are one dimensional arrays (vectors) interpreted as two * dimensional planes. The x (i) dimension varies first and the y (j) * dimension last. * * This class does provide access to the data through node iterators or * through direct access of the public members. The node iterators * return a @ref node object that provides easy access to all local * quantities according to the 2d lattice coordinate. * * There are buffer regions (extent is one in all directions) around * the data to make the advection procedure easier. * * The data is indexed in the range [0, nx-1][0, ny-1]; including * buffers indices span the range [-1, nx][-1, ny], repectively. */ class lattice { public: // typedefs /** @brief Iterator type */ typedef typename std::vector<node>::iterator node_iterator; /** @brief Const iterator type */ typedef typename std::vector<node>::const_iterator const_node_iterator; /** @brief Reverse iterator type */ typedef typename std::vector<node>::reverse_iterator reverse_node_iterator; /** @brief Const reverse iterator type */ typedef typename std::vector<node>::const_reverse_iterator const_reverse_node_iterator; public: // ctor /** * @brief Construct the lattice with given extent * @param[in] _nx Number of nodes in x direction * @param[in] _ny Number of nodes in y direction */ lattice(unsigned int _nx, unsigned int _ny); public: // coordinates to index conversion /** * @brief Convert a coordinate to a unique index * @param[in] i x coordinate * @param[in] j y coordinate * @return unique index * @pre Coordinates are in the domain */ inline unsigned int index(int i, int j) const; public: // node access /** @brief Iterator pointing to the beginning @return iterator */ node_iterator begin(); /** @brief Const iterator pointing to the beginning @return const iterator */ const_node_iterator begin() const; /** @brief Iterator pointing to the end @return iterator */ node_iterator end(); /** @brief Const iterator pointing to the end @return const iterator */ const_node_iterator end() const; /** @brief Reverse iterator pointing to the end @return reverse iterator */ reverse_node_iterator rbegin(); /** @brief Const reverse iterator pointing to the end @return const reverse iterator */ const_reverse_node_iterator rbegin() const; /** @brief Reverse iterator pointing to the beginning @return reverse iterator */ reverse_node_iterator rend(); /** @brief Const reverse iterator pointing to the beginning @return const reverse iterator */ const_reverse_node_iterator rend() const; /** * @brief Get node at coordinate (i,j) * @param[in] i x coordinate * @param[in] j y coordinate * @return reference to node at coordinate (i,j) * @pre coordinates are in domain */ inline node& get_node(int i, int j); /** * @brief Get node at coordinate (i,j) * @param[in] i x coordinate * @param[in] j y coordinate * @return const reference to node at coordinate (i,j) * @pre coordinates are in domain */ inline const node& get_node(int i, int j) const; /** * @brief Get node at coordinate (i,j) * @param[in] idx unique node index * @return reference to node at coordinate (i,j) * @pre idx is between [0, @ref lattice::real_size ) */ inline node& get_node(unsigned int idx); /** * @brief Get node at coordinate (i,j) * @param[in] idx unique node index * @return const reference to node at coordinate (i,j) * @pre idx is between [0, @ref lattice::real_size ) */ inline const node& get_node(unsigned int idx) const; public: // walls /** * @brief Add a solid wall * * Creates wall flags in the coordinate rectangle defined by * min_coord and max_coord. The corresponding nodes get the flag * "wall" and they are also stored in the vector * @ref lattice:wall_nodes for convienience. * * @param[in] min_coord minimum bounding rectangle corner * @param[in] max_coord maximum bounding rectangle corner * @pre (min_coord, max_coord) define a rectangle * @pre Both min_coord and max_coord are in the domain */ void add_wall(coordinate<int> min_coord, coordinate<int> max_coord); /** * @brief Add a solid spherical wall * * Creates wall flags in the sphere of radius r around the coordinate o. * The corresponding nodes get the flag * "wall" and they are also stored in the vector * @ref lattice:wall_nodes for convienience. * * @param[in] o center of sphere * @param[in] r radius of sphere * @pre (o, r) defines a sphere * @pre The resultant sphere should be in the domain */ /* * Sets the given node as a wall node */ void set_is_wall_node(coordinate<int>& a_node); /* * Unset the given node as a wall node */ void unset_is_wall_node(coordinate<int>& a_node); /* Sets the given node as a refill node */ void set_is_refill_node(coordinate<int>& a_node); /* * Unset the given node as a refill node */ void unset_is_refill_node(coordinate<int>& a_node); void set_u_target_at_node(coordinate<int>& a_node, coordinate<double> _u); coordinate<double> get_u_target_at_node(coordinate<int>& a_node); void clear_u_target_for_all_boundary_nodes(); void set_rho_target_at_node(coordinate<int>& a_node, double _rho); double get_rho_target_at_node(coordinate<int>& a_node); void clear_rho_target_for_all_boundary_nodes(); /* Sets the given node as a boundary node */ void set_is_boundary_node(coordinate<int>& a_node); /* * Unset the given node as a boundary node */ void unset_is_boundary_node(coordinate<int>& a_node); /** * Adds a pointer to a 2d geometrical shape to the current frame */ void add_to_shapes(geometry_2D* a_shape); /* * Deletes all current pointers to shapes */ void delete_shapes(); /* * Print all shapes info */ void print_shapes(); void print_bounding_nodes(); void print_out_going_velocities(lb::coordinate<int> position); /** @brief Delete all existing walls */ void delete_walls(); public: // file dump /** * @brief Write fields to file * * Write macroscopic variables to simple ascii file. * * @param[in] file_name file name */ void write_fields(std::string file_name); public: // print /** @brief print to output stream, useful for debugging only */ friend std::ostream& operator<<(std::ostream& os, const lattice& l); public: // members const unsigned int nx; ///< extent in x direction (excluding buffers) const unsigned int ny; ///< extent in y direction (excluding buffers) const unsigned int size; ///< total number of nodes (excluding buffers) const unsigned int buffer_size; ///< buffer width (equal to one) const unsigned int real_nx; ///< extent in x direction including buffers const unsigned int real_ny; ///< extent in y direction including buffers const unsigned int real_size; ///< total number of nodes including buffers const unsigned int n_populations; ///< number of populations std::vector<std::vector<float_type> > f; ///< population data std::vector<float_type> rho; ///< density data std::vector<float_type> u; ///< flow x-velocity data std::vector<float_type> v; ///< flow y-velocity data std::vector<node> nodes; ///< array holding all node objects std::vector<bool> find_refill_nodes(std::vector<coordinate<int>> &set1, std::vector<coordinate<int>> &set2); /* std::vector<node> wall_nodes; ///< array holding node objects belonging to a solid wall std::vector<node> boundary_nodes; ////<array holding all boundary node objeccts std::vector<node> refill_nodes; ///< array holding all node objects that were solid --> fluid (refill nodes) */ // Maps holding node status data std::map<std::pair<int,int>, bool> wall_nodes; std::map<std::pair<int,int>, bool> boundary_nodes; std::map<std::pair<int,int>, bool> refill_nodes; std::map<std::pair<int,int>, std::pair<double,double>> u_target_at_node; std::map<std::pair<int,int>, double> rho_target_at_node; property_array properties; ///< properties datastructure (can hold many different properties per node) const bool periodic_x; ///< flag whether to use periodicity in x direction const bool periodic_y; ///< flag whether to use periodicity in y direction std::vector<geometry_2D*> shapes; ///< obstacle shapes in the current frame }; // implementation // -------------- // node node::node(lattice* lat, int i, int j) : l(lat), index(l->real_nx*(j+l->buffer_size) + i + l->buffer_size), coord(i,j) { } void node::set(lattice* lat, int i, int j) { l = lat; index = l->real_nx*(j+l->buffer_size) + i + l->buffer_size; coord.i = i; coord.j = j; } inline float_type node::f(unsigned int i) const { return l->f[i][index]; } inline float_type& node::f(unsigned int i) { return l->f[i][index]; } inline float_type node::rho() const { return l->rho[index]; } inline float_type& node::rho() { return l->rho[index]; } inline float_type node::u() const { return l->u[index]; } inline float_type& node::u() { return l->u[index]; } inline float_type node::v() const { return l->v[index]; } inline float_type& node::v() { return l->v[index]; } inline bool node::has_flag_property(std::string name) const { return l->properties.has_flag_property(name, index); } inline bool node::set_flag_property(std::string name) { return l->properties.set_flag_property(name, index); } inline bool node::unset_flag_property(std::string name) { return l->properties.unset_flag_property(name, index); } inline bool node::has_data_property(std::string name) const { return l->properties.has_data_property(name,index); } template<typename T> inline bool node::set_data_property(std::string name, const T& property) { return l->properties.set_data_property(name, index, property); } bool node::unset_data_property(std::string name) { return l->properties.unset_data_property(name, index); } template <typename T> T& node::get_data_property(std::string name) { return l->properties.get_data_property<T>(name, index); } template <typename T> const T& node::get_data_property(std::string name) const { return l->properties.get_data_property<T>(name, index); } // lattice lattice::lattice(unsigned int _nx, unsigned int _ny) : nx(_nx), ny(_ny), size(nx*ny), buffer_size(1), real_nx(nx+2*buffer_size), real_ny(ny+2*buffer_size), real_size(real_nx*real_ny), n_populations(velocity_set().size), f( n_populations, std::vector<float_type>(real_size, 0) ), rho(real_size, 0), u(real_size, 0), v(real_size, 0), nodes(real_size), properties(real_size), periodic_x(true), periodic_y(true), shapes() { // register some properties properties.register_flag_property("fluid"); properties.register_flag_property("buffer"); properties.register_flag_property("wall"); properties.register_flag_property("boundary"); properties.register_flag_property("refill"); // set up nodes and properties unsigned int k(0); for (unsigned int j=0; j<real_ny; ++j) { for (unsigned int i=0; i<real_nx; ++i) { nodes[k].set(this, static_cast<int>(i)-buffer_size, static_cast<int>(j)-buffer_size); if (i<buffer_size || i>=real_nx-buffer_size || j<buffer_size || j>=real_ny-buffer_size) properties.set_flag_property("buffer",nodes[k].index); else properties.set_flag_property("fluid",nodes[k].index); ++k; } } } lattice::node_iterator lattice::begin() { return nodes.begin(); } lattice::const_node_iterator lattice::begin() const { return nodes.begin(); } lattice::node_iterator lattice::end() { return nodes.end(); } lattice::const_node_iterator lattice::end() const { return nodes.end(); } lattice::reverse_node_iterator lattice::rbegin() { return nodes.rbegin(); } lattice::const_reverse_node_iterator lattice::rbegin() const { return nodes.rbegin(); } lattice::reverse_node_iterator lattice::rend() { return nodes.rend(); } lattice::const_reverse_node_iterator lattice::rend() const { return nodes.rend(); } inline unsigned int lattice::index(int i, int j) const { return real_nx*(j+buffer_size) + i + buffer_size; } inline node& lattice::get_node(int i, int j) { return nodes[real_nx*(j+buffer_size) + i + buffer_size]; } inline const node& lattice::get_node(int i, int j) const { return nodes[real_nx*(j+buffer_size) + i + buffer_size]; } inline node& lattice::get_node(unsigned int idx) { return nodes[idx]; } inline const node& lattice::get_node(unsigned int idx) const { return nodes[idx]; } std::ostream& operator<<(std::ostream& os, const lattice& l) { for (unsigned int p=0; p<l.n_populations; ++p) { os << " f" << std::setw(2) << p << ":"; os << "\n" << " y " << std::setw((l.nx+2*l.buffer_size)*12+1) << std::setfill('-') << "" << "\n" << std::setfill(' '); for (int j=static_cast<int>(l.ny+l.buffer_size-1); j>-static_cast<int>(l.buffer_size+1); --j) { os << std::setw(4) << j << " |"; for (int i=-static_cast<int>(l.buffer_size); i<static_cast<int>(l.nx+l.buffer_size); ++i) { const unsigned int index = (j+l.buffer_size)*l.real_nx + i + l.buffer_size; if (i>=0 && i<static_cast<int>(l.nx) && j>=0 && j<static_cast<int>(l.ny)) os << std::setw(12) << std::setprecision(5) /*<< std::scientific*/ << l.f[p][index]; else os << std::setw(12) << "*"; } os << " |" << "\n"; } os << std::setw(6) << "" << std::setw((l.nx+2*l.buffer_size)*12+1) << std::setfill('-') << "" << "\n" << std::setfill(' ') << std::setw(6) << ""; for (int i=-static_cast<int>(l.buffer_size); i<static_cast<int>(l.nx+l.buffer_size); ++i) os << std::setw(12) << i; os << " x\n"; } os << l.properties; return os; } std::vector<bool> lattice::find_refill_nodes(std::vector<coordinate<int>>& set1, std::vector<coordinate<int>>& set2) { std::vector<bool> foobar(set1.size(),false); for (auto i=0; i<set1.size(); i++) { for (auto j=0; j<set2.size(); j++) { if ((set1[i].i==set2[j].i) && (set1[i].j==set2[j].j)) { foobar[i] = true; break; } } } return foobar ; } void lattice::add_wall(coordinate<int> min_coord, coordinate<int> max_coord) { for (int j=min_coord.j; j<=max_coord.j; ++j) { for (int i=min_coord.i; i<=max_coord.i; ++i) { // check if node not yet labelled as wall if (!get_node(i,j).has_flag_property("wall")) { // set wall property get_node(i,j).set_flag_property("wall"); wall_nodes[std::make_pair(i,j)] = true; } } } } void lattice::set_is_wall_node(coordinate<int>& a_node) { // check if node not yet labelled as wall if (!get_node(a_node.i,a_node.j).has_flag_property("wall")) { // set wall property get_node(a_node.i,a_node.j).set_flag_property("wall"); wall_nodes[std::make_pair(a_node.i,a_node.j)] = true; } } void lattice::unset_is_wall_node(coordinate<int>& a_node) { // check if is wall and then delete from walls if (get_node(a_node.i,a_node.j).has_flag_property("wall")) { // unset from walls get_node(a_node.i,a_node.j).unset_flag_property("wall"); wall_nodes.erase(std::make_pair(a_node.i,a_node.j)); } } void lattice::set_is_refill_node(coordinate<int>& a_node) { // check if node is not yet labelled as a refill node if (!get_node(a_node.i,a_node.j).has_flag_property("refill")) { // set refill node property get_node(a_node.i,a_node.j).set_flag_property("refill"); refill_nodes[std::make_pair(a_node.i,a_node.j)] = true; } } void lattice::set_u_target_at_node(coordinate<int>& a_node, coordinate<double> _u) { // set the u_target at current node u_target_at_node[std::make_pair(a_node.i,a_node.j)] = std::make_pair(_u.j,_u.j); } coordinate<double> lattice::get_u_target_at_node(coordinate<int>& a_node) { std::pair<double,double> velocity = u_target_at_node[std::make_pair(a_node.i,a_node.j)]; return lb::coordinate<double>(velocity.first,velocity.second); } void lattice::clear_u_target_for_all_boundary_nodes() { u_target_at_node.clear(); } void lattice::set_rho_target_at_node(coordinate<int>& a_node, double _rho) { // set the u_target at current node rho_target_at_node[std::make_pair(a_node.i,a_node.j)] = _rho; } double lattice::get_rho_target_at_node(coordinate<int>& a_node) { return rho_target_at_node[std::make_pair(a_node.i,a_node.j)]; } void lattice::clear_rho_target_for_all_boundary_nodes() { rho_target_at_node.clear(); } void lattice::unset_is_refill_node(coordinate<int>& a_node) { // check if node is refill node if (get_node(a_node.i,a_node.j).has_flag_property("refill")) { // unset refill property get_node(a_node.i,a_node.j).unset_flag_property("refill"); refill_nodes.erase(std::make_pair(a_node.i,a_node.j)); } } void lattice::set_is_boundary_node(coordinate<int>& a_node) { // check if node not yet labelled as boundary if (!get_node(a_node.i,a_node.j).has_flag_property("boundary")) { // set boundary property get_node(a_node.i,a_node.j).set_flag_property("boundary"); boundary_nodes[std::make_pair(a_node.i,a_node.j)] = true; } } void lattice::unset_is_boundary_node(coordinate<int>& a_node) { // check if node not yet labelled as wall if (get_node(a_node.i,a_node.j).has_flag_property("boundary")) { // set wall property get_node(a_node.i,a_node.j).unset_flag_property("boundary"); boundary_nodes.erase(std::make_pair(a_node.i,a_node.j)); } } void lattice::delete_walls() { for (auto it = wall_nodes.begin(); it != wall_nodes.end(); it++) { get_node(it->first.first, it->first.second).unset_flag_property("wall"); } wall_nodes.clear(); } void lattice::add_to_shapes(geometry_2D* a_shape) { shapes.push_back(a_shape); std::vector<coordinate<int>> new_wall = a_shape->get_internal_nodes(); for (auto i = new_wall.begin(); i != new_wall.end(); i++ ) { lattice::set_is_wall_node(*i); } } void lattice::delete_shapes() { for (auto i : shapes) { std::vector<coordinate<int>> new_wall = i->get_internal_nodes(); for (auto j = new_wall.begin(); j != new_wall.end(); j++ ) { lattice::unset_is_wall_node(*j); } } shapes.clear(); } void lattice::print_shapes() { std::cout << "Current objects: " << std::endl; for (std::vector<geometry_2D*>::iterator i = shapes.begin(); i != shapes.end(); i++) { (*i)->print(); } } void lattice::print_bounding_nodes() { for (std::vector<geometry_2D*>::iterator i = shapes.begin(); i != shapes.end(); i++) { (*i)->print_boundary_nodes(); } } void lattice::print_out_going_velocities(lb::coordinate<int> position) { for (std::vector<geometry_2D*>::iterator i = shapes.begin(); i != shapes.end(); i++) { (*i)->print_out_going_velocities(position); } } void lattice::write_fields(std::string file_name) { std::ofstream ofs(file_name.c_str()); // //using ofstream to output strings to a text file // if (ofs.is_open()) // { // ofs << "This is a test.\n"; // ofs << "I am learning C++.\n"; // ofs.close(); // } // else cout << "Can't open file"; if (ofs.is_open()) { // write header (comment that part if necessary) ofs << "x y rho u v\n"; // // write body // for (unsigned int j=0; j<ny; ++j) // { // for (unsigned int i=0; i<nx; ++i) // { // // ofs << i << " " << j << " " // // << std::scientific << nodes[(j+buffer_size)*real_nx + i + buffer_size].rho() << " " // // << std::scientific << nodes[(j+buffer_size)*real_nx + i + buffer_size].u() << " " // // << std::scientific << nodes[(j+buffer_size)*real_nx + i + buffer_size].v() << "\n"; // } // } } else { throw std::runtime_error("could not write to file"); } } // } // lb #endif //LB_LATTICE_HPP_INCLUDED
628bf3372e80a79a69f20c642f16802ef37275e1
087cbbd3099ff8fd8d2051c60461a0458333dbac
/contests/educationRound102/G_fast.cpp
85ff83e8c7542acc3e89a71c5d25861b64f7afa6
[]
no_license
1998factorial/Codeforces
1046ffb2dbee582191fa59e7290c53e902c0af5c
f5b8139810e0724828e6ce7e26f3f8228589b00a
refs/heads/master
2021-07-05T21:34:45.053171
2021-04-10T06:21:33
2021-04-10T06:21:33
228,158,437
1
0
null
null
null
null
UTF-8
C++
false
false
3,374
cpp
G_fast.cpp
#pragma GCC optimize(3) #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma comment(linker, "/stack:200000000") #include <bits/stdc++.h> #define sz(a) a.size() using namespace std; typedef long long ll; const int mod = 998244353; const int maxn = 1e5 + 10; int fac[maxn * 2] , inv[maxn * 2] , N , LEN[maxn * 2]; inline int C(int n , int r){ if(n < r || n < 0 || r < 0)return 0; return (ll)fac[n] * ((ll)inv[n - r] * inv[r] % mod) % mod; } inline ll qpow(int x , int n){ ll ret = 1; while(n){ if(n % 2)ret = (ll)ret * x % mod; x = (ll)x * x % mod; n >>= 1; } return (ret % mod + mod) % mod; } inline int add(int x , int y){ int ret = x + y; if(ret > mod)ret -= mod; return ret; } inline int sub(int x , int y){ int ret = x - y; if(ret < 0)ret += mod; return ret; } inline int mul(int x , int y){ ll ret = (ll)x * y % mod; return ret; } void change(vector<int>& y , int len) { int i, j, k; for (i = 1, j = len / 2; i < len - 1; i++) { if (i < j) swap(y[i], y[j]); k = len / 2; while (j >= k) { j = j - k; k = k / 2; } if (j < k) j += k; } } void NTT(vector<int>& P , int op){ int len = sz(P) , i , j , k; //change(P , len); for(int i = 1, j = 0; i < len - 1; ++i) { for(int k = len >> 1; (j ^= k) < k; k >>= 1); if(i < j) swap(P[i], P[j]); } for(i = 1; i < len; i <<= 1){ int gn = qpow(3 , (mod - 1) / (i << 1)); if(op == -1)gn = qpow(gn , mod - 2); for(j = 0; j < len; j += (i << 1)){ int g = 1; for(k = 0; k < i; ++k , g = mul(g , gn)){ int x = P[j + k] , y = mul(g , P[j + k + i]); P[j + k] = add(x , y); P[j + k + i] = sub(x , y); } } } if(op == -1){ //int inv = qpow(len , mod - 2); for(i = 0; i < len; ++i)P[i] = mul(P[i] , LEN[len]); } } vector<int> multiply(vector<int> a , vector<int> b){ int n = sz(a) , m = sz(b) , len = 1 , i; while(len < n + m)len <<= 1; a.resize(len) , b.resize(len); NTT(a , 1); NTT(b , 1); for(i = 0; i < len; ++i)a[i] = mul(a[i] , b[i]); NTT(a , -1); a.resize(n + m); return a; } int main(){ scanf("%d" , &N); vector<int> a(N) , b(N); for(int i = 0; i < N; ++i){ scanf("%d %d" , &a[i] , &b[i]); } fac[0] = 1; inv[0] = qpow(fac[0] , mod - 2); for(int i = 1; i < maxn * 2; ++i){ fac[i] = (ll)fac[i - 1] * i % mod; inv[i] = qpow(fac[i] , mod - 2); LEN[i] = qpow(i , mod - 2); } vector<int> ans(1 , 1); for(int i = 0; i < N; ++i){ int M = sz(ans); int from = max(0 , b[i] - M + 1); int to = min(a[i] + b[i] , M + a[i] - 1); vector<int> ans2 , F(to - from + 1); for(int j = 0; j <= to - from; ++j){ F[j] = C(a[i] + b[i] , from + j); } ans2 = multiply(F , ans); ans.resize(M + a[i] - b[i]); for(int j = 0 , k = b[i] - from; j < M + a[i] - b[i]; ++j , ++k){ // start from term = C(a[i] + b[i] , b[i]) ans[j] = ans2[k]; } } int ret = 0; for(auto& x : ans){ ret = add(ret , x); } printf("%d\n" , ret); }
d686027bc43e58c9efe7e74b80ce5242639b008b
3fe5a22f84e76115a04cc7555278e8bee8f829f6
/src/herd/dev/androiddevices.cpp
0b92c22a11052da8fac3bbac66ead3c0e257fef1
[]
no_license
icebald/dormouse
09a990290a78a75967d4623ab1073a3bc17ef8a7
df1bb3033a781c5574e17c5dc3d48949f76dae1c
refs/heads/master
2021-07-09T20:24:48.455939
2019-02-12T01:31:40
2019-02-12T01:31:40
146,267,301
0
0
null
null
null
null
UTF-8
C++
false
false
2,163
cpp
androiddevices.cpp
#include "ui/mainwindow.h" #include "androiddevices.h" #include "device.h" #include "adb/adbhelper.h" #include "ui/events.h" #include <QDebug> #include <thread> #include <QEvent> #include <QApplication> AndroidDevices::AndroidDevices(MainWindow *window) : mHwnd(window), mIsRun(false) { } void AndroidDevices::buildDevInfo(const QString &str) { QStringList sl =str.split(" "); if (sl.count() <= 0) return; dev_ptr dev(new device(sl.at(0))); for (int i = 1; i < sl.count(); i++) { if (sl.at(i).indexOf("model:") != -1) { QStringList strs = sl.at(i).split(":"); if (strs.count() < 2) continue; dev->setModel(strs.at(1)); } else if (sl.at(i).indexOf("product:") != -1) { QStringList strs = sl.at(i).split(":"); if (strs.count() < 2) continue; dev->setProduct(strs.at(1)); } else if (sl.at(i).indexOf("device:") != -1) { QStringList strs = sl.at(i).split(":"); if (strs.count() < 2) continue; dev->setDevice(strs.at(1)); } } mDevices.push_back(dev); } void AndroidDevices::buildDevice(const QString &str) { QStringList sl =str.split("\n"); for (int i=0; i < sl.count(); i++) { if (sl.at(i).indexOf("device") == -1 || sl.at(i).indexOf("attached") != -1) { continue; } buildDevInfo(sl.at(i)); } QApplication::postEvent(mHwnd, new DeviceEvent(mDevices)); } void AndroidDevices::run() { mIsRun = true; QString version = AdbHelper::excue(GET_VERSION); QApplication::postEvent(mHwnd, new VersionEvent(version)); while (mIsRun) { mDevices.clear(); buildDevice(AdbHelper::excue(LIST_DEVICE)); std::this_thread::sleep_for(std::chrono::seconds(60)); } } void AndroidDevices::stop() { mIsRun = false; this->exit(0); } void AndroidDevices::setSelectDev(int index) { mSelectDev = index; } void AndroidDevices::setPidSelect(int row, int index) { setSelectDev(row); mDevices.at(row)->setCurrentProgress(index); QApplication::postEvent(mHwnd, new SetSelectDevEvent(mDevices.at(row))); }
d21e00d5d91eb831f5bfae42b183d9e9c64f54e8
b4af26ef6994f4cbb738cdfd182e0a992d2e5baa
/source/leetcode/2047/hyo.cpp
0ca3b2377c044f6d14f936b9b8d10a81cab3d997
[]
no_license
wisest30/AlgoStudy
6819b193c8e9245104fc52df5852cd487ae7a26e
112de912fc10933445c2ad36ce30fd404c493ddf
refs/heads/master
2023-08-08T17:01:12.324470
2023-08-06T11:54:15
2023-08-06T11:54:15
246,302,438
10
17
null
2021-09-26T13:52:18
2020-03-10T13:02:56
C++
UTF-8
C++
false
false
1,014
cpp
hyo.cpp
class Solution { public: int countValidWords(string sentence) { istringstream is(sentence); string s; int ret = 0; while(is >> s) { bool valid = true; bool h = false, p = false; for(auto i = 0; i < s.size(); ++i) { if(isdigit(s[i])) { valid = false; break; } else if(s[i] == '-') { if(h || i == 0 || i + 1 == s.size() || !isalpha(s[i-1]) || !isalpha(s[i+1])) { valid = false; break; } h = true; } else if(p || s[i] == '.' || s[i] == '!' || s[i] == ',') { if(i + 1 != s.size()) { valid = false; break; } p = true; } } if(valid) ++ret; } return ret; } };
9dab4f3258c59c7beeae0ef860f5eefd4e3e62b7
5710451582f05d78fc6226ee8784fa9cd74a2ef6
/Project3/QueuedWorkItems/TypeTable.cpp
466d9612facfaac610ad7a33797485421d0a5da7
[]
no_license
sidmarkjoseph/C--piggybank
360c549d5683465c6997510d07e224690d5f7360
29041aaf9a7a5f5d399d983e30f5a3cd7818387f
refs/heads/master
2021-01-19T03:27:43.344073
2016-07-23T18:04:32
2016-07-24T01:40:02
55,188,509
0
0
null
null
null
null
UTF-8
C++
false
false
190
cpp
TypeTable.cpp
#include "TypeTable.h" int main() { TypeTable a; std::vector<std::string> str = { "sid", "mark" }; std::string b = "SJBHS"; a.addRecord(b, str); a.show(); std::getchar(); }
9ae7cbe7fd0e6648c0c9553efe149ca5114b47ef
463f8b7ac1e5c91d783ee06374a3a8555e56c338
/RocketEngine/RocketEngine/src/core/EngineSubsystem.h
cee8d2af1dd05c700cbee252c87aacde7b32c913
[]
no_license
dale-findlay/rocket-engine
db3e1954b37fa9fd70094649f628515c22c852e3
66d7b912f2de49050f96ffc4c865238a6199c932
refs/heads/main
2023-08-07T16:21:30.698681
2023-08-06T12:37:43
2023-08-06T12:37:43
342,523,437
0
0
null
null
null
null
UTF-8
C++
false
false
743
h
EngineSubsystem.h
#pragma once #include "core/CoreMinimal.h" #include "core/CoreSubsystem.h" namespace Rocket { class RkEngineSubsystem : public RkObject, CoreSubsystem { RK_OBJECT_BODY() public: RkEngineSubsystem(); virtual bool Init() = 0; virtual void Shutdown() = 0; bool IsInitialized() const { return m_Initialized; } bool IsShutdown() const { return m_Shutdown; } protected: void ResetStateFlags(); //It's the responsibility of each system to manage how it's init and shutdown procedure is defined. void SetIsInitialized(bool isInitialized); void SetIsShutdown(bool isShutdown); private: //Has this system been initialized. bool m_Initialized; //Has this system been shutdown. bool m_Shutdown; }; }
aa88fc30eac52228b40c1f48c4e69f8d3db3a1e5
12c2776a23f81d67ebebddbb663c5b9a89342764
/src/GUI/Lib/EventObserver.cpp
c875bb8c99ae5095a606086f139d34fb02ef4069
[]
no_license
kxait/pp_bank
8444dc7d5291db9fbe803081c676896aa5576d44
9b673f55cb2b190994643f794637d55949ee7d1f
refs/heads/master
2023-05-13T18:58:49.954012
2021-06-11T11:16:14
2021-06-11T11:16:14
365,543,881
0
0
null
null
null
null
UTF-8
C++
false
false
629
cpp
EventObserver.cpp
#include "EventObserver.h" #include "../../Log/UserLogger.h" UserLogger* logger; EventObserver::EventObserver(EventObserver * par) :parent(par) { logger = UserLogger::getLogger(); } void EventObserver::emitParent(std::string a, long b) { #ifdef DEBUG logger->logInfo(UserLogger::getString({"event wystrzelony u rodzica: ", a, ", ", std::to_string(b)})); #endif if(parent != nullptr) { parent->emit(a, b); } } void EventObserver::emit(std::string a, long b) { #ifdef DEBUG logger->logInfo(UserLogger::getString({"event wystrzelony: ", a, ", ", std::to_string(b)})); #endif // nie rob nic }
15e20e96d6eb3544529d2876cd424b49ef1b9e01
466613e0ea5e663dd6bc03a443206179bf3ef8a8
/code/src/utility/ShaderLibrary.hpp
d84113f2225b78b0e07615ee05a8d6c939b43d35
[]
no_license
alexanderraymartin/AnglerExperience
3c10062e32602f43fb35ad2ec4e751d5de7c9972
9153695f977f501ff7ed70d745c9e4c99c32d0ab
refs/heads/master
2020-03-07T08:32:26.465390
2018-03-25T19:55:29
2018-03-25T19:55:29
127,381,354
1
0
null
null
null
null
UTF-8
C++
false
false
2,657
hpp
ShaderLibrary.hpp
#pragma once #ifndef SHADERLIBRARY_H_ #define SHADERLIBRARY_H_ #include <unordered_map> #include <vector> #include <string> #include "common.h" #include "Program.h" using namespace std; class ShaderLibrary{ // This is a gray area of no referencing outside of ./utility because I think friend declarations // apply by name only and therefore no knowledge of the Material class is necessary. friend class Material; public: ShaderLibrary(){} // Initialize fallback shader. Must be run before use. void init(); // Add a shader to the library by name and pointer void add(const string &name, Program* program); void add(const char* name, Program* program){add(string(name), program);} // Bind the program stored under the given name and mark it as active void makeActive(const string &name); void makeActive(const char* name){makeActive(string(name));} // Automatically swaps to and binds on the given program pointer. This enables calls to be made to the // library during rendering that skip the overhead of the hash-table whilst avoiding redundant bind calls. void fastActivate(Program* prog); Program& getActive(); // Should only be used in combination with fastActivate()! Do not use to bind manually! Program* getActivePtr(); // Same as getActivePtr but for any program in the library. If the given name is not found returns NULL Program* getPtr(const string &name); Program* getPtr(const char* name){return(getPtr(string(name)));} private: bool inited = false; // Hash-table associative array linking GLSL programs to a simple name such as "blinn-phong" // Most pointers should point to an element of 'localPrograms', but don't need to. unordered_map<string, Program*> programs; // Collection of Program objects scoped within the class for the sake of unambiguous memory management. vector<Program> localPrograms; // Always initialized "error shader" that can be fallen back on if another shader is missing or fails Program fallback; // Pointer to active shader which is currently bound in OpenGL Program* active; // Hardcoded fallback shadercode constexpr const static char* errorvs = "#version 330 core\n" "layout(location = 0) in vec4 vertPos;\n" "\n" "uniform mat4 P;\n" "uniform mat4 V;\n" "uniform mat4 M;\n" "\n" "void main()\n" "{\n" " gl_Position = P * V * M * vertPos;\n" "}\n" ; constexpr const static char* errorfs = "#version 330 core\n" "\n" "out vec4 color;\n" "\n" "void main()\n" "{\n" " vec3 col = vec3(1.0,0.0,1.0);\n" " color = vec4(col, 1.0);\n" "}\n" ; }; #endif
5cea8f24c1bcd265c368674eb81478594feb94ef
a20bc243e4a63bb08f84660051ca96e5c1e332c1
/src/Actor.h
77db146aa2ec81473d5473fedd380753456f447b
[]
no_license
zach2good/MetalRL
9a7bab0f6e7dfd00edf60cd15fca6d2dbaa48f59
3b54b10e4428b6b4ee343f482b47c0c65dab10b1
refs/heads/master
2020-04-02T09:58:08.905083
2018-11-16T22:46:50
2018-11-16T22:46:50
154,318,841
0
0
null
null
null
null
UTF-8
C++
false
false
1,618
h
Actor.h
// // Created by Zach Toogood on 13/11/2018. // #pragma once #include "common.h" #include "Log.h" class Actor : public GameObject { public: Actor(const char* name, int x, int y, int ch, const char* color) : name(name), GameObject(x, y, ch, color) { } void step(std::shared_ptr<Log> log) override { } void attack(std::shared_ptr<Actor> other, std::shared_ptr<Log> log) { std::string out; out += name + "(" + to_string(hp) + "hp): "; bool hit = false; // roll to hit int roll = r.roll(dice::d20); int toHitResult = roll + toHit; out += to_string(toHitResult) + " to hit. "; if (toHitResult >= other->ac) { hit = true; // roll damage; int damageRoll = r.roll(dice); if (roll == 20) damageRoll *= 2; other->hp -= damageRoll; out += to_string(damageRoll) + " damage. "; if (other->hp <= 0) { other->color = "red"; other->alive = false; } } hit ? log->alert(out) : log->message(out); } int distanceTo(std::shared_ptr<Actor> other) { auto _x = pow(x - other->x, 2); auto _y = pow(y - other->y, 2); return static_cast<int>(sqrt(_x + _y)); } bool inRange(std::shared_ptr<Actor> other) { return distanceTo(other) <= range; } std::string name; int ac = 10; int toHit = 0; dice dice = dice::d4; int hp = 10; int range = 1; bool alive = true; roller r; };
a2f216b957335bd759ef4429853faf17b71c0922
c8653c6404103867f04479ad0c47662adb19c29d
/ConsoleApplication6/ConsoleApplication6/Rectangle.cpp
7be47db0bc6caab745b1f8d4f79bdc7b1eb7f448
[]
no_license
Piter17/asasasas
37f3c91057d39b15d340a8aba381d28521ddb92a
0f93ee8eb1e8a9c0ae75e41bf17dc8d96ac2a642
refs/heads/master
2021-01-01T16:02:19.302963
2017-07-20T14:23:36
2017-07-20T14:23:36
97,760,815
0
0
null
null
null
null
UTF-8
C++
false
false
3,669
cpp
Rectangle.cpp
#include "stdafx.h" #include "Rectangle.h" Rectangle::Rectangle(coordType X, coordType Y, coordType W, coordType H, rotType Rotation, eTexture TextureId) { _rect = { X, Y, W, H }; _rot = Rotation; _color = al_map_rgb(255, 255, 255); SetTexture(TextureId); } Rectangle::Rectangle(coordRect Rect, rotType Rotation, eTexture TextureId) { _rect = Rect; _rot = Rotation; _color = al_map_rgb(255, 255, 255); SetTexture(TextureId); } Rectangle::Rectangle(coordType X, coordType Y, coordType W, coordType H, rotType Rotation, ALLEGRO_COLOR color) { _rect = { X, Y, W, H }; _rot = Rotation; Rectangle::SetColor(color); } Rectangle::Rectangle(coordRect Rect, rotType Rotation, ALLEGRO_COLOR color) { _rect = Rect; _rot = Rotation; Rectangle::SetColor(color); } void Rectangle::SetColor(ALLEGRO_COLOR color) { _color = color; _init_vtxs(); } void Rectangle::SetColor(float Brightness) { SetColor(al_map_rgb_f(Brightness, Brightness, Brightness)); } void Rectangle::SetTexture(eTexture Texture) { _textureId = Texture; _texture = Texture::GetTexture(Texture); _init_vtxs(); } void Rectangle::_draw() { ALLEGRO_BITMAP* tex = nullptr; if (auto texture = _texture.lock()) tex = texture->GetNative(); al_draw_prim(_vtxs, nullptr, tex, 0, 4, ALLEGRO_PRIM_TRIANGLE_FAN); } void Rectangle::_afterChangeCoords() { _recalculate_vtxs(); } void Rectangle::_recalculate_vtxs() { auto halfW = _rect.W / static_cast<coordType>(2.0); auto halfH = _rect.H / static_cast<coordType>(2.0); _vtxs[0].x = ((-halfW) * std::cos(_rot)) + (-halfH * std::sin(_rot)) + _rect.X; _vtxs[0].y = ((halfW)* std::sin(_rot)) + (-halfH * std::cos(_rot)) + _rect.Y; _vtxs[1].x = ((halfW)* std::cos(_rot)) + ((-halfH) * std::sin(_rot)) + _rect.X; _vtxs[1].y = ((-halfW)* std::sin(_rot)) + ((-halfH) * std::cos(_rot)) + _rect.Y; _vtxs[2].x = ((halfW)* std::cos(_rot)) + (halfH * std::sin(_rot)) + _rect.X; _vtxs[2].y = ((-halfW)* std::sin(_rot)) + (halfH * std::cos(_rot)) + _rect.Y; _vtxs[3].x = ((-halfW) * std::cos(_rot)) + (halfH * std::sin(_rot)) + _rect.X; _vtxs[3].y = ((halfW)* std::sin(_rot)) + (halfH * std::cos(_rot)) + _rect.Y; } void Rectangle::_init_vtxs() { coordRect rect = {0, 0, 0, 0}; bool hasTexture = false; if (auto texture = _texture.lock()) { rect = { 0, 0, texture->GetW(), texture->GetH() }; hasTexture = true; } auto halfW = _rect.W / static_cast<coordType>(2.0); auto halfH = _rect.H / static_cast<coordType>(2.0); _vtxs[0].x = ((-halfW) * std::cos(_rot)) + (-halfH * std::sin(_rot)) + _rect.X; _vtxs[0].y = ((halfW)* std::sin(_rot)) + (-halfH * std::cos(_rot)) + _rect.Y; _vtxs[0].z = 0; _vtxs[0].u = rect.X; _vtxs[0].v = rect.Y; _vtxs[0].color = _color; _vtxs[1].x = ((halfW)* std::cos(_rot)) + ((-halfH) * std::sin(_rot)) + _rect.X; _vtxs[1].y = ((-halfW)* std::sin(_rot)) + ((-halfH) * std::cos(_rot)) + _rect.Y; _vtxs[1].z = 0; _vtxs[1].u = rect.W; _vtxs[1].v = rect.Y; _vtxs[1].color = _color; _vtxs[2].x = ((halfW)* std::cos(_rot)) + (halfH * std::sin(_rot)) + _rect.X; _vtxs[2].y = ((-halfW)* std::sin(_rot)) + (halfH * std::cos(_rot)) + _rect.Y; _vtxs[2].z = 0; _vtxs[2].u = rect.W; _vtxs[2].v = rect.H; _vtxs[2].color = _color; _vtxs[3].x = ((-halfW) * std::cos(_rot)) + (halfH * std::sin(_rot)) + _rect.X; _vtxs[3].y = ((halfW)* std::sin(_rot)) + (halfH * std::cos(_rot)) + _rect.Y; _vtxs[3].z = 0; _vtxs[3].u = rect.X; _vtxs[3].v = rect.H; _vtxs[3].color = _color; }
4240de6c8f3b6479b9b1164916ddbad6c53f9165
b62b5d5b5a5b76624bf6395c22066ae6c51950f0
/PanelGUI.cpp
4f1d9257c71bc2ccc7a86329a943c20204259fe0
[]
no_license
CalicoSpartan/ImmerseEngine
9268a7cb7cd24a7a157e82d0ce05f0b975a68ba9
b2f6b587c27aee07785f8bb4dc5b92e7335e507d
refs/heads/master
2021-07-16T03:46:52.517990
2018-10-27T02:10:32
2018-10-27T02:10:32
135,935,705
0
0
null
null
null
null
UTF-8
C++
false
false
2,096
cpp
PanelGUI.cpp
#include "PanelGUI.h" #include "ImmerseText.h" PanelGUI::PanelGUI(float x, float y, float width, float height) { meshData.Vertices.resize(4); meshData.Indices32.resize(6); // Position coordinates specified in NDC space. meshData.Vertices[0] = GeometryGenerator::Vertex( x, y - height, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f); meshData.Vertices[1] = GeometryGenerator::Vertex( x, y, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f); meshData.Vertices[2] = GeometryGenerator::Vertex( x + width, y, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f); meshData.Vertices[3] = GeometryGenerator::Vertex( x + width, y - height, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f); meshData.Indices32[0] = 0; meshData.Indices32[1] = 1; meshData.Indices32[2] = 2; meshData.Indices32[3] = 0; meshData.Indices32[4] = 2; meshData.Indices32[5] = 3; this->x = x; this->y = y; this->width = width; this->height = height; collapsedHeight = .1f; originalHeight = height; position.x = x; position.y = y; ChangeSize(bIsClosed); instanceCount = 1; } void PanelGUI::OnInvisible(bool bVisible) { bIsVisible = bVisible; if (myTitle != nullptr) { myTitle->bIsVisible = bVisible; } } void PanelGUI::ChangeSize(bool bClose) { if (bClose) { height = collapsedHeight; meshData.Vertices[3].Position = XMFLOAT3(x + width, y - height, 0.0f); meshData.Vertices[0].Position = XMFLOAT3(x, y - height, 0.0f); bIsClosed = true; for (auto n : scrollBoxes) { n->OnInvisible(false); } for (auto n : buttons) { n->OnInvisible(false); } if (myTitle != nullptr) { //myTitle->bVisible = false; } } else { height = originalHeight; meshData.Vertices[3].Position = XMFLOAT3(x + width, y - height, 0.0f); meshData.Vertices[0].Position = XMFLOAT3(x, y - height, 0.0f); bIsClosed = false; for (auto n : scrollBoxes) { n->OnInvisible(true); } for (auto n : buttons) { n->OnInvisible(true); } if (myTitle != nullptr) { //myTitle->bVisible = true; } } }
e624d5fb2e685e4a2286611f61aa4ffb8536762e
3525c13d3995f48640feb113e28787884eb2be47
/Networking/Assignment2-ConcurrentBlackJack/Assignment2-ConcurrentBlackJack/BlackjackGame.cpp
e3f2e0c65a83ac177e258fb90b45322a6ba9b8fa
[]
no_license
james-zinger/HumberCollegeGAMEWinter2014
5d144ad52e06cc20abf07a123484b4cfaf47b1bc
a4f8e1bef685acbc6a418459d3043181bfa807d2
refs/heads/master
2021-05-27T09:12:33.037316
2014-03-29T01:25:06
2014-03-29T01:25:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,937
cpp
BlackjackGame.cpp
/////////////////////////////////////////////////////////// // BlackjackGame.cpp // Implementation of the Class BlackjackGame // Created on: 14-Mar-2014 5:29:06 PM // Original author: James /////////////////////////////////////////////////////////// #include "BlackjackGame.h" #include "TCPGameServer.h" #include <boost/thread.hpp> namespace Blackjack { BlackjackGame::BlackjackGame( BlackjackPlayer* player, int maxPlayers) { srand( time( NULL ) ); //seed the random number generator m_Deck.Populate(); m_Deck.Shuffle(); m_Deck.Deal( m_House ); //hide house's first card m_House.FlipFirstCard(); AddPlayer( player ); MaxPlayers(maxPlayers); TCPGameServer::Instance()->Games().push_back(this); } BlackjackGame::~BlackjackGame() { } void BlackjackGame::Play() { if ( isGameEmpty() ) return; while ( true ) { if ( isGameEmpty() ) return; bool isPlayersReady = true; for (auto it = Players().begin(); it != Players().end(); ++it) { } } //display everyone's hand //for ( pPlayer = m_players.begin(); pPlayer != m_players.end(); ++pPlayer ) // cout << *pPlayer << endl; //cout << m_House << endl; //deal additional cards to players for ( auto pPlayer = m_players.begin(); pPlayer != m_players.end(); ++pPlayer ) m_Deck.AdditionalCards( **pPlayer ); //reveal house's first card m_House.FlipFirstCard(); cout << endl << m_House; //deal additional cards to house m_Deck.AdditionalCards( m_House ); if ( m_House.IsBusted() ) { //everyone still playing wins for ( auto pPlayer = m_players.begin(); pPlayer != m_players.end(); ++pPlayer ) if ( !( ( *pPlayer )->IsBusted() ) ) ( *pPlayer )->Win(); } else { //compare each player still playing to house for ( auto pPlayer = m_players.begin(); pPlayer != m_players.end(); ++pPlayer ) if ( !( ( *pPlayer )->IsBusted() ) ) { if ( ( *pPlayer )->GetTotal() > m_House.GetTotal() ) ( *pPlayer )->Win(); else if ( ( *pPlayer )->GetTotal() < m_House.GetTotal() ) ( *pPlayer )->Lose(); else ( *pPlayer )->Push(); } } //remove everyone's cards for ( auto pPlayer = m_players.begin(); pPlayer != m_players.end(); ++pPlayer ) ( *pPlayer )->Clear(); m_House.Clear(); } void BlackjackGame::GameThreadFunc( TCPGameServer* server ) { ThreadID( GetCurrentThreadId() ); GameServer( server ); Play(); } bool BlackjackGame::AddPlayer( BlackjackPlayer* player ) { if (Players().size() < MaxPlayers()) { Players().push_back( player ); Deck().Deal( *player ); return true; } return false; } void BlackjackGame::RemovePlayer( BlackjackPlayer* player ) { for ( auto it = Players().begin(); it != Players().end(); ++it ) { if ( ( *it ) == player ) { Players().erase( it ); } } } bool BlackjackGame::isGameEmpty() { return (Players().size() == 0); } }
5d3bc854900024ff01fa875af3c3d29f672a8a92
1e8ecbf2948996076dff5a80a96b19e72a9a5714
/QuickHullLib/ConvexHullSolver.h
5d03887480aca534732423449d0a790a6692697d
[]
no_license
drakeor/Convex-Hull-Solver
a19a23098522357a255a7fe8cff0f3e80d795f6a
18b3df17df16fe544d6fe8f2cd0b9bc5f7c19d47
refs/heads/master
2021-04-12T04:20:42.612483
2018-03-19T08:50:59
2018-03-19T08:50:59
125,768,002
0
0
null
null
null
null
UTF-8
C++
false
false
679
h
ConvexHullSolver.h
#pragma once #include <vector> #include "HullPoint.h" #include "HullLine.h" class ConvexHullSolver { protected: long totalNumberOfSteps; long pointCount; std::vector<HullPoint> points; std::vector<HullLine> lines; long cPoint1; long cPoint2; bool isConvex; public: ConvexHullSolver(std::vector<HullPoint> Points); ~ConvexHullSolver(); long GetTotalNumberOfSteps(); std::vector<HullPoint> GetCurrentPoints(); std::vector<HullLine> GetCurrentLines(); HullPoint* GetPoint(long id); long GetPoint1(); long GetPoint2(); long GetPointCount(); bool IsConvex(); virtual bool Step() = 0; virtual std::string GetName() = 0; std::vector<HullLine> Solve(); };
0e021db73ad0060e095832300b91573aef522bee
29b9127ce7ac961fd673061d3d6f4b3ea8d22fb9
/src/collisionDetection/engine/CollisionDetection.h
64a53aa47c07085536f405821c0d6418729db1e1
[ "Zlib" ]
permissive
MostafaHassan/Robograde
460379d7af19d0f30ab6995e43540d9103a6325d
2c9a7d0b8250ec240102d504127f5c54532cb2b0
refs/heads/master
2023-07-15T19:37:49.943853
2015-10-10T21:06:35
2015-10-10T21:06:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,347
h
CollisionDetection.h
/************************************************** Zlib Copyright 2015 Ola Enberg ***************************************************/ #pragma once #include "../ICollisionDetection.h" #include <memory/Alloc.h> #include "../entity/Entity.h" #include "../detection/IntersectionTestLookupTable.h" class CollisionDetection : public ICollisionDetection { public: ~CollisionDetection (); void Shutdown () override; void Step () override; void PickingWithRay ( glm::vec3& rayPosition, glm::vec3& rayDirection, const rVector<int>& pickAgainstGroupsIDs, rVector<unsigned int>& outEntities, glm::vec3* outPosition ) override; void PickingWithFrustum ( glm::vec3 (&planePositions)[6], glm::vec3 (&planeNormals)[6], const rVector<int>& pickAgainstGroupsIDs, rVector<unsigned int>& outIntersections ) override; void SetGroupsAffectedByFog ( const rVector<int>& groupsAffectedByFog ) override; void SetFogOfWarInfo ( const rVector<rVector<bool>>& texture, const glm::ivec2& textureSize, const glm::vec2& tileSize ) override; ICollisionEntity* CreateEntity () override; void DestroyEntity ( ICollisionEntity* entity ) override; void AddCollisionVolumeRay ( ICollisionEntity* entity, const glm::vec3& position, const glm::vec3& direction ) override; void AddCollisionVolumeOBB ( ICollisionEntity* entity, const glm::vec3& position, const glm::vec3 (&directions)[3] ) override; void AddCollisionVolumePlane ( ICollisionEntity* entity, const glm::vec3& position, const glm::vec3& normal ) override; void AddCollisionVolumeSphere ( ICollisionEntity* entity, const glm::vec3& position, const float radius ) override; void AddCollisionVolumeHeightMap ( ICollisionEntity* entity, GetTerrainHeightFunction getTerrainHeightFunction ) override; private: void PickingWithVolume ( Volume* pickingVolume, const rVector<int>& pickAgainstGroupsIDs, rVector<unsigned int>& outEntities, glm::vec3* outPosition, bool pickClosest ); bool CalcVisibilityForPosition ( const glm::vec3& position ) const; rVector<Entity*> m_Entities; IntersectionTestLookupTable m_TestLookup; rVector<int> m_GroupsAffectedByFog; rVector<rVector<bool>> m_FogOfWarTexture; glm::ivec2 m_FogOfWarTextureSize; glm::vec2 m_FogOfWarTileSize; };
a4f83aba60a9efcd5808754db147385f2812a326
2524f2b9bc706e881229d65a2b10c1adc8ec5a6e
/RobotArdu/src/test/resources/ast/actions/arduino_rgb_led_test.ino
4cf40a7419d1c437d034fa67a464d55a6bc5b273
[ "MIT", "GPL-3.0-only", "Apache-2.0" ]
permissive
rohit-bindal/openroberta-lab
13831724073cc355db19ad804010924ade09a1b2
7ed823538e34b3dbee93a902b61630c39f8909a3
refs/heads/master
2020-12-18T11:42:30.766451
2020-01-21T16:57:58
2020-01-21T16:57:58
235,364,711
3
0
Apache-2.0
2020-01-21T14:42:53
2020-01-21T14:42:53
null
UTF-8
C++
false
false
968
ino
arduino_rgb_led_test.ino
// This file is automatically generated by the Open Roberta Lab. #include <math.h> #include <NEPODefs.h> unsigned int ___item; unsigned int ___item2; unsigned int ___item3; int _led_red_R = 5; int _led_green_R = 6; int _led_blue_R = 3; void setup() { Serial.begin(9600); pinMode(_led_red_R, OUTPUT); pinMode(_led_green_R, OUTPUT); pinMode(_led_blue_R, OUTPUT); ___item = RGB(0xFF, 0xFF, 0xFF); ___item2 = ___item; ___item3 = RGB(120, 120, 120); } void loop() { analogWrite(_led_red_R, 204); analogWrite(_led_green_R, 0); analogWrite(_led_blue_R, 0); analogWrite(_led_red_R, RCHANNEL(___item)); analogWrite(_led_green_R, GCHANNEL(___item)); analogWrite(_led_blue_R, BCHANNEL(___item)); analogWrite(_led_red_R, 120); analogWrite(_led_green_R, 120); analogWrite(_led_blue_R, 120); analogWrite(_led_red_R, 0); analogWrite(_led_green_R, 0); analogWrite(_led_blue_R, 0); }
abff00e5d050088f4be356958fba67aa71666656
d549434afc05a64daf758b82c98ca23fcc43876e
/map_elem.cpp
357ffe4d00ee6f6c70a8e5089dce4de7dbd5ac36
[]
no_license
badoll/Sokoban
3a6dcf6f007115e5a8c1eb9612871f01b2c0ffe6
5a185827d2e6e3f2011b941928568c77c759cbbf
refs/heads/master
2020-11-27T04:15:12.118518
2019-12-20T16:48:01
2019-12-20T16:48:01
229,300,434
0
0
null
null
null
null
UTF-8
C++
false
false
952
cpp
map_elem.cpp
#include "map_elem.h" void map_elem::move(int dir) { switch (dir) { case UP: { y--; break; } case DOWN: { y++; break; } case LEFT: { x--; break; } case RIGHT: { x++; } } } bool map_elem::is_movable(int dir, const int **map) { switch (dir) { case UP: if (y-1 >= 0 && (map[x][y-1] == ACCESS || map[x][y-1] == DEST)) return true; break; case DOWN: if (y+1 < MAP_HEIGHT && (map[x][y+1] == ACCESS || map[x][y+1] == DEST)) return true; break; case LEFT: if (x-1 >= 0 && (map[x-1][y] == ACCESS || map[x-1][y] == DEST)) return true; break; case RIGHT: if (x+1 < MAP_WIDTH && (map[x+1][y] == ACCESS || map[x+1][y] == DEST)) return true; break; } return false; }
ab4acec243d401123a460054db5ea871127536a3
5b2953ac5e58d502e682e34931a45657d71c2744
/SFCGAL/include/SFCGAL/MultiPolygon.h
b9c71279717180ee2b7f85bc6a047a67f389a009
[]
no_license
cuulee/sfcgal-with-postgis
3817bae920dbf0da5d8ede6dd653670170a15836
25bbaf83316f62208da7544e8f6dab816fa0d293
refs/heads/master
2020-03-12T12:54:45.005274
2012-06-11T09:33:54
2012-06-11T09:33:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
962
h
MultiPolygon.h
#ifndef _SFCGAL_MULTIPOLYGON_H_ #define _SFCGAL_MULTIPOLYGON_H_ #include <vector> #include <boost/assert.hpp> #include <SFCGAL/Polygon.h> #include <SFCGAL/GeometryCollection.h> namespace SFCGAL { /** * A MultiPolygon in SFA. * * @ŧodo add polygon() etc. */ class MultiPolygon : public GeometryCollection { public: /** * Empty MultiPolygon constructor */ MultiPolygon() ; /** * Copy constructor */ MultiPolygon( MultiPolygon const& other ) ; /** * assign operator */ MultiPolygon& operator = ( const MultiPolygon & other ) ; /** * destructor */ virtual ~MultiPolygon() ; //-- SFCGAL::Geometry virtual MultiPolygon * clone() const ; //-- SFCGAL::Geometry virtual std::string geometryType() const ; //-- SFCGAL::Geometry virtual GeometryType geometryTypeId() const ; protected: //-- SFCGAL::GeometryCollection virtual bool isAllowed( Geometry const& g ) ; }; } #endif
91a456bb3f846157d3bbd03636315d1bab8c999a
81bf548ee9a4a9bc506782ba4b8e5632d16bf86a
/src/sdktools/maya/valveMaya/VsVguiWindow.cpp
572f5a14d23591f00ba523292e8c2d2d8f3f2add
[]
no_license
hackovh/-
f6b83e6a1c514f8b452d4d14f932d452e4b4110d
72286069ef9dd5975448cc6fe4c5911734edabe6
refs/heads/master
2020-05-19T06:12:56.778623
2019-05-04T07:57:52
2019-05-04T07:57:52
184,868,637
4
1
null
null
null
null
WINDOWS-1252
C++
false
false
15,333
cpp
VsVguiWindow.cpp
//===== Copyright © 1996-2006, Valve Corporation, All rights reserved. ======// // // Base class for windows that draw vgui in Maya // //===========================================================================// #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. #define _WIN32_WINNT 0x0501 // This means target Windows XP or later. (Subclassing windows requires XP) #endif #include "vsvguiwindow.h" #include "valvemaya.h" #include <windows.h> #include <commctrl.h> #include "tier0/dbg.h" #include "tier3/tier3.h" #include "materialsystem/IMaterialSystem.h" #include "vgui/IVGui.h" #include "vgui/ISurface.h" #include "vgui/ISystem.h" #include "vgui_controls/phandle.h" #include "vgui_controls/EditablePanel.h" #include "vgui_controls/AnimationController.h" #include "vgui_controls/phandle.h" #include "VGuiMatSurface/IMatSystemSurface.h" #include "imayavgui.h" #include "inputsystem/iinputsystem.h" #include "maya/mtimermessage.h" //----------------------------------------------------------------------------- // Name to look for when attaching to a window //----------------------------------------------------------------------------- #define VGUI_WINDOW_NAME "vsVGuiWindow" //----------------------------------------------------------------------------- // Window class for windows that draw vgui panels in Maya //----------------------------------------------------------------------------- class CVsVGuiWindow { public: CVsVGuiWindow(); virtual ~CVsVGuiWindow(); // Sets the main panel for the window void SetMainPanel( vgui::EditablePanel *pPanel ); vgui::EditablePanel *GetMainPanel(); // Attaches to/detaches from a particular window void Attach( ); void Detach(); protected: // Paints the window void PaintWindow(); private: // Windows messages callback LRESULT WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); LRESULT ParentWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); // Locate window to attach to HWND GetMayaWindow( const char *pWindowName ); // Locate window to key focus control to HWND GetKeyFocusWindow( HWND hRenderWindow ); void Tick( float flElapsedTime ); static LRESULT CALLBACK SubclassCallback( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData ); static LRESULT CALLBACK KeyFocusSubclassCallback( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData ); static BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam ); static BOOL CALLBACK EnumKeyFocusChildProc( HWND hWnd, LPARAM lParam ); static void MayaTimerFunc( float flElapsedTime, float flLastTime, void* clientData ); HWND m_hWnd; HWND m_hKeyFocusWnd; int m_hVGuiContext; float m_flRenderDelayTime; int m_nCurrentTick; int m_nLastRenderedTick; MCallbackId m_hTimerCallbackId; vgui::DHANDLE<vgui::EditablePanel> m_hMainPanel; static const UINT_PTR s_subclassId; }; //----------------------------------------------------------------------------- // Some random number, that and the callback pointer identify things //----------------------------------------------------------------------------- const UINT_PTR CVsVGuiWindow::s_subclassId(0xab01265); //----------------------------------------------------------------------------- // Constructor, destructor //----------------------------------------------------------------------------- CVsVGuiWindow::CVsVGuiWindow() { m_nLastRenderedTick = -1; m_nCurrentTick = 0; m_hTimerCallbackId = 0; m_flRenderDelayTime = 0.0f; m_hWnd = NULL; m_hKeyFocusWnd = NULL; m_hVGuiContext = vgui::DEFAULT_VGUI_CONTEXT; } CVsVGuiWindow::~CVsVGuiWindow() { Detach(); } //----------------------------------------------------------------------------- // Subclassed Parent Callback //----------------------------------------------------------------------------- LRESULT CVsVGuiWindow::ParentWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { // This is necessary because keyboard input is controlled by the 'focus hole' window switch ( uMsg ) { case WM_CHAR: case WM_SYSCHAR: case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: if ( hWnd == m_hKeyFocusWnd ) return SendMessage( m_hWnd, uMsg, wParam, lParam ); break; case WM_GETDLGCODE: return DLGC_WANTALLKEYS | DLGC_WANTCHARS | DLGC_WANTARROWS | DLGC_WANTTAB; // forward all keyboard into to vgui panel case WM_SETFOCUS: if ( hWnd == m_hKeyFocusWnd ) { g_pMayaVGui->SetFocus( m_hWnd, m_hVGuiContext ); } break; case WM_KILLFOCUS: if ( hWnd == m_hKeyFocusWnd ) { if ( g_pMayaVGui->HasFocus( m_hWnd ) ) { g_pMayaVGui->SetFocus( NULL, 0 ); } } break; } return ::DefSubclassProc( hWnd, uMsg, wParam, lParam ); } //----------------------------------------------------------------------------- // Subclassed Window Callback //----------------------------------------------------------------------------- LRESULT CVsVGuiWindow::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { switch ( uMsg ) { case WM_NCDESTROY: // WM_NCDESTROY is the last message, detach the object from the window handle if ( hWnd == m_hWnd ) { Detach(); LRESULT lr = ::DefSubclassProc( hWnd, uMsg, wParam, lParam ); delete this; return lr; } break; case WM_GETDLGCODE: return DLGC_WANTALLKEYS | DLGC_WANTCHARS; // forward all keyboard into to vgui panel case WM_SETCURSOR: return 1; // don't pass WM_SETCURSOR case WM_MOUSEACTIVATE: if ( hWnd == m_hWnd ) { HWND hFocus = GetFocus(); if ( hFocus != m_hKeyFocusWnd ) { SetFocus( m_hKeyFocusWnd ); } return MA_ACTIVATE; } break; case WM_SETFOCUS: if ( hWnd == m_hWnd ) { g_pMayaVGui->SetFocus( m_hWnd, m_hVGuiContext ); return 0; } break; case WM_KILLFOCUS: if ( hWnd == m_hWnd ) { if ( g_pMayaVGui->HasFocus( m_hWnd ) ) { g_pMayaVGui->SetFocus( NULL, 0 ); } return 0; } break; case WM_PAINT: if ( hWnd == m_hWnd ) { PaintWindow(); return 0; } break; } return ::DefSubclassProc( hWnd, uMsg, wParam, lParam ); } //----------------------------------------------------------------------------- // Subclassed Window Callback //----------------------------------------------------------------------------- LRESULT CALLBACK CVsVGuiWindow::SubclassCallback( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData ) { // Call the SubclassedWindow object that is attached to this window CVsVGuiWindow *pCVsVGuiWindow( (CVsVGuiWindow *)dwRefData ); if ( pCVsVGuiWindow ) return pCVsVGuiWindow->WndProc( hWnd, uMsg, wParam, lParam ); return 0; } //----------------------------------------------------------------------------- // Subclassed Window Callback //----------------------------------------------------------------------------- LRESULT CALLBACK CVsVGuiWindow::KeyFocusSubclassCallback( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData ) { // Call the SubclassedWindow object that is attached to this window CVsVGuiWindow *pCVsVGuiWindow( (CVsVGuiWindow *)dwRefData ); if ( pCVsVGuiWindow ) return pCVsVGuiWindow->ParentWndProc( hWnd, uMsg, wParam, lParam ); return 0; } //----------------------------------------------------------------------------- // Callback for enumerating windows via EnumChildWindows to search for the // proper window pane in Maya with the content "Vst ModelBrowser" //----------------------------------------------------------------------------- static const char *s_pWindowName; BOOL CALLBACK CVsVGuiWindow::EnumChildProc( HWND hWnd, LPARAM lParam ) { char str[1024]; // Make sure the window text matches ::GetWindowText( hWnd, str, sizeof(str) ); if ( Q_strcmp( str, s_pWindowName ) ) return TRUE; DWORD_PTR ptr; if ( GetWindowSubclass( hWnd, SubclassCallback, s_subclassId, &ptr ) ) return TRUE; *(HWND*)lParam = hWnd; return FALSE; } BOOL CALLBACK CVsVGuiWindow::EnumKeyFocusChildProc( HWND hWnd, LPARAM lParam ) { // Make sure the window text matches char str[1024]; ::GetWindowText( hWnd, str, sizeof(str) ); if ( Q_stricmp( str, "focushole" ) ) return TRUE; *(HWND*)lParam = hWnd; return FALSE; } //----------------------------------------------------------------------------- // Locate window to attach to //----------------------------------------------------------------------------- HWND CVsVGuiWindow::GetMayaWindow( const char *pWindowName ) { // Find the window to attach to. // The window has a child window with a particular name HWND subclassHWnd = NULL; s_pWindowName = pWindowName; EnumChildWindows( ::GetDesktopWindow(), EnumChildProc, ( long )&subclassHWnd ); if ( !subclassHWnd ) { Error( "Can't find window \"%s\"\n", pWindowName ); return NULL; } return subclassHWnd; } //----------------------------------------------------------------------------- // Locate window to key focus control to //----------------------------------------------------------------------------- HWND CVsVGuiWindow::GetKeyFocusWindow( HWND hRenderWindow ) { // The parent window is the one that has keyboard focus, and deals with input HWND hParentWnd = GetParent( hRenderWindow ); if ( !hParentWnd ) return NULL; HWND hGrandparentWnd = GetParent( hParentWnd ); if ( !hGrandparentWnd ) return hParentWnd; HWND kKeyFocusWnd = 0; EnumChildWindows( hGrandparentWnd, EnumKeyFocusChildProc, ( long )&kKeyFocusWnd ); return kKeyFocusWnd ? kKeyFocusWnd : hParentWnd; } //----------------------------------------------------------------------------- // Sets a panel to be the main panel //----------------------------------------------------------------------------- void CVsVGuiWindow::SetMainPanel( vgui::EditablePanel * pPanel ) { Assert( m_hMainPanel.Get() == NULL ); Assert( m_hVGuiContext == vgui::DEFAULT_VGUI_CONTEXT ); m_hMainPanel = pPanel; m_hMainPanel->SetParent( vgui::surface()->GetEmbeddedPanel() ); m_hMainPanel->SetVisible( true ); m_hMainPanel->SetCursor( vgui::dc_arrow ); m_hVGuiContext = vgui::ivgui()->CreateContext(); vgui::ivgui()->AssociatePanelWithContext( m_hVGuiContext, m_hMainPanel->GetVPanel() ); pPanel->InvalidateLayout(); EnableWindow( m_hWnd, true ); SetFocus( m_hWnd ); } vgui::EditablePanel *CVsVGuiWindow::GetMainPanel() { return m_hMainPanel.Get(); } //----------------------------------------------------------------------------- // Called by maya to update the window //----------------------------------------------------------------------------- void CVsVGuiWindow::MayaTimerFunc( float flElapsedTime, float flLastTime, void* clientData ) { CVsVGuiWindow* pVGuiWindow = (CVsVGuiWindow*)clientData; pVGuiWindow->Tick( flElapsedTime ); } void CVsVGuiWindow::Tick( float flElapsedTime ) { m_flRenderDelayTime -= flElapsedTime; g_pInputSystem->PollInputState(); vgui::ivgui()->RunFrame(); // run vgui animations vgui::GetAnimationController()->UpdateAnimations( vgui::system()->GetCurrentTime() ); // Ensures we give time to the other windows to render if ( m_flRenderDelayTime > 0.0f ) return; ++m_nCurrentTick; InvalidateRect( m_hWnd, NULL, TRUE ); } //----------------------------------------------------------------------------- // Attaches to/detaches from a particular window //----------------------------------------------------------------------------- void CVsVGuiWindow::Attach( ) { // Find the window to attach to. It's got a specific name, so we can use that // to find the window m_hWnd = GetMayaWindow( VGUI_WINDOW_NAME ); if ( !m_hWnd ) return; // Maya appears to have a special window we must hook to in order to deal with keyboard focus m_hKeyFocusWnd = GetKeyFocusWindow( m_hWnd ); // Subclass The Window if ( !::SetWindowSubclass( m_hWnd, SubclassCallback, s_subclassId, (DWORD_PTR)this ) ) { Warning( "Unable to subclass window!\n" ); return; } // Subclass The Window if ( m_hKeyFocusWnd ) { if ( !::SetWindowSubclass( m_hKeyFocusWnd, KeyFocusSubclassCallback, s_subclassId, (DWORD_PTR)this ) ) { Warning( "Unable to subclass key focus window!\n" ); return; } } g_pMaterialSystem->AddView( m_hWnd ); m_hTimerCallbackId = MTimerMessage::addTimerCallback( 0.015f, MayaTimerFunc, this ); } //----------------------------------------------------------------------------- // main application //----------------------------------------------------------------------------- void CVsVGuiWindow::Detach() { if ( m_hTimerCallbackId != 0 ) { MTimerMessage::removeCallback( m_hTimerCallbackId ); m_hTimerCallbackId = 0; } if ( m_hMainPanel.Get() ) { m_hMainPanel->MarkForDeletion(); m_hMainPanel = NULL; } if ( m_hVGuiContext != vgui::DEFAULT_VGUI_CONTEXT ) { vgui::ivgui()->DestroyContext( m_hVGuiContext ); m_hVGuiContext = vgui::DEFAULT_VGUI_CONTEXT; } // detach if ( m_hWnd ) { // kill the timer if any g_pMaterialSystem->RemoveView( m_hWnd ); RemoveWindowSubclass( m_hWnd, SubclassCallback, s_subclassId ); m_hWnd = NULL; } if ( m_hKeyFocusWnd ) { RemoveWindowSubclass( m_hKeyFocusWnd, KeyFocusSubclassCallback, s_subclassId ); m_hKeyFocusWnd = NULL; } } //----------------------------------------------------------------------------- // main application //----------------------------------------------------------------------------- void CVsVGuiWindow::PaintWindow() { if ( m_nCurrentTick == m_nLastRenderedTick || !g_pVGui->IsRunning() ) { ValidateRect( m_hWnd, NULL ); return; } m_nCurrentTick = m_nLastRenderedTick; vgui::VPANEL root = g_pVGuiSurface->GetEmbeddedPanel(); g_pVGuiSurface->Invalidate( root ); RECT windowRect; CMatRenderContextPtr pRenderContext( g_pMaterialSystem ); ::GetClientRect( m_hWnd, &windowRect ); g_pMaterialSystem->SetView( m_hWnd ); pRenderContext->Viewport( 0, 0, windowRect.right, windowRect.bottom ); float flStartTime = Plat_FloatTime(); pRenderContext->ClearColor4ub( 76, 88, 68, 255 ); pRenderContext->ClearBuffers( true, true ); g_pMaterialSystem->BeginFrame( 0 ); // draw from the main panel down if ( m_hMainPanel.Get() ) { int w, h; m_hMainPanel->GetSize( w, h ); if ( w != windowRect.right || h != windowRect.bottom ) { m_hMainPanel->SetBounds( 0, 0, windowRect.right, windowRect.bottom ); m_hMainPanel->Repaint(); } g_pVGuiSurface->RestrictPaintToSinglePanel( m_hMainPanel->GetVPanel() ); g_pVGuiSurface->PaintTraverseEx( root, true ); g_pVGuiSurface->RestrictPaintToSinglePanel( 0 ); } g_pMaterialSystem->EndFrame(); g_pMaterialSystem->SwapBuffers(); g_pMaterialSystem->SetView( NULL ); ValidateRect( m_hWnd, NULL ); m_flRenderDelayTime = Plat_FloatTime() - flStartTime; m_flRenderDelayTime = max( m_flRenderDelayTime, 0.015f ); } //----------------------------------------------------------------------------- // Creates, destroys a maya vgui window //----------------------------------------------------------------------------- void CreateMayaVGuiWindow( vgui::EditablePanel *pRootPanel, const char *pPanelName ) { CVsVGuiWindow *pVGuiWindow = new CVsVGuiWindow; pVGuiWindow->Attach( ); pVGuiWindow->SetMainPanel( pRootPanel ); } void DestroyMayaVGuiWindow( const char *pPanelName ) { }
a1aa8100890886383bc78f4227d6def1373ad6a0
9844e4c7b35441c7d90e1f244edf6d8d8a45082a
/SrandEngine/SrandEngine/ECS/Component.h
17be139ce4ddc10111340bbf2541ce9f684eb8e1
[]
no_license
DarkFace99/GameProject01_2020
3cff971baa5ad4bf97cef7f78990e2855edd611f
e59bbfead0cfb29f75db9e07db09bcd49db7aba5
refs/heads/master
2023-04-24T19:23:54.962671
2021-05-14T23:48:49
2021-05-14T23:48:49
288,905,490
0
0
null
null
null
null
UTF-8
C++
false
false
300
h
Component.h
#pragma once class GameObject; class Component { public: Component() = default; virtual ~Component() = default; GameObject* gameObject = nullptr; // The game object that this component will be attached virtual bool Init() { return true; } virtual void Draw() {} virtual void Update() {} };
17446b18db7c88eda9ccf1519d31042f4c3c13e4
6cd12c10c123ab178c282fa8848d4eda03a45284
/HardCodeNode/HardCodeNode.ino
87462ab4c4efed62b96bb5a00a9045fb0acb3c25
[]
no_license
nileshkulkarni/StreelLighting
3ff8c7ca893e3350d5d154e15542771b65b43144
bb4e9bce466da03403f265f83f99c6b8fdbe6af7
refs/heads/master
2021-01-01T19:39:10.755896
2015-04-23T03:54:08
2015-04-23T03:54:08
34,185,660
0
0
null
null
null
null
UTF-8
C++
false
false
9,400
ino
HardCodeNode.ino
/** * Copyright (c) 2009 Andrew Rapp. All rights reserved. * * This file is part of XBee-Arduino. * * XBee-Arduino is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * XBee-Arduino 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 XBee-Arduino. If not, see <http://www.gnu.org/licenses/>. */ #include <XBee.h> #include <SoftwareSerial.h> #include <Timer.h> #define CONF_SYN 10 #define CONF_ACK 11 #define SWITCH_ON 1 #define SWITCH_ON_ACK 2 #define MAX_NBRS 5 #define READ_TIMEOUT 10 #define LED_ON_COST 10000 #define MIN_ON_TIME 5000 int ID = 0; /* This example is for Series 1 XBee (802.15.4) Receives either a RX16 or RX64 packet and sets a PWM value based on packet data. Error led is flashed if an unexpected packet is received */ uint8_t payload[] = {0}; //enum SIDE{ LEFT, RIGHT,UNDEFINED}; // 64-bit addressing: This is the SH + SL address of remote XBee //XBeeAddress64 addr64 = XBeeAddress64(0x00, 0xFFFF); XBeeAddress64 addr64; // unless you have MY on the receiving radio set to FFFF, this will be received as a RX16 packet //Tx64Request tx = Tx64Request(addr64, payload, sizeof(payload)); Tx64Request tx; TxStatusResponse txStatus = TxStatusResponse(); typedef struct { uint32_t DH; uint32_t DL; int strength; } NodeDetails; NodeDetails* nbrList = (NodeDetails*)malloc(MAX_NBRS*sizeof(NodeDetails)); int noOfNbrs=0; XBee xbee = XBee(); XBeeResponse response = XBeeResponse(); // create reusable response objects for responses we expect to handle Rx16Response rx16 = Rx16Response(); Rx64Response rx64 = Rx64Response(); int statusLed = 13; int errorLed = 12; int dataLed = 9; int sensorpin = 0; int sensorVal = 0; // variable to store the values from sensor(initially zero) unsigned long meanArrivalTime = 20000; int passingCount = 0; int passing = 0; bool on = 0; int offEventID = -1; Timer t; unsigned long lastTime = 0; void autoConfiguration(){ for (int i=0;i<MAX_NBRS;i++) nbrList[i].DH = 1286656; nbrList[0].DL = 1076992318; nbrList[1].DL = 1081531030; nbrList[2].DL = 1081529831; nbrList[3].DL = 1080095032; nbrList[4].DL = 1081531434; } void reSend(){ } void signalOn(){ Serial.println("Sending to nbrs that found a car"); for(int i=ID-1;i<=ID+1;i++) { if(i>=0 && i<MAX_NBRS && i!= ID) { addr64 = XBeeAddress64(nbrList[i].DH, nbrList[i].DL); payload[0] = SWITCH_ON; tx = Tx64Request(addr64, payload, sizeof(payload)); xbee.send(tx); Serial.print("sending to "); Serial.println(i); } } } void turnOff(){ on = false; digitalWrite(statusLed,LOW); Serial.print("Current Time: "); Serial.println(millis()); Serial.println("turning off"); //delay(100000); } void sensing() { // Serial.println(millis()); sensorVal = analogRead(sensorpin); //Serial.println(sensorVal); if(passing == 0 && sensorVal > 200) { passing = 1; passingCount = 0; Serial.print("Incoming"); Serial.println(millis()); } else if(passing == 1 && sensorVal >= 200) { if(passingCount >= 2) { passing = 2; meanArrivalTime = 0.5 * ( millis() - lastTime) + 0.5* meanArrivalTime; Serial.print("u mean "); Serial.println(meanArrivalTime); lastTime= millis(); t.stop(offEventID); on = true; digitalWrite(statusLed, HIGH); signalOn(); if(meanArrivalTime > LED_ON_COST) { Serial.print("offing after "); Serial.println(MIN_ON_TIME); Serial.print("offing event scheduled at: "); Serial.println(MIN_ON_TIME+millis()); offEventID = t.after((unsigned long)MIN_ON_TIME,turnOff); } else { offEventID = t.after(2*LED_ON_COST - meanArrivalTime,turnOff); Serial.print("offing after "); Serial.print(2*LED_ON_COST - meanArrivalTime); } // offEventID = t.after(2000,turnOff); // Serial.println(offEventID); } else { passingCount++; // Serial.println("ignored"); } } else if (passing == 1) { Serial.print("ignored "); Serial.println(millis()); passing = 0; } else if(passing == 2 && sensorVal <200) { passing = 0; } } uint8_t option = 0; uint8_t data = 0; SoftwareSerial mySerial(10, 11); int ledcount=0; void flashLed(int pin, int times, int wait) { for (int i = 0; i < times; i++) { digitalWrite(pin, HIGH); delay(wait); digitalWrite(pin, LOW); if (i + 1 < times) { delay(wait); } } } void setup() { pinMode(statusLed, OUTPUT); pinMode(errorLed, OUTPUT); pinMode(dataLed, OUTPUT); // start serial mySerial.begin(9600); Serial.begin(9600); xbee.setSerial(mySerial); //flashLed(statusLed, 3, 50); autoConfiguration(); t.every(10,sensing); } void addNbr(Rx64Response recv64){ XBeeAddress64 NbrAddr64; NbrAddr64 = recv64.getRemoteAddress64(); bool alreadyExist = false; for(int i =0;i<noOfNbrs;i++){ Serial.print("matching "); Serial.print(nbrList[i].DL); Serial.print(" with "); Serial.println(NbrAddr64.getLsb()); if(nbrList[i].DH == NbrAddr64.getMsb() && nbrList[i].DL == NbrAddr64.getLsb()){ alreadyExist=true; Serial.println("nbr exists"); break; } } if(alreadyExist==false ){ int maxStrength = nbrList[0].strength; int maxIndex = 0; bool closer = true; if(noOfNbrs<MAX_NBRS) { maxIndex = noOfNbrs; noOfNbrs++; } else { for(int i=0;i<noOfNbrs;i++) { if(nbrList[i].strength > maxStrength) { maxStrength = nbrList[i].strength; maxIndex = i; } } if(maxStrength <= rx64.getRssi()) { closer = false; } else { Serial.print("Replacing id "); Serial.println(nbrList[maxIndex].DL); } } if(closer){ Serial.println("Adding nbr"); nbrList[maxIndex].DH = NbrAddr64.getMsb(); nbrList[maxIndex].DL= NbrAddr64.getLsb(); Serial.println(nbrList[maxIndex].DH); Serial.println(nbrList[maxIndex].DL); nbrList[maxIndex].strength = rx64.getRssi(); // nbrList[maxIndex].side = UNDEFINED; } } Serial.print("Current size "); Serial.println(noOfNbrs); for(int i=0;i<noOfNbrs;i++) { Serial.print("Member "); Serial.print(i); Serial.print(": "); Serial.print(nbrList[i].DL); Serial.print(" "); Serial.println(nbrList[i].strength); } } void processPayload(Rx64Response recv64){ Serial.print("Payload Received"); uint8_t pL = rx64.getData(0); Serial.println(pL); switch(pL){ case CONF_SYN: addNbr(recv64); payload[0] = CONF_ACK; tx = Tx64Request(recv64.getRemoteAddress64(), payload, sizeof(payload)); xbee.send(tx); break; case CONF_ACK: addNbr(recv64); break; case SWITCH_ON: t.stop(offEventID); on = true; digitalWrite(statusLed, HIGH); Serial.println("Led turned on by wireless message"); delay(100); if(meanArrivalTime > LED_ON_COST) { Serial.print("offing after "); Serial.print(MIN_ON_TIME); offEventID = t.after((unsigned long)MIN_ON_TIME,turnOff); } else { offEventID = t.after(2*LED_ON_COST - meanArrivalTime,turnOff); Serial.print("offing after "); Serial.print(2*LED_ON_COST - meanArrivalTime); } break; } } // continuously reads packets, looking for RX16 or RX64 void loop() { t.update(); xbee.readPacket(READ_TIMEOUT); if (xbee.getResponse().isAvailable()) { // got something Serial.println("got something"); // got a rx packet if (xbee.getResponse().getApiId() == RX_16_RESPONSE) { xbee.getResponse().getRx16Response(rx16); option = rx16.getOption(); data = rx16.getData(0); Serial.print("RSSI 16"); Serial.println(rx16.getRssi()); processPayload(rx64); } else if (xbee.getResponse().getApiId() == RX_64_RESPONSE) { xbee.getResponse().getRx64Response(rx64); option = rx64.getOption(); data = rx64.getData(0); Serial.print("RSSI 64"); Serial.println(rx64.getRssi()); processPayload(rx64); } else{ // This is our packet } // TODO check option, rssi bytes //flashLed(statusLed, 1, 10); // set dataLed PWM to value of the first byte in the data //analogWrite(dataLed, data); } else if (xbee.getResponse().isError()) { //nss.print("Error reading packet. Error code: "); //nss.println(xbee.getResponse().getErrorCode()); // or flash error led } }
276a3e8623a7236661aa56f2bfaba98dd60bd590
9a66d8339de7cf8debcd79b2d6bc4b669245087e
/郭明君/第3次-2017310232-郭明君-金融实验/6-22.cpp
304658e8b17f0cd77b23b4c00d963556afdbbb2c
[]
no_license
jinrongsyb17/homework-space
391183e268f1a09e586a18e4cbe2735b59173074
f0c8fe0c17c6fb08c55d967899d9b26a1782b0e3
refs/heads/master
2020-03-28T14:40:12.876141
2019-01-02T04:57:27
2019-01-02T04:57:27
148,510,153
9
18
null
2018-09-18T11:05:38
2018-09-12T16:33:38
C++
GB18030
C++
false
false
552
cpp
6-22.cpp
// 6-22.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<string> using namespace std; void reverse(char*s, char*t) { char c; if (s < t) { c = *s; *s = *t; *t = c; reverse(s += 1, t -= 1); } } void reverse(char*s) { reverse(s, s + strlen(s) - 1); } void main() { char strl[20]; cout << "输入一个字符串" << endl; cin >> strl; cout << "原字符串为:" << strl << endl; reverse(strl); cout << "倒序反转后为:" << strl << endl; }
ea74c32e232c2d48ac945b542ce3a53926eff12a
a6cabbd591226887c4047a984388b823d962e377
/include/MiniGLM.hpp
8713c1b5c0d965c791a3c3aa41cf61d4fa44f0d9
[]
no_license
PatrickPurcell/MiniRenderer
f6fea4f50cf0ad63216ef86271f4a1d26e64e5f5
cc5e887445230adb5e0d324b04d27ad7b2e622de
refs/heads/master
2021-09-04T02:50:02.400453
2018-01-14T23:14:40
2018-01-14T23:14:40
92,783,191
2
0
null
null
null
null
UTF-8
C++
false
false
6,399
hpp
MiniGLM.hpp
#pragma once #include "MiniDefines.hpp" namespace glm { template <size_t C> using vec = std::array<float, C>; using vec2 = vec<2>; using vec3 = vec<3>; using vec4 = vec<4>; #define VEC_OPERATOR(OPERATOR) \ template <Z C> \ vec<C> operator OPERATOR(const vec<C>& lhs, const vec<C>& rhs) \ { \ vec<C> r; \ for (Z i = 0; i < C; ++i) \ r[i] = lhs[i] OPERATOR rhs[i]; \ R r; \ } \ \ template <size_t C> \ vec<C> operator OPERATOR (const vec<C>& lhs, float scalar) \ { \ vec<C> r; \ for (Z i = 0; i < C; ++i) \ r[i] = lhs[i] OPERATOR scalar; \ R r; \ } VEC_OPERATOR(+) VEC_OPERATOR(-) VEC_OPERATOR(*) VEC_OPERATOR(/) template <size_t C> float dot(const vec<C>& v0, const vec<C>& v1) { float result = 0; for (size_t i = 0; i < C; ++i) result += v0[i] * v1[i]; R result; } template <size_t C> float length(const vec<C>& v) { R dot(v, v); } template <size_t C> vec<C> normalize(const vec<C>& vec) { R vec / std::sqrt(dot(vec, vec)); } vec3 cross(const vec3& v0, const vec3& v1) { R vec3 { v0[1] * v1[2] - v1[1] * v0[2], v0[2] * v1[0] - v1[2] * v0[0], v0[0] * v1[1] - v1[0] * v0[1] }; } using mat4 = std::array<vec4, 4>; mat4 operator*(const mat4& lhs, const mat4& rhs) { const auto SrcA0 = lhs[0]; const auto SrcA1 = lhs[1]; const auto SrcA2 = lhs[2]; const auto SrcA3 = lhs[3]; const auto SrcB0 = rhs[0]; const auto SrcB1 = rhs[1]; const auto SrcB2 = rhs[2]; const auto SrcB3 = rhs[3]; mat4 Result; Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; R Result; // mat4 result; // result[0] = lhs[0] * rhs[0] + lhs[1] * rhs[0] + lhs[2] * rhs[0] + lhs[3] * rhs[0]; // result[1] = lhs[0] * rhs[1] + lhs[1] * rhs[1] + lhs[2] * rhs[1] + lhs[3] * rhs[1]; // result[2] = lhs[0] * rhs[2] + lhs[1] * rhs[2] + lhs[2] * rhs[2] + lhs[3] * rhs[2]; // result[3] = lhs[0] * rhs[3] + lhs[1] * rhs[3] + lhs[2] * rhs[3] + lhs[3] * rhs[3]; // R result; } vec<4> operator*(const mat4& m, const vec4& v) { R vec<4> { m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3] }; } mat4 create_identity() { R mat4 { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }; } mat4 lookAt(const vec3& eye, const vec3& center, const vec3& up) { auto f = normalize(center - eye); auto s = normalize(cross(f, up)); auto u = cross(s, f); auto result = create_identity(); result[0][0] = s[0]; result[1][0] = s[1]; result[2][0] = s[2]; result[0][1] = u[0]; result[1][1] = u[1]; result[2][1] = u[2]; result[0][2] = -f[0]; result[1][2] = -f[1]; result[2][2] = -f[2]; result[3][0] = -dot(s, eye); result[3][1] = -dot(u, eye); result[3][2] = dot(f, eye); R result; } mat4 perspective(float fovy, float aspect, float zNear, float zFar) { float tanHalfFov = std::tan(fovy * 0.5f); mat4 result { }; result[0][0] = 1.0f / (tanHalfFov * aspect); result[1][1] = 1.0f / tanHalfFov; result[2][3] = -1; result[2][2] = zFar / (zNear - zFar); result[3][2] = -(zFar * zNear) / (zFar - zNear); R result; } template <typename RV, typename T> RV round_cast(const T& value) { R static_cast<RV>(std::round(value)); } template <typename T> const T& clamp(const T& v, const T& n, const T& x) { R std::min(std::max(n, v), x); } template <typename T> T lerp(const T& v0, const T& v1, const T& t) { R std::fma(t, v1, std::fma(-t, v0, v0)); } template <Z C> vec<C> saturate(vec<C> v) { vec<C> r; for (Z i = 0; i < C; ++i) r[i] = clamp<F>(v[i], 0, 1); R r; } template <typename T> T pi() { return T(3.14159265358979323846264338327950288); } template <typename T> T radians(const T& degrees) { R pi<T>() / static_cast<T>(180.0) * degrees; } template <typename T> T degrees(const T& radians) { R static_cast<T>(180.0) / pi<T>() * radians; } template <size_t C> std::string to_string(const vec<C>& v) { std::string str; for (size_t i = 0; i < C; ++i) { str += std::to_string(v[i]); if (i < C - 1) { str += ", "; } } R "{ " + str + " }"; } std::string to_string(const mat4& m) { R "{" + to_string(m[0]) + "\n " + to_string(m[1]) + "\n " + to_string(m[2]) + "\n " + to_string(m[3]) + "}"; } } // namespace glm
6e6cbcaf51cfa1be16c28d107b1a545e855c2229
8b8faa1ae046741473ea81f17fbbf4b55f7cc45d
/ConsoleApplication2/Enemy5.cpp
a8e7f7035ebbfa8fefda4d0e01598f87d244d5ea
[]
no_license
Vicen04/Space-Game-test
634e476c41c3c7029a4415ad0d7793954fc9851e
b3ceb3da592319bba8925d9a4d6ceb3ad7778225
refs/heads/master
2023-02-10T02:00:09.549787
2021-01-02T19:03:08
2021-01-02T19:03:08
291,293,628
0
0
null
null
null
null
UTF-8
C++
false
false
2,164
cpp
Enemy5.cpp
#include "Enemy5.h" #include "Texture2D.h" #include "TransformComponent.h" #include "MeshComponent.h" #include "RigidbodyComponent.h" #include "CameraComponent.h" #include "MaterialAsset.h" #include "Player.h" Enemy5::Enemy5(shared_ptr<MeshComponent> mesh, shared_ptr<TransformComponent> transform, shared_ptr<RigidbodyComponent> rigidBody, shared_ptr<CameraComponent> camera, shared_ptr<Player> player): EnemyBase(mesh, transform, rigidBody, camera) { SetScore(100); SetHealth(10); SetEnemyType("enemy5"); GetTransform()->SetScale(glm::vec3(120.0f, 120.0f, 1.0f)); GetRigidBody()->SetVelocityFactor(75.0f); _player = player; } Enemy5::~Enemy5() { } void Enemy5::Update(float time) { if (GetTexture() == nullptr) { SetTexture(make_shared<Texture2D>()); GetTexture()->Load("Textures/enemy5.png"); } if (GetUpdate() && _move) { if (GetShootTime() > 0.0f) SetShootTime(GetShootTime() - time); Move(); glm::vec2 velocity = GetRigidBody()->GetVelocity(); glm::vec3 position = GetTransform()->GetPosition(); GetTransform()->SetPosition(glm::vec3(velocity.x + position.x, velocity.y * time + position.y, position.z)); } CheckIsOnScreen(GetTransform()->GetPosition(), GetCamera()->GetCameraPosition()); GetTransform()->Update(); } void Enemy5::Move() { glm::vec3 player = _player->GetTransform()->GetPosition(); glm::vec3 position = GetTransform()->GetPosition(); if (player.y > position.y + 0.5f) GetRigidBody()->SetVelocity(glm::vec2(GetCamera()->GetCameraSpeed().x, GetRigidBody()->GetVelocityFactor())); else if (player.y < position.y -0.5f) GetRigidBody()->SetVelocity(glm::vec2(GetCamera()->GetCameraSpeed().x , -GetRigidBody()->GetVelocityFactor())); else GetRigidBody()->SetVelocity(glm::vec2(GetCamera()->GetCameraSpeed().x, 0.0f)); } void Enemy5::CheckIsOnScreen(glm::vec3 position, glm::vec3 camera) { glm::vec3 added = GetTransform()->GetScale(); if (position.x + (added.x / 2.0f) < camera.x) { SetDestroy(true); } else if (position.x - (added.x / 2.0f) > camera.x + 1024.0f) { SetUpdate(false); } else SetUpdate(true); if (position.x + (added.x / 2.0f) < camera.x + 1000.0f) _move = true; }
fcb82468f46c53bfc9787a0670348eb51fb4912f
59e10fdac99debbbcfef3190e7a0467b6e30fd26
/Plane-Game-master/Source/CMovingObject.cpp
8681f95a847492517572e429d8c2645501ee4044
[]
no_license
VaduvaAlexandraMihaela/Plane-Game
f47b35d4e6098f8d9a3c6bcab2ff6ae585384c87
d69f5b3ba39f8bfece263944e21d8d11f07911b3
refs/heads/master
2022-11-19T19:54:29.016812
2020-07-11T11:16:27
2020-07-11T11:16:27
278,846,010
0
0
null
null
null
null
UTF-8
C++
false
false
261
cpp
CMovingObject.cpp
#include "CMovingObject.h" CMovingObject::CMovingObject() { } CMovingObject::~CMovingObject() { //delete m_pSprite; } void CMovingObject::Update(float dt) { // Update sprite m_pSprite->update(dt); } void CMovingObject::Draw() { m_pSprite->draw(); }