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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e3324eb282818966c1caff6ed5cbca1b15a6ce5a
|
5399d919f33bca564bd309c448f1151e7fb6aa27
|
/modules/gzip/Gzip.cpp
|
7bee12362f6caf06730e2d5a6887d7c8b26da334
|
[] |
no_license
|
hotgloupi/zhttpd
|
bcbc37283ebf0fb401417fa1799f7f7bb286f0d5
|
0437ac2e34dde89abab26665df9cbee1777f1d44
|
refs/heads/master
| 2021-01-25T05:57:49.958146
| 2011-01-03T14:22:05
| 2011-01-03T14:22:05
| 963,056
| 4
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,766
|
cpp
|
Gzip.cpp
|
#include <string.h> // memcpy
#include "api/constants.hpp"
#include "api/IBuffer.hpp"
#include "api/IRequest.hpp"
#include "api/IModule.hpp"
#include "utils/Logger.hpp"
#include "Gzip.hpp"
Gzip::Gzip(zhttpd::api::IModuleManager*) :
_initialized(false)
{
}
Gzip::~Gzip()
{
if (this->_initialized)
this->_unload();
}
bool Gzip::_load(zhttpd::api::IRequest* request)
{
this->_stream.zalloc = Z_NULL;
this->_stream.zfree = Z_NULL;
this->_stream.opaque = Z_NULL;
if (deflateInit2(&this->_stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY) == Z_OK)
{
this->_initialized = true;
request->setResponseHeader("Content-Length", "");
request->setResponseHeader("Content-Encoding", "gzip");
return true;
}
return false;
}
void Gzip::_unload()
{
deflateEnd(&this->_stream);
this->_initialized = false;
}
bool Gzip::_deflate(zhttpd::api::IBuffer* in_buffer, zhttpd::api::IBuffer* out_buffer)
{
unsigned int bytes = 1;
unsigned int total_bytes = 0;
unsigned char out[GZIP_CHUNK];
this->_stream.avail_in = in_buffer->getSize();
this->_stream.next_in = reinterpret_cast<unsigned char*>(in_buffer->getRawData());
while (true)
{
this->_stream.avail_out = GZIP_CHUNK;
this->_stream.next_out = out;
if (deflate(&this->_stream, Z_SYNC_FLUSH) == Z_STREAM_ERROR)
return false;
bytes = GZIP_CHUNK - this->_stream.avail_out;
if (bytes > 0)
{
out_buffer->setSize(total_bytes + bytes);
::memcpy(out_buffer->getRawData() + total_bytes, out, bytes);
total_bytes += bytes;
}
else
break;
}
return true;
}
bool Gzip::processRequest(zhttpd::api::event::Type event, zhttpd::api::IRequest* request, zhttpd::api::IBuffer* in_buffer)
{
if (event == zhttpd::api::event::ON_END)
{
if (this->_initialized)
this->_unload();
request->raiseEnd();
return true;
}
else if (event == zhttpd::api::event::ON_RESPONSE_DATA)
{
if (!this->_initialized && !this->_load(request))
request->raiseError(zhttpd::api::http_code::INTERNAL_SERVER_ERROR);
else
{
zhttpd::api::IBuffer* out_buffer = request->getBufferManager().allocate(1);
if (this->_deflate(in_buffer, out_buffer))
request->giveData(out_buffer);
else
{
request->raiseError(zhttpd::api::http_code::INTERNAL_SERVER_ERROR);
request->getBufferManager().release(out_buffer);
}
}
request->getBufferManager().release(in_buffer);
return true;
}
return false;
}
|
e9ac22f4ab2d3223c07aab6dc62066689b9e848f
|
785df77400157c058a934069298568e47950e40b
|
/TnbCad2d/TnbLib/Cad2d/Length/Adaptive/Info/Cad2d_CurveLength_Adaptive_Info.cxx
|
24dcbcba5f213b3a07c4d05f97c44f15bf651db1
|
[] |
no_license
|
amir5200fx/Tonb
|
cb108de09bf59c5c7e139435e0be008a888d99d5
|
ed679923dc4b2e69b12ffe621fc5a6c8e3652465
|
refs/heads/master
| 2023-08-31T08:59:00.366903
| 2023-08-31T07:42:24
| 2023-08-31T07:42:24
| 230,028,961
| 9
| 3
| null | 2023-07-20T16:53:31
| 2019-12-25T02:29:32
|
C++
|
UTF-8
|
C++
| false
| false
| 48
|
cxx
|
Cad2d_CurveLength_Adaptive_Info.cxx
|
#include <Cad2d_CurveLength_Adaptive_Info.hxx>
|
b756cd3dc0c162a206a622e3de13d5f1bc467e48
|
79be97302e0d1195aaa01f52e5fa1da540ea112f
|
/core/lib/hermes/hermes_internal.hpp
|
9407e7bdd4120798191b74c4f7215a637b15fe3e
|
[
"Apache-2.0"
] |
permissive
|
victor-smirnov/memoria
|
8df7430c89b83ff9c93706dcf6100b3830c5f83a
|
fd203b5b081849c1a1db2d7f26b75bfd1d760a18
|
refs/heads/master
| 2023-05-12T20:52:19.828284
| 2023-05-01T00:02:46
| 2023-05-01T00:02:46
| 245,055,297
| 11
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,020
|
hpp
|
hermes_internal.hpp
|
// Copyright 2022 Victor Smirnov
//
// 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.
#pragma once
#include <memoria/core/hermes/hermes.hpp>
namespace memoria::hermes {
class HermesCtrImpl final: public HermesCtrView, public pool::enable_shared_from_this<HermesCtrImpl> {
arena::ArenaAllocator arena_;
LWMemHolder view_mem_holder_;
friend class HermesCtrBuilder;
friend class HermesCtrView;
public:
HermesCtrImpl()
{
HermesCtrView::arena_ = &arena_;
mem_holder_ = &view_mem_holder_;
header_ = arena_.allocate_object_untagged<DocumentHeader>();
}
HermesCtrImpl(size_t chunk_size, arena::AllocationType alc_type = arena::AllocationType::MULTI_CHUNK):
arena_(alc_type, chunk_size)
{
HermesCtrView::arena_ = &arena_;
mem_holder_ = &view_mem_holder_;
if (alc_type == arena::AllocationType::MULTI_CHUNK) {
header_ = arena_.allocate_object_untagged<DocumentHeader>();
}
}
HermesCtrImpl(arena::AllocationType alc_type, size_t chunk_size, const void* data, size_t size):
arena_(alc_type, chunk_size, data, size)
{
HermesCtrView::arena_ = &arena_;
mem_holder_ = &view_mem_holder_;
header_ = ptr_cast<DocumentHeader>(arena_.head().memory.get());
}
void object_pool_init_state();
void reset_state() noexcept;
protected:
void configure_refholder(SharedPtrHolder* ref_holder) {
view_mem_holder_.set_owner(ref_holder);
}
};
}
|
aa5f2a31417fb4c13b31506e06e9707fbc7facee
|
6880ba9f45d2e9a13a24dcacfa37113007b4c625
|
/Includes/list/list.cpp
|
96529054ec837570f547e203efe56768a42926c7
|
[] |
no_license
|
PatateDu609/projects
|
706ed45b5b3696073adf006c9b959f46ff43238f
|
56666a65fc23122267e5adb5883921681bbc991a
|
refs/heads/master
| 2020-07-12T05:37:26.989258
| 2019-09-15T18:35:42
| 2019-09-15T18:35:42
| 204,731,877
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,197
|
cpp
|
list.cpp
|
#ifndef LIST_CPP
#define LIST_CPP
#include "list.h"
template <class type>
List<type>::List() : _size(0), _begin(NULL)
{}
template <class type>
List<type>::List(const List &other) : _size(other.getsize()), _begin(NULL)
{
if (!_size)
return ;
Element<type> *temp = other._begin, *begin;
while (temp)
{
createElement(temp->_data);
temp = temp->_next;
}
begin = _begin;
while (begin->_next)
begin = begin->_next;
}
template <class type>
List<type>::List(const std::initializer_list<type>& init) : _size(init.size()), _begin(NULL)
{
if (!_size)
return ;
decltype(_begin) begin;
for(auto it = init.begin(); it != init.end(); it++)
createElement(*it);
begin = _begin;
while (begin->_next)
begin = begin->_next;
}
template <class type>
List<type>::List(const type* init, int size) : _size(size), _begin(NULL)
{
int i = 1;
if (!size)
return ;
_begin = new Element<type>(init[0]);
Element<type> *begin = _begin;
while (i < size)
{
begin->_next = new Element<type>(init[i]);
begin = begin->_next;
i++;
}
}
template <class type>
List<type>::~List()
{
Element<type> *temp;
while (_begin)
{
temp = _begin;
_begin = temp->_next;
delete temp;
}
}
#endif
|
2cd914b63d1e49665a4f51cef8c838d51ea64253
|
e47ebafd139ab4763d2ddac0d71784c92a7e6d8d
|
/thtfit/MediaPlayer/libNexusExt/LedScrGpioCtrl.h
|
135f3e6a5b650aae5ac6fa8426f70c3f665d0773
|
[] |
no_license
|
franzluo/codeCap
|
7362f61c3bab6dfb32d43c3e36e37ae8a7fac8a8
|
4d2bdb48750593a88545de2bf425b2bd60100fe8
|
refs/heads/master
| 2021-01-11T01:42:36.327163
| 2020-02-17T05:45:00
| 2020-02-17T05:45:00
| 70,659,058
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 853
|
h
|
LedScrGpioCtrl.h
|
#if !defined(_LedScrGpioCtrl_h_)
#define _LedScrGpioCtrl_h_
#include <BaseTypeDef.h>
#include <LedScrGpioCtrlApi.h>
#include <nexus_base_types.h>
#include <nexus_gpio.h>
class CLedScrGpioCtrl : public CLedScrGpioCtrlIf
{
public:
enum tagBrcmGpioNo {
BrcmGpioNo_Data = 45,
BrcmGpioNo_Clk = 43,
BrcmGpioNo_CS0 = 46,
BrcmGpioNo_CS1 = 44,
};
typedef enum tagBrcmGpioNo BrcmGpioNo_t;
public:
CLedScrGpioCtrl();
virtual ~CLedScrGpioCtrl();
virtual BOOL_t ChkInit();
virtual INT_t setGpioLevel(CLedScrGpioCtrlIf::GpioNo_t gpioNo, BOOL_t bLevel);
virtual void delayUs(int delayTimeUs);
private:
INT_t CommonConstruct();
private:
BOOL_t m_bInited;
NEXUS_GpioHandle m_hGpio_Data;
NEXUS_GpioHandle m_hGpio_Clk;
NEXUS_GpioHandle m_hGpio_CS0;
NEXUS_GpioHandle m_hGpio_CS1;
};
#endif //_LedScrGpioCtrl_h_
|
9b8e1a68a9d142e16284feb5d23ae10438efbd0c
|
6cecdbbe6eb721a0e43c07ed2b31bdcc9e553c55
|
/Sail2D/Runs/first_flatplate_150_8/case/1000/nuTilda
|
28ced42fdd4f53fe9ff819ee52b9a263abffcc7b
|
[] |
no_license
|
kiranhegde/Gmsh
|
799d8cbefb7dd3f3d35ded15b40292fd3ede6468
|
fefa906dabfddd9b87cc1f0256df81b4735420e1
|
refs/heads/master
| 2021-01-19T23:21:57.414954
| 2015-01-21T02:02:37
| 2015-01-21T02:02:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 144,790
|
nuTilda
|
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "1000";
object nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField nonuniform List<scalar>
14201
(
0.0614024
0.0581689
0.0549877
0.051875
0.0488392
0.0458886
0.0430321
0.0402804
0.0376453
0.0351416
0.0327871
0.0305984
0.0285887
0.0267748
0.0251759
0.0237873
0.0225209
0.0212819
0.0200392
0.018771
0.0174383
0.0159848
0.0143861
0.0129122
0.0646556
0.0619515
0.0593245
0.0567709
0.0542929
0.0518948
0.0495815
0.0473582
0.0452302
0.0432035
0.041284
0.0394775
0.0377911
0.0362346
0.034818
0.0335508
0.0324408
0.0314918
0.0307107
0.0301009
0.0296663
0.0294079
0.0293249
0.0294157
0.0675688
0.0653156
0.063132
0.0610163
0.0589697
0.0569947
0.055095
0.0532745
0.0515375
0.0498882
0.0483314
0.0468726
0.0455167
0.0442705
0.0431402
0.0421328
0.0412553
0.0405128
0.0399108
0.0394529
0.03914
0.0389715
0.038944
0.0390501
0.0701988
0.0683058
0.0664788
0.0647119
0.0630041
0.0613567
0.0597727
0.058255
0.0568074
0.0554333
0.0541363
0.0529214
0.051793
0.050756
0.0498159
0.0489779
0.0482479
0.0476309
0.0471314
0.0467528
0.0464966
0.0463628
0.0463493
0.0464515
0.0725371
0.0709492
0.0694118
0.0679228
0.0664814
0.0650887
0.0637468
0.0624585
0.061227
0.0600554
0.0589473
0.057907
0.0569385
0.0560466
0.0552363
0.0545124
0.0538799
0.0533445
0.0529103
0.0525808
0.0523581
0.0522438
0.0522371
0.0523353
0.0746272
0.0732831
0.0719785
0.0707109
0.06948
0.0682865
0.067132
0.0660195
0.0649522
0.0639328
0.0629653
0.0620535
0.0612019
0.0604147
0.0596973
0.0590543
0.0584906
0.0580117
0.0576224
0.0573262
0.0571258
0.0570237
0.05702
0.0571134
0.0764817
0.0753403
0.0742241
0.0731341
0.0720706
0.0710344
0.070027
0.0690509
0.06811
0.0672077
0.0663473
0.0655328
0.0647684
0.0640595
0.0634112
0.0628282
0.0623155
0.0618782
0.0615213
0.0612492
0.0610649
0.0609715
0.0609698
0.0610589
0.0781378
0.0771556
0.0761913
0.0752442
0.0743151
0.0734049
0.0725145
0.0716457
0.070803
0.0699923
0.0692161
0.0684773
0.0677803
0.0671299
0.0665346
0.065998
0.0655249
0.0651195
0.0647865
0.0645329
0.0643613
0.0642748
0.0642749
0.0643606
0.0796035
0.0787575
0.0779173
0.0770858
0.0762653
0.075457
0.074662
0.0738797
0.0731129
0.0723741
0.0716671
0.0709868
0.0703488
0.0697378
0.0691846
0.0686838
0.068242
0.0678656
0.0675479
0.0673102
0.0671482
0.0670675
0.0670706
0.0671563
0.0809205
0.0801805
0.0794363
0.0786938
0.0779572
0.0772286
0.0765109
0.0758079
0.0751061
0.074419
0.0737754
0.0731268
0.0725638
0.071965
0.0714465
0.070974
0.0705521
0.0702162
0.0698995
0.0696811
0.0695249
0.0694473
0.0694524
0.0695505
0.0138241
0.01624
0.0177491
0.0191684
0.0207102
0.0224261
0.0243139
0.0263575
0.0285388
0.0308419
0.0332543
0.0357658
0.0383687
0.0410559
0.0438207
0.0466568
0.0495578
0.0525171
0.0555279
0.058583
0.0616752
0.0647968
0.0679416
0.0711145
0.0296603
0.0300707
0.0306737
0.0314743
0.0324693
0.0336503
0.0350059
0.0365222
0.0381845
0.0399781
0.0418897
0.043907
0.0460188
0.0482155
0.0504885
0.0528309
0.0552355
0.0576961
0.0602073
0.0627635
0.0653591
0.0679886
0.0706466
0.0733419
0.0392768
0.0396313
0.0401332
0.0407853
0.0415868
0.042534
0.0436206
0.0448385
0.0461785
0.0476308
0.0491856
0.050834
0.052567
0.0543764
0.0562557
0.0581986
0.0601991
0.0622521
0.0643532
0.066498
0.068682
0.0709011
0.0731521
0.0754483
0.0466622
0.046985
0.0474307
0.0480008
0.0486946
0.049508
0.0504362
0.0514732
0.0526109
0.0538418
0.0551584
0.0565531
0.0580184
0.0595481
0.0611364
0.062778
0.0644686
0.0662043
0.0679814
0.0697968
0.0716471
0.0735293
0.0754408
0.0773964
0.0525335
0.0528341
0.053243
0.0537606
0.0543853
0.0551125
0.0559369
0.0568531
0.0578535
0.0589317
0.0600809
0.061294
0.0625648
0.063888
0.0652583
0.0666714
0.0681242
0.0696131
0.0711355
0.0726891
0.0742715
0.0758803
0.077513
0.0791764
0.057301
0.0575845
0.0579669
0.0584471
0.0590225
0.0596888
0.0604399
0.0612698
0.0621722
0.0631401
0.0641668
0.0652459
0.066372
0.0675399
0.0687446
0.0699825
0.0712509
0.0725473
0.0738696
0.0752156
0.0765833
0.0779711
0.0793777
0.0808046
0.0612373
0.0615065
0.0618681
0.0623203
0.0628591
0.06348
0.0641766
0.0649425
0.0657717
0.0666566
0.0675904
0.0685675
0.0695826
0.0706306
0.0717067
0.0728075
0.0739313
0.0750763
0.07624
0.0774203
0.0786152
0.0798237
0.0810448
0.0822778
0.0645302
0.0647864
0.065131
0.0655616
0.0660727
0.0666585
0.0673128
0.06803
0.0688029
0.0696231
0.0704841
0.0713812
0.0723098
0.0732634
0.0742369
0.075228
0.0762368
0.0772617
0.0782986
0.0793453
0.0804003
0.0814623
0.0825314
0.0836092
0.0673137
0.067557
0.0678873
0.068302
0.0687917
0.0693491
0.0699691
0.0706492
0.0713786
0.0721462
0.0729472
0.073781
0.0746424
0.0755202
0.0764086
0.0773092
0.0782264
0.0791568
0.0800901
0.0810291
0.0819695
0.0829109
0.0838557
0.0848079
0.0696834
0.0699145
0.0702326
0.0706364
0.071105
0.0716358
0.072227
0.07288
0.0735711
0.0742891
0.0750402
0.0758268
0.0766381
0.0774501
0.0782646
0.0790937
0.0799408
0.0807981
0.0816456
0.082501
0.0833433
0.0841873
0.0850342
0.0858906
0.0586696
0.0534617
0.0482367
0.0431433
0.0383623
0.0340114
0.0300964
0.0265813
0.0234265
0.0205955
0.0180555
0.0157776
0.0137364
0.0119098
0.0102786
0.00882655
0.00754103
0.00641557
0.00544759
0.00464302
0.00406529
0.00349926
0.00285938
0.00206544
0.0594131
0.0547084
0.04999
0.0453519
0.0409247
0.0368261
0.0330954
0.0297152
0.0266549
0.0238849
0.0213786
0.0191128
0.0170683
0.0152295
0.0135858
0.0121343
0.0108758
0.00981499
0.00898594
0.00817277
0.00731152
0.00635785
0.00525687
0.00392856
0.060232
0.0560288
0.0517994
0.0476081
0.0435392
0.0396913
0.0361359
0.0328845
0.0299168
0.0272091
0.02474
0.0224926
0.0204546
0.0186194
0.0169905
0.0155705
0.0143651
0.013375
0.0123864
0.0113387
0.0101859
0.00888455
0.00738679
0.00563413
0.0611164
0.0573511
0.0535549
0.049767
0.0460381
0.0424382
0.0390469
0.0359098
0.0330235
0.0303694
0.0279319
0.0257002
0.0236697
0.0218447
0.0202342
0.0188413
0.0176842
0.0165522
0.0153733
0.0141001
0.0126895
0.0110976
0.00927621
0.00717493
0.0619948
0.0586147
0.0551947
0.0517584
0.0483363
0.0449754
0.0417446
0.0387133
0.0358996
0.033293
0.0308826
0.0286639
0.0266398
0.0248252
0.0232303
0.0218749
0.0206215
0.0193465
0.0179967
0.0165274
0.0148953
0.0130552
0.010958
0.0085526
0.0628394
0.0597893
0.0566898
0.0535542
0.0504004
0.0472591
0.0441853
0.0412562
0.0385122
0.0359501
0.0335654
0.0313595
0.0293415
0.0275284
0.0259275
0.0245578
0.0232089
0.0218094
0.0203126
0.0186748
0.0168517
0.0147965
0.0124573
0.00977985
0.0636167
0.0608537
0.0580289
0.0551502
0.0522279
0.049283
0.0463582
0.0435294
0.0408534
0.0383349
0.0359761
0.0337846
0.0317767
0.0299689
0.0283732
0.026943
0.0255017
0.0239912
0.022366
0.0205818
0.0185926
0.0163482
0.0137937
0.0108716
0.0643238
0.0618012
0.0592119
0.0565534
0.0538312
0.0510601
0.0482739
0.0455427
0.0429333
0.0404567
0.0381227
0.0359465
0.03395
0.0321494
0.0305645
0.0290647
0.027537
0.0259273
0.0241894
0.0222778
0.0201432
0.017733
0.0149876
0.0118451
0.0649114
0.0626235
0.0602434
0.0577765
0.0552278
0.0526101
0.049952
0.0473163
0.0447735
0.0423335
0.0400206
0.0378583
0.0358748
0.034081
0.0324919
0.0309376
0.0293375
0.0276422
0.0258061
0.0237834
0.0215223
0.0189688
0.0160603
0.0127239
0.0654328
0.0633366
0.0611363
0.0588352
0.0564361
0.0539514
0.051411
0.0488728
0.0464057
0.04399
0.0416865
0.0395338
0.0375672
0.0357962
0.0341865
0.0325861
0.030926
0.0291571
0.0272345
0.0251161
0.022739
0.0200595
0.0170357
0.0135892
0.00110945
0.000825429
0.0010959
0.00139684
0.00168671
0.00196939
0.00225283
0.00254843
0.00287448
0.0032601
0.00374804
0.00436895
0.00510192
0.00594039
0.00688616
0.00794479
0.00912391
0.0104311
0.0118737
0.0134606
0.0152017
0.017107
0.0191855
0.0214487
0.00235354
0.00134703
0.00139004
0.00168168
0.00198033
0.00227828
0.00258874
0.00293077
0.00332761
0.00380468
0.00438587
0.00508046
0.00586567
0.00674007
0.0077066
0.00877053
0.00993781
0.0112138
0.012605
0.0141189
0.0157641
0.0175488
0.0194821
0.0215765
0.00362461
0.00198008
0.00167421
0.00193876
0.00225478
0.00258419
0.00294342
0.00335355
0.00383349
0.00439676
0.00505533
0.00580777
0.00663604
0.00753997
0.00852269
0.00958817
0.0107404
0.0119837
0.0133234
0.0147658
0.0163175
0.0179859
0.0197792
0.021707
0.00478835
0.00263383
0.00194916
0.00217066
0.00251316
0.00288763
0.00330894
0.0037938
0.00435188
0.00498785
0.00571255
0.00651185
0.00737515
0.00830311
0.00929778
0.0103616
0.0114973
0.0127082
0.0139986
0.0153736
0.0168387
0.0183995
0.0200632
0.0218374
0.0058273
0.00325579
0.00221476
0.0023848
0.0027618
0.00319034
0.00367837
0.00423513
0.00486242
0.00556107
0.00633964
0.00717833
0.00807133
0.00901892
0.0100222
0.0110822
0.0122008
0.0133809
0.0146254
0.0159382
0.0173234
0.0187861
0.0203315
0.0219658
0.00675056
0.00382503
0.00246837
0.00258666
0.00300376
0.00348995
0.00404321
0.00466533
0.00535294
0.0061069
0.00692959
0.00780197
0.00872035
0.00968437
0.0106938
0.0117488
0.0128508
0.0140017
0.0152037
0.0164594
0.0177721
0.0191452
0.0205829
0.0220888
0.00756896
0.00433663
0.00270758
0.00277891
0.00323897
0.00378271
0.00439662
0.00507624
0.00581569
0.00661954
0.00747965
0.00838158
0.00932185
0.0102995
0.0113133
0.012363
0.0134492
0.0145729
0.0157358
0.0169395
0.0181861
0.0194777
0.020817
0.0222058
0.00829346
0.00479216
0.00293174
0.0029626
0.00346649
0.004065
0.0047337
0.00546372
0.00624925
0.0070969
0.00798972
0.00891749
0.009877
0.0108658
0.0118827
0.012927
0.0139983
0.0150971
0.0162241
0.0173804
0.0185668
0.0197845
0.0210346
0.0223184
0.00894143
0.00519537
0.00313682
0.00313764
0.00368353
0.00433124
0.00505009
0.00582607
0.00665396
0.00753895
0.00846098
0.00941192
0.0103878
0.0113856
0.0124044
0.0134436
0.0145015
0.0155771
0.0166716
0.0177858
0.0189181
0.0200677
0.0212372
0.0224334
0.0096179
0.00560851
0.00335021
0.00330152
0.00388865
0.00460011
0.00536014
0.00617072
0.00703468
0.00794977
0.00889496
0.00986252
0.0108453
0.0118484
0.0128781
0.0139229
0.0149669
0.0160121
0.0170829
0.0181707
0.0192528
0.0203288
0.0214132
0.0225192
0.000612883
0.00210099
0.00426221
0.00663631
0.00897096
0.0112061
0.0133313
0.0153508
0.017282
0.019166
0.0210566
0.0229918
0.0249695
0.0269544
0.029174
0.0317464
0.0345967
0.037649
0.0408526
0.0441747
0.0475933
0.051091
0.0546531
0.0582599
0.00045684
0.00139794
0.00324083
0.00511626
0.00692724
0.00873146
0.0105563
0.0123985
0.0142525
0.016116
0.0179945
0.0198997
0.0218403
0.0238291
0.0259521
0.0282858
0.0307843
0.0335825
0.0367721
0.0402282
0.043855
0.0475949
0.0514097
0.0552579
0.000294918
0.000937818
0.00219479
0.00389263
0.0059681
0.00796906
0.00984466
0.0116329
0.0133658
0.015069
0.0167662
0.0184808
0.0202376
0.0220669
0.024011
0.0261198
0.0284187
0.0309655
0.0337597
0.036938
0.0405248
0.0443651
0.0483475
0.0523964
0.000318518
0.000808832
0.00188427
0.00333761
0.00520864
0.0072999
0.00934933
0.0113016
0.0131506
0.0149012
0.0165672
0.0181747
0.0197611
0.0213738
0.0230674
0.0249017
0.0269341
0.0292142
0.0317639
0.0346331
0.0377992
0.0414889
0.0455061
0.0496979
0.000295884
0.000725224
0.00169099
0.00299017
0.00465886
0.00669021
0.00883774
0.0109366
0.0129451
0.0148501
0.0166417
0.0183179
0.0198932
0.0214031
0.0229057
0.024477
0.0262033
0.0281644
0.0304195
0.0330048
0.0359091
0.0391546
0.042975
0.0471678
0.000295272
0.000677782
0.00157651
0.00277948
0.00432069
0.00622791
0.00838668
0.0105821
0.0127199
0.0147693
0.0167118
0.0185298
0.020212
0.0217631
0.0232142
0.024629
0.0261015
0.027742
0.0296545
0.0319117
0.0345381
0.0375242
0.0409106
0.0449013
0.000288891
0.000640192
0.00148937
0.00262344
0.00407292
0.00586932
0.00798834
0.0102413
0.0124833
0.0146566
0.0167358
0.0186995
0.020525
0.0221958
0.0237115
0.0251021
0.0264383
0.0278315
0.0294158
0.0313148
0.0336086
0.036319
0.0394413
0.0430171
0.000286304
0.000613709
0.00142684
0.0025096
0.0038908
0.00560104
0.00765332
0.00992477
0.012245
0.0145244
0.0167248
0.0188212
0.0207882
0.0225996
0.0242359
0.0256962
0.0270148
0.0282743
0.0296067
0.031169
0.0331002
0.0354818
0.0383311
0.0416332
0.000283112
0.000591956
0.00137601
0.00241838
0.00374579
0.00538728
0.00736945
0.00963131
0.0120068
0.0143769
0.0166854
0.0189021
0.0210003
0.0229504
0.0247236
0.0262998
0.0276821
0.028915
0.0301007
0.0313965
0.0329809
0.0350012
0.0375313
0.0405755
0.000280733
0.00057492
0.00133515
0.00234476
0.00362864
0.00521431
0.00713253
0.00936474
0.0117728
0.0142176
0.0166225
0.0189488
0.0211675
0.0232483
0.025158
0.0268662
0.0283552
0.029637
0.0307746
0.031898
0.0331935
0.0348576
0.0370338
0.0397792
0.000278422
0.000561179
0.00130054
0.00228276
0.00353037
0.00506945
0.00693168
0.00912344
0.0115449
0.0140492
0.0165397
0.0189659
0.0212958
0.0234981
0.0255384
0.0273806
0.0289947
0.0303695
0.0315326
0.0325752
0.0336631
0.0350126
0.0368278
0.0392363
0.000276259
0.000549384
0.00127101
0.00222976
0.00344646
0.00494591
0.00675947
0.00890692
0.0113257
0.0138746
0.0164398
0.0189573
0.0213897
0.0237052
0.0258685
0.0278412
0.0295857
0.0310756
0.0323118
0.0333472
0.0343116
0.0354124
0.0368907
0.0389453
0.000274125
0.000539054
0.00124512
0.0021834
0.00337313
0.00483824
0.00660912
0.00871254
0.0111166
0.0136961
0.0163253
0.0189259
0.0214536
0.0238743
0.0261531
0.0282503
0.0301243
0.0317388
0.0330754
0.0341559
0.0350703
0.0359973
0.0371862
0.0388904
0.000271973
0.000529763
0.00122195
0.00214214
0.00330799
0.00474269
0.00647597
0.00853757
0.0109183
0.0135157
0.0161985
0.0188744
0.0214902
0.0240094
0.0263966
0.0286118
0.0306114
0.0323527
0.0338042
0.0349637
0.0358852
0.0367094
0.0376702
0.0390497
0.000269796
0.000521347
0.00120102
0.00210493
0.00324941
0.00465691
0.00635642
0.00837921
0.0107314
0.0133355
0.0160613
0.0188048
0.0215024
0.0241136
0.0266025
0.0289293
0.0310494
0.0329161
0.0344891
0.035748
0.0367176
0.0374995
0.0382967
0.039395
0.000267574
0.000513595
0.00118186
0.00207095
0.00319609
0.00457899
0.00624797
0.00823479
0.0105556
0.0131571
0.0159161
0.0187191
0.0214923
0.0241897
0.0267742
0.0292065
0.0314413
0.0334301
0.0351262
0.0364964
0.0375419
0.0383291
0.0390231
0.0398931
0.000265347
0.000506432
0.00116428
0.00203967
0.0031471
0.00450755
0.00614864
0.00810208
0.0103908
0.012982
0.0157649
0.0186195
0.021462
0.0242402
0.0269148
0.0294465
0.0317906
0.033897
0.0357152
0.0372025
0.0383419
0.0391701
0.0398134
0.0405112
0.000263119
0.000499812
0.00114796
0.00201073
0.00310166
0.00444149
0.00605685
0.00797948
0.0102363
0.0128114
0.0156096
0.0185081
0.0214139
0.0242675
0.027027
0.0296527
0.0321005
0.0343197
0.0362571
0.0378636
0.0391082
0.0400032
0.0406392
0.0412208
0.000260856
0.000493585
0.00113271
0.00198375
0.00305938
0.0043799
0.0059716
0.00786553
0.0100913
0.0126462
0.015452
0.0183872
0.0213502
0.0242741
0.0271135
0.0298282
0.0323743
0.0347013
0.0367543
0.0384796
0.0398359
0.0408158
0.0414791
0.0419939
0.000258583
0.00048775
0.00111846
0.00195855
0.00301996
0.00432255
0.00589216
0.00775946
0.00995541
0.0124873
0.0152941
0.0182589
0.0212733
0.0242627
0.0271774
0.0299762
0.0326155
0.0350453
0.03721
0.0390523
0.0405233
0.0416002
0.0423165
0.042803
0.000256306
0.000482308
0.00110517
0.00193502
0.00298321
0.0042691
0.00581813
0.00766052
0.00982797
0.0123355
0.0151378
0.0181257
0.0211857
0.0242359
0.0272216
0.0301
0.0328278
0.0353556
0.0376274
0.039584
0.0411706
0.0423522
0.0431406
0.0436341
0.000254029
0.000477193
0.00109278
0.001913
0.00294884
0.00421919
0.00574895
0.00756801
0.00970857
0.012191
0.0149845
0.0179894
0.0210898
0.0241962
0.0272488
0.0302028
0.0330147
0.0356359
0.0380104
0.0400777
0.0417789
0.0430696
0.043943
0.044465
0.000251751
0.000472385
0.00108112
0.00189236
0.00291652
0.00417236
0.00568415
0.00748136
0.00959652
0.0120539
0.0148351
0.0178518
0.0209874
0.0241459
0.0272617
0.0302875
0.0331794
0.0358895
0.0383623
0.0405366
0.0423504
0.0437515
0.0447172
0.045282
0.000249466
0.000467849
0.00107017
0.00187296
0.00288618
0.00412828
0.00562327
0.00740009
0.00949119
0.0119239
0.0146902
0.0177141
0.0208801
0.0240866
0.0272621
0.0303561
0.0333244
0.0361194
0.0386862
0.0409632
0.0428863
0.0443969
0.0454585
0.0460781
0.000247172
0.000463541
0.00105977
0.00185459
0.0028575
0.00408667
0.0055658
0.00732339
0.00939173
0.0118002
0.0145498
0.0175767
0.0207688
0.0240194
0.0272513
0.0304104
0.0334515
0.0363274
0.0389839
0.0413595
0.0433881
0.0450063
0.0461672
0.0468645
0.000244858
0.000459413
0.00104986
0.00183709
0.00283024
0.00404714
0.00551124
0.00725061
0.0092973
0.0116822
0.0144137
0.0174399
0.0206536
0.0239446
0.0272297
0.0304508
0.0335615
0.0365148
0.039257
0.0417268
0.043857
0.0455804
0.0468417
0.0476183
0.000242513
0.000455453
0.00104039
0.00182033
0.00280412
0.00400936
0.0054591
0.00718107
0.00920711
0.0115692
0.0142813
0.0173035
0.0205348
0.0238625
0.0271976
0.030478
0.0336552
0.0366824
0.0395066
0.0420667
0.0442946
0.0461205
0.0474817
0.0483405
0.00024014
0.00045161
0.00103124
0.00180413
0.00277889
0.00397291
0.00540887
0.0071142
0.00912046
0.0114602
0.0141523
0.0171674
0.0204123
0.0237729
0.0271549
0.0304917
0.0337327
0.0368308
0.0397335
0.0423802
0.0447023
0.0466278
0.0480885
0.0490361
0.000237731
0.00044786
0.0010223
0.00178838
0.00275439
0.00393753
0.00536023
0.0070495
0.00903664
0.0113546
0.0140261
0.0170313
0.020286
0.0236757
0.0271016
0.030492
0.0337941
0.0369601
0.0399382
0.042668
0.0450811
0.0471036
0.0486634
0.0497045
0.00023528
0.000444162
0.00101356
0.00177298
0.00273049
0.00390304
0.00531283
0.00698656
0.00895518
0.0112519
0.0139023
0.0168954
0.020156
0.0235712
0.0270375
0.0304788
0.0338394
0.0370706
0.040121
0.0429309
0.0454318
0.047549
0.0492074
0.0503453
0.000232805
0.000440553
0.00100503
0.00175793
0.00270713
0.00386935
0.00526655
0.00692514
0.00887574
0.0111516
0.0137807
0.0167596
0.0200226
0.0234595
0.0269631
0.0304525
0.0338689
0.0371627
0.0402826
0.0431696
0.0457555
0.047965
0.0497208
0.0509556
0.000230302
0.00043701
0.00099668
0.0017432
0.00268427
0.00383645
0.00522136
0.00686518
0.00879823
0.0110538
0.0136615
0.0166244
0.0198866
0.0233414
0.0268789
0.0304135
0.0338832
0.037237
0.0404238
0.0433851
0.0460533
0.0483527
0.0502047
0.0515382
0.000227781
0.000433552
0.000988546
0.00172886
0.00266201
0.00380437
0.00517735
0.00680681
0.00872278
0.0109585
0.0135448
0.0164905
0.0197488
0.0232179
0.0267861
0.0303631
0.0338834
0.0372947
0.0405457
0.0435787
0.0463265
0.0487134
0.0506594
0.0520899
0.000225255
0.000430189
0.000980645
0.00171492
0.00264036
0.00377319
0.00513457
0.0067501
0.00864948
0.0108659
0.0134311
0.0163585
0.0196104
0.0230905
0.026686
0.0303025
0.033871
0.0373372
0.0406498
0.0437517
0.0465762
0.0490476
0.051085
0.0526096
0.000222727
0.000426935
0.00097301
0.00170144
0.00261943
0.00374302
0.00509318
0.0066952
0.00857854
0.0107762
0.0133207
0.0162293
0.0194726
0.0229608
0.0265805
0.0302338
0.0338478
0.0373666
0.0407383
0.0439064
0.0468048
0.0493583
0.0514846
0.0531019
0.000220195
0.000423774
0.000965616
0.0016884
0.00259918
0.00371384
0.00505315
0.00664215
0.00850999
0.0106895
0.0132138
0.0161034
0.0193365
0.0228301
0.0264713
0.0301588
0.0338162
0.0373853
0.0408139
0.0440459
0.0470159
0.0496492
0.0518633
0.0535743
0.000217662
0.000420714
0.000958461
0.00167577
0.00257959
0.00368563
0.00501448
0.00659091
0.00844382
0.0106058
0.0131105
0.015981
0.0192026
0.0226994
0.0263597
0.0300792
0.0337779
0.0373953
0.0408788
0.0441725
0.0472121
0.0499233
0.0522235
0.0540266
0.00021512
0.000417727
0.0009515
0.00166349
0.00256055
0.00365825
0.00497696
0.00654125
0.00837973
0.0105248
0.0130103
0.0158619
0.0190709
0.0225688
0.0262461
0.0299956
0.0337337
0.0373978
0.0409343
0.0442878
0.0473949
0.0501817
0.0525662
0.0544623
0.000212567
0.000414804
0.0009447
0.0016515
0.00254197
0.00363153
0.00494037
0.00649284
0.0083173
0.0104459
0.0129127
0.0157453
0.0189408
0.022438
0.02613
0.0299075
0.0336834
0.0373925
0.0409801
0.0443913
0.0475632
0.0504227
0.0528873
0.0548688
0.000209997
0.00041193
0.000938025
0.00163974
0.00252374
0.00360533
0.00490452
0.00644543
0.00825619
0.0103687
0.0128172
0.0156307
0.0188118
0.0223064
0.0260109
0.0298144
0.0336262
0.0373784
0.0410154
0.044482
0.0477161
0.0506449
0.0531853
0.0552463
0.000207412
0.000409099
0.000931456
0.00162815
0.00250581
0.00357957
0.00486928
0.00639885
0.00819615
0.0102928
0.0127232
0.0155177
0.0186833
0.0221734
0.0258883
0.0297155
0.0335612
0.0373547
0.041039
0.0445588
0.0478524
0.0508474
0.0534602
0.0555971
0.000204807
0.000406304
0.000924979
0.00161674
0.00248813
0.00355418
0.00483456
0.00635299
0.00813707
0.0102183
0.0126308
0.0154062
0.0185556
0.0220394
0.0257622
0.0296109
0.0334886
0.0373215
0.0410512
0.0446222
0.0479732
0.0510327
0.0537183
0.0559413
0.00020218
0.000403532
0.00091857
0.00160545
0.00247066
0.00352911
0.0048003
0.00630775
0.00807882
0.0101447
0.0125397
0.0152961
0.0184287
0.0219044
0.0256331
0.0295013
0.0334089
0.0372795
0.0410528
0.0446733
0.04808
0.0512022
0.0539581
0.0562564
0.000199529
0.000400776
0.000912212
0.00159426
0.00245336
0.0035043
0.00476642
0.00626303
0.0080213
0.0100722
0.0124498
0.0151873
0.0183024
0.0217688
0.0255013
0.029387
0.0333229
0.0372296
0.0410452
0.0447136
0.0481744
0.0513577
0.0541823
0.0565572
0.000196853
0.000398029
0.000905883
0.00158313
0.00243617
0.00347966
0.0047328
0.0062187
0.00796431
0.0100003
0.0123608
0.0150793
0.0181765
0.0216321
0.0253666
0.0292677
0.0332302
0.0371714
0.0410277
0.0447422
0.048255
0.0514964
0.0543852
0.0568281
0.000194153
0.000395285
0.000899565
0.00157203
0.00241904
0.00345513
0.00469936
0.00617464
0.0079077
0.00992903
0.0122725
0.0149721
0.018051
0.0214945
0.025229
0.0291436
0.0331308
0.037105
0.0410005
0.0447597
0.0483228
0.0516208
0.0545729
0.0570879
0.000191428
0.000392537
0.000893244
0.00156093
0.00240192
0.00343064
0.00466599
0.00613073
0.00785133
0.00985807
0.0121846
0.0148654
0.0179256
0.0213558
0.0250884
0.0290146
0.0330248
0.0370306
0.0409639
0.0447666
0.0483789
0.0517325
0.0547474
0.0573313
0.000188675
0.000389778
0.000886905
0.0015498
0.00238478
0.00340614
0.00463264
0.00608685
0.00779507
0.00978731
0.0120971
0.0147591
0.0178001
0.0212159
0.0249449
0.0288808
0.0329124
0.0369483
0.0409184
0.0447635
0.0484243
0.0518332
0.0549119
0.0575714
0.000185898
0.000387008
0.000880548
0.00153866
0.0023676
0.0033816
0.00459926
0.00604297
0.00773882
0.0097166
0.0120096
0.0146528
0.0176744
0.0210746
0.0247983
0.0287419
0.032793
0.0368575
0.0408631
0.0447494
0.0484572
0.0519195
0.055059
0.0577864
0.000183118
0.000384252
0.000874204
0.00152752
0.00235045
0.00335709
0.0045659
0.00599913
0.00768265
0.00964603
0.0119224
0.0145467
0.0175486
0.0209322
0.0246487
0.0285979
0.0326667
0.0367584
0.0407979
0.044724
0.0484771
0.0519911
0.0551891
0.0579838
0.000180308
0.000381507
0.000867888
0.00151643
0.00233335
0.00333266
0.00453266
0.00595544
0.00762668
0.00957573
0.0118355
0.014441
0.0174229
0.0207891
0.0244967
0.0284495
0.0325341
0.0366511
0.0407233
0.0446879
0.048485
0.052049
0.0553035
0.05816
0.000177485
0.000378758
0.000861605
0.00150541
0.00231637
0.0033084
0.00449966
0.00591208
0.00757115
0.00950598
0.0117493
0.0143361
0.0172979
0.020646
0.0243432
0.0282977
0.0323962
0.036537
0.0406404
0.0446422
0.0484825
0.052096
0.0554074
0.0583298
0.000174677
0.000376067
0.000855407
0.00149454
0.00229963
0.00328445
0.0044671
0.00586929
0.00751634
0.00943712
0.0116642
0.0142325
0.0171744
0.0205039
0.0241894
0.0281438
0.0322544
0.0364174
0.0405508
0.0445889
0.0484715
0.0521341
0.0555029
0.0584942
0.00017187
0.000373424
0.000849307
0.00148388
0.0022832
0.00326095
0.00443511
0.00582727
0.00746246
0.00936951
0.0115806
0.0141308
0.0170528
0.0203634
0.0240363
0.0279891
0.03211
0.0362936
0.0404555
0.0445286
0.0484521
0.0521621
0.0555853
0.0586374
0.00016907
0.000370844
0.000843408
0.00147345
0.00226716
0.00323801
0.00440387
0.00578613
0.00740978
0.0093033
0.0114988
0.0140311
0.0169337
0.0202254
0.0238847
0.0278344
0.0319641
0.0361667
0.0403557
0.0444624
0.0484254
0.052181
0.0556564
0.0587672
0.000166282
0.000368325
0.00083761
0.00146328
0.00225141
0.0032156
0.00437332
0.005746
0.00735833
0.00923875
0.011419
0.0139339
0.0168173
0.0200902
0.0237355
0.0276809
0.0318178
0.036038
0.0402527
0.0443916
0.0483928
0.0521926
0.0557188
0.0588873
0.000163501
0.000365873
0.000831969
0.00145337
0.00223612
0.00319367
0.00434358
0.00570687
0.00730829
0.00917586
0.0113414
0.0138393
0.0167041
0.0199583
0.0235892
0.0275294
0.0316723
0.0359088
0.040148
0.0443179
0.0483563
0.0521996
0.0557762
0.0590028
0.00016071
0.000363465
0.000826435
0.00144368
0.00222119
0.00317232
0.00431454
0.00566879
0.00725952
0.00911464
0.0112657
0.0137473
0.0165938
0.0198296
0.023446
0.0273802
0.031528
0.0357797
0.0400426
0.0442429
0.0483175
0.0522036
0.0558305
0.0591173
0.000157938
0.000361097
0.000821008
0.00143419
0.00220661
0.00315148
0.0042862
0.00563158
0.00721184
0.00905487
0.0111919
0.0136574
0.0164861
0.0197038
0.0233055
0.0272331
0.031385
0.035651
0.0399365
0.0441663
0.0482764
0.0522043
0.0558801
0.059224
0.000155178
0.000358809
0.000815721
0.00142485
0.00219224
0.003131
0.0042583
0.00559497
0.00716506
0.00899617
0.0111195
0.0135692
0.0163805
0.0195802
0.0231669
0.0270871
0.0312422
0.0355216
0.0398288
0.0440872
0.0482319
0.0522002
0.0559231
0.0593206
0.000152394
0.00035653
0.000810469
0.00141564
0.00217803
0.00311072
0.00423081
0.00555884
0.0071189
0.00893831
0.0110481
0.0134824
0.0162764
0.0194582
0.0230295
0.0269417
0.0310988
0.0353905
0.0397184
0.0440042
0.0481822
0.0521895
0.0559572
0.059405
0.000149603
0.000354295
0.000805311
0.00140659
0.00216407
0.00309077
0.00420369
0.00552331
0.00707344
0.00888128
0.0109777
0.0133967
0.0161736
0.0193375
0.022893
0.0267961
0.0309542
0.0352568
0.0396042
0.0439161
0.048126
0.0521706
0.0559815
0.0594789
0.000146794
0.000352103
0.000800231
0.0013977
0.00215038
0.0030712
0.00417709
0.00548839
0.00702874
0.0088252
0.0109084
0.0133124
0.0160723
0.0192183
0.0227576
0.0266509
0.0308085
0.0351208
0.0394866
0.0438234
0.0480639
0.0521447
0.0559979
0.0595467
0.000144001
0.000349956
0.000795286
0.00138901
0.00213704
0.0030521
0.00415109
0.00545423
0.00698493
0.00877026
0.0108405
0.0132296
0.0159728
0.0191011
0.0226241
0.0265066
0.0306629
0.0349835
0.0393662
0.0437268
0.0479966
0.0521122
0.0560061
0.0596017
0.000141222
0.000347916
0.000790545
0.00138061
0.00212404
0.00303354
0.00412577
0.0054209
0.00694226
0.00871665
0.0107744
0.0131489
0.0158758
0.0189865
0.0224931
0.0263645
0.0305183
0.0348463
0.0392446
0.0436279
0.0479258
0.0520748
0.0560073
0.0596468
0.000138414
0.000345898
0.000785861
0.00137238
0.00211132
0.00301537
0.00410109
0.00538843
0.00690072
0.00866451
0.01071
0.0130704
0.0157814
0.018875
0.0223654
0.0262253
0.030376
0.0347102
0.0391231
0.0435277
0.0478528
0.052034
0.0560034
0.0596835
0.000135589
0.000343925
0.000781274
0.00136435
0.00209892
0.00299764
0.00407698
0.00535681
0.00686025
0.00861371
0.0106472
0.0129939
0.0156894
0.0187664
0.0222408
0.0260891
0.030236
0.0345758
0.0390025
0.0434276
0.0477787
0.0519909
0.0559969
0.0597189
0.000132724
0.000341962
0.000776715
0.00135639
0.00208669
0.00298018
0.0040533
0.00532576
0.00682049
0.00856389
0.0105856
0.0129191
0.0155995
0.0186601
0.0221187
0.0259553
0.0300981
0.0344425
0.0388824
0.0433273
0.0477038
0.0519466
0.0559883
0.0597526
0.000129853
0.000340013
0.000772204
0.00134844
0.00207454
0.00296287
0.00402979
0.00529491
0.00678109
0.00851449
0.0105248
0.012845
0.0155105
0.0185549
0.0219979
0.0258224
0.0299607
0.0343092
0.0387615
0.0432255
0.0476266
0.0518989
0.0559755
0.0597803
0.000126937
0.000338078
0.000767663
0.00134048
0.00206226
0.00294547
0.00400617
0.00526398
0.00674158
0.00846514
0.010464
0.012771
0.0154216
0.0184499
0.0218768
0.025689
0.0298219
0.0341741
0.0386379
0.0431205
0.0475456
0.0518468
0.0559573
0.0598016
0.000123952
0.00033608
0.00076304
0.0013324
0.00204985
0.00292777
0.00398225
0.00523267
0.00670176
0.00841528
0.0104026
0.0126964
0.015332
0.0183439
0.0217545
0.0255536
0.0296804
0.0340352
0.03851
0.0430101
0.0474584
0.0517875
0.0559306
0.0598124
0.000120945
0.000334077
0.000758359
0.00132423
0.00203731
0.00290991
0.00395806
0.00520109
0.00666147
0.0083649
0.0103405
0.012621
0.0152415
0.0182367
0.0216305
0.0254156
0.0295352
0.0338917
0.0383768
0.042894
0.0473649
0.0517215
0.0558972
0.0598185
0.000117916
0.00033208
0.000753665
0.00131604
0.00202473
0.00289198
0.00393376
0.0051693
0.00662087
0.00831414
0.010278
0.0125449
0.0151501
0.0181283
0.0215047
0.0252752
0.0293865
0.0337435
0.0382378
0.0427715
0.0472644
0.0516477
0.0558544
0.0598096
0.000114897
0.000330118
0.000749057
0.0013079
0.00201227
0.0028742
0.00390957
0.00513758
0.00658038
0.0082634
0.0102155
0.0124689
0.0150587
0.0180198
0.0213785
0.0251334
0.0292357
0.0335921
0.0380946
0.0426442
0.0471588
0.051569
0.0558081
0.0598035
0.000111892
0.000328219
0.000744564
0.0013
0.00200004
0.0028568
0.00388588
0.00510641
0.00654054
0.00821354
0.010154
0.012394
0.0149684
0.0179126
0.0212537
0.0249927
0.0290848
0.0334399
0.0379499
0.0425146
0.0470506
0.0514879
0.0557598
0.059796
0.00010893
0.000326413
0.000740302
0.00129248
0.00198839
0.00284004
0.00386314
0.00507649
0.00650219
0.00816532
0.0100945
0.0123214
0.014881
0.0178086
0.0211322
0.0248555
0.028937
0.0332898
0.0378064
0.0423854
0.0469425
0.0514064
0.0557107
0.0597849
0.00010605
0.00032475
0.000736314
0.00128545
0.00197748
0.00282436
0.00384171
0.00504828
0.00646595
0.0081197
0.0100379
0.0122524
0.0147978
0.0177096
0.0210165
0.0247243
0.0287952
0.0331453
0.0376678
0.0422605
0.0468376
0.0513274
0.0556634
0.0597754
0.00010328
0.000323219
0.000732668
0.00127898
0.00196748
0.00280993
0.00382194
0.00502214
0.00643225
0.00807728
0.00998527
0.012188
0.0147201
0.0176171
0.0209083
0.0246015
0.0286623
0.0330093
0.0375371
0.0421426
0.046739
0.0512539
0.0556205
0.059769
0.00010062
0.000321859
0.000729386
0.00127309
0.00195828
0.0027967
0.00380376
0.00499808
0.00640129
0.00803816
0.00993683
0.0121287
0.0146485
0.0175317
0.0208085
0.0244884
0.0285397
0.032884
0.0374165
0.0420343
0.0466489
0.0511876
0.0555835
0.0597675
9.80216e-05
0.000320561
0.000726267
0.00126757
0.00194968
0.00278435
0.0037869
0.00497578
0.00637262
0.00800203
0.00989207
0.012074
0.0145824
0.0174531
0.0207167
0.0243845
0.0284275
0.0327697
0.0373071
0.0419364
0.0465689
0.0511304
0.0555536
0.0597672
9.54916e-05
0.0003193
0.000723249
0.00126224
0.00194143
0.00277252
0.00377077
0.00495459
0.00634543
0.00796781
0.00984964
0.0120222
0.0145201
0.017379
0.0206305
0.0242872
0.0283228
0.0326634
0.037206
0.0418469
0.0464967
0.0510811
0.055533
0.0597824
9.30067e-05
0.000318001
0.000720147
0.00125682
0.00193311
0.00276064
0.00375467
0.00493349
0.00631843
0.00793395
0.00980777
0.0119713
0.0144587
0.0173061
0.0205455
0.0241914
0.0282196
0.0325589
0.0371068
0.041759
0.0464255
0.0510313
0.0555091
0.0597897
9.05971e-05
0.000316609
0.000716883
0.00125111
0.00192441
0.00274825
0.00373789
0.00491154
0.00629036
0.00789885
0.0097645
0.0119185
0.0143951
0.0172305
0.0204573
0.0240914
0.0281116
0.0324485
0.0370009
0.0416634
0.0463448
0.0509689
0.0554669
0.0597669
8.82677e-05
0.00031514
0.000713427
0.00124502
0.00191506
0.00273502
0.00371994
0.00488806
0.00626047
0.00786143
0.00971846
0.0118624
0.0143276
0.0171499
0.0203628
0.0239837
0.0279943
0.0323277
0.0368832
0.0415552
0.0462504
0.0508913
0.0554081
0.0597293
8.60058e-05
0.000313523
0.000709651
0.00123845
0.00190497
0.00272071
0.00370066
0.00486284
0.0062284
0.00782136
0.00966913
0.0118023
0.0142551
0.0170635
0.0202613
0.0238674
0.0278666
0.032195
0.0367528
0.0414333
0.0461422
0.0508004
0.0553376
0.0596827
8.38472e-05
0.000311794
0.000705635
0.00123145
0.00189426
0.0027055
0.00368011
0.00483607
0.0061943
0.00777875
0.00961662
0.0117385
0.0141782
0.0169718
0.0201533
0.0237434
0.0277297
0.0320517
0.0366109
0.0412999
0.0460229
0.0506996
0.0552592
0.0596316
8.17996e-05
0.000309969
0.000701399
0.0012241
0.00188303
0.00268955
0.00365858
0.00480797
0.00615849
0.00773404
0.00956156
0.0116716
0.0140977
0.0168757
0.0200403
0.0236135
0.0275857
0.0319
0.03646
0.0411574
0.0458952
0.0505917
0.0551761
0.059579
7.99021e-05
0.000308078
0.000697064
0.00121652
0.00187148
0.00267315
0.00363639
0.00477895
0.00612154
0.00768786
0.00950483
0.0116026
0.0140147
0.016777
0.0199241
0.0234795
0.0274369
0.0317426
0.0363022
0.0410079
0.0457607
0.050478
0.0550885
0.0595236
7.8143e-05
0.000306204
0.000692714
0.00120891
0.00185976
0.00265656
0.00361388
0.00474951
0.00608401
0.00764105
0.00944726
0.0115326
0.0139305
0.0166768
0.0198064
0.0233437
0.0272854
0.0315815
0.0361399
0.0408531
0.0456206
0.0503584
0.0549944
0.0594599
7.65043e-05
0.000304313
0.000688395
0.00120136
0.00184815
0.00263998
0.00359147
0.00472019
0.0060467
0.00759438
0.00938986
0.0114629
0.0138468
0.0165772
0.0196892
0.0232084
0.027134
0.0314198
0.0359761
0.0406957
0.0454773
0.0502355
0.0548973
0.0593945
7.50106e-05
0.000302495
0.000684217
0.00119406
0.00183691
0.00262394
0.00356969
0.00469169
0.00601032
0.00754887
0.00933375
0.0113949
0.013765
0.0164799
0.0195748
0.0230763
0.0269857
0.0312605
0.0358141
0.0405392
0.0453338
0.050111
0.0547959
0.0593173
7.36443e-05
0.000300774
0.000680256
0.00118713
0.00182624
0.00260868
0.00354897
0.00466452
0.00597556
0.00750537
0.00928018
0.0113297
0.0136868
0.0163869
0.0194656
0.0229502
0.0268441
0.0311081
0.0356583
0.0403885
0.0451958
0.0499924
0.0547033
0.05926
7.23989e-05
0.000299166
0.000676581
0.00118062
0.00181626
0.00259441
0.0035295
0.00463895
0.00594289
0.0074644
0.00922978
0.0112684
0.0136132
0.0162995
0.0193631
0.0228318
0.0267115
0.0309653
0.0355121
0.0402471
0.0450668
0.0498827
0.0546198
0.0592085
7.12503e-05
0.000297659
0.000673133
0.00117457
0.00180687
0.00258103
0.00351131
0.00461501
0.0059123
0.00742617
0.00918268
0.0112112
0.0135445
0.016218
0.0192675
0.0227218
0.026588
0.0308324
0.0353761
0.0401152
0.0449466
0.0497808
0.0545428
0.0591658
7.01811e-05
0.00029623
0.000669904
0.00116889
0.00179809
0.00256845
0.00349424
0.00459264
0.00588369
0.00739027
0.00913847
0.0111575
0.01348
0.0161415
0.0191778
0.0226184
0.0264719
0.0307071
0.0352474
0.0399898
0.044831
0.0496808
0.0544629
0.0591079
6.91855e-05
0.000294879
0.000666822
0.0011635
0.00178979
0.00255658
0.0034781
0.00457145
0.00585658
0.00735628
0.00909647
0.0111065
0.0134188
0.0160687
0.0190923
0.0225196
0.0263607
0.0305866
0.0351229
0.0398673
0.0447162
0.0495781
0.0543745
0.0590318
6.82599e-05
0.000293574
0.000663887
0.00115834
0.00178187
0.00254524
0.00346266
0.00455118
0.00583059
0.00732371
0.00905628
0.0110575
0.0133598
0.0159986
0.0190098
0.0224242
0.026253
0.0304694
0.0350011
0.0397469
0.0446025
0.0494753
0.0542859
0.0589602
6.73938e-05
0.00029234
0.000661094
0.00115337
0.00177418
0.00253426
0.00344768
0.00453149
0.00580541
0.00729208
0.00901731
0.01101
0.0133026
0.0159303
0.0189294
0.0223309
0.0261475
0.0303545
0.0348815
0.0396285
0.0444906
0.0493748
0.0542011
0.0588965
6.65661e-05
0.000291108
0.000658318
0.00114849
0.00176662
0.00252346
0.00343302
0.00451219
0.00578072
0.00726113
0.00897912
0.0109634
0.0132464
0.0158632
0.0188503
0.022239
0.0260433
0.0302408
0.0347631
0.0395111
0.0443801
0.049276
0.0541183
0.0588336
6.57799e-05
0.000289899
0.000655597
0.0011437
0.00175922
0.00251286
0.0034186
0.00449327
0.00575649
0.00723069
0.00894143
0.0109175
0.013191
0.015797
0.018772
0.0221479
0.02594
0.0301278
0.0346453
0.0393942
0.04427
0.0491776
0.0540362
0.0587715
6.50269e-05
0.000288703
0.000652901
0.00113898
0.00175194
0.00250244
0.00340443
0.00447464
0.00573258
0.0072007
0.0089043
0.0108722
0.0131363
0.0157316
0.0186946
0.0220578
0.0258375
0.0300156
0.0345283
0.0392783
0.0441608
0.0490805
0.0539558
0.0587137
6.43177e-05
0.000287517
0.00065027
0.00113435
0.00174483
0.00249224
0.00339053
0.00445631
0.00570908
0.00717113
0.00886778
0.0108275
0.0130823
0.0156671
0.0186183
0.0219687
0.0257363
0.0299046
0.0344125
0.0391638
0.0440534
0.0489856
0.0538784
0.0586588
6.36483e-05
0.0002864
0.000647741
0.00112986
0.00173786
0.00248227
0.00337688
0.00443835
0.00568601
0.00714216
0.00883194
0.0107837
0.0130293
0.0156036
0.0185432
0.0218812
0.0256366
0.0297954
0.0342983
0.0390509
0.0439476
0.0488923
0.0538021
0.0586046
6.30066e-05
0.000285294
0.000645272
0.00112546
0.00173101
0.00247247
0.00336355
0.00442077
0.00566352
0.00711381
0.00879685
0.0107408
0.0129774
0.0155415
0.0184696
0.0217954
0.0255388
0.029688
0.034186
0.0389394
0.0438433
0.0487998
0.0537258
0.058547
6.23974e-05
0.000284215
0.00064286
0.00112119
0.00172439
0.00246295
0.00335055
0.00440369
0.00564157
0.00708617
0.00876254
0.0106989
0.0129267
0.0154808
0.0183977
0.0217114
0.025443
0.0295828
0.034076
0.0388305
0.0437412
0.0487097
0.0536515
0.0584916
6.18174e-05
0.000283164
0.000640494
0.00111703
0.00171794
0.00245368
0.00333791
0.00438703
0.00562014
0.00705922
0.0087291
0.0106581
0.0128773
0.0154216
0.0183276
0.0216297
0.0253499
0.0294803
0.0339689
0.0387246
0.0436423
0.0486232
0.0535818
0.058442
6.12637e-05
0.000282108
0.000638167
0.0011129
0.00171161
0.00244459
0.0033255
0.00437065
0.00559911
0.00703272
0.00869634
0.0106179
0.0128288
0.0153636
0.0182589
0.0215495
0.0252586
0.02938
0.0338638
0.0386206
0.0435453
0.0485386
0.053515
0.0584007
6.07344e-05
0.000281064
0.000635853
0.00110882
0.00170525
0.00243555
0.00331314
0.00435438
0.00557821
0.0070065
0.00866387
0.0105782
0.0127807
0.015306
0.0181907
0.0214699
0.0251676
0.0292798
0.0337585
0.038516
0.043447
0.0484516
0.0534435
0.058348
6.02274e-05
0.000280022
0.000633552
0.00110472
0.00169891
0.00242643
0.00330074
0.00433804
0.00555731
0.00698016
0.00863126
0.0105383
0.0127324
0.0152481
0.018122
0.0213895
0.0250754
0.0291777
0.0336505
0.0384073
0.0433435
0.0483576
0.0533618
0.0582784
5.97434e-05
0.000278967
0.000631216
0.00110061
0.00169253
0.00241727
0.00328826
0.00432164
0.00553626
0.00695365
0.00859831
0.0104981
0.0126837
0.0151896
0.0180524
0.0213077
0.0249813
0.0290729
0.0335391
0.0382947
0.0432351
0.0482581
0.0532743
0.0582056
5.92828e-05
0.000277924
0.000628891
0.00109651
0.00168619
0.00240815
0.00327581
0.00430525
0.00551515
0.00692707
0.00856534
0.0104576
0.0126347
0.0151307
0.0179822
0.0212252
0.0248861
0.0289664
0.0334253
0.0381792
0.0431235
0.0481547
0.0531818
0.0581225
5.88505e-05
0.000276906
0.000626646
0.00109248
0.00167995
0.00239921
0.00326356
0.00428906
0.00549434
0.00690079
0.00853278
0.0104176
0.0125862
0.0150724
0.0179129
0.0211436
0.024792
0.0288614
0.0333132
0.0380661
0.0430153
0.0480577
0.0531025
0.0580741
5.84441e-05
0.000275917
0.000624459
0.00108859
0.00167388
0.00239048
0.00325165
0.00427328
0.00547404
0.00687525
0.00850106
0.0103787
0.012539
0.0150157
0.0178455
0.0210645
0.024701
0.0287601
0.0332057
0.0379582
0.0429139
0.0479687
0.0530313
0.058023
5.80583e-05
0.000274954
0.000622359
0.00108485
0.00166806
0.00238208
0.00324012
0.00425809
0.0054545
0.00685054
0.00847038
0.0103411
0.0124934
0.014961
0.0177804
0.0209882
0.0246134
0.0286628
0.0331027
0.0378553
0.0428174
0.0478846
0.0529649
0.0579803
5.76983e-05
0.000274025
0.000620315
0.00108124
0.00166243
0.00237397
0.00322903
0.00424341
0.00543558
0.00682663
0.00844058
0.0103047
0.0124491
0.0149078
0.0177171
0.0209139
0.0245279
0.0285675
0.0330015
0.0377537
0.0427212
0.0477989
0.0528928
0.0579205
5.73684e-05
0.00027312
0.000618349
0.00107773
0.00165699
0.00236611
0.00321823
0.00422913
0.00541712
0.00680331
0.00841155
0.010269
0.0124057
0.0148556
0.0176549
0.0208406
0.0244433
0.0284726
0.0328999
0.0376507
0.0426225
0.0477092
0.0528151
0.0578557
5.70667e-05
0.000272273
0.000616472
0.00107433
0.00165168
0.00235846
0.00320769
0.00421515
0.00539909
0.00678047
0.00838317
0.010234
0.0123632
0.0148043
0.0175938
0.0207685
0.0243597
0.0283789
0.0327994
0.037549
0.0425258
0.0476237
0.052748
0.0578212
5.67776e-05
0.000271416
0.000614602
0.00107099
0.00164644
0.0023509
0.00319735
0.00420141
0.00538137
0.00675806
0.0083553
0.0101997
0.0123215
0.014754
0.0175337
0.0206977
0.0242777
0.0282869
0.0327009
0.0374496
0.0424322
0.047542
0.0526834
0.0577741
5.64998e-05
0.00027056
0.00061276
0.00106769
0.00164129
0.00234345
0.00318713
0.0041879
0.00536393
0.00673598
0.00832772
0.0101658
0.0122802
0.0147043
0.0174743
0.0206276
0.0241966
0.0281959
0.0326034
0.037351
0.042339
0.0474599
0.0526168
0.0577257
5.62413e-05
0.000269712
0.000610905
0.00106438
0.00163611
0.002336
0.0031769
0.00417436
0.00534645
0.00671386
0.00830017
0.0101319
0.012239
0.0146545
0.0174148
0.0205573
0.024115
0.028104
0.0325044
0.0372503
0.0422424
0.0473729
0.0525432
0.0576667
5.59906e-05
0.000268851
0.00060901
0.001061
0.00163087
0.00232844
0.00316653
0.00416063
0.00532868
0.00669142
0.00827219
0.0100975
0.012197
0.0146038
0.0173542
0.0204854
0.0240313
0.0280091
0.0324015
0.0371446
0.0421401
0.0472803
0.0524676
0.0576236
5.57396e-05
0.000267944
0.00060709
0.00105754
0.00162551
0.00232073
0.00315594
0.0041466
0.0053106
0.0066685
0.00824364
0.0100623
0.0121541
0.0145519
0.0172918
0.0204113
0.0239444
0.0279099
0.0322925
0.0370312
0.0420275
0.0471727
0.0523646
0.0575103
5.54971e-05
0.000267041
0.000605144
0.00105409
0.00162009
0.00231291
0.00314525
0.00413241
0.00529231
0.00664533
0.00821476
0.0100267
0.0121106
0.0144992
0.0172285
0.0203358
0.0238557
0.0278082
0.0321804
0.0369133
0.0419102
0.0470604
0.0522601
0.0574165
5.52784e-05
0.000266213
0.000603301
0.00105077
0.00161488
0.00230535
0.00313484
0.00411861
0.00527444
0.00662265
0.00818636
0.00999167
0.0120678
0.0144474
0.0171661
0.0202615
0.0237685
0.0277085
0.0320709
0.0367992
0.0417978
0.0469567
0.0521722
0.0573574
5.50947e-05
0.000265557
0.000601601
0.00104771
0.00161007
0.00229832
0.00312514
0.00410569
0.00525762
0.00660126
0.00815953
0.00995856
0.0120273
0.0143983
0.0171071
0.0201915
0.0236865
0.0276149
0.0319691
0.0366944
0.041697
0.0468664
0.0520985
0.0573032
5.49482e-05
0.00026501
0.000600163
0.00104505
0.00160587
0.00229216
0.00311652
0.00409409
0.00524249
0.00658187
0.00813522
0.00992836
0.0119903
0.0143534
0.0170532
0.0201274
0.0236119
0.0275304
0.0318774
0.0366012
0.0416082
0.0467879
0.0520343
0.0572541
5.48327e-05
0.000264624
0.000599035
0.00104291
0.00160238
0.00228699
0.0031092
0.00408417
0.0052294
0.00656508
0.00811398
0.0099018
0.0119576
0.0143135
0.0170053
0.0200705
0.0235455
0.0274554
0.0317965
0.0365194
0.0415312
0.046721
0.0519816
0.0572208
5.47376e-05
0.000264346
0.000598182
0.00104123
0.00159959
0.00228277
0.00310324
0.00407596
0.00521852
0.00655088
0.00809586
0.00987901
0.0119293
0.0142788
0.0169632
0.0200202
0.0234865
0.0273885
0.0317243
0.0364462
0.0414624
0.046661
0.0519336
0.0571849
5.46772e-05
0.000264213
0.000597618
0.00104007
0.00159756
0.00227961
0.0030986
0.0040695
0.00520974
0.00653925
0.00808072
0.00985975
0.011905
0.0142487
0.0169262
0.0199755
0.0234335
0.0273279
0.0316584
0.036379
0.0413988
0.0466053
0.0518885
0.057152
5.46443e-05
0.000264219
0.000597333
0.00103938
0.00159626
0.00227742
0.00309526
0.00406466
0.00520292
0.00652998
0.00806836
0.00984371
0.0118844
0.0142226
0.0168937
0.0199355
0.0233855
0.027272
0.031597
0.0363162
0.0413393
0.0465533
0.0518476
0.0571251
5.46411e-05
0.000264362
0.00059736
0.00103914
0.00159565
0.00227622
0.00309316
0.00406134
0.00519799
0.00652292
0.00805867
0.00983056
0.0118672
0.0142002
0.0168651
0.0198996
0.0233417
0.0272205
0.0315397
0.0362574
0.0412838
0.0465059
0.0518123
0.0571064
5.4665e-05
0.000264641
0.000597661
0.0010394
0.00159571
0.00227595
0.0030923
0.00405953
0.0051949
0.00651814
0.00805157
0.00982041
0.0118531
0.0141814
0.0168403
0.0198678
0.0233019
0.027173
0.0314865
0.0362025
0.0412327
0.0464629
0.0517811
0.05709
5.47124e-05
0.000265062
0.000598282
0.00104019
0.00159656
0.0022767
0.00309276
0.00405942
0.00519388
0.00651569
0.00804718
0.00981338
0.0118426
0.0141664
0.0168196
0.0198402
0.0232666
0.0271299
0.0314376
0.0361521
0.0411859
0.0464242
0.0517531
0.0570729
5.4793e-05
0.00026566
0.000599247
0.00104155
0.00159826
0.0022786
0.0030947
0.00406118
0.00519509
0.0065159
0.00804576
0.00980981
0.0118359
0.0141555
0.0168034
0.0198175
0.0232361
0.0270917
0.0313939
0.0361071
0.0411446
0.0463907
0.0517297
0.05706
5.49208e-05
0.000266456
0.000600631
0.00104359
0.00160096
0.00228185
0.00309838
0.00406507
0.00519882
0.00651911
0.00804789
0.0098101
0.0118336
0.0141495
0.0167924
0.0198001
0.0232114
0.0270595
0.0313563
0.0360685
0.04111
0.0463642
0.0517138
0.0570564
5.50964e-05
0.000267496
0.000602504
0.00104641
0.00160477
0.00228663
0.00310397
0.0040713
0.00520545
0.00652567
0.00805393
0.00981482
0.0118362
0.0141488
0.0167872
0.0197889
0.023193
0.0270338
0.0313251
0.0360366
0.0410824
0.0463449
0.0517046
0.057058
5.53158e-05
0.000268778
0.000604891
0.00105009
0.0016098
0.00229306
0.00311175
0.0040802
0.00521525
0.00653601
0.00806429
0.00982445
0.0118441
0.014154
0.0167882
0.0197842
0.0231813
0.0270147
0.0313005
0.0360109
0.0410616
0.0463326
0.0517023
0.0570641
5.55852e-05
0.000270342
0.000607881
0.00105476
0.00161629
0.00230142
0.00312195
0.00409217
0.00522871
0.00655057
0.00807935
0.00983937
0.0118579
0.0141653
0.0167957
0.0197862
0.0231761
0.0270017
0.0312816
0.0359909
0.0410463
0.0463264
0.0517056
0.0570679
5.59185e-05
0.000272239
0.000611537
0.00106055
0.0016244
0.00231196
0.00313496
0.00410754
0.00524617
0.00656979
0.0080997
0.00986013
0.0118779
0.0141833
0.0168099
0.0197947
0.023177
0.0269941
0.0312672
0.0359749
0.0410358
0.0463289
0.0517317
0.0571486
5.63371e-05
0.000274526
0.000616027
0.00106764
0.00163445
0.00232508
0.00315121
0.00412683
0.00526831
0.00659432
0.00812606
0.00988733
0.0119049
0.0142085
0.0168314
0.01981
0.023184
0.0269909
0.0312545
0.0359576
0.0410204
0.0463192
0.0517245
0.0571181
5.68562e-05
0.000277352
0.000621569
0.00107645
0.00164683
0.00234135
0.00317141
0.00415094
0.00529605
0.00662534
0.00815966
0.00992249
0.0119402
0.0142423
0.0168614
0.0198338
0.0231984
0.0269937
0.031246
0.0359429
0.041007
0.046314
0.0517334
0.0571579
5.74909e-05
0.000280782
0.000628405
0.00108734
0.00166224
0.00236159
0.00319668
0.00418118
0.0053311
0.00666466
0.00820254
0.00996777
0.0119864
0.0142874
0.0169031
0.0198689
0.0232237
0.0270064
0.0312461
0.0359354
0.0410012
0.0463175
0.0517501
0.0571838
5.82999e-05
0.000285099
0.00063706
0.00110116
0.00168179
0.00238727
0.00322871
0.00421963
0.00537573
0.00671494
0.0082575
0.0100264
0.0120469
0.0143475
0.01696
0.0199194
0.0232639
0.0270333
0.0312589
0.0359391
0.0410052
0.0463288
0.0517692
0.0572015
5.93043e-05
0.000290439
0.000647885
0.00111864
0.00170674
0.00242023
0.00327002
0.00426929
0.00543342
0.0067801
0.00832909
0.0101029
0.0121264
0.0144275
0.0170373
0.0199904
0.0233246
0.0270795
0.0312896
0.0359594
0.0410256
0.0463586
0.0518141
0.0572702
6.0787e-05
0.000297937
0.000662757
0.00114206
0.00173967
0.00246334
0.0033237
0.00433368
0.00550828
0.00686461
0.00842215
0.0102026
0.0122306
0.0145332
0.0171409
0.0200878
0.0234111
0.0271509
0.031344
0.0360018
0.0410678
0.0464116
0.0518838
0.0573573
6.24102e-05
0.0003068
0.000681685
0.00117313
0.0017841
0.00252188
0.00339663
0.00442076
0.00560888
0.00697758
0.00854584
0.0103347
0.0123681
0.0146728
0.0172786
0.0202187
0.0235302
0.0272534
0.0314272
0.0360702
0.0411352
0.0464911
0.0519827
0.0574828
6.51053e-05
0.000320082
0.000707701
0.00121433
0.00184243
0.00259861
0.0034923
0.00453525
0.00574124
0.00712614
0.00870814
0.0105078
0.0125481
0.0148553
0.0174587
0.020391
0.0236889
0.0273927
0.0315432
0.0361664
0.0412263
0.0465911
0.0520947
0.0575945
6.90087e-05
0.000340331
0.000750312
0.00128231
0.00193691
0.00271966
0.00363908
0.0047061
0.00593378
0.00733734
0.00893427
0.0107447
0.0127912
0.0150994
0.017698
0.0206196
0.0239004
0.0275805
0.0317021
0.0362976
0.041345
0.0467156
0.0522303
0.0577371
7.45431e-05
0.000366202
0.000808796
0.00137872
0.00207317
0.00289512
0.00385144
0.0049517
0.00620812
0.00763527
0.00925007
0.0110723
0.0131244
0.0154317
0.018023
0.0209306
0.0241903
0.0278418
0.0319279
0.0364862
0.0415113
0.0468824
0.0524039
0.0579086
8.51419e-05
0.000507178
0.00104965
0.00169769
0.00245111
0.00331912
0.00431122
0.00543866
0.00671478
0.00815492
0.0097763
0.0115988
0.013645
0.0159403
0.0185136
0.021397
0.0246265
0.0282421
0.032287
0.0368033
0.0417975
0.0471571
0.0526776
0.0581932
0.000669442
0.00256448
0.00475822
0.00711454
0.00959
0.012167
0.014833
0.0175803
0.0204028
0.0232936
0.0262459
0.0292562
0.0323232
0.0354457
0.0386221
0.0418503
0.0451279
0.048451
0.0518147
0.0552135
0.0586407
0.0620887
0.0655511
0.0690272
0.000260205
0.0010999
0.00260476
0.0044084
0.00646761
0.00873799
0.0111864
0.0137906
0.0165327
0.0193977
0.0223728
0.0254468
0.0286107
0.0318561
0.035175
0.0385608
0.0420062
0.0455034
0.0490452
0.0526236
0.0562298
0.0598549
0.0634895
0.0671313
0.000285242
0.0010029
0.00220313
0.00367483
0.00539071
0.00732843
0.00947204
0.0118081
0.0143239
0.0170074
0.0198462
0.022828
0.0259401
0.02917
0.0325057
0.0359355
0.0394471
0.0430292
0.0466706
0.0503595
0.0540846
0.0578344
0.0615983
0.0653781
0.000344574
0.000896021
0.00192311
0.00319591
0.00469453
0.00640885
0.00833188
0.0104574
0.0127789
0.0152887
0.0179782
0.0208377
0.0238558
0.0270205
0.0303187
0.0337368
0.037261
0.0408771
0.0445709
0.048328
0.0521345
0.0559764
0.0598414
0.0637306
0.000348042
0.000776158
0.00168293
0.00281743
0.0041654
0.0057211
0.0074815
0.00944427
0.0116072
0.0139666
0.0165176
0.0192536
0.0221663
0.0252459
0.0284805
0.0318572
0.0353619
0.0389793
0.0426936
0.0464888
0.0503489
0.0542572
0.0581982
0.0621609
0.00035145
0.000691247
0.00150867
0.00253884
0.00377162
0.00520304
0.00683262
0.0086611
0.010689
0.0129158
0.0153399
0.0179577
0.020764
0.0237513
0.02691
0.0302288
0.0336941
0.0372912
0.0410038
0.0448149
0.0487067
0.0526612
0.056661
0.060694
0.00035052
0.000629641
0.00137734
0.002325
0.00346548
0.00479569
0.0063172
0.00803266
0.00994456
0.012055
0.0143647
0.016873
0.019577
0.0224718
0.0255501
0.0288024
0.0322168
0.0357792
0.0394742
0.0432841
0.0471903
0.0511737
0.055214
0.0592903
0.000349059
0.000581517
0.00127206
0.00215195
0.00321639
0.00446261
0.00589336
0.00751262
0.00932458
0.0113329
0.0135403
0.0159484
0.0185563
0.0213616
0.0243591
0.0275413
0.030898
0.0344168
0.0380827
0.0418784
0.0457853
0.0497827
0.0538478
0.0579536
0.000347621
0.000542742
0.00118567
0.00200869
0.00300929
0.00418445
0.00553769
0.00707397
0.00879865
0.0107167
0.0128325
0.0151491
0.0176676
0.0203876
0.023306
0.0264172
0.0297129
0.0331822
0.036811
0.0405832
0.04448
0.0484797
0.0525583
0.0566859
0.000346132
0.00051088
0.00111344
0.00188797
0.00283415
0.00394826
0.00523437
0.00669811
0.00834587
0.0101836
0.0122168
0.0144498
0.0168855
0.0195251
0.0223672
0.0254082
0.0286415
0.0320577
0.0356443
0.039386
0.0432646
0.0472583
0.0513433
0.0554933
0.000344638
0.000484222
0.00105204
0.00178475
0.00268357
0.00374447
0.00497168
0.00637154
0.00795091
0.0097166
0.0116751
0.0138317
0.0161909
0.0187548
0.0215241
0.0244966
0.0276675
0.0310291
0.0345701
0.0382767
0.0421312
0.0461137
0.0502023
0.0543795
0.00034318
0.000461504
0.000999128
0.00169561
0.0025522
0.0035661
0.00474128
0.00608432
0.00760246
0.00930325
0.0111937
0.0132804
0.0155686
0.0180618
0.020762
0.0236684
0.0267779
0.0300841
0.0335777
0.0372458
0.0410721
0.0450375
0.0491197
0.0532932
0.000341764
0.000442062
0.000953113
0.00161757
0.00243633
0.00340842
0.0045371
0.0058291
0.0072921
0.00893397
0.0107625
0.0127849
0.0150072
0.0174342
0.0200688
0.0229119
0.0259614
0.0292127
0.0326579
0.0362853
0.0400801
0.044024
0.0480953
0.0522743
0.00034074
0.00042763
0.000912651
0.00154839
0.00233322
0.00326782
0.00435466
0.00560049
0.00701341
0.00860162
0.0103734
0.0123363
0.0144974
0.0168624
0.0194351
0.0222174
0.025209
0.0284063
0.0318027
0.0353883
0.0391496
0.0430694
0.0471276
0.0513078
0.000340873
0.00042262
0.000876799
0.00148651
0.00224065
0.00314142
0.00419026
0.00539418
0.00676141
0.00830049
0.0100199
0.0119279
0.014032
0.0163387
0.0188529
0.0215774
0.0245129
0.0276575
0.0310056
0.0345489
0.0382753
0.042169
0.0462117
0.0503876
0.000342028
0.000423713
0.000844919
0.00143076
0.00215695
0.00302688
0.00404121
0.00520691
0.00653223
0.00802595
0.00969704
0.011554
0.0136051
0.0158571
0.0183157
0.0209851
0.0238669
0.02696
0.0302605
0.0337615
0.0374519
0.0413175
0.0453407
0.049503
0.000343473
0.000426131
0.000816408
0.0013805
0.0020814
0.00292255
0.00390522
0.00503578
0.00632249
0.00777443
0.00940062
0.0112102
0.0132114
0.015412
0.0178184
0.0204353
0.0232652
0.0263084
0.0295625
0.033021
0.0366745
0.04051
0.0445102
0.0486549
0.000344723
0.000428135
0.000790853
0.00133496
0.00201268
0.00282711
0.00378052
0.00487862
0.00612969
0.00754278
0.00912729
0.0108925
0.0128471
0.0149993
0.0173561
0.0199228
0.0227031
0.0256983
0.0289065
0.0323229
0.0359392
0.0397431
0.0437178
0.047843
0.000345695
0.0004294
0.000767789
0.00129344
0.00194973
0.00273938
0.00366571
0.00473369
0.00595164
0.00732865
0.00887427
0.0105978
0.0125086
0.0146152
0.0169249
0.019444
0.0221768
0.0251253
0.0282889
0.0316637
0.0352427
0.0390143
0.0429631
0.0470716
0.000346396
0.000429982
0.000746823
0.00125534
0.00189175
0.00265837
0.00355949
0.00459954
0.00578659
0.00712994
0.0086391
0.0103237
0.0121933
0.0142566
0.0165217
0.0189953
0.0216824
0.024586
0.0277061
0.0310402
0.0345818
0.0383211
0.0422443
0.0463385
0.000346861
0.000430044
0.000727873
0.00122021
0.0018381
0.00258312
0.00346084
0.00447484
0.00563313
0.00694492
0.00841982
0.0100678
0.0118984
0.0139209
0.0161437
0.0185739
0.0212172
0.0240772
0.0271551
0.030449
0.0339536
0.0376601
0.0415554
0.0456234
0.000347211
0.000430063
0.000712762
0.00118785
0.00178827
0.00251316
0.0033689
0.00435855
0.00548986
0.00677202
0.00821478
0.00982824
0.0116221
0.0136058
0.0157882
0.018177
0.0207782
0.0235962
0.0266331
0.0298876
0.0333554
0.0370284
0.0408939
0.0449348
0.000347602
0.000431052
0.000705135
0.00115836
0.0017421
0.00244834
0.00328309
0.0042498
0.00535574
0.00661004
0.00802256
0.00960329
0.0113623
0.0133092
0.0154532
0.0178023
0.0203631
0.0231408
0.0261377
0.0293535
0.0327851
0.0364246
0.0402602
0.0442763
0.000348159
0.000433409
0.000703848
0.00113172
0.0016993
0.00238797
0.00320277
0.00414784
0.00522989
0.00645794
0.00784182
0.00939165
0.0111176
0.0130295
0.0151368
0.017448
0.0199701
0.0227085
0.0256666
0.0288449
0.0322405
0.0358471
0.0396543
0.0436505
0.000348865
0.000436599
0.000705199
0.00110759
0.0016595
0.00233148
0.00312736
0.00405201
0.0051115
0.00631474
0.00767151
0.00919204
0.0108866
0.0127652
0.0148375
0.0171123
0.019597
0.0222977
0.0252181
0.0283596
0.0317201
0.0352941
0.0390723
0.0430423
0.000349608
0.00043989
0.000706828
0.00108547
0.00162233
0.00227844
0.00305638
0.0039617
0.00499986
0.00617959
0.00751068
0.00900337
0.010668
0.0125148
0.0145537
0.0167935
0.0192423
0.0219065
0.0247905
0.027896
0.031222
0.0347636
0.038512
0.0424533
0.000350279
0.000442824
0.000707747
0.00106497
0.00158749
0.00222851
0.0029894
0.00387641
0.00489435
0.00605179
0.00735849
0.00882469
0.0104608
0.0122773
0.0142841
0.0164904
0.0189046
0.0215336
0.0243821
0.0274527
0.0307449
0.0342548
0.0379746
0.0418929
0.000350827
0.000445242
0.000707784
0.00104579
0.00155472
0.00218136
0.00292601
0.00379567
0.00479444
0.00593071
0.00721418
0.00865514
0.0102641
0.0120515
0.0140275
0.0162017
0.0185827
0.0211775
0.0239917
0.0270284
0.0302879
0.0337674
0.0374615
0.041366
0.000351255
0.000447152
0.000706984
0.00102774
0.00152384
0.00213691
0.00286635
0.00371919
0.00469967
0.00581577
0.00707713
0.00849401
0.010077
0.0118366
0.0137831
0.0159264
0.0182752
0.0208372
0.0236182
0.0266219
0.0298496
0.0332994
0.0369664
0.0408422
0.00035157
0.000448621
0.000705497
0.0010108
0.00149474
0.00209498
0.00281001
0.00364661
0.00460961
0.00570649
0.00694674
0.00834062
0.00989871
0.0116317
0.0135499
0.0156634
0.0179813
0.0205116
0.0232604
0.0262323
0.0294291
0.0328499
0.036491
0.0403453
0.000351788
0.000449744
0.000703532
0.000995247
0.0014673
0.00205532
0.0027566
0.00357764
0.00452392
0.00560243
0.00682251
0.00819437
0.00972866
0.0114361
0.0133271
0.015412
0.0177001
0.0201996
0.0229175
0.0258586
0.0290255
0.0324189
0.0360374
0.0398836
0.000351933
0.000450655
0.000701571
0.000982357
0.00144153
0.00201774
0.00270584
0.00351196
0.00444225
0.00550319
0.00670397
0.00805477
0.00956622
0.0112491
0.013114
0.0151713
0.0174307
0.0199006
0.0225885
0.0254997
0.0286378
0.032004
0.0355969
0.039412
0.000352055
0.000451588
0.000700456
0.000973992
0.0014176
0.00198211
0.00265753
0.00344932
0.0043643
0.00540842
0.00659071
0.00792132
0.00941084
0.0110701
0.0129099
0.0149407
0.0171723
0.0196137
0.0222725
0.0251548
0.0282643
0.0316025
0.0351664
0.0389435
0.000352199
0.000452784
0.000700785
0.000970272
0.00139563
0.00194834
0.00261147
0.00338949
0.00428979
0.00531779
0.00648236
0.00779356
0.00926204
0.0108986
0.0127142
0.0147195
0.0169244
0.0193381
0.0219688
0.0248227
0.0279042
0.0312149
0.0347532
0.0385174
0.000352397
0.000454338
0.000702484
0.000969514
0.0013755
0.00191631
0.0025675
0.00333227
0.00421848
0.00523103
0.00637859
0.00767118
0.0091194
0.0107342
0.0125265
0.0145071
0.0166861
0.0190731
0.0216764
0.0245027
0.0275567
0.0308406
0.0343533
0.0380912
0.000352647
0.000456169
0.00070504
0.000969981
0.00135691
0.00188593
0.00252561
0.0032778
0.00415022
0.00514787
0.00627908
0.00755376
0.00898253
0.0105763
0.0123462
0.0143029
0.016457
0.018818
0.0213947
0.024194
0.0272211
0.0304787
0.0339661
0.0376796
0.000352929
0.000458108
0.000707887
0.000970608
0.00133958
0.00185711
0.0024857
0.00322582
0.00408481
0.00506811
0.00618359
0.00744104
0.00885107
0.0104246
0.0121728
0.0141065
0.0162363
0.0185722
0.021123
0.0238961
0.0268969
0.0301285
0.0335908
0.0372802
0.000353212
0.000459996
0.000710617
0.000970892
0.00132326
0.00182972
0.00244762
0.00317609
0.00402207
0.0049915
0.00609182
0.00733268
0.00872463
0.0102786
0.0120058
0.0139173
0.0160237
0.0183352
0.0208608
0.0236082
0.0265832
0.0297893
0.0332267
0.0368919
0.00035347
0.000461725
0.000712996
0.000970642
0.00130779
0.00180362
0.0024112
0.00312841
0.0039618
0.00491786
0.00600355
0.00722841
0.00860294
0.0101381
0.011845
0.0137349
0.0158187
0.0181064
0.0206074
0.0233298
0.0262795
0.0294602
0.0328724
0.0365123
0.000353691
0.000463244
0.00071493
0.000969828
0.0012931
0.00177869
0.0023763
0.00308262
0.00390385
0.00484699
0.00591861
0.00712803
0.00848571
0.0100027
0.01169
0.0135591
0.0156207
0.0178854
0.0203625
0.0230602
0.0259847
0.0291397
0.0325245
0.0361298
0.000353868
0.000464546
0.000716415
0.00096853
0.00127932
0.00175485
0.00234284
0.00303864
0.0038481
0.00477875
0.00583676
0.00703129
0.00837272
0.00987202
0.0115404
0.0133892
0.0154294
0.0176716
0.0201253
0.0227988
0.0256985
0.028828
0.0321871
0.0357735
0.000354004
0.000465652
0.000717524
0.000966978
0.00126702
0.00173213
0.00231071
0.0029963
0.00379437
0.00471299
0.00575784
0.00693798
0.00826369
0.00974593
0.011396
0.0132251
0.0152445
0.0174647
0.0198955
0.0225453
0.0254206
0.028525
0.0318586
0.0354156
0.000354109
0.000466614
0.000718436
0.000965645
0.00125727
0.00171064
0.00227985
0.00295555
0.00374265
0.00464953
0.00568168
0.00684788
0.00815838
0.00962409
0.0112563
0.0130664
0.0150655
0.0172644
0.0196728
0.0222994
0.0251509
0.0282318
0.0315444
0.0350951
0.000354194
0.000467514
0.000719407
0.000965078
0.00125084
0.00169055
0.00225029
0.00291638
0.00369297
0.00458833
0.00560813
0.00676084
0.00805661
0.00950635
0.0111213
0.0129129
0.0148922
0.0170703
0.0194569
0.0220609
0.0248892
0.027947
0.0312362
0.0347522
0.000354274
0.000468444
0.00072068
0.000965592
0.00124748
0.00167196
0.00222205
0.00287877
0.00364517
0.00452925
0.00553708
0.00667672
0.0079582
0.00939241
0.0109906
0.0127641
0.0147243
0.016882
0.0192474
0.0218294
0.0246355
0.0276715
0.0309421
0.0344551
0.000354368
0.000469467
0.000722374
0.000967128
0.00124617
0.0016548
0.00219508
0.00284262
0.00359912
0.0044722
0.00546837
0.00659536
0.007863
0.00928211
0.010864
0.01262
0.0145615
0.0166994
0.0190441
0.0216048
0.0243895
0.0274048
0.0306567
0.0341508
0.000354482
0.000470608
0.000724478
0.000969362
0.00124587
0.00163888
0.00216933
0.00280781
0.00355466
0.00441705
0.00540191
0.00651658
0.00777078
0.00917525
0.0107412
0.0124802
0.0144035
0.0165222
0.0188468
0.0213868
0.0241506
0.0271451
0.0303751
0.0338396
0.000354614
0.000471829
0.000726835
0.000971924
0.00124588
0.00162394
0.00214468
0.00277428
0.0035117
0.00436367
0.00533753
0.00644025
0.0076814
0.00907164
0.0106222
0.0123446
0.0142502
0.0163502
0.0186552
0.021175
0.0239179
0.0268906
0.0300954
0.0335228
0.000354763
0.000473088
0.000729302
0.00097452
0.0012458
0.00160979
0.00212103
0.00274195
0.00347017
0.00431199
0.00527516
0.00636627
0.00759473
0.00897116
0.0105068
0.012213
0.0141014
0.0161831
0.018469
0.0209689
0.0236913
0.0266428
0.0298278
0.0332537
0.000354924
0.00047431
0.000731724
0.000976948
0.00124543
0.00159629
0.0020983
0.00271074
0.00342997
0.0042619
0.0052147
0.00629452
0.00751066
0.00887365
0.0103947
0.0120852
0.0139568
0.0160207
0.0182879
0.0207682
0.0234701
0.0264001
0.0295607
0.0329429
0.000355077
0.000475479
0.000733999
0.000979084
0.00124469
0.00158339
0.00207641
0.0026806
0.00339108
0.00421337
0.00515605
0.00622491
0.00742905
0.00877896
0.0102858
0.011961
0.0138162
0.0158628
0.0181116
0.0205726
0.0232544
0.0261634
0.0293032
0.0326776
0.000355217
0.000476575
0.000736085
0.00098089
0.0012436
0.00157121
0.00205533
0.00265144
0.00335345
0.00416648
0.00509913
0.0061573
0.00734978
0.00868695
0.01018
0.0118403
0.0136795
0.0157091
0.0179399
0.020382
0.023044
0.0259327
0.0290519
0.0324023
0.00035534
0.000477565
0.000737929
0.000982389
0.00124233
0.0015601
0.00203508
0.00262328
0.00331702
0.00412111
0.00504391
0.00609162
0.00727274
0.00859752
0.0100771
0.0117228
0.0135465
0.0155594
0.0177726
0.0201962
0.0228391
0.0257084
0.02881
0.0321516
0.000355419
0.000478467
0.000739542
0.000983636
0.00124109
0.00155063
0.00201573
0.00259607
0.00328181
0.00407714
0.0049903
0.00602781
0.00719787
0.00851059
0.00997702
0.0116086
0.013417
0.0154136
0.0176096
0.0200152
0.0226394
0.0254903
0.0285745
0.0318981
0.000355522
0.000479261
0.000741023
0.000984839
0.00124028
0.00154341
0.00199745
0.00256986
0.00324772
0.00403453
0.00493821
0.0059658
0.00712503
0.00842599
0.00987958
0.0114974
0.0132908
0.0152715
0.0174508
0.0198387
0.0224448
0.0252775
0.0283432
0.0316451
0.000355627
0.000480005
0.000742458
0.000986172
0.00124021
0.00153863
0.00198035
0.00254459
0.0032147
0.00399313
0.0048876
0.00590545
0.00705414
0.00834361
0.00978473
0.011389
0.0131679
0.0151331
0.0172958
0.0196666
0.022255
0.0250695
0.0281159
0.0313952
0.000355705
0.000480757
0.000743949
0.000987798
0.00124098
0.00153588
0.00196445
0.00252028
0.00318268
0.00395293
0.00483839
0.0058467
0.00698511
0.00826337
0.00969229
0.0112833
0.013048
0.0149981
0.0171447
0.0194986
0.0220697
0.0248661
0.0278936
0.0311531
0.000355784
0.000481541
0.000745559
0.000989781
0.00124252
0.00153451
0.00194964
0.00249695
0.00315167
0.00391386
0.00479045
0.0057895
0.00691792
0.00818518
0.00960221
0.0111803
0.0129312
0.0148664
0.0169973
0.0193349
0.0218891
0.0246689
0.0276837
0.0309518
0.00035586
0.000482347
0.000747272
0.000992062
0.00124456
0.00153385
0.00193573
0.00247446
0.00312158
0.00387589
0.0047438
0.00573381
0.0068524
0.00810905
0.00951447
0.01108
0.0128173
0.0147379
0.0168536
0.0191752
0.021713
0.0244765
0.0274744
0.0307087
0.000355976
0.000483176
0.000749134
0.000994588
0.00124686
0.00153347
0.0019226
0.00245281
0.00309243
0.00383893
0.00469834
0.00567954
0.00678856
0.00803479
0.00942884
0.010982
0.012706
0.0146126
0.0167134
0.0190193
0.0215412
0.0242887
0.0272711
0.0304983
0.000356094
0.000484028
0.000751106
0.000997229
0.00124922
0.0015331
0.00191009
0.0024319
0.00306412
0.00380301
0.00465422
0.00562663
0.00672631
0.00796234
0.00934529
0.0108865
0.0125976
0.0144903
0.0165765
0.0188672
0.0213734
0.0241044
0.0270678
0.0302622
0.00035621
0.000484908
0.000753112
0.000999876
0.00125151
0.00153259
0.00189813
0.00241168
0.00303664
0.00376812
0.00461139
0.00557507
0.00666556
0.00789163
0.00926374
0.0107932
0.0124917
0.014371
0.0164428
0.0187186
0.021209
0.0239229
0.026866
0.0300358
0.000356329
0.000485793
0.000755102
0.00100245
0.00125364
0.00153187
0.00188668
0.00239217
0.00301001
0.00373422
0.00456968
0.00552482
0.00660635
0.00782265
0.00918419
0.0107022
0.0123883
0.0142544
0.0163122
0.0185732
0.0210477
0.0237446
0.0266694
0.0298242
0.00035647
0.000486627
0.000757014
0.00100489
0.00125551
0.0015309
0.00187582
0.00237328
0.00298413
0.00370128
0.00452907
0.00547584
0.00654852
0.00775535
0.00910656
0.0106133
0.0122873
0.0141404
0.0161845
0.0184308
0.0208897
0.02357
0.026478
0.0296189
0.000356597
0.000487416
0.000758799
0.00100714
0.00125715
0.00152977
0.00186575
0.00235505
0.00295903
0.00366921
0.00448951
0.00542809
0.00649212
0.00768962
0.00903069
0.0105265
0.0121886
0.0140291
0.0160596
0.0182914
0.0207349
0.0233991
0.0262911
0.0294166
0.000356696
0.000488164
0.000760478
0.00100922
0.00125861
0.00152869
0.00185689
0.00233752
0.00293465
0.003638
0.00445099
0.00538143
0.00643701
0.00762539
0.00895655
0.0104416
0.0120922
0.0139202
0.0159373
0.0181548
0.0205834
0.023232
0.0261082
0.0292179
0.000356801
0.000488876
0.000762056
0.00101115
0.00125999
0.0015279
0.00184961
0.00232082
0.00291098
0.00360761
0.00441336
0.00533587
0.00638316
0.00756261
0.00888408
0.0103586
0.0119978
0.0138136
0.0158176
0.0180213
0.0204351
0.0230685
0.0259297
0.0290262
0.000356903
0.000489556
0.000763558
0.001013
0.00126143
0.00152756
0.00184413
0.00230501
0.00288808
0.00357799
0.00437665
0.00529138
0.0063306
0.00750132
0.00881327
0.0102775
0.0119056
0.0137093
0.0157004
0.0178904
0.0202898
0.0229086
0.0257557
0.0288403
0.000357007
0.000490163
0.00076497
0.00101484
0.00126302
0.00152784
0.00184036
0.00229016
0.0028659
0.00354917
0.00434084
0.00524798
0.00627922
0.00744137
0.00874405
0.0101982
0.0118153
0.0136071
0.0155857
0.0177622
0.0201474
0.022751
0.0255793
0.0286266
0.000357108
0.000490758
0.000766362
0.00101672
0.00126486
0.00152876
0.00183795
0.00227624
0.00284448
0.00352108
0.00430587
0.0052055
0.00622896
0.00738274
0.0086763
0.0101205
0.0117269
0.0135072
0.0154733
0.0176366
0.020008
0.0225973
0.0254142
0.0284776
0.000357208
0.000491374
0.000767797
0.00101871
0.00126698
0.00153024
0.00183653
0.00226314
0.00282378
0.00349376
0.00427179
0.00516408
0.00617981
0.00732536
0.00861
0.0100445
0.0116403
0.0134093
0.0153632
0.0175136
0.0198714
0.0224465
0.0252473
0.028273
0.00035731
0.000491993
0.00076927
0.00102083
0.00126938
0.00153213
0.00183568
0.00225081
0.00280376
0.00346717
0.00423853
0.00512371
0.0061318
0.00726922
0.00854509
0.00997007
0.0115556
0.0133135
0.0152554
0.0173932
0.0197376
0.022299
0.0250864
0.0281123
0.000357389
0.000492631
0.000770772
0.00102305
0.00127196
0.00153423
0.00183508
0.00223908
0.00278442
0.00344128
0.00420611
0.00508435
0.00608484
0.00721435
0.00848165
0.00989724
0.0114727
0.0132196
0.0151498
0.0172751
0.0196064
0.0221539
0.0249258
0.0279241
0.000357514
0.000493294
0.000772323
0.00102537
0.00127463
0.0015364
0.00183455
0.00222788
0.00276568
0.00341612
0.00417451
0.00504593
0.00603893
0.00716063
0.00841946
0.00982597
0.0113914
0.0131276
0.0150464
0.0171593
0.0194775
0.0220109
0.024767
0.0277471
0.00035767
0.000493938
0.000773927
0.00102773
0.00127734
0.00153855
0.00183398
0.00221716
0.00274756
0.00339163
0.0041437
0.00500837
0.00599402
0.00710801
0.00835858
0.00975606
0.0113118
0.0130374
0.0149449
0.0170458
0.0193514
0.0218723
0.02462
0.0276188
0.000357802
0.000494595
0.000775561
0.0010301
0.00128002
0.00154061
0.00183329
0.00220687
0.00272996
0.00336778
0.00411364
0.00497165
0.00595006
0.00705649
0.00829892
0.00968758
0.0112337
0.012949
0.0148454
0.0169346
0.019228
0.0217367
0.0244717
0.0274387
0.000357935
0.000495262
0.000777193
0.00103246
0.00128265
0.00154254
0.00183247
0.00219711
0.0027129
0.00334453
0.00408425
0.00493575
0.00590706
0.00700601
0.00824046
0.00962046
0.0111572
0.0128624
0.0147479
0.0168258
0.0191075
0.0216049
0.0243316
0.0273094
0.000358041
0.000495895
0.000778739
0.00103472
0.00128514
0.00154428
0.00183155
0.00218794
0.00269637
0.0033219
0.00405556
0.00490065
0.00586493
0.00695665
0.00818328
0.00955478
0.0110823
0.0127775
0.0146525
0.0167192
0.0189895
0.0214754
0.0241883
0.0271301
0.000358186
0.000496541
0.000780244
0.00103691
0.00128749
0.00154588
0.00183063
0.00217962
0.00268041
0.00329982
0.00402752
0.00486632
0.0058237
0.00690826
0.00812718
0.00949035
0.0110088
0.0126944
0.014559
0.0166148
0.0188738
0.0213478
0.0240473
0.0269792
0.000358358
0.000497144
0.000781705
0.00103899
0.00128972
0.0015474
0.00182986
0.00217238
0.00266506
0.00327833
0.00400017
0.0048327
0.0057833
0.00686081
0.00807219
0.00942718
0.0109368
0.0126129
0.0144674
0.0165125
0.0187603
0.0212222
0.0239079
0.0268235
0.000358503
0.000497735
0.000783124
0.00104099
0.00129186
0.00154891
0.00182938
0.00216642
0.00265039
0.00325742
0.00397339
0.00479979
0.00574371
0.0068143
0.00801827
0.00936525
0.0108663
0.012533
0.0143775
0.0164121
0.0186486
0.0210978
0.0237671
0.0266528
0.000358641
0.000498308
0.000784493
0.00104293
0.00129398
0.00155052
0.00182934
0.00216187
0.00263649
0.00323708
0.00394723
0.00476758
0.005705
0.00676874
0.00796545
0.00930457
0.0107971
0.0124547
0.0142894
0.0163136
0.0185388
0.0209761
0.0236353
0.0265344
0.000358799
0.000498876
0.000785789
0.00104481
0.00129608
0.00155226
0.00182978
0.00215855
0.00262334
0.00321737
0.00392168
0.00473611
0.00566715
0.00672413
0.0079137
0.00924512
0.0107293
0.0123779
0.014203
0.0162169
0.0184311
0.0208573
0.0235069
0.0263939
0.000358958
0.000499376
0.000787043
0.00104667
0.00129823
0.00155421
0.00183072
0.00215627
0.00261096
0.00319825
0.00389675
0.00470537
0.00563018
0.00668041
0.00786293
0.00918677
0.0106627
0.0123026
0.0141183
0.0161219
0.0183255
0.0207406
0.0233779
0.0262423
0.000359085
0.000499883
0.000788295
0.00104853
0.00130045
0.00155639
0.0018321
0.00215475
0.00259925
0.00317974
0.00387249
0.00467528
0.00559398
0.00663755
0.00781313
0.00912953
0.0105975
0.0122286
0.014035
0.0160287
0.0182219
0.0206262
0.0232527
0.0261129
0.000359228
0.000500412
0.000789556
0.00105043
0.0013028
0.0015588
0.0018338
0.00215375
0.00258814
0.0031618
0.00384877
0.00464587
0.00555852
0.00659554
0.00776429
0.00907338
0.0105335
0.0121561
0.0139533
0.0159374
0.0181203
0.0205138
0.0231287
0.0259731
0.000359381
0.000500959
0.000790846
0.00105238
0.00130525
0.00156135
0.00183573
0.00215304
0.0025776
0.0031444
0.00382564
0.00461711
0.00552386
0.00655441
0.00771642
0.00901834
0.0104707
0.0120849
0.0138732
0.0158476
0.0180204
0.0204031
0.0230061
0.025837
0.000359544
0.000501484
0.000792116
0.00105437
0.00130775
0.00156401
0.00183777
0.00215248
0.00256751
0.00312755
0.00380309
0.00458903
0.00548987
0.00651405
0.0076695
0.00896438
0.010409
0.012015
0.0137945
0.0157595
0.0179222
0.0202941
0.0228856
0.0257044
0.000359717
0.000502007
0.000793412
0.00105639
0.00131032
0.00156673
0.00183983
0.00215195
0.00255785
0.00311117
0.00378108
0.00456153
0.00545659
0.0064745
0.00762344
0.00891136
0.0103485
0.0119465
0.0137173
0.015673
0.0178258
0.0201871
0.0227674
0.0255756
0.00035989
0.000502561
0.000794748
0.00105845
0.00131292
0.00156948
0.00184189
0.00215139
0.00254857
0.00309528
0.00375963
0.00453461
0.00542397
0.0064357
0.00757825
0.00885934
0.0102892
0.0118792
0.0136414
0.0155879
0.017731
0.0200817
0.0226503
0.0254425
0.000360067
0.000503117
0.000796089
0.00106052
0.00131555
0.00157221
0.00184386
0.00215078
0.00253968
0.00307982
0.00373865
0.00450827
0.00539203
0.00639763
0.00753389
0.00880828
0.0102309
0.0118131
0.0135669
0.0155045
0.0176378
0.0199786
0.0225379
0.0253317
0.000360224
0.000503645
0.000797417
0.00106257
0.00131812
0.00157486
0.00184573
0.0021501
0.00253126
0.00306478
0.00371814
0.00448249
0.0053607
0.00636036
0.00749045
0.00875821
0.0101738
0.0117483
0.0134938
0.0154225
0.0175463
0.0198771
0.0224262
0.0252022
0.000360417
0.000504211
0.000798726
0.0010646
0.00132064
0.00157741
0.0018475
0.0021494
0.00252338
0.00305022
0.00369814
0.00445729
0.00533001
0.00632377
0.00744776
0.0087091
0.0101176
0.0116846
0.013422
0.0153419
0.0174565
0.0197777
0.0223171
0.0250867
0.000360644
0.000504752
0.000800025
0.00106659
0.0013231
0.00157988
0.00184917
0.00214874
0.00251621
0.00303613
0.00367863
0.00443259
0.00529993
0.00628785
0.00740587
0.00866083
0.0100625
0.011622
0.0133514
0.0152627
0.0173684
0.0196798
0.0222077
0.0249566
0.000360849
0.000505294
0.000801318
0.00106853
0.00132548
0.00158228
0.00185081
0.00214821
0.00250987
0.00302255
0.00365959
0.0044084
0.00527044
0.00625271
0.00736477
0.00861345
0.0100083
0.0115606
0.0132821
0.015185
0.0172816
0.0195838
0.0221035
0.0248573
0.000361054
0.00050584
0.000802589
0.00107044
0.00132783
0.00158463
0.00185245
0.00214793
0.00250451
0.00300953
0.00364101
0.00438475
0.00524161
0.00621832
0.00732444
0.00856693
0.00995521
0.0115003
0.0132141
0.0151087
0.0171964
0.0194894
0.0219988
0.0247308
0.000361234
0.000506325
0.000803785
0.00107227
0.0013301
0.00158692
0.00185414
0.00214795
0.00250017
0.00299713
0.00362294
0.00436165
0.00521337
0.0061847
0.00728497
0.00852136
0.00990309
0.0114411
0.0131473
0.0150338
0.0171129
0.0193971
0.0218987
0.0246351
0.00036145
0.000506843
0.000804954
0.00107407
0.00133231
0.00158919
0.00185593
0.00214835
0.00249683
0.00298533
0.00360537
0.00433908
0.00518575
0.00615174
0.00724621
0.00847659
0.00985186
0.011383
0.0130817
0.0149603
0.0170311
0.0193069
0.0218013
0.0245313
0.0003617
0.000507336
0.000806108
0.00107582
0.0013345
0.00159151
0.00185791
0.00214915
0.00249436
0.00297417
0.00358837
0.00431702
0.00515872
0.00611941
0.00720816
0.00843262
0.00980159
0.0113259
0.0130173
0.0148882
0.016951
0.0192181
0.0217018
0.0244054
0.000361927
0.000507835
0.000807263
0.00107757
0.00133669
0.00159391
0.00186004
0.00215031
0.00249261
0.00296361
0.00357184
0.00429547
0.00513224
0.00608773
0.00717084
0.00838947
0.00975224
0.0112699
0.0129541
0.0148172
0.016872
0.0191307
0.0216049
0.0243065
0.000362154
0.000508334
0.000808411
0.0010793
0.00133893
0.00159637
0.00186236
0.00215181
0.00249141
0.00295359
0.00355581
0.00427443
0.00510635
0.00605668
0.00713425
0.00834714
0.00970384
0.0112149
0.0128921
0.0147477
0.0167943
0.0190442
0.0215079
0.0241901
0.000362406
0.000508846
0.000809528
0.00108104
0.00134117
0.0015989
0.00186483
0.00215355
0.0024906
0.00294409
0.00354027
0.00425392
0.00508099
0.0060263
0.00709841
0.00830568
0.0096563
0.0111609
0.0128313
0.0146795
0.0167181
0.0189593
0.0214145
0.0240978
0.000362666
0.000509304
0.000810635
0.00108278
0.00134344
0.00160151
0.00186743
0.00215547
0.00249006
0.00293503
0.0035252
0.00423392
0.00505618
0.0059965
0.00706321
0.00826491
0.00960964
0.0111079
0.0127714
0.0146123
0.0166431
0.0188756
0.02132
0.0239794
0.000362898
0.000509778
0.000811758
0.00108454
0.00134575
0.0016042
0.00187016
0.00215749
0.00248966
0.00292638
0.00351062
0.00421437
0.00503191
0.00596729
0.00702868
0.00822492
0.00956387
0.0110559
0.0127127
0.0145463
0.0165693
0.018793
0.0212282
0.0238863
0.000363154
0.000510292
0.000812904
0.00108632
0.00134812
0.00160697
0.00187293
0.00215958
0.00248934
0.00291809
0.00349643
0.00419527
0.00500813
0.00593864
0.0069948
0.00818567
0.00951895
0.0110049
0.012655
0.0144817
0.0164967
0.0187115
0.0211357
0.0237722
0.000363394
0.000510772
0.000814049
0.0010881
0.00135051
0.00160974
0.00187573
0.00216167
0.00248905
0.00291013
0.00348263
0.00417664
0.00498491
0.00591063
0.00696161
0.00814721
0.00947492
0.0109548
0.0125984
0.0144178
0.016425
0.0186312
0.0210461
0.0236801
0.000363689
0.000511336
0.000815203
0.00108992
0.0013529
0.00161253
0.00187853
0.00216374
0.00248876
0.00290254
0.00346925
0.0041585
0.00496216
0.00588315
0.0069291
0.00810953
0.00943166
0.0109057
0.0125429
0.0143551
0.0163543
0.0185517
0.0209563
0.0235716
0.000364019
0.000511836
0.000816364
0.00109174
0.0013553
0.0016153
0.0018813
0.00216577
0.00248846
0.00289529
0.00345624
0.00414076
0.00493992
0.00585625
0.00689719
0.00807249
0.00938919
0.0108573
0.0124882
0.0142934
0.0162849
0.0184738
0.0208703
0.0234881
0.000364303
0.000512337
0.000817529
0.00109355
0.00135769
0.00161807
0.00188404
0.00216772
0.00248816
0.00288846
0.00344365
0.00412344
0.00491815
0.00582991
0.00686599
0.00803619
0.00934757
0.0108099
0.0124343
0.0142327
0.0162167
0.0183973
0.0207852
0.0233891
0.000364608
0.000512873
0.000818704
0.00109537
0.00136009
0.00162083
0.00188673
0.00216963
0.00248786
0.00288208
0.00343143
0.00410655
0.00489689
0.00580413
0.00683547
0.0080006
0.00930664
0.0107633
0.0123815
0.0141732
0.0161498
0.0183227
0.0207041
0.0233114
0.000364898
0.000513379
0.000819859
0.00109715
0.00136243
0.00162351
0.00188935
0.00217149
0.00248765
0.00287625
0.00341961
0.00409009
0.00487611
0.00577899
0.00680569
0.00796576
0.00926662
0.0107176
0.0123298
0.0141146
0.0160842
0.0182502
0.0206259
0.0232284
0.000365232
0.000513927
0.000820996
0.00109893
0.00136474
0.00162614
0.00189191
0.00217333
0.00248754
0.00287103
0.00340825
0.00407409
0.00485583
0.0057544
0.00677649
0.00793168
0.00922735
0.0106729
0.012279
0.0140573
0.0160199
0.0181795
0.0205501
0.0231492
0.000365605
0.000514453
0.000822132
0.00110067
0.00136701
0.00162871
0.00189443
0.00217518
0.00248761
0.00286652
0.00339737
0.00405852
0.00483605
0.00573034
0.00674794
0.00789822
0.00918888
0.010629
0.0122293
0.0140013
0.0159574
0.0181107
0.0204751
0.0230645
0.000365963
0.000514989
0.000823275
0.00110239
0.00136924
0.00163127
0.00189694
0.00217706
0.00248791
0.00286276
0.003387
0.00404339
0.00481673
0.00570684
0.00672
0.00786549
0.0091512
0.0105859
0.0121804
0.0139465
0.0158964
0.0180434
0.0204006
0.0229783
0.000366328
0.000515536
0.000824413
0.0011041
0.00137147
0.00163381
0.00189944
0.00217904
0.00248848
0.00285973
0.00337712
0.00402873
0.00479793
0.00568387
0.00669267
0.00783348
0.00911435
0.0105437
0.0121325
0.0138928
0.0158366
0.017977
0.0203264
0.0228935
0.000366676
0.000516036
0.000825508
0.00110578
0.00137364
0.0016363
0.00190195
0.00218111
0.00248934
0.00285742
0.00336777
0.00401455
0.0047796
0.00566151
0.00666602
0.00780205
0.00907799
0.0105023
0.0120858
0.0138403
0.0157782
0.0179122
0.0202554
0.022823
0.00036707
0.000516575
0.000826579
0.00110742
0.00137578
0.00163877
0.00190449
0.0021833
0.00249049
0.00285571
0.00335894
0.00400084
0.00476178
0.00563966
0.00663992
0.00777138
0.00904258
0.010462
0.0120402
0.0137889
0.0157209
0.0178491
0.0201871
0.0227522
0.000367506
0.000517104
0.000827648
0.00110904
0.00137791
0.00164126
0.00190711
0.00218565
0.00249194
0.00285456
0.00335065
0.0039876
0.00474444
0.00561835
0.00661446
0.00774145
0.00900807
0.0104227
0.0119957
0.0137388
0.0156651
0.0177875
0.0201199
0.0226754
0.00036793
0.00051765
0.000828743
0.00111067
0.00138004
0.00164379
0.00190977
0.00218813
0.00249363
0.00285386
0.0033428
0.00397481
0.00472758
0.00559757
0.00658963
0.00771224
0.00897436
0.0103841
0.0119521
0.0136901
0.0156107
0.0177273
0.0200528
0.0225969
0.000368365
0.000518184
0.00082981
0.00111229
0.00138218
0.00164632
0.00191251
0.00219074
0.00249552
0.00285349
0.0033354
0.0039625
0.00471123
0.00557736
0.00656545
0.00768379
0.00894149
0.0103465
0.0119094
0.0136423
0.0155576
0.0176685
0.0199874
0.0225264
0.000368794
0.0005187
0.000830874
0.0011139
0.00138433
0.00164889
0.00191531
0.00219349
0.00249761
0.00285341
0.00332842
0.00395063
0.00469539
0.00555775
0.00654179
0.0076558
0.00890935
0.0103099
0.011868
0.0135959
0.0155059
0.0176108
0.0199234
0.0224552
0.000369268
0.000519282
0.000831946
0.00111554
0.00138649
0.00165148
0.00191818
0.00219633
0.00249983
0.00285354
0.00332183
0.00393926
0.00468005
0.0055387
0.00651888
0.00762869
0.00887794
0.0102742
0.0118278
0.0135507
0.0154554
0.0175545
0.0198604
0.0223826
0.000369789
0.000519854
0.000833054
0.00111718
0.00138867
0.00165413
0.00192113
0.00219924
0.00250214
0.00285383
0.00331564
0.00392829
0.00466519
0.00552007
0.00649649
0.00760239
0.00884755
0.0102396
0.0117886
0.0135065
0.0154059
0.0174993
0.0197982
0.0223111
0.000370307
0.000520438
0.000834168
0.00111884
0.00139088
0.00165684
0.00192412
0.00220223
0.00250452
0.00285423
0.00330978
0.00391775
0.00465084
0.00550212
0.00647485
0.00757686
0.00881804
0.0102059
0.0117506
0.0134637
0.0153578
0.0174453
0.0197373
0.0222421
0.000370843
0.000521047
0.000835302
0.00112051
0.00139312
0.00165954
0.00192714
0.00220525
0.00250696
0.00285472
0.00330426
0.00390767
0.00463707
0.00548481
0.00645395
0.00755219
0.00878946
0.0101731
0.0117135
0.013422
0.0153109
0.0173925
0.0196774
0.0221738
0.00037141
0.000521642
0.000836407
0.0011222
0.00139536
0.00166226
0.00193018
0.0022083
0.0025094
0.00285529
0.00329908
0.00389798
0.00462361
0.00546801
0.00643366
0.0075283
0.0087618
0.0101414
0.0116774
0.0133814
0.0152653
0.0173409
0.0196195
0.0221119
0.000372007
0.000522244
0.000837528
0.00112388
0.0013976
0.00166499
0.00193324
0.00221136
0.00251188
0.0028559
0.00329423
0.0038888
0.00461081
0.00545189
0.00641417
0.00750511
0.00873477
0.0101107
0.0116427
0.0133421
0.015221
0.017291
0.0195634
0.0220482
0.000372626
0.000522872
0.000838683
0.00112558
0.00139986
0.00166775
0.00193632
0.00221442
0.00251436
0.0028566
0.00328979
0.00388006
0.00459861
0.00543646
0.00639548
0.00748295
0.00870892
0.0100811
0.011609
0.013304
0.015178
0.0172426
0.0195085
0.021985
0.000373277
0.000523537
0.000839859
0.0011273
0.00140214
0.00167054
0.0019394
0.00221749
0.00251683
0.00285736
0.00328565
0.00387174
0.00458698
0.00542155
0.00637742
0.00746169
0.00868411
0.0100527
0.0115767
0.0132673
0.0151363
0.0171956
0.0194562
0.02193
0.000373933
0.000524181
0.000841036
0.00112901
0.00140444
0.0016733
0.00194247
0.00222055
0.00251933
0.00285821
0.00328195
0.00386399
0.00457597
0.00540749
0.00636029
0.00744137
0.00866036
0.0100252
0.0115454
0.0132319
0.0150963
0.0171505
0.019406
0.0218748
0.000374658
0.000524883
0.000842209
0.00113075
0.00140671
0.00167605
0.00194553
0.0022236
0.00252183
0.00285915
0.00327868
0.00385663
0.0045653
0.00539401
0.00634399
0.00742205
0.00863763
0.00999902
0.0115154
0.0131978
0.0150578
0.0171073
0.0193578
0.0218211
0.000375454
0.000525581
0.000843406
0.00113248
0.00140899
0.00167879
0.00194858
0.00222665
0.00252437
0.00286023
0.00327589
0.00384988
0.00455542
0.00538133
0.00632844
0.00740354
0.00861606
0.00997411
0.0114868
0.0131653
0.0150211
0.0170659
0.0193119
0.0217715
0.000376265
0.000526307
0.000844635
0.00113423
0.00141126
0.00168155
0.00195165
0.00222971
0.00252694
0.00286147
0.00327363
0.00384371
0.00454626
0.00536951
0.00631389
0.00738597
0.00859532
0.00995031
0.0114597
0.0131345
0.0149862
0.0170264
0.0192673
0.0217186
0.000377123
0.000527068
0.000845888
0.00113599
0.00141357
0.00168433
0.00195471
0.0022328
0.00252959
0.00286284
0.00327179
0.00383817
0.00453783
0.00535836
0.00630017
0.00736962
0.00857598
0.00992795
0.0114341
0.0131052
0.0149527
0.0169887
0.0192247
0.0216701
0.000378003
0.000527799
0.000847108
0.00113774
0.00141586
0.00168708
0.00195777
0.0022359
0.00253233
0.00286446
0.0032704
0.00383315
0.00453014
0.00534823
0.0062876
0.00735451
0.00855805
0.0099071
0.0114101
0.0130777
0.0149214
0.0169533
0.0191851
0.0216292
0.000378977
0.000528603
0.000848349
0.00113951
0.00141815
0.00168984
0.00196086
0.00223907
0.00253519
0.00286633
0.0032697
0.00382891
0.00452332
0.00533906
0.00627612
0.00734061
0.00854147
0.00988768
0.0113878
0.0130521
0.0148922
0.0169201
0.0191475
0.0215856
0.00038005
0.000529416
0.000849623
0.00114128
0.00142046
0.00169262
0.00196396
0.00224227
0.00253811
0.00286839
0.00326959
0.00382526
0.00451708
0.00533078
0.00626584
0.00732809
0.00852647
0.00987002
0.0113671
0.0130284
0.0148652
0.0168893
0.0191127
0.0215479
0.000381172
0.000530274
0.000850943
0.00114309
0.00142278
0.00169543
0.0019671
0.00224552
0.00254116
0.00287078
0.00327006
0.0038225
0.00451195
0.00532367
0.00625668
0.00731669
0.00851276
0.00985404
0.0113486
0.013007
0.0148407
0.0168612
0.0190813
0.0215148
0.000382378
0.000531179
0.000852302
0.00114493
0.00142518
0.0016983
0.00197036
0.00224896
0.00254446
0.0028735
0.00327115
0.00382065
0.00450796
0.00531786
0.00624905
0.0073071
0.00850107
0.00984014
0.0113323
0.012988
0.0148186
0.0168359
0.019052
0.0214769
0.000383689
0.000532111
0.000853662
0.0011468
0.00142757
0.00170123
0.00197372
0.00225253
0.00254797
0.00287648
0.00327266
0.00381963
0.0045051
0.0053133
0.0062429
0.00729938
0.00849139
0.00982848
0.0113185
0.0129715
0.0147991
0.0168134
0.019026
0.0214489
0.000385126
0.000533078
0.000855073
0.00114875
0.00143008
0.00170425
0.00197719
0.00225628
0.00255175
0.00287987
0.00327495
0.00381972
0.00450361
0.00531037
0.00623858
0.0072936
0.00848392
0.00981915
0.0113071
0.0129579
0.0147829
0.0167941
0.0190032
0.0214216
0.000386703
0.000534107
0.000856525
0.00115066
0.0014326
0.00170743
0.00198086
0.00226022
0.00255572
0.00288362
0.00327799
0.00382086
0.00450332
0.00530907
0.0062363
0.00729009
0.00847897
0.00981256
0.0112986
0.0129473
0.01477
0.0167784
0.0189844
0.0214009
0.00038845
0.000535248
0.000858087
0.00115273
0.00143534
0.0017107
0.00198457
0.00226441
0.0025601
0.00288788
0.00328183
0.00382347
0.00450494
0.00530985
0.00623617
0.00728902
0.00847686
0.00980911
0.0112935
0.0129404
0.0147607
0.0167662
0.0189689
0.0213789
0.000390392
0.000536503
0.000859771
0.00115494
0.00143813
0.00171413
0.00198863
0.00226886
0.00256483
0.00289272
0.00328658
0.0038277
0.00450863
0.00531312
0.00623887
0.00729088
0.00847773
0.00980897
0.0112921
0.0129373
0.0147554
0.016758
0.0189563
0.0213569
0.000392557
0.000537691
0.000861545
0.00115741
0.00144124
0.00171794
0.0019931
0.00227382
0.00257013
0.00289825
0.00329251
0.0038339
0.00451478
0.00531907
0.00624463
0.00729634
0.0084825
0.00981296
0.011295
0.0129383
0.0147544
0.0167544
0.0189502
0.0213584
0.000394996
0.000538931
0.000863422
0.00115999
0.00144461
0.00172212
0.00199801
0.00227933
0.00257607
0.0029045
0.00329959
0.00384225
0.00452383
0.00532846
0.0062542
0.00730591
0.00849172
0.00982155
0.0113025
0.0129443
0.0147582
0.0167558
0.0189494
0.0213522
0.000398213
0.000541136
0.000866135
0.00116344
0.00144894
0.00172735
0.00200406
0.00228605
0.00258335
0.00291238
0.00330923
0.00385443
0.00453735
0.00534275
0.00626894
0.0073208
0.00850638
0.00983549
0.0113154
0.0129558
0.0147676
0.0167627
0.0189528
0.0213484
0.000401786
0.000541811
0.000867217
0.00116536
0.00145207
0.00173159
0.00200923
0.00229197
0.00258979
0.00291955
0.00331855
0.00386676
0.0045516
0.00535861
0.00628614
0.00733889
0.00852493
0.00985398
0.0113332
0.0129725
0.0147825
0.0167746
0.0189592
0.0213395
0.000410619
0.000553346
0.00088011
0.0011794
0.00146752
0.00174843
0.00202739
0.0023115
0.00261078
0.00294301
0.00334991
0.00390646
0.004595
0.00540368
0.00633136
0.00738308
0.00856723
0.00989348
0.0113691
0.0130039
0.014809
0.0167956
0.0189757
0.0213669
0.000368711
0.000504142
0.000838827
0.00114076
0.00143017
0.00171191
0.0019907
0.00227266
0.00256708
0.00289188
0.0032879
0.00383409
0.00451758
0.00532375
0.00625108
0.0073046
0.00849277
0.00982524
0.0113095
0.0129548
0.0147722
0.0167725
0.0189659
0.0213538
0.0245109
0.0824461
0.0818554
0.138048
0.124526
0.138401
0.0858943
0.10796
0.0842086
0.128979
0.119313
0.0649485
0.0798936
0.0418011
0.139418
0.0648097
0.0745308
0.138979
0.050143
0.130079
0.0828721
0.0431416
0.0827125
0.0742455
0.0642486
0.0894702
0.0730242
0.0869355
0.135993
0.103028
0.0466678
0.062306
0.0635507
0.0187725
0.097017
0.0511842
0.0672205
0.0960292
0.128692
0.139104
0.0919148
0.0360674
0.114186
0.0699701
0.0490995
0.0714792
0.138149
0.113609
0.0276028
0.0895418
0.0846079
0.0656117
0.136408
0.0504578
0.130313
0.124238
0.0489021
0.113937
0.071429
0.0370551
0.140102
0.0519915
0.131266
0.0312861
0.0425386
0.138793
0.0903319
0.0309171
0.106761
0.103295
0.131285
0.136314
0.135217
0.0473855
0.0322921
0.0959751
0.0803625
0.0575457
0.0743795
0.0236221
0.138678
0.0828319
0.0825663
0.0507716
0.0366939
0.136957
0.10281
0.0629868
0.0414293
0.128021
0.0768074
0.0861714
0.133404
0.0773254
0.0988883
0.120529
0.0922734
0.138126
0.0252987
0.140136
0.0803816
0.295851
0.0469796
0.0267259
0.0818177
0.115398
0.0871267
0.115383
0.0754965
0.106967
0.041576
0.0903424
0.140022
0.046165
0.0870773
0.0636127
0.0586
0.0877526
0.087694
0.121046
0.138333
0.0326405
0.149722
0.0920194
0.0621884
0.13184
0.14015
0.119428
0.140117
0.0848686
0.0798012
0.138734
0.137677
0.0451745
0.0635603
0.0237937
0.062955
0.0541496
0.0589809
0.0300501
0.0583814
0.0644575
0.0742325
0.0840107
0.0795714
0.0605708
0.0779135
0.0364713
0.0704986
0.0770877
0.0604755
0.0825575
0.135745
0.113654
0.0452691
0.114421
0.133393
0.140114
0.0477378
0.073503
0.111687
0.0630795
0.13873
0.121865
0.137988
0.123017
0.0647336
0.0311415
0.0481986
0.0811764
0.124565
0.0803629
0.137156
0.1377
0.140063
0.0804822
0.139863
0.0664864
0.136615
0.134407
0.0536451
0.0415677
0.0644585
0.169091
0.0549984
0.0475302
0.100254
0.115239
0.137607
0.0815596
0.0349444
0.0284591
0.0883081
0.0681267
0.0426455
0.13771
0.0901107
0.0395324
0.0397306
0.107762
0.135811
0.0818925
0.0778878
0.0370806
0.0622129
0.133408
0.0745781
0.0763372
0.0409578
0.0925371
0.0447762
0.140018
0.0727484
0.0730541
0.0788131
0.085861
0.0372877
0.119713
0.120377
0.0163406
0.140135
0.0436416
0.135949
0.313229
0.0939879
0.193105
0.0842857
0.139539
0.0417941
0.0811471
0.138498
0.109172
0.31331
0.0957042
0.0622382
0.109759
0.0891643
0.140138
0.134726
0.0268616
0.0772403
0.0526371
0.0788127
0.071837
0.047558
0.119422
0.0760992
0.0911666
0.0582655
0.130257
0.0634599
0.066516
0.0946017
0.189844
0.0926035
0.125854
0.136991
0.0996892
0.3269
0.081045
0.152189
0.131178
0.131051
0.0600633
0.141231
0.0838261
0.0757367
0.139599
0.0733918
0.139352
0.076261
0.0864555
0.0238336
0.071743
0.101505
0.123495
0.0961007
0.0279052
0.139032
0.0584643
0.140064
0.101467
0.0693231
0.0781674
0.0876479
0.075699
0.135063
0.0771315
0.0344843
0.0563147
0.130025
0.119409
0.0777611
0.0576004
0.387809
0.0255634
0.108225
0.0820142
0.0636118
0.139456
0.224133
0.0395949
0.0238991
0.136275
0.0410669
0.07517
0.0246231
0.0578319
0.057307
0.0855928
0.0464282
0.134505
0.0814138
0.0653313
0.0631586
0.139168
0.0542967
0.104717
0.117077
0.13835
0.12544
0.0979801
0.0790453
0.0692151
0.0824393
0.162198
0.139562
0.0767988
0.0815219
0.139958
0.0793817
0.12327
0.190268
0.115738
0.0350911
0.124291
0.099982
0.00871199
0.0882872
0.11539
0.131858
0.0616649
0.0109439
0.14019
0.130301
0.114302
0.0681529
0.13805
0.0243433
0.0797608
0.0493917
0.00858816
0.0895949
0.0651993
0.094905
0.0531215
0.0854337
0.0802724
0.134447
0.0912918
0.130853
0.109777
0.113218
0.0254725
0.134325
0.0551317
0.140105
0.140052
0.0748872
0.140143
0.106874
0.13986
0.0965161
0.130157
0.114693
0.138129
0.0826959
0.129906
0.080591
0.0881356
0.137751
0.136827
0.0927831
0.0343058
0.0385496
0.0346129
0.0783937
0.138737
0.129237
0.140118
0.0662812
0.138486
0.0386394
0.13805
0.0778065
0.081737
0.0887274
0.139294
0.103778
0.0871988
0.0501367
0.0717554
0.0703999
0.0290932
0.0955861
0.0538659
0.119132
0.0560994
0.137064
0.0887106
0.0682845
0.091388
0.139989
0.0357454
0.076218
0.112607
0.0826325
0.067368
0.108823
0.13084
0.081766
0.139996
0.139125
0.126129
0.0735948
0.0634722
0.0794292
0.066718
0.135202
0.0393285
0.0893756
0.109114
0.0305121
0.139884
0.0986407
0.139397
0.0826756
0.108609
0.114348
0.0782045
0.136537
0.0654612
0.034437
0.138085
0.0338469
0.0812834
0.0775645
0.130172
0.0489636
0.0975632
0.0325562
0.0161748
0.139341
0.121733
0.139481
0.0865123
0.087589
0.0703677
0.077479
0.0323187
0.0613733
0.0954595
0.140105
0.0327764
0.068951
0.139574
0.0730042
0.0410771
0.0870908
0.354847
0.138085
0.1402
0.157963
0.0336722
0.0465784
0.137455
0.0270858
0.0508537
0.0784622
0.135579
0.0530276
0.0706356
0.119512
0.126178
0.0596164
0.0394822
0.170004
0.0859355
0.112613
0.140929
0.367239
0.130374
0.0822957
0.137679
0.101647
0.0535189
0.122841
0.0653209
0.0683469
0.0645682
0.13467
0.0777233
0.085768
0.128212
0.100415
0.0571472
0.0732739
0.14014
0.085383
0.083476
0.140032
0.0794219
0.250077
0.104512
0.140083
0.0976492
0.090948
0.184815
0.0698039
0.0733351
0.102599
0.138141
0.372651
0.251372
0.073732
0.069872
0.0904211
0.0446773
0.194303
0.13148
0.137156
0.0837996
0.0859356
0.0536304
0.0454618
0.0891557
0.0778268
0.120012
0.0813883
0.0807552
0.071011
0.0905707
0.0705827
0.0714414
0.060186
0.135591
0.0766777
0.0650169
0.0670865
0.062806
0.0362862
0.0467551
0.0691281
0.294964
0.137645
0.084755
0.0647425
0.132417
0.140722
0.0808079
0.0959869
0.066841
0.127496
0.033629
0.0412824
0.0479502
0.204161
0.0821193
0.0520767
0.0532833
0.0405882
0.0480172
0.0614175
0.0678127
0.0639565
0.129831
0.136863
0.0638431
0.0560819
0.1243
0.118283
0.0809618
0.138977
0.0674513
0.119
0.0861845
0.0375415
0.0492232
0.0767003
0.136208
0.139763
0.034621
0.270517
0.0760004
0.0849876
0.0886491
0.137106
0.162651
0.0582356
0.140063
0.0807929
0.0833863
0.137245
0.137732
0.134129
0.133047
0.0335779
0.140191
0.132582
0.138399
0.0675174
0.140189
0.110704
0.0860058
0.0505284
0.0879344
0.0821486
0.135031
0.147068
0.137066
0.0804489
0.066671
0.1388
0.0429873
0.0904062
0.134934
0.0467184
0.0755953
0.135629
0.0536302
0.0638395
0.0767444
0.137186
0.0559925
0.136751
0.137814
0.0724029
0.0518673
0.115007
0.0996614
0.036216
0.113329
0.0514923
0.135699
0.137044
0.138374
0.129095
0.0614593
0.0925441
0.0797775
0.140032
0.164116
0.077769
0.0840394
0.138869
0.0637646
0.0280693
0.0725305
0.131888
0.0482756
0.140118
0.0897917
0.136428
0.0677583
0.105166
0.067393
0.062981
0.0563128
0.0500511
0.0289002
0.0566136
0.0588027
0.0762017
0.0867793
0.138923
0.0581867
0.0761362
0.0678954
0.0403265
0.121679
0.138262
0.0696131
0.128345
0.136727
0.0686795
0.0607358
0.0560435
0.105347
0.0608381
0.0780578
0.112917
0.0676424
0.127679
0.138126
0.0923948
0.098819
0.0650068
0.101804
0.0895782
0.0687143
0.138317
0.130208
0.128384
0.140199
0.135607
0.138414
0.0634007
0.0702365
0.139059
0.090775
0.098016
0.0942332
0.140178
0.111202
0.133221
0.141984
0.137572
0.0689417
0.0627945
0.0721712
0.0360859
0.053542
0.0473635
0.0625733
0.133539
0.113917
0.137046
0.0595524
0.136475
0.104153
0.0775178
0.0728643
0.0495602
0.140109
0.121874
0.0879945
0.138911
0.132561
0.123001
0.0513327
0.0728008
0.0902029
0.0793755
0.094415
0.0742152
0.0603859
0.0720108
0.080778
0.13916
0.131905
0.0741564
0.0749164
0.0874344
0.127
0.0628769
0.0628089
0.13899
0.0929528
0.0697864
0.0643951
0.0899125
0.125583
0.0242145
0.0526497
0.122865
0.0334182
0.0455455
0.0850304
0.0917507
0.126204
0.0852862
0.133723
0.0693533
0.132937
0.138338
0.133591
0.0357841
0.0863303
0.133062
0.0626078
0.11142
0.0705692
0.101144
0.0917577
0.0871727
0.0268309
0.137482
0.140181
0.134751
0.0305841
0.033919
0.155542
0.0315776
0.13925
0.0415859
0.0862283
0.138342
0.17428
0.101021
0.0634929
0.134195
0.140193
0.124912
0.0913095
0.0634051
0.138621
0.056273
0.11223
0.0637228
0.0829395
0.114089
0.123154
0.0374974
0.096202
0.131107
0.137453
0.108609
0.121986
0.0730874
0.0941949
0.0784798
0.102604
0.117636
0.0336007
0.0532045
0.0705024
0.0749009
0.0624153
0.123053
0.0502662
0.0709898
0.0232124
0.07993
0.129001
0.0714974
0.0979369
0.144729
0.215765
0.0383441
0.0887499
0.156708
0.137935
0.0526513
0.0317562
0.137882
0.0722281
0.142777
0.0400963
0.0764929
0.139554
0.05315
0.0350572
0.139442
0.0617471
0.0877585
0.113698
0.139866
0.125952
0.0592567
0.118319
0.1378
0.0601378
0.0781103
0.0883021
0.0686568
0.0124177
0.136813
0.0353048
0.0801564
0.131217
0.0543631
0.104803
0.0529923
0.0734857
0.0478241
0.136503
0.0712426
0.136926
0.0830418
0.0344734
0.0278478
0.0728907
0.0428039
0.137516
0.0871124
0.126179
0.0799111
0.0534502
0.111419
0.129205
0.137741
0.0379057
0.078274
0.133368
0.122683
0.0538365
0.138312
0.0878977
0.0925177
0.140206
0.0741184
0.069782
0.0438859
0.0358287
0.0832724
0.135221
0.0707509
0.0719463
0.133062
0.138784
0.0717909
0.0727543
0.136618
0.0851696
0.0874493
0.0705264
0.0290158
0.292488
0.0796909
0.0777136
0.0904739
0.13462
0.06275
0.0883043
0.123703
0.173031
0.139436
0.141535
0.128347
0.117385
0.0666943
0.0779284
0.0922027
0.0709153
0.071552
0.0991537
0.0331145
0.0279673
0.0324136
0.120958
0.120762
0.135849
0.240998
0.0505264
0.134267
0.0539948
0.138131
0.0796254
0.0899663
0.138647
0.137201
0.138376
0.14012
0.106218
0.0107541
0.0975364
0.139928
0.137434
0.139268
0.0598711
0.139781
0.12487
0.0946009
0.150547
0.0841661
0.0709916
0.0613327
0.28371
0.0239992
0.0566229
0.113906
0.0936237
0.134217
0.13787
0.135464
0.0315798
0.0680687
0.0476011
0.134006
0.0204581
0.140197
0.146735
0.0721794
0.0673141
0.100133
0.0784401
0.0845912
0.0715512
0.090613
0.335962
0.0958216
0.0743712
0.0791354
0.140019
0.0414671
0.0818178
0.115553
0.140017
0.0207034
0.128617
0.0544054
0.0749341
0.112081
0.0334075
0.0738644
0.137646
0.0917468
0.0827198
0.0849048
0.127657
0.064836
0.134341
0.0900024
0.118641
0.08551
0.139939
0.0733584
0.0758165
0.0575609
0.0813235
0.0799722
0.0545525
0.0579522
0.0544665
0.0674876
0.0820886
0.139548
0.0748425
0.0285375
0.082177
0.130457
0.0860391
0.0630062
0.139586
0.0716301
0.10731
0.139892
0.0445799
0.139454
0.139554
0.104504
0.0560794
0.0533554
0.0850384
0.138923
0.0660935
0.138706
0.0906602
0.0641564
0.0697121
0.0802357
0.0683726
0.0684671
0.110194
0.0438379
0.132448
0.0775698
0.0927176
0.0676051
0.0252282
0.0906923
0.14019
0.0406284
0.274572
0.0505921
0.0596721
0.0867055
0.0525727
0.0859251
0.0918868
0.0844074
0.0438196
0.0912645
0.0295591
0.131629
0.0670747
0.0531834
0.0832087
0.0404082
0.102465
0.0739189
0.104094
0.0912445
0.0803887
0.134479
0.0547335
0.139366
0.0320621
0.0717736
0.136348
0.0901946
0.0661168
0.0512134
0.100849
0.138316
0.0818028
0.079731
0.043019
0.116916
0.06701
0.022949
0.122892
0.10236
0.0816717
0.0155085
0.0932184
0.0753105
0.139407
0.104847
0.138522
0.0992067
0.122007
0.0534092
0.104441
0.0556207
0.0453893
0.095115
0.139629
0.0621883
0.133118
0.123651
0.138825
0.0748349
0.0340688
0.15069
0.131652
0.0602868
0.139952
0.0143143
0.0639943
0.0823653
0.0750986
0.0894459
0.0607976
0.0695659
0.0940718
0.0287269
0.105003
0.0348142
0.082751
0.140202
0.0745433
0.0825463
0.0694329
0.142188
0.130203
0.122333
0.0845683
0.0731898
0.13851
0.0871717
0.0665992
0.0384005
0.0566937
0.103472
0.129345
0.134023
0.0872466
0.140184
0.110349
0.139988
0.00996919
0.0165178
0.138644
0.0302718
0.0850773
0.0746347
0.0967357
0.071326
0.0635432
0.127383
0.130016
0.0748903
0.00469725
0.0913187
0.0992598
0.126565
0.121917
0.0863782
0.139555
0.137357
0.0774604
0.0658562
0.128516
0.0838104
0.027751
0.108251
0.0373293
0.0290709
0.0729537
0.0879447
0.0639499
0.111635
0.138515
0.106611
0.139796
0.0856746
0.0661878
0.0544395
0.137469
0.0305147
0.0622773
0.0726595
0.0672033
0.0878574
0.0532534
0.11607
0.110069
0.139209
0.0835784
0.0998305
0.0678578
0.0681336
0.0758368
0.0493947
0.0632859
0.0865749
0.0668492
0.119441
0.111967
0.135947
0.137856
0.114372
0.0808599
0.0709643
0.13145
0.0812713
0.0677319
0.0817088
0.0823666
0.0530117
0.0709342
0.0848843
0.0413487
0.00481329
0.084872
0.0839382
0.0844702
0.0526167
0.0465693
0.138261
0.0780734
0.0862435
0.132641
0.0822357
0.257892
0.140071
0.131503
0.134179
0.0392876
0.0902954
0.139448
0.134688
0.0730148
0.108113
0.0762057
0.0891966
0.120654
0.119344
0.0695136
0.0406149
0.112311
0.0322031
0.0633377
0.123051
0.157882
0.0841313
0.06212
0.050728
0.0838379
0.0561459
0.0628682
0.106938
0.0470714
0.131828
0.0911066
0.0783823
0.0796215
0.136336
0.0520127
0.20427
0.137791
0.0989065
0.115262
0.140141
0.150594
0.0651861
0.113871
0.0622452
0.0853978
0.0865916
0.130391
0.0596877
0.0926098
0.0660794
0.138451
0.0804493
0.0668909
0.138148
0.138173
0.0836851
0.0444915
0.00435746
0.0925129
0.0781164
0.120028
0.161133
0.0545241
0.120435
0.128109
0.112119
0.124452
0.124582
0.133831
0.127027
0.0380371
0.0623994
0.0828077
0.0944986
0.138025
0.0769209
0.113688
0.138619
0.0621366
0.140107
0.0260532
0.0566255
0.0893451
0.0386172
0.0702708
0.0757865
0.139846
0.0556661
0.0760361
0.116793
0.10445
0.124115
0.0860745
0.0987335
0.140172
0.0716957
0.0994964
0.123676
0.128242
0.060333
0.0801682
0.121089
0.0858318
0.069738
0.0509189
0.0590249
0.0907728
0.0608165
0.138952
0.139258
0.0829202
0.0251198
0.137527
0.082675
0.0362699
0.0659115
0.139956
0.136722
0.0889867
0.139712
0.0513853
0.135356
0.0497433
0.11249
0.0555163
0.0766005
0.184557
0.0668918
0.213705
0.0798434
0.0371913
0.0657036
0.138838
0.0353627
0.140213
0.0513118
0.0608787
0.0601088
0.0633493
0.07312
0.0280652
0.061223
0.139373
0.0873818
0.0806685
0.142274
0.141568
0.0938458
0.126478
0.0563663
0.140154
0.078794
0.0449816
0.128264
0.0829092
0.0736528
0.085313
0.117423
0.139024
0.0829589
0.138588
0.0461449
0.0789726
0.0791717
0.0786318
0.0440184
0.125497
0.0565734
0.0831045
0.0672694
0.0659524
0.0824511
0.0682807
0.0305777
0.131573
0.0729981
0.201307
0.136704
0.0788891
0.139763
0.0719496
0.0937047
0.178962
0.13904
0.0621059
0.139093
0.0996995
0.0820932
0.135302
0.0359803
0.0649147
0.0733478
0.0824409
0.0904752
0.223425
0.14844
0.140157
0.137153
0.140016
0.113664
0.134542
0.0695456
0.0326002
0.0707537
0.138616
0.0799962
0.139663
0.0656003
0.0288261
0.061634
0.0642674
0.102882
0.0664577
0.0493475
0.0646108
0.138863
0.0846412
0.128673
0.0454917
0.127935
0.0723181
0.0701059
0.0108644
0.110769
0.0734628
0.113776
0.0719208
0.0287665
0.134003
0.10572
0.0421556
0.137932
0.031643
0.0935089
0.0676661
0.0668902
0.140097
0.100544
0.123491
0.0517038
0.11595
0.123417
0.128028
0.0886178
0.0687812
0.0740259
0.139179
0.120708
0.0615932
0.130187
0.119739
0.104868
0.130351
0.115504
0.024073
0.139083
0.0281711
0.0914996
0.136109
0.0726634
0.418328
0.0410517
0.129856
0.0815128
0.114113
0.128335
0.0678289
0.101769
0.139193
0.00739369
0.0692691
0.0626412
0.0711984
0.140172
0.136908
0.127118
0.127189
0.0719431
0.13847
0.125562
0.148169
0.0632839
0.0459732
0.0189198
0.0831706
0.0602092
0.0759744
0.110675
0.044941
0.144263
0.0979174
0.135962
0.083357
0.0673376
0.125543
0.268367
0.0496636
0.0674798
0.133127
0.0710986
0.0489302
0.0376993
0.0413909
0.125224
0.0678917
0.13978
0.131479
0.0730279
0.0427272
0.0543025
0.0810673
0.0832979
0.0776639
0.0777017
0.0770737
0.069526
0.023639
0.0716349
0.135532
0.090473
0.104822
0.0730026
0.139666
0.0215153
0.0841655
0.113039
0.120945
0.0286765
0.147368
0.0412539
0.135837
0.132938
0.0769405
0.0724647
0.0794888
0.065895
0.081079
0.0751677
0.0121651
0.0164661
0.134241
0.0902337
0.13746
0.137447
0.0531628
0.0450734
0.0905626
0.0788255
0.102146
0.0623572
0.0545801
0.0784372
0.0899268
0.0713033
0.137196
0.100239
0.076567
0.0857738
0.0805897
0.0605073
0.13853
0.105542
0.0811437
0.0134107
0.131705
0.132347
0.138981
0.0490668
0.126851
0.0907816
0.0781191
0.137137
0.126815
0.0952977
0.0561304
0.0581087
0.0448019
0.0676838
0.133038
0.121577
0.0632346
0.131139
0.0686111
0.126752
0.138682
0.020643
0.0461455
0.136649
0.140179
0.0769824
0.0658918
0.139815
0.0664941
0.0440877
0.120454
0.0941942
0.300966
0.0618456
0.0686818
0.0929343
0.0723668
0.138502
0.0683772
0.0917949
0.103425
0.337273
0.0291616
0.0725399
0.0678706
0.0184666
0.0934395
0.139978
0.101238
0.0203213
0.0838207
0.14014
0.194487
0.133569
0.0631528
0.0661114
0.0754554
0.1374
0.072732
0.0242618
0.0555015
0.0816234
0.0504713
0.0984819
0.0509224
0.0639869
0.0819254
0.0791207
0.0774759
0.0849409
0.0764434
0.12289
0.0655364
0.0264178
0.13858
0.0274833
0.0674902
0.13573
0.109185
0.122233
0.0129604
0.180603
0.139496
0.0431375
0.138752
0.0668826
0.0731577
0.0407467
0.0645127
0.0883505
0.0296575
0.0772617
0.0743489
0.0998602
0.10344
0.00478504
0.0522632
0.138093
0.13936
0.0531518
0.0952774
0.0383467
0.0752145
0.138538
0.0538208
0.0700631
0.0689774
0.0705655
0.0334977
0.13999
0.0844967
0.0768665
0.139788
0.0283773
0.132639
0.0811562
0.0049639
0.0132998
0.127437
0.099704
0.0930443
0.134491
0.137223
0.029295
0.106049
0.0964971
0.0315153
0.0687109
0.0840074
0.0408375
0.125453
0.140075
0.126359
0.0640987
0.0973021
0.0391663
0.0655011
0.128635
0.0879369
0.133422
0.13562
0.0726954
0.13684
0.0478106
0.0314943
0.0634513
0.109655
0.0818981
0.0581057
0.0247243
0.144402
0.0973493
0.298927
0.13916
0.0486852
0.0726613
0.111351
0.0873987
0.0245929
0.0539795
0.0986677
0.0566705
0.100229
0.0841176
0.0787268
0.136763
0.117987
0.138518
0.0754601
0.139574
0.03872
0.0276292
0.0630843
0.0489474
0.0904324
0.130281
0.0849791
0.136322
0.107502
0.0445913
0.143544
0.0926255
0.0329731
0.204588
0.0690849
0.134552
0.0418591
0.0274999
0.135692
0.0477878
0.0726565
0.0623784
0.0835506
0.0625903
0.215026
0.0458353
0.0926764
0.0813546
0.090645
0.0533663
0.0668865
0.0172096
0.0510288
0.0712626
0.13944
0.14022
0.0181152
0.127235
0.0672644
0.0291749
0.0590819
0.0671316
0.123675
0.0625693
0.065491
0.0736281
0.0749827
0.0538056
0.0625084
0.13426
0.136266
0.0606952
0.0881252
0.140006
0.0978527
0.0359879
0.0521973
0.103803
0.0724597
0.0457697
0.138037
0.137478
0.118106
0.0621069
0.138518
0.103671
0.0824563
0.0896087
0.0987381
0.046829
0.0365119
0.0369534
0.0633139
0.138606
0.0723565
0.113193
0.139936
0.0911649
0.0365472
0.13776
0.138434
0.117384
0.0681101
0.139997
0.0894131
0.0635605
0.0446019
0.137893
0.0819847
0.0187841
0.083151
0.136458
0.0800717
0.0676573
0.0570892
0.0653516
0.0442226
0.0335849
0.0870365
0.098786
0.10949
0.0954732
0.0739989
0.138086
0.0449589
0.134372
0.127978
0.281864
0.0964003
0.103268
0.139691
0.0634864
0.274217
0.0795855
0.121224
0.137221
0.0779067
0.171709
0.0381397
0.138449
0.14016
0.0691427
0.0220786
0.0790622
0.0756282
0.0937963
0.147871
0.0476077
0.126052
0.103991
0.0490033
0.0235996
0.0355977
0.11371
0.0765234
0.137815
0.0679457
0.132297
0.067264
0.076106
0.0688115
0.0449789
0.138352
0.0526669
0.113939
0.134152
0.0904462
0.0496629
0.102647
0.138145
0.0356041
0.0839497
0.0461242
0.140199
0.0720525
0.0920267
0.071805
0.0882253
0.0645316
0.0797795
0.0851063
0.0776775
0.0613176
0.138973
0.132748
0.0679768
0.0832688
0.0845875
0.0748912
0.128282
0.0470603
0.0488681
0.0976434
0.027884
0.0595014
0.0995707
0.1272
0.0908706
0.10791
0.139835
0.0885691
0.097543
0.135955
0.144076
0.0865885
0.199943
0.0701839
0.127639
0.0797563
0.138361
0.0609591
0.0670945
0.0925613
0.0112576
0.0812863
0.119016
0.174205
0.0570784
0.0725764
0.118138
0.0520802
0.0372505
0.0836512
0.0597789
0.0795063
0.140167
0.110297
0.040828
0.140045
0.0413638
0.0538297
0.124767
0.13857
0.0969995
0.113477
0.0992305
0.138022
0.0886014
0.137632
0.0768235
0.0299419
0.122014
0.0333444
0.0992761
0.0942558
0.137664
0.0270108
0.357054
0.0507424
0.0674348
0.0618095
0.0550901
0.138976
0.140173
0.0418119
0.0978318
0.0288373
0.139112
0.137783
0.139897
0.0257676
0.137555
0.0263304
0.0541634
0.133834
0.0640952
0.0899386
0.11554
0.136606
0.295406
0.0158652
0.0942158
0.140196
0.10424
0.0625479
0.0610726
0.0776445
0.139345
0.13911
0.0705201
0.0267159
0.0555817
0.138445
0.117609
0.117976
0.0456874
0.10529
0.0954625
0.0675394
0.117706
0.0756515
0.0774741
0.103852
0.112237
0.113872
0.0582324
0.0799483
0.0657173
0.138581
0.110257
0.13898
0.131434
0.0610127
0.0763818
0.0395943
0.0953091
0.0930601
0.0836771
0.137006
0.138721
0.137893
0.087633
0.138169
0.0740624
0.0270482
0.0378206
0.132579
0.136998
0.0274868
0.0641651
0.0599359
0.130182
0.0613551
0.0798221
0.0920191
0.012079
0.151867
0.140025
0.138504
0.0837724
0.136344
0.00705194
0.146374
0.0484577
0.0293535
0.0750625
0.0818426
0.0637445
0.0664009
0.0822557
0.0513297
0.0805411
0.140194
0.136211
0.0357088
0.135979
0.0822109
0.138278
0.0670454
0.101093
0.0976141
0.0687481
0.0693067
0.107159
0.0843374
0.0830454
0.13719
0.0900308
0.137278
0.0420807
0.0923534
0.0719451
0.0723444
0.0973213
0.106049
0.139154
0.0836351
0.117545
0.0889204
0.0521913
0.0486552
0.066725
0.104834
0.0635896
0.0761904
0.0697325
0.0704878
0.026634
0.110494
0.00873066
0.119622
0.0103635
0.119177
0.105952
0.0688396
0.0882977
0.0886577
0.101436
0.0309236
0.0746428
0.0652634
0.130772
0.0484376
0.0450945
0.0866346
0.0798977
0.128045
0.0349917
0.049268
0.137523
0.0580045
0.0566524
0.0935222
0.0913402
0.0953987
0.0323337
0.0445677
0.0767726
0.238006
0.0660254
0.0977255
0.0695743
0.0422645
0.0841441
0.102711
0.0340095
0.139434
0.0791548
0.0721419
0.0460063
0.05249
0.135133
0.137067
0.0683407
0.0864581
0.0624197
0.0555567
0.0537792
0.045203
0.1219
0.0834542
0.139976
0.076289
0.0868011
0.088669
0.071933
0.030319
0.0909952
0.0657501
0.0764955
0.0480135
0.0691494
0.0805375
0.129233
0.116345
0.138357
0.0340588
0.12609
0.11932
0.0324015
0.0410329
0.119904
0.0838216
0.0476866
0.121105
0.123898
0.0599632
0.0628421
0.119582
0.0807724
0.0654606
0.113873
0.073194
0.0924061
0.0248177
0.0760905
0.11855
0.139391
0.077276
0.0660655
0.133897
0.0614694
0.09183
0.0759079
0.024833
0.108276
0.0717997
0.0499462
0.133099
0.0665852
0.056409
0.0754218
0.0927895
0.129511
0.130002
0.029174
0.0793843
0.0419377
0.0678929
0.0454967
0.0816524
0.140127
0.056828
0.0710724
0.137554
0.111042
0.13147
0.0711328
0.0766465
0.130979
0.11501
0.138296
0.0366534
0.0375369
0.0695672
0.0634033
0.137391
0.0581978
0.0681281
0.108332
0.204456
0.0897658
0.139907
0.122552
0.0863147
0.13796
0.0418302
0.111383
0.0953229
0.0627911
0.0389297
0.0628638
0.137449
0.0541889
0.0648977
0.121184
0.0734793
0.0333271
0.0618689
0.0924406
0.079266
0.0959259
0.0805299
0.0787636
0.128711
0.0412341
0.13842
0.149738
0.124189
0.127252
0.0592151
0.0573445
0.140198
0.0710006
0.0962802
0.0677662
0.045309
0.028839
0.0261909
0.0501747
0.0723438
0.139892
0.0915401
0.0562341
0.0240956
0.139736
0.0781759
0.0985432
0.0877467
0.0787607
0.134602
0.0467474
0.0809753
0.0769468
0.0561788
0.0440498
0.0739688
0.0849161
0.138546
0.133783
0.0140848
0.138126
0.139758
0.0309674
0.064807
0.0254204
0.1361
0.0491668
0.066281
0.140131
0.0448954
0.0826543
0.133991
0.0792868
0.137676
0.121131
0.139007
0.12947
0.0291261
0.140169
0.113052
0.132557
0.0635984
0.0811719
0.047995
0.121775
0.0714545
0.182159
0.040542
0.136294
0.0677113
0.0650382
0.0235603
0.10688
0.107478
0.0652988
0.135727
0.0815588
0.131168
0.0848391
0.0362029
0.0360225
0.105336
0.0154245
0.0168334
0.0549918
0.0777462
0.0561863
0.139025
0.0668281
0.140126
0.0962951
0.0675464
0.13792
0.141181
0.0839581
0.0718125
0.062093
0.0716682
0.0452921
0.0809213
0.0980364
0.0629261
0.0236144
0.027369
0.0481872
0.0854799
0.0665257
0.0783071
0.0353776
0.0244539
0.0759882
0.0634899
0.0517736
0.0592866
0.0435465
0.126361
0.133918
0.137996
0.062167
0.0592202
0.0365853
0.0701922
0.138371
0.0947163
0.0634733
0.0809521
0.106816
0.326431
0.0587417
0.0990195
0.0895995
0.0515231
0.137926
0.0788492
0.0752759
0.128243
0.0984707
0.110161
0.0124707
0.0664809
0.0737262
0.034566
0.0705695
0.112628
0.0756556
0.0468541
0.0631452
0.11864
0.0699766
0.0785445
0.128842
0.136261
0.0868076
0.0839351
0.063087
0.0495124
0.137805
0.138465
0.0764576
0.0339801
0.0526061
0.039044
0.131422
0.0609292
0.119235
0.0305551
0.0928528
0.0823005
0.0540189
0.0794279
0.050195
0.0388054
0.0764255
0.140634
0.0417455
0.099767
0.108674
0.131872
0.142123
0.092564
0.138481
0.0510242
0.0468967
0.0693806
0.0442954
0.0665846
0.0461676
0.0691198
0.0301084
0.139207
0.0937682
0.0825495
0.00647901
0.0454929
0.114392
0.109217
0.12747
0.0772125
0.138683
0.0412415
0.030952
0.0969208
0.0774142
0.0716155
0.131245
0.13909
0.140109
0.0747096
0.0243637
0.136049
0.100776
0.0566976
0.139118
0.140143
0.0849791
0.07449
0.024966
0.0434535
0.0315602
0.103663
0.0377798
0.0682365
0.0405664
0.0708337
0.0372492
0.0711439
0.026513
0.14002
0.0923206
0.092173
0.0774976
0.109681
0.0838759
0.0827197
0.0790231
0.0701434
0.045229
0.128504
0.104347
0.0746343
0.092727
0.0786409
0.0462228
0.0259822
0.0682748
0.0679979
0.279531
0.128883
0.135469
0.0845196
0.0672351
0.0735818
0.0781969
0.073278
0.0833573
0.0261035
0.0578673
0.124362
0.0290634
0.12762
0.0635603
0.129424
0.0803801
0.129104
0.113823
0.0831518
0.116899
0.0230261
0.0950419
0.0577481
0.134798
0.0461971
0.119315
0.0307507
0.0731022
0.080769
0.138013
0.0308546
0.120292
0.0960033
0.14357
0.0255571
0.076432
0.0536142
0.0862752
0.0503949
0.0211685
0.131976
0.138668
0.0633897
0.0728035
0.139883
0.0769158
0.0623444
0.0492817
0.0765161
0.140042
0.0492046
0.0831832
0.0420131
0.0801881
0.0259889
0.0337193
0.0825422
0.140156
0.0741372
0.0242797
0.0773087
0.0609925
0.0654068
0.0987559
0.0287893
0.13815
0.0842343
0.0972208
0.0236826
0.110717
0.066936
0.0298323
0.0905342
0.256533
0.036484
0.0598432
0.0873761
0.0836044
0.0624029
0.13343
0.132849
0.0875972
0.0658066
0.0971684
0.114357
0.0778309
0.0866409
0.080276
0.0843549
0.13829
0.0572892
0.123009
0.087395
0.0511908
0.0670938
0.08346
0.108244
0.0549911
0.0978471
0.139795
0.0861442
0.124754
0.0767774
0.0452512
0.130493
0.0610845
0.0723842
0.0960917
0.0862902
0.139332
0.120824
0.0292892
0.13991
0.0631452
0.0758647
0.137195
0.135812
0.0833117
0.0594972
0.114931
0.0707212
0.0879213
0.0857327
0.0945926
0.0266056
0.133601
0.0287257
0.093939
0.140056
0.135005
0.0505669
0.0566382
0.0614655
0.08224
0.0657137
0.114196
0.0969169
0.07212
0.0817955
0.138219
0.0554675
0.13783
0.0624858
0.0474733
0.112065
0.0809845
0.0815838
0.0414486
0.0724293
0.0627817
0.091752
0.0726129
0.0309211
0.0746029
0.018789
0.0572641
0.0380902
0.0608394
0.0670727
0.0684647
0.027068
0.0711406
0.133807
0.139065
0.0487756
0.0189694
0.120323
0.077031
0.0770617
0.0228767
0.0856449
0.0285388
0.0719831
0.0677231
0.0493779
0.140118
0.0453645
0.0760158
0.0938361
0.0834222
0.0113891
0.0699535
0.0287356
0.0803636
0.135603
0.11812
0.0670009
0.0665032
0.0332418
0.0667922
0.00616125
0.0977984
0.0432217
0.134234
0.138309
0.037263
0.0531717
0.0879704
0.090809
0.116858
0.0620053
0.059059
0.100483
0.0631527
0.0770593
0.0284937
0.0628789
0.0642239
0.140095
0.0734197
0.10239
0.101696
0.139376
0.136216
0.131992
0.0420375
0.132308
0.0838927
0.0339893
0.118571
0.0764648
0.0800168
0.123645
0.0631809
0.139238
0.121021
0.03737
0.127502
0.108992
0.0666773
0.139079
0.073558
0.139978
0.079742
0.085301
0.0048131
0.077692
0.103593
0.140044
0.0260496
0.077531
0.0236638
0.0837275
0.0435598
0.0930619
0.213221
0.0780274
0.0865483
0.0467996
0.100641
0.0721665
0.101527
0.0667412
0.138867
0.0919645
0.132003
0.082955
0.049171
0.0691378
0.136492
0.0255874
0.023686
0.0343798
0.0880985
0.0658432
0.139805
0.0555895
0.026209
0.0382665
0.0239544
0.0839869
0.138397
0.0367846
0.0604931
0.0802028
0.0923514
0.139526
0.065194
0.112183
0.0689001
0.0909838
0.0883176
0.0451607
0.0470554
0.0609727
0.0264167
0.078687
0.0589616
0.137112
0.065571
0.12982
0.0270272
0.139173
0.0192094
0.292118
0.0282957
0.128122
0.066849
0.0685274
0.107864
0.0774233
0.038757
0.0951809
0.0651137
0.139566
0.0865274
0.0509102
0.137993
0.139959
0.0755625
0.125292
0.028808
0.0791072
0.0868912
0.125549
0.131387
0.0532315
0.0797308
0.0685839
0.105016
0.0654752
0.0627644
0.123878
0.033642
0.053576
0.0405799
0.0636007
0.133382
0.0687108
0.132892
0.140012
0.155313
0.135597
0.0758755
0.00655554
0.0789847
0.0753327
0.0785226
0.144494
0.0882557
0.0707557
0.127165
0.0961436
0.0657255
0.137465
0.0321606
0.138133
0.118388
0.140162
0.121812
0.138375
0.134999
0.0483483
0.0286237
0.129394
0.0536386
0.0624724
0.0902103
0.06689
0.140054
0.0611197
0.135371
0.0791933
0.0664664
0.0667424
0.0553124
0.0853536
0.00874738
0.0603513
0.0892558
0.0696076
0.0539781
0.0720049
0.0881958
0.139999
0.0767807
0.0442677
0.100391
0.0848823
0.125548
0.0921684
0.069665
0.0793027
0.0852873
0.122932
0.0573054
0.102852
0.0424025
0.0830421
0.138273
0.137037
0.149353
0.0531871
0.0852096
0.0812154
0.139065
0.0754866
0.0822222
0.107543
0.140166
0.121913
0.0632522
0.03023
0.0976254
0.0265912
0.13906
0.0706074
0.126656
0.0247601
0.0770375
0.080332
0.0901257
0.137939
0.075797
0.101397
0.0667555
0.139098
0.0679119
0.0387538
0.07463
0.0691917
0.0235594
0.0355483
0.107634
0.0757036
0.139701
0.0797904
0.114702
0.160397
0.0733066
0.0872459
0.0894647
0.0923546
0.0665603
0.0727049
0.138459
0.083638
0.0735523
0.140053
0.0942094
0.0270452
0.11094
0.0391138
0.0992878
0.0440641
0.0580991
0.0872821
0.0907747
0.104084
0.0716803
0.0780025
0.0385815
0.0511883
0.080103
0.134541
0.0305232
0.177989
0.0627369
0.32955
0.138474
0.126435
0.0978856
0.0180199
0.127451
0.0267473
0.0289975
0.0767603
0.091552
0.0670168
0.131398
0.0821676
0.00388025
0.0335849
0.0685794
0.138747
0.130217
0.121181
0.061418
0.0559497
0.0595813
0.111671
0.0716575
0.133813
0.125802
0.0644408
0.063396
0.053738
0.0777694
0.0636014
0.0311767
0.0391988
0.138578
0.094348
0.104714
0.0504237
0.138213
0.138355
0.0692036
0.0968448
0.140101
0.0307646
0.00675658
0.0485135
0.100403
0.0732523
0.0996747
0.0560016
0.0744774
0.138811
0.14002
0.125705
0.0904025
0.0315849
0.0279395
0.0579018
0.0434918
0.10575
0.0462879
0.131974
0.0433984
0.0822008
0.0543852
0.0377666
0.137068
0.0631127
0.0834494
0.089
0.0317421
0.0670565
0.124837
0.133185
0.0350763
0.110845
0.0806234
0.0939061
0.137789
0.0265496
0.119626
0.133275
0.0908058
0.079339
0.105797
0.10747
0.0277704
0.110675
0.0745024
0.0137273
0.0760933
0.0513555
0.132118
0.183818
0.140004
0.0318383
0.00934619
0.0670586
0.139807
0.069541
0.138725
0.13434
0.0665999
0.0279089
0.0526565
0.103227
0.0785514
0.0861342
0.124701
0.0804406
0.0650272
0.137164
0.0714098
0.00343543
0.139759
0.080836
0.124771
0.0648721
0.0872086
0.0655341
0.0367421
0.119088
0.0296426
0.0727424
0.0334483
0.140218
0.098364
0.094678
0.044086
0.140161
0.10218
0.0801858
0.134355
0.0271766
0.10312
0.00860482
0.0816755
0.0561187
0.123591
0.138345
0.0616218
0.0677484
0.267877
0.0416913
0.0432234
0.107771
0.140166
0.0323103
0.0650768
0.0709564
0.12782
0.117644
0.122985
0.0620348
0.0290425
0.0549111
0.00541469
0.0765801
0.0770388
0.0701929
0.106301
0.0671771
0.0902814
0.0601528
0.0469921
0.0282066
0.139815
0.0397185
0.0665423
0.0760884
0.0629819
0.137496
0.0765385
0.0634828
0.0714615
0.0950118
0.0839659
0.0485556
0.0721559
0.0984941
0.0856528
0.121196
0.0774322
0.0714249
0.140091
0.0734463
0.0775498
0.0676703
0.13772
0.059885
0.087796
0.0697941
0.131567
0.081299
0.118785
0.330741
0.0929622
0.0734127
0.128557
0.139555
0.131503
0.0663599
0.118618
0.0831594
0.0938095
0.0721082
0.13771
0.0498004
0.0570943
0.138347
0.118223
0.0405076
0.0351326
0.0673841
0.0275426
0.12137
0.0752449
0.0855735
0.0904628
0.0915486
0.0356679
0.134586
0.0789036
0.171337
0.0727352
0.081563
0.124359
0.13987
0.0485726
0.0521331
0.136706
0.139446
0.124486
0.0774182
0.062544
0.0855404
0.0625528
0.0535305
0.139011
0.0715081
0.136955
0.065718
0.0745941
0.0782848
0.0737714
0.138879
0.137474
0.092853
0.0731961
0.0287602
0.134507
0.0407692
0.129396
0.0962817
0.0750205
0.0788035
0.0622923
0.0453524
0.0782746
0.0778836
0.137048
0.0834575
0.0652826
0.0808225
0.129714
0.0919492
0.0903174
0.0828803
0.0238619
0.145637
0.0034678
0.0695126
0.069452
0.0444828
0.0667261
0.0543804
0.134896
0.062471
0.0904814
0.057218
0.0873768
0.133488
0.0977756
0.264176
0.119466
0.0857312
0.0836283
0.0861729
0.0872897
0.061708
0.0352792
0.131527
0.0862464
0.131891
0.131276
0.125831
0.122206
0.0323115
0.151733
0.0925136
0.0756259
0.0797511
0.0742716
0.0350695
0.082025
0.114517
0.109451
0.110854
0.0777428
0.0991885
0.0790688
0.0950899
0.136664
0.132559
0.0198281
0.104469
0.0384301
0.061865
0.0596865
0.00402641
0.0381076
0.0746125
0.0609684
0.140036
0.0528051
0.038485
0.0771987
0.136489
0.0667154
0.0771737
0.0627784
0.140052
0.0925598
0.314241
0.125637
0.0332838
0.101645
0.0891229
0.173653
0.126202
0.140196
0.0644054
0.0519619
0.344833
0.140176
0.0456394
0.113073
0.0969411
0.0327553
0.11521
0.0479624
0.080281
0.0858952
0.0939031
0.0794119
0.131455
0.0604076
0.0317299
0.0318521
0.0789516
0.0569599
0.0579048
0.0519612
0.0470902
0.138609
0.0755558
0.071379
0.0974528
0.140178
0.135829
0.0734544
0.13882
0.0841804
0.0854427
0.138413
0.0579743
0.0293772
0.050747
0.0324719
0.121637
0.0622219
0.0995429
0.0852583
0.107052
0.0724624
0.0251993
0.140295
0.0376326
0.075986
0.0392314
0.106038
0.0998551
0.123202
0.102787
0.0377924
0.118288
0.0470801
0.164102
0.0737383
0.049857
0.028362
0.0672203
0.0877941
0.0784006
0.0433667
0.0892641
0.0859558
0.122937
0.130544
0.0573828
0.137974
0.0875691
0.13617
0.139785
0.0668065
0.0651333
0.0758262
0.0502546
0.0696071
0.124681
0.139638
0.0678803
0.023531
0.145988
0.140172
0.0994211
0.0207928
0.105573
0.0653747
0.0421923
0.0273005
0.0419684
0.0890805
0.0745017
0.0582567
0.140218
0.0788932
0.0277835
0.135062
0.0592463
0.0716191
0.0516868
0.139479
0.0782615
0.0717371
0.021808
0.0765526
0.356356
0.0321569
0.185406
0.0613646
0.0752824
0.0324433
0.132351
0.0281176
0.140208
0.0878645
0.0340992
0.0297442
0.0646699
0.0692192
0.0340858
0.0628875
0.0829898
0.0764621
0.118376
0.0945961
0.0778075
0.0233199
0.335581
0.063518
0.0819592
0.0285255
0.0307926
0.122074
0.126668
0.074796
0.0624785
0.0601507
0.062804
0.0259755
0.0850248
0.0820628
0.133798
0.0643757
0.092089
0.14008
0.0781256
0.0797706
0.129072
0.122298
0.045486
0.159408
0.0681454
0.0838031
0.132845
0.137707
0.0694761
0.128593
0.0768743
0.0389926
0.0863052
0.0874913
0.0633659
0.0773202
0.0308845
0.0251138
0.126553
0.0320868
0.0576823
0.0292703
0.0507571
0.0887383
0.0301766
0.0534091
0.048815
0.0482439
0.12714
0.0300083
0.0443996
0.0623922
0.133334
0.00557242
0.0679538
0.0446883
0.115466
0.0295352
0.0504126
0.0509748
0.0791565
0.0902089
0.139407
0.0731898
0.0633987
0.0252334
0.0760351
0.13745
0.0550818
0.0630296
0.072098
0.143179
0.0632064
0.0308808
0.0741737
0.139456
0.0330538
0.0347197
0.0933484
0.0621199
0.0492135
0.132991
0.0654845
0.0980695
0.0719987
0.023849
0.112006
0.0722468
0.0868174
0.0635542
0.0253476
0.0113082
0.0684242
0.070936
0.135328
0.123293
0.11808
0.0641753
0.0821874
0.0845792
0.081787
0.132761
0.0666821
0.137627
0.0630891
0.0671405
0.084228
0.0364744
0.135168
0.0671174
0.101436
0.0541033
0.1396
0.0738882
0.100172
0.118115
0.138694
0.139706
0.0244076
0.0653192
0.080936
0.0616878
0.453837
0.0364395
0.1505
0.0502218
0.0721399
0.0634478
0.129722
0.131843
0.04117
0.114222
0.0736821
0.136317
0.0620503
0.0887516
0.0756965
0.0638457
0.0383079
0.0256546
0.132516
0.067633
0.0797225
0.139398
0.0649865
0.0385814
0.0997208
0.0335249
0.0594271
0.0779731
0.0483797
0.0121371
0.0606528
0.134897
0.18613
0.0624201
0.0767702
0.141491
0.0562436
0.0375469
0.122847
0.0261541
0.104387
0.0600899
0.0297602
0.0390057
0.0364344
0.0779608
0.0668184
0.00819459
0.0768102
0.116444
0.131998
0.0422295
0.0823759
0.0671817
0.0823959
0.0846693
0.137333
0.102887
0.127045
0.09083
0.0807553
0.10127
0.0584055
0.119977
0.0687146
0.106569
0.0599371
0.0999156
0.085746
0.0950601
0.0826906
0.0623412
0.139134
0.140076
0.130768
0.0941479
0.108713
0.0236868
0.140053
0.106384
0.0715057
0.0142897
0.12125
0.0671695
0.0672809
0.0628642
0.0764121
0.0825614
0.0796594
0.0401283
0.0266452
0.0843999
0.101419
0.0499784
0.0337163
0.0239804
0.0754354
0.0346877
0.026082
0.0203129
0.119948
0.14017
0.0547116
0.0652056
0.129267
0.0175707
0.0964643
0.0940916
0.0798045
0.137639
0.0759694
0.131104
0.0605633
0.0407848
0.0892445
0.0646362
0.0659558
0.0931668
0.0966673
0.137987
0.135089
0.0949779
0.0286414
0.115326
0.0361518
0.267627
0.0579516
0.0760354
0.128768
0.0610051
0.0794901
0.0681219
0.0704626
0.0888429
0.076293
0.140079
0.0102131
0.0741887
0.140087
0.105793
0.0968331
0.0240357
0.0309983
0.138753
0.0630928
0.0663497
0.110677
0.0796097
0.0824778
0.0565197
0.0582834
0.0625121
0.0515931
0.132867
0.0591825
0.0891801
0.0722694
0.07844
0.0676703
0.0317516
0.0768408
0.094392
0.102884
0.0944902
0.129514
0.0850631
0.0946629
0.0246726
0.139249
0.0961953
0.0279413
0.0729994
0.0293851
0.128057
0.129222
0.110794
0.139089
0.06688
0.0455245
0.0885927
0.0488284
0.354941
0.0491102
0.136541
0.0781884
0.026879
0.0402959
0.0805228
0.139264
0.113161
0.0925585
0.0617648
0.0836951
0.110128
0.123472
0.0663946
0.0897948
0.0859911
0.056103
0.162166
0.140169
0.13998
0.092874
0.0763181
0.0598456
0.138775
0.138117
0.0624864
0.0133306
0.0705837
0.125388
0.0844971
0.0434573
0.0724983
0.0906897
0.0140649
0.139447
0.0700837
0.0788233
0.139658
0.0637964
0.0266685
0.0749185
0.0830982
0.0981967
0.0290284
0.0126595
0.137181
0.0662149
0.0859895
0.0847479
0.15044
0.137609
0.13902
0.0333196
0.073314
0.0381865
0.0959981
0.0991616
0.126635
0.0834039
0.0237381
0.0846622
0.0792794
0.090564
0.0246162
0.162824
0.133549
0.0937621
0.0697105
0.0574461
0.027808
0.137691
0.0991222
0.0622582
0.0629983
0.0549605
0.029414
0.0851386
0.0479645
0.120961
0.0279199
0.00835314
0.150315
0.0699065
0.0767856
0.0324945
0.050629
0.128132
0.0854017
0.0424873
0.0632106
0.107479
0.0392339
0.139689
0.0548809
0.075585
0.0987367
0.0686159
0.0354174
0.0884549
0.00969508
0.0890126
0.250281
0.0440441
0.0565088
0.0553498
0.0601001
0.0434246
0.0910598
0.0784449
0.0143361
0.042192
0.140013
0.0741642
0.102514
0.0521819
0.0362245
0.121768
0.140044
0.11948
0.0634855
0.0728983
0.137071
0.129674
0.0611917
0.05887
0.140105
0.139868
0.079344
0.0379629
0.140061
0.138421
0.0418294
0.0746174
0.12486
0.0583914
0.0757252
0.043499
0.0631679
0.108875
0.122879
0.12331
0.0930662
0.137768
0.043184
0.055309
0.0363704
0.140111
0.131048
0.074303
0.0873301
0.0714763
0.0956629
0.0905043
0.0881216
0.0952908
0.129504
0.108281
0.0405535
0.127833
0.136204
0.137342
0.0750098
0.0716002
0.116867
0.0618395
0.0584056
0.059261
0.0621444
0.140022
0.0506021
0.155887
0.121122
0.0600433
0.129456
0.0672814
0.138063
0.130281
0.00935493
0.19865
0.109164
0.0981072
0.0610666
0.133209
0.0738243
0.0421769
0.056078
0.115506
0.0869481
0.0993047
0.136012
0.0816654
0.0335103
0.0697292
0.0480257
0.137911
0.135941
0.224454
0.0779423
0.0790073
0.0705235
0.0426584
0.0766684
0.0895867
0.0167546
0.126892
0.010162
0.135694
0.0612581
0.0844515
0.135716
0.0237981
0.0742354
0.0415581
0.08483
0.0698117
0.0868024
0.0496667
0.0623755
0.0686504
0.0647544
0.0767078
0.139382
0.138071
0.0938242
0.0683603
0.0666845
0.14669
0.13994
0.0923209
0.038384
0.0307748
0.0275309
0.0398508
0.0269917
0.140117
0.0700377
0.116919
0.138318
0.0740883
0.136409
0.0920249
0.0738494
0.130466
0.0876641
0.113842
0.125629
0.0314608
0.138484
0.0461264
0.0716466
0.126326
0.0304161
0.0297986
0.107667
0.134514
0.00557879
0.0873601
0.102913
0.0332207
0.0785281
0.0310549
0.0913874
0.143814
0.0414364
0.0735516
0.135987
0.127505
0.0264716
0.0300832
0.0240633
0.102911
0.0614802
0.123102
0.0902642
0.140132
0.111083
0.138747
0.274352
0.137343
0.0669734
0.194026
0.0627074
0.0620688
0.0776252
0.0437428
0.0919941
0.0720123
0.0330425
0.0564775
0.0854253
0.082966
0.0756734
0.0334924
0.427208
0.0698911
0.102964
0.0442221
0.069258
0.0778638
0.137848
0.103227
0.367473
0.0914678
0.0160632
0.075695
0.135152
0.0631257
0.107853
0.138499
0.0730646
0.0268609
0.0315184
0.0594351
0.0973301
0.111342
0.083989
0.0728956
0.0314984
0.0327337
0.191186
0.0898873
0.110664
0.0677777
0.125169
0.0597264
0.0627412
0.094223
0.0678351
0.0699136
0.106405
0.103878
0.0764677
0.13645
0.132196
0.0871615
0.00763189
0.0245271
0.122578
0.127982
0.0919172
0.0888353
0.0573341
0.117501
0.0307494
0.258513
0.0330369
0.0789077
0.117275
0.133439
0.0348223
0.0333667
0.0304275
0.0729821
0.0696926
0.0734849
0.0244382
0.0924029
0.13252
0.138471
0.0804913
0.0807266
0.0993758
0.0653248
0.0887894
0.0772027
0.138223
0.138396
0.132239
0.0792666
0.11935
0.0280315
0.138233
0.0594377
0.0683382
0.0405984
0.0592089
0.138799
0.0527865
0.0854303
0.0493525
0.0660515
0.0361498
0.139091
0.0529954
0.0769903
0.0837814
0.0861273
0.0895156
0.102748
0.0869048
0.0785315
0.0594008
0.102848
0.0245984
0.0883646
0.133703
0.117234
0.0513383
0.102016
0.100525
0.0499181
0.0884987
0.0798402
0.106101
0.0863814
0.0741615
0.093174
0.131337
0.0912301
0.0463497
0.0826737
0.0999845
0.0804981
0.0987666
0.100797
0.0354529
0.139458
0.38295
0.139664
0.126801
0.121816
0.0137603
0.058277
0.0615093
0.106608
0.0927689
0.0859058
0.0836398
0.0390547
0.0622945
0.0898033
0.077158
0.0852661
0.137471
0.0460284
0.0636022
0.116254
0.0728656
0.00574192
0.139881
0.0401318
0.0539766
0.0972187
0.0720924
0.0866335
0.0863996
0.136941
0.104781
0.0834342
0.0924517
0.0474282
0.109555
0.132408
0.0888257
0.0688786
0.0327693
0.0901959
0.0783638
0.10885
0.094126
0.062209
0.0916238
0.138972
0.0408918
0.0757624
0.0903969
0.0476881
0.0685204
0.138222
0.10544
0.117645
0.0617267
0.0709023
0.084927
0.0494977
0.0833905
0.0645437
0.138621
0.0335087
0.0558671
0.0937727
0.13912
0.120831
0.138965
0.0950702
0.0808211
0.080665
0.0389632
0.0712624
0.0578563
0.0855534
0.11617
0.0741405
0.139792
0.131638
0.0929478
0.0586464
0.130486
0.138831
0.0699594
0.0758372
0.0568096
0.0572505
0.0615928
0.127186
0.136909
0.0691669
0.0859201
0.0285792
0.0875372
0.0701091
0.0845603
0.0369586
0.0773305
0.0786559
0.161519
0.13261
0.0434555
0.139538
0.115531
0.0250743
0.0506271
0.0524345
0.124245
0.136541
0.137021
0.00696182
0.0380136
0.0705781
0.0610178
0.062556
0.0800733
0.0736555
0.0236189
0.139723
0.124597
0.0732342
0.0262173
0.0644498
0.0851062
0.135244
0.0643523
0.133551
0.138851
0.0354257
0.0384983
0.085364
0.060789
0.140455
0.118569
0.0920213
0.0882779
0.0894998
0.124424
0.0238815
0.0313468
0.0405331
0.0806917
0.0934507
0.183632
0.118966
0.0174692
0.0785523
0.125341
0.1335
0.0955206
0.0859585
0.0646581
0.0846857
0.0753474
0.122761
0.105305
0.0642573
0.0845467
0.0410599
0.135749
0.127931
0.137276
0.0536129
0.0847814
0.0529745
0.0637446
0.137808
0.0290753
0.136449
0.1326
0.0649629
0.148342
0.0851422
0.0518694
0.0251702
0.0853211
0.0803952
0.0877556
0.0663596
0.111528
0.16508
0.0477416
0.130583
0.0186156
0.065018
0.070329
0.0353251
0.139193
0.0899112
0.0684288
0.138266
0.140009
0.0353395
0.143078
0.0826847
0.0642755
0.042433
0.0441271
0.143484
0.0379269
0.13723
0.0467061
0.041154
0.0712043
0.0623812
0.0829131
0.0844967
0.0827761
0.0729095
0.0878644
0.0937673
0.0492847
0.139713
0.132795
0.13858
0.0267469
0.069862
0.0241108
0.124008
0.122083
0.129754
0.0783602
0.0646701
0.0820227
0.363824
0.0797087
0.137942
0.11307
0.131827
0.108929
0.0449659
0.112638
0.0720137
0.126533
0.00670552
0.395769
0.124644
0.137423
0.137801
0.0418066
0.0693106
0.138444
0.0263539
0.0685829
0.0272723
0.0996792
0.13783
0.0795356
0.140031
0.12263
0.0445035
0.0885395
0.13724
0.0888276
0.151379
0.139153
0.0412846
0.0880459
0.10594
0.0760372
0.140113
0.0508805
0.0629284
0.132788
0.032103
0.125576
0.119431
0.0428294
0.15361
0.0765274
0.0906736
0.03333
0.0835202
0.130499
0.0807518
0.0814573
0.13573
0.134108
0.0675043
0.0768691
0.0580164
0.0542218
0.111352
0.138825
0.157789
0.080197
0.0752808
0.139958
0.0839627
0.0890339
0.0708577
0.0891951
0.0855629
0.0903657
0.0313935
0.185945
0.0970102
0.0417686
0.143156
0.0813713
0.138651
0.0818118
0.1486
0.0796411
0.0550559
0.134544
0.0579211
0.13535
0.0521175
0.0869603
0.071918
0.127619
0.130824
0.0968444
0.12903
0.0447777
0.068678
0.099412
0.130775
0.125893
0.0619372
0.078036
0.0241509
0.0234834
0.0716706
0.133024
0.0804791
0.0221369
0.082899
0.0835391
0.0780126
0.138558
0.363798
0.0704358
0.069301
0.137911
0.080948
0.0747274
0.043288
0.0854493
0.0255047
0.0734677
0.0750278
0.075336
0.0858914
0.0289844
0.0842425
0.134276
0.0599156
0.0644038
0.10653
0.058637
0.0308323
0.102037
0.0855278
0.134285
0.0713504
0.0678069
0.0965536
0.0449865
0.0343477
0.137341
0.0379018
0.0940288
0.0929564
0.0889118
0.0802266
0.0591075
0.0941451
0.136857
0.00476297
0.106642
0.0705941
0.0907111
0.059506
0.0314221
0.0779265
0.115868
0.0807158
0.115293
0.0574172
0.129514
0.0696019
0.0576327
0.0699673
0.0688403
0.0616868
0.133186
0.0850788
0.0802411
0.0664733
0.0752186
0.136752
0.0969264
0.0359073
0.135761
0.0626504
0.059915
0.041723
0.00866987
0.0834874
0.0736646
0.0387276
0.113595
0.097439
0.04377
0.138216
0.065398
0.139228
0.101428
0.0864121
0.0738913
0.0403258
0.0589906
0.0742138
0.107628
0.129155
0.0447607
0.0718315
0.0599286
0.0907654
0.0871647
0.11331
0.0652254
0.0609572
0.136498
0.136306
0.123631
0.0226285
0.0751323
0.137753
0.10035
0.0314395
0.0720994
0.0704757
0.00409975
0.094686
0.0894607
0.0527671
0.0697624
0.0975668
0.0746783
0.0816086
0.0345743
0.0672208
0.0857436
0.0527338
0.0660062
0.0481519
0.0718018
0.0449708
0.0823871
0.0591311
0.0510501
0.0717994
0.0780644
0.0779853
0.114542
0.0920629
0.137945
0.0753701
0.0454429
0.117215
0.0688207
0.0740445
0.131834
0.0747286
0.0668236
0.0662862
0.0762279
0.138291
0.0724959
0.114552
0.0332539
0.0726697
0.0816824
0.0676632
0.0441758
0.0747451
0.0869883
0.349711
0.13038
0.0742413
0.137744
0.0787343
0.0808692
0.0718083
0.0555646
0.0502285
0.0257283
0.133696
0.123683
0.071671
0.131311
0.00771934
0.16375
0.0251393
0.0362426
0.0386127
0.0685634
0.0610021
0.0863178
0.0946179
0.0708596
0.107107
0.0812103
0.0644455
0.0453001
0.140043
0.140129
0.139172
0.0918124
0.0993382
0.0280745
0.13485
0.0580087
0.0476158
0.0341485
0.0581077
0.0974759
0.12476
0.115372
0.0544439
0.108057
0.133276
0.0131266
0.0326657
0.108734
0.0811205
0.078656
0.0719891
0.0523104
0.133989
0.112626
0.138493
0.0426363
0.0311904
0.0655259
0.104487
0.0766831
0.134814
0.065892
0.138249
0.0529023
0.0399179
0.0623329
0.0705263
0.139337
0.0390424
0.0981148
0.0445006
0.0623453
0.138184
0.0659495
0.127175
0.127232
0.0701632
0.0656201
0.140052
0.112779
0.131576
0.0842596
0.00429294
0.062177
0.0727529
0.0785081
0.161226
0.142133
0.139545
0.0562936
0.0704925
0.071099
0.0360041
0.0632524
0.0634707
0.0762709
0.0444023
0.0630423
0.0608293
0.0544375
0.0823052
0.0339951
0.0838581
0.0754004
0.0618218
0.0613428
0.0927962
0.0622433
0.0821055
0.0755989
0.138886
0.133209
0.0739987
0.111674
0.0833969
0.0920978
0.0268964
0.0302928
0.132259
0.117252
0.0814559
0.0850693
0.06582
0.0493966
0.0748997
0.0382999
0.145306
0.101408
0.0796071
0.0908742
0.0362339
0.078526
0.0951641
0.137649
0.131806
0.0301619
0.139427
0.0802464
0.0829307
0.0430351
0.0775505
0.137422
0.0644787
0.0270148
0.0549674
0.101875
0.03766
0.0627458
0.066216
0.0603892
0.0352982
0.0713815
0.139176
0.0673304
0.0252271
0.139757
0.134994
0.0402777
0.036152
0.0899927
0.138283
0.0495802
0.0563837
0.0861108
0.0129032
0.0311591
0.0254416
0.0205685
0.0823575
0.13343
0.0837747
0.0288815
0.0691934
0.132404
0.0429431
0.0861484
0.071666
0.0223494
0.0733817
0.0554475
0.0719246
0.0662575
0.0787181
0.0701502
0.0759846
0.0946127
0.0946771
0.121445
0.0717191
0.0543935
0.051792
0.0429363
0.122028
0.0484865
0.0429834
0.0709701
0.126922
0.138709
0.0547213
0.0929008
0.0488242
0.0907143
0.130272
0.0355903
0.0376057
0.151448
0.329283
0.0649532
0.0814251
0.135145
0.0820676
0.133016
0.109941
0.0307135
0.139481
0.103485
0.0708357
0.11246
0.108125
0.0592557
0.086544
0.0815713
0.138465
0.0603647
0.10403
0.0655878
0.0547298
0.136799
0.13887
0.134743
0.0981403
0.0822824
0.0918623
0.0548283
0.13326
0.0539453
0.0723204
0.0670418
0.138179
0.082163
0.113632
0.110861
0.0691175
0.0056771
0.0448766
0.0705955
0.0915703
0.125011
0.112416
0.0334943
0.0666917
0.0540737
0.0704681
0.0162336
0.0129656
0.0348387
0.12575
0.0629592
0.0575728
0.0536565
0.0430323
0.137512
0.0444549
0.11698
0.0805988
0.145787
0.14114
0.10318
0.0536204
0.0964738
0.148869
0.138414
0.0591372
0.0421765
0.0464278
0.0656812
0.139637
0.0939126
0.107836
0.0586007
0.0645197
0.0480332
0.074079
0.063984
0.0490403
0.120479
0.139852
0.0331978
0.134562
0.0971695
0.137426
0.138752
0.0881208
0.0334813
0.102514
0.0632814
0.0973391
0.102962
0.047271
0.0755931
0.0828925
0.0926233
0.094574
0.11352
0.0266175
0.131076
0.227299
0.139039
0.136928
0.13857
0.0777422
0.0339542
0.106533
0.0181213
0.044428
0.0752553
0.102843
0.139192
0.0724412
0.137979
0.0779546
0.0355858
0.0787826
0.0461541
0.072756
0.0884689
0.093825
0.0418696
0.0940166
0.0867152
0.0757578
0.0826419
0.0870984
0.0705032
0.0623752
0.071342
0.0580294
0.0788391
0.0821402
0.0810754
0.0730048
0.0577223
0.0981413
0.139679
0.114246
0.134058
0.0694667
0.0530134
0.110809
0.0815023
0.0629505
0.0270932
0.13744
0.0469419
0.0968555
0.0361012
0.128623
0.137719
0.137062
0.0352766
0.129827
0.138455
0.076483
0.140131
0.0743336
0.0852046
0.0515597
0.0879906
0.0872675
0.101379
0.13081
0.088599
0.0904448
0.0740556
0.0598454
0.139279
0.0652235
0.0880677
0.0688243
0.0860456
0.037274
0.0703612
0.140076
0.136928
0.139643
0.0540492
0.0687445
0.0183984
0.138697
0.0660123
0.13979
0.0712862
0.178704
0.115153
0.0648954
0.10252
0.100266
0.12301
0.0834512
0.0603441
0.0638125
0.037947
0.0835038
0.138689
0.0581273
0.139927
0.139985
0.0824711
0.0448223
0.0792906
0.0864155
0.0628945
0.140137
0.070362
0.0475936
0.140016
0.0193903
0.0487884
0.138304
0.0360974
0.0341931
0.092223
0.138699
0.126818
0.135204
0.128959
0.0411408
0.159473
0.140182
0.103443
0.0887777
0.10098
0.0983791
0.130145
0.069031
0.070298
0.0590488
0.11143
0.131831
0.0355736
0.0962307
0.0953737
0.0885841
0.058807
0.129211
0.13985
0.102017
0.0871318
0.132598
0.133932
0.0494314
0.0602984
0.140142
0.0997364
0.0856894
0.0388349
0.141419
0.0765882
0.0563348
0.132966
0.0876048
0.138651
0.176571
0.137528
0.136098
0.0648202
0.00916614
0.0314635
0.0762818
0.0793937
0.0756234
0.138843
0.119943
0.135394
0.0877448
0.102984
0.0356977
0.0843548
0.116257
0.075903
0.136963
0.0578424
0.234166
0.0652115
0.0281268
0.0784254
0.0440284
0.0372794
0.139695
0.0862348
0.103171
0.00897428
0.0484353
0.00440518
0.0743425
0.0355425
0.101662
0.138747
0.0851994
0.12285
0.136791
0.0789334
0.177592
0.0792443
0.135181
0.137761
0.0930765
0.136545
0.046914
0.00726803
0.0154822
0.233555
0.0740843
0.072596
0.0100555
0.108978
0.10426
0.0482822
0.128143
0.0782034
0.076598
0.0908742
0.0800574
0.134889
0.151672
0.0807182
0.0736232
0.0692415
0.177449
0.138515
0.0577082
0.0726577
0.0796989
0.0807092
0.0694791
0.0720626
0.198374
0.0428033
0.0885628
0.0766916
0.056569
0.0797638
0.139486
0.104953
0.110979
0.0598579
0.139694
0.0767408
0.137913
0.140042
0.0807098
0.0151225
0.135189
0.135898
0.0713508
0.080641
0.0672822
0.140013
0.0777019
0.13857
0.102465
0.133599
0.0771633
0.105927
0.0951268
0.121511
0.0798156
0.120825
0.128625
0.0623633
0.0806489
0.137701
0.067205
0.0880935
0.253333
0.0477473
0.135249
0.0272966
0.0866688
0.0948287
0.0864434
0.0666538
0.0669213
0.0422574
0.0912504
0.106821
0.045703
0.0762381
0.0553084
0.126734
0.100581
0.139142
0.134676
0.00585306
0.138978
0.0260574
0.0880287
0.138742
0.0804682
0.122494
0.0570085
0.148821
0.0668953
0.135121
0.0692838
0.074998
0.111112
0.0628081
0.0115192
0.0908201
0.139879
0.0683937
0.157736
0.0693002
0.103667
0.0684832
0.377769
0.139157
0.064656
0.0282511
0.0911193
0.139955
0.0626937
0.0841773
0.0811436
0.107674
0.126984
0.100956
0.0932771
0.132321
0.0938243
0.0846744
0.138108
0.220781
0.117765
0.083744
0.139375
0.126618
0.0941669
0.138807
0.0917712
0.072442
0.108079
0.0943624
0.0640732
0.0537708
0.0863442
0.0863624
0.116971
0.130195
0.0649373
0.0172137
0.109157
0.0361351
0.0757426
0.138943
0.137665
0.111886
0.140187
0.0596537
0.134858
0.0836308
0.0260289
0.064328
0.076287
0.0657679
0.0850608
0.068893
0.0583579
0.101819
0.0809106
0.138572
0.14017
0.048193
0.0813544
0.075382
0.139969
0.140194
0.0884221
0.102144
0.0801153
0.138366
0.0572034
0.140126
0.137526
0.135314
0.138143
0.0854977
0.138155
0.0571833
0.00784081
0.0916482
0.0838148
0.135768
0.134302
0.138908
0.0646002
0.135889
0.13127
0.0326065
0.0385364
0.257919
0.0638372
0.144997
0.0664239
0.0850124
0.0686998
0.138079
0.0874488
0.0158737
0.11911
0.0302413
0.132101
0.0737382
0.0750354
0.0615216
0.22909
0.132259
0.0904541
0.134723
0.0721243
0.0736723
0.0642857
0.138538
0.0412967
0.106746
0.116673
0.135438
0.369785
0.0448442
0.0828076
0.139343
0.112628
0.143114
0.0799047
0.139851
0.077982
0.11351
0.0309081
0.119838
0.140907
0.0982443
0.123309
0.0982331
0.0718391
0.109565
0.0666754
0.175398
0.137983
0.0173508
0.0611571
0.118268
0.0643189
0.0182895
0.0679463
0.140002
0.00794695
0.0468963
0.0808812
0.0865592
0.0748281
0.0959813
0.0799562
0.139269
0.139787
0.136594
0.0881524
0.135479
0.0662957
0.137447
0.136192
0.0627281
0.0537556
0.373459
0.035194
0.0556442
0.0822622
0.0788106
0.0792845
0.140913
0.13795
0.132857
0.0638744
0.134299
0.0821974
0.013373
0.029475
0.0897489
0.0271853
0.0167363
0.0798768
0.0697644
0.133439
0.0637607
0.0585368
0.0795228
0.0433873
0.0266211
0.0929929
0.0805144
0.0610507
0.0713342
0.131129
0.0582816
0.0913667
0.09368
0.0503228
0.0739465
0.0568506
0.133934
0.0749059
0.094732
0.0660703
0.0704423
0.0933592
0.0693535
0.0829248
0.140171
0.141356
0.0874575
0.124734
0.153865
0.0669969
0.139992
0.0706878
0.0454645
0.0769031
0.0794738
0.0955856
0.135147
0.0577283
0.140045
0.139809
0.0892893
0.19329
0.0404424
0.0857121
0.138319
0.0515073
0.031177
0.0752
0.0624722
0.0295628
0.0663891
0.0351986
0.0991405
0.10294
0.103694
0.139589
0.237213
0.127111
0.127934
0.0410223
0.0329852
0.0860083
0.0640271
0.102038
0.0721635
0.14017
0.0605439
0.0558256
0.0569794
0.058863
0.0602185
0.0679335
0.0756091
0.140187
0.0154668
0.062549
0.0650447
0.100079
0.138674
0.103331
0.123079
0.138461
0.0621099
0.0854826
0.0832886
0.125451
0.0249448
0.138679
0.133365
0.0368115
0.0975914
0.113901
0.0855462
0.0634873
0.185702
0.099365
0.0740838
0.11758
0.116791
0.126356
0.109735
0.11616
0.0524222
0.0530117
0.137983
0.031499
0.125808
0.135028
0.126122
0.136863
0.0843107
0.108623
0.0787584
0.0448073
0.0837771
0.113966
0.117282
0.259837
0.0323693
0.138611
0.0546156
0.138753
0.105947
0.139252
0.129135
0.0962196
0.0264573
0.101933
0.0757234
0.0803156
0.0675272
0.0312227
0.0389245
0.0316759
0.0824857
0.0718712
0.139794
0.102187
0.13623
0.140744
0.0652717
0.138236
0.108845
0.0998552
0.0576646
0.0452
0.125086
0.138009
0.0803802
0.0407517
0.138796
0.0801647
0.0737135
0.0761089
0.0800841
0.405594
0.0838198
0.129606
0.133832
0.0405894
0.115354
0.0936252
0.07471
0.108331
0.0578897
0.13857
0.109661
0.139639
0.0579551
0.037836
0.138698
0.0475878
0.03892
0.0609343
0.0843855
0.0745538
0.0913632
0.0364518
0.00394307
0.140207
0.00992269
0.0742027
0.0918561
0.0608736
0.061651
0.0998524
0.0437292
0.0817073
0.0873055
0.0711522
0.0933006
0.0672891
0.0833014
0.139553
0.0707489
0.0847286
0.125429
0.13733
0.0835277
0.135616
0.0420705
0.0850968
0.100892
0.0747551
0.136131
0.0899259
0.0436344
0.0679363
0.138588
0.0697965
0.126358
0.0764558
0.0455635
0.0756622
0.0684658
0.155527
0.0607378
0.0530818
0.134014
0.125138
0.135696
0.0402732
0.17375
0.137874
0.110534
0.0355833
0.014333
0.111329
0.0967036
0.139726
0.0915802
0.0887965
0.104509
0.13935
0.0810114
0.139727
0.136563
0.14261
0.092439
0.137005
0.00845763
0.129266
0.108069
0.0702123
0.110285
0.0808846
0.0772162
0.0970868
0.0799294
0.137878
0.128248
0.097683
0.0700532
0.179563
0.046101
0.087812
0.0661514
0.0303571
0.0812495
0.0450531
0.138296
0.0812708
0.137401
0.136701
0.0795393
0.147334
0.111646
0.14961
0.0628074
0.075648
0.0697744
0.142083
0.132757
0.0743306
0.0774923
0.0471025
0.157957
0.142931
0.10306
0.115682
0.0836679
0.0624453
0.0324592
0.129124
0.159583
0.0843177
0.0473138
0.0884542
0.139443
0.072412
0.108522
0.318109
0.10863
0.119199
0.061586
0.0500541
0.12415
0.109802
0.0758984
0.136764
0.125727
0.0756626
0.117216
0.118739
0.061029
0.140082
0.0494559
0.0478066
0.0216286
0.199453
0.0657916
0.13859
0.0896349
0.0932741
0.150614
0.0834296
0.135524
0.137344
0.0596274
0.140645
0.0743727
0.085069
0.132855
0.0819815
0.0880528
0.0504091
0.120059
0.152188
0.029465
0.101871
0.0740491
0.0902574
0.0983673
0.0740347
0.0956326
0.11823
0.0711196
0.114342
0.052478
0.138544
0.0550215
0.0465994
0.0159545
0.164678
0.129762
0.140369
0.0769615
0.0763164
0.0879771
0.167221
0.110293
0.158522
0.139945
0.0829395
0.0299958
0.0629814
0.00611327
0.0374806
0.0510279
0.0516659
0.13911
0.136019
0.0568368
0.031908
0.0640648
0.139547
0.107366
0.135678
0.0478833
0.0183889
0.103174
0.0746389
0.075253
0.135426
0.129069
0.111507
0.0787334
0.0336106
0.136031
0.0829737
0.0900665
0.0587574
0.0593221
0.1014
0.0594248
0.0689072
0.0765979
0.0708522
0.0687611
0.0860526
0.0127099
0.116124
0.12005
0.139007
0.056877
0.105748
0.0834447
0.0924254
0.0629396
0.0894834
0.138458
0.0621179
0.0780182
0.011572
0.0228327
0.0875232
0.0958086
0.156629
0.138723
0.0941182
0.0881217
0.067252
0.120043
0.0534279
0.1182
0.0681377
0.105652
0.138234
0.125657
0.125003
0.0692974
0.0870089
0.103114
0.0332851
0.111324
0.0871883
0.0856134
0.134015
0.108278
0.0868704
0.115996
0.0631621
0.113249
0.139875
0.0417944
0.139705
0.11092
0.0890123
0.0808375
0.093276
0.09308
0.138824
0.0266981
0.0686777
0.0792245
0.0608701
0.140148
0.12733
0.0565612
0.0823161
0.0339898
0.031465
0.0732561
0.108068
0.106458
0.139596
0.0503752
0.0720977
0.0767516
0.139704
0.138831
0.133414
0.127353
0.0867769
0.070518
0.0964137
0.126243
0.135498
0.113291
0.0959837
0.0736188
0.0729596
0.128597
0.0191489
0.0523732
0.110488
0.137926
0.0691503
0.0780748
0.138921
0.138225
0.0403387
0.0101905
0.0829296
0.122605
0.108952
0.0347546
0.109566
0.138613
0.0794538
0.146048
0.0815916
0.0888257
0.102756
0.0740665
0.096471
0.196864
0.0349643
0.140047
0.139489
0.140059
0.0615575
0.128316
0.0853825
0.0510954
0.138719
0.113745
0.0785102
0.0960204
0.0958715
0.00686078
0.0896493
0.0679518
0.0879874
0.0778053
0.0847328
0.0722777
0.0726723
0.104751
0.138007
0.0805727
0.0706657
0.0412506
0.0789393
0.0788364
0.0917143
0.0658412
0.11123
0.0965072
0.11194
0.0711432
0.135433
0.0262182
0.0803046
0.0876307
0.0393063
0.0758565
0.0812836
0.0664905
0.0951105
0.138905
0.139241
0.065055
0.104593
0.0741109
0.0874395
0.0940724
0.0732036
0.111044
0.0818472
0.0873838
0.0990396
0.0824182
0.111306
0.114673
0.113614
0.1563
0.0779784
0.0665674
0.13924
0.136612
0.102421
0.138968
0.0707186
0.0791658
0.114898
0.0308216
0.137806
0.139738
0.0322938
0.120603
0.118551
0.0499183
0.139421
0.139989
0.0429215
0.098035
0.0628826
0.134622
0.0520133
0.111478
0.139634
0.0878758
0.128765
0.117267
)
;
boundaryField
{
wings
{
type fixedValue;
value uniform 0;
}
outlet
{
type freestream;
freestreamValue uniform 0.14;
value nonuniform List<scalar>
20
(
0.13805
0.125583
0.136618
0.157882
0.138173
0.137223
0.11371
0.295406
0.110257
0.12947
0.138219
0.133807
0.183818
0.453837
0.143484
0.363798
0.136963
0.137526
0.257919
0.373459
)
;
}
tunnel
{
type fixedValue;
value uniform 0;
}
inlet
{
type freestream;
freestreamValue uniform 0.14;
value uniform 0.14;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //
|
|
ab0c904c438380e2ec0180bf6fa664f89bad9d83
|
b1cd7e1bebabf7c11d5786d35a944906a12c30f4
|
/include/ShmConstants.h
|
fad23ef0e98a6ee0dd562603dde6706fa9b95c44
|
[
"MIT"
] |
permissive
|
b51/ShmNode
|
c7694e202d34ea8cde415cde91595d00098f81d7
|
dea0401eca332cbc3a0897d3c85a4c95a6313c20
|
refs/heads/master
| 2020-04-09T03:11:51.968214
| 2018-12-01T18:35:33
| 2018-12-01T18:35:33
| 159,973,245
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,699
|
h
|
ShmConstants.h
|
/*************************************************************************
*
* Author: b51
* Mail: b51live@gmail.com
* FileName: ShmConstants.h
*
* Created On: Fri 14 Sep 2018 08:31:56 PM CST
* Licensed under The MIT License [see LICENSE for details]
*
************************************************************************/
#ifndef SHM_CONSTANTS_H_
#define SHM_CONSTANTS_H_
#include <map>
#include <utility>
static const char visionShmName[] = "vcm";
static const char worldShmName[] = "wcm";
static const char gctrlShmName[] = "gcm";
static const char* Detection[] =
{
"Detected",
"Position/X/Value",
"Position/Y/Value",
"Position/Z/Value",
"BoundingBox/X/Value",
"BoundingBox/Y/Value",
"BoundingBox/Width/Value",
"BoundingBox/Height/Value",
};
static const char* Pose2d[] =
{
"Pose/X/Value",
"Pose/Y/Value",
"Pose/Angle/Value"
};
static const char* TimedPosition3d[] =
{
"Time/Value",
"Position/X/Value",
"Position/Y/Value",
"Position/Z/Value"
};
/*
static struct structWorldKeys
{
const char* key;
unsigned int size;
const char **names;
} world_keys[] =
{
{"time", 1, nullptr},
{"position", sizeof(Pose)/sizeof(char*), Pose},
{nullptr, 0, nullptr}
};
*/
struct structKeyValue
{
unsigned int size;
const char** names;
};
///////////////////////////////////////////////////////////////////////
typedef std::map<const char*, structKeyValue> mapKeyValue;
static const char ball_detection_key[] = "ballDetection";
static const char goal_detection_key[] = "goalDetection";
static const char spot_detection_key[] = "spotDetection";
static const char teammate_detection_key[] = "spotDetection";
static const char opponent_detection_key[] = "spotDetection";
static mapKeyValue vision_keys =
{
{"timestamp", {1, nullptr}},
{ball_detection_key, {sizeof(Detection)/sizeof(char*), Detection}},
{goal_detection_key, {sizeof(Detection)/sizeof(char*), Detection}},
{spot_detection_key, {sizeof(Detection)/sizeof(char*), Detection}},
{teammate_detection_key, {sizeof(Detection)/sizeof(char*), Detection}},
{opponent_detection_key, {sizeof(Detection)/sizeof(char*), Detection}},
};
///////////////////////////////////////////////////////////////////////
static const char pose_key[] = "pose";
static const char ball_global_key[] = "ballGlobal";
static const char goal_global_key[] = "goalGlobal";
static mapKeyValue world_keys =
{
{"timestamp", {1, nullptr}},
{pose_key, {sizeof(Pose2d)/sizeof(char*), Pose2d}},
{ball_global_key, {sizeof(TimedPosition3d)/sizeof(char*), TimedPosition3d}},
{goal_global_key, {sizeof(TimedPosition3d)/sizeof(char*), TimedPosition3d}},
};
#endif
|
c294c17d09fce026ee008d2261c543700176a846
|
7d4200ffe5a19ac24cea00ee272a7ada0d95fac6
|
/model/directoryNode.h
|
7dfbd99e4e5924ed076df634cea59b8c46548540
|
[
"Apache-2.0"
] |
permissive
|
micheleantonazzi/progettoProgrammazioneAdOggetti
|
6d74fce40a768ea8c838a57100d7c85361e98285
|
6a28730a217bd7fac5291745ca34374a32fb27b2
|
refs/heads/master
| 2020-03-13T20:03:26.613759
| 2018-04-27T08:16:50
| 2018-04-27T08:16:50
| 131,264,694
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,495
|
h
|
directoryNode.h
|
//
// Created by michele on 27/02/17.
//
#ifndef CLOUD_2_0_DIRECTORYNODE_H
#define CLOUD_2_0_DIRECTORYNODE_H
#include "fileSystemNode.h"
#include <iostream>
#include <list>
#include "feedback.h"
using std::list;
class directoryNode : public virtual fileSystemNode{
private:
list<fileSystemNode*> subNodes;
static void copy(const list<fileSystemNode*>&, fileSystemNode *parent);
static bool comparePointer (fileSystemNode*, fileSystemNode*);// usata per ordinare i nodi all'interno di una cartella
void drop();
public:
directoryNode(const string& = "directory unknown");
directoryNode(const directoryNode&);
directoryNode& operator= (const directoryNode&);
list<fileSystemNode*> openDirectory() const;
std::pair<int, int> countNodes() const; //indica quante sottocartelle e file sono contenuti in questa directory
virtual directoryNode* clone(fileSystemNode* = 0) const;
virtual byteSize getSize() const;
virtual string getInformation() const;
virtual string getType() const;
int addNode(fileSystemNode*); //solleva eccezione se il puntatore è nullo, se il puntatore è uguale alla cartella stessa e se il nodo è gia presente
int removeNode(fileSystemNode*);//solleva eccezione se la cartella è vuota o se il file non è presente
bool exist(fileSystemNode*) const;
bool existName(const string&) const;
virtual bool contains(fileSystemNode *) const;
virtual ~directoryNode();
};
#endif //CLOUD_2_0_DIRECTORYNODE_H
|
d6b80816a9394462065d2799a8a10511fc1b5f98
|
363590c82e8ede64b64e213eac540f21c09e1cbf
|
/AStart/asnode.h
|
77cd76191213789a207b0c2e4219f1613a49a73f
|
[] |
no_license
|
zlbruce/nrciz
|
73d6b3ac298f4e7fa922890c4c78b4c6ee16493b
|
af8343d57f806dd46ea12cb0d763767d6e4a8ee3
|
refs/heads/master
| 2021-01-19T07:56:38.128938
| 2012-10-10T09:43:52
| 2012-10-10T09:43:52
| 33,296,537
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,289
|
h
|
asnode.h
|
/*
*
* Portions Copyright (C) 2009 wind (xihels@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _ASNODE_H_
#define _ASNODE_H_
#include <stdio.h>
#include <set>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;
struct Index {
Index(int x_, int y_): x(x_), y(y_){}
bool operator == (const Index& other) const { return x == other.x && y == other.y; }
int x;
int y;
};
struct hash_index {
size_t operator() (const Index& o) const { return (o.x << 16 | o.y); }
};
struct ASNode {
ASNode() : parent(0), x(0), y(0), f(0), g(0), h(0) {}
ASNode(int _x, int _y) : parent(0), x(_x), y(_y), f(0), g(0), h(0) {}
//TOpenList::iterator iter;
ASNode* parent;
int x;
int y;
int f;
int g;
int h;
};
struct ASNodeFComp : binary_function <const ASNode*, const ASNode*, bool> {
bool operator () (const ASNode* p1, const ASNode* p2) const { return p1->f < p2->f;}
};
typedef multiset<ASNode*, ASNodeFComp> TOpenList;
typedef unordered_map<Index, ASNode*, hash_index> TCloseIndex;
typedef unordered_map<Index, TOpenList::iterator, hash_index> TOpenIndex;
class ASFinder {
public:
~ASFinder();
typedef bool (*TCHECKMAPFUN)(int x, int y);
ASNode* find(int x1, int y1, int x2, int y2, TCHECKMAPFUN fun);
protected:
int def_as_func(int x1, int y1, int x2, int y2) { return abs( x2 - x1 ) * 8 + abs( y2 - y1 ) * 16; }
bool check_child(int x, int y, int f, ASNode* parent);
private:
TCHECKMAPFUN check_map_fun;
TOpenList open_list;
TOpenIndex open_index;
TCloseIndex closed_index;
int end_x;
int end_y;
};
#endif // _ASNODE_H_
|
a82b0479d3cb4f6ccba42efe34ab402182089606
|
4fa415885f76e3091b291b741393c49999dff6d0
|
/hexen/p_user.c
|
9f4e285c964846c41ab616c3414aca9367617f54
|
[] |
no_license
|
mheyer32/chocolate-heretic
|
ce840479e4bd1626997c6b5eba4a496dda4bbf11
|
21f01fe3de1f9b569f06a348ad3ad5f6b67f2043
|
refs/heads/master
| 2022-12-18T09:11:01.786226
| 2020-09-28T06:04:18
| 2020-09-28T06:08:07
| 299,207,020
| 1
| 0
| null | 2020-09-28T06:13:37
| 2020-09-28T06:13:37
| null |
UTF-8
|
C++
| false
| false
| 46,869
|
c
|
p_user.c
|
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 1993-2008 Raven Software
// Copyright(C) 2008 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
//-----------------------------------------------------------------------------
#include "h2def.h"
#include "m_random.h"
#include "i_system.h"
#include "p_local.h"
#include "s_sound.h"
void P_PlayerNextArtifact(player_t * player);
// Macros
#define MAXBOB 0x100000 // 16 pixels of bob
// Data
boolean onground;
int newtorch; // used in the torch flicker effect.
int newtorchdelta;
int PStateNormal[NUMCLASSES] = {
S_FPLAY,
S_CPLAY,
S_MPLAY,
S_PIGPLAY
};
int PStateRun[NUMCLASSES] = {
S_FPLAY_RUN1,
S_CPLAY_RUN1,
S_MPLAY_RUN1,
S_PIGPLAY_RUN1
};
int PStateAttack[NUMCLASSES] = {
S_FPLAY_ATK1,
S_CPLAY_ATK1,
S_MPLAY_ATK1,
S_PIGPLAY_ATK1
};
int PStateAttackEnd[NUMCLASSES] = {
S_FPLAY_ATK2,
S_CPLAY_ATK3,
S_MPLAY_ATK2,
S_PIGPLAY_ATK1
};
int ArmorMax[NUMCLASSES] = { 20, 18, 16, 1 };
/*
==================
=
= P_Thrust
=
= moves the given origin along a given angle
=
==================
*/
void P_Thrust(player_t * player, angle_t angle, fixed_t move)
{
angle >>= ANGLETOFINESHIFT;
if (player->powers[pw_flight] && !(player->mo->z <= player->mo->floorz))
{
player->mo->momx += FixedMul(move, finecosine[angle]);
player->mo->momy += FixedMul(move, finesine[angle]);
}
else if (P_GetThingFloorType(player->mo) == FLOOR_ICE) // Friction_Low
{
player->mo->momx += FixedMul(move >> 1, finecosine[angle]);
player->mo->momy += FixedMul(move >> 1, finesine[angle]);
}
else
{
player->mo->momx += FixedMul(move, finecosine[angle]);
player->mo->momy += FixedMul(move, finesine[angle]);
}
}
/*
==================
=
= P_CalcHeight
=
=Calculate the walking / running height adjustment
=
==================
*/
void P_CalcHeight(player_t * player)
{
int angle;
fixed_t bob;
//
// regular movement bobbing (needs to be calculated for gun swing even
// if not on ground)
// OPTIMIZE: tablify angle
player->bob = FixedMul(player->mo->momx, player->mo->momx) +
FixedMul(player->mo->momy, player->mo->momy);
player->bob >>= 2;
if (player->bob > MAXBOB)
player->bob = MAXBOB;
if (player->mo->flags2 & MF2_FLY && !onground)
{
player->bob = FRACUNIT / 2;
}
if ((player->cheats & CF_NOMOMENTUM))
{
player->viewz = player->mo->z + VIEWHEIGHT;
if (player->viewz > player->mo->ceilingz - 4 * FRACUNIT)
player->viewz = player->mo->ceilingz - 4 * FRACUNIT;
player->viewz = player->mo->z + player->viewheight;
return;
}
angle = (FINEANGLES / 20 * leveltime) & FINEMASK;
bob = FixedMul(player->bob / 2, finesine[angle]);
//
// move viewheight
//
if (player->playerstate == PST_LIVE)
{
player->viewheight += player->deltaviewheight;
if (player->viewheight > VIEWHEIGHT)
{
player->viewheight = VIEWHEIGHT;
player->deltaviewheight = 0;
}
if (player->viewheight < VIEWHEIGHT / 2)
{
player->viewheight = VIEWHEIGHT / 2;
if (player->deltaviewheight <= 0)
player->deltaviewheight = 1;
}
if (player->deltaviewheight)
{
player->deltaviewheight += FRACUNIT / 4;
if (!player->deltaviewheight)
player->deltaviewheight = 1;
}
}
if (player->morphTics)
{
player->viewz = player->mo->z + player->viewheight - (20 * FRACUNIT);
}
else
{
player->viewz = player->mo->z + player->viewheight + bob;
}
if (player->mo->floorclip && player->playerstate != PST_DEAD
&& player->mo->z <= player->mo->floorz)
{
player->viewz -= player->mo->floorclip;
}
if (player->viewz > player->mo->ceilingz - 4 * FRACUNIT)
{
player->viewz = player->mo->ceilingz - 4 * FRACUNIT;
}
if (player->viewz < player->mo->floorz + 4 * FRACUNIT)
{
player->viewz = player->mo->floorz + 4 * FRACUNIT;
}
}
/*
=================
=
= P_MovePlayer
=
=================
*/
void P_MovePlayer(player_t * player)
{
int look;
int fly;
ticcmd_t *cmd;
cmd = &player->cmd;
player->mo->angle += (cmd->angleturn << 16);
onground = (player->mo->z <= player->mo->floorz
|| (player->mo->flags2 & MF2_ONMOBJ));
if (cmd->forwardmove)
{
if (onground || player->mo->flags2 & MF2_FLY)
{
P_Thrust(player, player->mo->angle, cmd->forwardmove * 2048);
}
else
{
P_Thrust(player, player->mo->angle, FRACUNIT >> 8);
}
}
if (cmd->sidemove)
{
if (onground || player->mo->flags2 & MF2_FLY)
{
P_Thrust(player, player->mo->angle - ANG90, cmd->sidemove * 2048);
}
else
{
P_Thrust(player, player->mo->angle, FRACUNIT >> 8);
}
}
if (cmd->forwardmove || cmd->sidemove)
{
if (player->mo->state == &states[PStateNormal[player->class]])
{
P_SetMobjState(player->mo, PStateRun[player->class]);
}
}
look = cmd->lookfly & 15;
if (look > 7)
{
look -= 16;
}
if (look)
{
if (look == TOCENTER)
{
player->centering = true;
}
else
{
player->lookdir += 5 * look;
if (player->lookdir > 90 || player->lookdir < -110)
{
player->lookdir -= 5 * look;
}
}
}
if (player->centering)
{
if (player->lookdir > 0)
{
player->lookdir -= 8;
}
else if (player->lookdir < 0)
{
player->lookdir += 8;
}
if (abs(player->lookdir) < 8)
{
player->lookdir = 0;
player->centering = false;
}
}
fly = cmd->lookfly >> 4;
if (fly > 7)
{
fly -= 16;
}
if (fly && player->powers[pw_flight])
{
if (fly != TOCENTER)
{
player->flyheight = fly * 2;
if (!(player->mo->flags2 & MF2_FLY))
{
player->mo->flags2 |= MF2_FLY;
player->mo->flags |= MF_NOGRAVITY;
if (player->mo->momz <= -39 * FRACUNIT)
{ // stop falling scream
S_StopSound(player->mo);
}
}
}
else
{
player->mo->flags2 &= ~MF2_FLY;
player->mo->flags &= ~MF_NOGRAVITY;
}
}
else if (fly > 0)
{
P_PlayerUseArtifact(player, arti_fly);
}
if (player->mo->flags2 & MF2_FLY)
{
player->mo->momz = player->flyheight * FRACUNIT;
if (player->flyheight)
{
player->flyheight /= 2;
}
}
}
//==========================================================================
//
// P_DeathThink
//
//==========================================================================
void P_DeathThink(player_t * player)
{
int dir;
angle_t delta;
int lookDelta;
extern int inv_ptr;
extern int curpos;
P_MovePsprites(player);
onground = (player->mo->z <= player->mo->floorz);
if (player->mo->type == MT_BLOODYSKULL || player->mo->type == MT_ICECHUNK)
{ // Flying bloody skull or flying ice chunk
player->viewheight = 6 * FRACUNIT;
player->deltaviewheight = 0;
//player->damagecount = 20;
if (onground)
{
if (player->lookdir < 60)
{
lookDelta = (60 - player->lookdir) / 8;
if (lookDelta < 1 && (leveltime & 1))
{
lookDelta = 1;
}
else if (lookDelta > 6)
{
lookDelta = 6;
}
player->lookdir += lookDelta;
}
}
}
else if (!(player->mo->flags2 & MF2_ICEDAMAGE))
{ // Fall to ground (if not frozen)
player->deltaviewheight = 0;
if (player->viewheight > 6 * FRACUNIT)
{
player->viewheight -= FRACUNIT;
}
if (player->viewheight < 6 * FRACUNIT)
{
player->viewheight = 6 * FRACUNIT;
}
if (player->lookdir > 0)
{
player->lookdir -= 6;
}
else if (player->lookdir < 0)
{
player->lookdir += 6;
}
if (abs(player->lookdir) < 6)
{
player->lookdir = 0;
}
}
P_CalcHeight(player);
if (player->attacker && player->attacker != player->mo)
{ // Watch killer
dir = P_FaceMobj(player->mo, player->attacker, &delta);
if (delta < ANG1 * 10)
{ // Looking at killer, so fade damage and poison counters
if (player->damagecount)
{
player->damagecount--;
}
if (player->poisoncount)
{
player->poisoncount--;
}
}
delta = delta / 8;
if (delta > ANG1 * 5)
{
delta = ANG1 * 5;
}
if (dir)
{ // Turn clockwise
player->mo->angle += delta;
}
else
{ // Turn counter clockwise
player->mo->angle -= delta;
}
}
else if (player->damagecount || player->poisoncount)
{
if (player->damagecount)
{
player->damagecount--;
}
else
{
player->poisoncount--;
}
}
if (player->cmd.buttons & BT_USE)
{
if (player == &players[consoleplayer])
{
I_SetPalette((byte *) W_CacheLumpName("PLAYPAL", PU_CACHE));
inv_ptr = 0;
curpos = 0;
newtorch = 0;
newtorchdelta = 0;
}
player->playerstate = PST_REBORN;
player->mo->special1 = player->class;
if (player->mo->special1 > 2)
{
player->mo->special1 = 0;
}
// Let the mobj know the player has entered the reborn state. Some
// mobjs need to know when it's ok to remove themselves.
player->mo->special2 = 666;
}
}
//----------------------------------------------------------------------------
//
// PROC P_MorphPlayerThink
//
//----------------------------------------------------------------------------
void P_MorphPlayerThink(player_t * player)
{
mobj_t *pmo;
if (player->morphTics & 15)
{
return;
}
pmo = player->mo;
if (!(pmo->momx + pmo->momy) && P_Random() < 64)
{ // Snout sniff
P_SetPspriteNF(player, ps_weapon, S_SNOUTATK2);
S_StartSound(pmo, SFX_PIG_ACTIVE1); // snort
return;
}
if (P_Random() < 48)
{
if (P_Random() < 128)
{
S_StartSound(pmo, SFX_PIG_ACTIVE1);
}
else
{
S_StartSound(pmo, SFX_PIG_ACTIVE2);
}
}
}
//----------------------------------------------------------------------------
//
// FUNC P_GetPlayerNum
//
//----------------------------------------------------------------------------
int P_GetPlayerNum(player_t * player)
{
int i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (player == &players[i])
{
return (i);
}
}
return (0);
}
//----------------------------------------------------------------------------
//
// FUNC P_UndoPlayerMorph
//
//----------------------------------------------------------------------------
boolean P_UndoPlayerMorph(player_t * player)
{
mobj_t *fog;
mobj_t *mo;
mobj_t *pmo;
fixed_t x;
fixed_t y;
fixed_t z;
angle_t angle;
int playerNum;
weapontype_t weapon;
int oldFlags;
int oldFlags2;
int oldBeast;
pmo = player->mo;
x = pmo->x;
y = pmo->y;
z = pmo->z;
angle = pmo->angle;
weapon = pmo->special1;
oldFlags = pmo->flags;
oldFlags2 = pmo->flags2;
oldBeast = pmo->type;
P_SetMobjState(pmo, S_FREETARGMOBJ);
playerNum = P_GetPlayerNum(player);
switch (PlayerClass[playerNum])
{
case PCLASS_FIGHTER:
mo = P_SpawnMobj(x, y, z, MT_PLAYER_FIGHTER);
break;
case PCLASS_CLERIC:
mo = P_SpawnMobj(x, y, z, MT_PLAYER_CLERIC);
break;
case PCLASS_MAGE:
mo = P_SpawnMobj(x, y, z, MT_PLAYER_MAGE);
break;
default:
I_Error("P_UndoPlayerMorph: Unknown player class %d\n",
player->class);
return false;
}
if (P_TestMobjLocation(mo) == false)
{ // Didn't fit
P_RemoveMobj(mo);
mo = P_SpawnMobj(x, y, z, oldBeast);
mo->angle = angle;
mo->health = player->health;
mo->special1 = weapon;
mo->player = player;
mo->flags = oldFlags;
mo->flags2 = oldFlags2;
player->mo = mo;
player->morphTics = 2 * 35;
return (false);
}
if (player->class == PCLASS_FIGHTER)
{
// The first type should be blue, and the third should be the
// Fighter's original gold color
if (playerNum == 0)
{
mo->flags |= 2 << MF_TRANSSHIFT;
}
else if (playerNum != 2)
{
mo->flags |= playerNum << MF_TRANSSHIFT;
}
}
else if (playerNum)
{ // Set color translation bits for player sprites
mo->flags |= playerNum << MF_TRANSSHIFT;
}
mo->angle = angle;
mo->player = player;
mo->reactiontime = 18;
if (oldFlags2 & MF2_FLY)
{
mo->flags2 |= MF2_FLY;
mo->flags |= MF_NOGRAVITY;
}
player->morphTics = 0;
player->health = mo->health = MAXHEALTH;
player->mo = mo;
player->class = PlayerClass[playerNum];
angle >>= ANGLETOFINESHIFT;
fog = P_SpawnMobj(x + 20 * finecosine[angle],
y + 20 * finesine[angle], z + TELEFOGHEIGHT, MT_TFOG);
S_StartSound(fog, SFX_TELEPORT);
P_PostMorphWeapon(player, weapon);
return (true);
}
//----------------------------------------------------------------------------
//
// PROC P_PlayerThink
//
//----------------------------------------------------------------------------
void P_PlayerThink(player_t * player)
{
ticcmd_t *cmd;
weapontype_t newweapon;
int floorType;
mobj_t *pmo;
// No-clip cheat
if (player->cheats & CF_NOCLIP)
{
player->mo->flags |= MF_NOCLIP;
}
else
{
player->mo->flags &= ~MF_NOCLIP;
}
cmd = &player->cmd;
if (player->mo->flags & MF_JUSTATTACKED)
{ // Gauntlets attack auto forward motion
cmd->angleturn = 0;
cmd->forwardmove = 0xc800 / 512;
cmd->sidemove = 0;
player->mo->flags &= ~MF_JUSTATTACKED;
}
// messageTics is above the rest of the counters so that messages will
// go away, even in death.
player->messageTics--; // Can go negative
if (!player->messageTics || player->messageTics == -1)
{ // Refresh the screen when a message goes away
player->ultimateMessage = false; // clear out any chat messages.
player->yellowMessage = false;
if (player == &players[consoleplayer])
{
BorderTopRefresh = true;
}
}
player->worldTimer++;
if (player->playerstate == PST_DEAD)
{
P_DeathThink(player);
return;
}
if (player->jumpTics)
{
player->jumpTics--;
}
if (player->morphTics)
{
P_MorphPlayerThink(player);
}
// Handle movement
if (player->mo->reactiontime)
{ // Player is frozen
player->mo->reactiontime--;
}
else
{
P_MovePlayer(player);
pmo = player->mo;
if (player->powers[pw_speed] && !(leveltime & 1)
&& P_AproxDistance(pmo->momx, pmo->momy) > 12 * FRACUNIT)
{
mobj_t *speedMo;
int playerNum;
speedMo = P_SpawnMobj(pmo->x, pmo->y, pmo->z, MT_PLAYER_SPEED);
if (speedMo)
{
speedMo->angle = pmo->angle;
playerNum = P_GetPlayerNum(player);
if (player->class == PCLASS_FIGHTER)
{
// The first type should be blue, and the
// third should be the Fighter's original gold color
if (playerNum == 0)
{
speedMo->flags |= 2 << MF_TRANSSHIFT;
}
else if (playerNum != 2)
{
speedMo->flags |= playerNum << MF_TRANSSHIFT;
}
}
else if (playerNum)
{ // Set color translation bits for player sprites
speedMo->flags |= playerNum << MF_TRANSSHIFT;
}
speedMo->target = pmo;
speedMo->special1 = player->class;
if (speedMo->special1 > 2)
{
speedMo->special1 = 0;
}
speedMo->sprite = pmo->sprite;
speedMo->floorclip = pmo->floorclip;
if (player == &players[consoleplayer])
{
speedMo->flags2 |= MF2_DONTDRAW;
}
}
}
}
P_CalcHeight(player);
if (player->mo->subsector->sector->special)
{
P_PlayerInSpecialSector(player);
}
if ((floorType = P_GetThingFloorType(player->mo)) != FLOOR_SOLID)
{
P_PlayerOnSpecialFlat(player, floorType);
}
switch (player->class)
{
case PCLASS_FIGHTER:
if (player->mo->momz <= -35 * FRACUNIT
&& player->mo->momz >= -40 * FRACUNIT && !player->morphTics
&& !S_GetSoundPlayingInfo(player->mo,
SFX_PLAYER_FIGHTER_FALLING_SCREAM))
{
S_StartSound(player->mo, SFX_PLAYER_FIGHTER_FALLING_SCREAM);
}
break;
case PCLASS_CLERIC:
if (player->mo->momz <= -35 * FRACUNIT
&& player->mo->momz >= -40 * FRACUNIT && !player->morphTics
&& !S_GetSoundPlayingInfo(player->mo,
SFX_PLAYER_CLERIC_FALLING_SCREAM))
{
S_StartSound(player->mo, SFX_PLAYER_CLERIC_FALLING_SCREAM);
}
break;
case PCLASS_MAGE:
if (player->mo->momz <= -35 * FRACUNIT
&& player->mo->momz >= -40 * FRACUNIT && !player->morphTics
&& !S_GetSoundPlayingInfo(player->mo,
SFX_PLAYER_MAGE_FALLING_SCREAM))
{
S_StartSound(player->mo, SFX_PLAYER_MAGE_FALLING_SCREAM);
}
break;
default:
break;
}
if (cmd->arti)
{ // Use an artifact
if ((cmd->arti & AFLAG_JUMP) && onground && !player->jumpTics)
{
if (player->morphTics)
{
player->mo->momz = 6 * FRACUNIT;
}
else
{
player->mo->momz = 9 * FRACUNIT;
}
player->mo->flags2 &= ~MF2_ONMOBJ;
player->jumpTics = 18;
}
else if (cmd->arti & AFLAG_SUICIDE)
{
P_DamageMobj(player->mo, NULL, NULL, 10000);
}
if (cmd->arti == NUMARTIFACTS)
{ // use one of each artifact (except puzzle artifacts)
int i;
for (i = 1; i < arti_firstpuzzitem; i++)
{
P_PlayerUseArtifact(player, i);
}
}
else
{
P_PlayerUseArtifact(player, cmd->arti & AFLAG_MASK);
}
}
// Check for weapon change
if (cmd->buttons & BT_SPECIAL)
{ // A special event has no other buttons
cmd->buttons = 0;
}
if (cmd->buttons & BT_CHANGE && !player->morphTics)
{
// The actual changing of the weapon is done when the weapon
// psprite can do it (A_WeaponReady), so it doesn't happen in
// the middle of an attack.
newweapon = (cmd->buttons & BT_WEAPONMASK) >> BT_WEAPONSHIFT;
if (player->weaponowned[newweapon]
&& newweapon != player->readyweapon)
{
player->pendingweapon = newweapon;
}
}
// Check for use
if (cmd->buttons & BT_USE)
{
if (!player->usedown)
{
P_UseLines(player);
player->usedown = true;
}
}
else
{
player->usedown = false;
}
// Morph counter
if (player->morphTics)
{
if (!--player->morphTics)
{ // Attempt to undo the pig
P_UndoPlayerMorph(player);
}
}
// Cycle psprites
P_MovePsprites(player);
// Other Counters
if (player->powers[pw_invulnerability])
{
if (player->class == PCLASS_CLERIC)
{
if (!(leveltime & 7) && player->mo->flags & MF_SHADOW
&& !(player->mo->flags2 & MF2_DONTDRAW))
{
player->mo->flags &= ~MF_SHADOW;
if (!(player->mo->flags & MF_ALTSHADOW))
{
player->mo->flags2 |= MF2_DONTDRAW | MF2_NONSHOOTABLE;
}
}
if (!(leveltime & 31))
{
if (player->mo->flags2 & MF2_DONTDRAW)
{
if (!(player->mo->flags & MF_SHADOW))
{
player->mo->flags |= MF_SHADOW | MF_ALTSHADOW;
}
else
{
player->mo->flags2 &=
~(MF2_DONTDRAW | MF2_NONSHOOTABLE);
}
}
else
{
player->mo->flags |= MF_SHADOW;
player->mo->flags &= ~MF_ALTSHADOW;
}
}
}
if (!(--player->powers[pw_invulnerability]))
{
player->mo->flags2 &= ~(MF2_INVULNERABLE | MF2_REFLECTIVE);
if (player->class == PCLASS_CLERIC)
{
player->mo->flags2 &= ~(MF2_DONTDRAW | MF2_NONSHOOTABLE);
player->mo->flags &= ~(MF_SHADOW | MF_ALTSHADOW);
}
}
}
if (player->powers[pw_minotaur])
{
player->powers[pw_minotaur]--;
}
if (player->powers[pw_infrared])
{
player->powers[pw_infrared]--;
}
if (player->powers[pw_flight] && netgame)
{
if (!--player->powers[pw_flight])
{
if (player->mo->z != player->mo->floorz)
{
// haleyjd: removed externdriver crap
player->centering = true;
}
player->mo->flags2 &= ~MF2_FLY;
player->mo->flags &= ~MF_NOGRAVITY;
BorderTopRefresh = true; //make sure the sprite's cleared out
}
}
if (player->powers[pw_speed])
{
player->powers[pw_speed]--;
}
if (player->damagecount)
{
player->damagecount--;
}
if (player->bonuscount)
{
player->bonuscount--;
}
if (player->poisoncount && !(leveltime & 15))
{
player->poisoncount -= 5;
if (player->poisoncount < 0)
{
player->poisoncount = 0;
}
P_PoisonDamage(player, player->poisoner, 1, true);
}
// Colormaps
// if(player->powers[pw_invulnerability])
// {
// if(player->powers[pw_invulnerability] > BLINKTHRESHOLD
// || (player->powers[pw_invulnerability]&8))
// {
// player->fixedcolormap = INVERSECOLORMAP;
// }
// else
// {
// player->fixedcolormap = 0;
// }
// }
// else
if (player->powers[pw_infrared])
{
if (player->powers[pw_infrared] <= BLINKTHRESHOLD)
{
if (player->powers[pw_infrared] & 8)
{
player->fixedcolormap = 0;
}
else
{
player->fixedcolormap = 1;
}
}
else if (!(leveltime & 16) && player == &players[consoleplayer])
{
if (newtorch)
{
if (player->fixedcolormap + newtorchdelta > 7
|| player->fixedcolormap + newtorchdelta < 1
|| newtorch == player->fixedcolormap)
{
newtorch = 0;
}
else
{
player->fixedcolormap += newtorchdelta;
}
}
else
{
newtorch = (M_Random() & 7) + 1;
newtorchdelta = (newtorch == player->fixedcolormap) ?
0 : ((newtorch > player->fixedcolormap) ? 1 : -1);
}
}
}
else
{
player->fixedcolormap = 0;
}
}
//----------------------------------------------------------------------------
//
// PROC P_ArtiTele
//
//----------------------------------------------------------------------------
void P_ArtiTele(player_t * player)
{
int i;
int selections;
fixed_t destX;
fixed_t destY;
angle_t destAngle;
if (deathmatch)
{
selections = deathmatch_p - deathmatchstarts;
i = P_Random() % selections;
destX = deathmatchstarts[i].x << FRACBITS;
destY = deathmatchstarts[i].y << FRACBITS;
destAngle = ANG45 * (deathmatchstarts[i].angle / 45);
}
else
{
destX = playerstarts[0][0].x << FRACBITS;
destY = playerstarts[0][0].y << FRACBITS;
destAngle = ANG45 * (playerstarts[0][0].angle / 45);
}
P_Teleport(player->mo, destX, destY, destAngle, true);
if (player->morphTics)
{ // Teleporting away will undo any morph effects (pig)
P_UndoPlayerMorph(player);
}
//S_StartSound(NULL, sfx_wpnup); // Full volume laugh
}
//----------------------------------------------------------------------------
//
// PROC P_ArtiTeleportOther
//
//----------------------------------------------------------------------------
void P_ArtiTeleportOther(player_t * player)
{
mobj_t *mo;
mo = P_SpawnPlayerMissile(player->mo, MT_TELOTHER_FX1);
if (mo)
{
mo->target = player->mo;
}
}
void P_TeleportToPlayerStarts(mobj_t * victim)
{
int i, selections = 0;
fixed_t destX, destY;
angle_t destAngle;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
selections++;
}
i = P_Random() % selections;
destX = playerstarts[0][i].x << FRACBITS;
destY = playerstarts[0][i].y << FRACBITS;
destAngle = ANG45 * (playerstarts[0][i].angle / 45);
P_Teleport(victim, destX, destY, destAngle, true);
//S_StartSound(NULL, sfx_wpnup); // Full volume laugh
}
void P_TeleportToDeathmatchStarts(mobj_t * victim)
{
int i, selections;
fixed_t destX, destY;
angle_t destAngle;
selections = deathmatch_p - deathmatchstarts;
if (selections)
{
i = P_Random() % selections;
destX = deathmatchstarts[i].x << FRACBITS;
destY = deathmatchstarts[i].y << FRACBITS;
destAngle = ANG45 * (deathmatchstarts[i].angle / 45);
P_Teleport(victim, destX, destY, destAngle, true);
//S_StartSound(NULL, sfx_wpnup); // Full volume laugh
}
else
{
P_TeleportToPlayerStarts(victim);
}
}
//----------------------------------------------------------------------------
//
// PROC P_TeleportOther
//
//----------------------------------------------------------------------------
void P_TeleportOther(mobj_t * victim)
{
if (victim->player)
{
if (deathmatch)
P_TeleportToDeathmatchStarts(victim);
else
P_TeleportToPlayerStarts(victim);
}
else
{
// If death action, run it upon teleport
if (victim->flags & MF_COUNTKILL && victim->special)
{
P_RemoveMobjFromTIDList(victim);
P_ExecuteLineSpecial(victim->special, victim->args,
NULL, 0, victim);
victim->special = 0;
}
// Send all monsters to deathmatch spots
P_TeleportToDeathmatchStarts(victim);
}
}
#define BLAST_RADIUS_DIST 255*FRACUNIT
#define BLAST_SPEED 20*FRACUNIT
#define BLAST_FULLSTRENGTH 255
void ResetBlasted(mobj_t * mo)
{
mo->flags2 &= ~MF2_BLASTED;
if (!(mo->flags & MF_ICECORPSE))
{
mo->flags2 &= ~MF2_SLIDE;
}
}
void P_BlastMobj(mobj_t * source, mobj_t * victim, fixed_t strength)
{
angle_t angle, ang;
mobj_t *mo;
fixed_t x, y, z;
angle = R_PointToAngle2(source->x, source->y, victim->x, victim->y);
angle >>= ANGLETOFINESHIFT;
if (strength < BLAST_FULLSTRENGTH)
{
victim->momx = FixedMul(strength, finecosine[angle]);
victim->momy = FixedMul(strength, finesine[angle]);
if (victim->player)
{
// Players handled automatically
}
else
{
victim->flags2 |= MF2_SLIDE;
victim->flags2 |= MF2_BLASTED;
}
}
else // full strength blast from artifact
{
if (victim->flags & MF_MISSILE)
{
switch (victim->type)
{
case MT_SORCBALL1: // don't blast sorcerer balls
case MT_SORCBALL2:
case MT_SORCBALL3:
return;
break;
case MT_MSTAFF_FX2: // Reflect to originator
victim->special1 = (int) victim->target;
victim->target = source;
break;
default:
break;
}
}
if (victim->type == MT_HOLY_FX)
{
if ((mobj_t *) (victim->special1) == source)
{
victim->special1 = (int) victim->target;
victim->target = source;
}
}
victim->momx = FixedMul(BLAST_SPEED, finecosine[angle]);
victim->momy = FixedMul(BLAST_SPEED, finesine[angle]);
// Spawn blast puff
ang = R_PointToAngle2(victim->x, victim->y, source->x, source->y);
ang >>= ANGLETOFINESHIFT;
x = victim->x + FixedMul(victim->radius + FRACUNIT, finecosine[ang]);
y = victim->y + FixedMul(victim->radius + FRACUNIT, finesine[ang]);
z = victim->z - victim->floorclip + (victim->height >> 1);
mo = P_SpawnMobj(x, y, z, MT_BLASTEFFECT);
if (mo)
{
mo->momx = victim->momx;
mo->momy = victim->momy;
}
if (victim->flags & MF_MISSILE)
{
victim->momz = 8 * FRACUNIT;
mo->momz = victim->momz;
}
else
{
victim->momz = (1000 / victim->info->mass) << FRACBITS;
}
if (victim->player)
{
// Players handled automatically
}
else
{
victim->flags2 |= MF2_SLIDE;
victim->flags2 |= MF2_BLASTED;
}
}
}
// Blast all mobj things away
void P_BlastRadius(player_t * player)
{
mobj_t *mo;
mobj_t *pmo = player->mo;
thinker_t *think;
fixed_t dist;
S_StartSound(pmo, SFX_ARTIFACT_BLAST);
P_NoiseAlert(player->mo, player->mo);
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != P_MobjThinker)
{ // Not a mobj thinker
continue;
}
mo = (mobj_t *) think;
if ((mo == pmo) || (mo->flags2 & MF2_BOSS))
{ // Not a valid monster
continue;
}
if ((mo->type == MT_POISONCLOUD) || // poison cloud
(mo->type == MT_HOLY_FX) || // holy fx
(mo->flags & MF_ICECORPSE)) // frozen corpse
{
// Let these special cases go
}
else if ((mo->flags & MF_COUNTKILL) && (mo->health <= 0))
{
continue;
}
else if (!(mo->flags & MF_COUNTKILL) &&
!(mo->player) && !(mo->flags & MF_MISSILE))
{ // Must be monster, player, or missile
continue;
}
if (mo->flags2 & MF2_DORMANT)
{
continue; // no dormant creatures
}
if ((mo->type == MT_WRAITHB) && (mo->flags2 & MF2_DONTDRAW))
{
continue; // no underground wraiths
}
if ((mo->type == MT_SPLASHBASE) || (mo->type == MT_SPLASH))
{
continue;
}
if (mo->type == MT_SERPENT || mo->type == MT_SERPENTLEADER)
{
continue;
}
dist = P_AproxDistance(pmo->x - mo->x, pmo->y - mo->y);
if (dist > BLAST_RADIUS_DIST)
{ // Out of range
continue;
}
P_BlastMobj(pmo, mo, BLAST_FULLSTRENGTH);
}
}
#define HEAL_RADIUS_DIST 255*FRACUNIT
// Do class specific effect for everyone in radius
boolean P_HealRadius(player_t * player)
{
mobj_t *mo;
mobj_t *pmo = player->mo;
thinker_t *think;
fixed_t dist;
int effective = false;
int amount;
for (think = thinkercap.next; think != &thinkercap; think = think->next)
{
if (think->function != P_MobjThinker)
{ // Not a mobj thinker
continue;
}
mo = (mobj_t *) think;
if (!mo->player)
continue;
if (mo->health <= 0)
continue;
dist = P_AproxDistance(pmo->x - mo->x, pmo->y - mo->y);
if (dist > HEAL_RADIUS_DIST)
{ // Out of range
continue;
}
switch (player->class)
{
case PCLASS_FIGHTER: // Radius armor boost
if ((P_GiveArmor(mo->player, ARMOR_ARMOR, 1)) ||
(P_GiveArmor(mo->player, ARMOR_SHIELD, 1)) ||
(P_GiveArmor(mo->player, ARMOR_HELMET, 1)) ||
(P_GiveArmor(mo->player, ARMOR_AMULET, 1)))
{
effective = true;
S_StartSound(mo, SFX_MYSTICINCANT);
}
break;
case PCLASS_CLERIC: // Radius heal
amount = 50 + (P_Random() % 50);
if (P_GiveBody(mo->player, amount))
{
effective = true;
S_StartSound(mo, SFX_MYSTICINCANT);
}
break;
case PCLASS_MAGE: // Radius mana boost
amount = 50 + (P_Random() % 50);
if ((P_GiveMana(mo->player, MANA_1, amount)) ||
(P_GiveMana(mo->player, MANA_2, amount)))
{
effective = true;
S_StartSound(mo, SFX_MYSTICINCANT);
}
break;
case PCLASS_PIG:
default:
break;
}
}
return (effective);
}
//----------------------------------------------------------------------------
//
// PROC P_PlayerNextArtifact
//
//----------------------------------------------------------------------------
void P_PlayerNextArtifact(player_t * player)
{
extern int inv_ptr;
extern int curpos;
if (player == &players[consoleplayer])
{
inv_ptr--;
if (inv_ptr < 6)
{
curpos--;
if (curpos < 0)
{
curpos = 0;
}
}
if (inv_ptr < 0)
{
inv_ptr = player->inventorySlotNum - 1;
if (inv_ptr < 6)
{
curpos = inv_ptr;
}
else
{
curpos = 6;
}
}
player->readyArtifact = player->inventory[inv_ptr].type;
}
}
//----------------------------------------------------------------------------
//
// PROC P_PlayerRemoveArtifact
//
//----------------------------------------------------------------------------
void P_PlayerRemoveArtifact(player_t * player, int slot)
{
int i;
extern int inv_ptr;
extern int curpos;
player->artifactCount--;
if (!(--player->inventory[slot].count))
{ // Used last of a type - compact the artifact list
player->readyArtifact = arti_none;
player->inventory[slot].type = arti_none;
for (i = slot + 1; i < player->inventorySlotNum; i++)
{
player->inventory[i - 1] = player->inventory[i];
}
player->inventorySlotNum--;
if (player == &players[consoleplayer])
{ // Set position markers and get next readyArtifact
inv_ptr--;
if (inv_ptr < 6)
{
curpos--;
if (curpos < 0)
{
curpos = 0;
}
}
if (inv_ptr >= player->inventorySlotNum)
{
inv_ptr = player->inventorySlotNum - 1;
}
if (inv_ptr < 0)
{
inv_ptr = 0;
}
player->readyArtifact = player->inventory[inv_ptr].type;
}
}
}
//----------------------------------------------------------------------------
//
// PROC P_PlayerUseArtifact
//
//----------------------------------------------------------------------------
void P_PlayerUseArtifact(player_t * player, artitype_t arti)
{
int i;
for (i = 0; i < player->inventorySlotNum; i++)
{
if (player->inventory[i].type == arti)
{ // Found match - try to use
if (P_UseArtifact(player, arti))
{ // Artifact was used - remove it from inventory
P_PlayerRemoveArtifact(player, i);
if (player == &players[consoleplayer])
{
if (arti < arti_firstpuzzitem)
{
S_StartSound(NULL, SFX_ARTIFACT_USE);
}
else
{
S_StartSound(NULL, SFX_PUZZLE_SUCCESS);
}
ArtifactFlash = 4;
}
}
else if (arti < arti_firstpuzzitem)
{ // Unable to use artifact, advance pointer
P_PlayerNextArtifact(player);
}
break;
}
}
}
//==========================================================================
//
// P_UseArtifact
//
// Returns true if the artifact was used.
//
//==========================================================================
boolean P_UseArtifact(player_t * player, artitype_t arti)
{
mobj_t *mo;
angle_t angle;
int i;
int count;
switch (arti)
{
case arti_invulnerability:
if (!P_GivePower(player, pw_invulnerability))
{
return (false);
}
break;
case arti_health:
if (!P_GiveBody(player, 25))
{
return (false);
}
break;
case arti_superhealth:
if (!P_GiveBody(player, 100))
{
return (false);
}
break;
case arti_healingradius:
if (!P_HealRadius(player))
{
return (false);
}
break;
case arti_torch:
if (!P_GivePower(player, pw_infrared))
{
return (false);
}
break;
case arti_egg:
mo = player->mo;
P_SpawnPlayerMissile(mo, MT_EGGFX);
P_SPMAngle(mo, MT_EGGFX, mo->angle - (ANG45 / 6));
P_SPMAngle(mo, MT_EGGFX, mo->angle + (ANG45 / 6));
P_SPMAngle(mo, MT_EGGFX, mo->angle - (ANG45 / 3));
P_SPMAngle(mo, MT_EGGFX, mo->angle + (ANG45 / 3));
break;
case arti_fly:
if (!P_GivePower(player, pw_flight))
{
return (false);
}
if (player->mo->momz <= -35 * FRACUNIT)
{ // stop falling scream
S_StopSound(player->mo);
}
break;
case arti_summon:
mo = P_SpawnPlayerMissile(player->mo, MT_SUMMON_FX);
if (mo)
{
mo->target = player->mo;
mo->special1 = (int) (player->mo);
mo->momz = 5 * FRACUNIT;
}
break;
case arti_teleport:
P_ArtiTele(player);
break;
case arti_teleportother:
P_ArtiTeleportOther(player);
break;
case arti_poisonbag:
angle = player->mo->angle >> ANGLETOFINESHIFT;
if (player->class == PCLASS_CLERIC)
{
mo = P_SpawnMobj(player->mo->x + 16 * finecosine[angle],
player->mo->y + 24 * finesine[angle],
player->mo->z - player->mo->floorclip +
8 * FRACUNIT, MT_POISONBAG);
if (mo)
{
mo->target = player->mo;
}
}
else if (player->class == PCLASS_MAGE)
{
mo = P_SpawnMobj(player->mo->x + 16 * finecosine[angle],
player->mo->y + 24 * finesine[angle],
player->mo->z - player->mo->floorclip +
8 * FRACUNIT, MT_FIREBOMB);
if (mo)
{
mo->target = player->mo;
}
}
else // PCLASS_FIGHTER, obviously (also pig, not so obviously)
{
mo = P_SpawnMobj(player->mo->x, player->mo->y,
player->mo->z - player->mo->floorclip +
35 * FRACUNIT, MT_THROWINGBOMB);
if (mo)
{
mo->angle =
player->mo->angle + (((P_Random() & 7) - 4) << 24);
mo->momz =
4 * FRACUNIT + ((player->lookdir) << (FRACBITS - 4));
mo->z += player->lookdir << (FRACBITS - 4);
P_ThrustMobj(mo, mo->angle, mo->info->speed);
mo->momx += player->mo->momx >> 1;
mo->momy += player->mo->momy >> 1;
mo->target = player->mo;
mo->tics -= P_Random() & 3;
P_CheckMissileSpawn(mo);
}
}
break;
case arti_speed:
if (!P_GivePower(player, pw_speed))
{
return (false);
}
break;
case arti_boostmana:
if (!P_GiveMana(player, MANA_1, MAX_MANA))
{
if (!P_GiveMana(player, MANA_2, MAX_MANA))
{
return false;
}
}
else
{
P_GiveMana(player, MANA_2, MAX_MANA);
}
break;
case arti_boostarmor:
count = 0;
for (i = 0; i < NUMARMOR; i++)
{
count += P_GiveArmor(player, i, 1); // 1 point per armor type
}
if (!count)
{
return false;
}
break;
case arti_blastradius:
P_BlastRadius(player);
break;
case arti_puzzskull:
case arti_puzzgembig:
case arti_puzzgemred:
case arti_puzzgemgreen1:
case arti_puzzgemgreen2:
case arti_puzzgemblue1:
case arti_puzzgemblue2:
case arti_puzzbook1:
case arti_puzzbook2:
case arti_puzzskull2:
case arti_puzzfweapon:
case arti_puzzcweapon:
case arti_puzzmweapon:
case arti_puzzgear1:
case arti_puzzgear2:
case arti_puzzgear3:
case arti_puzzgear4:
if (P_UsePuzzleItem(player, arti - arti_firstpuzzitem))
{
return true;
}
else
{
P_SetYellowMessage(player, TXT_USEPUZZLEFAILED, false);
return false;
}
break;
default:
return false;
}
return true;
}
//============================================================================
//
// A_SpeedFade
//
//============================================================================
void A_SpeedFade(mobj_t * actor)
{
actor->flags |= MF_SHADOW;
actor->flags &= ~MF_ALTSHADOW;
actor->sprite = actor->target->sprite;
}
|
dcb31dfab4153506d1d5fc42686ea5e393103fde
|
2756cd4094c18a2d9cf6d22e8719f85ae7c1a542
|
/maolan/midi/io.hpp
|
ba7ffec2f4c4c5602bb74940f112c115329e080d
|
[
"BSD-2-Clause"
] |
permissive
|
maolan/libmaolan
|
4d45fa5bb6d1647f600d3b06471fec6bd7223d33
|
cc1c3a872baf65f645902b2c2ce9db68ebe66ef2
|
refs/heads/master
| 2023-08-08T12:06:23.903278
| 2023-07-30T03:54:30
| 2023-07-30T03:54:30
| 115,933,918
| 6
| 3
|
BSD-2-Clause
| 2021-05-16T12:24:33
| 2018-01-01T17:19:55
|
C++
|
UTF-8
|
C++
| false
| false
| 453
|
hpp
|
io.hpp
|
#pragma once
#include <maolan/io.hpp>
#include <maolan/midi/buffer.hpp>
namespace maolan::midi {
class Input;
class IO : public maolan::IO {
public:
IO(const std::string &name = "", const bool ® = false);
virtual void fetch();
virtual void process();
virtual midi::Buffer pull();
virtual nlohmann::json connections();
void connect(midi::IO *to);
protected:
midi::Buffer _output;
midi::Input *_input;
};
} // namespace maolan::midi
|
1082a0e6fa1d69a19eeb24bf08181e7cf79c4395
|
e5b25b2d4b7f0e61a651230bbe91f4af8e3ff42c
|
/授業/Src/GameSystem/GameSystem.cpp
|
b777082d21b1266e930432104b25302d27c52a7f
|
[] |
no_license
|
Hrk-Ogs/3DGameProgramming2
|
44ee8c1875493c3eba02ced34093d3fd5e9827fb
|
784bdf590d7c4d0d6bf71a1148a5c1dadba47b6c
|
refs/heads/master
| 2023-02-14T18:32:46.188274
| 2021-01-06T03:48:02
| 2021-01-06T03:48:02
| 269,535,232
| 0
| 0
| null | null | null | null |
SHIFT_JIS
|
C++
| false
| false
| 18,063
|
cpp
|
GameSystem.cpp
|
#include "GameSystem.h"
void GameSystem::Init()
{
m_editorData.LogWindow.AddLog(u8"GameSystem起動...");
// システムコンポーネント登録
ComponentClassMaker::GetInstance().Register<TransformComponent>();
ComponentClassMaker::GetInstance().Register<ModelComponent>();
ComponentClassMaker::GetInstance().Register<InputComponent>();
ComponentClassMaker::GetInstance().Register<PlayerInputComponent>();
ComponentClassMaker::GetInstance().Register<SimpleAIInputComponent>();
ComponentClassMaker::GetInstance().Register<SpriteComponent>();
ComponentClassMaker::GetInstance().Register<CameraComponent>();
ComponentClassMaker::GetInstance().Register<LightComponent>();
ComponentClassMaker::GetInstance().Register<ParticleComponent>();
ComponentClassMaker::GetInstance().Register<SphereColliderComponent>();
ComponentClassMaker::GetInstance().Register<RayColliderComponent>();
ComponentClassMaker::GetInstance().Register<BoxColliderComponent>();
ComponentClassMaker::GetInstance().Register<MeshColliderComponent>();
ComponentClassMaker::GetInstance().Register<GraphicsSettingComponent>();
ComponentClassMaker::GetInstance().Register<UIButtonComponent>();
// Level作成
m_level = std::make_shared<Level>();
// リリース版
#ifndef DEVELOPMENT_MODE
// 実行モード
m_isPlay = true;
// コリジョンのデバッグ線秒がをOFF
ColliderComponent::s_showDebugLine = false;
// 初期レベル
ChangeLevel("Data\\Level\\Title.level");
#endif
// 結果用テクスチャ
m_texOpaqueWork = std::make_shared<KdTexture>();
m_texOpaqueWork->CreateRenderTarget(D3D.GetBackBuffer()->GetWidth(), D3D.GetBackBuffer()->GetHeight(), DXGI_FORMAT_R16G16B16A16_FLOAT);
m_texWork = std::make_shared<KdTexture>();
m_texWork->CreateRenderTarget(D3D.GetBackBuffer()->GetWidth(), D3D.GetBackBuffer()->GetHeight(), DXGI_FORMAT_R16G16B16A16_FLOAT);
// 高輝度用テクスチャ
m_texHighBrightness = std::make_shared<KdTexture>();
m_texHighBrightness->CreateRenderTarget(D3D.GetBackBuffer()->GetWidth(), D3D.GetBackBuffer()->GetHeight(), DXGI_FORMAT_R16G16B16A16_FLOAT);
// ブラーテクスチャ作成
m_texBlur.Create(D3D.GetBackBuffer()->GetWidth(), D3D.GetBackBuffer()->GetHeight());
// 波テクスチャ作成
m_texWave.Create(512, 512);
// 初期である程度波を進行させておく
for (int i = 0; i < 1000; i++)
{
SHADER.m_postProcessShader.AdvanceWave(m_texWave);
}
}
void GameSystem::Run()
{
// デバッグ線を全てクリアする
m_debugLineDraw.ResetLines();
//==========================
// レベルの切り替え処理
//==========================
if (m_nextLevelFilename.empty() == false) {
// Level作成
m_level = std::make_shared<Level>();
// リソース管理クラス最適化
// ※どこからも参照されていない不必要なリソースのみを解放する
int cnt = KDResFactory.Optimize();
m_editorData.LogWindow.AddLog(u8"%d個のリソースを解放", cnt);
// JSON読み込み&Levelのデシリアライズ
json11::Json jsn = KdLoadJSONFile(m_nextLevelFilename);
if (jsn.is_null() == false) {
// デシリアライズ
m_level->Deserialize(jsn);
// ファイルパス記憶
m_level->SetFilepath(m_nextLevelFilename);
}
// 予約をクリア
m_nextLevelFilename = "";
}
#ifdef DEVELOPMENT_MODE
//==========================
// ImGui開始
//==========================
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
// ImGui Demo ウィンドウ表示 ※すごく参考になるウィンドウです。imgui_demo.cpp参照。
ImGui::ShowDemoWindow(nullptr);
// ImGuizmo開始
ImGuizmo::BeginFrame();
#endif
//==========================
// GameObjectを収集
//==========================
// 収集GameObjectリストのリセット
m_tempGameObjects.clear();
// LevelからGameObjectを収集
m_level->CollectGameObject(m_tempGameObjects);
//==========================
//
// 更新処理
//
//==========================
// このコリジョン管理クラスを使用するようにセット
m_collisionMgr->SetManagerToDefault();
// 処理の前に、全TransformComponentに対して行列を記憶させておく
for (auto&& gameObj : m_tempGameObjects) {
gameObj->Transform()->BackupMatrix();
}
// 収集したGameObjectの更新処理
for (auto&& gameObj : m_tempGameObjects) {
// 全コンポーネント実行(直接コンポーネントリストを取得し、実行していく)
for (auto&& comp : gameObj->GetComponentList()) {
// Start実行
if (m_isPlay) {
comp->CallStartOnce();
}
comp->Update();
}
}
// 収集したGameObjectの更新処理
for (auto&& gameObj : m_tempGameObjects) {
// 全コンポーネント実行
for (auto&& comp : gameObj->GetComponentList()) {
// 更新処理
comp->LateUpdate();
}
}
// 「停止」時は、コライダー情報の更新のみ実行する
// 「実行」時は、コライダー情報の更新とあたり判定を実行
bool onlyUpdateCollider = (m_isPlay == false);
// コリジョン処理、結果通知
m_collisionMgr->Run(onlyUpdateCollider);
// 波
SHADER.m_postProcessShader.AdvanceWave(m_texWave);
#ifdef DEVELOPMENT_MODE
// エディターカメラ処理
if (m_isPlay == false || m_editorData.FreeCameraMode) {
// どのウィンドウの上にもマウスがいないときのみ
if (ImGui::IsAnyWindowHovered() == false) {
m_editorData.Camera.Update();
}
}
#endif
//-----------------------
// 描画準備
//-----------------------
// レンダリングデータをリセット
m_tempRenderingDate.Reset();
// ライト数リセット
SHADER.m_cb8_Light.Work().DL_Cnt = 0;
SHADER.m_cb8_Light.Work().PL_Cnt = 0;
SHADER.m_cb8_Light.Work().SL_Cnt = 0;
// GameOvject描画準備処理
for (auto&& gameObj : m_tempGameObjects) {
// 全コンポーネント実行
for (auto&& comp : gameObj->GetComponentList()) {
comp->PrepareDraw(m_tempRenderingDate);
}
}
// ライトデータ書き込み(GPUに転送され描画(シェーダー)で使用される)
SHADER.m_cb8_Light.Write();
//==========================
//
// 描画
//
//==========================
//-----------
// カメラ
//-----------
#ifdef DEVELOPMENT_MODE
// カメラをシェーダーにセット
if (m_tempRenderingDate.m_camera && m_editorData.FreeCameraMode == false && m_isPlay) { // カメラコンポーネントがある時
// カメラコンポーネントのカメラ情報をセットする
m_tempRenderingDate.m_camera->SetCamera();
}
else { // ないとき
// Editorカメラセット
m_editorData.Camera.SetToShader();
}
#else
if (m_tempRenderingDate.m_camera) {
// カメラコンポーネントのカメラ情報をセットする
m_tempRenderingDate.m_camera->SetCamera();
}
#endif
//------------------
// シャドウマップ生成描画
//------------------
for (auto&& lightComp : m_tempRenderingDate.m_shadowMapLight)
{
auto drawProc = [this]()
{
for (auto&& comp : m_tempRenderingDate.m_drawShadowList)
{
comp->Draw(RenderingData::kGenShadowMap);
}
};
// シャドウマップ生成描画
lightComp->GenerateShadowMap(drawProc);
}
// シャドウマップをセット
D3D.GetDevContext()->PSSetShaderResources(13, 1, SHADER.m_genShadowMapShader.GetSpotShadowMap()->GetSRViewAddress());
D3D.GetDevContext()->PSSetShaderResources(14, 1, SHADER.m_genShadowMapShader.GetDirShadowMap()->GetSRViewAddress());
//-----------
// ライト
//-----------
//-----------
// 描画
//-----------
//+++++++++++++++++++
// 不透明物結果用RTへ変更
//+++++++++++++++++++
// 結果用RTのクリア
D3D.GetDevContext()->ClearRenderTargetView(m_texOpaqueWork->GetRTView(), KdVec4(0, 0, 0, 1));
// RTの変更
D3D.GetDevContext()->OMSetRenderTargets(1, m_texOpaqueWork->GetRTViewAddress(), D3D.GetZBuffer()->GetDSView());
// ビューポートの設定
D3D.SetViewportFromRTV(m_texOpaqueWork->GetRTView());
//++++++++++++++++++++
// 3D描画(不透明)
//++++++++++++++++++++
// ※ここで、m_tempRenderingData.m_drawListをカメラから近い順番にソートすればパフォーマンスアップ
for (auto&& comp : m_tempRenderingDate.m_drawList) {
comp->Draw(RenderingData::kOpaquePhase);
}
//+++++++++++++++++++
// 結果用RTへ変更
//+++++++++++++++++++
// OPaqueWork -> Workへコピー
D3D.GetDevContext()->CopyResource(m_texWork->GetResource(), m_texOpaqueWork->GetResource());
// RTの変更
D3D.GetDevContext()->OMSetRenderTargets(1, m_texWork->GetRTViewAddress(), D3D.GetZBuffer()->GetDSView());
// ビューポートの設定
D3D.SetViewportFromRTV(m_texWork->GetRTView());
// 不透明物結果用RTをSRVとしてセット
D3D.GetDevContext()->PSSetShaderResources(10, 1, m_texOpaqueWork->GetSRViewAddress());
//++++++++++++++++++++
// 3D描画(半透明)
//++++++++++++++++++++
for (auto&& comp : m_tempRenderingDate.m_drawTransparentList) {
comp->Draw(RenderingData::kTransparentPhase);
}
// セットしていた不透明物結果用RTを解除
D3D.GetDevContext()->PSSetShaderResources(10, 1, KdTexture().GetSRViewAddress());
// シャドウマップを解除
D3D.GetDevContext()->PSSetShaderResources(13, 1, KdTexture().GetSRViewAddress());
D3D.GetDevContext()->PSSetShaderResources(14, 1, KdTexture().GetSRViewAddress());
//++++++++++++++++++++
// 3Dエフェクト描画(半透明)
//++++++++++++++++++++
D3D.GetDevContext()->OMSetDepthStencilState(SHADER.m_ds_ZEnable_ZWriteDisable, 0); // Zバッファの書き込みをOFF
D3D.GetDevContext()->RSSetState(SHADER.m_rs_CullNone); // カリングを無し(画面描画)
for (auto&& comp : m_tempRenderingDate.m_drawEffectList) {
comp->Draw(RenderingData::kEffectPhase);
}
D3D.GetDevContext()->OMSetDepthStencilState(SHADER.m_ds_ZEnable_ZWriteEnable, 0); // Zbaffa no書き込みをON
D3D.GetDevContext()->RSSetState(SHADER.m_rs_CullBack);
//+++++++++++++++++++
// ポストプロセス
//+++++++++++++++++++
// 高輝度抽出
SHADER.m_postProcessShader.BrightFiltering(m_texHighBrightness.get(), m_texWork.get());
// MGF
SHADER.m_postProcessShader.GenerateBlur(m_texBlur, m_texHighBrightness.get());
// ライトブルーム表現
D3D.GetDevContext()->OMSetBlendState(SHADER.m_bs_Add, KdVec4(0, 0, 0, 0), 0xFFFFFFFF);
for (int i = 0; i < 5; i++)
{
SHADER.m_postProcessShader.ColorDraw(m_texBlur.m_rt[i][0].get(), { 0.2f,0.2f,0.2f, 1 });
}
D3D.GetDevContext()->OMSetBlendState(SHADER.m_bs_Alpha, KdVec4(0, 0, 0, 0), 0xFFFFFFFF);
//+++++++++++++++++++
// RTをバックバッファへ戻す
//+++++++++++++++++++
D3D.GetDevContext()->OMSetRenderTargets(1, D3D.GetBackBuffer()->GetRTViewAddress(), D3D.GetZBuffer()->GetDSView());
D3D.SetViewportFromRTV(D3D.GetBackBuffer()->GetRTView());
// 結果画像をバックバッファへ描画
//SHADER.m_postProcessShader.ColorDraw(m_texWork.get(), { 1,1,1,1 });
SHADER.m_postProcessShader.ToneMappingDraw(m_texWork.get());
//++++++++++++++++++++
// 2D描画
//++++++++++++++++++++
SHADER.m_spriteShader.Begin(true, false);
for (auto&& comp : m_tempRenderingDate.m_drawSpriteList) {
comp->Draw(RenderingData::kSpritePhase);
}
SHADER.m_spriteShader.End();
#ifdef DEVELOPMENT_MODE
//===========================
// GUI処理
//===========================
Editor_ImGuiUpdate();
//-------------------
// デバッグ線描画
//-------------------
m_debugLineDraw.Draw();
//===========================
// ImGui描画
//===========================
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
#endif
}
// ImGui系の処理
void GameSystem::Editor_ImGuiUpdate()
{
//===============================================
// GameSystem
//===============================================
if (ImGui::Begin("GameSystem")) {
//---------------------
// エディター設定
//---------------------
// 実行/停止
if (ImGui::Checkbox(u8"実行", &m_isPlay)) {
// 実行前Levelをシリアライズしたもの置き場
static json11::Json::object sSerialLevel;
// 実行
if (m_isPlay) {
// 現在Levelの状態をシリアライズしておく
m_level->Serialize(sSerialLevel);
// 読み込みなども再現するため、一度リソース関係を全解放
// (今回はすばやく実行したいので、ここはコメントにする)
//m_editorData.LogWindow.AddLog(u8"リソース全解放");
//KDResFactory.Clear():
// デシリアライズで初期化
m_level->Deserialize(sSerialLevel);
}
// 停止
else {
// 読み込みなども再現するため、一度リソースを全解放
//m_editorData.LogWindow.AddLog(u8"リソースを全解放");
//KDResFactory.Clear();
// 再生前の状態へ戻す
m_level->Deserialize(sSerialLevel);
}
}
// 実行時のみCheckBoxを表示する
if (m_isPlay) {
ImGui::Indent();
ImGui::Checkbox("FreeCamer Mode", &m_editorData.FreeCameraMode);
ImGui::Unindent();
}
ImGui::Separator();
//------------------
// ImGuizmoの操作設定
//------------------
if (ImGui::CollapsingHeader("Gizmo", ImGuiTreeNodeFlags_DefaultOpen)) {
if (ImGui::RadioButton("Local", m_editorData.GizmoMode == ImGuizmo::LOCAL)) {
m_editorData.GizmoMode = ImGuizmo::LOCAL;
}
ImGui::SameLine();
if (ImGui::RadioButton("World", m_editorData.GizmoMode == ImGuizmo::WORLD)) {
m_editorData.GizmoMode = ImGuizmo::WORLD;
}
if (ImGui::RadioButton(u8"移動", m_editorData.GizmoOperation == ImGuizmo::TRANSLATE)) {
m_editorData.GizmoOperation = ImGuizmo::TRANSLATE;
}
ImGui::SameLine();
if (ImGui::RadioButton(u8"回転", m_editorData.GizmoOperation == ImGuizmo::ROTATE)) {
m_editorData.GizmoOperation = ImGuizmo::ROTATE;
}
ImGui::SameLine();
if (ImGui::RadioButton(u8"拡大", m_editorData.GizmoOperation == ImGuizmo::SCALE)) {
m_editorData.GizmoOperation = ImGuizmo::SCALE;
}
}
}
ImGui::End();
//===============================================
// Levelウィンドウ
//===============================================
if (ImGui::Begin("Level", 0, ImGuiWindowFlags_MenuBar)) {
//-------------------
// メインメニュー
//-------------------
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("File"))
{
// 新規Level
if (ImGui::Selectable(u8"新規Level"))
{
// リソースファクトリーをクリアする
KDResFactory.Clear();
// Level作成
m_level = std::make_shared<Level>();
}
// Level読み込み
if (ImGui::Selectable(u8"Level開く"))
{
std::string filepath = m_level->GetFilepath();
if (KdWindow::OpenFileDialog(filepath, "Levelファイル開く", "Levelファイル\0*.level\0"))
{
// リソースファクトリーをクリアする
KDResFactory.Clear();
// JSON読み込み
json11::Json jsn = KdLoadJSONFile(filepath);
if (jsn.is_null() == false)
{
// Level新規作成
m_level = std::make_shared<Level>();
// デシリアライズ
m_level->Deserialize(jsn);
// ファイルパス記憶
m_level->SetFilepath(filepath);
}
}
}
// Level保存
if (ImGui::Selectable(u8"名前を付けてLevel保存"))
{
std::string filepath = m_level->GetFilepath();
if (KdWindow::SaveFileDialog(filepath, "Levelファイル保存", "Levelファイル\0*.level\0"))
{
// ファイルパス記憶
m_level->SetFilepath(filepath);
// シリアライズ
json11::Json::object serialLevel;
m_level->Serialize(serialLevel);
// JSONを文字列化し、ファイルへ保存
json11::Json jsn = serialLevel;
std::string strJson = jsn.dump(true);
// ファイル書き込み
std::ofstream ofs(filepath);
if (ofs)
{
ofs.write(strJson.c_str(), strJson.size());
}
}
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
// ルートからの階層表示
m_level->Editor_ImGuiupdate();
}
ImGui::End();
//===============================================
// Inspectorウィンドウ
//===============================================
if (ImGui::Begin("Inspector")) {
// 選択物
KdSptr<GameObject> selectObj = m_editorData.SelectObj.lock();
if (selectObj) {
// GameObjectのImGui処理を実行
selectObj->Editor_ImGuiUpdate();
}
}
ImGui::End();
//===============================================
// ログウィンドウ
//===============================================
m_editorData.LogWindow.ImGuiUpdate("Log");
//===============================================
// CollisionManagerウィンドウ
// ・動作設定やデバッグ表示・負荷表示などが出来る
//===============================================
if (ImGui::Begin("Collision")) {
m_collisionMgr->ImGuiUpdate();
}
ImGui::End();
//===========================
// グラフィック
//===========================
if (ImGui::Begin("GraphicsDebug"))
{
if (ImGui::CollapsingHeader(u8"波マップ", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::Image(m_texWave.m_rtHeight[0]->GetSRView(), ImVec2(100 * m_texWave.m_rtHeight[0] ->GetAspectRatio(), 100));
ImGui::SameLine();
ImGui::Image(m_texWave.m_rtNormal->GetSRView(), ImVec2(100 * m_texWave.m_rtNormal->GetAspectRatio(), 100));
}
}
ImGui::End();
}
KdSptr<GameObject> GameSystem::Instantiate(const std::string& prefabFilename)
{
// Prefabファイル読み込み
json11::Json jsn = KDResFactory.GetJSON(prefabFilename);
if (jsn.is_object()) {
// GameObject生成
KdSptr<GameObject> newObj = std::make_shared<GameObject>();
// JSONデータを流し込む
newObj->Deserialize(jsn);
// とりあえずルートの子にする
newObj->SetParent(m_level->GetRootObject());
// 生成したGameObjectを返す
return newObj;
}
// 失敗時はnullを返す
return nullptr;
}
|
f8b4a942e2f5c4f4802e9d0bef4f8c8f70bfad6e
|
f7694374aa6f94751e092b2655fdfbaab2b77096
|
/URI/INICIANTE/uri1004.cpp
|
dd9c5d4180733f4ea5f62417382ab509e356e039
|
[
"MIT"
] |
permissive
|
marlloncsoares/C_plus_plus
|
05b2709ede3c5753bb3330ab66ae58259fe6dca3
|
b42027d68349b714556bf0a3d0fd3882b7dd6ac4
|
refs/heads/master
| 2022-04-10T01:36:26.670964
| 2020-04-01T01:33:55
| 2020-04-01T01:33:55
| 250,143,634
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 375
|
cpp
|
uri1004.cpp
|
#include <iostream>
using namespace std;
// Algoritmo para calcular o produto entre dois números inteiros.
int main() {
// Declara as variáveis que serão utilizadas
int x, y, p;
// Faz a leitura dos dados.
cin >> x >> y;
// Realiza o processamento.
p = x * y;
// Mostra o resultado.
cout << "PROD = " << p << endl;
return 0;
}
|
d6226ae3168e7d6dc5499330cbe5cad7692058a5
|
d9b1c78c5c0f15a91d7b4db7136567a9ec470a2e
|
/libs/numeric/mtl/test/vector_type_generator_test.cpp
|
24b46761718ca032b52f10bbe2823015bbe99ece
|
[
"MTLL"
] |
permissive
|
simunova/mtl4
|
eff9f8c0dca66cd2a3a2573b24a287be38f9f02a
|
09d8523d59baf5fdec29f3509a63babc2763af4a
|
refs/heads/master
| 2021-06-19T08:36:42.145155
| 2021-03-05T20:58:21
| 2021-03-05T20:58:21
| 177,810,098
| 28
| 18
| null | 2021-03-05T20:58:21
| 2019-03-26T14:53:13
|
C++
|
UTF-8
|
C++
| false
| false
| 2,012
|
cpp
|
vector_type_generator_test.cpp
|
// Software License for MTL
//
// Copyright (c) 2007 The Trustees of Indiana University.
// 2008 Dresden University of Technology and the Trustees of Indiana University.
// 2010 SimuNova UG (haftungsbeschränkt), www.simunova.com.
// All rights reserved.
// Authors: Peter Gottschling and Andrew Lumsdaine
//
// This file is part of the Matrix Template Library
//
// See also license.mtl.txt in the distribution.
#include <iostream>
#include <typeinfo>
#include <boost/type_traits/is_same.hpp>
#include <boost/numeric/mtl/mtl.hpp>
int main(int, char**)
{
using namespace mtl;
using mtl::io::tout;
#if defined(MTL_WITH_VARIADIC_TEMPLATE) && defined(MTL_WITH_STATICASSERT) && defined(MTL_WITH_TEMPLATE_ALIAS)
vector<double> v1;
tout << "Type of v1 is " << typeid(v1).name() << '\n';
static_assert(!traits::is_row_major<decltype(v1)>::value, "Vector must be column-major!");
vector<double, column_major> v2;
tout << "Type of v2 is " << typeid(v2).name() << '\n';
static_assert(!traits::is_row_major<decltype(v2)>::value, "Vector must be column-major!");
vector<double, row_major> v3;
tout << "Type of v3 is " << typeid(v3).name() << '\n';
static_assert(traits::is_row_major<decltype(v3)>::value, "Vector must be row-major!");
vector<double, as_size_type<unsigned> > v4;
tout << "Type of v4 is " << typeid(v4).name() << '\n';
static_assert(boost::is_same<mtl::Collection<decltype(v4)>::size_type, unsigned>::value,
"Size type must be unsigned!");
vector<double, dim<3> > v5;
tout << "Type of v5 is " << typeid(v5).name() << '\n';
static_assert(traits::is_static<decltype(v5)>::value, "Vector must have static size!");
vector<double, sparse> v6;
tout << "Type of v6 is " << typeid(v6).name() << '\n';
static_assert(traits::is_sparse<decltype(v6)>::value, "Vector must be sparse!");
#else
tout << "Test deactivated due to missing C++11 features.\n";
#endif
return 0;
}
|
939ca811fe2be239599fcc47b10b64cd8ea327a7
|
dcb236f4fe8d15c97661404b297016d877ebf0c8
|
/MMVII/include/MMVII_FormDer_BinaryOp.h
|
926337d9608ad4e19e4b41d1fc3782b6fd510fa8
|
[
"LicenseRef-scancode-cecill-b-en"
] |
permissive
|
luckyfish888/micmac
|
021a91cc6897f7d3e8d6d54dfeb0070d4afceef1
|
483c8823f34827691a5823d529fe6dcc1a7f573e
|
refs/heads/master
| 2021-06-13T20:55:12.171864
| 2020-04-06T18:28:21
| 2020-04-06T18:28:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 14,292
|
h
|
MMVII_FormDer_BinaryOp.h
|
#ifndef _MMVII_FormDer_BinaryOp_H_
#define _MMVII_FormDer_BinaryOp_H_
/** \file MMVII_FormDer_BinaryOp.h
\brief File for definition of binary operators inside formula
*/
namespace NS_MMVII_FormalDerivative
{
/* *************************************************** */
/* *************************************************** */
/* * * */
/* * BINARY FORMULA * */
/* * * */
/* *************************************************** */
/* *************************************************** */
/* ----------------------------------------------------------
Class implementing binary operation on formula
MOTHER CLASS : cBinaryF
DERIVED : cSumF / cMulF / cSubF / cDivF / cPowF
----------------------------------------------------------------*/
template <class TypeElem> class cBinaryF : public cImplemF<TypeElem>
{
public :
typedef cImplemF<TypeElem> tImplemF;
typedef typename tImplemF::tCoordF tCoordF;
typedef typename tImplemF::tFormula tFormula;
typedef typename tImplemF::tBuf tBuf;
/// An operator must describe its name
virtual std::string NameOperator() const = 0;
/// We can compute print of binary formula using operator name
std::string InfixPPrint() const override
{
return "("+ NameOperator() + " "+ mF1->InfixPPrint() + " " + mF2->InfixPPrint() + ")";
}
protected :
std::vector<tFormula> Ref() const override{return std::vector<tFormula>{mF1,mF2};}
inline cBinaryF(tFormula aF1,tFormula aF2,const std::string & aName):
tImplemF (aF1->CoordF(),aName),
mF1 (aF1),
mDataF1 (aF1->DataBuf()),
mF2 (aF2),
mDataF2 (aF2->DataBuf())
{
// It doesn't work to mix formula from different context
if (mF1->CoordF()!=mF2->CoordF())
UserSError("Mix formula from different context");
}
tFormula mF1; ///< First argument of operator
const TypeElem *mDataF1; ///< Fast access to data of buf F1
tFormula mF2; ///< Second argument of operator
const TypeElem *mDataF2; ///< Fast access to data of buf F2
};
template <class TypeElem> class cSumF : public cBinaryF <TypeElem>
{
public :
/// Required by constant reduction in cGenOperatorBinaire
static TypeElem Operation(const TypeElem & aV1,const TypeElem & aV2) {return aV1+aV2;}
using cBinaryF<TypeElem>::mF1;
using cBinaryF<TypeElem>::mF2;
using cBinaryF<TypeElem>::mDataF1;
using cBinaryF<TypeElem>::mDataF2;
using cImplemF<TypeElem>::mDataBuf;
inline cSumF(cFormula<TypeElem> aF1,cFormula<TypeElem> aF2,const std::string & aName) :
cBinaryF<TypeElem> (aF1,aF2,aName)
{ }
private :
std::string NameOperator() const override {return "+";}
void ComputeBuf(int aK0,int aK1) override
{
for (int aK=aK0 ; aK<aK1 ; aK++)
mDataBuf[aK] = mDataF1[aK] + mDataF2[aK];
}
cFormula<TypeElem> Derivate(int aK) const override {return mF1->Derivate(aK) + mF2->Derivate(aK);}
};
template <class TypeElem> class cMulF : public cBinaryF<TypeElem>
{
public :
/// Required by constant reduction in cGenOperatorBinaire
static TypeElem Operation(const TypeElem & aV1,const TypeElem & aV2) {return aV1*aV2;}
using cBinaryF<TypeElem>::mF1;
using cBinaryF<TypeElem>::mF2;
using cBinaryF<TypeElem>::mDataF1;
using cBinaryF<TypeElem>::mDataF2;
using cImplemF<TypeElem>::mDataBuf;
inline cMulF(cFormula<TypeElem> aF1,cFormula<TypeElem> aF2,const std::string & aName) :
cBinaryF<TypeElem> (aF1,aF2,aName)
{ }
private :
std::string NameOperator() const override {return "*";}
void ComputeBuf(int aK0,int aK1) override
{
for (int aK=aK0 ; aK<aK1 ; aK++)
mDataBuf[aK] = mDataF1[aK] * mDataF2[aK];
}
/// Formula (FG)' = F'G + G'F
cFormula<TypeElem> Derivate(int aK) const override
{
return mF2*mF1->Derivate(aK) + mF1*mF2->Derivate(aK);
}
};
template <class TypeElem> class cSubF : public cBinaryF<TypeElem>
{
public :
/// Required by constant reduction in cGenOperatorBinaire
static TypeElem Operation(const TypeElem & aV1,const TypeElem & aV2) {return aV1-aV2;}
using cBinaryF<TypeElem>::mF1;
using cBinaryF<TypeElem>::mF2;
using cBinaryF<TypeElem>::mDataF1;
using cBinaryF<TypeElem>::mDataF2;
using cImplemF<TypeElem>::mDataBuf;
inline cSubF(cFormula<TypeElem> aF1,cFormula<TypeElem> aF2,const std::string & aName) :
cBinaryF<TypeElem> (aF1,aF2,aName)
{ }
private :
std::string NameOperator() const override {return "-";}
void ComputeBuf(int aK0,int aK1) override
{
for (int aK=aK0 ; aK<aK1 ; aK++)
mDataBuf[aK] = mDataF1[aK] - mDataF2[aK];
}
/// Formula (F-G)' = F' - G'
cFormula<TypeElem> Derivate(int aK) const override {return mF1->Derivate(aK) - mF2->Derivate(aK);}
};
template <class TypeElem> class cDivF : public cBinaryF<TypeElem>
{
public :
/// Required by constant reduction in cGenOperatorBinaire
static TypeElem Operation(const TypeElem & aV1,const TypeElem & aV2) {return aV1/aV2;}
using cBinaryF<TypeElem>::mF1;
using cBinaryF<TypeElem>::mF2;
using cBinaryF<TypeElem>::mDataF1;
using cBinaryF<TypeElem>::mDataF2;
using cImplemF<TypeElem>::mDataBuf;
inline cDivF(cFormula<TypeElem> aF1,cFormula<TypeElem> aF2,const std::string & aName) :
cBinaryF<TypeElem> (aF1,aF2,aName)
{ }
private :
std::string NameOperator() const override {return "/";}
void ComputeBuf(int aK0,int aK1) override
{
for (int aK=aK0 ; aK<aK1 ; aK++)
mDataBuf[aK] = mDataF1[aK] / mDataF2[aK];
}
/// Formula (F/G)' = (F'G - G'F) / G ^ 2
cFormula<TypeElem> Derivate(int aK) const override
{
return (mF1->Derivate(aK)*mF2 - mF2->Derivate(aK)*mF1)/square(mF2);
}
};
template <class TypeElem> class cPowF : public cBinaryF<TypeElem>
{
public :
/// Required by constant reduction in cGenOperatorBinaire
static TypeElem Operation(const TypeElem & aV1,const TypeElem & aV2) {return std::pow(aV1,aV2);}
using cBinaryF<TypeElem>::mF1;
using cBinaryF<TypeElem>::mF2;
using cBinaryF<TypeElem>::mDataF1;
using cBinaryF<TypeElem>::mDataF2;
using cImplemF<TypeElem>::mDataBuf;
inline cPowF(cFormula<TypeElem> aF1,cFormula<TypeElem> aF2,const std::string & aName) :
cBinaryF<TypeElem> (aF1,aF2,aName)
{ }
private :
std::string NameOperator() const override {return "^";}
void ComputeBuf(int aK0,int aK1) override
{
for (int aK=aK0 ; aK<aK1 ; aK++)
mDataBuf[aK] = std::pow(mDataF1[aK],mDataF2[aK]);
}
/// Formula F ^ G = exp(G log(F))
/// (F^G) ' = (F^G) (G F'/F + G'log(F))
cFormula<TypeElem> Derivate(int aK) const override
{
return pow(mF1,mF2) * ( (mF1->Derivate(aK)/mF1)*mF2 + mF2->Derivate(aK)*log(mF1)) ;
}
};
/* ---------------------------------------*/
/* Global Functio on unary op */
/* ---------------------------------------*/
/** A Helper class to avoid code duplication on the process , see detailed comment in cGenOperatorUnaire (analogous) */
template <class TypeCompiled> class cGenOperatorBinaire
{
public :
typedef typename TypeCompiled::tElem tElem;
typedef typename TypeCompiled::tCoordF tCoordF;
typedef typename TypeCompiled::tImplemF tImplemF;
typedef typename tImplemF::tFormula tFormula;
static tFormula Generate(tFormula aF1,tFormula aF2,const std::string & aNameOp)
{
// Extract context (take F1 ou F2, does not matter, they must be the same)
tCoordF * aPCont = aF1->CoordF();
std::string aNameForm = aF1.NameFormulaBin(aNameOp,aF2);
if (aPCont->ExistFunc(aNameForm))
return aPCont->FuncOfName(aNameForm);
// Maybe the two operand are constant ? Then we can reduce
{
const tElem * aC1 = aF1->ValCste();
const tElem * aC2 = aF2->ValCste();
if (aC1 && aC2)
{
tElem aC12= TypeCompiled::Operation(*aC1,*aC2);
std::cout << "ZZZZZZ " << *aC1 << " " << *aC2 << " " << aC12<< "\n";
}
}
tFormula aResult (new TypeCompiled(aF1,aF2,aNameForm));
aPCont->AddFormula(aResult);
return aResult;
}
};
template <class TypeElem>
cFormula<TypeElem> operator +
(
const cFormula <TypeElem>& aF1,
const cFormula<TypeElem> & aF2
)
{
// Use the fact that 0 is neutral element to simplify
if (aF1->IsCste0()) return aF2;
if (aF2->IsCste0()) return aF1;
// Use commutativity of + to have a unique representation
if (aF1->Name() > aF2->Name())
return aF2+aF1;
return cGenOperatorBinaire<cSumF<TypeElem> >::Generate(aF1,aF2,"+");
}
template <class TypeElem>
cFormula<TypeElem> operator -
(
const cFormula <TypeElem>& aF1,
const cFormula<TypeElem> & aF2
)
{
// Use the fact that 0 is neutral element to simplify
if (aF1->IsCste0()) return -aF2;
if (aF2->IsCste0()) return aF1;
return cGenOperatorBinaire<cSubF<TypeElem> >::Generate(aF1,aF2,"-");
}
template <class TypeElem>
cFormula<TypeElem> operator *
(
const cFormula <TypeElem>& aF1,
const cFormula<TypeElem> & aF2
)
{
// Use the fact that 1 is neutral element to simplify
if (aF1->IsCste1()) return aF2;
if (aF2->IsCste1()) return aF1;
// Use the fact that 0 is absorbant element to simplify
if (aF1->IsCste0()) return aF1;
if (aF2->IsCste0()) return aF2;
// Use commutativity of + to have a unique representation
if (aF1->Name() > aF2->Name())
return aF2 * aF1;
return cGenOperatorBinaire<cMulF<TypeElem> >::Generate(aF1,aF2,"*");
}
template <class TypeElem>
cFormula<TypeElem> operator /
(
const cFormula <TypeElem>& aF1,
const cFormula<TypeElem> & aF2
)
{
if (aF1->IsCste0()) return aF1; // 0/F2 -> 0
if (aF2->IsCste1()) return aF1; // F1/1 -> F1
return cGenOperatorBinaire<cDivF<TypeElem> >::Generate(aF1,aF2,"/");
}
template <class TypeElem>
cFormula<TypeElem> pow
(
const cFormula <TypeElem>& aF1,
const cFormula<TypeElem> & aF2
)
{
return cGenOperatorBinaire<cPowF<TypeElem> >::Generate(aF1,aF2,"^");
}
/* ----------------------------------------------------------*/
/* Binary Operator between Formula and constants */
/* ----------------------------------------------------------*/
// ++++++++++++++++++++++++
template <class TypeElem>
inline cFormula<TypeElem> operator +(const TypeElem & aV1,const cFormula<TypeElem> & aF2)
{
return aF2->CoordF()->CsteOfVal(aV1) + aF2;
}
template <class TypeElem>
inline cFormula<TypeElem> operator +(const cFormula<TypeElem> & aF1,const TypeElem & aV2)
{
return aV2+aF1;
}
// ************************
template <class TypeElem>
inline cFormula<TypeElem> operator *(const TypeElem & aV1,const cFormula<TypeElem> & aF2)
{
return aF2->CoordF()->CsteOfVal(aV1) * aF2;
}
template <class TypeElem>
inline cFormula<TypeElem> operator *(const cFormula<TypeElem> & aF1,const TypeElem & aV2)
{
return aV2*aF1;
}
// --------------------------
template <class TypeElem>
inline cFormula<TypeElem> operator -(const TypeElem & aV1,const cFormula<TypeElem> & aF2)
{
return aF2->CoordF()->CsteOfVal(aV1) - aF2;
}
template <class TypeElem>
inline cFormula<TypeElem> operator -(const cFormula<TypeElem> & aF1,const TypeElem & aV2)
{
return aF1-aF1->CoordF()->CsteOfVal(aV2) ;
}
// /////////////////////////
template <class TypeElem>
inline cFormula<TypeElem> operator /(const TypeElem & aV1,const cFormula<TypeElem> & aF2)
{
return aF2->CoordF()->CsteOfVal(aV1) / aF2;
}
template <class TypeElem>
inline cFormula<TypeElem> operator /(const cFormula<TypeElem> & aF1,const TypeElem & aV2)
{
return aF1/aF1->CoordF()->CsteOfVal(aV2) ;
}
// powpowpowpowpowpowpow
template <class TypeElem> cFormula <TypeElem> pow (const TypeElem & aV1,const cFormula <TypeElem> & aF2)
{
return exp(log(aV1)*aF2);
}
}; // NS_MMVII_FormalDerivative
#endif // _MMVII_FormDer_BinaryOp_H_
|
9d55c6c4e70241f54165280887bce42489525b26
|
4492f861179922eacb86e59c83f189f544fd749b
|
/Code/PolishUtilities.hpp
|
4f0fa2c38e2bb74381efb2f7447d92779f045098
|
[] |
no_license
|
gupta409/Floorplanner
|
41cbe69b60f86502c79a04ab78ae1a380d840fb7
|
6c2ac6c9816738a77471d34e07cd3a3c263d08e5
|
refs/heads/master
| 2021-05-05T09:50:32.662251
| 2019-09-18T18:19:47
| 2019-09-18T18:19:47
| 117,876,674
| 9
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,041
|
hpp
|
PolishUtilities.hpp
|
/*
* PolishUtilities.h
*
* Created on: Nov 2, 2017
* Author: Anish Gupta
*/
#ifndef POLISHUTILITIES_HPP_
#define POLISHUTILITIES_HPP_
#include <string>
#include <vector>
using namespace std;
void polishUtilitesUnitTest();
class PolishUtilities {
private:
PolishUtilities();
public:
static bool isVerticalCut(string s);
static bool isHorizontalCut(string s);
static bool isValidCut(string s);
static bool isValidExpression(const vector<string>& experssion);
static bool isNormalizedExpression(const vector<string>& experssion);
static int getCutType(string s);
static void printExpression(const vector<string>& experssion);
static string getCompliment(string s);
static pair<vector<int>, vector<int>> getLocations(const vector<string>& expression);
static vector<pair<int, int>> getRepOperators(const vector<string>& expression);
static vector<int> getSurroundedOperands(const vector<string>& expression);
static const string VERTICAL_CUT;
static const string HORIZONTAL_CUT;
};
#endif /* POLISHUTILITIES_HPP_ */
|
baba3357a84d3ecaedcc5a66b51d3cba2c51df13
|
ab3122ba99ae0c8fb654503776f3fff38c4bfe72
|
/src/data/types/symbol_name.h
|
ff138d47ef05e46b448a54153cd77f38427c0b3a
|
[] |
no_license
|
TriangleMouse/parts_Trading_arbitrage_bot
|
28586cf7a6f1a4c922da6821dcd68ace0d16e27e
|
c3168db75c372849530e2ba7df95ba7d3be0c3d6
|
refs/heads/master
| 2023-08-15T09:03:46.196766
| 2021-10-17T17:16:40
| 2021-10-17T17:16:40
| 418,202,802
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 637
|
h
|
symbol_name.h
|
//
// Created by Артем Белявский on 8/12/21.
//
#ifndef TRADEBOT_SYMBOL_NAME_H
#define TRADEBOT_SYMBOL_NAME_H
#include <string>
namespace DATA {
namespace TYPES {
struct SymbolName {
std::string moscow_name;
std::string binance_name;
std::string binance_base_cur;
std::string binance_quote_cur;
};
bool operator==(const SymbolName&, const SymbolName&);
bool operator==(const SymbolName&, const std::string&);
bool operator==(const std::string&, const SymbolName&);
} // namespace TYPES
}
#endif //TRADEBOT_SYMBOL_NAME_H
|
c1e354c5fb87432523eb567b93b1b88b78769c4f
|
3c3f900dadf850dc7720656a986b3d3db60b14d5
|
/plugins/messageviewer/bodypartformatter/autotests/diffhighlightertest.h
|
e4cecfcff7927f85c037fdc3e53a92921437fef6
|
[
"BSD-3-Clause"
] |
permissive
|
KDE/kdepim-addons
|
680602d3b8dd1bfecd6e5c5423412cc5bf1b7cbf
|
d0bff1924db427aae0b6cf40dda52e998293b906
|
refs/heads/master
| 2023-09-04T05:08:51.218761
| 2023-09-04T01:49:13
| 2023-09-04T01:49:13
| 46,991,984
| 11
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 417
|
h
|
diffhighlightertest.h
|
/*
SPDX-FileCopyrightText: 2017-2023 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <QObject>
class DiffHighlighterTest : public QObject
{
Q_OBJECT
public:
explicit DiffHighlighterTest(QObject *parent = nullptr);
~DiffHighlighterTest() override = default;
private Q_SLOTS:
void shouldGenerateDiff_data();
void shouldGenerateDiff();
};
|
12370bf0979265fb923b78607b5f32e235c7d2d3
|
34e69e7a0a52e5ca08f49389a8c1ab12980862a2
|
/lib/frame_sorter_impl.cc
|
28c31c2a6e1a6283093b88a289700d251e0ba0cc
|
[] |
no_license
|
muccc/gr-iridium
|
86e765a49b7212247895bf0bad0e0aa375a5dd79
|
d578cbc46eadfefe8362d79621d4888d1a660b99
|
refs/heads/master
| 2023-08-29T03:46:00.280905
| 2023-08-07T22:12:39
| 2023-08-07T22:12:39
| 56,373,673
| 300
| 76
| null | 2023-01-13T22:29:42
| 2016-04-16T08:30:58
|
C++
|
UTF-8
|
C++
| false
| false
| 2,973
|
cc
|
frame_sorter_impl.cc
|
/* -*- c++ -*- */
/*
* Copyright 2021 gr-iridium author.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "frame_sorter_impl.h"
#include <gnuradio/io_signature.h>
namespace gr {
namespace iridium {
frame_sorter::sptr frame_sorter::make()
{
return gnuradio::make_block_sptr<frame_sorter_impl>();
}
/*
* The private constructor
*/
frame_sorter_impl::frame_sorter_impl()
: gr::block("frame_sorter",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make(0, 0, 0))
{
message_port_register_out(pmt::mp("pdus"));
auto port_name = pmt::mp("pdus");
message_port_register_in(port_name);
set_msg_handler(port_name, [this](const pmt::pmt_t& msg) { this->handler(msg); });
}
/*
* Our virtual destructor.
*/
frame_sorter_impl::~frame_sorter_impl() {}
void frame_sorter_impl::handler(const pmt::pmt_t& msg)
{
pmt::pmt_t symbols = pmt::cdr(msg);
pmt::pmt_t meta = pmt::car(msg);
frame f;
f.timestamp = pmt::to_uint64(pmt::dict_ref(meta, pmt::mp("timestamp"), pmt::PMT_NIL));
f.center_frequency =
pmt::to_double(pmt::dict_ref(meta, pmt::mp("center_frequency"), pmt::PMT_NIL));
int confidence =
pmt::to_long(pmt::dict_ref(meta, pmt::mp("confidence"), pmt::PMT_NIL));
auto it = frames.begin();
while (it != frames.end()) {
if (it->first.timestamp < f.timestamp - 2000000000) {
message_port_pub(pmt::mp("pdus"), it->second);
it = frames.erase(it);
} else {
break;
}
}
// Frames within this window will be de-duplicated
const int64_t max_dt = 1000000; // 1 ms
const int64_t max_df = 10000; // 10 kHz
// Get first element which is after the start of our search window (time).
it = frames.upper_bound((frame){ .timestamp = f.timestamp - max_dt });
// Loop over all elements possibly within our search window (time and frequency)
for (; it != frames.end() && abs(it->first.timestamp - f.timestamp) < max_dt;
it = std::next(it)) {
if (std::abs(it->first.center_frequency - f.center_frequency) < max_df) {
pmt::pmt_t meta_old = pmt::car(it->second);
int confidence_old = pmt::to_long(
pmt::dict_ref(meta_old, pmt::mp("confidence"), pmt::PMT_NIL));
if (confidence > confidence_old) {
// insert_or_assign with it2 as a hint would be nice but is C++17
frames.erase(it);
frames.insert({ f, msg });
}
return;
}
}
frames.insert({ f, msg });
}
bool frame_sorter_impl::stop()
{
// Flush remaining messages
auto it = frames.begin();
while (it != frames.end()) {
message_port_pub(pmt::mp("pdus"), it->second);
it = frames.erase(it);
}
// Signal end of messages
message_port_pub(pmt::mp("pdus"), pmt::PMT_EOF);
return true;
}
} /* namespace iridium */
} /* namespace gr */
|
eb847ece494df537c2f75151b42925330a29610c
|
3e6c08b23d23cd6e234c5a2ea96abe64c3b3b9b2
|
/Homeworks. First term/9/1/file.cpp
|
6814ec8c9b0e3e613db5232df02ddc1c362876cf
|
[] |
no_license
|
AnnaSkachkauskaite/Homeworks
|
3e25e137864233e13e7285916c06f6d3112bf780
|
50ab8410eac071c08a4179f98201915ecb0917c7
|
refs/heads/master
| 2021-01-10T20:04:48.461402
| 2015-05-28T15:49:13
| 2015-05-28T15:49:13
| 15,389,248
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 459
|
cpp
|
file.cpp
|
#include <stdio.h>
#include "stringUnit.h"
#include "file.h"
FILE *open ()
{
printf("Enter file adress ");
char fileAdress[maxFileAdressLength];
gets(fileAdress);
return fopen(fileAdress, "r");
}
int fileToStringArray (FILE *file1, String *strFile1[maxLinesNumber])
{
int strNumb1 = 0;
char buf = 0;
while (!feof(file1))
{
fscanf(file1, "%c", &buf);
addSymbol(strFile1[strNumb1], buf);
if (buf == '\n')
++strNumb1;
}
return strNumb1;
}
|
a82830615bd5a143b5a982bdf2747ee3eff88da0
|
40162e0e3b2a991c1a462f352ace0f430ece7b55
|
/huffman/main.cpp
|
da82a0bc0be7645bd2f0f6dc78caa3e925e7076a
|
[] |
no_license
|
AThings/C
|
dd084cdbea91c9df4384907025b23582af4afe32
|
18054b41bd82456c2dc6a08777d7a9581bc8cd9a
|
refs/heads/master
| 2020-04-08T07:11:53.990654
| 2019-04-13T15:39:26
| 2019-04-13T15:39:26
| 159,130,762
| 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 1,214
|
cpp
|
main.cpp
|
#include <iostream>
using namespace std;
//数组插入排序
void insertSort(int a[],int index,int willcha,int start)
{
while(a[index-1]<=willcha && index >start)
{
a[index] = a[index-1];
index--;
}
a[index] = willcha;/*
cout<<"------------------------\n";
for(int i=0;i<5;i++)
{
cout<<a[i]<<" ";
}
cout<<"------------------------\n";*/
}
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=1;i<n;i++) //从长度2开始排序
{
//i要插入的数字index
insertSort(a,i,a[i],0);
}/*
for(int i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
cout<<endl;*/
int result = 0;
int minPlus;
for(int i=n-1;i>0;i--)
{
minPlus = a[i]+a[i-1];
result +=minPlus;
a[i-1] = minPlus;
insertSort(a,i-1,a[i-1],0);
/*
for(int j=0;j<n;j++)
{
cout<<a[j]<<" ";
}
cout<<endl;
cout<<"result="<<result<<endl;*/
}
cout<<result<<endl;
/*
for(int i=0;i<n;i++)
{
cout<<a[i]<<" ";
}*/
return 0;
}
|
5cd79f5c675f27c8c8771b1a4eac031cb98801cc
|
2828f5714aae75fab60bba431105890d4e17ef89
|
/XPlaneConnectClient.h
|
400c03dea6617257865efbf7884609303cc93d8a
|
[] |
no_license
|
iot-crazy/xpc
|
51b0f967574bd01babc6daf46a939e20ea764238
|
732fa5b229507756e013d83c5b5fa8a8cf0164a2
|
refs/heads/master
| 2022-06-30T10:00:05.641953
| 2020-05-06T09:57:08
| 2020-05-06T09:57:08
| 261,709,566
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,034
|
h
|
XPlaneConnectClient.h
|
//
// A attempt at an arduino port of the XPlaneClient
// https://github.com/nasa/XPlaneConnect
//
//
// This is a work in progress and only a very limited set of features have been proted so far
//
// Huge thanks to all those involved with XPlaneConnect for this amazinh opprotunity!
// Please bear with me, I'm leaning C++ whilst writing this and thus there may be many examples of bad practice
// Always happy to receive feedback, let me know what I can improve!
#include <WiFiUdp.h>
#include <Arduino.h>
#ifndef XPlaneConnectClient_h
#define XPlaneConnectClient_h
class XPlaneConnectClient
{
private:
char * udpAddress;
int udpPort;
public:
XPlaneConnectClient(char* udpAddress, int udpPort);
int sendUDP(WiFiUDP &sock, char buffer[], int len);
int sendText(WiFiUDP &sock,char* msg, int x, int y);
int getDREFResponse(WiFiUDP &sock);
int sendCTRL(WiFiUDP &sock,float values[], int size, char ac);
};
#endif
|
6e1c35f768e8d71c03090ea9223e2b861ff7f947
|
4d60a17a65fd6d433de66a675f87535493bf639c
|
/src/panda_util.cpp
|
f07422e1f093873e838d3eae8cab98f41ff1b2bc
|
[] |
no_license
|
zhaomasha/panda_new
|
bdf9106ee8f04557e87ca9f88ee16c36f7267ec4
|
b61de3c2fb1d4ad24ffc92bce67782c1c86f062e
|
refs/heads/master
| 2021-01-10T01:45:59.777487
| 2015-11-16T04:57:27
| 2015-11-16T04:57:27
| 43,105,484
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,228
|
cpp
|
panda_util.cpp
|
#include "panda_util.hpp"
long getTime(){
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec*1000+tv.tv_usec/1000;
}
//解析字符串,取出一个集合
void parse_strings(string params,vector<string>& v,string delims){
char* result;
char* p=(char*)params.c_str();
char* ptr=NULL;
while((result=strtok_r(p,delims.c_str(),&ptr))!=NULL){
v.push_back(string(result));
p=NULL;
}
}
//针对系统变量中有些集合形式的参数,取出来,存入集合中
void parse_env(string param_name,vector<string>& v,string delims){
string params(getenv(param_name.c_str()));
parse_strings(params,v,delims);
}
//解析字符串,delims为分割符,得到子图和ip的pair对
pair<uint32_t,string> parse_sub_ip(string params,string delims){
char* ptr=NULL;
char* key=strtok_r((char*)params.c_str(),delims.c_str(),&ptr);
char* ip=strtok_r(NULL,delims.c_str(),&ptr);
return pair<uint32_t,string>(atoi(key),ip);
}
//解析字符串,delims为分割符,得到ip和负载的pair对
pair<string,uint32_t> parse_ip_num(string params,string delims){
char* ptr=NULL;
char* ip=strtok_r((char*)params.c_str(),delims.c_str(),&ptr);
char* num=strtok_r(NULL,delims.c_str(),&ptr);
return pair<string,uint32_t>(ip,atoi(num));
}
//元数据的路径中取出图的名字
string metapath_key(char *path){
int begin=strlen(getenv("SERVER_DIR_NAME"))+1;
int len=0;
for(int i=begin;path[i]!='.';i++) len++;
return string (path+begin,len);
}
//图的路径中取出图的名字
string graph_key(char*path){
int begin=strlen(getenv("DIR_NAME"))+1;
return string(path+begin);
}
/*lock_t* Getlock(){
return (lock_t*)malloc(sizeof(lock_t));
}
void Lock(lock_t *lock){
pthread_mutex_lock(lock);
}
void Unlock(lock_t *lock){
pthread_mutex_unlock(lock);
}
void Initlock(lock_t *lock,void *p){
pthread_mutex_init(lock,(pthread_mutexattr_t*)p);
}
void Destroylock(lock_t *lock){
pthread_mutex_destroy(lock);
}
//获得锁,返回0,否则返回非0的错误码
int Trylock(lock_t *lock){
return pthread_mutex_trylock(lock);
}*/
lock_t* Getlock(){
return (lock_t*)malloc(sizeof(lock_t));
}
void Lock(lock_t *lock){
while(!__sync_bool_compare_and_swap(lock,1,0)){
}
}
void Unlock(lock_t *lock){
*lock=1;
}
void Initlock(lock_t *lock,void *p){
*lock=1;
}
void Destroylock(lock_t *lock){
//free(lock);
}
//获得锁,返回0,否则返回非0的错误码
int Trylock(lock_t *lock){
if(__sync_bool_compare_and_swap(lock,1,0)){
return 0;
}
return 1;
}
bool GetCpuMem(float &cpu,size_t &mem, int pid,int tid )
{
bool ret = false;
char cmdline[100];
sprintf(cmdline, "ps -o %%cpu,rss,%%mem,pid,tid -mp %d", pid);
FILE *file;
file = popen(cmdline, "r");
if (file == NULL)
{
printf("file == NULL\n");
return false;
}
char line[300];
float l_cpuPrec=0;
int l_mem=0;
float l_memPrec=0;
int l_pid=0;
int l_tid=0;
if (fgets(line, 300, file) != NULL)
{
// printf("1st line:%s",line);
if (fgets(line, 300, file) != NULL)
{
// printf("2nd line:%s",line);
sscanf( line, "%f %d %f %d -", &l_cpuPrec, &l_mem, &l_memPrec, &l_pid );
cpu = l_cpuPrec;
mem = l_mem;
if( tid == -1 )
ret = true;
else
{
while( fgets(line, 300, file) != NULL )
{
sscanf( line, "%f - - - %d", &l_cpuPrec, &l_tid );
// printf("other line:%s",line);
// cout<<l_cpuPrec<<'\t'<<l_tid<<endl;
if( l_tid == tid )
{
printf("cpuVal is tid:%d\n",tid);
cpu = l_cpuPrec;
ret = true;
break;
}
}
if( l_tid != tid )
printf("TID not exist\n");
}
}
else
printf("PID not exist\n");
}
else
printf("Command or Parameter wrong\n");
pclose(file);
return ret;
}
|
c887a2ab03fb6b4456155784c9a2a54dd53fbaae
|
c01a0248ffd3e8e6c1b2eae4a014e38641d59aae
|
/CodingTest/4386_'별자리 만들기'.cpp
|
981c55cfd733fa4a958c725a65fc4c4458166867
|
[] |
no_license
|
SeoWJ/CodingTest
|
f8dbbe83b6200e780998b1979ba0a064f930bd71
|
f2c4923cc4c5e53abc7cfbbef76087c9db99e390
|
refs/heads/master
| 2023-04-24T01:50:18.654084
| 2021-05-11T08:12:27
| 2021-05-11T08:12:27
| 293,422,619
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,039
|
cpp
|
4386_'별자리 만들기'.cpp
|
#include <iostream>
#include <vector>
#include <queue>
#include <tuple>
#include <cmath>
#define endl '\n'
using namespace std;
class Constellation {
protected:
int N;
vector<pair<double, double>> stars;
priority_queue<tuple<double, int, int>, vector<tuple<double, int, int>>, greater<tuple<double, int, int>>> PQ;
int unionHead[101];
public:
Constellation() {
cin >> N;
for (int i = 0; i < 101; i++) unionHead[i] = i;
for (int i = 0; i < N; i++) {
double x, y;
cin >> x >> y;
stars.push_back({ x, y });
}
for (unsigned int i = 0; i < stars.size(); i++) {
for (unsigned int j = i + 1; j < stars.size(); j++) {
PQ.push({ getDistance(stars[i], stars[j]), i, j });
}
}
}
double getDistance(pair<int, int> s1, pair<int, int> s2) {
double diffX = s1.first > s2.first ? s1.first - s2.first : s2.first - s1.first;
double diffY = s1.second > s2.second ? s1.second - s2.second : s2.second - s1.second;
double result = sqrt(pow(diffX, 2) + pow(diffY, 2));
return result;
}
int getUnionHead(int star) {
if (unionHead[star] == star) return unionHead[star];
else return getUnionHead(unionHead[star]);
}
void setUnionHead(int star, int setValue) {
int prevUnionHead = getUnionHead(star);
unionHead[prevUnionHead] = setValue;
}
double kruskal() {
double totalDistance = 0;
while (!PQ.empty()) {
double dist = get<0>(PQ.top());
int node1 = get<1>(PQ.top());
int node2 = get<2>(PQ.top());
PQ.pop();
int unionHead1 = getUnionHead(node1);
int unionHead2 = getUnionHead(node2);
if (unionHead1 == unionHead2)
continue;
else {
totalDistance += dist;
if (unionHead1 < unionHead2)
setUnionHead(unionHead2, unionHead1);
else
setUnionHead(unionHead1, unionHead2);
}
}
return totalDistance;
}
void solution() {
cout << kruskal() << endl;
}
};
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout << fixed;
cout.precision(2);
Constellation* c = new Constellation();
c->solution();
delete c;
return 0;
}
|
7ea834cf4dabe7f96615b919298b7c668484b1b3
|
eb14a6433becb725b01217f5af57db433c970407
|
/code/ACE/manager_thread.cpp
|
f6a192f62b312afd80af0fe5c4f4427502865c89
|
[] |
no_license
|
csj561/c_plusplus
|
77376418c6d51489579ec122eea8d308748e3b2b
|
49c5075acb238b41341583a13b32f51a0d26d9d3
|
refs/heads/master
| 2021-01-17T00:08:43.451813
| 2017-04-07T08:00:54
| 2017-04-07T08:00:54
| 26,589,766
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,766
|
cpp
|
manager_thread.cpp
|
#include "ace/OS.h"
#include "ace/Task.h"
#include <ace/Future.h>
#include <ace/Activation_Queue.h>
#include <ace/Method_Request.h>
#include <ace/Time_Value.h>
#include "ace/Thread_Manager.h"
#include "ace/Get_Opt.h"
static void *taskone (void *)
{
ACE_DEBUG ((LM_DEBUG, "Thread:(%t)started Task one! \n"));
ACE_OS::sleep (2);
ACE_DEBUG ((LM_DEBUG, "Thread:(%t)finished Task one!\n"));
return 0;
}
static void *tasktwo (void *)
{
ACE_DEBUG ((LM_DEBUG, "Thread:(%t)started Task two!\n"));
ACE_OS::sleep (1);
ACE_DEBUG ((LM_DEBUG, "Thread:(%t)finished Task two!\n"));
return 0;
}
static void print_usage_and_die ()
{
ACE_DEBUG ((LM_DEBUG, "Usage program_name -a<num threads for pool1> -b<num threads for pool2>"));
ACE_OS::exit (1);
} int main (int argc, char *argv[])
{
int num_task_1;
int num_task_2;
if (argc < 3)
print_usage_and_die ();
ACE_Get_Opt get_opt (argc, argv, "a:b:");
char c;
while ((c = get_opt ()) != EOF)
{
switch (c)
{
case 'a':
num_task_1 = ACE_OS::atoi (get_opt.optarg);
break;
case 'b':
num_task_2 = ACE_OS::atoi (get_opt.optarg);
break;
default:
ACE_ERROR ((LM_ERROR, "Unknown option\n"));
ACE_OS::exit (1);
}
}
//Spawn the first set of threads that work on task 1.
if (ACE_Thread_Manager::instance ()->spawn_n (num_task_1, (ACE_THR_FUNC) taskone, //Execute task one
0, //No arguments
THR_NEW_LWP, //New Light Weight Process
ACE_DEFAULT_THREAD_PRIORITY, 1) == -1) //Group ID is 1
ACE_ERROR ((LM_ERROR, "Failure to spawn first group of threads: %p \n"));
//Spawn second set of threads that work on task 2.
if (ACE_Thread_Manager::instance ()->spawn_n (num_task_2, (ACE_THR_FUNC) tasktwo, //Execute task one
0, //No arguments
THR_NEW_LWP, //New Light Weight Process
ACE_DEFAULT_THREAD_PRIORITY, 2) == -1) //Group ID is 2
ACE_ERROR ((LM_ERROR, "Failure to spawn second group of threads: %p \n"));
//Wait for all tasks in grp 1 to exit
ACE_Thread_Manager::instance ()->wait_grp (1);
ACE_DEBUG ((LM_DEBUG, "Tasks in group 1 have exited! Continuing \n"));
//Wait for all tasks in grp 2 to exit
ACE_Thread_Manager::instance ()->wait_grp (2);
ACE_DEBUG ((LM_DEBUG, "Tasks in group 2 have exited! Continuing \n"));
}
|
50afffce16dc8b4cd4f20ba5a2a0f74a9971761e
|
23c38fe74b52456693a4f51a8de29739910bfbfe
|
/bestTimeByAndSell.cpp
|
7379f2429147ed87afeeb1355e2b7d2449c999bd
|
[] |
no_license
|
momoliu88/leetCodePoj
|
892ccd046ab51192abb66d3d3392ebbfb0010dea
|
b30b635dd6fdb88348bae880274bd9c834e24813
|
refs/heads/master
| 2021-01-25T08:37:30.092903
| 2014-01-06T09:12:24
| 2014-01-06T09:12:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,812
|
cpp
|
bestTimeByAndSell.cpp
|
#include <iostream>
#include <vector>
#include <algorithm>
/*
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
prices里面存储的是每一天的股价,这个解法好奇妙。
*/
using namespace std;
//计算从位置s,到e的最大利润
int compute(int s,int e,vector<int>&prices){
int maxPrice = prices[e];
int profits = 0 ;
//从n到0计算,记住maxPrice。
for(int i = e;i>=s;i--){
maxPrice = max(prices[i],maxPrice);
profits = max(profits,maxPrice-prices[i]);
}
return profits;
}
int maxProfit(vector<int> &prices) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int len = prices.size();
if(len ==0) return 0;
return compute(0,len-1,prices);
}
/*
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
最多交易两次。
*/
int maxProfitIII(vector<int> &prices) {
int len = prices.size();
if(len ==0) return 0;
int ret = 0 ;
int pa[len+1];//pa表示第i天所能获得的最大利润。
int pb[len+1]; //pb表示第i天开始到最后一天所能获得的最大利润。pa,pb均只进行一次交易
int minP = prices[0];
int maxP = prices[len-1];
pb[len] = 0;
pa[0] = 0;
for(int i = 1 ; i <= len;i++){
pa[i] = max(pa[i-1],prices[i-1]-minP);
minP = min(minP,prices[i-1]);
}
for(int i = len-1;i>=0;i--){
pb[i] = max(pb[i+1],maxP-prices[i-1]);
maxP = max(maxP,prices[i-1]);
}
for(int i =1 ; i<=len;i++)
if(ret<(pa[i-1]+pb[i])) //pb[i]大于或等于pb[j](j>i),根据定义可以知道。
ret = pa[i-1]+pb[i];
return ret;
}
/*
Design an algorithm to find the maximum profit.
You may complete as many transactions as you like
(ie, buy one and sell one share of the stock multiple times).
However, you may not engage in multiple transactions at the same time
(ie, you must sell the stock before you buy again).
可以随意买卖股票。
*/
int maxProfitII(vector<int> &prices) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int len = prices.size();
if(len ==0) return 0;
int maxP = 0;
int s = prices[0];
int i ;
for( i =1;i<len;i++){
if(prices[i]>=prices[i-1]) continue;//如果数字持续增长,则不卖
maxP += prices[i-1] - s; //如果出现股价下降,则卖出,然后更新买进的价格。
s = prices[i];
}
maxP += prices[i-1] -s ;
return maxP;
}
int main()
{
vector<int> prices;
prices.push_back(5);
prices.push_back(2);
prices.push_back(8);
cout << maxProfitIII(prices)<<endl;
}
|
5c8d082403dc913fe4afef977ddd4c78f0d2c850
|
7b8db19c3024d0632a04eef7b727f3f4c1a0c8a9
|
/include/Chikpi.h
|
981aeb1080f8bb38a51c2d52bb0ed496d17b0ca0
|
[] |
no_license
|
samfan0429/chipi
|
3f6ff2d012cd984d72f2722639d313138a6bc302
|
685ca42f4c668bb5d5b056625f4e672a3407afbd
|
refs/heads/master
| 2023-03-07T03:09:02.477421
| 2021-02-18T04:43:37
| 2021-02-18T04:43:37
| 338,062,189
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 655
|
h
|
Chikpi.h
|
#ifndef CHIKPI_H
#define CHIKPI_H
# include <vector>
# include <memory>
# include <SFML/Graphics.hpp>
# include <SFML/Audio.hpp>
# include <SFML/Network.hpp>
# include <SFML/Window.hpp>
# include <SFML/System.hpp>
# include "Chikorita.h"
// Main Application
class Chikpi
{
private:
sf::RenderWindow* window;
sf::VideoMode videomode;
sf::Event ev;
// Objects
std::vector<std::shared_ptr<Chikorita>> piano;
void initvariables();
void initWindow();
void initChiko();
public:
Chikpi();
virtual ~Chikpi();
const bool running() const;
void pollEvents();
void update();
void render();
};
#endif
|
366b1203bd543b906cf186e7033c926014812bf2
|
bc7c7edb89c1ee4eb29ef076bfd6daeed09b5540
|
/IVideoCall.h
|
5ab88e56348e6577083955820bfdb12822b17143
|
[] |
no_license
|
FKLam/XPlay2
|
6f1327aa372717bb4463e37bffac435ed834e9f1
|
d2acd20904ea4ea6a273f43a2d3cdf5c63f99e60
|
refs/heads/main
| 2023-01-13T04:45:26.546089
| 2020-11-04T11:19:45
| 2020-11-04T11:19:45
| 309,979,650
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 210
|
h
|
IVideoCall.h
|
#ifndef IVIDEOCALL_H
#define IVIDEOCALL_H
struct AVFrame;
class IVideoCall
{
public:
virtual void init(int width, int height) = 0;
virtual void repaint(AVFrame *frame) = 0;
};
#endif // IVIDEOCALL_H
|
4368d0c4923d06140c13fb40a07bdcb4441ab000
|
ec64118889b66820893a51e3bd62c9af651a0bae
|
/100827/F.cpp
|
7bcb949b923fe52be0b0573f530f6df180227d75
|
[] |
no_license
|
ferambot/Heuristics-CodeForces-GYM
|
e237309bb84bc09afbefefe408985e8a9dfa8a0b
|
6600d929b24d4d540c921a2995a138c180b2acdf
|
refs/heads/master
| 2018-05-18T22:14:29.665971
| 2016-06-13T05:52:41
| 2016-06-13T05:52:41
| 61,010,468
| 0
| 0
| null | 2016-06-13T05:52:42
| 2016-06-13T05:52:42
| null |
UTF-8
|
C++
| false
| false
| 3,645
|
cpp
|
F.cpp
|
#include<bits/stdc++.h>
#define assn(n,a,b) assert(n<=b and n>=a)
#define pb push_back
#define mp make_pair
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define TR(v,it) for( LET(it,v.begin()) ; it != v.end() ; it++)
#define repi(i,n) for(int i=0; i<(int)n;i++)
#define sd(n) scanf("%d",&n)
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%lld",&n)
#define sortv(a) sort(a.begin(),a.end())
#define all(a) a.begin(),a.end()
using namespace std;
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
typedef long long LL;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector< PII > VPII;
#define MOD 1000000009ll
LL mpow(LL a, LL n)
{LL ret=1;LL b=a;while(n) {if(n&1)
ret=(ret*b)%MOD;b=(b*b)%MOD;n>>=1;}
return (LL)ret;}
int m;
LL bs[1<<8];
bool check(int m1, int m2){
if(bs[m1]==0 or bs[m2]==0)return false;
int k = m;
int rem = ((1<<k) - 1) & m1;
rem<<=k;
if((m2>>k)==(rem>>k))
{
int na = 0;
for(int i = 0; i<k; i++)
{
if((m1>>i)&1)
{
int ni = i-2;
if(ni>=0 and ni<k)
na |= (1<<ni);
ni = i+2;
if(ni>=0 and ni<k)
na |= (1<<ni);
}
}
for(int i = k; i<2*k; i++)
{
if((m1>>i)&1)
{
int ni = i-k-1;
if(ni>=0 and ni<k)
na |= (1<<ni);
ni = i-k+1;
if(ni>=0 and ni<k)
na |= (1<<ni);
}
}
if(na & m2)return false;
return true;
}
return false;
}
typedef vector<vector<LL> > matrix;
matrix mul(matrix A, matrix B)
{
int K=A.size();
matrix C(K, vector<LL>(K, 0));
for(int i=0; i<K; i++)
for(int j=0; j<K; j++)
for(int k=0; k<K; k++)
C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % MOD;
return C;
}
matrix poww(matrix A, int p)
{
if (p == 1)
return A;
if (p % 2)
return mul(A, poww(A, p-1));
matrix X = poww(A, p/2);
return mul(X, X);
}
bool val(int mask)
{
int k = m;
for(int i = 0; i<k; i++)
if( (mask>>i) & 1)
{
int ni = i-2;
if(ni>=0 and ni<k and ((mask)>>(k+ni))&1)return false;
ni = i+2;
if(ni>=0 and ni<k and ((mask)>>(k+ni))&1)return false;
}
return true;
}
int main()
{
int t;
sd(t);
while(t--){
int n,siz;
LL ans=0;
sd(m),sd(n);
siz=(1<<(2*m));
for(int i = 0; i<siz; i++)
if(val(i)) bs[i] = 1; else bs[i] = 0;
vector< vector<LL > > mat(siz, vector<LL>(siz, 0));
for(int i=0; i<(1<<(2*m)); i++)
for(int j=0; j<(1<<(2*m)); j++)
if(bs[i] and bs[j] and check(i, j))mat[i][j]=1;
matrix p=poww(mat, n); for(int i = 0; i<siz; i++)
{
ans += p[0][i]; if(ans>=MOD)ans-=MOD;
}
cout << ans << endl;
}
return 0;
}
|
a636b13ec6567746a0b27e9c7a0d9aea1fb53adc
|
064be87af31f133ce7dcaebffe6c123316722c8f
|
/main.cpp
|
6ec684b17f2586479b271a9ec0c03a655368a7e7
|
[] |
no_license
|
ablaylock/flexFun
|
04fd16a540c4e98dace93bdeb268551b281ee188
|
c876b4111e918129876634c3efb7470126303eb4
|
refs/heads/master
| 2021-01-23T20:18:49.253398
| 2015-08-05T22:02:28
| 2015-08-05T22:02:28
| 40,193,737
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 514
|
cpp
|
main.cpp
|
#include <QCoreApplication>
#define YY_NO_UNISTD_H
#include "pcl-hpgl.lexer.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
yyscan_t scanner;
FILE * inputFile = 0;
if (argc > 1)
inputFile = fopen(argv[1], "rb");
yylex_init( &scanner );
if(argc > 1 && inputFile)
yyset_in(inputFile,scanner);
else
yyset_in(stdin,scanner);
yylex(scanner);
yylex_destroy(scanner);
if(inputFile)
fclose(inputFile);
return a.exec();
}
|
66886ec09a806756eff4fc30b303c541cee0b57e
|
7b023901b432d348ca546c2be778959f821a9f2b
|
/Debug code/encoder_test/encoder_test.ino
|
6c7115672abe05d486bcc43828e3d3ac3ea9cc37
|
[] |
no_license
|
lws803/vincentthebot_02-02-01
|
5787721b7b1e9771ce5c718181b98122f9aeff71
|
32eb196c80ff903476ddcb67ceab6bcebb868e4e
|
refs/heads/master
| 2021-03-19T17:08:07.591954
| 2018-04-21T08:07:09
| 2018-04-21T08:07:09
| 118,619,983
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 599
|
ino
|
encoder_test.ino
|
int encoderValue_A = 0; // LEFT ENCODER TICKS
int encoderValue_B = 0; // RIGHT ENCODER TICKS
ISR(INT0_vect) {
encoderValue_A++;
Serial.print("LEFT TICKS: ");
Serial.println(encoderValue_A);
}
ISR(INT1_vect) {
encoderValue_B++;
Serial.print("RIGHT TICKS: ");
Serial.println(encoderValue_B);
}
void setupEINT() {
// Activate INT0 and INT1
EIMSK |= 0b00000011;
// Set to FALLING EDGE read
EICRA |= 0b00001010;
// Enable pull up resistors at respective pins
DDRD &= 0b11110011;
PIND |= 0b00001100;
}
void setup() {
Serial.begin(9600);
setupEINT();
}
void loop() {
// nothing
}
|
5abed2c7be2ce44944c261f41327671fa98a4d29
|
e59bdf0a80632fe25a3ef7bd09ed3f45feb406f8
|
/src/stats/http/ConnectionManager.h
|
d950bf98eef015354394b930e9bc48ef1b70c730
|
[
"Apache-2.0"
] |
permissive
|
neogenie/iqlogger
|
45e8798e31906d767be3b31b4bf446c5821327fe
|
7a3866046dd30282a35ce954dc4fd301452aa924
|
refs/heads/master
| 2020-12-13T23:29:59.358375
| 2020-07-01T19:21:33
| 2020-07-01T19:21:33
| 234,562,522
| 4
| 0
|
Apache-2.0
| 2020-07-01T19:21:35
| 2020-01-17T14:16:05
|
C++
|
UTF-8
|
C++
| false
| false
| 541
|
h
|
ConnectionManager.h
|
//
// Connection.h
// ~~~~~~~~~~~~~~~~
//
// Copyright (C) 2018 IQOption Software, Inc.
//
//
#pragma once
#include <set>
#include "Connection.h"
namespace iqlogger::stats::http {
class ConnectionManager
{
public:
ConnectionManager(const ConnectionManager&) = delete;
ConnectionManager& operator=(const ConnectionManager&) = delete;
ConnectionManager();
void start(ConnectionPtr c);
void stop(ConnectionPtr c);
void stop_all();
private:
std::set<ConnectionPtr> m_connections;
};
} // namespace iqlogger::stats::http
|
4520020351b9b7b9cf1e57fdb6580f10e90ae01f
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_1485490_0/C++/kouri128/C.cpp
|
862559943cc64afe588335b72a99f2a278f25894
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,237
|
cpp
|
C.cpp
|
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll solve(int ai, int bi, const vector<pair<ll, ll> > &a, vector<pair<ll, ll> > &b)
{
int N = a.size();
int M = b.size();
if (ai >= N)
{
return 0;
}
ll sum = 0;
ll ret = 0;
for (int i = bi; i < M; ++i)
{
ll use = 0;
if (a[ai].second == b[i].second)
{
use = b[i].first;
if (a[ai].first <= sum + b[i].first)
{
use = a[ai].first - sum;
}
sum = min(a[ai].first, sum + b[i].first);
}
b[i].first -= use;
ret = max(ret, sum + solve(ai + 1, i, a, b));
b[i].first += use;
}
return ret;
}
int main()
{
int T;
cin>>T;
for (int caseNum = 1; caseNum <= T; ++caseNum)
{
int N, M;
cin>>N>>M;
vector<pair<ll, ll> > a(N);
for (int i = 0; i < N; ++i)
{
cin>>a[i].first>>a[i].second;
}
vector<pair<ll, ll> > b(M);
for (int i = 0; i < M; ++i)
{
cin>>b[i].first>>b[i].second;
}
cout<<"Case #"<<caseNum<<": "<<solve(0, 0, a, b)<<endl;
}
return 0;
}
|
ec4b6a0dba631cc1d9ef2edb2d794f1cbfde923e
|
69c3a9292a8b76696695712329cd68b56a5ba2c8
|
/Volume 1/0188.cpp
|
bc06bca9b7f3d7611597358b88139427324f920d
|
[] |
no_license
|
yuta1024/aoj
|
ebbf7ccc03d1adf00c2301559a8d835fba5e4003
|
da24890eaf199f7eb2cb98bfed1bf7e1c533b586
|
refs/heads/master
| 2021-01-02T22:37:55.372004
| 2012-09-18T11:36:43
| 2012-09-18T11:36:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 560
|
cpp
|
0188.cpp
|
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
while (cin >> n) {
if (n == 0)
break;
vector<int> array(n);
for (int i = 0; i < n; ++i)
cin >> array[i];
int target;
cin >> target;
int ans = 0, low = 0, high = n-1;
while (low <= high) {
++ans;
int mid = (low + high) / 2;
if (array[mid] == target)
break;
else if (array[mid] < target)
low = mid+1;
else
high = mid-1;
}
cout << ans << endl;
}
return 0;
}
|
34f42128e51b94b557c55042f2719813b082bdc8
|
fffb0b9756b71ae1548dc483552f04e09e9d5851
|
/cc/STRS.cpp
|
82f5b89c7181a8a36fb7ffac59f77e3dca90b737
|
[] |
no_license
|
nandu6177/code-amrita
|
93ea5046f798253e4fb217c598af6f0b84f3ae7a
|
cb3cca21da7035fcd7262bf52b5058405c16998c
|
refs/heads/master
| 2021-05-11T04:31:12.764411
| 2018-05-06T11:51:17
| 2018-05-06T11:51:17
| 117,941,803
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 673
|
cpp
|
STRS.cpp
|
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
typedef long long ll;
using namespace std;
const ll mod=1000000007;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
int c=0;
for(int i=0;i<n;i++){
int c1=0,c2=0;
if(s[i]=='1'){
int j=i-1;
while(j>=0){
if(s[j]=='0')
c1++;
else
break;
j--;
}
i++;
while(i<n){
if(s[i]=='0')
c2++;
else
break;
i++;
}
i--;
}
c+=min(c1,c2);
}
cout<<c<<endl;
}
return 0;
}
|
0632bae60019440119c992a25291c55515388716
|
64f0c704da6a2855de79505bb93cdbaa26d29c91
|
/benchmark/benchmark.ino
|
248338352a14359e631aa35e43277e875c72b66b
|
[] |
no_license
|
ITstreet1/Arduino-Benchmark
|
622711bde5f38a2fc4b796aeb639a3469cc1c68d
|
82e28d3470badcadfe56875d9b220cd9a7749506
|
refs/heads/master
| 2021-05-14T08:30:53.340172
| 2018-01-04T19:47:43
| 2018-01-04T19:47:43
| 116,300,658
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,731
|
ino
|
benchmark.ino
|
//
// Pi_2
//
// Steve Curd
// December 2012
//
// This program approximates pi utilizing the Newton's approximation. It quickly
// converges on the first 5-6 digits of precision, but converges verrrry slowly
// after that. For example, it takes over a million iterations to get to 7-8
// significant digits.
//
// I wrote this to evaluate the performance difference between the 8-bit Arduino Mega,
// and the 32-bit Arduino Due.
//
#include <LCD5110_Graph.h>
#define ITERATIONS 100000L // number of iterations
#define FLASH 1000 // blink LED every 1000 iterations
int progress = 1;
LCD5110 myGLCD(8,9,10,11,12);
extern unsigned char SmallFont[];
extern unsigned char TinyFont[];
extern uint8_t pi[];
char piArray[15];
char timeArray[15];
int percent = 0;
void setup() {
myGLCD.InitLCD();
myGLCD.setContrast(50);
myGLCD.clrScr();
myGLCD.drawBitmap(14, 0, pi, 84, 48);
myGLCD.update();
delay(2000);
pinMode(13, OUTPUT); // set the LED up to blink every 1000 iterations
Serial.begin(57600);
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
myGLCD.print("PI:",0,0);
myGLCD.print("TIME:",0,20);
printBar();
myGLCD.update();
}
void loop() {
unsigned long start, time;
unsigned long niter=ITERATIONS;
int LEDcounter = 0;
boolean alternate = false;
unsigned long i, count=0;
float x = 1.0;
float temp, pi=1.0;
Serial.print("Beginning ");
Serial.print(niter);
Serial.println(" iterations...");
Serial.println();
start = millis();
for ( i = 2; i < niter; i++) {
x *= -1.0;
pi += x / (2.0f*(float)i-1.0f);
if (LEDcounter++ > FLASH) {
LEDcounter = 0;
progress++;
percent = progress*100/(ITERATIONS/FLASH);
fillBar(percent);
if (alternate) {
digitalWrite(13, HIGH);
alternate = false;
} else {
digitalWrite(13, LOW);
alternate = true;
}
temp = 40000000.0 * pi;
}
}
time = millis() - start;
pi = pi * 4.0;
itoa(time,timeArray,10);
convertToString(pi);
myGLCD.print(piArray,18,0);
myGLCD.print(timeArray,30,20);
myGLCD.print("ms",60,20);
myGLCD.update();
Serial.print("# of trials = ");
Serial.println(niter);
Serial.print("Estimate of pi = ");
Serial.println(pi, 10);
Serial.print("Time: "); Serial.print(time); Serial.println(" ms");
delay(100000);
}
void printBar()
{
myGLCD.drawRect(2, 35, 81, 40);
myGLCD.update();
}
void fillBar(int percent)
{
percent = map(percent,0,100,2,81);
myGLCD.drawLine(2, 36, percent, 36);
myGLCD.drawLine(2, 37, percent, 37);
myGLCD.drawLine(2, 38, percent, 38);
myGLCD.drawLine(2, 39, percent, 39);
myGLCD.update();
}
void convertToString(float number)
{
dtostrf(number, 10, 7, piArray);
}
|
7d5fb648ea18ef3dcbe7e1461faeefa5d6825c62
|
45de2d5cd1750df0c0c8b473637960b733dc8858
|
/src/Model/Model.cpp
|
d5d43f2f1c7410f61c014900dd394afb7480fe25
|
[
"MIT"
] |
permissive
|
MericLuc/ModelGenerator
|
51ab5a8feb859b6c7e1db382002501defa5ef50e
|
2610909eed0c3aafcf0a43d11eb867e0f0863fa5
|
refs/heads/main
| 2023-01-30T09:05:06.227283
| 2020-12-18T13:33:21
| 2020-12-18T13:33:21
| 322,583,110
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 25,016
|
cpp
|
Model.cpp
|
/*!
* @file Model.cpp
* @brief Implementations of the functions defined in \a Model.h
* @author lhm
* @date 16/07/2019
*/
#include <errno.h>
#include <limits>
#include "Logger.h"
#include "Model.h"
#include "Exception.h"
#include "Conf_format.h"
#include "Message.h"
#include "Header.h"
#include "State.h"
#include "Field.h"
namespace ModGen {
using namespace std;
////////////////////////////////////////////////////////////////////////
bool parsingHelper::isEqual(const char* p_1, const char* p_2)
{
return (strncmp(p_1, p_2, MAX_NAME_SIZE) == 0);
}
map<Model::MODELSTATE, string> Model::stateString = {
{Model::NOT_INITIALIZED, "Model not initialized"},
{Model::INITIALIZED, "Model initialized" },
{Model::RUNNING, "Model running" },
{Model::STOPPED, "Model stopped" }
};
////////////////////////////////////////////////////////////////////////
Model::Model() :
confFile(nullptr),
curState(nullptr),
nexState(nullptr),
currentStateStr(NOT_INITIALIZED),
modelVar(map<string,int>()),
modelMes(map<string, Message>()),
modelHead(map<string, Header>())
{}
////////////////////////////////////////////////////////////////////////
Model::~Model()
{
if(confFile)
{
delete confFile;
}
}
////////////////////////////////////////////////////////////////////////
State* Model::getNextState()
{
if(!getInstance().nexState)
{
ERROR("Error - Unable to run the model - no valid state found.");
throw Exception::IntegrityCheckException<Model>("Unable to run the model - no valid state found.");
}
return getInstance().nexState;
}
////////////////////////////////////////////////////////////////////////
State* Model::getCurrState()
{
if(!getInstance().curState)
{
ERROR("Error - Unable to run the model - no valid state found.");
throw Exception::IntegrityCheckException<Model>("Unable to run the model - no valid state found.");
}
return getInstance().curState;
}
////////////////////////////////////////////////////////////////////////
Model& Model::getInstance()
{
static Model l_instance;
return l_instance;
}
////////////////////////////////////////////////////////////////////////
const string& Model::getStateString()
{
return stateString[getInstance().currentStateStr];
}
////////////////////////////////////////////////////////////////////////
const map<string, int>& Model::getVariables()
{
return getInstance().modelVar;
}
////////////////////////////////////////////////////////////////////////
const map<string, Message>& Model::getMessages()
{
return getInstance().modelMes;
}
////////////////////////////////////////////////////////////////////////
const map<string, Header>& Model::getHeaders()
{
return getInstance().modelHead;
}
////////////////////////////////////////////////////////////////////////
const map<string, State>& Model::getStates()
{
return getInstance().modelState;
}
////////////////////////////////////////////////////////////////////////
void Model::log()
{
string l_return = "\n\t\t------ VARIABLES ------\n";
for(auto& t : Model::getVariables() )
{
l_return += t.first + " " + to_string(t.second);
}
l_return += "\n\t\t------ MESSAGES ------\n";
for(auto& t : Model::getMessages() )
{
l_return += t.second.getDesc();
}
l_return += "\n\t\t------ HEADERS ------\n";
for(auto& t : Model::getHeaders() )
{
l_return += t.second.getDesc();
}
l_return += "\n\t\t------ STATES ------\n";
for(auto& t : Model::getStates() )
{
l_return += t.second.getDesc();
}
INFO(l_return);
}
////////////////////////////////////////////////////////////////////////
void Model::addVariable(const string& p_name, int p_val)
{
getInstance().modelVar[p_name] = p_val;
}
////////////////////////////////////////////////////////////////////////
void Model::operateVariable(const string& p_name,
const OPERATION& p_operation,
int p_value)
{
ModelVar &l_vars = getInstance().modelVar;
if(l_vars.find(p_name) == l_vars.end())
{
ERROR("Error - Trying to operate undefined model variable (" + p_name + ").");
throw Exception::ParsingFileError("Trying to operate undefined model variable (" + p_name + ").");
}
switch(p_operation)
{
case ADD: l_vars[p_name] += p_value; break;
case SUB: l_vars[p_name] -= p_value; break;
case DEL: l_vars.erase(p_name); break;
//default:
// throw Exception::UnimplementedElement<OPERATION>(p_operation);
}
}
////////////////////////////////////////////////////////////////////////
void Model::initializeVariables(const pugi::xml_document& p_doc)
{
pugi::xml_node tools = p_doc.child(Conf_format::root.c_str()).child(Variables_format::balise.c_str());
for (pugi::xml_node tool = tools.first_child(); tool; tool = tool.next_sibling())
{
string l_currVar = "";
int l_currVal = -1;
for (pugi::xml_attribute attr = tool.first_attribute(); attr; attr = attr.next_attribute())
{
if(!strncmp(attr.name(), Variables_format::name.c_str(), MAX_NAME_SIZE))
{
l_currVar = attr.value();
}
else if(!strncmp(attr.name(), Variables_format::init.c_str(), MAX_NAME_SIZE))
{
errno = 0;
char *ptr;
l_currVal = strtol(attr.value(), &ptr, 10);
if ((errno == ERANGE &&
(l_currVal == numeric_limits<long>::max() || l_currVal == numeric_limits<long>::min())) ||
(errno != 0 && l_currVal == 0) ||
ptr == attr.value())
{
ERROR("Error - Invalid format for 'init' variable model parameter.");
throw Exception::ParsingFileError("Invalid value for variable initialization.");
}
}
else
{
ERROR("Error - Invalid format of the variable model");
throw Exception::ParsingFileParamError<Model>(string(attr.name()));
}
if(!l_currVar.empty() && l_currVal != -1)
{
getInstance().modelVar[l_currVar] = l_currVal;
}
}
}
}
////////////////////////////////////////////////////////////////////////
void Model::initializeMessages(const pugi::xml_document& p_doc)
{
pugi::xml_node tools = p_doc.child(Conf_format::root.c_str()).child(Messages_format::balise.c_str());
for (pugi::xml_node tool = tools.first_child(); tool; tool = tool.next_sibling())
{
Message l_currentMesg;
for (pugi::xml_attribute attr = tool.first_attribute(); attr; attr = attr.next_attribute())
{
l_currentMesg.setParam(attr.name(), attr.value());
}
// Message valide (tous les champs obligatoires sont renseignés)
if(!l_currentMesg.isValid())
{
ERROR("Error - Unable to retrieve mandatory parameters for the current message.");
throw Exception::ParsingFileError("Unable to retrive every mandatory parameters the for current Message.");
}
// Message en doublon (ID déjà existant)
else if( getInstance().modelMes.find(l_currentMesg.getId()) != getInstance().modelMes.end() )
{
ERROR("Error - A message with ID (" + l_currentMesg.getId() + ") already exists.");
throw Exception::ParsingFileError("A message with ID (" + l_currentMesg.getId() + ") already exists.");
}
// Ajouter le message à la liste
getInstance().modelMes[l_currentMesg.getId()] = l_currentMesg;
DEBUG("Added a new message (" + l_currentMesg.getId() + ") to the model.");
}
}
////////////////////////////////////////////////////////////////////////
void Model::initializeHeaders(const pugi::xml_document& p_doc)
{
pugi::xml_node tools = p_doc.child(Conf_format::root.c_str()).child(Headers_format::balise.c_str());
// Parcours des headers
for (pugi::xml_node tool = tools.first_child(); tool; tool = tool.next_sibling())
{
Header l_currHeader;
// Paramètres du header courant
for (pugi::xml_attribute attr = tool.first_attribute(); attr; attr = attr.next_attribute())
{
l_currHeader.setParam(attr.name(),attr.value());
}
// Fields du header courant
for (pugi::xml_node fields = tool.first_child(); fields; fields = fields.next_sibling())
{
Field* l_currField = Field_Creator::Create(fields.name());
// Paramètres du champ courant
for (pugi::xml_attribute attr = fields.first_attribute(); attr; attr = attr.next_attribute())
{
l_currField->setParam(attr.name(), attr.value());
}
if(!l_currField->isValid())
{
ERROR("Error - Unable to retrieve mandatory parameters for the current Field (" + string(fields.name()) + ").");
throw Exception::ParsingFileError("Unable to retrive every mandatory parameters for current Field (" + string(fields.name()) + ").");
}
l_currHeader.addField(l_currField);
}
if(!l_currHeader.isValid())
{
ERROR("Error - Unable to retrieve mandatory parameters for the current Header.");
throw Exception::ParsingFileError("Unable to retrive every mandatory parameters for current Header.");
}
// Header en doublon (ID déjà existant)
else if( getInstance().modelHead.find(l_currHeader.getId()) != getInstance().modelHead.end() )
{
ERROR("Error - A header with ID (" + l_currHeader.getId() + ") already exists");
throw Exception::ParsingFileError("A header with ID (" + l_currHeader.getId() + ") already exists.");
}
getInstance().modelHead[l_currHeader.getId()] = l_currHeader;
DEBUG("Added a new header (" + l_currHeader.getId() + ") to the model.");
}
}
////////////////////////////////////////////////////////////////////////
void Model::initializeStates(const pugi::xml_document& p_doc)
{
pugi::xml_node tools = p_doc.child(Conf_format::root.c_str()).child(State_format::balise.c_str());
for (pugi::xml_node tool = tools.first_child(); tool; tool = tool.next_sibling())
{
State l_currentState;
if( strncmp(tool.name(), State_format::balise_2.c_str(), MAX_NAME_SIZE) )
{
ERROR("Error - Unable to retrieve the state balise");
throw Exception::ParsingFileBaliseError<State>(tool.name());
}
for (pugi::xml_attribute attr = tool.first_attribute(); attr; attr = attr.next_attribute())
{
l_currentState.setParam(attr.name(), attr.value());
}
// State valide (tous les champs obligatoires sont renseignés)
if(!l_currentState.isValid())
{
ERROR("Error - Unable to retrieve the mandatory parameters for current state.");
throw Exception::ParsingFileError("Unable to retrive every mandatory parameters for current State.");
}
// State en doublon (ID déjà existant)
else if( getInstance().modelState.find(l_currentState.getId()) != getInstance().modelState.end() )
{
ERROR("Error - A state with ID (" + l_currentState.getId() + ") already exists." );
throw Exception::ParsingFileError("A state with ID (" + l_currentState.getId() + ") already exists.");
}
// Ajouter le message à la liste
getInstance().modelState[l_currentState.getId()] = l_currentState;
DEBUG("Added a new State (" + l_currentState.getId() + ") to the model.");
// Add the first parsed state as start state
if(!getInstance().curState && !getInstance().nexState)
{
getInstance().curState = &getInstance().modelState[l_currentState.getId()];
getInstance().nexState = &getInstance().modelState[l_currentState.getId()];
}
for (pugi::xml_node next_lvl = tool.first_child(); next_lvl; next_lvl = next_lvl.next_sibling())
{
if( parsingHelper::isEqual(next_lvl.name(), StateOp_format::balise.c_str()) )
{
// DEBUG("BOUCLAGE SUR LES OPERATIONS");
Operation l_currentOp;
for (pugi::xml_node trans = next_lvl.first_child(); trans; trans = trans.next_sibling())
{
// Mauvaise balise (<Op> attendue)
if( !parsingHelper::isEqual(trans.name(), StateOp_format::balise_2.c_str()) )
{
throw Exception::ParsingFileBaliseError<Operation>(trans.name());
}
// Parcours des paramètres
for (pugi::xml_attribute trans_param = trans.first_attribute(); trans_param; trans_param = trans_param.next_attribute())
{
// On vérifie que la variable référencée existe
if( parsingHelper::isEqual(trans_param.name(), StateOp_format::var.c_str()) )
{
if( getInstance().modelVar.find(trans_param.value()) == getInstance().modelVar.end() )
{
throw Exception::UnimplementedElement<Variables_format>(trans_param.value());
}
l_currentOp.setVariable( getInstance().modelVar[trans_param.value()] );
}
l_currentOp.setParam(trans_param.name(), trans_param.value());
}
}
if(!l_currentOp.isValid())
{
ERROR("Error - Not enough informations for operation initialization.");
throw Exception::ParsingFileError("Not enough informations for operation initialization.");
}
getInstance().modelState[l_currentState.getId()].addOperation(l_currentOp);
}
else if( parsingHelper::isEqual(next_lvl.name(), StateTransition_format::balise.c_str()) )
{
// DEBUG("BOUCLAGE SUR LES TRANSITIONS");
for (pugi::xml_node trans = next_lvl.first_child(); trans; trans = trans.next_sibling())
{
Transition *l_currentTrans = nullptr;
string l_currentDestName;
// On a soit <Loop> soit <Transit>
// Balise <Loop>
if(parsingHelper::isEqual(trans.name(), StateTransitionLoop_format::balise.c_str()))
{
l_currentTrans = new LoopTransition();
l_currentTrans->setDestState(&getInstance().modelState[l_currentState.getId()]);
l_currentTrans->setParam(StateTransition_format::dest, l_currentState.getId());
// Parcours des paramètres
for (pugi::xml_attribute trans_param = trans.first_attribute(); trans_param; trans_param = trans_param.next_attribute())
{
l_currentTrans->setParam(trans_param.name(), trans_param.value());
}
}
// Balise <Transit>
else if(parsingHelper::isEqual(trans.name(), StateTransition_format::balise_2.c_str()))
{
//State* l_destState = nullptr;
for (pugi::xml_attribute transit_param = trans.first_attribute(); transit_param; transit_param = transit_param.next_attribute())
{
// Mauvais paramètre (dest_state attendu)
if( !parsingHelper::isEqual(transit_param.name(), StateTransition_format::dest.c_str()) )
{
throw Exception::ParsingFileBaliseError<StateTransition_format>(trans.name());
}
l_currentDestName = transit_param.value();
}
// On parcourt les enfants pour voir si c'est un Delay ou un Var
for (pugi::xml_node trans_3 = trans.first_child(); trans_3; trans_3 = trans_3.next_sibling())
{
// Var
if(parsingHelper::isEqual(trans_3.name(), StateTransitionCondVar_format::balise.c_str()))
{
l_currentTrans = new VarConditionTransition();
}
// Delay
else if(parsingHelper::isEqual(trans_3.name(), StateTransitionCondDelay_format::balise.c_str()))
{
l_currentTrans = new DelayConditionTransition();
}
else
{
throw Exception::UnimplementedElement<StateTransition_format>(trans_3.value());
}
//l_currentTrans->setDestState(l_destState);
l_currentTrans->setParam(StateTransition_format::dest, l_currentDestName);
for (pugi::xml_attribute param_3 = trans_3.first_attribute();
param_3; param_3 = param_3.next_attribute())
{
l_currentTrans->setParam(param_3.name(), param_3.value());
}
}
}
else
{
ERROR("Error - Could not correctly parse the current transition.");
throw Exception::ParsingFileBaliseError<StateTransition_format>(trans.name());
}
if(!l_currentTrans)
{
ERROR("Error - Unable to parse a Transition.");
throw Exception::ParsingFileError("Unable to parse a Transition.");
}
else if(!l_currentTrans->isValid())
{
// ICI
ERROR("Error - Not enough informations for operation initialization.");
throw Exception::ParsingFileError("Not enough informations for Transition initialization.");
}
getInstance().modelState[l_currentState.getId()].addTransition(*l_currentTrans);
}
}
else if( parsingHelper::isEqual(next_lvl.name(), StateMessage_format::balise.c_str()) )
{
// DEBUG("BOUCLAGE SUR LES MESSAGES");
for (pugi::xml_node mesg = next_lvl.first_child(); mesg; mesg = mesg.next_sibling())
{
// Mauvaise balise (<State_Mesg> attendue)
if( !parsingHelper::isEqual(mesg.name(), StateMessage_format::balise_2.c_str()) )
{
throw Exception::ParsingFileBaliseError<StateMessage_format>(mesg.name());
}
// Parcours des paramètres
for (pugi::xml_attribute mesg_param = mesg.first_attribute(); mesg_param; mesg_param = mesg_param.next_attribute())
{
// Pas le bon paramètre ("name" attendu)
if( !parsingHelper::isEqual(mesg_param.name(), StateMessage_format::name.c_str()) )
{
throw Exception::ParsingFileParamError<StateMessage_format>(mesg_param.name());
}
// Pas la bonne valeur (le message doit exister)
if( getInstance().modelMes.find(mesg_param.value()) == getInstance().modelMes.end() )
{
throw Exception::UnimplementedElement<StateMessage_format>(mesg_param.value());
}
else {
getInstance().modelState[l_currentState.getId()].addMessage(
&getInstance().modelMes[mesg_param.value()]);
}
}
}
}
else
{
throw Exception::ParsingFileBaliseError<State>(next_lvl.name());
}
}
}
}
////////////////////////////////////////////////////////////////////////
void Model::checkIntegrity()
{
// Parcourt toutes les transitions de tous les états
// pour mettre à jour l'état de destination
for(auto& l_states: getInstance().modelState )
{
for(auto& l_transitions: l_states.second.getTransitions())
{
auto& l_destStateName = l_transitions->getDestStateName();
if(getInstance().modelState.find(l_destStateName) == getInstance().modelState.end() )
{
ERROR("Error - Model error - Integrity check failed.");
throw Exception::IntegrityCheckException<Transition>(l_destStateName);
}
l_transitions->setDestState(&getInstance().modelState[l_destStateName]);
}
}
// Parcourt toutes les transitions de tous les états
// pour mettre à jour la variable sur laquelle ils opèrent
for(auto& l_states: getInstance().modelState )
{
for(auto& l_transitions: l_states.second.getTransitions())
{
auto l_varName = l_transitions->getVar();
if(!l_varName.empty() && getInstance().modelVar.find(l_varName) == getInstance().modelVar.end() )
{
ERROR("Error - Model error - Integrity check failed.");
throw Exception::IntegrityCheckException<Transition>(l_varName);
}
l_transitions->setVar(getInstance().modelVar[l_varName]);
}
}
// Parcourt tous les messages du modèle
// pour mettre à jour le Header qu'ils référencent
for(auto& l_messages: getInstance().modelMes )
{
auto& l_messageHeaderName = l_messages.second.getHeaderName();
if(getInstance().modelHead.find(l_messageHeaderName) == getInstance().modelHead.end() )
{
ERROR("Error - Model error - Integrity check failed.");
throw Exception::IntegrityCheckException<Message>(l_messageHeaderName);
}
l_messages.second.setHeader(&getInstance().modelHead[l_messageHeaderName]);
}
DEBUG("Model Integrity successfully checked.");
}
////////////////////////////////////////////////////////////////////////
void Model::clear()
{
if(getInstance().curState)
{
getInstance().curState = nullptr;
}
if(getInstance().nexState)
{
getInstance().nexState = nullptr;
}
getInstance().modelVar.clear();
getInstance().modelMes.clear();
getInstance().modelHead.clear();
getInstance().modelState.clear();
}
////////////////////////////////////////////////////////////////////////
void Model::setup(const string& p_filePath)
{
getInstance().currentStateStr = NOT_INITIALIZED;
clear();
if(getInstance().confFile)
{
delete getInstance().confFile;
}
getInstance().confFile = new string(p_filePath);
if(!getInstance().confFile)
{
ERROR("Error - Could not create the required pointer to the configuration file.");
throw Exception::ParsingFileError("Could not create the required pointer to the configuration file.");
}
pugi::xml_document l_doc;
pugi::xml_parse_result l_result = l_doc.load_file(getInstance().confFile->c_str());
DEBUG("Configuration file set to " + *getInstance().confFile);
if (!l_result)
{
ERROR("Error - Configuration file parsing failed (position " + to_string(l_result.offset) + ").");
throw Exception::ParsingFileError(l_result.description(), l_result.offset);
}
initializeVariables(l_doc); // Initialisation des variables du modèle
initializeMessages(l_doc); // Initialisation des messages du modèle
initializeHeaders(l_doc); // Initialisation des headers du modèle
initializeStates(l_doc); // Initialisation des états du modèle
checkIntegrity(); // Controles finaux d'intégrité du modele
getInstance().currentStateStr = INITIALIZED;
DEBUG("Configuration file parsed successfully.");
}
} // namespace ModGen
|
3bd4837a2700ecd6a0432ee516ad16fcb9f9812e
|
053bbaca722485b50c0fb766e9b7badd1a4b7757
|
/native/recog/src/coins.cpp
|
64107ae76ab1b3145048986c9ec8ca4d5b0e1d79
|
[] |
no_license
|
jfmwz/scaladays2013
|
b7bb48534dba31e26ff291186240128088b80de0
|
dc1ee95e03d971eef1f33a543742a618d7fa9ce2
|
refs/heads/master
| 2020-12-25T09:28:08.931588
| 2013-06-12T19:12:12
| 2013-06-12T19:12:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,394
|
cpp
|
coins.cpp
|
#include "coins.h"
#include <opencv2/gpu/gpu.hpp>
using namespace eigengo::akka;
std::vector<Coin> CoinCounter::countCpu(const cv::Mat &image) {
using namespace cv;
std::vector<Coin> coins;
Mat dst;
std::vector<Vec3f> circles;
cvtColor(image, dst, CV_BGR2GRAY);
GaussianBlur(dst, dst, Size(9, 9), 3, 3);
threshold(dst, dst, 150, 255, THRESH_BINARY);
GaussianBlur(dst, dst, Size(3, 3), 3, 3);
//Canny(dst, dst, 1000, 1700, 5);
HoughCircles(dst, circles, CV_HOUGH_GRADIENT,
1, // dp
60, // min dist
200, // canny1
20, // canny2
30, // min radius
100 // max radius
);
for (size_t i = 0; i < circles.size(); i++) {
Coin coin;
coin.center = circles[i][0];
coin.radius = circles[i][1];
coins.push_back(coin);
}
#ifdef TEST
Mat x(image);
for (size_t i = 0; i < circles.size(); i++ ) {
Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
int radius = cvRound(circles[i][2]);
// draw the circle center
circle(x, center, 3, Scalar(0,255,0), -1, 8, 0 );
// draw the circle outline
circle(x, center, radius, Scalar(0,0,255), 3, 8, 0 );
}
cv::imshow("", dst);
cv::waitKey();
#endif
return coins;
}
std::vector<Coin> CoinCounter::countGpu(const cv::Mat &cpuImage) {
std::vector<Coin> coins;
cv::gpu::GpuMat image(cpuImage);
cv::gpu::GpuMat dst;
cv::gpu::GpuMat circlesMat;
cv::gpu::cvtColor(image, dst, CV_BGR2GRAY);
cv::gpu::GaussianBlur(dst, dst, cv::Size(3, 3), 2, 2);
cv::gpu::Canny(dst, dst, 1000, 1700, 5);
cv::gpu::GaussianBlur(dst, dst, cv::Size(9, 9), 3, 3);
cv::gpu::HoughCircles(dst, circlesMat, CV_HOUGH_GRADIENT,
1, // dp
40, // min dist
100, // canny1
105, // canny2
10, // min radius
200 // max radius
);
std::vector<cv::Vec3f> circles;
cv::gpu::HoughCirclesDownload(circlesMat, circles);
for (size_t i = 0; i < circles.size(); i++) {
Coin coin;
coin.center = circles[i][0];
coin.radius = circles[i][1];
bool dup = false;
for (size_t j = 0; j < coins.size(); j++) {
if (coins.at(j).center == coin.center ||
coins.at(j).radius == coin.radius) {
dup = true;
break;
}
}
if (!dup) coins.push_back(coin);
}
return coins;
}
std::vector<Coin> CoinCounter::count(const cv::Mat &image) {
//if (cv::gpu::getCudaEnabledDeviceCount() > 0) return countGpu(image);
return countCpu(image);
}
|
71dfb72cf836b7792ffc69f94c91d9f1eaaabb95
|
3355e6cfe368490bdacdacb153cc8bea0b3a807d
|
/02-CPP/Leetcode/Leetcode/栈_队列/_0239_滑动窗口最大值.hpp
|
9b6f4627f841eb08fd3d42c381a4b87375bfc78c
|
[] |
no_license
|
CoderLiLe/DataStructureAlgorithm
|
1ecf077efbf19f3f08ee05879c9e2c1fa48dd736
|
f552e8d5e2f2b531e5b90dd0f16fd9208f0feadb
|
refs/heads/master
| 2021-11-19T09:27:15.688142
| 2021-10-12T12:10:47
| 2021-10-12T12:10:47
| 187,794,975
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 478
|
hpp
|
_0239_滑动窗口最大值.hpp
|
//
// _0239_滑动窗口最大值.hpp
// Leetcode
//
// Created by LiLe on 2021/7/22.
//
#ifndef _0239_________hpp
#define _0239_________hpp
#include <stdio.h>
#include <vector>
using namespace std;
/**
方法一:优先队列
*/
vector<int> maxSlidingWindow1(vector<int>& nums, int k);
/**
方法二:单调队列
*/
vector<int> maxSlidingWindow2(vector<int>& nums, int k);
vector<int> maxSlidingWindow3(vector<int>& nums, int k);
#endif /* _0239_________hpp */
|
da45bc677fba79bf661adaab43dcf837e3e4cb57
|
4fd74bb075e42bb91f99714c9fcddeedaaaad9db
|
/BST-Class-Implementation.cpp
|
eeac707130bd7b750653c16192c1ef05c7089517
|
[] |
no_license
|
rudrashisgorai/Random-Codes-in-Cpp
|
1a5f0f7bb27489cbf692929c2f92c00ae4794800
|
3c39d3607fb90aba72db65ed670c7e66e5301e3d
|
refs/heads/master
| 2023-03-13T22:24:33.167179
| 2021-03-07T15:46:08
| 2021-03-07T15:46:08
| 270,800,059
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,206
|
cpp
|
BST-Class-Implementation.cpp
|
/**************
* Following is BinaryTreeNode class -
template <typename T>
class BinaryTreeNode {
public:
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
* Foloowing is main function which we are using internally
int main(){
BST *tree = new BST();
int choice, input;
while(true){
cin>>choice;
switch(choice){
case 1:
cin >> input;
tree->insert(input);
break;
case 2:
cin >> input;
tree->deleteData(input);
break;
case 3:
cin >> input;
if(tree->hasData(input)) {
cout << "true" << endl;
}
else {
cout << "false" << endl;
}
break;
default:
tree->printTree();
return 0;
break;
}
}
}
*******************/
class BST {
// Complete this class
BinaryTreeNode<int>* root ;
public :
~BST() {
root = makeEmpty(root);
}
bool hasData(int data){
return search(root,data);
}
void insert(int x) {
root = insert(x, root);
}
void deleteData(int x) {
root = remove(x, root);
}
void printTree() {
inorder(root);
cout << endl;
}
private:
bool search(BinaryTreeNode<int>* root, int data){
if(!root) return false ;
if(root->data == data )return true ;
if(root -> data > data ) return search(root->left,data);
if(root -> data <data ) return search(root->right,data);
}
BinaryTreeNode<int>* makeEmpty(BinaryTreeNode<int>* t) {
if(t == NULL)
return NULL;
{
makeEmpty(t->left);
makeEmpty(t->right);
delete t;
}
return NULL;
}
BinaryTreeNode<int>* insert(int x, BinaryTreeNode<int>* t)
{
if(t == NULL)
{
t = new BinaryTreeNode<int>(x);
t->left = t->right = NULL;
}
else if(x < t->data)
t->left = insert(x, t->left);
else if(x > t->data)
t->right = insert(x, t->right);
return t;
}
BinaryTreeNode<int>* findMin(BinaryTreeNode<int>* t)
{
if(t == NULL)
return NULL;
else if(t->left == NULL)
return t;
else
return findMin(t->left);
}
BinaryTreeNode<int>* findMax(BinaryTreeNode<int>* t) {
if(t == NULL)
return NULL;
else if(t->right == NULL)
return t;
else
return findMax(t->right);
}
BinaryTreeNode<int>* remove(int x, BinaryTreeNode<int>* t) {
BinaryTreeNode<int>* temp;
if(t == NULL)
return NULL;
else if(x < t->data)
t->left = remove(x, t->left);
else if(x > t->data)
t->right = remove(x, t->right);
else if(t->left && t->right)
{
temp = findMin(t->right);
t->data = temp->data;
t->right = remove(t->data, t->right);
}
else
{
temp = t;
if(t->left == NULL)
t = t->right;
else if(t->right == NULL)
t = t->left;
delete temp;
}
return t;
}
void inorder(BinaryTreeNode<int>* t) {
if(t == NULL)
return;
cout << t->data <<":";
if(t->left) cout<<"L:"<<t->left->data<<",";
if(t->right)cout<<"R:"<<t->right->data<<endl;
else cout<<endl;
inorder(t->left);
inorder(t->right);
}
BinaryTreeNode<int>* find(BinaryTreeNode<int>* t, int x) {
if(t == NULL)
return NULL;
else if(x < t->data)
return find(t->left, x);
else if(x > t->data)
return find(t->right, x);
else
return t;
}
};
|
2851c58cd7cae4de28d1f190c093633a1927880d
|
28a4804ff4937dd1e3a8640505ede7cdb8de9428
|
/src/ast/return.cpp
|
503a7830ef2db0ad902857d8290061b8e2da8ce0
|
[] |
no_license
|
peteb/thesis
|
ada448f9c25066581a496366e32efcdfc94babd4
|
ebd49859b2e3505f6cca9c8c333e55c8679f8be5
|
refs/heads/master
| 2021-01-10T06:15:17.607586
| 2018-12-17T20:53:29
| 2018-12-17T20:53:29
| 47,706,338
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,117
|
cpp
|
return.cpp
|
/*
* $Id: return.cpp 1091 2010-04-18 23:07:50Z ptr $
* thorn-llvm
*
* (c) Copyright 2010 Peter Backman. All Rights Reserved.
*/
#include "return.h"
#include "lexscope.h"
#include "lexentry.h"
#include "builder.h"
#include "visitor.h"
#include <llvm/IR/Module.h>
using namespace llvm;
AST::Return::Return(AST::Expression * value) {
_value = value;
}
AST::Return::~Return() {
delete _value;
}
llvm::Value * AST::Return::genCode(Builder & builder) const {
assert(_value);
Value * retval = _value->genCode(builder);
builder.CreateStoreReturn(retval, 0);
builder.CreateBranchToRet();
Function * func = builder.irb().GetInsertBlock()->getParent();
BasicBlock * contbb = BasicBlock::Create(
builder.getModule()->getContext(), "after_ret", func
);
builder.irb().SetInsertPoint(contbb);
builder.irb().CreateUnreachable();
return retval;
}
void AST::Return::accept(AST::Visitor & visitor) {
visitor.visit(*this);
}
AST::Expression * AST::Return::getValue() const {
return _value;
}
|
4caca3560fd1467c5776419d40df8c9d240c4c15
|
b04636f31f716c21a6c0d77bc49b876bc496fff7
|
/Olympiad/CST 2019/Thầy Vận/QG07/samac.cpp
|
cd79f4af99cfed33d65f87348a8721c886ffa85a
|
[] |
no_license
|
khanhvu207/competitiveprogramming
|
736b15d46a24b93829f47e5a7dbcf461f4c30e9e
|
ae104488ec605a3d197740a270058401bc9c83df
|
refs/heads/master
| 2021-12-01T00:52:43.729734
| 2021-11-23T23:29:31
| 2021-11-23T23:29:31
| 158,355,181
| 19
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,223
|
cpp
|
samac.cpp
|
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
#define x first
#define y second
typedef pair<int, int> island;
typedef pair<double, pair<double, int> > SNode;
const double eps=1e-9;
int n;
island a[6555];
double d;
map<double, double> t;
map<pair<double, int>, double> V;
map<pair<double, int>, bool> vst;
priority_queue<SNode, vector<SNode>, greater<SNode> > q;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
freopen("samac.inp", "r", stdin);
freopen("samac.out", "w", stdout);
cin >> n;
for (int i=0; i<n; ++i)
cin >> a[i].x >> a[i].y;
cin >> d;
cin >> a[n].y;
a[n].x=1e9+1;
++n;
for (int i=0; i<n; ++i)
{
double x=abs(a[i].y-d);
V[{x, i}]=x;
q.push({V[{x, i}], {x, i}});
}
while (!q.empty())
{
double vol=q.top().x;
double dist=q.top().y.x;
int u=q.top().y.y;
q.pop();
//cerr << fixed << setprecision(3) << vol << ' ' << V[{dist, u}] << ' ' << vol-V[{dist, u}] << '\n';
if (vol>V[{dist, u}]) continue;
vst[{dist, u}]=1;
if (u==n-1) t[dist]=vol;
if (u==n-1) break;
for (int i=0; i<n; ++i)
{
if (i==u||(a[i].y-a[u].y<-eps)) continue;
double tdist=((i!=n-1)?sqrt((double)(a[u].x-a[i].x)*(a[u].x-a[i].x)+(double)(a[u].y-a[i].y)*(a[u].y-a[i].y)):abs(a[i].y-a[u].y));
if (!vst.count({tdist+dist, i})&&(!V.count({tdist+dist, i})||max(vol, tdist)<V[{tdist+dist, i}]))
{
V[{tdist+dist, i}]=max(vol, tdist);
q.push({V[{tdist+dist, i}], {tdist+dist, i}});
}
}
}
double res_vol=1000000000000000000.0;
double res_dist=1000000000000000000.0;
for (map<double, double>::iterator it=t.begin(); it!=t.end(); ++it)
{
if ((it->second)-res_vol<=eps)
{
if ((it->second)==res_vol)
res_dist=min(res_dist, it->first);
else
res_vol=it->second,
res_dist=it->first;
}
}
cout << fixed << setprecision(3) << res_vol << '\n' << res_dist;
return 0;
}
|
64d5cea314c805754db7889623e2ce137a09e335
|
3487f249665f096de6c42eda99bc3da3398bb547
|
/old/mixed/cpp/monkandmatchmakingmemcmp.cpp
|
42f25d158a6d4da5fa854735f1cb61ca2ec19b4c
|
[] |
no_license
|
hthuwal/competitive-programming
|
74489181774b4746234a62fe217ac539b2e1704e
|
65efdd8b90afd3895f734e204b9a4689de3eb810
|
refs/heads/master
| 2023-08-31T04:18:37.525826
| 2023-08-30T20:28:10
| 2023-08-30T20:28:10
| 133,988,036
| 5
| 2
| null | 2020-10-15T17:58:15
| 2018-05-18T18:02:05
|
C++
|
UTF-8
|
C++
| false
| false
| 338
|
cpp
|
monkandmatchmakingmemcmp.cpp
|
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main(){
char a[110000];
int q,l,m,n,o;
gets(a);
scanf("%d",&q);
while(q--){
scanf("%d %d %d %d",&l,&m,&n,&o);
if(m-l == o-n){
if(memcmp(&a[l-1],&a[n-1],m-l+1)==0)
printf("Yes\n");
else
printf("No\n");
}
else
printf("NO\n");
}
}
|
6b46ecd24f1e266f26e8986c0cd3f1ab3876d219
|
37a28974ba563aa5189e11df93dd19c649762634
|
/XMLWriter.h
|
3a9401c9b4c89c72b3b67d268580b2fddb15d1cb
|
[] |
no_license
|
zjucsxxd/eyeTrackingAnalysis
|
acf0d256e886048db2d8ff8dbc10500387d21dc5
|
1e1a186a5b30fe5096c937c1e785c0f224c7446a
|
refs/heads/master
| 2020-12-24T15:05:23.666204
| 2015-02-24T12:42:09
| 2015-02-24T12:42:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 607
|
h
|
XMLWriter.h
|
/*
* File: XMLWriter.h
* Author: chili
*
* Created on February 10, 2014, 9:19 AM
*/
#ifndef XMLWRITER_H
#define XMLWRITER_H
#include <string>
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
using namespace std;
class XMLWriter {
public:
XMLWriter();
XMLWriter(const XMLWriter& orig);
bool openFile(std::string filename, int nAOI);
void writeNewAOI(std::vector < std::vector < cv::Mat >> AOIsOnImage,long frameId);
virtual ~XMLWriter();
void close();
private:
std::vector<fstream*> outFiles;
string filename;
};
#endif /* XMLWRITER_H */
|
6411fe6125b7fcc5d0a1510e251afed5045b489e
|
89dc733e887f311d93031c57d68ced787fa1d67d
|
/src/simulation_reader/simulation_geometry.cpp
|
d7f6a73e35252c30a11333ad289a513d4d38bb20
|
[
"Unlicense"
] |
permissive
|
c-white/blacklight
|
242fd9e5ae24130dce1692cc141328197b11816c
|
9024a4bd74dc670f0d57278da31b73eb83d30693
|
refs/heads/master
| 2023-09-03T02:14:12.464682
| 2023-08-09T23:36:47
| 2023-08-09T23:36:47
| 187,455,357
| 7
| 3
|
Unlicense
| 2023-09-01T17:58:02
| 2019-05-19T09:06:45
|
C++
|
UTF-8
|
C++
| false
| false
| 9,813
|
cpp
|
simulation_geometry.cpp
|
// Blacklight simulation reader - conversion functions for different coordinate systems
// C++ headers
#include <cmath> // cos, exp, sin, sqrt
// Library headers
#include <omp.h> // pragmas
// Blacklight headers
#include "simulation_reader.hpp"
#include "../blacklight.hpp" // Math
#include "../utils/array.hpp" // Array
//--------------------------------------------------------------------------------------------------
// Function to convert coordinates from modified to standard spherical Kerr-Schild
// Inputs: (none)
// Outputs: (none)
// Notes:
// Assumes x1f, x2f, x1v, and x2v are set in modified coordinates.
// Allocates and sets x2v_alt to save modified coordinates.
// Transforms x1f, x2f, x1v, and x2v.
// Operates in serial, given all arrays are 1D and likely to be small.
void SimulationReader::ConvertCoordinates()
{
// Extract parameters
double h = metric_h;
int n1 = x1v.n1;
int n2 = x2v.n1;
// Copy x^2 values
x2v_alt.Allocate(n2);
for (int j = 0; j < n2; j++)
x2v_alt(j) = x2v(0,j);
// Transform x^1 to r
for (int i = 0; i <= n1; i++)
x1f(0,i) = std::exp(x1f(0,i));
for (int i = 0; i < n1; i++)
x1v(0,i) = std::exp(x1v(0,i));
// Transform x^2 to theta
for (int j = 0; j <= n2; j++)
x2f(0,j) = Math::pi * x2f(0,j) + (1.0 - h) / 2.0 * std::sin(2.0 * Math::pi * x2f(0,j));
for (int j = 0; j < n2; j++)
x2v(0,j) = Math::pi * x2v(0,j) + (1.0 - h) / 2.0 * std::sin(2.0 * Math::pi * x2v(0,j));
return;
}
//--------------------------------------------------------------------------------------------------
// Function to convert primitive 3-vectors from modified to standard spherical Kerr-Schild
// Inputs:
// primitives: primitive array with modified vector components
// Outputs:
// primitives: primitive array with standard vector components
// Notes:
// Assumes x1v and x2v are set in standard coordinates.
// Assumes x2v_alt is set in modified coordinates.
// Assumes ind_uu1, ind_uu2, ind_uu3, ind_bb1, ind_bb2, and ind_bb3 are set.
void SimulationReader::ConvertPrimitives3(Array<float> &primitives)
{
// Extract parameters
double a = simulation_a;
double h = metric_h;
int n1 = x1v.n1;
int n2 = x2v.n1;
int n3 = x3v.n1;
// Go through cells in parallel
#pragma omp parallel for schedule(static) collapse(2)
for (int k = 0; k < n3; k++)
for (int j = 0; j < n2; j++)
for (int i = 0; i < n1; i++)
{
// Extract coordinates
double r = x1v(0,i);
double th = x2v(0,j);
double sth = std::sin(th);
double cth = std::cos(th);
double x2 = x2v_alt(j);
// Extract primitives
double uu1 = primitives(ind_uu1,0,k,j,i);
double uu2 = primitives(ind_uu2,0,k,j,i);
double uu3 = primitives(ind_uu3,0,k,j,i);
double bb1 = primitives(ind_bb1,0,k,j,i);
double bb2 = primitives(ind_bb2,0,k,j,i);
double bb3 = primitives(ind_bb3,0,k,j,i);
// Calculate Jacobian of transformation
double dr_dx1 = r;
double dth_dx2 = Math::pi + (1.0 - h) * Math::pi * std::cos(2.0 * Math::pi * x2);
// Calculate standard metric
double sigma = r * r + a * a * cth * cth;
double f = 2.0 * r / sigma;
double g_tr = f;
double g_tth = 0.0;
double g_tph = -a * f * sth * sth;
double g_rr = 1.0 + f;
double g_rth = 0.0;
double g_rph = -a * (1.0 + f) * sth * sth;
double g_thth = sigma;
double g_thph = 0.0;
double g_phph = (r * r + a * a + a * a * f * sth * sth) * sth * sth;
double gtt = -(1.0 + f);
double gtr = f;
double gtth = 0.0;
double gtph = 0.0;
double alpha = 1.0 / std::sqrt(-gtt);
// Calculate modified metric
double g_01 = dr_dx1 * g_tr;
double g_02 = dth_dx2 * g_tth;
double g_03 = g_tph;
double g_11 = dr_dx1 * dr_dx1 * g_rr;
double g_12 = dr_dx1 * dth_dx2 * g_rth;
double g_13 = dr_dx1 * g_rph;
double g_22 = dth_dx2 * dth_dx2 * g_thth;
double g_23 = dth_dx2 * g_thph;
double g_33 = g_phph;
double g00 = gtt;
double g01 = gtr / dr_dx1;
double g02 = gtth / dth_dx2;
double g03 = gtph;
double alpha_mod = 1.0 / std::sqrt(-g00);
// Transform velocity from modified normal frame to modified coordinate frame
double uu0 = std::sqrt(1.0 + g_11 * uu1 * uu1 + 2.0 * g_12 * uu1 * uu2
+ 2.0 * g_13 * uu1 * uu3 + g_22 * uu2 * uu2 + 2.0 * g_23 * uu2 * uu3
+ g_33 * uu3 * uu3);
double u0 = uu0 / alpha_mod;
double u1 = uu1 - alpha_mod * g01 * uu0;
double u2 = uu2 - alpha_mod * g02 * uu0;
double u3 = uu3 - alpha_mod * g03 * uu0;
double u_1 = g_01 * u0 + g_11 * u1 + g_12 * u2 + g_13 * u3;
double u_2 = g_02 * u0 + g_12 * u1 + g_22 * u2 + g_23 * u3;
double u_3 = g_03 * u0 + g_13 * u1 + g_23 * u2 + g_33 * u3;
// Transform velocity from modified coordinate frame to standard coordinate frame
double ut = u0;
double ur = dr_dx1 * u1;
double uth = dth_dx2 * u2;
double uph = u3;
// Transform velocity from standard coordinate frame to standard normal frame
double uur = ur + alpha * alpha * gtr * ut;
double uuth = uth + alpha * alpha * gtth * ut;
double uuph = uph + alpha * alpha * gtph * ut;
// Calculate magnetic 4-vector in modified coordinate frame
double b0 = u_1 * bb1 + u_2 * bb2 + u_3 * bb3;
double b1 = (bb1 + b0 * u1) / u0;
double b2 = (bb2 + b0 * u2) / u0;
double b3 = (bb3 + b0 * u3) / u0;
// Transform magnetic 4-vector from modified coordinate frame to standard coordinate frame
double bt = b0;
double br = dr_dx1 * b1;
double bth = dth_dx2 * b2;
double bph = b3;
// Calculate magnetic field in standard coordinate frame
double bbr = br * ut - bt * ur;
double bbth = bth * ut - bt * uth;
double bbph = bph * ut - bt * uph;
// Save results
primitives(ind_uu1,0,k,j,i) = static_cast<float>(uur);
primitives(ind_uu2,0,k,j,i) = static_cast<float>(uuth);
primitives(ind_uu3,0,k,j,i) = static_cast<float>(uuph);
primitives(ind_bb1,0,k,j,i) = static_cast<float>(bbr);
primitives(ind_bb2,0,k,j,i) = static_cast<float>(bbth);
primitives(ind_bb3,0,k,j,i) = static_cast<float>(bbph);
}
return;
}
//--------------------------------------------------------------------------------------------------
// Function to convert primitive 4-vectors from modified to standard spherical Kerr-Schild
// Inputs:
// primitives: primitive array with modified vector components
// Outputs:
// primitives: primitive array with standard vector components
// Notes:
// Assumes x1v and x2v are set in standard coordinates.
// Assumes x2v_alt is set in modified coordinates.
// Assumes ind_u0, ind_uu1, ind_uu2, ind_uu3, ind_b0, ind_bb1, ind_bb2, and ind_bb3 are set.
void SimulationReader::ConvertPrimitives4(Array<float> &primitives)
{
// Extract parameters
double a = simulation_a;
double h = metric_h;
int n1 = x1v.n1;
int n2 = x2v.n1;
int n3 = x3v.n1;
// Go through cells in parallel
#pragma omp parallel for schedule(static) collapse(2)
for (int k = 0; k < n3; k++)
for (int j = 0; j < n2; j++)
for (int i = 0; i < n1; i++)
{
// Extract coordinates
double r = x1v(0,i);
double th = x2v(0,j);
double cth = std::cos(th);
double x2 = x2v_alt(j);
// Extract primitives
double u0 = primitives(ind_u0,0,k,j,i);
double u1 = primitives(ind_uu1,0,k,j,i);
double u2 = primitives(ind_uu2,0,k,j,i);
double u3 = primitives(ind_uu3,0,k,j,i);
double b0 = primitives(ind_b0,0,k,j,i);
double b1 = primitives(ind_bb1,0,k,j,i);
double b2 = primitives(ind_bb2,0,k,j,i);
double b3 = primitives(ind_bb3,0,k,j,i);
// Calculate Jacobian of transformation
double dr_dx1 = r;
double dth_dx2 = Math::pi + (1.0 - h) * Math::pi * std::cos(2.0 * Math::pi * x2);
// Calculate standard metric
double sigma = r * r + a * a * cth * cth;
double f = 2.0 * r / sigma;
double gtt = -(1.0 + f);
double gtr = f;
double gtth = 0.0;
double gtph = 0.0;
double alpha = 1.0 / std::sqrt(-gtt);
// Transform velocity from modified coordinate frame to standard coordinate frame
double ut = u0;
double ur = dr_dx1 * u1;
double uth = dth_dx2 * u2;
double uph = u3;
// Transform velocity from standard coordinate frame to standard normal frame
double uur = ur + alpha * alpha * gtr * ut;
double uuth = uth + alpha * alpha * gtth * ut;
double uuph = uph + alpha * alpha * gtph * ut;
// Transform magnetic 4-vector from modified coordinate frame to standard coordinate frame
double bt = b0;
double br = dr_dx1 * b1;
double bth = dth_dx2 * b2;
double bph = b3;
// Calculate magnetic field in standard coordinate frame
double bbr = br * ut - bt * ur;
double bbth = bth * ut - bt * uth;
double bbph = bph * ut - bt * uph;
// Save results
primitives(ind_uu1,0,k,j,i) = static_cast<float>(uur);
primitives(ind_uu2,0,k,j,i) = static_cast<float>(uuth);
primitives(ind_uu3,0,k,j,i) = static_cast<float>(uuph);
primitives(ind_bb1,0,k,j,i) = static_cast<float>(bbr);
primitives(ind_bb2,0,k,j,i) = static_cast<float>(bbth);
primitives(ind_bb3,0,k,j,i) = static_cast<float>(bbph);
}
return;
}
|
e1ee88ac829240c19f8ea5355a3e9814326ed736
|
82b65070be95e121ce4eea2abdddcfbc7872baa9
|
/rendererCpp/light.h
|
10313bb64ecf5d8cb4f20f3c515bc9e4af1b20a1
|
[] |
no_license
|
michcio12174/rendererCpp
|
ab7bc1e933f381f2264ae3ff45223690dcb90d70
|
b9d0564647a214606590638e6b8a8623d6193c78
|
refs/heads/master
| 2020-04-17T10:02:03.277059
| 2019-01-22T18:13:51
| 2019-01-22T18:13:51
| 124,757,245
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 497
|
h
|
light.h
|
#pragma once
class light
{
public:
//directional light constructor
light(vector3 color, vector3 direction);
//point light constructor
light(vector3 color, float intensity, vector3 origin);
virtual vector3 getLight(vector3 position);
virtual vector3 getVectorToLight(vector3 position);
//origin is used as origin of point light or direction of directional light
vector3 color, origin;
//this class can represent both directional and spot ligts
bool isPointLight;
float intensity;
};
|
ebbe86a6d0bbf2895591fa5913a2476783143281
|
102ce1e423a0279c98023847337ac39077f23678
|
/articles/2018/Cpp-Reference-in-Functional/functional-iostream.cpp
|
bad12bf24752321e5c3e506c8856ec9c3369859c
|
[
"MIT"
] |
permissive
|
BOT-Man-JL/BOT-Man-JL.github.io
|
50e40858a37c6c5b1ea9e3151c51310529fdb325
|
e5e851d43d761808639b67eedd75ed58ae87ce9b
|
refs/heads/master
| 2023-08-25T22:23:21.942407
| 2023-08-20T07:00:20
| 2023-08-21T04:13:02
| 82,437,872
| 36
| 13
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,286
|
cpp
|
functional-iostream.cpp
|
// Functional Transpose by BOT Man, 2018
// clang++ functional-iostream.cpp -std=c++11 -Wall -o iostream && ./iostream
#include <fstream>
#include <iostream>
#include <iterator>
#include <string>
int main(int argc, char* argv[]) {
std::ifstream ifs = argc >= 2 ? std::ifstream(argv[1]) : std::ifstream();
std::ofstream ofs = argc >= 3 ? std::ofstream(argv[2]) : std::ofstream();
std::copy(std::istream_iterator<std::string>(ifs),
std::istream_iterator<std::string>(),
std::ostream_iterator<std::string>(ofs, "\n"));
#ifdef NOT_COMPILE
std::copy(std::istream_iterator<std::string>(
argc >= 2 ? std::ifstream(argv[1]) : std::ifstream()),
std::istream_iterator<std::string>(),
std::ostream_iterator<std::string>(
argc >= 3 ? std::ofstream(argv[2]) : std::ofstream(), "\n"));
#endif // NOT_COMPILE
auto io_wrapper = [](std::ifstream&& ifs, std::ofstream&& ofs) -> void {
std::copy(std::istream_iterator<std::string>(ifs),
std::istream_iterator<std::string>(),
std::ostream_iterator<std::string>(ofs, "\n"));
};
io_wrapper(argc >= 2 ? std::ifstream(argv[1]) : std::ifstream(),
argc >= 3 ? std::ofstream(argv[2]) : std::ofstream());
return 0;
}
|
2a217242fd780bf8a42995d3163969057c5c944e
|
83ef40e396dc8ffdc14e9f6d64a42bae61f8c9e3
|
/Chaine/main.cpp
|
f8cf250e1487b17ff8318a2cb75e48f1557c2540
|
[] |
no_license
|
Banezi/CPP
|
cb08815d0b00d5723b8d9569841b213edff4b884
|
3031c3a43732022587c839f6cb18ccaea53325cd
|
refs/heads/master
| 2020-04-01T14:43:55.975459
| 2019-04-09T19:20:06
| 2019-04-09T19:20:06
| 153,305,763
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 259
|
cpp
|
main.cpp
|
#include <iostream>
#include "Chaine.hpp"
using namespace std;
void afficherParValeur(Chaine) {}
void afficherParReference(Chaine &) {}
int main()
{
Chaine c("une petite chaine");
//afficherParValeur(c);
//afficherParReference(c);
return 0;
}
|
d4cc5d258ca0cb9265f16263953289d9836babe2
|
24c263f2d5cb4f35e8d2757b0f2eb335c87c5bf4
|
/OOP/OOP8_string search/S0454028_Search.cpp
|
47c4eb7a31de30f757cdaf0332870d7be6aca43e
|
[] |
no_license
|
smallweii/NCUE
|
e78b511486ec91a7f4357fcf4da98ef34ca95dea
|
4e276cc08a263e963a1ae44e7119c2f9598df84c
|
refs/heads/master
| 2021-05-17T03:12:28.452181
| 2020-03-28T13:19:11
| 2020-03-28T13:19:11
| 250,591,985
| 2
| 0
| null | null | null | null |
BIG5
|
C++
| false
| false
| 1,981
|
cpp
|
S0454028_Search.cpp
|
#include<iostream>
#include<fstream>
#include<string.h>
#include<ctype.h>
#include "S0454028_Search.h"
using namespace std;
Search::Search(char *filename, string s) // constructor用來開檔
{
file.open(filename);
str = s; // 把使用者輸入的字串 s assign給 str
if (!file) { // 檢查檔案是否成功開啟
cout << "Can't open the file!" << endl;
exit(1); // 在不正常情形下,中斷程式的執行
}
}
Search::~Search() // destructor用來關檔
{
file.close();
}
void Search::search() // 找字串
{
char ch, test[100] = {0};
int i = 0, times = 0;
while (file.peek() != EOF) { // 若不是檔案結尾就進來
if (file.peek() != '.' && file.peek() != ' ') { // 若不是句號和空格就進來
file >> ch; // 讀該字元
test[i] = ch; // 把字元存到陣列
i++;
} else if (file.peek() == ' ') { // 若是空格就進來
file >> ch; // 因為空格讀不到,所以先讀空格的下一個字元
test[i] = ' '; // 把所屬空格的位置存成空格
i++;
test[i] = ch; // 把空格的下一個字元的位置存成該字元
i++;
} else { // 視句號為一句,若是句號就進來
file >> ch;
for (int j = 0; j < i; j++) {
if (test[j] == str[0]) { // 若第一個有一樣就繼續比
bool check = 1, appear = 0;
for (int k = 0; k < str.length(); k++) {
if (test[j + k] != str[k]) { // 比到不一樣的就進來
check = 0; // 沒找到字串
break;
}
}
if (check) { // 有找到字串就進來
times++;
if (appear == 0) { // 若欲找字串沒出現過就印
for (int l = 0; l < i; l++)
cout << test[l];
cout << "." << endl;
appear = 1; // 若欲找字串出現過在同句,印該句一次就好
}
}
}
}
i = 0; // 下一句重找
}
}
if (times == 1)
cout << times << " time" << endl; // 單數
else
cout << times << " times" << endl; // 複數
}
|
01850d0b0150710983d5e59b9b09e51c9c4e521f
|
c8700a08e903322385a8c53485a43377da0ce37e
|
/jni/libil2cpp-v24/debugger/protocol/commands/type.cpp
|
1ebafe2c9dfae45b43fbbae2881dad2a08a73685
|
[
"MIT"
] |
permissive
|
battlesteed/IL2CPPDumper-1
|
73e20e8c1a45f9d7c2ef78af44ce11fd17bff16f
|
877d21fbb82f08d64287e27e96491772c0b35e60
|
refs/heads/master
| 2023-08-07T00:18:59.652455
| 2021-10-01T01:58:12
| 2021-10-01T01:58:12
| 266,036,140
| 0
| 0
|
MIT
| 2020-05-22T06:31:40
| 2020-05-22T06:31:39
| null |
UTF-8
|
C++
| false
| false
| 301
|
cpp
|
type.cpp
|
#if IL2CPP_DEBUGGER_ENABLED
#include "type.h"
using namespace il2cpp::debugger;
void TypeGetValuesCommand::Reply::WriteContentTo(Buffer &out) const
{
for (std::vector<Variant>::const_iterator it = _values.begin(); it != _values.end(); ++it)
{
out.WriteVariant(*it);
}
}
#endif
|
2b9ef2c6eec0911d566bbc8af210a69bd1e8a4d8
|
cd5a78371196427bf258abe6386296cb2e57b72c
|
/out/include/octopus/HtmlNode.h
|
76ce44a5a693aa51433efab7c25f984134bfded0
|
[] |
no_license
|
Grabli66/Octopus
|
8ec86eb55d3ee27347d463147e2daed83e5abc64
|
22db97cdebfeee0b4e61e25ef2ad99f58aad7489
|
refs/heads/master
| 2020-04-14T02:58:10.950728
| 2019-01-07T16:53:29
| 2019-01-07T16:53:29
| 163,596,573
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| true
| 2,871
|
h
|
HtmlNode.h
|
// Generated by Haxe 4.0.0-preview.5+7eb789f
#ifndef INCLUDED_octopus_HtmlNode
#define INCLUDED_octopus_HtmlNode
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
#ifndef INCLUDED_a524558151a8a5a0
#define INCLUDED_a524558151a8a5a0
#include "myhtml/myhtml.h"
#endif
HX_DECLARE_CLASS1(octopus,HtmlNode)
HX_DECLARE_CLASS1(octopus,HtmlTree)
HX_DECLARE_CLASS1(octopus,NodeCollection)
namespace octopus{
class HXCPP_CLASS_ATTRIBUTES HtmlNode_obj : public hx::Object
{
public:
typedef hx::Object super;
typedef HtmlNode_obj OBJ_;
HtmlNode_obj();
public:
enum { _hx_ClassId = 0x70acbb4c };
void __construct( ::octopus::HtmlTree tree);
inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="octopus.HtmlNode")
{ return hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return hx::Object::operator new(inSize+extra,true,"octopus.HtmlNode"); }
static hx::ObjectPtr< HtmlNode_obj > __new( ::octopus::HtmlTree tree);
static hx::ObjectPtr< HtmlNode_obj > __alloc(hx::Ctx *_hx_ctx, ::octopus::HtmlTree tree);
static void * _hx_vtable;
static Dynamic __CreateEmpty();
static Dynamic __Create(hx::DynamicArray inArgs);
//~HtmlNode_obj();
HX_DO_RTTI_ALL;
hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp);
void __GetFields(Array< ::String> &outFields);
static void __register();
void __Mark(HX_MARK_PARAMS);
void __Visit(HX_VISIT_PARAMS);
bool _hx_isInstanceOf(int inClassId);
::String __ToString() const { return HX_("HtmlNode",2d,19,fa,e5); }
static ::octopus::HtmlNode fromNative( myhtml_tree_node_t* native, ::octopus::HtmlTree tree);
myhtml_tree_node_t* nativeNode;
::octopus::HtmlTree tree;
myhtml_tag_id_t get_tagId();
::String get_tagName();
::Dynamic get_tagName_dyn();
::String get_text();
::Dynamic get_text_dyn();
::octopus::HtmlNode get_child();
::Dynamic get_child_dyn();
::octopus::HtmlNode get_lastChild();
::Dynamic get_lastChild_dyn();
::octopus::HtmlNode get_next();
::Dynamic get_next_dyn();
::octopus::HtmlNode get_prev();
::Dynamic get_prev_dyn();
::Dynamic get_childs();
::Dynamic get_childs_dyn();
::Dynamic get_nodes();
::Dynamic get_nodes_dyn();
::String getAttributeValue(::String key);
::Dynamic getAttributeValue_dyn();
::String getInnerText(::String delimiter);
::Dynamic getInnerText_dyn();
::octopus::NodeCollection getNodesByTagId( myhtml_tag_id_t tagId);
::octopus::NodeCollection getNodesByTagName(::String name);
::Dynamic getNodesByTagName_dyn();
::octopus::NodeCollection findByCss(::String selectors);
::Dynamic findByCss_dyn();
};
} // end namespace octopus
#endif /* INCLUDED_octopus_HtmlNode */
|
5a0971b72c3308578dc88ac9193f7dd5b7b19a6a
|
aa095611e30d7e61c1bfdca88a22e0981d272641
|
/Leetcode/Leetcode Daily/May/27thMay21.cpp
|
11be4284f3226f06821751e901e60b833d2be726
|
[] |
no_license
|
hmnt007/CPP-Pogramming
|
de6787728a5786d6548c6db8b6d3c68a57c0c7c4
|
b691a5b88dd1f291fa191c2d84535d1e2d62e11a
|
refs/heads/master
| 2023-08-24T04:54:17.166172
| 2021-10-03T06:22:06
| 2021-10-03T06:22:06
| 209,529,589
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,482
|
cpp
|
27thMay21.cpp
|
// https://leetcode.com/explore/challenge/card/may-leetcoding-challenge-2021/601/week-4-may-22nd-may-28th/3757/
/**
Maximum Product of Word Lengths
Solution
Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. If no such two words exist, return 0.
Example 1:
Input: words = ["abcw","baz","foo","bar","xtfn","abcdef"]
Output: 16
Explanation: The two words can be "abcw", "xtfn".
Example 2:
Input: words = ["a","ab","abc","d","cd","bcd","abcd"]
Output: 4
Explanation: The two words can be "ab", "cd".
**/
// CODE
class Solution {
public:
int maxProduct(vector<string>& words) {
int n = words.size();
int maxProd = 0;
vector<vector<int> > bitset(n, vector<int>(26,0)); //store status for charset of each word
for(int i=0; i<n; i++){
for(char x : words[i]) {
bitset[i][x-'a'] = 1;
}
}
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
int cnt = 0;
for(int k=0; k<26; k++){
if(bitset[i][k] * bitset[j][k] == 1) cnt--;
}
if(cnt==0) {
int prod = words[i].size();
prod *= words[j].size();
maxProd = max(prod, maxProd);
}
}
}
return maxProd;
}
};
|
bf9267461f820d0a3fe7a25fd6d516c3e21aaa15
|
44f4d2c9285bf3a388e3019f50dd0ed1efd019c3
|
/src/Simulation.hpp
|
873aa77714f70a426e318c910d995578218a42ab
|
[
"MIT"
] |
permissive
|
MrMagne/position-based-fluids
|
2dcd414fbe1176534886e5ff020ee82014b5307a
|
529b0d44bff842a964771a77d92136196dca45d7
|
refs/heads/master
| 2021-01-10T20:06:34.505876
| 2013-07-21T12:22:40
| 2013-07-21T12:22:40
| 12,558,684
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,242
|
hpp
|
Simulation.hpp
|
#ifndef __SIMULATION_HPP
#define __SIMULATION_HPP
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <cmath>
#include <stdexcept>
#include <assert.h>
#include <algorithm>
#include "hesp.hpp"
#include "Parameters.hpp"
#include "Particle.hpp"
#include <GLFW/glfw3.h>
// Macro used for the end of cell list
static const int END_OF_CELL_LIST = -1;
using std::map;
using std::vector;
using std::string;
/**
* \brief CParser
*/
class Simulation {
private:
// Avoid copy
Simulation &operator=(const Simulation &other);
Simulation (const Simulation &other);
public:
/**
* \brief Default constructor.
*/
explicit Simulation(const ConfigParameters ¶meters,
const vector<Particle> &particles,
const map<string, cl::Kernel> kernels,
const cl::Context &clContext,
const cl::Device &clDevice,
const GLuint sharingBufferID);
/**
* \brief Destructor.
*/
~Simulation ();
void init(void);
void initCells(void);
void step(void);
// Copy current positions and velocities
void dumpData( cl_float4 * (&positions),
cl_float4 * (&velocities) );
cl_uint getNumberParticles() const {
return mNumParticles;
}
cl_float getSizeXmin() const {
return mSystemSizeMin.s[0];
}
cl_float getSizeXmax() const {
return mSystemSizeMax.s[0];
}
cl_float
getSizeYmin(void) const {
return mSystemSizeMin.s[1];
}
cl_float
getSizeYmax(void) const {
return mSystemSizeMax.s[1];
}
cl_float
getSizeZmin(void) const {
return mSystemSizeMin.s[2];
}
cl_float
getSizeZmax(void) const {
return mSystemSizeMax.s[2];
}
const cl_float4
getSizesMin(void) const {
return mSystemSizeMin;
}
const cl_float4
getSizesMax(void) const {
return mSystemSizeMax;
}
// Setter
void
setWaveGenerator(const double value) {
mWaveGenerator = value;
}
private:
// Sizes of domain
cl_float4 mSystemSizeMin;
cl_float4 mSystemSizeMax;
// OpenCL objects supplied by OpenCL setup
const cl::Context &mCLContext;
const cl::Device &mCLDevice;
// holds all OpenCL kernels required for the simulation
map<string, cl::Kernel> mKernels;
// command queue all OpenCL calls are run on
cl::CommandQueue mQueue;
// ranges used for executing the kernels
cl::NDRange mGlobalRange;
cl::NDRange mLocalRange;
// configuration parameters for the simulation
cl_float mTimestepLength;
cl_float mTimeEnd;
const cl_uint mNumParticles;
const size_t mBufferSizeParticles;
const size_t mBufferSizeCells;
const size_t mBufferSizeParticlesList;
const size_t mBufferSizeScalingFactors;
// Reference to a vector of particles to setup data arrays in OpenCL
const vector<Particle> &mParticles;
// The host memory holding the simulation data
cl_float4 *mPositions;
cl_float4 *mVelocities;
#if !defined(USE_LINKEDCELL)
cl_uint2 *mRadixCells;
#endif // USE_LINKEDCELL
// The device memory buffers holding the simulation data
cl::Buffer mCellsBuffer;
cl::Buffer mParticlesListBuffer;
cl::Buffer mPositionsBuffer;
cl::Buffer mPredictedBuffer;
cl::Buffer mVelocitiesBuffer;
cl::Buffer mScalingFactorsBuffer;
cl::Buffer mDeltaBuffer;
cl::Buffer mDeltaVelocityBuffer;
#if !defined(USE_LINKEDCELL)
cl::Buffer mRadixCellsBuffer;
cl::Buffer mRadixHistogramBuffer;
cl::Buffer mRadixGlobSumBuffer;
cl::Buffer mRadixCellsOutBuffer;
cl::Buffer mFoundCellsBuffer;
#endif // USE_LINKEDCELL
// Number of cells in each direction
cl_int4 mNumberCells;
// Lengths of each cell in each direction
cl_float4 mCellLength;
// Array for the cells
cl_int *mCells;
cl_int *mParticlesList;
// For generating waves
cl_float mWaveGenerator;
GLuint mSharingBufferID;
// Private member functions
void updateCells(void);
void updatePositions(void);
void updateVelocities(void);
void applyVorticityAndViscosity(void);
void predictPositions(void);
void updatePredicted(void);
void computeScaling(void);
void computeDelta(void);
#if !defined(USE_LINKEDCELL)
void radix(void);
#endif // USE_LINKEDCELL
};
#endif // __SIMULATION_HPP
|
1f62edc98c5eb0c7a642a1b608f2c3192b4a249a
|
7b9d17f6f2a07ebf7eb52bdbad99d627d6a9aeb1
|
/XLCTextEx/PLib/PFilePath.h
|
e9cce8a7d4e98d9cd3c081ff752bdbaefa9c928a
|
[
"MS-PL"
] |
permissive
|
hirano567/XLCTextEx
|
8c5fcc3de709ea344246e40ea6229416d31a1bf9
|
1ac7f13eb8b3f11c4551c87096dc1081a9bd820f
|
refs/heads/master
| 2021-01-21T14:57:07.277418
| 2017-06-27T05:42:23
| 2017-06-27T05:42:23
| 95,358,232
| 1
| 0
| null | null | null | null |
SHIFT_JIS
|
C++
| false
| false
| 11,357
|
h
|
PFilePath.h
|
// XLCTextEx_1.0x : PLib
// PFilePath.h
//
#pragma once
NS_PLIB_BEGIN
#define IS_PATH_SEPARATOR(c) \
(((c) == t_Char<T_CHAR>('/', L'/')) || ((c) == t_Char<T_CHAR>('\\', L'\\')))
//======================================================================
// SplitPath
// パスからファイル名を取り出す。
//======================================================================
//----------------------------------------------------------------------
// t_SplitPath
//----------------------------------------------------------------------
template<typename T_CHAR>
BOOL t_SplitPath(const T_CHAR** ppDir, size_t* pzDir,
const T_CHAR** ppFile, size_t* pzFile,
const T_CHAR* pPath, size_t zPath)
{
typedef const T_CHAR* T_PCSTR;
T_PCSTR pb, pc, pe;
if (ppDir == NULL || pzDir == NULL || ppFile == NULL || pzFile == NULL ||
pPath == NULL || zPath < 1) return FALSE;
if (!NS_PLIB::Trim<T_CHAR>(&pb, &pe, pPath, pPath + zPath) || pb == NULL) goto ERROR_HANDLING;
pc = pe - 1;
while (!(pc < pb))
{
// 区切り文字が見つかった場合
if (IS_PATH_SEPARATOR(*pc) || *pc == t_Char<T_CHAR>(TEXTAW(':')))
{
// パスの最後が区切り文字の場合は、全体がディレクトリパスである。
if (pc == pe)
{
*ppDir = pb;
*pzDir = (size_t)(pe - pb);
*ppFile = NULL;
*pzFile = 0;
return TRUE;
}
// それ以外の場合
else
{
*ppDir = pb;
*pzDir = (size_t)(pc - pb + 1);
*ppFile = pc + 1;
*pzFile = (size_t)(pe - pc - 1);
return TRUE;
}
}
--pc;
}
// 区切り文字が見つからなかった場合は、全体をファイル名とする。
*ppDir = NULL;
*pzDir = 0;
*ppFile = pb;
*pzFile = (size_t)(pe - pb);
return TRUE;
ERROR_HANDLING:
*ppDir = NULL;
*pzDir = 0;
*ppFile = NULL;
*pzFile = 0;
return FALSE;
}
//----------------------------------------------------------------------
// SplitPath
//----------------------------------------------------------------------
template<typename T_CHAR>
inline BOOL SplitPath(const T_CHAR** ppDir, size_t* pzDir,
const T_CHAR** ppFile, size_t* pzFile,
const T_CHAR* pPath, size_t zPath)
{
throw std::logic_error("SplitPath");
return FALSE;
}
template<>
inline BOOL SplitPath<char>(LPCSTR* ppDir, size_t* pzDir, LPCSTR* ppFile, size_t* pzFile,
LPCSTR pPath, size_t zPath)
{
return t_SplitPath<char>(ppDir, pzDir, ppFile, pzFile, pPath, zPath);
}
template<>
inline BOOL SplitPath<wchar_t>(LPCWSTR* ppDir, size_t* pzDir, LPCWSTR* ppFile, size_t* pzFile,
LPCWSTR pPath, size_t zPath)
{
return t_SplitPath<wchar_t>(ppDir, pzDir, ppFile, pzFile, pPath, zPath);
}
//======================================================================
// GetFileNameFromPath
// パスからファイル名を取り出す。
//======================================================================
//----------------------------------------------------------------------
// GetFileNameFromPath
//----------------------------------------------------------------------
template<typename T_CHAR>
inline BOOL GetFileNameFromPath(const T_CHAR** ppFile, size_t* pzFile,
const T_CHAR* pPath, size_t zPath)
{
throw std::logic_error("GetFileNameFromPath");
return FALSE;
}
template<>
inline BOOL GetFileNameFromPath<char>(LPCSTR* ppFile, size_t* pzFile,
LPCSTR pPath, size_t zPath)
{
LPCSTR pDir;
size_t zDir;
return t_SplitPath<char>(&pDir, &zDir, ppFile, pzFile, pPath, zPath);
}
template<>
inline BOOL GetFileNameFromPath<wchar_t>(LPCWSTR* ppFile, size_t* pzFile,
LPCWSTR pPath, size_t zPath)
{
LPCWSTR pDir;
size_t zDir;
return t_SplitPath<wchar_t>(&pDir, &zDir, ppFile, pzFile, pPath, zPath);
}
//======================================================================
// GetDirectoryPath (1)
// パスからディレクトリ名を取り出す。
//======================================================================
template<typename T_CHAR>
inline BOOL GetDirectoryPath(const T_CHAR** ppDir, size_t* pzDir,
const T_CHAR* pPath, size_t zPath)
{
throw std::logic_error("GetDirectoryPath");
return FALSE;
}
template<>
inline BOOL GetDirectoryPath<char>(LPCSTR* ppDir, size_t* pzDir,
LPCSTR pPath, size_t zPath)
{
LPCSTR pFile;
size_t zFile;
return t_SplitPath<char>(ppDir, pzDir, &pFile, &zFile, pPath, zPath);
}
template<>
inline BOOL GetDirectoryPath<wchar_t>(LPCWSTR* ppDir, size_t* pzDir,
LPCWSTR pPath, size_t zPath)
{
LPCWSTR pFile;
size_t zFile;
return t_SplitPath<wchar_t>(ppDir, pzDir, &pFile, &zFile, pPath, zPath);
}
//======================================================================
// GetDirectoryPath (2)
// パスからディレクトリ名を取り出す。(std::basic_string 版)
//======================================================================
template<typename T_CHAR>
inline BOOL GetDirectoryPath(std::basic_string<T_CHAR>* pstrDirectory,
std::basic_string<T_CHAR>* pstrPath)
{
const T_CHAR* pd;
size_t zd;
if (pstrDirectory == NULL || pstrPath == NULL) return false;
if (!GetDirectoryPath<T_CHAR>(&pd, &zd, pstrPath->c_str(), pstrPath->size())) return false;
pstrDirectory->append(pd, zd);
return true;
}
/*
//======================================================================
// ResolvePath
// パスをフォルダ名、ファイル名に分解する。
// 指定されたパスが絶対パスとみなせる場合は *pbAbsPath に TRUE がセットされる。
//======================================================================
//----------------------------------------------------------------------
// ResolvePath
//----------------------------------------------------------------------
template<typename T_CHAR>
BOOL ResolvePath(NS_PLIB::PCPStrList<T_CHAR>* pPathElements, BOOL* pbAbsPath,
const T_CHAR* pPath, size_t zPath)
{
typedef const T_CHAR* T_PCSTR;
T_PCSTR pc, pt, pb, pe;
if (pPathElements == NULL || pbAbsPath == NULL || pPath == NULL || zPath < 1)
return FALSE;
if (!NS_PLIB::Trim<T_CHAR>(&pb, &pe, pPath, pPath + zPath) || pb == NULL) return FALSE;
pc = pb;
// ドライブ名から始まっていたら、その部分を格納しておく。
if (zPath > 1)
{
if (NS_PLIB::t_IsAlpha<T_CHAR>(*pc) && *(pc + 1) == t_Char<T_CHAR>(':', L':'))
{
pPathElements->Append(pc, 2);
pc += 2;
}
}
// / か \ で始まっている場合は絶対パスとみなす。
if (IS_PATH_SEPARATOR(*pc))
{
*pbAbsPath = TRUE;
}
else
{
*pbAbsPath = FALSE;
}
while (pc < pe)
{
pt = pc;
while (pc < pe && !IS_PATH_SEPARATOR(*pc)) ++pc;
if (pc < pe) ++pc;
pPathElements->Append(pt, (size_t)(pc - pt));
}
return TRUE;
}
*/
//======================================================================
// IsAbsolutePath
//======================================================================
template<typename T_CHAR>
BOOL IsAbsolutePath(const T_CHAR* pPath, size_t zPath)
{
if (pPath == NULL || zPath < 1) return FALSE;
if (IS_PATH_SEPARATOR(*pPath)) return TRUE;
if (zPath > 2)
{
if (NS_PLIB::t_IsAlpha<T_CHAR>(*pPath) &&
*(pPath + 1) == t_Char<T_CHAR>(':', L':') &&
(*(pPath + 2) == t_Char<T_CHAR>('/', L'/') || *(pPath + 2) == t_Char<T_CHAR>('\\', L'\\')))
{
return TRUE;
}
}
return FALSE;
}
//======================================================================
// IsDirectoryPath
//======================================================================
template<typename T_CHAR>
BOOL IsDirectoryPath(const T_CHAR* pPath, size_t zPath)
{
if (pPath == NULL || zPath < 1) return FALSE;
return IS_PATH_SEPARATOR(*(pPath + zPath - 1));
}
//======================================================================
// GetExtension
// ファイル名から拡張子を取り出す。
//======================================================================
//----------------------------------------------------------------------
// t_GetExtension
//----------------------------------------------------------------------
template<typename T_CHAR>
BOOL t_GetExtension(const T_CHAR** ppExtension, size_t* pzExtension,
const T_CHAR* pFile, const T_CHAR* pEnd)
{
typedef const T_CHAR* T_PCSTR;
T_PCSTR pc, pe;
BOOL bFound = FALSE;
if (ppExtension == NULL || pFile == NULL || !(pFile < pEnd)) return FALSE;
pe = pEnd;
do
{
--pe;
}
while (!(pe < pFile) && t_IsSpace<T_CHAR>(*pe));
if (pe < pFile) return FALSE;
pc = pe;
while (!(pc < pFile))
{
if (*pc == t_Char<T_CHAR>(TEXTAW('.')))
{
if (pc < pEnd - 1)
{
bFound = TRUE;
}
break;
}
else if (IS_PATH_SEPARATOR(*pc) || *pc == t_Char<T_CHAR>(TEXTAW(':')))
{
break;
}
--pc;
}
if (bFound == TRUE)
{
*ppExtension = pc + 1;
*pzExtension = pe - pc;
return TRUE;
}
*ppExtension = pEnd;
*pzExtension = 0;
return FALSE;
}
//----------------------------------------------------------------------
// GetExtension
//----------------------------------------------------------------------
template<typename T_CHAR>
inline BOOL GetExtension(const T_CHAR** ppExtension, size_t* pzExtension,
const T_CHAR* pFile, size_t zFile)
{
throw std::logic_error("GetExtension");
return FALSE;
}
template<>
inline BOOL GetExtension<char>(LPCSTR* ppExtension, size_t* pzExtension,
LPCSTR pFile, size_t zFile)
{
return t_GetExtension<char>(ppExtension, pzExtension, pFile, pFile + zFile);
}
template<>
inline BOOL GetExtension<wchar_t>(LPCWSTR* ppExtension, size_t* pzExtension,
LPCWSTR pFile, size_t zFile)
{
return t_GetExtension<wchar_t>(ppExtension, pzExtension, pFile, pFile + zFile);
}
//======================================================================
// CheckExtension
// ファイル名の拡張子が、指定したグループ内にあるか調べる。
//======================================================================
//----------------------------------------------------------------------
// t_CheckExtension
//----------------------------------------------------------------------
template<typename T_CHAR>
BOOL t_CheckExtension(const T_CHAR* pFile, size_t zFile, std::list<const T_CHAR*>* pExtensions)
{
typedef const T_CHAR* T_PCSTR;
typedef std::list<const T_CHAR*>::iterator ITERATOR;
T_PCSTR pExtension = NULL;
size_t zExtension;
ITERATOR itr;
if (pFile == NULL || zFile < 1 || pExtensions == NULL) return FALSE;
if (!GetExtension<T_CHAR>(&pExtension, &zExtension, pFile, zFile)) return FALSE;
for (itr = pExtensions->begin(); itr != pExtensions->end(); ++itr)
{
if (!NS_PLIB::t_StrNCmp<T_CHAR, FALSE>(pExtension, *itr, zExtension)) return TRUE;
}
return FALSE;
}
//----------------------------------------------------------------------
// CheckExtension
//----------------------------------------------------------------------
template<typename T_CHAR>
inline BOOL CheckExtension(const T_CHAR* pFile, size_t zFile, std::list<const T_CHAR*>* pExtensions)
{
throw std::logic_error("CheckExtension");
return FALSE;
}
template<>
inline BOOL CheckExtension<char>(LPCSTR pFile, size_t zFile, std::list<LPCSTR>* pExtensions)
{
return t_CheckExtension<char>(pFile, zFile, pExtensions);
}
template<>
inline BOOL CheckExtension<wchar_t>(LPCWSTR pFile, size_t zFile, std::list<LPCWSTR>* pExtensions)
{
return t_CheckExtension<wchar_t>(pFile, zFile, pExtensions);
}
NS_PLIB_END
|
054b959f296ffdd2dcd2427e892949e309fcbfd5
|
d15ac6bfccf66137aad793e1fa8295eb218437d0
|
/Game1/Main.cpp
|
796f77044687e0806a69667f20cd0223e927314b
|
[] |
no_license
|
Irfan6220c/Learning-SFML
|
b22dfaa5c26a1e08f53d728106cf21a5f7fd594f
|
1ea78a86cc013aa76676abc5d4152ffbf1988187
|
refs/heads/master
| 2023-02-16T22:43:17.614572
| 2021-01-17T04:17:42
| 2021-01-17T04:17:42
| 327,773,991
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 78
|
cpp
|
Main.cpp
|
#include "Header.h"
int main() {
GameClass game;
//game.CreateWindow();
}
|
f604ffdad08dff2a0e4115667884f9e1912721c9
|
ca73854188b13289cbe368a28074e82861b78e37
|
/pro62.cpp
|
93a8f76640f6b525c69f7ca3a739c060e6ea545e
|
[] |
no_license
|
kiran2000/Lab-3
|
2fa966407309ff100660e8986627dd7215eb681e
|
415a8b58aceb4be36d2571dd18773a714a65cac2
|
refs/heads/master
| 2021-01-21T01:15:51.631620
| 2017-09-15T19:11:11
| 2017-09-15T19:11:11
| 101,871,657
| 0
| 0
| null | 2017-08-30T11:06:42
| 2017-08-30T11:06:42
| null |
UTF-8
|
C++
| false
| false
| 165
|
cpp
|
pro62.cpp
|
base = base * 2;
num = num / 10;
}
+ //CONVERTING DECIMAL TO HEXADECIMAL
long int quo;
int i=1,j,temp;
char hexa[100]
|
5b17507204e64c307802a6ae62c70ff0d8160bd1
|
26bc19b4ffa67b4ca7a86da210e14b07f332f1bb
|
/StochasticDiff/StochasticDiff/main.cpp
|
c5a57b97b8439c53fff0754c9f49f9501dc033fb
|
[] |
no_license
|
Edvard-Hagerup-Grieg/UNN-StochasticDiff
|
a674ba7af81bbb99ca8b6f35f505664766eeea6b
|
674bc98caac577b4be6e8ee9d7367df00ec80039
|
refs/heads/master
| 2020-04-22T17:16:28.406165
| 2019-04-20T08:17:39
| 2019-04-20T08:17:39
| 170,535,184
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 905
|
cpp
|
main.cpp
|
#pragma once
#include <stdlib.h>
#include "nummeth.h"
#include "omp.h"
#include <time.h>
using namespace std;
int main(int argc, char* argv[])
{
double time = 0.0;
//Euler
if (argv[1][0] == '0')
time = Euler(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atoi(argv[6]), atof(argv[7]));
//Heun
else if (argv[1][0] == '1')
time = Heun(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atoi(argv[6]), atof(argv[7]));
//Jump experiment
else if (argv[1][0] == '2')
time = Jump_vec(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atoi(argv[6]), atof(argv[7]));
else
{
cout << "Invalid argument." << endl;
cin.get();
}
cout << time;
//for (double d = 0.0; d < 8.1; d += 0.1)
//{
// time = Jump_vec(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]), atoi(argv[6]), d);
// cout << d << "\t" << time << endl;
//}
//cin.get();
return 0;
}
|
b676ff72d4b93cc623e6867fe9538227a6885adf
|
bb7dffa0fdbe6263ad5c114b459d3e8288ce9953
|
/randomgenerator.cpp
|
fc1b21170b2bcb2d7e448d991db2bb4ff63ab0ab
|
[] |
no_license
|
alexreinking/MarkovAnalysis
|
99ed9d360a6d4cc36ef7a247261c6b10fc10c8e3
|
12ae87e9c82fa83e5907e52a3cbb5ae9d97f95bb
|
refs/heads/master
| 2020-04-18T21:25:25.478684
| 2011-03-29T20:18:08
| 2011-03-29T20:18:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,022
|
cpp
|
randomgenerator.cpp
|
#include <QtCore>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <sys/stat.h>
#include <fcntl.h>
#include "randomgenerator.h"
RandomGenerator* RandomGenerator::m_instance = NULL;
RandomGenerator::RandomGenerator()
{
reseed();
}
RandomGenerator* RandomGenerator::instance()
{
if(m_instance == NULL)
m_instance = new RandomGenerator;
return m_instance;
}
RandomGenerator::~RandomGenerator()
{
delete m_instance;
m_instance = NULL;
}
int RandomGenerator::getRandomInt(int lower, int upper)
{
int range = abs(upper-lower);
double offset = getNormalizedDouble()*(double)range;
return lower+(int)offset;
}
double RandomGenerator::getNormalizedDouble()
{
return ((double)rand()/double(RAND_MAX+1ul));
}
void RandomGenerator::reseed()
{
unsigned int seed = time(NULL);
#ifdef Q_OS_LINUX
// int randomData = open("/dev/random", O_RDONLY);
// read(randomData, &seed, sizeof(seed));
// close(randomData);
srand(seed);
#else
srand(seed);
#endif
}
|
9e7e50074b4bdcc77f51370992f8b51c3febeb74
|
e0b4448b4d86e312c555452572af26e4f2b7e0ce
|
/cpp_example/src/ryft_odbc_cpp_sdk/wrapper.h
|
6795c2496ee3545a67b97fb3a5b83024f561a67d
|
[
"MIT"
] |
permissive
|
juripero/ryft-odbc-api
|
1be000518285212d8e13d42ba096200b20fc512f
|
53ae1098902b98994511ae077eaaba29d1f73e38
|
refs/heads/master
| 2020-07-09T17:50:28.194386
| 2017-05-04T01:14:34
| 2017-05-04T01:14:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,014
|
h
|
wrapper.h
|
// Copyright(c) 2015 - 2017, Ryft Systems, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met :
//
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
// disclaimer in the documentation and / or other materials provided with the distribution.
//
// All advertising materials mentioning features or use of this software must display the following acknowledgement :
//
// This product includes software developed by Ryft Systems, Inc.
//
// Neither the name of Ryft Systems, Inc.nor the names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY RYFT SYSTEMS, INC. ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL RYFT SYSTEMS, INC.BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// GNU General Public License, Version 2, June 1991
// Copyright (c) 1989, 1991 Free Software Foundation, Inc. / 51 Franklin St. 5th Floor, Boston, MA 02110 - 1301, USA
#pragma once
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
using namespace std;
namespace RYFT_ODBCWrap {
#include "error.h"
#include "resultset.h"
#include "catalog.h"
class ODBC_Wrapper {
public:
ODBC_Wrapper();
~ODBC_Wrapper();
bool connect(string& dsn, string& uid, string& pwd);
void disconnect();
bool isConnected();
bool describeCatalog(ODBC_ResultSet& tables);
bool describeTable(string& table, ODBC_ResultSet& columns);
bool describeDatatypes(ODBC_ResultSet& datatypes);
bool describeProcedures(ODBC_ResultSet& procedures);
bool execQuery(string& query, ODBC_ResultSet& resultSet);
ODBC_Errors odbcErrors();
private:
SQLHENV __env;
bool __initialized;
SQLHDBC __dbc;
bool __connected;
SQLHSTMT __stmt;
ODBC_Errors __odbcErrors;
void __odbcError();
bool __processResultSet(ODBC_ResultSet& resultSet);
};
};
|
a415d43c4ebc6070a83450e903e795e49804e204
|
be5f4d79910e4a93201664270916dcea51d3b9ee
|
/fastdownward/src/search/pdbs/zero_one_pdbs_heuristic.h
|
403fd8a6fa71624ffe33eefa635a6504bb881ccf
|
[
"MIT",
"GPL-1.0-or-later",
"GPL-3.0-or-later"
] |
permissive
|
mehrdadzakershahrak/Online-Explanation-Generation
|
17c3ab727c2a4a60381402ff44e95c0d5fd0e283
|
e41ad9b5a390abdaf271562a56105c191e33b74d
|
refs/heads/master
| 2022-12-09T15:49:45.709080
| 2019-12-04T10:23:23
| 2019-12-04T10:23:23
| 184,834,004
| 0
| 0
|
MIT
| 2022-12-08T17:42:50
| 2019-05-04T00:04:59
|
Python
|
UTF-8
|
C++
| false
| false
| 773
|
h
|
zero_one_pdbs_heuristic.h
|
#ifndef PDBS_ZERO_ONE_PDBS_HEURISTIC_H
#define PDBS_ZERO_ONE_PDBS_HEURISTIC_H
#include "zero_one_pdbs.h"
#include "../heuristic.h"
namespace pdbs {
class PatternDatabase;
class ZeroOnePDBsHeuristic : public Heuristic {
ZeroOnePDBs zero_one_pdbs;
protected:
virtual int compute_heuristic(const GlobalState &global_state);
/* TODO: we want to get rid of compute_heuristic(const GlobalState &state)
and change the interface to only use State objects. While we are doing
this, the following method already allows to get the heuristic value
for a State object. */
int compute_heuristic(const State &state) const;
public:
ZeroOnePDBsHeuristic(const options::Options &opts);
virtual ~ZeroOnePDBsHeuristic() = default;
};
}
#endif
|
2e7f02249e9f8799b852bee003eba54d44c35b08
|
31b18f7458f924928cc5acf942a9afc5149099f3
|
/shell.cpp
|
1c9d5d638fb2adb1831f182639a4c437b1329f01
|
[] |
no_license
|
keepCrashing/posd
|
dccc4432d979d78f6354013cfe42a6563d7c4ada
|
6ae5b4bed87e48bf05998705b2590151438b3930
|
refs/heads/master
| 2021-09-03T04:30:04.347750
| 2018-01-05T15:13:07
| 2018-01-05T15:13:07
| 103,396,885
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 928
|
cpp
|
shell.cpp
|
#include <gtest/gtest.h>
#include <iostream>
//#include "scanner.h"
#include "parser.h"
#include "shell.h"
using std::cout;
using std::endl;
using std::cin;
int main(int argc, char **argv)
{
string input, context = "", result = "";
while(true){
do{
if(context == ""){
cout << "?- ";
}else{
cout << "| ";
}
getline(cin, input);
if(input != ""){
while(input[0] == ' '){
input = input.substr(1, input.size() - 1);
}
context += input;
}
}while(input == "" || context.back() != '.');
if(context == "halt.") break;
try{
Scanner s(context);
Parser p(s);
p.buildExpression();
Shell shell(p.getExpressionTree());
result = shell.exec();
} catch (std::string & msg) {
std::cout << msg << std::endl;
}
cout << result << endl;
context = "";
};
}
|
7e0d7ab75665ed7f56e662edb03023e2e9bd6bae
|
d754ba23c8ff391ce9dcefcfae3b90cef16ecde0
|
/DMOJ/bf2.cpp
|
af46d7893ad54701999544489a776939777965a8
|
[] |
no_license
|
TruVortex/Competitive-Programming
|
3edc0838aef41128a27fdc7f47d704adbf2c3f38
|
3812ff630488d7589754ff25a3eefd8898226301
|
refs/heads/master
| 2023-05-10T01:48:00.996120
| 2021-06-02T03:36:35
| 2021-06-02T03:36:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 552
|
cpp
|
bf2.cpp
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string a;
int k;
cin>>a;
scanf("%i", &k);
vector<string> aa;
char e = 'z';
for (int x = 0; x < a.size()-k; x++)
{
if (a[x] <= e)
{
if (a[x] < e)
{
aa.clear();
e = a[x];
}
string b = "";
for (int y = 0; y < k; y++)
b+=a[x+y];
aa.push_back(b);
}
}
sort(aa.begin(), aa.end());
cout<<aa[0];
return 0;
}
|
5583a98017b6dc4c06f1fb92b6622e5321cec0cc
|
65247e6391cf93c651bdb2e069ca22a0eb631bf1
|
/PlayerBase.h
|
ddd3bfae4ad8b40eb3e41caad40cfd66e1783f1c
|
[] |
no_license
|
linofex/Machiavelli
|
71ba9c6d1f7711fa8e87e206e8f6dc3b37db1caf
|
1fbb759d4e6a565bcd245b36d14e6cf3ec63db08
|
refs/heads/master
| 2020-05-21T20:58:07.058034
| 2019-06-08T09:25:18
| 2019-06-08T09:25:18
| 63,788,772
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,567
|
h
|
PlayerBase.h
|
#ifndef PLAYERBASE_H
#define PLAYERBASE_H
/* Questa classe realizza un giocatore base, cioe' una classe astratta che e' padre
di una classe giocatore umano e una classe giocatore CPU. Un giocatore ha un nome
e le carte nella propria mano. E' possibile inserire, rimuovere, mesolarle, vederle */
#include <string>
#include <vector>
#include <sstream>
#include "Card.h"
class PlayerBase{
private:
std::string name;
std::vector<Card> cards;
static int n_player;
public:
PlayerBase(){
std::stringstream int2string;
int2string << n_player;
name = int2string.str();
n_player++;
}
/* Costruttore */
PlayerBase(const std::string& name_):name(name_){n_player ++;}
/* Metodo che aggiunge una carta al giocatore*/
virtual void AddCard(const Card& card);
/* Metodo che rimuove un carta */
virtual void RemoveCard(const Card& card);
/* Metodo che ordina le carte in mano */
virtual void SortCard();
/* Metodo che ritorna il nome del giocatore */
virtual std::string GetName() const;
/* Metodo che inserisce un insieme di carte preciso */
virtual void SetCards(const std::vector<Card>& cards);
/* Metodo che ritorna il mazzetto di carte */
virtual const std::vector<Card>& GetCards() const;
/* Metodo che stampa le carte */
virtual void SeeCards() const;
/* Metodo che controlla se il giocatore ha ancora carte */
virtual bool Empty() const;
/* Metodo che cerca una carta */
virtual bool FindCard(const Card& card) const;
/* Distruttore */
// virtual ~PlayerBase(){}
};
#endif
|
dc2eb553e35f9da8c7899fda91fa85e0262987c4
|
bdd21e1066aae2bcbfbce66964bfdb779f57d5d4
|
/examples/example_win32_directx11/Flask.cpp
|
e706172a6ad0475892d342dace4604fc158f7fc4
|
[
"MIT"
] |
permissive
|
FacelessMartyr/ImGui_rpggame
|
82bc41b6b603fe2deb19c13f9dbff478788d1f25
|
c5b3ab227a3c1afded1b0427b6e5c4d34d95a2a0
|
refs/heads/main
| 2023-06-16T00:12:04.134740
| 2021-07-17T09:33:28
| 2021-07-17T09:33:28
| 341,504,251
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 491
|
cpp
|
Flask.cpp
|
#include "Flask.h"
Game_Flask::Game_Flask(const Game_Flask& a):Game_Item(a)
{
this->heal_type = a.heal_type;
this->healing = a.healing;
this->charges = a.charges;
this->healtype_enum = a.healtype_enum;
}
Game_Flask& Game_Flask::operator=(const Game_Flask& a)
{
this->heal_type = a.heal_type;
this->healing = a.healing;
this->charges = a.charges;
this->healtype_enum = a.healtype_enum;
return *this;
}
void Game_Flask::drawIntoImgui() const
{
;
}
|
6e4dd6f027bf846d97de5ddb9520020dc11f4564
|
877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a
|
/app/src/main/cpp/dir7941/dir7942/dir8062/dir8063/dir12766/dir12767/dir13029/dir13714/file15022.cpp
|
051eaa6345715bab6c568efdb041dfa90d37e309
|
[] |
no_license
|
tgeng/HugeProject
|
829c3bdfb7cbaf57727c41263212d4a67e3eb93d
|
4488d3b765e8827636ce5e878baacdf388710ef2
|
refs/heads/master
| 2022-08-21T16:58:54.161627
| 2020-05-28T01:54:03
| 2020-05-28T01:54:03
| 267,468,475
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 115
|
cpp
|
file15022.cpp
|
#ifndef file15022
#error "macro file15022 must be defined"
#endif
static const char* file15022String = "file15022";
|
16d5f5298429a473387a05d98d807f1d588a7dad
|
792e697ba0f9c11ef10b7de81edb1161a5580cfb
|
/unittests/Transforms/Utils/ModuleUtilsTest.cpp
|
e1bc58fda0e38fefe474be87b5bad7e6cd9d492c
|
[
"NCSA",
"LLVM-exception",
"Apache-2.0"
] |
permissive
|
opencor/llvmclang
|
9eb76cb6529b6a3aab2e6cd266ef9751b644f753
|
63b45a7928f2a8ff823db51648102ea4822b74a6
|
refs/heads/master
| 2023-08-26T04:52:56.472505
| 2022-11-02T04:35:46
| 2022-11-03T03:55:06
| 115,094,625
| 0
| 1
|
Apache-2.0
| 2021-08-12T22:29:21
| 2017-12-22T08:29:14
|
LLVM
|
UTF-8
|
C++
| false
| false
| 2,223
|
cpp
|
ModuleUtilsTest.cpp
|
//===- ModuleUtilsTest.cpp - Unit tests for Module utility ----===//
//
// 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
//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
using namespace llvm;
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
SMDiagnostic Err;
std::unique_ptr<Module> Mod = parseAssemblyString(IR, Err, C);
if (!Mod)
Err.print("ModuleUtilsTest", errs());
return Mod;
}
static int getUsedListSize(Module &M, StringRef Name) {
auto *UsedList = M.getGlobalVariable(Name);
if (!UsedList)
return 0;
auto *UsedListBaseArrayType = cast<ArrayType>(UsedList->getValueType());
return UsedListBaseArrayType->getNumElements();
}
TEST(ModuleUtils, AppendToUsedList1) {
LLVMContext C;
std::unique_ptr<Module> M = parseIR(
C, R"(@x = addrspace(4) global [2 x i32] zeroinitializer, align 4)");
SmallVector<GlobalValue *, 2> Globals;
for (auto &G : M->globals()) {
Globals.push_back(&G);
}
EXPECT_EQ(0, getUsedListSize(*M, "llvm.compiler.used"));
appendToCompilerUsed(*M, Globals);
EXPECT_EQ(1, getUsedListSize(*M, "llvm.compiler.used"));
EXPECT_EQ(0, getUsedListSize(*M, "llvm.used"));
appendToUsed(*M, Globals);
EXPECT_EQ(1, getUsedListSize(*M, "llvm.used"));
}
TEST(ModuleUtils, AppendToUsedList2) {
LLVMContext C;
std::unique_ptr<Module> M =
parseIR(C, R"(@x = global [2 x i32] zeroinitializer, align 4)");
SmallVector<GlobalValue *, 2> Globals;
for (auto &G : M->globals()) {
Globals.push_back(&G);
}
EXPECT_EQ(0, getUsedListSize(*M, "llvm.compiler.used"));
appendToCompilerUsed(*M, Globals);
EXPECT_EQ(1, getUsedListSize(*M, "llvm.compiler.used"));
EXPECT_EQ(0, getUsedListSize(*M, "llvm.used"));
appendToUsed(*M, Globals);
EXPECT_EQ(1, getUsedListSize(*M, "llvm.used"));
}
|
28b4f7165831ce6046b7e5a6e441c55f273de9c1
|
9640e621c6814d08ac4b243a2cfb5d6ed6fa1496
|
/ChatClient/ChatClient/ChatClient.cpp
|
828c118e3f64843dca3a73110091cabc570a5d94
|
[
"MIT"
] |
permissive
|
Sarytobi/Death-March
|
d4b90dc00c28e47c00ce45eb7d9a7b58dbe5a3e3
|
937a8688bd8a83a200473f69d8418ab00ed7b68a
|
refs/heads/master
| 2020-12-19T19:32:47.328059
| 2020-02-12T17:38:25
| 2020-02-12T17:38:25
| 235,829,975
| 0
| 0
|
MIT
| 2020-02-12T11:57:55
| 2020-01-23T15:57:19
| null |
UTF-8
|
C++
| false
| false
| 4,297
|
cpp
|
ChatClient.cpp
|
#pragma comment(lib, "ws2_32.lib")
#include <winsock2.h>
#include <iostream>
#include "conio.h"
#include <string>
#include "NetworksComnuliti.h"
#pragma warning(disable: 4996)
SOCKET Connection;
using namespace std;
bool flagMenu = false;
string answers[10];
int answerCounter;
string upperMessage;
void ClientHandler();
string menu(string upperMessage, string* answers, int answerCounter);
int main(int argc, char* argv[]) {
//WSAStartup
WSAData wsaData;
WORD DLLVersion = MAKEWORD(2, 1);
if (WSAStartup(DLLVersion, &wsaData) != 0) {
std::cout << "Error" << std::endl;
exit(1);
}
SOCKADDR_IN addr;
int sizeofaddr = sizeof(addr);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_port = htons(1111);
addr.sin_family = AF_INET;
Connection = socket(AF_INET, SOCK_STREAM, NULL);
if (connect(Connection, (SOCKADDR*)&addr, sizeof(addr)) != 0) {
std::cout << "Error: failed connect to server.\n";
return 1;
}
std::cout << "Connected!\n";
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)ClientHandler, NULL, NULL, NULL);
std::string msg1;
std::string temp;
std::cout << "Enter Name Players - ";
msg1 += "NamePlayers";
std::getline(std::cin, temp);
msg1 += temp;
int msg_size = msg1.size();
send(Connection, (char*)&msg_size, sizeof(int), NULL);
send(Connection, msg1.c_str(), msg_size, NULL);
while (true) {
if (flagMenu)
{
msg1 = menu(upperMessage, answers, answerCounter);
}
else
{
std::getline(std::cin, msg1);
}
if (msg1 == "")
{
continue;
}
int msg_size = msg1.size();
send(Connection, (char*)&msg_size, sizeof(int), NULL);
send(Connection, msg1.c_str(), msg_size, NULL);
Sleep(10);
}
system("pause");
return 0;
}
void ClientHandler() {
int msg_size;
string message, messageToOut;
int foundSymbol;
while (true) {
recv(Connection, (char*)&msg_size, sizeof(int), NULL);
char* msg = new char[msg_size + 1];
msg[msg_size] = '\0';
recv(Connection, msg, msg_size, NULL);
message.clear();
message = msg;
if (message.find('#') != string::npos)
{
foundSymbol = message.find('#');
upperMessage = message.substr(0, foundSymbol);
for (int i = 0; i < 10; i++)
{
answers[i].clear();
}
message = message.substr(foundSymbol, message.length());
answerCounter = 0;
while (message.find('#') != string::npos)
{
message = message.substr(1, message.length());
if (message.find('#') == string::npos)
{
messageToOut = message;
answers[answerCounter] = messageToOut; //form array with variants of answer
answerCounter++;
}
else
{
foundSymbol = message.find('#');
messageToOut = message.substr(0, foundSymbol);
answers[answerCounter] = messageToOut;
answerCounter++;
message = message.substr(foundSymbol, message.length());
}
}
flagMenu = true; //switching to menu input model
}
else
{
std::cout << message << endl;
std::cout << "Press Enter to continue";
}
delete[] msg;
}
}
string menu(string upperMessage, string* answers, int answerCounter)
{
int pushButton;
int highlightedVariant = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); //color console
while (true)
{
system("cls");
cout << upperMessage << endl << endl << endl;
for (int i = 0; i < answerCounter; i++)
{
if (i == highlightedVariant)
{
SetConsoleTextAttribute(hConsole, 240); //white console
cout << answers[i] << endl;
SetConsoleTextAttribute(hConsole, 15); //black console back
}
else
{
cout << answers[i] << endl;
}
}
pushButton = _getch();
if (pushButton == 224) //push
{
pushButton = _getch();
}
if (pushButton == 72) //up
{
if (highlightedVariant == 0)
{
highlightedVariant = answerCounter - 1;
}
else
{
highlightedVariant--;
}
}
else if (pushButton == 80) //down
{
if (highlightedVariant == answerCounter - 1)
{
highlightedVariant = 0;
}
else
{
highlightedVariant++;
}
}
else if (pushButton == 13) //enter
{
flagMenu = false;
system("cls");
return answers[highlightedVariant];
}
}
}
|
f190358e97afcbb30bdfa9b4ac9bf4cb645d24b9
|
427c7d54f1c4d2b3b09ec9d8de40fb601437592d
|
/code/SalaryCalculator/Classes/Salary.cpp
|
397369adc768298d713314cc5f544fb209851f90
|
[] |
no_license
|
loveleon/AzureSky
|
4c1427ce2b1c507eacb09275355e9c4660c5e1d4
|
205725f4c9c988bbb919ce3e9caed149a557483a
|
refs/heads/master
| 2021-06-23T14:47:19.348244
| 2017-08-14T16:42:23
| 2017-08-14T16:42:23
| 100,288,915
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,760
|
cpp
|
Salary.cpp
|
#include "Salary.h"
#include "Tax.h"
#include "Welfare.h"
bool Calculator::Pre2Suf(Salary& salary, int version)
{
float pre = salary.Pre - salary.Det;
if (pre < 0 || pre > ULONG_MAX)
{
return false;
}
Tax* tax = TaxManager::Instance()->getTax(version);
if (!tax)
{
return false;
}
float line = tax->Line;
float rest = pre - line;
if(rest <= 0)
{
salary.Tax = 0;
salary.Suf = pre;
return true;
}
for(int i = 0; ;i++)
{
float min = tax->Items[i]->Min;
float max = tax->Items[i]->Max;
if(rest > min && rest <= max)
{
float rate = tax->Items[i]->Rate;
float deduct = tax->Items[i]->Det;
salary.Tax = (pre - line) * rate - deduct;
salary.Suf = pre - salary.Tax;
return true;
}
}
}
bool Calculator::Suf2Pre(Salary& salary, int version)
{
float suf = salary.Suf;
if (suf < 0 || suf > ULONG_MAX)
{
return false;
}
Tax* tax = TaxManager::Instance()->getTax(version);
if(!tax)
{
return false;
}
float line = tax->Line;
float rest = suf - line;
if(rest <= 0)
{
salary.Tax = 0;
salary.Pre = suf + salary.Det;
return true;
}
float pre = 0;
for(int i = 0; i < (int)tax->Items.size(); i++)
{
float min = tax->Items[i]->Min;
float max = tax->Items[i]->Max;
float rate = tax->Items[i]->Rate;
float deduct = tax->Items[i]->Det;
float temp = (suf - deduct - rate * line) /(1 - rate);
if (temp > pre)
{
pre = temp;
}
}
salary.Tax = pre - suf;
salary.Pre = pre + salary.Det;
return true;
}
bool Calculator::Tax2Two(Salary& salary, int version)
{
float tax = salary.Tax;
if (tax < 0 || tax > ULONG_MAX)
{
return false;
}
Tax* table = TaxManager::Instance()->getTax(version);
if(!table)
{
return false;
}
float line = table->Line;
float pre = (float)ULONG_MAX;
for(int i = 0; i < (int)table->Items.size(); i++)
{
float min = table->Items[i]->Min;
float max = table->Items[i]->Max;
float rate = table->Items[i]->Rate;
float deduct = table->Items[i]->Det;
float temp = (tax + deduct) / rate + line;
if (temp < pre)
{
pre = temp;
}
}
salary.Suf = pre - tax;
salary.Pre = pre + salary.Det;
return true;
}
bool Calculator::DoDeduct(Deduct& deduct, const std::vector<WelfareItem>& Items)
{
float ins = deduct.Ins;
float fund = deduct.Fund;
if (ins < 0 || ins > ULONG_MAX || fund < 0 || fund > ULONG_MAX)
{
return false;
}
for (int i = 0; i < (int)Items.size(); i++)
{
WelfareItem item;
item.Type = i;
float temp = i < WIT_FUND ? ins : fund;
item.Allow = Items[i].Allow;
item.Personal = int(Items[i].Personal * temp);
item.Company = int(Items[i].Company * temp);
deduct.Items.push_back(item);
if (item.Allow)
{
deduct.Private += item.Personal;
deduct.Company += item.Company;
}
}
return true;
}
|
c1e3b0f6624f18692bd6b32bc5a95134565e9756
|
05db8a70a2134afc5c830b7f2af779647f643202
|
/src/constant/EzyConnectionFailedReason.cpp
|
ea5ecc04273959e983adf9e14856d52a3ccaa83a
|
[] |
no_license
|
youngmonkeys/ezyfox-server-cpp-client
|
a97699cb6494380e75d86c86ee4493471f52f986
|
1d55695eaaf855b01464604cd205ae6861e1bbf2
|
refs/heads/master
| 2023-07-21T19:36:32.775174
| 2023-07-09T06:58:55
| 2023-07-09T06:58:55
| 112,422,375
| 6
| 6
| null | 2023-07-10T15:02:37
| 2017-11-29T03:36:27
|
C++
|
UTF-8
|
C++
| false
| false
| 586
|
cpp
|
EzyConnectionFailedReason.cpp
|
#include <map>
#include "EzyConnectionFailedReason.h"
EZY_NAMESPACE_START_WITH_ONLY(constant)
static std::map<int, std::string> sConnectionFailedReasonNames = {
{TimeOut, "TimeOut"},
{NetworkUnreachable, "NetworkUnreachable"},
{UnknownHost, "UnknownHost"},
{ConnectionRefused, "ConnectionRefused"},
{UnknownFailure, "UnknownFailure"}
};
std::string getConnectionFailedReasonName(int reason) {
if(sConnectionFailedReasonNames.count(reason) == 0)
return std::to_string(reason);
return sConnectionFailedReasonNames[reason];
}
EZY_NAMESPACE_END_WITH
|
e90aa0b75f8433f3027c50d5e7c62554c0162efc
|
cee96e0cecdd9cd783ad567fe5faa04dc0d8ba08
|
/src/mpx_raw.ino
|
a76d208430d4cedb9c92d7c03d471fcdebd6e49f
|
[] |
no_license
|
gnkarn/mpx_raw
|
22167a96ea1e18dd3e899944bbb21a846f55d4e4
|
63fe963cc9e2e7b7253e8ed081ea479eef3c12a7
|
refs/heads/master
| 2021-05-09T23:57:12.805185
| 2018-01-27T13:56:57
| 2018-01-27T13:56:57
| 118,816,555
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,859
|
ino
|
mpx_raw.ino
|
/*
Author: AnalysIR
Revision: 1.0
This code is provided to overcome an issue with Arduino IR libraries
It allows you to capture raw timings for signals longer than 255 marks & spaces.
Typical use case is for long Air conditioner signals.
You can use the output to plug back into IRremote, to resend the signal.
This Software was written by AnalysIR.
Usage: Free to use, subject to conditions posted on blog below.
Please credit AnalysIR and provide a link to our website/blog, where possible.
Copyright AnalysIR 2014
Please refer to the blog posting for conditions associated with use.
http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/
Connections:
IR Receiver Arduino
V+ -> +5v
GND -> GND
Signal Out -> Digital Pin 2
(If using a 3V Arduino, you may connect V+ to +3V)
2018 _ Raw_ir modified by GNK to decode mpx 16 bit code
*/
#define LEDPIN 13
//you may increase this value on Arduinos with greater than 2k SRAM
#define maxLen 34
// Uncomment to enable printing out nice debug messages.
// #define DEBUG
// Define where debug output will be printed.
#define DEBUG_PRINTER Serial
// Setup debug printing macros.
#ifdef DEBUG
#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#else
#define DEBUG_PRINT(...) {}
#define DEBUG_PRINTLN(...) {}
#endif
volatile uint32_t irBuffer[maxLen]; //stores timings - volatile because changed by ISR
uint16_t delta[maxLen]; // contiene los tiempos netos de cada pulso en lugar del tiempo absoluto
volatile unsigned int x = 0; //Pointer thru irBuffer - volatile because changed by ISR
String code =""; // contiene el string del ultimo codigo de 16 bits
int zona = ""; // guarda el codigo de la zona detectada
uint8_t data[2]; //vector de resultado
#define BitOneTicks 2400 // si es mayor que 2400 ms es un uno
#define BitZeroTicks 1400 // si es menor que 1400 ms es un cero
#define max_ticks 4000 // si un pulso es mayor que este valor , entonces hay Error de captura
// asigna una zona en caso de detectar un codigo especifico
int detectZona ( String code1) {
if ( code1 == "1615" ){ return 1 ; }
else if (code1 == "9630") { return 3 ;}
else if (code1 == "1640") { return 4 ;}
else if (code1 == "9653") { return 5 ;}
else if (code1 == "9665") { return 6 ;}
else {return 0 ;}
}
// Inspect pulses and determine which ones are 0 (high state cycle count < low
// state cycle count), or 1 (high state cycle count > low state cycle count).
void decode_mpx(){
// Reset 16 bits of received data to zero.
data[0] = data[1] = 0;
for (int i=0; i<16; ++i) {
uint32_t lowCycles = delta[2*i];
uint32_t highCycles = delta[2*i+1];
if ((highCycles == 0)|| (lowCycles==0)) {
DEBUG_PRINTLN(F("Timeout waiting for pulse."));
//_lastresult = false;
return; //_lastresult;
}
// un pulso anormalmente largo en medio de la trama ?
if ( delta[i-1] > max_ticks) {
DEBUG_PRINTLN(F("pulso muy largo "));
//_lastresult = false;
return; //_lastresult;
}
data[i/8] <<= 1;
// Now compare the low and high cycle times to see if the bit is a 0 or 1.
if (highCycles > BitOneTicks) {
// High cycles are greater than 50us low cycle count, must be a 1.
data[i/8] |= 1;
//DEBUG_PRINTLN(highCycles); // debug sacar
}
// Else high cycles are less than (or equal to, a weird case) the 50us low
// cycle count so this must be a zero. Nothing needs to be changed in the
// stored data.
}
String stringOne = String(data[0], HEX);
String stringTwo = String(data[1],HEX);
if (stringOne.length() == 1) {stringOne = "0"+stringOne ;};
if (stringTwo.length() ==1 ) {stringTwo = "0"+stringTwo ;};
stringOne.toUpperCase();
stringTwo.toUpperCase();
code = stringOne + stringTwo ;
// Serial.println (code); // DEBUG
zona = detectZona(code) ;
if (zona != 0) {
Serial.print("Z");
Serial.println (zona );
}
DEBUG_PRINT(data[0]); DEBUG_PRINT("_");DEBUG_PRINT(data[1]); // debug gnk
DEBUG_PRINT(" || ");
DEBUG_PRINT(data[0], HEX);DEBUG_PRINT("_");DEBUG_PRINTLN(data[1], HEX); // debug gnk
}
void setup() {
Serial.begin(115200); //change BAUD rate as required
Serial.println( " decodifica protocolo mpx X28: ") ;
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//set up ISR for receiving IR signal
}
void loop() {
// put your main code here, to run repeatedly:
//Serial.println(F("Press the button on the remote now - once only"));
delay(100); // pause 500 m secs subirlo en caso de dubug a 500 ms y bajarlo a 50 para produccion
if (x=34) { //if a signal is captured , 32 transiciones son 16 bits
detachInterrupt(0);//stop interrupts & capture until finshed here
digitalWrite(LEDPIN, HIGH);//visual indicator that signal received
DEBUG_PRINTLN();
DEBUG_PRINT(F("Raw: (")); //dump raw header format - for library
DEBUG_PRINT((x - 1));
DEBUG_PRINT(F(") "));
for (int i = 1; i < x; i++) { //now dump the times
if (!(i & 0x1)) {
DEBUG_PRINT(F("-"));
}
delta[i-1]= irBuffer[i] - irBuffer[i - 1];
DEBUG_PRINT(delta[i-1]);
DEBUG_PRINT(F(", "));
}
x = 0;
//Serial.println();
DEBUG_PRINTLN();
decode_mpx(); // imprime resultado
digitalWrite(LEDPIN, LOW);//end of visual indicator, for this time
attachInterrupt(0, rxIR_Interrupt_Handler, CHANGE);//re-enable ISR for receiving IR signal
}
}
void rxIR_Interrupt_Handler() {
if (x > maxLen) return; //ignore if irBuffer is already full
irBuffer[x++] = micros(); //just continually record the time-stamp of signal transitions
}
|
668052fd565f97facb6a35805dce726daf2c048a
|
cf4edc2a34c4627d45c47feeacf2acf079aa596f
|
/source/QSystemSemaphore.cpp
|
2b0bf7faef1c3820d2fae28f05af2bbc99251903
|
[
"MIT"
] |
permissive
|
diegopego/Qt4xHb
|
eeb7c3e33b570193469bfca47d7d1835c2efbc38
|
5f96614f794cc8392b4d97f7dcd80b2fbf46ab65
|
refs/heads/master
| 2021-01-09T05:55:50.167467
| 2017-02-01T22:44:30
| 2017-02-01T22:44:30
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
C++
| false
| false
| 3,515
|
cpp
|
QSystemSemaphore.cpp
|
/*
Qt4xHb - bibliotecas de ligação entre Harbour/xHarbour e Qt Framework 4
Copyright (C) 2012-2017 Marcos Antonio Gambeta <marcosgambeta@uol.com.br>
*/
#include <QSystemSemaphore>
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
#include "hbstack.h"
#ifndef __XHARBOUR__
#include "hbapicls.h"
#define ISNIL HB_ISNIL
#define ISLOG HB_ISLOG
#define ISNUM HB_ISNUM
#define ISCHAR HB_ISCHAR
#define ISPOINTER HB_ISPOINTER
#define ISOBJECT HB_ISOBJECT
#define ISARRAY HB_ISARRAY
#endif
#include "qt4xhb_clsid.h"
#include "qt4xhb_utils.h"
/*
QSystemSemaphore ( const QString & key, int initialValue = 0, AccessMode mode = Open )
*/
HB_FUNC( QSYSTEMSEMAPHORE_NEW )
{
QSystemSemaphore * o = NULL;
QString par1 = hb_parc(1);
int par2 = ISNIL(2)? 0 : hb_parni(2);
int par3 = ISNIL(3)? (int) QSystemSemaphore::Open : hb_parni(3);
o = new QSystemSemaphore ( par1, par2, (QSystemSemaphore::AccessMode) par3 );
PHB_ITEM self = hb_stackSelfItem();
PHB_ITEM ptr = hb_itemPutPtr( NULL,(QSystemSemaphore *) o );
hb_objSendMsg( self, "_pointer", 1, ptr );
hb_itemRelease( ptr );
hb_itemReturn( self );
}
HB_FUNC( QSYSTEMSEMAPHORE_DELETE )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
delete obj;
obj = NULL;
PHB_ITEM self = hb_stackSelfItem();
PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
hb_objSendMsg( self, "_pointer", 1, ptr );
hb_itemRelease( ptr );
}
hb_itemReturn( hb_stackSelfItem() );
}
/*
bool acquire ()
*/
HB_FUNC( QSYSTEMSEMAPHORE_ACQUIRE )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
bool b = obj->acquire ( );
hb_retl( b );
}
}
/*
SystemSemaphoreError error () const
*/
HB_FUNC( QSYSTEMSEMAPHORE_ERROR )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
int i = obj->error ( );
hb_retni( i );
}
}
/*
QString errorString () const
*/
HB_FUNC( QSYSTEMSEMAPHORE_ERRORSTRING )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
QString str1 = obj->errorString ( );
hb_retc( (const char *) str1.toLatin1().data() );
}
}
/*
QString key () const
*/
HB_FUNC( QSYSTEMSEMAPHORE_KEY )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
QString str1 = obj->key ( );
hb_retc( (const char *) str1.toLatin1().data() );
}
}
/*
bool release ( int n = 1 )
*/
HB_FUNC( QSYSTEMSEMAPHORE_RELEASE )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
int par1 = ISNIL(1)? 1 : hb_parni(1);
bool b = obj->release ( par1 );
hb_retl( b );
}
}
/*
void setKey ( const QString & key, int initialValue = 0, AccessMode mode = Open )
*/
HB_FUNC( QSYSTEMSEMAPHORE_SETKEY )
{
QSystemSemaphore * obj = (QSystemSemaphore *) hb_itemGetPtr( hb_objSendMsg( hb_stackSelfItem(), "POINTER", 0 ) );
if( obj )
{
QString par1 = hb_parc(1);
int par2 = ISNIL(2)? 0 : hb_parni(2);
int par3 = ISNIL(3)? (int) QSystemSemaphore::Open : hb_parni(3);
obj->setKey ( par1, par2, (QSystemSemaphore::AccessMode) par3 );
}
hb_itemReturn( hb_stackSelfItem() );
}
|
1f65219f1e0fc41009852b8c091b100804a81a19
|
e3d3d65fbded93e08791ea08e2b5e49d1a1782cf
|
/basic/health.cpp
|
d0b567fa297c7f6e6319f7fb4a8aa44e8221aa21
|
[] |
no_license
|
luuuwang/BugFight
|
76c5ed06d6d06059f4b0fa4f72f021d4e441d8f8
|
db5456c8c24d6d776bfd49a2d7edfb089e1dd9b0
|
refs/heads/master
| 2020-12-20T15:56:19.101260
| 2016-07-04T00:00:09
| 2016-07-04T00:00:09
| 62,516,828
| 0
| 0
| null | 2016-07-03T22:12:13
| 2016-07-03T22:01:02
| null |
UTF-8
|
C++
| false
| false
| 2,229
|
cpp
|
health.cpp
|
#include "health.h"
Health::Health() :
screen(IOManager::getInstance().getScreen()),
start(Vector2f(Gamedata::getInstance().getXmlInt("health/startLoc/x"),
Gamedata::getInstance().getXmlInt("health/startLoc/y"))),
totalLength(Gamedata::getInstance().getXmlInt("health/length")),
currentLength(totalLength),
thick(Gamedata::getInstance().getXmlInt("health/thick")),
decrements(Gamedata::getInstance().getXmlInt("health/decrements")),
RED( SDL_MapRGB(screen->format, 0xff, 0x00, 0x00) ),
GRAY( SDL_MapRGB(screen->format, 0xce, 0xb4, 0xb4) ),
BLACK( SDL_MapRGB(screen->format, 0x00, 0x00, 0x00) ),
color(RED) {
}
Health::Health(int sx, int sy, int tl, int cl,
float t, int dec, Uint32 c):
screen(IOManager::getInstance().getScreen()),
start(Vector2f(sx, sy)),
totalLength(tl),
currentLength(cl),
thick(t),
decrements(dec),
RED( SDL_MapRGB(screen->format, 0xff, 0x00, 0x00) ),
GRAY( SDL_MapRGB(screen->format, 0xff, 0xff, 0xff) ),
BLACK( SDL_MapRGB(screen->format, 0x00, 0x00, 0x00) ),
color(c) {
}
void Health::drawBox() const {
Draw_AALine(screen, start[0], start[1],
start[0]+totalLength, start[1],
thick, GRAY);
// Two Horizontal lines
Draw_AALine(screen, start[0], start[1]-(thick/2 + 1),
start[0]+totalLength, start[1]-(thick/2 + 1),
1.0, BLACK);
Draw_AALine(screen, start[0], start[1]+(thick/2 + 1),
start[0]+totalLength, start[1]+(thick/2 + 1),
1.0, BLACK);
// Two Vertical lines
Draw_AALine(screen, start[0]-1, start[1]-(thick/2 + 1),
start[0]-1, start[1]+(thick/2 + 1),
2.0, BLACK);
Draw_AALine(screen, start[0]+totalLength+1, start[1]-(thick/2 + 1),
start[0]+totalLength+1, start[1]+(thick/2 + 1),
2.0, BLACK);
}
void Health::draw() const {
drawBox();
Draw_AALine(screen, start[0], start[1],
start[0] + currentLength, start[1],
thick, color);
}
void Health::update() {
currentLength = currentLength - decrements < 0 ? 0 : currentLength - decrements;
}
|
287b85752e862d426a226e91c6dfa0226df6805c
|
211857ea633218010fbd6a9ce7e8210002c95ffe
|
/stl/algorithm/generate_copy.cpp
|
39ac12f2dfadabb0ec9f925fd4292b5573e26af1
|
[] |
no_license
|
mettasri/cpp
|
6fdcd1c5fc120277d9ecaf26692d2dfdf521474a
|
ab2800de215999576c3bc9604dce0254e45a1388
|
refs/heads/master
| 2022-11-18T22:26:47.562834
| 2020-02-05T18:24:38
| 2020-02-05T18:24:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 347
|
cpp
|
generate_copy.cpp
|
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
struct g
{
g():n(0){}
int operator()() { return n++; }
int n;
};
int main()
{
int a[10];
generate(a, a+10, g());
// copy(a, a+10, ostream_iterator<int>(cout, " "));
ostream_iterator<int> out_it(cout, " ");
copy(a, a+10, out_it);
}
|
1733d2a49e5054cfd7cf1fde458d5d49be01ac82
|
464d6cb42fb8981595cbf7260069cd1e6a67fe2f
|
/HashMap/Count distinct elements in every window of size k.cpp
|
57e8f9d0b5f2add7ad9527eb1b4a39f7381fbba7
|
[] |
no_license
|
rahul799/leetcode_problems
|
fd42276f85dc881b869072b74654f5811c6618ea
|
cc7f086eb9ac9bbd20ea004c46d89aa84df10d36
|
refs/heads/main
| 2023-04-14T05:09:31.016878
| 2021-04-20T19:46:52
| 2021-04-20T19:46:52
| 359,933,382
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,500
|
cpp
|
Count distinct elements in every window of size k.cpp
|
Count distinct elements in every window of size k
Last Updated: 27-06-2020
Given an array of size n and an integer k, return the count of distinct numbers in all windows of size k.
Example:
Input: arr[] = {1, 2, 1, 3, 4, 2, 3};
k = 4
Output: 3 4 4 3
Explanation:
First window is {1, 2, 1, 3}, count of distinct numbers is 3
Second window is {2, 1, 3, 4} count of distinct numbers is 4
Third window is {1, 3, 4, 2} count of distinct numbers is 4
Fourth window is {3, 4, 2, 3} count of distinct numbers is 3
Input: arr[] = {1, 2, 4, 4};
k = 2
Output: 2 2 1
Explanation:
First window is {1, 2}, count of distinct numbers is 2
First window is {2, 4}, count of distinct numbers is 2
First window is {4, 4}, count of distinct numbers is 1
Algorithm:
1. Create an empty hash map. Let the hash map be hM.
2. Initialize the count of distinct element as dist_count to 0.
3. Traverse through the first window and insert elements of the first window to hM. The elements are used as key and their counts as the value in hM. Also, keep updating dist_count
Traverse through the remaining array (or other windows).
Remove the first element of the previous window.
If the removed element appeared only once, remove it from hM and decrease the distinct count, i.e. do “dist_count–“
else (appeared multiple times in hM), then decrement its count in hM
Add the current element (last element of the new window)
If the added element is not present in hM, add it to hM and increase the distinct count, i.e. do “dist_count++”
Else (the added element appeared multiple times), increment its count in hM
// An efficient C++ program to
// count distinct elements in
// every window of size k
#include <iostream>
#include <map>
using namespace std;
void countDistinct(int arr[], int k, int n)
{
// Creates an empty hashmap hm
map<int, int> hm;
// initialize distinct element count for current window
int dist_count = 0;
// Traverse the first window and store count
// of every element in hash map
for (int i = 0; i < k; i++) {
if (hm[arr[i]] == 0) {
dist_count++;
}
hm[arr[i]] += 1;
}
// Print count of first window
cout << dist_count << endl;
// Traverse through the remaining array
for (int i = k; i < n; i++) {
// Remove first element of previous window
// If there was only one occurrence, then reduce distinct count.
if (hm[arr[i - k]] == 1) {
dist_count--;
}
// reduce count of the removed element
hm[arr[i - k]] -= 1;
// Add new element of current window
// If this element appears first time,
// increment distinct element count
if (hm[arr[i]] == 0) {
dist_count++;
}
hm[arr[i]] += 1;
// Print count of current window
cout << dist_count << endl;
}
}
int main()
{
int arr[] = { 1, 2, 1, 3, 4, 2, 3 };
int size = sizeof(arr) / sizeof(arr[0]);
int k = 4;
countDistinct(arr, k, size);
return 0;
}
// This solution is contributed by Aditya Goel
vector<int> solve(vector<int>& nums, int k) {
unordered_map<int, int> mp;
for (int i = 0; i < k; i++) {
mp[nums[i]]++;
}
vector<int> vec;
vec.push_back(mp.size());
int p = 0, n = nums.size();
mp[nums[p]]--;
if (mp[nums[p]] == 0) {
mp.erase(nums[p]);
}
p = 1;
for (int i = k; i < n; i++) {
mp[nums[i]]++;
vec.push_back(mp.size());
mp[nums[p]]--;
if (mp[nums[p]] == 0) mp.erase(nums[p]);
p++;
}
return vec;
}
|
e749e69fb4cf1d9fd5f404174214715843331ca3
|
8a182aefb1c5298098d925f44202040fecc2b45e
|
/main.cpp
|
de4cc3a79dded076896675d9d8ba76f9a4610705
|
[] |
no_license
|
matthill/tesseract_z_issue
|
598cb4296ed4e80d72f1558fe0ad9ce58df873f7
|
d60f350c76b9106e14a3ec836d82c864e3cadc3d
|
refs/heads/master
| 2021-01-10T07:24:51.914679
| 2016-03-06T14:46:28
| 2016-03-06T14:46:39
| 53,259,193
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,994
|
cpp
|
main.cpp
|
#include "tesseract/baseapi.h"
#include <iostream>
#include <leptonica/allheaders.h>
using namespace std;
using namespace tesseract;
int main( int argc, const char** argv )
{
tesseract::TessBaseAPI tesseract;
tesseract.Init("./", "leu" );
tesseract.SetVariable("save_blob_choices", "T");
tesseract.SetVariable("debug_file", "/dev/null");
tesseract.SetPageSegMode(PSM_SINGLE_CHAR);
PIX *pixs = pixRead("z.png");
int z_width = 32;
int z_height = 41;
int num_channels = 1;
tesseract.SetImage(pixs);
tesseract.SetRectangle(0, 0, z_width, z_height);
tesseract.Recognize(NULL);
tesseract::ResultIterator* ri = tesseract.GetIterator();
tesseract::PageIteratorLevel level = tesseract::RIL_SYMBOL;
do
{
const char* symbol = ri->GetUTF8Text(level);
float conf = ri->Confidence(level);
bool dontcare;
int fontindex = 0;
int pointsize = 0;
const char* fontName = ri->WordFontAttributes(&dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &dontcare, &pointsize, &fontindex);
// Ignore NULL pointers, spaces, and characters that are way too small to be valid
int MIN_PIXEL_SIZE = 6;
if(symbol != 0 && pointsize >= MIN_PIXEL_SIZE)
{
cout << symbol << " : " << conf << endl;
printf("symbol %s, conf: %f font: %s (index %d) size %dpx", symbol, conf, fontName, fontindex, pointsize);
bool indent = false;
tesseract::ChoiceIterator ci(*ri);
do
{
const char* choice = ci.GetUTF8Text();
if (indent) printf("\t\t ");
printf("\t- ");
printf("%s conf: %f\n", choice, ci.Confidence());
indent = true;
}
while(ci.Next());
}
printf("---------------------------------------------\n");
delete[] symbol;
}
while((ri->Next(level)));
return 0;
}
|
844628afe35ed2bfc603f752235e41f4dbb19e9e
|
5401293f149bd72f35aa85f02d5efb52647c02e7
|
/src/Utils/Graphics/ImageUtils.cpp
|
53fa17909070cf393dd0215f513df08c28076240
|
[] |
no_license
|
thorhunter1/Tactics-Ogre-2
|
6d15c2792c2d6500858e448a89abf2f4384215f2
|
f7caaeb63afdc1bdc2d96360c083d611530a69fd
|
refs/heads/master
| 2021-01-01T06:33:02.816405
| 2015-07-31T09:08:00
| 2015-07-31T09:08:00
| 38,154,110
| 4
| 1
| null | 2015-07-26T12:27:36
| 2015-06-27T09:07:44
|
C++
|
UTF-8
|
C++
| false
| false
| 1,760
|
cpp
|
ImageUtils.cpp
|
#include "ImageUtils.hpp"
#include "Utils/Game/TeamColorEnum.hpp"
#include "SFML.hpp"
namespace Graphics
{
int teamColor( sf::Image& image, TeamColor color )
{
float red_paint = 1.0;
float green_paint = 1.0;
float blue_paint = 1.0;
//float alpha_paint = 1.0;
if( color == TeamColor::Gray ) {}
if( color == TeamColor::Red ) { red_paint = 1.0; green_paint = 0.5; blue_paint = 0.5; }
if( color == TeamColor::Green ) { red_paint = 0.5; green_paint = 1.0; blue_paint = 0.5; }
if( color == TeamColor::Blue ) { red_paint = 0.5; green_paint = 0.7; blue_paint = 1.0; }
if( color == TeamColor::Teal ) { red_paint = 0.2; green_paint = 0.8; blue_paint = 1.0; }
if( color == TeamColor::Black ) { red_paint = 0.5; green_paint = 0.5; blue_paint = 0.5; }
//if( color == TeamColor::Transparent ) { alpha_paint = 0.3; }
sf::Vector2u img_size = image.getSize();
for( int iRows = 0; iRows < img_size.x; ++iRows )
{
for( int iCols = 0; iCols < img_size.y; ++iCols )
{
sf::Color pix = image.getPixel( iRows, iCols );
//if( pix.r == pix.g && pix.r == pix.b )
//Debug( "r:" << (int)pix.r << " g:" << (int)pix.g << " b:" << (int)pix.b );
//if( pix == LightGray || pix == MiddleGray || pix == DarkGray )
if( pix.r == pix.g && pix.r == pix.b )
{
pix.r *= red_paint;
pix.g *= green_paint;
pix.b *= blue_paint;
//pix.a *= alpha_paint;
image.setPixel( iRows, iCols, pix );
}
}
}
}
}
|
3c79a1b1c2bfb0e8b30a4096636e8f7a1798bb9b
|
7694e64aa2b72d58eb740465a0c8c010744c59a4
|
/doc/Script/lua1/main.cpp
|
913270be2e027c676af849c9db57d00ff7b28547
|
[] |
no_license
|
tlegorju/Escape_prototype
|
44a6bb55dfca4c996f6c3d3085ba83a43fc7ea7e
|
ad2a9e6d0a2cce5e255bcb6b41d8739200940a68
|
refs/heads/master
| 2021-06-10T00:21:33.026412
| 2016-12-07T16:44:30
| 2016-12-07T16:44:30
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
C++
| false
| false
| 4,631
|
cpp
|
main.cpp
|
#include <stdio.h>
#include <stdlib.h>
#include <lua/lua.hpp>
int helloWorld(lua_State* L)
{
printf("hello world/n");
return 0;
}
int affichage(lua_State* L)
{
int nbArguments = lua_gettop(L);
if (nbArguments != 1)
{
fprintf(stderr,"nombre d'arguments invalide");
return 0;
}
printf("parametre : %s\n",lua_tostring(L,1));
return 0;
}
int printParams(lua_State* L)
{
printf("affichage des parametres de la fonction : \n");;
int nbParams = lua_gettop(L);
// Attention : lua commence à compter à partir de 1
for (int i = 1; i <= nbParams; i++)
{
if (lua_isnumber(L,i))
{
printf("%f\n",lua_tonumber(L,i));
}
else if (lua_isboolean(L,i))
{
if (lua_toboolean(L,i))
{
printf("true\n");;
}
else
{
printf("false\n");
}
}
else if (lua_isstring(L,i))
{
printf("%s\n",lua_tostring(L,i));
}
}
return 0;
}
int halfParam(lua_State* L)
{
int nbParam = lua_gettop(L);
if (nbParam != 1)
{
printf("halfParam : mauvais nombre de parametres\n");
return 0;
}
if (!lua_isnumber(L,1))
{
printf("halfParam : le parametre doit etre de type number\n");
return 0;
}
float param = lua_tonumber(L,1);
float ret = param / 2.0f;
lua_pushnumber(L,ret);
return 1;
}
int main(int argc, char** argv)
{
lua_State * state;
// on crée un context d'execution de Lua
state = lua_open();
// on charge les librairies standards de Lua
luaL_openlibs(state);
// on enregistre nos fonction C++ pour qu'elle puissent
// etre accedée depuis Lua
lua_register(state,"helloWorld",helloWorld);
lua_register(state,"affiche",affichage);
lua_register(state,"printParams",printParams);
lua_register(state,"halfParam",halfParam);
// on lance le script lua
if (luaL_dofile(state,"script.lua")!=0)
{
// il y a eut une erreur dans le script
fprintf(stderr,"%s\n",lua_tostring(state,-1));
exit(0);
}
// recuperation d'une variable (number) Lua depuis le code C++
lua_settop(state,0);
lua_getglobal(state,"var");
if (lua_isnumber(state,1))
{
printf("valeur de la variable var : %f\n",lua_tonumber(state,1));
}
lua_pop(state,1);
// recuperation d'une variable (string) Lua depuis le code C++
lua_settop(state,0);
lua_getglobal(state,"toto");
if (lua_isstring(state,1))
{
printf("valeur de la variable toto : %s\n",lua_tostring(state,1));
}
lua_pop(state,1);
//recuperation du contenu d'un tableau Lua depuis le code C++
lua_settop(state,0);
lua_getglobal(state,"tableau");
if (!lua_istable(state,1))
{
fprintf(stderr,"la variable tableau n'est pas un tableau\n");
lua_pop(state,1);
}
else
{
// on veut adresser la variable d'indice 2
lua_pushnumber(state,2);
// maintnenant on a dans la pile l'indice à la place 1 et le tableau
// à la place 2 (car on a empilé l'indice par dessus)
// on demande à Lua de remplacer le haut de la pile (donc notre indice)
// par la contenu de la case du tableau en lui donnant l'adresse du tableau
lua_gettable(state,-2);
// on verifie la donnée recuperée
if (lua_isstring(state,-1))
{
printf("valeur recuperé à l'indice 2 : %s\n",lua_tostring(state,-1));
// on depile les deux elements (la valeure de la case et le nom
// du tableau)
lua_pop(state,2);
}
}
// appel d'une fonction lua depuis le code C++
// on empile le nom de la fonction qu'on souhaite lancer
lua_getglobal(state,"luaPrint");
// on verifie si la fonction existe bien
if (!lua_isfunction(state,-1))
{
// la fonction n'existe pas
fprintf(stderr,"la fonction luaPrint n'existe pas\n");
lua_pop(state,1);
}
else
{
// la fonction existe, on lui passe une chaine de caractere comme
// premier argument
lua_pushstring(state,"le message passé en parametre\n");
// on appel la fonction qui a 1 argument et 0 retour
lua_call(state,1,0);
}
// on empile le nom de la fonction qu'on souhaite lancer
lua_getglobal(state,"addition");
// on verifie si la fonction existe bien
if (!lua_isfunction(state,-1))
{
// la fonction n'existe pas
fprintf(stderr,"la fonction addition n'existe pas\n");
lua_pop(state,1);
}
else
{
// la fonction existe, on lui passe une chaine de caractere comme
// premier argument
lua_pushnumber(state,10);
lua_pushnumber(state,20);
// on appel la fonction qui a 2 argument et 1 retour
lua_call(state,2,1);
// on recupere la valeur de retour
float retour = (float)lua_tonumber(state,-1);
printf("valeur de retour : %f\n",retour);
}
return 0;
}
|
c1d865fb2ce9491256ab93fba218445de5b8fc6f
|
9af092bcc5b061841c10b2b6ee0a29d9ab06b0ed
|
/mgr.h
|
45d82cf9bd300ffe3e663f64af0333697121f3b3
|
[] |
no_license
|
angeltears/minloadblance
|
5c2e074a071e456bf27641c8683a3becdd749f8b
|
9f115b3e792f9dfd6efbde331068a5ff8e6c1002
|
refs/heads/master
| 2020-03-19T13:30:12.556700
| 2018-07-30T05:27:14
| 2018-07-30T05:27:14
| 136,582,355
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 9,912
|
h
|
mgr.h
|
//
// Created by solitude on 18-6-8.
//
#ifndef MINLOADBLANCE_MGR_HPP
#define MINLOADBLANCE_MGR_HPP
#include <map>
#include "conn.h"
using std::map;
using std::pair;
const unsigned int hostname_size = 1024;
class host
{
public:
char m_hostname[1024];
int m_port;
int m_connect;
};
class mgr
{
public:
mgr(int epollfd, const host& srv);
~mgr() = default;
int conn2srv(const sockaddr_in & address);
conn* pick_conn(int cltfd);
void free_conn(conn* connection);
int get_used_conn_cnt();
void recycle_conns();
RET_CODE process(int fd, OP_TYPE type);
private:
/// epollfd 共用
static int m_epollfd;
/// 被代理的服务器地址和监听套接字的pair
map<int, conn*> m_conns;
map<int, conn*> m_used;
map<int, conn*> m_freed;
/// 每一个mgr 对应一个host信息
host m_logic_srv;
};
int mgr::m_epollfd= -1;
int mgr::conn2srv(const sockaddr_in &address)
{
int sockfd = socket(PF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
{
return -1;
}
if (connect(sockfd, (struct sockaddr *)&address, sizeof(address)) != 0)
{
close(sockfd);
return -1;
}
return sockfd;
}
/// 创建epollfd, srv即xml文件中的三个配置信息
mgr::mgr( int epollfd, const host& srv ) : m_logic_srv(srv)
{
m_epollfd = epollfd;
int ret = 0;
struct sockaddr_in address;
bzero(&address, sizeof(address));
address.sin_family = AF_INET;
inet_pton(AF_INET, srv.m_hostname, &address.sin_addr);
address.sin_port = htons(srv.m_port);
log(LOG_INFO, __FILE__, __LINE__, "logcial srv host info: (%s, %d)", srv.m_hostname, srv.m_port);
for (int i = 0; i < srv.m_connect; ++i)
{
sleep(1);
int sockfd = conn2srv(address); /// 创建一个socket 并链接到被代理的端口上 协议是inet4
if (sockfd < 0)
{
log(LOG_ERR, __FILE__, __LINE__, "build connection %d failed", i);
}
else
{
log(LOG_INFO, __FILE__, __LINE__, "build connection %d sucessed", i);
conn* tmp = NULL;
try
{
tmp = new conn;
}
catch(...)
{
close(sockfd);
continue;
}
tmp->init_srv(sockfd, address);
m_conns.insert(pair<int, conn*>(sockfd, tmp));
}
}
}
int mgr::get_used_conn_cnt()
{
return m_used.size();
}
conn* mgr::pick_conn(int cltfd)
{
if (m_conns.empty()) /// 判断是否有链接
{
log( LOG_ERR, __FILE__, __LINE__, "%s", "not enough srv connections to server" );
return NULL;
}
auto iter = m_conns.begin();
int srvfd = iter->first;
conn* tmp = iter->second;
if (!tmp)
{
log( LOG_ERR, __FILE__, __LINE__, "%s", "empty server connection object" );
return NULL;
}
/// 有链接的话就从m_conns中移除,加入到m_used中
m_conns.erase(iter);
m_used.insert(pair<int, conn*>(cltfd, tmp)); /// clt即客户端
m_used.insert(pair<int, conn*>(srvfd, tmp)); /// srv即服务端
/// 同时检测两个链接的fd
add_read_fd(m_epollfd, cltfd);
add_read_fd(m_epollfd, srvfd);
log(LOG_INFO,__FILE__, __LINE__, "bind client sock %d with server sock %d", cltfd, srvfd);
/// 将被代理服务器信息返回
return tmp;
}
void mgr::free_conn(conn *connection)
{
int cltfd = connection->m_cltfd;
int srvfd = connection->m_srvfd;
closefd(m_epollfd, cltfd);
closefd(m_epollfd, srvfd);
m_used.erase(cltfd);
m_used.erase(srvfd);
connection->reset();
/// 将释放掉的加入到freed中
m_freed.insert(pair<int, conn*>(srvfd, connection));
}
void mgr::recycle_conns()
{
/// 判断有没有空闲的链接
if (m_freed.empty())
{
return;
}
for (auto iter = m_freed.begin(); iter != m_freed.end(); iter++)
{
sleep(1);
int srvfd = iter->first;
conn* tmp = iter->second;
srvfd = conn2srv(tmp->m_srv_address); /// 如果有就重新建立链接
if (srvfd < 0)
{
log(LOG_ERR, __FILE__, __LINE__, "%s", "fix connection failed");
}
else
{
log(LOG_INFO, __FILE__, __LINE__, "%s", "fix connection success");
tmp->init_srv(srvfd, tmp->m_srv_address);
m_conns.insert(pair<int, conn*>(srvfd, tmp));
}
}
m_freed.clear(); /// 建立完成后清除数组
}
RET_CODE mgr::process(int fd, OP_TYPE type)
{
conn* connection = m_used[fd];
if (!connection)
{
return RET_CODE::NOTHING;
}
if (connection->m_cltfd == fd) /// 表明是客户端的链接
{
int srvfd = connection->m_srvfd;
switch (type)
{
case OP_TYPE::READ:
{
RET_CODE res = connection->read_clt();
switch(res)
{
case RET_CODE::OK:
{
log(LOG_DEBUG,__FILE__, __LINE__, "content read from clients : %s", connection->m_clt_buf);
}
case RET_CODE::BUFFER_FULL:
{
/// 如果从clt读取的buf满了 就将srvfd设置为out
modfd(m_epollfd, srvfd, EPOLLOUT);
break;
}
case RET_CODE::IOERR:
{}
case RET_CODE::CLOSED:
{
/// 如果链接断开 就释放掉两个conn
free_conn(connection);
return RET_CODE::CLOSED;
}
default:
break;
}
if (connection->m_srv_closed)
{
free_conn(connection);
return RET_CODE::CLOSED;
}
break;
}
case OP_TYPE::WAITE:
{
RET_CODE res = connection->write_clt();
switch (res)
{
case RET_CODE::TRY_AGAIN:
{
modfd(m_epollfd, fd, EPOLLOUT);
break;
}
case RET_CODE::BUFFER_EMPTY:
{
/// 如果要写入客户端的buff为空,则将其设为可读
modfd(m_epollfd, srvfd, EPOLLIN);
modfd(m_epollfd, fd, EPOLLIN);
break;
}
case RET_CODE::IOERR:
{
}
case RET_CODE::CLOSED:
{
free_conn(connection);
return RET_CODE::CLOSED;
}
default:
break;
}
if( connection->m_srv_closed )
{
free_conn( connection );
return RET_CODE::CLOSED;
}
break;
}
default:
{
log(LOG_ERR,__FILE__, __LINE__, "%s", "other operation not support yet");
break;
}
}
}
else if (connection->m_srvfd == fd)
{
int cltfd = connection->m_cltfd;
switch (type)
{
case OP_TYPE::READ:
{
RET_CODE res = connection->read_srv();
switch (res)
{
case RET_CODE::OK:
{
log(LOG_DEBUG, __FILE__, __LINE__, "content read from server: %s", connection->m_srv_buf);
}
case RET_CODE::BUFFER_FULL:
{
modfd(m_epollfd, cltfd, EPOLLOUT);
break;
}
case RET_CODE::IOERR:
case RET_CODE::CLOSED:
{
/// 如果服务端读满完了,就应该想客户端写
modfd(m_epollfd, cltfd, EPOLLOUT);
connection->m_srv_closed = true;
break;
}
default:
break;
}
break;
}
case OP_TYPE::WAITE:
{
RET_CODE res = connection->write_srv();
switch (res)
{
case RET_CODE::TRY_AGAIN:
{
modfd(m_epollfd, fd, EPOLLOUT);
break;
}
case RET_CODE::BUFFER_EMPTY:
{
modfd(m_epollfd, cltfd, EPOLLIN);
modfd(m_epollfd, fd, EPOLLIN);
break;
}
case RET_CODE::IOERR:
{
}
case RET_CODE::CLOSED: /// 发生了错误,写入客户端失败
{
modfd( m_epollfd, cltfd, EPOLLOUT );
connection->m_srv_closed = true;
break;
}
default:
break;
}
break;
}
default:
{
log( LOG_ERR, __FILE__, __LINE__, "%s", "other operation not support yet" );
break;
}
}
}
else
{
return RET_CODE::NOTHING;
}
return RET_CODE::OK;
}
#endif //MINLOADBLANCE_MGR_HPP
|
1b61007528a09704a8d84022142448053ce92610
|
d6b4bdf418ae6ab89b721a79f198de812311c783
|
/apigateway/include/tencentcloud/apigateway/v20180808/model/BindApiAppRequest.h
|
47eb00fc963ab0c604ea6ac3a9cc4908b913609c
|
[
"Apache-2.0"
] |
permissive
|
TencentCloud/tencentcloud-sdk-cpp-intl-en
|
d0781d461e84eb81775c2145bacae13084561c15
|
d403a6b1cf3456322bbdfb462b63e77b1e71f3dc
|
refs/heads/master
| 2023-08-21T12:29:54.125071
| 2023-08-21T01:12:39
| 2023-08-21T01:12:39
| 277,769,407
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,462
|
h
|
BindApiAppRequest.h
|
/*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TENCENTCLOUD_APIGATEWAY_V20180808_MODEL_BINDAPIAPPREQUEST_H_
#define TENCENTCLOUD_APIGATEWAY_V20180808_MODEL_BINDAPIAPPREQUEST_H_
#include <string>
#include <vector>
#include <map>
#include <tencentcloud/core/AbstractModel.h>
namespace TencentCloud
{
namespace Apigateway
{
namespace V20180808
{
namespace Model
{
/**
* BindApiApp request structure.
*/
class BindApiAppRequest : public AbstractModel
{
public:
BindApiAppRequest();
~BindApiAppRequest() = default;
std::string ToJsonString() const;
/**
* 获取Unique ID of the application to be bound.
* @return ApiAppId Unique ID of the application to be bound.
*
*/
std::string GetApiAppId() const;
/**
* 设置Unique ID of the application to be bound.
* @param _apiAppId Unique ID of the application to be bound.
*
*/
void SetApiAppId(const std::string& _apiAppId);
/**
* 判断参数 ApiAppId 是否已赋值
* @return ApiAppId 是否已赋值
*
*/
bool ApiAppIdHasBeenSet() const;
/**
* 获取Environment to be bound.
* @return Environment Environment to be bound.
*
*/
std::string GetEnvironment() const;
/**
* 设置Environment to be bound.
* @param _environment Environment to be bound.
*
*/
void SetEnvironment(const std::string& _environment);
/**
* 判断参数 Environment 是否已赋值
* @return Environment 是否已赋值
*
*/
bool EnvironmentHasBeenSet() const;
/**
* 获取Unique ID of the service to be bound.
* @return ServiceId Unique ID of the service to be bound.
*
*/
std::string GetServiceId() const;
/**
* 设置Unique ID of the service to be bound.
* @param _serviceId Unique ID of the service to be bound.
*
*/
void SetServiceId(const std::string& _serviceId);
/**
* 判断参数 ServiceId 是否已赋值
* @return ServiceId 是否已赋值
*
*/
bool ServiceIdHasBeenSet() const;
/**
* 获取Unique ID of the API to be bound.
* @return ApiId Unique ID of the API to be bound.
*
*/
std::string GetApiId() const;
/**
* 设置Unique ID of the API to be bound.
* @param _apiId Unique ID of the API to be bound.
*
*/
void SetApiId(const std::string& _apiId);
/**
* 判断参数 ApiId 是否已赋值
* @return ApiId 是否已赋值
*
*/
bool ApiIdHasBeenSet() const;
private:
/**
* Unique ID of the application to be bound.
*/
std::string m_apiAppId;
bool m_apiAppIdHasBeenSet;
/**
* Environment to be bound.
*/
std::string m_environment;
bool m_environmentHasBeenSet;
/**
* Unique ID of the service to be bound.
*/
std::string m_serviceId;
bool m_serviceIdHasBeenSet;
/**
* Unique ID of the API to be bound.
*/
std::string m_apiId;
bool m_apiIdHasBeenSet;
};
}
}
}
}
#endif // !TENCENTCLOUD_APIGATEWAY_V20180808_MODEL_BINDAPIAPPREQUEST_H_
|
ba57be35c964ec6cb48f409ada81492f35e5fc6b
|
0eff74b05b60098333ad66cf801bdd93becc9ea4
|
/second/download/git/gumtree/git_repos_function_1721_git-2.7.6.cpp
|
e1339f188514d23e0402459333fabbfa2224e9c5
|
[] |
no_license
|
niuxu18/logTracker-old
|
97543445ea7e414ed40bdc681239365d33418975
|
f2b060f13a0295387fe02187543db124916eb446
|
refs/heads/master
| 2021-09-13T21:39:37.686481
| 2017-12-11T03:36:34
| 2017-12-11T03:36:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 152
|
cpp
|
git_repos_function_1721_git-2.7.6.cpp
|
int unsorted_string_list_has_string(struct string_list *list,
const char *string)
{
return unsorted_string_list_lookup(list, string) != NULL;
}
|
35c7cbe1e689aaa0a6c35040ff90cc6d75f118c1
|
1f93e0e27bc369e79cc44e9adcc2d321eb19e8f5
|
/samples/calculator/calculator.cpp
|
73c466af3d1832eacd32b7fede6ca4392487b7f2
|
[
"MIT"
] |
permissive
|
king-mampreh/apply
|
60790b6437fc966a0ad524e682c1584958a8ff59
|
9b3eb14af0b2b5cddb12ea5f4986631213a2fc80
|
refs/heads/master
| 2020-05-19T20:24:12.382382
| 2019-05-17T21:01:04
| 2019-05-17T21:01:04
| 185,201,076
| 3
| 0
|
MIT
| 2019-05-17T21:01:05
| 2019-05-06T13:21:28
|
C++
|
UTF-8
|
C++
| false
| false
| 1,611
|
cpp
|
calculator.cpp
|
// Copyright (c) King Mampreh. All rights reserved.
// Licensed under the MIT License.
#include <xt/apply.h>
#include <iostream>
#include <map>
template <typename F, typename G>
auto operator | (F&& f, G&& g) {
return [=] (auto... args) {
return f(args...) || g(args...);
};
}
const auto pred = std::not_fn(::isascii) | ::iscntrl | ::isblank;
const auto filter = [](auto s) {
return (s.erase(std::remove_if(s.begin(), s.end(), pred), s.end()), std::move(s));
};
const auto to_string = [](const std::any& any) {
return filter(std::any_cast<std::string>(any));
};
template <> int
xt::convert<int>::operator()(const std::any& any) { return std::stoi(to_string(any)); }
template <> std::string
xt::convert<std::string>::operator()(const std::string& s) { return filter(s); }
std::map<std::string, std::function<int(int, int)> > dispatch_tbl = {
{"+", std::plus<>() },
{"-", std::minus<>() },
{"*", std::multiplies<>() },
{"/", std::divides<>() },
{"%", std::modulus<>() },
{"&", std::bit_and<>() },
{"|", std::bit_or<>() },
{"^", std::bit_xor<>() },
{"fst", [](int a,int) { return a; }},
{"snd", [](int,int a) { return a; }}
};
int main() {
while(true) {
std::cout << "> ";
try {
xt::apply_i([=](std::string op, int a, int b) {
std::cout << "Result: " << dispatch_tbl.at(op)(a, b) << std::endl;
}, std::istream_iterator<std::string>(std::cin));
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
}
};
return 0;
}
|
4a55798912e7e8f0ef2604a8e8de7337bf68e289
|
65a03ca4c6532445ca9de827669c876383b3b821
|
/ISMK.77257.Lectures/meters-sensors/W06T02.I2C.2x16-LCD.Printing/W06T02.I2C.2x16-LCD.Printing.ino
|
82fae17ae09a8f2521d0884d936dbae28c8d8771
|
[
"MIT"
] |
permissive
|
coshkun/Arduino
|
518c5a7c9d31d38011b6ac26fdb0e863b17eac07
|
6954fac75dfb634ec6eb7fa01af9231cb1a9bdc1
|
refs/heads/master
| 2020-04-04T22:50:22.885908
| 2017-07-29T17:31:04
| 2017-07-29T17:31:04
| 82,003,951
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 839
|
ino
|
W06T02.I2C.2x16-LCD.Printing.ino
|
// #include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
String mesaj = "iyi gunler!";
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
lcd.backlight();
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print(mesaj.length());
lcd.home();
for(int i = 15; i>0; i--){
lcd.setCursor(i,0);
lcd.print(mesaj);
delay(100);
lcd.clear();
}
lcd.clear();
delay(500);
lcd.print(mesaj);
delay(500);
for(int i = 0; i<=16; i++){
lcd.setCursor(i,0);
lcd.print(mesaj);
delay(100);
lcd.clear();
}
//lcd.setCursor(10,1);
}
|
d16cda8cd674e13ce1b9731056fb2d22eda17a78
|
75ee79b8abdd9512f6357a814e1cde5b537012f7
|
/ClientTests/InputTest.cpp
|
806c16a52e879826bfb6afe1bf17b88243ec85cf
|
[] |
no_license
|
BlindAnguis/Shooterman
|
418aa8624719bd0ffa99cfdf29439b0303fb7cc0
|
166cab7df5a05fd4b506c6acf3f9748bcb4d0996
|
refs/heads/master
| 2020-04-21T17:35:51.915001
| 2020-01-31T15:42:53
| 2020-01-31T15:42:53
| 169,740,884
| 3
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 956
|
cpp
|
InputTest.cpp
|
#include "InputTest.h"
#include "../Shooterman/Common/Messages/MouseMessage.cpp"
#include "../Shooterman/Common/Messages/InputMessage.cpp"
InputTest::InputTest() {}
InputTest::~InputTest() {}
void InputTest::SetUp() {
mMessageHandlerMock = std::make_shared<MessageHandlerMock>();
mKeyboardMock = std::make_shared<KeyboardMock>();
mInput = std::make_shared<Input>(mMessageHandlerMock, mKeyboardMock);
mInput->start();
}
void InputTest::TearDown() {
mInput->stop();
mInput = nullptr;
mMessageHandlerMock = nullptr;
mKeyboardMock = nullptr;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Verify that the network handler subscribes/unsubscribes to all interfaces and
// publishes/unpublishes all interfaces
///////////////////////////////////////////////////////////////////////////////////////////////////
TEST_F(InputTest, verifyBasicStartupAndShutdown) {
mInput->run();
}
|
9bffa6e0d8177d490b4c06c80e05f6053c142b29
|
773f615ca7f3111f33c9ee34c23359df0f7dd3e0
|
/UnitTesting/UtilsTest.cpp
|
578861117cbaef39db38e1c258d90a1c9141145b
|
[] |
no_license
|
keloysiusmak/cs3201-group6-spa
|
9b97df28accf5187b61b110ac4c4bb5545dda02a
|
6cb4f849c9c59edb82661d51bc579b0df3338732
|
refs/heads/master
| 2021-09-12T08:20:51.849978
| 2018-04-15T15:37:32
| 2018-04-15T15:37:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,877
|
cpp
|
UtilsTest.cpp
|
#include "stdafx.h"
#include "CppUnitTest.h"
#include "../SPA/PKB.h"
#include "../SPA/PatternObject.h"
#include "../SPA/Parser.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace std;
namespace UtilsTest
{
TEST_CLASS(UtilsTest)
{
public:
TEST_METHOD(UtilsSanitise) {
string testString = "This \
is \
a sanitise test \
case";
string result = Utils::sanitise(testString);
string match = "This is a sanitise test case";
Assert::AreEqual(match, result);
}
TEST_METHOD(UtilsExplode) {
string testString = "procedure Test { a = b; c = d+2; }";
string sanitised = Utils::sanitise(testString);
vector<string> tokens = Utils::explode(sanitised, ParserConstants::DELIM_STRING, ParserConstants::DELIMITERS);
Assert::AreEqual(tokens[0], string("procedure"));
Assert::AreEqual(tokens[1], string("Test"));
Assert::AreEqual(tokens[2], string("{"));
Assert::AreEqual(tokens[3], string("a"));
Assert::AreEqual(tokens[4], string("="));
Assert::AreEqual(tokens[5], string("b"));
Assert::AreEqual(tokens[6], string(";"));
Assert::AreEqual(tokens[7], string("c"));
Assert::AreEqual(tokens[8], string("="));
Assert::AreEqual(tokens[9], string("d"));
Assert::AreEqual(tokens[10], string("+"));
Assert::AreEqual(tokens[11], string("2"));
Assert::AreEqual(tokens[12], string(";"));
Assert::AreEqual(tokens[13], string("}"));
}
TEST_METHOD(UtilsInValidName) {
Assert::AreEqual(true, Utils::isValidName("procedure"));
Assert::AreEqual(true, Utils::isValidName("aY789"));
Assert::AreEqual(true, Utils::isValidName("a987688999"));
Assert::AreEqual(true, Utils::isValidName("A0987"));
Assert::AreEqual(false, Utils::isValidName("123"));
Assert::AreEqual(false, Utils::isValidName("/888"));
Assert::AreEqual(false, Utils::isValidName("a??"));
Assert::AreEqual(false, Utils::isValidName("Mo++"));
}
TEST_METHOD(UtilsTrim) {
Assert::AreEqual(string("11"), Utils::trim(string(" 11 ")));
Assert::AreEqual(string("1a b"), Utils::trim(string(" 1a b ")));
Assert::AreEqual(string("b%b"), Utils::trim(string(" b%b ")));
}
TEST_METHOD(UtilsGetWordAndPop) {
std::deque<string> deq{ "a", "+", "b", "-", "c" };
std::queue<string> expression(deq);
Assert::AreEqual(string("a"), Utils::getWordAndPop(expression));
Assert::AreEqual(string("+"), Utils::getWordAndPop(expression));
Assert::AreEqual(string("b"), Utils::getWordAndPop(expression));
Assert::AreEqual(string("-"), Utils::getWordAndPop(expression));
Assert::AreEqual(string("c"), Utils::getWordAndPop(expression));
}
TEST_METHOD(UtilsIsValidIntger) {
Assert::AreEqual(true, Utils::isInteger(string("11")));
Assert::AreEqual(true, Utils::isInteger(string("112")));
Assert::AreEqual(true, Utils::isInteger(string("121")));
Assert::AreEqual(false, Utils::isInteger(string("1a1")));
Assert::AreEqual(false, Utils::isInteger(string("1+1")));
}
TEST_METHOD(UtilsIsValidFactor) {
Assert::AreEqual(true, Utils::isValidFactor(string("aa")));
Assert::AreEqual(true, Utils::isValidFactor(string("11")));
Assert::AreEqual(false, Utils::isValidFactor(string("1a1")));
Assert::AreEqual(false, Utils::isValidFactor(string("a-b")));
}
TEST_METHOD(UtilsIsValidOperator) {
Assert::AreEqual(true, Utils::isValidOperator(string("+")));
Assert::AreEqual(true, Utils::isValidOperator(string("-")));
Assert::AreEqual(true, Utils::isValidOperator(string("*")));
Assert::AreEqual(false, Utils::isValidOperator(string("/")));
Assert::AreEqual(false, Utils::isValidOperator(string("^")));
Assert::AreEqual(false, Utils::isValidOperator(string("$$$")));
}
TEST_METHOD(UtilsIsValidConstant) {
Assert::AreEqual(true, Utils::isValidConstant(string("12")));
Assert::AreEqual(true, Utils::isValidConstant(string("12999")));
Assert::AreEqual(true, Utils::isValidConstant(string("0")));
Assert::AreEqual(false, Utils::isValidConstant(string("-2")));
Assert::AreEqual(false, Utils::isValidConstant(string("a1")));
Assert::AreEqual(false, Utils::isValidConstant(string("**")));
}
TEST_METHOD(UtilsIsOpenBracket) {
Assert::AreEqual(true, Utils::isOpenBracket(string("(")));
Assert::AreEqual(false, Utils::isOpenBracket(string("( ")));
Assert::AreEqual(false, Utils::isOpenBracket(string(")")));
Assert::AreEqual(false, Utils::isOpenBracket(string("{")));
Assert::AreEqual(false, Utils::isOpenBracket(string("<")));
}
TEST_METHOD(UtilsIsCloseBracket) {
Assert::AreEqual(true, Utils::isCloseBracket(string(")")));
Assert::AreEqual(false, Utils::isCloseBracket(string(") ")));
Assert::AreEqual(false, Utils::isCloseBracket(string("(")));
Assert::AreEqual(false, Utils::isCloseBracket(string("}")));
Assert::AreEqual(false, Utils::isCloseBracket(string(">")));
}
};
}
|
10d39b57b80da6802b4d83527c15800517a8004e
|
a00aee39f3ea46b370177fcc6b7bc703d153bbd0
|
/Tracers/SingleSphere.h
|
7afd394d696fb763f22afd5039ce6069b477afbd
|
[] |
no_license
|
Crystal521/RayTracer
|
9253c605a85f9adad5ee28ab9dbddf8d1ecbf005
|
34b455dc30346fb80b6c734b5dc67903ee9e06d6
|
refs/heads/master
| 2020-06-20T02:06:00.382323
| 2016-05-08T02:45:09
| 2016-05-08T02:45:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 296
|
h
|
SingleSphere.h
|
#ifndef _SINGLESPHERE_H_
#define _SINGLESPHERE_H_
#include "Tracer.h"
class SingleSphere:public Tracer
{
public:
SingleSphere();
SingleSphere(World* pWorld);
virtual ~SingleSphere();
virtual RGBColor TraceRay(const Ray& ray) const;
protected:
private:
};
#endif // !_SINGLESPHERE_H_
|
7e467ff1b81ec0f0971da28b46e7f00d33bf6aa6
|
f6a8c46fed9988802e1d58bce865964c2efd63f7
|
/cpp_05/ex03/Intern.cpp
|
6e10ba754cb41aa6360efd6a8d26ef96ed027e3e
|
[] |
no_license
|
aquinoa-nba/Cpp_modules
|
adedf7e955f56e01d3bde5643e3cb0512deee7a8
|
dd36891f15b4d7a91dbeef5b850eea4f8257307b
|
refs/heads/master
| 2023-08-19T02:27:54.814411
| 2021-10-08T16:02:55
| 2021-10-08T16:02:55
| 372,608,645
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,035
|
cpp
|
Intern.cpp
|
#include "Intern.hpp"
Intern::FormsGenerator::FormsGenerator(std::string const &formName, Form *(func)(std::string const &))
: _formName(formName), _func(func) {}
Intern::FormsGenerator::FormsGenerator(FormsGenerator const &other) { *this = other; }
bool Intern::FormsGenerator::checkName(std::string const &formName) { return _formName == formName; }
Form* Intern::FormsGenerator::makeFunc(std::string const &target) { return _func(target); }
Intern::FormsGenerator& Intern::FormsGenerator::operator = (FormsGenerator const &other)
{
_formName = other._formName;
_func = other._func;
return *this;
}
Intern::Intern()
{
this->_formArr[0] = new FormsGenerator("shrubbery creation", ShrubberyCreationForm::createForm);
this->_formArr[1] = new FormsGenerator("Shrubbery creation", ShrubberyCreationForm::createForm);
this->_formArr[2] = new FormsGenerator("Shrubbery Creation", ShrubberyCreationForm::createForm);
this->_formArr[3] = new FormsGenerator("robotomy request", RobotomyRequestForm::createForm);
this->_formArr[4] = new FormsGenerator("Robotomy request", RobotomyRequestForm::createForm);
this->_formArr[5] = new FormsGenerator("Robotomy Request", RobotomyRequestForm::createForm);
this->_formArr[6] = new FormsGenerator("presidential pardon", PresidentialPardonForm::createForm);
this->_formArr[7] = new FormsGenerator("Presidential pardon", PresidentialPardonForm::createForm);
this->_formArr[8] = new FormsGenerator("Presidential Pardon", PresidentialPardonForm::createForm);
}
Intern::Intern(Intern const &other) { (void)other;}
Intern::~Intern()
{
for (int i = 0; i < 9; i++)
delete _formArr[i];
}
Form* Intern::makeForm(std::string const &formName, std::string const &target)
{
for(int i = 0; i < 9; i++)
{
if (_formArr[i]->checkName(formName) == true)
{
std::cout << B_GREEN"Intern"NO_COLOR" creates " << formName << std::endl;
return _formArr[i]->makeFunc(target);
}
}
throw WrongFormName();
}
Intern& Intern::operator = (Intern const &other)
{
(void)other;
return *this;
}
|
e516d3d7506f4b36a08fabbe2e3b91489b99d80c
|
44c0913601ce2bb10674682b77fc47dc5b0a7601
|
/Chapter_7/Lectures/Recursion/Reverse_String/Iterative_Version/reverse_string_iterative.cpp
|
8a55dcdf31bbb576b6f4bd7070904dcf57f8dde5
|
[] |
no_license
|
justin-nguyen-1996/Learn_CPP
|
ca11ff151be47ce25976ed73e6e19e6a0f4966c5
|
05f9a95943914ac37adba6e20d3dd9d037d89d6c
|
refs/heads/master
| 2020-04-12T06:22:05.834288
| 2017-05-18T02:52:08
| 2017-05-18T02:52:08
| 59,640,823
| 2
| 1
| null | 2016-06-05T19:11:57
| 2016-05-25T07:29:43
|
C++
|
UTF-8
|
C++
| false
| false
| 588
|
cpp
|
reverse_string_iterative.cpp
|
/*
Author: Justin Nguyen
Created: 7/7/2016
*/
#include <iostream>
#include <string>
#include <vector>
void swap(char &a, char &b) {
char temp = a;
a = b;
b = temp;
}
void reverseString(std::string &str) {
int length = str.length();
for(int i = 0; i < length / 2; i += 1) {
swap(str[i], str[length - 1 - i]);
}
}
int main() {
std::vector<std::string> str_vec
{ "abcd", "abc", "12bd8jgue", "ababa", "abab", "a", "aaa", "aabb" };
for (std::string str : str_vec) {
std::cout << "reverseString(" << str << "):\t\t";
reverseString(str);
std::cout << str << "\n";
}
}
|
5362963ecfa113e08f25f3c771aad61be68dfe7e
|
2d42a50f7f3b4a864ee19a42ea88a79be4320069
|
/source/system/input/keymap.cpp
|
7421f90e83d2887b4630062d5a5faa254add53c3
|
[] |
no_license
|
Mikalai/punk_project_a
|
8a4f55e49e2ad478fdeefa68293012af4b64f5d4
|
8829eb077f84d4fd7b476fd951c93377a3073e48
|
refs/heads/master
| 2016-09-06T05:58:53.039941
| 2015-01-24T11:56:49
| 2015-01-24T11:56:49
| 14,536,431
| 1
| 0
| null | 2014-06-26T06:40:50
| 2013-11-19T20:03:46
|
C
|
UTF-8
|
C++
| false
| false
| 1,527
|
cpp
|
keymap.cpp
|
#include "system/errors/module.h"
#include "system/events/key_event.h"
#include "keymap.h"
PUNK_ENGINE_BEGIN
namespace System
{
struct KeyMapImpl
{
~KeyMapImpl()
{}
KeyboardActionsCollection m_actions;
};
void KeyMap::Add(Key key, KeyboardAction action)
{
impl->m_actions[key].insert(action);
}
void KeyMap::Remove(Key key, KeyboardAction action)
{
auto key_it = impl->m_actions.find(key);
if (key_it == impl->m_actions.end())
return;
auto action_it = key_it->second.find(action);
if (key_it->second.end() == action_it)
return;
key_it->second.erase(action_it);
}
std::set<KeyboardAction>& KeyMap::GetActions(Key key)
{
return impl->m_actions[key];
}
const std::set<KeyboardAction>& KeyMap::GetActions(Key key) const
{
auto it = impl->m_actions.find(key);
if (it == impl->m_actions.end())
throw Error::SystemException("Key was not found");
return it->second;
}
void KeyMap::OnKeyEvent(const KeyEvent &event) {
for (auto action : impl->m_actions[event.key]) {
(*(*action))(event);
}
}
KeyMap::KeyMap()
: impl(new KeyMapImpl)
{
}
KeyMap::~KeyMap()
{
delete impl;
impl = nullptr;
}
void KeyMap::QueryInterface(const Core::Guid& type, void** object) {
Core::QueryInterface(this, type, object, { Core::IID_IObject, IID_IKeyMap });
}
std::uint32_t KeyMap::AddRef() {
return m_ref_count.fetch_add(1);
}
std::uint32_t KeyMap::Release() {
auto v = m_ref_count.fetch_sub(1) - 1;
if (!v) {
delete this;
}
return v;
}
}
PUNK_ENGINE_END
|
0e34579423aafdc2aa3c889356730c17dccaf95a
|
0301361c8677d9d24703a8ad73eb8c8c90f09736
|
/src/engine/version.h
|
41d3e69a408bf1ef76b908d2b99bccf2105cff2a
|
[
"MIT"
] |
permissive
|
dj2/Elysian
|
a2b57593f5a6c57d9f9547336e6fb47c0ee7184f
|
02d35946774ec144edee848eddb85efa01b86d33
|
refs/heads/main
| 2023-07-18T01:40:28.450710
| 2021-08-28T02:54:08
| 2021-08-28T02:54:08
| 397,942,528
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 950
|
h
|
version.h
|
#pragma once
#include <cstdint>
namespace el::engine {
// Shift values for creating a Vulkan Version.
constexpr auto kVkVariantShift = 29;
constexpr auto kVkMajorShift = 22;
constexpr auto kVkMinorShift = 12;
class VersionInfo {
public:
VersionInfo() = default;
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
VersionInfo(uint32_t variant, uint32_t major, uint32_t minor, uint32_t patch)
: variant_(variant), major_(major), minor_(minor), patch_(patch) {}
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
VersionInfo(uint32_t major, uint32_t minor, uint32_t patch)
: VersionInfo(0, major, minor, patch) {}
[[nodiscard]] auto to_vk() const -> uint32_t {
return variant_ << kVkVariantShift | major_ << kVkMajorShift |
minor_ << kVkMinorShift | patch_;
}
private:
uint32_t variant_ = 0;
uint32_t major_ = 1;
uint32_t minor_ = 0;
uint32_t patch_ = 0;
};
} // namespace el::engine
|
e8b83af2d0f3be0115bdc38db5a5c5b50b85e95f
|
b775e61080e749f8441c8cadc030bc33ed5290f1
|
/daemon/monitor.cpp
|
edaff7607a5ef717252fcc2d11d1c87e5362090f
|
[] |
no_license
|
sunny-val/gps_server
|
f790ea8a42b2273f561df8ffad92643df08a0b65
|
b56f3dce0d65344095e9d4daf9a714fddb84e154
|
refs/heads/master
| 2020-04-11T10:46:00.733378
| 2018-11-27T05:20:39
| 2018-11-27T05:20:39
| 161,725,510
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,641
|
cpp
|
monitor.cpp
|
/*
* monitor.cpp
*
* Created on: 30.05.2016
* Author: sunny
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <execinfo.h>
#include <unistd.h>
#include <errno.h>
#include <wait.h>
#include "monitor.h"
#include "log.h"
#include "work.h"
//#define PID_FILE "/var/run/gps_server.pid"
#define PID_FILE "/home/sunny/gps_server.pid"
// Узнать pid запущенной службы
int getPid() {
FILE* f;
int pid = -1;
f = fopen(PID_FILE, "r");
if (f) {
fscanf(f, "%u", &pid);
fclose(f);
}
return pid;
}
void SetPidFile(const char* Filename) {
FILE* f;
f = fopen(Filename, "w+");
if (f) {
fprintf(f, "%u", getpid());
fclose(f);
} else
WriteLog("can't create pid file %s\n", Filename);
}
// Основная цель мониторинг — отслеживание состояния процесса демона. Нам будут важны только два момента:
// Уведомление о завершении процесса демона.
// Получение кода завершения демона.
// Весь мониторинг работы демона будет заключен в функцию MonitorProc.
// Весь смысл мониторинга заключается в том, чтобы запустить дочерний процесс и следить за ним,
// и в зависимости от кода его завершения, перезапускать его или завершать свою работу.
int MonitorProc(void) {
int pid;
int status;
int need_start = 1;
sigset_t sigset;
siginfo_t siginfo;
// настраиваем сигналы которые будем обрабатывать
sigemptyset(&sigset);
// сигнал остановки процесса пользователем
sigaddset(&sigset, SIGQUIT);
// сигнал для остановки процесса пользователем с терминала
sigaddset(&sigset, SIGINT);
// сигнал запроса завершения процесса
sigaddset(&sigset, SIGTERM);
// сигнал посылаемый при изменении статуса дочернего процесс
sigaddset(&sigset, SIGCHLD);
// сигнал посылаемый при изменении статуса дочернего процесс
sigaddset(&sigset, SIGCHLD);
// пользовательский сигнал который мы будем использовать для обновления конфига
sigaddset(&sigset, SIGUSR1);
sigprocmask(SIG_BLOCK, &sigset, NULL);
// данная функция создат файл с нашим PID'ом
SetPidFile(PID_FILE);
// бесконечный цикл работы
for (;;) {
// если необходимо создать потомка
if (need_start) {
// создаём потомка
pid = fork();
}
need_start = 1;
if (pid == -1) // если произошла ошибка
{
// запишем в лог сообщение об этом
WriteLog("[MONITOR] Fork failed (%s)\n", strerror(errno));
} else if (!pid) // если мы потомок
{
// данный код выполняется в потомке
// запустим функцию отвечающую за работу демона
status = WorkProc();
// завершим процесс
exit(status);
} else // если мы родитель
{
// данный код выполняется в родителе
// ожидаем поступление сигнала
sigwaitinfo(&sigset, &siginfo);
//printf("[MONITOR] get signal=%d\n",siginfo.si_signo);//xxx
// если пришел сигнал от потомка
if (siginfo.si_signo == SIGCHLD) {
// получаем статус завершение
wait(&status);
// преобразуем статус в нормальный вид
status = WEXITSTATUS(status);
// если потомок завершил работу с кодом говорящем о том, что нет нужны дальше работать
if (status == CHILD_NEED_TERMINATE) {
// запишем в лог сообщени об этом
WriteLog("[MONITOR] Childer stopped\n");
// прервем цикл
break;
} else if (status == CHILD_NEED_WORK) // если требуется перезапустить потомка
{
// запишем в лог данное событие
WriteLog("[MONITOR] Childer restart\n");
}
} else if (siginfo.si_signo == SIGUSR1) // если пришел сигнал что необходимо перезагрузить конфиг
{
kill(pid, SIGUSR1); // перешлем его потомку
need_start = 0; // установим флаг что нам не надо запускать потомка заново
} else // если пришел какой-либо другой ожидаемый сигнал
{
// запишем в лог информацию о пришедшем сигнале
WriteLog("[MONITOR] Signal %d(%s)\n", siginfo.si_signo,
strsignal(siginfo.si_signo));
printf("[MONITOR] Signal %d(%s)\n", siginfo.si_signo,
strsignal(siginfo.si_signo));
// убьем потомка
kill(pid, SIGTERM);
status = 0;
break;
}
}
}
// запишем в лог, что мы остановились
WriteLog("[MONITOR] Stopped\n");
// удалим файл с PID'ом
unlink(PID_FILE);
return status;
}
|
43228cabc328c24936790533ad1579f6446832e9
|
43d677cc0296e9d00d43d2c984d44492ad022aa0
|
/TestPlayerMain/TestPlayerMain.cpp
|
d43fd6794c03b9c8e034d33ed2abb4c573a60d0f
|
[] |
no_license
|
mustafadincer/TestPlayerMain
|
0fae5ac5eb90e257f09ed31a4b265be3f28312ed
|
484a21c212e2ac8b5d72c82bde3a476a5a9dd32c
|
refs/heads/master
| 2023-04-09T05:09:29.854552
| 2021-04-14T01:49:50
| 2021-04-14T01:49:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,367
|
cpp
|
TestPlayerMain.cpp
|
// TestPlayerMain.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
// Program tests out Player class by reading input from console, calling Player functions to store data
//
#include <iostream>
#include <string>
#include "player.h"
using namespace std;
#define MAX_NAME_SIZE 24 // maximum name size, no constraints on characters, truncate characters after name, remove CR/NL when storing
#define MAX_SYMBOL_SIZE 1 // maximum symbol size, no constraints on characters
#define NUM_PLAYERS 3 // # of player instances
int main()
{
string name; // temporary storage for reading player name from console
char symbol; // temporary storage for reading
string buffer;
player playerArray[NUM_PLAYERS];
std::cout << "Hello World!\n";
// create player instances
// populate players - loop through defined number of players
for (int loopcounter = 0; loopcounter < NUM_PLAYERS-1; loopcounter++) {
// read input, getline removes newline but allows all other characters as valid, up to max name size
// input with newline only are invalid, prompt again for player name
// ToDo: display error message
buffer = "";
while (buffer.length() == 0) {
cout << "Enter Player Name: ";
getline(cin, buffer, '\n');
if (buffer.length() > MAX_NAME_SIZE) {
buffer.erase(MAX_NAME_SIZE);
}
cout << "Player Name: " << buffer << "\n"; // will replace with call to create instance with player name
}
playerArray[loopcounter].set_player_name(buffer);
// same as above, except symbol is only a single character
// if more than one character entered, truncate to 1st character
buffer = "";
while (buffer.length() == 0) {
cout << "Enter Player symbol: ";
getline(cin, buffer, '\n');
if (buffer.length() > MAX_SYMBOL_SIZE) {
buffer.erase(MAX_SYMBOL_SIZE);
}
cout << "Player Symbol: " << buffer << "\n"; // will replace with call to create instance with player name
}
playerArray[loopcounter].set_player_symbol(buffer[0]);
} // end player information input from console & storage in player instances
// Retrieve information for all created players & print
cout << "*** Printing Player information ***\n";
for (int loopcounter = 0; loopcounter < NUM_PLAYERS; loopcounter++) {
cout << playerArray[loopcounter].get_player_name() << " \t" << playerArray[loopcounter].get_player_symbol() << "\n";
}
return 0;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
|
255396ac594d461a335f46a6c1e26a63bfcb81d7
|
c920079b644668fcea120937ec7bec392d2029bd
|
/B4---C++-Programming/cpp_bomberman/src/save/XmlSave.cpp
|
5e7bb374d3ba6cca9ee0b4ddc7858f69e32e9385
|
[] |
no_license
|
Ankirama/Epitech
|
d23fc8912d19ef657b925496ce0ffcc58dc51d3b
|
3690ab3ec0c8325edee1802b6b0ce6952e3ae182
|
refs/heads/master
| 2021-01-19T08:11:27.374033
| 2018-01-03T10:06:20
| 2018-01-03T10:06:20
| 105,794,978
| 0
| 5
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,027
|
cpp
|
XmlSave.cpp
|
#include "XmlSave.hh"
#include "GameState.hh"
XmlSave::XmlSave(std::string const &filename, int nbPlayers, int nbAIs): m_ofs(filename.c_str()),
m_xmlWrite(this->m_ofs) {
this->m_nbPlayers = nbPlayers;
this->m_nbAIs = nbAIs;
this->m_playersDone = false;
this->m_AIDone = false;
this->m_playersStarted = false;
this->m_AIsStarted = false;
this->m_idPlayer = 1;
this->m_idAI = 1;
this->m_xmlWrite << tag("save");
}
XmlSave::~XmlSave() {}
void XmlSave::saveGame() {
std::vector<ACharacter *> players = GameState::Instance()->getPlayers();
Maze &maze = GameState::Instance()->getMaze();
for (unsigned int i = 0; i < players.size(); ++i) {
if (players[i]->getType().compare("Player") == 0)
this->savePlayer(*(static_cast<Player *>(players[i])));
else
this->saveAI(*(static_cast<IA *>(players[i])));
}
this->saveMaze(maze.getMaze(), maze.getWidth(), maze.getHeight());
}
bool XmlSave::savePlayer(Player &bomber) {
if (this->m_playersDone)
return false;
if (!this->m_playersStarted) {
this->m_playersStarted = true;
this->m_xmlWrite
<< tag("players")
<< attribute("number") << this->m_nbPlayers;
}
this->m_xmlWrite
<< tag("player")
<< attribute("id") << this->m_idPlayer++
<< attribute("state") << bomber.getState()
<< tag("name")
<< data() << bomber.getName()
<< endtag()
<< tag("maxBombs")
<< data() << bomber.getMaxBombs()
<< endtag()
<< tag("position")
<< data() << bomber.getPosition()
<< endtag()
<< tag("direction")
<< data() << bomber.getDirection()
<< endtag()
<< tag("speed")
<< data() << bomber.getSpeed()
<< endtag()
<< tag("rangeBomb")
<< data() << bomber.getRangeBomb()
<< endtag();
this->writeTexture(bomber.getTexturePath());
this->m_xmlWrite
<< tag("score")
<< data() << bomber.getScore()
<< endtag();
this->writeKeys(bomber.getKeyLeft(), bomber.getKeyRight(), bomber.getKeyUp(),
bomber.getKeyDown(), bomber.getKeyBomb());
this->writeBombs(bomber.getBombs());
this->m_xmlWrite
<< endtag("player");
--this->m_nbPlayers;
if ((this->m_playersDone = this->m_nbPlayers == 0 ? true: false)) {
this->m_xmlWrite
<< endtag("players");
}
return true;
}
bool XmlSave::saveAI(IA &bomber) {
if (!this->m_playersDone || this->m_AIDone)
return false;
if (!this->m_AIsStarted) {
this->m_AIsStarted = true;
this->m_xmlWrite
<< tag("AIs")
<< attribute("number") << this->m_nbAIs;
}
this->m_xmlWrite
<< tag("AI")
<< attribute("id") << this->m_idAI++
<< attribute("state") << bomber.getState()
<< tag("difficulty")
<< data() << static_cast<int>(bomber.getDifficulty())
<< endtag()
<< tag("maxBombs")
<< data() << bomber.getMaxBombs()
<< endtag()
<< tag("position")
<< data() << bomber.getPosition()
<< endtag()
<< tag("direction")
<< data() << bomber.getDirection()
<< endtag()
<< tag("speed")
<< data() << bomber.getSpeed()
<< endtag()
<< tag("rangeBomb")
<< data() << bomber.getRangeBomb()
<< endtag();
this->writeTexture(bomber.getTexturePath());
this->writeBombs(bomber.getBombs());
this->m_xmlWrite
<< endtag("AI");
--this->m_nbAIs;
if ((this->m_AIDone = this->m_nbAIs == 0 ? true: false)) {
this->m_xmlWrite
<< endtag("AIs");
}
return true;
}
bool XmlSave::saveMaze(char const *map, int width, int height) {
if (!this->m_playersDone || !this->m_AIDone)
return false;
this->m_xmlWrite
<< tag("maze")
<< tag("size")
<< tag("width")
<< data() << width
<< endtag()
<< tag("height")
<< data() << height
<< endtag("size")
<< tag("maze")
<< data() << map
<< endtag("maze");
return false;
}
void XmlSave::writeTexture(std::string const& filepath) {
this->m_xmlWrite
<< tag("texture")
<< data() << filepath
<< endtag();
}
void XmlSave::writeKeys(int left, int right, int up, int down, int bomb) {
this->m_xmlWrite
<< tag("keys")
<< tag("left")
<< data() << left
<< endtag()
<< tag("right")
<< data() << right
<< endtag()
<< tag("up")
<< data() << up
<< endtag()
<< tag("down")
<< data() << down
<< endtag()
<< tag("bomb")
<< data() << bomb
<< endtag("keys");
}
void XmlSave::writeBombs(std::list<Bomb *> const &bombs) {
int i = 0;
this->m_xmlWrite
<< tag("bombs")
<< attribute("number") << bombs.size();
for (std::list<Bomb *>::const_iterator it = bombs.begin(); it != bombs.end(); ++it) {
this->m_xmlWrite
<< tag("bomb")
<< attribute("id") << ++i;
this->writeTexture((*it)->getTexturePath());
this->m_xmlWrite
<< tag("time")
<< data() << (*it)->getDelay()
<< endtag()
<< tag("range")
<< data() << (*it)->getRange()
<< endtag()
<< tag("position")
<< data() << (*it)->getPosition()
<< endtag("bomb");
}
this->m_xmlWrite << endtag("bombs");
}
|
390c5d1e3a5c5088c0227837f7cbe1df387efb58
|
8f0cb1228b109ce976c9228153b405a23118dc71
|
/swarm_ws/src/contour_node/src/level_description.cpp
|
094587dd1137be3b0ef6abc3d349f55b8a29cc99
|
[
"BSD-3-Clause"
] |
permissive
|
wvu-irl/reu-swarm-ros
|
f57124eec12011c19d367e881cf5903e6d1b44be
|
d63c9c4435cd22d8eca5414bf1a4602dd892c3af
|
refs/heads/master
| 2020-05-26T13:18:24.620892
| 2019-09-01T02:13:23
| 2019-09-01T02:13:23
| 188,242,415
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,280
|
cpp
|
level_description.cpp
|
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, WVU Interactive Robotics Laboratory
* https://web.statler.wvu.edu/~irl/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the Willow Garage nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
#include <contour_node/level_description.h>
#include <math.h>
#include <iostream>
double map_ns::calculate(wvu_swarm_std_msgs::map_level ml,
wvu_swarm_std_msgs::vicon_point loc)
{
double rx = loc.x;
double ry = loc.y;
double z = 0;
for (size_t i = 0; i < ml.functions.size(); i++)
{
wvu_swarm_std_msgs::gaussian curr_eq = ml.functions[i];
double x = rx - curr_eq.ellipse.offset_x;
double y = ry - curr_eq.ellipse.offset_y;
double theta = x == 0 ? (y > 0 ? M_PI_2 : -M_PI_2) : (atan(y/x) + (y < 0 ? M_PI : 0));
double r = sqrt(x*x + y*y);
double a = curr_eq.ellipse.x_rad;
double b = curr_eq.ellipse.y_rad;
double x_app = r * cos(theta + curr_eq.ellipse.theta_offset);
double y_app = r * sin(theta + curr_eq.ellipse.theta_offset);
double re = a != 0 && b != 0 ? sqrt(a * a * x_app * x_app + y_app * y_app * b * b) / (a * b) : 10000;
z += curr_eq.amplitude * pow(M_E, (-re * re) / 2.0);
}
return z;
}
wvu_swarm_std_msgs::map_level map_ns::combineLevels(
wvu_swarm_std_msgs::map_level a, wvu_swarm_std_msgs::map_level b)
{
wvu_swarm_std_msgs::map_level n_lev;
for (size_t i = 0; i < a.functions.size(); i++)
n_lev.functions.push_back(a.functions.at(i));
for (size_t i = 0; i < b.functions.size(); i++)
n_lev.functions.push_back(b.functions.at(i));
return n_lev;
}
|
f25bb56a7f81c50fe3609905386613f563215eae
|
59a53ffbfe19eb84ba310e66889462ce67451318
|
/463.islandPerimeter.cpp
|
5118819ffc790efef80b79cf513386e14d8788d8
|
[] |
no_license
|
wfnuser/leetcode
|
0877e03fed6617836a8c4dd695f62868d00c0f05
|
3202104983b4b68272766a3285ffe8683e9b1712
|
refs/heads/master
| 2022-06-29T04:16:12.874513
| 2022-05-25T05:52:03
| 2022-05-25T05:52:03
| 142,956,247
| 42
| 14
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 954
|
cpp
|
463.islandPerimeter.cpp
|
class Solution {
public:
int ans = 0;
int islandPerimeter(vector<vector<int>>& grid) {
if (grid.size() == 0) return 0;
if (grid[0].size() == 0) return 0;
int m = grid.size();
int n = grid[0].size();
int i = 0;
int j = 0;
int ans = 0;
for (i = 0; i < m; i++) {
for (j = 0; j < n; j++) {
if (grid[i][j] == 1) {
int cnt = 0;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
for (int d = 0; d < 4; d++) {
int ii = i+dx[d];
int jj = j+dy[d];
if (ii < 0 || ii >= m || jj < 0 || jj >= n) continue;
if (grid[ii][jj]) cnt++;
}
ans += 4- cnt;
}
}
}
return ans;
}
};
|
a4f4ca7cbf270bc146aec73db94bfa2c31fb053a
|
ffd784337744c75a386ac073bab5306b00c5b3bd
|
/zerojudge/d401.cpp
|
877d2966be0b0310f608782d051766aad9ecde85
|
[] |
no_license
|
jimmyhealer/Competitive-Programming
|
b93ff0397cef7076b98f711f8a270151891a9233
|
7a6cc7f942b956784998fe0573e6ba8e0d572544
|
refs/heads/master
| 2022-02-15T00:48:12.289354
| 2019-09-08T03:41:08
| 2019-09-08T04:20:54
| 284,256,471
| 2
| 0
| null | 2020-08-01T12:34:13
| 2020-08-01T12:34:12
| null |
UTF-8
|
C++
| false
| false
| 875
|
cpp
|
d401.cpp
|
#include<stdio.h>
#include<queue>
#include<vector>
using namespace std ;
vector<int> a[2] ;
priority_queue<int,vector<int>,greater<int> > que[2] ;
int main(){
int N ;
while (~scanf("%d",&N)){
a[0].clear() ;
a[1].clear() ;
//input -------------
for (int i=0 ,p ,h ;i<N ;i++ ){
scanf("%d%d",&p ,&h ) ;
a[p-1].push_back(h) ;
}
//K th --------------
int K ;
scanf("%d",&K ) ;
while (!que[0].empty())que[0].pop() ;
while (!que[1].empty())que[1].pop() ;
for (int p=0 ;p<2 ;p++ ){
for (int x:a[p]){
que[p].push(x) ;
if (que[p].size()>K)que[p].pop() ;
}
}
//output ------------
int x=que[0].top() ,y=que[1].top() ;
if (x>y)printf("1 %d\n",x-y) ;
else printf("2 %d\n",y-x) ;
}
}
|
34dc15c2f8468d70cf0233e9ae69f710d07b2049
|
c30e51031f62074ba0741920e385ed2fd9416e5a
|
/Semaphore.cpp
|
e9d4ebe5fb0b900620c84c26ba5e55a8ab74b50b
|
[] |
no_license
|
tectronics/outcall
|
f3ddb3fbeffe47262a0edd0416afbf21714accd9
|
094ddd7863a3fab152d76d3d90536bb415e9a6b5
|
refs/heads/master
| 2018-01-11T15:00:15.774271
| 2008-07-02T08:43:18
| 2008-07-02T08:43:18
| 45,312,847
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,464
|
cpp
|
Semaphore.cpp
|
/*
* Copyright (c) 2003-2007, Bicom Systems Ltd.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Bicom Systems Ltd nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Denis Komadaric,
* Bicom Systems Ltd.
*/
#include "stdafx.h"
#include "Semaphore.h"
Semaphore::Semaphore(const TCHAR *name, int milliseconds, int initialCount, int maximumCount)
{
Release = false;
this->name = name;
handle = CreateSemaphore(NULL, initialCount, maximumCount, name);
if (handle!=NULL) {
DWORD result = WaitForSingleObject(handle, milliseconds);
if (result==WAIT_OBJECT_0) {
Release = true;
}
}
}
Semaphore::~Semaphore(void)
{
if (Release) {
ReleaseObject(1);
}
if (handle) {
CloseHandle(handle);
}
}
void Semaphore::Wait(int milliseconds) {
WaitForSingleObject(handle, milliseconds);
}
void Semaphore::ReleaseObject(LONG lReleaseCount) {
LONG lpPreviousCount;
ReleaseSemaphore(handle, lReleaseCount, &lpPreviousCount);
Release = false;
}
|
c99044f4545f2b1d8530e4e6908895c6197182bc
|
b66715c97e48731ebba2afb8d81d02beb695c691
|
/TopCoder/9824 - CorporationSalary (SRM 407 [Div1 easy - Div2 medium]).cpp
|
63d662b0aa5bdeb9b517b764779c6aaaef85956d
|
[] |
no_license
|
justHusam/Competitive-Programming
|
c105b982108db914d80c759741302a9828b123b4
|
4c86037370774dc18beb1f2b302a59f2e84979d4
|
refs/heads/master
| 2020-03-19T10:26:12.874772
| 2018-09-14T12:24:41
| 2018-09-14T12:24:41
| 136,369,844
| 4
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 674
|
cpp
|
9824 - CorporationSalary (SRM 407 [Div1 easy - Div2 medium]).cpp
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
class CorporationSalary {
public:
vector<int> g[50];
ll dp[50];
long long totalSalary(vector<string> relations) {
int n = relations.size();
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
if (relations[i][j] == 'Y')
g[i].push_back(j);
memset(dp, -1, sizeof dp);
for (int i = 0; i < n; ++i)
DFS(i);
ll res = 0;
for (int i = 0; i < n; ++i)
res += dp[i];
return res;
}
ll DFS(int v) {
ll &res = dp[v];
if (res != -1)
return res;
res = 0;
for (size_t i = 0; i < g[v].size(); ++i)
res += DFS(g[v][i]);
if (res == 0)
++res;
return res;
}
};
|
9e5ea2471e26110420a3dfb200d0d5b63c4d2936
|
22e0fe422b202f43f22466ea093784bbe5781575
|
/circular_queue_cpp98/test3_circular_queue.cpp
|
479c581e334c61d1368092f89c9f593e758b68aa
|
[] |
no_license
|
ClarkSims/AlgosInC-
|
7f05f405a1f154275e316e9d5feb4713734a93fa
|
14d16cee499d78f90916e65a25f7279305e6a659
|
refs/heads/master
| 2020-05-15T19:42:50.030611
| 2019-06-06T22:02:46
| 2019-06-06T22:02:46
| 182,461,426
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,481
|
cpp
|
test3_circular_queue.cpp
|
/// \file test3_circular_queue.cpp
/// \brief This program test the major interface functions of circular_queue, begin(), end(), push_back() and
/// pop_front. It test the boundary conditions where the buffer is full and is empty also.
#include "circular_queue.h"
#include "CustomRand.h"
#include <iostream>
using namespace util_ipc;
using namespace std;
#define SIZE 1024
#define N 1048576
#define OFFSET 5
int main()
{
int32_t sz = sizeof( circular_queue<int,SIZE>);
void *blob = new char[sz];
circular_queue<int,SIZE> *cq = circular_queue<int,SIZE>::factory( blob, "foo");
ax_b_c_random Rand;
int i, j, J;
unsigned int I;
for (i=0; i<OFFSET; ++i) {
Rand.put_seed( i);
I = Rand.rand();
*cq->end() = I;
cq->push_back();
}
int k, l;
for (j=0; i<N; ) {
Rand.put_seed( i + j);
k = Rand.rand() % SIZE + 1;
for (l=0; l<k; ++l) {
Rand.put_seed( j);
J = Rand.rand();
if (cq->begin() == 0) break; // buffer empty
if (J != *cq->begin()) {
cerr << "test failed, j = " << j << " *head = " << *cq->begin() << endl;
return -1;
}
cq->pop_front();
++j;
}
Rand.put_seed( i + j);
k = Rand.rand() % SIZE + 1;
for (l=0; l<k && i<N; ++l) {
Rand.put_seed( i);
I = Rand.rand();
if (cq->end() == 0) break; // buffer full
*cq->end() = I;
cq->push_back();
++i;
}
}
cout << "test passed!" << endl;
return 0;
}
|
c65093278cae6a63b9e8d65eede56f91585642c4
|
e3b67db8b0ea9af2ba890dc4e119ff22876a2232
|
/extensions/aws/s3/S3Wrapper.h
|
4bce76217112e74dd48deb32eefe4474f854bb49
|
[
"MPL-2.0",
"Apache-2.0",
"BSD-3-Clause",
"curl",
"OpenSSL",
"libtiff",
"bzip2-1.0.6",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"MIT-0",
"Beerware",
"Zlib",
"NCSA",
"ISC",
"CC0-1.0",
"LicenseRef-scancode-object-form-exception-to-mit",
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-protobuf",
"Libpng",
"LicenseRef-scancode-mit-old-style",
"JSON",
"BSD-1-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"LicenseRef-scancode-bsd-unchanged"
] |
permissive
|
apache/nifi-minifi-cpp
|
90919e880bf7ac1ce51b8ad0f173cc4e3aded7fe
|
9b55dc0c0f17a190f3e9ade87070a28faf542c25
|
refs/heads/main
| 2023-08-29T22:29:02.420503
| 2023-08-25T17:21:53
| 2023-08-25T17:21:53
| 56,750,161
| 131
| 114
|
Apache-2.0
| 2023-09-14T05:53:30
| 2016-04-21T07:00:06
|
C++
|
UTF-8
|
C++
| false
| false
| 15,191
|
h
|
S3Wrapper.h
|
/**
* @file S3Wrapper.h
* S3Wrapper class declaration
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <map>
#include <memory>
#include <optional>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "aws/s3/model/StorageClass.h"
#include "aws/s3/model/ServerSideEncryption.h"
#include "aws/s3/model/ObjectCannedACL.h"
#include "core/logging/Logger.h"
#include "core/logging/LoggerConfiguration.h"
#include "utils/AWSInitializer.h"
#include "utils/OptionalUtils.h"
#include "utils/StringUtils.h"
#include "utils/ListingStateManager.h"
#include "utils/gsl.h"
#include "S3RequestSender.h"
#include "Exception.h"
#include "MultipartUploadStateStorage.h"
#include "range/v3/algorithm/find.hpp"
namespace org::apache::nifi::minifi::aws::s3 {
inline constexpr std::array<std::pair<std::string_view, Aws::S3::Model::StorageClass>, 7> STORAGE_CLASS_MAP {{
{"Standard", Aws::S3::Model::StorageClass::STANDARD},
{"ReducedRedundancy", Aws::S3::Model::StorageClass::REDUCED_REDUNDANCY},
{"StandardIA", Aws::S3::Model::StorageClass::STANDARD_IA},
{"OnezoneIA", Aws::S3::Model::StorageClass::ONEZONE_IA},
{"IntelligentTiering", Aws::S3::Model::StorageClass::INTELLIGENT_TIERING},
{"Glacier", Aws::S3::Model::StorageClass::GLACIER},
{"DeepArchive", Aws::S3::Model::StorageClass::DEEP_ARCHIVE}
}};
inline constexpr std::array<std::pair<Aws::S3::Model::ObjectStorageClass, std::string_view>, 7> OBJECT_STORAGE_CLASS_MAP {{
{Aws::S3::Model::ObjectStorageClass::STANDARD, "Standard"},
{Aws::S3::Model::ObjectStorageClass::REDUCED_REDUNDANCY, "ReducedRedundancy"},
{Aws::S3::Model::ObjectStorageClass::STANDARD_IA, "StandardIA"},
{Aws::S3::Model::ObjectStorageClass::ONEZONE_IA, "OnezoneIA"},
{Aws::S3::Model::ObjectStorageClass::INTELLIGENT_TIERING, "IntelligentTiering"},
{Aws::S3::Model::ObjectStorageClass::GLACIER, "Glacier"},
{Aws::S3::Model::ObjectStorageClass::DEEP_ARCHIVE, "DeepArchive"}
}};
inline constexpr std::array<std::pair<Aws::S3::Model::ObjectVersionStorageClass, std::string_view>, 1> VERSION_STORAGE_CLASS_MAP {{
{Aws::S3::Model::ObjectVersionStorageClass::STANDARD, "Standard"}
}};
inline constexpr std::array<std::pair<std::string_view, Aws::S3::Model::ServerSideEncryption>, 3> SERVER_SIDE_ENCRYPTION_MAP {{
{"None", Aws::S3::Model::ServerSideEncryption::NOT_SET},
{"AES256", Aws::S3::Model::ServerSideEncryption::AES256},
{"aws_kms", Aws::S3::Model::ServerSideEncryption::aws_kms},
}};
inline constexpr std::array<std::pair<std::string_view, Aws::S3::Model::ObjectCannedACL>, 7> CANNED_ACL_MAP {{
{"BucketOwnerFullControl", Aws::S3::Model::ObjectCannedACL::bucket_owner_full_control},
{"BucketOwnerRead", Aws::S3::Model::ObjectCannedACL::bucket_owner_read},
{"AuthenticatedRead", Aws::S3::Model::ObjectCannedACL::authenticated_read},
{"PublicReadWrite", Aws::S3::Model::ObjectCannedACL::public_read_write},
{"PublicRead", Aws::S3::Model::ObjectCannedACL::public_read},
{"Private", Aws::S3::Model::ObjectCannedACL::private_},
{"AwsExecRead", Aws::S3::Model::ObjectCannedACL::aws_exec_read},
}};
struct Expiration {
std::string expiration_time;
std::string expiration_time_rule_id;
};
struct PutObjectResult {
std::string version;
std::string etag;
std::string expiration;
std::string ssealgorithm;
};
struct RequestParameters {
RequestParameters(Aws::Auth::AWSCredentials creds, Aws::Client::ClientConfiguration config)
: credentials(std::move(creds)),
client_config(std::move(config)) {}
Aws::Auth::AWSCredentials credentials;
Aws::Client::ClientConfiguration client_config;
void setClientConfig(const aws::s3::ProxyOptions& proxy, const std::string& endpoint_override_url) {
client_config.proxyHost = proxy.host;
client_config.proxyPort = proxy.port;
client_config.proxyUserName = proxy.username;
client_config.proxyPassword = proxy.password;
client_config.endpointOverride = endpoint_override_url;
}
};
struct PutObjectRequestParameters : public RequestParameters {
PutObjectRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::string object_key;
std::string storage_class;
std::string server_side_encryption;
std::string content_type;
std::map<std::string, std::string> user_metadata_map;
std::string fullcontrol_user_list;
std::string read_permission_user_list;
std::string read_acl_user_list;
std::string write_acl_user_list;
std::string canned_acl;
bool use_virtual_addressing = true;
};
struct DeleteObjectRequestParameters : public RequestParameters {
DeleteObjectRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::string object_key;
std::string version;
};
struct GetObjectRequestParameters : public RequestParameters {
GetObjectRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::string object_key;
std::string version;
bool requester_pays = false;
};
struct HeadObjectResult {
std::filesystem::path path;
std::filesystem::path absolute_path;
std::filesystem::path filename;
std::string mime_type;
std::string etag;
Expiration expiration;
std::string ssealgorithm;
std::string version;
std::map<std::string, std::string> user_metadata_map;
void setFilePaths(const std::string& key);
};
struct GetObjectResult : public HeadObjectResult {
int64_t write_size = 0;
};
struct ListRequestParameters : public RequestParameters {
ListRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::string delimiter;
std::string prefix;
bool use_versions = false;
uint64_t min_object_age = 0;
};
struct ListedObjectAttributes : public minifi::utils::ListedObject {
[[nodiscard]] std::chrono::time_point<std::chrono::system_clock> getLastModified() const override {
return last_modified;
}
[[nodiscard]] std::string getKey() const override {
return filename;
}
std::string filename;
std::string etag;
bool is_latest = false;
std::chrono::time_point<std::chrono::system_clock> last_modified;
int64_t length = 0;
std::string store_class;
std::string version;
};
using HeadObjectRequestParameters = GetObjectRequestParameters;
using GetObjectTagsParameters = DeleteObjectRequestParameters;
struct ListMultipartUploadsRequestParameters : public RequestParameters {
ListMultipartUploadsRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::optional<std::chrono::milliseconds> age_off_limit; // if set, only list the aged off uploads
bool use_virtual_addressing = true;
};
struct MultipartUpload {
std::string key;
std::string upload_id;
};
struct AbortMultipartUploadRequestParameters : public RequestParameters {
AbortMultipartUploadRequestParameters(const Aws::Auth::AWSCredentials& creds, const Aws::Client::ClientConfiguration& config)
: RequestParameters(creds, config) {}
std::string bucket;
std::string key;
std::string upload_id;
bool use_virtual_addressing = true;
};
class StreamReadException : public Exception {
public:
explicit StreamReadException(const std::string& error) : Exception(GENERAL_EXCEPTION, error) {}
};
class S3Wrapper {
public:
static constexpr uint64_t BUFFER_SIZE = 4_KiB;
S3Wrapper();
explicit S3Wrapper(std::unique_ptr<S3RequestSender>&& request_sender);
std::optional<PutObjectResult> putObject(const PutObjectRequestParameters& put_object_params, const std::shared_ptr<io::InputStream>& stream, uint64_t flow_size);
std::optional<PutObjectResult> putObjectMultipart(const PutObjectRequestParameters& put_object_params, const std::shared_ptr<io::InputStream>& stream, uint64_t flow_size, uint64_t multipart_size);
bool deleteObject(const DeleteObjectRequestParameters& params);
std::optional<GetObjectResult> getObject(const GetObjectRequestParameters& get_object_params, io::OutputStream& out_body);
std::optional<std::vector<ListedObjectAttributes>> listBucket(const ListRequestParameters& params);
std::optional<std::map<std::string, std::string>> getObjectTags(const GetObjectTagsParameters& params);
std::optional<HeadObjectResult> headObject(const HeadObjectRequestParameters& head_object_params);
std::optional<std::vector<MultipartUpload>> listMultipartUploads(const ListMultipartUploadsRequestParameters& params);
bool abortMultipartUpload(const AbortMultipartUploadRequestParameters& params);
void ageOffLocalS3MultipartUploadStates(std::chrono::milliseconds multipart_upload_max_age_threshold);
void initializeMultipartUploadStateStorage(gsl::not_null<minifi::core::StateManager*> state_manager);
virtual ~S3Wrapper() = default;
private:
struct UploadPartsResult {
std::string upload_id;
std::vector<std::string> part_etags;
};
static Expiration getExpiration(const std::string& expiration);
template<typename RequestType>
void setCannedAcl(RequestType& request, const std::string& canned_acl) const {
if (canned_acl.empty()) return;
const auto it = ranges::find(CANNED_ACL_MAP, canned_acl, [](const auto& kv) { return kv.first; });
if (it == CANNED_ACL_MAP.end()) return;
logger_->log_debug("Setting AWS canned ACL [%s]", canned_acl);
request.SetACL(it->second);
}
template<typename RequestType>
RequestType createPutObjectRequest(const PutObjectRequestParameters& put_object_params) {
auto request = RequestType{}
.WithBucket(put_object_params.bucket)
.WithKey(put_object_params.object_key)
.WithStorageClass(minifi::utils::at(STORAGE_CLASS_MAP, put_object_params.storage_class));
if (!put_object_params.server_side_encryption.empty() && put_object_params.server_side_encryption != "None") {
request.SetServerSideEncryption(minifi::utils::at(SERVER_SIDE_ENCRYPTION_MAP, put_object_params.server_side_encryption));
}
if (!put_object_params.content_type.empty()) {
request.SetContentType(put_object_params.content_type);
}
if (!put_object_params.user_metadata_map.empty()) {
request.SetMetadata(put_object_params.user_metadata_map);
}
if (!put_object_params.fullcontrol_user_list.empty()) {
request.SetGrantFullControl(put_object_params.fullcontrol_user_list);
}
if (!put_object_params.read_permission_user_list.empty()) {
request.SetGrantRead(put_object_params.read_permission_user_list);
}
if (!put_object_params.read_acl_user_list.empty()) {
request.SetGrantReadACP(put_object_params.read_acl_user_list);
}
if (!put_object_params.write_acl_user_list.empty()) {
request.SetGrantWriteACP(put_object_params.write_acl_user_list);
}
setCannedAcl<RequestType>(request, put_object_params.canned_acl);
return request;
}
template<typename ResultType>
PutObjectResult createPutObjectResult(const ResultType& upload_result) {
return {
.version = upload_result.GetVersionId(),
// Etags are returned by AWS in quoted form that should be removed
.etag = minifi::utils::StringUtils::removeFramingCharacters(upload_result.GetETag(), '"'),
// GetExpiration returns a string pair with a date and a ruleid in 'expiry-date=\"<DATE>\", rule-id=\"<RULEID>\"' format
// s3.expiration only needs the date member of this pair
.expiration = getExpiration(upload_result.GetExpiration()).expiration_time,
.ssealgorithm = getEncryptionString(upload_result.GetServerSideEncryption())
};
}
static int64_t writeFetchedBody(Aws::IOStream& source, int64_t data_size, io::OutputStream& output);
static std::string getEncryptionString(Aws::S3::Model::ServerSideEncryption encryption);
static std::shared_ptr<Aws::StringStream> readFlowFileStream(const std::shared_ptr<io::InputStream>& stream, uint64_t read_limit, uint64_t& read_size_out);
std::optional<std::vector<ListedObjectAttributes>> listVersions(const ListRequestParameters& params);
std::optional<std::vector<ListedObjectAttributes>> listObjects(const ListRequestParameters& params);
void addListResults(const Aws::Vector<Aws::S3::Model::ObjectVersion>& content, uint64_t min_object_age, std::vector<ListedObjectAttributes>& listed_objects);
void addListResults(const Aws::Vector<Aws::S3::Model::Object>& content, uint64_t min_object_age, std::vector<ListedObjectAttributes>& listed_objects);
void addListMultipartUploadResults(const Aws::Vector<Aws::S3::Model::MultipartUpload>& uploads, std::optional<std::chrono::milliseconds> age_off_limit,
std::vector<MultipartUpload>& filtered_uploads);
std::optional<UploadPartsResult> uploadParts(const PutObjectRequestParameters& put_object_params, const std::shared_ptr<io::InputStream>& stream, MultipartUploadState upload_state);
std::optional<Aws::S3::Model::CompleteMultipartUploadResult> completeMultipartUpload(const PutObjectRequestParameters& put_object_params, const UploadPartsResult& upload_parts_result);
bool multipartUploadExistsInS3(const PutObjectRequestParameters& put_object_params);
std::optional<MultipartUploadState> getMultipartUploadState(const PutObjectRequestParameters& put_object_params);
template<typename ListRequest>
ListRequest createListRequest(const ListRequestParameters& params);
template<typename FetchObjectRequest>
FetchObjectRequest createFetchObjectRequest(const GetObjectRequestParameters& get_object_params);
template<typename AwsResult, typename FetchObjectResult>
FetchObjectResult fillFetchObjectResult(const GetObjectRequestParameters& get_object_params, const AwsResult& fetch_object_result);
const utils::AWSInitializer& AWS_INITIALIZER = utils::AWSInitializer::get();
std::shared_ptr<minifi::core::logging::Logger> logger_{minifi::core::logging::LoggerFactory<S3Wrapper>::getLogger()};
std::unique_ptr<S3RequestSender> request_sender_;
uint64_t last_bucket_list_timestamp_ = 0;
std::unique_ptr<MultipartUploadStateStorage> multipart_upload_storage_;
};
} // namespace org::apache::nifi::minifi::aws::s3
|
248caefd9877edbf3ecb84c7c2ca2aeda63d57b0
|
d1cae7eb03865040994e629c8b9cc456dd129e8d
|
/main.cpp
|
f0b11cc0ab451fb176ed47caf069b193451b6335
|
[] |
no_license
|
kalaharileeu/TestSDL2
|
3375e8c5750c5937457d4004c4eaa0fa0d71e09a
|
d7ec508526c3e774678dc8597e6c59523b9256cc
|
refs/heads/master
| 2021-01-13T02:42:10.232041
| 2017-01-03T22:56:51
| 2017-01-03T22:56:51
| 77,181,275
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 870
|
cpp
|
main.cpp
|
#include<SDL.h>
SDL_Window* _gWindow = 0;
SDL_Renderer* _gRenderer = 0;
int main(int argc, char* args[])
{
// initialize SDL
if (SDL_Init(SDL_INIT_EVERYTHING) >= 0)
{
// if succeeded create our window
_gWindow = SDL_CreateWindow("Hello SDL2",
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
640, 480, SDL_WINDOW_SHOWN);
// If window creation succeeded create renderer
if (_gWindow != 0)
{
_gRenderer = SDL_CreateRenderer(_gWindow, -1, 0);
}
}
else
{
return 1; // sdl could not initialize
}
// EVERYTHING GOOD draw blue window
// Function expects Red, Green, Blue and Alpha as color values
SDL_SetRenderDrawColor(_gRenderer, 0, 0, 255, 255);
//clear the window
SDL_RenderClear(_gRenderer);
// show the window
SDL_RenderPresent(_gRenderer);
// set a delay before quitting
SDL_Delay(5000);
// clean up SDL
SDL_Quit();
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.