blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2 values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905 values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 10.4M | extension stringclasses 115 values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6dce8298cb97791002e90eb41990a970a8b9cf04 | 9bd2e0abd36191df0373d8927df85b2a12304816 | /Calibration/OpenShortCalib/moc_hardwareinterface.cpp | 4c95d369e2d3621ee77f25203fb799253365db51 | [] | no_license | Qmax/PT6 | 8c92c3566c082843fc561bd684faa427183a6f04 | e4c670beb058ec246cf6f823b4414e19ba956e5f | refs/heads/master | 2021-01-19T08:59:47.400962 | 2014-09-02T14:04:19 | 2014-09-02T14:04:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,158 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'hardwareinterface.h'
**
** Created: Mon Jul 15 16:41:08 2013
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "hardwareinterface.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'hardwareinterface.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.6.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_HardwareInterface[] = {
// content:
4, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
static const char qt_meta_stringdata_HardwareInterface[] = {
"HardwareInterface\0"
};
const QMetaObject HardwareInterface::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_HardwareInterface,
qt_meta_data_HardwareInterface, 0 }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &HardwareInterface::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *HardwareInterface::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *HardwareInterface::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_HardwareInterface))
return static_cast<void*>(const_cast< HardwareInterface*>(this));
return QObject::qt_metacast(_clname);
}
int HardwareInterface::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
QT_END_MOC_NAMESPACE
| [
"ravivarman@ravivarman.(none)"
] | ravivarman@ravivarman.(none) |
572c1db87c7f1ee2182b31f55b10bb5c21b08dd0 | 7fefd2e7345e165d9f4e50fb4d95417e8441eac0 | /line.h | 984707563fea6a79d57d30c08ed1101abfe74596 | [] | no_license | jpreiss/molasses | 30ea94fd39b66328cee66742179a7473ab44ca11 | 9fa6e3d05fabad5e92025cc441961f9878ab9517 | refs/heads/master | 2021-01-17T08:29:30.623443 | 2016-06-28T21:27:56 | 2016-06-28T21:27:56 | 12,252,235 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 969 | h | #pragma once
#include "vec.h"
class Line
{
public:
Line(Vec const &s, Vec const &e) : start(s), end(e) {}
Vec start;
Vec end;
float length2()
{
return (end - start).length2();
}
float length()
{
return (end - start).length();
}
};
/* Not needed yet, wrote before I decided to ditch scan line rasterizer
for barycentric
bool isOnLeft(Vec const &start, Vec const &end, Vec const &v)
{
Vec start2D(start.x, start.y, 0);
Vec end2D(end.x, end.y, 0);
Vec normal = cross(Vec(0, 0, 1), end2D - start2D);
Vec test = v - start;
float dp = dot(normal, test);
return dp > 0;
}
bool onSameSide(Line const &l, Vec const &a, Vec const &b)
{
// not sure all this projecting to 2D is necessary
Vec start2D(l.start.x, l.start.y, 0);
Vec end2D(l.end.x, l.end.y, 0);
Vec a2D(a.x, a.y, 0);
Vec b2D(b.x, b.y, 0);
Vec dir = end2D - start2D;
Vec toA = a2D - start2D;
Vec toB = b2D - start2D;
return dot(toA.normalTo(dir), toB.normalTo(dir)) > 0;
}
*/ | [
"donjeezy@gmail.com"
] | donjeezy@gmail.com |
4f9641178f717ba23ebf244be5d52db3062fe933 | 1a54220fad88ff1a8e83a1c6aed7c62013fcd2e4 | /Unique Paths/main.cpp | 3fc43265f92684927ffa3c8ab6a04ad30eeb400b | [] | no_license | akashc777/LeetCodeChallenge | ef7d6335c05d782de039a70af34463571ff0cde1 | 41f900dddb411f5ba076bcea2fb7e896bb16c966 | refs/heads/master | 2022-11-29T02:07:26.132812 | 2020-08-05T16:40:03 | 2020-08-05T16:40:03 | 281,602,695 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 412 | cpp | class Solution {
public:
int uniquePaths(int m, int n) {
int arr[m][n];
for(int i=0; i<m; i++){
for(int j=0; j<n; j++){
if(i==0 || j==0){
arr[i][j] = 1;
continue;
}else{
arr[i][j]= arr[i][j-1] + arr[i-1][j];
}
}
}
return arr[m-1][n-1];
}
}; | [
"contact@akash.page"
] | contact@akash.page |
c5acb5d682dae47ae7beff77ab46551ed20d38e6 | 723aba9051f6c05ad63d7d0f06c96dc8152be9fb | /NewSandbox/AnimNotifies/Weapons/Mag/MagOut/MagOutAnimNotify_PlaySound.cpp | 7ab2f74c88093785929da8819e89adf567a77b26 | [] | no_license | JTuthill01/NewSandbox | 94efe5521c85dd2d3ca62f48f0e877ff69fd1aae | 916d2cb60ba3da4330d2af98da3aad376e2d6788 | refs/heads/main | 2023-07-17T14:41:18.389959 | 2021-09-03T13:02:25 | 2021-09-03T13:02:25 | 384,204,538 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 406 | cpp | #include "MagOutAnimNotify_PlaySound.h"
#include "NewSandbox/Actors/Weapons/WeaponBase/WeaponBase.h"
#include "Kismet/GameplayStatics.h"
void UMagOutAnimNotify_PlaySound::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation)
{
auto Weapon = Cast<AWeaponBase>(MeshComp->GetOwner());
if (!Weapon)
return;
else
UGameplayStatics::SpawnSoundAttached(Weapon->MagOutSound, MeshComp);
}
| [
"emt_tuthill@hotmail.com"
] | emt_tuthill@hotmail.com |
e3ec9623eeae9c35129670b40d583fb951d73dc0 | 756acc543ca1bc54a8317733db22f870c183967b | /Session.cpp | 36b4cf2ef232735362c44551fcf2502e15da9671 | [] | no_license | urbanscenery/ReservationSystem | 70048856f0a5e03fb99b1cbf92004adc82a3c16d | f0d26180ecb7b95038b30e504d9771c878cb25a2 | refs/heads/master | 2020-03-18T19:26:39.219208 | 2018-06-03T05:13:33 | 2018-06-03T05:13:33 | 135,154,646 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 598 | cpp | #include "Session.h"
Session::Session()
{
}
Session::Session(char *newUserID)
{
strcpy(userID, newUserID);
}
/*Session::Session(char *newUserID, char *newMemberType)
{
strcpy_s(userID, sizeof(userID), newUserID);
if (strcmp("guest", newMemberType) == 0)
memberType = 1;
else
memberType = 2;
}*/
Session::~Session()
{
}
char *Session::getUserID()
{
return userID;
}
/*int Session::getMemberType()
{
return memberType;
}*/
Session *Session::getNext()
{
return next;
}
void Session::setNext(Session *nextSession)
{
next = nextSession;
} | [
"urbanscenery@gmail.com"
] | urbanscenery@gmail.com |
ef159e0c8d54636b21fc453b65d0c237876f98ae | 7e68c3e0e86d1a1327026d189a613297b769c411 | /parsergen/lexgen/DFA.cpp | d37e8e71ef041bb03e666800f40797c476827459 | [] | no_license | staticlibs/Big-Numbers | bc08092e36c7c640dcf43d863448cd066abaebed | adbfa38cc2e3b8ef706a3ac8bbd3e398f741baf3 | refs/heads/master | 2023-03-16T20:25:08.699789 | 2020-12-20T20:50:25 | 2020-12-20T20:50:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,360 | cpp | #include "stdafx.h"
#include <string.h>
#include "DFA.h"
DFA::DFA(const NFA &nfa) : m_NFA(nfa), m_verboseFile(stdoutMarginFile) {
const Options &options = Options::getInstance();
makeTransitions();
if(isDFAVerbose()) {
_tprintf(_T("Unminimized DFA table:\n"));
for(size_t i = 0; i < m_states.size(); i++) {
m_states[i].print(m_verboseFile);
}
}
minimize();
if(isDFAVerbose()) {
_tprintf(_T("Minimized DFA table:\n"));
for(size_t i = 0; i < m_states.size(); i++) {
m_states[i].print(m_verboseFile);
}
}
}
DFAstate::DFAstate(int id, BitSet *NFAset, AcceptAction *action) {
m_id = id;
m_accept = action;
m_NFAset = NFAset;
memset(m_transition, 0, sizeof(m_transition));
}
void DFA::makeTransitions() {
const Options &options = Options::getInstance();
BitSet *NFAset = newNFAset(); // set of NFA states that defines the next DFA state.
NFAset->add(0);
DFAstate startState(0);
epsClosure(*NFAset, startState.m_accept);
startState.m_NFAset = NFAset;
m_states.add(startState);
for(size_t index = 0; index < m_states.size(); index++) {
DFAstate *current = &m_states[index];
if(isDFAVerbose()) {
m_verboseFile.printf(_T("DFA state %3d. NFA states:"), current->m_id);
printSet(m_verboseFile, *current->m_NFAset);
m_verboseFile.printf(_T("\n"));
}
for(int c = 0; c < MAX_CHARS ; c++) {
int nextDFAstate = FAILURE; // go to nextDFAstate on char c
if(NFAset = transition(*current->m_NFAset, c)) {
AcceptAction *accept; // if current DFA state is an acceptstate, this is the AcceptAction
epsClosure(*NFAset, accept);
if((nextDFAstate = stateExist(*NFAset)) < 0) {
nextDFAstate = (int)m_states.size();
m_states.add(DFAstate(nextDFAstate, NFAset, accept));
} else {
delete NFAset;
}
}
current->m_transition[c] = nextDFAstate;
}
}
}
int DFA::stateExist(const BitSet &NFAset) const {
for(size_t i = 0; i < m_states.size(); i++) {
if(*m_states[i].m_NFAset == NFAset) {
return (int)i;
}
}
return -1;
}
void DFA::epsClosure(BitSet &NFAset, AcceptAction *&accept) const {
// NFAset is the set of start states to examine. also used as output
// *accept is modified to point to the AcceptAction associated with an accepting
// state (or nullptr if the state isn't an accepting state).
//
// Computes the epsilon closure set for the NFAset. This set
// will contain all states that can be reached by making epsilon transitions
// from all NFA states in the original set. Returns an empty set if the
// set or the closure set is empty. Modifies *accept to point to the
// accepting String with LOWEST lineno, if one of the NFA states in the output set is an
// accepting state.
// The algorithm is:
//
// 1: push all NFA-states in NFAset set onto stateStack
// 2: while(stateStack is not empty)
// 3: pop the top element p
// 4 if p is an accept state and p.accept.lineno < accept.lineno
// accept = p.accept
// 5: if(there's an epsilon transition from p to q)
// 6: if(q isn't in NFAset)
// 7: add q to NFAset
// 8: push q onto stateStack
CompactStack<UINT> stateStack; // stack of NFA-states remaining to be tested
for(auto it = NFAset.getIterator(); it.hasNext(); ) { // 1
stateStack.push((int)it.next());
}
accept = nullptr;
while(!stateStack.isEmpty()) { // 2
const NFAstate &p = *m_NFA[stateStack.pop()]; // 3
if(p.m_accept
&& ((accept == nullptr) || (p.m_accept->m_pos.getLineNumber() < accept->m_pos.getLineNumber()))) { // 4
accept = p.m_accept;
}
if(p.m_edge == EDGE_EPSILON) { // 5
if(p.m_next1) {
const UINT next = p.m_next1->getID();
if(!NFAset.contains(next)) { // 6
NFAset.add(next); // 7
stateStack.push(next); // 8
}
}
if(p.m_next2) {
const UINT next = p.m_next2->getID();
if(!NFAset.contains(next)) { // 6
NFAset.add(next); // 7
stateStack.push(next); // 8
}
}
}
}
}
BitSet *DFA::transition(BitSet &NFAset, int c) const {
BitSet *result = nullptr;
for(auto it = NFAset.getIterator(); it.hasNext();) {
const UINT i = (UINT)it.next();
const NFAstate *p = m_NFA[i]->successor(c);
if(p) {
if(result == nullptr) {
result = newNFAset();
}
result->add(p->getID());
}
}
/*
printf(_T("transitions on "));
printchar(c);
printf(_T(" from {"));
printSet(inp_set);
printf(_T("}="));
if(result != nullptr)
printSet(*result);
else
printf(_T("nullptr"));
printf(_T("\n"));
*/
return result;
}
void DFA::printGroups(MarginFile &f) {
for(size_t i = 0; i < m_groups.size(); i++) {
f.printf(_T("Group %2d:"), (int)i);
printSet(f, m_groups[i]);
f.printf(_T("\n"));
}
}
void DFA::printStates(MarginFile &f) const {
for(size_t i = 0; i < m_states.size(); i++) {
m_states[i].print(f);
}
}
void DFA::makeInitialGroups() {
const Options &options = Options::getInstance();
const UINT stateCount = getStateCount();
m_inGroup.insert(0, -1, stateCount);
for(UINT i = 0; i < stateCount; i++) {
BitSet newset(stateCount);
for(UINT j = 0; j < i; j++) {
// Check to see if a group already exists, ie. that has the same
// accepting String as the current state. If so, add the current
// state to the already existing group and skip past the code that
// would create a new group. Note that since all nonAccepting states
// have nullptr accept strings, this loop puts all of these together
// into a single group.
if(m_states[i].m_accept == m_states[j].m_accept) {
m_groups[m_inGroup[j]].add(i);
m_inGroup[i] = m_inGroup[j];
goto Continue;
}
}
// Create a new group and put the current state into it.
newset.add(i);
m_inGroup[i] = (int)m_groups.size(); // state[i] belongs to group m_groups.size()
m_groups.add(newset);
Continue:; // Group already exists.
}
if(isDFAVerbose()) {
m_verboseFile.printf(_T("Initial groupings:\n"));
printGroups(m_verboseFile);
}
}
void DFA::fixupTransitions() {
const UINT groupCount = (UINT)m_groups.size();
Array<DFAstate> newStates(groupCount);
for(UINT g = 0; g < groupCount; g++) {
const size_t state = m_groups[g].select(); // there is at least one state in each group
newStates.add(DFAstate(g));
DFAstate &newState = newStates.last();
DFAstate &oldState = m_states[state];
newState.m_accept = oldState.m_accept;
for(UINT c = 0; c < MAX_CHARS; c++) {
const int trans = oldState.m_transition[c];
newState.m_transition[c] = (trans == FAILURE) ? FAILURE : m_inGroup[trans];
}
}
m_states = newStates;
}
void DFA::minimize() {
const Options &options = Options::getInstance();
bool stable; // did we anything in this pass
makeInitialGroups();
do {
stable = true;
for(size_t i = 0; i < m_groups.size(); i++) {
BitSet ¤t = m_groups[i];
if(current.size() <= 1) {
continue;
}
BitSet newset(m_states.size());
Iterator<size_t> it = current.getIterator();
int first = (int)it.next(); // state number of first element of current group
while(it.hasNext()) {
const int next = (int)it.next(); // state number of next element of current group
for(UINT c = 0; c < MAX_CHARS; c++) {
int firstSuccessor = m_states[first].m_transition[c];
int nextSuccessor = m_states[next ].m_transition[c];
if(firstSuccessor != nextSuccessor // if successor-states differ or belong to different groups
&& ( firstSuccessor == FAILURE
|| nextSuccessor == FAILURE
|| m_inGroup[firstSuccessor] != m_inGroup[nextSuccessor]
)
) {
current.remove(next); // move the state to newset
newset.add(next);
m_inGroup[next] = (int)m_groups.size();
break;
}
} // for
} // while
if(!newset.isEmpty()) {
m_groups.add(newset);
stable = false;
}
} // for
} while(!stable);
if(isDFAVerbose()) {
m_verboseFile.printf(_T("\nStates grouped as follows after minimization:\n"));
printGroups(m_verboseFile);
}
fixupTransitions();
}
#if !defined(USE_COMPACT_DFAFORMAT)
void DFAstate::print(MarginFile &f) const {
if(m_accept == nullptr) {
f.printf(_T("// DFA State %3d [nonAccepting]"), m_id );
} else {
f.printf(_T("// DFA State %3d %s"), m_id, m_accept->dumpFormat().cstr());
}
UINT chars_printed = f.getLeftMargin();
int last_transition = FAILURE;
for(UINT c = 0; c < MAX_CHARS; c++) {
if(m_transition[c] != FAILURE) {
if(m_transition[c] != last_transition) {
f.printf(_T("\n// goto %2d on "), m_transition[c]);
chars_printed = f.getLeftMargin();
}
const String tmp = binToAscii(c);
if(f.getCurrentLineLength() + tmp.length() > RMARGIN) {
f.printf(_T("\n// "));
chars_printed = f.getLeftMargin();
}
f.printf(_T("%s"), tmp.cstr() );
chars_printed += (UINT)tmp.length();
last_transition = m_transition[c];
}
}
f.printf(_T("\n"));
}
#else // USE_COMPACT_DFAFORMAT
#define FORMATCHAR(ch) binToAscii(ch)
#define _FLUSHRANGE() \
{ String tmp; \
if(delim) tmp += delim; else delim = "," ; \
if(first == last) { \
tmp = FORMATCHAR(first); \
} else { \
const TCHAR *formatStr = (first + 1 == last) ? _T("%s%s") : _T("%s-%s"); \
tmp = format(formatStr, FORMATCHAR(first).cstr(), FORMATCHAR(last).cstr()); \
} \
if(charsPrinted + tmp.length() > RMARGIN) { \
f.printf(_T("\n// ")); \
charsPrinted = f.getLeftMargin(); \
} \
f.printf(_T("%s"), tmp.cstr()); \
charsPrinted += tmp.length(); \
}
#define FLUSHRANGE() { if(first <= last) _FLUSHRANGE(); }
#define NEWTRANS() { first = 1; last = 0; delim = nullptr; }
void DFAstate::print(MarginFile &f) const {
if(m_accept == nullptr) {
f.printf(_T("// DFA State %3d [nonAccepting]"), m_id );
} else {
f.printf(_T("// DFA State %3d %s"), m_id, m_accept->dumpFormat().cstr());
}
int charsPrinted = f.getLeftMargin();
int lastTransition = FAILURE;
unsigned int first,last;
const TCHAR *delim;
NEWTRANS();
for(int ch = 0; ch < MAX_CHARS; ch++) {
if(m_transition[ch] != FAILURE) {
if(m_transition[ch] != lastTransition) {
FLUSHRANGE(); NEWTRANS();
f.printf(_T("\n// goto %2d on "), m_transition[ch]);
charsPrinted = f.getLeftMargin();
}
if(first > last) {
first = last = ch;
} else if(ch == last+1) {
last = ch;
} else {
FLUSHRANGE();
first = last = ch;
}
lastTransition = m_transition[ch];
}
}
FLUSHRANGE();
f.printf(_T("\n"));
}
#endif
| [
"jesper.gr.mikkelsen@gmail.com"
] | jesper.gr.mikkelsen@gmail.com |
637314c2d7c941b4fccffb9044d42b2d07b78867 | 3603a0c374fae8eb00437b0bd3086230e12874de | /twxes10/libs/cocos2dx/platform/CCCommon.cpp | c6f0e0347a6b829fa03b86e447f77ee6b141a216 | [
"MIT"
] | permissive | diwu/Tiny-Wings-Remake-on-Android | b5bfb8dada7783546622464690c5f212ebba9479 | a9fd714432a350b69615bf8dbb40448231a54524 | refs/heads/master | 2021-01-01T18:06:41.598507 | 2017-04-18T02:09:20 | 2017-04-18T02:09:20 | 4,390,705 | 50 | 23 | null | 2017-04-18T02:09:21 | 2012-05-21T06:53:30 | C | UTF-8 | C++ | false | false | 8,098 | cpp | /****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCCommon.h"
#define MAX_LEN (cocos2d::kMaxLogLen + 1)
/****************************************************
* win32
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#include <Windows.h>
#include "CCStdC.h"
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char szBuf[MAX_LEN];
va_list ap;
va_start(ap, pszFormat);
vsnprintf_s(szBuf, MAX_LEN, MAX_LEN, pszFormat, ap);
va_end(ap);
WCHAR wszBuf[MAX_LEN] = {0};
MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf));
OutputDebugStringW(wszBuf);
OutputDebugStringA("\n");
printf("%s\n", szBuf);
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
MessageBoxA(NULL, pszMsg, pszTitle, MB_OK);
}
NS_CC_END;
#endif // CC_PLATFORM_WIN32
/****************************************************
* wophone
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE)
#include "TG3.h"
static char s_szLogFilePath[EOS_FILE_MAX_PATH] = {0};
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
if (! s_szLogFilePath[0])
{
// save the log file named "Cocos2dxLog.txt" to the directory which the app.so in.
TUChar AppID[EOS_FILE_MAX_PATH] = {0};
UInt32 nCmdType = 0;
Int32 nRet = SS_AppRequest_GetAppName(AppID, &nCmdType);
if (nRet < 0)
{
return;
}
TUChar AppPath[EOS_FILE_MAX_PATH] = {0};
if (SS_GetApplicationPath(AppID, SS_APP_PATH_TYPE_EXECUTABLE, AppPath) < 0)
{
return;
}
char szAppPath[EOS_FILE_MAX_PATH] = {0};
TUString::StrUnicodeToStrUtf8((Char*) szAppPath, AppPath);
#ifndef _TRANZDA_VM_
strcpy(s_szLogFilePath, "");
#else
strcpy(s_szLogFilePath, "D:/Work7");
#endif
strcat(s_szLogFilePath, szAppPath);
strcat(s_szLogFilePath, "Cocos2dxLog.txt");
}
char szBuf[MAX_LEN];
va_list ap;
va_start(ap, pszFormat);
#ifdef _TRANZDA_VM_
vsprintf_s(szBuf, MAX_LEN, pszFormat, ap);
#else
vsnprintf(szBuf, MAX_LEN, pszFormat, ap);
#endif
va_end(ap);
#ifdef _TRANZDA_VM_
WCHAR wszBuf[MAX_LEN] = {0};
MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf));
OutputDebugStringW(wszBuf);
OutputDebugStringA("\n");
#else
FILE * pf = fopen(s_szLogFilePath, "a+");
if (! pf)
{
return;
}
fwrite(szBuf, 1, strlen(szBuf), pf);
fwrite("\r\n", 1, strlen("\r\n"), pf);
fflush(pf);
fclose(pf);
#endif
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
TUChar tszMsg[MAX_LEN] = { 0 };
TUChar tszTitle[MAX_LEN] = { 0 };
TUString::StrUtf8ToStrUnicode(tszMsg,(Char*)pszMsg);
TUString::StrUtf8ToStrUnicode(tszTitle,(Char*)pszTitle);
TMessageBox box(tszMsg, tszTitle, WMB_OK);
box.Show();
}
NS_CC_END;
#endif // CC_PLATFORM_WOPHONE
/****************************************************
* ios
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// implement in CCCommon_iso.mm
#endif // CC_PLATFORM_IOS
/****************************************************
* android
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <android/log.h>
#include <stdio.h>
#include <jni.h>
#include "android/jni/MessageJni.h"
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN];
va_list args;
va_start(args, pszFormat);
vsprintf(buf, pszFormat, args);
va_end(args);
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", buf);
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
showMessageBoxJNI(pszMsg, pszTitle);
}
NS_CC_END;
#endif // CC_PLATFORM_ANDROID
/****************************************************
* linux
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include <stdio.h>
#include "CCStdC.h"
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN];
va_list args;
va_start(args, pszFormat);
vsprintf(buf, pszFormat, args);
va_end(args);
//TODO will copy how orx do
printf(buf);
}
// marmalade no MessageBox, use CCLog instead
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
CCLog("%s: %s", pszTitle, pszMsg);
}
NS_CC_END;
#endif
/****************************************************
* marmalade
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
#include <s3e.h>
#include "IwUtil.h"
#include "IwUtilInitTerm.h"
#include <IwMemBucketHelpers.h>
#include <stdio.h>
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN];
va_list args;
va_start(args, pszFormat);
vsprintf(buf, pszFormat, args);
va_end(args);
IwTrace(GAME, (buf));
}
// marmalade no MessageBox, use CCLog instead
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
CCLog("%s: %s", pszTitle, pszMsg);
}
NS_CC_END;
#endif // CC_PLATFORM_MARMALADE
/****************************************************
* bada
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include <FBaseSys.h>
#include <FUi.h>
#include <stdio.h>
#include <stdarg.h>
using namespace Osp::Ui::Controls;
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN] = {0};
va_list args;
va_start(args, pszFormat);
vsnprintf(buf, MAX_LEN, pszFormat, args);
va_end(args);
__App_info(__PRETTY_FUNCTION__ , __LINE__, buf);
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
if (pszMsg != NULL && pszTitle != NULL)
{
int iRet = 0;
MessageBox msgBox;
msgBox.Construct(pszTitle, pszMsg, MSGBOX_STYLE_OK);
msgBox.ShowAndWait(iRet);
}
}
NS_CC_END;
#endif // CC_PLATFORM_BADA
/****************************************************
* qnx
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include <cstdio>
#include <cstdarg>
#include <stdio.h>
#include <stdarg.h>
using namespace std;
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN];
va_list args;
va_start(args, pszFormat);
vsprintf(buf, pszFormat, args);
va_end(args);
fprintf(stderr, "cocos2d-x debug info [%s]\n", buf);
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
CCLog("%s: %s", pszTitle, pszMsg);
}
NS_CC_END;
#endif // CC_PLATFORM_QNX
| [
"diwwu@zynga.com"
] | diwwu@zynga.com |
2d9a3e185e3edc34cea89d8f9e74ebe432030a84 | 86f3b7e119705f5cdfe3921925e93c883f0b8445 | /BeatDetectionPlugin.h | 1c557288bd3f43e16d9c635c83062db683e2191a | [
"MIT"
] | permissive | m0r13/vamp-beat-detection | cb6ebb2dee5891b931fd70a1592f8e5fba799844 | 68f4c449248f883de5d3ff1541dd0fcaa3555c18 | refs/heads/master | 2020-07-21T19:16:08.457921 | 2016-11-15T18:56:00 | 2016-11-15T18:56:00 | 73,841,627 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,431 | h | #ifndef _BEAT_DETECTION_PLUGIN_H_
#define _BEAT_DETECTION_PLUGIN_H_
#include <vamp-sdk/Plugin.h>
using std::string;
class BeatDetectionPlugin : public Vamp::Plugin {
public:
BeatDetectionPlugin(float inputSampleRate);
virtual ~BeatDetectionPlugin();
string getIdentifier() const;
string getName() const;
string getDescription() const;
string getMaker() const;
int getPluginVersion() const;
string getCopyright() const;
InputDomain getInputDomain() const;
size_t getPreferredBlockSize() const;
size_t getPreferredStepSize() const;
size_t getMinChannelCount() const;
size_t getMaxChannelCount() const;
ParameterList getParameterDescriptors() const;
float getParameter(string identifier) const;
void setParameter(string identifier, float value);
/*
ProgramList getPrograms() const;
string getCurrentProgram() const;
void selectProgram(string name);
*/
OutputList getOutputDescriptors() const;
bool initialise(size_t channels, size_t stepSize, size_t blockSize);
void reset();
FeatureSet process(const float *const *inputBuffers,
Vamp::RealTime timestamp);
FeatureSet getRemainingFeatures();
protected:
float mInputSampleRate;
size_t mStepSize;
float mDownSampleCounter;
float mProcessEvery;
int mBeatCounter;
bool mBeatStatus;
Vamp::RealTime mBeatStart;
};
#endif
| [
"moritz.hilscher@gmail.com"
] | moritz.hilscher@gmail.com |
690b35d6c170e8efbfbf09d7f135fb59a238acca | c6b920f08a4615a7471d026005c2ecc3267ddd71 | /adapters/Lammps/src/Glue/LammpsNativeAtomPositionDefinition.cpp | 147fdcfdfe8b706f37685f774a42c5367f90d7fd | [] | no_license | etomica/legacy-api | bcbb285395f27aa9685f02cc7905ab75f87b017c | defcfb6650960bf6bf0a3e55cb5ffabb40d76d8b | refs/heads/master | 2021-01-20T14:07:57.547442 | 2010-04-22T21:19:19 | 2010-04-22T21:19:19 | 82,740,861 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,241 | cpp | /*
* LammpsNativeAtomPositionDefinition.cpp
* API Glue
*
*/
#include "IAPIMolecule.h"
#include "IAPIAtomList.h"
#include "IAPIVector.h"
#include "LammpsNativeAtomPositionDefinition.h"
#include "LammpsVector2D.h"
namespace lammpswrappers
{
LammpsNativeAtomPositionDefinition::LammpsNativeAtomPositionDefinition
(JNIEnv *jenv, jobject jobj, IAPISimulation *sim) {
mSim = dynamic_cast<LammpsSimulation *>(sim);
nativeObject = jenv->NewGlobalRef(jobj);
}
/*
* position()
*/
IAPIVector *LammpsNativeAtomPositionDefinition::position(IAPIMolecule *atom) {
printf("LammpsNativeAtomPositionDefinition::position() This method should NOT be called\n");
}
/*
* position()
*/
IAPIVector *LammpsNativeAtomPositionDefinition::position(jobject atom) {
JavaVM *jvm;
jint ret = JNI_GetCreatedJavaVMs(&jvm, 1, NULL);
JNIEnv *jenv;
(jvm)->AttachCurrentThread((void **)&jenv, NULL);
jclass conformationClass = (jenv)->GetObjectClass(nativeObject);
jmethodID positionMethod =
(jenv)->GetMethodID(conformationClass,
"position",
"(Letomica/api/IMolecule;)Letomica/api/IVector;");
jobject obj = (jenv)->CallObjectMethod(nativeObject, positionMethod, atom);
jclass pos = (jenv)->GetObjectClass(obj);
jmethodID xMethod =
(jenv)->GetMethodID(pos, "x", "(I)D");
IAPIVectorMutable *vec = mSim->getSpace()->makeVector();
if(mSim->getSpace()->getD() == 2) {
jdouble x_pos = (jenv)->CallDoubleMethod(obj, xMethod, 0);
jdouble y_pos = (jenv)->CallDoubleMethod(obj, xMethod, 1);
double position[] = {x_pos, y_pos};
vec->E(position);
}
else if(mSim->getSpace()->getD() == 3) {
jdouble x_pos = (jenv)->CallDoubleMethod(obj, xMethod, 0);
jdouble y_pos = (jenv)->CallDoubleMethod(obj, xMethod, 1);
jdouble z_pos = (jenv)->CallDoubleMethod(obj, xMethod, 2);
double pos[] = {x_pos, y_pos, z_pos};
vec->E(pos);
}
return vec;
}
}
| [
"rrassler@buffalo.edu"
] | rrassler@buffalo.edu |
324207603de7a838bab5c3e44901d3b41886a513 | 46bf6fc69231692b467f50eba2299db7f1784ace | /Proj/Attr/hfwidget_facade_attr.cpp | 691765fa0ef2908b1bb6df51739d9bdcca3df892 | [] | no_license | RabbitChenc/crasherror | 5080c6629659a04721e27a04a5100d982c264ff6 | 2b3c589f00e60fc32b0715d795d6ac5070126113 | refs/heads/master | 2022-09-17T13:19:21.198554 | 2020-06-03T09:03:28 | 2020-06-03T09:03:28 | 269,039,710 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,331 | cpp | #include "hfwidget_facade_attr.h"
#include <QtDebug>
#include "../hfsin_hungry.h"
PtrHungry &hungry1 = PtrHungry::getInstance();
QXmlStreamReader &xmlReader1 = hungry1.xmlReader;
HFWidgetFacadeAttrs::HFWidgetFacadeAttrs()
{
setWidgetAttri(attriWidget);
}
const tHFWidgetFacadeAttri*HFWidgetFacadeAttrs::getWidgetAttri()
{
return &attriWidget;
}
void HFWidgetFacadeAttrs::setWidgetAttri(tHFWidgetFacadeAttri &attr)
{
if(xmlReader1.attributes().hasAttribute("background")){
QString backcolor = xmlReader1.attributes().value("background").toString() ;
if(backcolor.startsWith("0x") || backcolor.startsWith("0X")){
attr.backgroundColor = backcolor.mid(2);
}else{
attr.backgroundColor = backcolor;
}
}
if(xmlReader1.attributes().hasAttribute("foreground")){
QString forecolor = xmlReader1.attributes().value("foreground").toString() ;
if(forecolor.startsWith("0x") || forecolor.startsWith("0X")){
attr.foregroundColor = forecolor.mid(2);
}else{
attr.foregroundColor = forecolor;
}
}
}
void HFWidgetFacadeAttrs::debugTest(tHFWidgetFacadeAttri &state)
{
qDebug() << "widget:"<<state.backgroundColor<< ";" <<state.foregroundColor<<endl;
}
HFWidgetFacadeAttrs::~HFWidgetFacadeAttrs()
{
}
| [
"357778342@qq.com"
] | 357778342@qq.com |
4c7c353e3587d5a3db4b89bc7dd9d991d985b52b | d93c9f0239e33fcb8ccc20ce999b094659003202 | /aero_srr_supervisor/include/aero_srr_supervisor/StateTable.h | 29d260f24b185fe4ae93435f1f38cc4f567abf74 | [] | no_license | Sprann9257/aero_srr_13 | 6657b5f464b3b43f11b8c8b4091b21660a7df910 | f378a11bc6de8b280262cb3de7d58eab95a4eee7 | refs/heads/master | 2021-05-27T19:23:10.092640 | 2013-06-06T17:15:20 | 2013-06-06T17:15:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,855 | h | /**
* @file StateTable.h
*
* @date May 2, 2013
* @author parallels
* @brief \TODO
*/
#ifndef STATETABLE_H_
#define STATETABLE_H_
//*********** SYSTEM DEPENDANCIES ****************//
#include<boost/unordered_map.hpp>
#include<boost/foreach.hpp>
//************ LOCAL DEPENDANCIES ****************//
#include <aero_srr_supervisor/SupervisorUtilities.h>
//*********** NAMESPACES ****************//
namespace as = aero_srr_supervisor;
namespace aero_srr_supervisor
{
/**
* @author Adam Panzica
* @brief Simple class for maintaining a state transition table
*/
class StateTable
{
private:
typedef uint8_t state_t;
typedef std::vector<state_t> svec_t;
typedef boost::unordered_map<state_t, svec_t> tmap_t;
typedef boost::unordered_map<state_t, std::string> smap_t;
tmap_t transition_map_; ///Map of all valid state transitions
smap_t state_representations_; ///Map of states to string representations
public:
/**
* @author Adam Panzica
* @brief Adds a string representation of a state, useful for debugging
* @param [in] state The state we're creating a representation of
* @param [in] representation The string we want to represent the state
*/
void addStateStringRepresentation(const state_t state, const std::string& representation);
/**
* @author Adam Panzica
* @brief Adds a new valid state transition to the state table
* @param [in] from_state The state being transitioned out of
* @param [in] to_state The state being transitioned into
* @param [in] reversible If opposite transition (to_state -> from_state) should also be created. Defaults to false
*/
void addTranstion(const state_t from_state, const state_t to_state, const bool reversible = false);
/**
* @author Adam Panzica
* @brief Checks if a transition between to states is valid
* @param [in] from_state The state being transitioned out of
* @param [in] to_state The state being transitioned into
* @return True if the transition is valid, else false
*/
bool isValidTransition(const state_t from_state, const state_t to_state) const;
/**
* @author Adam Panzica
* @param [in] for_state The state to get the transition list for
* @param [out] transition_list A vector to fill with the transition list
* @return True if the state existed in the StateTable, else false
*/
bool getTransitionList(const state_t for_state, std::vector<state_t>& transition_list) const;
/**
* @author Adam Panzica
* @param [in] state the state to convert to string
* @param [out] string The string to write it to
*
* This method will fill the output string with the string representation of the state if one exists, otherwise it will be the numeric equivalent of the given state enum
*/
void stateToString(const state_t state, std::string& string) const;
};
}
#endif /* STATETABLE_H_ */
| [
"adampanzica@gmail.com"
] | adampanzica@gmail.com |
750a5bca2982fa6d23a05fe6d603366b43bdbe6a | 27a2bcbe3757071a0e1174f849e487dc9f315294 | /minisql/storage/record/RecordFile.h | daab26ed1d38868db885ea7ee89d7944f7be3fdf | [] | no_license | bluealert/MiniSQL | 3b6873896fe1a17c1e681d6f5be2efc98e6cd92c | 7195c6aa2c300601ad284e04c273e4f083680c63 | refs/heads/master | 2020-03-09T20:52:56.137690 | 2019-06-07T06:48:27 | 2019-06-07T06:48:27 | 128,995,731 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,065 | h | #pragma once
#include <storage/record/RID.h>
#include <storage/record/RecordPage.h>
#include <string>
namespace minisql {
namespace storage {
namespace tx {
class Transaction;
}
namespace record {
class TableInfo;
class RecordFile {
public:
RecordFile(const std::shared_ptr<TableInfo> &ti, tx::Transaction &tx);
virtual ~RecordFile();
void beforeFirst();
bool next();
int32_t getInt32(const std::string &fldName) const;
std::string getString(const std::string &fldName) const;
void insert();
void setInt32(const std::string &fldName, int32_t val);
void setString(const std::string &fldName, const std::string &val);
void del();
void close();
std::unique_ptr<RID> currentRid() const;
void moveToRid(const RID &rid);
private:
void moveToBlock(int32_t b);
bool atLastBlock();
void appendBlock();
private:
std::shared_ptr<TableInfo> ti_;
tx::Transaction &tx_;
int32_t currBlkNum_;
std::string fileName_;
std::unique_ptr<RecordPage> rp_;
};
} // namespace record
} // namespace storage
} // namespace minisql | [
"tao.zhou2009@gmail.com"
] | tao.zhou2009@gmail.com |
e375f6af0c89fd7e42b0c682f5c51fe6bd95fb7f | c7506dcd5b5eb0a47eea30a939cc5fd042c44a8b | /x.cpp | 34781c24a0375e70f64eb8db05dd7855fcaff501 | [] | no_license | blocklimemal/test | 0521a9496fce05f435bfd563b75a2efa8d7d3cff | 9550cbcf1cfbe6e7f4148484a29ad6d1a3b5339d | refs/heads/master | 2022-12-01T03:19:05.001559 | 2020-08-19T08:57:39 | 2020-08-19T08:57:39 | 288,655,410 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6 | cpp | dnsdj
| [
"deven.sharma@siemens.com"
] | deven.sharma@siemens.com |
f9cef69bf5f6ee30822b9a3bb3960e759b7560f3 | 61f861b29683ff9e979a4719611aef9b3b029bf1 | /kakui/kakui/net/SocketsOps.h | b9285482a9fad337d16c4d7ecf81872520c9eae6 | [] | no_license | kakitgogogo/Bauble | 001c1a09562852a7ad8547fc14374c068826165a | ecc1d0dab96e1335e194c45cf1af178cac79d1bc | refs/heads/master | 2020-05-21T08:54:04.981182 | 2017-08-26T04:22:24 | 2017-08-26T04:22:24 | 69,658,608 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,155 | h | #pragma once
#include <arpa/inet.h>
#include <endian.h>
namespace kakui
{
namespace sockets
{
inline uint64_t hostToNetwork64(uint64_t host64)
{
return htobe64(host64);
}
inline uint32_t hostToNetwork32(uint32_t host32)
{
return htonl(host32);
}
inline uint16_t hostToNetwork16(uint16_t host16)
{
return htons(host16);
}
inline uint64_t networkToHost64(uint64_t net64)
{
return be64toh(net64);
}
inline uint32_t networkToHost32(uint32_t net32)
{
return ntohl(net32);
}
inline uint16_t networkToHost16(uint16_t net16)
{
return ntohs(net16);
}
int createNonblockingOrDie();
int connect(int sockfd, const struct sockaddr_in& addr);
void bindOrDie(int sockfd, const struct sockaddr_in& addr);
void listenOrDie(int sockfd);
int accept(int sockfd, struct sockaddr_in* addr);
void close(int sockfd);
void shutdownWrite(int sockfd);
void toHostPort(char* buf, size_t size, const struct sockaddr_in& addr);
void fromHostPort(const char* ip, uint16_t port, struct sockaddr_in* addr);
struct sockaddr_in getLocalAddr(int sockfd);
struct sockaddr_in getPeerAddr(int sockfd);
int getSocketError(int sockfd);
bool isSelfConnect(int sockfd);
}
} | [
"707828130@qq.com"
] | 707828130@qq.com |
d5361d5fe77876646583cb88d78dd5b41edfb086 | b1aa3bfe1732d75fdd2adb0abe7051384015e3d1 | /apps/c/CloverLeaf_3D_HDF5/MPI_OpenMP/update_halo_kernel5_plus_4_b_omp_kernel.cpp | 975cfdd4a307bc48ed12d347a18c47f2e2f2bda5 | [] | no_license | lipk/OPS | 56a04e863a6e32ed250e74047adc9ec083b850ca | 33d2801dd898abe031cba5b9aaae1d0d2c8ce9ad | refs/heads/master | 2021-01-22T23:48:42.671026 | 2017-03-17T09:09:20 | 2017-03-17T09:09:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,496 | cpp | //
// auto-generated by ops.py
//
#ifdef _OPENMP
#include <omp.h>
#endif
// user function
inline void update_halo_kernel5_plus_4_b(double *vol_flux_z,
double *mass_flux_z,
const int *fields) {
if (fields[FIELD_VOL_FLUX_Z] == 1)
vol_flux_z[OPS_ACC0(0, 0, 0)] = vol_flux_z[OPS_ACC0(0, -4, 0)];
if (fields[FIELD_MASS_FLUX_Z] == 1)
mass_flux_z[OPS_ACC1(0, 0, 0)] = mass_flux_z[OPS_ACC1(0, -4, 0)];
}
// host stub function
void ops_par_loop_update_halo_kernel5_plus_4_b(char const *name,
ops_block block, int dim,
int *range, ops_arg arg0,
ops_arg arg1, ops_arg arg2) {
// Timing
double t1, t2, c1, c2;
int offs[3][3];
ops_arg args[3] = {arg0, arg1, arg2};
#ifdef CHECKPOINTING
if (!ops_checkpointing_before(args, 3, range, 130))
return;
#endif
if (OPS_diags > 1) {
ops_timing_realloc(130, "update_halo_kernel5_plus_4_b");
OPS_kernels[130].count++;
ops_timers_core(&c1, &t1);
}
// compute locally allocated range for the sub-block
int start[3];
int end[3];
#ifdef OPS_MPI
sub_block_list sb = OPS_sub_block_list[block->index];
if (!sb->owned)
return;
for (int n = 0; n < 3; n++) {
start[n] = sb->decomp_disp[n];
end[n] = sb->decomp_disp[n] + sb->decomp_size[n];
if (start[n] >= range[2 * n]) {
start[n] = 0;
} else {
start[n] = range[2 * n] - start[n];
}
if (sb->id_m[n] == MPI_PROC_NULL && range[2 * n] < 0)
start[n] = range[2 * n];
if (end[n] >= range[2 * n + 1]) {
end[n] = range[2 * n + 1] - sb->decomp_disp[n];
} else {
end[n] = sb->decomp_size[n];
}
if (sb->id_p[n] == MPI_PROC_NULL &&
(range[2 * n + 1] > sb->decomp_disp[n] + sb->decomp_size[n]))
end[n] += (range[2 * n + 1] - sb->decomp_disp[n] - sb->decomp_size[n]);
}
#else
for (int n = 0; n < 3; n++) {
start[n] = range[2 * n];
end[n] = range[2 * n + 1];
}
#endif
#ifdef OPS_DEBUG
ops_register_args(args, "update_halo_kernel5_plus_4_b");
#endif
offs[0][0] = args[0].stencil->stride[0] * 1; // unit step in x dimension
offs[0][1] =
off3D(1, &start[0], &end[0], args[0].dat->size, args[0].stencil->stride) -
offs[0][0];
offs[0][2] =
off3D(2, &start[0], &end[0], args[0].dat->size, args[0].stencil->stride) -
offs[0][1] - offs[0][0];
offs[1][0] = args[1].stencil->stride[0] * 1; // unit step in x dimension
offs[1][1] =
off3D(1, &start[0], &end[0], args[1].dat->size, args[1].stencil->stride) -
offs[1][0];
offs[1][2] =
off3D(2, &start[0], &end[0], args[1].dat->size, args[1].stencil->stride) -
offs[1][1] - offs[1][0];
int off0_0 = offs[0][0];
int off0_1 = offs[0][1];
int off0_2 = offs[0][2];
int dat0 = args[0].dat->elem_size;
int off1_0 = offs[1][0];
int off1_1 = offs[1][1];
int off1_2 = offs[1][2];
int dat1 = args[1].dat->elem_size;
// Halo Exchanges
ops_H_D_exchanges_host(args, 3);
ops_halo_exchanges(args, 3, range);
ops_H_D_exchanges_host(args, 3);
#ifdef _OPENMP
int nthreads = omp_get_max_threads();
#else
int nthreads = 1;
#endif
xdim0 = args[0].dat->size[0];
ydim0 = args[0].dat->size[1];
xdim1 = args[1].dat->size[0];
ydim1 = args[1].dat->size[1];
if (OPS_diags > 1) {
ops_timers_core(&c2, &t2);
OPS_kernels[130].mpi_time += t2 - t1;
}
#pragma omp parallel for
for (int thr = 0; thr < nthreads; thr++) {
int z_size = end[2] - start[2];
char *p_a[3];
int start_i = start[2] + ((z_size - 1) / nthreads + 1) * thr;
int finish_i =
start[2] + MIN(((z_size - 1) / nthreads + 1) * (thr + 1), z_size);
// get address per thread
int start0 = start[0];
int start1 = start[1];
int start2 = start_i;
// set up initial pointers
int d_m[OPS_MAX_DIM];
#ifdef OPS_MPI
for (int d = 0; d < dim; d++)
d_m[d] =
args[0].dat->d_m[d] + OPS_sub_dat_list[args[0].dat->index]->d_im[d];
#else
for (int d = 0; d < dim; d++)
d_m[d] = args[0].dat->d_m[d];
#endif
int base0 = dat0 * 1 * (start0 * args[0].stencil->stride[0] -
args[0].dat->base[0] - d_m[0]);
base0 = base0 +
dat0 * args[0].dat->size[0] * (start1 * args[0].stencil->stride[1] -
args[0].dat->base[1] - d_m[1]);
base0 = base0 +
dat0 * args[0].dat->size[0] * args[0].dat->size[1] *
(start2 * args[0].stencil->stride[2] - args[0].dat->base[2] -
d_m[2]);
p_a[0] = (char *)args[0].data + base0;
#ifdef OPS_MPI
for (int d = 0; d < dim; d++)
d_m[d] =
args[1].dat->d_m[d] + OPS_sub_dat_list[args[1].dat->index]->d_im[d];
#else
for (int d = 0; d < dim; d++)
d_m[d] = args[1].dat->d_m[d];
#endif
int base1 = dat1 * 1 * (start0 * args[1].stencil->stride[0] -
args[1].dat->base[0] - d_m[0]);
base1 = base1 +
dat1 * args[1].dat->size[0] * (start1 * args[1].stencil->stride[1] -
args[1].dat->base[1] - d_m[1]);
base1 = base1 +
dat1 * args[1].dat->size[0] * args[1].dat->size[1] *
(start2 * args[1].stencil->stride[2] - args[1].dat->base[2] -
d_m[2]);
p_a[1] = (char *)args[1].data + base1;
p_a[2] = (char *)args[2].data;
for (int n_z = start_i; n_z < finish_i; n_z++) {
for (int n_y = start[1]; n_y < end[1]; n_y++) {
for (int n_x = start[0];
n_x < start[0] + (end[0] - start[0]) / SIMD_VEC; n_x++) {
// call kernel function, passing in pointers to data -vectorised
#pragma simd
for (int i = 0; i < SIMD_VEC; i++) {
update_halo_kernel5_plus_4_b((double *)p_a[0] + i * 1 * 1,
(double *)p_a[1] + i * 1 * 1,
(int *)p_a[2]);
}
// shift pointers to data x direction
p_a[0] = p_a[0] + (dat0 * off0_0) * SIMD_VEC;
p_a[1] = p_a[1] + (dat1 * off1_0) * SIMD_VEC;
}
for (int n_x = start[0] + ((end[0] - start[0]) / SIMD_VEC) * SIMD_VEC;
n_x < end[0]; n_x++) {
// call kernel function, passing in pointers to data - remainder
update_halo_kernel5_plus_4_b((double *)p_a[0], (double *)p_a[1],
(int *)p_a[2]);
// shift pointers to data x direction
p_a[0] = p_a[0] + (dat0 * off0_0);
p_a[1] = p_a[1] + (dat1 * off1_0);
}
// shift pointers to data y direction
p_a[0] = p_a[0] + (dat0 * off0_1);
p_a[1] = p_a[1] + (dat1 * off1_1);
}
// shift pointers to data z direction
p_a[0] = p_a[0] + (dat0 * off0_2);
p_a[1] = p_a[1] + (dat1 * off1_2);
}
}
if (OPS_diags > 1) {
ops_timers_core(&c1, &t1);
OPS_kernels[130].time += t1 - t2;
}
ops_set_dirtybit_host(args, 3);
ops_set_halo_dirtybit3(&args[0], range);
ops_set_halo_dirtybit3(&args[1], range);
if (OPS_diags > 1) {
// Update kernel record
ops_timers_core(&c2, &t2);
OPS_kernels[130].mpi_time += t2 - t1;
OPS_kernels[130].transfer += ops_compute_transfer(dim, start, end, &arg0);
OPS_kernels[130].transfer += ops_compute_transfer(dim, start, end, &arg1);
}
}
| [
"mudalige@octon.arc.ox.ac.uk"
] | mudalige@octon.arc.ox.ac.uk |
67445f330f384106d48e30491d77589367d534b0 | 3d4d930bafe20349d7cc9f084a803800204380fb | /THE_DEV_GAME/PROYECT/THE DEV GAME/THE DEV GAME/TextureManager.cpp | 2607088a7e50653ce620e457b8b63a69d0527c5b | [] | no_license | HafWalker/TheDevGame | e93b66fc72bdab4ae68de499bb05e1e8b709563a | 424b056b40ba5fd26cf4a4f427b3c885d1014f2a | refs/heads/master | 2023-08-05T11:53:29.174662 | 2021-09-24T13:42:06 | 2021-09-24T13:42:06 | 388,254,825 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 472 | cpp | #include "stdafx.h"
#include "TextureManager.h"
sf::RenderWindow* window = nullptr;
void TextureManager::SetRenderTarget(sf::RenderWindow* win) {
window = win;
}
sf::Texture* TextureManager::LoadTexture(const char* fileName) {
sf::Texture* texture = new sf::Texture();
if (texture->loadFromFile(fileName)) {
return texture;
}
else {
return nullptr;
}
}
void TextureManager::Draw(sf::Sprite& sprite) {
window->draw(sprite);
} | [
"hernan.angel.ferrari@gmail.com"
] | hernan.angel.ferrari@gmail.com |
9bc2c7fbcfd48acdb3831d29e9e45bc1b4c4f5b8 | 76926ce6279623fa5ecec91b6d45c1fadc43ff27 | /tests/ut_spreadsheet/ut_spreadsheet.cpp | c49417de5b964a3b5c723a62fbfe233c3e13b0f8 | [] | no_license | hallarempt/office-tools | 166508afc45a8070c18dec503c703502b897742c | 1457f7fee87d0139a25dccf274785ba7422e4e26 | refs/heads/master | 2021-05-29T01:16:43.124994 | 2015-07-06T07:51:22 | 2015-07-06T07:51:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,010 | cpp | #include "ut_spreadsheet.h"
#define private public
#include <officeviewerspreadsheet.h>
#undef private
#include <actionpool.h>
#include <definitions.h>
#include <mapplication.h>
const QString testDocuments = "/usr/share/office-tools-tests/data/spreadsheet.ods";
Ut_SpreadSheet::Ut_SpreadSheet()
{
spreadsheet = new OfficeViewerSpreadsheet;
spreadsheet->loadDocument(testDocuments, 0);
}
Ut_SpreadSheet::~Ut_SpreadSheet()
{
delete spreadsheet;
spreadsheet = 0;
}
void Ut_SpreadSheet::testCreation()
{
QVERIFY(spreadsheet);
}
void Ut_SpreadSheet::testCreateContent()
{
bool created = spreadsheet->createKoWidget();
QVERIFY(created);
}
void Ut_SpreadSheet::testPreview()
{
//QList <QImage *>thumbnailList = spreadsheet->getPreviews();
//QVERIFY(thumbnailList != 0);
}
void Ut_SpreadSheet::testSearch()
{
//spreadsheet->startSearch("sheet");
}
void Ut_SpreadSheet::testFixedIndicators()
{
bool created = spreadsheet->createKoWidget();
QVERIFY(created);
ActionPool::instance()->getAction(ActionPool::SpreadSheetFixedIndicators)->trigger();
}
void Ut_SpreadSheet::testFloatingIndicators()
{
bool created = spreadsheet->createKoWidget();
QVERIFY(created);
ActionPool::instance()->getAction(ActionPool::SpreadSheetFloatingIndicators)->trigger();
}
void Ut_SpreadSheet::testNoIndicators()
{
bool created = spreadsheet->createKoWidget();
QVERIFY(created);
ActionPool::instance()->getAction(ActionPool::SpreadSheetNoIndicators)->trigger();
}
void Ut_SpreadSheet::testSearchText()
{
bool created = spreadsheet->createKoWidget();
QVERIFY(created);
spreadsheet->startSearch("searchstring");
QTest::qWait(1000);
spreadsheet->nextWord();
spreadsheet->previousWord();
QVERIFY(spreadsheet->searchResults.count());
QCOMPARE(spreadsheet->searchResults.at(0).count, 2);
}
int main(int argc, char* argv[])
{
MApplication app(argc, argv);
Ut_SpreadSheet test;
QTest::qExec(&test, argc, argv);
}
| [
"boud@valdyas.org"
] | boud@valdyas.org |
fcd714e19ee8b75a62dda65cab11950eb015a4ec | b6e8a1fa1085a52d7ba6ed6b6f11dbd82905f3ba | /source/windows/brwindowsversion.cpp | b00a40a4e15fd767fd10fd12f53fbc64122acab7 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"Zlib"
] | permissive | etsangsplk/burgerlib | ed4039b175ec96fe28c0ccd52d19f5715fbeccc9 | bec821be1ba1d7fbe08e3b128b086158d3bb1b21 | refs/heads/master | 2022-04-03T20:56:46.598519 | 2020-02-24T09:25:15 | 2020-02-24T09:25:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,483 | cpp | /***************************************
Shims for version.dll
Copyright (c) 1995-2017 by Rebecca Ann Heineman <becky@burgerbecky.com>
It is released under an MIT Open Source license. Please see LICENSE for
license details. Yes, you can use it in a commercial title without paying
anything, just give me a credit.
Please? It's not like I'm asking you for money!
***************************************/
#include "brwindowstypes.h"
#if defined(BURGER_WINDOWS) || defined(DOXYGEN)
#if !defined(DOXYGEN)
//
// Handle some annoying defines that some windows SDKs may or may not have
//
#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
#endif
#if !defined(_WIN32_WINNT)
#define _WIN32_WINNT 0x0501 // Windows XP
#endif
#include <Windows.h>
#include <WinVer.h>
typedef BOOL(APIENTRY* VerQueryValueAPtr)(
LPCVOID pBlock, LPCSTR lpSubBlock, LPVOID* lplpBuffer, PUINT puLen);
typedef BOOL(APIENTRY* VerQueryValueWPtr)(
LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID* lplpBuffer, PUINT puLen);
typedef BOOL(APIENTRY* GetFileVersionInfoAPtr)(
LPCSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData);
typedef BOOL(APIENTRY* GetFileVersionInfoWPtr)(
LPCWSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData);
typedef DWORD(APIENTRY* GetFileVersionInfoSizeAPtr)(
LPCSTR lptstrFilename, LPDWORD lpdwHandle);
typedef DWORD(APIENTRY* GetFileVersionInfoSizeWPtr)(
LPCWSTR lptstrFilename, LPDWORD lpdwHandle);
// Unit tests for pointers
// While these tests fail on Codewarrior, it's okay because it's only a
// difference in const.
// VerQueryValueAPtr gVerQueryValueA = ::VerQueryValueA;
// VerQueryValueWPtr gVerQueryValueW = ::VerQueryValueW;
// GetFileVersionInfoAPtr gGetFileVersionInfoA = ::GetFileVersionInfoA;
// GetFileVersionInfoWPtr gGetFileVersionInfoW = ::GetFileVersionInfoW;
// GetFileVersionInfoSizeAPtr gGetFileVersionInfoSizeA =
// ::GetFileVersionInfoSizeA;
// GetFileVersionInfoSizeWPtr gGetFileVersionInfoSizeW =
// ::GetFileVersionInfoSizeW;
#endif
//
// version.dll
//
/*! ************************************
\brief Load in version.dll and call VerQueryValueA
Manually load version.dll if needed and call the Windows function
VerQueryValueA()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647464(v=vs.85).aspx
\windowsonly
\param pBlock The version-information resource returned by the
GetFileVersionInfo function. \param pSubBlock A pointer to the
version-information value to be retrieved.
\param ppBuffer A pointer that contains the address of a pointer to the
requested version information in the buffer pointed to by pBlock.
\param pLen The size of the buffer pointed to by lplpBuffer, in bytes.
\return Returns \ref TRUE if successful, or \ref FALSE otherwise.
***************************************/
Word BURGER_API Burger::Windows::VerQueryValueA(
const void* pBlock, const char* pSubBlock, void** ppBuffer, Word* pLen)
{
void* pVerQueryValueA = LoadFunctionIndex(CALL_VerQueryValueA);
BOOL uResult = FALSE; // Failure
if (pVerQueryValueA) {
uResult = static_cast<VerQueryValueAPtr>(pVerQueryValueA)(
pBlock, pSubBlock, ppBuffer, pLen);
}
return static_cast<Word>(uResult);
}
/*! ************************************
\brief Load in version.dll and call VerQueryValueW
Manually load version.dll if needed and call the Windows function
VerQueryValueW()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647464(v=vs.85).aspx
\windowsonly
\param pBlock The version-information resource returned by the
GetFileVersionInfo function.
\param pSubBlock A pointer to the version-information value to be retrieved.
\param ppBuffer A pointer that contains the address of a pointer to the
requested version information in the buffer pointed to by pBlock.
\param pLen The size of the buffer pointed to by lplpBuffer, in bytes.
\return Returns \ref TRUE if successful, or \ref FALSE otherwise.
***************************************/
Word BURGER_API Burger::Windows::VerQueryValueW(
const void* pBlock, const Word16* pSubBlock, void** ppBuffer, Word* pLen)
{
void* pVerQueryValueW = LoadFunctionIndex(CALL_VerQueryValueW);
BOOL uResult = FALSE; // Failure
if (pVerQueryValueW) {
uResult = static_cast<VerQueryValueWPtr>(pVerQueryValueW)(
pBlock, reinterpret_cast<LPCWSTR>(pSubBlock), ppBuffer, pLen);
}
return static_cast<Word>(uResult);
}
/*! ************************************
\brief Load in version.dll and call GetFileVersionInfoA
Manually load version.dll if needed and call the Windows function
GetFileVersionInfoA()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647003(v=vs.85).aspx
\windowsonly
\param ptstrFilename The name of the file
\param dwHandle This parameter is ignored.
\param dwLen The size, in bytes, of the buffer pointed to by the lpData
parameter.
\param pData Pointer to a buffer that receives the file-version information.
\return Returns \ref TRUE if successful, or \ref FALSE otherwise.
***************************************/
Word BURGER_API Burger::Windows::GetFileVersionInfoA(
const char* ptstrFilename, Word32 dwHandle, Word32 dwLen, void* pData)
{
void* pGetFileVersionInfoA = LoadFunctionIndex(CALL_GetFileVersionInfoA);
BOOL uResult = FALSE; // Failure
if (pGetFileVersionInfoA) {
uResult = static_cast<GetFileVersionInfoAPtr>(pGetFileVersionInfoA)(
ptstrFilename, dwHandle, dwLen, pData);
}
return static_cast<Word>(uResult);
}
/*! ************************************
\brief Load in version.dll and call GetFileVersionInfoW
Manually load version.dll if needed and call the Windows function
GetFileVersionInfoW()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647003(v=vs.85).aspx
\windowsonly
\param ptstrFilename The name of the file
\param dwHandle This parameter is ignored.
\param dwLen The size, in bytes, of the buffer pointed to by the lpData
parameter.
\param pData Pointer to a buffer that receives the file-version information.
\return Returns \ref TRUE if successful, or \ref FALSE otherwise.
***************************************/
Word BURGER_API Burger::Windows::GetFileVersionInfoW(
const Word16* ptstrFilename, Word32 dwHandle, Word32 dwLen, void* pData)
{
void* pGetFileVersionInfoW = LoadFunctionIndex(CALL_GetFileVersionInfoW);
BOOL uResult = FALSE; // Failure
if (pGetFileVersionInfoW) {
uResult = static_cast<GetFileVersionInfoWPtr>(pGetFileVersionInfoW)(
reinterpret_cast<LPCWSTR>(ptstrFilename), dwHandle, dwLen, pData);
}
return static_cast<Word>(uResult);
}
/*! ************************************
\brief Load in version.dll and call GetFileVersionInfoA
Manually load version.dll if needed and call the Windows function
GetFileVersionInfoA()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647005(v=vs.85).aspx
\windowsonly
\param ptstrFilename The name of the file of interest.
\param pdwHandle A pointer to a variable that the function sets to zero.
\return Returns the number of bytes if successful, or zero otherwise.
***************************************/
Word32 BURGER_API Burger::Windows::GetFileVersionInfoSizeA(
const char* ptstrFilename, unsigned long* pdwHandle)
{
void* pGetFileVersionInfoSizeA =
LoadFunctionIndex(CALL_GetFileVersionInfoSizeA);
Word uResult = 0; // Failure
if (pGetFileVersionInfoSizeA) {
uResult = static_cast<GetFileVersionInfoSizeAPtr>(
pGetFileVersionInfoSizeA)(ptstrFilename, pdwHandle);
}
return uResult;
}
/*! ************************************
\brief Load in version.dll and call GetFileVersionInfoSizeW
Manually load version.dll if needed and call the Windows function
GetFileVersionInfoSizeW()
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647005(v=vs.85).aspx
\windowsonly
\param ptstrFilename The name of the file of interest.
\param pdwHandle A pointer to a variable that the function sets to zero.
\return Returns the number of bytes if successful, or zero otherwise.
***************************************/
Word32 BURGER_API Burger::Windows::GetFileVersionInfoSizeW(
const Word16* ptstrFilename, unsigned long* pdwHandle)
{
void* pGetFileVersionInfoSizeW =
LoadFunctionIndex(CALL_GetFileVersionInfoSizeW);
Word uResult = 0; // Failure
if (pGetFileVersionInfoSizeW) {
uResult =
static_cast<GetFileVersionInfoSizeWPtr>(pGetFileVersionInfoSizeW)(
reinterpret_cast<LPCWSTR>(ptstrFilename), pdwHandle);
}
return uResult;
}
#endif
| [
"becky@burgerbecky.com"
] | becky@burgerbecky.com |
d043e62354f9d5959cc5f05105052a5553738991 | e050f7477be615e3a0a3add741dc547a99f7b85a | /1099-Consecutive_Odd_Numbers_II/main.cpp | c1c59614addf209edb88f4788d4ca906fa8b52a4 | [] | no_license | NateJ892/OnlineJudge | 1c1cc3742bcd3701190a3e79772ad7900916e665 | f6cfb6da1b82d26d05c45a3d1e80ea4b28007a59 | refs/heads/master | 2023-03-10T20:58:44.361634 | 2021-02-26T18:35:15 | 2021-02-26T18:35:15 | 333,303,062 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 345 | cpp | #include <iostream>
int main(void)
{
int n;
std::cin >> n;
for (int i = 0; i < n; i++)
{
int x, y, s, t, b;
std::cin >> x >> y;
if (x > y)
{
t = y;
b = x;
}
else
{
t = x;
b = y;
}
for (int a = t+1; a < b; a++)
{
if(a%2 != 0) s += a;
}
std::cout << s << std::endl;
x=y=s=t=b=0;
}
return 0;
}
| [
"natej892@gmail.com"
] | natej892@gmail.com |
7497d8640e97e43364ae39082a317ac2d0bd7896 | 83bacfbdb7ad17cbc2fc897b3460de1a6726a3b1 | /node/src/signal_wrap.cc | 582d1a9ecfdc026d38e0ce0ef9703b727a28efa5 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"ISC",
"BSD-2-Clause",
"LicenseRef-scancode-openssl",
"ICU",
"LicenseRef-scancode-unknown-license-reference",
"NAIST-2003",
"NTP",
"LicenseRef-scancode-unicode",
"Zlib",
"Artistic-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | cool2528/miniblink49 | d909e39012f2c5d8ab658dc2a8b314ad0050d8ea | 7f646289d8074f098cf1244adc87b95e34ab87a8 | refs/heads/master | 2020-06-05T03:18:43.211372 | 2019-06-01T08:57:37 | 2019-06-01T08:59:56 | 192,294,645 | 2 | 0 | Apache-2.0 | 2019-06-17T07:16:28 | 2019-06-17T07:16:27 | null | UTF-8 | C++ | false | false | 3,342 | cc | #include "async-wrap.h"
#include "async-wrap-inl.h"
#include "env.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "util.h"
#include "util-inl.h"
#include "v8.h"
namespace node {
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Object;
using v8::Value;
class SignalWrap : public HandleWrap {
public:
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
constructor->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Signal"));
env->SetProtoMethod(constructor, "close", HandleWrap::Close);
env->SetProtoMethod(constructor, "ref", HandleWrap::Ref);
env->SetProtoMethod(constructor, "unref", HandleWrap::Unref);
env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);
env->SetProtoMethod(constructor, "start", Start);
env->SetProtoMethod(constructor, "stop", Stop);
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "Signal"),
constructor->GetFunction());
}
size_t self_size() const override { return sizeof(*this); }
private:
static void New(const FunctionCallbackInfo<Value>& args) {
// This constructor should not be exposed to public javascript.
// Therefore we assert that we are not trying to call this as a
// normal function.
CHECK(args.IsConstructCall());
Environment* env = Environment::GetCurrent(args);
new SignalWrap(env, args.This());
}
SignalWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
AsyncWrap::PROVIDER_SIGNALWRAP) {
int r = uv_signal_init(env->event_loop(), &handle_);
CHECK_EQ(r, 0);
}
static void Start(const FunctionCallbackInfo<Value>& args) {
SignalWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
int signum = args[0]->Int32Value();
#if defined(__POSIX__) && HAVE_INSPECTOR
if (signum == SIGPROF) {
Environment* env = Environment::GetCurrent(args);
if (env->inspector_agent()->IsStarted()) {
fprintf(stderr, "process.on(SIGPROF) is reserved while debugging\n");
return;
}
}
#endif
int err = uv_signal_start(&wrap->handle_, OnSignal, signum);
args.GetReturnValue().Set(err);
}
static void Stop(const FunctionCallbackInfo<Value>& args) {
SignalWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
int err = uv_signal_stop(&wrap->handle_);
args.GetReturnValue().Set(err);
}
static void OnSignal(uv_signal_t* handle, int signum) {
SignalWrap* wrap = ContainerOf(&SignalWrap::handle_, handle);
Environment* env = wrap->env();
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
Local<Value> arg = Integer::New(env->isolate(), signum);
wrap->MakeCallback(env->onsignal_string(), 1, &arg);
}
uv_signal_t handle_;
};
} // namespace node
NODE_MODULE_CONTEXT_AWARE_BUILTIN(signal_wrap, node::SignalWrap::Initialize)
| [
"22249030@qq.com"
] | 22249030@qq.com |
a7d39a334f1adbf329883594347d04f81c841a78 | 8c314a99c6429a4f31099380394b0daa8b07e898 | /src/pro/Juego/ej_modulos/Menus/InicioJuego.cpp | 251a12156cbd02569594b1652f6045ff9e3d0e32 | [] | no_license | raquelgg00/TheFirstForm | 40479e83483eb6915429ad5ac064d88e6e02b8f4 | d09f264414e882c5f81e210a5e814468ea0e2690 | refs/heads/main | 2023-07-01T06:39:24.774878 | 2021-07-19T18:53:28 | 2021-07-19T18:53:28 | 384,072,042 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,880 | cpp | #include "InicioJuego.h"
// Singleton
InicioJuego* InicioJuego::pinstance = 0;
InicioJuego* InicioJuego::Instance(){
if(pinstance == 0){
pinstance = new InicioJuego;
}
return pinstance;
}
// Constructor
InicioJuego::InicioJuego(){
motor = Motor::Instance();
texto_sprite = new Sprite();
if(motor->getTamHeight()==720)
texto_sprite->setTexture("Inicio1","png");
else
texto_sprite->setTexture("Inicio2","png");
texto_sprite->setOrigin(texto_sprite->getBounds("global").width/2.f, texto_sprite->getBounds("global").height/2.f);
texto_sprite->setPosition(motor->getTamWidth()/2.f ,motor->getTamHeight()*0.75);
sprite = new Sprite();
sprite->setTexture("CaratulaGrande","png");
fondoTransicion = new Sprite();
fondoTransicion->setTexture("fondoNegro","png");
if(motor->getTamHeight()==720){
fondoTransicion->setScale(0.67,0.67);
sprite->setScale(0.67,0.67);
}
aumentando_tamanio = true;
alpha = 255;
motor->getSonidoInicio()->Play();
}
// Destructor
InicioJuego::~InicioJuego(){
if(pinstance!=NULL){
delete pinstance;
pinstance=NULL;
}
if(texto_sprite!=NULL){
delete texto_sprite;
texto_sprite=NULL;
}
if(sprite!=NULL){
delete sprite;
sprite=NULL;
}
if(fondoTransicion!=NULL){
delete fondoTransicion;
fondoTransicion=NULL;
}
}
void InicioJuego::CambiarEstado(){
motor->getSonidoInicio()->pause();
motor->getMusicaMenu()->Play();
Partida::setEstado(MenuPrincipal::Instance());
}
void InicioJuego::render(float tick){
tick = 0.f;
motor->ventanaClear(140,140,140);
motor->ventanaDibuja(sprite->getSprite());
motor->ventanaDibuja(texto_sprite->getSprite());
if(alpha > 0)
motor->ventanaDibuja(fondoTransicion->getSprite());
motor->setView(0);
motor->ventanaDisplay();
}
void InicioJuego::update(){
if(alpha > 0) alpha--;
if(alpha < 150) alpha--;
if(alpha<0) alpha = 0;
fondoTransicion->setColor(0,0,0,alpha);
if(aumentando_tamanio){
texto_sprite->setScale(texto_sprite->getScale().x+0.005, texto_sprite->getScale().y+0.005);
}
else {
texto_sprite->setScale(texto_sprite->getScale().x-0.005, texto_sprite->getScale().y-0.005);
}
if(texto_sprite->getScale().x > 1.15){
aumentando_tamanio = false;
}
else if(texto_sprite->getScale().x < 1){
aumentando_tamanio = true;
}
}
void InicioJuego::input(){
while(motor->ventanaPollEvent()){
if(motor->eventTypeClosed()){
motor->ventanaClose();
}
sf::Event *event = motor->getEvent();
if (event->type == sf::Event::KeyPressed){
motor->getSonidoSeleccion()->Play();
CambiarEstado();
}
}
} | [
"raquelgarciaguillem@gmail.com"
] | raquelgarciaguillem@gmail.com |
e12f2b53d066e907bd946caf5b2d33160b62bbe8 | 8ddf1ae9e439d54e0ceda6705e0bc49df4c3c39f | /VR_Chatting/Plugins/PluginExercise/Intermediate/Build/Win64/UE4/Inc/OneImmersCustom/StereoLayerWidgetComponent.gen.cpp | 1f56d8b1e5aece4d704cecc22188d908762f7330 | [] | no_license | Yuni-Children/VR_Chatting | 4a951a33035c30247cf0c1b5930fcd05e4227e2c | 8cec0c224a9ca10ce32093901b5a0bc2323cc4a8 | refs/heads/master | 2022-07-15T00:58:36.856074 | 2020-05-19T10:23:15 | 2020-05-19T10:23:15 | 264,922,475 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,324 | cpp | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/GeneratedCppIncludes.h"
#include "OneImmersCustom/Private/StereoLayerWidgetComponent.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4883)
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS
void EmptyLinkFunctionForGeneratedCodeStereoLayerWidgetComponent() {}
// Cross Module References
ONEIMMERSCUSTOM_API UClass* Z_Construct_UClass_UStereoLayerWidgetComponent_NoRegister();
ONEIMMERSCUSTOM_API UClass* Z_Construct_UClass_UStereoLayerWidgetComponent();
UMG_API UClass* Z_Construct_UClass_UWidgetComponent();
UPackage* Z_Construct_UPackage__Script_OneImmersCustom();
ENGINE_API UClass* Z_Construct_UClass_UMaterialInterface_NoRegister();
// End Cross Module References
void UStereoLayerWidgetComponent::StaticRegisterNativesUStereoLayerWidgetComponent()
{
}
UClass* Z_Construct_UClass_UStereoLayerWidgetComponent_NoRegister()
{
return UStereoLayerWidgetComponent::StaticClass();
}
struct Z_Construct_UClass_UStereoLayerWidgetComponent_Statics
{
static UObject* (*const DependentSingletons[])();
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam Class_MetaDataParams[];
#endif
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_NoDrawMaterial_MetaData[];
#endif
static const UE4CodeGen_Private::FObjectPropertyParams NewProp_NoDrawMaterial;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bLiveTransform_MetaData[];
#endif
static void NewProp_bLiveTransform_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bLiveTransform;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bStereoLayerEnabled_MetaData[];
#endif
static void NewProp_bStereoLayerEnabled_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bStereoLayerEnabled;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bQuadPreserveTextureRatio_MetaData[];
#endif
static void NewProp_bQuadPreserveTextureRatio_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bQuadPreserveTextureRatio;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bNoAlphaChannel_MetaData[];
#endif
static void NewProp_bNoAlphaChannel_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bNoAlphaChannel;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bSupportsDepth_MetaData[];
#endif
static void NewProp_bSupportsDepth_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bSupportsDepth;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_bLiveTexture_MetaData[];
#endif
static void NewProp_bLiveTexture_SetBit(void* Obj);
static const UE4CodeGen_Private::FBoolPropertyParams NewProp_bLiveTexture;
#if WITH_METADATA
static const UE4CodeGen_Private::FMetaDataPairParam NewProp_Priority_MetaData[];
#endif
static const UE4CodeGen_Private::FIntPropertyParams NewProp_Priority;
static const UE4CodeGen_Private::FPropertyParamsBase* const PropPointers[];
static const FCppClassTypeInfoStatic StaticCppClassTypeInfo;
static const UE4CodeGen_Private::FClassParams ClassParams;
};
UObject* (*const Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::DependentSingletons[])() = {
(UObject* (*)())Z_Construct_UClass_UWidgetComponent,
(UObject* (*)())Z_Construct_UPackage__Script_OneImmersCustom,
};
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::Class_MetaDataParams[] = {
{ "BlueprintSpawnableComponent", "" },
{ "ClassGroupNames", "Custom" },
{ "HideCategories", "Object Activation Components|Activation Sockets Base Lighting LOD Mesh Mobility Trigger" },
{ "IncludePath", "StereoLayerWidgetComponent.h" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
};
#endif
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_NoDrawMaterial_MetaData[] = {
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
};
#endif
const UE4CodeGen_Private::FObjectPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_NoDrawMaterial = { "NoDrawMaterial", nullptr, (EPropertyFlags)0x0020080000000000, UE4CodeGen_Private::EPropertyGenFlags::Object, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UStereoLayerWidgetComponent, NoDrawMaterial), Z_Construct_UClass_UMaterialInterface_NoRegister, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_NoDrawMaterial_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_NoDrawMaterial_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bLiveTransform = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform = { "bLiveTransform", nullptr, (EPropertyFlags)0x0010000000000015, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "True if the quad should internally set it's Y value based on the set texture's dimensions" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bStereoLayerEnabled = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled = { "bStereoLayerEnabled", nullptr, (EPropertyFlags)0x0010000000000015, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "True if the quad should internally set it's Y value based on the set texture's dimensions" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bQuadPreserveTextureRatio = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio = { "bQuadPreserveTextureRatio", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "True if the texture should not use its own alpha channel (1.0 will be substituted)" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bNoAlphaChannel = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel = { "bNoAlphaChannel", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "True if the stereo layer needs to support depth intersections with the scene geometry, if available on the platform" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bSupportsDepth = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth = { "bSupportsDepth", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "True if the stereo layer texture needs to update itself every frame(scene capture, video, etc.)" },
};
#endif
void Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture_SetBit(void* Obj)
{
((UStereoLayerWidgetComponent*)Obj)->bLiveTexture = 1;
}
const UE4CodeGen_Private::FBoolPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture = { "bLiveTexture", nullptr, (EPropertyFlags)0x0010000000000005, UE4CodeGen_Private::EPropertyGenFlags::Bool , RF_Public|RF_Transient|RF_MarkAsNative, 1, sizeof(uint8), sizeof(UStereoLayerWidgetComponent), &Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture_SetBit, METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture_MetaData)) };
#if WITH_METADATA
const UE4CodeGen_Private::FMetaDataPairParam Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_Priority_MetaData[] = {
{ "Category", "StereoLayerWidget" },
{ "ModuleRelativePath", "Private/StereoLayerWidgetComponent.h" },
{ "ToolTip", "Render priority among all stereo layers, higher priority render on top of lower priority *" },
};
#endif
const UE4CodeGen_Private::FIntPropertyParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_Priority = { "Priority", nullptr, (EPropertyFlags)0x0010000000000015, UE4CodeGen_Private::EPropertyGenFlags::Int, RF_Public|RF_Transient|RF_MarkAsNative, 1, STRUCT_OFFSET(UStereoLayerWidgetComponent, Priority), METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_Priority_MetaData, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_Priority_MetaData)) };
const UE4CodeGen_Private::FPropertyParamsBase* const Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::PropPointers[] = {
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_NoDrawMaterial,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTransform,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bStereoLayerEnabled,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bQuadPreserveTextureRatio,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bNoAlphaChannel,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bSupportsDepth,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_bLiveTexture,
(const UE4CodeGen_Private::FPropertyParamsBase*)&Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::NewProp_Priority,
};
const FCppClassTypeInfoStatic Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::StaticCppClassTypeInfo = {
TCppClassTypeTraits<UStereoLayerWidgetComponent>::IsAbstract,
};
const UE4CodeGen_Private::FClassParams Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::ClassParams = {
&UStereoLayerWidgetComponent::StaticClass,
"Engine",
&StaticCppClassTypeInfo,
DependentSingletons,
nullptr,
Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::PropPointers,
nullptr,
ARRAY_COUNT(DependentSingletons),
0,
ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::PropPointers),
0,
0x00A010A4u,
METADATA_PARAMS(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::Class_MetaDataParams, ARRAY_COUNT(Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::Class_MetaDataParams))
};
UClass* Z_Construct_UClass_UStereoLayerWidgetComponent()
{
static UClass* OuterClass = nullptr;
if (!OuterClass)
{
UE4CodeGen_Private::ConstructUClass(OuterClass, Z_Construct_UClass_UStereoLayerWidgetComponent_Statics::ClassParams);
}
return OuterClass;
}
IMPLEMENT_CLASS(UStereoLayerWidgetComponent, 4088501914);
template<> ONEIMMERSCUSTOM_API UClass* StaticClass<UStereoLayerWidgetComponent>()
{
return UStereoLayerWidgetComponent::StaticClass();
}
static FCompiledInDefer Z_CompiledInDefer_UClass_UStereoLayerWidgetComponent(Z_Construct_UClass_UStereoLayerWidgetComponent, &UStereoLayerWidgetComponent::StaticClass, TEXT("/Script/OneImmersCustom"), TEXT("UStereoLayerWidgetComponent"), false, nullptr, nullptr, nullptr);
DEFINE_VTABLE_PTR_HELPER_CTOR(UStereoLayerWidgetComponent);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#ifdef _MSC_VER
#pragma warning (pop)
#endif
| [
"gur6531@naver.com"
] | gur6531@naver.com |
2cec7376e2bae8af76c656831adc7c5f803a67a8 | 4f5c41b5fbb97e310543c7514ed5414e10d5e3d5 | /Employee Management Software/code/threads/threadtest.cc | 9147f0110f017fb9699e1fabc90729034116f960 | [
"MIT-Modern-Variant"
] | permissive | anish9461/Operating-System | 46c4e437d5fa897907721401fab07a0712a1d480 | fac865b249b4d89d5ea316dbd04f127ebdb4972c | refs/heads/master | 2020-07-02T00:02:39.173479 | 2019-08-09T00:02:16 | 2019-08-09T00:02:16 | 201,352,902 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 14,846 | cc | #include "kernel.h"
#include "main.h"
#include "thread.h"
#include "list.h"
#include "string.h"
#include "employee.h"
#include <fstream>
#include <cstdlib>
//----------< Initialize global Employee ID >-----------
int idMax = 8001;
int order;
int compare(Employee *a, Employee *b);
void readFromFile();
void enterNewRecord();
void displayEmployees(Employee *e);
void SearchEmployeebyID(int id);
void printDeptEmployees(int dept);
void UpdateDetails();
void DeleteEmployee();
int comparePay(Employee *a, Employee *b);
void printShowCheck(Employee *e);
void ShowCheck();
void saveToFile();
void selectMenu();
void company(int i);
void myFunction();
//----------< Compare function to sort Employees by ascending order of their departments and then by position >------------------
int compare(Employee *a, Employee *b)
{
//comparing the departments of two employee objects and sorting them in increasing order
if (a->getDept() > b->getDept())
return 1;
else if (a->getDept() < b->getDept())
return -1;
else
{
//If departments are same, sorting in increasing oreder of employee postions
if (a->getpos() > b->getpos())
return 1;
else if (a->getpos() < b->getpos())
{
return -1;
}
else
return 0;
}
}
//------------< List of Employee Records sorted according to compare function >----------------
List<Employee*> *eList = new SortedList<Employee*>(compare);
//-------------< Reading Employee records from the existing file >-------------
void readFromFile()
{
//flushing the output stream
cout<<std::flush;
//reading the employee.bat file from threads folder
ifstream inFile("../threads/employee.dat");
char str[500];
//text gives the substrings in string datatype
string text;
const char *test;
int i;
int count;
while (inFile.getline(str, 255, '\n')) {
//creating pointer to the object
Employee *e = new Employee();
i = 0;
//count gives the substrings positions
count = 0;
//run this loop until last character is null
while (!(str[i-1] == '\0'))
{
//get the Substrings and concatenate to the string
while (!((str[i] == '\0') || (isspace(str[i]))))
{
if (count == 0)
text = text + str[i];
else if(count == 1)
text = text + str[i];
else if (count == 2)
text = text + str[i];
else if (count == 3)
text = text + str[i];
else if (count == 4)
{
text = text + str[i];
}
i++;
}
//Set the Employee ID
if (count == 0)
{
test = text.c_str();
int tempid = atoi(test);
e->setId(tempid);
if(idMax <= tempid)
idMax = tempid + 1;
}
//Set the name
else if (count == 1)
{
e->setName(text);
}
//Set the department
else if (count == 2)
{
test = text.c_str();
e->setDept(atoi(test));
}
//Set the position
else if (count == 3)
{
test = text.c_str();
e->setpos(atoi(test));
}
//Set the hourly rate
else if (count == 4)
{
test = text.c_str();
e->sethrate(atoi(test));
}
i++;
count++;
text = "";
}
//Append the employee object pointer to the list
eList->Append(e);
}
}
//-------------< Function to enter new Employee Record : Select option 1 in Menu >------------
void enterNewRecord()
{
//create employee object pointer
Employee *e = new Employee();
e->setId(idMax);
idMax++;
//Set the employee name
cout << "Enter Employee Name" << endl;
string name;
cin >> name;
e->setName(name);
//Set the employee position
cout << "Enter Position" << endl;
int position;
cin >> position;
e->setpos(position);
//set the employee department
cout << "Enter Department" << endl;
int dept;
cin >> dept;
e->setDept(dept);
//set the employee hourly rate
cout << "Enter hourly rate" << endl;
int hr;
cin >> hr;
e->sethrate(hr);
//Append the employee object pointer to the list
eList->Append(e);
}
//-----------< Function to display All Employee Records >-----------------
void displayEmployees(Employee *e)
{
cout << endl;
cout << ">---------< Employee Record >----------<" << endl << endl;
cout << "Employee ID: "<< e->getId() << endl;
cout << "Employee Name: "<< e->getName() << endl;
cout << "Employee Department: "<< e->getDept() << endl;
cout << "Employee Position: "<< e->getpos() << endl;
cout << "Employee hourly rate: "<< e->gethrate() << endl <<endl << endl;
}
//------------< Function to print employee record searched by ID >----------------------
void SearchEmployeebyID(int id)
{
Employee *e = new Employee();
//create List Iterator to iterate through the employee list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
List<Employee*> *eListID = new SortedList<Employee*>(compare);
//Iterate through the list
while(!Ilist->IsDone())
{
//get the current item in the list
e = Ilist->Item();
//check if entered ID is equal to the employee ID from the list
if(id == e->getId())
{
//append the employee object pointer to the list
eListID->Append(e);
//display the employee record using Apply function
eListID->Apply(displayEmployees);
return;
}
//point to next object in the list
Ilist->Next();
}
cout << "Employee entry does not exist" << endl << endl;
}
//-----------------< Function to print employees in particular Department >-------------------
void printDeptEmployees(int dept)
{
//create employee object pointer
Employee *e = new Employee();
//create list iterator to iterate through the list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
//create list for storing employees in the department
List<Employee*> *eListDept = new SortedList<Employee*>(compare);
//iterate through the list
while(!Ilist->IsDone())
{
//assign employee to current item in the list
e = Ilist->Item();
//Check if the entered department is present in the list
if(dept == e->getDept())
{
//append the employee object pointer to the list
eListDept->Append(e);
}
//point to next item in the list
Ilist->Next();
}
//print the employees n the department using apply function
eListDept->Apply(displayEmployees);
}
//-----------------< Function to search Employee by ID and Department >--------------
void SearchEmployee()
{
int select;
cout << "To Search:\n Select 1 to search by ID \n Select 2 to search by Department" << endl;
cin >> select;
cout << endl;
//switch statement to search employee by ID or department
switch(select)
{
case 1:
{
int id;
cout << "Enter Employee ID" << endl;
cin >> id;
//function to search employee by ID
SearchEmployeebyID(id);
break;
}
case 2:
{
int dept;
cout << "Enter Department number" << endl;
cin >> dept;
//function to search employee by department
printDeptEmployees(dept);
break;
}
default:
cout << "Invalid Entry" << endl << endl;
}
}
//-----------------< Function to update the existing Employee Record >------------------
void UpdateDetails()
{
//create employee object pointer
Employee *e = new Employee();
//create list iterator to iterate through the list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
int id = 0;
cout << "Enter Employee ID" << endl;
cin >> id;
cout << endl;
//iterate through the list to get the employee ID
while(!Ilist->IsDone())
{
e = Ilist->Item();
if(id == e->getId())
break;
Ilist->Next();
}
//Check if ID exists
if(id != 0)
{
cout << "Employee Entry does not exist" << endl << endl;
return;
}
int select;
//update the employee details
while(select != 5)
{
cout << "1. Update Name\n2. Update Department\n3. Update Position\n4. Update hourly rate\n5. Exit\n Select Option" << endl;
cin >> select;
cout << endl;
switch(select){
case 1: {
cout << "Enter New Name" << endl;
string name;
cin >> name;
//set employee new name
e->setName(name);
break;
}
case 2:{
cout << "Enter New Department" << endl;
int dept;
cin >> dept;
//set employee new department
e->setDept(dept);
break;
}
case 3:{
cout << "Enter New position" << endl;
int pos;
cin >> pos;
//set employee new position
e->setpos(pos);
break;
}
case 4:{
cout << "Enter New hourly rate" << endl;
int hrate;
cin >> hrate;
//set employee new hour rate
e->sethrate(hrate);
break;
}
case 5:{
break;
}
default:
cout << "Invalid Selection" << endl;
}
}
//create employee temporary list
List<Employee*> *eListtemp = new SortedList<Employee*>(compare);
//create employee list iterator to iterate through the list
ListIterator<Employee*> *Ilisttemp = new ListIterator<Employee*>(eList);
//iterate through the list to sort the list after updating
while(!Ilisttemp->IsDone())
{
//get the current item from the list
e = Ilisttemp->Item();
//append the employee object pointer to the list
eListtemp->Append(e);
//get the next item from the list
Ilisttemp->Next();
}
eList = eListtemp;
}
//-----------------< Function to Delete existing employee record from the list >------------------
void DeleteEmployee()
{
//Employee ID to be deleted
int id;
string check;
cout << "Enter the employee ID" <<endl;
cin >> id;
//Ask for confirmation for deletion
cout << "Confirm Y/N" << endl;
cin >> check;
//create Employee object pointer
Employee *e = new Employee();
//create list iterator to iterate through the list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
//Delete the employee object if "Y"
if(check == "Y")
{
//Iterate through the list
while(!Ilist->IsDone())
{
//current item in the list
e = Ilist->Item();
//check if entered ID is equal to the ID in the list
if(id == e->getId())
{
//Remove employee object pointer from the list
eList->Remove(e);
//delete the employee object pointer
delete e;
idMax--;
break;
}
//point to next item in the list
Ilist->Next();
}
}
else{
cout << endl;
cout << "Employee Record Not Deleted" << endl;
}
}
//-------------< Function to compare pay of employees for sorting employees according to individual paycheck >--------------
int comparePay(Employee *a, Employee *b)
{
//sort in descending order of the individual employee paycheck
if (a->getpayCheck() < b->getpayCheck())
return 1;
else if (a->getpayCheck() > b->getpayCheck())
return -1;
else
return 0;
}
//----------------< Display the Order#, employee ID, working hours and paycheck amount >-------------------
void printShowCheck(Employee *e)
{
cout << ">----------< Employee >-----------<" << endl << endl;
cout << "Order #"<< order << endl;
cout << "Employee ID: "<< e->getId() << " || Employee Name: " << e->getName() << endl;
cout << "Working hours: " << e->getHoursWorked() << endl;
cout << "PayCheck Amount: " << e->getpayCheck() << endl << endl;
order++;
}
//---------------< Function to find and display Individual Employee PayCheck and TotalPayAmount >--------------
void ShowCheck()
{
order = 1;
int totalPayCheck = 0;
//create new employee object pointer
Employee *e = new Employee();
//create sorted list of paycheck amount
List<Employee*> *ePayList = new SortedList<Employee*>(comparePay);
//create list iterator to iterate through the list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
//iterate through the list
while(!Ilist->IsDone())
{
//current item in the list
e = Ilist->Item();
//append employee object pointer to the list
ePayList->Append(e);
//point to net item in the list
Ilist->Next();
}
//create list iterator for paycheck list
ListIterator<Employee*> *IlistPay = new ListIterator<Employee*>(ePayList);
//iterate through the list
while(!IlistPay->IsDone())
{
//current item in the list
e = IlistPay->Item();
//append employee object pointer to the list
totalPayCheck = totalPayCheck + e->getpayCheck();
//point to net item in the list
IlistPay->Next();
}
//display the paycheck amount in decreasing order of paycheck
ePayList->Apply(printShowCheck);
cout << endl;
cout << "Total Amount of PayCheck is: " << totalPayCheck << endl << endl;
}
//--------------< Function to save all the Employee Records back to employee.bat file >------------
void saveToFile()
{
cout << "Saving Employee Data to employee.dat file" << endl;
//create ofstream
ofstream myfile;
//open the employee file
myfile.open("../threads/employee.dat");
//create the employee object pointer
Employee *e = new Employee();
//create list iterator to iterate through the list
ListIterator<Employee*> *Ilist = new ListIterator<Employee*>(eList);
//iterate through the list
while(!Ilist->IsDone())
{
//current item in the list
e = Ilist->Item();
//output the employee record to the employee.dat file
myfile << e->getId() << " " << e->getName() << " " << e->getDept() << " " << e->getpos() << " " << e->gethrate() << endl;
//point to next item in the list
Ilist->Next();
}
//close the file
myfile.close();
}
//-----------------< Function to select different Menu options for Employee record >-----------
void selectMenu()
{
//option to select the different employee functions
int option=0;
while (option != 7)
{
cout << "Select 1 to enter new record" << endl;
cout << "Select 2 to display all the Employees" << endl;
cout << "Select 3 to search an Employee" << endl;
cout << "Select 4 to Update employee details" << endl;
cout << "Select 5 to Delete an Employee information" << endl;
cout << "Select 6 to get the weekly personal paychecks and total paycheck amount" << endl;
cout << "Select 7 to quit the program" << endl << endl;
cout << "Select any one option" << endl;
cin >> option;
//switch statement select menu
switch (option) {
//function to enter new record
case 1: enterNewRecord();
break;
//function to display all the employee records
case 2: eList->Apply(displayEmployees);
break;
//function to search employee record
case 3: SearchEmployee();
break;
//function to update employe details
case 4: UpdateDetails();
break;
//function to delete employee record
case 5: DeleteEmployee();
break;
//function to display individual paychecks and total paycheck amount
case 6: ShowCheck();
break;
//function to save to the file
case 7: saveToFile();
exit(0);
}
}
}
//--------< Company function that reads from file first and then let user choose any menu option from selectMenu() function >-----------------
void company(int i)
{
//function to read from the file
readFromFile();
//fucntion to select menu
selectMenu();
}
//------------< Defined function that creates child thread for executing program >--------------
void myFunction()
{
//create a new thread and fork it to company
Thread *t = new Thread("forked thread");
t -> Fork((VoidFunctionPtr) company, (void *) 1);
}
| [
"anish9461@gmail.com"
] | anish9461@gmail.com |
8beaf49d1967e22083a70d6cfbcf840e3fdd9531 | 3843f6622e9e488fb3f6aec5243de4aa08fa5ab2 | /S005/S005.cpp | f820904bdc27ef77c73e5e02cce9bcf09b730d16 | [] | no_license | Olya-ycheba/S005 | 619b5ca5fc045892f9746ac239b04fa96c33d4da | c705e3a46c48ecee4522bcb12a0212b763d171c2 | refs/heads/master | 2023-04-22T11:24:07.410149 | 2021-04-27T09:27:16 | 2021-04-27T09:27:16 | 362,054,863 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,621 | cpp | // S005.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main()
{
char strok[256]; //вводимая строка
char Findstr[256];
char f[] = "%s";//формат строки
char fd[] = "%d";//формат числа
cout << "Enter string: ";
char m[514] = "Search string ";//
__asm
{
lea ebx, strok
push ebx
lea ecx, f
push ecx
call scanf
add esp, 8
lea edx, m
push edx
lea ecx, f
push ecx
call printf
add esp, 8
lea edx, Findstr
push edx
lea ecx, f
push ecx
call scanf
add esp, 8
lea ebx, strok
dec ebx
lea ecx, Findstr
b1 :
inc ebx
mov al, [ebx]
cmp al, 0
je b5
cmp al, [ecx]
jnz b1
mov edx, ebx
b2 :
inc ebx
inc ecx
mov al, [ebx]
cmp al, 0
je b4
mov al, [ecx]
cmp al, 0
je b7
cmp al, [ebx]
je b2
mov ebx, edx
lea ecx, Findstr
jmp b1
b4 :
mov al, [ecx]
cmp al, 0
jne b5
b7 :
lea ebx, strok
sub edx, ebx
push edx
jmp b6
b5 :
mov ebx, -1
push ebx
b6 :
lea ebx, fd
push ebx
call printf
add esp, 8
}
}
// Запуск программы: CTRL+F5 или меню "Отладка" > "Запуск без отладки"
// Отладка программы: F5 или меню "Отладка" > "Запустить отладку"
// Советы по началу работы
// 1. В окне обозревателя решений можно добавлять файлы и управлять ими.
// 2. В окне Team Explorer можно подключиться к системе управления версиями.
// 3. В окне "Выходные данные" можно просматривать выходные данные сборки и другие сообщения.
// 4. В окне "Список ошибок" можно просматривать ошибки.
// 5. Последовательно выберите пункты меню "Проект" > "Добавить новый элемент", чтобы создать файлы кода, или "Проект" > "Добавить существующий элемент", чтобы добавить в проект существующие файлы кода.
// 6. Чтобы снова открыть этот проект позже, выберите пункты меню "Файл" > "Открыть" > "Проект" и выберите SLN-файл.
| [
"Asus@LAPTOP-EIH2MNAJ"
] | Asus@LAPTOP-EIH2MNAJ |
88c184830f0870778342bb9782f4c96f83b25c08 | c7817c0efd91bfcdceb0e4e55702ce057d6e556e | /src/wpb_home_apps/src/shopping.cpp | cc6da4b33a4a6b664b3e72d2dd76e03d5798d4ae | [
"MIT"
] | permissive | THUwelcomerobot/robot | fa3fd2102f882bec73614c9c815a010b3ebcd718 | a8c8e5105cf4a3be478c89249e818aa970bfc243 | refs/heads/master | 2020-03-22T14:56:01.875578 | 2018-07-19T08:53:50 | 2018-07-19T08:53:50 | 140,215,854 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,023 | cpp | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2017-2020, Waterplus http://www.6-robot.com
* 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 WaterPlus 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,
* FOOTPRINTAL, 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.
*********************************************************************/
/* @author Zhang Wanjie */
#include <ros/ros.h>
#include <std_msgs/String.h>
#include "wpb_home_tutorials/Follow.h"
#include <geometry_msgs/Twist.h>
#include "xfyun_waterplus/IATSwitch.h"
#include <sound_play/SoundRequest.h>
#include "wpb_home_tutorials/Follow.h"
#include <move_base_msgs/MoveBaseAction.h>
#include <actionlib/client/simple_action_client.h>
#include <waterplus_map_tools/Waypoint.h>
#include <waterplus_map_tools/GetWaypointByName.h>
#include <tf/transform_listener.h>
#include <geometry_msgs/PoseStamped.h>
using namespace std;
#define STATE_READY 0
#define STATE_FOLLOW 1
#define STATE_ASK 2
#define STATE_GOTO 3
#define STATE_GRAB 4
#define STATE_COMEBACK 5
#define STATE_PASS 6
typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;
static string strGoto;
static sound_play::SoundRequest spk_msg;
static ros::Publisher spk_pub;
static ros::Publisher vel_pub;
static string strToSpeak = "";
static string strKeyWord = "";
static ros::ServiceClient clientIAT;
static xfyun_waterplus::IATSwitch srvIAT;
static ros::ServiceClient cliGetWPName;
static waterplus_map_tools::GetWaypointByName srvName;
static ros::Publisher add_waypoint_pub;
static ros::ServiceClient follow_start;
static ros::ServiceClient follow_stop;
static ros::ServiceClient follow_resume;
static wpb_home_tutorials::Follow srvFlw;
static ros::Publisher behaviors_pub;
static std_msgs::String behavior_msg;
static ros::Subscriber grab_result_sub;
static ros::Subscriber pass_result_sub;
static bool bGrabDone;
static bool bPassDone;
static int nState = STATE_READY;
static int nDelay = 0;
static vector<string> arKeyword;
// 添加航点关键词
void InitKeyword()
{
arKeyword.push_back("start"); //机器人开始启动的地点,最后要回去
arKeyword.push_back("water");
arKeyword.push_back("tea");
arKeyword.push_back("cola");
}
// 从句子里找arKeyword里存在的关键词
static string FindKeyword(string inSentence)
{
string res = "";
int nSize = arKeyword.size();
for(int i=0;i<nSize;i++)
{
int nFindIndex = inSentence.find(arKeyword[i]);
if(nFindIndex >= 0)
{
res = arKeyword[i];
break;
}
}
return res;
}
// 将机器人当前位置保存为新航点
void AddNewWaypoint(string inStr)
{
tf::TransformListener listener;
tf::StampedTransform transform;
try
{
listener.waitForTransform("/map","/base_footprint", ros::Time(0), ros::Duration(10.0) );
listener.lookupTransform("/map","/base_footprint", ros::Time(0), transform);
}
catch (tf::TransformException &ex)
{
ROS_ERROR("[lookupTransform] %s",ex.what());
return;
}
float tx = transform.getOrigin().x();
float ty = transform.getOrigin().y();
tf::Stamped<tf::Pose> p = tf::Stamped<tf::Pose>(tf::Pose(transform.getRotation() , tf::Point(tx, ty, 0.0)), ros::Time::now(), "map");
geometry_msgs::PoseStamped new_pos;
tf::poseStampedTFToMsg(p, new_pos);
waterplus_map_tools::Waypoint new_waypoint;
new_waypoint.name = inStr;
new_waypoint.pose = new_pos.pose;
add_waypoint_pub.publish(new_waypoint);
ROS_WARN("[New Waypoint] %s ( %.2f , %.2f )" , new_waypoint.name.c_str(), tx, ty);
}
// 语音说话
void Speak(string inStr)
{
spk_msg.arg = inStr;
spk_pub.publish(spk_msg);
}
// 跟随模式开关
static void FollowSwitch(bool inActive, float inDist)
{
if(inActive == true)
{
srvFlw.request.thredhold = inDist;
if (!follow_start.call(srvFlw))
{
ROS_WARN("[CActionManager] - follow start failed...");
}
}
else
{
if (!follow_stop.call(srvFlw))
{
ROS_WARN("[CActionManager] - failed to stop following...");
}
}
}
// 物品抓取模式开关
static void GrabSwitch(bool inActive)
{
if(inActive == true)
{
behavior_msg.data = "grab start";
behaviors_pub.publish(behavior_msg);
}
else
{
behavior_msg.data = "grab stop";
behaviors_pub.publish(behavior_msg);
}
}
// 物品递给开关
static void PassSwitch(bool inActive)
{
if(inActive == true)
{
behavior_msg.data = "pass start";
behaviors_pub.publish(behavior_msg);
}
else
{
behavior_msg.data = "pass stop";
behaviors_pub.publish(behavior_msg);
}
}
// 语音识别结果处理函数
void KeywordCB(const std_msgs::String::ConstPtr & msg)
{
ROS_WARN("------ Keyword = %s ------",msg->data.c_str());
if(nState == STATE_FOLLOW)
{
// 从识别结果句子中查找物品(航点)关键词
string strKeyword = FindKeyword(msg->data);
int nLenOfKW = strlen(strKeyword.c_str());
if(nLenOfKW > 0)
{
// 发现物品(航点)关键词
AddNewWaypoint(strKeyword);
string strSpeak = strKeyword + " . OK. I have memoried. Next one , please";
Speak(strSpeak);
}
// 停止跟随的指令
int nFindIndex = msg->data.find("top follow");
if(nFindIndex >= 0)
{
FollowSwitch(false, 0);
AddNewWaypoint("master");
nState = STATE_ASK;
nDelay = 0;
Speak("OK. What do you want me to fetch?");
}
}
if(nState == STATE_ASK)
{
// 从识别结果句子中查找物品(航点)关键词
string strKeyword = FindKeyword(msg->data);
int nLenOfKW = strlen(strKeyword.c_str());
if(nLenOfKW > 0)
{
// 发现物品(航点)关键词
strGoto = strKeyword;
string strSpeak = strKeyword + " . OK. I will go to get it for you.";
Speak(strSpeak);
nState = STATE_GOTO;
}
}
}
// 物品抓取状态
void GrabResultCallback(const std_msgs::String::ConstPtr& res)
{
int nFindIndex = 0;
nFindIndex = res->data.find("done");
if( nFindIndex >= 0 )
{
bGrabDone = true;
}
}
// 物品递给状态
void PassResultCallback(const std_msgs::String::ConstPtr& res)
{
int nFindIndex = 0;
nFindIndex = res->data.find("done");
if( nFindIndex >= 0 )
{
bPassDone = true;
}
}
int main(int argc, char** argv)
{
ros::init(argc, argv, "wpb_home_shopping");
ros::NodeHandle n;
ros::Subscriber sub_sr = n.subscribe("/xfyun/iat", 10, KeywordCB);
follow_start = n.serviceClient<wpb_home_tutorials::Follow>("wpb_home_follow/start");
follow_stop = n.serviceClient<wpb_home_tutorials::Follow>("wpb_home_follow/stop");
follow_resume = n.serviceClient<wpb_home_tutorials::Follow>("wpb_home_follow/resume");
cliGetWPName = n.serviceClient<waterplus_map_tools::GetWaypointByName>("/waterplus/get_waypoint_name");
add_waypoint_pub = n.advertise<waterplus_map_tools::Waypoint>( "/waterplus/add_waypoint", 1);
spk_pub = n.advertise<sound_play::SoundRequest>("/robotsound", 20);
spk_msg.sound = sound_play::SoundRequest::SAY;
spk_msg.command = sound_play::SoundRequest::PLAY_ONCE;
vel_pub = n.advertise<geometry_msgs::Twist>("/cmd_vel", 10);
clientIAT = n.serviceClient<xfyun_waterplus::IATSwitch>("xfyun_waterplus/IATSwitch");
behaviors_pub = n.advertise<std_msgs::String>("/wpb_home/behaviors", 30);
grab_result_sub = n.subscribe<std_msgs::String>("/wpb_home/grab_result",30,&GrabResultCallback);
pass_result_sub = n.subscribe<std_msgs::String>("/wpb_home/pass_result",30,&PassResultCallback);
InitKeyword();
ROS_WARN("[main] wpb_home_shopping");
ros::Rate r(30);
while(ros::ok())
{
// 1、刚启动,准备
if(nState == STATE_READY)
{
// 启动后延迟一段时间然后开始跟随
nDelay ++;
// ROS_WARN("[STATE_READY] - nDelay = %d", nDelay);
if(nDelay > 100)
{
AddNewWaypoint("start");
nDelay = 0;
nState = STATE_FOLLOW;
}
}
// 2、跟随阶段
if(nState == STATE_FOLLOW)
{
if(nDelay == 0)
{
FollowSwitch(true, 0.7);
}
// nDelay ++;
}
// 3、询问要去哪个航点
if(nState == STATE_ASK)
{
}
// 4、导航去指定航点
if(nState == STATE_GOTO)
{
srvName.request.name = strGoto;
if (cliGetWPName.call(srvName))
{
std::string name = srvName.response.name;
float x = srvName.response.pose.position.x;
float y = srvName.response.pose.position.y;
ROS_INFO("[STATE_GOTO] Get_wp_name = %s (%.2f,%.2f)", strGoto.c_str(),x,y);
MoveBaseClient ac("move_base", true);
if(!ac.waitForServer(ros::Duration(5.0)))
{
ROS_INFO("The move_base action server is no running. action abort...");
}
else
{
move_base_msgs::MoveBaseGoal goal;
goal.target_pose.header.frame_id = "map";
goal.target_pose.header.stamp = ros::Time::now();
goal.target_pose.pose = srvName.response.pose;
ac.sendGoal(goal);
ac.waitForResult();
if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
{
ROS_INFO("Arrived at %s!",strGoto.c_str());
Speak("OK. I am taking it.");
nState = STATE_GRAB;
nDelay = 0;
}
else
{
ROS_INFO("Failed to get to %s ...",strGoto.c_str() );
Speak("Failed to go to the waypoint.");
nState = STATE_ASK;
}
}
}
else
{
ROS_ERROR("Failed to call service GetWaypointByName");
Speak("There is no this waypoint.");
nState = STATE_ASK;
}
}
// 5、抓取物品
if(nState == STATE_GRAB)
{
if(nDelay == 0)
{
bGrabDone = false;
GrabSwitch(true);
}
nDelay ++;
if(bGrabDone == true)
{
GrabSwitch(false);
Speak("I got it. I am coming back.");
nState = STATE_COMEBACK;
}
}
// 6、抓完物品回来
if(nState == STATE_COMEBACK)
{
srvName.request.name = "master";
if (cliGetWPName.call(srvName))
{
std::string name = srvName.response.name;
float x = srvName.response.pose.position.x;
float y = srvName.response.pose.position.y;
ROS_INFO("[STATE_COMEBACK] Get_wp_name = %s (%.2f,%.2f)", strGoto.c_str(),x,y);
MoveBaseClient ac("move_base", true);
if(!ac.waitForServer(ros::Duration(5.0)))
{
ROS_INFO("The move_base action server is no running. action abort...");
}
else
{
move_base_msgs::MoveBaseGoal goal;
goal.target_pose.header.frame_id = "map";
goal.target_pose.header.stamp = ros::Time::now();
goal.target_pose.pose = srvName.response.pose;
ac.sendGoal(goal);
ac.waitForResult();
if(ac.getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
{
ROS_INFO("Arrived at %s!",strGoto.c_str());
Speak("Hi,master. This is what you wanted.");
nState = STATE_PASS;
nDelay = 0;
}
else
{
ROS_INFO("Failed to get to %s ...",strGoto.c_str() );
Speak("Failed to go to the master.");
nState = STATE_ASK;
}
}
}
else
{
ROS_ERROR("Failed to call service GetWaypointByName");
Speak("There is no waypoint named master.");
nState = STATE_ASK;
}
}
// 7、将物品给主人
if(nState == STATE_PASS)
{
if(nDelay == 0)
{
bPassDone = false;
PassSwitch(true);
}
nDelay ++;
if(bPassDone == true)
{
PassSwitch(false);
Speak("OK. What do you want next?");
nState = STATE_ASK;
}
}
ros::spinOnce();
r.sleep();
}
return 0;
} | [
"1584666784@qq.com"
] | 1584666784@qq.com |
f005462218d793a8204176846c1624793575daef | c252a4c41233b24cf82f1868737a37d57b3a35fa | /windows/runner/main.cpp | 931f148eb246ed1bbfb249cdfb7b9f62a3a82fc8 | [] | no_license | leoyuguanall38/radiology_call_helper | 4c7877f54b5e9cab600723958ed3c9ae6498ae62 | dcd26d58b053c8604b7673cd3d875027f57fddd9 | refs/heads/master | 2023-03-29T20:37:42.045750 | 2021-04-05T06:54:59 | 2021-04-05T06:54:59 | 348,952,710 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,231 | cpp | #include <flutter/dart_project.h>
#include <flutter/flutter_view_controller.h>
#include <windows.h>
#include "flutter_window.h"
#include "run_loop.h"
#include "utils.h"
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
// Attach to console when present (e.g., 'flutter run') or create a
// new console when running with a debugger.
if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
CreateAndAttachConsole();
}
// Initialize COM, so that it is available for use in the library and/or
// plugins.
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
RunLoop run_loop;
flutter::DartProject project(L"data");
std::vector<std::string> command_line_arguments =
GetCommandLineArguments();
project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
FlutterWindow window(&run_loop, project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
if (!window.CreateAndShow(L"radiology_call_helper", origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);
run_loop.Run();
::CoUninitialize();
return EXIT_SUCCESS;
}
| [
"51035633+leoyuguanall38@users.noreply.github.com"
] | 51035633+leoyuguanall38@users.noreply.github.com |
25346991cc0c2472949c7feceb80a9d00e664fda | e1c5cfbb8e307d35482ab97330035c7a52a382c6 | /src/GvimExt/gvimext.h | b6be3a7975b718c507c83cace079753c45ecdb8d | [
"Vim"
] | permissive | drichardson/vim | 49d9e75e67c37e86055b8edc15962eb51c7c5d37 | e9fd95588cc553dae11bd6e3c5ff9fc50e46c4f2 | refs/heads/master | 2022-02-02T18:26:41.402767 | 2022-01-19T01:27:53 | 2022-01-19T01:30:10 | 251,437,053 | 0 | 0 | NOASSERTION | 2020-03-30T21:53:56 | 2020-03-30T21:53:55 | null | UTF-8 | C++ | false | false | 4,494 | h | /* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved gvimext by Tianmiao Hu
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
*/
/*
* If you have any questions or any suggestions concerning gvimext, please
* contact Tianmiao Hu: tianmiao@acm.org.
*/
#if !defined(AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_)
#define AFX_STDAFX_H__3389658B_AD83_11D3_9C1E_0090278BBD99__INCLUDED_
#if defined(_MSC_VER) && _MSC_VER > 1000
#pragma once
#endif
// Insert your headers here
// #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
//--------------------------------------------------------------
// common user interface routines
//
//
//--------------------------------------------------------------
#ifndef STRICT
# define STRICT
#endif
#define INC_OLE2 // MS-Windows, get ole2 from windows.h
/* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
#if defined(_MSC_VER) && _MSC_VER >= 1400
# define _CRT_SECURE_NO_DEPRECATE
# define _CRT_NONSTDC_NO_DEPRECATE
#endif
#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#include <wchar.h>
/* Accommodate old versions of VC that don't have a modern Platform SDK */
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
# undef UINT_PTR
# define UINT_PTR UINT
#endif
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
// Initialize GUIDs (should be done only and at-least once per DLL/EXE)
//
#pragma data_seg(".text")
#define INITGUID
#include <initguid.h>
//
// The class ID of this Shell extension class.
//
// class id: {51EEE242-AD87-11d3-9C1E-0090278BBD99}
//
//
// NOTE!!! If you use this shell extension as a starting point,
// you MUST change the GUID below. Simply run UUIDGEN.EXE
// to generate a new GUID.
//
// {51EEE242-AD87-11d3-9C1E-0090278BBD99}
// static const GUID <<name>> =
// { 0x51eee242, 0xad87, 0x11d3, { 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99 } };
//
//
// {51EEE242-AD87-11d3-9C1E-0090278BBD99}
// IMPLEMENT_OLECREATE(<<class>>, <<external_name>>,
// 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99);
//
// {51EEE242-AD87-11d3-9C1E-0090278BBD99} -- this is the registry format
DEFINE_GUID(CLSID_ShellExtension, 0x51eee242, 0xad87, 0x11d3, 0x9c, 0x1e, 0x0, 0x90, 0x27, 0x8b, 0xbd, 0x99);
// this class factory object creates context menu handlers for windows 32 shell
class CShellExtClassFactory : public IClassFactory
{
protected:
ULONG m_cRef;
public:
CShellExtClassFactory();
~CShellExtClassFactory();
//IUnknown members
STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//IClassFactory members
STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
STDMETHODIMP LockServer(BOOL);
};
typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY;
#define MAX_HWND 100
// this is the actual OLE Shell context menu handler
class CShellExt : public IContextMenu,
IShellExtInit
{
private:
BOOL LoadMenuIcon();
protected:
ULONG m_cRef;
LPDATAOBJECT m_pDataObj;
UINT m_edit_existing_off;
HBITMAP m_hVimIconBitmap;
// For some reason, this callback must be static
static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
STDMETHODIMP PushToWindow(HWND hParent,
LPCSTR pszWorkingDir,
LPCSTR pszCmd,
LPCSTR pszParam,
int iShowCmd,
int idHWnd);
STDMETHODIMP InvokeSingleGvim(HWND hParent,
LPCWSTR workingDir,
LPCSTR pszCmd,
LPCSTR pszParam,
int iShowCmd,
int gvimExtraOptions);
public:
int m_cntOfHWnd;
HWND m_hWnd[MAX_HWND];
CShellExt();
~CShellExt();
//IUnknown members
STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//IShell members
STDMETHODIMP QueryContextMenu(HMENU hMenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags);
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
STDMETHODIMP GetCommandString(UINT_PTR idCmd,
UINT uFlags,
UINT FAR *reserved,
LPSTR pszName,
UINT cchMax);
//IShellExtInit methods
STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder,
LPDATAOBJECT pDataObj,
HKEY hKeyID);
};
typedef CShellExt *LPCSHELLEXT;
#pragma data_seg()
#endif
| [
"Bram@vim.org"
] | Bram@vim.org |
4c4d85dec60f1a4942cfd934cd3604cf497687d5 | 057aef2128a747a7e739ea5dd37e745344dbff95 | /framework/mem/shm.h | 53e772a48cc5a305cc583c0c6ca59791ac175470 | [] | no_license | neaos/myserver | 64932b96418ae3009ef1227da34e81fa4aa6be31 | a2d7e826401fcddbb5a23c3dab66c9953c85a9a3 | refs/heads/master | 2023-03-23T10:44:17.610383 | 2020-06-26T08:18:28 | 2020-06-26T08:18:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,783 | h | //
// shm.h
// 共享内存块管理类
// Created by DGuco on 17/03/23.
// Copyright © 2016年 DGuco. All rights reserved.
//
#ifndef _SHM_H_
#define _SHM_H_
#include "base.h"
#define YEARSEC 31536000
typedef enum
{
SHM_INIT = 1,
SHM_RECOVER = 0
} EIMode;
class CSharedMem
{
//禁止在栈上生成对象
protected:
//构造函数
CSharedMem();
//构造函数
CSharedMem(unsigned int nKey, size_t nSize);
//构造函数
CSharedMem(unsigned int nKey, size_t nSize, int nInitFlag);
public:
//析构函数
~CSharedMem();
//初始化
int Initialize(unsigned int nKey, size_t nSize);
//设置共享内存创建时间戳
void SetStamp();
//new操作符重载将类对象定义到共享内存区地址
void* operator new( size_t nSize);
//delete操作符重载
void operator delete(void* pMem);
//获取对象创建类型
EIMode GetInitMode();
//设置对象创建类型
void SetInitMode( EIMode emMode );
//在创建好的共享内存块上划分内存段
void* CreateSegment( size_t nSize);
static CSharedMem* CreateInstance();
static CSharedMem* CreateInstance(unsigned int nKey, size_t nSize);
static CSharedMem* CreateInstance(unsigned int nKey, size_t nSize, int nInitFlag);
//当前共享内存块地址大小通常为sizeof(CSharedMem) + sizeof(CCodeQueue) + PIPE_SIZE(可变)
static BYTE* pbCurrentShm;
protected:
private:
//共享内存key
unsigned int m_nShmKey;
//共享内存大小
size_t m_nShmSize;
//共享内存创建时间戳
time_t m_tCreateTime;
time_t m_tLastStamp;
//crc校验码
unsigned int m_nCRC;
//当前可用空闲内存去的起始地址
BYTE* m_pbCurrentSegMent;
//对象初始化类型
EIMode m_InitMode;
};
#endif
| [
"1139140929@qq.com"
] | 1139140929@qq.com |
e62219a60b604b890c641f0845b6a6bf817c29f8 | e0279edbc6619c7c18358a9697ebc1f2dc6ee499 | /DMOJ/cco14p1.cpp | 3b90ed01120615f5890ad74ff9f66d60cdd9b316 | [] | no_license | tikul/Competitive-Programming | 9e9830301f5f7a4a4553992a9ccc74a8d5d2748e | 83b0afeb8ed85d60787d097120b0af7e99b20b47 | refs/heads/master | 2021-01-01T06:15:19.515610 | 2017-11-14T03:36:20 | 2017-11-14T03:36:20 | 97,393,776 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,284 | cpp | #include <stdio.h>
#include <cstring>
#include <algorithm>
using namespace std;
int N, dp[2002], L[2002][2002], R[2002][2002];
char grid[2002][2002];
int main(){
scanf("%i", &N);
char x;
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
scanf(" %c", &grid[i][j]);
}
}
//preprocess left
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
if(grid[i][j]=='.'){
L[i][j] = 0;
continue;
}
if(j == 0) L[i][j] = 1;
else L[i][j] = 1+L[i][j-1];
}
}
//preprocess right
for(int i = 0; i < N; i++){
for(int j = N-1; j >= 0; j--){
if(grid[i][j]=='.'){
R[i][j] = 0;
continue;
}
if(j == N-1) R[i][j] = 1;
else R[i][j] = 1+R[i][j+1];
}
}
//dp
memset(dp, 0, sizeof(dp));
int tot = 0;
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
int w = min(L[i][j], R[i][j]);
if(w==0){
dp[j] = 0;
}else{
int uw = min(dp[j], w-1);
tot += uw+1;
dp[j] = uw+1;
}
}
}
printf("%i", tot);
} | [
"tikul@users.noreply.github.com"
] | tikul@users.noreply.github.com |
f2d44a8d3feb3e180abde4231192df0a23065a73 | 2ccbccf91ce4b6802e20fe9b31206416b4c5064b | /cpp01/ex07/include/replace.hpp | 23bda63bdcd55f4f1880a30c9f143e984cf9d706 | [] | no_license | TerryDodre/42 | 84e4097b5a9e0d40f904858c3d7d9330914133fa | c044a895e84adbccb1126c264a02b723b6cd32ff | refs/heads/master | 2023-03-26T23:15:53.441341 | 2021-03-26T16:04:00 | 2021-03-26T16:04:00 | 302,292,552 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 391 | hpp | #ifndef REPLACE_HPP
# define REPLACE_HPP
# include <iostream>
# include <fstream>
# include <string>
# include <sstream>
class replace {
private:
std::string filename;
std::string s1;
std::string s2;
public:
replace(std::string file, std::string argv1, std::string argv2);
~replace();
int check();
int replace_program();
int write_replace(std::string ret);
};
#endif
| [
"terrydodre@hotmail.fr"
] | terrydodre@hotmail.fr |
b84e557f2c0f36544425a44541654a6136e13a44 | b6f38c6bc4626db2422477a03c2616fe4f94427a | /unittests/expectation/FullOutputExpectationTests.cpp | c5b42d86242a30b3436c55bae446490aebfb53df | [
"BSD-3-Clause"
] | permissive | chyla/OutputMatchTestingTool | ae0b6f5bd833aef497d665d29e52065051948cb6 | d45fe3433e15e0dc396f62577c49d2673a531359 | refs/heads/master | 2023-08-11T13:34:59.332006 | 2023-07-29T09:02:27 | 2023-07-29T09:02:27 | 209,099,990 | 5 | 0 | BSD-3-Clause | 2021-07-18T17:30:43 | 2019-09-17T16:10:44 | C++ | UTF-8 | C++ | false | false | 6,413 | cpp | /*
* Copyright (c) 2019-2023, Adam Chyła <adam@chyla.org>.
* All rights reserved.
*
* Distributed under the terms of the BSD 3-Clause License.
*/
#include "unittests/test_framework.hpp"
#include "headers/expectation/FullOutputExpectation.hpp"
#include "headers/expectation/validation/FullOutputCause.hpp"
#include "headers/ProcessResults.hpp"
namespace omtt
{
TEST_CASE("Should be satisfied when expected output and SUT output is the same")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "some output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == true);
}
TEST_CASE("Should not be satisfied when expected output and SUT output is not the same")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "some other output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == false);
}
TEST_CASE("Should not be satisfied when expected output and SUT output differs in letters case")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "Some Output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == false);
}
TEST_CASE("Cause should not be set when expectation match")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "some output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == true);
CHECK(!validationReults.cause.has_value());
}
TEST_CASE("Cause should be set when expectation didn't match")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "SOME OUTPUT"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == false);
CHECK(validationReults.cause.has_value());
}
TEST_CASE("Cause should not be set on empty texts")
{
const std::string expectedOutput = "";
const ProcessResults sutResults {0, ""};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.isSatisfied() == true);
CHECK(!validationReults.cause.has_value());
}
TEST_CASE("Cause should contain expected output")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "Some output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fExpectedOutput == expectedOutput);
}
TEST_CASE("Cause should contain process output")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "Some output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fOutput == sutResults.output);
}
TEST_CASE("Cause should point to zero byte when the difference is on the zero position")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "Some output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fDifferencePosition == 0);
}
TEST_CASE("Cause should point to thirth byte when the difference is on the fourth position")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "somE output"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fDifferencePosition == 3);
}
TEST_CASE("Cause should point to the last byte when the difference is on the last position")
{
const std::string expectedOutput = "some output";
const ProcessResults sutResults {0, "some outpuT"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fDifferencePosition == 10);
}
TEST_CASE("Cause should point after last byte of expectation text when expectation text is shorten than SUT output")
{
const std::string expectedOutput = "some";
const ProcessResults sutResults {0, "some text"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fDifferencePosition == 4);
}
TEST_CASE("Cause should point after last byte of SUT output text when SUT output text is shorten than expectation text")
{
const std::string expectedOutput = "some text";
const ProcessResults sutResults {0, "some"};
expectation::FullOutputExpectation expectation(expectedOutput);
auto validationReults = expectation.Validate(sutResults);
CHECK(validationReults.cause.has_value());
const auto cause = std::get<expectation::validation::FullOutputCause>(*validationReults.cause);
CHECK(cause.fDifferencePosition == 4);
}
}
| [
"adam@chyla.org"
] | adam@chyla.org |
a0ee0c0b2a43b89e935f80e46f8a174ee37b9245 | e69d1dd68c62c3addee6c961ed91ee22dc7badfb | /等价二叉树.cpp | 83ef1d38ceb65da677558ce4d2dbd24ef616ff19 | [] | no_license | Juliiii/lintcode | 20004dd793208906572e5fda3ff67d6a0364801c | 74d627b4e7b0f9ceb07f8811f8605359a77ff88e | refs/heads/master | 2021-01-15T17:28:59.681662 | 2017-11-25T11:34:20 | 2017-11-25T11:34:20 | 99,755,193 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 910 | cpp | /**
* Definition of TreeNode:
* class TreeNode {
* public:
* int val;
* TreeNode *left, *right;
* TreeNode(int val) {
* this->val = val;
* this->left = this->right = NULL;
* }
* }
*/
class Solution {
public:
/*
* @param a: the root of binary tree a.
* @param b: the root of binary tree b.
* @return: true if they are identical, or false.
*/
bool isIdentical(TreeNode * a, TreeNode * b) {
// write your code here
bool flag = true;
helper(a, b, flag);
return flag;
}
void helper(TreeNode* a, TreeNode* b, bool& flag) {
if (!flag) return;
if (!a && !b) return;
if ((!a && b )|| (!b && a)) {
flag = false;
return;
}
if (a->val != b->val) {
flag = false;
return;
}
helper(a->left, b->left, flag);
helper(a->right, b->right, flag);
}
};
| [
"820917549@qq.com"
] | 820917549@qq.com |
51a8f415335279bfbc269edf2a2a34fde3437770 | 875301066242d901f782beed96fa40c7265862b2 | /src/main.h | 4c3a1434304850fdc66fbccd47457fbc0c28a6e3 | [
"MIT"
] | permissive | totorajo/indocoin | 7cabada5d4c42ca00477950b481c61e017f72118 | ed4fa980283ec75b6a06f6580528d72a810e30ea | refs/heads/master | 2021-05-28T09:49:02.930639 | 2014-05-25T12:58:30 | 2014-05-25T12:58:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 72,511 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013-2014 Indocoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
#define BITCOIN_MAIN_H
#include "bignum.h"
#include "sync.h"
#include "net.h"
#include "script.h"
#include "scrypt.h"
#include <list>
class CWallet;
class CBlock;
class CBlockIndex;
class CKeyItem;
class CReserveKey;
class CAddress;
class CInv;
class CNode;
struct CBlockIndexWorkComparator;
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000; // 1000KB block hard limit
/** Obsolete: maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2; // 500KB block soft limit
/** Default for -blockmaxsize, maximum size for mined blocks **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 500000;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 17000;
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = 100000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
/** The maximum number of orphan transactions kept in memory */
static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100;
/** The maximum number of entries in an 'inv' protocol message */
static const unsigned int MAX_INV_SZ = 50000;
/** The maximum size of a blk?????.dat file (since 0.8) */
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
/** Dust Soft Limit, allowed with additional fee per output */
static const int64 DUST_SOFT_LIMIT = 100000000;
/** Dust Hard Limit, ignored as wallet inputs (mininput default) */
static const int64 DUST_HARD_LIMIT = 1000000;
/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 19450000000 * COIN; //not used
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 30;
/** Coinbase maturity after block 145000 **/
static const int COINBASE_MATURITY_NEW = 60*4;
/** Block at which COINBASE_MATURITY_NEW comes into effect **/
static const int COINBASE_MATURITY_SWITCH = 145000;
/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
/** Maximum number of script-checking threads allowed */
static const int MAX_SCRIPTCHECK_THREADS = 16;
#ifdef USE_UPNP
static const int fHaveUPnP = true;
#else
static const int fHaveUPnP = false;
#endif
extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main;
extern std::map<uint256, CBlockIndex*> mapBlockIndex;
extern std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid;
extern uint256 hashGenesisBlock;
extern CBlockIndex* pindexGenesisBlock;
extern int nBestHeight;
extern uint256 nBestChainWork;
extern uint256 nBestInvalidWork;
extern uint256 hashBestChain;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
extern uint64 nLastBlockTx;
extern uint64 nLastBlockSize;
extern const std::string strMessageMagic;
extern double dHashesPerSec;
extern int64 nHPSTimerStart;
extern int64 nTimeBestReceived;
extern CCriticalSection cs_setpwalletRegistered;
extern std::set<CWallet*> setpwalletRegistered;
extern unsigned char pchMessageStart[4];
extern bool fImporting;
extern bool fReindex;
extern bool fBenchmark;
extern int nScriptCheckThreads;
extern bool fTxIndex;
extern unsigned int nCoinCacheSize;
// Settings
extern int64 nTransactionFee;
// Minimum disk space required - used in CheckDiskSpace()
static const uint64 nMinDiskSpace = 52428800;
class CReserveKey;
class CCoinsDB;
class CBlockTreeDB;
struct CDiskBlockPos;
class CCoins;
class CTxUndo;
class CCoinsView;
class CCoinsViewCache;
class CScriptCheck;
class CValidationState;
struct CBlockTemplate;
/** Register a wallet to receive updates from core */
void RegisterWallet(CWallet* pwalletIn);
/** Unregister a wallet from core */
void UnregisterWallet(CWallet* pwalletIn);
/** Push an updated transaction to all registered wallets */
void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false);
/** Process an incoming block */
bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL);
/** Check whether enough disk space is available for an incoming block */
bool CheckDiskSpace(uint64 nAdditionalBytes = 0);
/** Open a block file (blk?????.dat) */
FILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false);
/** Open an undo file (rev?????.dat) */
FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false);
/** Import blocks from an external file */
bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp = NULL);
/** Initialize a new block tree database + block data on disk */
bool InitBlockIndex();
/** Load the block tree and coins database from disk */
bool LoadBlockIndex();
/** Unload database information */
void UnloadBlockIndex();
/** Verify consistency of the block and coin databases */
bool VerifyDB(int nCheckLevel, int nCheckDepth);
/** Print the loaded block tree */
void PrintBlockTree();
/** Find a block by height in the currently-connected chain */
CBlockIndex* FindBlockByHeight(int nHeight);
/** Process protocol messages received from a given node */
bool ProcessMessages(CNode* pfrom);
/** Send queued protocol messages to be sent to a give node */
bool SendMessages(CNode* pto, bool fSendTrickle);
/** Run an instance of the script checking thread */
void ThreadScriptCheck();
/** Run the miner threads */
void GenerateBitcoins(bool fGenerate, CWallet* pwallet);
/** Generate a new block, without valid proof-of-work */
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
/** Modify the extranonce in a block */
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
/** Do mining precalculation */
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
/** Check mined block */
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
/** Calculate the minimum amount of work a received block needs, without knowing its direct parent */
unsigned int ComputeMinWork(unsigned int nBase, int64 nTime);
/** Get the number of active peers */
int GetNumBlocksOfPeers();
/** Check whether we are doing an initial block download (synchronizing from disk or network) */
bool IsInitialBlockDownload();
/** Format a string that describes several potential problems detected by the core */
std::string GetWarnings(std::string strFor);
/** Retrieve a transaction (from memory pool, or from disk, if possible) */
bool GetTransaction(const uint256 &hash, CTransaction &tx, uint256 &hashBlock, bool fAllowSlow = false);
/** Connect/disconnect blocks until pindexNew is the new tip of the active block chain */
bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew);
/** Find the best known block, and make it the tip of the block chain */
bool ConnectBestBlock(CValidationState &state);
/** Create a new block index entry for a given block hash */
CBlockIndex * InsertBlockIndex(uint256 hash);
/** Verify a signature */
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
/** Abort with a message */
bool AbortNode(const std::string &msg);
bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
struct CDiskBlockPos
{
int nFile;
unsigned int nPos;
IMPLEMENT_SERIALIZE(
READWRITE(VARINT(nFile));
READWRITE(VARINT(nPos));
)
CDiskBlockPos() {
SetNull();
}
CDiskBlockPos(int nFileIn, unsigned int nPosIn) {
nFile = nFileIn;
nPos = nPosIn;
}
friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) {
return (a.nFile == b.nFile && a.nPos == b.nPos);
}
friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) {
return !(a == b);
}
void SetNull() { nFile = -1; nPos = 0; }
bool IsNull() const { return (nFile == -1); }
};
struct CDiskTxPos : public CDiskBlockPos
{
unsigned int nTxOffset; // after header
IMPLEMENT_SERIALIZE(
READWRITE(*(CDiskBlockPos*)this);
READWRITE(VARINT(nTxOffset));
)
CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {
}
CDiskTxPos() {
SetNull();
}
void SetNull() {
CDiskBlockPos::SetNull();
nTxOffset = 0;
}
};
/** An inpoint - a combination of a transaction and an index n into its vin */
class CInPoint
{
public:
CTransaction* ptx;
unsigned int n;
CInPoint() { SetNull(); }
CInPoint(CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; }
void SetNull() { ptx = NULL; n = (unsigned int) -1; }
bool IsNull() const { return (ptx == NULL && n == (unsigned int) -1); }
};
/** An outpoint - a combination of a transaction hash and an index n into its vout */
class COutPoint
{
public:
uint256 hash;
unsigned int n;
COutPoint() { SetNull(); }
COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; }
IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); )
void SetNull() { hash = 0; n = (unsigned int) -1; }
bool IsNull() const { return (hash == 0 && n == (unsigned int) -1); }
friend bool operator<(const COutPoint& a, const COutPoint& b)
{
return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n));
}
friend bool operator==(const COutPoint& a, const COutPoint& b)
{
return (a.hash == b.hash && a.n == b.n);
}
friend bool operator!=(const COutPoint& a, const COutPoint& b)
{
return !(a == b);
}
std::string ToString() const
{
return strprintf("COutPoint(%s, %u)", hash.ToString().c_str(), n);
}
void print() const
{
printf("%s\n", ToString().c_str());
}
};
/** An input of a transaction. It contains the location of the previous
* transaction's output that it claims and a signature that matches the
* output's public key.
*/
class CTxIn
{
public:
COutPoint prevout;
CScript scriptSig;
unsigned int nSequence;
CTxIn()
{
nSequence = std::numeric_limits<unsigned int>::max();
}
explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max())
{
prevout = prevoutIn;
scriptSig = scriptSigIn;
nSequence = nSequenceIn;
}
CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max())
{
prevout = COutPoint(hashPrevTx, nOut);
scriptSig = scriptSigIn;
nSequence = nSequenceIn;
}
IMPLEMENT_SERIALIZE
(
READWRITE(prevout);
READWRITE(scriptSig);
READWRITE(nSequence);
)
bool IsFinal() const
{
return (nSequence == std::numeric_limits<unsigned int>::max());
}
friend bool operator==(const CTxIn& a, const CTxIn& b)
{
return (a.prevout == b.prevout &&
a.scriptSig == b.scriptSig &&
a.nSequence == b.nSequence);
}
friend bool operator!=(const CTxIn& a, const CTxIn& b)
{
return !(a == b);
}
std::string ToString() const
{
std::string str;
str += "CTxIn(";
str += prevout.ToString();
if (prevout.IsNull())
str += strprintf(", coinbase %s", HexStr(scriptSig).c_str());
else
str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24).c_str());
if (nSequence != std::numeric_limits<unsigned int>::max())
str += strprintf(", nSequence=%u", nSequence);
str += ")";
return str;
}
void print() const
{
printf("%s\n", ToString().c_str());
}
};
/** An output of a transaction. It contains the public key that the next input
* must be able to sign with to claim it.
*/
class CTxOut
{
public:
int64 nValue;
CScript scriptPubKey;
CTxOut()
{
SetNull();
}
CTxOut(int64 nValueIn, CScript scriptPubKeyIn)
{
nValue = nValueIn;
scriptPubKey = scriptPubKeyIn;
}
IMPLEMENT_SERIALIZE
(
READWRITE(nValue);
READWRITE(scriptPubKey);
)
void SetNull()
{
nValue = -1;
scriptPubKey.clear();
}
bool IsNull() const
{
return (nValue == -1);
}
uint256 GetHash() const
{
return SerializeHash(*this);
}
friend bool operator==(const CTxOut& a, const CTxOut& b)
{
return (a.nValue == b.nValue &&
a.scriptPubKey == b.scriptPubKey);
}
friend bool operator!=(const CTxOut& a, const CTxOut& b)
{
return !(a == b);
}
bool IsDust() const;
std::string ToString() const
{
if (scriptPubKey.size() < 6)
return "CTxOut(error)";
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
}
void print() const
{
printf("%s\n", ToString().c_str());
}
};
enum GetMinFee_mode
{
GMF_BLOCK,
GMF_RELAY,
GMF_SEND,
};
/** The basic transaction that is broadcasted on the network and contained in
* blocks. A transaction can contain multiple inputs and outputs.
*/
class CTransaction
{
public:
static int64 nMinTxFee;
static int64 nMinRelayTxFee;
static const int CURRENT_VERSION=1;
int nVersion;
std::vector<CTxIn> vin;
std::vector<CTxOut> vout;
unsigned int nLockTime;
CTransaction()
{
SetNull();
}
IMPLEMENT_SERIALIZE
(
READWRITE(this->nVersion);
nVersion = this->nVersion;
READWRITE(vin);
READWRITE(vout);
READWRITE(nLockTime);
)
void SetNull()
{
nVersion = CTransaction::CURRENT_VERSION;
vin.clear();
vout.clear();
nLockTime = 0;
}
bool IsNull() const
{
return (vin.empty() && vout.empty());
}
uint256 GetHash() const
{
return SerializeHash(*this);
}
bool IsFinal(int nBlockHeight=0, int64 nBlockTime=0) const
{
// Time based nLockTime implemented in 0.1.6
if (nLockTime == 0)
return true;
if (nBlockHeight == 0)
nBlockHeight = nBestHeight;
if (nBlockTime == 0)
nBlockTime = GetAdjustedTime();
if ((int64)nLockTime < ((int64)nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime))
return true;
BOOST_FOREACH(const CTxIn& txin, vin)
if (!txin.IsFinal())
return false;
return true;
}
bool IsNewerThan(const CTransaction& old) const
{
if (vin.size() != old.vin.size())
return false;
for (unsigned int i = 0; i < vin.size(); i++)
if (vin[i].prevout != old.vin[i].prevout)
return false;
bool fNewer = false;
unsigned int nLowest = std::numeric_limits<unsigned int>::max();
for (unsigned int i = 0; i < vin.size(); i++)
{
if (vin[i].nSequence != old.vin[i].nSequence)
{
if (vin[i].nSequence <= nLowest)
{
fNewer = false;
nLowest = vin[i].nSequence;
}
if (old.vin[i].nSequence < nLowest)
{
fNewer = true;
nLowest = old.vin[i].nSequence;
}
}
}
return fNewer;
}
bool IsCoinBase() const
{
return (vin.size() == 1 && vin[0].prevout.IsNull());
}
/** Check for standard transaction types
@return True if all outputs (scriptPubKeys) use only standard transaction forms
*/
bool IsStandard(std::string& strReason) const;
bool IsStandard() const
{
std::string strReason;
return IsStandard(strReason);
}
/** Check for standard transaction types
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return True if all inputs (scriptSigs) use only standard transaction forms
*/
bool AreInputsStandard(CCoinsViewCache& mapInputs) const;
/** Count ECDSA signature operations the old-fashioned (pre-0.6) way
@return number of sigops this transaction's outputs will produce when spent
*/
unsigned int GetLegacySigOpCount() const;
/** Count ECDSA signature operations in pay-to-script-hash inputs.
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return maximum number of sigops required to validate this transaction's inputs
*/
unsigned int GetP2SHSigOpCount(CCoinsViewCache& mapInputs) const;
/** Amount of bitcoins spent by this transaction.
@return sum of all outputs (note: does not include fees)
*/
int64 GetValueOut() const
{
int64 nValueOut = 0;
BOOST_FOREACH(const CTxOut& txout, vout)
{
nValueOut += txout.nValue;
if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))
throw std::runtime_error("CTransaction::GetValueOut() : value out of range");
}
return nValueOut;
}
/** Amount of bitcoins coming in to this transaction
Note that lightweight clients may not know anything besides the hash of previous transactions,
so may not be able to calculate this.
@param[in] mapInputs Map of previous transactions that have outputs we're spending
@return Sum of value of all inputs (scriptSigs)
*/
int64 GetValueIn(CCoinsViewCache& mapInputs) const;
static bool AllowFree(double dPriority)
{
// Large (in bytes) low-priority (new, small-coin) transactions
// need a fee.
return dPriority > 100 * COIN * 1440 / 250; // IndoCoin: 1440 blocks found a day. Priority cutoff is 100 indocoin day / 250 bytes.
}
// Apply the effects of this transaction on the UTXO set represented by view
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash);
int64 GetMinFee(unsigned int nBlockSize=1, bool fAllowFree=true, enum GetMinFee_mode mode=GMF_BLOCK) const;
friend bool operator==(const CTransaction& a, const CTransaction& b)
{
return (a.nVersion == b.nVersion &&
a.vin == b.vin &&
a.vout == b.vout &&
a.nLockTime == b.nLockTime);
}
friend bool operator!=(const CTransaction& a, const CTransaction& b)
{
return !(a == b);
}
std::string ToString() const
{
std::string str;
str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%"PRIszu", vout.size=%"PRIszu", nLockTime=%u)\n",
GetHash().ToString().c_str(),
nVersion,
vin.size(),
vout.size(),
nLockTime);
for (unsigned int i = 0; i < vin.size(); i++)
str += " " + vin[i].ToString() + "\n";
for (unsigned int i = 0; i < vout.size(); i++)
str += " " + vout[i].ToString() + "\n";
return str;
}
void print() const
{
printf("%s", ToString().c_str());
}
// Check whether all prevouts of this transaction are present in the UTXO set represented by view
bool HaveInputs(CCoinsViewCache &view) const;
// Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts)
// This does not modify the UTXO set. If pvChecks is not NULL, script checks are pushed onto it
// instead of being performed inline.
bool CheckInputs(CValidationState &state, CCoinsViewCache &view, bool fScriptChecks = true,
unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC,
std::vector<CScriptCheck> *pvChecks = NULL) const;
// Apply the effects of this transaction on the UTXO set represented by view
void UpdateCoins(CValidationState &state, CCoinsViewCache &view, CTxUndo &txundo, int nHeight, const uint256 &txhash) const;
// Context-independent validity checks
bool CheckTransaction(CValidationState &state) const;
// Try to accept this transaction into the memory pool
bool AcceptToMemoryPool(CValidationState &state, bool fCheckInputs=true, bool fLimitFree = true, bool* pfMissingInputs=NULL);
protected:
static const CTxOut &GetOutputFor(const CTxIn& input, CCoinsViewCache& mapInputs);
};
/** wrapper for CTxOut that provides a more compact serialization */
class CTxOutCompressor
{
private:
CTxOut &txout;
public:
static uint64 CompressAmount(uint64 nAmount);
static uint64 DecompressAmount(uint64 nAmount);
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
IMPLEMENT_SERIALIZE(({
if (!fRead) {
uint64 nVal = CompressAmount(txout.nValue);
READWRITE(VARINT(nVal));
} else {
uint64 nVal = 0;
READWRITE(VARINT(nVal));
txout.nValue = DecompressAmount(nVal);
}
CScriptCompressor cscript(REF(txout.scriptPubKey));
READWRITE(cscript);
});)
};
/** Undo information for a CTxIn
*
* Contains the prevout's CTxOut being spent, and if this was the
* last output of the affected transaction, its metadata as well
* (coinbase or not, height, transaction version)
*/
class CTxInUndo
{
public:
CTxOut txout; // the txout data before being spent
bool fCoinBase; // if the outpoint was the last unspent: whether it belonged to a coinbase
unsigned int nHeight; // if the outpoint was the last unspent: its height
int nVersion; // if the outpoint was the last unspent: its version
CTxInUndo() : txout(), fCoinBase(false), nHeight(0), nVersion(0) {}
CTxInUndo(const CTxOut &txoutIn, bool fCoinBaseIn = false, unsigned int nHeightIn = 0, int nVersionIn = 0) : txout(txoutIn), fCoinBase(fCoinBaseIn), nHeight(nHeightIn), nVersion(nVersionIn) { }
unsigned int GetSerializeSize(int nType, int nVersion) const {
return ::GetSerializeSize(VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion) +
(nHeight > 0 ? ::GetSerializeSize(VARINT(this->nVersion), nType, nVersion) : 0) +
::GetSerializeSize(CTxOutCompressor(REF(txout)), nType, nVersion);
}
template<typename Stream>
void Serialize(Stream &s, int nType, int nVersion) const {
::Serialize(s, VARINT(nHeight*2+(fCoinBase ? 1 : 0)), nType, nVersion);
if (nHeight > 0)
::Serialize(s, VARINT(this->nVersion), nType, nVersion);
::Serialize(s, CTxOutCompressor(REF(txout)), nType, nVersion);
}
template<typename Stream>
void Unserialize(Stream &s, int nType, int nVersion) {
unsigned int nCode = 0;
::Unserialize(s, VARINT(nCode), nType, nVersion);
nHeight = nCode / 2;
fCoinBase = nCode & 1;
if (nHeight > 0)
::Unserialize(s, VARINT(this->nVersion), nType, nVersion);
::Unserialize(s, REF(CTxOutCompressor(REF(txout))), nType, nVersion);
}
};
/** Undo information for a CTransaction */
class CTxUndo
{
public:
// undo information for all txins
std::vector<CTxInUndo> vprevout;
IMPLEMENT_SERIALIZE(
READWRITE(vprevout);
)
};
/** Undo information for a CBlock */
class CBlockUndo
{
public:
std::vector<CTxUndo> vtxundo; // for all but the coinbase
IMPLEMENT_SERIALIZE(
READWRITE(vtxundo);
)
bool WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock)
{
// Open history file to append
CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION);
if (!fileout)
return error("CBlockUndo::WriteToDisk() : OpenUndoFile failed");
// Write index header
unsigned int nSize = fileout.GetSerializeSize(*this);
fileout << FLATDATA(pchMessageStart) << nSize;
// Write undo data
long fileOutPos = ftell(fileout);
if (fileOutPos < 0)
return error("CBlockUndo::WriteToDisk() : ftell failed");
pos.nPos = (unsigned int)fileOutPos;
fileout << *this;
// calculate & write checksum
CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);
hasher << hashBlock;
hasher << *this;
fileout << hasher.GetHash();
// Flush stdio buffers and commit to disk before returning
fflush(fileout);
if (!IsInitialBlockDownload())
FileCommit(fileout);
return true;
}
bool ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock)
{
// Open history file to read
CAutoFile filein = CAutoFile(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION);
if (!filein)
return error("CBlockUndo::ReadFromDisk() : OpenBlockFile failed");
// Read block
uint256 hashChecksum;
try {
filein >> *this;
filein >> hashChecksum;
}
catch (std::exception &e) {
return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__);
}
// Verify checksum
CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);
hasher << hashBlock;
hasher << *this;
if (hashChecksum != hasher.GetHash())
return error("CBlockUndo::ReadFromDisk() : checksum mismatch");
return true;
}
};
/** pruned version of CTransaction: only retains metadata and unspent transaction outputs
*
* Serialized format:
* - VARINT(nVersion)
* - VARINT(nCode)
* - unspentness bitvector, for vout[2] and further; least significant byte first
* - the non-spent CTxOuts (via CTxOutCompressor)
* - VARINT(nHeight)
*
* The nCode value consists of:
* - bit 1: IsCoinBase()
* - bit 2: vout[0] is not spent
* - bit 4: vout[1] is not spent
* - The higher bits encode N, the number of non-zero bytes in the following bitvector.
* - In case both bit 2 and bit 4 are unset, they encode N-1, as there must be at
* least one non-spent output).
*
* Example: 0104835800816115944e077fe7c803cfa57f29b36bf87c1d358bb85e
* <><><--------------------------------------------><---->
* | \ | /
* version code vout[1] height
*
* - version = 1
* - code = 4 (vout[1] is not spent, and 0 non-zero bytes of bitvector follow)
* - unspentness bitvector: as 0 non-zero bytes follow, it has length 0
* - vout[1]: 835800816115944e077fe7c803cfa57f29b36bf87c1d35
* * 8358: compact amount representation for 60000000000 (600 BTC)
* * 00: special txout type pay-to-pubkey-hash
* * 816115944e077fe7c803cfa57f29b36bf87c1d35: address uint160
* - height = 203998
*
*
* Example: 0109044086ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4eebbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa486af3b
* <><><--><--------------------------------------------------><----------------------------------------------><---->
* / \ \ | | /
* version code unspentness vout[4] vout[16] height
*
* - version = 1
* - code = 9 (coinbase, neither vout[0] or vout[1] are unspent,
* 2 (1, +1 because both bit 2 and bit 4 are unset) non-zero bitvector bytes follow)
* - unspentness bitvector: bits 2 (0x04) and 14 (0x4000) are set, so vout[2+2] and vout[14+2] are unspent
* - vout[4]: 86ef97d5790061b01caab50f1b8e9c50a5057eb43c2d9563a4ee
* * 86ef97d579: compact amount representation for 234925952 (2.35 BTC)
* * 00: special txout type pay-to-pubkey-hash
* * 61b01caab50f1b8e9c50a5057eb43c2d9563a4ee: address uint160
* - vout[16]: bbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa4
* * bbd123: compact amount representation for 110397 (0.001 BTC)
* * 00: special txout type pay-to-pubkey-hash
* * 8c988f1a4a4de2161e0f50aac7f17e7f9555caa4: address uint160
* - height = 120891
*/
class CCoins
{
public:
// whether transaction is a coinbase
bool fCoinBase;
// unspent transaction outputs; spent outputs are .IsNull(); spent outputs at the end of the array are dropped
std::vector<CTxOut> vout;
// at which height this transaction was included in the active block chain
int nHeight;
// version of the CTransaction; accesses to this value should probably check for nHeight as well,
// as new tx version will probably only be introduced at certain heights
int nVersion;
// construct a CCoins from a CTransaction, at a given height
CCoins(const CTransaction &tx, int nHeightIn) : fCoinBase(tx.IsCoinBase()), vout(tx.vout), nHeight(nHeightIn), nVersion(tx.nVersion) { }
// empty constructor
CCoins() : fCoinBase(false), vout(0), nHeight(0), nVersion(0) { }
// remove spent outputs at the end of vout
void Cleanup() {
while (vout.size() > 0 && vout.back().IsNull())
vout.pop_back();
if (vout.empty())
std::vector<CTxOut>().swap(vout);
}
void swap(CCoins &to) {
std::swap(to.fCoinBase, fCoinBase);
to.vout.swap(vout);
std::swap(to.nHeight, nHeight);
std::swap(to.nVersion, nVersion);
}
// equality test
friend bool operator==(const CCoins &a, const CCoins &b) {
return a.fCoinBase == b.fCoinBase &&
a.nHeight == b.nHeight &&
a.nVersion == b.nVersion &&
a.vout == b.vout;
}
friend bool operator!=(const CCoins &a, const CCoins &b) {
return !(a == b);
}
// calculate number of bytes for the bitmask, and its number of non-zero bytes
// each bit in the bitmask represents the availability of one output, but the
// availabilities of the first two outputs are encoded separately
void CalcMaskSize(unsigned int &nBytes, unsigned int &nNonzeroBytes) const {
unsigned int nLastUsedByte = 0;
for (unsigned int b = 0; 2+b*8 < vout.size(); b++) {
bool fZero = true;
for (unsigned int i = 0; i < 8 && 2+b*8+i < vout.size(); i++) {
if (!vout[2+b*8+i].IsNull()) {
fZero = false;
continue;
}
}
if (!fZero) {
nLastUsedByte = b + 1;
nNonzeroBytes++;
}
}
nBytes += nLastUsedByte;
}
bool IsCoinBase() const {
return fCoinBase;
}
unsigned int GetSerializeSize(int nType, int nVersion) const {
unsigned int nSize = 0;
unsigned int nMaskSize = 0, nMaskCode = 0;
CalcMaskSize(nMaskSize, nMaskCode);
bool fFirst = vout.size() > 0 && !vout[0].IsNull();
bool fSecond = vout.size() > 1 && !vout[1].IsNull();
assert(fFirst || fSecond || nMaskCode);
unsigned int nCode = 8*(nMaskCode - (fFirst || fSecond ? 0 : 1)) + (fCoinBase ? 1 : 0) + (fFirst ? 2 : 0) + (fSecond ? 4 : 0);
// version
nSize += ::GetSerializeSize(VARINT(this->nVersion), nType, nVersion);
// size of header code
nSize += ::GetSerializeSize(VARINT(nCode), nType, nVersion);
// spentness bitmask
nSize += nMaskSize;
// txouts themself
for (unsigned int i = 0; i < vout.size(); i++)
if (!vout[i].IsNull())
nSize += ::GetSerializeSize(CTxOutCompressor(REF(vout[i])), nType, nVersion);
// height
nSize += ::GetSerializeSize(VARINT(nHeight), nType, nVersion);
return nSize;
}
template<typename Stream>
void Serialize(Stream &s, int nType, int nVersion) const {
unsigned int nMaskSize = 0, nMaskCode = 0;
CalcMaskSize(nMaskSize, nMaskCode);
bool fFirst = vout.size() > 0 && !vout[0].IsNull();
bool fSecond = vout.size() > 1 && !vout[1].IsNull();
assert(fFirst || fSecond || nMaskCode);
unsigned int nCode = 8*(nMaskCode - (fFirst || fSecond ? 0 : 1)) + (fCoinBase ? 1 : 0) + (fFirst ? 2 : 0) + (fSecond ? 4 : 0);
// version
::Serialize(s, VARINT(this->nVersion), nType, nVersion);
// header code
::Serialize(s, VARINT(nCode), nType, nVersion);
// spentness bitmask
for (unsigned int b = 0; b<nMaskSize; b++) {
unsigned char chAvail = 0;
for (unsigned int i = 0; i < 8 && 2+b*8+i < vout.size(); i++)
if (!vout[2+b*8+i].IsNull())
chAvail |= (1 << i);
::Serialize(s, chAvail, nType, nVersion);
}
// txouts themself
for (unsigned int i = 0; i < vout.size(); i++) {
if (!vout[i].IsNull())
::Serialize(s, CTxOutCompressor(REF(vout[i])), nType, nVersion);
}
// coinbase height
::Serialize(s, VARINT(nHeight), nType, nVersion);
}
template<typename Stream>
void Unserialize(Stream &s, int nType, int nVersion) {
unsigned int nCode = 0;
// version
::Unserialize(s, VARINT(this->nVersion), nType, nVersion);
// header code
::Unserialize(s, VARINT(nCode), nType, nVersion);
fCoinBase = nCode & 1;
std::vector<bool> vAvail(2, false);
vAvail[0] = nCode & 2;
vAvail[1] = nCode & 4;
unsigned int nMaskCode = (nCode / 8) + ((nCode & 6) != 0 ? 0 : 1);
// spentness bitmask
while (nMaskCode > 0) {
unsigned char chAvail = 0;
::Unserialize(s, chAvail, nType, nVersion);
for (unsigned int p = 0; p < 8; p++) {
bool f = (chAvail & (1 << p)) != 0;
vAvail.push_back(f);
}
if (chAvail != 0)
nMaskCode--;
}
// txouts themself
vout.assign(vAvail.size(), CTxOut());
for (unsigned int i = 0; i < vAvail.size(); i++) {
if (vAvail[i])
::Unserialize(s, REF(CTxOutCompressor(vout[i])), nType, nVersion);
}
// coinbase height
::Unserialize(s, VARINT(nHeight), nType, nVersion);
Cleanup();
}
// mark an outpoint spent, and construct undo information
bool Spend(const COutPoint &out, CTxInUndo &undo) {
if (out.n >= vout.size())
return false;
if (vout[out.n].IsNull())
return false;
undo = CTxInUndo(vout[out.n]);
vout[out.n].SetNull();
Cleanup();
if (vout.size() == 0) {
undo.nHeight = nHeight;
undo.fCoinBase = fCoinBase;
undo.nVersion = this->nVersion;
}
return true;
}
// mark a vout spent
bool Spend(int nPos) {
CTxInUndo undo;
COutPoint out(0, nPos);
return Spend(out, undo);
}
// check whether a particular output is still available
bool IsAvailable(unsigned int nPos) const {
return (nPos < vout.size() && !vout[nPos].IsNull());
}
// check whether the entire CCoins is spent
// note that only !IsPruned() CCoins can be serialized
bool IsPruned() const {
BOOST_FOREACH(const CTxOut &out, vout)
if (!out.IsNull())
return false;
return true;
}
};
/** Closure representing one script verification
* Note that this stores references to the spending transaction */
class CScriptCheck
{
private:
CScript scriptPubKey;
const CTransaction *ptxTo;
unsigned int nIn;
unsigned int nFlags;
int nHashType;
public:
CScriptCheck() {}
CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, int nHashTypeIn) :
scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey),
ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), nHashType(nHashTypeIn) { }
bool operator()() const;
void swap(CScriptCheck &check) {
scriptPubKey.swap(check.scriptPubKey);
std::swap(ptxTo, check.ptxTo);
std::swap(nIn, check.nIn);
std::swap(nFlags, check.nFlags);
std::swap(nHashType, check.nHashType);
}
};
/** A transaction with a merkle branch linking it to the block chain. */
class CMerkleTx : public CTransaction
{
public:
uint256 hashBlock;
std::vector<uint256> vMerkleBranch;
int nIndex;
// memory only
mutable bool fMerkleVerified;
CMerkleTx()
{
Init();
}
CMerkleTx(const CTransaction& txIn) : CTransaction(txIn)
{
Init();
}
void Init()
{
hashBlock = 0;
nIndex = -1;
fMerkleVerified = false;
}
IMPLEMENT_SERIALIZE
(
nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
nVersion = this->nVersion;
READWRITE(hashBlock);
READWRITE(vMerkleBranch);
READWRITE(nIndex);
)
int SetMerkleBranch(const CBlock* pblock=NULL);
int GetDepthInMainChain(CBlockIndex* &pindexRet) const;
int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }
int GetHeightInMainChain(CBlockIndex* &pindexRet) const;
int GetHeightInMainChain() const { CBlockIndex *pindexRet; return GetHeightInMainChain(pindexRet); }
bool IsInMainChain() const { return GetDepthInMainChain() > 0; }
int GetBlocksToMaturity() const;
bool AcceptToMemoryPool(bool fCheckInputs=true, bool fLimitFree=true);
};
/** Data structure that represents a partial merkle tree.
*
* It respresents a subset of the txid's of a known block, in a way that
* allows recovery of the list of txid's and the merkle root, in an
* authenticated way.
*
* The encoding works as follows: we traverse the tree in depth-first order,
* storing a bit for each traversed node, signifying whether the node is the
* parent of at least one matched leaf txid (or a matched txid itself). In
* case we are at the leaf level, or this bit is 0, its merkle node hash is
* stored, and its children are not explorer further. Otherwise, no hash is
* stored, but we recurse into both (or the only) child branch. During
* decoding, the same depth-first traversal is performed, consuming bits and
* hashes as they written during encoding.
*
* The serialization is fixed and provides a hard guarantee about the
* encoded size:
*
* SIZE <= 10 + ceil(32.25*N)
*
* Where N represents the number of leaf nodes of the partial tree. N itself
* is bounded by:
*
* N <= total_transactions
* N <= 1 + matched_transactions*tree_height
*
* The serialization format:
* - uint32 total_transactions (4 bytes)
* - varint number of hashes (1-3 bytes)
* - uint256[] hashes in depth-first order (<= 32*N bytes)
* - varint number of bytes of flag bits (1-3 bytes)
* - byte[] flag bits, packed per 8 in a byte, least significant bit first (<= 2*N-1 bits)
* The size constraints follow from this.
*/
class CPartialMerkleTree
{
protected:
// the total number of transactions in the block
unsigned int nTransactions;
// node-is-parent-of-matched-txid bits
std::vector<bool> vBits;
// txids and internal hashes
std::vector<uint256> vHash;
// flag set when encountering invalid data
bool fBad;
// helper function to efficiently calculate the number of nodes at given height in the merkle tree
unsigned int CalcTreeWidth(int height) {
return (nTransactions+(1 << height)-1) >> height;
}
// calculate the hash of a node in the merkle tree (at leaf level: the txid's themself)
uint256 CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid);
// recursive function that traverses tree nodes, storing the data as bits and hashes
void TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);
// recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild.
// it returns the hash of the respective node.
uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch);
public:
// serialization implementation
IMPLEMENT_SERIALIZE(
READWRITE(nTransactions);
READWRITE(vHash);
std::vector<unsigned char> vBytes;
if (fRead) {
READWRITE(vBytes);
CPartialMerkleTree &us = *(const_cast<CPartialMerkleTree*>(this));
us.vBits.resize(vBytes.size() * 8);
for (unsigned int p = 0; p < us.vBits.size(); p++)
us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0;
us.fBad = false;
} else {
vBytes.resize((vBits.size()+7)/8);
for (unsigned int p = 0; p < vBits.size(); p++)
vBytes[p / 8] |= vBits[p] << (p % 8);
READWRITE(vBytes);
}
)
// Construct a partial merkle tree from a list of transaction id's, and a mask that selects a subset of them
CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);
CPartialMerkleTree();
// extract the matching txid's represented by this partial merkle tree.
// returns the merkle root, or 0 in case of failure
uint256 ExtractMatches(std::vector<uint256> &vMatch);
};
/** Nodes collect new transactions into a block, hash them into a hash tree,
* and scan through nonce values to make the block's hash satisfy proof-of-work
* requirements. When they solve the proof-of-work, they broadcast the block
* to everyone and the block is added to the block chain. The first transaction
* in the block is a special one that creates a new coin owned by the creator
* of the block.
*/
class CBlockHeader
{
public:
// header
static const int CURRENT_VERSION=2;
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
CBlockHeader()
{
SetNull();
}
IMPLEMENT_SERIALIZE
(
READWRITE(this->nVersion);
nVersion = this->nVersion;
READWRITE(hashPrevBlock);
READWRITE(hashMerkleRoot);
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);
)
void SetNull()
{
nVersion = CBlockHeader::CURRENT_VERSION;
hashPrevBlock = 0;
hashMerkleRoot = 0;
nTime = 0;
nBits = 0;
nNonce = 0;
}
bool IsNull() const
{
return (nBits == 0);
}
uint256 GetHash() const
{
return Hash(BEGIN(nVersion), END(nNonce));
}
int64 GetBlockTime() const
{
return (int64)nTime;
}
void UpdateTime(const CBlockIndex* pindexPrev);
};
class CBlock : public CBlockHeader
{
public:
// network and disk
std::vector<CTransaction> vtx;
// memory only
mutable std::vector<uint256> vMerkleTree;
CBlock()
{
SetNull();
}
CBlock(const CBlockHeader &header)
{
SetNull();
*((CBlockHeader*)this) = header;
}
IMPLEMENT_SERIALIZE
(
READWRITE(*(CBlockHeader*)this);
READWRITE(vtx);
)
void SetNull()
{
CBlockHeader::SetNull();
vtx.clear();
vMerkleTree.clear();
}
uint256 GetPoWHash() const
{
uint256 thash;
scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(thash));
return thash;
}
CBlockHeader GetBlockHeader() const
{
CBlockHeader block;
block.nVersion = nVersion;
block.hashPrevBlock = hashPrevBlock;
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block;
}
uint256 BuildMerkleTree() const
{
vMerkleTree.clear();
BOOST_FOREACH(const CTransaction& tx, vtx)
vMerkleTree.push_back(tx.GetHash());
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
for (int i = 0; i < nSize; i += 2)
{
int i2 = std::min(i+1, nSize-1);
vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]), END(vMerkleTree[j+i]),
BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2])));
}
j += nSize;
}
return (vMerkleTree.empty() ? 0 : vMerkleTree.back());
}
const uint256 &GetTxHash(unsigned int nIndex) const {
assert(vMerkleTree.size() > 0); // BuildMerkleTree must have been called first
assert(nIndex < vtx.size());
return vMerkleTree[nIndex];
}
std::vector<uint256> GetMerkleBranch(int nIndex) const
{
if (vMerkleTree.empty())
BuildMerkleTree();
std::vector<uint256> vMerkleBranch;
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
int i = std::min(nIndex^1, nSize-1);
vMerkleBranch.push_back(vMerkleTree[j+i]);
nIndex >>= 1;
j += nSize;
}
return vMerkleBranch;
}
static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex)
{
if (nIndex == -1)
return 0;
BOOST_FOREACH(const uint256& otherside, vMerkleBranch)
{
if (nIndex & 1)
hash = Hash(BEGIN(otherside), END(otherside), BEGIN(hash), END(hash));
else
hash = Hash(BEGIN(hash), END(hash), BEGIN(otherside), END(otherside));
nIndex >>= 1;
}
return hash;
}
bool WriteToDisk(CDiskBlockPos &pos)
{
// Open history file to append
CAutoFile fileout = CAutoFile(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION);
if (!fileout)
return error("CBlock::WriteToDisk() : OpenBlockFile failed");
// Write index header
unsigned int nSize = fileout.GetSerializeSize(*this);
fileout << FLATDATA(pchMessageStart) << nSize;
// Write block
long fileOutPos = ftell(fileout);
if (fileOutPos < 0)
return error("CBlock::WriteToDisk() : ftell failed");
pos.nPos = (unsigned int)fileOutPos;
fileout << *this;
// Flush stdio buffers and commit to disk before returning
fflush(fileout);
if (!IsInitialBlockDownload())
FileCommit(fileout);
return true;
}
bool ReadFromDisk(const CDiskBlockPos &pos)
{
SetNull();
// Open history file to read
CAutoFile filein = CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);
if (!filein)
return error("CBlock::ReadFromDisk() : OpenBlockFile failed");
// Read block
try {
filein >> *this;
}
catch (std::exception &e) {
return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__);
}
// Check the header
if (!CheckProofOfWork(GetPoWHash(), nBits))
return error("CBlock::ReadFromDisk() : errors in block header");
return true;
}
void print() const
{
printf("CBlock(hash=%s, input=%s, PoW=%s, ver=%d, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%"PRIszu")\n",
GetHash().ToString().c_str(),
HexStr(BEGIN(nVersion),BEGIN(nVersion)+80,false).c_str(),
GetPoWHash().ToString().c_str(),
nVersion,
hashPrevBlock.ToString().c_str(),
hashMerkleRoot.ToString().c_str(),
nTime, nBits, nNonce,
vtx.size());
for (unsigned int i = 0; i < vtx.size(); i++)
{
printf(" ");
vtx[i].print();
}
printf(" vMerkleTree: ");
for (unsigned int i = 0; i < vMerkleTree.size(); i++)
printf("%s ", vMerkleTree[i].ToString().c_str());
printf("\n");
}
/** Undo the effects of this block (with given index) on the UTXO set represented by coins.
* In case pfClean is provided, operation will try to be tolerant about errors, and *pfClean
* will be true if no problems were found. Otherwise, the return value will be false in case
* of problems. Note that in any case, coins may be modified. */
bool DisconnectBlock(CValidationState &state, CBlockIndex *pindex, CCoinsViewCache &coins, bool *pfClean = NULL);
// Apply the effects of this block (with given index) on the UTXO set represented by coins
bool ConnectBlock(CValidationState &state, CBlockIndex *pindex, CCoinsViewCache &coins, bool fJustCheck=false);
// Read a block from disk
bool ReadFromDisk(const CBlockIndex* pindex);
// Add this block to the block index, and if necessary, switch the active block chain to this
bool AddToBlockIndex(CValidationState &state, const CDiskBlockPos &pos);
// Context-independent validity checks
bool CheckBlock(CValidationState &state, bool fCheckPOW=true, bool fCheckMerkleRoot=true) const;
// Store block on disk
// if dbp is provided, the file is known to already reside on disk
bool AcceptBlock(CValidationState &state, CDiskBlockPos *dbp = NULL);
};
class CBlockFileInfo
{
public:
unsigned int nBlocks; // number of blocks stored in file
unsigned int nSize; // number of used bytes of block file
unsigned int nUndoSize; // number of used bytes in the undo file
unsigned int nHeightFirst; // lowest height of block in file
unsigned int nHeightLast; // highest height of block in file
uint64 nTimeFirst; // earliest time of block in file
uint64 nTimeLast; // latest time of block in file
IMPLEMENT_SERIALIZE(
READWRITE(VARINT(nBlocks));
READWRITE(VARINT(nSize));
READWRITE(VARINT(nUndoSize));
READWRITE(VARINT(nHeightFirst));
READWRITE(VARINT(nHeightLast));
READWRITE(VARINT(nTimeFirst));
READWRITE(VARINT(nTimeLast));
)
void SetNull() {
nBlocks = 0;
nSize = 0;
nUndoSize = 0;
nHeightFirst = 0;
nHeightLast = 0;
nTimeFirst = 0;
nTimeLast = 0;
}
CBlockFileInfo() {
SetNull();
}
std::string ToString() const {
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat("%Y-%m-%d", nTimeFirst).c_str(), DateTimeStrFormat("%Y-%m-%d", nTimeLast).c_str());
}
// update statistics (does not update nSize)
void AddBlock(unsigned int nHeightIn, uint64 nTimeIn) {
if (nBlocks==0 || nHeightFirst > nHeightIn)
nHeightFirst = nHeightIn;
if (nBlocks==0 || nTimeFirst > nTimeIn)
nTimeFirst = nTimeIn;
nBlocks++;
if (nHeightIn > nHeightFirst)
nHeightLast = nHeightIn;
if (nTimeIn > nTimeLast)
nTimeLast = nTimeIn;
}
};
extern CCriticalSection cs_LastBlockFile;
extern CBlockFileInfo infoLastBlockFile;
extern int nLastBlockFile;
enum BlockStatus {
BLOCK_VALID_UNKNOWN = 0,
BLOCK_VALID_HEADER = 1, // parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future
BLOCK_VALID_TREE = 2, // parent found, difficulty matches, timestamp >= median previous, checkpoint
BLOCK_VALID_TRANSACTIONS = 3, // only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids, sigops, size, merkle root
BLOCK_VALID_CHAIN = 4, // outputs do not overspend inputs, no double spends, coinbase output ok, immature coinbase spends, BIP30
BLOCK_VALID_SCRIPTS = 5, // scripts/signatures ok
BLOCK_VALID_MASK = 7,
BLOCK_HAVE_DATA = 8, // full block available in blk*.dat
BLOCK_HAVE_UNDO = 16, // undo data available in rev*.dat
BLOCK_HAVE_MASK = 24,
BLOCK_FAILED_VALID = 32, // stage after last reached validness failed
BLOCK_FAILED_CHILD = 64, // descends from failed block
BLOCK_FAILED_MASK = 96
};
/** The block chain is a tree shaped structure starting with the
* genesis block at the root, with each block potentially having multiple
* candidates to be the next block. pprev and pnext link a path through the
* main/longest chain. A blockindex may have multiple pprev pointing back
* to it, but pnext will only point forward to the longest branch, or will
* be null if the block is not part of the longest chain.
*/
class CBlockIndex
{
public:
// pointer to the hash of the block, if any. memory is owned by this CBlockIndex
const uint256* phashBlock;
// pointer to the index of the predecessor of this block
CBlockIndex* pprev;
// (memory only) pointer to the index of the *active* successor of this block
CBlockIndex* pnext;
// height of the entry in the chain. The genesis block has height 0
int nHeight;
// Which # file this block is stored in (blk?????.dat)
int nFile;
// Byte offset within blk?????.dat where this block's data is stored
unsigned int nDataPos;
// Byte offset within rev?????.dat where this block's undo data is stored
unsigned int nUndoPos;
// (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block
uint256 nChainWork;
// Number of transactions in this block.
// Note: in a potential headers-first mode, this number cannot be relied upon
unsigned int nTx;
// (memory only) Number of transactions in the chain up to and including this block
unsigned int nChainTx; // change to 64-bit type when necessary; won't happen before 2030
// Verification status of this block. See enum BlockStatus
unsigned int nStatus;
// block header
int nVersion;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
CBlockIndex()
{
phashBlock = NULL;
pprev = NULL;
pnext = NULL;
nHeight = 0;
nFile = 0;
nDataPos = 0;
nUndoPos = 0;
nChainWork = 0;
nTx = 0;
nChainTx = 0;
nStatus = 0;
nVersion = 0;
hashMerkleRoot = 0;
nTime = 0;
nBits = 0;
nNonce = 0;
}
CBlockIndex(CBlockHeader& block)
{
phashBlock = NULL;
pprev = NULL;
pnext = NULL;
nHeight = 0;
nFile = 0;
nDataPos = 0;
nUndoPos = 0;
nChainWork = 0;
nTx = 0;
nChainTx = 0;
nStatus = 0;
nVersion = block.nVersion;
hashMerkleRoot = block.hashMerkleRoot;
nTime = block.nTime;
nBits = block.nBits;
nNonce = block.nNonce;
}
CDiskBlockPos GetBlockPos() const {
CDiskBlockPos ret;
if (nStatus & BLOCK_HAVE_DATA) {
ret.nFile = nFile;
ret.nPos = nDataPos;
}
return ret;
}
CDiskBlockPos GetUndoPos() const {
CDiskBlockPos ret;
if (nStatus & BLOCK_HAVE_UNDO) {
ret.nFile = nFile;
ret.nPos = nUndoPos;
}
return ret;
}
CBlockHeader GetBlockHeader() const
{
CBlockHeader block;
block.nVersion = nVersion;
if (pprev)
block.hashPrevBlock = pprev->GetBlockHash();
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block;
}
uint256 GetBlockHash() const
{
return *phashBlock;
}
int64 GetBlockTime() const
{
return (int64)nTime;
}
CBigNum GetBlockWork() const
{
CBigNum bnTarget;
bnTarget.SetCompact(nBits);
if (bnTarget <= 0)
return 0;
return (CBigNum(1)<<256) / (bnTarget+1);
}
bool IsInMainChain() const
{
return (pnext || this == pindexBest);
}
bool CheckIndex() const
{
/** Scrypt is used for block proof-of-work, but for purposes of performance the index internally uses sha256.
* This check was considered unneccessary given the other safeguards like the genesis and checkpoints. */
return true; // return CheckProofOfWork(GetBlockHash(), nBits);
}
enum { nMedianTimeSpan=11 };
int64 GetMedianTimePast() const
{
int64 pmedian[nMedianTimeSpan];
int64* pbegin = &pmedian[nMedianTimeSpan];
int64* pend = &pmedian[nMedianTimeSpan];
const CBlockIndex* pindex = this;
for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)
*(--pbegin) = pindex->GetBlockTime();
std::sort(pbegin, pend);
return pbegin[(pend - pbegin)/2];
}
int64 GetMedianTime() const
{
const CBlockIndex* pindex = this;
for (int i = 0; i < nMedianTimeSpan/2; i++)
{
if (!pindex->pnext)
return GetBlockTime();
pindex = pindex->pnext;
}
return pindex->GetMedianTimePast();
}
/**
* Returns true if there are nRequired or more blocks of minVersion or above
* in the last nToCheck blocks, starting at pstart and going backwards.
*/
static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart,
unsigned int nRequired, unsigned int nToCheck);
std::string ToString() const
{
return strprintf("CBlockIndex(pprev=%p, pnext=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev, pnext, nHeight,
hashMerkleRoot.ToString().c_str(),
GetBlockHash().ToString().c_str());
}
void print() const
{
printf("%s\n", ToString().c_str());
}
};
struct CBlockIndexWorkComparator
{
bool operator()(CBlockIndex *pa, CBlockIndex *pb) {
if (pa->nChainWork > pb->nChainWork) return false;
if (pa->nChainWork < pb->nChainWork) return true;
if (pa->GetBlockHash() < pb->GetBlockHash()) return false;
if (pa->GetBlockHash() > pb->GetBlockHash()) return true;
return false; // identical blocks
}
};
/** Used to marshal pointers into hashes for db storage. */
class CDiskBlockIndex : public CBlockIndex
{
public:
uint256 hashPrev;
CDiskBlockIndex() {
hashPrev = 0;
}
explicit CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) {
hashPrev = (pprev ? pprev->GetBlockHash() : 0);
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(VARINT(nVersion));
READWRITE(VARINT(nHeight));
READWRITE(VARINT(nStatus));
READWRITE(VARINT(nTx));
if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO))
READWRITE(VARINT(nFile));
if (nStatus & BLOCK_HAVE_DATA)
READWRITE(VARINT(nDataPos));
if (nStatus & BLOCK_HAVE_UNDO)
READWRITE(VARINT(nUndoPos));
// block header
READWRITE(this->nVersion);
READWRITE(hashPrev);
READWRITE(hashMerkleRoot);
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);
)
uint256 GetBlockHash() const
{
CBlockHeader block;
block.nVersion = nVersion;
block.hashPrevBlock = hashPrev;
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block.GetHash();
}
std::string ToString() const
{
std::string str = "CDiskBlockIndex(";
str += CBlockIndex::ToString();
str += strprintf("\n hashBlock=%s, hashPrev=%s)",
GetBlockHash().ToString().c_str(),
hashPrev.ToString().c_str());
return str;
}
void print() const
{
printf("%s\n", ToString().c_str());
}
};
/** Capture information about block/transaction validation */
class CValidationState {
private:
enum mode_state {
MODE_VALID, // everything ok
MODE_INVALID, // network rule violation (DoS value may be set)
MODE_ERROR, // run-time error
} mode;
int nDoS;
bool corruptionPossible;
public:
CValidationState() : mode(MODE_VALID), nDoS(0), corruptionPossible(false) {}
bool DoS(int level, bool ret = false, bool corruptionIn = false) {
if (mode == MODE_ERROR)
return ret;
nDoS += level;
mode = MODE_INVALID;
corruptionPossible = corruptionIn;
return ret;
}
bool Invalid(bool ret = false) {
return DoS(0, ret);
}
bool Error() {
mode = MODE_ERROR;
return false;
}
bool Abort(const std::string &msg) {
AbortNode(msg);
return Error();
}
bool IsValid() {
return mode == MODE_VALID;
}
bool IsInvalid() {
return mode == MODE_INVALID;
}
bool IsError() {
return mode == MODE_ERROR;
}
bool IsInvalid(int &nDoSOut) {
if (IsInvalid()) {
nDoSOut = nDoS;
return true;
}
return false;
}
bool CorruptionPossible() {
return corruptionPossible;
}
};
/** Describes a place in the block chain to another node such that if the
* other node doesn't have the same branch, it can find a recent common trunk.
* The further back it is, the further before the fork it may be.
*/
class CBlockLocator
{
protected:
std::vector<uint256> vHave;
public:
CBlockLocator()
{
}
explicit CBlockLocator(const CBlockIndex* pindex)
{
Set(pindex);
}
explicit CBlockLocator(uint256 hashBlock)
{
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end())
Set((*mi).second);
}
CBlockLocator(const std::vector<uint256>& vHaveIn)
{
vHave = vHaveIn;
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(vHave);
)
void SetNull()
{
vHave.clear();
}
bool IsNull()
{
return vHave.empty();
}
void Set(const CBlockIndex* pindex)
{
vHave.clear();
int nStep = 1;
while (pindex)
{
vHave.push_back(pindex->GetBlockHash());
// Exponentially larger steps back
for (int i = 0; pindex && i < nStep; i++)
pindex = pindex->pprev;
if (vHave.size() > 10)
nStep *= 2;
}
vHave.push_back(hashGenesisBlock);
}
int GetDistanceBack()
{
// Retrace how far back it was in the sender's branch
int nDistance = 0;
int nStep = 1;
BOOST_FOREACH(const uint256& hash, vHave)
{
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
return nDistance;
}
nDistance += nStep;
if (nDistance > 10)
nStep *= 2;
}
return nDistance;
}
CBlockIndex* GetBlockIndex()
{
// Find the first block the caller has in the main chain
BOOST_FOREACH(const uint256& hash, vHave)
{
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
return pindex;
}
}
return pindexGenesisBlock;
}
uint256 GetBlockHash()
{
// Find the first block the caller has in the main chain
BOOST_FOREACH(const uint256& hash, vHave)
{
std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);
if (mi != mapBlockIndex.end())
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
return hash;
}
}
return hashGenesisBlock;
}
int GetHeight()
{
CBlockIndex* pindex = GetBlockIndex();
if (!pindex)
return 0;
return pindex->nHeight;
}
};
class CTxMemPool
{
public:
mutable CCriticalSection cs;
std::map<uint256, CTransaction> mapTx;
std::map<COutPoint, CInPoint> mapNextTx;
bool accept(CValidationState &state, CTransaction &tx, bool fCheckInputs, bool fLimitFree, bool* pfMissingInputs);
bool addUnchecked(const uint256& hash, const CTransaction &tx);
bool remove(const CTransaction &tx, bool fRecursive = false);
bool removeConflicts(const CTransaction &tx);
void clear();
void queryHashes(std::vector<uint256>& vtxid);
void pruneSpent(const uint256& hash, CCoins &coins);
unsigned long size()
{
LOCK(cs);
return mapTx.size();
}
bool exists(uint256 hash)
{
return (mapTx.count(hash) != 0);
}
CTransaction& lookup(uint256 hash)
{
return mapTx[hash];
}
};
extern CTxMemPool mempool;
struct CCoinsStats
{
int nHeight;
uint256 hashBlock;
uint64 nTransactions;
uint64 nTransactionOutputs;
uint64 nSerializedSize;
uint256 hashSerialized;
int64 nTotalAmount;
CCoinsStats() : nHeight(0), hashBlock(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0), hashSerialized(0), nTotalAmount(0) {}
};
/** Abstract view on the open txout dataset. */
class CCoinsView
{
public:
// Retrieve the CCoins (unspent transaction outputs) for a given txid
virtual bool GetCoins(const uint256 &txid, CCoins &coins);
// Modify the CCoins for a given txid
virtual bool SetCoins(const uint256 &txid, const CCoins &coins);
// Just check whether we have data for a given txid.
// This may (but cannot always) return true for fully spent transactions
virtual bool HaveCoins(const uint256 &txid);
// Retrieve the block index whose state this CCoinsView currently represents
virtual CBlockIndex *GetBestBlock();
// Modify the currently active block index
virtual bool SetBestBlock(CBlockIndex *pindex);
// Do a bulk modification (multiple SetCoins + one SetBestBlock)
virtual bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
// Calculate statistics about the unspent transaction output set
virtual bool GetStats(CCoinsStats &stats);
// As we use CCoinsViews polymorphically, have a virtual destructor
virtual ~CCoinsView() {}
};
/** CCoinsView backed by another CCoinsView */
class CCoinsViewBacked : public CCoinsView
{
protected:
CCoinsView *base;
public:
CCoinsViewBacked(CCoinsView &viewIn);
bool GetCoins(const uint256 &txid, CCoins &coins);
bool SetCoins(const uint256 &txid, const CCoins &coins);
bool HaveCoins(const uint256 &txid);
CBlockIndex *GetBestBlock();
bool SetBestBlock(CBlockIndex *pindex);
void SetBackend(CCoinsView &viewIn);
bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
bool GetStats(CCoinsStats &stats);
};
/** CCoinsView that adds a memory cache for transactions to another CCoinsView */
class CCoinsViewCache : public CCoinsViewBacked
{
protected:
CBlockIndex *pindexTip;
std::map<uint256,CCoins> cacheCoins;
public:
CCoinsViewCache(CCoinsView &baseIn, bool fDummy = false);
// Standard CCoinsView methods
bool GetCoins(const uint256 &txid, CCoins &coins);
bool SetCoins(const uint256 &txid, const CCoins &coins);
bool HaveCoins(const uint256 &txid);
CBlockIndex *GetBestBlock();
bool SetBestBlock(CBlockIndex *pindex);
bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
// Return a modifiable reference to a CCoins. Check HaveCoins first.
// Many methods explicitly require a CCoinsViewCache because of this method, to reduce
// copying.
CCoins &GetCoins(const uint256 &txid);
// Push the modifications applied to this cache to its base.
// Failure to call this method before destruction will cause the changes to be forgotten.
bool Flush();
// Calculate the size of the cache (in number of transactions)
unsigned int GetCacheSize();
private:
std::map<uint256,CCoins>::iterator FetchCoins(const uint256 &txid);
};
/** CCoinsView that brings transactions from a memorypool into view.
It does not check for spendings by memory pool transactions. */
class CCoinsViewMemPool : public CCoinsViewBacked
{
protected:
CTxMemPool &mempool;
public:
CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn);
bool GetCoins(const uint256 &txid, CCoins &coins);
bool HaveCoins(const uint256 &txid);
};
/** Global variable that points to the active CCoinsView (protected by cs_main) */
extern CCoinsViewCache *pcoinsTip;
/** Global variable that points to the active block tree (protected by cs_main) */
extern CBlockTreeDB *pblocktree;
struct CBlockTemplate
{
CBlock block;
std::vector<int64_t> vTxFees;
std::vector<int64_t> vTxSigOps;
};
#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_M_X64) || defined(__x86_64__) || defined(_M_AMD64)
extern unsigned int cpuid_edx;
#endif
/** Used to relay blocks as header + vector<merkle branch>
* to filtered nodes.
*/
class CMerkleBlock
{
public:
// Public only for unit testing
CBlockHeader header;
CPartialMerkleTree txn;
public:
// Public only for unit testing and relay testing
// (not relayed)
std::vector<std::pair<unsigned int, uint256> > vMatchedTxn;
// Create from a CBlock, filtering transactions according to filter
// Note that this will call IsRelevantAndUpdate on the filter for each transaction,
// thus the filter will likely be modified.
CMerkleBlock(const CBlock& block, CBloomFilter& filter);
IMPLEMENT_SERIALIZE
(
READWRITE(header);
READWRITE(txn);
)
};
#endif
| [
"admin@indocoin.net"
] | admin@indocoin.net |
4798d698ec7e16987d335bbe133c8adc93b6b05d | f8b56b711317fcaeb0fb606fb716f6e1fe5e75df | /Internal/SDK/BP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc_classes.h | 9c341625ceda5b9ee51b7a0c3a73055dce742105 | [] | no_license | zanzo420/SoT-SDK-CG | a5bba7c49a98fee71f35ce69a92b6966742106b4 | 2284b0680dcb86207d197e0fab6a76e9db573a48 | refs/heads/main | 2023-06-18T09:20:47.505777 | 2021-07-13T12:35:51 | 2021-07-13T12:35:51 | 385,600,112 | 0 | 0 | null | 2021-07-13T12:42:45 | 2021-07-13T12:42:44 | null | UTF-8 | C++ | false | false | 873 | h | #pragma once
// Name: Sea of Thieves, Version: 2.2.0.2
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc.BP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc_C
// 0x0000 (FullSize[0x0130] - InheritedSize[0x0130])
class UBP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc_C : public UItemDesc
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc.BP_fod_SplashTail_03_SeafoamRaw_00_a_ItemDesc_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
b4fcff27293878beaa94321151dfd8c5ca5aaac5 | 1f95e2144280d1ef46d4b62b49eaead585e3235e | /CRSInfoServer/AxPublic/AxReadWriteINI.h | 783551fb8552c8b4e0ca2dc3f335d7a0ffcc298d | [] | no_license | jack-liaojie/EQ_C- | 0a74ebe8399f897b1ae369c728ba4bd23e84c48b | 518b099c3cc55196d6c38500f36544ccd9aefb67 | refs/heads/master | 2022-12-03T01:26:11.061817 | 2020-08-05T15:53:28 | 2020-08-05T15:53:28 | 285,261,010 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,809 | h | #pragma once
class CAxReadWriteINI
{
public:
//-----------------------------------------------------------------
// Get application pathes.
//-----------------------------------------------------------------
public:
// the returned value is a pointer to an internal static buffer,
// which contains full dir path with a backslash at the end.
static LPCTSTR GetAppModulePath(LPCTSTR lpModuleName = NULL); //
//-----------------------------------------------------------------
// Ini file operations
//-----------------------------------------------------------------
public:
// Full pathname of the application's ini file.
// Following functions use this file if pszIniFile is NULL
static LPCTSTR GetIniFileName(); // return "CommonConfig.cfg" as file name
static CString GetAppConfigFile(); // return "[ApplicatinName].cfg" as file name
// Ini file write functions
static BOOL IniWriteString(LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteInt(LPCTSTR pszSection, LPCTSTR pszKey, INT nData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteLong(LPCTSTR pszSection, LPCTSTR pszKey, LONG lData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteDouble(LPCTSTR pszSection, LPCTSTR pszKey, double fData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteRect(LPCTSTR pszSection, LPCTSTR pszKey, RECT rcData, LPCTSTR pszIniFile = NULL);
static BOOL IniWritePoint(LPCTSTR pszSection, LPCTSTR pszKey, POINT ptData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteSize(LPCTSTR pszSection, LPCTSTR pszKey, SIZE siData, LPCTSTR pszIniFile = NULL);
static BOOL IniWriteColor(LPCTSTR pszSection, LPCTSTR pszKey, DWORD dwColor, LPCTSTR pszIniFile = NULL);
// Ini file read functions.
// Return FALSE if the key or valid value does not exist, the value in the variable is not changed.
static BOOL IniReadString(LPCTSTR pszSection, LPCTSTR pszKey, LPTSTR pszData, DWORD dwChars, LPCTSTR pszIniFile = NULL);
static BOOL IniReadString(LPCTSTR pszSection, LPCTSTR pszKey, CString& strData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadInt(LPCTSTR pszSection, LPCTSTR pszKey, INT& nData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadLong(LPCTSTR pszSection, LPCTSTR pszKey, LONG& lData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadDouble(LPCTSTR pszSection, LPCTSTR pszKey, double& fData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadRect(LPCTSTR pszSection, LPCTSTR pszKey, RECT& rcData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadPoint(LPCTSTR pszSection, LPCTSTR pszKey, POINT& ptData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadSize(LPCTSTR pszSection, LPCTSTR pszKey, SIZE& siData, LPCTSTR pszIniFile = NULL);
static BOOL IniReadColor(LPCTSTR pszSection, LPCTSTR pszKey, DWORD& dwColor, LPCTSTR pszIniFile = NULL);
};
| [
"274939380@QQ.com"
] | 274939380@QQ.com |
a59f372b2b0d9abcf9538c0e53c253c11cf09d66 | 6116ae26d6525c960b5a8dae43fa0eb097a85d20 | /src/tests/unit/tst_server/tst_server.cpp | 7f8ce97e864e5a799d7a45662673823f82197fb5 | [] | no_license | SfietKonstantin/harmony | c77710403a243e255725a6004bb829b6429a7294 | 0e5641fa2cb804c55c163a27d351e9b5ce414d12 | refs/heads/master | 2020-12-30T10:36:45.957499 | 2015-08-16T20:52:40 | 2015-08-16T20:52:40 | 29,784,614 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,356 | cpp | /*
* Copyright (C) 2014 Lucien XU <sfietkonstantin@free.fr>
*
* You may use this file under the terms of the BSD license as follows:
*
* "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.
* * The names of its contributors may not 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 <algorithm>
#include <QtTest/QtTest>
#include <QtTest/QSignalSpy>
#include <QtCore/QDebug>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <jsonwebtoken.h>
#include <iserver.h>
#include <iauthentificationservice.h>
#include <iextensionmanager.h>
Q_IMPORT_PLUGIN(HarmonyTestExtension)
using namespace harmony;
static const int PORT = 8080;
class TstServer: public QObject
{
Q_OBJECT
private:
static void handleSslErrors(QNetworkReply &reply)
{
connect(&reply, &QNetworkReply::sslErrors, [&reply](const QList<QSslError> &sslErrors) {
reply.ignoreSslErrors(sslErrors);
});
}
private Q_SLOTS:
void initTestCase()
{
Q_INIT_RESOURCE(harmony);
// Remove path to certificate
QDir dir {QStandardPaths::writableLocation(QStandardPaths::DataLocation)};
if (dir.exists()) {
dir.removeRecursively();
}
}
void testPing()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QCOMPARE(server->port(), PORT);
QVERIFY(server->start());
reply.reset(network.get(QNetworkRequest(QUrl("https://localhost:8080/ping"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("pong"));
server->stop();
reply.reset(network.get(QNetworkRequest(QUrl("https://localhost:8080/ping"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::ConnectionRefusedError);
}
void testAuthentification()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
bool changed {false};
IAuthentificationService::Ptr as = IAuthentificationService::create("test", [&changed](const std::string &) {
changed = true;
});
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
QNetworkRequest postRequest (QUrl("https://localhost:8080/authenticate"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", QString::fromStdString(as->password()));
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
reply.reset(network.post(postRequest, query));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QList<QByteArray> replySplitted = reply->readAll().split('.');
QCOMPARE(replySplitted.count(), 3);
QVERIFY(changed);
}
void testAuthentificationFailure()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
QNetworkRequest postRequest (QUrl("https://localhost:8080/authenticate"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", "test");
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
reply.reset(network.post(postRequest, query));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
void testMultiRequest()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply1 {};
std::unique_ptr<QNetworkReply> reply2 {};
std::unique_ptr<QNetworkReply> reply3 {};
bool changed {false};
IAuthentificationService::Ptr as = IAuthentificationService::create("test", [&changed](const std::string &) {
changed = true;
});
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
QNetworkRequest postRequest (QUrl("https://localhost:8080/authenticate"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", "test");
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
reply1.reset(network.post(postRequest, query));
handleSslErrors(*reply1);
reply2.reset(network.post(postRequest, query));
handleSslErrors(*reply2);
reply3.reset(network.post(postRequest, query));
handleSslErrors(*reply3);
while (!reply1->isFinished() || !reply2->isFinished() || !reply3->isFinished()) {
QTest::qWait(100);
}
QVERIFY(changed);
}
void testMultiRequest2()
{
QNetworkAccessManager network {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
QNetworkRequest postRequest (QUrl("https://localhost:8080/authenticate"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", QString::fromStdString(as->password()));
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
std::vector<std::unique_ptr<QNetworkReply>> replies;
for (int i = 0; i < 10; ++i) {
std::unique_ptr<QNetworkReply> reply {network.post(postRequest, query)};
handleSslErrors(*reply);
replies.push_back(std::move(reply));
}
while (!std::accumulate(std::begin(replies), std::end(replies), true,
[](bool finished, const std::unique_ptr<QNetworkReply> &reply) {
return finished && reply->isFinished();
})) {
QTest::qWait(100);
}
for (const std::unique_ptr<QNetworkReply> &reply : replies) {
QVERIFY(reply->isFinished());
}
int count = std::accumulate(std::begin(replies), std::end(replies), 0,
[](int count, const std::unique_ptr<QNetworkReply> &reply) {
return count + (reply->error() == QNetworkReply::NoError ? 1 : 0);
});
QCOMPARE(count, 1);
}
void testRequests()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
// Authorization
QNetworkRequest authorizationRequest (QUrl("https://localhost:8080/authenticate"));
authorizationRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", QString::fromStdString(as->password()));
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
reply.reset(network.post(authorizationRequest, query));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QByteArray token {"Bearer "};
QJsonDocument result {QJsonDocument::fromJson(reply->readAll())};
token.append(result.object().value("token").toString());
// Get
QNetworkRequest getRequest (QUrl("https://localhost:8080/api/test/test_get?string=test&int=3"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"int\":\"3\",\"string\":\"test\"},\"type\":\"get\"}"));
// Post
QJsonObject postData;
postData.insert("string", "test2");
postData.insert("int", 12345);
postData.insert("bool", true);
postData.insert("array", QJsonArray({"a", "b", "c"}));
QJsonDocument document {postData};
QNetworkRequest postRequest (QUrl("https://localhost:8080/api/test/test_post?string=test&int=3"));
postRequest.setRawHeader("Authorization", token);
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
reply.reset(network.post(postRequest, document.toJson(QJsonDocument::Compact)));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{\"array\":[\"a\",\"b\",\"c\"],\"bool\":true,\"int\":12345,\"string\":\"test2\"},\"name\":\"test_post\",\"params\":{\"int\":\"3\",\"string\":\"test\"},\"type\":\"post\"}"));
// Delete
QNetworkRequest deleteRequest (QUrl("https://localhost:8080/api/test/test_delete?string=test&int=3"));
deleteRequest.setRawHeader("Authorization", token);
reply.reset(network.deleteResource(deleteRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_delete\",\"params\":{\"int\":\"3\",\"string\":\"test\"},\"type\":\"delete\"}"));
// API
QNetworkRequest apiRequest (QUrl("https://localhost:8080/api/list"));
apiRequest.setRawHeader("Authorization", token);
reply.reset(network.get(apiRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
document = QJsonDocument::fromJson(reply->readAll());
QVERIFY(document.isArray());
QCOMPARE(document.array().count(), 1);
const QJsonObject &extension = document.array().first().toObject();
QCOMPARE(extension.value("id").toString(), QString("test"));
}
void testUnauthorizedRequests()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
// Get
reply.reset(network.get(QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// Post
QNetworkRequest postRequest (QUrl("https://localhost:8080/api/test/test_post"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
reply.reset(network.post(postRequest, "{}"));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// Delete
reply.reset(network.deleteResource(QNetworkRequest(QUrl("https://localhost:8080/api/test/test_delete"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// API
reply.reset(network.get(QNetworkRequest(QUrl("https://localhost:8080/api/list"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
void testUnauthorizedRequests2()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
// Get
QNetworkRequest getRequest (QUrl("https://localhost:8080/api/test/test_get"));
getRequest.setRawHeader("Authorization", "Bearer test");
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// Post
QNetworkRequest postRequest (QUrl("https://localhost:8080/api/test/test_post"));
postRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
postRequest.setRawHeader("Authorization", "Bearer test");
reply.reset(network.post(postRequest, "{}"));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// Delete
QNetworkRequest deleteRequest (QUrl("https://localhost:8080/api/test/test_delete"));
deleteRequest.setRawHeader("Authorization", "Bearer test");
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
// API
reply.reset(network.get(QNetworkRequest(QUrl("https://localhost:8080/api/list"))));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
void testStatusCode()
{
QNetworkAccessManager network {};
std::unique_ptr<QNetworkReply> reply {};
IAuthentificationService::Ptr as = IAuthentificationService::create("test");
IExtensionManager::Ptr em = IExtensionManager::create();
IServer::Ptr server = IServer::create(*as, *em, PORT);
QVERIFY(server->start());
// Authorization
QNetworkRequest authorizationRequest (QUrl("https://localhost:8080/authenticate"));
authorizationRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QJsonObject object;
object.insert("password", QString::fromStdString(as->password()));
QByteArray query = QJsonDocument(object).toJson(QJsonDocument::Compact);
reply.reset(network.post(authorizationRequest, query));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QByteArray token {"Bearer "};
QJsonDocument result {QJsonDocument::fromJson(reply->readAll())};
token.append(result.object().value("token").toString());
// Status 201
QNetworkRequest getRequest (QUrl("https://localhost:8080/api/test/test_get?status=201"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 201);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"201\"},\"type\":\"get\"}"));
// Status 202
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=202"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 202);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"202\"},\"type\":\"get\"}"));
// Status 204
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=204"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 204);
QVERIFY(reply->readAll().isEmpty()); // No content, even if content has been sent
// Status 401
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=401"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 401);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"401\"},\"type\":\"get\"}"));
// Status 403
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=403"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::ContentOperationNotPermittedError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 403);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"403\"},\"type\":\"get\"}"));
// Status 404
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=404"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::ContentNotFoundError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 404);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"404\"},\"type\":\"get\"}"));
// Non-standard status
getRequest = QNetworkRequest(QUrl("https://localhost:8080/api/test/test_get?status=12345"));
getRequest.setRawHeader("Authorization", token);
reply.reset(network.get(getRequest));
handleSslErrors(*reply);
while (!reply->isFinished()) {
QTest::qWait(100);
}
QCOMPARE(reply->error(), QNetworkReply::ProtocolInvalidOperationError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 400);
QCOMPARE(reply->readAll(), QByteArray("{\"body\":{},\"name\":\"test_get\",\"params\":{\"status\":\"12345\"},\"type\":\"get\"}"));
}
};
QTEST_MAIN(TstServer)
#include "tst_server.moc"
| [
"sfietkonstantin@free.fr"
] | sfietkonstantin@free.fr |
7f5d1c65f1bbac05dca316bef4fe7e64e2bdd000 | b3da88b96df80a5e87f04500b1a83c7d7f565727 | /Object_Oriented_Programming/Unified Project/Object Oriented Programming/Const_and_References.cpp | 60c078ef1f6e8b9876cf19b4a56a5bce237015e6 | [] | no_license | BarcinoLechiguino/Programming-II | 2e821ec46b663e96f8e9d1603daba0d445546757 | b792865aa34dbecd148223f9c84c35d31fb759bf | refs/heads/master | 2020-09-27T10:00:42.032948 | 2019-12-07T10:53:15 | 2019-12-07T10:53:15 | 226,490,807 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,909 | cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
typedef unsigned int uint;
//const Objects and Class Methods
class Foo
{
public:
int n;
Foo() : n(0){}
void set(int v) { n = v; }
int get() const { return n; }
};
//References
void increment(int& n) //The n parameter of the functio is declared as a reference.
{
++n;
}
//The standard of passing read only data
void foo(int n) { cout << n << endl; } // Makes a copy of n.
void bar(int *n) { cout << *n << endl; } // Does not make a copy but n can be nullptr.
void baz(int& n) { cout << n << endl; } // Does not make a copy but n cannot be nullptr.
void oof(const int& n) { cout << n << endl; } // Const reference that is read-only.
void ExamplesII()
{
//const Variables
const int a = 2; //"a" cannot be modified.
//const Pointers
int b = 4;
const int * p1 = &b; //Pointer to a constant data. Can change p1 (address) but cannot change *p1 (element).
int * const p2 = &b; //Constant pointer to a data. Cannot change p2 (address) but can can change *p2 (element).
const int * const p3 = &b; //Constant pointer to a constant data. Cannot change p3 (address) and cannot change *p3 (element) either.
//const Objects and Class Methods
const Foo f1; //We declare a const instance of the class foo.
Foo f2; //We declare an instance of the class foo.
int n1 = f1.get(); //We get a value from the class.
//f1.set(3); Would not compile due to the fact that f1 is const and void set is not.
f2.set(3); //We change the value of f2.
//References
int c = 3;
int& rc = c; //C is given an alias, which in this case is rc.
increment(c);
cout << rc << endl;
}
int doubleNumberino(uint& number)
{
number *= 2;
return number;
}
void CaR_ExerciseI()
{
uint numberino = 0;
cout << "Introduce a number from 0 to 100: " << endl;
cin >> numberino;
if (numberino > 100 || numberino < 0)
{
cout << "The introduced number is not within the range of 0 and 100." << endl;
return;
}
doubleNumberino(numberino);
cout << "The doubled value is: " << numberino << endl;
}
int misteriousFunction(const int * value)
{
value = 0;
return 0;
}
void CaR_ExerciseII()
{
int num = 5;
const int * ptr1 = #
misteriousFunction(ptr1);
cout << *ptr1 << endl;
}
struct Pirate
{
char const * name;
int lifeUnits;
};
struct Weapon
{
char const * name;
int damage;
};
void printPirateInfo(const Pirate &prt)
{
cout << "Pirate's name: " << prt.name << " HP: " << prt.lifeUnits << endl;
}
void printWeaponInfo(const Weapon &wpn)
{
cout << "Weapon's name: " << wpn.name << " Damage: " << wpn.damage << endl;
}
void attack(Pirate * lechuck, const Weapon &blade)
{
lechuck->lifeUnits -= blade.damage;
}
void CaR_ExerciseIII()
{
Pirate pirate = { "LeChuck", 100 };
Weapon weapon = { "Sword", 10 };
printPirateInfo(pirate);
printWeaponInfo(weapon);
attack(&pirate, weapon);
printPirateInfo(pirate);
} | [
"angotov@gmail.com"
] | angotov@gmail.com |
a571c9df3ade79ac9fdf9079919dfa669b3c1785 | 5988ea61f0a5b61fef8550601b983b46beba9c5d | /3rd/ACE-5.7.0/ACE_wrappers/examples/Export/dll.h | e95fd10fb7e9d176d0e051151cd028973a50852e | [
"MIT"
] | permissive | binghuo365/BaseLab | e2fd1278ee149d8819b29feaa97240dec7c8b293 | 2b7720f6173672efd9178e45c3c5a9283257732a | refs/heads/master | 2016-09-15T07:50:48.426709 | 2016-05-04T09:46:51 | 2016-05-04T09:46:51 | 38,291,364 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,322 | h | // $Id: dll.h 80826 2008-03-04 14:51:23Z wotte $
// To use the export macros with a DLL, a file will need to be
// created (see ACE_wrapper/bin/generate_export_file.pl) and
// included. This file defines Test_Export (and the
// TEST_SINGLETON_* macros).
#include "test_export.h"
#include "ace/Singleton.h"
#include "ace/Null_Mutex.h"
#define RETVAL 42
// To expose a function outside of a DLL, use the *_Export
// at the beginning of the function declaration.
Test_Export int test_function ();
// To expose data, put use the *Export at the beginning
// of the variable declaration. The extern is required when
// building static libraries.
extern Test_Export int test_variable;
// To expose a class, put the *_Export between "class"
// and the class name.
class Test_Export test_class
{
public:
int method ();
};
// ACE_Singleton and its relatives are special cases. The problem is
// that ACE_Singleton is a template. If the singleton is used in both
// the DLL and the executable linking the DLL, then two instances of
// the singleton will be used (which defeats the purpose of a Singleton).
//
// This occurs because the ACE_Singleton template is expanded in both
// places because Visual C++ and Borland C++ do this automatically by
// including the template source. This in turn creates two copies of
// the static member variable.
//
// So to get around this problem, the *_SINGLETON_DECLARE macro is
// used to instruct the compiler to not create the second copy in the
// program. This macro solution does not work for Borland C++, so for
// this compiler you must explicitly disable the template instantiation
// using a #pragma (or use the other workaround below).
//
// Another workaround for this is to not to expose the Singleton itself
// to the outside world, but to instead supply a function or static
// member function that returns the singleton to the executable
// (like get_dll_singleton () does below).
#if defined (__BORLANDC__)
# if !defined (TEST_BUILD_DLL)
# pragma option push -Jgx
# endif
#endif
TEST_SINGLETON_DECLARE (ACE_Singleton, test_class, ACE_Null_Mutex)
#if defined (__BORLANDC__)
# if !defined (TEST_BUILD_DLL)
# pragma option pop
# endif
#endif
typedef ACE_Singleton<test_class, ACE_Null_Mutex> TEST_SINGLETON;
Test_Export test_class *get_dll_singleton ();
| [
"binghuo365@hotmail.com"
] | binghuo365@hotmail.com |
b81febcc8a7c440f454cc88f68138b4bbb29bcda | eaab7e8e7c96cb4e7c7784716a4b55bbaff9bc4f | /Project 2/Sequence.cpp | 0d9f209a0971be8d31e1af3051a68bf30d5bee4f | [] | no_license | joeljgeorge/CS32 | 6341dfb9ca935ac706de06d254100d12aee4c97c | a4748ff817ffef3fa6fe081378a4008731ec1058 | refs/heads/master | 2021-08-30T04:00:59.191301 | 2017-12-15T23:47:17 | 2017-12-15T23:47:17 | 114,420,638 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,567 | cpp | // Sequence.cpp
#include "Sequence.h"
#include <iostream>
Sequence::Sequence()
: m_size(0)
{
head = nullptr;
tail = nullptr;
}
bool Sequence::insert(int pos, const ItemType& value)
{
if (pos < 0 || pos > size())//if position is negative or greater than the size of the array (i.e. it is beyond the last position), return false (bounds check)
return false;
uncheckedInsert(pos, value);
return true;
}
int Sequence::insert(const ItemType& value)
{
Node *navigator = head;
int pos;
for (pos = 0; pos < size(); pos++)//find position of first value that is less than or equal to passed in value
{
if (value <= navigator->value)
break;
navigator = navigator->next;
}
uncheckedInsert(pos, value);//insert value
return pos;
}
bool Sequence::erase(int pos)
{
if (pos < 0 || pos >= size())//bounds check
return false;
if (pos == 0 && size() == 1) {//if there's only one item in the list, delete the node and set head and tail to nullptr
delete head;
head = nullptr;
tail = nullptr;
m_size--;
return true;
}
if (pos == 0) //erasing node at beginning of linked list
{//IF THIS DOESN'T WORK, LOOK AT PAGE 141 OF COURSE READER!!!
Node *temp = head->next;//saving address of next node
delete head;
head = temp;//moving head to next node
head->prev = nullptr;
m_size--;
return true;
}
else if (pos == size() - 1)//erasing node at end of linked list
{
Node *temp = tail->prev;//saving address of previous node
delete tail;
tail = temp;//moving tail to previous node
tail->next = nullptr;
m_size--;
return true;
}
else {//erasing node in the middle
Node *temp = head;
for (int i = 0; i < pos; i++) {
temp = temp->next; //traversing through the linked list until temp points at node in desired position
}
temp->prev->next = temp->next;//set the next pointer of previous node to node that follows current node
temp->next->prev = temp->prev;//set the prev pointer of next node to node that precedes the current node
delete temp;//delete current node
temp = nullptr;
m_size--;
return true;
}
}
int Sequence::remove(const ItemType& value)
{
int numRemoved = 0;
Node *temp = head;
for (int i = 0; i < size(); i++) {
if (temp == nullptr)//probably unnecessary
break;
Node *placeHolder = temp->next;
if (temp->value == value) {//if node value equals parameter value, erase it, increment numRemoved, and decrement i to avoid skipping over nodes
erase(i);
numRemoved++;
i--;
}
temp = placeHolder;
}
return numRemoved;
}
bool Sequence::get(int pos, ItemType& value) const
{
if (pos < 0 || pos >= size())//bounds check
return false;
Node *temp = head;
for (int i = 0; i < pos; i++) {//traverse through array until temp points at node in desired position
temp = temp->next;
}
value = temp->value; //set value parameter equal to value of node
return true;
}
bool Sequence::set(int pos, const ItemType& value)
{
if (pos < 0 || pos >= size())//bounds check
return false;
Node *temp = head;
for (int i = 0; i < pos; i++) {//again, list traversal
temp = temp->next;
}
temp->value = value;//set value at node equal to parameter value
return true;
}
int Sequence::find(const ItemType& value) const
{
Node *temp = head;
for (int i = 0; i < size(); i++) {
if (temp->value == value)//if value of node equals value, return position of node
return i;
temp = temp->next;
}
return -1;
}
void Sequence::swap(Sequence& other)
{
Node *head_temp = this->head; //first, swap the head pointers of both lists
this->head = other.head;
other.head = head_temp;
Node *tail_temp = this->tail; //next, swap the tail pointers of both lists
this->tail = other.tail;
other.tail = tail_temp;
int tempSize = m_size; //finally, swap the sizes of both lists
m_size = other.m_size;
other.m_size = tempSize;
}
void Sequence::uncheckedInsert(int pos, const ItemType& value)
{
Node *p;
p = new Node;
p->value = value;
if (head == nullptr) {//if linked list is empty
head = p;//set head to point to node
p->prev = nullptr;
p->next = nullptr;
tail = p;//set tail to also point to node
m_size++;//increment size of list
}
else if (pos == size()) {//when trying to insert at end of linked list
tail->next = p;//make the node at the end of the list at new node
p->prev = tail; //set new node's prev pointer to the node that tail still points to
p->next = nullptr;//set new node's next pointer to nullptr
tail = p;//set tail to point to node p
m_size++;
}
else if (pos == 0) {//when trying to insert at beginning of linked list
p->prev = nullptr;//pretty similar protocol to that of insertion at end of list
p->next = head;
head->prev = p;
head = p;
m_size++;
}
else //when trying to insert a node somewhere in the middle
{
Node *temp = head;
for (int i = 0; i < pos; i++)
{
temp = temp->next;//traverse list until temp points at node in desired position
}
p->next = temp;//set new node's next pointer to temp
p->prev = temp->prev;//set new node's prev pointer to node that precedes temp
p->prev->next = p;//set next pointer of node preceding new node to p
p->next->prev = p;//set prev pointer of node that temp points to p
m_size++;
}
}
Sequence::~Sequence() {
Node *temp = head;
while (temp != nullptr) {//deallocating every node
Node *n = temp->next;
delete temp;
temp = n;
}
}
Sequence::Sequence(const Sequence &src) {
Node *srcNavigator = src.head;//create pointer to traverse src linked list
this->head = nullptr;//set current head pointer to nullptr (empty list)
this->tail = nullptr;//set current tail pointer to nullptr
Node *thisNavigator = this->head;//create pointer to traverse this linked list
this->m_size = src.size();//set current size to size of src linked list
for (int i = 0; i < this->m_size; i++)
{
if (i == 0) {//creating first node
Node *p = new Node;//create new node
this->head = p;//make head and tail point to it
this->tail = p;
p->value = srcNavigator->value;//set the value of this new node to the value of the first node in src linked list
p->prev = nullptr;//set prev and next to nullptr, as there are currently no other nodes
p->next = nullptr;
srcNavigator = srcNavigator->next;//move on to the next node in the linked list
thisNavigator = head;//set the traversal pointer for this list to point to the first node
}
else {
Node *p = new Node;//create new node
thisNavigator->next = p;//thisNavigator points to the previous node, so this sets the next value of the previous node to the new node created
p->value = srcNavigator->value;
p->prev = thisNavigator;//set prev data member to thisNavigator
p->next = nullptr;//set next to nullptr, as there is no node following this rn
tail = p;//set tail to this newly created node at the end
thisNavigator = thisNavigator->next;//move traversal pointer to this pointer
srcNavigator = srcNavigator->next;
}
}
}
Sequence& Sequence::operator=(const Sequence &src) {
if (this->head == src.head)//if aliased, do not do anything
return *this;
Node *temp = this->head;//delete all of the current nodes
while (temp != nullptr) {
Node *n = temp->next;
delete temp;
temp = n;
}
this->head = nullptr;
this->tail = nullptr;
//CODE FROM COPY CONSTRUCTOR
Node *srcNavigator = src.head;//create pointer to traverse src linked list
Node *thisNavigator = this->head;//create pointer to traverse this linked list
this->m_size = src.size();//set current size to size of src linked list
for (int i = 0; i < this->m_size; i++)
{
if (i == 0) {//creating first node
Node *p = new Node;//create new node
this->head = p;//make head and tail point to it
this->tail = p;
p->value = srcNavigator->value;//set the value of this new node to the value of the first node in src linked list
p->prev = nullptr;//set prev and next to nullptr, as there are currently no other nodes
p->next = nullptr;
srcNavigator = srcNavigator->next;//move on to the next node in the linked list
thisNavigator = head;//set the traversal pointer for this list to point to the first node
}
else {
Node *p = new Node;//create new node
thisNavigator->next = p;//thisNavigator points to the previous node, so this sets the next value of the previous node to the new node created
p->value = srcNavigator->value;
p->prev = thisNavigator;//set prev data member to thisNavigator
p->next = nullptr;//set next to nullptr, as there is no node following this rn
tail = p;//set tail to this newly created node at the end
thisNavigator = thisNavigator->next;//move traversal pointer to this pointer
srcNavigator = srcNavigator->next;
}
}
return *this;
}
void Sequence::dump() const {
Node *temp = head;
for (int i = 0; i < size(); i++) {
std::cerr << temp->value << std::endl;
temp = temp->next;
}
}
//non-member functions
int subsequence(const Sequence& seq1, const Sequence& seq2) {
if (seq2.size() > seq1.size() || seq2.size() == 0)//if seq2 is larger than seq1 or if seq2 is empty, return -1
return -1;
int i = 0, j = 0;
int count = 0;
while (j < seq1.size() && i < seq2.size()) {
ItemType temp1;
seq1.get(j, temp1);//get value of seq1 at position j
ItemType temp2;
seq2.get(i, temp2);//get value of seq2 at position i
if (temp1 == temp2) {//if the two values are equal, increment both to the next value and increment count
i++;
j++;
count++;
}
else {//if values are not equal, go back to the start of seq2 and set count back to 0
if (i == 0)//if we're already at the beginning of seq2, increment j++ so as to avoid an infinite loop
j++;
i = 0;
count = 0;
}
}
if (count != seq2.size())//if seq2 is a subsequence of seq1, count will be equal to the size of seq2. If this condition is not met, that means seq2...
return -1;//...is not a subsequence of seq1
else
return j - i;//if seq2 is a subsequence of seq1, i should be equal to the length of seq2, and j will be whatever position comes right after the end...
} //...of subsequence seq2. Subtracting i from j will give you the position at which the subsequence starts
void interleave(const Sequence& seq1, const Sequence& seq2, Sequence& result) {
int count = 1;//determines which sequence to copy value from (1 for seq1 and 2 for seq2)
int j = 0, k = 0;//tracking position through seq1 and seq2
Sequence result_temp;
for (int i = 0; i < seq1.size() + seq2.size(); i++) {//length of result should be the sum of the two sequences' sizes
if (count == 1) {//if count == 1, copy value from seq1...
if (j >= seq1.size()) {//...unless we've already accessed the last element in seq1
ItemType value;//in that case, copy value from seq2
seq2.get(k, value);
result_temp.insert(i, value);
k++;
}
else {//if we haven't gone through seq1 yet, copy the value from seq1
ItemType value;
seq1.get(j, value);
result_temp.insert(i, value);
j++;//increment j, so that next time we access seq1 we can copy the value in the next node
}
count++;//increment count, so that the next value will come from seq2 if possible
}
else if (count == 2) {//similar logic to above case, except applied to seq2 instead of seq1
if (k >= seq2.size()) {
ItemType value;
seq1.get(j, value);
result_temp.insert(i, value);
j++;
}
else {
ItemType value;
seq2.get(k, value);
result_temp.insert(i, value);
k++;
}
count--;//decrement count, so that the next value will come from seq1
}
}
result = result_temp;//copy result_temp into result
}
| [
"joelgeorge03@gmail.com"
] | joelgeorge03@gmail.com |
6276c5aa1bc1ebf72f26cbd2b92c191d367874a9 | 3144e4b6e9675da79bc7affea6e1ac68b379c9f0 | /src/qt/cornellieisaddressvalidator.h | bed3e38a4db736f89b830df5ffc9c0e78b827041 | [
"MIT"
] | permissive | Milanisius/cornellieis | e4b3cccb65de235f7accc89510f2988a734093b0 | 004100044453ff5e23d3bcaa74d392242ec6fcce | refs/heads/master | 2023-04-03T09:49:14.676096 | 2021-04-16T09:48:33 | 2021-04-16T09:48:33 | 358,549,741 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 919 | h | // Copyright (c) 2011-2014 The Cornellieis developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator, checks for valid characters and
* removes some whitespace.
*/
class CornellieisAddressEntryValidator : public QValidator
{
Q_OBJECT
public:
explicit CornellieisAddressEntryValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
/** Cornellieis address widget validator, checks for a valid cornellieis address.
*/
class CornellieisAddressCheckValidator : public QValidator
{
Q_OBJECT
public:
explicit CornellieisAddressCheckValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
#endif // BITCOINADDRESSVALIDATOR_H
| [
"milanisius@gmail.com"
] | milanisius@gmail.com |
d6adaa294f9d87fe66e16ea785f60f34a05e0757 | 19ac850b28564e2b2a61b283eed3a981b19ea5ce | /School KTU/SG/OOP_examples/courseGrade/studentType.cpp | 792d6d4b512705e9df90422b8a563797d0f769bc | [] | no_license | muhammet-mucahit/My-CPlusPlus-Studies | 03b1d29e9fbb3733e98ba79406f3b0484948df76 | 8ade7e263bb218252c3edc0655bbe3850fd26e0d | refs/heads/master | 2020-06-28T14:31:55.762214 | 2019-08-02T15:19:29 | 2019-08-02T15:19:29 | 200,255,928 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,868 | cpp |
#include "studentType.h"
void studentType::setInfo(string fName, string lName, int ID, int nOfCourses, bool isTPaid, courseType courses[]) {
int i;
personType::setName(fName,lName);
sId = ID;
isTuitionPaid = isTPaid;
numberOfCourses = nOfCourses ;
for(i = 0; i < numberOfCourses; i++)
coursesEnrolled[i] = courses[i];
sortCourses(); //sort the array coursesEnrolled
}
void studentType::print(double tuitionRate) {
int i;
cout<<"Student Name: ";
personType::print();
cout<<endl;
cout<<"Student ID: "<<sId<<endl;
cout<<"Number of courses enrolled: "
<<numberOfCourses<<endl;
cout<<endl;
cout<<left;
cout<<"Course No"<<setw(15)<<"Course Name" <<setw(8)<<"Credits" <<setw(6)<<"Grade"<<endl;
cout.unsetf(ios::left);
for(i = 0; i < numberOfCourses; i++)
coursesEnrolled[i].print(isTuitionPaid);
cout<<endl;
cout<<"Total number of credit hours: " <<getHoursEnrolled()<<endl;
cout<<fixed<<showpoint<<setprecision(2);
if(isTuitionPaid)
cout<<"Mid-Semester GPA: "<<getGpa()<<endl;
else
{
cout<<"*** Grades are being held for not paying "
<<"the tuition. ***"<<endl;
cout<<"Amount Due: "<<billingAmount(tuitionRate) <<endl;
}
cout<<"-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-"<<endl<<endl;
}
void studentType::print(ofstream& outp, double tuitionRate) {
int i;
string first;
string last;
personType::getName(first,last);
outp<<"Student Name: "<<first<<" "<<last<<endl;
outp<<"Student ID: "<<sId<<endl;
outp<<"Number of courses enrolled: "
<<numberOfCourses<<endl;
outp<<endl;
outp<<left;
outp<<"Course No"<<setw(15)<<" Course Name"
<<setw(8)<<"Credits"
<<setw(6)<<"Grade"<<endl;
outp.unsetf(ios::left);
for(i = 0; i < numberOfCourses; i++)
coursesEnrolled[i].print(outp,isTuitionPaid);
outp<<endl;
outp<<"Total number of credit hours: "
<<getHoursEnrolled()<<endl;
outp<<fixed<<showpoint<<setprecision(2);
if(isTuitionPaid)
outp<<"Mid-Semester GPA: "<<getGpa()<<endl;
else
{
outp<<"*** Grades are being held for not paying "
<<"the tuition. ***"<<endl;
outp<<"Amount Due: "<<billingAmount(tuitionRate)<<endl;
}
outp<<"-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-"<<endl<<endl;
}
studentType::studentType() {
}
int studentType::getHoursEnrolled() {
int totalCredits = 0;
int i;
for(i = 0; i < numberOfCourses; i++)
totalCredits += coursesEnrolled[i].getCredits();
return totalCredits;
}
double studentType::getGpa() {
int i;
double sum = 0.0;
for(i = 0; i < numberOfCourses; i++)
{
switch(coursesEnrolled[i].getGrade())
{
case 'A': sum += coursesEnrolled[i].getCredits() * 4;
break;
case 'B': sum += coursesEnrolled[i].getCredits() * 3;
break;
case 'C': sum += coursesEnrolled[i].getCredits() * 2;
break;
case 'D': sum += coursesEnrolled[i].getCredits() * 1;
break;
case 'F': sum += coursesEnrolled[i].getCredits() * 0;
break;
default: cout<<"Invalid Course Grade "<< coursesEnrolled[i].getGrade() <<endl;
}
}
return sum / getHoursEnrolled();
}
double studentType::billingAmount(double tuitionRate) {
return tuitionRate * getHoursEnrolled();
}
void studentType::sortCourses() {
int i,j;
int minIndex;
courseType tempCourse;
string course1;
string course2;
for(i = 0; i < numberOfCourses - 1; i++)
{
minIndex = i;
for(j = i + 1; j < numberOfCourses; j++)
{
coursesEnrolled[minIndex].getCourseNumber(course1);
coursesEnrolled[j].getCourseNumber(course2);
if(course1 > course2)
minIndex = j;
}//end for
tempCourse = coursesEnrolled[minIndex];
coursesEnrolled[minIndex] = coursesEnrolled[i];
coursesEnrolled[i] = tempCourse;
}
}
| [
"mucahit@zeo.org"
] | mucahit@zeo.org |
0c58ce2b4ba9d80bee6c6c6c670d8a4b47186c86 | 729266d893d7641e82d9b5fe0bc99f54c55820b7 | /ch7-item38.cc | 44054bd148d3607916b50f49891fdc8804cd1cf5 | [] | no_license | CppOpenSourceProjects/effective-modern-cpp-1 | 32b8c5e340954f20157e3a11fefaca17fbfe150a | 3c8902b2e8982f29a87ba4dcc444a0ef778307bf | refs/heads/master | 2021-01-11T06:36:15.330419 | 2015-10-22T06:51:13 | 2015-10-22T06:51:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 346 | cc | #include <vector>
#include <future>
std::vector<std::future<void>> futs;
class Widget {
public:
private:
std::shared_future<double> fut;
};
int calcValue() { return 0; }
int main()
{
{
std::packaged_task<int()>
pt(calcValue);
auto fut = pt.get_future();
std::thread t(std::move(pt));
t.join();
}
return 0;
}
| [
"luuvish@gmail.com"
] | luuvish@gmail.com |
cfebd4cda74a281a34a15535b059477b05bc1106 | d77c1546826f05aaeaced5671b997050d05916c8 | /Br_Sim.h | b9c4a739aeafa81c4d5484ba26951dc2c2397063 | [] | no_license | Davidelama/Brownian-Simulation | 0be46e7643e66bb84811d6942eca67d724c5d414 | c8854fe371ad85015fe0c45008f259db9732d53a | refs/heads/master | 2022-04-23T14:18:48.172194 | 2020-04-21T08:47:07 | 2020-04-21T08:47:07 | 256,529,033 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,569 | h | int Ntrial, N, Nsim, Neq, Ncell, Nmax, dim, Nneigh, Nmeas, Nhist, Nlevel, Nblock;
double L, sigma, rho, rc, T, dt, mu;
double *x, *y, *z, *vx, *vy, *vz, *fx, *fy, *fz;
int *cell_list_index, *hist;
int **cell_list, **neighbor;
class RanMars *random_mars;
void rand_init_pos();
void init_vel();
void init_output(FILE* &fout,FILE* &gout,FILE* &sfout, FILE* &zout, FILE* &drout); //here I pass by reference (&) a FILE* type (i.e. pointer to FILE), that allows me to treat the FILE* variable as a global one
void rescale_vel();
double dist(double x1, double y1, double z1, double x2, double y2, double z2);
void print_pos(int step);
void print_g(FILE* &gout);
void print_sf(FILE* &sfout);
void print_single_g(int step);
void print_cell(int step);
void print_block(double** &x_blk, double** &y_blk, double** &z_blk);
void latt_init_pos();
double calculate_force();
double calculate_kin();
double calculate_pot();
void print_SF();
double calculate_pressure();
void md_step();
void bd_step();
void init_cell_list();
void reinit_cell_list();
void test_cell(int step);
void close_output(FILE* &fout,FILE* &gout,FILE* &sfout, FILE* &zout, FILE* &drout);
void init_block(double** &x_blk, double** &y_blk, double** &z_blk, double* &Zx, double* &Zy, double* &Zz);
void block_corr(int step, double** &x_blk, double** &y_blk, double** &z_blk, double* &Zx, double* &Zy, double* &Zz, FILE* &zout);
void block_intg(int step, double** &x_blk, double** &y_blk, double** &z_blk, double* &Zx, double* &Zy, double* &Zz, FILE* &drout);
//remember damn ; at the end | [
"davide.breoni@outlook.it"
] | davide.breoni@outlook.it |
604ab7071fbea90d1119827666900cd9fc717eae | d56f8b19c6de1ea21b77647560fd99cded4fd267 | /src/util.cpp | c8e9815758ab2760abdda73c4bf156bdc55a46b5 | [
"MIT"
] | permissive | profitforall/PFA | a723116f2e1c9c6bbd6e55d220a57c0025459569 | 7302419647cff650edece88f6823c2ebc3e87d02 | refs/heads/main | 2023-08-31T07:57:03.936675 | 2021-09-29T01:01:32 | 2021-09-29T01:01:32 | 410,308,037 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,038 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "util.h"
#include "chainparamsbase.h"
#include "random.h"
#include "serialize.h"
#include "sync.h"
#include "utilstrencodings.h"
#include "utiltime.h"
#include <stdarg.h>
#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
#include <pthread.h>
#include <pthread_np.h>
#endif
#ifndef WIN32
// for posix_fallocate
#ifdef __linux__
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
#endif
#define _POSIX_C_SOURCE 200112L
#endif // __linux__
#include <algorithm>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#else
#ifdef _MSC_VER
#pragma warning(disable:4786)
#pragma warning(disable:4804)
#pragma warning(disable:4805)
#pragma warning(disable:4717)
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <io.h> /* for _commit */
#include <shlobj.h>
#endif
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/foreach.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
// Work around clang compilation problem in Boost 1.46:
// /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
// See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options
// http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION
namespace boost {
namespace program_options {
std::string to_internal(const std::string&);
}
} // namespace boost
// Application startup time (used for uptime calculation)
const int64_t nStartupTime = GetTime();
using namespace std;
const char * const BITCOIN_CONF_FILENAME = "profitforall.conf";
const char * const BITCOIN_PID_FILENAME = "profitforalld.pid";
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
bool fDebug = false;
bool fPrintToConsole = false;
bool fPrintToDebugLog = true;
bool fDaemon = false;
bool fServer = false;
string strMiscWarning;
bool fLogTimestamps = DEFAULT_LOGTIMESTAMPS;
bool fLogTimeMicros = DEFAULT_LOGTIMEMICROS;
bool fLogIPs = DEFAULT_LOGIPS;
std::atomic<bool> fReopenDebugLog(false);
CTranslationInterface translationInterface;
/** Init OpenSSL library multithreading support */
static CCriticalSection** ppmutexOpenSSL;
void locking_callback(int mode, int i, const char* file, int line) NO_THREAD_SAFETY_ANALYSIS
{
if (mode & CRYPTO_LOCK) {
ENTER_CRITICAL_SECTION(*ppmutexOpenSSL[i]);
} else {
LEAVE_CRITICAL_SECTION(*ppmutexOpenSSL[i]);
}
}
// Init
class CInit
{
public:
CInit()
{
// Init OpenSSL library multithreading support
ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*));
for (int i = 0; i < CRYPTO_num_locks(); i++)
ppmutexOpenSSL[i] = new CCriticalSection();
CRYPTO_set_locking_callback(locking_callback);
// OpenSSL can optionally load a config file which lists optional loadable modules and engines.
// We don't use them so we don't require the config. However some of our libs may call functions
// which attempt to load the config file, possibly resulting in an exit() or crash if it is missing
// or corrupt. Explicitly tell OpenSSL not to try to load the file. The result for our libs will be
// that the config appears to have been loaded and there are no modules/engines available.
OPENSSL_no_config();
#ifdef WIN32
// Seed OpenSSL PRNG with current contents of the screen
RAND_screen();
#endif
// Seed OpenSSL PRNG with performance counter
RandAddSeed();
}
~CInit()
{
// Securely erase the memory used by the PRNG
RAND_cleanup();
// Shutdown OpenSSL library multithreading support
CRYPTO_set_locking_callback(NULL);
for (int i = 0; i < CRYPTO_num_locks(); i++)
delete ppmutexOpenSSL[i];
OPENSSL_free(ppmutexOpenSSL);
}
}
instance_of_cinit;
/**
* LogPrintf() has been broken a couple of times now
* by well-meaning people adding mutexes in the most straightforward way.
* It breaks because it may be called by global destructors during shutdown.
* Since the order of destruction of static/global objects is undefined,
* defining a mutex as a global object doesn't work (the mutex gets
* destroyed, and then some later destructor calls OutputDebugStringF,
* maybe indirectly, and you get a core dump at shutdown trying to lock
* the mutex).
*/
static boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT;
/**
* We use boost::call_once() to make sure mutexDebugLog and
* vMsgsBeforeOpenLog are initialized in a thread-safe manner.
*
* NOTE: fileout, mutexDebugLog and sometimes vMsgsBeforeOpenLog
* are leaked on exit. This is ugly, but will be cleaned up by
* the OS/libc. When the shutdown sequence is fully audited and
* tested, explicit destruction of these objects can be implemented.
*/
static FILE* fileout = NULL;
static boost::mutex* mutexDebugLog = NULL;
static list<string> *vMsgsBeforeOpenLog;
static int FileWriteStr(const std::string &str, FILE *fp)
{
return fwrite(str.data(), 1, str.size(), fp);
}
static void DebugPrintInit()
{
assert(mutexDebugLog == NULL);
mutexDebugLog = new boost::mutex();
vMsgsBeforeOpenLog = new list<string>;
}
void OpenDebugLog()
{
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
assert(fileout == NULL);
assert(vMsgsBeforeOpenLog);
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
fileout = fopen(pathDebug.string().c_str(), "a");
if (fileout) setbuf(fileout, NULL); // unbuffered
// dump buffered messages from before we opened the log
while (!vMsgsBeforeOpenLog->empty()) {
FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);
vMsgsBeforeOpenLog->pop_front();
}
delete vMsgsBeforeOpenLog;
vMsgsBeforeOpenLog = NULL;
}
bool LogAcceptCategory(const char* category)
{
if (category != NULL)
{
if (!fDebug)
return false;
// Give each thread quick access to -debug settings.
// This helps prevent issues debugging global destructors,
// where mapMultiArgs might be deleted before another
// global destructor calls LogPrint()
static boost::thread_specific_ptr<set<string> > ptrCategory;
if (ptrCategory.get() == NULL)
{
const vector<string>& categories = mapMultiArgs["-debug"];
ptrCategory.reset(new set<string>(categories.begin(), categories.end()));
// thread_specific_ptr automatically deletes the set when the thread ends.
}
const set<string>& setCategories = *ptrCategory.get();
// if not debugging everything and not debugging specific category, LogPrint does nothing.
if (setCategories.count(string("")) == 0 &&
setCategories.count(string("1")) == 0 &&
setCategories.count(string(category)) == 0)
return false;
}
return true;
}
/**
* fStartedNewLine is a state variable held by the calling context that will
* suppress printing of the timestamp when multiple calls are made that don't
* end in a newline. Initialize it to true, and hold it, in the calling context.
*/
static std::string LogTimestampStr(const std::string &str, bool *fStartedNewLine)
{
string strStamped;
if (!fLogTimestamps)
return str;
if (*fStartedNewLine) {
int64_t nTimeMicros = GetLogTimeMicros();
strStamped = DateTimeStrFormat("%Y-%m-%d %H:%M:%S", nTimeMicros/1000000);
if (fLogTimeMicros)
strStamped += strprintf(".%06d", nTimeMicros%1000000);
strStamped += ' ' + str;
} else
strStamped = str;
if (!str.empty() && str[str.size()-1] == '\n')
*fStartedNewLine = true;
else
*fStartedNewLine = false;
return strStamped;
}
int LogPrintStr(const std::string &str)
{
int ret = 0; // Returns total number of characters written
static bool fStartedNewLine = true;
string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
if (fPrintToConsole)
{
// print to console
ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout);
fflush(stdout);
}
else if (fPrintToDebugLog)
{
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
// buffer if we haven't opened the log yet
if (fileout == NULL) {
assert(vMsgsBeforeOpenLog);
ret = strTimestamped.length();
vMsgsBeforeOpenLog->push_back(strTimestamped);
}
else
{
// reopen the log file, if requested
if (fReopenDebugLog) {
fReopenDebugLog = false;
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL)
setbuf(fileout, NULL); // unbuffered
}
ret = FileWriteStr(strTimestamped, fileout);
}
}
return ret;
}
/** Interpret string as boolean, for argument parsing */
static bool InterpretBool(const std::string& strValue)
{
if (strValue.empty())
return true;
return (atoi(strValue) != 0);
}
/** Turn -noX into -X=0 */
static void InterpretNegativeSetting(std::string& strKey, std::string& strValue)
{
if (strKey.length()>3 && strKey[0]=='-' && strKey[1]=='n' && strKey[2]=='o')
{
strKey = "-" + strKey.substr(3);
strValue = InterpretBool(strValue) ? "0" : "1";
}
}
void ParseParameters(int argc, const char* const argv[])
{
mapArgs.clear();
mapMultiArgs.clear();
for (int i = 1; i < argc; i++)
{
std::string str(argv[i]);
std::string strValue;
size_t is_index = str.find('=');
if (is_index != std::string::npos)
{
strValue = str.substr(is_index+1);
str = str.substr(0, is_index);
}
#ifdef WIN32
boost::to_lower(str);
if (boost::algorithm::starts_with(str, "/"))
str = "-" + str.substr(1);
#endif
if (str[0] != '-')
break;
// Interpret --foo as -foo.
// If both --foo and -foo are set, the last takes effect.
if (str.length() > 1 && str[1] == '-')
str = str.substr(1);
InterpretNegativeSetting(str, strValue);
mapArgs[str] = strValue;
mapMultiArgs[str].push_back(strValue);
}
}
std::string GetArg(const std::string& strArg, const std::string& strDefault)
{
if (mapArgs.count(strArg))
return mapArgs[strArg];
return strDefault;
}
int64_t GetArg(const std::string& strArg, int64_t nDefault)
{
if (mapArgs.count(strArg))
return atoi64(mapArgs[strArg]);
return nDefault;
}
bool GetBoolArg(const std::string& strArg, bool fDefault)
{
if (mapArgs.count(strArg))
return InterpretBool(mapArgs[strArg]);
return fDefault;
}
bool SoftSetArg(const std::string& strArg, const std::string& strValue)
{
if (mapArgs.count(strArg))
return false;
mapArgs[strArg] = strValue;
return true;
}
bool SoftSetBoolArg(const std::string& strArg, bool fValue)
{
if (fValue)
return SoftSetArg(strArg, std::string("1"));
else
return SoftSetArg(strArg, std::string("0"));
}
static const int screenWidth = 79;
static const int optIndent = 2;
static const int msgIndent = 7;
std::string HelpMessageGroup(const std::string &message) {
return std::string(message) + std::string("\n\n");
}
std::string HelpMessageOpt(const std::string &option, const std::string &message) {
return std::string(optIndent,' ') + std::string(option) +
std::string("\n") + std::string(msgIndent,' ') +
FormatParagraph(message, screenWidth - msgIndent, msgIndent) +
std::string("\n\n");
}
static std::string FormatException(const std::exception* pex, const char* pszThread)
{
#ifdef WIN32
char pszModule[MAX_PATH] = "";
GetModuleFileNameA(NULL, pszModule, sizeof(pszModule));
#else
const char* pszModule = "profitforall";
#endif
if (pex)
return strprintf(
"EXCEPTION: %s \n%s \n%s in %s \n", typeid(*pex).name(), pex->what(), pszModule, pszThread);
else
return strprintf(
"UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread);
}
void PrintExceptionContinue(const std::exception* pex, const char* pszThread)
{
std::string message = FormatException(pex, pszThread);
LogPrintf("\n\n************************\n%s\n", message);
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
}
boost::filesystem::path GetDefaultDataDir()
{
namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\ProfitForAll
// Windows >= Vista: C:\Users\Username\AppData\Roaming\ProfitForAll
// Mac: ~/Library/Application Support/ProfitForAll
// Unix: ~/.profitforall
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "ProfitForAll";
#else
fs::path pathRet;
char* pszHome = getenv("HOME");
if (pszHome == NULL || strlen(pszHome) == 0)
pathRet = fs::path("/");
else
pathRet = fs::path(pszHome);
#ifdef MAC_OSX
// Mac
return pathRet / "Library/Application Support/ProfitForAll";
#else
// Unix
return pathRet / ".profitforall";
#endif
#endif
}
static boost::filesystem::path pathCached;
static boost::filesystem::path pathCachedNetSpecific;
static CCriticalSection csPathCached;
const boost::filesystem::path &GetDataDir(bool fNetSpecific)
{
namespace fs = boost::filesystem;
LOCK(csPathCached);
fs::path &path = fNetSpecific ? pathCachedNetSpecific : pathCached;
// This can be called during exceptions by LogPrintf(), so we cache the
// value so we don't have to do memory allocations after that.
if (!path.empty())
return path;
if (mapArgs.count("-datadir")) {
path = fs::system_complete(mapArgs["-datadir"]);
if (!fs::is_directory(path)) {
path = "";
return path;
}
} else {
path = GetDefaultDataDir();
}
if (fNetSpecific)
path /= BaseParams().DataDir();
fs::create_directories(path);
return path;
}
void ClearDatadirCache()
{
pathCached = boost::filesystem::path();
pathCachedNetSpecific = boost::filesystem::path();
}
boost::filesystem::path GetConfigFile()
{
boost::filesystem::path pathConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
if (!pathConfigFile.is_complete())
pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
void ReadConfigFile(map<string, string>& mapSettingsRet,
map<string, vector<string> >& mapMultiSettingsRet)
{
boost::filesystem::ifstream streamConfig(GetConfigFile());
if (!streamConfig.good())
return; // No bitcoin.conf file is OK
set<string> setOptions;
setOptions.insert("*");
for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
{
// Don't overwrite existing settings so command line settings override bitcoin.conf
string strKey = string("-") + it->string_key;
string strValue = it->value[0];
InterpretNegativeSetting(strKey, strValue);
if (mapSettingsRet.count(strKey) == 0)
mapSettingsRet[strKey] = strValue;
mapMultiSettingsRet[strKey].push_back(strValue);
}
// If datadir is changed in .conf file:
ClearDatadirCache();
}
#ifndef WIN32
boost::filesystem::path GetPidFile()
{
boost::filesystem::path pathPidFile(GetArg("-pid", BITCOIN_PID_FILENAME));
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
return pathPidFile;
}
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
{
FILE* file = fopen(path.string().c_str(), "w");
if (file)
{
fprintf(file, "%d\n", pid);
fclose(file);
}
}
#endif
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
{
#ifdef WIN32
return MoveFileExA(src.string().c_str(), dest.string().c_str(),
MOVEFILE_REPLACE_EXISTING) != 0;
#else
int rc = std::rename(src.string().c_str(), dest.string().c_str());
return (rc == 0);
#endif /* WIN32 */
}
/**
* Ignores exceptions thrown by Boost's create_directory if the requested directory exists.
* Specifically handles case where path p exists, but it wasn't possible for the user to
* write to the parent directory.
*/
bool TryCreateDirectory(const boost::filesystem::path& p)
{
try
{
return boost::filesystem::create_directory(p);
} catch (const boost::filesystem::filesystem_error&) {
if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p))
throw;
}
// create_directory didn't create the directory, it had to have existed already
return false;
}
void FileCommit(FILE *fileout)
{
fflush(fileout); // harmless if redundantly called
#ifdef WIN32
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(fileout));
FlushFileBuffers(hFile);
#else
#if defined(__linux__) || defined(__NetBSD__)
fdatasync(fileno(fileout));
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
fcntl(fileno(fileout), F_FULLFSYNC, 0);
#else
fsync(fileno(fileout));
#endif
#endif
}
bool TruncateFile(FILE *file, unsigned int length) {
#if defined(WIN32)
return _chsize(_fileno(file), length) == 0;
#else
return ftruncate(fileno(file), length) == 0;
#endif
}
/**
* this function tries to raise the file descriptor limit to the requested number.
* It returns the actual file descriptor limit (which may be more or less than nMinFD)
*/
int RaiseFileDescriptorLimit(int nMinFD) {
#if defined(WIN32)
return 2048;
#else
struct rlimit limitFD;
if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) {
if (limitFD.rlim_cur < (rlim_t)nMinFD) {
limitFD.rlim_cur = nMinFD;
if (limitFD.rlim_cur > limitFD.rlim_max)
limitFD.rlim_cur = limitFD.rlim_max;
setrlimit(RLIMIT_NOFILE, &limitFD);
getrlimit(RLIMIT_NOFILE, &limitFD);
}
return limitFD.rlim_cur;
}
return nMinFD; // getrlimit failed, assume it's fine
#endif
}
/**
* this function tries to make a particular range of a file allocated (corresponding to disk space)
* it is advisory, and the range specified in the arguments will never contain live data
*/
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
#if defined(WIN32)
// Windows-specific version
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));
LARGE_INTEGER nFileSize;
int64_t nEndPos = (int64_t)offset + length;
nFileSize.u.LowPart = nEndPos & 0xFFFFFFFF;
nFileSize.u.HighPart = nEndPos >> 32;
SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);
SetEndOfFile(hFile);
#elif defined(MAC_OSX)
// OSX specific version
fstore_t fst;
fst.fst_flags = F_ALLOCATECONTIG;
fst.fst_posmode = F_PEOFPOSMODE;
fst.fst_offset = 0;
fst.fst_length = (off_t)offset + length;
fst.fst_bytesalloc = 0;
if (fcntl(fileno(file), F_PREALLOCATE, &fst) == -1) {
fst.fst_flags = F_ALLOCATEALL;
fcntl(fileno(file), F_PREALLOCATE, &fst);
}
ftruncate(fileno(file), fst.fst_length);
#elif defined(__linux__)
// Version using posix_fallocate
off_t nEndPos = (off_t)offset + length;
posix_fallocate(fileno(file), 0, nEndPos);
#else
// Fallback version
// TODO: just write one byte per block
static const char buf[65536] = {};
fseek(file, offset, SEEK_SET);
while (length > 0) {
unsigned int now = 65536;
if (length < now)
now = length;
fwrite(buf, 1, now, file); // allowed to fail; this function is advisory anyway
length -= now;
}
#endif
}
void ShrinkDebugFile()
{
// Scroll debug.log if it's getting too big
boost::filesystem::path pathLog = GetDataDir() / "debug.log";
FILE* file = fopen(pathLog.string().c_str(), "r");
if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000)
{
// Restart the file with some of the end
std::vector <char> vch(200000,0);
fseek(file, -((long)vch.size()), SEEK_END);
int nBytes = fread(begin_ptr(vch), 1, vch.size(), file);
fclose(file);
file = fopen(pathLog.string().c_str(), "w");
if (file)
{
fwrite(begin_ptr(vch), 1, nBytes, file);
fclose(file);
}
}
else if (file != NULL)
fclose(file);
}
#ifdef WIN32
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate)
{
namespace fs = boost::filesystem;
char pszPath[MAX_PATH] = "";
if(SHGetSpecialFolderPathA(NULL, pszPath, nFolder, fCreate))
{
return fs::path(pszPath);
}
LogPrintf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n");
return fs::path("");
}
#endif
void runCommand(const std::string& strCommand)
{
int nErr = ::system(strCommand.c_str());
if (nErr)
LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr);
}
void RenameThread(const char* name)
{
#if defined(PR_SET_NAME)
// Only the first 15 characters are used (16 - NUL terminator)
::prctl(PR_SET_NAME, name, 0, 0, 0);
#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
pthread_set_name_np(pthread_self(), name);
#elif defined(MAC_OSX)
pthread_setname_np(name);
#else
// Prevent warnings for unused parameters...
(void)name;
#endif
}
void SetupEnvironment()
{
// On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
// may be invalid, in which case the "C" locale is used as fallback.
#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
try {
std::locale(""); // Raises a runtime error if current locale is invalid
} catch (const std::runtime_error&) {
setenv("LC_ALL", "C", 1);
}
#endif
// The path locale is lazy initialized and to avoid deinitialization errors
// in multithreading environments, it is set explicitly by the main thread.
// A dummy locale is used to extract the internal default locale, used by
// boost::filesystem::path, which is then used to explicitly imbue the path.
std::locale loc = boost::filesystem::path::imbue(std::locale::classic());
boost::filesystem::path::imbue(loc);
}
bool SetupNetworking()
{
#ifdef WIN32
// Initialize Windows Sockets
WSADATA wsadata;
int ret = WSAStartup(MAKEWORD(2,2), &wsadata);
if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2)
return false;
#endif
return true;
}
void SetThreadPriority(int nPriority)
{
#ifdef WIN32
SetThreadPriority(GetCurrentThread(), nPriority);
#else // WIN32
#ifdef PRIO_THREAD
setpriority(PRIO_THREAD, 0, nPriority);
#else // PRIO_THREAD
setpriority(PRIO_PROCESS, 0, nPriority);
#endif // PRIO_THREAD
#endif // WIN32
}
int GetNumCores()
{
#if BOOST_VERSION >= 105600
return boost::thread::physical_concurrency();
#else // Must fall back to hardware_concurrency, which unfortunately counts virtual cores
return boost::thread::hardware_concurrency();
#endif
}
std::string CopyrightHolders(const std::string& strPrefix)
{
std::string strCopyrightHolders =
strPrefix + "The Bitcoin Core developers" +
"\n" + strPrefix + "The Blackcoin developers" +
"\n" + strPrefix + "The Blackcoin More developers";
"\n" + strPrefix + "ProfitForAll developers";
return strCopyrightHolders;
}
// Obtain the application startup time (used for uptime calculation)
int64_t GetStartupTime()
{
return nStartupTime;
}
| [
"91382848+profitforall@users.noreply.github.com"
] | 91382848+profitforall@users.noreply.github.com |
9e681733d12bab232da0df4007502bb96a41403a | 920c4ef30727f0c51b5c9f00bdd9b923b541853e | /Code_Cpp/cppserver备份资料/code/common/source/include/cfg_data/clientData/clientData.h | b6bd88df7be53b82327a37fe67218497a1e12624 | [] | no_license | fishney/TDServer | 10e50cd156b9109816ddebde241614a28546842a | 19305fc7bf649a9add86146bd1bfd253efa6e9cb | refs/heads/master | 2023-03-16T22:24:45.802339 | 2017-10-19T07:02:56 | 2017-10-19T07:02:56 | null | 0 | 0 | null | null | null | null | IBM852 | C++ | false | false | 1,278 | h | /*----------------- clientData.h
*
* Copyright (C): 2016 MokyliníĄMokyqi
* Author : │┬┴┴
* Version : V1.0
* Date : 2016/5/20 17:24:21
*--------------------------------------------------------------
*
*------------------------------------------------------------*/
#pragma once
#include "stl/std_map.h"
#include "cfg_data/fileData/fileData.h"
/*************************************************************/
class CClientData
{
public:
enum
{
Version = 2016040801
};
struct _stClientData
{
uint32 uCrc;
std::string strData;
_stClientData()
{
uCrc = 0;
strData.clear();
}
};
public:
typedef stl_map<std::string,_stClientData> MAP_CLENT_DATA;
private:
MAP_CLENT_DATA m_mapData;
public:
virtual pc_str getFileName ()const { return "expend.dat"; }
virtual pc_str getXmlName ()const { return "cs_expend.xml"; }
public:
CClientData();
public:
inline const _stClientData* find (const std::string& strFileName) const { return m_mapData.find_(strFileName); }
public:
bool reLoad (std::string& strClientDataPath);
private:
bool onLoad (std::string& strClientDataPath,std::string& strFileName);
};
//-------------------------------------------------------------
extern CClientData g_clClientData;
| [
"haibo tang"
] | haibo tang |
5ee589250a872fc1a5479d86fdd15fdcf69c6b08 | 9d364070c646239b2efad7abbab58f4ad602ef7b | /platform/external/chromium_org/chrome/browser/services/gcm/fake_gcm_profile_service.h | eb0ed02f8024ac5095d9b2367451b9b8a2747363 | [
"BSD-3-Clause"
] | permissive | denix123/a32_ul | 4ffe304b13c1266b6c7409d790979eb8e3b0379c | b2fd25640704f37d5248da9cc147ed267d4771c2 | refs/heads/master | 2021-01-17T20:21:17.196296 | 2016-08-16T04:30:53 | 2016-08-16T04:30:53 | 65,786,970 | 0 | 2 | null | 2020-03-06T22:00:52 | 2016-08-16T04:15:54 | null | UTF-8 | C++ | false | false | 1,923 | h | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_
#define CHROME_BROWSER_SERVICES_GCM_FAKE_GCM_PROFILE_SERVICE_H_
#include <list>
#include <vector>
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "components/gcm_driver/gcm_driver.h"
namespace content {
class BrowserContext;
}
namespace gcm {
class FakeGCMProfileService : public GCMProfileService {
public:
static KeyedService* Build(content::BrowserContext* context);
explicit FakeGCMProfileService(Profile* profile);
virtual ~FakeGCMProfileService();
void RegisterFinished(const std::string& app_id,
const std::vector<std::string>& sender_ids);
void UnregisterFinished(const std::string& app_id);
void SendFinished(const std::string& app_id,
const std::string& receiver_id,
const GCMClient::OutgoingMessage& message);
void AddExpectedUnregisterResponse(GCMClient::Result result);
const GCMClient::OutgoingMessage& last_sent_message() const {
return last_sent_message_;
}
const std::string& last_receiver_id() const {
return last_receiver_id_;
}
const std::string& last_registered_app_id() const {
return last_registered_app_id_;
}
const std::vector<std::string>& last_registered_sender_ids() const {
return last_registered_sender_ids_;
}
void set_collect(bool collect) {
collect_ = collect;
}
private:
bool collect_;
std::string last_registered_app_id_;
std::vector<std::string> last_registered_sender_ids_;
std::list<GCMClient::Result> unregister_responses_;
GCMClient::OutgoingMessage last_sent_message_;
std::string last_receiver_id_;
DISALLOW_COPY_AND_ASSIGN(FakeGCMProfileService);
};
}
#endif
| [
"allegrant@mail.ru"
] | allegrant@mail.ru |
5854d2146466ad50f519643ac4c221c14dd91ce0 | ed45ea4470bcfc497e2584697d7842a540e04fd9 | /C++/gtest/gtest/catkin_gtest/src/ros_gtest/src/talker/main.cpp | 8b27072cab32d59b76e2d26b22653c232778ed75 | [] | no_license | cf-zhang/documents | ffcd8213587f8aa9c47406cf2491bf77beec9c33 | 8a4439932017b67fba7988ff7fadd9829bce1e4c | refs/heads/master | 2022-03-03T13:52:27.333343 | 2022-02-25T11:31:22 | 2022-02-25T11:31:22 | 154,789,912 | 11 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 257 | cpp | #include "rostalker.h"
int main(int argc, char **argv){
ros::init(argc, argv, "rosTalker");
ros_gtest::RosTalker rt;
ros::Rate loop_rate(5);
while(ros::ok()){
rt.talk("hello world");
loop_rate.sleep();
}
return 0;
}
| [
"cfzhang@forwardx.com"
] | cfzhang@forwardx.com |
cb7a609b0df4979d39e9c5e11d4b43db6dd1df25 | 1e182a138eae8be72594052ad78d4037a0ff1aba | /src/chord/src/DHT/NodeBucket.h | 527970c1aabbe6d225b5153441b64e6f5d46905f | [] | no_license | KitWong2048/VideoMesh | 63e56a8cecce7a61e3f6b4d9eacbb7446999a550 | 2057a8d648c50f82f757e2f19f50037d2f21b6e9 | refs/heads/master | 2020-03-13T04:04:10.302045 | 2018-04-26T05:47:04 | 2018-04-26T05:47:04 | 130,956,229 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,738 | h | /*
NodeBucket.h
Copyright (c) 2007 Hong Kong University of Science and Technology ("HKUST")
This source code is an intellectual property owned by HKUST and funded by
Innovation and Technology Fund (Ref No. GHP/045/05)
Permission is hereby granted, to any person and party obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the
Software with the rights to use, copy, modify and merge, subject to the
following conditions:
1. Commercial use of this source code or any derivatives works from this source
code in any form is not allowed
2. Redistribution of this source code or any derivatives works from this source
code in any form is not allowed
3. Any of these conditions can be waived if you get permission from the
copyright holder
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/** @file NodeBucket.h
* This file contains the class for making a list of nodes.
*/
#ifndef _H_NODE_BUCKET_
#define _H_NODE_BUCKET_
#include <list>
#include "../Util/Common.h"
#include "../Util/Mutex.h"
#include "../DHT/Node.h"
#include "../DHT/Logger.h"
namespace DHT{
/** Forward class definition the class Chord.
* @See Chord
*/
class Chord;
/** @class NodeBucket
* This class is a list of nodes. The nodes are arranged in clockwise direction with respect to a reference ID.
*/
class NodeBucket{
protected:
/** @var refID
* The reference ID for arranging the node.
*/
DHTNetworkID refID;
/** @var chord
* The chord network to which the nodes belong to.
*/
Chord* chord;
/** @var log
* The handle for logging.
*/
Logger* log;
/** @var nodes
* The list of nodes.
*/
list<Node*>* nodes;
/** @var nodesMutex
* Lock for controlling access to nodes.
*/
Util::Mutex nodesMutex;
/** @var bucketSize
* The maximum size of the node bucket.
*/
int bucketSize;
/** @fn virtual bool order(const DHTNetworkID& _lower, const DHTNetworkID& _middle, const DHTNetworkID& _upper, bool _lowerClosed = false, bool _upperClosed = false);
* @param _lower: the node on the lower bound.
* @param _middle: the node in the middle.
* @param _upper: the node on the upper bound.
* @param _lowerClosed: if the lower bound is closed, set this to true
* @param _upperClosed: if the upper bound is closed, set this to true
* @return true if _middle is in (_lower, _upper); false otherwise
* The order for arranging three nodes.
*/
virtual bool order(const DHTNetworkID& _lower, const DHTNetworkID& _middle, const DHTNetworkID& _upper, bool _lowerClosed = false, bool _upperClosed = false);
public:
NodeBucket(int _listSize, const DHTNetworkID& _refID, Chord& _chord);
NodeBucket(const NodeBucket& _nodeList);
virtual ~NodeBucket();
/** @fn int getSize();
* @return the current size of bucket
* Get the number of node inside the bucket.
*/
int getSize();
/** @fn Node* addNode(const Node& _node);
* @param _node: add a node to the bucket
* @return the node that is replaced by the new node
* Add a node to the bucket.
*/
Node* addNode(const Node& _node);
/** @fn Node* removeNode(const DHTNetworkID& _id);
* @param _id: the ID of the node to be removed
* @return the removed node if it exists
* Remove a node with certain ID.
*/
Node* removeNode(const DHTNetworkID& _id);
/** @fn Node* operator[](int _pos);
* @param _pos: the position of the desired
* @return a node at the position specified
* Get a node at a given position which is starting from zero.
*/
Node* operator[](int _pos);
/** @fn NodeBucket& operator=(const NodeBucket& _nodeList)
* Assignment operator overloading.
* Make a deep copy of the input object.
* @param _nodeList: the Node to be copied.
* @return a reference to the caller
*/
NodeBucket& operator=(const NodeBucket& _nodeList);
/** @fn void print(LogLevel _logLevel)
* @param _logLevel: Under what logging level should it prints out the message
* This function prints the details of the bucket.
*/
void print(Util::LogLevel _logLevel);
/** @fn Node** returnAllNodes();
* @return an array of Node* with last entry equals to NULL
* Get all the nodes in the bucket.
*/
Node** returnAllNodes();
/** @fn NodeBucket* clone()
* @return a deep copy of the instance which invokes this function
* This function gives a deep copy of the invoker.
*/
NodeBucket* clone();
/** @fn Node* getClosestSucc(const DHTNetworkID& _id);
* @param _id: the ID that the returned node succeeding to
* @return the node succeeding to a given ID
* Get the node succeeding to a given ID.
*/
Node* getClosestSucc(const DHTNetworkID& _id);
/** @fn Node* getClosestPred(const DHTNetworkID& _id);
* @param _id: the ID that the returned node preceding to
* @return the node preceding to a given ID
* Get the node preceding to a given ID.
*/
Node* getClosestPred(const DHTNetworkID& _id);
/** @fn bool isNodeExist(const Node& _node)
* @param _node: the node to check
* @return true if the node exist in the bucket.
* Check whether a certain node exists.
*/
bool isNodeExist(const Node& _node);
};
}
#endif
| [
"hjie.huang@gmail.com"
] | hjie.huang@gmail.com |
e1340a208d28aee55b6a44b98b82d01dd2149770 | afb8cdd50e05a7dcd39756cd4efc0a8fb36eb6b2 | /dbus_bindings/dbus-proxies.h | d602cb550459c0e48d7d3eef2c02b4811a7ea56a | [] | no_license | baorepo/hello_world | 562bd28bf68270ff3ba96333e4085aa76e7c6bb8 | e92cc5f1fd2fda691157ac6b17a8b0912aedd09c | refs/heads/master | 2020-04-06T17:45:29.069097 | 2018-11-16T03:32:02 | 2018-11-16T03:32:02 | 157,672,582 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 35,861 | h | // Automatic generation of D-Bus interfaces:
// - org.chromium.HelloWorldInterface
#ifndef ____CHROMEOS_DBUS_BINDING__DBUS_PROXIES_H
#define ____CHROMEOS_DBUS_BINDING__DBUS_PROXIES_H
#include <memory>
#include <string>
#include <vector>
#include <base/bind.h>
#include <base/callback.h>
#include <base/files/scoped_file.h>
#include <base/logging.h>
#include <base/macros.h>
#include <base/memory/ref_counted.h>
#include <brillo/any.h>
#include <brillo/dbus/dbus_method_invoker.h>
#include <brillo/dbus/dbus_property.h>
#include <brillo/dbus/dbus_signal_handler.h>
#include <brillo/dbus/file_descriptor.h>
#include <brillo/errors/error.h>
#include <brillo/variant_dictionary.h>
#include <dbus/bus.h>
#include <dbus/message.h>
#include <dbus/object_manager.h>
#include <dbus/object_path.h>
#include <dbus/object_proxy.h>
namespace org {
namespace chromium {
// Abstract interface proxy for org::chromium::HelloWorldInterface.
class HelloWorldInterfaceProxyInterface {
public:
virtual ~HelloWorldInterfaceProxyInterface() = default;
virtual bool AttemptHello(
const std::string& in_app_version,
const std::string& in_omaha_url,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void AttemptHelloAsync(
const std::string& in_app_version,
const std::string& in_omaha_url,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool AttemptHelloWithFlags(
const std::string& in_app_version,
const std::string& in_omaha_url,
int32_t in_flags,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void AttemptHelloWithFlagsAsync(
const std::string& in_app_version,
const std::string& in_omaha_url,
int32_t in_flags,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool AttemptInstall(
const std::string& in_dlc_request,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void AttemptInstallAsync(
const std::string& in_dlc_request,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool AttemptRollback(
bool in_powerwash,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void AttemptRollbackAsync(
bool in_powerwash,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool CanRollback(
bool* out_can_rollback,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void CanRollbackAsync(
const base::Callback<void(bool /*can_rollback*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool ResetStatus(
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void ResetStatusAsync(
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetStatus(
int64_t* out_last_checked_time,
double* out_progress,
std::string* out_current_operation,
std::string* out_new_version,
int64_t* out_new_size,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetStatusAsync(
const base::Callback<void(int64_t /*last_checked_time*/, double /*progress*/, const std::string& /*current_operation*/, const std::string& /*new_version*/, int64_t /*new_size*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool RebootIfNeeded(
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void RebootIfNeededAsync(
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool SetChannel(
const std::string& in_target_channel,
bool in_is_powerwash_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void SetChannelAsync(
const std::string& in_target_channel,
bool in_is_powerwash_allowed,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetChannel(
bool in_get_current_channel,
std::string* out_channel,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetChannelAsync(
bool in_get_current_channel,
const base::Callback<void(const std::string& /*channel*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool SetCohortHint(
const std::string& in_cohort_hint,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void SetCohortHintAsync(
const std::string& in_cohort_hint,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetCohortHint(
std::string* out_cohort_hint,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetCohortHintAsync(
const base::Callback<void(const std::string& /*cohort_hint*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool SetP2PHelloPermission(
bool in_enabled,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void SetP2PHelloPermissionAsync(
bool in_enabled,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetP2PHelloPermission(
bool* out_enabled,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetP2PHelloPermissionAsync(
const base::Callback<void(bool /*enabled*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool SetHelloOverCellularPermission(
bool in_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void SetHelloOverCellularPermissionAsync(
bool in_allowed,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool SetHelloOverCellularTarget(
const std::string& in_target_version,
int64_t in_target_size,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void SetHelloOverCellularTargetAsync(
const std::string& in_target_version,
int64_t in_target_size,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetHelloOverCellularPermission(
bool* out_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetHelloOverCellularPermissionAsync(
const base::Callback<void(bool /*allowed*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetDurationSinceHello(
int64_t* out_usec_wallclock,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetDurationSinceHelloAsync(
const base::Callback<void(int64_t /*usec_wallclock*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetPrevVersion(
std::string* out_prev_version,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetPrevVersionAsync(
const base::Callback<void(const std::string& /*prev_version*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetRollbackPartition(
std::string* out_rollback_partition_name,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetRollbackPartitionAsync(
const base::Callback<void(const std::string& /*rollback_partition_name*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetLastAttemptError(
int32_t* out_last_attempt_error,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetLastAttemptErrorAsync(
const base::Callback<void(int32_t /*last_attempt_error*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual bool GetEolStatus(
int32_t* out_eol_status,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void GetEolStatusAsync(
const base::Callback<void(int32_t /*eol_status*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) = 0;
virtual void RegisterStatusHelloSignalHandler(
const base::Callback<void(int64_t,
double,
const std::string&,
const std::string&,
int64_t)>& signal_callback,
dbus::ObjectProxy::OnConnectedCallback on_connected_callback) = 0;
virtual const dbus::ObjectPath& GetObjectPath() const = 0;
virtual dbus::ObjectProxy* GetObjectProxy() const = 0;
};
} // namespace chromium
} // namespace org
namespace org {
namespace chromium {
// Interface proxy for org::chromium::HelloWorldInterface.
class HelloWorldInterfaceProxy final : public HelloWorldInterfaceProxyInterface {
public:
HelloWorldInterfaceProxy(
const scoped_refptr<dbus::Bus>& bus,
const std::string& service_name) :
bus_{bus},
service_name_{service_name},
dbus_object_proxy_{
bus_->GetObjectProxy(service_name_, object_path_)} {
}
~HelloWorldInterfaceProxy() override {
}
void RegisterStatusHelloSignalHandler(
const base::Callback<void(int64_t,
double,
const std::string&,
const std::string&,
int64_t)>& signal_callback,
dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override {
brillo::dbus_utils::ConnectToSignal(
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"StatusHello",
signal_callback,
on_connected_callback);
}
void ReleaseObjectProxy(const base::Closure& callback) {
bus_->RemoveObjectProxy(service_name_, object_path_, callback);
}
const dbus::ObjectPath& GetObjectPath() const override {
return object_path_;
}
dbus::ObjectProxy* GetObjectProxy() const override {
return dbus_object_proxy_;
}
bool AttemptHello(
const std::string& in_app_version,
const std::string& in_omaha_url,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptHello",
error,
in_app_version,
in_omaha_url);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void AttemptHelloAsync(
const std::string& in_app_version,
const std::string& in_omaha_url,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptHello",
success_callback,
error_callback,
in_app_version,
in_omaha_url);
}
bool AttemptHelloWithFlags(
const std::string& in_app_version,
const std::string& in_omaha_url,
int32_t in_flags,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptHelloWithFlags",
error,
in_app_version,
in_omaha_url,
in_flags);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void AttemptHelloWithFlagsAsync(
const std::string& in_app_version,
const std::string& in_omaha_url,
int32_t in_flags,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptHelloWithFlags",
success_callback,
error_callback,
in_app_version,
in_omaha_url,
in_flags);
}
bool AttemptInstall(
const std::string& in_dlc_request,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptInstall",
error,
in_dlc_request);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void AttemptInstallAsync(
const std::string& in_dlc_request,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptInstall",
success_callback,
error_callback,
in_dlc_request);
}
bool AttemptRollback(
bool in_powerwash,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptRollback",
error,
in_powerwash);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void AttemptRollbackAsync(
bool in_powerwash,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"AttemptRollback",
success_callback,
error_callback,
in_powerwash);
}
bool CanRollback(
bool* out_can_rollback,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"CanRollback",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_can_rollback);
}
void CanRollbackAsync(
const base::Callback<void(bool /*can_rollback*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"CanRollback",
success_callback,
error_callback);
}
bool ResetStatus(
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"ResetStatus",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void ResetStatusAsync(
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"ResetStatus",
success_callback,
error_callback);
}
bool GetStatus(
int64_t* out_last_checked_time,
double* out_progress,
std::string* out_current_operation,
std::string* out_new_version,
int64_t* out_new_size,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetStatus",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_last_checked_time, out_progress, out_current_operation, out_new_version, out_new_size);
}
void GetStatusAsync(
const base::Callback<void(int64_t /*last_checked_time*/, double /*progress*/, const std::string& /*current_operation*/, const std::string& /*new_version*/, int64_t /*new_size*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetStatus",
success_callback,
error_callback);
}
bool RebootIfNeeded(
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"RebootIfNeeded",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void RebootIfNeededAsync(
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"RebootIfNeeded",
success_callback,
error_callback);
}
bool SetChannel(
const std::string& in_target_channel,
bool in_is_powerwash_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetChannel",
error,
in_target_channel,
in_is_powerwash_allowed);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void SetChannelAsync(
const std::string& in_target_channel,
bool in_is_powerwash_allowed,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetChannel",
success_callback,
error_callback,
in_target_channel,
in_is_powerwash_allowed);
}
bool GetChannel(
bool in_get_current_channel,
std::string* out_channel,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetChannel",
error,
in_get_current_channel);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_channel);
}
void GetChannelAsync(
bool in_get_current_channel,
const base::Callback<void(const std::string& /*channel*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetChannel",
success_callback,
error_callback,
in_get_current_channel);
}
bool SetCohortHint(
const std::string& in_cohort_hint,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetCohortHint",
error,
in_cohort_hint);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void SetCohortHintAsync(
const std::string& in_cohort_hint,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetCohortHint",
success_callback,
error_callback,
in_cohort_hint);
}
bool GetCohortHint(
std::string* out_cohort_hint,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetCohortHint",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_cohort_hint);
}
void GetCohortHintAsync(
const base::Callback<void(const std::string& /*cohort_hint*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetCohortHint",
success_callback,
error_callback);
}
bool SetP2PHelloPermission(
bool in_enabled,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetP2PHelloPermission",
error,
in_enabled);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void SetP2PHelloPermissionAsync(
bool in_enabled,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetP2PHelloPermission",
success_callback,
error_callback,
in_enabled);
}
bool GetP2PHelloPermission(
bool* out_enabled,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetP2PHelloPermission",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_enabled);
}
void GetP2PHelloPermissionAsync(
const base::Callback<void(bool /*enabled*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetP2PHelloPermission",
success_callback,
error_callback);
}
bool SetHelloOverCellularPermission(
bool in_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetHelloOverCellularPermission",
error,
in_allowed);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void SetHelloOverCellularPermissionAsync(
bool in_allowed,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetHelloOverCellularPermission",
success_callback,
error_callback,
in_allowed);
}
bool SetHelloOverCellularTarget(
const std::string& in_target_version,
int64_t in_target_size,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetHelloOverCellularTarget",
error,
in_target_version,
in_target_size);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error);
}
void SetHelloOverCellularTargetAsync(
const std::string& in_target_version,
int64_t in_target_size,
const base::Callback<void()>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"SetHelloOverCellularTarget",
success_callback,
error_callback,
in_target_version,
in_target_size);
}
bool GetHelloOverCellularPermission(
bool* out_allowed,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetHelloOverCellularPermission",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_allowed);
}
void GetHelloOverCellularPermissionAsync(
const base::Callback<void(bool /*allowed*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetHelloOverCellularPermission",
success_callback,
error_callback);
}
bool GetDurationSinceHello(
int64_t* out_usec_wallclock,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetDurationSinceHello",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_usec_wallclock);
}
void GetDurationSinceHelloAsync(
const base::Callback<void(int64_t /*usec_wallclock*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetDurationSinceHello",
success_callback,
error_callback);
}
bool GetPrevVersion(
std::string* out_prev_version,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetPrevVersion",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_prev_version);
}
void GetPrevVersionAsync(
const base::Callback<void(const std::string& /*prev_version*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetPrevVersion",
success_callback,
error_callback);
}
bool GetRollbackPartition(
std::string* out_rollback_partition_name,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetRollbackPartition",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_rollback_partition_name);
}
void GetRollbackPartitionAsync(
const base::Callback<void(const std::string& /*rollback_partition_name*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetRollbackPartition",
success_callback,
error_callback);
}
bool GetLastAttemptError(
int32_t* out_last_attempt_error,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetLastAttemptError",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_last_attempt_error);
}
void GetLastAttemptErrorAsync(
const base::Callback<void(int32_t /*last_attempt_error*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetLastAttemptError",
success_callback,
error_callback);
}
bool GetEolStatus(
int32_t* out_eol_status,
brillo::ErrorPtr* error,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
auto response = brillo::dbus_utils::CallMethodAndBlockWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetEolStatus",
error);
return response && brillo::dbus_utils::ExtractMethodCallResults(
response.get(), error, out_eol_status);
}
void GetEolStatusAsync(
const base::Callback<void(int32_t /*eol_status*/)>& success_callback,
const base::Callback<void(brillo::Error*)>& error_callback,
int timeout_ms = dbus::ObjectProxy::TIMEOUT_USE_DEFAULT) override {
brillo::dbus_utils::CallMethodWithTimeout(
timeout_ms,
dbus_object_proxy_,
"org.chromium.HelloWorldInterface",
"GetEolStatus",
success_callback,
error_callback);
}
private:
scoped_refptr<dbus::Bus> bus_;
std::string service_name_;
const dbus::ObjectPath object_path_{"/org/chromium/HelloWorld"};
dbus::ObjectProxy* dbus_object_proxy_;
DISALLOW_COPY_AND_ASSIGN(HelloWorldInterfaceProxy);
};
} // namespace chromium
} // namespace org
#endif // ____CHROMEOS_DBUS_BINDING__DBUS_PROXIES_H
| [
"baozhu.zuo@gmail.com"
] | baozhu.zuo@gmail.com |
8d3cf6c02123fc5c7ecf38a8b4a921b7a3aa28ed | b665a8cb647dce1cc89258903dc9ee55cd5c384c | /Sources/aaplus-v2.08/include/AAVSOP87_URA.h | 45936f66f9f877a944c64e71f0e6ac5d5c995fde | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | OmniBus/SwiftAA | 8baa80ddd179d0d844dd9612001360130a44c497 | 108c03bcb23ae72d395f451ef8010d078cce3c41 | refs/heads/master | 2021-06-30T10:12:00.908663 | 2020-10-09T04:38:24 | 2020-10-09T04:38:24 | 170,970,094 | 0 | 0 | MIT | 2020-10-09T04:38:25 | 2019-02-16T06:16:29 | C++ | UTF-8 | C++ | false | false | 1,490 | h | /*
Module : AAVSOP87_URA.h
Purpose: Implementation for the algorithms for VSOP87
Created: PJN / 13-09-2015
History: PJN / 13-09-2015 1. Initial public release.
Copyright (c) 2015 - 2019 by PJ Naughter (Web: www.naughter.com, Email: pjna@naughter.com)
All rights reserved.
Copyright / Usage Details:
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise)
when your product is released in binary form. You are allowed to modify the source code in any way you want
except you cannot modify the copyright details at the top of each module. If you want to distribute source
code with your application, then you are only allowed to distribute versions released by the author. This is
to maintain a single distribution point for the source code.
*/
/////////////////////// Macros / Defines //////////////////////////////////////
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef __AAVSOP87_URA_H__
#define __AAVSOP87_URA_H__
#ifndef AAPLUS_EXT_CLASS
#define AAPLUS_EXT_CLASS
#endif
////////////////////////////// Classes ////////////////////////////////////////
class AAPLUS_EXT_CLASS CAAVSOP87_Uranus
{
public:
static double A(double JD) noexcept;
static double L(double JD) noexcept;
static double K(double JD) noexcept;
static double H(double JD) noexcept;
static double Q(double JD) noexcept;
static double P(double JD) noexcept;
};
#endif //#ifndef __AAVSOP87_URA_H_
| [
"cedric@onekilopars.ec"
] | cedric@onekilopars.ec |
d2d1e07543d4f58a58c674af1f9b6696850ccc00 | 55f290e2a84baa90c0eac68481613894100eb3fe | /engine/world/scene_graph.h | 9972bce42e411c99eb71380d572431160dd8d3d9 | [
"MIT"
] | permissive | wibbe/crown | 520d07aeaff0d792f9f8c8f3e267baf026cfb405 | e4c837905bda9cd36710761bfc33dd45425cf0ea | refs/heads/master | 2021-01-18T01:46:32.338598 | 2014-10-17T11:08:21 | 2014-10-17T11:08:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,397 | h | /*
Copyright (c) 2013 Daniele Bartolini, Michele Rossi
Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "types.h"
#include "math_types.h"
#include "memory_types.h"
#include "unit_resource.h"
namespace crown
{
/// Represents a collection of nodes, possibly linked together to form a tree.
///
/// @ingroup World
struct SceneGraph
{
SceneGraph(Allocator& a, uint32_t index);
/// Creates the graph with @a count items.
/// @a name, @a local and @parent are the array containing the name of the nodes,
/// the local poses of the nodes and the links between the nodes respectively.
/// A parent of -1 means "no parent".
void create(const Matrix4x4& root, uint32_t count, const UnitNode* nodes);
/// Destroys the graph deallocating memory if necessary.
void destroy();
/// Returns the index of the node with the given @a name
int32_t node(const char* name) const;
/// @copydoc SceneGraph::node()
int32_t node(StringId32 name) const;
/// Returns whether the graph has the node with the given @a name.
bool has_node(const char* name) const;
/// Returns the number of nodes in the graph.
uint32_t num_nodes() const;
/// Returns whether the node @a child can be linked to @a parent.
bool can_link(int32_t child, int32_t parent) const;
/// Links the @a child node to the @a parent node.
/// After the linking the @a child pose is reset to identity.
/// @note The @a parent node must be either -1 (meaning no parent), or an index lesser than child.
void link(int32_t child, int32_t parent);
/// Unlinks the @a child node from its parent if it has any.
/// After unlinking, the @child local pose is set to its previous world pose.
void unlink(int32_t child);
/// Sets the local position, rotation or pose of the given @a node.
void set_local_position(int32_t node, const Vector3& pos);
/// @copydoc SceneGraph::set_local_position()
void set_local_rotation(int32_t node, const Quaternion& rot);
/// @copydoc SceneGraph::set_local_position()
void set_local_pose(int32_t node, const Matrix4x4& pose);
/// Returns the local position, rotation or pose of the given @a node.
Vector3 local_position(int32_t node) const;
/// @copydoc SceneGraph::local_position()
Quaternion local_rotation(int32_t node) const;
/// @copydoc SceneGraph::local_position()
Matrix4x4 local_pose(int32_t node) const;
/// Sets the world position, rotation or pose of the given @a node.
/// @note This should never be called by user code.
void set_world_position(int32_t node, const Vector3& pos);
/// @copydoc SceneGraph::set_world_position()
void set_world_rotation(int32_t node, const Quaternion& rot);
/// @copydoc SceneGraph::set_world_position()
void set_world_pose(int32_t node, const Matrix4x4& pose);
/// Returns the world position, rotation or pose of the given @a node.
Vector3 world_position(int32_t node) const;
/// @copydoc SceneGraph::world_position()
Quaternion world_rotation(int32_t node) const;
/// @copydoc SceneGraph::world_position()
Matrix4x4 world_pose(int32_t node) const;
/// Transforms local poses to world poses.
void update();
public:
/// Index into SceneGraphManager
Allocator* m_allocator;
uint32_t m_index;
uint32_t m_num_nodes;
uint8_t* m_flags;
Matrix4x4* m_world_poses;
Matrix4x4* m_local_poses;
int32_t* m_parents;
StringId32* m_names;
};
} // namespace crown
| [
"danyatk@gmail.com"
] | danyatk@gmail.com |
358068e6c21ffe75694bd0b41852f0da6afad128 | 757dc9f8c6d58b947ef449270cbe1c3253cb0902 | /Source/QuicksandEngine/Physics/PhysicsDebugDrawer.hpp | 1d0ad6db346df4468f559f2b8fd5725a00a3657c | [] | no_license | KevinMackenzie/AmberRabbit | bbe268d41ba83b3c6848f473f6a65c74bc41bcd5 | 803f1a57c235ae5ddbd864013e1328eee7ada283 | refs/heads/master | 2021-01-13T01:41:45.242855 | 2015-01-05T01:18:34 | 2015-01-05T01:18:34 | 21,077,167 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,265 | hpp | #ifndef QSE_PHYSICSDEBUGDRAWER_HPP
#define QSE_PHYSICSDEBUGDRAWER_HPP
#include "../../BulletPhysics/btBulletDynamicsCommon.h"
//////////////////////////////////////////////////////////////////////////////
// class BulletDebugDrawer - Chapter 17, page 605
//
// Bullet uses this object to draw debug information. This implementation
// of btIDebugDraw uses direct3D lines to represent the current state
// of the physics simulation
//
#pragma warning(disable : 4275)
class BulletDebugDrawer : public btIDebugDraw
{
DebugDrawModes m_DebugModes;
public:
// btIDebugDraw interface
virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color) override;
virtual void reportErrorWarning(const char* warningString) override;
virtual void draw3dText(const btVector3& location,const char* textString) override;
virtual void setDebugMode(int debugMode) override;
virtual int getDebugMode() const override;
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& color) override;
// [mrmike] Added post press to read PlayerOptions.xml to turn on physics debug options.
void ReadOptions(void);
};
#pragma warning(default : 4275)
#endif | [
"kjmack305@gmail.com"
] | kjmack305@gmail.com |
a8433c59cb78c617cf757d68bc61bd9220d5ec37 | ea046eaa55d452ef2760ae9934a9cb71a273b811 | /src/leaderboard.cpp | 9d8fbd1e1f87e32d8cd1cf4111c8c247679f897e | [
"MIT"
] | permissive | kanavkhanna/Battleship | 7ee05ae5ab4d4a9e6e30993f294f5e93adee2733 | d7859da32ecf5a871403f9b09f33b0e319cfb8b0 | refs/heads/master | 2022-12-10T06:17:00.148192 | 2020-05-06T21:00:29 | 2020-05-06T21:00:29 | 298,666,803 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,580 | cpp | //
// Created by Kanav Khanna on 4/26/20.
//
#include "battleship/leaderboard.h"
namespace battleship {
using std::string;
using std::vector;
LeaderBoard::LeaderBoard(const string& db_path) : db_{db_path} {
db_ << "CREATE TABLE if not exists leaderboard (\n"
" name TEXT NOT NULL,\n"
" score INTEGER NOT NULL\n"
");";
}
void LeaderBoard::AddScoreToLeaderBoard(const Player& player) {
db_ << "INSERT INTO leaderboard(name, score) VALUES (?,?);"
<<player.name
<<player.score;
}
vector<Player> GetPlayers(sqlite::database_binder* rows) {
vector<Player> players;
for (auto&& row : *rows) {
string name;
size_t score;
row >> name >> score;
Player player = {name, score};
players.push_back(player);
}
return players;
}
auto LeaderBoard::RetrieveHighScores(const size_t limit) -> vector<Player> {
auto rows = db_ << "SELECT name,score from leaderboard order by score desc limit ?;"
<<limit;
return GetPlayers(&rows);
}
auto LeaderBoard::RetrieveHighScores(const Player& player,
const size_t limit) -> vector<Player> {
auto rows = db_ << "select name,score from leaderboard where name = ? order by score desc limit ?;"
<<player.name<<limit;
return GetPlayers(&rows);
}
size_t LeaderBoard::RetrievePlayerScore(std::string name) {
auto row = db_ << "select max(score) from leaderboard where name = ?;"
<<name;
size_t score;
row >> score;
return (score + 1);
}
} // namespace battleship | [
"kanavk2@illinois.edu"
] | kanavk2@illinois.edu |
cd280f70e114b4f64fa2df0242c4c94989a7ef3d | 317f2542cd92aa527c2e17af5ef609887a298766 | /tools/target_10_2_0_1155/qnx6/usr/include/bb/pim/calendar/BbmConferencePreferredData.hpp | 997f1c9a96045f7d7e159f4a096ecc04d1e4d841 | [] | no_license | sborpo/bb10qnx | ec77f2a96546631dc38b8cc4680c78a1ee09b2a8 | 33a4b75a3f56806f804c7462d5803b8ab11080f4 | refs/heads/master | 2020-07-05T06:53:13.352611 | 2014-12-12T07:39:35 | 2014-12-12T07:39:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,082 | hpp |
/*!
* @copyright
* Copyright Research In Motion Limited, 2012-2013
* Research In Motion Limited. All rights reserved.
*/
#ifndef BB_PIM_CALENDAR_BBMCONFERENCEPREFERREDDATA_HPP
#define BB_PIM_CALENDAR_BBMCONFERENCEPREFERREDDATA_HPP
#include <bb/pim/Global>
#include <bb/pim/calendar/DataTypes>
#include <QSharedDataPointer>
#include <QString>
namespace bb {
namespace pim {
namespace calendar {
class BbmConferencePreferredDataPrivate;
/*!
* @brief The @c BbmConferencePreferredData class includes data for a BBM conference call.
*
* @details This class contains conference call information that's discovered by the BBM conference
* module. This information includes access code, moderator code, and so on.
*
* @see BbmConference
*
* @xmlonly
* <apigrouping group="App Integration/Calendar"/>
* <library name="bbpim"/>
* @endxmlonly
*
* @since BlackBerry 10.0.0
*/
class BB_PIM_EXPORT BbmConferencePreferredData {
public:
/*!
* @brief Constructs a new @c BbmConferencePreferredData.
*
* @since BlackBerry 10.0.0
*/
BbmConferencePreferredData();
/*!
* @brief Destroys this @c BbmConferencePreferredData.
*
* @since BlackBerry 10.0.0
*/
~BbmConferencePreferredData();
/*!
* @brief Copy constructor.
*
* @details This function constructs a @c BbmConferencePreferredData containing exactly the
* same values as the provided @c %BbmConferencePreferredData.
*
* @param other The @c %BbmConferencePreferredData to be copied.
*
* @since BlackBerry 10.0.0
*/
BbmConferencePreferredData(const BbmConferencePreferredData& other);
/*!
* @brief Assignment operator.
*
* @details This operator copies all values from the provided @c BbmConferencePreferredData
* into this @c %BbmConferencePreferredData.
*
* @param other The @c %BbmConferencePreferredData from which to copy all values.
*
* @return A reference to this @c %BbmConferencePreferredData.
*
* @since BlackBerry 10.0.0
*/
BbmConferencePreferredData& operator=(const BbmConferencePreferredData& other);
/*!
* @brief Retrieves the access code of this conference.
*
* @return The access code.
*
* @since BlackBerry 10.0.0
*/
QString accessCode() const;
/*!
* @brief Retrieves the access code for the moderator of this conference.
*
* @return The moderator access code.
*
* @since BlackBerry 10.0.0
*/
QString moderatorCode() const;
/*!
* @brief Indicates whether the current user is the moderator of this conference.
*
* @return @c true if the current user is the moderator, @c false otherwise.
*
* @since BlackBerry 10.0.0
*/
bool isModerator() const;
/*!
* @brief Retrieves the access code for participants of this conference.
*
* @return The participant access code.
*
* @since BlackBerry 10.0.0
*/
QString participantCode() const;
/*!
* @brief Retrieves the phone number for this conference.
*
* @return The phone number.
*
* @since BlackBerry 10.0.0
*/
QString phoneNumber() const;
/*!
* @brief Sets the access code for this conference.
*
* @param accessCode The new access code.
*
* @since BlackBerry 10.0.0
*/
void setAccessCode(const QString& accessCode);
/*!
* @brief Sets the moderator access code for this conference.
*
* @param moderatorCode The new moderator access code.
*
* @since BlackBerry 10.0.0
*/
void setModeratorCode(const QString& moderatorCode);
/*!
* @brief Sets whether the current user is the moderator of this conference.
*
* @param moderator If @c true the current user is the moderator, if @c false the current
* user is not the moderator.
*
* @since BlackBerry 10.0.0
*/
void setModerator(bool moderator);
/*!
* @brief Sets the participant access code for this conference.
*
* @param participantCode The new participant access code.
*
* @since BlackBerry 10.0.0
*/
void setParticipantCode(const QString& participantCode);
/*!
* @brief Sets the phone number for this conference.
*
* @param phoneNumber The new phone number.
*
* @since BlackBerry 10.0.0
*/
void setPhoneNumber(const QString& phoneNumber);
/*!
* @brief Indicates whether this @c BbmConferencePreferredData is valid.
*
* @details This function determines whether the attributes of this @c %BbmConferencePreferredData
* object have acceptable values.
*
* @return @c true if this @c %BbmConferencePreferredData is valid, @c false otherwise.
*
* @since BlackBerry 10.0.0
*/
bool isValid() const;
private:
QSharedDataPointer<BbmConferencePreferredDataPrivate> d_ptr;
};
} // namespace calendar
} // namespace pim
} // namespace bb
#endif // BB_PIM_CALENDAR_BBMCONFERENCEPREFERREDDATA_HPP
| [
"dev@dclark.us"
] | dev@dclark.us |
70f4aef0feef7e6eb983d21a63240aa5bbcec3f5 | 805c32c852574ae16b4f339aa6f8679a049d7ccc | /Player.hpp | 0cd2709d6354f81b87e1670ffa558ced12ec44dd | [] | no_license | piotrku91/Flooooow2D_Game | d2d1f0b8b04cb8198158e3a9f5703952a9fe0e97 | 7d7293e8d084b245e3d0800417896c0dbe738f0f | refs/heads/master | 2023-08-12T08:49:11.511930 | 2021-09-29T16:37:50 | 2021-09-29T16:37:50 | 411,060,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 215 | hpp | #pragma once
#include "Body.hpp"
class Player : public Body {
public:
Player(const sf::Texture& texture, float posX, float posY, float sizeX, float sizeY)
: Body(texture, posX, posY, sizeX, sizeY){};
}; | [
"piotrku91@github.com"
] | piotrku91@github.com |
75db408bdef42ae97a3d4c068eb53b3dc132850b | 65964baaae2c631c0b73716886d0eeae2013838b | /jump_game_II/jump_game_II.cpp | c360a52cd59bdad2dcbafc72c76fff5d1d1dfa20 | [] | no_license | try-your-best/leetcode | d3a5f53bee8e917b11f12c3f21b34fd11a7eafb3 | 859ff86a138d667a839adec0d352e39ae88a15da | refs/heads/master | 2016-09-15T20:33:30.394740 | 2014-10-13T14:42:28 | 2014-10-13T14:42:28 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 819 | cpp | /*
思路:一开始想到的是用DP。结果超时。看答案才知用贪心!
即每次都选择在当前跳跃次数下,下一步能跳跃到最远的点!
*/
class Solution {
public:
int jump(int A[], int n) {
int step_num = 0;//到达当前距离所用的最小跳跃次数。
int last_reached_distance = 0;//目前跳跃次数下,所能到达的最大距离。
int next_max_reached_distance = 0;//下一次跳跃所能到达的最大距离。
for(int i = 0; i < n; i++)
{
if(i > last_reached_distance)
{
last_reached_distance = next_max_reached_distance;
step_num++;
}
next_max_reached_distance = max(next_max_reached_distance,i+A[i]);
}
return step_num;
}
};
| [
"damonhao@qq.com"
] | damonhao@qq.com |
9a7c28797451840cf4cfe55f77252350008b4a4c | dc679291fd34186e69fd6186fe7c1fd346b5e360 | /src/Day 9 - Stream Processing/Main.cpp | 379802c0616a7707840ed6506aca61fbc401b01b | [] | no_license | Biendeo/Advent-Of-Code-2017 | 7087610e8898cc094a771930c12e54add4d454a6 | afbdf7271d64733e9431defd382b418e2cb1354e | refs/heads/master | 2021-08-31T16:34:58.332265 | 2017-12-21T06:51:06 | 2017-12-21T06:51:06 | 112,828,595 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 683 | cpp | // Day 9: Main.cpp
// Just begins the program's execution. For this program, you must pass the input file as a
// commandline argument to the program. That file will be read it. The file should be a single line
// of characters.
// Same deal as yesterday for structure. This one ended up being very brief.
#include <iostream>
#include "StreamProcessing.h"
int main(int argc, char* argv[]) {
using namespace Biendeo::AdventOfCode2017::Day9;
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " [input file]\n";
return 1;
}
StreamProcessing sp(argv[1]);
#ifndef AOC_PART2
std::cout << sp.Score() << "\n";
#else
std::cout << sp.Garbage() << "\n";
#endif
return 0;
} | [
"pantherman1996@gmail.com"
] | pantherman1996@gmail.com |
23e446769a2ad6f175d05c76ec7ad753d95a9a82 | 3850eac3882e8753be5f8d2d33bbc45f261141ab | /trees/vertical_traversal.cpp | dc3b9407fac08ff59d268f1b6fd6d0f1d9d00738 | [] | no_license | ankitkumarsamota121/geeksforgeeks_practice | 0f2ab48bc76dceadc465ad8bf588a70db053f83c | 27cbca1d44e2e6105ae8729ab9f4ea1b4a97d13c | refs/heads/master | 2023-02-07T14:58:37.107833 | 2021-01-03T11:55:47 | 2021-01-03T11:55:47 | 255,017,249 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,316 | cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
vector<int> verticalOrder(Node* root);
// Function to Build Tree
Node* buildTree(string str) {
// Corner Case
if (str.length() == 0 || str[0] == 'N')
return NULL;
// Creating vector of strings from input
// string after spliting by space
vector<string> ip;
istringstream iss(str);
for (string str; iss >> str;)
ip.push_back(str);
// Create the root of the tree
Node* root = newNode(stoi(ip[0]));
// Push the root to the queue
queue<Node*> queue;
queue.push(root);
// Starting from the second element
int i = 1;
while (!queue.empty() && i < ip.size()) {
// Get and remove the front of the queue
Node* currNode = queue.front();
queue.pop();
// Get the current node's value from the string
string currVal = ip[i];
// If the left child is not null
if (currVal != "N") {
// Create the left child for the current node
currNode->left = newNode(stoi(currVal));
// Push it to the queue
queue.push(currNode->left);
}
// For the right child
i++;
if (i >= ip.size())
break;
currVal = ip[i];
// If the right child is not null
if (currVal != "N") {
// Create the right child for the current node
currNode->right = newNode(stoi(currVal));
// Push it to the queue
queue.push(currNode->right);
}
i++;
}
return root;
}
// Function for Inorder Traversal
void printInorder(Node* root) {
if (!root)
return;
printInorder(root->left);
cout << root->data << " ";
printInorder(root->right);
}
int main() {
int t;
string tc;
getline(cin, tc);
t = stoi(tc);
while (t--) {
string s;
getline(cin, s);
// string c;
// getline(cin,c);
Node* root = buildTree(s);
vector<int> res = verticalOrder(root);
for (int i : res) cout << i << " ";
cout << endl;
}
return 0;
}
// } Driver Code Ends
/* A binary tree node has data, pointer to left child
and a pointer to right child
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
};
*/
// root: root node of the tree
vector<int> verticalOrder(Node* root) {
//Your code here
map<int, vector<int>> M;
int d = 0;
vector<int> V;
queue<pair<Node*, int>> Q;
Q.push({root, d});
while (!Q.empty()) {
auto temp = Q.front();
Q.pop();
d = temp.second;
Node* node = temp.first;
M[d].push_back(node->data);
if (node->left)
Q.push({node->left, d - 1});
if (node->right)
Q.push({node->right, d + 1});
}
for (auto p : M) {
for (auto x : p.second)
V.push_back(x);
}
return V;
}
| [
"ankitkumarsamota121@gmail.com"
] | ankitkumarsamota121@gmail.com |
2df0215d666689a28f3c4e11875024bb8f1c20c7 | 572580660d475027fa349e47a078479222066726 | /Server/kennel/Ecc_Common/opens/snmp++/snmp++/Snmp++/src/md5c.cpp | 8c3a7a6ee51dac7fec807e927ef82e3045f34783 | [] | no_license | SiteView/ecc82Server | 30bae118932435e226ade01bfbb05b662742e6dd | 084b06af3a7ca6c5abf5064e0d1f3f8069856d25 | refs/heads/master | 2021-01-10T21:11:37.487455 | 2013-01-16T09:22:02 | 2013-01-16T09:22:02 | 7,639,874 | 6 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 11,970 | cpp | /*_############################################################################
_##
_## md5c.cpp
_##
_## SNMP++v3.2.15
_## -----------------------------------------------
_## Copyright (c) 2001-2004 Jochen Katz, Frank Fock
_##
_## This software is based on SNMP++2.6 from Hewlett Packard:
_##
_## Copyright (c) 1996
_## Hewlett-Packard Company
_##
_## ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
_## Permission to use, copy, modify, distribute and/or sell this software
_## and/or its documentation is hereby granted without fee. User agrees
_## to display the above copyright notice and this license notice in all
_## copies of the software and any documentation of the software. User
_## agrees to assume all liability for the use of the software;
_## Hewlett-Packard and Jochen Katz make no representations about the
_## suitability of this software for any purpose. It is provided
_## "AS-IS" without warranty of any kind, either express or implied. User
_## hereby grants a royalty-free license to any and all derivatives based
_## upon this software code base.
_##
_## Stuttgart, Germany, Tue Jan 4 21:42:42 CET 2005
_##
_##########################################################################*/
char md5c_cpp_version[]="#(@) SNMP++ $Id: md5c.cpp,v 1.4 2004/03/03 23:11:21 katz Exp $";
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */
/* Copyright (C) 1991, RSA Data Security, Inc. All rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include "snmp_pp/md5.h"
#if !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SNMP_PP_NAMESPACE
namespace Snmp_pp {
#endif
/* Constants for MD5Transform routine.
*/
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
static void MD5Transform PROTO_LIST ((UINT4 [4], const unsigned char [64]));
static void Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int));
static void Decode PROTO_LIST ((UINT4 *, const unsigned char *, unsigned int));
static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
static unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* F, G, H and I are basic MD5 functions.
*/
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define I(x, y, z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits.
*/
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
Rotation is separate from addition to prevent recomputation.
*/
#define FF(a, b, c, d, x, s, ac) { \
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define GG(a, b, c, d, x, s, ac) { \
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define HH(a, b, c, d, x, s, ac) { \
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define II(a, b, c, d, x, s, ac) { \
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
/* MD5 initialization. Begins an MD5 operation, writing a new context.
*/
void MD5Init (MD5_CTX *context)
{
context->count[0] = context->count[1] = 0;
/* Load magic initialization constants.
*/
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
context->state[3] = 0x10325476;
}
/* MD5 block update operation. Continues an MD5 message-digest operation,
processing another message block, and updating the context.
*/
void MD5Update (MD5_CTX *context, /* context */
const unsigned char *input, /* input block */
const unsigned int inputLen) /* length of input block */
{
unsigned int i, index, partLen;
/* Compute number of bytes mod 64 */
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
/* Transform as many times as possible.
*/
if (inputLen >= partLen) {
MD5_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
/* Buffer remaining input */
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
}
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
the message digest and zeroizing the context.
*/
void MD5Final (
unsigned char digest[16], /* message digest */
MD5_CTX *context) /* context */
{
unsigned char bits[8];
unsigned int index, padLen;
/* Save number of bits */
Encode (bits, context->count, 8);
/* Pad out to 56 mod 64.
*/
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
MD5Update (context, PADDING, padLen);
/* Append length (before padding) */
MD5Update (context, bits, 8);
/* Store state in digest */
Encode (digest, context->state, 16);
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)context, 0, sizeof (*context));
}
/* MD5 basic transformation. Transforms state based on block.
*/
static void MD5Transform (
UINT4 state[4],
const unsigned char block[64])
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode (x, block, 64);
/* Round 1 */
FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
/* Round 2 */
GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
GG ( d, a, b, c, x[10], S22, 0x2441453); /* 22 */
GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
/* Round 3 */
HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
HH ( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
/* Round 4 */
II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)x, 0, sizeof (x));
}
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
a multiple of 4.
*/
static void Encode (
unsigned char *output,
UINT4 *input,
unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (unsigned char)(input[i] & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
a multiple of 4.
*/
static void Decode (
UINT4 *output,
const unsigned char *input,
unsigned int len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
static void MD5_memcpy (
POINTER output,
POINTER input,
unsigned int len)
{
memcpy(output, input, len);
}
static void MD5_memset (
POINTER output,
int value,
unsigned int len)
{
memset(output, value, len);
}
#ifdef SNMP_PP_NAMESPACE
}; // end of namespace Snmp_pp
#endif
#ifdef __cplusplus
}
#endif
#endif // !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
| [
"xingyu.cheng@dragonflow.com"
] | xingyu.cheng@dragonflow.com |
b16fdeee6e23075620355d9da72d8f946dc2907f | c3f2a0f3e0de7cf1177230c7912a54024e1ced2f | /instructions_label.h | 3cf48610011eefae5ce7beb50f97001f165794af | [] | no_license | ziqumu/ose | 46cd099818c9c6b8ca4b3b54cd61c7c32e0f7ba3 | 1861ea0c133710e67fc1de2fdd52d3a5057dc359 | refs/heads/master | 2021-01-01T05:50:04.233244 | 2014-02-25T12:18:19 | 2014-02-25T12:18:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 696 | h | #ifndef INSTRUCTIONSLABEL_H
#define INSTRUCTIONSLABEL_H
#include <QLabel>
#include <QDebug>
#include <QMouseEvent>
#include <QContextMenuEvent>
#include <QPaintEvent>
#include <QTextDocument>
#include <cstdint>
#include <QTextEdit>
class InstructionsLabel : public QLabel
{
Q_OBJECT
private:
uint32_t offset = 0xffffffff;
QString value = "";
public:
explicit InstructionsLabel(QWidget *parent = 0);
void mouseDoubleClickEvent(QMouseEvent * ev);
void focusOutEvent(QFocusEvent *ev);
void setOffset(uint32_t offset, QString value);
void keyPressEvent(QKeyEvent * ev);
signals:
void valueChanged(QString value);
public slots:
};
#endif // INSTRUCTIONSLABEL_H
| [
"ziqumu@gmail.com"
] | ziqumu@gmail.com |
948a652ab0c53c8880f1125d8a5bb58279c3bdf3 | d2a5e35a42305044ecf74fa1800d77c2abad40e7 | /projects/EarthWeb/EarthWeb/Source/TileSource/TileSourceNoise/TileSourceNoise.h | 480d548eebf7f134fdc07282e9f79fc497b8f180 | [] | no_license | geobeans/Earth3d | 262f94f3e6768a63fcd84c698bb56681e453bf1b | c9af88cc94a2b8ec8328c356f38715301a258cd3 | refs/heads/master | 2020-04-13T08:55:21.183339 | 2018-12-28T07:44:13 | 2018-12-28T07:44:13 | 163,096,175 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 666 | h | #ifndef OSGEARTHX_WEB_TILE_SOURCE_NOISE_H
#define OSGEARTHX_WEB_TILE_SOURCE_NOISE_H 1
#include <EarthWeb/Source/SourceDispatchImpl.h>
#include <EarthWeb/Source/TileSource/ITileSourceDispath.h>
#include <osgEarthDrivers/noise/NoiseOptions>
#define TileSourceNoiseDispatchImpl SourceDispatchImpl< osgEarth::Drivers::Noise::NoiseOptions, TileSourceNoise, ITileSourceDispatch >
FB_FORWARD_PTR(TileSourceNoise)
class TileSourceNoise : public TileSourceNoiseDispatchImpl
{
public:
TileSourceNoise( const std::vector<FB::variant>* pArgs = NULL ) : TileSourceNoiseDispatchImpl( TILE_SOURCE_NOISE )
{
}
virtual ~TileSourceNoise(){}
protected:
private:
};
#endif | [
"jinping74@outlook.com"
] | jinping74@outlook.com |
f2862bd8c627582bfa26960bfacd85c239daf97c | ee21530730a7d843ca6dae2d2394f1b9fda0f464 | /Integral/Source.cpp | 2a6b264f9ef9532190560ded230c56d5242f317a | [] | no_license | devvados/numeric-methods | 5303a9f8df60615ba067864bf4fb89034bc77299 | b85326d23116b613855761e48fcbfafc5b5ca5b1 | refs/heads/master | 2021-09-10T10:43:12.450991 | 2018-03-24T18:20:21 | 2018-03-24T18:20:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,594 | cpp | #include <iostream>
#include <cmath>
using namespace std;
double f(const double & x)
{
return (x + 1.5)*sin(x*x);
}
double f1(const double & x)
{
return 1/(sqrt(x*x + 4));
}
double deriv(const double & x)
{
return (2 * (pow(x, 2) - 2)) / pow((pow(x, 2) + 4), 5.0 / 2.0);
}
double fault()
{
int n = 10;
double a = 1.6, b = 2.4;
return (pow((b - a), 3) / (12 * pow(n, 2))) * deriv(2.4);
}
void trapeze(const double & a, const double & b, int n, const double & eps)
{
double h, x, s = 0, s_old;
do {
h = (b - a) / n;
s_old = s;
s = 0;
for (x = a; x < b; x += h)
s += (f1(x + h) + f1(x)) / 2 * h;
} while ((abs(s_old - s) > eps));
cout << "Trapeze method: " << s << endl;
}
double ff(int i, const double & a, const double & h)
{
return f(a + h*i / 2);
}
double simpson(const double & a, const double & b, int n, const double & eps)
{
double h, s = 0.0, s_old, s1, s2;
int i;
do {
h = (b - a) / n;
s_old = s;
s1 = 0;
for (i = 2; i < 2 * n - 1; i += 2)
s1 += ff(i, a, h);
s2 = 0;
for (i = 1; i < 2 * n; i += 2)
s2 += ff(i, a, h);
s = h / 6 * (ff(0, a, h) + 2 * s1 + 4 * s2 + ff(2 *n, a, h));
} while ((abs(s_old - s) > eps*h*n / (b - a)));
return s;
}
int main()
{
double a, a1, b, b1, eps;
int n, n1;
cout.precision(11);
trapeze(1.6, 2.4, 10, 0.001);
cout << "Fault = " << fault() << endl;
double s1 = simpson(0.4, 1.2, 8, 0.001);
double s2 = simpson(0.4, 1.2, 16, 0.001);
double fault = fabs(s1 - s2) / 15;
cout << "Simpson n = 8: " << s1 << endl;
cout << "Simpson n = 16: " << s2 << endl;
system("pause");
return 0;
}
| [
"vadim-cavs@yandex.ru"
] | vadim-cavs@yandex.ru |
7d8dde4765a6150ea6db61fed06b64073d4ca5e3 | b24ac9ebbcd0a3668cd2f64a45cbfc3c98fdaa1e | /thrift/lib/cpp2/transport/inmemory/test/InMemoryConnectionTest.cpp | 3a7df8cbcc1bc60e806a7e4fc447f418bb623997 | [
"Apache-2.0"
] | permissive | martina6hall/fbthrift | 4946e51af9172d986c5508aabc524e1f85035454 | 898e259cb1bc30702262dd2f2dc5351be793bca9 | refs/heads/master | 2021-01-24T19:37:38.055423 | 2018-02-28T02:08:34 | 2018-02-28T02:17:26 | 123,242,017 | 1 | 0 | Apache-2.0 | 2018-02-28T06:45:18 | 2018-02-28T06:45:18 | null | UTF-8 | C++ | false | false | 5,436 | cpp | /*
* Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <gtest/gtest.h>
#include <folly/ExceptionWrapper.h>
#include <folly/futures/Future.h>
#include <folly/synchronization/Baton.h>
#include <thrift/lib/cpp2/server/BaseThriftServer.h>
#include <thrift/lib/cpp2/transport/core/ThriftClient.h>
#include <thrift/lib/cpp2/transport/core/testutil/ServerConfigsMock.h>
#include <thrift/lib/cpp2/transport/inmemory/InMemoryConnection.h>
#include <thrift/lib/cpp2/transport/inmemory/test/gen-cpp2/Division.h>
#include <memory>
namespace apache {
namespace thrift {
// The three classes below implement sync, async, and future style servers.
class DivisionHandlerSync : virtual public DivisionSvIf {
public:
int divide(int x, int y) override {
if (y == 0) {
throw DivideByZero();
} else {
return x / y;
}
}
};
class DivisionHandlerAsync : virtual public DivisionSvIf {
public:
void async_tm_divide(
std::unique_ptr<HandlerCallback<int32_t>> callback,
int32_t x,
int32_t y) override {
if (y == 0) {
callback->exception(folly::make_exception_wrapper<DivideByZero>());
} else {
callback->result(x / y);
}
}
};
class DivisionHandlerFuture : virtual public DivisionSvIf {
public:
folly::Future<int32_t> future_divide(int32_t x, int32_t y) override {
if (y == 0) {
return folly::makeFuture<int32_t>(DivideByZero());
} else {
return folly::makeFuture<int32_t>(x / y);
}
}
};
// This class is for the async client calls.
class DivisionRequestCallback : public RequestCallback {
public:
DivisionRequestCallback(ClientReceiveState* result, folly::Baton<>* baton)
: result_(result), baton_(baton) {}
void requestSent() override {}
void replyReceived(ClientReceiveState&& state) override {
*result_ = std::move(state);
baton_->post();
}
void requestError(ClientReceiveState&& state) override {
*result_ = std::move(state);
baton_->post();
}
private:
ClientReceiveState* result_;
folly::Baton<>* baton_;
};
// This method tests sync, async, and future style clients with the
// handler specified as the template parameter. For each of these 3
// cases, it calls the divide service method 3 times:
// divide(15, 5); divide(1, 0); divide(7, 1);
template <class Handler>
void testClientWithHandler() {
auto handler = std::make_shared<Handler>();
auto pFac =
std::make_shared<ThriftServerAsyncProcessorFactory<Handler>>(handler);
apache::thrift::server::ServerConfigsMock serverConfigs;
auto connection = std::make_shared<InMemoryConnection>(pFac, serverConfigs);
auto thriftClient = ThriftClient::Ptr(new ThriftClient(connection));
thriftClient->setProtocolId(apache::thrift::protocol::T_COMPACT_PROTOCOL);
auto divisionClient =
std::make_unique<DivisionAsyncClient>(std::move(thriftClient));
// Synchronous client
EXPECT_EQ(3, divisionClient->sync_divide(15, 5));
EXPECT_THROW({ divisionClient->sync_divide(1, 0); }, DivideByZero);
EXPECT_EQ(7, divisionClient->sync_divide(7, 1));
// Asynchronous client
{
ClientReceiveState result;
folly::Baton<> baton;
auto callback = std::make_unique<DivisionRequestCallback>(&result, &baton);
divisionClient->divide(std::move(callback), 15, 5);
baton.wait();
int32_t val;
auto ew = divisionClient->recv_wrapped_divide(val, result);
EXPECT_FALSE(ew);
EXPECT_EQ(3, val);
}
{
ClientReceiveState result;
folly::Baton<> baton;
auto callback = std::make_unique<DivisionRequestCallback>(&result, &baton);
divisionClient->divide(std::move(callback), 1, 0);
baton.wait();
int32_t val;
auto ew = divisionClient->recv_wrapped_divide(val, result);
EXPECT_TRUE(ew);
EXPECT_EQ(typeid(DivideByZero), ew.type());
}
{
ClientReceiveState result;
folly::Baton<> baton;
auto callback = std::make_unique<DivisionRequestCallback>(&result, &baton);
divisionClient->divide(std::move(callback), 7, 1);
baton.wait();
int32_t val;
auto ew = divisionClient->recv_wrapped_divide(val, result);
EXPECT_FALSE(ew);
EXPECT_EQ(7, val);
}
// Future client
EXPECT_EQ(3, divisionClient->future_divide(15, 5).get());
EXPECT_THROW({ divisionClient->future_divide(1, 0).get(); }, DivideByZero);
EXPECT_EQ(7, divisionClient->future_divide(7, 1).get());
}
// The 3 tests below run the each style of server as described in the
// comments in testClientWithHandler.
//
// I.e., 3 styles of servers X 3 styles of clients X 3 calls each
// (so 27 test cases).
TEST(InMemoryConnection, SyncServer) {
testClientWithHandler<DivisionHandlerSync>();
}
TEST(InMemoryConnection, AsyncServer) {
testClientWithHandler<DivisionHandlerAsync>();
}
TEST(InMemoryConnection, FutureServer) {
testClientWithHandler<DivisionHandlerFuture>();
}
} // namespace thrift
} // namespace apache
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
7b040775968b7569506a04ddd86eae957f80dde2 | 72d9009d19e92b721d5cc0e8f8045e1145921130 | /frailtySurv/inst/testfiles/deriv_dlognormal_c/deriv_dlognormal_c_DeepState_TestHarness.cpp | 891cd3aba8cf7a6af2045d4d2f3f730ce7765b1e | [] | no_license | akhikolla/TestedPackages-NoIssues | be46c49c0836b3f0cf60e247087089868adf7a62 | eb8d498cc132def615c090941bc172e17fdce267 | refs/heads/master | 2023-03-01T09:10:17.227119 | 2021-01-25T19:44:44 | 2021-01-25T19:44:44 | 332,027,727 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,214 | cpp | // AUTOMATICALLY GENERATED BY RCPPDEEPSTATE PLEASE DO NOT EDIT BY HAND, INSTEAD EDIT
// deriv_dlognormal_c_DeepState_TestHarness_generation.cpp and deriv_dlognormal_c_DeepState_TestHarness_checks.cpp
#include <fstream>
#include <RInside.h>
#include <iostream>
#include <RcppDeepState.h>
#include <qs.h>
#include <DeepState.hpp>
NumericVector deriv_dlognormal_c(NumericVector x, NumericVector theta);
TEST(frailtySurv_deepstate_test,deriv_dlognormal_c_test){
RInside R;
std::cout << "input starts" << std::endl;
NumericVector x = RcppDeepState_NumericVector();
qs::c_qsave(x,"/home/akhila/fuzzer_packages/fuzzedpackages/frailtySurv/inst/testfiles/deriv_dlognormal_c/inputs/x.qs",
"high", "zstd", 1, 15, true, 1);
std::cout << "x values: "<< x << std::endl;
NumericVector theta = RcppDeepState_NumericVector();
qs::c_qsave(theta,"/home/akhila/fuzzer_packages/fuzzedpackages/frailtySurv/inst/testfiles/deriv_dlognormal_c/inputs/theta.qs",
"high", "zstd", 1, 15, true, 1);
std::cout << "theta values: "<< theta << std::endl;
std::cout << "input ends" << std::endl;
try{
deriv_dlognormal_c(x,theta);
}
catch(Rcpp::exception& e){
std::cout<<"Exception Handled"<<std::endl;
}
}
| [
"akhilakollasrinu424jf@gmail.com"
] | akhilakollasrinu424jf@gmail.com |
c579aa05cd6009087bebb26756b8b117b19aaa57 | 92a31ac0a6437d1ed4f252d4c9acfe57a2230873 | /netwerk/protocol/ccnx/nsCCNxCore.cpp | b7cee83e58c7898f7959759e1476be81ed997b03 | [] | no_license | goodcjw/ffccnx | c69b7d78c1cbe2795f3ebdfed425a25f30fc3392 | e9c310c02a55dc1b5149ee8a57959a528cd95161 | refs/heads/master | 2020-12-24T14:17:41.498077 | 2012-06-01T07:27:58 | 2012-06-01T07:27:58 | 4,007,351 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,649 | cpp | #include "nsCCNxCore.h"
#include "nsCCNxChannel.h"
#include "nsCCNxTransport.h"
#include "nsIOService.h"
#include "nsIURL.h"
#include "nsStreamUtils.h"
#if defined(PR_LOGGING)
extern PRLogModuleInfo* gCCNxLog;
#endif
#define LOG(args) PR_LOG(gCCNxLog, PR_LOG_DEBUG, args)
// nsBaseContentStream::nsISupports
NS_IMPL_THREADSAFE_ADDREF(nsCCNxCore)
NS_IMPL_THREADSAFE_RELEASE(nsCCNxCore)
// We only support nsIAsyncInputStream when we are in non-blocking mode.
NS_INTERFACE_MAP_BEGIN(nsCCNxCore)
NS_INTERFACE_MAP_ENTRY(nsIInputStream)
NS_INTERFACE_MAP_ENTRY(nsIInputStreamCallback)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAsyncInputStream, mNonBlocking)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
NS_INTERFACE_MAP_END_THREADSAFE;
nsCCNxCore::nsCCNxCore()
: mChannel(nsnull)
, mDataTransport(nsnull)
, mDataStream(nsnull)
, mState(CCNX_INIT)
, mStatus(NS_OK)
, mNonBlocking(true)
, mCallback(nsnull)
, mCallbackTarget(nsnull) {
LOG(("nsCCNxCore created @%p", this));
}
nsCCNxCore::~nsCCNxCore() {
/*
if (mDataTransport != nsnull)
NS_RELEASE(mDataTransport);
mDataTransport = nsnull;
*/
mDataTransport = nsnull;
LOG(("nsCCNxCore destroyed @%p", this));
}
nsresult
nsCCNxCore::Init(nsCCNxChannel *channel) {
mChannel = channel;
// nsCOMPtr<nsIURL> url, URL should be parsed here
// URI can be access by mChannel->URI()
nsresult rv;
nsCOMPtr<nsIURL> url = do_QueryInterface(mChannel->URI());
rv = url->GetAsciiSpec(mInterest);
// XXX temopry walkaround when nsCCNxURL is absent
mInterest.Trim("ccnx:", true, false, false);
if (NS_FAILED(rv))
return rv;
return NS_OK;
}
//-----------------------------------------------------------------------------
void
nsCCNxCore::DispatchCallback(bool async)
{
if (!mCallback)
return;
// It's important to clear mCallback and mCallbackTarget up-front because the
// OnInputStreamReady implementation may call our AsyncWait method.
nsCOMPtr<nsIInputStreamCallback> callback;
if (async) {
NS_NewInputStreamReadyEvent(getter_AddRefs(callback), mCallback,
mCallbackTarget);
if (!callback)
return; // out of memory!
mCallback = nsnull;
}
else {
callback.swap(mCallback);
}
mCallbackTarget = nsnull;
callback->OnInputStreamReady(this);
}
void
nsCCNxCore::OnCallbackPending() {
// If this is the first call, then see if we could use the cache. If we
// aren't going to read from (or write to) the cache, then just proceed to
// connect to the server.
if (mState == CCNX_INIT) {
// internally call OpenInputStream and refer it as mDataStream
// mDataStream is actually created by NS_NewPipe2
mState = Connect();
}
if (mState == CCNX_CONNECT && mDataStream) {
// this is a nsPipeOutputStream
mDataStream->AsyncWait(this, 0, 0, CallbackTarget());
}
}
CCNX_STATE
nsCCNxCore::Connect() {
// create the CCNx transport
nsCOMPtr<nsITransport> ntrans;
nsresult rv;
rv = CreateTransport(getter_AddRefs(ntrans));
if (NS_FAILED(rv))
return CCNX_ERROR;
mDataTransport = ntrans;
// we are reading from the ndn
nsCOMPtr<nsIInputStream> input;
rv = mDataTransport->OpenInputStream(0,
nsIOService::gDefaultSegmentSize,
nsIOService::gDefaultSegmentCount,
getter_AddRefs(input));
NS_ENSURE_SUCCESS(rv, CCNX_ERROR);
mDataStream = do_QueryInterface(input);
return CCNX_CONNECT;
}
NS_IMETHODIMP
nsCCNxCore::CreateTransport(nsITransport **result) {
nsCCNxTransport *ntrans = new nsCCNxTransport();
if (!ntrans)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(ntrans);
nsresult rv = ntrans->Init(mInterest.get());
if (NS_FAILED(rv)) {
NS_RELEASE(ntrans);
return rv;
}
*result = ntrans;
return NS_OK;
}
//-----------------------------------------------------------------------------
// nsIInputStream Methods
NS_IMETHODIMP
nsCCNxCore::Close() {
return IsClosed() ? NS_OK : CloseWithStatus(NS_BASE_STREAM_CLOSED);
}
NS_IMETHODIMP
nsCCNxCore::Available(PRUint32 *avail) {
// from nsFtpState
if (mDataStream)
return mDataStream->Available(avail);
// from nsBaseContentStream
*avail = 0;
return mStatus;
}
NS_IMETHODIMP
nsCCNxCore::Read(char *buf, PRUint32 count, PRUint32 *countRead) {
return ReadSegments(NS_CopySegmentToBuffer, buf, count, countRead);
}
NS_IMETHODIMP
nsCCNxCore::ReadSegments(nsWriteSegmentFun writer, void *closure,
PRUint32 count, PRUint32 *countRead) {
// from nsFtpState
if (mDataStream) {
nsWriteSegmentThunk thunk = { this, writer, closure };
return mDataStream->ReadSegments(NS_WriteSegmentThunk, &thunk,
count, countRead);
}
// from nsBaseContentStream
*countRead = 0;
if (mStatus == NS_BASE_STREAM_CLOSED)
return NS_OK;
// No data yet
if (!IsClosed() && IsNonBlocking())
return NS_BASE_STREAM_WOULD_BLOCK;
return mStatus;
}
NS_IMETHODIMP
nsCCNxCore::IsNonBlocking(bool *nonblocking) {
*nonblocking = true;
return NS_OK;
}
//-----------------------------------------------------------------------------
// nsIAsyncInputStream Methods
NS_IMETHODIMP
nsCCNxCore::CloseWithStatus(nsresult reason) {
// from nsFtpState
if (mDataTransport) {
// Shutdown the data transport.
mDataTransport->Close(NS_ERROR_ABORT);
mDataTransport = nsnull;
}
mDataStream = nsnull;
// from nsBaseContentStream
if (IsClosed())
return NS_OK;
NS_ENSURE_ARG(NS_FAILED(reason));
mStatus = reason;
DispatchCallbackAsync();
return NS_OK;
}
NS_IMETHODIMP
nsCCNxCore::AsyncWait(nsIInputStreamCallback *callback,
PRUint32 flags,
PRUint32 amount,
nsIEventTarget *target) {
// Our _only_ consumer is nsInputStreamPump, so we simplify things here by
// making assumptions about how we will be called.
mCallback = callback;
mCallbackTarget = target;
if (!mCallback)
return NS_OK;
if (IsClosed()) {
DispatchCallbackAsync();
return NS_OK;
}
OnCallbackPending();
return NS_OK;
}
//-----------------------------------------------------------------------------
// nsIInputStreamCallback Methods
NS_IMETHODIMP
nsCCNxCore::OnInputStreamReady(nsIAsyncInputStream *aInStream) {
// We are receiving a notification from our data stream, so just forward it
// on to our stream callback.
if (HasPendingCallback())
DispatchCallbackSync();
return NS_OK;
}
| [
"goodcjw2@gmail.com"
] | goodcjw2@gmail.com |
d9f1adb60d7878c5aba609766f13473546d67df6 | be6eab2a509676503399dab108b335d0150e2b60 | /build/px4/topics_sources/mission.cpp | 9b62580cb5a36d50ea58586e0dd1ea8fcb7904a8 | [] | no_license | SwastikNandan/Open_UAV_colab | 23ebf8da8c5088a6730dfdd1fb6e7cd6cdccd7d4 | 9493de0cd312e792a7e8fe5c1668be02e8394ae6 | refs/heads/master | 2021-03-10T18:48:56.305634 | 2020-03-11T05:09:19 | 2020-03-11T05:09:19 | 246,476,826 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,289 | cpp | /****************************************************************************
*
* Copyright (C) 2013-2016 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 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.
*
****************************************************************************/
/* Auto-generated by genmsg_cpp from file /home/swastik/catkin_ws/src/Firmware/msg/mission.msg */
#include <px4_config.h>
#include <drivers/drv_orb_dev.h>
#include <uORB/topics/mission.h>
const char *__orb_mission_fields = "uint64_t timestamp;int32_t dataman_id;uint32_t count;int32_t current_seq;uint8_t[4] _padding0;";
ORB_DEFINE(mission, struct mission_s, 20,
__orb_mission_fields);
ORB_DEFINE(offboard_mission, struct mission_s, 20,
__orb_mission_fields);
ORB_DEFINE(onboard_mission, struct mission_s, 20,
__orb_mission_fields);
| [
"s.swastiknandan@gmail.com"
] | s.swastiknandan@gmail.com |
272e4207f4ba6af97cd2e536ad2e6c7a75dc7329 | a27e6562c3263aecc6265ee2bd2a0fab9de93aed | /[1] KWACIK - Kwadracik.cpp | d3b5a31dcf0fbd4567970fd54568dd47226a724e | [] | no_license | mrotko/spoj | 301749892590b216ba910fcf0795c4973b479812 | 2c352059d0e22406f2cc15ce5cb4b0ed928e6332 | refs/heads/master | 2021-06-12T17:29:18.176929 | 2017-02-12T23:22:28 | 2017-02-12T23:22:28 | 56,945,855 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,333 | cpp | #include <iostream>
using namespace std;
int main() {
int t, n;
cin >> t;
while(t--) {
cin >> n;
int sum = 0, x;
if(n > 36) cout << 0 << endl;
else {
for(int s = 0; s <= min(9, n); s++) {
for(int d1 = 0; d1 <= min(9, n); d1++) {
for(int d2 = 0; d2 <= min(9, n); d2++) {
x = n - s - d1 - d2;
if(x >= 0 && x <= min(9, n))
for(int d3 = 0; d3 <= min(9, n); d3++) {
x = n - s - d2 - d3;
if(x >= 0 && x <= min(9, n))
for(int d4 = 0; d4 <= min(9, n); d4++) {
int test = 0;
x = n - s - d3 - d4;
if(x >= 0 && x <= min(9, n)) test++;
x = n - s - d4 - d1;
if(x >= 0 && x <= min(9, n)) test++;
if(test == 2)
sum++;
};
};
};
}
}
cout << sum << endl;
}
}
} | [
"michalr835@gmail.com"
] | michalr835@gmail.com |
4046bae7587fc608aebba5e4e9e89aa48489e68b | c90b939502d5b864b9d1cbc95feeb58073744534 | /qctimage.cpp | 3a698cdca75f96184eed8581e1285d798f948a67 | [] | no_license | howff/xqctide | c728bfdca3ce8529d96969479e05496f341fe7a0 | 8c91c51e3f8c709cf75450be734042365f2c4f01 | refs/heads/master | 2020-04-02T06:32:54.740777 | 2018-10-23T17:24:21 | 2018-10-23T17:24:21 | 154,155,572 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,405 | cpp | /* > qctimage.cpp
* 1.00 arb Thu May 27 09:18:38 BST 2010
*/
static const char SCCSid[] = "@(#)qctimage.cpp 1.00 (C) 2010 arb QCT image scrollview";
/*
* QCTImage is a class to display a QCT (QuickChart) image.
* It is a subclass of QScrollView so it can be used like a widget
* that displays an image with scrollbars.
*/
/*
* Configuration:
* Define STOP_MAP_MOVING_AFTER_MSEC as number of milliseconds to wait
* after a mouseMove event to get a mouseButtonReleased event. If moving
* within MSEC period then assume user wants map to continue moving,
* otherwise user paused the mouse before releasing the button so wants
* it to remain stationary.
*/
#define STOP_MAP_MOVING_AFTER_MSEC 50
#include <qapplication.h> // for OverrideCursor
#include <qcursor.h> // for QCursor::pos
#include <qpainter.h>
#include <qtimer.h>
#include "satlib/dundee.h"
#include "osmap/qct.h"
#include "qctimage.h"
/* ---------------------------------------------------------------------------
*
*/
ArrowPlot::ArrowPlot(int x, int y, float bearing, float length)
{
stemwidth = 8;
filled = true;
QPointArray prepoints(8);
prepoints[0] = QPoint(-stemwidth, 0);
prepoints[1] = QPoint(-stemwidth, NINT(-length));
prepoints[2] = QPoint(-stemwidth*2, NINT(-length));
prepoints[3] = QPoint(0, NINT(-length)-stemwidth*2);
prepoints[4] = QPoint(stemwidth*2, NINT(-length));
prepoints[5] = QPoint(stemwidth, NINT(-length));
prepoints[6] = QPoint(stemwidth, 0);
prepoints[7] = QPoint(-stemwidth, 0);
// Translate origin THEN rotate all the points
QWMatrix wm;
wm.translate(x, y);
wm.rotate(bearing);
points = wm.map(prepoints);
// For speed extract the bounding box and keep it
boundingBox = points.boundingRect();
}
ArrowPlot::~ArrowPlot()
{
}
QRect
ArrowPlot::rect() const
{
return boundingBox;
}
void
ArrowPlot::plot(QPainter *painter)
{
if (filled)
painter->drawPolygon(points);
else
painter->drawPolyline(points);
}
/* ---------------------------------------------------------------------------
*
*/
TidePlot::TidePlot(int x, int y, float min, float max, float currently)
{
dimension = 5;
// painter coords go from top left but level is up from bottom
int level = NINT((currently-min)/(max-min)*dimension*4);
QPointArray prepoints(7);
prepoints[0] = QPoint(-dimension, -dimension*2);
prepoints[1] = QPoint(-dimension, dimension*2);
prepoints[2] = QPoint( dimension, dimension*2);
prepoints[3] = QPoint( dimension, -dimension*2);
prepoints[4] = QPoint(-dimension, -dimension*2);
prepoints[5] = QPoint(-dimension, dimension*2-level);
prepoints[6] = QPoint( dimension, dimension*2-level);
debugf(1,"TIDEPLOT %f < %f < %f = %d < %d(%f) < %d\n",
min,currently,max, -dimension*2,-dimension*2+level,((currently-min)/(max-min)*dimension*4),dimension*2);
// Translate origin to move all the points
QWMatrix wm;
wm.translate(x, y);
points = wm.map(prepoints);
// For speed extract the bounding box and keep it
boundingBox = points.boundingRect();
}
TidePlot::~TidePlot()
{
}
QRect
TidePlot::rect() const
{
return boundingBox;
}
void
TidePlot::plot(QPainter *painter)
{
painter->drawPolyline(points);
}
/* ---------------------------------------------------------------------------
*
*/
QCTImage::QCTImage(QWidget *parent) : QScrollView(parent, "qcti", WNoAutoErase|WStaticContents|WPaintClever)
{
qct = 0;
dragging = floating = false;
startx = starty = 0;
arrowList.setAutoDelete(true);
tideList.setAutoDelete(true);
// Allow mouse move events through to contentsMouseMoveEvent
viewport()->setMouseTracking(true);
// Enable panning -- this only works if you try to drag an item
// from outside the window (eg. from the Desktop) into the window
// and hold it near the edge. It's a nice effect though.
//setDragAutoScroll(true);
//viewport()->setAcceptDrops(true);
}
QCTImage::~QCTImage()
{
unload();
}
void
QCTImage::unload()
{
if (qct)
{
delete qct;
qct = 0;
}
arrowList.clear();
tideList.clear();
}
/*
* Load a QCT, create a QImage, copy the image data from the QCT,
* resize the internal dimensions of the scrollview, scroll to middle.
*/
bool
QCTImage::load(QString filename, int scalefactor)
{
int ii, yy, width, height;
qct = new QCT();
QApplication::setOverrideCursor(waitCursor);
if (!qct->openFilename((const char*)filename, false, scalefactor))
{
log_error_message("cannot read %s", (const char*)filename);
return false;
}
QApplication::restoreOverrideCursor();
// Create the internal image with the correct dimensions
width = qct->getImageWidth();
height = qct->getImageHeight();
image.reset();
image.create(width, height, 8, 256);
debugf(1, "loaded QCT %d x %d (reduced %d) from %s\n", width, height, scalefactor, (const char*)filename);
// Fill in the colourmap by querying the QCT colourmap
for (ii=0; ii<256; ii++)
{
int R, G, B;
qct->getColour(ii, &R, &G, &B);
image.setColor(ii, qRgb(R, G, B));
}
// Fill in the image data by reading the QCT image data
for (yy=0; yy<height; yy++)
{
memcpy(image.scanLine(yy), qct->getImage()+yy*width*sizeof(unsigned char), width*sizeof(unsigned char));
}
// Free the image memory from within the QCT object now we've copied it
qct->unloadImage();
// Tell the scrollview how big its image is
resizeContents(width, height);
// Scroll to the middle
center(width/2, height/2);
return true;
}
/*
* Save the image to a file
*/
bool
QCTImage::save(QString filename, const char *fmt)
{
return image.save(filename, fmt);
}
/* --------------------------------------------------------------------------
* Paint the portion of the image onto the screen or printer.
*/
void
QCTImage::render(QPainter *painter, int cx, int cy, int cw, int ch)
{
if (image.isNull())
{
//painter->eraseRect(area);
return;
}
// Plot the visible part of the image
QRect area(cx, cy, cw, ch);
painter->drawImage(area.topLeft(), image, area);
// Border and fill colour of arrows
painter->save();
painter->setPen(QPen(black, 1, SolidLine)); // ! use no thicker than 1
painter->setBrush(QBrush(red, SolidPattern));
// Get all the arrows to draw themselves
for (ArrowPlot *arrow = arrowList.first(); arrow; arrow = arrowList.next())
{
debugf(1, "ARROW %d %d %d %d ",arrow->rect().x(), arrow->rect().y(),
arrow->rect().width(), arrow->rect().height());
if (arrow->rect().intersects(area))
{
debugf(1, "plot\n");
arrow->plot(painter);
}
else
{
debugf(1, "invisible\n");
}
}
painter->restore();
// Border and fill colour of tides
painter->save();
painter->setPen(QPen(black, 2, SolidLine));
painter->setBrush(QBrush(green, SolidPattern));
// Get all the tide marks to draw themselves
for (TidePlot *tideplot = tideList.first(); tideplot; tideplot = tideList.next())
{
debugf(1, "TIDEPLOT %d %d %d %d ", tideplot->rect().x(), tideplot->rect().y(),
tideplot->rect().width(), tideplot->rect().height());
if (tideplot->rect().intersects(area))
{
debugf(1, "plot\n");
tideplot->plot(painter);
}
else
{
debugf(1, "invisible\n");
}
}
painter->restore();
}
void
QCTImage::drawContents(QPainter *painter, int cx, int cy, int cw, int ch)
{
render(painter, cx, cy, cw, ch);
}
/* --------------------------------------------------------------------------
* Right-click context menu requested (event contains content coords)
*/
void
QCTImage::contentsContextMenuEvent(QContextMenuEvent *event)
{
int mx = event->pos().x();
int my = event->pos().y();
int imagewidth = image.width();
int imageheight = image.height();
if (mx < 0 || my < 0 || mx > imagewidth || my > imageheight)
return;
double lat, lon;
qct->xy_to_latlon(mx,my, &lat, &lon);
debugf(1,"QCTImage::contentsContextMenuEvent %d, %d = %f, %f\n", mx, my, lat, lon);
emit contextMenu(lat, lon);
// XXX accept or ignore event?
event->accept();
}
/* --------------------------------------------------------------------------
* Mouse is moving over the map
* convert mouse position into latitude and longitude,
* if button was pressed then dragging is true so scroll the map
* (could test for button by looking at event->state instead?)
* [NB. Only called if mouse tracking has been enabled.]
*/
void
QCTImage::contentsMouseMoveEvent(QMouseEvent *event)
{
// Do nothing if no image has been loaded
if (image.isNull() || qct == 0)
return;
// Do nothing if point is not within image
int mx = event->pos().x();
int my = event->pos().y();
int imagewidth = image.width();
int imageheight = image.height();
if (mx < 0 || my < 0 || mx > imagewidth || my > imageheight)
return;
double lat, lon;
qct->xy_to_latlon(mx,my, &lat, &lon);
//debugf(1,"QCTImage::contentsMouseMoveEvent %d, %d = %f, %f (TL %d %d)\n", mx, my, lat, lon, contentsX(), contentsY());
// Could set val as colour of pixel at mx,my
emit location(lat, lon, 0);
// Panning
if (dragging)
{
dragDelta = QPoint(dragStartMousePos - contentsToViewport(event->pos()));
QPoint newpos = dragStartContentsPos + dragDelta;
setContentsPos(newpos.x(), newpos.y());
lastMoveTime.start();
//debugf(1,"Mouse started at %5d %5d\n", dragStartMousePos.x(), dragStartMousePos.y());
//debugf(1,"contents were at %5d %5d\n", dragStartContentsPos.y(), dragStartContentsPos.y());
//debugf(1,"mouse now %5d %5d\n", event->pos().x(), event->pos().y());
//debugf(1,"delta %5d %5d\n", delta.x(), delta.y());
//debugf(1,"contents now at %5d %5d\n", newpos.x(), newpos.y());
}
// XXX accept or ignore event?
event->accept();
}
void
QCTImage::contentsMousePressEvent(QMouseEvent *event)
{
// If not a plain left-button then might be a context menu so ignore
if (event->button() != Qt::LeftButton)
{
event->ignore();
return;
}
dragging = true;
floating = false;
dragStartMousePos = contentsToViewport(event->pos());
dragStartContentsPos = QPoint(contentsX(), contentsY());
// Display dragging-hand cursor
QApplication::setOverrideCursor(Qt::PointingHandCursor);
// XXX accept or ignore event?
event->accept();
}
void
QCTImage::contentsMouseReleaseEvent(QMouseEvent *event)
{
// Prevent any future mouseMoveEvents from continuing to drag the map
dragging = false;
// If mouse was moving recently (not paused over one spot) then assume the
// user wants the map to continue moving in the same direction, ie floating
if (lastMoveTime.elapsed() < STOP_MAP_MOVING_AFTER_MSEC)
{
floating = true;
keepFloating();
}
else
{
floating = false;
}
// Remove dragging-hand cursor
// XXX may not have been set so shouldn't unset without checking first
QApplication::restoreOverrideCursor();
// XXX accept or ignore event?
event->accept();
}
void
QCTImage::keepFloating()
{
// Keep moving smoothly in the same direction
scrollBy(dragDelta.x() / 4, dragDelta.y() / 4);
// Come back later and move further
if (floating)
QTimer::singleShot(100, this, SLOT(keepFloating()));
}
void
QCTImage::contentsWheelEvent(QWheelEvent *event)
{
// If you only want the wheel event to be effective when a Shift/Ctrl/Alt key is pressed:
//if (event->state() & Qt::KeyButtonMask)
{
emit mouseWheel(event->orientation(), event->delta());
}
// XXX accept or ignore event, ignore to allow scrolling to work?
event->accept();
}
/* --------------------------------------------------------------------------
* Delete all info about plotted items ready to have new items plotted
* (so doesn't bother to update the screen)
*/
void
QCTImage::unplotArrows()
{
// Only erase the visible bits
QRect vis(contentsX(), contentsY(), contentsWidth(), contentsHeight());
// Erase all the old arrows before their shape changes to new bbox
for (ArrowPlot *arrow = arrowList.first(); arrow; arrow = arrowList.next())
{
QRect arrect = arrow->rect();
if (arrect.intersects(vis))
updateContents(arrect);
}
// Empty the list
arrowList.clear();
}
void
QCTImage::unplotTides()
{
// Only erase the visible bits
QRect vis(contentsX(), contentsY(), contentsWidth(), contentsHeight());
// Erase all the old arrows before their shape changes to new bbox
for (TidePlot *tideplot = tideList.first(); tideplot; tideplot = tideList.next())
{
QRect tidrect = tideplot->rect();
if (tidrect.intersects(vis))
updateContents(tidrect);
}
// Empty the list
tideList.clear();
}
/* --------------------------------------------------------------------------
* Convert latitude and longitude into pixel coordinate
* and plot.
*/
void
QCTImage::plotArrow(float lat, float lon, float bearing, float length)
{
if (!qct)
return;
int x, y;
qct->latlon_to_xy(lat, lon, &x, &y);
ArrowPlot *arrow = new ArrowPlot(x, y, bearing, length);
arrowList.append(arrow);
debugf(1,"plot at %f %f = %d %d bearing %f length %f\n",lat,lon, x,y, bearing,length);
updateContents(arrow->rect());
}
void
QCTImage::plotTide(float lat, float lon, float min, float max, float currently)
{
if (!qct)
return;
int x, y;
qct->latlon_to_xy(lat, lon, &x, &y);
TidePlot *tideplot = new TidePlot(x, y, min, max, currently);
tideList.append(tideplot);
debugf(1,"plot at %f %f = %d %d min %f max %f currently %f\n",lat,lon, x,y, min,max,currently);
updateContents(tideplot->rect());
}
/* --------------------------------------------------------------------------
* Scroll so the given location is in the middle of the screen
*/
bool
QCTImage::scrollToLatLon(double lat, double lon)
{
if (!qct)
return false;
int x, y;
qct->latlon_to_xy(lat, lon, &x, &y);
if (x<0 || y<0 || x>image.width()-1 || y>image.height()-1)
return false;
debugf(1,"scrollToLatLon %f %f -> %d %d\n", lat,lon, x,y);
center(x, y);
// If we've not been shown yet then the above center() won't work
// so we take a note of the requested position until showEvent().
startx = x;
starty = y;
return true;
}
void
QCTImage::showEvent(QShowEvent *ev)
{
if (startx && starty)
{
center(startx, starty);
startx = starty = 0;
}
}
/* --------------------------------------------------------------------------
* Return the coordinate of the middle of the visible part of the image.
*/
bool
QCTImage::latLonOfCenter(double *lat, double *lon)
{
if (!qct)
return false;
int x, y;
x = contentsX() + visibleWidth() / 2;
y = contentsY() + visibleHeight() / 2;
qct->xy_to_latlon(x, y, lat, lon);
debugf(1,"latLonOfCenter %d %d -> %f %f\n",x,y, *lat,*lon);
return true;
}
| [
"arb@sat.dundee.ac.uk"
] | arb@sat.dundee.ac.uk |
dc02d27689090f5f5331a2c37499e08ab379c6fe | 08bee5927c2322ae85ff43a2742ed6aa13d1125c | /queue/queue_implementation .cpp | 0c795f76a12c88bed3cec013e9fdb9c16d5d4244 | [] | no_license | Shuvo-mandol/My_acm_code_library | a9245bd0d412008e03183ca9c99c5be3693e6e68 | 41d59109825eb095e7e6109223b6ffbb01f38047 | refs/heads/master | 2022-03-15T21:47:30.451486 | 2022-02-25T08:25:38 | 2022-02-25T08:25:38 | 88,274,539 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,804 | cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 10
int qu[MAX];
int front= -1;
int rear = -1;
void insert_element();
void delete_element();
void display_element();
int main()
{
int option;
cout<<">>> C program to display queue >>> "<<endl;
do
{
cout<< "1. Insert_element"<<endl;
cout<< "2. Delete_element"<<endl;
cout<< "3. Display_element"<<endl;
cout<< "4. Exit"<<endl;
cout<< "Enter a option : ";
cin >> option;
cout<<endl;
switch(option)
{
case 1: insert_element();
break;
case 2: delete_element();
break;
case 3: display_element();
break;
case 4: cout<<"End of program ";
return 0;
default: cout<<"Enter a right value "<<endl;
}
}
while(option != 4);
return 0;
}
void insert_element()
{
int num;
cout<<"Enter a value to be inserted : ";
cin >> num;
if(front==0 && rear== MAX-1 || front== rear+1)
{
cout<<"Overflow"<<endl;
}
else if(front==-1 && rear== -1)
{
front= 0;
rear=0;
qu[rear]= num;
}
else if(rear== MAX-1 && front !=0)
{
rear=0;
qu[rear]= num;
}
else
{
rear++;
qu[rear]= num;
}
}
void delete_element()
{
int element;
if(front== -1)
{
cout<<"Underflow"<<endl;
return;
}
element= qu[front];
if(front== rear && front!=-1 && rear!= -1)
{
cout<<element<<" Deleted"<<endl;
}
if(front == rear)
{
front= -1;
rear= -1;
}
else
{
if(front== MAX-1)
front=0;
else
front++;
cout<<element<<" deleted";
cout<<endl;
}
}
void display_element()
{
int i;
if(front== -1)
{
cout<<"No elements to display"<<endl;
return;
}
else
{
cout<<"The elements are : ";
i=front;
if(front<= rear)
{
while(i<=rear)
{
cout<< qu[i]<<" ";
i++;
}
}
else
{
while(i<=MAX-1)
{
cout<< qu[i]<<" ";
i++;
}
i=0;
while(i<= rear)
{
cout<< qu[i]<<" ";
i++;
}
}
cout<<endl;
}
}
| [
"shuvocseiu@gmail.com"
] | shuvocseiu@gmail.com |
cbbcb213f9036fc298619dcc1199dda6cbee0fce | d2190cbb5ea5463410eb84ec8b4c6a660e4b3d0e | /old_hydra/hydra/tags/apr07/hadesgo4/Go4HadesOnline/TGo4TriggerOnlineStatus.h | 4d613c0cf66c2887cfdde6f3737382a369252b59 | [] | no_license | wesmail/hydra | 6c681572ff6db2c60c9e36ec864a3c0e83e6aa6a | ab934d4c7eff335cc2d25f212034121f050aadf1 | refs/heads/master | 2021-07-05T17:04:53.402387 | 2020-08-12T08:54:11 | 2020-08-12T08:54:11 | 149,625,232 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 733 | h | /* Generated by Together */
#ifndef TGO4TRIGGERONLINESTATUS_H
#define TGO4TRIGGERONLINESTATUS_H
#include "Go4StatusBase/TGo4Status.h"
#include "TObjArray.h"
#include "TIterator.h"
#include "TObject.h"
class TGo4TriggerOnlineStatus : public TGo4Status {
public:
~TGo4TriggerOnlineStatus();
TGo4TriggerOnlineStatus(Text_t *Name, Text_t * Title);
TObject* OverWriteLocalObject(TNamed * fxData_Local);
TIterator *GetLocalListIter(){return LocalListIter;}
TObjArray *GetLocalListStatus();
TObject* GetObjectfromLocalList(const char *ObjectAt);
ClassDef(TGo4TriggerOnlineStatus,1);
private:
TObjArray *LocalListContent;
TIterator* LocalListIter;
};
#endif //TGO4TRIGGERONLINESTATUS_H
| [
"waleed.physics@gmail.com"
] | waleed.physics@gmail.com |
01e3a12111956025c8c47347ed5f12165ab7fb92 | 4f8c9afb157c4bafae771bc16c885848a3c28496 | /src/chainparams.h | 849c8b9f4ed09e1d9749b3feb5e7864adf2dc032 | [
"MIT"
] | permissive | jubus08/goldy | 4df4f383cc3b423c35441d2ded00a0901f992f9c | 1e7b3606907a39e4b184b67215562a305355e22f | refs/heads/master | 2020-04-25T16:10:39.167927 | 2019-03-14T11:32:44 | 2019-03-14T11:32:44 | 172,901,250 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,559 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHAINPARAMS_H
#define BITCOIN_CHAINPARAMS_H
#include "chainparamsbase.h"
#include "checkpoints.h"
#include "primitives/block.h"
#include "protocol.h"
#include "uint256.h"
#include <vector>
typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
struct CDNSSeedData {
std::string name, host;
CDNSSeedData(const std::string& strName, const std::string& strHost) : name(strName), host(strHost) {}
};
/**
* CChainParams defines various tweakable parameters of a given instance of the
* GOLDY COIN system. There are three: the main network on which people trade goods
* and services, the public test network which gets reset from time to time and
* a regression test mode which is intended for private networks only. It has
* minimal difficulty to ensure that blocks can be found instantly.
*/
class CChainParams
{
public:
enum Base58Type {
PUBKEY_ADDRESS,
SCRIPT_ADDRESS,
SECRET_KEY, // BIP16
EXT_PUBLIC_KEY, // BIP32
EXT_SECRET_KEY, // BIP32
EXT_COIN_TYPE, // BIP44
MAX_BASE58_TYPES
};
const uint256& HashGenesisBlock() const { return hashGenesisBlock; }
const MessageStartChars& MessageStart() const { return pchMessageStart; }
const std::vector<unsigned char>& AlertKey() const { return vAlertPubKey; }
int GetDefaultPort() const { return nDefaultPort; }
const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; }
int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; }
/** Used to check majorities for block version upgrade */
int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; }
int RejectBlockOutdatedMajority() const { return nRejectBlockOutdatedMajority; }
int ToCheckBlockUpgradeMajority() const { return nToCheckBlockUpgradeMajority; }
int MaxReorganizationDepth() const { return nMaxReorganizationDepth; }
/** Used if GenerateBitcoins is called with a negative number of threads */
int DefaultMinerThreads() const { return nMinerThreads; }
const CBlock& GenesisBlock() const { return genesis; }
bool RequireRPCPassword() const { return fRequireRPCPassword; }
/** Make miner wait to have peers to avoid wasting work */
bool MiningRequiresPeers() const { return fMiningRequiresPeers; }
/** Headers first syncing is disabled */
bool HeadersFirstSyncingActive() const { return fHeadersFirstSyncingActive; };
/** Default value for -checkmempool and -checkblockindex argument */
bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }
/** Allow mining of a min-difficulty block */
bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }
/** Skip proof-of-work check: allow mining of any difficulty block */
bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }
/** Make standard checks */
bool RequireStandard() const { return fRequireStandard; }
int64_t TargetTimespan() const { return nTargetTimespan; }
int64_t TargetSpacing() const { return nTargetSpacing; }
int64_t Interval() const { return nTargetTimespan / nTargetSpacing; }
int LAST_POW_BLOCK() const { return nLastPOWBlock; }
int COINBASE_MATURITY() const { return nMaturity; }
int ModifierUpgradeBlock() const { return nModifierUpdateBlock; }
CAmount MaxMoneyOut() const { return nMaxMoneyOut; }
/** The masternode count that we will allow the see-saw reward payments to be off by */
int MasternodeCountDrift() const { return nMasternodeCountDrift; }
/** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
/** In the future use NetworkIDString() for RPC fields */
bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; }
/** Return the BIP70 network string (main, test or regtest) */
std::string NetworkIDString() const { return strNetworkID; }
const std::vector<CDNSSeedData>& DNSSeeds() const { return vSeeds; }
const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
const std::vector<CAddress>& FixedSeeds() const { return vFixedSeeds; }
virtual const Checkpoints::CCheckpointData& Checkpoints() const = 0;
int PoolMaxTransactions() const { return nPoolMaxTransactions; }
std::string SporkKey() const { return strSporkKey; }
std::string ObfuscationPoolDummyAddress() const { return strObfuscationPoolDummyAddress; }
int64_t StartMasternodePayments() const { return nStartMasternodePayments; }
CBaseChainParams::Network NetworkID() const { return networkID; }
int NewMasternodeCollateral_StartBlock() const { return nNewMasternodeCollateral_StartBlock; }
int NewMasternodeCollateral_GPBlock() const { return nNewMasternodeCollateral_GPBlock; }
int NewMasternode_Collateral() const { return nNewMasternode_Collateral; }
int OriginalMasternode_Collateral() const { return nOriginalMasternode_Collateral; }
int64_t Budget_Fee_Confirmations() const { return nBudget_Fee_Confirmations; }
protected:
CChainParams() {}
uint256 hashGenesisBlock;
MessageStartChars pchMessageStart;
//! Raw pub key bytes for the broadcast alert signing key.
std::vector<unsigned char> vAlertPubKey;
int nDefaultPort;
uint256 bnProofOfWorkLimit;
int nMaxReorganizationDepth;
int nSubsidyHalvingInterval;
int nEnforceBlockUpgradeMajority;
int nRejectBlockOutdatedMajority;
int nToCheckBlockUpgradeMajority;
int64_t nTargetTimespan;
int64_t nTargetSpacing;
int nLastPOWBlock;
int nMasternodeCountDrift;
int nMaturity;
int nModifierUpdateBlock;
CAmount nMaxMoneyOut;
int nMinerThreads;
std::vector<CDNSSeedData> vSeeds;
std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
CBaseChainParams::Network networkID;
std::string strNetworkID;
CBlock genesis;
std::vector<CAddress> vFixedSeeds;
bool fRequireRPCPassword;
bool fMiningRequiresPeers;
bool fAllowMinDifficultyBlocks;
bool fDefaultConsistencyChecks;
bool fRequireStandard;
bool fMineBlocksOnDemand;
bool fSkipProofOfWorkCheck;
bool fTestnetToBeDeprecatedFieldRPC;
bool fHeadersFirstSyncingActive;
int nPoolMaxTransactions;
std::string strSporkKey;
std::string strObfuscationPoolDummyAddress;
int64_t nStartMasternodePayments;
int nNewMasternodeCollateral_StartBlock;
int nNewMasternodeCollateral_GPBlock;
int nNewMasternode_Collateral;
int nOriginalMasternode_Collateral;
int64_t nBudget_Fee_Confirmations;
};
/**
* Modifiable parameters interface is used by test cases to adapt the parameters in order
* to test specific features more easily. Test cases should always restore the previous
* values after finalization.
*/
class CModifiableParams
{
public:
//! Published setters to allow changing values in unit test cases
virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) = 0;
virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority) = 0;
virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority) = 0;
virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority) = 0;
virtual void setDefaultConsistencyChecks(bool aDefaultConsistencyChecks) = 0;
virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks) = 0;
virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck) = 0;
};
/**
* Return the currently selected parameters. This won't change after app startup
* outside of the unit tests.
*/
const CChainParams& Params();
/** Return parameters for the given network. */
CChainParams& Params(CBaseChainParams::Network network);
/** Get modifiable network parameters (UNITTEST only) */
CModifiableParams* ModifiableParams();
/** Sets the params returned by Params() to those for the given network. */
void SelectParams(CBaseChainParams::Network network);
/**
* Looks for -regtest or -testnet and then calls SelectParams as appropriate.
* Returns false if an invalid combination is given.
*/
bool SelectParamsFromCommandLine();
#endif // BITCOIN_CHAINPARAMS_H
| [
"root@server1500.nazwa.pl"
] | root@server1500.nazwa.pl |
e3a08c6bf34647a7a27c2e2c4208ddc1c22fe7e9 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /gpu/khronos_glcts_support/native/main.cc | 94d4dbf38aa0df2066b1fad37e87398d9d2ccc31 | [
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | C++ | false | false | 1,702 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <cstdio>
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/message_loop/message_pump_type.h"
#include "base/task/single_thread_task_executor.h"
#include "third_party/khronos_glcts/framework/common/tcuApp.hpp"
#include "third_party/khronos_glcts/framework/common/tcuCommandLine.hpp"
#include "third_party/khronos_glcts/framework/common/tcuDefs.hpp"
#include "third_party/khronos_glcts/framework/common/tcuPlatform.hpp"
#include "third_party/khronos_glcts/framework/common/tcuResource.hpp"
#include "third_party/khronos_glcts/framework/common/tcuTestLog.hpp"
#include "third_party/khronos_glcts/framework/delibs/decpp/deUniquePtr.hpp"
// implemented in the native platform
tcu::Platform* createPlatform ();
void GTFMain(int argc, char* argv[]) {
setvbuf(stdout, DE_nullptr, _IOLBF, 4 * 1024);
try {
tcu::CommandLine cmdLine(argc, argv);
tcu::DirArchive archive(cmdLine.getArchiveDir());
tcu::TestLog log(cmdLine.getLogFileName(), cmdLine.getLogFlags());
de::UniquePtr<tcu::Platform> platform(createPlatform());
de::UniquePtr<tcu::App> app(
new tcu::App(*platform, archive, log, cmdLine));
// Main loop.
for (;;) {
if (!app->iterate())
break;
}
}
catch (const std::exception& e) {
tcu::die("%s", e.what());
}
}
int main(int argc, char *argv[]) {
base::AtExitManager at_exit;
base::CommandLine::Init(argc, argv);
base::SingleThreadTaskExecutor main_task_executor(base::MessagePumpType::UI);
GTFMain(argc, argv);
return 0;
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
7c79cc120403328a8522d1cf0f0fc4adbafbf307 | 65ab93cb4b9e8eec7e53bb4207c4b692d0602053 | /pat1012.cpp | 9892dfc0888b0179e1b33bba81f12d31e9129b59 | [] | no_license | ChordXD/2019Autumn | c4a8075ae46046b7e4be95bc21f74aec972f4259 | 21ba78c30d1afc6bbfef2772f9bcdeec994db52a | refs/heads/master | 2020-08-02T05:31:50.266551 | 2019-10-15T02:03:10 | 2019-10-15T02:03:10 | 211,249,523 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,182 | cpp | /* ***********************************************
Author :Chord
Email:pengrj2018@gmail.com
Created Time :2019/10/4 11:50:36
File Name :pat1012.cpp
************************************************ */
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <stack>
#include <bitset>
#include <iomanip>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 7;
#define EPS 1e-9
typedef struct{
string id;
int C,M,E,A;
void getA(){
A = (M + C + E) / 3;
}
}student;
student a[maxn];
map<string,int>haStudent;
int rankNumC[200],rankNumM[200],rankNumE[200],rankNumA[200];
int rankC[200],rankM[200],rankE[200],rankA[200];
void solve(void){
int n,m;
cin>>n>>m;
for(int i = 1 ; i <= n ; i++){
cin>>a[i].id>>a[i].C>>a[i].M>>a[i].E;
haStudent[a[i].id] = i;
a[i].getA();
rankNumC[a[i].C]++;
rankNumE[a[i].E]++;
rankNumM[a[i].M]++;
rankNumA[a[i].A]++;
}
int nowRankC = 1,nowRankM = 1,nowRankE = 1,nowRankA = 1;
for(int i = 100 ; i >= 0 ; i--){
if(rankNumC[i] != 0){
rankC[i] = nowRankC;
nowRankC += rankNumC[i];
}
if(rankNumE[i] != 0){
rankE[i] = nowRankE;
nowRankE += rankNumE[i];
}
if(rankNumM[i] != 0){
rankM[i] = nowRankM;
nowRankM += rankNumM[i];
}
if(rankNumA[i] != 0){
rankA[i] = nowRankA;
nowRankA += rankNumA[i];
}
}
while(m--){
string f;
cin>>f;
int id = haStudent[f];
if(!id)
cout<<"N/A"<<endl;
else{
int sC = rankC[a[id].C],sE = rankE[a[id].E],sM = rankM[a[id].M],sA = rankA[a[id].A];
int bestRank = sA;
char bestRankC = 'A';
if(sC < bestRank){
bestRank = sC;
bestRankC = 'C';
}
if(sM < bestRank){
bestRank = sM;
bestRankC = 'M';
}
if(sE < bestRank){
bestRank = sE;
bestRankC = 'E';
}
cout<<bestRank<<' '<<bestRankC<<endl;
}
}
}
int main()
{
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
solve();
return 0;
}
| [
"376841573@qq.com"
] | 376841573@qq.com |
cd57029f8f5e56f6e939b0a496f2754bc8823ce7 | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE126_Buffer_Overread/s01/CWE126_Buffer_Overread__CWE129_fgets_33.cpp | 63bbf8ac5003d8ee2e1f80a5daa83b225a2854d2 | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 4,486 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE126_Buffer_Overread__CWE129_fgets_33.cpp
Label Definition File: CWE126_Buffer_Overread__CWE129.label.xml
Template File: sources-sinks-33.tmpl.cpp
*/
/*
* @description
* CWE: 126 Buffer Overread
* BadSource: fgets Read data from the console using fgets()
* GoodSource: Larger than zero but less than 10
* Sinks:
* GoodSink: Ensure the array index is valid
* BadSink : Improperly check the array index by not checking the upper bound
* Flow Variant: 33 Data flow: use of a C++ reference to data within the same function
*
* */
#include "std_testcase.h"
#define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2)
namespace CWE126_Buffer_Overread__CWE129_fgets_33
{
#ifndef OMITBAD
void bad()
{
int data;
int &dataRef = data;
/* Initialize data */
data = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
{
int data = dataRef;
{
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to access an index of the array that is above the upper bound
* This check does not check the upper bounds of the array index */
if (data >= 0)
{
printIntLine(buffer[data]);
}
else
{
printLine("ERROR: Array index is negative");
}
}
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
static void goodG2B()
{
int data;
int &dataRef = data;
/* Initialize data */
data = -1;
/* FIX: Use a value greater than 0, but less than 10 to avoid attempting to
* access an index of the array in the sink that is out-of-bounds */
data = 7;
{
int data = dataRef;
{
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to access an index of the array that is above the upper bound
* This check does not check the upper bounds of the array index */
if (data >= 0)
{
printIntLine(buffer[data]);
}
else
{
printLine("ERROR: Array index is negative");
}
}
}
}
/* goodB2G() uses the BadSource with the GoodSink */
static void goodB2G()
{
int data;
int &dataRef = data;
/* Initialize data */
data = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
{
int data = dataRef;
{
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overread */
if (data >= 0 && data < (10))
{
printIntLine(buffer[data]);
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
}
}
void good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE126_Buffer_Overread__CWE129_fgets_33; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
9cf95ec1c4548e9f6ea2e556f4538df8e00f6d0c | d85b1f3ce9a3c24ba158ca4a51ea902d152ef7b9 | /testcases/CWE78_OS_Command_Injection/s09/CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81.h | 6fd8ca2791196ea28669e62b75f0bfc8b52c7e31 | [] | no_license | arichardson/juliet-test-suite-c | cb71a729716c6aa8f4b987752272b66b1916fdaa | e2e8cf80cd7d52f824e9a938bbb3aa658d23d6c9 | refs/heads/master | 2022-12-10T12:05:51.179384 | 2022-11-17T15:41:30 | 2022-12-01T15:25:16 | 179,281,349 | 34 | 34 | null | 2022-12-01T15:25:18 | 2019-04-03T12:03:21 | null | UTF-8 | C++ | false | false | 1,796 | h | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81.h
Label Definition File: CWE78_OS_Command_Injection.strings.label.xml
Template File: sources-sink-81.tmpl.h
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: listen_socket Read data using a listen socket (server side)
* GoodSource: Fixed string
* Sinks: w32_spawnlp
* BadSink : execute command with wspawnlp
* Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe"
#define COMMAND_INT L"cmd.exe"
#define COMMAND_ARG1 L"/c"
#define COMMAND_ARG2 L"dir "
#define COMMAND_ARG3 data
#else /* NOT _WIN32 */
#include <unistd.h>
#define COMMAND_INT_PATH L"/bin/sh"
#define COMMAND_INT L"sh"
#define COMMAND_ARG1 L"-c"
#define COMMAND_ARG2 L"ls "
#define COMMAND_ARG3 data
#endif
namespace CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81
{
class CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81_base
{
public:
/* pure virtual function */
virtual void action(wchar_t * data) const = 0;
};
#ifndef OMITBAD
class CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81_bad : public CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81_base
{
public:
void action(wchar_t * data) const;
};
#endif /* OMITBAD */
#ifndef OMITGOOD
class CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81_goodG2B : public CWE78_OS_Command_Injection__wchar_t_listen_socket_w32_spawnlp_81_base
{
public:
void action(wchar_t * data) const;
};
#endif /* OMITGOOD */
}
| [
"Alexander.Richardson@cl.cam.ac.uk"
] | Alexander.Richardson@cl.cam.ac.uk |
37264df8121f7adff4fe80e2fea6486a38b2b3e5 | d1a43e0597519b24cb185e9e239eda286c58f000 | /select/tcp_epoll_server.hpp | 40c018a71947f39128750cf49ceaad6b9a5cd9d1 | [] | no_license | NietzscheMYB/study-for-Linux | 5159661a3d9b23889d494ed295d32929a2000d74 | f0ba86623b98842aa53fa3739be081f0c8f3a0ed | refs/heads/master | 2020-05-19T08:00:32.908384 | 2020-01-08T11:55:54 | 2020-01-08T11:55:54 | 184,910,827 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,088 | hpp | #pragma once
#include<sys/epoll.h>
#include<vector>
#include"tcp_socket.hpp"
#include<functional>
#if 0
//相当于接口 Interface
class Base
{
public:
virtual void Add(const TcpSocket&)=0;
virtual void Del(const TcpSocket&)=0;
virtual void Wait(std::vector<TcpSocket>* output)=0;
};
#endif
//epoll 这个类就对标selector这个类
class Epoll{
public:
Epoll()
{
epoll_fd_=epoll_create(10);//10是随便写
}
~Epoll()
{
close(epoll_fd_);
}
//只有新客户端连接过来才调用,调用频率远低于select
//也就意味着 epoll 拷贝数据就远没有select 拷贝那么频繁
void Add(const TcpSocket& sock)
{
printf("[Epoll::ADD]%d\n",sock.GetFd());
epoll_event event;
event.events=EPOLLIN;//设置关注读就绪
event.data.fd=sock.GetFd();
//此处epoll add 的时候插入的是键值对
//fd在键和值之中都出现了,这件事情是迫不得已
//这也是epoll一个小小的槽点
epoll_ctl(epoll_fd_,EPOLL_CTL_ADD,sock.GetFd(),&event);//
}
#if 0
void Add(const TcpSocket& sock,bool is_et=false)
{
printf("[Epoll::ADD]%d\n",sock.GetFd());
epoll_event event;
event.events=EPOLLIN;//设置关注读就绪
if(is_et)
{
event.events|=EPOLLET;
}//每一个是分别对待
event.data.fd=sock.GetFd();
//此处epoll add 的时候插入的是键值对
//fd在键和值之中都出现了,这件事情是迫不得已
//这也是epoll一个小小的槽点
epoll_ctl(epoll_fd_,EPOLL_CTL_ADD,sock.GetFd(),&event);//
}
#endif
void Del(const TcpSocket& sock)
{
printf("[Epoll::Del]%d\n",sock.GetFd());
epoll_ctl(epoll_fd_,EPOLL_CTL_DEL,sock.GetFd(),NULL);//最后一个参数不填
}
void Wait(std::vector<TcpSocket>* output)
{
output->clear();
//等待文件描述符就绪
epoll_event events[100];
//最后一个参数表示阻塞等待
//返回之后,就用若干个文件描述符就绪,保存在events数组之中
//返回值结果就是在描述数组中有几个有效元素个数
//epoll_wait 返回内容只是键值对的值
//如果不加任何处理的话,用户不知道对应文件描述符是谁
//迫不得已,只能在插入的时候,把socket往值里也存一份
int nfds=epoll_wait(epoll_fd_,events,100,-1);
if(nfds<0)
{
perror("epoll_wait");
return ;
}
//依次处理每个就绪的文件描述符
for(int i=0;i<nfds;++i)
{
int sock=events[i].data.fd;
output->push_back(TcpSocket(sock));
}
}
private:
int epoll_fd_;//通过这个epoll_fd_找到内核中的对象,
//从从而进行文件描述符的管理
};
#define CHECK_RET(exp) if(!exp){return false;}
typedef std::function<void (std::string&,std::string*)> Handler;
class TcpEpollServer
{
public:
bool Start(const std::string& ip,uint16_t port,Handler handler)
{
//1.先创建socket
TcpSocket listen_sock;
CHECK_RET(listen_sock.Socket());
//2.绑定端口号
CHECK_RET(listen_sock.Bind(ip,port));
//3.监听socket
CHECK_RET(listen_sock.Listen());
//4.创建epoll对象,并把listen_sock 用epoll管理起来
Epoll epoll;
epoll.Add(listen_sock);
//5.进入主循环
while (true)
{
//6.使用Epoll::Wait 等待文件描述符就绪
std::vector<TcpSocket> output;
epoll.Wait(&output);
//7.循环处理每个就绪的文件描述符,也是分成两种情况
for(auto sock:output)
{
if(sock.GetFd()==listen_sock.GetFd())
{
// a.listen_sock 就调用accept
TcpSocket client_sock;
sock.Accept(&client_sock);
epoll.Add(client_sock);
}else
{
// b.非listen_sock,就调用Recv
std::string req;
int n=sock.Recv(&req);
if(n<0)
{
continue;
}
if(n==0)
{
//对端关闭
printf("[client %d]disconnected!\n",sock.GetFd());
sock.Close();
epoll.Del(sock);
continue;
}
//正确读取的情况
printf("[client %d]%s\n",sock.GetFd(),req.c_str());
std::string resp;
handler(req,&resp);
sock.Send(resp);
}//end else
}
}
}
};
//Nginx 非常知名的使用Epoll的开源项目
//NodeJs | [
"1023826776@qq.com"
] | 1023826776@qq.com |
0a3a081e8c90b3e1524d7e21b5a1e1a373842359 | 061577d99f928066f7a8b314875152dd6b2c1193 | /multimedia/mrvl_media_player/player/MRVLFFPlayer.cpp | ffa7c1d96f255ac3170c29a91a06953c09d62719 | [] | no_license | xfdingustc/mmp | ff1c1e03f4d74ce3e01ebc4d5efa66c8f59edc87 | d1cc648cdf2865be04ab8045d8e721af633494cd | refs/heads/master | 2020-12-02T08:01:06.535151 | 2017-07-10T09:44:32 | 2017-07-10T09:44:32 | 96,760,049 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,261 | cpp | /*
** Copyright 2012, MARVELL SEMICONDUCTOR, LTD.
** THIS CODE CONTAINS CONFIDENTIAL INFORMATION OF MARVELL.
** NO RIGHTS ARE GRANTED HEREIN UNDER ANY PATENT, MASK WORK RIGHT OR COPYRIGHT
** OF MARVELL OR ANY THIRD PARTY. MARVELL RESERVES THE RIGHT AT ITS SOLE
** DISCRETION TO REQUEST THAT THIS CODE BE IMMEDIATELY RETURNED TO MARVELL.
** THIS CODE IS PROVIDED "AS IS". MARVELL MAKES NO WARRANTIES, EXPRESSED,
** IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE.
**
** MARVELL COMPRISES MARVELL TECHNOLOGY GROUP LTD. (MTGL) AND ITS SUBSIDIARIES,
** MARVELL INTERNATIONAL LTD. (MIL), MARVELL TECHNOLOGY, INC. (MTI), MARVELL
** SEMICONDUCTOR, INC. (MSI), MARVELL ASIA PTE LTD. (MAPL), MARVELL JAPAN K.K.
** (MJKK), MARVELL ISRAEL LTD. (MSIL).
*/
extern "C" {
#include <poll.h>
#include <pthread.h>
}
#include <utils/Log.h>
#include <media/mediaplayer.h>
#include <utils/KeyedVector.h>
#include <utils/String8.h>
#include "MediaPlayerOnlineDebug.h"
#include "MRVLFFPlayer.h"
#undef LOG_TAG
#define LOG_TAG "MRVLFFPlayer"
namespace mmp {
#define MSToUs 1000
// 10M is a proper buffer size. It won't take too long to buffer 10M, also buffering won't
// happen too frequently.
#define VOD_Buffering_Threshold (10 * 1000 * 1000)
#define Live_BUffering_Threshold (1 * 1000 * 1000)
volatile int32_t MRVLFFPlayer::instance_id_ = 0;
MRVLFFPlayer::MRVLFFPlayer(MRVLFFPlayerCbTarget *target)
: cur_play_speed_(1.0),
work_thread_id_(0),
pending_seek_(false),
pending_seek_target_(0),
seek_in_progress_(false),
cb_target_(target),
is_eos_sent_(false) {
// initilize members
front_ = 0;
end_ = 0;
for (int i = 0; i < QUEUE_LEN; i++) {
state_queue_[i] = State_Invalid;
}
cur_state_ = State_WaitingForPrepare;
tgt_state_ = State_Invalid;
is_loopback_enabled_ = false;
sprintf(log_tag_, "MRVLFFPlayer%d", instance_id_);
android_atomic_inc(&instance_id_);
core_player_ = new CorePlayer(this);
MV_LOGI("Create MRVLFFPlayer Done");
}
MRVLFFPlayer::~MRVLFFPlayer() {
MV_LOGI("Begin to destroy FFMPEG Player");
reset();
if(core_player_) {
core_player_->Reset();
delete core_player_;
core_player_ = NULL;
}
MV_LOGI("Destroy FFMPEG Player Done");
}
status_t MRVLFFPlayer::sendMsg(MSG_TYPE message, void* data) {
uint32_t width, height, resolution;
uint32_t channel_info;
int *errorno = NULL;
int progress = 0;
char *ip_addr = NULL;
switch (message) {
case MSG_EOS:
if (is_loopback_enabled_) {
MV_LOGD("EOS recieved and loop is set, play again.");
seekTo(0);
} else {
MV_LOGD("EOS recieved, send MEDIA_PLAYBACK_COMPLETE to player.");
if (!is_eos_sent_) {
if (cb_target_) {
MV_LOGD("send MEDIA_PLAYBACK_COMPLETE to application");
cb_target_->sendMsg(MEDIA_PLAYBACK_COMPLETE);
}
is_eos_sent_ = true;
// As android http://developer.android.com/reference/android/media/MediaPlayer.html
// While in the PlaybackCompleted state, calling start() can restart the playback from
// the beginning of the audio/video source.
pause();
seekTo(0);
}
}
break;
case MSG_RES_CHANGE:
resolution = *(reinterpret_cast<uint32_t*>(data));
width = resolution >> 16;
height = resolution & 0xFFFF;
MV_LOGD("Got resolution width = %d, height = %d.", width, height);
if (cb_target_) {
cb_target_->sendMsg(MEDIA_SET_VIDEO_SIZE, width, height);
}
break;
case MSG_RENDERING_START:
if (cb_target_) {
cb_target_->sendMsg(MEDIA_INFO, MEDIA_INFO_RENDERING_START, 0);
}
break;
case MSG_ERROR:
MV_LOGD("---ERROR MSG---");
if ((State_Preparing == cur_state_) && (State_Stopped == tgt_state_)) {
// error is reported during prepare.
} else {
// On error, shut down the pipeline.
// Call reset() may result in deadlock, we'd better do it asynchronously.
action_mutex_.lock();
setNextState_l(State_Shutdown);
wakeup_event_.setEvent();
action_mutex_.unlock();
}
if (cb_target_) {
errorno = (int *)data;
cb_target_->sendMsg(MEDIA_ERROR, 100, *errorno);
}
break;
case MSG_TIMED_TEXT:
if (cb_target_) {
cb_target_->sendMsg(MEDIA_TIMED_TEXT, 0, 0, data);
}
break;
case MSG_SEEK_COMPLETE:
MV_LOGD("---SEEK COMPLETE MSG---");
if (cb_target_) {
cb_target_->sendMsg(MEDIA_SEEK_COMPLETE);
}
seek_in_progress_ = false;
break;
case MSG_RESOURCE_READY:
MV_LOGD("---RESOURCE READY MSG---");
channel_info = *(reinterpret_cast<uint32_t*>(data));
if (cb_target_) {
cb_target_->sendMsg(MEDIA_INFO, MSG_RESOURCE_READY, channel_info);
}
break;
case MSG_PLAYING_BANDWIDTH:
MV_LOGD("---HLS PLAYING_BANDWIDTH MSG---");
if (cb_target_) {
int *ptr = (int *)data;
int bandwidth = *ptr;
MV_LOGD("new bandwidth for HLS is %d bps", bandwidth);
cb_target_->sendMsg(MEDIA_INFO, MSG_PLAYING_BANDWIDTH, bandwidth);
}
break;
case MSG_HLS_REALTIME_SPEED:
MV_LOGD("---HLS REALTIME_SPEED MSG---");
if (cb_target_) {
int *ptr = (int *)data;
int realtime_speed = (*ptr) / 1000;
MV_LOGD("HLS TS real time download speed is %d Kbit/s", realtime_speed);
cb_target_->sendMsg(MEDIA_INFO, MSG_HLS_REALTIME_SPEED, realtime_speed);
}
break;
case MSG_HLS_IP_ADDRESS:
ip_addr = (char *)data;
if (cb_target_) {
// Notify application that we get a new IP address, then app should get it through invoke().
cb_target_->sendMsg(MEDIA_INFO, MSG_HLS_IP_ADDRESS, (int)data);
}
break;
case MSG_BUFFERING_UPDATE:
if (cb_target_) {
int *buffering_level = (int *)data;
MV_LOGD("Have buffered %d%% data", *buffering_level);
cb_target_->sendMsg(MEDIA_BUFFERING_UPDATE, *buffering_level);
}
break;
default:
break;
}
return 1;
}
status_t MRVLFFPlayer::setDataSource(const char *url) {
bool ret = false;
MV_LOGI("setDataSource, url=%s", url);
MmuAutoLock lock(action_mutex_);
if (kSuccess != core_player_->SetSource(url)) {
MV_LOGE("Failed to set source for FF player");
return false;
}
MV_LOGI("LEAVE");
return true;
}
status_t MRVLFFPlayer::setDataSource(const char *url,
const KeyedVector<String8, String8> *headers) {
bool ret = false;
android::String8 cookie;
cookie.append("COOKIE");
android::String8 value;
if (headers != NULL) {
value.append(headers->valueAt(0));
}
MV_LOGI("setDataSource, url=%s, headers = %p", url, headers);
MmuAutoLock lock(action_mutex_);
if (kSuccess != core_player_->SetSource(url, headers)) {
MV_LOGE("Failed to set source for FF player");
return false;
}
MV_LOGI("LEAVE");
return true;
}
status_t MRVLFFPlayer::setDataSource(int fd, int64_t offset, int64_t length) {
bool ret = false;
MV_LOGI("setDataSource, fd=%d, offset=%lld, length=%lld", fd, offset, length);
MmuAutoLock lock(action_mutex_);
if (kSuccess != core_player_->SetSource(fd, offset, length)) {
MV_LOGE("Failed to set source for FF player");
return false;
}
MV_LOGI("LEAVE");
return true;
}
status_t MRVLFFPlayer::setSecondDataSource(const char* url, const char* mime_type) {
MmuAutoLock lock(action_mutex_);
MV_LOGI("setSecondDataSource, url=%s", url);
if (kSuccess != core_player_->SetSecondSource(url, mime_type)) {
MV_LOGE("Failed to set second source for FF player");
return false;
}
MV_LOGI("LEAVE");
return true;
}
status_t MRVLFFPlayer::setSecondDataSource(int fd, int64_t offset, int64_t length,
const char* mime_type){
bool ret = false;
MV_LOGI("setSecondDataSource, fd=%d, offset=%lld, length=%lld", fd, offset, length);
MmuAutoLock lock(action_mutex_);
if (kSuccess != core_player_->SetSecondSource(fd, offset, length, mime_type)) {
MV_LOGE("Failed to set source for FF player");
return false;
}
MV_LOGI("LEAVE");
return true;
};
status_t MRVLFFPlayer::prepare() {
MV_LOGI("ENTER");
prepareAsync();
int retryCount = 0;
int sleepTime = 10000;
while ((cur_state_ != State_Stopped) && (retryCount < 100)) {
usleep(sleepTime);
retryCount ++;
}
MV_LOGI("LEAVE");
return (cur_state_ == State_Stopped) ? NO_ERROR : UNKNOWN_ERROR;
}
status_t MRVLFFPlayer::prepareAsync() {
MV_LOGI("ENTER");
if (!wakeup_event_.successfulInit()) {
MV_LOGE("failed to initialize wakeup event.");
return UNKNOWN_ERROR;
}
MmuAutoLock lock(action_mutex_);
cur_state_ = State_Preparing;
setNextState_l(State_Stopped);
int res = pthread_create(&work_thread_id_, NULL, staticWorkThreadEntry, this);
if (res) {
MV_LOGE("MRVLFFPlayer failed to create its work thread (err = %d)", res);
return UNKNOWN_ERROR;
}
MV_LOGI("LEAVE");
return NO_ERROR;
}
status_t MRVLFFPlayer::start() {
MV_LOGI("ENTER");
if (cur_state_ == State_Playing) {
MV_LOGI("cur_state_ is alreay State_Playing, don't set again.");
return NO_ERROR;
}
MmuAutoLock lock(action_mutex_);
setNextState_l(State_Playing);
wakeup_event_.setEvent();
mCondition_.wait(action_mutex_);
MV_LOGI("LEAVE");
if (State_Playing == cur_state_) {
return NO_ERROR;
} else {
return UNKNOWN_ERROR;
}
}
status_t MRVLFFPlayer::pause() {
MV_LOGI("ENTER");
MmuAutoLock lock(action_mutex_);
setNextState_l(State_Paused);
wakeup_event_.setEvent();
mCondition_.wait(action_mutex_);
MV_LOGI("LEAVE");
if ((State_Paused == cur_state_)) {
return NO_ERROR;
} else {
return UNKNOWN_ERROR;
}
}
status_t MRVLFFPlayer::stop() {
MV_LOGI("ENTER");
MmuAutoLock lock(action_mutex_);
setNextState_l(State_Stopped);
wakeup_event_.setEvent();
MV_LOGI("LEAVE");
return NO_ERROR;
}
status_t MRVLFFPlayer::reset() {
MV_LOGI("ENTER");
// Stop CorePlayer datasource firstly so that reset() won't block,
// especially at preapare stage for HLS.
core_player_->stopDataSource();
// Destroy work thread, which also reset CorePlayer.
if (work_thread_id_) {
void* thread_ret;
action_mutex_.lock();
clearAllStateRequests();
setNextState_l(State_Shutdown);
action_mutex_.unlock();
MV_LOGI("wait MRVLFFPlayer thread finished.");
pthread_join(work_thread_id_, &thread_ret);
MV_LOGI("now work thread is already shut down.");
work_thread_id_ = 0;
}
MV_LOGI("LEAVE");
return NO_ERROR;
}
bool MRVLFFPlayer::isPlaying() {
bool ret = false;
if (is_eos_sent_) {
ret = false;
} else {
ret = (State_Playing == cur_state_);
}
MV_LOGV("it is %s playing.", ret ? "" : "not");
return ret;
}
status_t MRVLFFPlayer::seekTo(int msec) {
if (1.0 != cur_play_speed_) {
MV_LOGE("it is during trick play, seek is not supported");
if (cb_target_) {
cb_target_->sendMsg(MEDIA_SEEK_COMPLETE);
}
return NO_ERROR;
}
MV_LOGI("Seek to "TIME_FORMAT"(%d ms).", TIME_ARGS(msec * 1000), msec);
MmuAutoLock lock(action_mutex_);
pending_seek_ = true;
pending_seek_target_ = msec;
wakeup_event_.setEvent();
MV_LOGI("LEAVE");
return NO_ERROR;
}
bool MRVLFFPlayer::setLooping(bool loop) {
MV_LOGI("loop = %s", (loop!=0) ? "TRUE" : "FALSE");
MmuAutoLock lock(action_mutex_);
is_loopback_enabled_ = loop;
return true;
}
bool MRVLFFPlayer::getLooping() {
MV_LOGI("loop = %s", is_loopback_enabled_ ? "TRUE" : "FALSE");
return is_loopback_enabled_;
}
status_t MRVLFFPlayer::getCurrentPosition(int *msec) {
uint64_t pos = 0;
MmuAutoLock lock(action_mutex_);
*msec = 0;
if (cur_state_ == State_Preparing) {
MV_LOGI("cur_state_ is State_Preparing, return directly");
return NO_ERROR;
}
pos = core_player_->GetPosition();
*msec = (int)(pos / 1000);
if(*msec < 0) {
*msec = 0;
}
MV_LOGV("Current position: "TIME_FORMAT, TIME_ARGS(pos));
return NO_ERROR;
}
status_t MRVLFFPlayer::getDuration(int *msec) {
uint64_t dur;
*msec = 0;
dur = core_player_->GetDuration();
*msec = (int)(dur / MSToUs);
if(*msec < 0) {
*msec = 0;
}
return NO_ERROR;
}
status_t MRVLFFPlayer::setVolume(float leftVolume, float rightVolume) {
core_player_->setVolume(leftVolume, rightVolume);
return NO_ERROR;
}
status_t MRVLFFPlayer::fastforward(int speed) {
MmuAutoLock lock(action_mutex_);
tgt_play_speed_ = (double)speed;
MV_LOGI("set tgt_play_speed_ %f", tgt_play_speed_);
return NO_ERROR;
}
status_t MRVLFFPlayer::slowforward(int speed) {
double slowspeed;
slowspeed = 1.0;
slowspeed /= speed;
MmuAutoLock lock(action_mutex_);
tgt_play_speed_ = (double)slowspeed;
MV_LOGI("set tgt_play_speed_ %f", tgt_play_speed_);
return NO_ERROR;
}
status_t MRVLFFPlayer::fastbackward(int speed) {
double fastspeed;
fastspeed = -(double)speed;
MmuAutoLock lock(action_mutex_);
tgt_play_speed_ = fastspeed;
MV_LOGI("set tgt_play_speed_ %f", tgt_play_speed_);
return NO_ERROR;
}
uint32_t MRVLFFPlayer::GetAudioSubStreamCounts() {
MV_LOGI("ENTER");
if(core_player_ != NULL) {
return core_player_->GetAudioStreamCount();
} else {
return 0;
}
}
uint32_t MRVLFFPlayer::GetVideoSubStreamCounts() {
MV_LOGI("ENTER");
if(core_player_ != NULL) {
return core_player_->GetVideoStreamCount();
} else {
return 0;
}
}
int32_t MRVLFFPlayer::GetCurrentAudioSubStream() {
MV_LOGI("ENTER");
MmuAutoLock lock(action_mutex_);
if (core_player_) {
return core_player_->GetCurrentAudioStream();
} else {
return -1;
}
}
bool MRVLFFPlayer::getAudioStreamsDescription(streamDescriptorList *desc_list) {
MV_LOGI("ENTER");
bool ret = false;
MmuAutoLock lock(action_mutex_);
if (!desc_list || !core_player_) {
ret = false;
}
if (core_player_) {
ret = core_player_->getAudioStreamsDescription(desc_list);
}
return ret;
}
status_t MRVLFFPlayer::SetCurrentAudioSubStream(int sub_stream_id) {
MV_LOGI("ENTER");
int current_audio = 0;
int totalaudio_count = 0;
MmuAutoLock lock(action_mutex_);
totalaudio_count = core_player_->GetAudioStreamCount();
if ( totalaudio_count == 0) {
MV_LOGI("This file just has %d audio stream!!!", totalaudio_count);
return UNKNOWN_ERROR;
}else if ( totalaudio_count == 1) {
return NO_ERROR;
}else if ( sub_stream_id < 0 && sub_stream_id >= totalaudio_count) {
MV_LOGI("This audio id is invalid, please set audioID from 0 to %d!!",
totalaudio_count- 1);
return UNKNOWN_ERROR;
} else {
// set current audio streams ;
core_player_->SelectAudioStream(sub_stream_id);
current_audio = core_player_->GetCurrentAudioStream();
MV_LOGI("setcurrentAudiotrackID( cur %d) done( total %d)",
current_audio, totalaudio_count);
}
MV_LOGI("EXIT");
return NO_ERROR;
}
uint32_t MRVLFFPlayer::GetSubtitleSubStreamCounts() {
MV_LOGI("ENTER");
if(core_player_ != NULL)
return core_player_->GetSubtitleStreamCount();
else
return 0;
}
int32_t MRVLFFPlayer::GetCurrentSubtitleSubStream() {
MV_LOGI("ENTER");
MmuAutoLock lock(action_mutex_);
if (core_player_) {
return core_player_->GetCurrentSubtitleStream();
} else {
return -1;
}
}
bool MRVLFFPlayer::getSubtitleStreamsDescription(streamDescriptorList *desc_list) {
MV_LOGI("ENTER");
bool ret = false;
MmuAutoLock lock(action_mutex_);
if (!desc_list || !core_player_) {
ret = false;
}
if (core_player_) {
ret = core_player_->getSubtitleStreamsDescription(desc_list);
}
return ret;
}
bool MRVLFFPlayer::needCheckTimeOut() {
#if 0
// Only in local media play back we do not check timeout
if (core_player_ && CorePlayer::SOURCE_FILE == core_player_->getDataSourceType()) {
return false;
} else {
return true;
}
#else
return true;
#endif
}
status_t MRVLFFPlayer::SetCurrentSubtitleSubStream(int subid) {
MV_LOGI("ENTER");
bool ret = false;
int current_sub = 0;
int allsub_count = 0;
MmuAutoLock lock(action_mutex_);
allsub_count = core_player_->GetSubtitleStreamCount();
if ( allsub_count == 0) {
MV_LOGI("This file no subtitle!!!\n");
return UNKNOWN_ERROR;
} else if ( subid <= -1 && subid >= allsub_count) {
MV_LOGI("This subtitle id is invalid, please set SubID from -1 to %d!!",
allsub_count- 1);
return UNKNOWN_ERROR;
} else {
// set current subtitle ;
core_player_->SelectSubtitleStream(subid);
current_sub = core_player_->GetCurrentSubtitleStream();
MV_LOGI("setcurrentSubtitletrackID(cur %d) done(total %d)",
current_sub, allsub_count);
}
ret = NO_ERROR;
exit:
return NO_ERROR;
}
status_t MRVLFFPlayer::DeselectSubtitleSubStream(int subid) {
MV_LOGI("ENTER");
status_t ret = NO_ERROR;
int current_sub = 0;
int allsub_count = 0;
MmuAutoLock lock(action_mutex_);
allsub_count = core_player_->GetSubtitleStreamCount();
if ( allsub_count == 0) {
MV_LOGI("This file no subtitle!!!\n");
return UNKNOWN_ERROR;
} else if ( subid <= -1 && subid >= allsub_count) {
MV_LOGI("This subtitle id is invalid, please set SubID from -1 to %d!!",
allsub_count- 1);
return UNKNOWN_ERROR;
} else {
// set current subtitle ;
MediaResult err = core_player_->DeselectSubtitleStream(subid);
if (err != kSuccess) {
ret = UNKNOWN_ERROR;
}
}
exit:
return ret;
}
// It should be called after lock is held.
void MRVLFFPlayer::setNextState_l(State state) {
// We simply ignore overflow of state queue because there won't be
// many state change in a short time.
state_queue_[end_++] = state;
if (end_ >= QUEUE_LEN) {
end_ = 0;
}
}
MRVLFFPlayer::State MRVLFFPlayer::getNextState() {
State next = State_Invalid;
MmuAutoLock lock(action_mutex_);
if (front_ == end_) {
return State_Invalid;
}
next = state_queue_[front_++];
if (front_ >= QUEUE_LEN) {
front_ = 0;
}
return next;
}
// It should be called after lock is held.
bool MRVLFFPlayer::clearAllStateRequests() {
// Remove state transition requests.
front_ = 0;
end_ = 0;
for (int i = 0; i < QUEUE_LEN; i++) {
state_queue_[i] = State_Invalid;
}
// Remove seek request.
pending_seek_ = false;
pending_seek_target_ = 0;
return true;
}
bool MRVLFFPlayer::transferFromPreparing() {
MmuAutoLock lock(action_mutex_);
switch (tgt_state_) {
case State_Stopped:
break;
case State_Shutdown:
return true;
default:
return false;
}
bool ret = false;
if (kSuccess == core_player_->Prepare()) {
MV_LOGI("Core player is prepared, send MEDIA_PREPARED");
if (cb_target_) {
cb_target_->sendMsg(MEDIA_PREPARED);
}
cur_state_ = State_Stopped;
ret = true;
} else {
setNextState_l(State_Shutdown);
if (cb_target_) {
cb_target_->sendMsg(MEDIA_ERROR, 100, MRVL_PLAYER_ERROR_PROBE_FILE_FAILED);
}
MV_LOGE("work thread, CorePlayer meet error when prepare");
}
return ret;
}
bool MRVLFFPlayer::transferFromStopped() {
MmuAutoLock lock(action_mutex_);
switch (tgt_state_) {
case State_Playing:
break;
case State_Paused:
cur_state_ = State_Paused;
return true;
case State_Shutdown:
return true;
default:
return false;
}
bool ret = false;
if (kSuccess == core_player_->Play(1.0)) {
cur_play_speed_ = 1.0;
tgt_play_speed_ = 1.0;
cur_state_ = State_Playing;
is_eos_sent_ = false;
ret = true;
}
mCondition_.broadcast();
return ret;
}
bool MRVLFFPlayer::transferFromPaused() {
MmuAutoLock lock(action_mutex_);
switch (tgt_state_) {
case State_Playing:
break;
case State_Stopped:
cur_state_ = State_Stopped;
return (kSuccess == core_player_->Stop());
case State_Shutdown:
return true;
default:
return false;
}
bool ret = false;
if (kSuccess == core_player_->Resume(1.0)) {
cur_play_speed_ = 1.0;
tgt_play_speed_ = 1.0;
cur_state_ = State_Playing;
ret = true;
}
mCondition_.broadcast();
return ret;
}
bool MRVLFFPlayer::transferFromPlaying() {
MmuAutoLock lock(action_mutex_);
bool ret = false;
switch (tgt_state_) {
case State_Stopped:
cur_state_ = State_Stopped;
return (kSuccess == core_player_->Stop());
case State_Paused:
ret = (kSuccess == core_player_->Pause());
cur_state_ = State_Paused;
mCondition_.broadcast();
return ret;
case State_Shutdown:
return true;
default:
return false;
}
}
bool MRVLFFPlayer::processSeek() {
MmuAutoLock lock(action_mutex_);
MV_LOGI("ENTER");
bool ret = false;
seek_in_progress_ = true;
if (kSuccess == core_player_->SetPosition((uint64_t)pending_seek_target_ * MSToUs)) {
MV_LOGI("seek success");
is_eos_sent_ = false;
ret = true;
} else {
seek_in_progress_ = false;
MV_LOGE("seek failed");
}
pending_seek_ = false;
pending_seek_target_ = 0;
MV_LOGI("EXIT");
return ret;
}
bool MRVLFFPlayer::processTrickPlay() {
double play_speed = 1.0;
{
// No need to protect the whole pipeline operation.
MmuAutoLock lock(action_mutex_);
play_speed = tgt_play_speed_;
}
bool ret = false;
if (kSuccess == core_player_->Play(play_speed)) {
cur_play_speed_ = play_speed;
ret = true;
} else {
MV_LOGE("calling trick play failed");
}
return ret;
}
bool MRVLFFPlayer::waitingForWork(int msecTimeout) {
struct pollfd wait_fd;
wait_fd.fd = wakeup_event_.getWakeupHandle();
wait_fd.events = POLLIN;
wait_fd.revents = 0;
int res = poll(&wait_fd, 1, msecTimeout);
wakeup_event_.clearPendingEvents();
if (res < 0) {
MV_LOGE("Wait error in PipeEvent, sleeping to prevent overload!");
usleep(1000);
}
return (res > 0);
}
void* MRVLFFPlayer::MRVLFFPlayerWorkThread() {
bool abort_work_thread = false;
const int sleepTime = 10; // 10ms for waitingForWork()
// 20ms
const uint64_t PLAY_TIME_DELTA = 20 * 1000 * 1000;
// play position
uint64_t last_position = 0;
uint64_t current_position = 0;
// 200ms
const uint64_t Delta = 200 * 1000;
// 5s
const int Delta_Underrun = 5 * 1000 * 1000;
// time past
struct timeval last;
struct timeval current;
uint64_t timpe_past = 0;
int underrun_times = 0;
struct timeval underrun_time;
uint64_t timpe_past_from_underrun = 0;
gettimeofday(&last, NULL);
gettimeofday(&underrun_time, NULL);
tgt_state_ = getNextState();
while ((tgt_state_ != State_Shutdown) && !abort_work_thread) {
if ((State_Invalid == tgt_state_) || (cur_state_ == tgt_state_)) {
if (pending_seek_ && (cur_state_ >= State_Stopped)) {
if (!processSeek()) {
MV_LOGE("Failed to process pending seek to %d mSec.", pending_seek_target_);
abort_work_thread = true;
}
} else if ((cur_play_speed_ != tgt_play_speed_) &&
(State_Playing == cur_state_ || State_Paused == cur_state_)) {
if (!processTrickPlay()) {
MV_LOGE("Failed to process trick play from %f to %f.",
cur_play_speed_, tgt_play_speed_);
abort_work_thread = true;
}
} else {
// Check whether underrun happens every 200ms.
if (!seek_in_progress_) {
gettimeofday(¤t, NULL);
timpe_past += (current.tv_sec - last.tv_sec) * 1000000 + (current.tv_usec - last.tv_usec);
last.tv_sec = current.tv_sec;
last.tv_usec = current.tv_usec;
} else {
gettimeofday(&last, NULL);
timpe_past = 0;
}
if (timpe_past >= Delta) {
timpe_past = 0;
bool datasource_underrun = core_player_->isUnderrun();
}
// Waiting for new task.
waitingForWork(sleepTime);
}
} else {
MV_LOGD("transfer state cur state = %s, target state = %s",
State2Str(cur_state_), State2Str(tgt_state_));
switch (cur_state_) {
case State_Preparing:
if (!transferFromPreparing()) {
MV_LOGE("Unexpected error transitioning from %s to %s",
State2Str(cur_state_), State2Str(tgt_state_));
abort_work_thread = true;
}
break;
case State_Stopped:
if (!transferFromStopped()) {
MV_LOGE("Unexpected error transitioning from %s to %s",
State2Str(cur_state_), State2Str(tgt_state_));
abort_work_thread = true;
}
break;
case State_Paused:
if (!transferFromPaused()) {
MV_LOGE("Unexpected error transitioning from %s to %s",
State2Str(cur_state_), State2Str(tgt_state_));
abort_work_thread = true;
}
break;
case State_Playing:
if (!transferFromPlaying()) {
MV_LOGE("Unexpected error transitioning from %s to %s",
State2Str(cur_state_), State2Str(tgt_state_));
abort_work_thread = true;
}
break;
case State_Shutdown:
break;
case State_WaitingForPrepare:
default:
MV_LOGE("Unexpected cur_state = %d in work thread; aborting!", cur_state_);
abort_work_thread = true;
}
}
tgt_state_ = getNextState();
}
// CorePlayer pipeline is created in this thread, so it is proper to destoy it when exit thread.
if (core_player_) {
core_player_->Reset();
}
if (abort_work_thread && cb_target_) {
cb_target_->sendMsg(MEDIA_ERROR, 100, MRVL_PLAYER_ERROR_PLAYER_ERROR);
}
MV_LOGD("quit MRVLFFPlayerWorkThread now");
cur_state_ = State_Shutdown;
mCondition_.broadcast();
return NULL;
}
/* static */
void* MRVLFFPlayer::staticWorkThreadEntry(void* thiz) {
if (thiz == NULL) {
return NULL;
}
MRVLFFPlayer *pMRVLFFPlayer = reinterpret_cast<MRVLFFPlayer*>(thiz);
// Give our thread a name to assist in debugging.
prctl(PR_SET_NAME, "MRVLFFPlayerWorkThread", 0, 0, 0);
return pMRVLFFPlayer->MRVLFFPlayerWorkThread();
}
}
| [
"ding.xiaofei@whaley.cn"
] | ding.xiaofei@whaley.cn |
42632d724a206e894e3e01d90b572e482934e5de | 9eb8b09eb8a0af700e68ce909ad3291857ffafc3 | /src/x3d/OpenGLRenderer.cpp | 46b599a75a2f25e35d8c027489dc244c3a1fe500 | [] | no_license | fry/x3d | 2f91783351906813e4f4b2fff9ff51068ba53983 | 8ee8f5f2412a9f498c47c1acdf0707ce37f3f90c | refs/heads/master | 2021-01-10T20:22:45.528571 | 2010-11-07T18:44:59 | 2010-11-07T18:44:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,077 | cpp | #if defined(__WIN32__)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <gl/glew.h>
#else
#include <gl/glew.h>
#endif
#include "x3d/OpenGLRenderer.hpp"
#include "x3d/OpenGLTexture.hpp"
#include <iostream>
namespace {
void set_matrix(GLenum mode, const x3d::Matrix4<float>& mat) {
glMatrixMode(mode);
glLoadMatrixf(mat);
}
void set_matrix(GLenum mode, const x3d::Matrix4<double>& mat) {
glMatrixMode(mode);
glLoadMatrixd(mat);
}
void initialize_texturing() {
glEnable(GL_TEXTURE_2D);
// select modulate to mix texture with color for shading
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
}
void setup_texture() {
// when texture area is small, bilinear filter the closest mipmap
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST );
// when texture area is large, bilinear filter the original
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
// the texture wraps over at the edges (repeat)
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
}
static const char* extension_requirements[] = {
"GL_ARB_vertex_buffer_object",
0
};
}
using namespace x3d::Core;
void OpenGLRenderer::begin() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
void OpenGLRenderer::end() {
}
void OpenGLRenderer::initialize(int width, int height) {
log().infoStream() << "OpenGL Version: " << glGetString(GL_VERSION);
log().infoStream() << "Renderer: " << glGetString(GL_RENDERER);
log().infoStream() << "Vendor: " << glGetString(GL_VENDOR);
glViewport(0, 0, width, height);
glClearDepth(1.0);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glDepthFunc(GL_LEQUAL);
glEnable(GL_CULL_FACE);
glFrontFace(GL_CW);
glEnable(GL_DEPTH_TEST);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glShadeModel(GL_SMOOTH);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
set_clear_color(x3d::Color::Red);
initialize_texturing();
m_screen_width = width;
m_screen_height = height;
// Initialize glew
GLenum ret = glewInit();
if (GLEW_OK != ret) {
log().errorStream() << "Error initializing GLEW: " << glewGetErrorString(ret);
}
// Confirm required extensions are supported
const char** ext = extension_requirements;
while (*ext) {
if (glewIsSupported(*ext)) {
log().infoStream() << *ext << " supported";
} else {
log().errorStream() << *ext << " NOT supported";
}
ext ++;
}
}
void OpenGLRenderer::set_matrix_projection(const x3d::Matrix4f& mat) {
set_matrix(GL_PROJECTION, mat);
}
void OpenGLRenderer::set_matrix_modelview(const x3d::Matrix4f& mat) {
set_matrix(GL_MODELVIEW, mat);
}
x3d::Texture* OpenGLRenderer::create_texture(x3d::Image* image) {
return new x3d::OpenGLTexture(image);
}
void OpenGLRenderer::set_clear_color(const x3d::Color& color) {
glClearColor(color.r, color.g, color.b, color.a);
}
| [
"e.siew@londeroth.org"
] | e.siew@londeroth.org |
294a4963b7cb57fcc3a0c1fcf748016249123f9b | 6dbe76259489be2f21fde27bbe7093621a0789f9 | /libraries/TFT/TFT.cpp | 00959cd9eb6a94d561934409fe4f7fa3e60e81c8 | [] | no_license | kbarre123/Arduino | d846e7285dcd4ca84db0853acf3126748b2e1ca9 | e306c2d197f33a968ba23957d96a55e6f9202fd4 | refs/heads/master | 2021-01-22T07:13:35.436236 | 2015-04-08T14:25:18 | 2015-04-08T14:25:18 | 13,965,746 | 0 | 0 | null | 2013-11-09T23:42:45 | 2013-10-29T19:10:09 | Arduino | UTF-8 | C++ | false | false | 11,648 | cpp | /*
ST7781R TFT Library.
2011 Copyright (c) Seeed Technology Inc.
Authors: Albert.Miao, Visweswara R (with initializtion code from TFT vendor)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
Modified record:
2012.3.27 by Frankie.Chu
Add funtion:setDisplayDirect.
Add more conditional statements in funtions,fillRectangle,drawChar,drawString
to deal with different directions displaying.
*/
#include "TFT.h"
void TFT::pushData(unsigned char data)
{
all_pin_low();
#ifdef SEEEDUINO
PORTD |= (data<<2);
PORTB |= (data>>6);
#endif
#ifdef MEGA
PORTE |= ((data<<4) & (0x30));
PORTG |= ((data<<3) & (0x20));
PORTE |= ((data & 0x08));
PORTH |= ((data>>1) & (0x78));
#endif
#ifdef MAPLE
#endif
}
unsigned char TFT::getData(void)
{
unsigned char data=0;
delay(1);
data |= ((PIND&0xfc)>>2);
data |= ((PINB&0x03)<<6);
return data;
}
void TFT::sendCommand(unsigned int index)
{
CS_LOW;
RS_LOW;
RD_HIGH;
WR_HIGH;
WR_LOW;
pushData(0);
WR_HIGH;
WR_LOW;
pushData(index&0xff);
WR_HIGH;
CS_HIGH;
}
void TFT::sendData(unsigned int data)
{
CS_LOW;
RS_HIGH;
RD_HIGH;
WR_LOW;
pushData((data&0xff00)>>8);
WR_HIGH;
WR_LOW;
pushData(data&0xff);
WR_HIGH;
CS_HIGH;
}
unsigned int TFT::readRegister(unsigned int index)
{
unsigned int data=0;
CS_LOW;
RS_LOW;
RD_HIGH;
all_pin_output();
WR_LOW;
pushData(0);
WR_HIGH;
WR_LOW;
pushData(index);
WR_HIGH;
all_pin_input();
all_pin_low();
RS_HIGH;
RD_LOW;
RD_HIGH;
data |= getData()<<8;
RD_LOW;
RD_HIGH;
data |= getData();
CS_HIGH;
all_pin_output();
return data;
}
void TFT::init (void)
{
CS_OUTPUT;
RD_OUTPUT;
WR_OUTPUT;
RS_OUTPUT;
Tft.all_pin_output();
Tft.all_pin_low();
delay(100);
sendCommand(0x0001);
sendData(0x0100);
sendCommand(0x0002);
sendData(0x0700);
sendCommand(0x0003);
sendData(0x1030);
sendCommand(0x0004);
sendData(0x0000);
sendCommand(0x0008);
sendData(0x0302);
sendCommand(0x000A);
sendData(0x0000);
sendCommand(0x000C);
sendData(0x0000);
sendCommand(0x000D);
sendData(0x0000);
sendCommand(0x000F);
sendData(0x0000);
delay(100);
sendCommand(0x0030);
sendData(0x0000);
sendCommand(0x0031);
sendData(0x0405);
sendCommand(0x0032);
sendData(0x0203);
sendCommand(0x0035);
sendData(0x0004);
sendCommand(0x0036);
sendData(0x0B07);
sendCommand(0x0037);
sendData(0x0000);
sendCommand(0x0038);
sendData(0x0405);
sendCommand(0x0039);
sendData(0x0203);
sendCommand(0x003c);
sendData(0x0004);
sendCommand(0x003d);
sendData(0x0B07);
sendCommand(0x0020);
sendData(0x0000);
sendCommand(0x0021);
sendData(0x0000);
sendCommand(0x0050);
sendData(0x0000);
sendCommand(0x0051);
sendData(0x00ef);
sendCommand(0x0052);
sendData(0x0000);
sendCommand(0x0053);
sendData(0x013f);
delay(100);
sendCommand(0x0060);
sendData(0xa700);
sendCommand(0x0061);
sendData(0x0001);
sendCommand(0x0090);
sendData(0x003A);
sendCommand(0x0095);
sendData(0x021E);
sendCommand(0x0080);
sendData(0x0000);
sendCommand(0x0081);
sendData(0x0000);
sendCommand(0x0082);
sendData(0x0000);
sendCommand(0x0083);
sendData(0x0000);
sendCommand(0x0084);
sendData(0x0000);
sendCommand(0x0085);
sendData(0x0000);
sendCommand(0x00FF);
sendData(0x0001);
sendCommand(0x00B0);
sendData(0x140D);
sendCommand(0x00FF);
sendData(0x0000);
delay(100);
sendCommand(0x0007);
sendData(0x0133);
delay(50);
exitStandBy();
sendCommand(0x0022);
//paint screen black
for(unsigned char i=0;i<2;i++)
{
for(unsigned int f=0;f<38400;f++)
{
sendData(BLACK);
}
}
}
void TFT::exitStandBy(void)
{
sendCommand(0x0010);
sendData(0x14E0);
delay(100);
sendCommand(0x0007);
sendData(0x0133);
}
void TFT::setOrientation(unsigned int HV)//horizontal or vertical
{
sendCommand(0x03);
if(HV==1)//vertical
{
sendData(0x5038);
}
else//horizontal
{
sendData(0x5030);
}
sendCommand(0x0022); //Start to write to display RAM
}
void TFT::setDisplayDirect(unsigned char Direction)
{
DisplayDirect = Direction;
}
void TFT::setXY(unsigned int poX, unsigned int poY)
{
sendCommand(0x0020);//X
sendData(poX);
sendCommand(0x0021);//Y
sendData(poY);
sendCommand(0x0022);//Start to write to display RAM
}
void TFT::setPixel(unsigned int poX, unsigned int poY,unsigned int color)
{
setXY(poX,poY);
sendData(color);
}
void TFT::drawCircle(int poX, int poY, int r,unsigned int color)
{
int x = -r, y = 0, err = 2-2*r, e2;
do {
setPixel(poX-x, poY+y,color);
setPixel(poX+x, poY+y,color);
setPixel(poX+x, poY-y,color);
setPixel(poX-x, poY-y,color);
e2 = err;
if (e2 <= y) {
err += ++y*2+1;
if (-x == y && e2 <= x) e2 = 0;
}
if (e2 > x) err += ++x*2+1;
} while (x <= 0);
}
void TFT::fillCircle(int poX, int poY, int r,unsigned int color)
{
int x = -r, y = 0, err = 2-2*r, e2;
do {
drawVerticalLine(poX-x,poY-y,2*y,color);
drawVerticalLine(poX+x,poY-y,2*y,color);
e2 = err;
if (e2 <= y) {
err += ++y*2+1;
if (-x == y && e2 <= x) e2 = 0;
}
if (e2 > x) err += ++x*2+1;
} while (x <= 0);
}
void TFT::drawLine(unsigned int x0,unsigned int y0,unsigned int x1,unsigned int y1,unsigned int color)
{
int x = x1-x0;
int y = y1-y0;
int dx = abs(x), sx = x0<x1 ? 1 : -1;
int dy = -abs(y), sy = y0<y1 ? 1 : -1;
int err = dx+dy, e2; /* error value e_xy */
for (;;){ /* loop */
setPixel(x0,y0,color);
e2 = 2*err;
if (e2 >= dy) { /* e_xy+e_x > 0 */
if (x0 == x1) break;
err += dy; x0 += sx;
}
if (e2 <= dx) { /* e_xy+e_y < 0 */
if (y0 == y1) break;
err += dx; y0 += sy;
}
}
}
void TFT::drawVerticalLine(unsigned int poX, unsigned int poY,unsigned int length,unsigned int color)
{
setXY(poX,poY);
setOrientation(1);
if(length+poY>MAX_Y)
{
length=MAX_Y-poY;
}
for(unsigned int i=0;i<length;i++)
{
sendData(color);
}
}
void TFT::drawHorizontalLine(unsigned int poX, unsigned int poY,unsigned int length,unsigned int color)
{
setXY(poX,poY);
setOrientation(0);
if(length+poX>MAX_X)
{
length=MAX_X-poX;
}
for(unsigned int i=0;i<length;i++)
{
sendData(color);
}
}
void TFT::drawRectangle(unsigned int poX, unsigned int poY, unsigned int length,unsigned int width,unsigned int color)
{
drawHorizontalLine(poX, poY, length, color);
drawHorizontalLine(poX, poY+width, length, color);
drawVerticalLine(poX, poY, width,color);
drawVerticalLine(poX + length, poY, width,color);
}
void TFT::fillRectangle(unsigned int poX, unsigned int poY, unsigned int length, unsigned int width, unsigned int color)
{
for(unsigned int i=0;i<width;i++)
{
if(DisplayDirect == LEFT2RIGHT)
drawHorizontalLine(poX, poY+i, length, color);
else if (DisplayDirect == DOWN2UP)
drawHorizontalLine(poX, poY-i, length, color);
else if(DisplayDirect == RIGHT2LEFT)
drawHorizontalLine(poX, poY-i, length, color);
else if(DisplayDirect == UP2DOWN)
drawHorizontalLine(poX, poY+i, length, color);
}
}
void TFT::drawChar(unsigned char ascii,unsigned int poX, unsigned int poY,unsigned int size, unsigned int fgcolor)
{
setXY(poX,poY);
if((ascii < 0x20)||(ascii > 0x7e))//Unsupported char.
{
//ascii = '?';
ascii = ' ';
}
for(unsigned char i=0;i<8;i++)
{
unsigned char temp = pgm_read_byte(&simpleFont[ascii-0x20][i]);
for(unsigned char f=0;f<8;f++)
{
if((temp>>f)&0x01)
{
if(DisplayDirect == LEFT2RIGHT)
fillRectangle(poX+i*size, poY+f*size, size, size, fgcolor);
else if(DisplayDirect == DOWN2UP)
fillRectangle(poX+f*size, poY-i*size, size, size, fgcolor);
else if(DisplayDirect == RIGHT2LEFT)
fillRectangle(poX-i*size, poY-f*size, size, size, fgcolor);
else if(DisplayDirect == UP2DOWN)
fillRectangle(poX-f*size, poY+i*size, size, size, fgcolor);
}
}
}
}
void TFT::drawString(char *string,unsigned int poX, unsigned int poY,unsigned int size,unsigned int fgcolor)
{
while(*string)
{
for(unsigned char i=0;i<8;i++)
{
drawChar(*string, poX, poY, size, fgcolor);
}
*string++;
if(DisplayDirect == LEFT2RIGHT)
{
if(poX < MAX_X)
{
poX+=8*size; // Move cursor right
}
}
else if(DisplayDirect == DOWN2UP)
{
if(poY > 0)
{
poY-=8*size; // Move cursor right
}
}
else if(DisplayDirect == RIGHT2LEFT)
{
if(poX > 0)
{
poX-=8*size; // Move cursor right
}
}
else if(DisplayDirect == UP2DOWN)
{
if(poY < MAX_Y)
{
poY+=8*size; // Move cursor right
}
}
}
}
void TFT::all_pin_input(void)
{
#ifdef SEEEDUINO
DDRD &=~ 0xfc;
DDRB &=~ 0x03;
#endif
#ifdef MEGA
DDRE &=~ 0x38;
DDRG &=~ 0x20;
DDRH &=~ 0x78;
#endif
#ifdef MAPLE
#endif
}
void TFT::all_pin_output(void)
{
#ifdef SEEEDUINO
DDRD |= 0xfc;
DDRB |= 0x03;
#endif
#ifdef MEGA
DDRE |= 0x38;
DDRG |= 0x20;
DDRH |= 0x78;
#endif
#ifdef MAPLE
#endif
}
void TFT::all_pin_low(void)
{
#ifdef SEEEDUINO
PORTD &=~ 0xfc;
PORTB &=~ 0x03;
#endif
#ifdef MEGA
PORTE &=~ 0x38;
PORTG &=~ 0x20;
PORTH &=~ 0x78;
#endif
#ifdef MAPLE
#endif
}
TFT Tft=TFT(); | [
"kbarre123@gmail.com"
] | kbarre123@gmail.com |
a950a59135fbce0065db4b3bc6bee85e7af850b6 | 0c72211ec4c78a6c11455af308590952ddae107f | /problem_14.cpp | e2552f3214e48e11c8392a5889baa95f7153cc97 | [] | no_license | zmcneilly/cpp_euler | 0084128143740dfb197a86adfb6d8919cbaf8bf9 | 2d5f6774f350675132e61dc841f7453865fc5e0b | refs/heads/master | 2016-09-03T07:29:52.859400 | 2015-02-13T16:34:44 | 2015-02-13T16:34:44 | 30,469,132 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 467 | cpp | #include <iostream>
int main() {
int longest = 0, len = 0, max = 1000000;
for (int i = 2; i < max; i++) {
int count = 1;
unsigned long long value = i; // in C++ size fails silently!
while (value > 1) {
count++;
if (value & 1 == 1) {
value = (3 * value) + 1;
}
else {
value = value / 2;
}
}
if (count > len) {
len = count;
longest = i;
}
}
std::cout << longest << std::endl;
}
| [
"zach.mcneilly@gmail.com"
] | zach.mcneilly@gmail.com |
a634c98cae46cafe8b69c9ad77476c7c3a1b954c | 51be8db88a49f7bebeefddf431faff6048ac4f37 | /xpcc/src/xpcc/architecture/platform/cortex_m3/common/hard_fault_handler.cpp | bc8ebcc495f8082896572cf4840fc98625992ffb | [
"MIT"
] | permissive | jrahlf/3D-Non-Contact-Laser-Profilometer | 0a2cee1089efdcba780f7b8d79ba41196aa22291 | 912eb8890442f897c951594c79a8a594096bc119 | refs/heads/master | 2016-08-04T23:07:48.199953 | 2014-07-13T07:09:31 | 2014-07-13T07:09:31 | 17,915,736 | 6 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 3,457 | cpp | // coding: utf-8
// ----------------------------------------------------------------------------
/* Copyright (c) 2011, Roboterclub Aachen e.V.
* 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 Roboterclub Aachen e.V. 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 ROBOTERCLUB AACHEN E.V. ''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 ROBOTERCLUB AACHEN E.V. 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 <stdint.h>
#include <xpcc/debug/logger.hpp>
#include <xpcc_config.hpp>
// ----------------------------------------------------------------------------
extern "C"
void
_hardFaultHandler(const uint32_t * ctx)
{
#if CORTEX_ENABLE_HARD_FAULT_HANDLER != 0
#undef XPCC_LOG_LEVEL
#define XPCC_LOG_LEVEL xpcc::log::ERROR
uint32_t stacked_r0 = ((uint32_t) ctx[0]);
uint32_t stacked_r1 = ((uint32_t) ctx[1]);
uint32_t stacked_r2 = ((uint32_t) ctx[2]);
uint32_t stacked_r3 = ((uint32_t) ctx[3]);
uint32_t stacked_r12 = ((uint32_t) ctx[4]);
uint32_t stacked_lr = ((uint32_t) ctx[5]);
uint32_t stacked_pc = ((uint32_t) ctx[6]);
uint32_t stacked_psr = ((uint32_t) ctx[7]);
uint32_t bfar = (*((volatile uint32_t *)(0xE000ED38)));
uint32_t cfsr = (*((volatile uint32_t *)(0xE000ED28)));
uint32_t hfsr = (*((volatile uint32_t *)(0xE000ED2C)));
uint32_t dfsr = (*((volatile uint32_t *)(0xE000ED30)));
uint32_t afsr = (*((volatile uint32_t *)(0xE000ED3C)));
XPCC_LOG_ERROR.printf("\n\nHard fault Exception:\n");
XPCC_LOG_ERROR.printf("r0 : 0x%08lx r12 : 0x%08lx\n", stacked_r0, stacked_r12);
XPCC_LOG_ERROR.printf("r1 : 0x%08lx lr : 0x%08lx\n", stacked_r1, stacked_lr);
XPCC_LOG_ERROR.printf("r2 : 0x%08lx pc : 0x%08lx\n", stacked_r2, stacked_pc);
XPCC_LOG_ERROR.printf("r3 : 0x%08lx psr : 0x%08lx\n", stacked_r3, stacked_psr);
XPCC_LOG_ERROR.printf("BFAR : 0x%08lx\n", bfar);
XPCC_LOG_ERROR.printf("CFSR : 0x%08lx\n", cfsr);
XPCC_LOG_ERROR.printf("HFSR : 0x%08lx\n", hfsr);
XPCC_LOG_ERROR.printf("DFSR : 0x%08lx\n", dfsr);
XPCC_LOG_ERROR.printf("AFSR : 0x%08lx\n", afsr);
#else
(void) ctx; // avoid warning
#endif
// Infinite loop
while (1)
{
}
}
| [
"dev.jonas.rahlf@gmail.com"
] | dev.jonas.rahlf@gmail.com |
533e7a7092de1834ffef131d6d27df1a95779812 | 261ff029c1355a8a1f74a46f76155bc44ca2f44b | /Engine/Resources/Codes/AnimationCtrl.cpp | 55ff1f01619ed76069403766e9a4cb763d113a35 | [] | no_license | bisily/DirectX3D_Personal_-portfolio | 39aa054f60228e703a6d942a7df94a9faaa7a00a | e06878690793d103273f2b50213a92bdfb923b33 | refs/heads/master | 2022-11-26T11:51:29.985373 | 2020-08-04T09:17:09 | 2020-08-04T09:17:09 | 284,932,529 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 5,864 | cpp | #include "AnimationCtrl.h"
USING(Engine)
Engine::CAnimationCtrl::CAnimationCtrl(LPD3DXANIMATIONCONTROLLER pAniCtrl)
: m_pAniCtrl(pAniCtrl)
, m_iCurrentTrack(0)
, m_iNewTrack(1)
, m_fAccTime(0.f)
, m_iOldAniIdx(99)
{
m_pAniCtrl->AddRef();
}
Engine::CAnimationCtrl::CAnimationCtrl(const CAnimationCtrl & rhs)
: m_iCurrentTrack(rhs.m_iCurrentTrack)
, m_iNewTrack(rhs.m_iNewTrack)
, m_fAccTime(rhs.m_fAccTime)
, m_iOldAniIdx(rhs.m_iOldAniIdx)
{
rhs.m_pAniCtrl->CloneAnimationController(rhs.m_pAniCtrl->GetMaxNumAnimationOutputs(), // 메쉬가 지닌 총 애니메이션 개수( 복제 시 원본 객체에서 제공되고 있는 애니메이션의 개수)
rhs.m_pAniCtrl->GetMaxNumAnimationSets(), // 구동이 가능한 애니메이션 개수(1인자, 2인자 값이 거의 같음)
rhs.m_pAniCtrl->GetMaxNumTracks(), // 구동할 수 있는 최대 트랙의 개수, 정수형의 값, 대부분 한 개를 사용하고 많이 사용해봐야 두 개를 사용
rhs.m_pAniCtrl->GetMaxNumEvents(), // 현재 메쉬에 적용되는 독특한 효과, 현재 우리는 사용하지 못한다.
&m_pAniCtrl);
}
Engine::CAnimationCtrl::~CAnimationCtrl()
{
}
HRESULT Engine::CAnimationCtrl::Ready_AnimationCtrl()
{
return S_OK;
}
// 문자열로도 받을 수 있음
void Engine::CAnimationCtrl::Set_AnimationSet(const _uint & iIdx)
{
if (m_iOldAniIdx == iIdx)
return;
m_iNewTrack = (m_iCurrentTrack == 0 ? 1 : 0);
// 애니메이션 셋 정보를 저장하는 객체
LPD3DXANIMATIONSET pAS = nullptr;
m_pAniCtrl->GetAnimationSet(iIdx, &pAS);
//m_pAniCtrl->GetAnimationSetByName();
// 애니메이션 셋의 전체 재생시간을 체크하기 위한 작업
m_dPeriod = pAS->GetPeriod(); // 시간을 반환, 현재 애니메이션 트랙의 포지션과 일치하는 값
//m_pAniCtrl->GetTrackDesc(iIdx, nullptr); // 현재 재생되는 트랙의 정보를 가져와주는 함수
// 0번째 트랙에 애니메이션 셋을 세팅한다.
m_pAniCtrl->SetTrackAnimationSet(m_iNewTrack, pAS);
// 사용하지 않고 있는 이벤트들 때문에 보간이 안되는 경우가 발생할 수 있어서 넣어주는 코드(이벤트가 발생하지 않도록 처리하는 함수)
m_pAniCtrl->UnkeyAllTrackEvents(m_iCurrentTrack);
m_pAniCtrl->UnkeyAllTrackEvents(m_iNewTrack);
// 현재의 모션을 꺼버리겠다는 의미(3인자 : 언제부터 키 프레임을 해제 할 것인가)
m_pAniCtrl->KeyTrackEnable(m_iCurrentTrack, FALSE, m_fAccTime + 0.08);
// 해제되는 시간 동안 현재 프레임은 어떤 속도로 움직일 것인지에 대한 함수(속도의 상수 값은 각자 1)
m_pAniCtrl->KeyTrackSpeed(m_iCurrentTrack, 1.f, m_fAccTime, 0.08, D3DXTRANSITION_LINEAR);
//
m_pAniCtrl->KeyTrackWeight(m_iCurrentTrack, 0.1f, m_fAccTime, 0.08, D3DXTRANSITION_LINEAR);
// 위쪽에서 0.25라는 시간의 딜레이를 준 상태에서 트랙을 활성화하고 있다.
// 이것은 두 모션이 0.25라는 시간동안 동시에 돌고 있다는 것을 의미하며, 이 시간 사이의 애니메이션을 보간하려는 것이다.
m_pAniCtrl->SetTrackEnable(m_iNewTrack, TRUE);
m_pAniCtrl->KeyTrackSpeed(m_iNewTrack, 1.f, m_fAccTime, 0.08, D3DXTRANSITION_LINEAR);
m_pAniCtrl->KeyTrackWeight(m_iNewTrack, 0.9f, m_fAccTime, 0.08, D3DXTRANSITION_LINEAR);
// 현재 애니메이션이 재생되고 있었던 시간을 초기화 한다.
m_pAniCtrl->ResetTime();
m_fAccTime = 0.f;
// 기존의 재생 중이던 트랙에서 새로운 트랙이 등장하게 되었을 때, 0초부터 시작하도록 지시하는 함수
m_pAniCtrl->SetTrackPosition(m_iNewTrack, 0.0);
m_iOldAniIdx = iIdx;
m_iCurrentTrack = m_iNewTrack;
}
void Engine::CAnimationCtrl::Play_AnimationSet(const _float & fTimeDelta)
{
m_pAniCtrl->AdvanceTime(fTimeDelta, NULL); // 2인자 : 애니메이션 동작에 따른 사운드나 이펙트에 대한 처리를 담당하는 객체 주소, 하지만 직접만들어서 사용해야하는데 이유는 사용 제약이 심해서 오히려 코드의 가중만 커지기 때문
m_fAccTime += fTimeDelta;
}
CAnimationCtrl * Engine::CAnimationCtrl::Create(LPD3DXANIMATIONCONTROLLER pAniCtrl)
{
CAnimationCtrl* pInstance = new CAnimationCtrl(pAniCtrl);
if (FAILED(pInstance->Ready_AnimationCtrl()))
{
ERR_BOX(L"Animation Create Failed");
Engine::Safe_Release(pInstance);
}
return pInstance;
}
CAnimationCtrl * Engine::CAnimationCtrl::Create(const CAnimationCtrl & rhs)
{
CAnimationCtrl* pInstance = new CAnimationCtrl(rhs);
if (FAILED(pInstance->Ready_AnimationCtrl()))
{
ERR_BOX(L"Animation Create Failed");
Engine::Safe_Release(pInstance);
}
return pInstance;
}
void Engine::CAnimationCtrl::Free()
{
Engine::Safe_Release(m_pAniCtrl);
}
// 현재 트랙이 끝났을 경우 TRUE를 반환하는 함수
_bool Engine::CAnimationCtrl::Is_AnimationSetEnd()
{
D3DXTRACK_DESC TrackInfo;
ZeroMemory(&TrackInfo, sizeof(D3DXTRACK_DESC));
m_pAniCtrl->GetTrackDesc(m_iCurrentTrack, &TrackInfo);
if (TrackInfo.Position >= m_dPeriod - 0.1)
return true;
return false;
}
_bool CAnimationCtrl::Is_AniSetEnd()
{
D3DXTRACK_DESC TrackInfo;
ZeroMemory(&TrackInfo, sizeof(D3DXTRACK_DESC));
m_pAniCtrl->GetTrackDesc(m_iCurrentTrack, &TrackInfo);
if (TrackInfo.Position >= m_dPeriod)
return true;
return false;
}
_double CAnimationCtrl::Get_Position()
{
D3DXTRACK_DESC TrackInfo;
ZeroMemory(&TrackInfo, sizeof(D3DXTRACK_DESC));
m_pAniCtrl->GetTrackDesc(m_iCurrentTrack, &TrackInfo);
return TrackInfo.Position;
}
_double CAnimationCtrl::Get_Percent()
{
D3DXTRACK_DESC TrackInfo;
ZeroMemory(&TrackInfo, sizeof(D3DXTRACK_DESC));
m_pAniCtrl->GetTrackDesc(m_iCurrentTrack, &TrackInfo);
_double iResult = _double((TrackInfo.Position / m_dPeriod) * 100);
return iResult;
}
| [
"mnopw2@naver.com"
] | mnopw2@naver.com |
a44171e3344b06fda31d2506fd1ccdd14e62943f | fd9800b743629cfc9b45aff97834df7bd6a4bfdc | /Project1/MyForm.h | 54d1620e32d73ace5d0c144868f5c0e7b2ab85ca | [] | no_license | nowito/Project1 | e48e8bc294e5b5a3640b5e670e0ed30f06084b26 | 562f7e9670ef5c3c24418d405ecd77f54caee947 | refs/heads/master | 2021-01-10T05:45:46.222112 | 2016-03-28T16:25:37 | 2016-03-28T16:25:37 | 54,903,966 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 7,845 | h | #pragma once
namespace Project1 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Text;
using namespace System::Threading;
using namespace System::Drawing;
using namespace System::IO::Ports;
/// <summary>
/// Resumen de MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
MyForm(void)
{
InitializeComponent();
findPorts();
}
protected:
/// <summary>
/// Limpiar los recursos que se estén usando.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private: System::IO::Ports::SerialPort^ serialPort1;
private: System::Windows::Forms::ComboBox^ ComSelect;
private: System::Windows::Forms::ComboBox^ BaudSelect;
private: System::Windows::Forms::Button^ OpenButton;
private: System::Windows::Forms::Button^ CloseButton;
private: System::Windows::Forms::ProgressBar^ progressBar1;
private: System::Windows::Forms::TextBox^ LogBox;
private: System::Windows::Forms::TextBox^ CommandBar;
private: System::Windows::Forms::Button^ SendButton;
private: System::Windows::Forms::Button^ ResetButton;
protected:
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Variable del diseñador necesaria.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Método necesario para admitir el Diseñador. No se puede modificar
/// el contenido de este método con el editor de código.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->serialPort1 = (gcnew System::IO::Ports::SerialPort(this->components));
this->ComSelect = (gcnew System::Windows::Forms::ComboBox());
this->BaudSelect = (gcnew System::Windows::Forms::ComboBox());
this->OpenButton = (gcnew System::Windows::Forms::Button());
this->CloseButton = (gcnew System::Windows::Forms::Button());
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
this->LogBox = (gcnew System::Windows::Forms::TextBox());
this->CommandBar = (gcnew System::Windows::Forms::TextBox());
this->SendButton = (gcnew System::Windows::Forms::Button());
this->ResetButton = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// serialPort1
//
this->serialPort1->DataReceived += gcnew System::IO::Ports::SerialDataReceivedEventHandler(this, &MyForm::serialPort1_DataReceived);
//
// ComSelect
//
this->ComSelect->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->ComSelect->FormattingEnabled = true;
this->ComSelect->Location = System::Drawing::Point(12, 23);
this->ComSelect->Name = L"ComSelect";
this->ComSelect->Size = System::Drawing::Size(121, 21);
this->ComSelect->TabIndex = 0;
//
// BaudSelect
//
this->BaudSelect->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->BaudSelect->FormattingEnabled = true;
this->BaudSelect->Items->AddRange(gcnew cli::array< System::Object^ >(2) { L"9600", L"115200" });
this->BaudSelect->Location = System::Drawing::Point(202, 22);
this->BaudSelect->Name = L"BaudSelect";
this->BaudSelect->Size = System::Drawing::Size(121, 21);
this->BaudSelect->TabIndex = 1;
//
// OpenButton
//
this->OpenButton->Location = System::Drawing::Point(426, 73);
this->OpenButton->Name = L"OpenButton";
this->OpenButton->Size = System::Drawing::Size(75, 23);
this->OpenButton->TabIndex = 2;
this->OpenButton->Text = L"OPEN";
this->OpenButton->UseVisualStyleBackColor = true;
this->OpenButton->Click += gcnew System::EventHandler(this, &MyForm::OpenButton_Click);
//
// CloseButton
//
this->CloseButton->Enabled = false;
this->CloseButton->Location = System::Drawing::Point(426, 120);
this->CloseButton->Name = L"CloseButton";
this->CloseButton->Size = System::Drawing::Size(75, 23);
this->CloseButton->TabIndex = 3;
this->CloseButton->Text = L"CLOSE";
this->CloseButton->UseVisualStyleBackColor = true;
this->CloseButton->Click += gcnew System::EventHandler(this, &MyForm::CloseButton_Click);
//
// progressBar1
//
this->progressBar1->Location = System::Drawing::Point(401, 20);
this->progressBar1->Name = L"progressBar1";
this->progressBar1->Size = System::Drawing::Size(100, 23);
this->progressBar1->TabIndex = 4;
//
// LogBox
//
this->LogBox->Location = System::Drawing::Point(12, 120);
this->LogBox->Multiline = true;
this->LogBox->Name = L"LogBox";
this->LogBox->ReadOnly = true;
this->LogBox->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
this->LogBox->Size = System::Drawing::Size(311, 327);
this->LogBox->TabIndex = 5;
//
// CommandBar
//
this->CommandBar->Location = System::Drawing::Point(12, 76);
this->CommandBar->Name = L"CommandBar";
this->CommandBar->Size = System::Drawing::Size(311, 20);
this->CommandBar->TabIndex = 6;
this->CommandBar->Click += gcnew System::EventHandler(this, &MyForm::CommandBar_click);
this->CommandBar->KeyUp += gcnew System::Windows::Forms::KeyEventHandler(this, &MyForm::EnterKeyBar);
//
// SendButton
//
this->SendButton->Enabled = false;
this->SendButton->Location = System::Drawing::Point(330, 73);
this->SendButton->Name = L"SendButton";
this->SendButton->Size = System::Drawing::Size(52, 23);
this->SendButton->TabIndex = 7;
this->SendButton->Text = L"Send";
this->SendButton->UseVisualStyleBackColor = true;
this->SendButton->Click += gcnew System::EventHandler(this, &MyForm::SendButton_Click);
//
// ResetButton
//
this->ResetButton->Location = System::Drawing::Point(426, 166);
this->ResetButton->Name = L"ResetButton";
this->ResetButton->Size = System::Drawing::Size(75, 23);
this->ResetButton->TabIndex = 8;
this->ResetButton->Text = L"reset";
this->ResetButton->UseVisualStyleBackColor = true;
// this->ResetButton->Click += gcnew System::EventHandler(this, &MyForm::ResetButton_Click);
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(550, 459);
this->Controls->Add(this->ResetButton);
this->Controls->Add(this->SendButton);
this->Controls->Add(this->CommandBar);
this->Controls->Add(this->LogBox);
this->Controls->Add(this->progressBar1);
this->Controls->Add(this->CloseButton);
this->Controls->Add(this->OpenButton);
this->Controls->Add(this->BaudSelect);
this->Controls->Add(this->ComSelect);
this->Name = L"MyForm";
this->Text = L"MyForm";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void findPorts();
private: System::Void OpenButton_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void AfterEvent();
private: System::Void CloseButton_Click(System::Object^ sender, System::EventArgs^ e);
private: System::Void CommandBar_click(System::Object^ sender, System::EventArgs^ e);
private: System::Void EnterKeyBar(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e);
private: System::Void SendButton_Click(System::Object^ sender, System::EventArgs^ e);
delegate void DelegateType(System::String ^);
private: System::Void serialPort1_DataReceived(System::Object^ sender, System::IO::Ports::SerialDataReceivedEventArgs^ e);
private: System::Void DataReceived(String ^myString);
private: System::Void ResetButton_Click(System::Object^ sender, System::EventArgs^ e);
};
}
| [
"arrallatemillos@gmail.com"
] | arrallatemillos@gmail.com |
57799264eda352fd8c77b23d77fb62da8ebaca27 | 42699a6711b6f02c25acdb79e2791b67db015257 | /include/App.hpp | 9a05894eb07baa96a40c6233fbab036736bea969 | [] | no_license | nacho-vlad/digit-recognition | 10605ff509255b6fdc3cb5c13e43f6472f633615 | 09ce08b201dcd6642ec2932d82858eec22b0d0bd | refs/heads/master | 2023-01-03T11:12:42.242861 | 2020-10-29T18:18:53 | 2020-10-29T18:18:53 | 240,187,835 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,945 | hpp | #pragma once
#include <iostream>
#include <vector>
#include <Widget.hpp>
#include <Button.hpp>
#include <TextArea.hpp>
#include <PaintArea.hpp>
#include <neural_network.hpp>
#include <utils.hpp>
gui::PaintArea *paintArea;
gui::TextArea *digitText;
gui::Button *clearButton;
gui::Button *calculateButton;
gui::Button *small;
gui::Button *medium;
gui::Button *large;
std::vector<gui::Widget*> widgets;
int findDigit(nn::neural_network &NN)
{
auto inputMatrix = (paintArea->toMatrix(28,28));
std::vector<double> inputVector = inputMatrix.toVector();
NN.feedforward(inputVector);
auto result = NN.getOutput().toVector();
int digit = 0;
float mx = 0;
for(int i=0;i<10;i++)
if(result[i]>mx)
{
//std::cout<<result[i]<<std::endl;
mx=result[i];
digit=i;
}
return digit;
}
void Init()
{
nn::neural_network NN({784,64,32,10},
{nn::sigmoid,nn::sigmoid,nn::sigmoid,nn::sigmoid},
nn::quadratic);
std::ifstream inBrain("trainedFinal2.txt");
NN.fromFile(inBrain);
digitText = new gui::TextArea(sf::FloatRect(600.0,660.0,200.0,75.0),"NaN");
paintArea= new gui::PaintArea(sf::IntRect(150,50,562,562));
clearButton = new gui::Button(sf::FloatRect(230.0,660.0,200.0,75.0),"Clear",sf::Color::Red);
clearButton->setCallback([=]{
paintArea->clear();
});
calculateButton = new gui::Button(sf::FloatRect(450.0,660.0,200.0,75.0),"Calculate", sf::Color::Green);
calculateButton->setCallback([=]() mutable {
digitText->setText(std::to_string(findDigit(NN)));
});
small = new gui::Button(sf::FloatRect(710.0,100.0,120.0,60.0),"small",sf::Color::Blue);
medium = new gui::Button(sf::FloatRect(710.0,170.0,120.0,60.0),"medium",sf::Color::Blue);
large = new gui::Button(sf::FloatRect(710.0,240.0,120.0,60.0),"large",sf::Color::Blue);
small->setCallback([=] {
paintArea->setRadius(10);
});
medium->setCallback([=] {
paintArea->setRadius(20);
});
large->setCallback([=] {
paintArea->setRadius(30);
});
widgets.push_back(paintArea);
widgets.push_back(digitText);
widgets.push_back(clearButton);
widgets.push_back(calculateButton);
widgets.push_back(small);
widgets.push_back(medium);
widgets.push_back(large);
}
void Update()
{
for(auto w:widgets)
w->update();
}
void HandleEvents()
{
sf::Event event;
while(window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
{
window.close();
return;
}
for(auto w:widgets)
w->handleEvent(event);
}
}
void Draw()
{
window.clear(sf::Color::Black);
for(auto w:widgets)
window.draw(*w);
window.display();
}
| [
"sabauflorin28@gmail.com"
] | sabauflorin28@gmail.com |
2a13c6b746539740c5c624276dac1bd3e61ccce6 | 64aa3159d0cf52c71f3a68d5be6d95cb7e3e0d7f | /include/physics/collider.h | 822c2490eea6565ddc13151111da30980ea33d7c | [] | no_license | LoshkinOleg/NekoEngine | 87d376576793f91f5468bdc66179bde93ebcccbf | e89a3b33a81d8c0ee9ed06bc8616cb3fba220989 | refs/heads/master | 2022-11-20T07:01:49.816600 | 2019-10-10T09:18:59 | 2019-10-10T09:18:59 | 263,606,128 | 1 | 0 | null | 2020-05-13T11:08:43 | 2020-05-13T11:08:42 | null | UTF-8 | C++ | false | false | 1,781 | h | #pragma once
/*
MIT License
Copyright (c) 2017 SAE Institute Switzerland AG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "Box2D/Dynamics/b2Fixture.h"
#include "engine/entity.h"
#include "Box2D/Dynamics/b2WorldCallbacks.h"
namespace neko
{
class MainEngine;
/**
* \brief class used in the void* of box2d fixture to be able to get info from contact and collisions
*/
struct Collider
{
b2Fixture* fixture;
b2Body* body;
neko::Entity entity;
};
/**
* \brief override the default box2d contact listener and communicate directly to the MainEngine
*/
class CollisionListener : public b2ContactListener
{
public:
~CollisionListener() override;
void BeginContact(b2Contact* contact) override;
void EndContact(b2Contact* contact) override;
};
}
| [
"elias.farhan@gmail.com"
] | elias.farhan@gmail.com |
bdaa31617e0a5811b228d187d9418ed475f7dec1 | 9a48be80edc7692df4918c0222a1640545384dbb | /Libraries/Boost1.40/libs/interprocess/example/doc_vectorstream.cpp | 8ddd3a6636647d486174bdc6498ede078ce2c32a | [
"BSL-1.0"
] | permissive | fcrick/RepSnapper | 05e4fb1157f634acad575fffa2029f7f655b7940 | a5809843f37b7162f19765e852b968648b33b694 | refs/heads/master | 2021-01-17T21:42:29.537504 | 2010-06-07T05:38:05 | 2010-06-07T05:38:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,502 | cpp | //////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2006-2007. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
//[doc_vectorstream
#include <boost/interprocess/containers/vector.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/streams/vectorstream.hpp>
#include <iterator>
//<-
#include "../test/get_process_id_name.hpp"
//->
using namespace boost::interprocess;
typedef allocator<int, managed_shared_memory::segment_manager>
IntAllocator;
typedef allocator<char, managed_shared_memory::segment_manager>
CharAllocator;
typedef vector<int, IntAllocator> MyVector;
typedef basic_string
<char, std::char_traits<char>, CharAllocator> MyString;
typedef basic_vectorstream<MyString> MyVectorStream;
int main ()
{
//Remove shared memory on construction and destruction
struct shm_remove
{
//<-
#if 1
shm_remove() { shared_memory_object::remove(test::get_process_id_name()); }
~shm_remove(){ shared_memory_object::remove(test::get_process_id_name()); }
#else
//->
shm_remove() { shared_memory_object::remove("MySharedMemory"); }
~shm_remove(){ shared_memory_object::remove("MySharedMemory"); }
//<-
#endif
//->
} remover;
//<-
#if 1
managed_shared_memory segment(
create_only,
test::get_process_id_name(), //segment name
65536); //segment size in bytes
#else
//->
managed_shared_memory segment(
create_only,
"MySharedMemory", //segment name
65536); //segment size in bytes
//<-
#endif
//->
//Construct shared memory vector
MyVector *myvector =
segment.construct<MyVector>("MyVector")
(IntAllocator(segment.get_segment_manager()));
//Fill vector
myvector->reserve(100);
for(int i = 0; i < 100; ++i){
myvector->push_back(i);
}
//Create the vectorstream. To create the internal shared memory
//basic_string we need to pass the shared memory allocator as
//a constructor argument
MyVectorStream myvectorstream(CharAllocator(segment.get_segment_manager()));
//Reserve the internal string
myvectorstream.reserve(100*5);
//Write all vector elements as text in the internal string
//Data will be directly written in shared memory, because
//internal string's allocator is a shared memory allocator
for(std::size_t i = 0, max = myvector->size(); i < max; ++i){
myvectorstream << (*myvector)[i] << std::endl;
}
//Auxiliary vector to compare original data
MyVector *myvector2 =
segment.construct<MyVector>("MyVector2")
(IntAllocator(segment.get_segment_manager()));
//Avoid reallocations
myvector2->reserve(100);
//Extract all values from the internal
//string directly to a shared memory vector.
std::istream_iterator<int> it(myvectorstream), itend;
std::copy(it, itend, std::back_inserter(*myvector2));
//Compare vectors
assert(std::equal(myvector->begin(), myvector->end(), myvector2->begin()));
//Create a copy of the internal string
MyString stringcopy (myvectorstream.vector());
//Now we create a new empty shared memory string...
MyString *mystring =
segment.construct<MyString>("MyString")
(CharAllocator(segment.get_segment_manager()));
//...and we swap vectorstream's internal string
//with the new one: after this statement mystring
//will be the owner of the formatted data.
//No reallocations, no data copies
myvectorstream.swap_vector(*mystring);
//Let's compare both strings
assert(stringcopy == *mystring);
//Done, destroy and delete vectors and string from the segment
segment.destroy_ptr(myvector2);
segment.destroy_ptr(myvector);
segment.destroy_ptr(mystring);
return 0;
}
//]
#include <boost/interprocess/detail/config_end.hpp>
| [
"metrix@Blended.(none)"
] | metrix@Blended.(none) |
c438c4d86e2d206c203d07c6fe2feeaab8f79fff | a4c45cc2ce9fc90e0ba27f647136b3a69ce0bf09 | /problems/maximum-product-difference-between-two-pairs/SOLUTION.cpp | 09ae1104dc3926b1a49e320494aa2ffa4f49033d | [] | no_license | AhJo53589/leetcode-cn | fd8cb65a2d86f25d2e32553f6b32dbfc9cb7bae7 | 7acba71548c41e276003682833e04b8fab8bc8f8 | refs/heads/master | 2023-01-29T19:35:13.816866 | 2023-01-15T03:21:37 | 2023-01-15T03:21:37 | 182,630,154 | 268 | 47 | null | null | null | null | UTF-8 | C++ | false | false | 851 | cpp |
//////////////////////////////////////////////////////////////////////////
class Solution {
public:
int maxProductDifference(vector<int>& nums) {
sort(nums.begin(), nums.end());
int j = nums.size() - 1;
return nums[j] * nums[j - 1] - nums[0] * nums[1];
}
};
//////////////////////////////////////////////////////////////////////////
int _solution_run(vector<int>& nums)
{
//int caseNo = -1;
//static int caseCnt = 0;
//if (caseNo != -1 && caseCnt++ != caseNo) return {};
Solution sln;
return sln.maxProductDifference(nums);
}
//#define USE_SOLUTION_CUSTOM
//string _solution_custom(TestCases &tc)
//{
// return {};
//}
//////////////////////////////////////////////////////////////////////////
//#define USE_GET_TEST_CASES_IN_CPP
//vector<string> _get_test_cases_string()
//{
// return {};
//}
| [
"ahjo_bb@hotmail.com"
] | ahjo_bb@hotmail.com |
4765116f75c597fa462e36f47c48e146a8837876 | 8bcd52f1157a7710bb93430188d9f28809ccfd1f | /sources/L02SpotLightBalls/main.cpp | 08ecee4e64d86576a9d21f6d6603339b5f5e6e5a | [] | no_license | dknife/oldGraphicsLecture | 2f297424d0034183df15baeeb80dcea721f636c9 | 23884497cc545cce1bbb7c882cb0c56b12d90c00 | refs/heads/master | 2016-09-05T23:22:51.905039 | 2015-05-22T08:10:11 | 2015-05-22T08:10:11 | 33,981,553 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,446 | cpp | #ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#ifdef _WIN32
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif
#include <math.h>
#include <math.h>
float angle = 0.0;
bool bAnimation = true;
bool bPointLight = true;
// 재질에 설정될 값
GLfloat mat_specular[] = {1.0, 1.0f, 1.0f, 1.0f };
GLfloat mat_diffuse[] = { 1.0, 1.0f, 0.0f, 1.0f };
GLfloat mat_ambient[] = { 0.1, 0.1f, 0.1f, 1.0f };
GLfloat mat_shininess[] = { 120.0 };
// 광원에 설정될 값
GLfloat lit_specular[] = { 1.0, 1.0f, 1.0f, 1.0f };
GLfloat lit_diffuse[] = { 1.0, 0.4f, 0.4f, 1.0f };
GLfloat lit_ambient[] = { 1.0, 1.0f, 1.0f, 1.0f };
GLfloat light_position[] = { 0.0, 0.0f, 1.0f, 1.0f };
void LightSet(void) {
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glLightfv(GL_LIGHT0, GL_SPECULAR, lit_specular);
glLightfv(GL_LIGHT0, GL_DIFFUSE, lit_diffuse);
glLightfv(GL_LIGHT0, GL_AMBIENT, lit_ambient);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
}
void LightPositioning(bool bPointLight) {
light_position[3] = (bPointLight)?1.0:0.0;
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
}
void init(void) {
glEnable(GL_DEPTH_TEST);
glClearColor(0.0,0.0,0.0,1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, 1, 1, 1000);
LightSet();
}
void reshape(int w, int h) {
float asp = float(w)/float(h);
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60, asp, 1, 1000);
}
void DrawAxes(void) {
glDisable(GL_LIGHTING);
glBegin(GL_LINES);
glColor3f(1,0,0);
glVertex3f(0,0,0);
glVertex3f(1,0,0);
glColor3f(0,0.5,0);
glVertex3f(0,0,0);
glVertex3f(0,1,0);
glColor3f(0,0,1);
glVertex3f(0,0,0);
glVertex3f(0,0,1);
glEnd();
glEnable(GL_LIGHTING);
}
void keyboard(unsigned char c, int x, int y) {
switch(c) {
case 'a':
case 'A': bAnimation = 1-bAnimation; break;
case 'p':
case 'P': bPointLight = 1-bPointLight; break;
}
}
void display(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
float od = 10.0; // observation distance
gluLookAt(od*cos(angle),0, od*sin(angle), 0,0,0, 0,1,0);
if(bAnimation) angle += 0.01;
LightPositioning(bPointLight);
glLineWidth(4);
DrawAxes();
for(int i=0;i<10;i++) {
for(int j=0;j<10;j++) {
float x = -5.0+i;
float y = -5.0+j;
glPushMatrix();
glTranslatef(x,y,0.0);
glutSolidSphere(0.5,50,50);
glPopMatrix();
}
}
glutSwapBuffers();
}
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100,100);
glutCreateWindow("Smooth Shading");
init(); // 초기화
// 콜백 함수 등록
glutDisplayFunc(display);
glutIdleFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop(); // 무한루프
return 0;
} | [
"ymkang@San302-YMKang.local"
] | ymkang@San302-YMKang.local |
45c6bf8fe5dbeaf2d76a9a1f257ad2a35351e02b | ef5731de317f1f6e30303944e2f5d26ba1d54619 | /pehill-5-cases-OpenFOAM/case_1p2/0/p | 527446ca123b22f1b80af769805dfe15e5d2917d | [] | no_license | xiaoh/para-database-for-PIML | a2e85360cd9ca67c1c200000a5d4a509d927f121 | c01a100fe5a76af0afb2949865c113b8624feb4c | refs/heads/master | 2023-05-28T02:34:38.160883 | 2023-05-18T14:57:57 | 2023-05-18T14:57:57 | 212,373,599 | 17 | 15 | null | null | null | null | UTF-8 | C++ | false | false | 181,553 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "10000";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
14751
(
-3.18281e-05
-2.90511e-05
-2.56403e-05
-2.20051e-05
-1.79965e-05
-1.3694e-05
-9.20927e-06
-4.53054e-06
2.45663e-07
5.07968e-06
9.91244e-06
1.47024e-05
1.94002e-05
2.39687e-05
2.83784e-05
3.25966e-05
3.6611e-05
4.03956e-05
4.3947e-05
4.72523e-05
5.03124e-05
5.31219e-05
5.569e-05
5.80119e-05
6.01006e-05
6.19586e-05
6.35964e-05
6.50207e-05
6.62413e-05
6.7267e-05
6.81068e-05
6.87697e-05
6.92643e-05
6.95989e-05
6.97822e-05
6.98201e-05
6.97217e-05
6.94926e-05
6.91397e-05
6.86678e-05
6.80826e-05
6.739e-05
6.65925e-05
6.5697e-05
6.47043e-05
6.36197e-05
6.24453e-05
6.11849e-05
5.984e-05
5.8414e-05
5.69082e-05
5.53257e-05
5.36674e-05
5.19359e-05
5.01323e-05
4.82591e-05
4.63173e-05
4.43094e-05
4.22359e-05
4.01008e-05
3.79019e-05
3.56424e-05
3.33209e-05
3.09364e-05
2.84874e-05
2.59706e-05
2.33809e-05
2.07103e-05
1.79549e-05
1.51073e-05
1.21671e-05
9.13859e-06
6.03609e-06
2.88236e-06
-2.9639e-07
-3.47121e-06
-6.6112e-06
-9.70611e-06
-1.27278e-05
-1.56805e-05
-1.8536e-05
-2.13019e-05
-2.39517e-05
-2.6481e-05
-2.88737e-05
-3.11086e-05
-3.31694e-05
-3.50297e-05
-3.6663e-05
-3.80491e-05
-3.91402e-05
-3.99229e-05
-4.03702e-05
-4.04142e-05
-4.01072e-05
-3.93258e-05
-3.81296e-05
-3.64686e-05
-3.45654e-05
-3.1826e-05
-2.90491e-05
-2.56387e-05
-2.20037e-05
-1.79954e-05
-1.36931e-05
-9.20858e-06
-4.53001e-06
2.46051e-07
5.07994e-06
9.91257e-06
1.47025e-05
1.94001e-05
2.39685e-05
2.83782e-05
3.25962e-05
3.66106e-05
4.0395e-05
4.39465e-05
4.72517e-05
5.03116e-05
5.3121e-05
5.56891e-05
5.8011e-05
6.00997e-05
6.19577e-05
6.35956e-05
6.50198e-05
6.62405e-05
6.72662e-05
6.81061e-05
6.8769e-05
6.92636e-05
6.95983e-05
6.97817e-05
6.98196e-05
6.97213e-05
6.94923e-05
6.91395e-05
6.86675e-05
6.80825e-05
6.73899e-05
6.65924e-05
6.56969e-05
6.47043e-05
6.36198e-05
6.24454e-05
6.1185e-05
5.98402e-05
5.84141e-05
5.69084e-05
5.53259e-05
5.36677e-05
5.19361e-05
5.01325e-05
4.82594e-05
4.63176e-05
4.43097e-05
4.22362e-05
4.01011e-05
3.79021e-05
3.56426e-05
3.3321e-05
3.09364e-05
2.84872e-05
2.59702e-05
2.33802e-05
2.07094e-05
1.79536e-05
1.51057e-05
1.21653e-05
9.1367e-06
6.03428e-06
2.88079e-06
-2.97567e-07
-3.47189e-06
-6.61134e-06
-9.70568e-06
-1.27269e-05
-1.56791e-05
-1.85342e-05
-2.12996e-05
-2.39492e-05
-2.64782e-05
-2.88707e-05
-3.11053e-05
-3.3166e-05
-3.50261e-05
-3.66593e-05
-3.80455e-05
-3.91366e-05
-3.99193e-05
-4.03667e-05
-4.04108e-05
-4.01039e-05
-3.93228e-05
-3.81268e-05
-3.64659e-05
-3.45629e-05
-3.18243e-05
-2.90478e-05
-2.56378e-05
-2.20035e-05
-1.79956e-05
-1.36936e-05
-9.20923e-06
-4.5306e-06
2.45592e-07
5.07963e-06
9.91239e-06
1.47024e-05
1.94001e-05
2.39687e-05
2.83785e-05
3.25966e-05
3.6611e-05
4.03955e-05
4.39468e-05
4.72519e-05
5.03117e-05
5.3121e-05
5.56889e-05
5.80106e-05
6.00993e-05
6.19572e-05
6.3595e-05
6.50192e-05
6.62399e-05
6.72656e-05
6.81055e-05
6.87685e-05
6.92631e-05
6.95979e-05
6.97813e-05
6.98193e-05
6.9721e-05
6.9492e-05
6.91393e-05
6.86674e-05
6.80824e-05
6.73898e-05
6.65924e-05
6.5697e-05
6.47044e-05
6.36199e-05
6.24456e-05
6.11852e-05
5.98405e-05
5.84145e-05
5.69087e-05
5.53263e-05
5.36681e-05
5.19366e-05
5.0133e-05
4.826e-05
4.63181e-05
4.43103e-05
4.22368e-05
4.01017e-05
3.79026e-05
3.5643e-05
3.33212e-05
3.09365e-05
2.84871e-05
2.59698e-05
2.33795e-05
2.07083e-05
1.79521e-05
1.51039e-05
1.21633e-05
9.13467e-06
6.03237e-06
2.8792e-06
-2.98658e-07
-3.47237e-06
-6.61112e-06
-9.70479e-06
-1.27253e-05
-1.5677e-05
-1.85316e-05
-2.12967e-05
-2.39459e-05
-2.64748e-05
-2.88671e-05
-3.11017e-05
-3.31623e-05
-3.50224e-05
-3.66556e-05
-3.80419e-05
-3.9133e-05
-3.99158e-05
-4.03633e-05
-4.04075e-05
-4.01008e-05
-3.93198e-05
-3.81242e-05
-3.64634e-05
-3.45611e-05
-3.18235e-05
-2.90478e-05
-2.56384e-05
-2.20046e-05
-1.79974e-05
-1.36955e-05
-9.21114e-06
-4.53222e-06
2.44423e-07
5.0789e-06
9.91205e-06
1.47024e-05
1.94005e-05
2.39694e-05
2.83795e-05
3.25978e-05
3.66124e-05
4.03968e-05
4.3948e-05
4.72529e-05
5.03124e-05
5.31214e-05
5.5689e-05
5.80105e-05
6.00989e-05
6.19566e-05
6.35943e-05
6.50184e-05
6.6239e-05
6.72647e-05
6.81045e-05
6.87675e-05
6.92621e-05
6.95969e-05
6.97803e-05
6.98184e-05
6.97201e-05
6.94912e-05
6.91385e-05
6.86667e-05
6.80817e-05
6.73893e-05
6.65919e-05
6.56966e-05
6.47041e-05
6.36197e-05
6.24454e-05
6.11852e-05
5.98405e-05
5.84146e-05
5.6909e-05
5.53267e-05
5.36685e-05
5.19371e-05
5.01336e-05
4.82606e-05
4.63189e-05
4.43111e-05
4.22377e-05
4.01025e-05
3.79035e-05
3.56439e-05
3.3322e-05
3.09372e-05
2.84877e-05
2.59703e-05
2.33798e-05
2.07084e-05
1.79522e-05
1.51039e-05
1.21633e-05
9.13468e-06
6.03252e-06
2.87959e-06
-2.97911e-07
-3.47118e-06
-6.60939e-06
-9.70253e-06
-1.27225e-05
-1.56738e-05
-1.8528e-05
-2.12928e-05
-2.3942e-05
-2.64708e-05
-2.88632e-05
-3.10978e-05
-3.31586e-05
-3.50189e-05
-3.66523e-05
-3.80388e-05
-3.91301e-05
-3.99131e-05
-4.03609e-05
-4.0405e-05
-4.00987e-05
-3.93179e-05
-3.81226e-05
-3.64616e-05
-3.4561e-05
-3.18239e-05
-2.90494e-05
-2.56405e-05
-2.20074e-05
-1.80012e-05
-1.36992e-05
-9.2149e-06
-4.53556e-06
2.41666e-07
5.0767e-06
9.91038e-06
1.47012e-05
1.93997e-05
2.3969e-05
2.83793e-05
3.25979e-05
3.66126e-05
4.03969e-05
4.39479e-05
4.72524e-05
5.03116e-05
5.312e-05
5.56873e-05
5.80083e-05
6.00964e-05
6.19538e-05
6.35913e-05
6.50153e-05
6.62358e-05
6.72614e-05
6.81012e-05
6.87642e-05
6.92589e-05
6.95937e-05
6.97772e-05
6.98154e-05
6.97173e-05
6.94885e-05
6.91359e-05
6.86643e-05
6.80795e-05
6.73872e-05
6.65901e-05
6.56949e-05
6.47026e-05
6.36184e-05
6.24443e-05
6.11843e-05
5.98398e-05
5.84142e-05
5.69087e-05
5.53267e-05
5.36688e-05
5.19376e-05
5.01343e-05
4.82615e-05
4.632e-05
4.43124e-05
4.22391e-05
4.01041e-05
3.79051e-05
3.56456e-05
3.33239e-05
3.09392e-05
2.84898e-05
2.59725e-05
2.33824e-05
2.07115e-05
1.79559e-05
1.51085e-05
1.21689e-05
9.14137e-06
6.0401e-06
2.88778e-06
-2.89542e-07
-3.463e-06
-6.60154e-06
-9.69512e-06
-1.27154e-05
-1.5667e-05
-1.85214e-05
-2.12865e-05
-2.3936e-05
-2.64651e-05
-2.8858e-05
-3.10931e-05
-3.31543e-05
-3.5015e-05
-3.66489e-05
-3.80359e-05
-3.91277e-05
-3.9911e-05
-4.03593e-05
-4.04035e-05
-4.00977e-05
-3.93172e-05
-3.81223e-05
-3.64609e-05
-3.45629e-05
-3.18261e-05
-2.90535e-05
-2.56453e-05
-2.20131e-05
-1.8008e-05
-1.37062e-05
-9.22206e-06
-4.54238e-06
2.35412e-07
5.071e-06
9.9052e-06
1.46964e-05
1.93953e-05
2.3965e-05
2.83757e-05
3.25945e-05
3.66093e-05
4.03935e-05
4.39442e-05
4.72484e-05
5.03071e-05
5.31151e-05
5.56819e-05
5.80025e-05
6.00903e-05
6.19475e-05
6.35849e-05
6.50088e-05
6.62292e-05
6.72549e-05
6.80948e-05
6.8758e-05
6.92528e-05
6.95879e-05
6.97717e-05
6.98101e-05
6.97123e-05
6.94838e-05
6.91315e-05
6.86602e-05
6.80758e-05
6.73838e-05
6.6587e-05
6.56922e-05
6.47003e-05
6.36165e-05
6.24428e-05
6.11831e-05
5.9839e-05
5.84137e-05
5.69087e-05
5.5327e-05
5.36694e-05
5.19386e-05
5.01357e-05
4.82633e-05
4.63221e-05
4.43148e-05
4.22417e-05
4.0107e-05
3.79083e-05
3.5649e-05
3.33274e-05
3.0943e-05
2.84939e-05
2.59771e-05
2.33876e-05
2.07177e-05
1.79636e-05
1.5118e-05
1.21808e-05
9.15574e-06
6.05691e-06
2.90657e-06
-2.69605e-07
-3.44288e-06
-6.58196e-06
-9.67671e-06
-1.26983e-05
-1.56514e-05
-1.85072e-05
-2.12737e-05
-2.39245e-05
-2.6455e-05
-2.8849e-05
-3.10853e-05
-3.31476e-05
-3.50094e-05
-3.66441e-05
-3.80322e-05
-3.91249e-05
-3.9909e-05
-4.03582e-05
-4.04027e-05
-4.00978e-05
-3.93179e-05
-3.81235e-05
-3.64615e-05
-3.45674e-05
-3.1831e-05
-2.9061e-05
-2.56538e-05
-2.20227e-05
-1.80192e-05
-1.37179e-05
-9.23393e-06
-4.55401e-06
2.24329e-07
5.06049e-06
9.89526e-06
1.4687e-05
1.93864e-05
2.39566e-05
2.83678e-05
3.25869e-05
3.66019e-05
4.03862e-05
4.39368e-05
4.72406e-05
5.0299e-05
5.31065e-05
5.5673e-05
5.79934e-05
6.00811e-05
6.19382e-05
6.35756e-05
6.49996e-05
6.62202e-05
6.72461e-05
6.80863e-05
6.87498e-05
6.9245e-05
6.95805e-05
6.97647e-05
6.98035e-05
6.97062e-05
6.94782e-05
6.91263e-05
6.86555e-05
6.80716e-05
6.73801e-05
6.65839e-05
6.56895e-05
6.46981e-05
6.36149e-05
6.24417e-05
6.11825e-05
5.9839e-05
5.84142e-05
5.69097e-05
5.53285e-05
5.36714e-05
5.19411e-05
5.01387e-05
4.82668e-05
4.6326e-05
4.43192e-05
4.22465e-05
4.01121e-05
3.79138e-05
3.56549e-05
3.33337e-05
3.09497e-05
2.85011e-05
2.5985e-05
2.33965e-05
2.07278e-05
1.79754e-05
1.51321e-05
1.21977e-05
9.17578e-06
6.08018e-06
2.93282e-06
-2.41089e-07
-3.41307e-06
-6.55177e-06
-9.64715e-06
-1.26698e-05
-1.56248e-05
-1.84826e-05
-2.12514e-05
-2.39045e-05
-2.64372e-05
-2.88336e-05
-3.1072e-05
-3.31363e-05
-3.50001e-05
-3.66366e-05
-3.80265e-05
-3.9121e-05
-3.99064e-05
-4.03572e-05
-4.04025e-05
-4.0099e-05
-3.93202e-05
-3.81267e-05
-3.64639e-05
-3.45752e-05
-3.18391e-05
-2.90727e-05
-2.56667e-05
-2.2037e-05
-1.80353e-05
-1.37347e-05
-9.25115e-06
-4.57104e-06
2.07863e-07
5.04467e-06
9.88014e-06
1.46725e-05
1.93726e-05
2.39434e-05
2.83554e-05
3.25751e-05
3.65906e-05
4.03751e-05
4.39258e-05
4.72296e-05
5.02879e-05
5.30952e-05
5.56616e-05
5.79819e-05
6.00696e-05
6.19269e-05
6.35645e-05
6.49888e-05
6.62098e-05
6.72361e-05
6.80768e-05
6.87408e-05
6.92366e-05
6.95726e-05
6.97574e-05
6.97969e-05
6.97001e-05
6.94727e-05
6.91215e-05
6.86514e-05
6.80681e-05
6.73773e-05
6.65817e-05
6.56879e-05
6.46972e-05
6.36146e-05
6.2442e-05
6.11835e-05
5.98406e-05
5.84165e-05
5.69126e-05
5.5332e-05
5.36756e-05
5.19459e-05
5.01441e-05
4.82728e-05
4.63326e-05
4.43263e-05
4.22543e-05
4.01203e-05
3.79226e-05
3.56641e-05
3.33435e-05
3.09601e-05
2.85122e-05
2.59969e-05
2.34094e-05
2.07422e-05
1.79916e-05
1.51507e-05
1.22191e-05
9.20045e-06
6.10824e-06
2.9641e-06
-2.07196e-07
-3.37742e-06
-6.5152e-06
-9.61067e-06
-1.26341e-05
-1.55906e-05
-1.84502e-05
-2.12214e-05
-2.38771e-05
-2.64126e-05
-2.8812e-05
-3.10533e-05
-3.31205e-05
-3.49872e-05
-3.66263e-05
-3.8019e-05
-3.91158e-05
-3.99034e-05
-4.03564e-05
-4.04033e-05
-4.01017e-05
-3.93245e-05
-3.81325e-05
-3.6469e-05
-3.45869e-05
-3.18515e-05
-2.90894e-05
-2.56849e-05
-2.20568e-05
-1.80571e-05
-1.37577e-05
-9.27448e-06
-4.5942e-06
1.8532e-07
5.0229e-06
9.85927e-06
1.46524e-05
1.93535e-05
2.39254e-05
2.83385e-05
3.25592e-05
3.65756e-05
4.03608e-05
4.39119e-05
4.7216e-05
5.02745e-05
5.3082e-05
5.56485e-05
5.79691e-05
6.00571e-05
6.19148e-05
6.35529e-05
6.49777e-05
6.61993e-05
6.72263e-05
6.80677e-05
6.87323e-05
6.92288e-05
6.95656e-05
6.97511e-05
6.97913e-05
6.96953e-05
6.94687e-05
6.91182e-05
6.86488e-05
6.80663e-05
6.73761e-05
6.65813e-05
6.56883e-05
6.46983e-05
6.36164e-05
6.24445e-05
6.11868e-05
5.98446e-05
5.84212e-05
5.6918e-05
5.53382e-05
5.36825e-05
5.19535e-05
5.01524e-05
4.82817e-05
4.63422e-05
4.43366e-05
4.22652e-05
4.01319e-05
3.79348e-05
3.5677e-05
3.33569e-05
3.09742e-05
2.8527e-05
2.60126e-05
2.34261e-05
2.07603e-05
1.80114e-05
1.51727e-05
1.22437e-05
9.2282e-06
6.13931e-06
2.99843e-06
-1.70092e-07
-3.33829e-06
-6.47488e-06
-9.57016e-06
-1.2594e-05
-1.5552e-05
-1.84135e-05
-2.11871e-05
-2.38456e-05
-2.63842e-05
-2.8787e-05
-3.10318e-05
-3.31024e-05
-3.49726e-05
-3.6615e-05
-3.8011e-05
-3.91111e-05
-3.99014e-05
-4.03573e-05
-4.04062e-05
-4.0107e-05
-3.9332e-05
-3.81418e-05
-3.64778e-05
-3.46033e-05
-3.18693e-05
-2.91123e-05
-2.57094e-05
-2.20832e-05
-1.80857e-05
-1.37877e-05
-9.3048e-06
-4.62431e-06
1.5602e-07
4.99467e-06
9.8323e-06
1.46267e-05
1.93293e-05
2.39028e-05
2.83175e-05
3.25398e-05
3.65576e-05
4.0344e-05
4.38962e-05
4.72011e-05
5.02602e-05
5.30682e-05
5.56353e-05
5.79565e-05
6.00451e-05
6.19034e-05
6.35423e-05
6.49679e-05
6.61903e-05
6.72181e-05
6.80603e-05
6.87257e-05
6.92231e-05
6.95606e-05
6.97469e-05
6.9788e-05
6.96928e-05
6.9467e-05
6.91172e-05
6.86487e-05
6.80669e-05
6.73776e-05
6.65835e-05
6.56913e-05
6.4702e-05
6.36209e-05
6.24498e-05
6.11929e-05
5.98514e-05
5.84288e-05
5.69264e-05
5.53473e-05
5.36923e-05
5.19641e-05
5.01637e-05
4.82939e-05
4.63551e-05
4.43502e-05
4.22796e-05
4.01469e-05
3.79505e-05
3.56933e-05
3.33738e-05
3.09918e-05
2.85452e-05
2.60315e-05
2.34459e-05
2.07811e-05
1.80336e-05
1.51967e-05
1.22701e-05
9.25744e-06
6.17172e-06
3.0341e-06
-1.3152e-07
-3.29748e-06
-6.43266e-06
-9.5275e-06
-1.25517e-05
-1.5511e-05
-1.83744e-05
-2.11506e-05
-2.38122e-05
-2.63543e-05
-2.87608e-05
-3.10095e-05
-3.30842e-05
-3.49583e-05
-3.66046e-05
-3.80045e-05
-3.91084e-05
-3.99019e-05
-4.0361e-05
-4.04127e-05
-4.01159e-05
-3.93437e-05
-3.81558e-05
-3.64914e-05
-3.46252e-05
-3.18935e-05
-2.91422e-05
-2.57412e-05
-2.21171e-05
-1.81217e-05
-1.38254e-05
-9.3426e-06
-4.66163e-06
1.19898e-07
4.96012e-06
9.79961e-06
1.4596e-05
1.93007e-05
2.38765e-05
2.82936e-05
3.25181e-05
3.65381e-05
4.03264e-05
4.38801e-05
4.71863e-05
5.02465e-05
5.30555e-05
5.56235e-05
5.79455e-05
6.0035e-05
6.18943e-05
6.3534e-05
6.49606e-05
6.61839e-05
6.72125e-05
6.80556e-05
6.8722e-05
6.92202e-05
6.95586e-05
6.97457e-05
6.97877e-05
6.96933e-05
6.94683e-05
6.91193e-05
6.86516e-05
6.80707e-05
6.73821e-05
6.65888e-05
6.56973e-05
6.47089e-05
6.36285e-05
6.24582e-05
6.1202e-05
5.98614e-05
5.84395e-05
5.69379e-05
5.53595e-05
5.37054e-05
5.19779e-05
5.01783e-05
4.83092e-05
4.63712e-05
4.43671e-05
4.22972e-05
4.01652e-05
3.79695e-05
3.57128e-05
3.33939e-05
3.10123e-05
2.85662e-05
2.60529e-05
2.34678e-05
2.08037e-05
1.80571e-05
1.52216e-05
1.2297e-05
9.28686e-06
6.2042e-06
3.06986e-06
-9.27184e-08
-3.25619e-06
-6.38975e-06
-9.48395e-06
-1.25085e-05
-1.5469e-05
-1.83345e-05
-2.11133e-05
-2.37783e-05
-2.63242e-05
-2.87349e-05
-3.0988e-05
-3.3067e-05
-3.49456e-05
-3.65964e-05
-3.80006e-05
-3.91088e-05
-3.99061e-05
-4.03689e-05
-4.04237e-05
-4.01298e-05
-3.93608e-05
-3.81756e-05
-3.6511e-05
-3.46537e-05
-3.19252e-05
-2.91797e-05
-2.57808e-05
-2.21589e-05
-1.81655e-05
-1.38707e-05
-9.38767e-06
-4.70576e-06
7.75794e-08
4.92009e-06
9.76223e-06
1.45613e-05
1.92691e-05
2.3848e-05
2.82682e-05
3.24959e-05
3.65186e-05
4.03094e-05
4.38651e-05
4.71731e-05
5.02348e-05
5.30451e-05
5.56143e-05
5.79374e-05
6.0028e-05
6.18883e-05
6.35291e-05
6.49567e-05
6.61809e-05
6.72106e-05
6.80546e-05
6.87218e-05
6.92209e-05
6.95602e-05
6.97481e-05
6.97909e-05
6.96973e-05
6.94731e-05
6.91249e-05
6.8658e-05
6.80778e-05
6.73899e-05
6.65975e-05
6.57067e-05
6.4719e-05
6.36394e-05
6.24699e-05
6.12144e-05
5.98746e-05
5.84534e-05
5.69526e-05
5.5375e-05
5.37217e-05
5.1995e-05
5.01962e-05
4.83278e-05
4.63906e-05
4.43871e-05
4.2318e-05
4.01866e-05
3.79914e-05
3.57353e-05
3.34166e-05
3.10354e-05
2.85894e-05
2.60761e-05
2.3491e-05
2.08272e-05
1.8081e-05
1.52464e-05
1.23234e-05
9.31558e-06
6.23589e-06
3.1049e-06
-5.4439e-08
-3.21517e-06
-6.34689e-06
-9.44021e-06
-1.2465e-05
-1.54266e-05
-1.82943e-05
-2.1076e-05
-2.37446e-05
-2.62946e-05
-2.87098e-05
-3.09677e-05
-3.30516e-05
-3.49352e-05
-3.65909e-05
-3.8e-05
-3.9113e-05
-3.99147e-05
-4.03815e-05
-4.04402e-05
-4.01492e-05
-3.9384e-05
-3.82019e-05
-3.65374e-05
-3.46891e-05
-3.19645e-05
-2.92249e-05
-2.58282e-05
-2.22083e-05
-1.82166e-05
-1.39232e-05
-9.43927e-06
-4.75577e-06
3.01542e-08
4.87579e-06
9.72143e-06
1.45241e-05
1.92357e-05
2.38186e-05
2.82427e-05
3.24742e-05
3.65003e-05
4.02942e-05
4.38525e-05
4.71627e-05
5.02262e-05
5.30381e-05
5.56086e-05
5.79331e-05
6.00249e-05
6.18864e-05
6.35283e-05
6.49569e-05
6.61822e-05
6.72128e-05
6.80577e-05
6.87258e-05
6.92257e-05
6.95658e-05
6.97545e-05
6.97981e-05
6.97052e-05
6.94818e-05
6.91342e-05
6.8668e-05
6.80886e-05
6.74014e-05
6.66097e-05
6.57196e-05
6.47326e-05
6.36538e-05
6.2485e-05
6.12303e-05
5.98911e-05
5.84707e-05
5.69707e-05
5.53938e-05
5.37412e-05
5.20153e-05
5.02172e-05
4.83496e-05
4.6413e-05
4.44103e-05
4.23418e-05
4.02108e-05
3.80161e-05
3.57602e-05
3.34417e-05
3.10604e-05
2.86142e-05
2.61005e-05
2.35149e-05
2.08507e-05
1.81045e-05
1.52704e-05
1.23487e-05
9.34306e-06
6.26638e-06
3.13886e-06
-1.6983e-08
-3.17467e-06
-6.30433e-06
-9.39652e-06
-1.24214e-05
-1.53842e-05
-1.82541e-05
-2.10388e-05
-2.37113e-05
-2.62658e-05
-2.86859e-05
-3.0949e-05
-3.30383e-05
-3.49273e-05
-3.65885e-05
-3.8003e-05
-3.91215e-05
-3.9928e-05
-4.03994e-05
-4.04626e-05
-4.01748e-05
-3.94139e-05
-3.82352e-05
-3.65712e-05
-3.47319e-05
-3.20115e-05
-2.92774e-05
-2.58829e-05
-2.22648e-05
-1.82743e-05
-1.39821e-05
-9.49647e-06
-4.81066e-06
-2.13354e-08
4.82827e-06
9.67829e-06
1.44854e-05
1.92017e-05
2.37893e-05
2.82181e-05
3.2454e-05
3.64842e-05
4.02817e-05
4.38429e-05
4.71557e-05
5.02213e-05
5.30351e-05
5.56071e-05
5.79331e-05
6.00262e-05
6.18889e-05
6.35319e-05
6.49616e-05
6.61879e-05
6.72194e-05
6.80652e-05
6.87342e-05
6.92349e-05
6.95758e-05
6.97651e-05
6.98095e-05
6.97172e-05
6.94944e-05
6.91475e-05
6.8682e-05
6.81032e-05
6.74167e-05
6.66257e-05
6.57362e-05
6.47499e-05
6.36717e-05
6.25036e-05
6.12496e-05
5.99112e-05
5.84915e-05
5.69922e-05
5.5416e-05
5.37641e-05
5.20389e-05
5.02415e-05
4.83745e-05
4.64386e-05
4.44364e-05
4.23684e-05
4.02378e-05
3.80432e-05
3.57873e-05
3.34686e-05
3.10869e-05
2.864e-05
2.61255e-05
2.35389e-05
2.08739e-05
1.81272e-05
1.52933e-05
1.23727e-05
9.36921e-06
6.29564e-06
3.17184e-06
1.97866e-08
-3.13452e-06
-6.26186e-06
-9.35268e-06
-1.23777e-05
-1.53415e-05
-1.82138e-05
-2.10016e-05
-2.36782e-05
-2.62376e-05
-2.8663e-05
-3.09318e-05
-3.3027e-05
-3.49221e-05
-3.65893e-05
-3.80097e-05
-3.91343e-05
-3.99464e-05
-4.04227e-05
-4.0491e-05
-4.02067e-05
-3.94506e-05
-3.82758e-05
-3.66122e-05
-3.47818e-05
-3.20658e-05
-2.93366e-05
-2.59444e-05
-2.23278e-05
-1.83381e-05
-1.40464e-05
-9.55849e-06
-4.86966e-06
-7.61178e-08
4.7783e-06
9.63353e-06
1.44458e-05
1.91676e-05
2.37608e-05
2.81949e-05
3.2436e-05
3.64706e-05
4.02722e-05
4.38369e-05
4.71526e-05
5.02206e-05
5.30364e-05
5.56102e-05
5.79378e-05
6.00323e-05
6.18963e-05
6.35405e-05
6.49713e-05
6.61985e-05
6.7231e-05
6.80776e-05
6.87473e-05
6.92487e-05
6.95903e-05
6.97803e-05
6.98252e-05
6.97336e-05
6.95114e-05
6.9165e-05
6.87001e-05
6.81219e-05
6.74359e-05
6.66455e-05
6.57566e-05
6.47709e-05
6.36934e-05
6.25259e-05
6.12725e-05
5.99348e-05
5.85157e-05
5.70171e-05
5.54416e-05
5.37904e-05
5.20658e-05
5.0269e-05
4.84026e-05
4.64671e-05
4.44653e-05
4.23977e-05
4.02671e-05
3.80726e-05
3.58164e-05
3.34971e-05
3.11146e-05
2.86666e-05
2.61508e-05
2.35628e-05
2.08966e-05
1.81491e-05
1.53151e-05
1.23956e-05
9.39435e-06
6.32412e-06
3.20433e-06
5.64129e-08
-3.09418e-06
-6.21893e-06
-9.30816e-06
-1.23332e-05
-1.5298e-05
-1.81729e-05
-2.0964e-05
-2.36451e-05
-2.62097e-05
-2.86408e-05
-3.09159e-05
-3.30175e-05
-3.49192e-05
-3.65932e-05
-3.80201e-05
-3.91514e-05
-3.99696e-05
-4.04514e-05
-4.05254e-05
-4.02449e-05
-3.94939e-05
-3.83233e-05
-3.66605e-05
-3.48385e-05
-3.2127e-05
-2.94022e-05
-2.60123e-05
-2.23968e-05
-1.84074e-05
-1.41159e-05
-9.62492e-06
-4.93237e-06
-1.33808e-07
4.72623e-06
9.5875e-06
1.44059e-05
1.91339e-05
2.37333e-05
2.81735e-05
3.24203e-05
3.64601e-05
4.02663e-05
4.38348e-05
4.71537e-05
5.02244e-05
5.30425e-05
5.56181e-05
5.79474e-05
6.00434e-05
6.19088e-05
6.35542e-05
6.4986e-05
6.62143e-05
6.72476e-05
6.8095e-05
6.87654e-05
6.92675e-05
6.96096e-05
6.98001e-05
6.98456e-05
6.97545e-05
6.95328e-05
6.91869e-05
6.87225e-05
6.81447e-05
6.74593e-05
6.66694e-05
6.5781e-05
6.47959e-05
6.37189e-05
6.2552e-05
6.12992e-05
5.9962e-05
5.85436e-05
5.70456e-05
5.54706e-05
5.382e-05
5.20959e-05
5.02996e-05
4.84337e-05
4.64986e-05
4.4497e-05
4.24295e-05
4.02988e-05
3.81039e-05
3.58471e-05
3.35269e-05
3.11432e-05
2.86937e-05
2.61762e-05
2.35865e-05
2.09188e-05
1.81703e-05
1.53364e-05
1.24179e-05
9.4192e-06
6.3526e-06
3.23713e-06
9.36882e-08
-3.05288e-06
-6.17485e-06
-9.26233e-06
-1.22874e-05
-1.52532e-05
-1.81308e-05
-2.09256e-05
-2.36115e-05
-2.61818e-05
-2.86191e-05
-3.0901e-05
-3.30096e-05
-3.49186e-05
-3.66e-05
-3.8034e-05
-3.91727e-05
-3.99977e-05
-4.04853e-05
-4.05656e-05
-4.02891e-05
-3.95436e-05
-3.83774e-05
-3.67156e-05
-3.49016e-05
-3.2195e-05
-2.9474e-05
-2.60864e-05
-2.24717e-05
-1.8482e-05
-1.41903e-05
-9.69564e-06
-4.99866e-06
-1.94305e-07
4.67217e-06
9.54029e-06
1.43655e-05
1.91006e-05
2.3707e-05
2.81539e-05
3.24072e-05
3.64526e-05
4.02639e-05
4.38367e-05
4.71592e-05
5.02328e-05
5.30535e-05
5.56312e-05
5.79623e-05
6.00599e-05
6.19267e-05
6.35733e-05
6.50062e-05
6.62354e-05
6.72695e-05
6.81176e-05
6.87886e-05
6.92913e-05
6.96339e-05
6.98249e-05
6.98709e-05
6.97801e-05
6.95588e-05
6.92133e-05
6.87493e-05
6.8172e-05
6.74869e-05
6.66975e-05
6.58095e-05
6.48249e-05
6.37484e-05
6.2582e-05
6.13297e-05
5.9993e-05
5.85751e-05
5.70776e-05
5.55032e-05
5.3853e-05
5.21294e-05
5.03335e-05
4.84678e-05
4.65329e-05
4.45314e-05
4.24638e-05
4.03326e-05
3.81372e-05
3.58794e-05
3.35579e-05
3.11727e-05
2.87215e-05
2.62021e-05
2.36104e-05
2.09412e-05
1.81917e-05
1.53578e-05
1.24407e-05
9.44466e-06
6.38197e-06
3.27109e-06
1.32387e-07
-3.00994e-06
-6.12901e-06
-9.21466e-06
-1.22398e-05
-1.52068e-05
-1.80874e-05
-2.0886e-05
-2.35772e-05
-2.61536e-05
-2.85977e-05
-3.0887e-05
-3.30033e-05
-3.49201e-05
-3.66095e-05
-3.80513e-05
-3.9198e-05
-4.00303e-05
-4.05243e-05
-4.06113e-05
-4.03391e-05
-3.95995e-05
-3.8438e-05
-3.67774e-05
-3.49708e-05
-3.22699e-05
-2.9552e-05
-2.61667e-05
-2.25525e-05
-1.85622e-05
-1.42699e-05
-9.77079e-06
-5.06869e-06
-2.57739e-07
4.61599e-06
9.4918e-06
1.43247e-05
1.90677e-05
2.36819e-05
2.81363e-05
3.23967e-05
3.64484e-05
4.02653e-05
4.38427e-05
4.71693e-05
5.02461e-05
5.30696e-05
5.56495e-05
5.79826e-05
6.00818e-05
6.19501e-05
6.3598e-05
6.5032e-05
6.62621e-05
6.72969e-05
6.81457e-05
6.88173e-05
6.93205e-05
6.96635e-05
6.98548e-05
6.99011e-05
6.98107e-05
6.95897e-05
6.92444e-05
6.87807e-05
6.82037e-05
6.7519e-05
6.673e-05
6.58422e-05
6.48581e-05
6.37819e-05
6.2616e-05
6.13641e-05
6.00279e-05
5.86104e-05
5.71133e-05
5.55393e-05
5.38895e-05
5.21661e-05
5.03705e-05
4.85049e-05
4.65701e-05
4.45684e-05
4.25005e-05
4.03687e-05
3.81724e-05
3.59134e-05
3.35905e-05
3.12036e-05
2.87504e-05
2.62289e-05
2.36352e-05
2.09644e-05
1.8214e-05
1.53803e-05
1.24647e-05
9.47155e-06
6.41297e-06
3.30687e-06
1.73062e-07
-2.96491e-06
-6.08102e-06
-9.16484e-06
-1.21901e-05
-1.51585e-05
-1.80423e-05
-2.08452e-05
-2.3542e-05
-2.61251e-05
-2.85765e-05
-3.08738e-05
-3.29983e-05
-3.49237e-05
-3.66218e-05
-3.80719e-05
-3.92273e-05
-4.00675e-05
-4.05684e-05
-4.06627e-05
-4.03949e-05
-3.96615e-05
-3.8505e-05
-3.68459e-05
-3.5046e-05
-3.2352e-05
-2.96366e-05
-2.62535e-05
-2.26396e-05
-1.86483e-05
-1.43548e-05
-9.85067e-06
-5.14275e-06
-3.24389e-07
4.55745e-06
9.44183e-06
1.42833e-05
1.9035e-05
2.36579e-05
2.81205e-05
3.23888e-05
3.64474e-05
4.02705e-05
4.3853e-05
4.7184e-05
5.02644e-05
5.3091e-05
5.56732e-05
5.80085e-05
6.01095e-05
6.19793e-05
6.36285e-05
6.50636e-05
6.62946e-05
6.73302e-05
6.81795e-05
6.88516e-05
6.93551e-05
6.96984e-05
6.989e-05
6.99366e-05
6.98463e-05
6.96255e-05
6.92804e-05
6.88169e-05
6.82402e-05
6.75556e-05
6.67669e-05
6.58794e-05
6.48955e-05
6.38197e-05
6.26541e-05
6.14025e-05
6.00667e-05
5.86495e-05
5.71528e-05
5.5579e-05
5.39294e-05
5.22063e-05
5.04108e-05
4.85452e-05
4.66103e-05
4.46083e-05
4.25398e-05
4.04072e-05
3.82099e-05
3.59496e-05
3.3625e-05
3.12361e-05
2.87809e-05
2.62572e-05
2.36615e-05
2.09891e-05
1.82379e-05
1.54045e-05
1.24905e-05
9.50042e-06
6.44608e-06
3.34485e-06
2.16015e-07
-2.91756e-06
-6.03072e-06
-9.11277e-06
-1.21384e-05
-1.51082e-05
-1.79956e-05
-2.0803e-05
-2.3506e-05
-2.60962e-05
-2.85555e-05
-3.08614e-05
-3.29948e-05
-3.49293e-05
-3.66369e-05
-3.8096e-05
-3.92606e-05
-4.01093e-05
-4.06176e-05
-4.07197e-05
-4.04567e-05
-3.97299e-05
-3.85785e-05
-3.69213e-05
-3.51276e-05
-3.24416e-05
-2.97281e-05
-2.63474e-05
-2.27334e-05
-1.87406e-05
-1.44456e-05
-9.93573e-06
-5.22126e-06
-3.9464e-07
4.49621e-06
9.39007e-06
1.42411e-05
1.90024e-05
2.36348e-05
2.81065e-05
3.23834e-05
3.64495e-05
4.02795e-05
4.38677e-05
4.72034e-05
5.02878e-05
5.31177e-05
5.57025e-05
5.80402e-05
6.01431e-05
6.20146e-05
6.3665e-05
6.51012e-05
6.63331e-05
6.73693e-05
6.82192e-05
6.88917e-05
6.93955e-05
6.9739e-05
6.99307e-05
6.99774e-05
6.98872e-05
6.96665e-05
6.93215e-05
6.8858e-05
6.82814e-05
6.75969e-05
6.68084e-05
6.5921e-05
6.49374e-05
6.38617e-05
6.26964e-05
6.14451e-05
6.01095e-05
5.86926e-05
5.71961e-05
5.56225e-05
5.39731e-05
5.225e-05
5.04545e-05
4.85888e-05
4.66536e-05
4.46511e-05
4.2582e-05
4.04485e-05
3.825e-05
3.59881e-05
3.36618e-05
3.12709e-05
2.88135e-05
2.62876e-05
2.36899e-05
2.1016e-05
1.8264e-05
1.54309e-05
1.25186e-05
9.53162e-06
6.48157e-06
3.38523e-06
2.61388e-07
-2.8678e-06
-5.97805e-06
-9.05842e-06
-1.20845e-05
-1.5056e-05
-1.79473e-05
-2.07596e-05
-2.34692e-05
-2.6067e-05
-2.85347e-05
-3.08498e-05
-3.29928e-05
-3.49372e-05
-3.66548e-05
-3.81236e-05
-3.92982e-05
-4.01561e-05
-4.06723e-05
-4.07826e-05
-4.05249e-05
-3.98049e-05
-3.8659e-05
-3.70041e-05
-3.5216e-05
-3.25395e-05
-2.98271e-05
-2.64487e-05
-2.28345e-05
-1.88399e-05
-1.45428e-05
-1.00265e-05
-5.30474e-06
-4.68962e-07
4.43184e-06
9.33614e-06
1.41977e-05
1.89695e-05
2.36124e-05
2.8094e-05
3.23804e-05
3.64549e-05
4.02923e-05
4.38867e-05
4.72278e-05
5.03164e-05
5.315e-05
5.57377e-05
5.80779e-05
6.01828e-05
6.20559e-05
6.37078e-05
6.5145e-05
6.63777e-05
6.74146e-05
6.8265e-05
6.89377e-05
6.94417e-05
6.97854e-05
6.99771e-05
7.00238e-05
6.99335e-05
6.97127e-05
6.93677e-05
6.89042e-05
6.83275e-05
6.76431e-05
6.68546e-05
6.59673e-05
6.49837e-05
6.39082e-05
6.27431e-05
6.14919e-05
6.01565e-05
5.87397e-05
5.72434e-05
5.56699e-05
5.40205e-05
5.22974e-05
5.05018e-05
4.86359e-05
4.67003e-05
4.46973e-05
4.26274e-05
4.04928e-05
3.8293e-05
3.60295e-05
3.37013e-05
3.13084e-05
2.88487e-05
2.63205e-05
2.37207e-05
2.10453e-05
1.82925e-05
1.54598e-05
1.25492e-05
9.56535e-06
6.51958e-06
3.42813e-06
3.09249e-07
-2.8156e-06
-5.923e-06
-9.00178e-06
-1.20285e-05
-1.50019e-05
-1.78973e-05
-2.07149e-05
-2.34315e-05
-2.60375e-05
-2.85143e-05
-3.08392e-05
-3.29924e-05
-3.49474e-05
-3.66758e-05
-3.8155e-05
-3.93402e-05
-4.0208e-05
-4.07327e-05
-4.08519e-05
-4.05998e-05
-3.9887e-05
-3.87468e-05
-3.70947e-05
-3.53116e-05
-3.2646e-05
-2.99343e-05
-2.65583e-05
-2.29436e-05
-1.89467e-05
-1.46471e-05
-1.01236e-05
-5.39374e-06
-5.47878e-07
4.36387e-06
9.27966e-06
1.41527e-05
1.89362e-05
2.35905e-05
2.80831e-05
3.23798e-05
3.64633e-05
4.03089e-05
4.39101e-05
4.7257e-05
5.03503e-05
5.3188e-05
5.57787e-05
5.81217e-05
6.02287e-05
6.21037e-05
6.37569e-05
6.51953e-05
6.64288e-05
6.74663e-05
6.8317e-05
6.89899e-05
6.9494e-05
6.98377e-05
7.00292e-05
7.00758e-05
6.99854e-05
6.97644e-05
6.94192e-05
6.89556e-05
6.83788e-05
6.76942e-05
6.69057e-05
6.60183e-05
6.50348e-05
6.39593e-05
6.27942e-05
6.15431e-05
6.02078e-05
5.87911e-05
5.72948e-05
5.57213e-05
5.4072e-05
5.23488e-05
5.0553e-05
4.86867e-05
4.67507e-05
4.4747e-05
4.26763e-05
4.05405e-05
3.83393e-05
3.60741e-05
3.37439e-05
3.13487e-05
2.88867e-05
2.63562e-05
2.37542e-05
2.10773e-05
1.83238e-05
1.54914e-05
1.25825e-05
9.60173e-06
6.56021e-06
3.47361e-06
3.5963e-07
-2.76095e-06
-5.86558e-06
-8.94289e-06
-1.19704e-05
-1.4946e-05
-1.78458e-05
-2.06691e-05
-2.33931e-05
-2.60077e-05
-2.84942e-05
-3.08296e-05
-3.29938e-05
-3.49601e-05
-3.67001e-05
-3.81905e-05
-3.93871e-05
-4.02654e-05
-4.07994e-05
-4.0928e-05
-4.06819e-05
-3.99768e-05
-3.88427e-05
-3.71937e-05
-3.54151e-05
-3.27621e-05
-3.00505e-05
-2.66768e-05
-2.30614e-05
-1.90618e-05
-1.47591e-05
-1.02278e-05
-5.48892e-06
-6.31964e-07
4.2918e-06
9.22016e-06
1.41059e-05
1.89021e-05
2.35689e-05
2.80734e-05
3.23814e-05
3.64749e-05
4.03294e-05
4.39381e-05
4.72912e-05
5.03897e-05
5.32318e-05
5.58258e-05
5.81718e-05
6.02811e-05
6.2158e-05
6.38127e-05
6.52522e-05
6.64865e-05
6.75245e-05
6.83755e-05
6.90486e-05
6.95526e-05
6.98961e-05
7.00875e-05
7.01338e-05
7.00431e-05
6.98218e-05
6.94762e-05
6.90124e-05
6.84353e-05
6.77505e-05
6.69619e-05
6.60743e-05
6.50907e-05
6.40152e-05
6.285e-05
6.15989e-05
6.02636e-05
5.88469e-05
5.73507e-05
5.57771e-05
5.41277e-05
5.24043e-05
5.06082e-05
4.87415e-05
4.6805e-05
4.48005e-05
4.27288e-05
4.05917e-05
3.8389e-05
3.61219e-05
3.37897e-05
3.13922e-05
2.89277e-05
2.63948e-05
2.37907e-05
2.11122e-05
1.83578e-05
1.55258e-05
1.26185e-05
9.64086e-06
6.60353e-06
3.5217e-06
4.12546e-07
-2.70386e-06
-5.80581e-06
-8.88178e-06
-1.19102e-05
-1.48882e-05
-1.77927e-05
-2.0622e-05
-2.3354e-05
-2.59779e-05
-2.84746e-05
-3.08213e-05
-3.29972e-05
-3.49756e-05
-3.67279e-05
-3.82303e-05
-3.94392e-05
-4.03289e-05
-4.08727e-05
-4.10114e-05
-4.07719e-05
-4.00749e-05
-3.89471e-05
-3.73018e-05
-3.55273e-05
-3.28884e-05
-3.01764e-05
-2.6805e-05
-2.31886e-05
-1.9186e-05
-1.48796e-05
-1.03397e-05
-5.59092e-06
-7.21814e-07
4.21511e-06
9.15722e-06
1.40568e-05
1.88669e-05
2.35474e-05
2.80649e-05
3.23852e-05
3.64896e-05
4.03537e-05
4.39705e-05
4.73306e-05
5.04347e-05
5.32816e-05
5.58793e-05
5.82284e-05
6.03402e-05
6.22191e-05
6.38753e-05
6.53159e-05
6.6551e-05
6.75895e-05
6.84408e-05
6.91138e-05
6.96177e-05
6.9961e-05
7.0152e-05
7.01979e-05
7.01068e-05
6.9885e-05
6.9539e-05
6.90747e-05
6.84973e-05
6.78122e-05
6.70233e-05
6.61355e-05
6.51517e-05
6.40759e-05
6.29107e-05
6.16595e-05
6.03241e-05
5.89074e-05
5.7411e-05
5.58373e-05
5.41877e-05
5.24641e-05
5.06677e-05
4.88004e-05
4.68632e-05
4.48578e-05
4.27851e-05
4.06465e-05
3.84422e-05
3.61732e-05
3.38388e-05
3.14389e-05
2.89719e-05
2.64365e-05
2.38301e-05
2.115e-05
1.83948e-05
1.55631e-05
1.26575e-05
9.68279e-06
6.64957e-06
3.57242e-06
4.67988e-07
-2.64435e-06
-5.74373e-06
-8.81851e-06
-1.18481e-05
-1.48286e-05
-1.77382e-05
-2.0574e-05
-2.33144e-05
-2.59482e-05
-2.84558e-05
-3.08144e-05
-3.30029e-05
-3.49941e-05
-3.67597e-05
-3.8275e-05
-3.9497e-05
-4.03989e-05
-4.09533e-05
-4.11028e-05
-4.08704e-05
-4.01819e-05
-3.90609e-05
-3.74199e-05
-3.5649e-05
-3.30257e-05
-3.0313e-05
-2.69438e-05
-2.33262e-05
-1.93202e-05
-1.50095e-05
-1.04601e-05
-5.70044e-06
-8.18046e-07
4.13325e-06
9.09038e-06
1.40052e-05
1.88304e-05
2.35258e-05
2.80575e-05
3.23912e-05
3.65073e-05
4.03821e-05
4.40078e-05
4.73754e-05
5.04856e-05
5.33376e-05
5.59393e-05
5.82919e-05
6.04063e-05
6.22874e-05
6.39451e-05
6.53869e-05
6.66228e-05
6.76616e-05
6.8513e-05
6.9186e-05
6.96897e-05
7.00325e-05
7.0223e-05
7.02684e-05
7.01767e-05
6.99543e-05
6.96077e-05
6.91429e-05
6.8565e-05
6.78794e-05
6.70901e-05
6.62019e-05
6.52179e-05
6.41419e-05
6.29765e-05
6.1725e-05
6.03895e-05
5.89726e-05
5.74761e-05
5.59022e-05
5.42523e-05
5.25283e-05
5.07314e-05
4.88635e-05
4.69256e-05
4.49192e-05
4.28452e-05
4.07052e-05
3.84991e-05
3.6228e-05
3.38913e-05
3.14889e-05
2.90193e-05
2.64814e-05
2.38727e-05
2.11909e-05
1.84348e-05
1.56034e-05
1.26993e-05
9.72754e-06
6.69835e-06
3.62576e-06
5.2592e-07
-2.58249e-06
-5.67942e-06
-8.75317e-06
-1.1784e-05
-1.47675e-05
-1.76824e-05
-2.05251e-05
-2.32745e-05
-2.59186e-05
-2.84379e-05
-3.08092e-05
-3.3011e-05
-3.50161e-05
-3.67959e-05
-3.8325e-05
-3.95609e-05
-4.04759e-05
-4.10418e-05
-4.12027e-05
-4.09781e-05
-4.02986e-05
-3.91847e-05
-3.75487e-05
-3.5781e-05
-3.31749e-05
-3.04612e-05
-2.70941e-05
-2.3475e-05
-1.94652e-05
-1.51495e-05
-1.05897e-05
-5.81817e-06
-9.21272e-07
4.0457e-06
9.01921e-06
1.39505e-05
1.87923e-05
2.3504e-05
2.80511e-05
3.23993e-05
3.65284e-05
4.04146e-05
4.40499e-05
4.74257e-05
5.05427e-05
5.34003e-05
5.60063e-05
5.83626e-05
6.04798e-05
6.23632e-05
6.40226e-05
6.54655e-05
6.67021e-05
6.77413e-05
6.85927e-05
6.92655e-05
6.97688e-05
7.01111e-05
7.03009e-05
7.03456e-05
7.02531e-05
7.003e-05
6.96827e-05
6.92172e-05
6.86386e-05
6.79524e-05
6.71626e-05
6.62739e-05
6.52895e-05
6.42131e-05
6.30474e-05
6.17957e-05
6.04599e-05
5.90428e-05
5.7546e-05
5.59717e-05
5.43215e-05
5.2597e-05
5.07996e-05
4.8931e-05
4.69921e-05
4.49846e-05
4.29094e-05
4.07677e-05
3.85597e-05
3.62864e-05
3.39473e-05
3.15423e-05
2.907e-05
2.65294e-05
2.39184e-05
2.12349e-05
1.84778e-05
1.56466e-05
1.2744e-05
9.77513e-06
6.74983e-06
3.68167e-06
5.86278e-07
-2.51835e-06
-5.61299e-06
-8.68588e-06
-1.17183e-05
-1.47048e-05
-1.76254e-05
-2.04755e-05
-2.32343e-05
-2.58895e-05
-2.84211e-05
-3.0806e-05
-3.3022e-05
-3.50418e-05
-3.68367e-05
-3.83806e-05
-3.96316e-05
-4.05606e-05
-4.11388e-05
-4.1312e-05
-4.10959e-05
-4.04259e-05
-3.93196e-05
-3.7689e-05
-3.59242e-05
-3.33371e-05
-3.06217e-05
-2.72568e-05
-2.3636e-05
-1.96219e-05
-1.53004e-05
-1.07295e-05
-5.94482e-06
-1.03209e-06
3.95197e-06
8.94332e-06
1.38927e-05
1.87525e-05
2.34818e-05
2.80457e-05
3.24098e-05
3.65528e-05
4.04515e-05
4.40973e-05
4.74821e-05
5.06063e-05
5.347e-05
5.60807e-05
5.8441e-05
6.05613e-05
6.2447e-05
6.41081e-05
6.55522e-05
6.67894e-05
6.78289e-05
6.86803e-05
6.93528e-05
6.98554e-05
7.0197e-05
7.0386e-05
7.04299e-05
7.03364e-05
7.01124e-05
6.97642e-05
6.92978e-05
6.87185e-05
6.80315e-05
6.72411e-05
6.63517e-05
6.53667e-05
6.42899e-05
6.31238e-05
6.18716e-05
6.05355e-05
5.91179e-05
5.76208e-05
5.60461e-05
5.43953e-05
5.26703e-05
5.08722e-05
4.90027e-05
4.70629e-05
4.50542e-05
4.29774e-05
4.0834e-05
3.86241e-05
3.63485e-05
3.40068e-05
3.15991e-05
2.91241e-05
2.65808e-05
2.39673e-05
2.1282e-05
1.85239e-05
1.56929e-05
1.27917e-05
9.82552e-06
6.80397e-06
3.74009e-06
6.48969e-07
-2.45205e-06
-5.54455e-06
-8.61678e-06
-1.16509e-05
-1.46409e-05
-1.75675e-05
-2.04253e-05
-2.31942e-05
-2.58611e-05
-2.84058e-05
-3.0805e-05
-3.30361e-05
-3.50717e-05
-3.68828e-05
-3.84425e-05
-3.97095e-05
-4.06537e-05
-4.12451e-05
-4.14313e-05
-4.12244e-05
-4.05646e-05
-3.94662e-05
-3.7842e-05
-3.60795e-05
-3.35133e-05
-3.07958e-05
-2.7433e-05
-2.381e-05
-1.97913e-05
-1.54632e-05
-1.088e-05
-6.08104e-06
-1.15107e-06
3.85161e-06
8.8624e-06
1.38315e-05
1.87109e-05
2.34594e-05
2.80415e-05
3.24227e-05
3.6581e-05
4.04932e-05
4.41505e-05
4.75449e-05
5.0677e-05
5.35473e-05
5.61631e-05
5.85276e-05
6.06511e-05
6.25394e-05
6.42022e-05
6.56475e-05
6.68854e-05
6.79251e-05
6.87763e-05
6.94482e-05
6.99502e-05
7.02909e-05
7.04788e-05
7.05216e-05
7.0427e-05
7.02019e-05
6.98526e-05
6.93851e-05
6.88048e-05
6.81169e-05
6.73256e-05
6.64355e-05
6.54498e-05
6.43723e-05
6.32057e-05
6.1953e-05
6.06163e-05
5.91983e-05
5.77006e-05
5.61254e-05
5.4474e-05
5.27482e-05
5.09493e-05
4.90789e-05
4.71379e-05
4.51279e-05
4.30496e-05
4.09042e-05
3.86922e-05
3.64142e-05
3.40699e-05
3.16593e-05
2.91814e-05
2.66353e-05
2.40195e-05
2.13322e-05
1.85731e-05
1.57421e-05
1.28423e-05
9.87866e-06
6.86069e-06
3.8009e-06
7.13868e-07
-2.38374e-06
-5.47428e-06
-8.54607e-06
-1.15821e-05
-1.45758e-05
-1.75089e-05
-2.03749e-05
-2.31544e-05
-2.58336e-05
-2.83922e-05
-3.08067e-05
-3.30539e-05
-3.51062e-05
-3.69345e-05
-3.85113e-05
-3.97954e-05
-4.07557e-05
-4.13614e-05
-4.15615e-05
-4.13646e-05
-4.07155e-05
-3.96256e-05
-3.80084e-05
-3.62479e-05
-3.37044e-05
-3.09843e-05
-2.76237e-05
-2.3998e-05
-1.99742e-05
-1.56386e-05
-1.10421e-05
-6.2275e-06
-1.27873e-06
3.74423e-06
8.77617e-06
1.37666e-05
1.86674e-05
2.34368e-05
2.80388e-05
3.24386e-05
3.66133e-05
4.05402e-05
4.42099e-05
4.76147e-05
5.07554e-05
5.36328e-05
5.62542e-05
5.86232e-05
6.07502e-05
6.26411e-05
6.43057e-05
6.57522e-05
6.69906e-05
6.80303e-05
6.88812e-05
6.95525e-05
7.00535e-05
7.03931e-05
7.05798e-05
7.06213e-05
7.05253e-05
7.02988e-05
6.99482e-05
6.94795e-05
6.8898e-05
6.82089e-05
6.74166e-05
6.65255e-05
6.5539e-05
6.44606e-05
6.32932e-05
6.20398e-05
6.07026e-05
5.92839e-05
5.77855e-05
5.62096e-05
5.45575e-05
5.28309e-05
5.1031e-05
4.91595e-05
4.72173e-05
4.52057e-05
4.31257e-05
4.09784e-05
3.87641e-05
3.64835e-05
3.41365e-05
3.1723e-05
2.92422e-05
2.66932e-05
2.40747e-05
2.13855e-05
1.86253e-05
1.57943e-05
1.28956e-05
9.93446e-06
6.91989e-06
3.86399e-06
7.80822e-07
-2.31359e-06
-5.40238e-06
-8.47395e-06
-1.15121e-05
-1.451e-05
-1.74497e-05
-2.03245e-05
-2.31152e-05
-2.58075e-05
-2.83808e-05
-3.08114e-05
-3.30757e-05
-3.51458e-05
-3.69925e-05
-3.85874e-05
-3.98898e-05
-4.08674e-05
-4.14884e-05
-4.17034e-05
-4.15174e-05
-4.08796e-05
-3.97988e-05
-3.81893e-05
-3.64304e-05
-3.39117e-05
-3.11882e-05
-2.78298e-05
-2.42011e-05
-2.01715e-05
-1.58275e-05
-1.12165e-05
-6.38477e-06
-1.41553e-06
3.62949e-06
8.68446e-06
1.36983e-05
1.86222e-05
2.34143e-05
2.80378e-05
3.24577e-05
3.66504e-05
4.05931e-05
4.42762e-05
4.76924e-05
5.08424e-05
5.37274e-05
5.63547e-05
5.87286e-05
6.08592e-05
6.27528e-05
6.44193e-05
6.58669e-05
6.71058e-05
6.81454e-05
6.89958e-05
6.96662e-05
7.0166e-05
7.05043e-05
7.06894e-05
7.07293e-05
7.06318e-05
7.04037e-05
7.00514e-05
6.95812e-05
6.89983e-05
6.83078e-05
6.75143e-05
6.6622e-05
6.56343e-05
6.4555e-05
6.33867e-05
6.21324e-05
6.07943e-05
5.93748e-05
5.78757e-05
5.62989e-05
5.46459e-05
5.29183e-05
5.11174e-05
4.92446e-05
4.7301e-05
4.52878e-05
4.32059e-05
4.10565e-05
3.88398e-05
3.65566e-05
3.42067e-05
3.17901e-05
2.93062e-05
2.67543e-05
2.41332e-05
2.14419e-05
1.86804e-05
1.58493e-05
1.29517e-05
9.99281e-06
6.98143e-06
3.9292e-06
8.49649e-07
-2.24182e-06
-5.32908e-06
-8.40068e-06
-1.14413e-05
-1.44435e-05
-1.73905e-05
-2.02745e-05
-2.30769e-05
-2.5783e-05
-2.83719e-05
-3.08196e-05
-3.3102e-05
-3.51911e-05
-3.70573e-05
-3.86717e-05
-3.99936e-05
-4.09896e-05
-4.16271e-05
-4.18579e-05
-4.16836e-05
-4.10579e-05
-3.99866e-05
-3.83857e-05
-3.66279e-05
-3.41361e-05
-3.14086e-05
-2.80523e-05
-2.442e-05
-2.03842e-05
-1.60307e-05
-1.14038e-05
-6.5534e-06
-1.56187e-06
3.50718e-06
8.58721e-06
1.36264e-05
1.85755e-05
2.33922e-05
2.8039e-05
3.24807e-05
3.66928e-05
4.06527e-05
4.43503e-05
4.77788e-05
5.09387e-05
5.3832e-05
5.64657e-05
5.88447e-05
6.09791e-05
6.28756e-05
6.45439e-05
6.59925e-05
6.72317e-05
6.82711e-05
6.91207e-05
6.979e-05
7.02884e-05
7.0625e-05
7.08083e-05
7.08463e-05
7.07469e-05
7.05168e-05
7.01627e-05
6.96906e-05
6.9106e-05
6.84139e-05
6.76188e-05
6.67251e-05
6.57362e-05
6.46556e-05
6.34862e-05
6.22308e-05
6.08917e-05
5.94712e-05
5.79711e-05
5.63933e-05
5.47392e-05
5.30105e-05
5.12084e-05
4.93342e-05
4.7389e-05
4.53741e-05
4.32902e-05
4.11385e-05
3.89193e-05
3.66333e-05
3.42804e-05
3.18607e-05
2.93736e-05
2.68186e-05
2.41948e-05
2.15014e-05
1.87385e-05
1.59071e-05
1.30104e-05
1.00536e-05
7.04517e-06
3.99634e-06
9.20141e-07
-2.16864e-06
-5.25462e-06
-8.32653e-06
-1.13699e-05
-1.43768e-05
-1.73313e-05
-2.02251e-05
-2.30399e-05
-2.57606e-05
-2.83659e-05
-3.08317e-05
-3.31333e-05
-3.52426e-05
-3.71296e-05
-3.87647e-05
-4.01074e-05
-4.11232e-05
-4.17784e-05
-4.20259e-05
-4.18644e-05
-4.12513e-05
-4.01903e-05
-3.85987e-05
-3.68416e-05
-3.43787e-05
-3.16465e-05
-2.82924e-05
-2.46558e-05
-2.06131e-05
-1.62488e-05
-1.16048e-05
-6.73387e-06
-1.71806e-06
3.37714e-06
8.48442e-06
1.35511e-05
1.85276e-05
2.3371e-05
2.80432e-05
3.25085e-05
3.67415e-05
4.07199e-05
4.44332e-05
4.78748e-05
5.10456e-05
5.39476e-05
5.65881e-05
5.89725e-05
6.11109e-05
6.30103e-05
6.46804e-05
6.613e-05
6.73694e-05
6.84083e-05
6.92568e-05
6.99246e-05
7.04213e-05
7.07558e-05
7.0937e-05
7.09728e-05
7.08711e-05
7.06387e-05
7.02824e-05
6.98082e-05
6.92215e-05
6.85275e-05
6.77306e-05
6.68352e-05
6.58447e-05
6.47627e-05
6.35919e-05
6.23352e-05
6.09949e-05
5.95732e-05
5.80719e-05
5.64929e-05
5.48377e-05
5.31076e-05
5.13041e-05
4.94284e-05
4.74815e-05
4.54646e-05
4.33786e-05
4.12245e-05
3.90026e-05
3.67137e-05
3.43577e-05
3.19347e-05
2.94443e-05
2.68861e-05
2.42594e-05
2.15638e-05
1.87995e-05
1.59676e-05
1.30716e-05
1.01166e-05
7.11092e-06
4.06521e-06
9.92069e-07
-2.09433e-06
-5.17931e-06
-8.25182e-06
-1.12982e-05
-1.43102e-05
-1.72727e-05
-2.01768e-05
-2.30047e-05
-2.57407e-05
-2.83633e-05
-3.08482e-05
-3.31703e-05
-3.53009e-05
-3.72101e-05
-3.88672e-05
-4.0232e-05
-4.12689e-05
-4.1943e-05
-4.22085e-05
-4.20607e-05
-4.1461e-05
-4.04107e-05
-3.88294e-05
-3.70724e-05
-3.46407e-05
-3.1903e-05
-2.85509e-05
-2.49095e-05
-2.0859e-05
-1.64827e-05
-1.18199e-05
-6.9266e-06
-1.88435e-06
3.23932e-06
8.37624e-06
1.34729e-05
1.84791e-05
2.33514e-05
2.8051e-05
3.25417e-05
3.67975e-05
4.07958e-05
4.4526e-05
4.79817e-05
5.1164e-05
5.40754e-05
5.67231e-05
5.91132e-05
6.12557e-05
6.3158e-05
6.48299e-05
6.62802e-05
6.75195e-05
6.85577e-05
6.94048e-05
7.00709e-05
7.05654e-05
7.08976e-05
7.10762e-05
7.11093e-05
7.10049e-05
7.07699e-05
7.0411e-05
6.99342e-05
6.93452e-05
6.86489e-05
6.78499e-05
6.69525e-05
6.59602e-05
6.48764e-05
6.3704e-05
6.24458e-05
6.11041e-05
5.9681e-05
5.81783e-05
5.65979e-05
5.49413e-05
5.32098e-05
5.14047e-05
4.95272e-05
4.75785e-05
4.55595e-05
4.34712e-05
4.13145e-05
3.90898e-05
3.67978e-05
3.44385e-05
3.20121e-05
2.95183e-05
2.69568e-05
2.43271e-05
2.16291e-05
1.88631e-05
1.60307e-05
1.31352e-05
1.01818e-05
7.17849e-06
4.1356e-06
1.06518e-06
-2.01916e-06
-5.10343e-06
-8.17687e-06
-1.12265e-05
-1.42441e-05
-1.7215e-05
-2.013e-05
-2.29716e-05
-2.57238e-05
-2.83647e-05
-3.08698e-05
-3.32134e-05
-3.53667e-05
-3.72993e-05
-3.89799e-05
-4.03683e-05
-4.14276e-05
-4.21221e-05
-4.24065e-05
-4.22736e-05
-4.1688e-05
-4.06492e-05
-3.90788e-05
-3.73216e-05
-3.49231e-05
-3.21792e-05
-2.88289e-05
-2.51818e-05
-2.11228e-05
-1.67329e-05
-1.20498e-05
-7.13194e-06
-2.06089e-06
3.09374e-06
8.26288e-06
1.33921e-05
1.84305e-05
2.33341e-05
2.80633e-05
3.25815e-05
3.68617e-05
4.08815e-05
4.46298e-05
4.81007e-05
5.12953e-05
5.42165e-05
5.68719e-05
5.9268e-05
6.14147e-05
6.33199e-05
6.49933e-05
6.64443e-05
6.76832e-05
6.87203e-05
6.95657e-05
7.02295e-05
7.07215e-05
7.10508e-05
7.12264e-05
7.12564e-05
7.11489e-05
7.09108e-05
7.05488e-05
7.00692e-05
6.94774e-05
6.87785e-05
6.7977e-05
6.70773e-05
6.60828e-05
6.4997e-05
6.38227e-05
6.25628e-05
6.12193e-05
5.97946e-05
5.82904e-05
5.67084e-05
5.50502e-05
5.3317e-05
5.15101e-05
4.96308e-05
4.768e-05
4.56588e-05
4.3568e-05
4.14086e-05
3.91809e-05
3.68856e-05
3.45229e-05
3.2093e-05
2.95956e-05
2.70306e-05
2.43978e-05
2.16972e-05
1.89295e-05
1.60963e-05
1.32011e-05
1.02489e-05
7.2477e-06
4.20727e-06
1.13923e-06
-1.94341e-06
-5.02731e-06
-8.10203e-06
-1.11554e-05
-1.41789e-05
-1.71587e-05
-2.00851e-05
-2.29412e-05
-2.57103e-05
-2.83705e-05
-3.08969e-05
-3.32633e-05
-3.54406e-05
-3.73981e-05
-3.91038e-05
-4.05172e-05
-4.16004e-05
-4.23165e-05
-4.2621e-05
-4.25041e-05
-4.19334e-05
-4.09066e-05
-3.93482e-05
-3.75903e-05
-3.52271e-05
-3.2476e-05
-2.91275e-05
-2.54737e-05
-2.14053e-05
-1.70003e-05
-1.22949e-05
-7.35018e-06
-2.24779e-06
2.94053e-06
8.14467e-06
1.33092e-05
1.83825e-05
2.332e-05
2.80812e-05
3.26289e-05
3.69355e-05
4.09782e-05
4.4746e-05
4.8233e-05
5.14407e-05
5.43725e-05
5.70358e-05
5.9438e-05
6.15891e-05
6.34971e-05
6.5172e-05
6.66232e-05
6.78615e-05
6.8897e-05
6.97403e-05
7.04014e-05
7.08903e-05
7.12162e-05
7.13883e-05
7.14147e-05
7.13035e-05
7.10619e-05
7.06965e-05
7.02135e-05
6.96184e-05
6.89165e-05
6.81122e-05
6.72098e-05
6.62128e-05
6.51247e-05
6.39483e-05
6.26862e-05
6.13409e-05
5.99143e-05
5.84083e-05
5.68245e-05
5.51645e-05
5.34294e-05
5.16206e-05
4.97393e-05
4.77862e-05
4.57626e-05
4.36692e-05
4.15068e-05
3.92759e-05
3.69772e-05
3.46109e-05
3.21772e-05
2.96761e-05
2.71075e-05
2.44715e-05
2.17682e-05
1.89985e-05
1.61643e-05
1.3269e-05
1.03178e-05
7.31833e-06
4.27999e-06
1.21392e-06
-1.86739e-06
-4.95129e-06
-8.02766e-06
-1.1085e-05
-1.4115e-05
-1.71041e-05
-2.00427e-05
-2.29138e-05
-2.57008e-05
-2.83813e-05
-3.09302e-05
-3.33207e-05
-3.55234e-05
-3.75073e-05
-3.92395e-05
-4.06795e-05
-4.17882e-05
-4.25273e-05
-4.28532e-05
-4.27533e-05
-4.21984e-05
-4.11843e-05
-3.96386e-05
-3.78797e-05
-3.55537e-05
-3.27946e-05
-2.94475e-05
-2.57862e-05
-2.17072e-05
-1.72853e-05
-1.25556e-05
-7.58158e-06
-2.44507e-06
2.77986e-06
8.02201e-06
1.32248e-05
1.83359e-05
2.331e-05
2.81057e-05
3.26852e-05
3.702e-05
4.10874e-05
4.48759e-05
4.83802e-05
5.16017e-05
5.45445e-05
5.72162e-05
5.96247e-05
6.178e-05
6.36907e-05
6.53668e-05
6.68181e-05
6.80552e-05
6.90888e-05
6.99294e-05
7.05873e-05
7.10725e-05
7.13946e-05
7.15625e-05
7.15848e-05
7.14695e-05
7.12237e-05
7.08543e-05
7.03674e-05
6.97688e-05
6.90634e-05
6.82558e-05
6.73504e-05
6.63506e-05
6.52598e-05
6.40809e-05
6.28165e-05
6.14689e-05
6.00403e-05
5.85322e-05
5.69464e-05
5.52843e-05
5.35473e-05
5.17363e-05
4.98527e-05
4.78972e-05
4.5871e-05
4.37747e-05
4.16092e-05
3.9375e-05
3.70727e-05
3.47026e-05
3.2265e-05
2.976e-05
2.71876e-05
2.45481e-05
2.18418e-05
1.907e-05
1.62345e-05
1.33389e-05
1.03884e-05
7.39017e-06
4.35351e-06
1.28901e-06
-1.7914e-06
-4.87569e-06
-7.95411e-06
-1.10159e-05
-1.40527e-05
-1.70518e-05
-2.0003e-05
-2.28901e-05
-2.56958e-05
-2.83976e-05
-3.09702e-05
-3.33861e-05
-3.56158e-05
-3.76275e-05
-3.9388e-05
-4.08562e-05
-4.19919e-05
-4.27557e-05
-4.31042e-05
-4.30225e-05
-4.24841e-05
-4.14835e-05
-3.99512e-05
-3.81908e-05
-3.59041e-05
-3.31361e-05
-2.979e-05
-2.61201e-05
-2.20293e-05
-1.75886e-05
-1.28324e-05
-7.82633e-06
-2.65272e-06
2.61199e-06
7.89535e-06
1.31396e-05
1.82916e-05
2.33051e-05
2.81379e-05
3.27516e-05
3.71167e-05
4.12104e-05
4.5021e-05
4.85436e-05
5.17798e-05
5.47341e-05
5.74144e-05
5.98293e-05
6.19889e-05
6.39021e-05
6.55791e-05
6.70299e-05
6.82655e-05
6.92966e-05
7.01339e-05
7.0788e-05
7.1269e-05
7.15865e-05
7.17497e-05
7.17673e-05
7.16471e-05
7.13967e-05
7.10228e-05
7.05316e-05
6.99288e-05
6.92195e-05
6.84083e-05
6.74993e-05
6.64963e-05
6.54025e-05
6.42208e-05
6.29538e-05
6.16037e-05
6.01727e-05
5.86623e-05
5.70743e-05
5.541e-05
5.36706e-05
5.18573e-05
4.99712e-05
4.80131e-05
4.59841e-05
4.38847e-05
4.17159e-05
3.94782e-05
3.71721e-05
3.4798e-05
3.23563e-05
2.98471e-05
2.72708e-05
2.46276e-05
2.19182e-05
1.91439e-05
1.63068e-05
1.34106e-05
1.04603e-05
7.46303e-06
4.42761e-06
1.36421e-06
-1.71574e-06
-4.80083e-06
-7.88175e-06
-1.09484e-05
-1.39926e-05
-1.70021e-05
-1.99667e-05
-2.28704e-05
-2.56958e-05
-2.84201e-05
-3.10176e-05
-3.34604e-05
-3.57184e-05
-3.77597e-05
-3.95501e-05
-4.10482e-05
-4.22127e-05
-4.30026e-05
-4.3375e-05
-4.33129e-05
-4.27919e-05
-4.18053e-05
-4.02872e-05
-3.8525e-05
-3.62795e-05
-3.35016e-05
-3.01561e-05
-2.64764e-05
-2.23723e-05
-1.79108e-05
-1.31257e-05
-8.08463e-06
-2.87069e-06
2.43721e-06
7.76523e-06
1.30544e-05
1.82505e-05
2.33064e-05
2.81792e-05
3.28294e-05
3.7227e-05
4.13487e-05
4.51828e-05
4.87247e-05
5.19763e-05
5.49426e-05
5.76319e-05
6.00532e-05
6.2217e-05
6.41325e-05
6.581e-05
6.72599e-05
6.84934e-05
6.95213e-05
7.03548e-05
7.10044e-05
7.14804e-05
7.17927e-05
7.19506e-05
7.19627e-05
7.18372e-05
7.15814e-05
7.12024e-05
7.07063e-05
7.00988e-05
6.93851e-05
6.85698e-05
6.7657e-05
6.66503e-05
6.55532e-05
6.43683e-05
6.30984e-05
6.17455e-05
6.03118e-05
5.87989e-05
5.72084e-05
5.55416e-05
5.37997e-05
5.19839e-05
5.0095e-05
4.81341e-05
4.6102e-05
4.39994e-05
4.18271e-05
3.95855e-05
3.72755e-05
3.48972e-05
3.24512e-05
2.99376e-05
2.73571e-05
2.471e-05
2.19972e-05
1.92201e-05
1.63812e-05
1.34839e-05
1.05335e-05
7.53672e-06
4.50206e-06
1.43928e-06
-1.64069e-06
-4.72705e-06
-7.81092e-06
-1.08829e-05
-1.39349e-05
-1.69554e-05
-1.99341e-05
-2.28554e-05
-2.57014e-05
-2.84493e-05
-3.1073e-05
-3.35441e-05
-3.58321e-05
-3.79047e-05
-3.97267e-05
-4.12566e-05
-4.24515e-05
-4.32693e-05
-4.36669e-05
-4.36256e-05
-4.31228e-05
-4.2151e-05
-4.06479e-05
-3.88835e-05
-3.66812e-05
-3.38921e-05
-3.05467e-05
-2.68558e-05
-2.27372e-05
-1.82525e-05
-1.34359e-05
-8.35662e-06
-3.09889e-06
2.25583e-06
7.63221e-06
1.29698e-05
1.82135e-05
2.33152e-05
2.82307e-05
3.29201e-05
3.73522e-05
4.15038e-05
4.53628e-05
4.8925e-05
5.21927e-05
5.51715e-05
5.787e-05
6.02977e-05
6.24655e-05
6.43829e-05
6.60606e-05
6.75091e-05
6.87398e-05
6.9764e-05
7.05928e-05
7.12372e-05
7.17076e-05
7.20139e-05
7.21657e-05
7.21716e-05
7.204e-05
7.17784e-05
7.13936e-05
7.0892e-05
7.02793e-05
6.95607e-05
6.87408e-05
6.78236e-05
6.6813e-05
6.5712e-05
6.45237e-05
6.32504e-05
6.18945e-05
6.04579e-05
5.89422e-05
5.73489e-05
5.56794e-05
5.39347e-05
5.21161e-05
5.02243e-05
4.82604e-05
4.6225e-05
4.41189e-05
4.19428e-05
3.96973e-05
3.7383e-05
3.50002e-05
3.25497e-05
3.00316e-05
2.74466e-05
2.47953e-05
2.20788e-05
1.92987e-05
1.64575e-05
1.35589e-05
1.06078e-05
7.61104e-06
4.57664e-06
1.51398e-06
-1.56652e-06
-4.65464e-06
-7.74194e-06
-1.08198e-05
-1.38802e-05
-1.69123e-05
-1.99058e-05
-2.28454e-05
-2.57131e-05
-2.84858e-05
-3.1137e-05
-3.36379e-05
-3.59576e-05
-3.80631e-05
-3.99188e-05
-4.14823e-05
-4.27095e-05
-4.35568e-05
-4.39812e-05
-4.39619e-05
-4.34783e-05
-4.25219e-05
-4.10346e-05
-3.92675e-05
-3.71102e-05
-3.43089e-05
-3.0963e-05
-2.72595e-05
-2.31245e-05
-1.86143e-05
-1.37634e-05
-8.64249e-06
-3.33724e-06
2.06821e-06
7.49685e-06
1.28868e-05
1.81816e-05
2.33324e-05
2.82939e-05
3.3025e-05
3.7494e-05
4.16772e-05
4.55625e-05
4.91461e-05
5.24307e-05
5.54223e-05
5.81301e-05
6.05643e-05
6.27358e-05
6.46548e-05
6.6332e-05
6.77785e-05
6.90058e-05
7.00255e-05
7.08489e-05
7.14873e-05
7.19511e-05
7.22508e-05
7.23956e-05
7.23947e-05
7.22563e-05
7.1988e-05
7.15969e-05
7.10892e-05
7.04707e-05
6.97466e-05
6.89215e-05
6.79996e-05
6.69845e-05
6.58794e-05
6.46872e-05
6.34103e-05
6.2051e-05
6.06111e-05
5.90923e-05
5.7496e-05
5.58235e-05
5.40759e-05
5.22542e-05
5.03593e-05
4.8392e-05
4.63531e-05
4.42433e-05
4.20632e-05
3.98135e-05
3.74947e-05
3.51073e-05
3.26519e-05
3.0129e-05
2.75393e-05
2.48836e-05
2.21631e-05
1.93796e-05
1.65358e-05
1.36353e-05
1.06832e-05
7.68585e-06
4.65118e-06
1.58809e-06
-1.49348e-06
-4.58386e-06
-7.67512e-06
-1.07593e-05
-1.38286e-05
-1.6873e-05
-1.9882e-05
-2.28408e-05
-2.57312e-05
-2.85299e-05
-3.12101e-05
-3.37424e-05
-3.60956e-05
-3.8236e-05
-4.01272e-05
-4.17263e-05
-4.29877e-05
-4.38664e-05
-4.4319e-05
-4.43231e-05
-4.38596e-05
-4.29194e-05
-4.14484e-05
-3.96784e-05
-3.7568e-05
-3.47532e-05
-3.1406e-05
-2.76884e-05
-2.35353e-05
-1.89969e-05
-1.41085e-05
-8.9424e-06
-3.58566e-06
1.87468e-06
7.35977e-06
1.2806e-05
1.8156e-05
2.33594e-05
2.83699e-05
3.31456e-05
3.76537e-05
4.18705e-05
4.57835e-05
4.93895e-05
5.26916e-05
5.56965e-05
5.84137e-05
6.08541e-05
6.30291e-05
6.49492e-05
6.66254e-05
6.80691e-05
6.92923e-05
7.03066e-05
7.11239e-05
7.17553e-05
7.22119e-05
7.25039e-05
7.26411e-05
7.26325e-05
7.24865e-05
7.22109e-05
7.18126e-05
7.12982e-05
7.06733e-05
6.99432e-05
6.91125e-05
6.81853e-05
6.71653e-05
6.60556e-05
6.48591e-05
6.35783e-05
6.22152e-05
6.07718e-05
5.92496e-05
5.765e-05
5.59743e-05
5.42234e-05
5.23984e-05
5.05001e-05
4.85293e-05
4.64867e-05
4.43729e-05
4.21886e-05
3.99343e-05
3.76108e-05
3.52185e-05
3.2758e-05
3.023e-05
2.76353e-05
2.49748e-05
2.225e-05
1.94627e-05
1.66159e-05
1.37131e-05
1.07594e-05
7.76102e-06
4.72551e-06
1.66141e-06
-1.42179e-06
-4.51498e-06
-7.61073e-06
-1.07017e-05
-1.37807e-05
-1.68379e-05
-1.98632e-05
-2.28421e-05
-2.57564e-05
-2.85824e-05
-3.1293e-05
-3.38584e-05
-3.62467e-05
-3.8424e-05
-4.03528e-05
-4.19896e-05
-4.32872e-05
-4.41992e-05
-4.46817e-05
-4.47106e-05
-4.42681e-05
-4.33448e-05
-4.18909e-05
-4.01175e-05
-3.80558e-05
-3.52263e-05
-3.1877e-05
-2.81436e-05
-2.39703e-05
-1.9401e-05
-1.44718e-05
-9.25655e-06
-3.84408e-06
1.67559e-06
7.22155e-06
1.27285e-05
1.81375e-05
2.33973e-05
2.84602e-05
3.32834e-05
3.7833e-05
4.20851e-05
4.60273e-05
4.96567e-05
5.2977e-05
5.59954e-05
5.87221e-05
6.11686e-05
6.33466e-05
6.52673e-05
6.69418e-05
6.83821e-05
6.96003e-05
7.06084e-05
7.14185e-05
7.20422e-05
7.24905e-05
7.2774e-05
7.29026e-05
7.28854e-05
7.27311e-05
7.24473e-05
7.20413e-05
7.15194e-05
7.08875e-05
7.01508e-05
6.93139e-05
6.8381e-05
6.73556e-05
6.62409e-05
6.50398e-05
6.37546e-05
6.23875e-05
6.09402e-05
5.94143e-05
5.78112e-05
5.61319e-05
5.43776e-05
5.2549e-05
5.06471e-05
4.86724e-05
4.66258e-05
4.45078e-05
4.2319e-05
4.006e-05
3.77314e-05
3.53339e-05
3.28681e-05
3.03347e-05
2.77346e-05
2.5069e-05
2.23395e-05
1.95482e-05
1.66978e-05
1.37923e-05
1.08364e-05
7.83642e-06
4.79949e-06
1.73379e-06
-1.35162e-06
-4.44818e-06
-7.54898e-06
-1.06474e-05
-1.37365e-05
-1.68073e-05
-1.98497e-05
-2.28497e-05
-2.57889e-05
-2.86435e-05
-3.13861e-05
-3.39863e-05
-3.64118e-05
-3.8628e-05
-4.05966e-05
-4.22731e-05
-4.36092e-05
-4.45565e-05
-4.50705e-05
-4.51257e-05
-4.47052e-05
-4.37996e-05
-4.23633e-05
-4.05862e-05
-3.85751e-05
-3.57293e-05
-3.2377e-05
-2.8626e-05
-2.44305e-05
-1.98272e-05
-1.48538e-05
-9.58518e-06
-4.11245e-06
1.47126e-06
7.08279e-06
1.26549e-05
1.81273e-05
2.34473e-05
2.85661e-05
3.34396e-05
3.80333e-05
4.23227e-05
4.62955e-05
4.99493e-05
5.32883e-05
5.63205e-05
5.90567e-05
6.1509e-05
6.36897e-05
6.56102e-05
6.72824e-05
6.87184e-05
6.99306e-05
7.09316e-05
7.17336e-05
7.23485e-05
7.27875e-05
7.30616e-05
7.31807e-05
7.31541e-05
7.29906e-05
7.26979e-05
7.22833e-05
7.17533e-05
7.11137e-05
7.03698e-05
6.95262e-05
6.85869e-05
6.75557e-05
6.64356e-05
6.52295e-05
6.39396e-05
6.2568e-05
6.11166e-05
5.95867e-05
5.79797e-05
5.62966e-05
5.45385e-05
5.27062e-05
5.08003e-05
4.88216e-05
4.67707e-05
4.46482e-05
4.24547e-05
4.01907e-05
3.78568e-05
3.54538e-05
3.29823e-05
3.04431e-05
2.78374e-05
2.51664e-05
2.24318e-05
1.96359e-05
1.67816e-05
1.38727e-05
1.09142e-05
7.91198e-06
4.87301e-06
1.8051e-06
-1.28313e-06
-4.38365e-06
-7.49009e-06
-1.05965e-05
-1.36964e-05
-1.67814e-05
-1.98418e-05
-2.28638e-05
-2.5829e-05
-2.87137e-05
-3.14898e-05
-3.41266e-05
-3.65913e-05
-3.88485e-05
-4.08593e-05
-4.2578e-05
-4.39548e-05
-4.49394e-05
-4.54867e-05
-4.55697e-05
-4.51723e-05
-4.42851e-05
-4.28671e-05
-4.10859e-05
-3.91271e-05
-3.62638e-05
-3.29074e-05
-2.9137e-05
-2.49168e-05
-2.02764e-05
-1.5255e-05
-9.92857e-06
-4.39076e-06
1.26199e-06
6.94406e-06
1.25862e-05
1.81264e-05
2.35108e-05
2.8689e-05
3.36159e-05
3.8256e-05
4.25847e-05
4.65895e-05
5.02686e-05
5.3627e-05
5.66732e-05
5.94188e-05
6.18765e-05
6.40593e-05
6.59791e-05
6.76481e-05
6.90788e-05
7.02842e-05
7.1277e-05
7.20698e-05
7.26749e-05
7.31037e-05
7.33673e-05
7.34759e-05
7.3439e-05
7.32653e-05
7.29629e-05
7.2539e-05
7.20002e-05
7.13523e-05
7.06005e-05
6.97495e-05
6.88035e-05
6.77659e-05
6.664e-05
6.54284e-05
6.41334e-05
6.27571e-05
6.13011e-05
5.97669e-05
5.81558e-05
5.64687e-05
5.47066e-05
5.28701e-05
5.09601e-05
4.89771e-05
4.69217e-05
4.47944e-05
4.25958e-05
4.03265e-05
3.79871e-05
3.55782e-05
3.31007e-05
3.05556e-05
2.79438e-05
2.5267e-05
2.25269e-05
1.97259e-05
1.68672e-05
1.39545e-05
1.09927e-05
7.98764e-06
4.946e-06
1.87524e-06
-1.21643e-06
-4.3215e-06
-7.43417e-06
-1.05492e-05
-1.36605e-05
-1.67604e-05
-1.98396e-05
-2.28846e-05
-2.58772e-05
-2.87932e-05
-3.16046e-05
-3.42799e-05
-3.67858e-05
-3.90864e-05
-4.11417e-05
-4.2905e-05
-4.43249e-05
-4.53492e-05
-4.59317e-05
-4.60441e-05
-4.56709e-05
-4.48029e-05
-4.34037e-05
-4.16182e-05
-3.97136e-05
-3.68311e-05
-3.34695e-05
-2.96776e-05
-2.54303e-05
-2.07494e-05
-1.56759e-05
-1.0287e-05
-4.67902e-06
1.04808e-06
6.80593e-06
1.2523e-05
1.81359e-05
2.35888e-05
2.88302e-05
3.38137e-05
3.85028e-05
4.28726e-05
4.69109e-05
5.06163e-05
5.39944e-05
5.70548e-05
5.98096e-05
6.22724e-05
6.44567e-05
6.6375e-05
6.80399e-05
6.94644e-05
7.06618e-05
7.16453e-05
7.24279e-05
7.3022e-05
7.34395e-05
7.36916e-05
7.37887e-05
7.37405e-05
7.35558e-05
7.32428e-05
7.28088e-05
7.22603e-05
7.16034e-05
7.08432e-05
6.99843e-05
6.90309e-05
6.79865e-05
6.68543e-05
6.56368e-05
6.43363e-05
6.29549e-05
6.14941e-05
5.99553e-05
5.83397e-05
5.66483e-05
5.48819e-05
5.30411e-05
5.11267e-05
4.91391e-05
4.70789e-05
4.49465e-05
4.27426e-05
4.04677e-05
3.81224e-05
3.57075e-05
3.32237e-05
3.06721e-05
2.8054e-05
2.53709e-05
2.26248e-05
1.98184e-05
1.69546e-05
1.40375e-05
1.10719e-05
8.06337e-06
5.01842e-06
1.94416e-06
-1.15159e-06
-4.26183e-06
-7.38132e-06
-1.05055e-05
-1.3629e-05
-1.67445e-05
-1.98433e-05
-2.29124e-05
-2.59334e-05
-2.88824e-05
-3.17307e-05
-3.44465e-05
-3.69959e-05
-3.93422e-05
-4.14446e-05
-4.32552e-05
-4.47207e-05
-4.5787e-05
-4.64067e-05
-4.65502e-05
-4.62024e-05
-4.53545e-05
-4.39748e-05
-4.21846e-05
-4.03359e-05
-3.74327e-05
-3.40648e-05
-3.02491e-05
-2.59722e-05
-2.12472e-05
-1.61174e-05
-1.06609e-05
-4.97729e-06
8.29762e-07
6.66894e-06
1.24664e-05
1.81567e-05
2.36826e-05
2.8991e-05
3.40343e-05
3.87751e-05
4.31881e-05
4.72612e-05
5.09937e-05
5.43921e-05
5.74667e-05
6.02305e-05
6.26979e-05
6.4883e-05
6.67989e-05
6.84587e-05
6.98759e-05
7.10642e-05
7.20373e-05
7.28085e-05
7.33905e-05
7.37955e-05
7.4035e-05
7.41195e-05
7.4059e-05
7.38623e-05
7.35378e-05
7.30929e-05
7.25341e-05
7.18674e-05
7.1098e-05
7.02307e-05
6.92694e-05
6.82177e-05
6.70787e-05
6.58549e-05
6.45486e-05
6.31617e-05
6.16957e-05
6.01521e-05
5.85317e-05
5.68357e-05
5.50647e-05
5.32193e-05
5.13002e-05
4.93078e-05
4.72425e-05
4.51049e-05
4.28954e-05
4.06146e-05
3.82631e-05
3.58416e-05
3.33512e-05
3.07928e-05
2.81679e-05
2.54782e-05
2.27258e-05
1.99133e-05
1.7044e-05
1.41219e-05
1.11518e-05
8.13917e-06
5.09024e-06
2.01182e-06
-1.08864e-06
-4.20466e-06
-7.33159e-06
-1.04656e-05
-1.36018e-05
-1.67337e-05
-1.98529e-05
-2.29471e-05
-2.59979e-05
-2.89812e-05
-3.18683e-05
-3.46266e-05
-3.72218e-05
-3.96164e-05
-4.17686e-05
-4.36292e-05
-4.51432e-05
-4.62541e-05
-4.69132e-05
-4.70895e-05
-4.67684e-05
-4.59415e-05
-4.45818e-05
-4.27867e-05
-4.09958e-05
-3.80702e-05
-3.46945e-05
-3.0853e-05
-2.65435e-05
-2.17706e-05
-1.658e-05
-1.10507e-05
-5.28566e-06
6.07286e-07
6.53364e-06
1.2417e-05
1.81899e-05
2.37934e-05
2.91729e-05
3.42793e-05
3.90743e-05
4.35325e-05
4.76418e-05
5.14023e-05
5.48213e-05
5.79101e-05
6.06826e-05
6.3154e-05
6.53391e-05
6.72517e-05
6.89053e-05
7.03141e-05
7.14922e-05
7.24536e-05
7.32121e-05
7.37808e-05
7.41721e-05
7.43978e-05
7.44687e-05
7.43948e-05
7.41852e-05
7.38483e-05
7.33915e-05
7.28216e-05
7.21444e-05
7.13653e-05
7.04889e-05
6.95192e-05
6.84597e-05
6.73134e-05
6.60829e-05
6.47704e-05
6.33776e-05
6.19062e-05
6.03573e-05
5.8732e-05
5.70311e-05
5.52552e-05
5.3405e-05
5.14809e-05
4.94834e-05
4.74128e-05
4.52696e-05
4.30542e-05
4.07672e-05
3.84092e-05
3.5981e-05
3.34835e-05
3.0918e-05
2.82859e-05
2.55891e-05
2.28298e-05
2.00108e-05
1.71354e-05
1.42077e-05
1.12325e-05
8.21505e-06
5.16148e-06
2.07825e-06
-1.02758e-06
-4.15e-06
-7.28497e-06
-1.04294e-05
-1.35789e-05
-1.6728e-05
-1.98685e-05
-2.29888e-05
-2.60706e-05
-2.90899e-05
-3.20176e-05
-3.48206e-05
-3.74639e-05
-3.99095e-05
-4.21143e-05
-4.4028e-05
-4.55933e-05
-4.67514e-05
-4.74523e-05
-4.76635e-05
-4.73704e-05
-4.65654e-05
-4.52264e-05
-4.3426e-05
-4.16948e-05
-3.87452e-05
-3.53604e-05
-3.14907e-05
-2.71456e-05
-2.23209e-05
-1.70645e-05
-1.14567e-05
-5.60426e-06
3.80868e-07
6.40056e-06
1.23756e-05
1.82365e-05
2.39224e-05
2.93771e-05
3.45501e-05
3.9402e-05
4.39073e-05
4.80541e-05
5.18435e-05
5.52834e-05
5.83863e-05
6.1167e-05
6.36418e-05
6.58261e-05
6.77343e-05
6.93807e-05
7.07797e-05
7.19462e-05
7.28947e-05
7.36392e-05
7.41932e-05
7.45697e-05
7.47804e-05
7.48365e-05
7.47481e-05
7.45247e-05
7.41744e-05
7.3705e-05
7.31231e-05
7.24348e-05
7.16452e-05
7.07591e-05
6.97804e-05
6.87125e-05
6.75586e-05
6.6321e-05
6.50018e-05
6.36029e-05
6.21256e-05
6.05712e-05
5.89406e-05
5.72346e-05
5.54536e-05
5.35983e-05
5.1669e-05
4.96661e-05
4.75899e-05
4.54409e-05
4.32193e-05
4.09258e-05
3.8561e-05
3.61257e-05
3.36208e-05
3.10478e-05
2.84081e-05
2.57037e-05
2.2937e-05
2.01109e-05
1.72289e-05
1.4295e-05
1.1314e-05
8.29107e-06
5.23217e-06
2.14346e-06
-9.68368e-07
-4.09781e-06
-7.24141e-06
-1.03968e-05
-1.35604e-05
-1.67272e-05
-1.98899e-05
-2.30373e-05
-2.61515e-05
-2.92084e-05
-3.21785e-05
-3.50284e-05
-3.77225e-05
-4.02219e-05
-4.24824e-05
-4.44521e-05
-4.60719e-05
-4.72802e-05
-4.80253e-05
-4.82734e-05
-4.80098e-05
-4.72279e-05
-4.59102e-05
-4.41042e-05
-4.24347e-05
-3.94593e-05
-3.60639e-05
-3.21635e-05
-2.77798e-05
-2.2899e-05
-1.75718e-05
-1.18796e-05
-5.93321e-06
1.50715e-07
6.27023e-06
1.23432e-05
1.82977e-05
2.4071e-05
2.96051e-05
3.4848e-05
3.97597e-05
4.4314e-05
4.84997e-05
5.23185e-05
5.57796e-05
5.88965e-05
6.1685e-05
6.41623e-05
6.63448e-05
6.82476e-05
6.98853e-05
7.12734e-05
7.24269e-05
7.3361e-05
7.40902e-05
7.46283e-05
7.49885e-05
7.5183e-05
7.52231e-05
7.51193e-05
7.48808e-05
7.45163e-05
7.40333e-05
7.34387e-05
7.27384e-05
7.19377e-05
7.10413e-05
7.0053e-05
6.89764e-05
6.78143e-05
6.65691e-05
6.5243e-05
6.38376e-05
6.23542e-05
6.0794e-05
5.91578e-05
5.74463e-05
5.566e-05
5.37994e-05
5.18646e-05
4.98561e-05
4.77741e-05
4.56189e-05
4.3391e-05
4.10907e-05
3.87187e-05
3.62759e-05
3.37633e-05
3.11823e-05
2.85345e-05
2.58221e-05
2.30475e-05
2.02138e-05
1.73245e-05
1.43838e-05
1.13963e-05
8.36726e-06
5.30237e-06
2.20752e-06
-9.10944e-07
-4.04799e-06
-7.2008e-06
-1.03678e-05
-1.3546e-05
-1.67313e-05
-1.9917e-05
-2.30926e-05
-2.62404e-05
-2.93364e-05
-3.23509e-05
-3.525e-05
-3.79975e-05
-4.05536e-05
-4.2873e-05
-4.49023e-05
-4.65798e-05
-4.78415e-05
-4.86335e-05
-4.89207e-05
-4.86881e-05
-4.79305e-05
-4.66348e-05
-4.48231e-05
-4.32173e-05
-4.02142e-05
-3.68068e-05
-3.28732e-05
-2.84474e-05
-2.35062e-05
-1.81028e-05
-1.23198e-05
-6.27268e-06
-8.29625e-08
6.1432e-06
1.23204e-05
1.83744e-05
2.42402e-05
2.98582e-05
3.51747e-05
4.01487e-05
4.4754e-05
4.89798e-05
5.28288e-05
5.63112e-05
5.94418e-05
6.22374e-05
6.47164e-05
6.6896e-05
6.87921e-05
7.042e-05
7.17956e-05
7.29348e-05
7.3853e-05
7.45654e-05
7.50861e-05
7.54288e-05
7.56058e-05
7.56287e-05
7.55082e-05
7.52537e-05
7.48739e-05
7.43765e-05
7.37683e-05
7.30554e-05
7.22429e-05
7.13356e-05
7.03372e-05
6.92512e-05
6.80805e-05
6.68275e-05
6.5494e-05
6.40817e-05
6.25919e-05
6.10256e-05
5.93836e-05
5.76665e-05
5.58746e-05
5.40084e-05
5.20679e-05
5.00536e-05
4.79655e-05
4.58039e-05
4.35692e-05
4.12618e-05
3.88824e-05
3.64318e-05
3.39111e-05
3.13217e-05
2.86654e-05
2.59445e-05
2.31615e-05
2.03195e-05
1.74224e-05
1.44741e-05
1.14796e-05
8.4437e-06
5.37214e-06
2.2705e-06
-8.55214e-07
-4.00045e-06
-7.16302e-06
-1.03421e-05
-1.35355e-05
-1.67399e-05
-1.99495e-05
-2.31542e-05
-2.63369e-05
-2.94737e-05
-3.25347e-05
-3.54853e-05
-3.82889e-05
-4.09049e-05
-4.32866e-05
-4.53789e-05
-4.71178e-05
-4.84362e-05
-4.9278e-05
-4.96067e-05
-4.9407e-05
-4.86748e-05
-4.7402e-05
-4.55844e-05
-4.40444e-05
-4.10117e-05
-3.75907e-05
-3.36212e-05
-2.915e-05
-2.41436e-05
-1.86583e-05
-1.2778e-05
-6.62283e-06
-3.19949e-07
6.02003e-06
1.23083e-05
1.84678e-05
2.44315e-05
3.01378e-05
3.55314e-05
4.05706e-05
4.52288e-05
4.94959e-05
5.33755e-05
5.68793e-05
6.00232e-05
6.28253e-05
6.5305e-05
6.74806e-05
6.93685e-05
7.09851e-05
7.23468e-05
7.347e-05
7.43709e-05
7.5065e-05
7.55669e-05
7.58906e-05
7.60488e-05
7.60533e-05
7.5915e-05
7.56434e-05
7.52474e-05
7.47346e-05
7.4112e-05
7.33857e-05
7.25607e-05
7.16418e-05
7.06328e-05
6.95371e-05
6.83573e-05
6.70959e-05
6.57547e-05
6.43353e-05
6.28388e-05
6.12662e-05
5.96181e-05
5.78951e-05
5.60974e-05
5.42253e-05
5.2279e-05
5.02586e-05
4.81642e-05
4.5996e-05
4.37543e-05
4.14395e-05
3.90523e-05
3.65935e-05
3.40643e-05
3.14662e-05
2.88009e-05
2.60709e-05
2.3279e-05
2.04282e-05
1.75226e-05
1.45662e-05
1.15638e-05
8.52046e-06
5.44156e-06
2.33249e-06
-8.01067e-07
-3.95504e-06
-7.12788e-06
-1.03196e-05
-1.35287e-05
-1.67529e-05
-1.9987e-05
-2.32219e-05
-2.64408e-05
-2.962e-05
-3.27294e-05
-3.5734e-05
-3.85966e-05
-4.12757e-05
-4.37233e-05
-4.58825e-05
-4.76864e-05
-4.90652e-05
-4.99599e-05
-5.03327e-05
-5.01678e-05
-4.94625e-05
-4.82134e-05
-4.63897e-05
-4.49177e-05
-4.18537e-05
-3.84174e-05
-3.44093e-05
-2.9889e-05
-2.48126e-05
-1.92393e-05
-1.32545e-05
-6.98383e-06
-5.60006e-07
5.90134e-06
1.23077e-05
1.85791e-05
2.46462e-05
3.04453e-05
3.59197e-05
4.10267e-05
4.57397e-05
5.00491e-05
5.39599e-05
5.7485e-05
6.06417e-05
6.34494e-05
6.59288e-05
6.80989e-05
6.99774e-05
7.15811e-05
7.29272e-05
7.40329e-05
7.49149e-05
7.5589e-05
7.60707e-05
7.63739e-05
7.6512e-05
7.64968e-05
7.63394e-05
7.60497e-05
7.56364e-05
7.51074e-05
7.44696e-05
7.37291e-05
7.2891e-05
7.196e-05
7.09398e-05
6.98338e-05
6.86446e-05
6.73745e-05
6.60252e-05
6.45983e-05
6.30949e-05
6.15156e-05
5.98612e-05
5.81321e-05
5.63284e-05
5.44503e-05
5.24979e-05
5.04712e-05
4.83703e-05
4.61952e-05
4.39463e-05
4.16239e-05
3.92286e-05
3.67613e-05
3.42232e-05
3.16158e-05
2.89412e-05
2.62016e-05
2.34001e-05
2.054e-05
1.76251e-05
1.46599e-05
1.16491e-05
8.5976e-06
5.51071e-06
2.39359e-06
-7.48382e-07
-3.91161e-06
-7.09521e-06
-1.02999e-05
-1.35253e-05
-1.67698e-05
-2.00292e-05
-2.32952e-05
-2.65515e-05
-2.97746e-05
-3.29345e-05
-3.59957e-05
-3.89203e-05
-4.16658e-05
-4.41831e-05
-4.64131e-05
-4.82864e-05
-4.97293e-05
-5.06804e-05
-5.11001e-05
-5.09721e-05
-5.02951e-05
-4.90708e-05
-4.7241e-05
-4.58392e-05
-4.27419e-05
-3.92887e-05
-3.52392e-05
-3.06659e-05
-2.55144e-05
-1.98468e-05
-1.37501e-05
-7.35581e-06
-8.02864e-07
5.78775e-06
1.23195e-05
1.87094e-05
2.48855e-05
3.07822e-05
3.63411e-05
4.15186e-05
4.62882e-05
5.06409e-05
5.45832e-05
5.81293e-05
6.12982e-05
6.41105e-05
6.65883e-05
6.87516e-05
7.06191e-05
7.22082e-05
7.35371e-05
7.46235e-05
7.54849e-05
7.61375e-05
7.65973e-05
7.68786e-05
7.69951e-05
7.69589e-05
7.67813e-05
7.64723e-05
7.60408e-05
7.54946e-05
7.48408e-05
7.40854e-05
7.32335e-05
7.22898e-05
7.12579e-05
7.01412e-05
6.89421e-05
6.76629e-05
6.63053e-05
6.48707e-05
6.336e-05
6.17739e-05
6.0113e-05
5.83776e-05
5.65677e-05
5.46834e-05
5.27247e-05
5.06916e-05
4.85839e-05
4.64017e-05
4.41453e-05
4.1815e-05
3.94113e-05
3.69351e-05
3.43878e-05
3.17708e-05
2.90862e-05
2.63366e-05
2.3525e-05
2.06548e-05
1.77302e-05
1.47555e-05
1.17355e-05
8.67518e-06
5.57965e-06
2.4539e-06
-6.97027e-07
-3.86998e-06
-7.06476e-06
-1.0283e-05
-1.3525e-05
-1.67903e-05
-2.00756e-05
-2.33734e-05
-2.66684e-05
-2.99371e-05
-3.31495e-05
-3.62698e-05
-3.92594e-05
-4.2075e-05
-4.46659e-05
-4.69711e-05
-4.89179e-05
-5.04292e-05
-5.14404e-05
-5.19101e-05
-5.18211e-05
-5.11742e-05
-4.99758e-05
-4.814e-05
-4.68108e-05
-4.36781e-05
-4.02064e-05
-3.61125e-05
-3.14824e-05
-2.62503e-05
-2.04817e-05
-1.42653e-05
-7.73889e-06
-1.04821e-06
5.67996e-06
1.23448e-05
1.88599e-05
2.51509e-05
3.11499e-05
3.6797e-05
4.20476e-05
4.68754e-05
5.12724e-05
5.52464e-05
5.88132e-05
6.19934e-05
6.48093e-05
6.72841e-05
6.94391e-05
7.12937e-05
7.28666e-05
7.41765e-05
7.52419e-05
7.60807e-05
7.67102e-05
7.71464e-05
7.74044e-05
7.74978e-05
7.74394e-05
7.72403e-05
7.69109e-05
7.64601e-05
7.58959e-05
7.52253e-05
7.44542e-05
7.3588e-05
7.26309e-05
7.15869e-05
7.04589e-05
6.92496e-05
6.7961e-05
6.65948e-05
6.51521e-05
6.36339e-05
6.20409e-05
6.03733e-05
5.86313e-05
5.68151e-05
5.49245e-05
5.29593e-05
5.09195e-05
4.88049e-05
4.66155e-05
4.43514e-05
4.20129e-05
3.96005e-05
3.71152e-05
3.45581e-05
3.19311e-05
2.92361e-05
2.64759e-05
2.36536e-05
2.07728e-05
1.78378e-05
1.48529e-05
1.18231e-05
8.75325e-06
5.64847e-06
2.5135e-06
-6.46875e-07
-3.82999e-06
-7.03631e-06
-1.02683e-05
-1.35273e-05
-1.68138e-05
-2.01255e-05
-2.34561e-05
-2.67908e-05
-3.01067e-05
-3.33736e-05
-3.65556e-05
-3.96133e-05
-4.25027e-05
-4.51715e-05
-4.75563e-05
-4.95814e-05
-5.11655e-05
-5.22407e-05
-5.27636e-05
-5.27163e-05
-5.21014e-05
-5.09301e-05
-4.90884e-05
-4.78342e-05
-4.46643e-05
-4.11724e-05
-3.70311e-05
-3.23399e-05
-2.70218e-05
-2.1145e-05
-1.48006e-05
-8.13314e-06
-1.29567e-06
5.57873e-06
1.23846e-05
1.9032e-05
2.54437e-05
3.15499e-05
3.72888e-05
4.26151e-05
4.75028e-05
5.19447e-05
5.59504e-05
5.95375e-05
6.27281e-05
6.55462e-05
6.80165e-05
7.01615e-05
7.20015e-05
7.35562e-05
7.48451e-05
7.58876e-05
7.67022e-05
7.73067e-05
7.77178e-05
7.79507e-05
7.80197e-05
7.79376e-05
7.77159e-05
7.7365e-05
7.6894e-05
7.63108e-05
7.56225e-05
7.48352e-05
7.39539e-05
7.2983e-05
7.19263e-05
7.07867e-05
6.95668e-05
6.82685e-05
6.68933e-05
6.54424e-05
6.39166e-05
6.23163e-05
6.06418e-05
5.88933e-05
5.70706e-05
5.51735e-05
5.32017e-05
5.11551e-05
4.90335e-05
4.68366e-05
4.45645e-05
4.22176e-05
3.97962e-05
3.73014e-05
3.47344e-05
3.20968e-05
2.9391e-05
2.66196e-05
2.37861e-05
2.0894e-05
1.79479e-05
1.49521e-05
1.19118e-05
8.83184e-06
5.7172e-06
2.57249e-06
-5.97805e-07
-3.79145e-06
-7.00961e-06
-1.02557e-05
-1.35319e-05
-1.68399e-05
-2.01785e-05
-2.35425e-05
-2.6918e-05
-3.02824e-05
-3.3606e-05
-3.68522e-05
-3.99813e-05
-4.29483e-05
-4.56993e-05
-4.81686e-05
-5.02769e-05
-5.19386e-05
-5.30822e-05
-5.36619e-05
-5.3659e-05
-5.3078e-05
-5.19354e-05
-5.0088e-05
-4.89113e-05
-4.57022e-05
-4.21886e-05
-3.79967e-05
-3.32402e-05
-2.783e-05
-2.18377e-05
-1.53566e-05
-8.53859e-06
-1.5448e-06
5.4849e-06
1.244e-05
1.92269e-05
2.57656e-05
3.19837e-05
3.78179e-05
4.32225e-05
4.81714e-05
5.26589e-05
5.66961e-05
6.03027e-05
6.35027e-05
6.63217e-05
6.87857e-05
7.09188e-05
7.27423e-05
7.42768e-05
7.55428e-05
7.65604e-05
7.73489e-05
7.79266e-05
7.83108e-05
7.85171e-05
7.85602e-05
7.84531e-05
7.82075e-05
7.7834e-05
7.73417e-05
7.67387e-05
7.6032e-05
7.52277e-05
7.43307e-05
7.33455e-05
7.22756e-05
7.11241e-05
6.98932e-05
6.85849e-05
6.72006e-05
6.57412e-05
6.42075e-05
6.25999e-05
6.09185e-05
5.91632e-05
5.73338e-05
5.54301e-05
5.34517e-05
5.13982e-05
4.92693e-05
4.70648e-05
4.47847e-05
4.24291e-05
3.99985e-05
3.74939e-05
3.49164e-05
3.2268e-05
2.95508e-05
2.67678e-05
2.39224e-05
2.10184e-05
1.80605e-05
1.50532e-05
1.20017e-05
8.91095e-06
5.78587e-06
2.6309e-06
-5.49711e-07
-3.7542e-06
-6.98443e-06
-1.02447e-05
-1.35383e-05
-1.6868e-05
-2.02339e-05
-2.36319e-05
-2.7049e-05
-3.04634e-05
-3.38455e-05
-3.71586e-05
-4.03624e-05
-4.34109e-05
-4.62488e-05
-4.88077e-05
-5.10045e-05
-5.27489e-05
-5.39654e-05
-5.46058e-05
-5.46504e-05
-5.41056e-05
-5.29932e-05
-5.11405e-05
-5.0044e-05
-4.67938e-05
-4.32566e-05
-3.9011e-05
-3.41848e-05
-2.86763e-05
-2.25606e-05
-1.59336e-05
-8.95518e-06
-1.79508e-06
5.39939e-06
1.25123e-05
1.94462e-05
2.61178e-05
3.24528e-05
3.8386e-05
4.3871e-05
4.88824e-05
5.34159e-05
5.74844e-05
6.11096e-05
6.43176e-05
6.71357e-05
6.95918e-05
7.1711e-05
7.35159e-05
7.50281e-05
7.62691e-05
7.72597e-05
7.802e-05
7.85691e-05
7.89246e-05
7.91027e-05
7.91184e-05
7.89849e-05
7.87143e-05
7.83171e-05
7.78026e-05
7.71789e-05
7.6453e-05
7.5631e-05
7.47178e-05
7.37178e-05
7.26344e-05
7.14705e-05
7.02284e-05
6.89098e-05
6.75161e-05
6.60481e-05
6.45065e-05
6.28913e-05
6.12028e-05
5.94407e-05
5.76047e-05
5.56943e-05
5.37091e-05
5.16487e-05
4.95124e-05
4.73002e-05
4.50118e-05
4.26474e-05
4.02073e-05
3.76926e-05
3.51044e-05
3.24446e-05
2.97156e-05
2.69203e-05
2.40624e-05
2.1146e-05
1.81755e-05
1.51561e-05
1.20927e-05
8.99055e-06
5.85447e-06
2.68878e-06
-5.02511e-07
-3.71809e-06
-6.96053e-06
-1.02351e-05
-1.35461e-05
-1.68975e-05
-2.02908e-05
-2.37233e-05
-2.71828e-05
-3.06486e-05
-3.40911e-05
-3.74737e-05
-4.07555e-05
-4.38897e-05
-4.68191e-05
-4.94729e-05
-5.17639e-05
-5.35965e-05
-5.48909e-05
-5.55962e-05
-5.56915e-05
-5.51854e-05
-5.41052e-05
-5.22476e-05
-5.1234e-05
-4.79407e-05
-4.43786e-05
-4.00759e-05
-3.51753e-05
-2.95621e-05
-2.33147e-05
-1.65321e-05
-9.38277e-06
-2.04591e-06
5.32319e-06
1.26028e-05
1.96912e-05
2.65021e-05
3.29586e-05
3.89942e-05
4.45619e-05
4.96369e-05
5.42164e-05
5.83156e-05
6.19584e-05
6.51729e-05
6.79885e-05
7.04345e-05
7.25376e-05
7.43217e-05
7.58094e-05
7.70231e-05
7.79846e-05
7.87148e-05
7.92333e-05
7.95584e-05
7.97066e-05
7.96934e-05
7.95322e-05
7.92353e-05
7.88133e-05
7.82757e-05
7.76305e-05
7.68847e-05
7.60444e-05
7.51145e-05
7.40991e-05
7.30018e-05
7.18253e-05
7.05717e-05
6.92426e-05
6.78393e-05
6.63626e-05
6.48128e-05
6.31902e-05
6.14945e-05
5.97255e-05
5.78828e-05
5.59657e-05
5.39737e-05
5.19062e-05
4.97626e-05
4.75425e-05
4.52457e-05
4.28722e-05
4.04225e-05
3.78973e-05
3.5298e-05
3.26265e-05
2.98852e-05
2.70772e-05
2.42062e-05
2.12766e-05
1.8293e-05
1.52606e-05
1.21848e-05
9.07058e-06
5.92297e-06
2.74613e-06
-4.5615e-07
-3.68299e-06
-6.93769e-06
-1.02264e-05
-1.35548e-05
-1.6928e-05
-2.03487e-05
-2.38158e-05
-2.73185e-05
-3.08368e-05
-3.43416e-05
-3.77961e-05
-4.11593e-05
-4.43833e-05
-4.74094e-05
-5.01636e-05
-5.25547e-05
-5.44815e-05
-5.58592e-05
-5.66339e-05
-5.67834e-05
-5.63186e-05
-5.52726e-05
-5.3411e-05
-5.24831e-05
-4.91449e-05
-4.55561e-05
-4.1193e-05
-3.62133e-05
-3.04885e-05
-2.41009e-05
-1.71525e-05
-9.82116e-06
-2.29656e-06
5.25744e-06
1.27129e-05
1.99635e-05
2.69199e-05
3.35027e-05
3.96439e-05
4.52962e-05
5.04358e-05
5.50613e-05
5.91904e-05
6.28494e-05
6.60687e-05
6.88796e-05
7.13134e-05
7.33982e-05
7.51591e-05
7.66199e-05
7.78041e-05
7.87343e-05
7.94322e-05
7.99182e-05
8.0211e-05
8.03278e-05
8.02841e-05
8.00939e-05
7.97695e-05
7.93217e-05
7.876e-05
7.80925e-05
7.73261e-05
7.64669e-05
7.55197e-05
7.44887e-05
7.33771e-05
7.21876e-05
7.09223e-05
6.95826e-05
6.81697e-05
6.66841e-05
6.51261e-05
6.34959e-05
6.1793e-05
6.00172e-05
5.81677e-05
5.62439e-05
5.42451e-05
5.21705e-05
5.00194e-05
4.77914e-05
4.54861e-05
4.31035e-05
4.06439e-05
3.81081e-05
3.54974e-05
3.28137e-05
3.00596e-05
2.72383e-05
2.43536e-05
2.14101e-05
1.84127e-05
1.53668e-05
1.22778e-05
9.15094e-06
5.99128e-06
2.8029e-06
-4.10615e-07
-3.64881e-06
-6.91573e-06
-1.02186e-05
-1.3564e-05
-1.69586e-05
-2.04067e-05
-2.39086e-05
-2.7455e-05
-3.10266e-05
-3.45954e-05
-3.81244e-05
-4.15723e-05
-4.48904e-05
-4.80183e-05
-5.0879e-05
-5.33765e-05
-5.54036e-05
-5.68703e-05
-5.77193e-05
-5.7927e-05
-5.75065e-05
-5.6497e-05
-5.46322e-05
-5.37928e-05
-5.0408e-05
-4.67911e-05
-4.23642e-05
-3.73003e-05
-3.1457e-05
-2.49198e-05
-1.77948e-05
-1.027e-05
-2.5462e-06
5.20335e-06
1.2844e-05
2.02647e-05
2.73728e-05
3.40865e-05
4.03365e-05
4.60752e-05
5.12797e-05
5.59509e-05
6.01089e-05
6.37826e-05
6.70047e-05
6.98088e-05
7.2228e-05
7.42919e-05
7.60272e-05
7.74586e-05
7.86108e-05
7.95074e-05
8.0171e-05
8.06224e-05
8.08811e-05
8.09647e-05
8.08892e-05
8.06686e-05
8.03156e-05
7.9841e-05
7.92543e-05
7.85637e-05
7.77762e-05
7.68976e-05
7.59327e-05
7.48856e-05
7.37594e-05
7.25567e-05
7.12795e-05
6.9929e-05
6.85063e-05
6.70118e-05
6.54457e-05
6.38078e-05
6.20978e-05
6.03151e-05
5.84589e-05
5.65285e-05
5.45228e-05
5.24412e-05
5.02827e-05
4.80468e-05
4.57329e-05
4.3341e-05
4.08713e-05
3.83246e-05
3.57021e-05
3.30059e-05
3.02385e-05
2.74034e-05
2.45045e-05
2.15465e-05
1.85346e-05
1.54744e-05
1.23715e-05
9.23147e-06
6.05927e-06
2.85901e-06
-3.65932e-07
-3.61551e-06
-6.89449e-06
-1.02111e-05
-1.35733e-05
-1.69889e-05
-2.04641e-05
-2.40007e-05
-2.75909e-05
-3.12169e-05
-3.48511e-05
-3.8457e-05
-4.1993e-05
-4.54096e-05
-4.86445e-05
-5.16178e-05
-5.42284e-05
-5.63626e-05
-5.79245e-05
-5.8853e-05
-5.91231e-05
-5.87501e-05
-5.77796e-05
-5.59128e-05
-5.51649e-05
-5.17317e-05
-4.80852e-05
-4.3591e-05
-3.84379e-05
-3.24686e-05
-2.57723e-05
-1.84594e-05
-1.07289e-05
-2.79388e-06
5.16224e-06
1.29977e-05
2.05964e-05
2.78623e-05
3.47115e-05
4.10731e-05
4.68996e-05
5.21694e-05
5.68857e-05
6.10712e-05
6.47577e-05
6.79804e-05
7.07752e-05
7.31773e-05
7.52178e-05
7.69247e-05
7.83242e-05
7.9442e-05
8.03027e-05
8.09296e-05
8.13445e-05
8.15673e-05
8.16161e-05
8.15072e-05
8.1255e-05
8.08722e-05
8.03698e-05
7.97573e-05
7.9043e-05
7.82337e-05
7.73351e-05
7.63522e-05
7.52886e-05
7.41477e-05
7.29316e-05
7.16423e-05
7.0281e-05
6.88485e-05
6.7345e-05
6.57707e-05
6.41253e-05
6.24082e-05
6.06187e-05
5.87559e-05
5.68188e-05
5.48065e-05
5.27178e-05
5.0552e-05
4.83081e-05
4.59856e-05
4.35843e-05
4.11044e-05
3.85466e-05
3.59121e-05
3.3203e-05
3.04219e-05
2.75724e-05
2.46586e-05
2.16854e-05
1.86583e-05
1.55831e-05
1.24658e-05
9.31196e-06
6.12677e-06
2.91431e-06
-3.22185e-07
-3.58307e-06
-6.87387e-06
-1.02038e-05
-1.35822e-05
-1.70183e-05
-2.052e-05
-2.4091e-05
-2.77252e-05
-3.14061e-05
-3.51071e-05
-3.87921e-05
-4.24195e-05
-4.59389e-05
-4.92864e-05
-5.23788e-05
-5.51095e-05
-5.7358e-05
-5.90216e-05
-6.00352e-05
-6.03723e-05
-6.00502e-05
-5.91216e-05
-5.72541e-05
-5.66008e-05
-5.31175e-05
-4.94402e-05
-4.48751e-05
-3.96275e-05
-3.35244e-05
-2.66589e-05
-1.91462e-05
-1.11972e-05
-3.03852e-06
5.13558e-06
1.31756e-05
2.09603e-05
2.83902e-05
3.5379e-05
4.18547e-05
4.77702e-05
5.31053e-05
5.78657e-05
6.20771e-05
6.57742e-05
6.89952e-05
7.17781e-05
7.41603e-05
7.61745e-05
7.78504e-05
7.92152e-05
8.0296e-05
8.11184e-05
8.17065e-05
8.20828e-05
8.22679e-05
8.22803e-05
8.21366e-05
8.18515e-05
8.14378e-05
8.09067e-05
8.02676e-05
7.95289e-05
7.86972e-05
7.77783e-05
7.67769e-05
7.56968e-05
7.45408e-05
7.33113e-05
7.20098e-05
7.06376e-05
6.91952e-05
6.76829e-05
6.61005e-05
6.44476e-05
6.27234e-05
6.09272e-05
5.90579e-05
5.71144e-05
5.50954e-05
5.29999e-05
5.08267e-05
4.85749e-05
4.62438e-05
4.38332e-05
4.13429e-05
3.87738e-05
3.61271e-05
3.34046e-05
3.06094e-05
2.77449e-05
2.48157e-05
2.18267e-05
1.87837e-05
1.56928e-05
1.25604e-05
9.39216e-06
6.19353e-06
2.96861e-06
-2.7951e-07
-3.55156e-06
-6.85381e-06
-1.01966e-05
-1.35904e-05
-1.70463e-05
-2.05737e-05
-2.41786e-05
-2.78565e-05
-3.15927e-05
-3.53617e-05
-3.91279e-05
-4.28499e-05
-4.64766e-05
-4.99423e-05
-5.31604e-05
-5.60188e-05
-5.83889e-05
-6.01613e-05
-6.12662e-05
-6.16751e-05
-6.14077e-05
-6.05241e-05
-5.86575e-05
-5.81019e-05
-5.45671e-05
-5.08576e-05
-4.62182e-05
-4.08705e-05
-3.46256e-05
-2.75802e-05
-1.98551e-05
-1.16742e-05
-3.27888e-06
5.12495e-06
1.33795e-05
2.13582e-05
2.89579e-05
3.60903e-05
4.26825e-05
4.86877e-05
5.40877e-05
5.88908e-05
6.31262e-05
6.68316e-05
7.00481e-05
7.28163e-05
7.51755e-05
7.71606e-05
7.88025e-05
8.01299e-05
8.11711e-05
8.19526e-05
8.24997e-05
8.28354e-05
8.29809e-05
8.29553e-05
8.27754e-05
8.24562e-05
8.20106e-05
8.14499e-05
8.07836e-05
8.00199e-05
7.91654e-05
7.82258e-05
7.72057e-05
7.61087e-05
7.49375e-05
7.36944e-05
7.23808e-05
7.09977e-05
6.95455e-05
6.80244e-05
6.6434e-05
6.47737e-05
6.30427e-05
6.124e-05
5.93643e-05
5.74145e-05
5.5389e-05
5.32867e-05
5.11063e-05
4.88467e-05
4.65071e-05
4.4087e-05
4.15864e-05
3.90058e-05
3.63466e-05
3.36105e-05
3.08007e-05
2.79208e-05
2.49754e-05
2.19699e-05
1.89104e-05
1.58031e-05
1.26549e-05
9.47175e-06
6.25926e-06
3.02164e-06
-2.38113e-07
-3.5211e-06
-6.83431e-06
-1.01892e-05
-1.35976e-05
-1.70722e-05
-2.06244e-05
-2.42623e-05
-2.79836e-05
-3.17751e-05
-3.5613e-05
-3.94624e-05
-4.3282e-05
-4.70204e-05
-5.06101e-05
-5.3961e-05
-5.69547e-05
-5.94547e-05
-6.13433e-05
-6.25458e-05
-6.30319e-05
-6.28232e-05
-6.1988e-05
-6.01243e-05
-5.96695e-05
-5.60819e-05
-5.2339e-05
-4.76215e-05
-4.21683e-05
-3.57731e-05
-2.85367e-05
-2.05859e-05
-1.21591e-05
-3.51359e-06
5.13203e-06
1.36112e-05
2.17917e-05
2.9567e-05
3.68467e-05
4.35571e-05
4.96524e-05
5.51165e-05
5.99607e-05
6.42178e-05
6.79288e-05
7.11379e-05
7.38882e-05
7.62215e-05
7.81743e-05
7.97792e-05
8.10663e-05
8.20652e-05
8.28034e-05
8.33071e-05
8.36002e-05
8.37044e-05
8.36391e-05
8.34217e-05
8.30673e-05
8.25889e-05
8.19978e-05
8.13036e-05
8.05143e-05
7.96367e-05
7.86761e-05
7.7637e-05
7.6523e-05
7.53366e-05
7.40799e-05
7.27541e-05
7.13602e-05
6.98983e-05
6.83685e-05
6.67702e-05
6.51027e-05
6.3365e-05
6.1556e-05
5.96742e-05
5.77182e-05
5.56865e-05
5.35776e-05
5.13901e-05
4.91229e-05
4.67748e-05
4.43453e-05
4.18343e-05
3.92422e-05
3.65702e-05
3.38203e-05
3.09954e-05
2.80995e-05
2.51375e-05
2.21148e-05
1.9038e-05
1.59137e-05
1.2749e-05
9.55033e-06
6.32359e-06
3.07306e-06
-1.98271e-07
-3.49186e-06
-6.81546e-06
-1.01816e-05
-1.36035e-05
-1.70957e-05
-2.06715e-05
-2.43413e-05
-2.81051e-05
-3.19519e-05
-3.58593e-05
-3.97935e-05
-4.37137e-05
-4.75682e-05
-5.12877e-05
-5.47785e-05
-5.79159e-05
-6.0554e-05
-6.25669e-05
-6.3874e-05
-6.4443e-05
-6.42973e-05
-6.3514e-05
-6.16555e-05
-6.13047e-05
-5.76632e-05
-5.38859e-05
-4.90868e-05
-4.35222e-05
-3.69678e-05
-2.95285e-05
-2.13383e-05
-1.26509e-05
-3.74112e-06
5.15866e-06
1.38726e-05
2.22626e-05
3.02189e-05
3.76492e-05
4.44794e-05
5.06647e-05
5.61917e-05
6.10749e-05
6.5351e-05
6.90646e-05
7.2263e-05
7.49922e-05
7.72962e-05
7.92135e-05
8.07783e-05
8.20222e-05
8.2976e-05
8.36684e-05
8.41265e-05
8.43749e-05
8.4436e-05
8.43297e-05
8.40735e-05
8.36827e-05
8.31707e-05
8.25485e-05
8.18258e-05
8.10105e-05
8.01093e-05
7.91275e-05
7.80693e-05
7.69382e-05
7.57366e-05
7.44663e-05
7.31285e-05
7.17238e-05
7.02524e-05
6.8714e-05
6.7108e-05
6.54336e-05
6.36895e-05
6.18743e-05
5.99866e-05
5.80247e-05
5.5987e-05
5.38717e-05
5.16774e-05
4.94027e-05
4.70463e-05
4.46075e-05
4.20861e-05
3.94823e-05
3.67974e-05
3.40334e-05
3.11931e-05
2.82807e-05
2.53014e-05
2.22609e-05
1.9166e-05
1.6024e-05
1.28422e-05
9.62745e-06
6.38606e-06
3.12247e-06
-1.60339e-07
-3.46414e-06
-6.7974e-06
-1.01738e-05
-1.3608e-05
-1.71162e-05
-2.07142e-05
-2.44146e-05
-2.82199e-05
-3.21214e-05
-3.60986e-05
-4.01191e-05
-4.41426e-05
-4.81175e-05
-5.19727e-05
-5.56109e-05
-5.89005e-05
-6.16857e-05
-6.38314e-05
-6.52503e-05
-6.59082e-05
-6.58302e-05
-6.51029e-05
-6.32521e-05
-6.30086e-05
-5.93122e-05
-5.54997e-05
-5.06152e-05
-4.49332e-05
-3.82105e-05
-3.0556e-05
-2.21116e-05
-1.31482e-05
-3.95975e-06
5.2068e-06
1.41656e-05
2.27728e-05
3.09151e-05
3.84988e-05
4.54497e-05
5.17246e-05
5.73127e-05
6.22325e-05
6.65246e-05
7.02375e-05
7.34218e-05
7.61264e-05
7.83977e-05
8.0276e-05
8.17975e-05
8.29951e-05
8.39011e-05
8.45452e-05
8.49554e-05
8.51572e-05
8.51736e-05
8.50247e-05
8.47285e-05
8.43004e-05
8.37538e-05
8.30999e-05
8.23482e-05
8.15067e-05
8.05817e-05
7.95784e-05
7.85011e-05
7.73528e-05
7.6136e-05
7.48522e-05
7.35024e-05
7.20872e-05
7.06064e-05
6.90597e-05
6.74463e-05
6.57651e-05
6.40148e-05
6.21938e-05
6.03005e-05
5.8333e-05
5.62895e-05
5.41682e-05
5.19673e-05
4.96853e-05
4.73207e-05
4.48728e-05
4.2341e-05
3.97256e-05
3.70277e-05
3.42492e-05
3.13932e-05
2.84639e-05
2.54667e-05
2.24077e-05
1.92941e-05
1.61335e-05
1.29339e-05
9.70258e-06
6.44616e-06
3.16937e-06
-1.2476e-07
-3.43828e-06
-6.78038e-06
-1.01659e-05
-1.36109e-05
-1.71336e-05
-2.07519e-05
-2.44812e-05
-2.83265e-05
-3.22819e-05
-3.6329e-05
-4.04368e-05
-4.45663e-05
-4.86656e-05
-5.26626e-05
-5.64557e-05
-5.99064e-05
-6.28483e-05
-6.51356e-05
-6.66742e-05
-6.74275e-05
-6.74221e-05
-6.67551e-05
-6.49149e-05
-6.47821e-05
-6.10301e-05
-5.71815e-05
-5.22081e-05
-4.64026e-05
-3.9502e-05
-3.1619e-05
-2.29053e-05
-1.36498e-05
-4.16761e-06
5.27853e-06
1.44924e-05
2.33239e-05
3.1657e-05
3.93964e-05
4.64685e-05
5.28317e-05
5.84789e-05
6.34324e-05
6.77372e-05
7.14458e-05
7.46123e-05
7.72885e-05
7.95234e-05
8.13594e-05
8.28342e-05
8.39825e-05
8.48378e-05
8.54311e-05
8.57913e-05
8.59446e-05
8.59145e-05
8.57217e-05
8.53843e-05
8.49181e-05
8.43362e-05
8.36501e-05
8.2869e-05
8.20009e-05
8.10519e-05
8.00271e-05
7.89306e-05
7.77653e-05
7.65333e-05
7.52361e-05
7.38746e-05
7.2449e-05
7.09591e-05
6.94043e-05
6.77837e-05
6.60961e-05
6.43398e-05
6.25133e-05
6.06147e-05
5.86419e-05
5.6593e-05
5.4466e-05
5.22588e-05
4.99697e-05
4.75973e-05
4.51403e-05
4.25983e-05
3.99713e-05
3.72603e-05
3.44672e-05
3.15952e-05
2.86484e-05
2.56327e-05
2.25546e-05
1.94215e-05
1.62417e-05
1.30236e-05
9.77511e-06
6.50329e-06
3.21318e-06
-9.20669e-08
-3.41475e-06
-6.76475e-06
-1.0158e-05
-1.36122e-05
-1.71475e-05
-2.07841e-05
-2.45403e-05
-2.8424e-05
-3.2432e-05
-3.65485e-05
-4.07445e-05
-4.4982e-05
-4.92099e-05
-5.33545e-05
-5.73105e-05
-6.09317e-05
-6.404e-05
-6.64786e-05
-6.8145e-05
-6.90006e-05
-6.90731e-05
-6.84709e-05
-6.66447e-05
-6.66258e-05
-6.28178e-05
-5.89325e-05
-5.38667e-05
-4.79312e-05
-4.08427e-05
-3.27176e-05
-2.37184e-05
-1.4154e-05
-4.36267e-06
5.37607e-06
1.48549e-05
2.39178e-05
3.24457e-05
4.03427e-05
4.75357e-05
5.39858e-05
5.96893e-05
6.46732e-05
6.8987e-05
7.26874e-05
7.58321e-05
7.84761e-05
8.06708e-05
8.24608e-05
8.38856e-05
8.49815e-05
8.57834e-05
8.63233e-05
8.66314e-05
8.67343e-05
8.66562e-05
8.64182e-05
8.60387e-05
8.55334e-05
8.49158e-05
8.41969e-05
8.33861e-05
8.24912e-05
8.15181e-05
8.04718e-05
7.93562e-05
7.81738e-05
7.69269e-05
7.56165e-05
7.42434e-05
7.28077e-05
7.13089e-05
6.97464e-05
6.81189e-05
6.64251e-05
6.46633e-05
6.28317e-05
6.09281e-05
5.89504e-05
5.68964e-05
5.47639e-05
5.25508e-05
5.0255e-05
4.7875e-05
4.54093e-05
4.28572e-05
4.02186e-05
3.74945e-05
3.46866e-05
3.17982e-05
2.88336e-05
2.57989e-05
2.27009e-05
1.95476e-05
1.63478e-05
1.31106e-05
9.84434e-06
6.55674e-06
3.25322e-06
-6.28933e-08
-3.39409e-06
-6.75094e-06
-1.01506e-05
-1.36121e-05
-1.71578e-05
-2.08104e-05
-2.45911e-05
-2.8511e-05
-3.25701e-05
-3.67552e-05
-4.10397e-05
-4.53873e-05
-4.97475e-05
-5.40456e-05
-5.81725e-05
-6.19738e-05
-6.52591e-05
-6.78588e-05
-6.96619e-05
-7.06271e-05
-7.07829e-05
-7.02505e-05
-6.8442e-05
-6.85403e-05
-6.46762e-05
-6.07539e-05
-5.5592e-05
-4.95201e-05
-4.22331e-05
-3.38514e-05
-2.45498e-05
-1.4659e-05
-4.54267e-06
5.50174e-06
1.52553e-05
2.4556e-05
3.32824e-05
4.1338e-05
4.86513e-05
5.5186e-05
6.09428e-05
6.59533e-05
7.0272e-05
7.39601e-05
7.70789e-05
7.96866e-05
8.18372e-05
8.35775e-05
8.49489e-05
8.59893e-05
8.67349e-05
8.72191e-05
8.74728e-05
8.75236e-05
8.73961e-05
8.71118e-05
8.66892e-05
8.61442e-05
8.54902e-05
8.47382e-05
8.38976e-05
8.29757e-05
8.19785e-05
8.09108e-05
7.97761e-05
7.85769e-05
7.73152e-05
7.59918e-05
7.46074e-05
7.31618e-05
7.16545e-05
7.00845e-05
6.84505e-05
6.67509e-05
6.49839e-05
6.31474e-05
6.12392e-05
5.9257e-05
5.71983e-05
5.50608e-05
5.28421e-05
5.054e-05
4.81526e-05
4.56785e-05
4.31165e-05
4.04666e-05
3.77293e-05
3.49066e-05
3.20016e-05
2.90188e-05
2.59644e-05
2.28459e-05
1.96717e-05
1.64512e-05
1.31941e-05
9.90949e-06
6.60572e-06
3.28871e-06
-3.79795e-08
-3.37699e-06
-6.73953e-06
-1.01439e-05
-1.36108e-05
-1.71645e-05
-2.08305e-05
-2.4633e-05
-2.85867e-05
-3.26946e-05
-3.69472e-05
-4.13202e-05
-4.57794e-05
-5.02755e-05
-5.47328e-05
-5.90387e-05
-6.30301e-05
-6.65033e-05
-6.92749e-05
-7.12238e-05
-7.23062e-05
-7.25514e-05
-7.20938e-05
-7.03071e-05
-7.05261e-05
-6.66061e-05
-6.26464e-05
-5.73851e-05
-5.11699e-05
-4.36736e-05
-3.502e-05
-2.53983e-05
-1.51628e-05
-4.70521e-06
5.65798e-06
1.56957e-05
2.52403e-05
3.41681e-05
4.23829e-05
4.98149e-05
5.64315e-05
6.22378e-05
6.72707e-05
7.15901e-05
7.52613e-05
7.83498e-05
8.0917e-05
8.30196e-05
8.47065e-05
8.6021e-05
8.70028e-05
8.76894e-05
8.81155e-05
8.83129e-05
8.83099e-05
8.81316e-05
8.77999e-05
8.73334e-05
8.67481e-05
8.60573e-05
8.5272e-05
8.44013e-05
8.34525e-05
8.24313e-05
8.13422e-05
8.01886e-05
7.89729e-05
7.76965e-05
7.63605e-05
7.49651e-05
7.35099e-05
7.19943e-05
7.04171e-05
6.87769e-05
6.70719e-05
6.53001e-05
6.34591e-05
6.15468e-05
5.95604e-05
5.74974e-05
5.53553e-05
5.31314e-05
5.08234e-05
4.84291e-05
4.59468e-05
4.33753e-05
4.07141e-05
3.79638e-05
3.51262e-05
3.22043e-05
2.92029e-05
2.61284e-05
2.29887e-05
1.97929e-05
1.65509e-05
1.32732e-05
9.96965e-06
6.64935e-06
3.31877e-06
-1.81793e-08
-3.36422e-06
-6.73119e-06
-1.01385e-05
-1.36085e-05
-1.71677e-05
-2.08441e-05
-2.46655e-05
-2.86499e-05
-3.28043e-05
-3.71226e-05
-4.15836e-05
-4.61556e-05
-5.07907e-05
-5.54131e-05
-5.99061e-05
-6.4098e-05
-6.77704e-05
-7.0725e-05
-7.28294e-05
-7.40372e-05
-7.43779e-05
-7.40005e-05
-7.22401e-05
-7.25833e-05
-6.86079e-05
-6.46108e-05
-5.92468e-05
-5.28813e-05
-4.51643e-05
-3.62226e-05
-2.62621e-05
-1.56631e-05
-4.84767e-06
5.84736e-06
1.61784e-05
2.59722e-05
3.51035e-05
4.34772e-05
5.10258e-05
5.77208e-05
6.35726e-05
6.86235e-05
7.29386e-05
7.65883e-05
7.9642e-05
8.21643e-05
8.42148e-05
8.58446e-05
8.70989e-05
8.80189e-05
8.86439e-05
8.90096e-05
8.91487e-05
8.90904e-05
8.88601e-05
8.848e-05
8.7969e-05
8.73429e-05
8.6615e-05
8.57963e-05
8.48955e-05
8.39198e-05
8.28747e-05
8.17644e-05
8.05922e-05
7.93601e-05
7.80695e-05
7.6721e-05
7.53149e-05
7.38505e-05
7.23269e-05
7.07429e-05
6.90969e-05
6.73868e-05
6.56104e-05
6.37655e-05
6.18493e-05
5.98592e-05
5.77924e-05
5.5646e-05
5.34174e-05
5.11039e-05
4.8703e-05
4.62129e-05
4.36321e-05
4.096e-05
3.81968e-05
3.53443e-05
3.24055e-05
2.93852e-05
2.629e-05
2.31285e-05
1.99103e-05
1.6646e-05
1.33469e-05
1.00239e-05
6.68661e-06
3.34239e-06
-4.46969e-09
-3.35671e-06
-6.72674e-06
-1.01351e-05
-1.36058e-05
-1.71675e-05
-2.08512e-05
-2.46881e-05
-2.86999e-05
-3.28979e-05
-3.72796e-05
-4.18276e-05
-4.65131e-05
-5.12902e-05
-5.60829e-05
-6.07713e-05
-6.51744e-05
-6.90581e-05
-7.22075e-05
-7.44774e-05
-7.58192e-05
-7.62618e-05
-7.59703e-05
-7.42412e-05
-7.47119e-05
-7.06822e-05
-6.66478e-05
-6.1178e-05
-5.46549e-05
-4.67052e-05
-3.74584e-05
-2.71396e-05
-1.61574e-05
-4.96728e-06
6.07252e-06
1.67054e-05
2.67531e-05
3.60894e-05
4.46208e-05
5.22832e-05
5.90527e-05
6.49452e-05
7.0009e-05
7.4315e-05
7.79383e-05
8.09525e-05
8.34256e-05
8.54198e-05
8.69886e-05
8.81792e-05
8.90345e-05
8.95953e-05
8.98984e-05
8.99775e-05
8.98624e-05
8.9579e-05
8.91498e-05
8.85936e-05
8.79264e-05
8.71613e-05
8.6309e-05
8.53783e-05
8.43758e-05
8.3307e-05
8.21758e-05
8.09852e-05
7.9737e-05
7.84324e-05
7.70719e-05
7.56553e-05
7.4182e-05
7.26509e-05
7.10604e-05
6.94088e-05
6.7694e-05
6.59135e-05
6.40649e-05
6.21453e-05
6.01518e-05
5.80815e-05
5.59314e-05
5.36985e-05
5.13799e-05
4.8973e-05
4.64755e-05
4.38858e-05
4.1203e-05
3.84271e-05
3.55597e-05
3.26039e-05
2.95644e-05
2.64482e-05
2.32642e-05
2.00229e-05
1.67355e-05
1.34143e-05
1.0071e-05
6.71639e-06
3.35845e-06
2.03388e-09
-3.35552e-06
-6.72715e-06
-1.01345e-05
-1.36033e-05
-1.71645e-05
-2.0852e-05
-2.47005e-05
-2.87361e-05
-3.29742e-05
-3.74167e-05
-4.20502e-05
-4.68492e-05
-5.17707e-05
-5.67391e-05
-6.16311e-05
-6.62563e-05
-7.03637e-05
-7.37201e-05
-7.61663e-05
-7.76508e-05
-7.82022e-05
-7.80026e-05
-7.63099e-05
-7.69118e-05
-7.28291e-05
-6.87577e-05
-6.31792e-05
-5.64911e-05
-4.82963e-05
-3.87262e-05
-2.80288e-05
-1.66429e-05
-5.06105e-06
6.33619e-06
1.72789e-05
2.75844e-05
3.71262e-05
4.58134e-05
5.35859e-05
6.04252e-05
6.63533e-05
7.14248e-05
7.57164e-05
7.93082e-05
8.2278e-05
8.46974e-05
8.66313e-05
8.81354e-05
8.92589e-05
9.00466e-05
9.05406e-05
9.07791e-05
9.07965e-05
9.06233e-05
9.0286e-05
8.98069e-05
8.92052e-05
8.84966e-05
8.76943e-05
8.68086e-05
8.58479e-05
8.4819e-05
8.37267e-05
8.25749e-05
8.13662e-05
8.01023e-05
7.87841e-05
7.74118e-05
7.59851e-05
7.45032e-05
7.29648e-05
7.13682e-05
6.97114e-05
6.79921e-05
6.62079e-05
6.43559e-05
6.24332e-05
6.04368e-05
5.83635e-05
5.621e-05
5.39732e-05
5.165e-05
4.92374e-05
4.6733e-05
4.41348e-05
4.14416e-05
3.86533e-05
3.57712e-05
3.27982e-05
2.97394e-05
2.66018e-05
2.33947e-05
2.01294e-05
1.68181e-05
1.3474e-05
1.01098e-05
6.73743e-06
3.36569e-06
7.05677e-11
-3.36184e-06
-6.73353e-06
-1.01377e-05
-1.36018e-05
-1.71591e-05
-2.08465e-05
-2.47028e-05
-2.87579e-05
-3.30322e-05
-3.75323e-05
-4.22491e-05
-4.71613e-05
-5.22291e-05
-5.7378e-05
-6.24818e-05
-6.73403e-05
-7.16843e-05
-7.52609e-05
-7.78945e-05
-7.9531e-05
-8.01982e-05
-8.00964e-05
-7.84459e-05
-7.91826e-05
-7.50487e-05
-7.0941e-05
-6.52512e-05
-5.839e-05
-4.99372e-05
-4.00246e-05
-2.89272e-05
-1.71166e-05
-5.12583e-06
6.64118e-06
1.7901e-05
2.84671e-05
3.82141e-05
4.70542e-05
5.49326e-05
6.18364e-05
6.77945e-05
7.2868e-05
7.71396e-05
8.06947e-05
8.36154e-05
8.59765e-05
8.78459e-05
8.92816e-05
9.03348e-05
9.10521e-05
9.1477e-05
9.16489e-05
9.16032e-05
9.13708e-05
9.09786e-05
9.04493e-05
8.98017e-05
8.90518e-05
8.82122e-05
8.72932e-05
8.6303e-05
8.52478e-05
8.41325e-05
8.29604e-05
8.1734e-05
8.04547e-05
7.91232e-05
7.77395e-05
7.63031e-05
7.48129e-05
7.32674e-05
7.1665e-05
7.00033e-05
6.82799e-05
6.64922e-05
6.46371e-05
6.27117e-05
6.07127e-05
5.86367e-05
5.64802e-05
5.42399e-05
5.19125e-05
4.94947e-05
4.69838e-05
4.43774e-05
4.16743e-05
3.88738e-05
3.59772e-05
3.29872e-05
2.99088e-05
2.67494e-05
2.35186e-05
2.02286e-05
1.68927e-05
1.35249e-05
1.01391e-05
6.74839e-06
3.36271e-06
-1.16817e-08
-3.37704e-06
-6.74716e-06
-1.01459e-05
-1.36023e-05
-1.71521e-05
-2.08354e-05
-2.46949e-05
-2.87651e-05
-3.30711e-05
-3.7625e-05
-4.24225e-05
-4.74469e-05
-5.26624e-05
-5.79962e-05
-6.33198e-05
-6.8423e-05
-7.30172e-05
-7.68275e-05
-7.966e-05
-8.14581e-05
-8.22484e-05
-8.22509e-05
-8.06485e-05
-8.15236e-05
-7.7341e-05
-7.31976e-05
-6.73942e-05
-6.03519e-05
-5.16274e-05
-4.13521e-05
-2.98322e-05
-1.75752e-05
-5.15831e-06
6.99033e-06
1.85737e-05
2.94024e-05
3.9353e-05
4.83424e-05
5.63214e-05
6.3284e-05
6.9266e-05
7.43355e-05
7.85816e-05
8.20947e-05
8.49612e-05
8.72595e-05
8.90604e-05
9.04241e-05
9.14038e-05
9.2048e-05
9.24016e-05
9.25051e-05
9.2395e-05
9.21025e-05
9.16549e-05
9.10749e-05
9.03815e-05
8.95902e-05
8.87136e-05
8.77616e-05
8.67421e-05
8.56611e-05
8.45231e-05
8.33311e-05
8.20874e-05
8.07931e-05
7.94486e-05
7.80539e-05
7.6608e-05
7.51099e-05
7.35577e-05
7.19497e-05
7.02833e-05
6.85561e-05
6.67651e-05
6.49073e-05
6.29794e-05
6.0978e-05
5.88996e-05
5.67405e-05
5.44971e-05
5.21658e-05
4.97432e-05
4.72262e-05
4.46122e-05
4.18994e-05
3.90871e-05
3.61762e-05
3.31692e-05
3.00712e-05
2.68897e-05
2.36348e-05
2.03193e-05
1.69578e-05
1.35654e-05
1.01573e-05
6.74778e-06
3.34799e-06
-3.48335e-08
-3.40264e-06
-6.76952e-06
-1.01604e-05
-1.36059e-05
-1.71444e-05
-2.08193e-05
-2.46771e-05
-2.87574e-05
-3.30904e-05
-3.76937e-05
-4.25685e-05
-4.77035e-05
-5.30675e-05
-5.85902e-05
-6.41414e-05
-6.95009e-05
-7.43593e-05
-7.84175e-05
-8.1461e-05
-8.34306e-05
-8.43516e-05
-8.44647e-05
-8.29168e-05
-8.3934e-05
-7.97057e-05
-7.55277e-05
-6.96087e-05
-6.23766e-05
-5.33662e-05
-4.27067e-05
-3.0741e-05
-1.80151e-05
-5.15499e-06
7.38652e-06
1.92988e-05
3.0391e-05
4.05427e-05
4.96766e-05
5.77504e-05
6.47654e-05
7.0765e-05
7.58244e-05
8.0039e-05
8.35047e-05
8.63122e-05
8.85433e-05
9.02716e-05
9.15598e-05
9.2463e-05
9.30315e-05
9.33117e-05
9.33454e-05
9.31696e-05
9.28163e-05
9.23129e-05
9.16821e-05
9.09428e-05
9.01104e-05
8.91971e-05
8.82125e-05
8.71642e-05
8.60579e-05
8.48976e-05
8.36862e-05
8.24256e-05
8.11167e-05
7.97596e-05
7.83541e-05
7.68991e-05
7.53933e-05
7.38347e-05
7.22213e-05
7.05505e-05
6.88196e-05
6.70255e-05
6.51651e-05
6.3235e-05
6.12314e-05
5.91508e-05
5.69893e-05
5.47431e-05
5.24083e-05
4.99813e-05
4.74586e-05
4.48373e-05
4.21153e-05
3.92916e-05
3.63665e-05
3.33427e-05
3.0225e-05
2.70212e-05
2.37416e-05
2.04e-05
1.70119e-05
1.35941e-05
1.01629e-05
6.73398e-06
3.31989e-06
-7.10607e-08
-3.44033e-06
-6.80223e-06
-1.01827e-05
-1.3614e-05
-1.71372e-05
-2.07989e-05
-2.46501e-05
-2.8735e-05
-3.30897e-05
-3.77375e-05
-4.26856e-05
-4.79287e-05
-5.34413e-05
-5.91564e-05
-6.49428e-05
-7.05703e-05
-7.57073e-05
-8.00284e-05
-8.32955e-05
-8.54469e-05
-8.65062e-05
-8.67364e-05
-8.52497e-05
-8.64128e-05
-8.21423e-05
-7.79309e-05
-7.1895e-05
-6.4464e-05
-5.51527e-05
-4.40862e-05
-3.16502e-05
-1.84326e-05
-5.11226e-06
7.83262e-06
2.00782e-05
3.14335e-05
4.17826e-05
5.10555e-05
5.92175e-05
6.6278e-05
7.22883e-05
7.73312e-05
8.15085e-05
8.49214e-05
8.76649e-05
8.98244e-05
9.14764e-05
9.26856e-05
9.35094e-05
9.39999e-05
9.4205e-05
9.41674e-05
9.39251e-05
9.35104e-05
9.29509e-05
9.22693e-05
9.14844e-05
9.06112e-05
8.96616e-05
8.8645e-05
8.75684e-05
8.64372e-05
8.52552e-05
8.40249e-05
8.27478e-05
8.14247e-05
8.00555e-05
7.86396e-05
7.71758e-05
7.56625e-05
7.40977e-05
7.24791e-05
7.0804e-05
6.90695e-05
6.72726e-05
6.54097e-05
6.34774e-05
6.14719e-05
5.93892e-05
5.72255e-05
5.49766e-05
5.26386e-05
5.02074e-05
4.76793e-05
4.50511e-05
4.23203e-05
3.94854e-05
3.65465e-05
3.3506e-05
3.03686e-05
2.71422e-05
2.38377e-05
2.04692e-05
1.70537e-05
1.36095e-05
1.01543e-05
6.70532e-06
3.27664e-06
-1.22182e-07
-3.49197e-06
-6.84714e-06
-1.02145e-05
-1.36282e-05
-1.71319e-05
-2.07755e-05
-2.46145e-05
-2.86984e-05
-3.30688e-05
-3.77556e-05
-4.27725e-05
-4.81207e-05
-5.37812e-05
-5.96914e-05
-6.57201e-05
-7.16274e-05
-7.70579e-05
-8.16577e-05
-8.51613e-05
-8.7505e-05
-8.87105e-05
-8.90645e-05
-8.76456e-05
-8.89586e-05
-8.46501e-05
-8.04069e-05
-7.42531e-05
-6.66138e-05
-5.69859e-05
-4.54879e-05
-3.25564e-05
-1.88236e-05
-5.02636e-06
8.33149e-06
2.09135e-05
3.25302e-05
4.3072e-05
5.24772e-05
6.07201e-05
6.78188e-05
7.38329e-05
7.88526e-05
8.29867e-05
8.63414e-05
8.90161e-05
9.10998e-05
9.26716e-05
9.37987e-05
9.45405e-05
9.49508e-05
9.5079e-05
9.49691e-05
9.46595e-05
9.41831e-05
9.35674e-05
9.28353e-05
9.20051e-05
9.10916e-05
9.01063e-05
8.90582e-05
8.7954e-05
8.67985e-05
8.55954e-05
8.43467e-05
8.30537e-05
8.17169e-05
8.03358e-05
7.89099e-05
7.74375e-05
7.5917e-05
7.43461e-05
7.27225e-05
7.10432e-05
6.93054e-05
6.75055e-05
6.56403e-05
6.37058e-05
6.16983e-05
5.96137e-05
5.74478e-05
5.51964e-05
5.28553e-05
5.04201e-05
4.78869e-05
4.5252e-05
4.25126e-05
3.96669e-05
3.67145e-05
3.36574e-05
3.05004e-05
2.72512e-05
2.39213e-05
2.05253e-05
1.70816e-05
1.36099e-05
1.01298e-05
6.66004e-06
3.2164e-06
-1.90135e-07
-3.55955e-06
-6.90625e-06
-1.0258e-05
-1.36504e-05
-1.713e-05
-2.07503e-05
-2.45715e-05
-2.8648e-05
-3.3028e-05
-3.77477e-05
-4.28279e-05
-4.82774e-05
-5.40844e-05
-6.01918e-05
-6.64696e-05
-7.26684e-05
-7.84077e-05
-8.33025e-05
-8.70563e-05
-8.96029e-05
-9.09627e-05
-9.14469e-05
-9.0103e-05
-9.15699e-05
-8.72284e-05
-8.29551e-05
-7.66831e-05
-6.88253e-05
-5.88643e-05
-4.69092e-05
-3.34555e-05
-1.91837e-05
-4.89347e-06
8.88591e-06
2.18061e-05
3.36813e-05
4.44097e-05
5.39398e-05
6.22556e-05
6.93847e-05
7.53952e-05
8.03853e-05
8.44701e-05
8.77613e-05
9.03626e-05
9.23663e-05
9.38544e-05
9.48963e-05
9.55536e-05
9.58818e-05
9.59318e-05
9.57486e-05
9.53712e-05
9.48329e-05
9.41613e-05
9.3379e-05
9.25041e-05
9.15509e-05
9.05307e-05
8.94518e-05
8.83206e-05
8.71416e-05
8.59178e-05
8.46513e-05
8.33429e-05
8.19928e-05
8.06004e-05
7.91647e-05
7.7684e-05
7.61565e-05
7.45798e-05
7.29513e-05
7.1268e-05
6.95267e-05
6.7724e-05
6.58563e-05
6.39197e-05
6.19102e-05
5.98235e-05
5.76555e-05
5.54016e-05
5.30573e-05
5.06182e-05
4.808e-05
4.54386e-05
4.26909e-05
3.98345e-05
3.68687e-05
3.37952e-05
3.06185e-05
2.73464e-05
2.39907e-05
2.05669e-05
1.7094e-05
1.35937e-05
1.00877e-05
6.59636e-06
3.13726e-06
-2.76936e-07
-3.64519e-06
-6.98175e-06
-1.03151e-05
-1.36827e-05
-1.71336e-05
-2.07252e-05
-2.45223e-05
-2.8585e-05
-3.29677e-05
-3.77136e-05
-4.28512e-05
-4.83972e-05
-5.43484e-05
-6.06543e-05
-6.71873e-05
-7.36892e-05
-7.97533e-05
-8.49601e-05
-8.89783e-05
-9.17387e-05
-9.32607e-05
-9.38818e-05
-9.26199e-05
-9.42448e-05
-8.98761e-05
-8.55745e-05
-7.91851e-05
-7.10979e-05
-6.07863e-05
-4.83466e-05
-3.43434e-05
-1.95083e-05
-4.70968e-06
9.49858e-06
2.27573e-05
3.48865e-05
4.57944e-05
5.5441e-05
6.38212e-05
7.09724e-05
7.6972e-05
8.19257e-05
8.59553e-05
8.91779e-05
9.17012e-05
9.36211e-05
9.5022e-05
9.5976e-05
9.65465e-05
9.67909e-05
9.67615e-05
9.65043e-05
9.60589e-05
9.54588e-05
9.47316e-05
9.38997e-05
9.29807e-05
9.19887e-05
9.09342e-05
8.98253e-05
8.86679e-05
8.74661e-05
8.62225e-05
8.49388e-05
8.36155e-05
8.22526e-05
8.08492e-05
7.94041e-05
7.79154e-05
7.63812e-05
7.47987e-05
7.31654e-05
7.1478e-05
6.97333e-05
6.79277e-05
6.60575e-05
6.41186e-05
6.2107e-05
6.00182e-05
5.78478e-05
5.55913e-05
5.32438e-05
5.08007e-05
4.82575e-05
4.56097e-05
4.28537e-05
3.99868e-05
3.70078e-05
3.3918e-05
3.07215e-05
2.74263e-05
2.40445e-05
2.05922e-05
1.70894e-05
1.35595e-05
1.00264e-05
6.51255e-06
3.03735e-06
-3.8462e-07
-3.75108e-06
-7.07593e-06
-1.03883e-05
-1.37273e-05
-1.71448e-05
-2.0702e-05
-2.44687e-05
-2.85106e-05
-3.28887e-05
-3.76537e-05
-4.28419e-05
-4.8479e-05
-5.4571e-05
-6.10758e-05
-6.78696e-05
-7.4686e-05
-8.1091e-05
-8.66278e-05
-9.09248e-05
-9.39101e-05
-9.56025e-05
-9.63667e-05
-9.51941e-05
-9.69811e-05
-9.2592e-05
-8.82644e-05
-8.17588e-05
-7.34308e-05
-6.27502e-05
-4.97967e-05
-3.52155e-05
-1.97928e-05
-4.47105e-06
1.0172e-05
2.37679e-05
3.61453e-05
4.72243e-05
5.69782e-05
6.54137e-05
7.25788e-05
7.85598e-05
8.34706e-05
8.74392e-05
9.0588e-05
9.30289e-05
9.48613e-05
9.6172e-05
9.70354e-05
9.7517e-05
9.76763e-05
9.75665e-05
9.72349e-05
9.67214e-05
9.60599e-05
9.52776e-05
9.43968e-05
9.34346e-05
9.24046e-05
9.13168e-05
9.01788e-05
8.89961e-05
8.77722e-05
8.65095e-05
8.52093e-05
8.38717e-05
8.24965e-05
8.10825e-05
7.96283e-05
7.81319e-05
7.65911e-05
7.5003e-05
7.3365e-05
7.16736e-05
6.99254e-05
6.81169e-05
6.6244e-05
6.43027e-05
6.22887e-05
6.01975e-05
5.80246e-05
5.57652e-05
5.34144e-05
5.09671e-05
4.84187e-05
4.57644e-05
4.30002e-05
4.01227e-05
3.71305e-05
3.40242e-05
3.0808e-05
2.74895e-05
2.40812e-05
2.05999e-05
1.70665e-05
1.3506e-05
9.94451e-06
6.40698e-06
2.91489e-06
-5.15171e-07
-3.87941e-06
-7.19117e-06
-1.04801e-05
-1.37868e-05
-1.71661e-05
-2.06831e-05
-2.44126e-05
-2.84264e-05
-3.27923e-05
-3.75685e-05
-4.27999e-05
-4.85216e-05
-5.47504e-05
-6.14534e-05
-6.85127e-05
-7.56547e-05
-8.24171e-05
-8.83027e-05
-9.28937e-05
-9.61149e-05
-9.79858e-05
-9.88992e-05
-9.78231e-05
-9.97766e-05
-9.53746e-05
-9.10235e-05
-8.44041e-05
-7.58228e-05
-6.47537e-05
-5.12554e-05
-3.60669e-05
-2.00321e-05
-4.17367e-06
1.09087e-05
2.48388e-05
3.7457e-05
4.86975e-05
5.85487e-05
6.70299e-05
7.42003e-05
8.01552e-05
8.50164e-05
8.89184e-05
9.19887e-05
9.4343e-05
9.60843e-05
9.73018e-05
9.80725e-05
9.84634e-05
9.85362e-05
9.83454e-05
9.79392e-05
9.73578e-05
9.66354e-05
9.57988e-05
9.48699e-05
9.38655e-05
9.27985e-05
9.16785e-05
9.05124e-05
8.93052e-05
8.80602e-05
8.67791e-05
8.5463e-05
8.41118e-05
8.27247e-05
8.13006e-05
7.98377e-05
7.83339e-05
7.67866e-05
7.51931e-05
7.35504e-05
7.1855e-05
7.01033e-05
6.82916e-05
6.6416e-05
6.4472e-05
6.24555e-05
6.03617e-05
5.81859e-05
5.59233e-05
5.35688e-05
5.11171e-05
4.85633e-05
4.59023e-05
4.31295e-05
4.02413e-05
3.72358e-05
3.4113e-05
3.08767e-05
2.75347e-05
2.40994e-05
2.05885e-05
1.70239e-05
1.34317e-05
9.84063e-06
6.27822e-06
2.76827e-06
-6.7043e-07
-4.03227e-06
-7.32983e-06
-1.05931e-05
-1.3864e-05
-1.72002e-05
-2.06711e-05
-2.43566e-05
-2.83346e-05
-3.268e-05
-3.74591e-05
-4.27255e-05
-4.85246e-05
-5.48849e-05
-6.17845e-05
-6.9113e-05
-7.65914e-05
-8.37278e-05
-8.99818e-05
-9.48825e-05
-9.83508e-05
-0.000100408
-0.000101477
-0.000100504
-0.000102628
-9.82223e-05
-9.38503e-05
-8.71206e-05
-7.82727e-05
-6.67944e-05
-5.27184e-05
-3.68924e-05
-2.02212e-05
-3.81367e-06
1.17107e-05
2.59702e-05
3.88204e-05
5.02117e-05
6.01496e-05
6.86666e-05
7.58335e-05
8.17547e-05
8.656e-05
9.03898e-05
9.33769e-05
9.56408e-05
9.72878e-05
9.84095e-05
9.90852e-05
9.9384e-05
9.93695e-05
9.90972e-05
9.86164e-05
9.79676e-05
9.71849e-05
9.62949e-05
9.53191e-05
9.42736e-05
9.31707e-05
9.20195e-05
9.08264e-05
8.95958e-05
8.83304e-05
8.70318e-05
8.57005e-05
8.43362e-05
8.29379e-05
8.1504e-05
8.00328e-05
7.85218e-05
7.69684e-05
7.53696e-05
7.37222e-05
7.20227e-05
7.02676e-05
6.84526e-05
6.6574e-05
6.46271e-05
6.26077e-05
6.0511e-05
5.83321e-05
5.60659e-05
5.37073e-05
5.12509e-05
4.86913e-05
4.60231e-05
4.32416e-05
4.03425e-05
3.73233e-05
3.41837e-05
3.09271e-05
2.7561e-05
2.40983e-05
2.05571e-05
1.69605e-05
1.33357e-05
9.71389e-06
6.12514e-06
2.59616e-06
-8.51986e-07
-4.21156e-06
-7.49414e-06
-1.07297e-05
-1.39616e-05
-1.72502e-05
-2.06689e-05
-2.43033e-05
-2.82376e-05
-3.2554e-05
-3.73269e-05
-4.26194e-05
-4.84879e-05
-5.49732e-05
-6.20665e-05
-6.96671e-05
-7.7492e-05
-8.50195e-05
-9.16622e-05
-9.6889e-05
-0.000100616
-0.000102867
-0.000104096
-0.000103234
-0.000105534
-0.000101133
-9.67434e-05
-8.99081e-05
-8.07791e-05
-6.88695e-05
-5.41811e-05
-3.76865e-05
-2.03549e-05
-3.38732e-06
1.25799e-05
2.71624e-05
4.02341e-05
5.17645e-05
6.17777e-05
7.03204e-05
7.74749e-05
8.3355e-05
8.80981e-05
9.18505e-05
9.47501e-05
9.69199e-05
9.84696e-05
9.94931e-05
0.000100072
0.000100277
0.000100175
9.98209e-05
9.92659e-05
9.85502e-05
9.77082e-05
9.67659e-05
9.57444e-05
9.4659e-05
9.35215e-05
9.23403e-05
9.11212e-05
8.98682e-05
8.85835e-05
8.72681e-05
8.59224e-05
8.45457e-05
8.31366e-05
8.16935e-05
8.02143e-05
7.86964e-05
7.71371e-05
7.5533e-05
7.38811e-05
7.21776e-05
7.04188e-05
6.86005e-05
6.67187e-05
6.47688e-05
6.27462e-05
6.06462e-05
5.84638e-05
5.61936e-05
5.38306e-05
5.13689e-05
4.88031e-05
4.61274e-05
4.33367e-05
4.04262e-05
3.7393e-05
3.42361e-05
3.09587e-05
2.75681e-05
2.40774e-05
2.05051e-05
1.68757e-05
1.32175e-05
9.56364e-06
5.94698e-06
2.39761e-06
-1.06107e-06
-4.41887e-06
-7.68611e-06
-1.08925e-05
-1.40824e-05
-1.73191e-05
-2.06799e-05
-2.42562e-05
-2.81385e-05
-3.24169e-05
-3.71741e-05
-4.2483e-05
-4.84116e-05
-5.50146e-05
-6.22975e-05
-7.01718e-05
-7.83526e-05
-8.62882e-05
-9.3341e-05
-9.89109e-05
-0.000102907
-0.00010536
-0.000106754
-0.00010601
-0.000108489
-0.000104106
-9.97009e-05
-9.2766e-05
-8.33404e-05
-7.0976e-05
-5.56383e-05
-3.84435e-05
-2.04279e-05
-2.89105e-06
1.3518e-05
2.84148e-05
4.16964e-05
5.33532e-05
6.34298e-05
7.19877e-05
7.91212e-05
8.49529e-05
8.96277e-05
9.32977e-05
9.61057e-05
9.8178e-05
9.96279e-05
0.000100551
0.000101032
0.000101143
0.000100952
0.000100516
9.98872e-05
9.91055e-05
9.82054e-05
9.7212e-05
9.61461e-05
9.50221e-05
9.38514e-05
9.26414e-05
9.13975e-05
9.01231e-05
8.882e-05
8.74888e-05
8.61294e-05
8.47409e-05
8.33217e-05
8.18698e-05
8.0383e-05
7.88585e-05
7.72934e-05
7.56843e-05
7.4028e-05
7.23204e-05
7.05579e-05
6.87362e-05
6.6851e-05
6.48977e-05
6.28718e-05
6.07681e-05
5.85818e-05
5.63073e-05
5.39394e-05
5.1472e-05
4.88995e-05
4.62158e-05
4.34154e-05
4.0493e-05
3.74453e-05
3.42707e-05
3.09719e-05
2.7556e-05
2.40365e-05
2.04324e-05
1.67692e-05
1.30767e-05
9.38957e-06
5.7435e-06
2.17216e-06
-1.29842e-06
-4.65533e-06
-7.90736e-06
-1.10836e-05
-1.42293e-05
-1.741e-05
-2.07075e-05
-2.42186e-05
-2.80408e-05
-3.22717e-05
-3.70032e-05
-4.2318e-05
-4.82966e-05
-5.50087e-05
-6.24757e-05
-7.06241e-05
-7.91694e-05
-8.753e-05
-9.50152e-05
-0.000100946
-0.000105222
-0.000107885
-0.000109448
-0.000108827
-0.00011149
-0.000107137
-0.000102721
-9.56939e-05
-8.59546e-05
-7.31104e-05
-5.70845e-05
-3.91575e-05
-2.04351e-05
-2.32153e-06
1.4526e-05
2.97269e-05
4.3205e-05
5.49747e-05
6.51025e-05
7.36651e-05
8.0769e-05
8.65451e-05
9.1146e-05
9.47288e-05
9.74415e-05
9.94131e-05
0.000100761
0.000101581
0.000101963
0.000101978
0.000101699
0.000101182
0.00010048
9.96335e-05
9.86765e-05
9.76334e-05
9.65246e-05
9.53635e-05
9.41609e-05
9.29234e-05
9.1656e-05
9.03613e-05
8.90408e-05
8.76946e-05
8.63223e-05
8.49226e-05
8.34939e-05
8.20337e-05
8.05397e-05
7.90089e-05
7.74383e-05
7.58244e-05
7.41636e-05
7.24521e-05
7.06859e-05
6.88606e-05
6.69719e-05
6.50151e-05
6.29855e-05
6.08779e-05
5.86873e-05
5.64081e-05
5.40348e-05
5.15613e-05
4.89816e-05
4.62894e-05
4.34788e-05
4.0544e-05
3.74812e-05
3.42882e-05
3.09673e-05
2.75254e-05
2.39764e-05
2.03394e-05
1.66414e-05
1.29134e-05
9.192e-06
5.51509e-06
1.91996e-06
-1.56419e-06
-4.92146e-06
-8.15895e-06
-1.13047e-05
-1.44045e-05
-1.75261e-05
-2.07553e-05
-2.41946e-05
-2.79484e-05
-3.21223e-05
-3.68174e-05
-4.21268e-05
-4.81444e-05
-5.49556e-05
-6.25998e-05
-7.10212e-05
-7.99387e-05
-8.87412e-05
-9.66818e-05
-0.000102992
-0.000107559
-0.000110438
-0.000112173
-0.000111682
-0.000114534
-0.000110224
-0.000105802
-9.86912e-05
-8.86197e-05
-7.52688e-05
-5.8514e-05
-3.98222e-05
-2.03714e-05
-1.67572e-06
1.56049e-05
3.10975e-05
4.47577e-05
5.66258e-05
6.67923e-05
7.53491e-05
8.2415e-05
8.81287e-05
9.26502e-05
9.61414e-05
9.87553e-05
0.000100623
0.000101867
0.000102583
0.000102864
0.000102784
0.000102416
0.000101818
0.000101045
0.000100134
9.91219e-05
9.80307e-05
9.68805e-05
9.56838e-05
9.44508e-05
9.31871e-05
9.18974e-05
9.05835e-05
8.92466e-05
8.78863e-05
8.6502e-05
8.50918e-05
8.36541e-05
8.21861e-05
8.06853e-05
7.91486e-05
7.75727e-05
7.59541e-05
7.4289e-05
7.25736e-05
7.08036e-05
6.89747e-05
6.70824e-05
6.51219e-05
6.30884e-05
6.09766e-05
5.87815e-05
5.64972e-05
5.41182e-05
5.16381e-05
4.90509e-05
4.63497e-05
4.35284e-05
4.05806e-05
3.75021e-05
3.429e-05
3.09463e-05
2.74776e-05
2.3898e-05
2.02271e-05
1.64933e-05
1.27285e-05
8.97185e-06
5.26258e-06
1.64184e-06
-1.85782e-06
-5.2171e-06
-8.44129e-06
-1.15569e-05
-1.461e-05
-1.76701e-05
-2.08267e-05
-2.41881e-05
-2.78656e-05
-3.19728e-05
-3.66205e-05
-4.19125e-05
-4.79569e-05
-5.4856e-05
-6.26691e-05
-7.13608e-05
-8.06568e-05
-8.99178e-05
-9.83378e-05
-0.000105046
-0.000109915
-0.000113017
-0.000114927
-0.000114572
-0.000117616
-0.000113366
-0.00010894
-0.000101757
-9.13334e-05
-7.74471e-05
-5.99206e-05
-4.04315e-05
-2.02317e-05
-9.50947e-07
1.6755e-05
3.25252e-05
4.63516e-05
5.83032e-05
6.84957e-05
7.70364e-05
8.4056e-05
8.97008e-05
9.41379e-05
9.75334e-05
0.000100045
0.000101807
0.000102945
0.000103556
0.000103736
0.00010356
0.000103103
0.000102426
0.000101581
0.000100608
9.95422e-05
9.84044e-05
9.72146e-05
9.59838e-05
9.47218e-05
9.34335e-05
9.21227e-05
9.07908e-05
8.94384e-05
8.8065e-05
8.66693e-05
8.52494e-05
8.38032e-05
8.23278e-05
8.08207e-05
7.92783e-05
7.76975e-05
7.60743e-05
7.44052e-05
7.26859e-05
7.09122e-05
6.90796e-05
6.71836e-05
6.52193e-05
6.31818e-05
6.10656e-05
5.88656e-05
5.6576e-05
5.41909e-05
5.17039e-05
4.91087e-05
4.63982e-05
4.35658e-05
4.06046e-05
3.75099e-05
3.4278e-05
3.09107e-05
2.74142e-05
2.38031e-05
2.00973e-05
1.63266e-05
1.25237e-05
8.73049e-06
4.98738e-06
1.33938e-06
-2.17796e-06
-5.54124e-06
-8.75394e-06
-1.18406e-05
-1.48471e-05
-1.78444e-05
-2.09252e-05
-2.42034e-05
-2.77972e-05
-3.18281e-05
-3.6417e-05
-4.16788e-05
-4.77368e-05
-5.47113e-05
-6.26831e-05
-7.1641e-05
-8.13204e-05
-9.10559e-05
-9.99801e-05
-0.000107108
-0.000112288
-0.00011562
-0.000117705
-0.00011749
-0.000120732
-0.000116558
-0.000112135
-0.000104891
-9.40932e-05
-7.96407e-05
-6.12979e-05
-4.09791e-05
-2.00113e-05
-1.44957e-07
1.79762e-05
3.4008e-05
4.79838e-05
6.00035e-05
7.02092e-05
7.87236e-05
8.56891e-05
9.12587e-05
9.56067e-05
9.89027e-05
0.00010131
0.000102964
0.000103994
0.000104498
0.000104577
0.000104304
0.000103761
0.000103003
0.00010209
0.000101056
9.99379e-05
9.87553e-05
9.75275e-05
9.62644e-05
9.4975e-05
9.36632e-05
9.23327e-05
9.09838e-05
8.96172e-05
8.82313e-05
8.68251e-05
8.53961e-05
8.39421e-05
8.24599e-05
8.09468e-05
7.93992e-05
7.78136e-05
7.61862e-05
7.45131e-05
7.279e-05
7.10127e-05
6.91764e-05
6.72767e-05
6.53085e-05
6.32667e-05
6.1146e-05
5.89411e-05
5.66458e-05
5.42545e-05
5.17603e-05
4.91569e-05
4.64366e-05
4.35929e-05
4.06178e-05
3.75064e-05
3.42542e-05
3.08626e-05
2.73374e-05
2.36939e-05
1.99521e-05
1.61434e-05
1.23012e-05
8.47e-06
4.69168e-06
1.01482e-06
-2.52248e-06
-5.89202e-06
-9.09557e-06
-1.21551e-05
-1.51163e-05
-1.80505e-05
-2.10536e-05
-2.42443e-05
-2.77479e-05
-3.16935e-05
-3.62123e-05
-4.14305e-05
-4.74876e-05
-5.45234e-05
-6.26422e-05
-7.186e-05
-8.19263e-05
-9.21518e-05
-0.000101606
-0.000109174
-0.000114676
-0.000118242
-0.000120503
-0.000120433
-0.000123877
-0.000119798
-0.000115382
-0.000108092
-9.68963e-05
-8.18446e-05
-6.26393e-05
-4.14587e-05
-1.97058e-05
7.44019e-07
1.92679e-05
3.55436e-05
4.96509e-05
6.17228e-05
7.19292e-05
8.04073e-05
8.73114e-05
9.28001e-05
9.70545e-05
0.000100248
0.000102548
0.000104091
0.000105013
0.00010541
0.000105387
0.000105018
0.000104388
0.000103552
0.000102571
0.000101478
0.00010031
9.90842e-05
9.78203e-05
9.65263e-05
9.52111e-05
9.38774e-05
9.25283e-05
9.11637e-05
8.97837e-05
8.83864e-05
8.69704e-05
8.5533e-05
8.40717e-05
8.25832e-05
8.10646e-05
7.9512e-05
7.79221e-05
7.62905e-05
7.46137e-05
7.28869e-05
7.11061e-05
6.92662e-05
6.73628e-05
6.53905e-05
6.33445e-05
6.12191e-05
5.90091e-05
5.67081e-05
5.43104e-05
5.18088e-05
4.91971e-05
4.64669e-05
4.36115e-05
4.06224e-05
3.7494e-05
3.4221e-05
3.08045e-05
2.72498e-05
2.3573e-05
1.97942e-05
1.59464e-05
1.20636e-05
8.19323e-06
4.37826e-06
6.70956e-07
-2.88847e-06
-6.26668e-06
-9.46383e-06
-1.24989e-05
-1.5417e-05
-1.82893e-05
-2.1214e-05
-2.43145e-05
-2.77226e-05
-3.15746e-05
-3.60121e-05
-4.11727e-05
-4.72135e-05
-5.4295e-05
-6.25472e-05
-7.20168e-05
-8.24717e-05
-9.32016e-05
-0.000103212
-0.000111243
-0.000117077
-0.000120882
-0.000123317
-0.000123395
-0.000127045
-0.000123083
-0.000118681
-0.000111359
-9.97397e-05
-8.40536e-05
-6.39378e-05
-4.1864e-05
-1.93112e-05
1.71723e-06
2.0629e-05
3.71293e-05
5.13495e-05
6.34576e-05
7.36522e-05
8.20847e-05
8.89202e-05
9.43227e-05
9.84796e-05
0.000101567
0.000103758
0.000105189
0.000106001
0.00010629
0.000106165
0.000105701
0.000104985
0.000104073
0.000103025
0.000101875
0.000100659
9.9392e-05
9.80938e-05
9.67707e-05
9.54312e-05
9.4077e-05
9.27106e-05
9.13313e-05
8.99389e-05
8.8531e-05
8.7106e-05
8.56608e-05
8.41929e-05
8.26986e-05
8.11748e-05
7.96177e-05
7.80236e-05
7.63883e-05
7.47079e-05
7.29776e-05
7.11933e-05
6.93499e-05
6.74428e-05
6.54665e-05
6.34163e-05
6.12862e-05
5.9071e-05
5.67642e-05
5.436e-05
5.1851e-05
4.92308e-05
4.64907e-05
4.36237e-05
4.06204e-05
3.74748e-05
3.41808e-05
3.07389e-05
2.71541e-05
2.34433e-05
1.96265e-05
1.57387e-05
1.18142e-05
7.90352e-06
4.05035e-06
3.11198e-07
-3.27235e-06
-6.66166e-06
-9.85545e-06
-1.28692e-05
-1.57475e-05
-1.85604e-05
-2.14079e-05
-2.4417e-05
-2.77257e-05
-3.14771e-05
-3.58227e-05
-4.09117e-05
-4.69197e-05
-5.40297e-05
-6.23998e-05
-7.21108e-05
-8.29539e-05
-9.42016e-05
-0.000104796
-0.000113313
-0.000119488
-0.000123536
-0.000126142
-0.000126372
-0.000130232
-0.000126408
-0.000122027
-0.000114692
-0.00010262
-8.62617e-05
-6.51866e-05
-4.21891e-05
-1.88239e-05
2.77532e-06
2.20577e-05
3.87618e-05
5.30757e-05
6.5204e-05
7.53748e-05
8.37525e-05
9.0513e-05
9.58243e-05
9.98803e-05
0.000102858
0.000104939
0.000106257
0.000106959
0.000107139
0.000106913
0.000106353
0.000105553
0.000104565
0.000103454
0.000102248
0.000100986
9.96795e-05
9.83489e-05
9.69985e-05
9.56363e-05
9.42628e-05
9.28804e-05
9.14876e-05
9.00837e-05
8.86662e-05
8.72329e-05
8.57806e-05
8.43065e-05
8.28069e-05
8.12785e-05
7.97171e-05
7.81193e-05
7.64804e-05
7.47966e-05
7.3063e-05
7.12754e-05
6.94285e-05
6.75178e-05
6.55376e-05
6.34832e-05
6.13483e-05
5.9128e-05
5.68153e-05
5.44047e-05
5.18883e-05
4.92598e-05
4.65098e-05
4.36312e-05
4.06138e-05
3.74511e-05
3.41359e-05
3.06684e-05
2.70531e-05
2.33077e-05
1.94523e-05
1.55239e-05
1.15566e-05
7.60459e-06
3.71175e-06
-6.04972e-08
-3.67007e-06
-7.07277e-06
-1.02663e-05
-1.32623e-05
-1.61049e-05
-1.88623e-05
-2.16355e-05
-2.45538e-05
-2.77612e-05
-3.14064e-05
-3.56508e-05
-4.06542e-05
-4.66122e-05
-5.3732e-05
-6.22022e-05
-7.21421e-05
-8.33707e-05
-9.51484e-05
-0.000106353
-0.000115382
-0.000121908
-0.000126202
-0.000128975
-0.000129358
-0.000133431
-0.000129771
-0.000125418
-0.000118088
-0.000105534
-8.84631e-05
-6.63785e-05
-4.24283e-05
-1.82408e-05
3.91835e-06
2.35519e-05
4.04378e-05
5.48256e-05
6.69582e-05
7.70937e-05
8.54082e-05
9.20877e-05
9.73033e-05
0.000101255
0.000104122
0.00010609
0.000107293
0.000107885
0.000107956
0.000107629
0.000106974
0.000106092
0.00010503
0.000103857
0.000102598
0.000101291
9.99479e-05
9.85867e-05
9.72105e-05
9.58272e-05
9.44359e-05
9.30388e-05
9.16334e-05
9.02191e-05
8.87926e-05
8.73518e-05
8.5893e-05
8.44134e-05
8.29089e-05
8.13762e-05
7.9811e-05
7.82097e-05
7.65675e-05
7.48806e-05
7.31439e-05
7.13531e-05
6.95029e-05
6.75887e-05
6.56047e-05
6.35461e-05
6.14066e-05
5.91811e-05
5.68627e-05
5.44458e-05
5.19221e-05
4.92854e-05
4.65257e-05
4.36358e-05
4.06045e-05
3.7425e-05
3.40887e-05
3.05957e-05
2.69496e-05
2.31694e-05
1.92747e-05
1.53052e-05
1.12945e-05
7.30041e-06
3.36661e-06
-4.39887e-07
-4.07728e-06
-7.49532e-06
-1.06917e-05
-1.36737e-05
-1.64853e-05
-1.91922e-05
-2.18956e-05
-2.4726e-05
-2.78321e-05
-3.13677e-05
-3.5503e-05
-4.04077e-05
-4.62979e-05
-5.34071e-05
-6.19576e-05
-7.21112e-05
-8.37204e-05
-9.60385e-05
-0.000107882
-0.000117448
-0.000124334
-0.000128877
-0.00013181
-0.000132347
-0.000136638
-0.000133167
-0.000128851
-0.000121546
-0.000108477
-9.06511e-05
-6.75064e-05
-4.25761e-05
-1.75595e-05
5.14572e-06
2.51089e-05
4.21534e-05
5.65952e-05
6.87166e-05
7.88056e-05
8.7049e-05
9.36421e-05
9.87579e-05
0.000102603
0.000105356
0.000107211
0.000108299
0.00010878
0.000108742
0.000108315
0.000107566
0.000106603
0.000105469
0.000104235
0.000102925
0.000101577
0.000100198
9.88082e-05
9.7408e-05
9.6005e-05
9.45972e-05
9.31865e-05
9.17697e-05
9.03458e-05
8.89112e-05
8.74636e-05
8.5999e-05
8.45144e-05
8.30054e-05
8.14689e-05
7.99002e-05
7.82957e-05
7.66505e-05
7.49607e-05
7.32211e-05
7.14273e-05
6.9574e-05
6.76564e-05
6.56687e-05
6.3606e-05
6.1462e-05
5.92315e-05
5.69075e-05
5.44843e-05
5.19536e-05
4.93089e-05
4.65399e-05
4.36391e-05
4.05943e-05
3.73984e-05
3.40415e-05
3.05231e-05
2.68462e-05
2.30312e-05
1.90971e-05
1.50863e-05
1.10315e-05
6.99501e-06
3.01923e-06
-8.22543e-07
-4.48937e-06
-7.92438e-06
-1.11265e-05
-1.4098e-05
-1.68837e-05
-1.9546e-05
-2.21858e-05
-2.49333e-05
-2.79406e-05
-3.1365e-05
-3.53856e-05
-4.01799e-05
-4.59845e-05
-5.30615e-05
-6.16701e-05
-7.20196e-05
-8.40016e-05
-9.68686e-05
-0.000109379
-0.000119511
-0.000126766
-0.000131559
-0.000134642
-0.000135334
-0.000139845
-0.000136591
-0.000132324
-0.000125065
-0.000111445
-9.28191e-05
-6.85634e-05
-4.26275e-05
-1.67783e-05
6.45618e-06
2.67254e-05
4.39046e-05
5.83804e-05
7.04753e-05
8.05075e-05
8.86725e-05
9.51743e-05
0.000100187
0.000103922
0.00010656
0.000108301
0.000109272
0.000109644
0.000109496
0.000108971
0.000108128
0.000107086
0.000105881
0.00010459
0.000103231
0.000101843
0.000100431
9.90143e-05
9.75917e-05
9.61706e-05
9.47476e-05
9.33245e-05
9.18972e-05
9.04647e-05
8.90228e-05
8.75691e-05
8.60991e-05
8.461e-05
8.30971e-05
8.15572e-05
7.99854e-05
7.8378e-05
7.67301e-05
7.50376e-05
7.32953e-05
7.14988e-05
6.96425e-05
6.77216e-05
6.57304e-05
6.36638e-05
6.15154e-05
5.92801e-05
5.69506e-05
5.45214e-05
5.19838e-05
4.93316e-05
4.65536e-05
4.36425e-05
4.05848e-05
3.73731e-05
3.3996e-05
3.04527e-05
2.67453e-05
2.28958e-05
1.89223e-05
1.48705e-05
1.07715e-05
6.69237e-06
2.67382e-06
-1.20393e-06
-4.90161e-06
-8.35493e-06
-1.15654e-05
-1.45298e-05
-1.72945e-05
-1.99186e-05
-2.25023e-05
-2.51737e-05
-2.80871e-05
-3.14017e-05
-3.53042e-05
-3.99782e-05
-4.56805e-05
-5.27026e-05
-6.13447e-05
-7.18694e-05
-8.42135e-05
-9.76357e-05
-0.000110842
-0.000121567
-0.0001292
-0.000134244
-0.000137468
-0.000138312
-0.000143048
-0.000140041
-0.000135833
-0.000128643
-0.000114435
-9.49601e-05
-6.95427e-05
-4.25781e-05
-1.5896e-05
7.84783e-06
2.83977e-05
4.56869e-05
6.01768e-05
7.22308e-05
8.21966e-05
9.02766e-05
9.66827e-05
0.000101589
0.000105213
0.000107734
0.00010936
0.000110215
0.000110477
0.000110219
0.000109597
0.000108662
0.000107542
0.000106269
0.000104923
0.000103516
0.000102091
0.000100647
9.92061e-05
9.77626e-05
9.6325e-05
9.4888e-05
9.34536e-05
9.20168e-05
9.05765e-05
8.9128e-05
8.76688e-05
8.61941e-05
8.47011e-05
8.31847e-05
8.16417e-05
8.00671e-05
7.84573e-05
7.68069e-05
7.5112e-05
7.33672e-05
7.15681e-05
6.9709e-05
6.77852e-05
6.57905e-05
6.37202e-05
6.15675e-05
5.93276e-05
5.69928e-05
5.45579e-05
5.20138e-05
4.93544e-05
4.65679e-05
4.36471e-05
4.05772e-05
3.73505e-05
3.39539e-05
3.03864e-05
2.66491e-05
2.27655e-05
1.87531e-05
1.46608e-05
1.05176e-05
6.39625e-06
2.33447e-06
-1.5796e-06
-5.30942e-06
-8.7821e-06
-1.2003e-05
-1.49635e-05
-1.7712e-05
-2.03042e-05
-2.284e-05
-2.5444e-05
-2.8271e-05
-3.14796e-05
-3.52633e-05
-3.98098e-05
-4.53943e-05
-5.23386e-05
-6.09877e-05
-7.16636e-05
-8.43559e-05
-9.8337e-05
-0.000112266
-0.000123617
-0.000131636
-0.00013693
-0.000140282
-0.000141276
-0.000146239
-0.000143511
-0.000139376
-0.000132278
-0.00011744
-9.70668e-05
-7.04376e-05
-4.2424e-05
-1.49124e-05
9.31812e-06
3.01217e-05
4.74958e-05
6.19803e-05
7.39795e-05
8.387e-05
9.18593e-05
9.81659e-05
0.000102962
0.000106474
0.000108877
0.000110388
0.000111125
0.00011128
0.000110912
0.000110193
0.000109167
0.000107972
0.000106632
0.000105234
0.000103782
0.000102322
0.000100849
9.93845e-05
9.79217e-05
9.64689e-05
9.50192e-05
9.35746e-05
9.21292e-05
9.0682e-05
8.92276e-05
8.77635e-05
8.62847e-05
8.47882e-05
8.32687e-05
8.17231e-05
8.0146e-05
7.8534e-05
7.68814e-05
7.51844e-05
7.34374e-05
7.1636e-05
6.97743e-05
6.78476e-05
6.58497e-05
6.37759e-05
6.16191e-05
5.93748e-05
5.7035e-05
5.45947e-05
5.20443e-05
4.93782e-05
4.65838e-05
4.36539e-05
4.05726e-05
3.73319e-05
3.39167e-05
3.03258e-05
2.65592e-05
2.26426e-05
1.85919e-05
1.44599e-05
1.02731e-05
6.11008e-06
2.00495e-06
-1.94539e-06
-5.70837e-06
-9.20115e-06
-1.24344e-05
-1.53934e-05
-1.81302e-05
-2.06966e-05
-2.3193e-05
-2.57394e-05
-2.84896e-05
-3.15991e-05
-3.52662e-05
-3.96809e-05
-4.51346e-05
-5.19786e-05
-6.06063e-05
-7.14064e-05
-8.44293e-05
-9.89702e-05
-0.000113649
-0.000125657
-0.000134073
-0.000139615
-0.00014308
-0.000144221
-0.000149414
-0.000146997
-0.000142949
-0.000135967
-0.000120457
-9.91321e-05
-7.12421e-05
-4.21621e-05
-1.38278e-05
1.08639e-05
3.18929e-05
4.93266e-05
6.37867e-05
7.57182e-05
8.55255e-05
9.34186e-05
9.96227e-05
0.000104308
0.000107705
0.000109988
0.000111385
0.000112005
0.000112052
0.000111574
0.000110761
0.000109644
0.000108377
0.000106972
0.000105524
0.000104029
0.000102536
0.000101036
9.95505e-05
9.80699e-05
9.66033e-05
9.5142e-05
9.36882e-05
9.22352e-05
9.07818e-05
8.93221e-05
8.78538e-05
8.63714e-05
8.48718e-05
8.33497e-05
8.18019e-05
8.02227e-05
7.86087e-05
7.69542e-05
7.52554e-05
7.35064e-05
7.17028e-05
6.98388e-05
6.79095e-05
6.59086e-05
6.38315e-05
6.16709e-05
5.94223e-05
5.70777e-05
5.46323e-05
5.20761e-05
4.94037e-05
4.66019e-05
4.36638e-05
4.05719e-05
3.73181e-05
3.38854e-05
3.02722e-05
2.64772e-05
2.25285e-05
1.84404e-05
1.42701e-05
1.00404e-05
5.83686e-06
1.68862e-06
-2.29754e-06
-6.0944e-06
-9.6077e-06
-1.28549e-05
-1.58146e-05
-1.85434e-05
-2.10897e-05
-2.35548e-05
-2.6054e-05
-2.87388e-05
-3.17587e-05
-3.53146e-05
-3.95962e-05
-4.49093e-05
-5.16321e-05
-6.02089e-05
-7.11027e-05
-8.44349e-05
-9.9533e-05
-0.000114988
-0.000127687
-0.000136508
-0.000142296
-0.000145857
-0.000147139
-0.000152565
-0.000150494
-0.000146551
-0.000139708
-0.00012348
-0.000101148
-7.19503e-05
-4.17898e-05
-1.26435e-05
1.24813e-05
3.37064e-05
5.11747e-05
6.55919e-05
7.74437e-05
8.71606e-05
9.49532e-05
0.000101052
0.000105623
0.000108905
0.000111069
0.000112351
0.000112853
0.000112795
0.000112207
0.000111302
0.000110095
0.000108758
0.00010729
0.000105794
0.000104259
0.000102736
0.000101209
9.97048e-05
9.8208e-05
9.67289e-05
9.52571e-05
9.37952e-05
9.23353e-05
9.08765e-05
8.94122e-05
8.79403e-05
8.64547e-05
8.49526e-05
8.34282e-05
8.18784e-05
8.02975e-05
7.86819e-05
7.70258e-05
7.53254e-05
7.35746e-05
7.17692e-05
6.9903e-05
6.79713e-05
6.59677e-05
6.38874e-05
6.17232e-05
5.94707e-05
5.71216e-05
5.46714e-05
5.21097e-05
4.94316e-05
4.6623e-05
4.36774e-05
4.05758e-05
3.73102e-05
3.3861e-05
3.02265e-05
2.64041e-05
2.24247e-05
1.83004e-05
1.40931e-05
9.82178e-06
5.57911e-06
1.38835e-06
-2.63275e-06
-6.46384e-06
-9.9978e-06
-1.32602e-05
-1.62223e-05
-1.89465e-05
-2.14777e-05
-2.39191e-05
-2.63811e-05
-2.90131e-05
-3.19553e-05
-3.54087e-05
-3.95594e-05
-4.47251e-05
-5.13086e-05
-5.98047e-05
-7.07589e-05
-8.43748e-05
-0.000100024
-0.00011628
-0.000129704
-0.000138941
-0.000144972
-0.000148609
-0.000150026
-0.000155688
-0.000153998
-0.000150177
-0.000143498
-0.000126503
-0.000103108
-7.25569e-05
-4.13054e-05
-1.13614e-05
1.41662e-05
3.55573e-05
5.30352e-05
6.73919e-05
7.9153e-05
8.87734e-05
9.64615e-05
0.000102453
0.000106909
0.000110074
0.000112117
0.000113286
0.00011367
0.000113508
0.000112811
0.000111815
0.00011052
0.000109115
0.000107586
0.000106046
0.000104472
0.000102921
0.000101371
9.98485e-05
9.83367e-05
9.68464e-05
9.53653e-05
9.38961e-05
9.24302e-05
9.09667e-05
8.94985e-05
8.80234e-05
8.65351e-05
8.50309e-05
8.35047e-05
8.19533e-05
8.03709e-05
7.8754e-05
7.70965e-05
7.53948e-05
7.36425e-05
7.18355e-05
6.99674e-05
6.80336e-05
6.60273e-05
6.39442e-05
6.17766e-05
5.95204e-05
5.7167e-05
5.47123e-05
5.21456e-05
4.94622e-05
4.66474e-05
4.36951e-05
4.05848e-05
3.73084e-05
3.3844e-05
3.01894e-05
2.63409e-05
2.2332e-05
1.81729e-05
1.39305e-05
9.61883e-06
5.3388e-06
1.10649e-06
-2.9483e-06
-6.81362e-06
-1.03679e-05
-1.36465e-05
-1.66123e-05
-1.9335e-05
-2.18552e-05
-2.42796e-05
-2.67141e-05
-2.93058e-05
-3.21842e-05
-3.55468e-05
-3.95721e-05
-4.45876e-05
-5.10168e-05
-5.94037e-05
-7.03824e-05
-8.42521e-05
-0.000100442
-0.000117521
-0.000131707
-0.00014137
-0.000147639
-0.00015133
-0.000152875
-0.000158775
-0.000157503
-0.000153825
-0.000147334
-0.000129521
-0.000105005
-7.30572e-05
-4.07081e-05
-9.98419e-06
1.59136e-05
3.744e-05
5.49033e-05
6.91831e-05
8.08434e-05
9.03619e-05
9.79425e-05
0.000103824
0.000108164
0.000111213
0.000113135
0.000114191
0.000114457
0.000114193
0.000113386
0.000112301
0.000110919
0.00010945
0.000107862
0.00010628
0.000104669
0.000103093
0.00010152
9.99822e-05
9.84569e-05
9.69566e-05
9.54671e-05
9.39917e-05
9.25204e-05
9.10529e-05
8.95813e-05
8.81036e-05
8.66131e-05
8.51072e-05
8.35794e-05
8.20269e-05
8.04432e-05
7.88253e-05
7.71668e-05
7.5464e-05
7.37104e-05
7.1902e-05
7.00322e-05
6.80965e-05
6.60879e-05
6.40022e-05
6.18314e-05
5.95718e-05
5.72145e-05
5.47556e-05
5.21841e-05
4.94959e-05
4.66755e-05
4.37174e-05
4.05993e-05
3.73133e-05
3.38349e-05
3.01614e-05
2.62879e-05
2.22512e-05
1.80587e-05
1.3783e-05
9.43274e-06
5.1174e-06
8.44804e-07
-3.24202e-06
-7.1412e-06
-1.07152e-05
-1.40107e-05
-1.69812e-05
-1.97048e-05
-2.22178e-05
-2.46309e-05
-2.70463e-05
-2.96097e-05
-3.24389e-05
-3.57251e-05
-3.96344e-05
-4.45006e-05
-5.07645e-05
-5.90163e-05
-6.99818e-05
-8.40707e-05
-0.000100786
-0.00011871
-0.000133695
-0.000143795
-0.000150296
-0.000154018
-0.000155681
-0.000161822
-0.000161006
-0.000157492
-0.000151211
-0.000132528
-0.00010683
-7.34473e-05
-3.99978e-05
-8.51535e-06
1.77185e-05
3.93494e-05
5.67744e-05
7.09616e-05
8.25124e-05
9.19247e-05
9.93952e-05
0.000105166
0.000109388
0.00011232
0.000114121
0.000115065
0.000115215
0.00011485
0.000113933
0.000112762
0.000111294
0.000109763
0.000108119
0.000106498
0.000104852
0.000103252
0.000101659
0.000100107
9.85692e-05
9.70602e-05
9.55633e-05
9.40823e-05
9.26065e-05
9.11355e-05
8.96611e-05
8.81813e-05
8.6689e-05
8.51818e-05
8.36528e-05
8.20994e-05
8.05149e-05
7.88963e-05
7.72369e-05
7.55332e-05
7.37787e-05
7.19691e-05
7.00979e-05
6.81605e-05
6.61498e-05
6.40617e-05
6.1888e-05
5.96253e-05
5.72642e-05
5.48015e-05
5.22256e-05
4.95331e-05
4.67076e-05
4.37444e-05
4.06194e-05
3.7325e-05
3.38339e-05
3.01428e-05
2.62454e-05
2.21824e-05
1.79582e-05
1.36513e-05
9.26422e-06
4.91585e-06
6.0451e-07
-3.51236e-06
-7.44468e-06
-1.10373e-05
-1.435e-05
-1.7326e-05
-2.00526e-05
-2.25615e-05
-2.49682e-05
-2.73718e-05
-2.99177e-05
-3.27123e-05
-3.59382e-05
-3.97445e-05
-4.44662e-05
-5.05579e-05
-5.86522e-05
-6.95668e-05
-8.38361e-05
-0.000101056
-0.000119843
-0.000135664
-0.000146213
-0.000152942
-0.000156668
-0.000158438
-0.000164823
-0.0001645
-0.000161175
-0.000155127
-0.000135518
-0.000108578
-7.37238e-05
-3.91751e-05
-6.95892e-06
1.95753e-05
4.12798e-05
5.86439e-05
7.27243e-05
8.41579e-05
9.34603e-05
0.000100819
0.000106478
0.000110582
0.000113397
0.000115076
0.00011591
0.000115943
0.00011548
0.000114453
0.000113198
0.000111646
0.000110055
0.000108356
0.000106699
0.000105022
0.0001034
0.000101788
0.000100223
9.86744e-05
9.71576e-05
9.56542e-05
9.41686e-05
9.26889e-05
9.12151e-05
8.97383e-05
8.82569e-05
8.67632e-05
8.5255e-05
8.37252e-05
8.21712e-05
8.05861e-05
7.8967e-05
7.7307e-05
7.56028e-05
7.38475e-05
7.2037e-05
7.01646e-05
6.82258e-05
6.62132e-05
6.4123e-05
6.19466e-05
5.9681e-05
5.73164e-05
5.48502e-05
5.22703e-05
4.95739e-05
4.67439e-05
4.37763e-05
4.06453e-05
3.73437e-05
3.3841e-05
3.01334e-05
2.62136e-05
2.21258e-05
1.78715e-05
1.35356e-05
9.11359e-06
4.7346e-06
3.86302e-07
-3.75833e-06
-7.72273e-06
-1.13325e-05
-1.46624e-05
-1.76445e-05
-2.03758e-05
-2.28832e-05
-2.52877e-05
-2.76853e-05
-3.02231e-05
-3.29965e-05
-3.61794e-05
-3.98988e-05
-4.44849e-05
-5.04016e-05
-5.83206e-05
-6.91479e-05
-8.35547e-05
-0.000101254
-0.000120918
-0.000137614
-0.000148625
-0.000155573
-0.000159275
-0.000161141
-0.000167772
-0.000167982
-0.000164872
-0.000159077
-0.000138485
-0.000110242
-7.38842e-05
-3.82419e-05
-5.31959e-06
2.1478e-05
4.32258e-05
6.05075e-05
7.44679e-05
8.57777e-05
9.49676e-05
0.000102213
0.00010776
0.000111745
0.000114443
0.000116001
0.000116726
0.000116642
0.000116084
0.000114947
0.00011361
0.000111974
0.000110328
0.000108577
0.000106886
0.000105178
0.000103537
0.000101908
0.000100331
9.87729e-05
9.72496e-05
9.57404e-05
9.42509e-05
9.27679e-05
9.12919e-05
8.98133e-05
8.83307e-05
8.6836e-05
8.53272e-05
8.37968e-05
8.22425e-05
8.06571e-05
7.90378e-05
7.73775e-05
7.5673e-05
7.39171e-05
7.2106e-05
7.02325e-05
6.82925e-05
6.62783e-05
6.41862e-05
6.20075e-05
5.97392e-05
5.73715e-05
5.4902e-05
5.23183e-05
4.96185e-05
4.67844e-05
4.3813e-05
4.06769e-05
3.73692e-05
3.38561e-05
3.01333e-05
2.61922e-05
2.20811e-05
1.77986e-05
1.34356e-05
8.98081e-06
4.5737e-06
1.9039e-07
-3.97951e-06
-7.97463e-06
-1.15996e-05
-1.49466e-05
-1.79348e-05
-2.06723e-05
-2.31806e-05
-2.55862e-05
-2.79828e-05
-3.05199e-05
-3.32842e-05
-3.64407e-05
-4.00915e-05
-4.45553e-05
-5.02984e-05
-5.80289e-05
-6.87357e-05
-8.32346e-05
-0.00010138
-0.000121932
-0.000139542
-0.000151029
-0.00015819
-0.000161837
-0.000163786
-0.000170665
-0.000171447
-0.00016858
-0.000163056
-0.000141423
-0.000111816
-7.39269e-05
-3.72003e-05
-3.60259e-06
2.34208e-05
4.51819e-05
6.23611e-05
7.61895e-05
8.73702e-05
9.64456e-05
0.000103576
0.000109011
0.000112877
0.000115458
0.000116896
0.000117513
0.000117313
0.000116662
0.000115414
0.000113999
0.00011228
0.000110581
0.00010878
0.000107058
0.000105322
0.000103663
0.000102019
0.000100433
9.88654e-05
9.73364e-05
9.58224e-05
9.43297e-05
9.28441e-05
9.13664e-05
8.98863e-05
8.84029e-05
8.69076e-05
8.53985e-05
8.38679e-05
8.23136e-05
8.07281e-05
7.91089e-05
7.74485e-05
7.57438e-05
7.39876e-05
7.21761e-05
7.03019e-05
6.8361e-05
6.63454e-05
6.42516e-05
6.20707e-05
5.98001e-05
5.74294e-05
5.4957e-05
5.23698e-05
4.96669e-05
4.68291e-05
4.38547e-05
4.07142e-05
3.74015e-05
3.38792e-05
3.01423e-05
2.6181e-05
2.20482e-05
1.77389e-05
1.33511e-05
8.86555e-06
4.43283e-06
1.65674e-08
-4.17595e-06
-8.20018e-06
-1.18381e-05
-1.52015e-05
-1.81958e-05
-2.09408e-05
-2.34519e-05
-2.58615e-05
-2.82608e-05
-3.08034e-05
-3.35682e-05
-3.67137e-05
-4.03156e-05
-4.4674e-05
-5.02496e-05
-5.7783e-05
-6.83405e-05
-8.28849e-05
-0.000101439
-0.000122884
-0.000141446
-0.000153424
-0.000160789
-0.00016435
-0.000166367
-0.000173498
-0.00017489
-0.000172295
-0.00016706
-0.000144326
-0.000113294
-7.38509e-05
-3.60536e-05
-1.8136e-06
2.53974e-05
4.71429e-05
6.42006e-05
7.78865e-05
8.89339e-05
9.78936e-05
0.000104909
0.000110232
0.000113978
0.000116443
0.00011776
0.000118271
0.000117956
0.000117214
0.000115857
0.000114365
0.000112566
0.000110816
0.000108967
0.000107217
0.000105455
0.000103781
0.000102122
0.000100527
9.89525e-05
9.74187e-05
9.59006e-05
9.44054e-05
9.29176e-05
9.14387e-05
8.99577e-05
8.84739e-05
8.69782e-05
8.54692e-05
8.39386e-05
8.23846e-05
8.07993e-05
7.91803e-05
7.75201e-05
7.58156e-05
7.40593e-05
7.22476e-05
7.03729e-05
6.84312e-05
6.64145e-05
6.43193e-05
6.21365e-05
5.98637e-05
5.74903e-05
5.50153e-05
5.24249e-05
4.97192e-05
4.68782e-05
4.39013e-05
4.07571e-05
3.74403e-05
3.39099e-05
3.01598e-05
2.61795e-05
2.20265e-05
1.76922e-05
1.32816e-05
8.76724e-06
4.31139e-06
-1.35723e-07
-4.34814e-06
-8.39967e-06
-1.20482e-05
-1.5427e-05
-1.8427e-05
-2.11803e-05
-2.36959e-05
-2.61119e-05
-2.85171e-05
-3.10695e-05
-3.38427e-05
-3.69904e-05
-4.05628e-05
-4.48362e-05
-5.02545e-05
-5.75869e-05
-6.79716e-05
-8.25157e-05
-0.000101433
-0.000123773
-0.000143324
-0.000155808
-0.000163369
-0.000166812
-0.00016888
-0.000176266
-0.000178307
-0.000176015
-0.000171083
-0.000147187
-0.000114672
-7.36561e-05
-3.48057e-05
4.12469e-08
2.74015e-05
4.91036e-05
6.60224e-05
7.95567e-05
9.04676e-05
9.9311e-05
0.000106212
0.000111422
0.000115049
0.000117398
0.000118595
0.000119002
0.000118572
0.000117743
0.000116275
0.000114709
0.00011283
0.000111034
0.00010914
0.000107364
0.000105577
0.000103889
0.000102218
0.000100616
9.90345e-05
9.74969e-05
9.59754e-05
9.44782e-05
9.29888e-05
9.15092e-05
9.00276e-05
8.85437e-05
8.70481e-05
8.55394e-05
8.40092e-05
8.24556e-05
8.08707e-05
7.92523e-05
7.75924e-05
7.58883e-05
7.41322e-05
7.23205e-05
7.04455e-05
6.85033e-05
6.64857e-05
6.43894e-05
6.22048e-05
5.99302e-05
5.75544e-05
5.50769e-05
5.24836e-05
4.97754e-05
4.69315e-05
4.39526e-05
4.08054e-05
3.74855e-05
3.3948e-05
3.01857e-05
2.61874e-05
2.20155e-05
1.76577e-05
1.32262e-05
8.68515e-06
4.20853e-06
-2.67319e-07
-4.49692e-06
-8.5738e-06
-1.22302e-05
-1.56231e-05
-1.86282e-05
-2.13906e-05
-2.3912e-05
-2.63365e-05
-2.875e-05
-3.13156e-05
-3.41028e-05
-3.72634e-05
-4.08242e-05
-4.50348e-05
-5.03111e-05
-5.7443e-05
-6.76366e-05
-8.21379e-05
-0.000101369
-0.000124596
-0.000145172
-0.000158181
-0.000165929
-0.000169218
-0.000171322
-0.000178965
-0.000181694
-0.000179736
-0.000175121
-0.000150001
-0.000115945
-7.33434e-05
-3.34612e-05
1.95558e-06
2.94271e-05
5.10592e-05
6.78232e-05
8.11979e-05
9.19701e-05
0.000100697
0.000107484
0.000112582
0.00011609
0.000118324
0.000119402
0.000119705
0.000119162
0.000118248
0.000116668
0.000115032
0.000113075
0.000111236
0.000109298
0.000107498
0.00010569
0.00010399
0.000102307
0.000100699
9.91119e-05
9.75712e-05
9.6047e-05
9.45485e-05
9.3058e-05
9.1578e-05
9.00962e-05
8.86127e-05
8.71173e-05
8.56093e-05
8.40796e-05
8.25268e-05
8.09426e-05
7.93249e-05
7.76656e-05
7.59621e-05
7.42063e-05
7.23948e-05
7.05198e-05
6.85774e-05
6.65591e-05
6.44619e-05
6.22758e-05
5.99996e-05
5.76215e-05
5.51419e-05
5.25459e-05
4.98355e-05
4.69889e-05
4.40084e-05
4.08588e-05
3.75366e-05
3.3993e-05
3.02194e-05
2.6204e-05
2.20145e-05
1.76349e-05
1.31843e-05
8.61842e-06
4.12325e-06
-3.79269e-07
-4.62341e-06
-8.7236e-06
-1.23851e-05
-1.57905e-05
-1.87998e-05
-2.15716e-05
-2.41001e-05
-2.65348e-05
-2.89586e-05
-3.15398e-05
-3.43449e-05
-3.75264e-05
-4.10913e-05
-4.52619e-05
-5.04157e-05
-5.73521e-05
-6.73413e-05
-8.17623e-05
-0.000101253
-0.000125353
-0.000146989
-0.000160541
-0.000168467
-0.000171568
-0.000173689
-0.000181592
-0.000185046
-0.000183457
-0.000179167
-0.000152761
-0.000117109
-7.29145e-05
-3.20252e-05
3.92271e-06
3.14678e-05
5.30048e-05
6.95999e-05
8.28085e-05
9.34409e-05
0.000102053
0.000108725
0.000113712
0.000117101
0.00011922
0.000120179
0.000120382
0.000119727
0.00011873
0.000117039
0.000115334
0.000113302
0.000111421
0.000109442
0.000107622
0.000105793
0.000104083
0.00010239
0.000100777
9.9185e-05
9.76421e-05
9.61158e-05
9.46164e-05
9.31253e-05
9.16454e-05
9.01638e-05
8.86808e-05
8.71861e-05
8.56789e-05
8.415e-05
8.25982e-05
8.10148e-05
7.93982e-05
7.77396e-05
7.60369e-05
7.42817e-05
7.24707e-05
7.05958e-05
6.86534e-05
6.66346e-05
6.45368e-05
6.23495e-05
6.00719e-05
5.76918e-05
5.52102e-05
5.26117e-05
4.98993e-05
4.70504e-05
4.40687e-05
4.09171e-05
3.75935e-05
3.40447e-05
3.02604e-05
2.62289e-05
2.2023e-05
1.76229e-05
1.3155e-05
8.5661e-06
4.05444e-06
-4.72766e-07
-4.72893e-06
-8.85036e-06
-1.2514e-05
-1.59302e-05
-1.89427e-05
-2.17241e-05
-2.42605e-05
-2.67068e-05
-2.91425e-05
-3.17409e-05
-3.45665e-05
-3.77743e-05
-4.13559e-05
-4.55082e-05
-5.05626e-05
-5.73137e-05
-6.70896e-05
-8.13991e-05
-0.000101093
-0.000126045
-0.000148772
-0.000162886
-0.000170983
-0.000173858
-0.000175977
-0.000184144
-0.000188359
-0.000187172
-0.000183217
-0.000155464
-0.000118162
-7.23716e-05
-3.05034e-05
5.93587e-06
3.35178e-05
5.49361e-05
7.13496e-05
8.43868e-05
9.48792e-05
0.000103377
0.000109936
0.000114812
0.000118083
0.000120087
0.000120929
0.000121033
0.000120266
0.00011919
0.000117387
0.000115616
0.00011351
0.000111592
0.000109574
0.000107735
0.000105888
0.000104169
0.000102467
0.00010085
9.92544e-05
9.77098e-05
9.6182e-05
9.46823e-05
9.3191e-05
9.17116e-05
9.02304e-05
8.87483e-05
8.72544e-05
8.57483e-05
8.42205e-05
8.26699e-05
8.10876e-05
7.94721e-05
7.78146e-05
7.61128e-05
7.43584e-05
7.25481e-05
7.06736e-05
6.87314e-05
6.67124e-05
6.46141e-05
6.24258e-05
6.01471e-05
5.77653e-05
5.52819e-05
5.26812e-05
4.9967e-05
4.71159e-05
4.41333e-05
4.09802e-05
3.76558e-05
3.41024e-05
3.03082e-05
2.62614e-05
2.20402e-05
1.76211e-05
1.31374e-05
8.52722e-06
4.00094e-06
-5.49094e-07
-4.81494e-06
-8.95556e-06
-1.26185e-05
-1.60436e-05
-1.90581e-05
-2.18488e-05
-2.43938e-05
-2.68529e-05
-2.93019e-05
-3.19185e-05
-3.4766e-05
-3.80035e-05
-4.16112e-05
-4.57648e-05
-5.07449e-05
-5.7326e-05
-6.68834e-05
-8.1057e-05
-0.000100898
-0.000126673
-0.000150518
-0.000165214
-0.000173473
-0.000176086
-0.000178185
-0.000186618
-0.00019163
-0.00019088
-0.000187263
-0.000158103
-0.000119102
-7.1718e-05
-2.8902e-05
7.98811e-06
3.55711e-05
5.6849e-05
7.307e-05
8.59316e-05
9.62847e-05
0.000104669
0.000111117
0.000115883
0.000119036
0.000120925
0.000121651
0.000121658
0.000120781
0.000119628
0.000117713
0.00011588
0.000113701
0.000111748
0.000109694
0.000107839
0.000105974
0.000104249
0.000102539
0.000100919
9.93202e-05
9.77747e-05
9.62459e-05
9.47463e-05
9.32552e-05
9.17765e-05
9.02961e-05
8.88152e-05
8.73224e-05
8.58177e-05
8.42911e-05
8.27419e-05
8.11609e-05
7.95468e-05
7.78904e-05
7.61899e-05
7.44364e-05
7.2627e-05
7.07531e-05
6.88113e-05
6.67923e-05
6.46938e-05
6.25048e-05
6.02251e-05
5.78418e-05
5.53569e-05
5.27541e-05
5.00383e-05
4.71853e-05
4.42019e-05
4.10476e-05
3.7723e-05
3.4166e-05
3.03624e-05
2.6301e-05
2.20656e-05
1.76287e-05
1.31307e-05
8.50081e-06
3.96154e-06
-6.09576e-07
-4.88299e-06
-9.04081e-06
-1.27e-05
-1.61321e-05
-1.91473e-05
-2.1947e-05
-2.45012e-05
-2.69739e-05
-2.94372e-05
-3.20727e-05
-3.49426e-05
-3.82115e-05
-4.18516e-05
-4.60226e-05
-5.09543e-05
-5.73858e-05
-6.67236e-05
-8.07429e-05
-0.000100679
-0.000127239
-0.000152226
-0.000167525
-0.000175938
-0.000178252
-0.00018031
-0.000189013
-0.000194855
-0.000194578
-0.000191301
-0.000160673
-0.000119928
-7.09575e-05
-2.72275e-05
1.00726e-05
3.76221e-05
5.87397e-05
7.47589e-05
8.7442e-05
9.76572e-05
0.000105931
0.000112268
0.000116925
0.00011996
0.000121736
0.000122347
0.000122258
0.000121273
0.000120046
0.000118018
0.000116125
0.000113875
0.00011189
0.000109802
0.000107934
0.000106054
0.000104322
0.000102607
0.000100984
9.93827e-05
9.78368e-05
9.63076e-05
9.48086e-05
9.3318e-05
9.18404e-05
9.0361e-05
8.88816e-05
8.73901e-05
8.58869e-05
8.43618e-05
8.28143e-05
8.12347e-05
7.96221e-05
7.79671e-05
7.6268e-05
7.45157e-05
7.27074e-05
7.08343e-05
6.88931e-05
6.68743e-05
6.47758e-05
6.25863e-05
6.03059e-05
5.79212e-05
5.5435e-05
5.28304e-05
5.01131e-05
4.72583e-05
4.42744e-05
4.11193e-05
3.7795e-05
3.42348e-05
3.04223e-05
2.63471e-05
2.20984e-05
1.7645e-05
1.3134e-05
8.4859e-06
3.93509e-06
-6.55535e-07
-4.93464e-06
-9.10776e-06
-1.27605e-05
-1.61974e-05
-1.9212e-05
-2.20203e-05
-2.45838e-05
-2.70708e-05
-2.95492e-05
-3.22041e-05
-3.50963e-05
-3.83967e-05
-4.20731e-05
-4.6274e-05
-5.11816e-05
-5.74885e-05
-6.66097e-05
-8.04617e-05
-0.000100446
-0.000127747
-0.000153892
-0.000169815
-0.000178376
-0.000180354
-0.00018235
-0.000191328
-0.000198032
-0.000198261
-0.000195325
-0.000163171
-0.000120638
-7.00946e-05
-2.54866e-05
1.21823e-05
3.96656e-05
6.06047e-05
7.64142e-05
8.8917e-05
9.89964e-05
0.000107162
0.000113389
0.000117938
0.000120857
0.000122519
0.000123016
0.000122833
0.000121741
0.000120444
0.000118302
0.000116352
0.000114034
0.00011202
0.0001099
0.00010802
0.000106126
0.00010439
0.000102669
0.000101046
9.94423e-05
9.78966e-05
9.63674e-05
9.48693e-05
9.33795e-05
9.19034e-05
9.04253e-05
8.89475e-05
8.74575e-05
8.59561e-05
8.44326e-05
8.28869e-05
8.13089e-05
7.96981e-05
7.80446e-05
7.63471e-05
7.45961e-05
7.27891e-05
7.0917e-05
6.89767e-05
6.69583e-05
6.48601e-05
6.26702e-05
6.03893e-05
5.80036e-05
5.55163e-05
5.291e-05
5.01914e-05
4.73349e-05
4.43506e-05
4.11948e-05
3.78713e-05
3.43086e-05
3.04875e-05
2.63991e-05
2.2138e-05
1.76693e-05
1.31465e-05
8.48158e-06
3.92044e-06
-6.88262e-07
-4.97147e-06
-9.15809e-06
-1.28016e-05
-1.62415e-05
-1.92541e-05
-2.20702e-05
-2.46431e-05
-2.71449e-05
-2.9639e-05
-3.23134e-05
-3.52275e-05
-3.85588e-05
-4.22728e-05
-4.65123e-05
-5.14177e-05
-5.76281e-05
-6.65405e-05
-8.0216e-05
-0.000100209
-0.0001282
-0.000155515
-0.000172084
-0.000180785
-0.000182391
-0.000184305
-0.000193559
-0.000201156
-0.000201926
-0.000199328
-0.000165592
-0.000121233
-6.91343e-05
-2.36865e-05
1.43106e-05
4.16963e-05
6.24408e-05
7.80345e-05
9.03562e-05
0.000100303
0.000108362
0.000114482
0.000118922
0.000121726
0.000123276
0.00012366
0.000123385
0.000122188
0.000120821
0.000118566
0.000116561
0.000114177
0.000112137
0.000109989
0.000108098
0.000106193
0.000104453
0.000102728
0.000101104
9.94991e-05
9.79541e-05
9.64253e-05
9.49285e-05
9.34399e-05
9.19654e-05
9.04888e-05
8.90129e-05
8.75246e-05
8.60252e-05
8.45036e-05
8.29597e-05
8.13836e-05
7.97747e-05
7.81229e-05
7.64271e-05
7.46777e-05
7.28721e-05
7.10012e-05
6.90619e-05
6.70442e-05
6.49464e-05
6.27565e-05
6.04753e-05
5.80888e-05
5.56005e-05
5.29927e-05
5.0273e-05
4.74149e-05
4.44303e-05
4.12739e-05
3.79516e-05
3.43867e-05
3.05575e-05
2.64565e-05
2.21838e-05
1.7701e-05
1.31675e-05
8.48697e-06
3.91653e-06
-7.08989e-07
-4.995e-06
-9.19345e-06
-1.28253e-05
-1.62661e-05
-1.92754e-05
-2.20985e-05
-2.46808e-05
-2.71976e-05
-2.97079e-05
-3.24016e-05
-3.53369e-05
-3.86977e-05
-4.24492e-05
-4.67326e-05
-5.16539e-05
-5.77973e-05
-6.65139e-05
-8.00069e-05
-9.99767e-05
-0.000128606
-0.000157093
-0.000174327
-0.000183163
-0.000184363
-0.000186173
-0.000195708
-0.000204226
-0.000205571
-0.000203305
-0.000167932
-0.000121715
-6.80823e-05
-2.18344e-05
1.64509e-05
4.37097e-05
6.42452e-05
7.96182e-05
9.17591e-05
0.000101576
0.000109532
0.000115545
0.00011988
0.000122567
0.000124005
0.000124278
0.000123913
0.000122613
0.00012118
0.000118811
0.000116754
0.000114306
0.000112243
0.000110068
0.000108168
0.000106253
0.000104512
0.000102782
0.000101159
9.95534e-05
9.80094e-05
9.64814e-05
9.49862e-05
9.34991e-05
9.20265e-05
9.05517e-05
8.90778e-05
8.75915e-05
8.60942e-05
8.45745e-05
8.30328e-05
8.14587e-05
7.98518e-05
7.82019e-05
7.6508e-05
7.47603e-05
7.29564e-05
7.10868e-05
6.91488e-05
6.71319e-05
6.50348e-05
6.2845e-05
6.05638e-05
5.81766e-05
5.56876e-05
5.30785e-05
5.03577e-05
4.74982e-05
4.45133e-05
4.13564e-05
3.80355e-05
3.44689e-05
3.06318e-05
2.65187e-05
2.22353e-05
1.77395e-05
1.31962e-05
8.50128e-06
3.92234e-06
-7.18872e-07
-5.00665e-06
-9.21556e-06
-1.28331e-05
-1.62732e-05
-1.92778e-05
-2.21072e-05
-2.46987e-05
-2.72305e-05
-2.97571e-05
-3.24702e-05
-3.54258e-05
-3.88141e-05
-4.26018e-05
-4.69314e-05
-5.18823e-05
-5.79877e-05
-6.6527e-05
-7.98339e-05
-9.97568e-05
-0.00012897
-0.000158625
-0.000176545
-0.00018551
-0.000186268
-0.000187954
-0.000197774
-0.000207239
-0.00020919
-0.00020725
-0.000170188
-0.000122084
-6.69445e-05
-1.99373e-05
1.85967e-05
4.57011e-05
6.60152e-05
8.11643e-05
9.31254e-05
0.000102816
0.000110672
0.000116581
0.00012081
0.000123383
0.000124709
0.000124873
0.000124419
0.000123016
0.000121521
0.000119037
0.00011693
0.000114422
0.000112338
0.000110138
0.000108232
0.000106308
0.000104565
0.000102834
0.00010121
9.96053e-05
9.80628e-05
9.6536e-05
9.50427e-05
9.35573e-05
9.20868e-05
9.06139e-05
8.91423e-05
8.76581e-05
8.6163e-05
8.46455e-05
8.3106e-05
8.1534e-05
7.99293e-05
7.82814e-05
7.65896e-05
7.48438e-05
7.30417e-05
7.11737e-05
6.92371e-05
6.72212e-05
6.5125e-05
6.29356e-05
6.06545e-05
5.82669e-05
5.57774e-05
5.31671e-05
5.04454e-05
4.75844e-05
4.45993e-05
4.1442e-05
3.81227e-05
3.45547e-05
3.071e-05
2.65854e-05
2.2292e-05
1.77842e-05
1.3232e-05
8.52376e-06
3.93697e-06
-7.18991e-07
-5.00773e-06
-9.22618e-06
-1.28269e-05
-1.62647e-05
-1.92632e-05
-2.20981e-05
-2.46984e-05
-2.72451e-05
-2.97884e-05
-3.25204e-05
-3.54952e-05
-3.8909e-05
-4.27306e-05
-4.71065e-05
-5.20965e-05
-5.81906e-05
-6.65759e-05
-7.96959e-05
-9.95542e-05
-0.000129301
-0.000160111
-0.000178733
-0.000187824
-0.000188107
-0.000189648
-0.000199756
-0.000210192
-0.000212783
-0.000211158
-0.000172359
-0.000122344
-6.57273e-05
-1.80027e-05
2.07419e-05
4.76666e-05
6.77488e-05
8.26718e-05
9.4455e-05
0.000104024
0.000111782
0.000117589
0.000121713
0.000124172
0.000125388
0.000125443
0.000124902
0.0001234
0.000121844
0.000119245
0.000117091
0.000114524
0.000112422
0.0001102
0.00010829
0.000106358
0.000104615
0.000102882
0.00010126
9.96549e-05
9.81143e-05
9.6589e-05
9.50978e-05
9.36144e-05
9.21462e-05
9.06755e-05
8.92062e-05
8.77242e-05
8.62316e-05
8.47163e-05
8.31793e-05
8.16095e-05
8.00071e-05
7.83615e-05
7.66718e-05
7.4928e-05
7.31279e-05
7.12616e-05
6.93266e-05
6.73121e-05
6.52169e-05
6.3028e-05
6.07474e-05
5.83596e-05
5.58697e-05
5.32584e-05
5.05359e-05
4.76736e-05
4.46881e-05
4.15304e-05
3.82129e-05
3.46437e-05
3.07915e-05
2.66559e-05
2.23534e-05
1.78346e-05
1.32744e-05
8.55374e-06
3.95963e-06
-7.10395e-07
-4.99944e-06
-9.22684e-06
-1.28082e-05
-1.62424e-05
-1.92336e-05
-2.20733e-05
-2.46819e-05
-2.72432e-05
-2.98031e-05
-3.25538e-05
-3.55467e-05
-3.89837e-05
-4.28364e-05
-4.72569e-05
-5.22918e-05
-5.83975e-05
-6.66555e-05
-7.95916e-05
-9.93717e-05
-0.000129607
-0.000161549
-0.000180889
-0.000190104
-0.00018988
-0.000191255
-0.000201654
-0.000213084
-0.000216343
-0.000215023
-0.000174442
-0.000122497
-6.44373e-05
-1.60375e-05
2.28807e-05
4.96023e-05
6.94438e-05
8.414e-05
9.57479e-05
0.0001052
0.000112864
0.000118569
0.00012259
0.000124936
0.000126042
0.000125991
0.000125364
0.000123765
0.00012215
0.000119436
0.000117237
0.000114615
0.000112496
0.000110255
0.000108341
0.000106404
0.000104661
0.000102926
0.000101306
9.97025e-05
9.81641e-05
9.66406e-05
9.51518e-05
9.36705e-05
9.22048e-05
9.07364e-05
8.92696e-05
8.779e-05
8.62999e-05
8.47871e-05
8.32525e-05
8.16851e-05
8.00852e-05
7.84418e-05
7.67545e-05
7.50129e-05
7.32149e-05
7.13505e-05
6.94173e-05
6.74042e-05
6.53103e-05
6.31222e-05
6.08422e-05
5.84543e-05
5.59643e-05
5.33522e-05
5.0629e-05
4.77654e-05
4.47797e-05
4.16215e-05
3.83058e-05
3.47355e-05
3.0876e-05
2.673e-05
2.2419e-05
1.78903e-05
1.33227e-05
8.59062e-06
3.98962e-06
-6.94032e-07
-4.98296e-06
-9.21888e-06
-1.27784e-05
-1.62079e-05
-1.91907e-05
-2.20345e-05
-2.4651e-05
-2.72266e-05
-2.98028e-05
-3.2572e-05
-3.55819e-05
-3.90397e-05
-4.29204e-05
-4.73826e-05
-5.24646e-05
-5.86003e-05
-6.67596e-05
-7.95191e-05
-9.921e-05
-0.000129897
-0.000162941
-0.000183012
-0.000192346
-0.000191587
-0.000192778
-0.000203471
-0.000215913
-0.00021987
-0.00021884
-0.000176435
-0.000122547
-6.30813e-05
-1.4049e-05
2.50074e-05
5.15049e-05
7.10986e-05
8.55683e-05
9.70043e-05
0.000106345
0.000113917
0.000119523
0.000123442
0.000125675
0.000126672
0.000126516
0.000125805
0.00012411
0.000122439
0.00011961
0.000117368
0.000114694
0.000112561
0.000110303
0.000108387
0.000106445
0.000104703
0.000102968
0.000101351
9.97482e-05
9.82122e-05
9.66908e-05
9.52045e-05
9.37256e-05
9.22625e-05
9.07966e-05
8.93324e-05
8.78553e-05
8.63679e-05
8.48575e-05
8.33256e-05
8.17607e-05
8.01633e-05
7.85224e-05
7.68376e-05
7.50983e-05
7.33025e-05
7.14402e-05
6.95089e-05
6.74974e-05
6.5405e-05
6.32179e-05
6.09386e-05
5.8551e-05
5.6061e-05
5.34483e-05
5.07245e-05
4.78598e-05
4.48736e-05
4.17149e-05
3.8401e-05
3.48298e-05
3.0963e-05
2.68072e-05
2.24886e-05
1.79509e-05
1.33766e-05
8.63383e-06
4.02623e-06
-6.70702e-07
-4.95934e-06
-9.2035e-06
-1.27391e-05
-1.61628e-05
-1.91362e-05
-2.19837e-05
-2.46075e-05
-2.7197e-05
-2.97891e-05
-3.25763e-05
-3.56023e-05
-3.90786e-05
-4.2984e-05
-4.74842e-05
-5.26132e-05
-5.87921e-05
-6.68815e-05
-7.94764e-05
-9.90679e-05
-0.000130179
-0.000164288
-0.000185098
-0.000194551
-0.000193229
-0.000194216
-0.000205207
-0.000218677
-0.000223359
-0.000222605
-0.000178337
-0.000122499
-6.16661e-05
-1.20439e-05
2.71167e-05
5.33712e-05
7.27117e-05
8.69563e-05
9.82243e-05
0.000107457
0.000114942
0.000120451
0.000124268
0.000126391
0.000127279
0.000127019
0.000126226
0.000124437
0.000122712
0.000119767
0.000117486
0.000114762
0.000112618
0.000110345
0.000108427
0.000106482
0.000104743
0.000103008
0.000101393
9.9792e-05
9.82587e-05
9.67396e-05
9.52561e-05
9.37796e-05
9.23193e-05
9.0856e-05
8.93946e-05
8.79201e-05
8.64354e-05
8.49277e-05
8.33984e-05
8.18361e-05
8.02415e-05
7.86031e-05
7.69208e-05
7.51839e-05
7.33906e-05
7.15305e-05
6.96013e-05
6.75916e-05
6.55008e-05
6.3315e-05
6.10366e-05
5.86495e-05
5.61596e-05
5.35465e-05
5.08222e-05
4.79563e-05
4.49697e-05
4.18104e-05
3.84982e-05
3.49261e-05
3.10523e-05
2.68872e-05
2.25617e-05
1.80159e-05
1.34356e-05
8.68285e-06
4.06886e-06
-6.41109e-07
-4.92952e-06
-9.18177e-06
-1.26916e-05
-1.61085e-05
-1.90719e-05
-2.19223e-05
-2.45532e-05
-2.7156e-05
-2.97637e-05
-3.25684e-05
-3.56094e-05
-3.91021e-05
-4.30287e-05
-4.75629e-05
-5.27367e-05
-5.89674e-05
-6.70139e-05
-7.94611e-05
-9.8943e-05
-0.00013046
-0.000165593
-0.000187145
-0.000196717
-0.000194806
-0.000195571
-0.000206863
-0.000221377
-0.000226807
-0.000226313
-0.000180149
-0.000122356
-6.01989e-05
-1.00288e-05
2.92039e-05
5.51985e-05
7.4282e-05
8.83037e-05
9.94081e-05
0.00010854
0.000115939
0.000121352
0.00012507
0.000127082
0.000127862
0.000127501
0.000126627
0.000124747
0.000122969
0.000119909
0.00011759
0.00011482
0.000112666
0.000110381
0.000108463
0.000106516
0.000104779
0.000103045
0.000101433
9.9834e-05
9.83037e-05
9.67871e-05
9.53064e-05
9.38327e-05
9.23752e-05
9.09146e-05
8.94561e-05
8.79843e-05
8.65024e-05
8.49974e-05
8.34709e-05
8.19113e-05
8.03194e-05
7.86837e-05
7.70041e-05
7.52698e-05
7.3479e-05
7.16212e-05
6.96943e-05
6.76866e-05
6.55976e-05
6.34131e-05
6.11359e-05
5.87494e-05
5.626e-05
5.36466e-05
5.09219e-05
4.8055e-05
4.50679e-05
4.19078e-05
3.85973e-05
3.50241e-05
3.11435e-05
2.69697e-05
2.2638e-05
1.80852e-05
1.34993e-05
8.73723e-06
4.11695e-06
-6.05879e-07
-4.89436e-06
-9.1547e-06
-1.2637e-05
-1.60463e-05
-1.89992e-05
-2.18522e-05
-2.44896e-05
-2.71053e-05
-2.97281e-05
-3.25497e-05
-3.56046e-05
-3.91119e-05
-4.30564e-05
-4.76202e-05
-5.28353e-05
-5.91222e-05
-6.71492e-05
-7.94704e-05
-9.88327e-05
-0.000130743
-0.000166859
-0.000189152
-0.000198841
-0.000196319
-0.000196846
-0.000208442
-0.00022401
-0.000230211
-0.00022996
-0.000181869
-0.000122123
-5.86864e-05
-8.01011e-06
3.12643e-05
5.69842e-05
7.58083e-05
8.96104e-05
0.000100556
0.000109591
0.000116909
0.000122229
0.000125848
0.00012775
0.000128424
0.000127963
0.000127009
0.000125041
0.000123211
0.000120036
0.000117681
0.000114868
0.000112707
0.000110411
0.000108495
0.000106546
0.000104812
0.00010308
0.000101471
9.98744e-05
9.83472e-05
9.68333e-05
9.53556e-05
9.38847e-05
9.24302e-05
9.09723e-05
8.95167e-05
8.80478e-05
8.65687e-05
8.50665e-05
8.3543e-05
8.19861e-05
8.03971e-05
7.87641e-05
7.70873e-05
7.53556e-05
7.35675e-05
7.17122e-05
6.97877e-05
6.77821e-05
6.5695e-05
6.35121e-05
6.12363e-05
5.88506e-05
5.63617e-05
5.37483e-05
5.10233e-05
4.81555e-05
4.51678e-05
4.20069e-05
3.86978e-05
3.51235e-05
3.12361e-05
2.70544e-05
2.27174e-05
1.81583e-05
1.35675e-05
8.79657e-06
4.17002e-06
-5.65565e-07
-4.85461e-06
-9.12316e-06
-1.25764e-05
-1.59774e-05
-1.89194e-05
-2.17746e-05
-2.44182e-05
-2.70464e-05
-2.96838e-05
-3.25216e-05
-3.55896e-05
-3.91096e-05
-4.30689e-05
-4.76576e-05
-5.291e-05
-5.92538e-05
-6.72807e-05
-7.95006e-05
-9.8734e-05
-0.000131031
-0.000168089
-0.000191115
-0.000200922
-0.000197769
-0.000198042
-0.000209945
-0.000226576
-0.000233568
-0.000233542
-0.000183498
-0.000121807
-5.71358e-05
-5.994e-06
3.32936e-05
5.87263e-05
7.729e-05
9.08764e-05
0.000101669
0.000110613
0.000117853
0.000123081
0.000126603
0.000128396
0.000128964
0.000128405
0.000127373
0.000125318
0.000123438
0.000120148
0.000117759
0.000114908
0.000112741
0.000110436
0.000108522
0.000106573
0.000104843
0.000103112
0.000101507
9.99131e-05
9.83892e-05
9.68782e-05
9.54037e-05
9.39356e-05
9.24842e-05
9.10292e-05
8.95766e-05
8.81105e-05
8.66344e-05
8.51351e-05
8.36144e-05
8.20605e-05
8.04743e-05
7.88442e-05
7.71703e-05
7.54413e-05
7.36559e-05
7.18033e-05
6.98812e-05
6.78779e-05
6.5793e-05
6.36118e-05
6.13375e-05
5.89528e-05
5.64647e-05
5.38514e-05
5.11263e-05
4.82576e-05
4.52693e-05
4.21074e-05
3.87996e-05
3.5224e-05
3.13301e-05
2.71411e-05
2.27995e-05
1.8235e-05
1.36397e-05
8.86051e-06
4.22763e-06
-5.20655e-07
-4.81094e-06
-9.08792e-06
-1.25109e-05
-1.5903e-05
-1.88339e-05
-2.16909e-05
-2.43406e-05
-2.69806e-05
-2.96321e-05
-3.24857e-05
-3.55656e-05
-3.90965e-05
-4.3068e-05
-4.76772e-05
-5.29621e-05
-5.9361e-05
-6.74022e-05
-7.95472e-05
-9.86447e-05
-0.000131324
-0.00016929
-0.000193034
-0.000202958
-0.000199157
-0.000199162
-0.000211374
-0.000229074
-0.000236875
-0.000237055
-0.000185038
-0.000121412
-5.55538e-05
-3.9863e-06
3.52879e-05
6.04228e-05
7.87262e-05
9.21016e-05
0.000102746
0.000111605
0.00011877
0.000123908
0.000127334
0.00012902
0.000129483
0.000128828
0.000127719
0.00012558
0.000123652
0.000120247
0.000117826
0.000114939
0.000112768
0.000110457
0.000108546
0.000106597
0.000104871
0.000103143
0.000101541
9.99504e-05
9.84298e-05
9.69219e-05
9.54505e-05
9.39854e-05
9.25371e-05
9.10851e-05
8.96355e-05
8.81724e-05
8.66993e-05
8.52029e-05
8.36852e-05
8.21342e-05
8.0551e-05
7.89238e-05
7.72528e-05
7.55267e-05
7.37441e-05
7.18942e-05
6.99748e-05
6.79739e-05
6.58912e-05
6.37119e-05
6.14393e-05
5.90558e-05
5.65687e-05
5.39557e-05
5.12306e-05
4.83611e-05
4.53721e-05
4.22091e-05
3.89023e-05
3.53252e-05
3.1425e-05
2.72295e-05
2.28842e-05
1.8315e-05
1.37158e-05
8.92872e-06
4.2894e-06
-4.71584e-07
-4.76395e-06
-9.04968e-06
-1.24412e-05
-1.58239e-05
-1.87437e-05
-2.16024e-05
-2.42578e-05
-2.69092e-05
-2.95744e-05
-3.2443e-05
-3.5534e-05
-3.90743e-05
-4.30553e-05
-4.76808e-05
-5.29933e-05
-5.94436e-05
-6.75089e-05
-7.96052e-05
-9.85629e-05
-0.000131619
-0.000170465
-0.000194906
-0.000204948
-0.000200484
-0.000200208
-0.00021273
-0.000231503
-0.000240128
-0.000240495
-0.000186488
-0.000120944
-5.39473e-05
-1.9925e-06
3.72437e-05
6.20721e-05
8.01166e-05
9.32861e-05
0.000103789
0.000112568
0.000119661
0.000124711
0.000128043
0.000129623
0.000129981
0.000129233
0.000128047
0.000125827
0.000123852
0.000120333
0.000117882
0.000114963
0.00011279
0.000110474
0.000108566
0.000106619
0.000104897
0.000103172
0.000101574
9.99861e-05
9.84691e-05
9.69643e-05
9.54962e-05
9.40342e-05
9.2589e-05
9.114e-05
8.96935e-05
8.82333e-05
8.67633e-05
8.52698e-05
8.37552e-05
8.22071e-05
8.0627e-05
7.90027e-05
7.73347e-05
7.56116e-05
7.38319e-05
7.19848e-05
7.00681e-05
6.80698e-05
6.59895e-05
6.38123e-05
6.15415e-05
5.91595e-05
5.66734e-05
5.40609e-05
5.13359e-05
4.84658e-05
4.54761e-05
4.23118e-05
3.90058e-05
3.5427e-05
3.15207e-05
2.73195e-05
2.29712e-05
1.83982e-05
1.37954e-05
9.00091e-06
4.35498e-06
-4.18735e-07
-4.71415e-06
-9.00904e-06
-1.23682e-05
-1.57411e-05
-1.865e-05
-2.15102e-05
-2.41712e-05
-2.68336e-05
-2.95118e-05
-3.23949e-05
-3.5496e-05
-3.90442e-05
-4.30324e-05
-4.76704e-05
-5.30053e-05
-5.95021e-05
-6.7597e-05
-7.96689e-05
-9.84876e-05
-0.000131911
-0.000171621
-0.000196731
-0.000206889
-0.000201751
-0.000201183
-0.000214017
-0.000233863
-0.000243324
-0.000243859
-0.000187851
-0.000120409
-5.23227e-05
-1.78976e-08
3.91577e-05
6.36727e-05
8.14608e-05
9.44302e-05
0.000104797
0.000113502
0.000120526
0.00012549
0.000128729
0.000130205
0.00013046
0.00012962
0.00012836
0.00012606
0.000124038
0.000120405
0.000117926
0.000114979
0.000112805
0.000110486
0.000108583
0.000106639
0.000104921
0.000103199
0.000101605
0.00010002
9.8507e-05
9.70054e-05
9.55407e-05
9.40818e-05
9.26398e-05
9.11938e-05
8.97505e-05
8.82933e-05
8.68263e-05
8.53359e-05
8.38243e-05
8.22792e-05
8.07022e-05
7.90809e-05
7.7416e-05
7.56958e-05
7.39191e-05
7.20749e-05
7.01611e-05
6.81654e-05
6.60876e-05
6.39127e-05
6.16439e-05
5.92634e-05
5.67786e-05
5.41668e-05
5.14421e-05
4.85714e-05
4.5581e-05
4.24153e-05
3.91098e-05
3.55289e-05
3.1617e-05
2.74109e-05
2.30604e-05
1.84843e-05
1.38783e-05
9.07679e-06
4.42405e-06
-3.62453e-07
-4.66201e-06
-8.96654e-06
-1.22926e-05
-1.56554e-05
-1.85536e-05
-2.14152e-05
-2.40817e-05
-2.67546e-05
-2.94454e-05
-3.23424e-05
-3.54529e-05
-3.90075e-05
-4.30007e-05
-4.76477e-05
-5.30005e-05
-5.95378e-05
-6.76643e-05
-7.97326e-05
-9.84177e-05
-0.000132193
-0.000172761
-0.000198508
-0.00020878
-0.000202959
-0.000202091
-0.000215236
-0.000236153
-0.000246461
-0.000247144
-0.000189129
-0.000119814
-5.06864e-05
1.93274e-06
4.10271e-05
6.52237e-05
8.27586e-05
9.5534e-05
0.000105771
0.000114408
0.000121366
0.000126247
0.000129394
0.000130766
0.00013092
0.000129991
0.000128656
0.00012628
0.000124212
0.000120466
0.000117961
0.000114989
0.000112816
0.000110496
0.000108598
0.000106656
0.000104943
0.000103224
0.000101634
0.000100053
9.85437e-05
9.70453e-05
9.5584e-05
9.41282e-05
9.26895e-05
9.12466e-05
8.98063e-05
8.83522e-05
8.68883e-05
8.54009e-05
8.38924e-05
8.23504e-05
8.07764e-05
7.91582e-05
7.74963e-05
7.57792e-05
7.40056e-05
7.21644e-05
7.02535e-05
6.82605e-05
6.61854e-05
6.40128e-05
6.17462e-05
5.93674e-05
5.68841e-05
5.42731e-05
5.15488e-05
4.86777e-05
4.56866e-05
4.25195e-05
3.92141e-05
3.56309e-05
3.17137e-05
2.75036e-05
2.31517e-05
1.85732e-05
1.39643e-05
9.1561e-06
4.49633e-06
-3.03048e-07
-4.60792e-06
-8.92266e-06
-1.2215e-05
-1.55675e-05
-1.84554e-05
-2.13183e-05
-2.39904e-05
-2.66734e-05
-2.93762e-05
-3.22866e-05
-3.54055e-05
-3.89654e-05
-4.29618e-05
-4.76142e-05
-5.29806e-05
-5.95523e-05
-6.77095e-05
-7.97908e-05
-9.83524e-05
-0.000132458
-0.000173889
-0.000200237
-0.000210619
-0.00020411
-0.000202934
-0.00021639
-0.000238372
-0.000249534
-0.000250347
-0.000190323
-0.000119164
-4.90445e-05
3.85487e-06
4.28491e-05
6.67239e-05
8.40098e-05
9.65979e-05
0.000106712
0.000115285
0.000122181
0.00012698
0.000130037
0.000131308
0.000131362
0.000130345
0.000128937
0.000126486
0.000124374
0.000120516
0.000117986
0.000114993
0.000112822
0.000110502
0.000108609
0.000106671
0.000104963
0.000103248
0.000101662
0.000100085
9.8579e-05
9.7084e-05
9.5626e-05
9.41735e-05
9.27379e-05
9.12981e-05
8.98611e-05
8.84099e-05
8.69492e-05
8.54648e-05
8.39594e-05
8.24204e-05
8.08496e-05
7.92344e-05
7.75757e-05
7.58617e-05
7.40912e-05
7.2253e-05
7.03451e-05
6.8355e-05
6.62827e-05
6.41126e-05
6.18483e-05
5.94714e-05
5.69896e-05
5.43797e-05
5.1656e-05
4.87846e-05
4.57927e-05
4.26241e-05
3.93185e-05
3.57327e-05
3.18106e-05
2.75974e-05
2.3245e-05
1.86646e-05
1.40531e-05
9.23859e-06
4.57154e-06
-2.40805e-07
-4.55226e-06
-8.87781e-06
-1.21359e-05
-1.5478e-05
-1.83561e-05
-2.12204e-05
-2.3898e-05
-2.65907e-05
-2.93052e-05
-3.22283e-05
-3.5355e-05
-3.89191e-05
-4.29169e-05
-4.75717e-05
-5.29474e-05
-5.95476e-05
-6.77325e-05
-7.98386e-05
-9.82907e-05
-0.000132698
-0.000175005
-0.000201916
-0.000212404
-0.000205205
-0.000203715
-0.000217481
-0.000240521
-0.000252543
-0.000253466
-0.000191437
-0.000118465
-4.74028e-05
5.7444e-06
4.46217e-05
6.81727e-05
8.52146e-05
9.76222e-05
0.00010762
0.000116135
0.00012297
0.00012769
0.00013066
0.00013183
0.000131786
0.000130683
0.000129204
0.000126681
0.000124524
0.000120554
0.000118002
0.000114991
0.000112823
0.000110505
0.000108618
0.000106684
0.000104981
0.00010327
0.000101689
0.000100115
9.8613e-05
9.71215e-05
9.56669e-05
9.42175e-05
9.27852e-05
9.13485e-05
8.99146e-05
8.84665e-05
8.70088e-05
8.55275e-05
8.40252e-05
8.24893e-05
8.09216e-05
7.93095e-05
7.7654e-05
7.59431e-05
7.41758e-05
7.23407e-05
7.04359e-05
6.84487e-05
6.63792e-05
6.42117e-05
6.19498e-05
5.9575e-05
5.7095e-05
5.44862e-05
5.17632e-05
4.88917e-05
4.58992e-05
4.27289e-05
3.94229e-05
3.58341e-05
3.19076e-05
2.76924e-05
2.334e-05
1.87585e-05
1.41447e-05
9.32403e-06
4.64945e-06
-1.75986e-07
-4.49532e-06
-8.83234e-06
-1.2056e-05
-1.53874e-05
-1.82563e-05
-2.11222e-05
-2.38053e-05
-2.65075e-05
-2.92331e-05
-3.21684e-05
-3.53022e-05
-3.88693e-05
-4.28672e-05
-4.75218e-05
-5.29025e-05
-5.9526e-05
-6.77339e-05
-7.98719e-05
-9.82308e-05
-0.00013291
-0.000176109
-0.000203546
-0.000214134
-0.000206244
-0.000204438
-0.000218511
-0.000242601
-0.000255483
-0.000256499
-0.000192472
-0.000117724
-4.57666e-05
7.59761e-06
4.63427e-05
6.95697e-05
8.6373e-05
9.86071e-05
0.000108495
0.000116957
0.000123736
0.000128378
0.000131262
0.000132333
0.000132192
0.000131006
0.000129458
0.000126864
0.000124663
0.000120582
0.000118009
0.000114984
0.000112821
0.000110506
0.000108626
0.000106696
0.000104998
0.000103291
0.000101714
0.000100144
9.86458e-05
9.71577e-05
9.57065e-05
9.42604e-05
9.28313e-05
9.13977e-05
8.99668e-05
8.85218e-05
8.70672e-05
8.55889e-05
8.40897e-05
8.25569e-05
8.09923e-05
7.93834e-05
7.7731e-05
7.60233e-05
7.42592e-05
7.24272e-05
7.05255e-05
6.85414e-05
6.64748e-05
6.431e-05
6.20507e-05
5.9678e-05
5.71999e-05
5.45925e-05
5.18704e-05
4.89989e-05
4.60057e-05
4.28339e-05
3.9527e-05
3.5935e-05
3.20048e-05
2.77884e-05
2.34368e-05
1.88546e-05
1.42387e-05
9.41218e-06
4.72981e-06
-1.08837e-07
-4.4374e-06
-8.7866e-06
-1.19757e-05
-1.52964e-05
-1.81568e-05
-2.10242e-05
-2.3713e-05
-2.64243e-05
-2.91607e-05
-3.21077e-05
-3.52478e-05
-3.88171e-05
-4.28138e-05
-4.74658e-05
-5.28478e-05
-5.94894e-05
-6.7715e-05
-7.98879e-05
-9.81707e-05
-0.000133087
-0.000177192
-0.000205128
-0.000215807
-0.00020723
-0.000205105
-0.000219484
-0.000244612
-0.000258354
-0.000259445
-0.000193432
-0.000116945
-4.41411e-05
9.41108e-06
4.80107e-05
7.09145e-05
8.74853e-05
9.95531e-05
0.000109337
0.000117751
0.000124476
0.000129043
0.000131843
0.000132818
0.000132582
0.000131315
0.000129698
0.000127037
0.000124791
0.000120601
0.000118007
0.000114973
0.000112815
0.000110505
0.000108631
0.000106706
0.000105013
0.000103311
0.000101738
0.000100172
9.86774e-05
9.71927e-05
9.57449e-05
9.4302e-05
9.28761e-05
9.14455e-05
9.00178e-05
8.85758e-05
8.71243e-05
8.5649e-05
8.41529e-05
8.26232e-05
8.10617e-05
7.94559e-05
7.78067e-05
7.61022e-05
7.43412e-05
7.25124e-05
7.06139e-05
6.86329e-05
6.65693e-05
6.44074e-05
6.21506e-05
5.97804e-05
5.73043e-05
5.46984e-05
5.19773e-05
4.9106e-05
4.61122e-05
4.29387e-05
3.96307e-05
3.60351e-05
3.21019e-05
2.78853e-05
2.35352e-05
1.89529e-05
1.4335e-05
9.50282e-06
4.81239e-06
-3.95882e-08
-4.37873e-06
-8.74086e-06
-1.18953e-05
-1.52053e-05
-1.80579e-05
-2.09271e-05
-2.36217e-05
-2.63418e-05
-2.90886e-05
-3.20468e-05
-3.51927e-05
-3.87632e-05
-4.27576e-05
-4.7405e-05
-5.27848e-05
-5.94394e-05
-6.76774e-05
-7.98846e-05
-9.81077e-05
-0.000133227
-0.000178246
-0.000206662
-0.00021742
-0.000208161
-0.000205721
-0.000220403
-0.000246555
-0.000261154
-0.000262302
-0.000194318
-0.000116135
-4.25307e-05
1.1182e-05
4.96244e-05
7.22069e-05
8.85517e-05
0.000100461
0.000110148
0.000118518
0.000125192
0.000129687
0.000132404
0.000133285
0.000132956
0.00013161
0.000129925
0.000127198
0.000124908
0.00012061
0.000117999
0.000114957
0.000112806
0.000110501
0.000108634
0.000106715
0.000105028
0.00010333
0.000101761
0.000100199
9.87077e-05
9.72265e-05
9.5782e-05
9.43423e-05
9.29196e-05
9.14921e-05
9.00674e-05
8.86285e-05
8.718e-05
8.57078e-05
8.42147e-05
8.2688e-05
8.11296e-05
7.9527e-05
7.7881e-05
7.61796e-05
7.44219e-05
7.25963e-05
7.0701e-05
6.87231e-05
6.66626e-05
6.45036e-05
6.22496e-05
5.98818e-05
5.74079e-05
5.48037e-05
5.20837e-05
4.92127e-05
4.62185e-05
4.30434e-05
3.97339e-05
3.61345e-05
3.21989e-05
2.79831e-05
2.36351e-05
1.90531e-05
1.44335e-05
9.59573e-06
4.89699e-06
3.15401e-08
-4.31954e-06
-8.69539e-06
-1.18152e-05
-1.51146e-05
-1.79601e-05
-2.08313e-05
-2.35318e-05
-2.62605e-05
-2.90173e-05
-3.19863e-05
-3.51374e-05
-3.87084e-05
-4.26994e-05
-4.73407e-05
-5.27154e-05
-5.93777e-05
-6.76234e-05
-7.98612e-05
-9.80386e-05
-0.00013333
-0.000179255
-0.000208149
-0.000218971
-0.000209041
-0.000206288
-0.000221271
-0.000248433
-0.000263882
-0.000265069
-0.000195136
-0.000115299
-4.09399e-05
1.29076e-05
5.11825e-05
7.3447e-05
8.95727e-05
0.00010133
0.000110926
0.000119258
0.000125884
0.000130308
0.000132946
0.000133733
0.000133314
0.000131892
0.000130141
0.000127351
0.000125016
0.00012061
0.000117982
0.000114938
0.000112794
0.000110496
0.000108636
0.000106722
0.00010504
0.000103347
0.000101783
0.000100224
9.87369e-05
9.72591e-05
9.58179e-05
9.43814e-05
9.29618e-05
9.15374e-05
9.01157e-05
8.86798e-05
8.72343e-05
8.57651e-05
8.4275e-05
8.27514e-05
8.11961e-05
7.95966e-05
7.79537e-05
7.62555e-05
7.4501e-05
7.26787e-05
7.07866e-05
6.88119e-05
6.67545e-05
6.45985e-05
6.23473e-05
5.99821e-05
5.75105e-05
5.49081e-05
5.21895e-05
4.9319e-05
4.63244e-05
4.31477e-05
3.98365e-05
3.6233e-05
3.22959e-05
2.80818e-05
2.37365e-05
1.91552e-05
1.45339e-05
9.69069e-06
4.98338e-06
1.04339e-07
-4.26004e-06
-8.65041e-06
-1.17359e-05
-1.50246e-05
-1.7864e-05
-2.07373e-05
-2.34439e-05
-2.61809e-05
-2.89474e-05
-3.19269e-05
-3.50826e-05
-3.86533e-05
-4.26402e-05
-4.72738e-05
-5.2641e-05
-5.9306e-05
-6.75548e-05
-7.98177e-05
-9.79605e-05
-0.000133395
-0.000180203
-0.000209586
-0.00022046
-0.000209868
-0.000206808
-0.00022209
-0.000250245
-0.000266536
-0.000267747
-0.000195887
-0.00011444
-3.93722e-05
1.45858e-05
5.26844e-05
7.4635e-05
9.05486e-05
0.000102162
0.000111674
0.000119971
0.000126552
0.000130908
0.000133468
0.000134165
0.000133657
0.000132161
0.000130346
0.000127494
0.000125114
0.000120602
0.00011796
0.000114915
0.00011278
0.000110489
0.000108636
0.000106728
0.000105052
0.000103363
0.000101803
0.000100249
9.87649e-05
9.72905e-05
9.58526e-05
9.44192e-05
9.30027e-05
9.15813e-05
9.01627e-05
8.87297e-05
8.72871e-05
8.58209e-05
8.43338e-05
8.28132e-05
8.1261e-05
7.96645e-05
7.80248e-05
7.63298e-05
7.45785e-05
7.27594e-05
7.08707e-05
6.88992e-05
6.6845e-05
6.4692e-05
6.24438e-05
6.00812e-05
5.7612e-05
5.50116e-05
5.22944e-05
4.94246e-05
4.64297e-05
4.32515e-05
3.99383e-05
3.63306e-05
3.23928e-05
2.81814e-05
2.38393e-05
1.9259e-05
1.4636e-05
9.78749e-06
5.07137e-06
1.78608e-07
-4.20039e-06
-8.60613e-06
-1.16576e-05
-1.49357e-05
-1.77697e-05
-2.06455e-05
-2.33582e-05
-2.61034e-05
-2.88794e-05
-3.18688e-05
-3.50287e-05
-3.85985e-05
-4.25805e-05
-4.72053e-05
-5.25629e-05
-5.92261e-05
-6.74734e-05
-7.97552e-05
-9.78706e-05
-0.000133424
-0.000181075
-0.00021097
-0.000221882
-0.000210643
-0.000207286
-0.000222862
-0.000251995
-0.000269118
-0.000270335
-0.000196573
-0.000113565
-3.78316e-05
1.62145e-05
5.41294e-05
7.57709e-05
9.148e-05
0.000102957
0.00011239
0.000120657
0.000127195
0.000131486
0.00013397
0.000134579
0.000133985
0.000132418
0.000130539
0.000127628
0.000125203
0.000120586
0.00011793
0.000114889
0.000112764
0.000110481
0.000108635
0.000106734
0.000105062
0.000103378
0.000101823
0.000100272
9.87918e-05
9.73207e-05
9.58861e-05
9.44558e-05
9.30423e-05
9.16239e-05
9.02082e-05
8.87781e-05
8.73385e-05
8.58752e-05
8.43911e-05
8.28735e-05
8.13242e-05
7.97309e-05
7.80943e-05
7.64025e-05
7.46544e-05
7.28385e-05
7.0953e-05
6.89848e-05
6.69338e-05
6.4784e-05
6.25387e-05
6.01789e-05
5.77122e-05
5.5114e-05
5.23984e-05
4.95294e-05
4.65344e-05
4.33548e-05
4.00393e-05
3.64272e-05
3.24896e-05
2.82818e-05
2.39434e-05
1.93644e-05
1.47398e-05
9.88593e-06
5.16077e-06
2.54156e-07
-4.14075e-06
-8.56274e-06
-1.15806e-05
-1.48481e-05
-1.76778e-05
-2.05561e-05
-2.32753e-05
-2.60284e-05
-2.88135e-05
-3.18126e-05
-3.49763e-05
-3.85446e-05
-4.25211e-05
-4.7136e-05
-5.24824e-05
-5.914e-05
-6.73805e-05
-7.96752e-05
-9.77666e-05
-0.000133419
-0.000181856
-0.000212292
-0.000223235
-0.000211366
-0.000207724
-0.000223587
-0.000253681
-0.000271625
-0.000272832
-0.000197199
-0.000112678
-3.6321e-05
1.77919e-05
5.55169e-05
7.68551e-05
9.23672e-05
0.000103714
0.000113076
0.000121317
0.000127815
0.000132042
0.000134454
0.000134977
0.000134298
0.000132663
0.000130723
0.000127754
0.000125282
0.000120562
0.000117895
0.000114861
0.000112745
0.000110471
0.000108633
0.000106738
0.000105072
0.000103393
0.000101841
0.000100294
9.88175e-05
9.73498e-05
9.59184e-05
9.44912e-05
9.30807e-05
9.16651e-05
9.02523e-05
8.88251e-05
8.73884e-05
8.5928e-05
8.44468e-05
8.29321e-05
8.13859e-05
7.97956e-05
7.8162e-05
7.64734e-05
7.47285e-05
7.29159e-05
7.10336e-05
6.90687e-05
6.70209e-05
6.48743e-05
6.26321e-05
6.02752e-05
5.78111e-05
5.52151e-05
5.25013e-05
4.96333e-05
4.66382e-05
4.34573e-05
4.01393e-05
3.65229e-05
3.25865e-05
2.83832e-05
2.40489e-05
1.94712e-05
1.48449e-05
9.98581e-06
5.25138e-06
3.30801e-07
-4.08127e-06
-8.52043e-06
-1.15052e-05
-1.47623e-05
-1.75884e-05
-2.04696e-05
-2.31955e-05
-2.59562e-05
-2.87503e-05
-3.17586e-05
-3.49257e-05
-3.8492e-05
-4.24625e-05
-4.70668e-05
-5.24006e-05
-5.90492e-05
-6.72778e-05
-7.95797e-05
-9.7647e-05
-0.000133381
-0.000182536
-0.000213537
-0.000224517
-0.000212036
-0.000208122
-0.000224261
-0.000255303
-0.000274056
-0.000275238
-0.000197766
-0.000111783
-3.4844e-05
1.9316e-05
5.68463e-05
7.78876e-05
9.32106e-05
0.000104435
0.00011373
0.000121949
0.00012841
0.000132577
0.000134918
0.000135358
0.000134598
0.000132896
0.000130897
0.000127872
0.000125354
0.000120531
0.000117855
0.00011483
0.000112725
0.00011046
0.00010863
0.000106741
0.00010508
0.000103406
0.000101859
0.000100315
9.88422e-05
9.73778e-05
9.59495e-05
9.45253e-05
9.31177e-05
9.17051e-05
9.02951e-05
8.88707e-05
8.74368e-05
8.59792e-05
8.45009e-05
8.29891e-05
8.14459e-05
7.98585e-05
7.82281e-05
7.65425e-05
7.48008e-05
7.29914e-05
7.11124e-05
6.91508e-05
6.71063e-05
6.49629e-05
6.27238e-05
6.03698e-05
5.79084e-05
5.53148e-05
5.26029e-05
4.97361e-05
4.67412e-05
4.35591e-05
4.02384e-05
3.66176e-05
3.26833e-05
2.84854e-05
2.41555e-05
1.95794e-05
1.49514e-05
1.00869e-05
5.34303e-06
4.08375e-07
-4.02207e-06
-8.47934e-06
-1.14317e-05
-1.46785e-05
-1.7502e-05
-2.03862e-05
-2.3119e-05
-2.58873e-05
-2.869e-05
-3.17073e-05
-3.48774e-05
-3.84413e-05
-4.24054e-05
-4.69984e-05
-5.23187e-05
-5.89553e-05
-6.71672e-05
-7.94704e-05
-9.75112e-05
-0.000133311
-0.000183106
-0.000214684
-0.000225721
-0.00021265
-0.000208483
-0.000224875
-0.000256846
-0.000276409
-0.000277552
-0.000198277
-0.000110883
-3.34036e-05
2.07852e-05
5.81169e-05
7.88686e-05
9.40104e-05
0.00010512
0.000114354
0.000122555
0.000128981
0.00013309
0.000135363
0.000135722
0.000134884
0.000133119
0.000131061
0.000127983
0.000125417
0.000120494
0.000117809
0.000114797
0.000112703
0.000110449
0.000108626
0.000106743
0.000105088
0.000103418
0.000101875
0.000100336
9.88658e-05
9.74046e-05
9.59794e-05
9.45581e-05
9.31534e-05
9.17436e-05
9.03365e-05
8.89148e-05
8.74837e-05
8.60289e-05
8.45535e-05
8.30445e-05
8.15042e-05
7.99198e-05
7.82924e-05
7.66099e-05
7.48713e-05
7.30651e-05
7.11894e-05
6.92311e-05
6.71898e-05
6.50496e-05
6.28137e-05
6.04628e-05
5.80042e-05
5.54131e-05
5.27032e-05
4.98377e-05
4.68431e-05
4.366e-05
4.03365e-05
3.67115e-05
3.27804e-05
2.85886e-05
2.42633e-05
1.96888e-05
1.50589e-05
1.01891e-05
5.43556e-06
4.8672e-07
-3.96326e-06
-8.43962e-06
-1.13603e-05
-1.4597e-05
-1.74187e-05
-2.03063e-05
-2.30462e-05
-2.58219e-05
-2.86329e-05
-3.1659e-05
-3.48318e-05
-3.83929e-05
-4.23502e-05
-4.69316e-05
-5.22376e-05
-5.886e-05
-6.70511e-05
-7.9349e-05
-9.73593e-05
-0.000133211
-0.00018356
-0.000215714
-0.000226843
-0.000213207
-0.000208804
-0.00022541
-0.000258282
-0.000278669
-0.000279775
-0.000198735
-0.000109985
-3.20035e-05
2.21968e-05
5.93275e-05
7.97975e-05
9.47663e-05
0.000105768
0.000114947
0.000123133
0.000129526
0.000133581
0.000135788
0.00013607
0.000135156
0.000133331
0.000131217
0.000128087
0.000125472
0.00012045
0.000117758
0.000114761
0.00011268
0.000110436
0.000108621
0.000106745
0.000105095
0.000103429
0.00010189
0.000100355
9.88883e-05
9.74303e-05
9.60081e-05
9.45898e-05
9.31879e-05
9.17809e-05
9.03764e-05
8.89575e-05
8.75292e-05
8.60771e-05
8.46044e-05
8.30983e-05
8.15608e-05
7.99793e-05
7.83549e-05
7.66754e-05
7.494e-05
7.3137e-05
7.12645e-05
6.93094e-05
6.72715e-05
6.51346e-05
6.29019e-05
6.0554e-05
5.80983e-05
5.55098e-05
5.2802e-05
4.9938e-05
4.69439e-05
4.376e-05
4.04336e-05
3.68045e-05
3.28776e-05
2.86928e-05
2.43722e-05
1.97993e-05
1.51675e-05
1.02923e-05
5.52881e-06
5.65691e-07
-3.90494e-06
-8.40143e-06
-1.12914e-05
-1.45181e-05
-1.7339e-05
-2.02303e-05
-2.29775e-05
-2.57603e-05
-2.85796e-05
-3.1614e-05
-3.47894e-05
-3.83474e-05
-4.22976e-05
-4.6867e-05
-5.21584e-05
-5.87648e-05
-6.69316e-05
-7.92166e-05
-9.71925e-05
-0.000133082
-0.000183891
-0.000216612
-0.000227873
-0.000213703
-0.000209084
-0.000225854
-0.000259569
-0.000280803
-0.00028191
-0.000199152
-0.000109099
-3.06525e-05
2.35454e-05
6.04749e-05
8.06728e-05
9.54775e-05
0.000106379
0.000115509
0.000123682
0.000130047
0.00013405
0.000136194
0.000136401
0.000135414
0.000133532
0.000131364
0.000128185
0.000125519
0.0001204
0.000117702
0.000114725
0.000112656
0.000110423
0.000108615
0.000106745
0.000105101
0.00010344
0.000101905
0.000100373
9.89098e-05
9.74549e-05
9.60356e-05
9.46202e-05
9.32211e-05
9.18167e-05
9.0415e-05
8.89988e-05
8.75731e-05
8.61237e-05
8.46537e-05
8.31504e-05
8.16157e-05
8.00371e-05
7.84156e-05
7.67392e-05
7.50068e-05
7.32069e-05
7.13377e-05
6.93859e-05
6.73512e-05
6.52177e-05
6.29882e-05
6.06435e-05
5.81907e-05
5.56049e-05
5.28993e-05
5.0037e-05
4.70436e-05
4.3859e-05
4.05296e-05
3.68967e-05
3.29752e-05
2.87979e-05
2.44823e-05
1.99109e-05
1.52769e-05
1.03961e-05
5.62264e-06
6.45145e-07
-3.84719e-06
-8.36489e-06
-1.12252e-05
-1.44422e-05
-1.72633e-05
-2.01585e-05
-2.29132e-05
-2.57031e-05
-2.85303e-05
-3.15729e-05
-3.47505e-05
-3.83051e-05
-4.22481e-05
-4.68055e-05
-5.20821e-05
-5.8671e-05
-6.68109e-05
-7.9075e-05
-9.70122e-05
-0.000132923
-0.000184086
-0.000217368
-0.0002288
-0.000214132
-0.00020932
-0.000226204
-0.000260675
-0.000282761
-0.000283951
-0.00019956
-0.000108262
-2.93768e-05
2.48137e-05
6.15487e-05
8.14882e-05
9.61399e-05
0.000106951
0.000116037
0.000124203
0.000130541
0.000134495
0.00013658
0.000136716
0.00013566
0.000133722
0.000131503
0.000128276
0.000125558
0.000120345
0.000117643
0.000114687
0.000112631
0.000110409
0.000108609
0.000106746
0.000105106
0.00010345
0.000101918
0.00010039
9.89301e-05
9.74783e-05
9.60619e-05
9.46493e-05
9.32529e-05
9.18512e-05
9.04521e-05
8.90385e-05
8.76154e-05
8.61687e-05
8.47014e-05
8.32008e-05
8.16689e-05
8.00931e-05
7.84745e-05
7.6801e-05
7.50717e-05
7.3275e-05
7.14089e-05
6.94604e-05
6.74291e-05
6.52988e-05
6.30726e-05
6.07311e-05
5.82813e-05
5.56983e-05
5.29951e-05
5.01346e-05
4.7142e-05
4.39569e-05
4.06245e-05
3.69884e-05
3.30732e-05
2.89042e-05
2.45934e-05
2.00234e-05
1.5387e-05
1.05006e-05
5.71686e-06
7.24935e-07
-3.79012e-06
-8.33015e-06
-1.11621e-05
-1.43697e-05
-1.71919e-05
-2.00915e-05
-2.28539e-05
-2.56508e-05
-2.84856e-05
-3.1536e-05
-3.47157e-05
-3.82668e-05
-4.22025e-05
-4.67478e-05
-5.20097e-05
-5.85802e-05
-6.66914e-05
-7.89272e-05
-9.68193e-05
-0.00013273
-0.000184134
-0.000217976
-0.00022961
-0.000214491
-0.00020951
-0.000226463
-0.000261582
-0.000284492
-0.000285869
-0.000200001
-0.000107537
-2.82317e-05
2.59613e-05
6.25218e-05
8.22258e-05
9.6741e-05
0.000107473
0.000116525
0.000124689
0.000131006
0.000134915
0.000136946
0.000137013
0.000135891
0.000133902
0.000131634
0.000128361
0.00012559
0.000120284
0.00011758
0.000114647
0.000112606
0.000110394
0.000108602
0.000106745
0.00010511
0.000103458
0.000101931
0.000100406
9.89492e-05
9.75004e-05
9.60869e-05
9.4677e-05
9.32832e-05
9.18842e-05
9.04876e-05
8.90767e-05
8.76562e-05
8.62121e-05
8.47474e-05
8.32495e-05
8.17203e-05
8.01474e-05
7.85316e-05
7.68611e-05
7.51347e-05
7.33411e-05
7.14782e-05
6.95329e-05
6.75049e-05
6.5378e-05
6.3155e-05
6.08168e-05
5.83701e-05
5.579e-05
5.30892e-05
5.02307e-05
4.72392e-05
4.40538e-05
4.07184e-05
3.70795e-05
3.31719e-05
2.90114e-05
2.47054e-05
2.01366e-05
1.54976e-05
1.06054e-05
5.81136e-06
8.04975e-07
-3.73374e-06
-8.29731e-06
-1.11026e-05
-1.43011e-05
-1.71253e-05
-2.00298e-05
-2.28002e-05
-2.56038e-05
-2.8446e-05
-3.15039e-05
-3.46855e-05
-3.8233e-05
-4.21615e-05
-4.66948e-05
-5.19425e-05
-5.84941e-05
-6.65754e-05
-7.87764e-05
-9.66145e-05
-0.000132493
-0.000184034
-0.000218433
-0.000230297
-0.000214778
-0.000209653
-0.000226638
-0.000262281
-0.000285952
-0.000287599
-0.000200468
-0.000106968
-2.72737e-05
2.69361e-05
6.33533e-05
8.2855e-05
9.72562e-05
0.000107925
0.000116954
0.000125125
0.00013143
0.000135303
0.000137285
0.000137291
0.000136107
0.00013407
0.000131756
0.000128441
0.000125615
0.00012022
0.000117516
0.000114609
0.000112581
0.00011038
0.000108594
0.000106744
0.000105113
0.000103466
0.000101942
0.00010042
9.89665e-05
9.75206e-05
9.61097e-05
9.47025e-05
9.33114e-05
9.1915e-05
9.0521e-05
8.91127e-05
8.76948e-05
8.62534e-05
8.47914e-05
8.32962e-05
8.17698e-05
8.01997e-05
7.85868e-05
7.69192e-05
7.51959e-05
7.34053e-05
7.15456e-05
6.96036e-05
6.75789e-05
6.54552e-05
6.32356e-05
6.09006e-05
5.8457e-05
5.58798e-05
5.31816e-05
5.03252e-05
4.73349e-05
4.41494e-05
4.08111e-05
3.71703e-05
3.32712e-05
2.91197e-05
2.48183e-05
2.02505e-05
1.56087e-05
1.07107e-05
5.90623e-06
8.85388e-07
-3.678e-06
-8.26653e-06
-1.1047e-05
-1.42368e-05
-1.70643e-05
-1.9974e-05
-2.27526e-05
-2.55627e-05
-2.84119e-05
-3.14768e-05
-3.46601e-05
-3.82041e-05
-4.21255e-05
-4.66475e-05
-5.18815e-05
-5.84142e-05
-6.64652e-05
-7.86261e-05
-9.63978e-05
-0.000132204
-0.000183815
-0.000218746
-0.000230852
-0.000214998
-0.00020975
-0.000226738
-0.000262775
-0.000287109
-0.000289059
-0.00020089
-0.000106526
-2.65075e-05
2.77162e-05
6.40163e-05
8.33513e-05
9.76619e-05
0.000108282
0.000117298
0.000125484
0.000131788
0.000135638
0.000137584
0.000137538
0.000136301
0.000134222
0.000131866
0.000128513
0.000125634
0.000120158
0.000117456
0.000114575
0.000112559
0.000110368
0.000108588
0.000106742
0.000105116
0.000103472
0.000101951
0.000100432
9.89807e-05
9.75374e-05
9.6129e-05
9.47243e-05
9.33357e-05
9.19418e-05
9.05504e-05
8.91447e-05
8.77295e-05
8.62909e-05
8.48317e-05
8.33395e-05
8.1816e-05
8.02489e-05
7.86391e-05
7.69747e-05
7.52546e-05
7.34674e-05
7.1611e-05
6.96724e-05
6.7651e-05
6.55309e-05
6.33146e-05
6.09829e-05
5.85424e-05
5.5968e-05
5.32724e-05
5.04181e-05
4.7429e-05
4.42437e-05
4.09025e-05
3.72605e-05
3.3371e-05
2.92289e-05
2.49322e-05
2.03654e-05
1.57208e-05
1.08168e-05
6.00171e-06
9.66019e-07
-3.6235e-06
-8.23852e-06
-1.09965e-05
-1.41784e-05
-1.70101e-05
-1.99254e-05
-2.27119e-05
-2.55277e-05
-2.8383e-05
-3.1454e-05
-3.46387e-05
-3.81795e-05
-4.20946e-05
-4.6606e-05
-5.18275e-05
-5.83419e-05
-6.6363e-05
-7.84792e-05
-9.61688e-05
-0.000131865
-0.000183525
-0.000218934
-0.000231279
-0.000215159
-0.000209808
-0.000226782
-0.000263092
-0.000287955
-0.000290181
-0.000201177
-0.000106136
-2.58839e-05
2.83268e-05
6.45198e-05
8.3717e-05
9.79565e-05
0.000108538
0.000117544
0.000125745
0.000132052
0.000135892
0.000137815
0.000137734
0.000136457
0.000134346
0.000131958
0.000128574
0.000125649
0.000120108
0.00011741
0.00011455
0.000112543
0.000110359
0.000108583
0.000106741
0.000105117
0.000103476
0.000101956
0.00010044
9.89906e-05
9.75493e-05
9.61429e-05
9.47402e-05
9.33537e-05
9.1962e-05
9.05729e-05
8.91697e-05
8.77571e-05
8.63211e-05
8.48648e-05
8.33756e-05
8.18553e-05
8.02915e-05
7.86851e-05
7.70243e-05
7.53079e-05
7.35245e-05
7.16721e-05
6.97375e-05
6.77203e-05
6.56041e-05
6.33918e-05
6.10638e-05
5.86267e-05
5.60555e-05
5.33625e-05
5.05102e-05
4.75223e-05
4.43369e-05
4.09925e-05
3.73501e-05
3.3472e-05
2.93401e-05
2.50483e-05
2.04825e-05
1.58342e-05
1.09231e-05
6.09559e-06
1.0435e-06
-3.57371e-06
-8.21544e-06
-1.09537e-05
-1.4129e-05
-1.69654e-05
-1.98858e-05
-2.26789e-05
-2.54991e-05
-2.83588e-05
-3.14344e-05
-3.462e-05
-3.8158e-05
-4.20678e-05
-4.657e-05
-5.17804e-05
-5.82779e-05
-6.62701e-05
-7.83385e-05
-9.59287e-05
-0.000131498
-0.000183216
-0.000219028
-0.000231584
-0.000215269
-0.000209837
-0.000226798
-0.00026328
-0.000288523
-0.000290944
-0.000201268
-0.000105734
-2.53518e-05
2.88065e-05
6.4892e-05
8.39745e-05
9.81587e-05
0.000108709
0.000117705
0.000125912
0.00013222
0.000136052
0.000137964
0.000137861
0.000136559
0.000134429
0.00013202
0.000128618
0.000125662
0.000120077
0.000117382
0.000114536
0.000112535
0.000110354
0.00010858
0.00010674
0.000105118
0.000103477
0.00010196
0.000100444
9.89961e-05
9.7556e-05
9.61508e-05
9.47494e-05
9.33643e-05
9.19742e-05
9.05867e-05
8.91853e-05
8.77746e-05
8.63409e-05
8.48869e-05
8.34003e-05
8.18828e-05
8.03221e-05
7.87191e-05
7.70619e-05
7.53495e-05
7.35704e-05
7.17225e-05
6.97928e-05
6.77806e-05
6.56697e-05
6.34627e-05
6.11399e-05
5.87077e-05
5.61409e-05
5.34518e-05
5.06026e-05
4.76166e-05
4.44312e-05
4.1083e-05
3.74405e-05
3.35768e-05
2.94556e-05
2.51673e-05
2.05995e-05
1.59436e-05
1.10211e-05
6.1776e-06
1.10741e-06
-3.53604e-06
-8.20037e-06
-1.0923e-05
-1.40937e-05
-1.69341e-05
-1.98582e-05
-2.26557e-05
-2.54784e-05
-2.83404e-05
-3.14183e-05
-3.46038e-05
-3.81393e-05
-4.20448e-05
-4.65398e-05
-5.17406e-05
-5.82233e-05
-6.61886e-05
-7.82093e-05
-9.56913e-05
-0.000131136
-0.000182927
-0.000219066
-0.000231786
-0.000215338
-0.000209847
-0.000226803
-0.000263388
-0.000288871
-0.000291384
-0.000201165
-0.00010531
-2.4891e-05
2.91808e-05
6.51593e-05
8.41485e-05
9.82912e-05
0.000108816
0.000117803
0.000126009
0.000132312
0.000136137
0.000138041
0.000137926
0.000136612
0.000134472
0.000132053
0.000128642
0.000125672
0.000120066
0.00011737
0.00011453
0.000112531
0.000110352
0.000108579
0.00010674
0.000105118
0.000103478
0.000101961
0.000100446
9.8998e-05
9.75584e-05
9.61538e-05
9.47531e-05
9.33686e-05
9.19793e-05
9.05927e-05
8.91923e-05
8.77827e-05
8.63503e-05
8.48978e-05
8.34128e-05
8.18972e-05
8.03386e-05
7.8738e-05
7.70835e-05
7.53741e-05
7.35985e-05
7.17546e-05
6.98294e-05
6.78223e-05
6.5717e-05
6.35162e-05
6.12e-05
5.87747e-05
5.6215e-05
5.35328e-05
5.06903e-05
4.771e-05
4.45284e-05
4.11791e-05
3.75388e-05
3.36888e-05
2.95721e-05
2.52789e-05
2.07009e-05
1.60306e-05
1.10926e-05
6.23249e-06
1.14673e-06
-3.51529e-06
-8.194e-06
-1.09067e-05
-1.40754e-05
-1.69184e-05
-1.98446e-05
-2.26442e-05
-2.54677e-05
-2.833e-05
-3.14082e-05
-3.45926e-05
-3.81256e-05
-4.20277e-05
-4.65172e-05
-5.17104e-05
-5.81813e-05
-6.61239e-05
-7.81032e-05
-9.54871e-05
-0.000130821
-0.000182687
-0.000219081
-0.000231913
-0.00021537
-0.000209846
-0.000226804
-0.000263463
-0.00028907
-0.000291588
-0.000200979
-0.00010495
-2.45462e-05
2.94393e-05
6.53316e-05
8.42559e-05
9.83708e-05
0.000108879
0.000117858
0.00012606
0.000132357
0.000136176
0.000138073
0.000137953
0.000136634
0.00013449
0.000132067
0.000128653
0.000125678
0.000120064
0.000117367
0.000114528
0.00011253
0.000110352
0.000108578
0.000106739
0.000105117
0.000103478
0.00010196
0.000100445
9.8998e-05
9.75586e-05
9.61541e-05
9.47536e-05
9.33693e-05
9.19802e-05
9.0594e-05
8.91938e-05
8.77847e-05
8.63527e-05
8.49008e-05
8.34165e-05
8.19017e-05
8.03441e-05
7.87446e-05
7.70915e-05
7.53837e-05
7.36099e-05
7.17683e-05
6.98458e-05
6.7842e-05
6.57406e-05
6.35444e-05
6.12336e-05
5.88146e-05
5.6262e-05
5.35879e-05
5.07546e-05
4.77848e-05
4.46148e-05
4.12775e-05
3.76498e-05
3.37926e-05
2.96649e-05
2.53569e-05
2.07639e-05
1.6079e-05
1.11285e-05
6.25747e-06
1.1628e-06
-3.50808e-06
-8.19353e-06
-1.09023e-05
-1.40708e-05
-1.69154e-05
-1.98425e-05
-2.2643e-05
-2.54666e-05
-2.83285e-05
-3.14061e-05
-3.45891e-05
-3.81201e-05
-4.20197e-05
-4.65055e-05
-5.16936e-05
-5.81569e-05
-6.60843e-05
-7.80363e-05
-9.53516e-05
-0.000130606
-0.000182543
-0.0002191
-0.000231991
-0.000215378
-0.000209832
-0.000226801
-0.000263538
-0.000289186
-0.000291685
-0.000200898
-0.00010482
-2.44147e-05
2.95395e-05
6.54004e-05
8.43019e-05
9.84047e-05
0.000108906
0.000117881
0.00012608
0.000132375
0.000136191
0.000138087
0.000137965
0.000136643
0.000134498
0.000132073
0.000128658
0.00012568
0.000120061
0.000117364
0.000114527
0.000112529
0.00011035
0.000108578
0.000106739
0.000105117
0.000103477
0.00010196
0.000100445
9.89976e-05
9.75582e-05
9.61537e-05
9.47532e-05
9.3369e-05
9.198e-05
9.05938e-05
8.91937e-05
8.77846e-05
8.63527e-05
8.49009e-05
8.34167e-05
8.19021e-05
8.03447e-05
7.87455e-05
7.70928e-05
7.53855e-05
7.36124e-05
7.17717e-05
6.98503e-05
6.7848e-05
6.57486e-05
6.35547e-05
6.12468e-05
5.88311e-05
5.62824e-05
5.36129e-05
5.07851e-05
4.78223e-05
4.46627e-05
4.13411e-05
3.77359e-05
3.3852e-05
2.97117e-05
2.53936e-05
2.07917e-05
1.60988e-05
1.11417e-05
6.26572e-06
1.16773e-06
-3.50539e-06
-8.19273e-06
-1.09022e-05
-1.4072e-05
-1.69181e-05
-1.98464e-05
-2.26478e-05
-2.54722e-05
-2.83344e-05
-3.1412e-05
-3.45946e-05
-3.81246e-05
-4.20228e-05
-4.6507e-05
-5.16931e-05
-5.8154e-05
-6.60769e-05
-7.8022e-05
-9.53137e-05
-0.000130548
-0.00018254
-0.000219142
-0.000232041
-0.00021538
-0.000209813
)
;
boundaryField
{
bottomWall
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
inlet
{
type cyclic;
}
outlet
{
type cyclic;
}
topWall
{
type zeroGradient;
}
}
// ************************************************************************* //
| [
"hengxiao@vt.edu"
] | hengxiao@vt.edu | |
2e07200c0e94efec93991d47d14ba2e813734631 | 44a55b0ff8dc111d3a052219798faaa3bf0fd0db | /main.cpp | 34ed5344cc6a5515a8e86b9deb68c87d52f40122 | [] | no_license | baldwinvs/boost_socket_testing | 8c7f27e560b10e57230ef7993ae310c2274b3ebd | aa941ce8164b9e325ee1f18254667088bcb028a3 | refs/heads/master | 2023-05-06T08:32:18.064478 | 2021-06-01T02:16:32 | 2021-06-01T02:16:32 | 372,510,162 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,820 | cpp | #include <thread>
#include <boost/asio.hpp>
#include <array>
#include <atomic>
#include <cstdio>
#include <cstddef>
#include <cstring>
#include <iomanip>
#include <iostream>
constexpr uint16_t portToUse {141};
constexpr size_t bufSize {16};
inline const std::string address {"127.0.0.1"};
std::atomic_bool received {true};
int receiver() {
std::array<char, bufSize> buf {};
boost::asio::io_service ioService;
boost::asio::ip::udp::socket socket{ioService};
boost::asio::ip::udp::endpoint endpoint {boost::asio::ip::address::from_string(address), portToUse};
socket.open(boost::asio::ip::udp::v4());
socket.bind(endpoint);
while(1) {
auto len = socket.receive_from(boost::asio::buffer(buf.data(), sizeof(buf)), endpoint);
//print the data
std::cout.write(buf.data(), len);
std::cout << std::endl;
received = true;
}
return 0;
}
int transmitter() {
std::array<char, bufSize> buf {};
char fillChar {'0'};
boost::asio::io_service ioService;
boost::asio::ip::udp::socket socket{ioService};
socket.open(boost::asio::ip::udp::v4());
boost::asio::ip::udp::endpoint endpoint {boost::asio::ip::address::from_string(address), portToUse};
using namespace std::chrono_literals;
while(1) {
if(received) {
received = false;
memset(buf.data(), fillChar, buf.size());
socket.send_to(boost::asio::buffer(buf), endpoint);
if(++fillChar > '9')
fillChar = '0';
}
std::this_thread::sleep_for(100ms);
}
return 0;
}
int main() {
std::thread(receiver).detach();
std::thread(transmitter).detach();
while(1) {
using namespace std::chrono_literals;
std::this_thread::sleep_for(60s);
}
return 0;
}
| [
"baldwinvs@outlook.com"
] | baldwinvs@outlook.com |
ce597a8aa400a53734cb0377393b7b5d255b24d9 | cecac291a46aa5a71bf48be4df651ab679767acd | /Ch9_10_Person_Detection/ArduCAM/ArduCAM/examples/mini/ArduCAM_Mini_2MP_Plus_Multi_Capture2SD/ArduCAM_Mini_2MP_Plus_Multi_Capture2SD.ino | bf212ead1b31ecb25b25d677a619957289d0755d | [
"MIT",
"LGPL-2.1-only"
] | permissive | TinyML-Study/TinyML-Code-Practice-Peter | 21abd09070634e3915e931f0ce3f6e41fee2b5e6 | eb3978328d63ff8054003dc8e4cacbb3d12189b6 | refs/heads/master | 2022-12-28T20:33:41.580367 | 2020-10-20T14:48:12 | 2020-10-20T14:48:12 | 295,699,200 | 0 | 1 | MIT | 2020-10-20T14:48:14 | 2020-09-15T10:59:40 | C++ | UTF-8 | C++ | false | false | 6,075 | ino | // ArduCAM Mini demo (C)2018 Lee
// Web: http://www.ArduCAM.com
// This program is a demo of how to use the enhanced functions
// This demo was made for ArduCAM_Mini_2MP_Plus.
// It can continue shooting and store it into the SD card in JPEG format
// The demo sketch will do the following tasks
// 1. Set the camera to JPEG output mode.
// 2. Capture a JPEG photo and buffer the image to FIFO
// 3.Write the picture data to the SD card
// 5.close the file
//You can change the FRAMES_NUM count to change the number of the picture.
//IF the FRAMES_NUM is 0X00, take one photos
//IF the FRAMES_NUM is 0X01, take two photos
//IF the FRAMES_NUM is 0X02, take three photos
//IF the FRAMES_NUM is 0X03, take four photos
//IF the FRAMES_NUM is 0X04, take five photos
//IF the FRAMES_NUM is 0X05, take six photos
//IF the FRAMES_NUM is 0X06, take seven photos
//IF the FRAMES_NUM is 0XFF, continue shooting until the FIFO is full
//You can see the picture in the SD card.
// This program requires the ArduCAM V4.0.0 (or later) library and ArduCAM_Mini_2MP_Plus
// and use Arduino IDE 1.6.8 compiler or above
#include <Wire.h>
#include <ArduCAM.h>
#include <SPI.h>
#include <SD.h>
#include "memorysaver.h"
//This demo can only work on OV5640_MINI_5MP_PLUS or OV5642_MINI_5MP_PLUS platform.
#if !(defined (OV2640_MINI_2MP_PLUS))
#error Please select the hardware platform and camera module in the ../libraries/ArduCAM/memorysaver.h file
#endif
#define FRAMES_NUM 0x06
// set pin 7 as the slave select for the digital pot:
const int CS = 7;
#define SD_CS 9
bool is_header = false;
int total_time = 0;
#if defined (OV2640_MINI_2MP_PLUS)
ArduCAM myCAM( OV2640, CS );
#endif
uint8_t read_fifo_burst(ArduCAM myCAM);
void setup() {
// put your setup code here, to run once:
uint8_t vid, pid;
uint8_t temp;
#if defined(__SAM3X8E__)
Wire1.begin();
#else
Wire.begin();
#endif
Serial.begin(115200);
Serial.println(F("ArduCAM Start!"));
// set the CS as an output:
pinMode(CS, OUTPUT);
digitalWrite(CS, HIGH);
// initialize SPI:
SPI.begin();
//Reset the CPLD
myCAM.write_reg(0x07, 0x80);
delay(100);
myCAM.write_reg(0x07, 0x00);
delay(100);
while (1) {
//Check if the ArduCAM SPI bus is OK
myCAM.write_reg(ARDUCHIP_TEST1, 0x55);
temp = myCAM.read_reg(ARDUCHIP_TEST1);
if (temp != 0x55)
{
Serial.println(F("SPI interface Error!"));
delay(1000); continue;
} else {
Serial.println(F("SPI interface OK.")); break;
}
}
#if defined (OV2640_MINI_2MP_PLUS)
while (1) {
//Check if the camera module type is OV2640
myCAM.wrSensorReg8_8(0xff, 0x01);
myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);
myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);
if ((vid != 0x26 ) && (( pid != 0x41 ) || ( pid != 0x42 ))) {
Serial.println(F("ACK CMD Can't find OV2640 module!"));
delay(1000); continue;
}
else {
Serial.println(F("ACK CMD OV2640 detected.")); break;
}
}
#endif
//Initialize SD Card
while (!SD.begin(SD_CS))
{
Serial.println(F("SD Card Error!")); delay(1000);
}
Serial.println(F("SD Card detected."));
//Change to JPEG capture mode and initialize the OV5640 module
myCAM.set_format(JPEG);
myCAM.InitCAM();
myCAM.clear_fifo_flag();
myCAM.write_reg(ARDUCHIP_FRAMES, FRAMES_NUM);
}
void loop() {
// put your main code here, to run repeatedly:
myCAM.flush_fifo();
myCAM.clear_fifo_flag();
#if defined (OV2640_MINI_2MP_PLUS)
myCAM.OV2640_set_JPEG_size(OV2640_1600x1200);
#endif
//Start capture
myCAM.start_capture();
Serial.println(F("start capture."));
total_time = millis();
while ( !myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK));
Serial.println(F("CAM Capture Done."));
total_time = millis() - total_time;
Serial.print(F("capture total_time used (in miliseconds):"));
Serial.println(total_time, DEC);
total_time = millis();
read_fifo_burst(myCAM);
total_time = millis() - total_time;
Serial.print(F("save capture total_time used (in miliseconds):"));
Serial.println(total_time, DEC);
//Clear the capture done flag
myCAM.clear_fifo_flag();
delay(5000);
}
uint8_t read_fifo_burst(ArduCAM myCAM)
{
uint8_t temp = 0, temp_last = 0;
uint32_t length = 0;
static int i = 0;
static int k = 0;
char str[16];
File outFile;
byte buf[256];
length = myCAM.read_fifo_length();
Serial.print(F("The fifo length is :"));
Serial.println(length, DEC);
if (length >= MAX_FIFO_SIZE) //8M
{
Serial.println("Over size.");
return 0;
}
if (length == 0 ) //0 kb
{
Serial.println(F("Size is 0."));
return 0;
}
myCAM.CS_LOW();
myCAM.set_fifo_burst();//Set fifo burst mode
i = 0;
while ( length-- )
{
temp_last = temp;
temp = SPI.transfer(0x00);
//Read JPEG data from FIFO
if ( (temp == 0xD9) && (temp_last == 0xFF) ) //If find the end ,break while,
{
buf[i++] = temp; //save the last 0XD9
//Write the remain bytes in the buffer
myCAM.CS_HIGH();
outFile.write(buf, i);
//Close the file
outFile.close();
Serial.println(F("OK"));
is_header = false;
myCAM.CS_LOW();
myCAM.set_fifo_burst();
i = 0;
}
if (is_header == true)
{
//Write image data to buffer if not full
if (i < 256)
buf[i++] = temp;
else
{
//Write 256 bytes image data to file
myCAM.CS_HIGH();
outFile.write(buf, 256);
i = 0;
buf[i++] = temp;
myCAM.CS_LOW();
myCAM.set_fifo_burst();
}
}
else if ((temp == 0xD8) & (temp_last == 0xFF))
{
is_header = true;
myCAM.CS_HIGH();
//Create a avi file
k = k + 1;
itoa(k, str, 10);
strcat(str, ".jpg");
//Open the new file
outFile = SD.open(str, O_WRITE | O_CREAT | O_TRUNC);
if (! outFile)
{
Serial.println(F("File open failed"));
while (1);
}
myCAM.CS_LOW();
myCAM.set_fifo_burst();
buf[i++] = temp_last;
buf[i++] = temp;
}
}
myCAM.CS_HIGH();
return 1;
}
| [
"petercha90@gmail.com"
] | petercha90@gmail.com |
3c997390641683ba576171d6c1f091468b85eaa0 | b517081a8537beddf629c973d4322951dcd78edd | /dynamic_solver/FastConsensusSolver/src/BayesianQuenchedConsensusSolver.cpp | 13d5343e0f665f7f4b5c70e499fc7002efdeab5c | [] | no_license | andresantoro/Social_Consensus | a979a93e8c0089070675683be3f49b2245530e20 | 8b9637c41b9bd9ccaa5615c1b4741069f2505f39 | refs/heads/master | 2021-07-16T18:07:14.705800 | 2019-02-14T22:14:08 | 2019-02-14T22:14:08 | 138,658,928 | 0 | 0 | null | 2019-02-14T22:14:09 | 2018-06-25T23:06:00 | Jupyter Notebook | UTF-8 | C++ | false | false | 3,908 | cpp | /**
* \file BayesianQuenchedConsensusSolver.cpp
* \brief Methods for the class BayesianQuenchedConsensusSolver
* \author Guillaume St-Onge
* \version 1.0
* \date 27/09/2018
*/
#include "BayesianQuenchedConsensusSolver.hpp"
using namespace std;
namespace soc
{//start of namespace net
/*---------------------------
* Constructor
*---------------------------*/
/**
* \brief Constructor of the class BayesianQuenchedConsensusSolver
* \param[in] network_map unordered_map of <Node, vector<Node>> for structure
* \param[in] influence_map unordered_map of <Node, double> to fix the influence
* \param[in] initial_state_vector vector<double> to represent initial opinion
* \param[in] eta double parameter for the dynamics
* \param[in] seed int seed for the random number generator
*/
BayesianQuenchedConsensusSolver::BayesianQuenchedConsensusSolver(
unordered_map<Node, vector<Node> >& network_map,
unordered_map<Node, double>& influence_map,
vector<double>& initial_state_vector, double eta, int seed,
size_t max_cluster, bool both_speak) :
QuenchedConsensusSolver(network_map, influence_map,
initial_state_vector, eta, seed, max_cluster, both_speak),
variance_vector_(network_map.size(), 1.)
{
}
/**
* \brief Constructor of the class BayesianQuenchedConsensusSolver
* \param[in] network_map unordered_map of <Node, vector<Node>> for structure
* \param[in] influence_map unordered_map of <Node, double> to fix the influence
* \param[in] eta double parameter for the dynamics
* \param[in] seed int seed for the random number generator
*/
BayesianQuenchedConsensusSolver::BayesianQuenchedConsensusSolver(
unordered_map<Node, vector<Node> >& network_map,
unordered_map<Node, double>& influence_map,
double eta, int seed, size_t max_cluster, bool both_speak) :
QuenchedConsensusSolver(network_map, influence_map, eta, seed,
max_cluster, both_speak),
variance_vector_(network_map.size(), 1.)
{
}
/*---------------------------
* Mutators
*---------------------------*/
/**
* \brief Make a step of the consensus dynamics
*/
void BayesianQuenchedConsensusSolver::consensus_step()
{
Node listener = random_int(size_, gen_);
Node speaker = network_map_.at(listener)[
random_int(network_map_.at(listener).size(), gen_)];
//initial state
double raw_variation = state_vector_[speaker]-state_vector_[listener];
double initial_speaker_variance = variance_vector_[speaker];
double initial_listener_variance = variance_vector_[listener];
//get "scaled" kalman gain
double k = (eta_*(1 + influence_map_[speaker] - influence_map_[listener])*
initial_listener_variance/(initial_speaker_variance +
initial_listener_variance));
//determine variation on state and update variance
double variation_listener = (raw_variation*k);
state_vector_[listener] += variation_listener;
variance_vector_[listener] = ((1-k)*(1-k)*initial_listener_variance +
k*k*initial_speaker_variance);
//store the variation step
history_vector_.push_back(pair<Node,double>(listener, variation_listener));
//change the state of the speaker also
if (both_speak_)
{
//get "scaled" kalman gain
double k = (eta_*(1 + influence_map_[listener] -
influence_map_[speaker])*initial_speaker_variance/
(initial_speaker_variance + initial_listener_variance));
//determine variation
double variation_speaker = (-raw_variation*k);
state_vector_[speaker] += variation_speaker;
variance_vector_[speaker] = ((1-k)*(1-k)*initial_speaker_variance +
k*k*initial_listener_variance);
//store the variation step
history_vector_.push_back(pair<Node,double>(speaker,
variation_speaker));
}
}
}//end of namespace soc
| [
"guillaume.st-onge.4@ulaval.ca"
] | guillaume.st-onge.4@ulaval.ca |
b52f93b339edf61bca883127853b263754d931d1 | b8be35d7f0d82c7a4892c7cb6f772c26def63073 | /src/timedata.cpp | d0008194096ffde3a86b8de3844e73a6f8151ae8 | [
"MIT"
] | permissive | poseidondev/posq | 9fec53574e601f9666caef61c9439d6143b62ee8 | fe1915b8a8a1bf72117395ef3bb033f3b1edba53 | refs/heads/master | 2021-03-27T19:59:39.746053 | 2019-01-09T03:08:58 | 2019-01-09T03:08:58 | 121,125,177 | 5 | 21 | MIT | 2019-01-09T03:14:09 | 2018-02-11T13:17:28 | C++ | UTF-8 | C++ | false | false | 3,610 | cpp | // Copyright (c) 2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "timedata.h"
#include "netbase.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>
using namespace std;
static CCriticalSection cs_nTimeOffset;
static int64_t nTimeOffset = 0;
/**
* "Never go to sea with two chronometers; take one or three."
* Our three time sources are:
* - System clock
* - Median of other nodes clocks
* - The user (asking the user to fix the system clock if the first two disagree)
*/
int64_t GetTimeOffset()
{
LOCK(cs_nTimeOffset);
return nTimeOffset;
}
int64_t GetAdjustedTime()
{
return GetTime() + GetTimeOffset();
}
static int64_t abs64(int64_t n)
{
return (n >= 0 ? n : -n);
}
void AddTimeData(const CNetAddr& ip, int64_t nTime)
{
int64_t nOffsetSample = nTime - GetTime();
LOCK(cs_nTimeOffset);
// Ignore duplicates
static set<CNetAddr> setKnown;
if (!setKnown.insert(ip).second)
return;
// Add data
static CMedianFilter<int64_t> vTimeOffsets(200, 0);
vTimeOffsets.input(nOffsetSample);
LogPrintf("Added time data, samples %d, offset %+d (%+d minutes)\n", vTimeOffsets.size(), nOffsetSample, nOffsetSample / 60);
// There is a known issue here (see issue #4521):
//
// - The structure vTimeOffsets contains up to 200 elements, after which
// any new element added to it will not increase its size, replacing the
// oldest element.
//
// - The condition to update nTimeOffset includes checking whether the
// number of elements in vTimeOffsets is odd, which will never happen after
// there are 200 elements.
//
// But in this case the 'bug' is protective against some attacks, and may
// actually explain why we've never seen attacks which manipulate the
// clock offset.
//
// So we should hold off on fixing this and clean it up as part of
// a timing cleanup that strengthens it in a number of other ways.
//
if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) {
int64_t nMedian = vTimeOffsets.median();
std::vector<int64_t> vSorted = vTimeOffsets.sorted();
// Only let other nodes change our time by so much
if (abs64(nMedian) < 70 * 60) {
nTimeOffset = nMedian;
} else {
nTimeOffset = 0;
static bool fDone;
if (!fDone) {
// If nobody has a time different than ours but within 5 minutes of ours, give a warning
bool fMatch = false;
BOOST_FOREACH (int64_t nOffset, vSorted)
if (nOffset != 0 && abs64(nOffset) < 5 * 60)
fMatch = true;
if (!fMatch) {
fDone = true;
string strMessage = _("Warning: Please check that your computer's date and time are correct! If your clock is wrong Poseidon Core will not work properly.");
strMiscWarning = strMessage;
LogPrintf("*** %s\n", strMessage);
uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING);
}
}
}
if (fDebug) {
BOOST_FOREACH (int64_t n, vSorted)
LogPrintf("%+d ", n);
LogPrintf("| ");
}
LogPrintf("nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset / 60);
}
}
| [
"sh.an.ebuckley92@gmail.com"
] | sh.an.ebuckley92@gmail.com |
014edd9436449c0ca8b7f5a3cde434195598e041 | 4ff7cfd989f2345416a9e8760077e75147f1dfca | /C++/tsoj/1150细菌繁殖.cpp | f401e5eecb0114d0e06cd23db8205e6fcbfa138b | [] | no_license | gqzcl/code_save | bc7de0974402e1ef85dbaeb51d38699d11d32a0f | 47a817ab6e5c0ad16450c3d36263274c1ff3dcd1 | refs/heads/master | 2020-04-07T08:16:31.591946 | 2018-12-21T07:59:55 | 2018-12-21T07:59:55 | 158,206,968 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 1,414 | cpp | #include<iostream>
using namespace std;
const int N=180;
int months[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int days(int day1,int month1,int day2,int month2)
{
int count=0;
for(int i=month1;i<=month2;i++)
{
if(month1==month2)
count=day2-day1;
else if(i==month1)
count=count+months[i-1]-day1;
else if(i==month2)
count+=day2;
else
count+=months[i-1];
}
return count;
}
int fact(int count,int p[])
{
for(int i=count;i>0;)
{
if(i/8>0)
{
i-=8;
for(int j=N-1;j>=0;j--)
p[j]*=256;
}
else if(i/4>0)
{
i-=4;
for(int j=N-1;j>=0;j--)
p[j]*=16;
}
else if(i/2>0)
{
i-=2;
for(int j=N-1;j>=0;j--)
p[j]*=4;
}
else
{
i-=1;
for(int j=N-1;j>=0;j--)
p[j]*=2;
}
for(int j=N-1;j>=0;j--)
{
if(p[j]>=10)
{
p[j-1]+=p[j]/10;
p[j]%=10;
}
}
}
}
int print(int arr[])//Êä³öÊý×é
{
int flag=0;
for(int i=0;i<N;i++)
{
if(flag)
cout<<arr[i];
else if(arr[i])
{
cout<<arr[i];
flag=1;
}
}
cout<<endl;
}
int main()
{
int n;
while(cin>>n)
{
while(n--)
{
int day1,month1,day2,month2;
string nsize;
cin>>month1>>day1>>nsize>>month2>>day2;
int count=days(day1,month1,day2,month2);
int result[N];
for(int i=0;i<N;i++)
result[i]=0;
int j=nsize.length()-1;
for(int i=N-1;j>=0;i--)
result[i]=nsize[j--]-'0';
fact(count,result);
print(result);
}
}
return 0;
}
| [
"1476048558@qq.com"
] | 1476048558@qq.com |
574d4c2d771b1e53e3c12bf8524daac09277ff79 | 241a8475d685d42eab3a600785bb03afd934b1b1 | /punteros/main.cpp | 2dc9f84d9487258e11ce56e579b56d57f89bd23c | [] | no_license | lonelyday01/EDD2015 | 3d1db0c646bc7d62f7c166fe25111dce016322db | d2ea390864478358fb22e936b7f825c8bc743c5c | refs/heads/master | 2020-05-09T17:07:43.114871 | 2016-01-12T08:45:57 | 2016-01-12T08:45:57 | 42,542,664 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 317 | cpp | #include <iostream>
using namespace std;
int main()
{
int taman=0,cont;
int * puntero;
cout<<"ingresa el tamaño del arreglo"<<endl;
cin>>taman;
int arreglo[taman];
puntero = arreglo;
*puntero=1;
for (cont=0;cont < taman; cont ++)
{
puntero[cont]=&puntero++;
cout<<arreglo[cont]<<endl;
}
return 0;
}
| [
"janixiox@gmail.com"
] | janixiox@gmail.com |
9c182d3c1565ceb4b5893f41a0803928f9e48614 | b4d312da77b8d3f2eebbfde092643428343d9c00 | /Classes/CppCallJava/CppCallJava.h | 149072f2a273d7df563b40e1e9259157de572765 | [] | no_license | droidsde/HaiMianBaoBao | 6558fa49f0b5125b53a228493490a4b8d63c2188 | 4b8a89012e8bfde1197fd709b3d1f6a5a6eed721 | refs/heads/master | 2020-04-08T18:19:07.364875 | 2015-12-04T09:25:50 | 2015-12-04T09:25:50 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,334 | h | #ifndef CPP_CALL_JAVA__H
#define CPP_CALL_JAVA__H
#include "cocos2d.h"
#include "string.h"
USING_NS_CC;
class CppCallJava
{
public:
//************************************
// Method: getPlatfromInfo
// FullName: CppCallJava::getPlatfromInfo
// Access: public
// Returns: void
// Explain: 登录前必须获取
// Parameter: void
//************************************
static void getPlatfromInfo(void);
static void verifyLuas(int userid, int maxlevel);
static bool logOut(void);
static char* getCandyPicDir(void);
static void loadNoCandyUserInfo(const char* jsondata);
static void toPay(const char* subject, const char* num, const char* body, const char* fee, const char* nickname);
static void patchTracker(const char* data);
static void showFeedbackDialog(void);
static void toBuyProp(int buytype, int num, int preciousid = 0);
static void getChitNickName(void);
static void initChat(int userid, int chatstate, const char* nickname);
static void deleteUserImage();
//购买超级大礼包
static void BuySuperGift();
// 分享接口
static void ShareToqzone(const char* path);
static bool isNetworkOk(void);
static bool toSystemSet(void);
static void sendRegeditOrLogin(int isRegedit, int userid);
static void BuyProduct(int productId);
static long getUserId( void );
};
#endif | [
"769875137@qq.com"
] | 769875137@qq.com |
dcd83500bdc9365df3c88d82031c416ba492a4a1 | f45c8775c0517fdc46939e6d5d728a09a7fe55e3 | /atcoder/abc133/C.cpp | 1b36bdca8cdc25cdb041c4a4043499178d9bc63f | [] | no_license | Radhesh-Sarma/Competitive-Coding | 6550af86545d7456923c559a78784af201f57e4e | ce71acaa912249717a8f6cbf7584034548db7951 | refs/heads/main | 2023-02-23T09:40:57.401882 | 2021-01-31T15:53:24 | 2021-01-31T15:53:24 | 191,410,831 | 0 | 1 | null | 2019-06-11T16:34:32 | 2019-06-11T16:34:31 | null | UTF-8 | C++ | false | false | 1,950 | cpp | //Keep Working Hard
// I__Like__Food
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define rep(i,a,b) for(int i = a; i <=b; i++)
#define rep2(i,a,b) for(int i = a; i>=b; i--)
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
using namespace __gnu_pbds;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
#define all(v) v.begin(),v.end()
#define PB push_back
#define MP make_pair
#define double long double
#define trace1(x) cerr<<#x<<": "<<x<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define cases int testcases;cin>>testcases; while(testcases--)
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int N = 20005;
const int INF = 1e16;
const double PI = acos(-1);
int32_t main()
{
IOS
int l,r;
cin >> l >> r;
if(r - l > 2019)
{
cout << 0;
return 0;
}
int ans = 1e9;
for(int i = l; i <= r; i++)
{
for(int j = i + 1; j <= r; j++)
{
ans = min(ans, (i*j)%2019);
if(ans == 0)
{
cout << 0;
return 0;
}
}
}
cout << ans;
return 0;
} | [
"radhesh@pop-os.localdomain"
] | radhesh@pop-os.localdomain |
542136170dcaff77ba6d75fa417e1d501eca23c5 | 243548920b4a8f6aa024419f56fd34332a23fa60 | /modelos/write_cdt_to_vtk_xml_file.h | cfb48396c80b8292b34a5920ed9d5be2c7c69052 | [] | no_license | lvsdvale/Simula-o-computacional-da-Laringe | 3e55aa5677a784505911ca63eb1035bb488aea21 | 382e0edaffbf017bb23c5cd6ae0301e0ca391afe | refs/heads/master | 2022-11-19T09:37:57.626955 | 2020-07-16T19:43:18 | 2020-07-16T19:43:18 | 267,971,026 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,376 | h | #ifndef Mesh_3_example_write_cdt_to_vtk_xml_file_h
#define Mesh_3_example_write_cdt_to_vtk_xml_file_h
#include<fstream>
namespace CGAL {
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds> CDT;
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CDT::Vertex_handle Vertex_handle;
typedef CDT::Point Point;
int main()
template<class CDT>
bool write_cdt_to_vtk_xml_file(CDT cdt, const std::string &file_name)
{
typedef typename CDT::Finite_facets_iterator Cell_iterator;
typedef typename CDT::Finite_vertices_iterator Vertex_iterator;
// Domain
typedef Exact_predicates_inexact_constructions_kernel K;
typedef K::FT FT;
typedef K::Point_3 Point3;
// check that file extension is "vtu"
CGAL_assertion(file_name.substr(file_name.length()-4,4) == ".vtu");
// open file
std::ofstream vtk_file(file_name.c_str());
// header
vtk_file << "<VTKFile type=\"UnstructuredGrid\" ";
vtk_file << "version=\"0.1\" ";
vtk_file << "byte_order=\"BigEndian\">" << std::endl;
int indent_size = 2;
std::string indent_unit(indent_size, ' ');
std::string indent = indent_unit;
vtk_file << indent + "<UnstructuredGrid>" << std::endl;
// write mesh
int num_vertices = cdt.number_of_vertices();
int num_cells = cdt.number_of_faces();
indent += indent_unit;
vtk_file << indent + "<Piece NumberOfPoints=\"" << num_vertices << "\" ";
vtk_file << "NumberOfCells=\"" << num_cells << "\">" << std::endl;
// Write vertices
indent += indent_unit;
vtk_file << indent + "<Points>" << std::endl;
indent += indent_unit;
vtk_file << indent;
vtk_file << "<DataArray type=\"Float32\" NumberOfComponents=\"3\" Format=\"ascii\">" << std::endl;
std::map<Point, int> V;
int i=0;
indent += indent_unit;
for (Vertex_iterator it=cdt.finite_vertices_begin(); it != cdt.finite_vertices_end(); ++it)
{
vtk_file << indent;
vtk_file << it->point().x() << " " << it->point().y() << " " << it->point().z() << std::endl;
V[it->point()] = i;
++i;
}
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</DataArray>" << std::endl;
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</Points>" << std::endl;
// Write tetrahedra
vtk_file << indent << "<Cells>" << std::endl;
indent += indent_unit;
vtk_file << indent;
vtk_file << "<DataArray type=\"Int32\" Name=\"connectivity\" Format=\"ascii\">";
vtk_file << std::endl;
indent += indent_unit;
Cell_iterator it;
for (it = cdt.finite_faces_begin(); it != cdt.finite_faces_end(); ++it)
{
if (it->first->is_facet_on_surface(it->second)) {
vtk_file << indent;
vtk_file << V[it->first->vertex((it->second+1)%4)->point()] << " ";
vtk_file << V[it->first->vertex((it->second+2)%4)->point()] << " ";
vtk_file << V[it->first->vertex((it->second+3)%4)->point()] << " " << std::endl;
}
}
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</DataArray>" << std::endl;
// offsets
// every element is a three node triangle so all offsets are multiples of 3
vtk_file << indent;
vtk_file << "<DataArray type=\"Int32\" Name=\"offsets\" Format=\"ascii\">";
vtk_file << std::endl;
i = 3;
indent += indent_unit;
for (int j = 0; j < num_cells; ++j)
{
vtk_file << indent << i << std::endl;
i += 3;
}
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</DataArray>" << std::endl;
// cell types (type 5 is a three node triangle)
vtk_file << indent;
vtk_file << "<DataArray type=\"Int32\" Name=\"types\" Format=\"ascii\">";
vtk_file << std::endl;
indent += indent_unit;
for (int j = 0; j < num_cells; ++j)
{
vtk_file << indent << "5" << std::endl;
}
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</DataArray>" << std::endl;
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</Cells>" << std::endl;
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</Piece>" << std::endl;
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << indent + "</UnstructuredGrid>" << std::endl;
indent.erase(indent.length()-indent_size, indent_size);
vtk_file << "</VTKFile>" << std::endl;
return true;
}
}
| [
"vale@alunos.utfpr.edu.br"
] | vale@alunos.utfpr.edu.br |
023d04bd761fd0563abb0e1a985cc0fa84735186 | 8e567498a9224d7c6bf71cfe66ec5360e056ec02 | /mars/boost/numeric/conversion/detail/is_subranged.hpp | d045b7f3e1a3d321b681d5fdf81c486e327693bf | [
"MIT",
"Zlib",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL",
"BSD-3-Clause",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"BSL-1.0",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | Tencent/mars | db31afeeb5c0325bfceede594038381bce3c1635 | 6c7028fffe01e2b49a66c221b1ac2f548649053f | refs/heads/master | 2023-08-31T07:29:50.430084 | 2023-08-09T07:24:42 | 2023-08-09T07:24:42 | 76,222,419 | 18,118 | 3,828 | NOASSERTION | 2023-09-12T07:37:07 | 2016-12-12T04:39:54 | C++ | UTF-8 | C++ | false | false | 7,984 | hpp | // (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/numeric/conversion
//
// Contact the author at: fernando_cacciola@hotmail.com
//
#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
#define BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
#include "boost/config.hpp"
#include "boost/limits.hpp"
#include "boost/mpl/int.hpp"
#include "boost/mpl/multiplies.hpp"
#include "boost/mpl/less.hpp"
#include "boost/mpl/equal_to.hpp"
#include "boost/type_traits/is_same.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
#include "boost/numeric/conversion/detail/int_float_mixture.hpp"
#include "boost/numeric/conversion/detail/sign_mixture.hpp"
#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp"
namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace numeric { namespace convdetail
{
//---------------------------------------------------------------
// Implementations of the compile time predicate "T is subranged"
//---------------------------------------------------------------
// for integral to integral conversions
template<class T,class S>
struct subranged_Sig2Unsig
{
// Signed to unsigned conversions are 'subranged' because of possible loose
// of negative values.
typedef mpl::true_ type ;
} ;
// for unsigned integral to signed integral conversions
template<class T,class S>
struct subranged_Unsig2Sig
{
// IMPORTANT NOTE:
//
// This code assumes that signed/unsigned integral values are represented
// such that:
//
// numeric_limits<signed T>::digits + 1 == numeric_limits<unsigned T>::digits
//
// The '+1' is required since numeric_limits<>::digits gives 1 bit less for signed integral types.
//
// This fact is used by the following logic:
//
// if ( (numeric_limits<T>::digits+1) < (2*numeric_limits<S>::digits) )
// then the conversion is subranged.
//
typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
// T is signed, so take digits+1
typedef typename T_digits::next u_T_digits ;
typedef mpl::int_<2> Two ;
typedef typename mpl::multiplies<S_digits,Two>::type S_digits_times_2 ;
typedef typename mpl::less<u_T_digits,S_digits_times_2>::type type ;
} ;
// for integral to integral conversions of the same sign.
template<class T,class S>
struct subranged_SameSign
{
// An integral conversion of the same sign is subranged if digits(T) < digits(S).
typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
typedef typename mpl::less<T_digits,S_digits>::type type ;
} ;
// for integral to float conversions
template<class T,class S>
struct subranged_Int2Float
{
typedef mpl::false_ type ;
} ;
// for float to integral conversions
template<class T,class S>
struct subranged_Float2Int
{
typedef mpl::true_ type ;
} ;
// for float to float conversions
template<class T,class S>
struct subranged_Float2Float
{
// If both T and S are floats,
// compare exponent bits and if they match, mantisa bits.
typedef mpl::int_< ::std::numeric_limits<S>::digits > S_mantisa ;
typedef mpl::int_< ::std::numeric_limits<T>::digits > T_mantisa ;
typedef mpl::int_< ::std::numeric_limits<S>::max_exponent > S_exponent ;
typedef mpl::int_< ::std::numeric_limits<T>::max_exponent > T_exponent ;
typedef typename mpl::less<T_exponent,S_exponent>::type T_smaller_exponent ;
typedef typename mpl::equal_to<T_exponent,S_exponent>::type equal_exponents ;
typedef mpl::less<T_mantisa,S_mantisa> T_smaller_mantisa ;
typedef mpl::eval_if<equal_exponents,T_smaller_mantisa,mpl::false_> not_bigger_exponent_case ;
typedef typename
mpl::eval_if<T_smaller_exponent,mpl::true_,not_bigger_exponent_case>::type
type ;
} ;
// for Udt to built-in conversions
template<class T,class S>
struct subranged_Udt2BuiltIn
{
typedef mpl::true_ type ;
} ;
// for built-in to Udt conversions
template<class T,class S>
struct subranged_BuiltIn2Udt
{
typedef mpl::false_ type ;
} ;
// for Udt to Udt conversions
template<class T,class S>
struct subranged_Udt2Udt
{
typedef mpl::false_ type ;
} ;
//-------------------------------------------------------------------
// Selectors for the implementations of the subranged predicate
//-------------------------------------------------------------------
template<class T,class S>
struct get_subranged_Int2Int
{
typedef subranged_SameSign<T,S> Sig2Sig ;
typedef subranged_Sig2Unsig<T,S> Sig2Unsig ;
typedef subranged_Unsig2Sig<T,S> Unsig2Sig ;
typedef Sig2Sig Unsig2Unsig ;
typedef typename get_sign_mixture<T,S>::type sign_mixture ;
typedef typename
for_sign_mixture<sign_mixture, Sig2Sig, Sig2Unsig, Unsig2Sig, Unsig2Unsig>::type
type ;
} ;
template<class T,class S>
struct get_subranged_BuiltIn2BuiltIn
{
typedef get_subranged_Int2Int<T,S> Int2IntQ ;
typedef subranged_Int2Float <T,S> Int2Float ;
typedef subranged_Float2Int <T,S> Float2Int ;
typedef subranged_Float2Float<T,S> Float2Float ;
typedef mpl::identity<Int2Float > Int2FloatQ ;
typedef mpl::identity<Float2Int > Float2IntQ ;
typedef mpl::identity<Float2Float> Float2FloatQ ;
typedef typename get_int_float_mixture<T,S>::type int_float_mixture ;
typedef for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ> for_ ;
typedef typename for_::type selected ;
typedef typename selected::type type ;
} ;
template<class T,class S>
struct get_subranged
{
typedef get_subranged_BuiltIn2BuiltIn<T,S> BuiltIn2BuiltInQ ;
typedef subranged_BuiltIn2Udt<T,S> BuiltIn2Udt ;
typedef subranged_Udt2BuiltIn<T,S> Udt2BuiltIn ;
typedef subranged_Udt2Udt<T,S> Udt2Udt ;
typedef mpl::identity<BuiltIn2Udt> BuiltIn2UdtQ ;
typedef mpl::identity<Udt2BuiltIn> Udt2BuiltInQ ;
typedef mpl::identity<Udt2Udt > Udt2UdtQ ;
typedef typename get_udt_builtin_mixture<T,S>::type udt_builtin_mixture ;
typedef typename
for_udt_builtin_mixture<udt_builtin_mixture, BuiltIn2BuiltInQ, BuiltIn2UdtQ, Udt2BuiltInQ, Udt2UdtQ>::type
selected ;
typedef typename selected::type selected2 ;
typedef typename selected2::type type ;
} ;
//-------------------------------------------------------------------
// Top level implementation selector.
//-------------------------------------------------------------------
template<class T, class S>
struct get_is_subranged
{
typedef get_subranged<T,S> non_trivial_case ;
typedef mpl::identity<mpl::false_> trivial_case ;
typedef is_same<T,S> is_trivial ;
typedef typename mpl::if_<is_trivial,trivial_case,non_trivial_case>::type selected ;
typedef typename selected::type type ;
} ;
} } } // namespace mars_boost::numeric::convdetail
#endif
| [
"garryyan@tencent.com"
] | garryyan@tencent.com |
9d3742da7c7a375016ebdcd45b10218d87108fed | 522a944acfc5798d6fb70d7a032fbee39cc47343 | /d6k/trunk/src/scadastudio/deviceview.cpp | 797e708f9ac97ffc84b52c871568f5cd0408c921 | [] | no_license | liuning587/D6k2.0master | 50275acf1cb0793a3428e203ac7ff1e04a328a50 | 254de973a0fbdd3d99b651ec1414494fe2f6b80f | refs/heads/master | 2020-12-30T08:21:32.993147 | 2018-03-30T08:20:50 | 2018-03-30T08:20:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,819 | cpp | #include "deviceview.h"
#include "fesmodule.h"
#include "aitable.h"
#include "ditable.h"
#include "aotable.h"
#include "dotable.h"
#include "scadastudiodefine.h"
#include "config_data.h"
#include "scadastudio/icore.h"
#include "devicetable.h"
#include "devicemodel.h"
CDeviceView::CDeviceView(IMainModuleInterface *pCore, Config::CDevice *pDeviceData, QString &strTag,
CQuoteItem *pItem, CChannel *pModule, Config::CFesData *pFesData)
: QMainWindow(nullptr)/*, m_pTabDevice(nullptr)*/
{
Q_ASSERT(pDeviceData);
if (!pDeviceData)
{
QString strError = QString(tr("device tagname %1 can not find!!!")).arg(strTag);
pCore->LogMsg(DEVICE_DESC, strError.toStdString().c_str(), LEVEL_1);
return;
}
CDeviceTable *pTable = new CDeviceTable(this, pCore, pDeviceData, pItem, (CChannel *)pModule, pFesData);
m_pTable = pTable;
setCentralWidget(pTable);
//m_pTabDevice = new QTabWidget(this);
//m_pTabDevice->setTabPosition(QTabWidget::South);
//setCentralWidget(m_pTabDevice);
//auto *pTmp = CFesModel::GetDevice(pFes, strTag);
////auto *pFes = CFesModel::GetFesData(arrFes, strTag, FES__CHANNEL_CHILD_DEVICE_ITEM);
//auto &arrScale = pFes->m_arrTransforms;
//pTmp->m_arrAIs;
//CAITable *pAI = new CAITable(this, pTmp->m_arrAIs, pCore, pModule, pFes);
//CDITable *pDI = new CDITable(this, pTmp->m_arrDIs, pCore, pModule);
//CAOTable *pAO = new CAOTable(this, pTmp->m_arrAOs, pCore, pModule);
//CDOTable *pDO = new CDOTable(this, pTmp->m_arrDOs, pCore, pModule);
//m_pTabDevice->addTab(pAI, tr("ai"));
//m_pTabDevice->addTab(pDI, tr("di"));
//m_pTabDevice->addTab(pAO, tr("ao"));
//m_pTabDevice->addTab(pDO, tr("do"));
}
CDeviceView::~CDeviceView()
{
}
void CDeviceView::Delete()
{
m_pTable->setModel(nullptr);
}
void CDeviceView::Refresh()
{
m_pTable->GetModel()->RefrushModel();
} | [
"xingzhibing_ab@hotmail.com"
] | xingzhibing_ab@hotmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.