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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13607ac02efd28518d3eacb853ee27a7d56d4217 | 9b58f7541539d4cd79d1f9e2aabbba1f3d33551b | /include/FOX-1.7/FXToolBarShell.h | ebd6580d9356f9ac7bbf0f5f70ba9bb5231db4a3 | [] | no_license | LordOfDragons/fox-precompiled | 1e3f95c3c6dd8ad9938c2352542859c475f7182e | e2ccfbe0d6b03f4bd373f39b5bbf9067b8e6ca4d | refs/heads/main | 2023-03-22T14:54:51.128355 | 2021-03-17T18:37:24 | 2021-03-17T18:37:24 | 348,796,414 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,052 | h | /********************************************************************************
* *
* T o o l B a r S h e l l W i d g e t *
* *
*********************************************************************************
* Copyright (C) 2000,2020 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* 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 3 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 program. If not, see <http://www.gnu.org/licenses/> *
********************************************************************************/
#ifndef FXTOOLBARSHELL_H
#define FXTOOLBARSHELL_H
#ifndef FXTOPWINDOW_H
#include "FXTopWindow.h"
#endif
namespace FX {
/**
* A Toolbar shell is a widget floating around over the Main Window.
* It typically contains an undocked tool bar. The Toolbar shell can
* be resized horizontally by grabbing its sides if the widget contained
* in the Toolbar shell has the LAYOUT_FIX_WIDTH option. Likewise, it
* can be resized vertically if the LAYOUT_FIX_HEIGHT option is passed
* to the widget contained in the Toolbar shell. If both LAYOUT_FIX_WIDTH
* and LAYOUT_FIX_HEIGHT are passed to the contained widget, Toolbar shell
* can also be resized by grabbing the corners.
* Normally, the Toolbar shell tries to accomodate changes in its contained
* widget by shrink-wrapping around it, i.e. if the contained widget changes,
* the Toolbar shell will change to fit narrowly around it.
*/
class FXAPI FXToolBarShell : public FXTopWindow {
FXDECLARE(FXToolBarShell)
protected:
FXColor baseColor; // Base color
FXColor hiliteColor; // Highlight color
FXColor shadowColor; // Shadow color
FXColor borderColor; // Border color
FXint border; // Border width
FXint gripx; // Grip offset x
FXint gripy; // Grip offset y
FXint xopp; // Opposite x
FXint yopp; // Opposite y
FXuchar mode; // Dragging mode
protected:
static const FXDefaultCursor cursorType[16];
private:
FXToolBarShell(const FXToolBarShell&);
FXToolBarShell &operator=(const FXToolBarShell&);
protected:
FXToolBarShell();
FXuchar where(FXint x,FXint y) const;
void drawBorderRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawRidgeRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawGrooveRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleRaisedRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawDoubleSunkenRectangle(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
void drawFrame(FXDCWindow& dc,FXint x,FXint y,FXint w,FXint h);
protected:
enum {
DRAG_NONE = 0,
DRAG_TOP = 1,
DRAG_BOTTOM = 2,
DRAG_LEFT = 4,
DRAG_RIGHT = 8,
DRAG_TOPLEFT = (DRAG_TOP|DRAG_LEFT),
DRAG_TOPRIGHT = (DRAG_TOP|DRAG_RIGHT),
DRAG_BOTTOMLEFT = (DRAG_BOTTOM|DRAG_LEFT),
DRAG_BOTTOMRIGHT = (DRAG_BOTTOM|DRAG_RIGHT),
DRAG_WHOLE = (DRAG_TOP|DRAG_BOTTOM|DRAG_LEFT|DRAG_RIGHT)
};
public:
long onPaint(FXObject*,FXSelector,void*);
long onEnter(FXObject*,FXSelector,void*);
long onLeave(FXObject*,FXSelector,void*);
long onMotion(FXObject*,FXSelector,void*);
long onLeftBtnPress(FXObject*,FXSelector,void*);
long onLeftBtnRelease(FXObject*,FXSelector,void*);
long onLayout(FXObject*,FXSelector,void*);
public:
/// Construct a toolbar shell
FXToolBarShell(FXWindow* owner,FXuint opts=FRAME_RAISED|FRAME_THICK,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint hs=4,FXint vs=4);
/// Create server-side resources
virtual void create();
/// Perform layout
virtual void layout();
/// Return the default width of this window
virtual FXint getDefaultWidth();
/// Return the default height of this window
virtual FXint getDefaultHeight();
/// Change frame style
void setFrameStyle(FXuint style);
/// Get current frame style
FXuint getFrameStyle() const;
/// Get border width
FXint getBorderWidth() const { return border; }
/// Change highlight color
void setHiliteColor(FXColor clr);
/// Get highlight color
FXColor getHiliteColor() const { return hiliteColor; }
/// Change shadow color
void setShadowColor(FXColor clr);
/// Get shadow color
FXColor getShadowColor() const { return shadowColor; }
/// Change border color
void setBorderColor(FXColor clr);
/// Get border color
FXColor getBorderColor() const { return borderColor; }
/// Change base gui color
void setBaseColor(FXColor clr);
/// Get base gui color
FXColor getBaseColor() const { return baseColor; }
/// Save to stream
virtual void save(FXStream& store) const;
/// Load from stream
virtual void load(FXStream& store);
};
}
#endif
| [
"roland@rptd.ch"
] | roland@rptd.ch |
8b389e107f3608bdd3c8233cb72717a9f9dc91d9 | 1600b27e3981d4bf5cc35f0e2e82229e0a4d73f8 | /Source/RayTracingFramework/GeometricPrimitives/Plane.h | a189489c0344dbaeaf662a62642d9b1e3e2b9bdc | [] | no_license | tominflux/3D2_RayTracer | e8b890e52958b0def814468e4e87cdda2995ae6d | 7670d964467681c27b8d3c64c0c05d1819ee32fb | refs/heads/master | 2021-09-04T02:44:22.739607 | 2018-01-14T21:37:17 | 2018-01-14T21:37:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,216 | h | #ifndef _PLANEGEOMETRY_RAYTRACINGFRAMEWORK
#define _PLANEGEOMETRY_RAYTRACINGFRAMEWORK
#include <RayTracingFramework\RayTracingPrerequisites.h>
#include "IGeometry.h"
namespace RayTracingFramework{
class Plane : public IGeometry
{
friend class Box;
glm::vec4 P0, N; //Origin point and Normal vector describing the plane.
float A, B, C, D; //Variables from the implicit equations. Ax + By +Cz +D=0=
public:
Plane(glm::vec4 P0, glm::vec4 N);
virtual bool testLocalCollision(RayTracingFramework::Ray& ray);
private:
/**
Computes a collision of a ray (in coords local to the plane) with the plane
@param origin, direction: definition of the ray (origin point and unitary direction vector)
@param t (Output parameter): Distance of the intersection point to the origin
@param col_P (Output parameter): Point of intersection (point on the plane where the ray hits the plane)
@param col_N (Output parameter): Normal of the plane at the intersection point (... all points on a plane share the same normal vector).
*/
virtual bool testRayPlaneCollision(glm::vec4 origin, glm::vec4 direction
, float& t, glm::vec4& col_P, glm::vec4& col_N);
};
};
#endif | [
"tomchescreations@gmail.com"
] | tomchescreations@gmail.com |
d1809c3f7bfec0179391fa5af0ccce762ba09c09 | 0ae2954b5232d364aba2743c6d621b9c8b915013 | /AudioGraphBug/Timer.cpp | 6266f7bfd8e3e9b8d37f4a02d939853d4330cd63 | [] | no_license | tom-huntington/AudioGraphBug | b02b39d0473b0398e1964e139b0f89c94c3d4458 | e3fb06172eed38ace085ad405339acfd1053c2ba | refs/heads/master | 2022-12-11T10:02:58.656841 | 2020-09-02T06:10:55 | 2020-09-02T06:10:55 | 292,186,657 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,487 | cpp | #include "pch.h"
#include "timer.h"
#include "stats.h"
#include <wchar.h>
void timer::start_timer()
{
QueryPerformanceFrequency(&Frequency);
QueryPerformanceCounter(&StartingTime);
}
void timer::time()
{
static long long unsigned count = 0;
count++;
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld\n", ElapsedMicroseconds.QuadPart, 1.0 / 60.0 * 1000000.0, count); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
void timer::time(long long unsigned count)
{
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld. Count: %llu. Counts per s: %f\n", ElapsedMicroseconds.QuadPart, count, (double)count / (double)(ElapsedMicroseconds.QuadPart / 1000000.0)); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
void timer::timeCumulative(long long unsigned increment)
{
static long long unsigned cumulative = 0;
static long long unsigned count = 0;
static long long unsigned cumulativeTime = 0;
cumulative += increment;
count++;
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
cumulativeTime += ElapsedMicroseconds.QuadPart;
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld. Count: %llu. Counts per second: %f\n", ElapsedMicroseconds.QuadPart, count, (double)cumulative / (double)(cumulativeTime / 1000000.0)); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
void timer::timeCumulativeReseting(long long unsigned increment)
{
static long long unsigned cumulative = 0;
static long long unsigned count = 0;
static long long unsigned cumulativeTime = 0;
if (cumulativeTime / 1000000.0 > 10)
{
cumulative = 0;
count = 0;
cumulativeTime = 0;
}
cumulative += increment;
count++;
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
cumulativeTime += ElapsedMicroseconds.QuadPart;
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld. Count: %llu. Counts per second: %f\n", ElapsedMicroseconds.QuadPart, count, (double)cumulative / (double)(cumulativeTime / 1000000.0)); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
void timer::timeAverage()
{
static RunningStats stat;
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
stat.Push(ElapsedMicroseconds.QuadPart);
static int count = 0;
if (count < 3)
{
stat.Clear();
count++;
}
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld. Average: %.3Lf\n", ElapsedMicroseconds.QuadPart, stat.Mean(), 1.0 / 60.0 * 1000000.0); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
void timer::timeAverageReseting()
{
static RunningStats stat;
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
ElapsedMicroseconds.QuadPart *= 1000000;
ElapsedMicroseconds.QuadPart /= Frequency.QuadPart;
stat.Push(ElapsedMicroseconds.QuadPart);
static int count = 0;
if (count == 100)
{
stat.Clear();
count = 0;
}
count++;
wchar_t text_buffer[200] = { 0 }; //temporary buffer
swprintf(text_buffer, _countof(text_buffer), L"Microseconds: %lld. Average: %.3Lf\n", ElapsedMicroseconds.QuadPart, stat.Mean(), 1.0 / 60.0 * 1000000.0); // convert
OutputDebugString(text_buffer); // print
StartingTime = EndingTime;
}
| [
"thomasp.huntington@outlook.com"
] | thomasp.huntington@outlook.com |
9587a3904ecad38a0d7d61d4a2f4e5958d25f8e5 | 80dff3782e19e768b405291d080c7d5fa1b74502 | /src/curses/window.cpp | 0f6c3c48ae133ec7aa35cde7a779640d216fcd66 | [] | no_license | jimm/sleigh | a0b3f80999925ff9737c103932ad19c79e84f63b | 1514058e223a6948ac8e5f8ab983bd4f64c17164 | refs/heads/main | 2021-06-24T18:29:12.864509 | 2020-07-24T18:14:20 | 2020-07-24T18:14:20 | 163,532,175 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,546 | cpp | #include <stdlib.h>
#include <string.h>
#include "window.h"
Window::Window(struct rect r, const char *title_str)
: active(false)
{
if (title_str != 0)
title = title_str;
win = newwin(r.height, r.width, r.row, r.col);
rect = r;
}
Window::~Window() {
delwin(win);
}
void Window::move_and_resize(struct rect r) {
rect = r;
mvwin(win, r.row, r.col);
wresize(win, r.height, r.width);
}
void Window::draw() {
wclear(win);
box(win, ACS_VLINE, ACS_HLINE);
if (title.length() == 0)
return;
string win_title = " " + title + " ";
make_fit(win_title, 0);
wmove(win, 0, 1);
if (active)
wattron(win, A_REVERSE);
waddstr(win, win_title.c_str());
if (active)
wattroff(win, A_REVERSE);
}
int Window::visible_height() {
return getmaxy(win) - 2;
}
/*
* MODIFIES str by fitting it to the maximum window display width (which is
* the window width minus two for the borders) minus `reduce_max_len_by`.
*/
void Window::make_fit(string &str, int reduce_max_len_by) {
int w_maxlen = getmaxx(win) - (2 + reduce_max_len_by);
if (str.length() > w_maxlen)
str.resize(w_maxlen, ' ');
}
/*
* Copies str into outbuf to the maximum window display width (which is the
* window width minus two for the borders) minus `reduce_max_len_by`.
*/
void Window::make_fit(const char *str, int reduce_max_len_by, char *outbuf) {
int len = strlen(str);
int w_maxlen = getmaxx(win) - (2 + reduce_max_len_by);
int newlen = len < w_maxlen ? len : w_maxlen;
strncpy(outbuf, str, newlen);
outbuf[newlen] = 0;
}
| [
"jim.menard@warbyparker.com"
] | jim.menard@warbyparker.com |
418881ed23321460dcc8261de95f3517222e6b44 | 8bfa3c91abe7f22bffc3115c1fa48ed1a4aabd82 | /ABC/118/A/a.cpp | 6cbf88c7deee612db246ff476a59c5051c9bac23 | [] | no_license | yugo1103/atcoder | 96a0dcd41704fadc0a1ef3253cdffa4a961fdc0a | 9b2d0b1a0f178cd442d51d2ad07added982d2a92 | refs/heads/master | 2020-07-26T04:04:41.019118 | 2020-03-30T10:42:39 | 2020-03-30T10:42:39 | 208,528,448 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 269 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < n; i++)
int main(void){
ll a, b;
cin >> a >> b;
if(b % a == 0)
cout << a + b << endl;
else
cout << b - a << endl;
return 0;
}
| [
"y1103orz@akane.waseda.jp"
] | y1103orz@akane.waseda.jp |
64dcd30a9ea0e8324b3c88524fb6a99ef62c6be3 | a8a294be4c45d111a9b900d7d9a0252994402f38 | /Кравец/length.cpp | f748754e8298ffbffcde7e060803f1d57ba82649 | [] | no_license | grand-roman/cPlusPlusTraining | 196521843e3b0797cdbb22ab97bcca2adbe94c66 | 0fc707ce66c57d31b603ec0d1897df14e95ea13b | refs/heads/master | 2022-04-22T03:23:57.487275 | 2020-04-15T07:10:01 | 2020-04-15T07:10:01 | 255,024,764 | 0 | 8 | null | 2020-04-15T07:10:02 | 2020-04-12T06:44:34 | C++ | UTF-8 | C++ | false | false | 132 | cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string a;
getline(cin, a);
cout << a.length();
}
| [
"Kravez-2003@mail.ru"
] | Kravez-2003@mail.ru |
35ff4dc8efb83793104dff9884f8e9a87e600cab | f1862bb71285350afe8599a81195d8fb3e079bb6 | /CodeChef/CHEFVOLUN.cpp | 4e8873354a4d8fe81c83e924c81807225c0dc4c0 | [
"MIT"
] | permissive | raghavdubey/CP-Guide | 69f8932e171e6b2cd3284f20f6ef7ac5b0242b68 | 57458ed3ec5339defa2796ce0be2da707f66c1ec | refs/heads/master | 2021-05-15T02:43:33.923203 | 2017-10-17T13:07:08 | 2017-10-17T13:07:08 | 106,256,252 | 3 | 8 | null | 2017-10-23T14:28:14 | 2017-10-09T08:25:27 | C++ | UTF-8 | C++ | false | false | 4,001 | cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <queue>
#include <set>
#include <functional>
#include <numeric>
#include <math.h>
#include <string>
#include <cstring>
#include <iomanip>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <utility>
#define pii pair <int,int>
#define pll pair <long long,long long>
#define sc scanf
#define pf printf
#define pb push_back
#define Pi 2*acos(0.0)
#define ms(a,b) memset(a, b, sizeof(a))
#define MP make_pair
#define db double
#define EPS 10E-10
#define ff first
#define ss second
#define sqr(x) (x)*(x)
#define D(x) cout<<#x " = "<<(x)<<endl
#define VI vector <ll>
#define DBG pf("Hi\n")
#define MOD 1000000007
#define SZ(a) (int)a.size()
#define sf(a) scanf("%d",&a)
#define sfl(a) scanf("%lld",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sffl(a,b) scanf("%lld %lld",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n) for(ll i=0;i<n;i++)
#define loop1(i,n) for(int i=1;i<n;i++)
#define loop2(i,n) for(int i=2;i<n;i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define intlim 2147483648
#define infinity (1<<28)
#define ull unsigned long long
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*((b)/gcd(a,b)))
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long int
#define DRT() ll test_case; cin>>test_case; while(test_case--)
using namespace std;
int main()
{
ll i,j,x,k,flag,y,a,b,l;
string st;
DRT()
{
cin>>st;
cin>>x>>y;
// entries of both x and y is done by now
l=st.size();
//cout<<l<<endl;
a=0;
b=0;
loop(j,l)
{
if(st[j]=='a')
++a;
else if(st[j]=='b')
++b;
}
//cout<<a<<" "<<b<<endl;
j=0;
flag=0;
while(j<l)
{
if(a>=b)
{
if(a>0)
{
loop(k,x)
{
if(a>0)
{
cout<<"a";
a-=1;
//j is incremented now
j+=1;
}
else
break;
//loop breaked if satisfied
}
}
if(b>0)
{
loop(k,y)
{
if(b>0)
{
cout<<"b";
b-=1;
j+=1;
}
else
break;
//Breaking is neccessity here
}
}
else
flag=1;
//flag is updated now
if((b==0) and (a>0) and (flag==1) or (a==0) and (b>0) and (flag==1))
cout<<"*";
}
if(b>a)
{
if(b>0)
{
loop(k,y)
{
if(b>0)
{
cout<<"b";
b-=1;
j+=1;
}
else
break;
}
}
if(a>0)
{
loop(k,x)
{
if(a>0)
{
cout<<"a";
a-=1;
j+=1;
}
// Breaking is neccesary here
else
break;
}
}
else
flag=1;
if((b==0) and (a>0) and (flag==1) or (a==0) and (b>0) and (flag==1))
cout<<"*";
}
}
//Next line as answer is found by now
cout<<endl;
}
return 0;
}
| [
"anmolmishra54@outlook.com"
] | anmolmishra54@outlook.com |
53dbbea0ef0aef97ed1d859517be2f77d393d37e | 45506bf4f9a22212b832a619e0ffb8b61a858720 | /Example_6_1_FVM/main.cpp | d5d3929c01d595b090760672c8e04c404aa4e126 | [] | no_license | Czeslaw20/CFD_Algorithm | ed0851e48900b2274dbcb0acf1518265db68824e | 433aca0c56dcd8fd00ae7c3a3e95cea2a3b2a44a | refs/heads/master | 2023-01-01T16:52:16.134219 | 2020-10-28T04:08:38 | 2020-10-28T04:08:38 | 305,708,717 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 444 | cpp | #include "TDMA_Solver.h"
#include "Domain.h"
void test01()
{
vector<double> a{1, 1, 1, 1};
a.insert(a.begin(), 0);
vector<double> b{3, 3, 3, 3, 3};
vector<double> c{1, 1, 1, 1};
c.push_back(0);
vector<double> f{1, 1, 0, 0, 0};
TDMA_Solver solver(a, b, c, f);
solver.solve();
solver.output();
}
void test02()
{
Domain d(1, 8);
d.init(0);
d.solve();
}
int main()
{
test02();
return 0;
} | [
"1214665388@qq.com"
] | 1214665388@qq.com |
2659aa565f7fb097d15da75b1d03a58f813f79d9 | 551837821b6c6065117acde99d26820ad38b51b2 | /source/v3.0.1.beta/lines.cpp | 96dc8fc431275ab42f0b2a176c3f02174675431d | [] | no_license | olegbugaenko/DiffRay | 2deaab7be1ca3f347a3b0a09b1bf843e6e7443db | e1e5366ee3d27557cbeab1317688f38b2e7b03fd | refs/heads/master | 2020-07-06T09:27:05.082594 | 2020-05-17T15:19:04 | 2020-05-17T15:19:04 | 202,970,508 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,476 | cpp | #include "basics.h"
#include "reader.h"
#include "lines.h"
#include "geometry.h"
int CLine::linesCount;
int CLine::nrows;
double ***CLine::emits;
int CLine::nsectors;
int CLine::iSector;
int CLine::initSectorials(int nsectors)
{
//assuming we have only 1 sector (SS)
CLine::emits = new double**[nsectors];
CLine::nsectors = nsectors;
}
int CLine::readLines(char fname[500],int iSector)
{
if(CLine::nsectors<=0)
{
CLine::initSectorials(CGeometry::nSectors);
}
FILE *FREAD;
FREAD = fopen(fname,"r");
if(!FREAD || FREAD == NULL)
{
printf("%s\n", fname);
CBasics::throwError("ERROR OPENING FILE WITH NULL POINTER!");
}
CLine::iSector = iSector;
FREAD = fopen(fname,"r");
CReader::read_file_array(FREAD,2550,2,0,CLine::getRadii,CLine::putLine,CLine::putLineVal);
fclose(FREAD);
return 1;
}
int CLine::putLine(int nlines)
{
CLine::linesCount = nlines-1;
int is = CLine::iSector;
{
CLine::emits[is] = new double *[CLine::nrows];
for(int ir=0;ir<CLine::nrows;ir++)
{
CLine::emits[is][ir] = new double[CLine::linesCount];
for(int il=0;il<CLine::linesCount;il++)
{
CLine::emits[is][ir][il] = 0.0;
}
}
}
}
int CLine::getRadii(int nrows)
{
CLine::nrows = nrows;
}
int CLine::putLineVal(int raw, int col, double val)
{
if(col>0) // not radii
{
CLine::emits[CLine::iSector][raw][col-1] = pow(10.0,val);
}
//printf("%d %d %d - %lf\n",CLine::iSector,raw,col,CLine::emits[CLine::iSector][raw][col-1] );
return 1;
} | [
"Izyuk.web@gmail.com"
] | Izyuk.web@gmail.com |
8acf67068a442c40a88edc2886e388b84a718e04 | e6545c4c51beea6eb758ab925dfdff028474da27 | /re2/parse.cc | 56e793a71f6690f38f230d236701496e9b8e3ad1 | [
"BSD-3-Clause"
] | permissive | yiyigao/rec-camb-t10 | 8c715e8208776f10855808bd03cb9a9e9f626473 | d743ff24db390ad7c675a72ee782301ed41aa295 | refs/heads/master | 2020-11-30T03:31:53.179218 | 2019-12-26T15:50:38 | 2019-12-26T15:50:38 | 230,289,095 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 66,635 | cc | // Copyright 2006 The RE2 Authors. All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Regular expression parser.
// The parser is a simple precedence-based parser with a
// manual stack. The parsing work is done by the methods
// of the ParseState class. The Regexp::Parse function is
// essentially just a lexer that calls the ParseState method
// for each token.
// The parser recognizes POSIX extended regular expressions
// excluding backreferences, collating elements, and collating
// classes. It also allows the empty string as a regular expression
// and recognizes the Perl escape sequences \d, \s, \w, \D, \S, and \W.
// See regexp.h for rationale.
#include "util/util.h"
#include "re2/regexp.h"
#include "re2/stringpiece.h"
#include "re2/unicode_casefold.h"
#include "re2/unicode_groups.h"
namespace re2 {
// Regular expression parse state.
// The list of parsed regexps so far is maintained as a vector of
// Regexp pointers called the stack. Left parenthesis and vertical
// bar markers are also placed on the stack, as Regexps with
// non-standard opcodes.
// Scanning a left parenthesis causes the parser to push a left parenthesis
// marker on the stack.
// Scanning a vertical bar causes the parser to pop the stack until it finds a
// vertical bar or left parenthesis marker (not popping the marker),
// concatenate all the popped results, and push them back on
// the stack (DoConcatenation).
// Scanning a right parenthesis causes the parser to act as though it
// has seen a vertical bar, which then leaves the top of the stack in the
// form LeftParen regexp VerticalBar regexp VerticalBar ... regexp VerticalBar.
// The parser pops all this off the stack and creates an alternation of the
// regexps (DoAlternation).
class Regexp::ParseState {
public:
ParseState(ParseFlags flags, const StringPiece& whole_regexp,
RegexpStatus* status);
~ParseState();
ParseFlags flags() { return flags_; }
int rune_max() { return rune_max_; }
// Parse methods. All public methods return a bool saying
// whether parsing should continue. If a method returns
// false, it has set fields in *status_, and the parser
// should return NULL.
// Pushes the given regular expression onto the stack.
// Could check for too much memory used here.
bool PushRegexp(Regexp* re);
// Pushes the literal rune r onto the stack.
bool PushLiteral(Rune r);
// Pushes a regexp with the given op (and no args) onto the stack.
bool PushSimpleOp(RegexpOp op);
// Pushes a ^ onto the stack.
bool PushCarat();
// Pushes a \b (word == true) or \B (word == false) onto the stack.
bool PushWordBoundary(bool word);
// Pushes a $ onto the stack.
bool PushDollar();
// Pushes a . onto the stack
bool PushDot();
// Pushes a repeat operator regexp onto the stack.
// A valid argument for the operator must already be on the stack.
// s is the name of the operator, for use in error messages.
bool PushRepeatOp(RegexpOp op, const StringPiece& s, bool nongreedy);
// Pushes a repetition regexp onto the stack.
// A valid argument for the operator must already be on the stack.
bool PushRepetition(int min, int max, const StringPiece& s, bool nongreedy);
// Checks whether a particular regexp op is a marker.
bool IsMarker(RegexpOp op);
// Processes a left parenthesis in the input.
// Pushes a marker onto the stack.
bool DoLeftParen(const StringPiece& name);
bool DoLeftParenNoCapture();
// Processes a vertical bar in the input.
bool DoVerticalBar();
// Processes a right parenthesis in the input.
bool DoRightParen();
// Processes the end of input, returning the final regexp.
Regexp* DoFinish();
// Finishes the regexp if necessary, preparing it for use
// in a more complicated expression.
// If it is a CharClassBuilder, converts into a CharClass.
Regexp* FinishRegexp(Regexp*);
// These routines don't manipulate the parse stack
// directly, but they do need to look at flags_.
// ParseCharClass also manipulates the internals of Regexp
// while creating *out_re.
// Parse a character class into *out_re.
// Removes parsed text from s.
bool ParseCharClass(StringPiece* s, Regexp** out_re,
RegexpStatus* status);
// Parse a character class character into *rp.
// Removes parsed text from s.
bool ParseCCCharacter(StringPiece* s, Rune *rp,
const StringPiece& whole_class,
RegexpStatus* status);
// Parse a character class range into rr.
// Removes parsed text from s.
bool ParseCCRange(StringPiece* s, RuneRange* rr,
const StringPiece& whole_class,
RegexpStatus* status);
// Parse a Perl flag set or non-capturing group from s.
bool ParsePerlFlags(StringPiece* s);
// Finishes the current concatenation,
// collapsing it into a single regexp on the stack.
void DoConcatenation();
// Finishes the current alternation,
// collapsing it to a single regexp on the stack.
void DoAlternation();
// Generalized DoAlternation/DoConcatenation.
void DoCollapse(RegexpOp op);
// Maybe concatenate Literals into LiteralString.
bool MaybeConcatString(int r, ParseFlags flags);
private:
ParseFlags flags_;
StringPiece whole_regexp_;
RegexpStatus* status_;
Regexp* stacktop_;
int ncap_; // number of capturing parens seen
int rune_max_; // maximum char value for this encoding
DISALLOW_COPY_AND_ASSIGN(ParseState);
};
// Pseudo-operators - only on parse stack.
const RegexpOp kLeftParen = static_cast<RegexpOp>(kMaxRegexpOp+1);
const RegexpOp kVerticalBar = static_cast<RegexpOp>(kMaxRegexpOp+2);
Regexp::ParseState::ParseState(ParseFlags flags,
const StringPiece& whole_regexp,
RegexpStatus* status)
: flags_(flags), whole_regexp_(whole_regexp),
status_(status), stacktop_(NULL), ncap_(0) {
if (flags_ & Latin1)
rune_max_ = 0xFF;
else
rune_max_ = Runemax;
}
// Cleans up by freeing all the regexps on the stack.
Regexp::ParseState::~ParseState() {
Regexp* next;
for (Regexp* re = stacktop_; re != NULL; re = next) {
next = re->down_;
re->down_ = NULL;
if (re->op() == kLeftParen)
delete re->name_;
re->Decref();
}
}
// Finishes the regexp if necessary, preparing it for use in
// a more complex expression.
// If it is a CharClassBuilder, converts into a CharClass.
Regexp* Regexp::ParseState::FinishRegexp(Regexp* re) {
if (re == NULL)
return NULL;
re->down_ = NULL;
if (re->op_ == kRegexpCharClass && re->ccb_ != NULL) {
CharClassBuilder* ccb = re->ccb_;
re->ccb_ = NULL;
re->cc_ = ccb->GetCharClass();
delete ccb;
}
return re;
}
// Pushes the given regular expression onto the stack.
// Could check for too much memory used here.
bool Regexp::ParseState::PushRegexp(Regexp* re) {
MaybeConcatString(-1, NoParseFlags);
// Special case: a character class of one character is just
// a literal. This is a common idiom for escaping
// single characters (e.g., [.] instead of \.), and some
// analysis does better with fewer character classes.
// Similarly, [Aa] can be rewritten as a literal A with ASCII case folding.
if (re->op_ == kRegexpCharClass) {
if (re->ccb_->size() == 1) {
Rune r = re->ccb_->begin()->lo;
re->Decref();
re = new Regexp(kRegexpLiteral, flags_);
re->rune_ = r;
} else if (re->ccb_->size() == 2) {
Rune r = re->ccb_->begin()->lo;
if ('A' <= r && r <= 'Z' && re->ccb_->Contains(r + 'a' - 'A')) {
re->Decref();
re = new Regexp(kRegexpLiteral, flags_ | FoldCase);
re->rune_ = r + 'a' - 'A';
}
}
}
if (!IsMarker(re->op()))
re->simple_ = re->ComputeSimple();
re->down_ = stacktop_;
stacktop_ = re;
return true;
}
// Searches the case folding tables and returns the CaseFold* that contains r.
// If there isn't one, returns the CaseFold* with smallest f->lo bigger than r.
// If there isn't one, returns NULL.
const CaseFold* LookupCaseFold(const CaseFold *f, int n, Rune r) {
const CaseFold* ef = f + n;
// Binary search for entry containing r.
while (n > 0) {
int m = n/2;
if (f[m].lo <= r && r <= f[m].hi)
return &f[m];
if (r < f[m].lo) {
n = m;
} else {
f += m+1;
n -= m+1;
}
}
// There is no entry that contains r, but f points
// where it would have been. Unless f points at
// the end of the array, it points at the next entry
// after r.
if (f < ef)
return f;
// No entry contains r; no entry contains runes > r.
return NULL;
}
// Returns the result of applying the fold f to the rune r.
Rune ApplyFold(const CaseFold *f, Rune r) {
switch (f->delta) {
default:
return r + f->delta;
case EvenOddSkip: // even <-> odd but only applies to every other
if ((r - f->lo) % 2)
return r;
// fall through
case EvenOdd: // even <-> odd
if (r%2 == 0)
return r + 1;
return r - 1;
case OddEvenSkip: // odd <-> even but only applies to every other
if ((r - f->lo) % 2)
return r;
// fall through
case OddEven: // odd <-> even
if (r%2 == 1)
return r + 1;
return r - 1;
}
}
// Returns the next Rune in r's folding cycle (see unicode_casefold.h).
// Examples:
// CycleFoldRune('A') = 'a'
// CycleFoldRune('a') = 'A'
//
// CycleFoldRune('K') = 'k'
// CycleFoldRune('k') = 0x212A (Kelvin)
// CycleFoldRune(0x212A) = 'K'
//
// CycleFoldRune('?') = '?'
Rune CycleFoldRune(Rune r) {
const CaseFold* f = LookupCaseFold(unicode_casefold, num_unicode_casefold, r);
if (f == NULL || r < f->lo)
return r;
return ApplyFold(f, r);
}
// Add lo-hi to the class, along with their fold-equivalent characters.
// If lo-hi is already in the class, assume that the fold-equivalent
// chars are there too, so there's no work to do.
static void AddFoldedRange(CharClassBuilder* cc, Rune lo, Rune hi, int depth) {
// AddFoldedRange calls itself recursively for each rune in the fold cycle.
// Most folding cycles are small: there aren't any bigger than four in the
// current Unicode tables. make_unicode_casefold.py checks that
// the cycles are not too long, and we double-check here using depth.
if (depth > 10) {
LOG(DFATAL) << "AddFoldedRange recurses too much.";
return;
}
if (!cc->AddRange(lo, hi)) // lo-hi was already there? we're done
return;
while (lo <= hi) {
const CaseFold* f = LookupCaseFold(unicode_casefold, num_unicode_casefold, lo);
if (f == NULL) // lo has no fold, nor does anything above lo
break;
if (lo < f->lo) { // lo has no fold; next rune with a fold is f->lo
lo = f->lo;
continue;
}
// Add in the result of folding the range lo - f->hi
// and that range's fold, recursively.
Rune lo1 = lo;
Rune hi1 = min<Rune>(hi, f->hi);
switch (f->delta) {
default:
lo1 += f->delta;
hi1 += f->delta;
break;
case EvenOdd:
if (lo1%2 == 1)
lo1--;
if (hi1%2 == 0)
hi1++;
break;
case OddEven:
if (lo1%2 == 0)
lo1--;
if (hi1%2 == 1)
hi1++;
break;
}
AddFoldedRange(cc, lo1, hi1, depth+1);
// Pick up where this fold left off.
lo = f->hi + 1;
}
}
// Pushes the literal rune r onto the stack.
bool Regexp::ParseState::PushLiteral(Rune r) {
// Do case folding if needed.
if ((flags_ & FoldCase) && CycleFoldRune(r) != r) {
Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
re->ccb_ = new CharClassBuilder;
Rune r1 = r;
do {
if (!(flags_ & NeverNL) || r != '\n') {
re->ccb_->AddRange(r, r);
}
r = CycleFoldRune(r);
} while (r != r1);
re->ccb_->RemoveAbove(rune_max_);
return PushRegexp(re);
}
// Exclude newline if applicable.
if ((flags_ & NeverNL) && r == '\n')
return PushRegexp(new Regexp(kRegexpNoMatch, flags_));
// No fancy stuff worked. Ordinary literal.
if (MaybeConcatString(r, flags_))
return true;
Regexp* re = new Regexp(kRegexpLiteral, flags_);
re->rune_ = r;
return PushRegexp(re);
}
// Pushes a ^ onto the stack.
bool Regexp::ParseState::PushCarat() {
if (flags_ & OneLine) {
return PushSimpleOp(kRegexpBeginText);
}
return PushSimpleOp(kRegexpBeginLine);
}
// Pushes a \b or \B onto the stack.
bool Regexp::ParseState::PushWordBoundary(bool word) {
if (word)
return PushSimpleOp(kRegexpWordBoundary);
return PushSimpleOp(kRegexpNoWordBoundary);
}
// Pushes a $ onto the stack.
bool Regexp::ParseState::PushDollar() {
if (flags_ & OneLine) {
// Clumsy marker so that MimicsPCRE() can tell whether
// this kRegexpEndText was a $ and not a \z.
Regexp::ParseFlags oflags = flags_;
flags_ = flags_ | WasDollar;
bool ret = PushSimpleOp(kRegexpEndText);
flags_ = oflags;
return ret;
}
return PushSimpleOp(kRegexpEndLine);
}
// Pushes a . onto the stack.
bool Regexp::ParseState::PushDot() {
if ((flags_ & DotNL) && !(flags_ & NeverNL))
return PushSimpleOp(kRegexpAnyChar);
// Rewrite . into [^\n]
Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
re->ccb_ = new CharClassBuilder;
re->ccb_->AddRange(0, '\n' - 1);
re->ccb_->AddRange('\n' + 1, rune_max_);
return PushRegexp(re);
}
// Pushes a regexp with the given op (and no args) onto the stack.
bool Regexp::ParseState::PushSimpleOp(RegexpOp op) {
Regexp* re = new Regexp(op, flags_);
return PushRegexp(re);
}
// Pushes a repeat operator regexp onto the stack.
// A valid argument for the operator must already be on the stack.
// The char c is the name of the operator, for use in error messages.
bool Regexp::ParseState::PushRepeatOp(RegexpOp op, const StringPiece& s,
bool nongreedy) {
if (stacktop_ == NULL || IsMarker(stacktop_->op())) {
status_->set_code(kRegexpRepeatArgument);
status_->set_error_arg(s);
return false;
}
Regexp::ParseFlags fl = flags_;
if (nongreedy)
fl = fl ^ NonGreedy;
Regexp* re = new Regexp(op, fl);
re->AllocSub(1);
re->down_ = stacktop_->down_;
re->sub()[0] = FinishRegexp(stacktop_);
re->simple_ = re->ComputeSimple();
stacktop_ = re;
return true;
}
// Pushes a repetition regexp onto the stack.
// A valid argument for the operator must already be on the stack.
bool Regexp::ParseState::PushRepetition(int min, int max,
const StringPiece& s,
bool nongreedy) {
if ((max != -1 && max < min) || min > 1000 || max > 1000) {
status_->set_code(kRegexpRepeatSize);
status_->set_error_arg(s);
return false;
}
if (stacktop_ == NULL || IsMarker(stacktop_->op())) {
status_->set_code(kRegexpRepeatArgument);
status_->set_error_arg(s);
return false;
}
Regexp::ParseFlags fl = flags_;
if (nongreedy)
fl = fl ^ NonGreedy;
Regexp* re = new Regexp(kRegexpRepeat, fl);
re->min_ = min;
re->max_ = max;
re->AllocSub(1);
re->down_ = stacktop_->down_;
re->sub()[0] = FinishRegexp(stacktop_);
re->simple_ = re->ComputeSimple();
stacktop_ = re;
return true;
}
// Checks whether a particular regexp op is a marker.
bool Regexp::ParseState::IsMarker(RegexpOp op) {
return op >= kLeftParen;
}
// Processes a left parenthesis in the input.
// Pushes a marker onto the stack.
bool Regexp::ParseState::DoLeftParen(const StringPiece& name) {
Regexp* re = new Regexp(kLeftParen, flags_);
re->cap_ = ++ncap_;
if (name.data() != NULL)
re->name_ = new string(name.as_string());
return PushRegexp(re);
}
// Pushes a non-capturing marker onto the stack.
bool Regexp::ParseState::DoLeftParenNoCapture() {
Regexp* re = new Regexp(kLeftParen, flags_);
re->cap_ = -1;
return PushRegexp(re);
}
// Adds r to cc, along with r's upper case if foldascii is set.
static void AddLiteral(CharClassBuilder* cc, Rune r, bool foldascii) {
cc->AddRange(r, r);
if (foldascii && 'a' <= r && r <= 'z')
cc->AddRange(r + 'A' - 'a', r + 'A' - 'a');
}
// Processes a vertical bar in the input.
bool Regexp::ParseState::DoVerticalBar() {
MaybeConcatString(-1, NoParseFlags);
DoConcatenation();
// Below the vertical bar is a list to alternate.
// Above the vertical bar is a list to concatenate.
// We just did the concatenation, so either swap
// the result below the vertical bar or push a new
// vertical bar on the stack.
Regexp* r1;
Regexp* r2;
if ((r1 = stacktop_) != NULL &&
(r2 = stacktop_->down_) != NULL &&
r2->op() == kVerticalBar) {
// If above and below vertical bar are literal or char class,
// can merge into a single char class.
Regexp* r3;
if ((r1->op() == kRegexpLiteral ||
r1->op() == kRegexpCharClass ||
r1->op() == kRegexpAnyChar) &&
(r3 = r2->down_) != NULL) {
Rune rune;
switch (r3->op()) {
case kRegexpLiteral: // convert to char class
rune = r3->rune_;
r3->op_ = kRegexpCharClass;
r3->cc_ = NULL;
r3->ccb_ = new CharClassBuilder;
AddLiteral(r3->ccb_, rune, r3->parse_flags_ & Regexp::FoldCase);
// fall through
case kRegexpCharClass:
if (r1->op() == kRegexpLiteral)
AddLiteral(r3->ccb_, r1->rune_,
r1->parse_flags_ & Regexp::FoldCase);
else if (r1->op() == kRegexpCharClass)
r3->ccb_->AddCharClass(r1->ccb_);
if (r1->op() == kRegexpAnyChar || r3->ccb_->full()) {
delete r3->ccb_;
r3->ccb_ = NULL;
r3->op_ = kRegexpAnyChar;
}
// fall through
case kRegexpAnyChar:
// pop r1
stacktop_ = r2;
r1->Decref();
return true;
default:
break;
}
}
// Swap r1 below vertical bar (r2).
r1->down_ = r2->down_;
r2->down_ = r1;
stacktop_ = r2;
return true;
}
return PushSimpleOp(kVerticalBar);
}
// Processes a right parenthesis in the input.
bool Regexp::ParseState::DoRightParen() {
// Finish the current concatenation and alternation.
DoAlternation();
// The stack should be: LeftParen regexp
// Remove the LeftParen, leaving the regexp,
// parenthesized.
Regexp* r1;
Regexp* r2;
if ((r1 = stacktop_) == NULL ||
(r2 = r1->down_) == NULL ||
r2->op() != kLeftParen) {
status_->set_code(kRegexpMissingParen);
status_->set_error_arg(whole_regexp_);
return false;
}
// Pop off r1, r2. Will Decref or reuse below.
stacktop_ = r2->down_;
// Restore flags from when paren opened.
Regexp* re = r2;
flags_ = re->parse_flags();
// Rewrite LeftParen as capture if needed.
if (re->cap_ > 0) {
re->op_ = kRegexpCapture;
// re->cap_ is already set
re->AllocSub(1);
re->sub()[0] = FinishRegexp(r1);
re->simple_ = re->ComputeSimple();
} else {
re->Decref();
re = r1;
}
return PushRegexp(re);
}
// Processes the end of input, returning the final regexp.
Regexp* Regexp::ParseState::DoFinish() {
DoAlternation();
Regexp* re = stacktop_;
if (re != NULL && re->down_ != NULL) {
status_->set_code(kRegexpMissingParen);
status_->set_error_arg(whole_regexp_);
return NULL;
}
stacktop_ = NULL;
return FinishRegexp(re);
}
// Returns the leading regexp that re starts with.
// The returned Regexp* points into a piece of re,
// so it must not be used after the caller calls re->Decref().
Regexp* Regexp::LeadingRegexp(Regexp* re) {
if (re->op() == kRegexpEmptyMatch)
return NULL;
if (re->op() == kRegexpConcat && re->nsub() >= 2) {
Regexp** sub = re->sub();
if (sub[0]->op() == kRegexpEmptyMatch)
return NULL;
return sub[0];
}
return re;
}
// Removes LeadingRegexp(re) from re and returns what's left.
// Consumes the reference to re and may edit it in place.
// If caller wants to hold on to LeadingRegexp(re),
// must have already Incref'ed it.
Regexp* Regexp::RemoveLeadingRegexp(Regexp* re) {
if (re->op() == kRegexpEmptyMatch)
return re;
if (re->op() == kRegexpConcat && re->nsub() >= 2) {
Regexp** sub = re->sub();
if (sub[0]->op() == kRegexpEmptyMatch)
return re;
sub[0]->Decref();
sub[0] = NULL;
if (re->nsub() == 2) {
// Collapse concatenation to single regexp.
Regexp* nre = sub[1];
sub[1] = NULL;
re->Decref();
return nre;
}
// 3 or more -> 2 or more.
re->nsub_--;
memmove(sub, sub + 1, re->nsub_ * sizeof sub[0]);
return re;
}
Regexp::ParseFlags pf = re->parse_flags();
re->Decref();
return new Regexp(kRegexpEmptyMatch, pf);
}
// Returns the leading string that re starts with.
// The returned Rune* points into a piece of re,
// so it must not be used after the caller calls re->Decref().
Rune* Regexp::LeadingString(Regexp* re, int *nrune,
Regexp::ParseFlags *flags) {
while (re->op() == kRegexpConcat && re->nsub() > 0)
re = re->sub()[0];
*flags = static_cast<Regexp::ParseFlags>(re->parse_flags_ & Regexp::FoldCase);
if (re->op() == kRegexpLiteral) {
*nrune = 1;
return &re->rune_;
}
if (re->op() == kRegexpLiteralString) {
*nrune = re->nrunes_;
return re->runes_;
}
*nrune = 0;
return NULL;
}
// Removes the first n leading runes from the beginning of re.
// Edits re in place.
void Regexp::RemoveLeadingString(Regexp* re, int n) {
// Chase down concats to find first string.
// For regexps generated by parser, nested concats are
// flattened except when doing so would overflow the 16-bit
// limit on the size of a concatenation, so we should never
// see more than two here.
Regexp* stk[4];
int d = 0;
while (re->op() == kRegexpConcat) {
if (d < arraysize(stk))
stk[d++] = re;
re = re->sub()[0];
}
// Remove leading string from re.
if (re->op() == kRegexpLiteral) {
re->rune_ = 0;
re->op_ = kRegexpEmptyMatch;
} else if (re->op() == kRegexpLiteralString) {
if (n >= re->nrunes_) {
delete[] re->runes_;
re->runes_ = NULL;
re->nrunes_ = 0;
re->op_ = kRegexpEmptyMatch;
} else if (n == re->nrunes_ - 1) {
Rune rune = re->runes_[re->nrunes_ - 1];
delete[] re->runes_;
re->runes_ = NULL;
re->nrunes_ = 0;
re->rune_ = rune;
re->op_ = kRegexpLiteral;
} else {
re->nrunes_ -= n;
memmove(re->runes_, re->runes_ + n, re->nrunes_ * sizeof re->runes_[0]);
}
}
// If re is now empty, concatenations might simplify too.
while (d-- > 0) {
re = stk[d];
Regexp** sub = re->sub();
if (sub[0]->op() == kRegexpEmptyMatch) {
sub[0]->Decref();
sub[0] = NULL;
// Delete first element of concat.
switch (re->nsub()) {
case 0:
case 1:
// Impossible.
LOG(DFATAL) << "Concat of " << re->nsub();
re->submany_ = NULL;
re->op_ = kRegexpEmptyMatch;
break;
case 2: {
// Replace re with sub[1].
Regexp* old = sub[1];
sub[1] = NULL;
re->Swap(old);
old->Decref();
break;
}
default:
// Slide down.
re->nsub_--;
memmove(sub, sub + 1, re->nsub_ * sizeof sub[0]);
break;
}
}
}
}
// Factors common prefixes from alternation.
// For example,
// ABC|ABD|AEF|BCX|BCY
// simplifies to
// A(B(C|D)|EF)|BC(X|Y)
// which the normal parse state routines will further simplify to
// A(B[CD]|EF)|BC[XY]
//
// Rewrites sub to contain simplified list to alternate and returns
// the new length of sub. Adjusts reference counts accordingly
// (incoming sub[i] decremented, outgoing sub[i] incremented).
// It's too much of a pain to write this code with an explicit stack,
// so instead we let the caller specify a maximum depth and
// don't simplify beyond that. There are around 15 words of local
// variables and parameters in the frame, so allowing 8 levels
// on a 64-bit machine is still less than a kilobyte of stack and
// probably enough benefit for practical uses.
const int kFactorAlternationMaxDepth = 8;
int Regexp::FactorAlternation(
Regexp** sub, int n,
Regexp::ParseFlags altflags) {
return FactorAlternationRecursive(sub, n, altflags,
kFactorAlternationMaxDepth);
}
int Regexp::FactorAlternationRecursive(
Regexp** sub, int n,
Regexp::ParseFlags altflags,
int maxdepth) {
if (maxdepth <= 0)
return n;
// Round 1: Factor out common literal prefixes.
Rune *rune = NULL;
int nrune = 0;
Regexp::ParseFlags runeflags = Regexp::NoParseFlags;
int start = 0;
int out = 0;
for (int i = 0; i <= n; i++) {
// Invariant: what was in sub[0:start] has been Decref'ed
// and that space has been reused for sub[0:out] (out <= start).
//
// Invariant: sub[start:i] consists of regexps that all begin
// with the string rune[0:nrune].
Rune* rune_i = NULL;
int nrune_i = 0;
Regexp::ParseFlags runeflags_i = Regexp::NoParseFlags;
if (i < n) {
rune_i = LeadingString(sub[i], &nrune_i, &runeflags_i);
if (runeflags_i == runeflags) {
int same = 0;
while (same < nrune && same < nrune_i && rune[same] == rune_i[same])
same++;
if (same > 0) {
// Matches at least one rune in current range. Keep going around.
nrune = same;
continue;
}
}
}
// Found end of a run with common leading literal string:
// sub[start:i] all begin with rune[0:nrune] but sub[i]
// does not even begin with rune[0].
//
// Factor out common string and append factored expression to sub[0:out].
if (i == start) {
// Nothing to do - first iteration.
} else if (i == start+1) {
// Just one: don't bother factoring.
sub[out++] = sub[start];
} else {
// Construct factored form: prefix(suffix1|suffix2|...)
Regexp* x[2]; // x[0] = prefix, x[1] = suffix1|suffix2|...
x[0] = LiteralString(rune, nrune, runeflags);
for (int j = start; j < i; j++)
RemoveLeadingString(sub[j], nrune);
int nn = FactorAlternationRecursive(sub + start, i - start, altflags,
maxdepth - 1);
x[1] = AlternateNoFactor(sub + start, nn, altflags);
sub[out++] = Concat(x, 2, altflags);
}
// Prepare for next round (if there is one).
if (i < n) {
start = i;
rune = rune_i;
nrune = nrune_i;
runeflags = runeflags_i;
}
}
n = out;
// Round 2: Factor out common complex prefixes,
// just the first piece of each concatenation,
// whatever it is. This is good enough a lot of the time.
start = 0;
out = 0;
Regexp* first = NULL;
for (int i = 0; i <= n; i++) {
// Invariant: what was in sub[0:start] has been Decref'ed
// and that space has been reused for sub[0:out] (out <= start).
//
// Invariant: sub[start:i] consists of regexps that all begin with first.
Regexp* first_i = NULL;
if (i < n) {
first_i = LeadingRegexp(sub[i]);
if (first != NULL && Regexp::Equal(first, first_i)) {
continue;
}
}
// Found end of a run with common leading regexp:
// sub[start:i] all begin with first but sub[i] does not.
//
// Factor out common regexp and append factored expression to sub[0:out].
if (i == start) {
// Nothing to do - first iteration.
} else if (i == start+1) {
// Just one: don't bother factoring.
sub[out++] = sub[start];
} else {
// Construct factored form: prefix(suffix1|suffix2|...)
Regexp* x[2]; // x[0] = prefix, x[1] = suffix1|suffix2|...
x[0] = first->Incref();
for (int j = start; j < i; j++)
sub[j] = RemoveLeadingRegexp(sub[j]);
int nn = FactorAlternationRecursive(sub + start, i - start, altflags,
maxdepth - 1);
x[1] = AlternateNoFactor(sub + start, nn, altflags);
sub[out++] = Concat(x, 2, altflags);
}
// Prepare for next round (if there is one).
if (i < n) {
start = i;
first = first_i;
}
}
n = out;
// Round 3: Collapse runs of single literals into character classes.
start = 0;
out = 0;
for (int i = 0; i <= n; i++) {
// Invariant: what was in sub[0:start] has been Decref'ed
// and that space has been reused for sub[0:out] (out <= start).
//
// Invariant: sub[start:i] consists of regexps that are either
// literal runes or character classes.
if (i < n &&
(sub[i]->op() == kRegexpLiteral ||
sub[i]->op() == kRegexpCharClass))
continue;
// sub[i] is not a char or char class;
// emit char class for sub[start:i]...
if (i == start) {
// Nothing to do.
} else if (i == start+1) {
sub[out++] = sub[start];
} else {
// Make new char class.
CharClassBuilder ccb;
for (int j = start; j < i; j++) {
Regexp* re = sub[j];
if (re->op() == kRegexpCharClass) {
CharClass* cc = re->cc();
for (CharClass::iterator it = cc->begin(); it != cc->end(); ++it)
ccb.AddRange(it->lo, it->hi);
} else if (re->op() == kRegexpLiteral) {
ccb.AddRangeFlags(re->rune(), re->rune(), re->parse_flags());
} else {
LOG(DFATAL) << "RE2: unexpected op: " << re->op() << " "
<< re->ToString();
}
re->Decref();
}
sub[out++] = NewCharClass(ccb.GetCharClass(), altflags);
}
// ... and then emit sub[i].
if (i < n)
sub[out++] = sub[i];
start = i+1;
}
n = out;
// Round 4: Collapse runs of empty matches into single empty match.
start = 0;
out = 0;
for (int i = 0; i < n; i++) {
if (i + 1 < n &&
sub[i]->op() == kRegexpEmptyMatch &&
sub[i+1]->op() == kRegexpEmptyMatch) {
sub[i]->Decref();
continue;
}
sub[out++] = sub[i];
}
n = out;
return n;
}
// Collapse the regexps on top of the stack, down to the
// first marker, into a new op node (op == kRegexpAlternate
// or op == kRegexpConcat).
void Regexp::ParseState::DoCollapse(RegexpOp op) {
// Scan backward to marker, counting children of composite.
int n = 0;
Regexp* next = NULL;
Regexp* sub;
for (sub = stacktop_; sub != NULL && !IsMarker(sub->op()); sub = next) {
next = sub->down_;
if (sub->op_ == op)
n += sub->nsub_;
else
n++;
}
// If there's just one child, leave it alone.
// (Concat of one thing is that one thing; alternate of one thing is same.)
if (stacktop_ != NULL && stacktop_->down_ == next)
return;
// Construct op (alternation or concatenation), flattening op of op.
Regexp** subs = new Regexp*[n];
next = NULL;
int i = n;
for (sub = stacktop_; sub != NULL && !IsMarker(sub->op()); sub = next) {
next = sub->down_;
if (sub->op_ == op) {
Regexp** sub_subs = sub->sub();
for (int k = sub->nsub_ - 1; k >= 0; k--)
subs[--i] = sub_subs[k]->Incref();
sub->Decref();
} else {
subs[--i] = FinishRegexp(sub);
}
}
Regexp* re = ConcatOrAlternate(op, subs, n, flags_, true);
delete[] subs;
re->simple_ = re->ComputeSimple();
re->down_ = next;
stacktop_ = re;
}
// Finishes the current concatenation,
// collapsing it into a single regexp on the stack.
void Regexp::ParseState::DoConcatenation() {
Regexp* r1 = stacktop_;
if (r1 == NULL || IsMarker(r1->op())) {
// empty concatenation is special case
Regexp* re = new Regexp(kRegexpEmptyMatch, flags_);
PushRegexp(re);
}
DoCollapse(kRegexpConcat);
}
// Finishes the current alternation,
// collapsing it to a single regexp on the stack.
void Regexp::ParseState::DoAlternation() {
DoVerticalBar();
// Now stack top is kVerticalBar.
Regexp* r1 = stacktop_;
stacktop_ = r1->down_;
r1->Decref();
DoCollapse(kRegexpAlternate);
}
// Incremental conversion of concatenated literals into strings.
// If top two elements on stack are both literal or string,
// collapse into single string.
// Don't walk down the stack -- the parser calls this frequently
// enough that below the bottom two is known to be collapsed.
// Only called when another regexp is about to be pushed
// on the stack, so that the topmost literal is not being considered.
// (Otherwise ab* would turn into (ab)*.)
// If r >= 0, consider pushing a literal r on the stack.
// Return whether that happened.
bool Regexp::ParseState::MaybeConcatString(int r, ParseFlags flags) {
Regexp* re1;
Regexp* re2;
if ((re1 = stacktop_) == NULL || (re2 = re1->down_) == NULL)
return false;
if (re1->op_ != kRegexpLiteral && re1->op_ != kRegexpLiteralString)
return false;
if (re2->op_ != kRegexpLiteral && re2->op_ != kRegexpLiteralString)
return false;
if ((re1->parse_flags_ & FoldCase) != (re2->parse_flags_ & FoldCase))
return false;
if (re2->op_ == kRegexpLiteral) {
// convert into string
Rune rune = re2->rune_;
re2->op_ = kRegexpLiteralString;
re2->nrunes_ = 0;
re2->runes_ = NULL;
re2->AddRuneToString(rune);
}
// push re1 into re2.
if (re1->op_ == kRegexpLiteral) {
re2->AddRuneToString(re1->rune_);
} else {
for (int i = 0; i < re1->nrunes_; i++)
re2->AddRuneToString(re1->runes_[i]);
re1->nrunes_ = 0;
delete[] re1->runes_;
re1->runes_ = NULL;
}
// reuse re1 if possible
if (r >= 0) {
re1->op_ = kRegexpLiteral;
re1->rune_ = r;
re1->parse_flags_ = flags;
return true;
}
stacktop_ = re2;
re1->Decref();
return false;
}
// Lexing routines.
// Parses a decimal integer, storing it in *n.
// Sets *s to span the remainder of the string.
// Sets *out_re to the regexp for the class.
static bool ParseInteger(StringPiece* s, int* np) {
if (s->size() == 0 || !isdigit((*s)[0] & 0xFF))
return false;
// Disallow leading zeros.
if (s->size() >= 2 && (*s)[0] == '0' && isdigit((*s)[1] & 0xFF))
return false;
int n = 0;
int c;
while (s->size() > 0 && isdigit(c = (*s)[0] & 0xFF)) {
// Avoid overflow.
if (n >= 100000000)
return false;
n = n*10 + c - '0';
s->remove_prefix(1); // digit
}
*np = n;
return true;
}
// Parses a repetition suffix like {1,2} or {2} or {2,}.
// Sets *s to span the remainder of the string on success.
// Sets *lo and *hi to the given range.
// In the case of {2,}, the high number is unbounded;
// sets *hi to -1 to signify this.
// {,2} is NOT a valid suffix.
// The Maybe in the name signifies that the regexp parse
// doesn't fail even if ParseRepetition does, so the StringPiece
// s must NOT be edited unless MaybeParseRepetition returns true.
static bool MaybeParseRepetition(StringPiece* sp, int* lo, int* hi) {
StringPiece s = *sp;
if (s.size() == 0 || s[0] != '{')
return false;
s.remove_prefix(1); // '{'
if (!ParseInteger(&s, lo))
return false;
if (s.size() == 0)
return false;
if (s[0] == ',') {
s.remove_prefix(1); // ','
if (s.size() == 0)
return false;
if (s[0] == '}') {
// {2,} means at least 2
*hi = -1;
} else {
// {2,4} means 2, 3, or 4.
if (!ParseInteger(&s, hi))
return false;
}
} else {
// {2} means exactly two
*hi = *lo;
}
if (s.size() == 0 || s[0] != '}')
return false;
s.remove_prefix(1); // '}'
*sp = s;
return true;
}
// Removes the next Rune from the StringPiece and stores it in *r.
// Returns number of bytes removed from sp.
// Behaves as though there is a terminating NUL at the end of sp.
// Argument order is backwards from usual Google style
// but consistent with chartorune.
static int StringPieceToRune(Rune *r, StringPiece *sp, RegexpStatus* status) {
int n;
if (fullrune(sp->data(), sp->size())) {
n = chartorune(r, sp->data());
if (!(n == 1 && *r == Runeerror)) { // no decoding error
sp->remove_prefix(n);
return n;
}
}
status->set_code(kRegexpBadUTF8);
status->set_error_arg(NULL);
return -1;
}
// Return whether name is valid UTF-8.
// If not, set status to kRegexpBadUTF8.
static bool IsValidUTF8(const StringPiece& s, RegexpStatus* status) {
StringPiece t = s;
Rune r;
while (t.size() > 0) {
if (StringPieceToRune(&r, &t, status) < 0)
return false;
}
return true;
}
// Is c a hex digit?
static int IsHex(int c) {
return ('0' <= c && c <= '9') ||
('A' <= c && c <= 'F') ||
('a' <= c && c <= 'f');
}
// Convert hex digit to value.
static int UnHex(int c) {
if ('0' <= c && c <= '9')
return c - '0';
if ('A' <= c && c <= 'F')
return c - 'A' + 10;
if ('a' <= c && c <= 'f')
return c - 'a' + 10;
LOG(DFATAL) << "Bad hex digit " << c;
return 0;
}
// Parse an escape sequence (e.g., \n, \{).
// Sets *s to span the remainder of the string.
// Sets *rp to the named character.
static bool ParseEscape(StringPiece* s, Rune* rp,
RegexpStatus* status, int rune_max) {
const char* begin = s->begin();
if (s->size() < 1 || (*s)[0] != '\\') {
// Should not happen - caller always checks.
status->set_code(kRegexpInternalError);
status->set_error_arg(NULL);
return false;
}
if (s->size() < 2) {
status->set_code(kRegexpTrailingBackslash);
status->set_error_arg(NULL);
return false;
}
Rune c, c1;
s->remove_prefix(1); // backslash
if (StringPieceToRune(&c, s, status) < 0)
return false;
int code;
switch (c) {
default:
if (c < Runeself && !isalpha(c) && !isdigit(c)) {
// Escaped non-word characters are always themselves.
// PCRE is not quite so rigorous: it accepts things like
// \q, but we don't. We once rejected \_, but too many
// programs and people insist on using it, so allow \_.
*rp = c;
return true;
}
goto BadEscape;
// Octal escapes.
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
// Single non-zero octal digit is a backreference; not supported.
if (s->size() == 0 || (*s)[0] < '0' || (*s)[0] > '7')
goto BadEscape;
// fall through
case '0':
// consume up to three octal digits; already have one.
code = c - '0';
if (s->size() > 0 && '0' <= (c = (*s)[0]) && c <= '7') {
code = code * 8 + c - '0';
s->remove_prefix(1); // digit
if (s->size() > 0) {
c = (*s)[0];
if ('0' <= c && c <= '7') {
code = code * 8 + c - '0';
s->remove_prefix(1); // digit
}
}
}
if (code > rune_max)
goto BadEscape;
*rp = code;
return true;
// Hexadecimal escapes
case 'x':
if (s->size() == 0)
goto BadEscape;
if (StringPieceToRune(&c, s, status) < 0)
return false;
if (c == '{') {
// Any number of digits in braces.
// Update n as we consume the string, so that
// the whole thing gets shown in the error message.
// Perl accepts any text at all; it ignores all text
// after the first non-hex digit. We require only hex digits,
// and at least one.
if (StringPieceToRune(&c, s, status) < 0)
return false;
int nhex = 0;
code = 0;
while (IsHex(c)) {
nhex++;
code = code * 16 + UnHex(c);
if (code > rune_max)
goto BadEscape;
if (s->size() == 0)
goto BadEscape;
if (StringPieceToRune(&c, s, status) < 0)
return false;
}
if (c != '}' || nhex == 0)
goto BadEscape;
*rp = code;
return true;
}
// Easy case: two hex digits.
if (s->size() == 0)
goto BadEscape;
if (StringPieceToRune(&c1, s, status) < 0)
return false;
if (!IsHex(c) || !IsHex(c1))
goto BadEscape;
*rp = UnHex(c) * 16 + UnHex(c1);
return true;
// C escapes.
case 'n':
*rp = '\n';
return true;
case 'r':
*rp = '\r';
return true;
case 't':
*rp = '\t';
return true;
// Less common C escapes.
case 'a':
*rp = '\a';
return true;
case 'f':
*rp = '\f';
return true;
case 'v':
*rp = '\v';
return true;
// This code is disabled to avoid misparsing
// the Perl word-boundary \b as a backspace
// when in POSIX regexp mode. Surprisingly,
// in Perl, \b means word-boundary but [\b]
// means backspace. We don't support that:
// if you want a backspace embed a literal
// backspace character or use \x08.
//
// case 'b':
// *rp = '\b';
// return true;
}
LOG(DFATAL) << "Not reached in ParseEscape.";
BadEscape:
// Unrecognized escape sequence.
status->set_code(kRegexpBadEscape);
status->set_error_arg(StringPiece(begin, s->data() - begin));
return false;
}
// Add a range to the character class, but exclude newline if asked.
// Also handle case folding.
void CharClassBuilder::AddRangeFlags(
Rune lo, Rune hi, Regexp::ParseFlags parse_flags) {
// Take out \n if the flags say so.
bool cutnl = !(parse_flags & Regexp::ClassNL) ||
(parse_flags & Regexp::NeverNL);
if (cutnl && lo <= '\n' && '\n' <= hi) {
if (lo < '\n')
AddRangeFlags(lo, '\n' - 1, parse_flags);
if (hi > '\n')
AddRangeFlags('\n' + 1, hi, parse_flags);
return;
}
// If folding case, add fold-equivalent characters too.
if (parse_flags & Regexp::FoldCase)
AddFoldedRange(this, lo, hi, 0);
else
AddRange(lo, hi);
}
// Look for a group with the given name.
static const UGroup* LookupGroup(const StringPiece& name,
const UGroup *groups, int ngroups) {
// Simple name lookup.
for (int i = 0; i < ngroups; i++)
if (StringPiece(groups[i].name) == name)
return &groups[i];
return NULL;
}
// Fake UGroup containing all Runes
static URange16 any16[] = { { 0, 65535 } };
static URange32 any32[] = { { 65536, Runemax } };
static UGroup anygroup = { "Any", +1, any16, 1, any32, 1 };
// Look for a POSIX group with the given name (e.g., "[:^alpha:]")
static const UGroup* LookupPosixGroup(const StringPiece& name) {
return LookupGroup(name, posix_groups, num_posix_groups);
}
static const UGroup* LookupPerlGroup(const StringPiece& name) {
return LookupGroup(name, perl_groups, num_perl_groups);
}
// Look for a Unicode group with the given name (e.g., "Han")
static const UGroup* LookupUnicodeGroup(const StringPiece& name) {
// Special case: "Any" means any.
if (name == StringPiece("Any"))
return &anygroup;
return LookupGroup(name, unicode_groups, num_unicode_groups);
}
// Add a UGroup or its negation to the character class.
static void AddUGroup(CharClassBuilder *cc, const UGroup *g, int sign,
Regexp::ParseFlags parse_flags) {
if (sign == +1) {
for (int i = 0; i < g->nr16; i++) {
cc->AddRangeFlags(g->r16[i].lo, g->r16[i].hi, parse_flags);
}
for (int i = 0; i < g->nr32; i++) {
cc->AddRangeFlags(g->r32[i].lo, g->r32[i].hi, parse_flags);
}
} else {
if (parse_flags & Regexp::FoldCase) {
// Normally adding a case-folded group means
// adding all the extra fold-equivalent runes too.
// But if we're adding the negation of the group,
// we have to exclude all the runes that are fold-equivalent
// to what's already missing. Too hard, so do in two steps.
CharClassBuilder ccb1;
AddUGroup(&ccb1, g, +1, parse_flags);
// If the flags say to take out \n, put it in, so that negating will take it out.
// Normally AddRangeFlags does this, but we're bypassing AddRangeFlags.
bool cutnl = !(parse_flags & Regexp::ClassNL) ||
(parse_flags & Regexp::NeverNL);
if (cutnl) {
ccb1.AddRange('\n', '\n');
}
ccb1.Negate();
cc->AddCharClass(&ccb1);
return;
}
int next = 0;
for (int i = 0; i < g->nr16; i++) {
if (next < g->r16[i].lo)
cc->AddRangeFlags(next, g->r16[i].lo - 1, parse_flags);
next = g->r16[i].hi + 1;
}
for (int i = 0; i < g->nr32; i++) {
if (next < g->r32[i].lo)
cc->AddRangeFlags(next, g->r32[i].lo - 1, parse_flags);
next = g->r32[i].hi + 1;
}
if (next <= Runemax)
cc->AddRangeFlags(next, Runemax, parse_flags);
}
}
// Maybe parse a Perl character class escape sequence.
// Only recognizes the Perl character classes (\d \s \w \D \S \W),
// not the Perl empty-string classes (\b \B \A \Z \z).
// On success, sets *s to span the remainder of the string
// and returns the corresponding UGroup.
// The StringPiece must *NOT* be edited unless the call succeeds.
const UGroup* MaybeParsePerlCCEscape(StringPiece* s, Regexp::ParseFlags parse_flags) {
if (!(parse_flags & Regexp::PerlClasses))
return NULL;
if (s->size() < 2 || (*s)[0] != '\\')
return NULL;
// Could use StringPieceToRune, but there aren't
// any non-ASCII Perl group names.
StringPiece name(s->begin(), 2);
const UGroup *g = LookupPerlGroup(name);
if (g == NULL)
return NULL;
s->remove_prefix(name.size());
return g;
}
enum ParseStatus {
kParseOk, // Did some parsing.
kParseError, // Found an error.
kParseNothing, // Decided not to parse.
};
// Maybe parses a Unicode character group like \p{Han} or \P{Han}
// (the latter is a negated group).
ParseStatus ParseUnicodeGroup(StringPiece* s, Regexp::ParseFlags parse_flags,
CharClassBuilder *cc,
RegexpStatus* status) {
// Decide whether to parse.
if (!(parse_flags & Regexp::UnicodeGroups))
return kParseNothing;
if (s->size() < 2 || (*s)[0] != '\\')
return kParseNothing;
Rune c = (*s)[1];
if (c != 'p' && c != 'P')
return kParseNothing;
// Committed to parse. Results:
int sign = +1; // -1 = negated char class
if (c == 'P')
sign = -1;
StringPiece seq = *s; // \p{Han} or \pL
StringPiece name; // Han or L
s->remove_prefix(2); // '\\', 'p'
if (!StringPieceToRune(&c, s, status))
return kParseError;
if (c != '{') {
// Name is the bit of string we just skipped over for c.
const char* p = seq.begin() + 2;
name = StringPiece(p, s->begin() - p);
} else {
// Name is in braces. Look for closing }
size_t end = s->find('}', 0);
if (end == s->npos) {
if (!IsValidUTF8(seq, status))
return kParseError;
status->set_code(kRegexpBadCharRange);
status->set_error_arg(seq);
return kParseError;
}
name = StringPiece(s->begin(), end); // without '}'
s->remove_prefix(end + 1); // with '}'
if (!IsValidUTF8(name, status))
return kParseError;
}
// Chop seq where s now begins.
seq = StringPiece(seq.begin(), s->begin() - seq.begin());
// Look up group
if (name.size() > 0 && name[0] == '^') {
sign = -sign;
name.remove_prefix(1); // '^'
}
const UGroup *g = LookupUnicodeGroup(name);
if (g == NULL) {
status->set_code(kRegexpBadCharRange);
status->set_error_arg(seq);
return kParseError;
}
AddUGroup(cc, g, sign, parse_flags);
return kParseOk;
}
// Parses a character class name like [:alnum:].
// Sets *s to span the remainder of the string.
// Adds the ranges corresponding to the class to ranges.
static ParseStatus ParseCCName(StringPiece* s, Regexp::ParseFlags parse_flags,
CharClassBuilder *cc,
RegexpStatus* status) {
// Check begins with [:
const char* p = s->data();
const char* ep = s->data() + s->size();
if (ep - p < 2 || p[0] != '[' || p[1] != ':')
return kParseNothing;
// Look for closing :].
const char* q;
for (q = p+2; q <= ep-2 && (*q != ':' || *(q+1) != ']'); q++)
;
// If no closing :], then ignore.
if (q > ep-2)
return kParseNothing;
// Got it. Check that it's valid.
q += 2;
StringPiece name(p, q-p);
const UGroup *g = LookupPosixGroup(name);
if (g == NULL) {
status->set_code(kRegexpBadCharRange);
status->set_error_arg(name);
return kParseError;
}
s->remove_prefix(name.size());
AddUGroup(cc, g, g->sign, parse_flags);
return kParseOk;
}
// Parses a character inside a character class.
// There are fewer special characters here than in the rest of the regexp.
// Sets *s to span the remainder of the string.
// Sets *rp to the character.
bool Regexp::ParseState::ParseCCCharacter(StringPiece* s, Rune *rp,
const StringPiece& whole_class,
RegexpStatus* status) {
if (s->size() == 0) {
status->set_code(kRegexpMissingBracket);
status->set_error_arg(whole_class);
return false;
}
// Allow regular escape sequences even though
// many need not be escaped in this context.
if (s->size() >= 1 && (*s)[0] == '\\')
return ParseEscape(s, rp, status, rune_max_);
// Otherwise take the next rune.
return StringPieceToRune(rp, s, status) >= 0;
}
// Parses a character class character, or, if the character
// is followed by a hyphen, parses a character class range.
// For single characters, rr->lo == rr->hi.
// Sets *s to span the remainder of the string.
// Sets *rp to the character.
bool Regexp::ParseState::ParseCCRange(StringPiece* s, RuneRange* rr,
const StringPiece& whole_class,
RegexpStatus* status) {
StringPiece os = *s;
if (!ParseCCCharacter(s, &rr->lo, whole_class, status))
return false;
// [a-] means (a|-), so check for final ].
if (s->size() >= 2 && (*s)[0] == '-' && (*s)[1] != ']') {
s->remove_prefix(1); // '-'
if (!ParseCCCharacter(s, &rr->hi, whole_class, status))
return false;
if (rr->hi < rr->lo) {
status->set_code(kRegexpBadCharRange);
status->set_error_arg(StringPiece(os.data(), s->data() - os.data()));
return false;
}
} else {
rr->hi = rr->lo;
}
return true;
}
// Parses a possibly-negated character class expression like [^abx-z[:digit:]].
// Sets *s to span the remainder of the string.
// Sets *out_re to the regexp for the class.
bool Regexp::ParseState::ParseCharClass(StringPiece* s,
Regexp** out_re,
RegexpStatus* status) {
StringPiece whole_class = *s;
if (s->size() == 0 || (*s)[0] != '[') {
// Caller checked this.
status->set_code(kRegexpInternalError);
status->set_error_arg(NULL);
return false;
}
bool negated = false;
Regexp* re = new Regexp(kRegexpCharClass, flags_ & ~FoldCase);
re->ccb_ = new CharClassBuilder;
s->remove_prefix(1); // '['
if (s->size() > 0 && (*s)[0] == '^') {
s->remove_prefix(1); // '^'
negated = true;
if (!(flags_ & ClassNL) || (flags_ & NeverNL)) {
// If NL can't match implicitly, then pretend
// negated classes include a leading \n.
re->ccb_->AddRange('\n', '\n');
}
}
bool first = true; // ] is okay as first char in class
while (s->size() > 0 && ((*s)[0] != ']' || first)) {
// - is only okay unescaped as first or last in class.
// Except that Perl allows - anywhere.
if ((*s)[0] == '-' && !first && !(flags_&PerlX) &&
(s->size() == 1 || (*s)[1] != ']')) {
StringPiece t = *s;
t.remove_prefix(1); // '-'
Rune r;
int n = StringPieceToRune(&r, &t, status);
if (n < 0) {
re->Decref();
return false;
}
status->set_code(kRegexpBadCharRange);
status->set_error_arg(StringPiece(s->data(), 1+n));
re->Decref();
return false;
}
first = false;
// Look for [:alnum:] etc.
if (s->size() > 2 && (*s)[0] == '[' && (*s)[1] == ':') {
switch (ParseCCName(s, flags_, re->ccb_, status)) {
case kParseOk:
continue;
case kParseError:
re->Decref();
return false;
case kParseNothing:
break;
}
}
// Look for Unicode character group like \p{Han}
if (s->size() > 2 &&
(*s)[0] == '\\' &&
((*s)[1] == 'p' || (*s)[1] == 'P')) {
switch (ParseUnicodeGroup(s, flags_, re->ccb_, status)) {
case kParseOk:
continue;
case kParseError:
re->Decref();
return false;
case kParseNothing:
break;
}
}
// Look for Perl character class symbols (extension).
const UGroup *g = MaybeParsePerlCCEscape(s, flags_);
if (g != NULL) {
AddUGroup(re->ccb_, g, g->sign, flags_);
continue;
}
// Otherwise assume single character or simple range.
RuneRange rr;
if (!ParseCCRange(s, &rr, whole_class, status)) {
re->Decref();
return false;
}
// AddRangeFlags is usually called in response to a class like
// \p{Foo} or [[:foo:]]; for those, it filters \n out unless
// Regexp::ClassNL is set. In an explicit range or singleton
// like we just parsed, we do not filter \n out, so set ClassNL
// in the flags.
re->ccb_->AddRangeFlags(rr.lo, rr.hi, flags_ | Regexp::ClassNL);
}
if (s->size() == 0) {
status->set_code(kRegexpMissingBracket);
status->set_error_arg(whole_class);
re->Decref();
return false;
}
s->remove_prefix(1); // ']'
if (negated)
re->ccb_->Negate();
re->ccb_->RemoveAbove(rune_max_);
*out_re = re;
return true;
}
// Is this a valid capture name? [A-Za-z0-9_]+
// PCRE limits names to 32 bytes.
// Python rejects names starting with digits.
// We don't enforce either of those.
static bool IsValidCaptureName(const StringPiece& name) {
if (name.size() == 0)
return false;
for (int i = 0; i < name.size(); i++) {
int c = name[i];
if (('0' <= c && c <= '9') ||
('a' <= c && c <= 'z') ||
('A' <= c && c <= 'Z') ||
c == '_')
continue;
return false;
}
return true;
}
// Parses a Perl flag setting or non-capturing group or both,
// like (?i) or (?: or (?i:. Removes from s, updates parse state.
// The caller must check that s begins with "(?".
// Returns true on success. If the Perl flag is not
// well-formed or not supported, sets status_ and returns false.
bool Regexp::ParseState::ParsePerlFlags(StringPiece* s) {
StringPiece t = *s;
// Caller is supposed to check this.
if (!(flags_ & PerlX) || t.size() < 2 || t[0] != '(' || t[1] != '?') {
LOG(DFATAL) << "Bad call to ParseState::ParsePerlFlags";
status_->set_code(kRegexpInternalError);
return false;
}
t.remove_prefix(2); // "(?"
// Check for named captures, first introduced in Python's regexp library.
// As usual, there are three slightly different syntaxes:
//
// (?P<name>expr) the original, introduced by Python
// (?<name>expr) the .NET alteration, adopted by Perl 5.10
// (?'name'expr) another .NET alteration, adopted by Perl 5.10
//
// Perl 5.10 gave in and implemented the Python version too,
// but they claim that the last two are the preferred forms.
// PCRE and languages based on it (specifically, PHP and Ruby)
// support all three as well. EcmaScript 4 uses only the Python form.
//
// In both the open source world (via Code Search) and the
// Google source tree, (?P<expr>name) is the dominant form,
// so that's the one we implement. One is enough.
if (t.size() > 2 && t[0] == 'P' && t[1] == '<') {
// Pull out name.
size_t end = t.find('>', 2);
if (end == t.npos) {
if (!IsValidUTF8(*s, status_))
return false;
status_->set_code(kRegexpBadNamedCapture);
status_->set_error_arg(*s);
return false;
}
// t is "P<name>...", t[end] == '>'
StringPiece capture(t.begin()-2, end+3); // "(?P<name>"
StringPiece name(t.begin()+2, end-2); // "name"
if (!IsValidUTF8(name, status_))
return false;
if (!IsValidCaptureName(name)) {
status_->set_code(kRegexpBadNamedCapture);
status_->set_error_arg(capture);
return false;
}
if (!DoLeftParen(name)) {
// DoLeftParen's failure set status_.
return false;
}
s->remove_prefix(capture.end() - s->begin());
return true;
}
bool negated = false;
bool sawflags = false;
int nflags = flags_;
Rune c;
for (bool done = false; !done; ) {
if (t.size() == 0)
goto BadPerlOp;
if (StringPieceToRune(&c, &t, status_) < 0)
return false;
switch (c) {
default:
goto BadPerlOp;
// Parse flags.
case 'i':
sawflags = true;
if (negated)
nflags &= ~FoldCase;
else
nflags |= FoldCase;
break;
case 'm': // opposite of our OneLine
sawflags = true;
if (negated)
nflags |= OneLine;
else
nflags &= ~OneLine;
break;
case 's':
sawflags = true;
if (negated)
nflags &= ~DotNL;
else
nflags |= DotNL;
break;
case 'U':
sawflags = true;
if (negated)
nflags &= ~NonGreedy;
else
nflags |= NonGreedy;
break;
// Negation
case '-':
if (negated)
goto BadPerlOp;
negated = true;
sawflags = false;
break;
// Open new group.
case ':':
if (!DoLeftParenNoCapture()) {
// DoLeftParenNoCapture's failure set status_.
return false;
}
done = true;
break;
// Finish flags.
case ')':
done = true;
break;
}
}
if (negated && !sawflags)
goto BadPerlOp;
flags_ = static_cast<Regexp::ParseFlags>(nflags);
*s = t;
return true;
BadPerlOp:
status_->set_code(kRegexpBadPerlOp);
status_->set_error_arg(StringPiece(s->begin(), t.begin() - s->begin()));
return false;
}
// Converts latin1 (assumed to be encoded as Latin1 bytes)
// into UTF8 encoding in string.
// Can't use EncodingUtils::EncodeLatin1AsUTF8 because it is
// deprecated and because it rejects code points 0x80-0x9F.
void ConvertLatin1ToUTF8(const StringPiece& latin1, string* utf) {
char buf[UTFmax];
utf->clear();
for (int i = 0; i < latin1.size(); i++) {
Rune r = latin1[i] & 0xFF;
int n = runetochar(buf, &r);
utf->append(buf, n);
}
}
// Parses the regular expression given by s,
// returning the corresponding Regexp tree.
// The caller must Decref the return value when done with it.
// Returns NULL on error.
Regexp* Regexp::Parse(const StringPiece& s, ParseFlags global_flags,
RegexpStatus* status) {
// Make status non-NULL (easier on everyone else).
RegexpStatus xstatus;
if (status == NULL)
status = &xstatus;
ParseState ps(global_flags, s, status);
StringPiece t = s;
// Convert regexp to UTF-8 (easier on the rest of the parser).
if (global_flags & Latin1) {
string* tmp = new string;
ConvertLatin1ToUTF8(t, tmp);
status->set_tmp(tmp);
t = *tmp;
}
if (global_flags & Literal) {
// Special parse loop for literal string.
while (t.size() > 0) {
Rune r;
if (StringPieceToRune(&r, &t, status) < 0)
return NULL;
if (!ps.PushLiteral(r))
return NULL;
}
return ps.DoFinish();
}
StringPiece lastunary = NULL;
while (t.size() > 0) {
StringPiece isunary = NULL;
switch (t[0]) {
default: {
Rune r;
if (StringPieceToRune(&r, &t, status) < 0)
return NULL;
if (!ps.PushLiteral(r))
return NULL;
break;
}
case '(':
// "(?" introduces Perl escape.
if ((ps.flags() & PerlX) && (t.size() >= 2 && t[1] == '?')) {
// Flag changes and non-capturing groups.
if (!ps.ParsePerlFlags(&t))
return NULL;
break;
}
if (ps.flags() & NeverCapture) {
if (!ps.DoLeftParenNoCapture())
return NULL;
} else {
if (!ps.DoLeftParen(NULL))
return NULL;
}
t.remove_prefix(1); // '('
break;
case '|':
if (!ps.DoVerticalBar())
return NULL;
t.remove_prefix(1); // '|'
break;
case ')':
if (!ps.DoRightParen())
return NULL;
t.remove_prefix(1); // ')'
break;
case '^': // Beginning of line.
if (!ps.PushCarat())
return NULL;
t.remove_prefix(1); // '^'
break;
case '$': // End of line.
if (!ps.PushDollar())
return NULL;
t.remove_prefix(1); // '$'
break;
case '.': // Any character (possibly except newline).
if (!ps.PushDot())
return NULL;
t.remove_prefix(1); // '.'
break;
case '[': { // Character class.
Regexp* re;
if (!ps.ParseCharClass(&t, &re, status))
return NULL;
if (!ps.PushRegexp(re))
return NULL;
break;
}
case '*': { // Zero or more.
RegexpOp op;
op = kRegexpStar;
goto Rep;
case '+': // One or more.
op = kRegexpPlus;
goto Rep;
case '?': // Zero or one.
op = kRegexpQuest;
goto Rep;
Rep:
StringPiece opstr = t;
bool nongreedy = false;
t.remove_prefix(1); // '*' or '+' or '?'
if (ps.flags() & PerlX) {
if (t.size() > 0 && t[0] == '?') {
nongreedy = true;
t.remove_prefix(1); // '?'
}
if (lastunary.size() > 0) {
// In Perl it is not allowed to stack repetition operators:
// a** is a syntax error, not a double-star.
// (and a++ means something else entirely, which we don't support!)
status->set_code(kRegexpRepeatOp);
status->set_error_arg(StringPiece(lastunary.begin(),
t.begin() - lastunary.begin()));
return NULL;
}
}
opstr.set(opstr.data(), t.data() - opstr.data());
if (!ps.PushRepeatOp(op, opstr, nongreedy))
return NULL;
isunary = opstr;
break;
}
case '{': { // Counted repetition.
int lo, hi;
StringPiece opstr = t;
if (!MaybeParseRepetition(&t, &lo, &hi)) {
// Treat like a literal.
if (!ps.PushLiteral('{'))
return NULL;
t.remove_prefix(1); // '{'
break;
}
bool nongreedy = false;
if (ps.flags() & PerlX) {
if (t.size() > 0 && t[0] == '?') {
nongreedy = true;
t.remove_prefix(1); // '?'
}
if (lastunary.size() > 0) {
// Not allowed to stack repetition operators.
status->set_code(kRegexpRepeatOp);
status->set_error_arg(StringPiece(lastunary.begin(),
t.begin() - lastunary.begin()));
return NULL;
}
}
opstr.set(opstr.data(), t.data() - opstr.data());
if (!ps.PushRepetition(lo, hi, opstr, nongreedy))
return NULL;
isunary = opstr;
break;
}
case '\\': { // Escaped character or Perl sequence.
// \b and \B: word boundary or not
if ((ps.flags() & Regexp::PerlB) &&
t.size() >= 2 && (t[1] == 'b' || t[1] == 'B')) {
if (!ps.PushWordBoundary(t[1] == 'b'))
return NULL;
t.remove_prefix(2); // '\\', 'b'
break;
}
if ((ps.flags() & Regexp::PerlX) && t.size() >= 2) {
if (t[1] == 'A') {
if (!ps.PushSimpleOp(kRegexpBeginText))
return NULL;
t.remove_prefix(2); // '\\', 'A'
break;
}
if (t[1] == 'z') {
if (!ps.PushSimpleOp(kRegexpEndText))
return NULL;
t.remove_prefix(2); // '\\', 'z'
break;
}
// Do not recognize \Z, because this library can't
// implement the exact Perl/PCRE semantics.
// (This library treats "(?-m)$" as \z, even though
// in Perl and PCRE it is equivalent to \Z.)
if (t[1] == 'C') { // \C: any byte [sic]
if (!ps.PushSimpleOp(kRegexpAnyByte))
return NULL;
t.remove_prefix(2); // '\\', 'C'
break;
}
if (t[1] == 'Q') { // \Q ... \E: the ... is always literals
t.remove_prefix(2); // '\\', 'Q'
while (t.size() > 0) {
if (t.size() >= 2 && t[0] == '\\' && t[1] == 'E') {
t.remove_prefix(2); // '\\', 'E'
break;
}
Rune r;
if (StringPieceToRune(&r, &t, status) < 0)
return NULL;
if (!ps.PushLiteral(r))
return NULL;
}
break;
}
}
if (t.size() >= 2 && (t[1] == 'p' || t[1] == 'P')) {
Regexp* re = new Regexp(kRegexpCharClass, ps.flags() & ~FoldCase);
re->ccb_ = new CharClassBuilder;
switch (ParseUnicodeGroup(&t, ps.flags(), re->ccb_, status)) {
case kParseOk:
if (!ps.PushRegexp(re))
return NULL;
goto Break2;
case kParseError:
re->Decref();
return NULL;
case kParseNothing:
re->Decref();
break;
}
}
const UGroup *g = MaybeParsePerlCCEscape(&t, ps.flags());
if (g != NULL) {
Regexp* re = new Regexp(kRegexpCharClass, ps.flags() & ~FoldCase);
re->ccb_ = new CharClassBuilder;
AddUGroup(re->ccb_, g, g->sign, ps.flags());
if (!ps.PushRegexp(re))
return NULL;
break;
}
Rune r;
if (!ParseEscape(&t, &r, status, ps.rune_max()))
return NULL;
if (!ps.PushLiteral(r))
return NULL;
break;
}
}
Break2:
lastunary = isunary;
}
return ps.DoFinish();
}
} // namespace re2
| [
"rsc@swtch.com"
] | rsc@swtch.com |
eefe813abfd3905fe8bd80e3f30f057676f1684f | b9473b59a68d850896358925f29c9297405e2afc | /inversion_pairs_count.cpp | eef7673153dbfb02713c96767dd2a3f12261fa3c | [] | no_license | blitzup/Data_Structures | e060e76153826355f4b4702c51d4c29ca37bba09 | 9e80156b13e8a8c191cbb1a286b897632aa70a4b | refs/heads/main | 2023-07-18T20:46:47.821648 | 2021-09-24T12:21:23 | 2021-09-24T12:21:23 | 318,102,198 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,575 | cpp | // while dividing the array with odd length make sure that
// the left side length is smaller than equal to the right side
//check whether above statement true.
#include <bits/stdc++.h>
using namespace std;
long long int merge_arrays(long long int arr[], long long int lb, long long int mid, long long int ub)
{
long long int i = lb, j = mid + 1, count = 0, b[ub + 1], k = 0;
while (i <= mid && j <= ub)
{
if (arr[i] > arr[j])
count += mid - i + 1, b[k++] = arr[j++];
else
b[k++] = arr[i++];
}
while (i <= mid)
b[k++] = arr[i++];
while (j <= ub)
b[k++] = arr[j++];
k = 0;
for (auto i = lb; i <= ub; i++)
arr[i] = b[k++];
return count;
}
long long int merge_sort(long long int arr[], long long int lb, long long int ub)
{
long long int count = 0, count1 = 0, count2 = 0;
if (lb < ub)
{
long long int mid = (lb + ub - 1) / 2;
count1 = merge_sort(arr, lb, mid);
count2 = merge_sort(arr, mid + 1, ub);
count = merge_arrays(arr, lb, mid, ub);
}
return count1 + count2 + count;
}
long long int inversionCount(long long arr[], long long N)
{
long long int count = merge_sort(arr, 0, N - 1);
return count;
}
int main()
{
int t;
cin >> t;
while (t--){
long long int n;
cin >> n;
long long int arr[n];
for(auto i=0; i<n; i++) cin >> arr[i];
long long int inversion_pairs = inversionCount(arr, n);
cout << inversion_pairs << endl;
}
return 0;
} | [
"8blitzup@gmail.com"
] | 8blitzup@gmail.com |
2b178fd8010423fb59e1eccd98bc08975aea71ee | 31ca23395ae0971c89ff633e0dc73ba83b02cd56 | /halcon-qt-demo/halconutil.h | 5cc4f713a5af0a3330d3f14f4b0d115937f777af | [] | no_license | jiangjianqing/qt-demo | d6286af37cade4282d645c52a97d0e3cf58fa858 | 7f1e00b8e155ee948643ae4f6fccbe5f5aae18cd | refs/heads/master | 2021-08-31T01:57:38.553353 | 2017-12-20T05:30:44 | 2017-12-20T05:30:44 | 103,135,402 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 524 | h | #ifndef HALCONUTIL_H
#define HALCONUTIL_H
#include "HalconCpp.h"
#include "../utils/msvc_compatible.h"
using namespace HalconCpp;
class HalconUtil
{
public:
HalconUtil();
////通过HImage获取图像高度和宽度以及数据指针
static int getCImageDataFromHImage(HImage * hImg,BYTE** ppImg,int* pnWidth,int* pnHeight,int* pnChannel);
//转化换为halcon中的图像对象
static HImage ImageData_to_HImage(unsigned char* pImg,int nWidth,int nHeight,int nChannel);
};
#endif // HALCONUTIL_H
| [
"cz_jjq@163.com"
] | cz_jjq@163.com |
e1cbbead77e163dfce1eb2712578e0c20961325c | feb27a8e88036b696948582dfcdf471d505988a9 | /main.cpp | 08763fe54e9b43861cad2cfda7ad14412cd81ee7 | [] | no_license | doseikwatia/qtandroidweatherapp | 9bb973104292f9dd9fc5e479f627c7b9ee19f2e2 | ee547f13f00a3c72e11517b4e560c714f242344c | refs/heads/master | 2020-08-23T16:27:26.042572 | 2014-08-23T09:34:36 | 2014-08-23T09:34:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | cpp | #include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "weatherservice.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
// engine.addImageProvider("Photo",ImageProvider);
qmlRegisterType<WeatherService>("WeatherService",1,0,"WeatherService");
qmlRegisterType<WeatherInfo>("WeatherService",1,0,"WeatherInfo");
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
return app.exec();
}
| [
"doseikwatia@gmail.com"
] | doseikwatia@gmail.com |
54c561cf801b3035f4760a8757bfc1430c25dd65 | e23341279d8f6b06e26c832220499d2cde454415 | /AVLTree_210609/AVLTree.h | bbd164175e0cf3c0a6d921146faf45e0d67a3094 | [] | no_license | Pluto0214/study | d1ccde61b6ae2ac81742d00947b0b7a3e2f75561 | b6f5d5a3ff36dbc3616a0c4f87661ea890841e9c | refs/heads/master | 2023-05-27T04:57:54.878157 | 2021-06-09T13:30:54 | 2021-06-09T13:30:54 | 287,317,381 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 5,614 | h | #pragma once
#include<assert.h>
template<class K,class V>
struct AVLTreeNode
{
AVLTreeNode<K, V>* _left;
AVLTreeNode<K, V>* _right;
AVLTreeNode<K, V>* _parent;//非必须,这个_parent就是为了记录回去的路径,如果没有这个,用栈进行记录也是可以的
int _bf;//平衡因子 非必须
pair<K, V> _kv;
AVLTreeNode(const pair<K, V> kv)
:_left(nullptr)
,_right(nullptr)
,_parent(nullptr)
,_bf(0)//刚创建的时候平衡因子是0
,_kv(kv)
{}
};
template<class K, class V>
struct AVLTree
{
typedef AVLTreeNode<K, V> Node;
public:
//插入
pair<Node*, bool>insert(const pair<K, V>& kv)
{
//如果这颗树为空
if (_root == nullptr)
{
_root = new Node(kv);
return make_pair(_root, true);
}
//开始找这个结点要插入的位置
Node* parent = nullptr;
Node* cur = _root;
while (cur)
{
if (cur->kv.first < kv.first)
{
parent = cur;
cur = cur->_right;
}
else if(cur->kv.first > kv.first)
{
parent = cur;
cur = cur->left;
}
else//说明已经有了,返回这个结点的位置,返回插入失败
{
return make_pair(cur, false);
}
}
//出了while循环,说明找到可以插入的位置了,接下来进行插入
cur = new Node(kv);
if (parent->kv.first < kv.first)
{
parent->_right = cur;
cur->_parent = parent;
}
else
{
parent->_left = cur;
cur->_parent = parent;
}
//接下来开始更新平衡因子
Node* newnode = cur;//要在while循环之前把cur保存一下,最后return的是这个新插入的结点cur,而下面的while循环中cur一直在向上动
while (parent)
{
if (parent->_right == cur)
{
parent->_bf++;
}
else
{
parent->_bf--;
}
//如果父亲的平衡因子是0,那就说明没有改变高度,不需要再向上更新了
if (parent->_bf == 0)
{
break;
}
//如果等于1或者-1的话,那就说明高度被改变了,需要继续向上更新
else if (abs(parent->_bf) == 1)
{
cur = parent;
parent = parent->_parent;
}
//如果为+-2的话,那就说明这棵树已经不平衡了,需要通过旋转的方式来让它平衡
else if (abs(parent->_bf) == 2)
{
//旋转
if (parent->_bf == -2)
{
if (cur->_bf = -1)
{
RotateR(parent);
}
else//cur->_bf == 1
{
RotateLR(parent);
}
}
else
{
if (cur->_bf == 1)
{
RotateL(parent);
}
else
{
RoatateRL(parent);
}
}
}
else
{
assert(false);
}
break;//旋转完之后树就已经平衡了,所以要跳出循环
}
return make_pair(newnode, true);
}
//左左 右单旋
void RotateR(Node* parent)
{
Node* subL = parent->_left;
Node* subLR = sub->right;
parent->_left = subLR;
if (subLR)//如果subLR存在的话
{
subLR->_parent = parent;
}
Node* parentParent = parent->_parent;
subL->_right = parent;
parent->_parent = subL;
if (parent == _root)
{
_root = subL;
subL->_parent = nullptr;
}
else
{
if (parentParent->_left == parent)
{
parentParent -> _left = subL;
subL->_parent = parentParent;
}
else
{
parentParent->_right = subL;
subL->_parent = parentParent;
}
}
//旋转完之后,更新一下parent和subL的平衡因子
subL->_bf = parent->_bf = 0;
}
//右右 左单旋
void RotateL(Node* parent)
{
Node* subR = parent->_right;
Node* subRL = subR->_left;
parent->_right = subRL;
if (subRL)
{
subRL->_parent = parent;
}
Node* parentParent = parent->_parent;
subR->_left = parent;
parent->_parent = subR;
if (parent == _root)
{
_root = subR;
_root->_parent = nullptr;
}
else
{
if (parentParent->_left == parent)
{
parentParent->_left = subR;
}
else
{
parentParent->_right = subR;
}
subR->_parent = parentParent;
}
//旋转完之后更新平衡因子
subR->_bf = parent->_bf = 0;
}
//左右 先左单旋再右单旋
void RotateLR(Node* parent)
{
Node* subL = parent->_left;
Node* subLR = subL->_right;
int bf = subLR->_bf;
RotateL(parent->_left);
RotateR(parent);
if (bf == 1) //说明subLR是右树插入
{
subL->_bf = -1;
parent->_bf = subLR->_bf = 0;
}
else if (bf == -1)//说明subLR是左树插入
{
parent->_bf = 1;
subL->_bf = subLR->_bf = 0;
}
else if(bf == 0) //说明subLR是新增结点
{
parent->_bf = subL->_bf = subLR->_bf = 0;
}
else
{
assert(false);
}
}
//右左 先右旋再左旋
void RotateRL(Node* parent)
{
Node* subR = parent->_right;
Node* subRL = subR->_left;
int bf = subRL->_bf;
RotateR(parent->_right);
RotateL(parent);
if (bf == -1)
{
subR->_bf = 1;
parent->_bf = subRL->_bf = 0;
}
else if (bf == 1)
{
parent->_bf = -1;
subR->_bf = subRL->_bf = 0;
}
else if (bf == 0)
{
parent->_bf = subR->_bf = subRL->_bf = 0;
}
else
{
assert(false);
}
}
int Height(Node* root)
{
if (root == nullptr)
{
return 0;
}
return max(Height(root->left), Height(root->right)) + 1;
}
bool _isBalance(Node* root)
{
if (root == nullptr)
{
return true;
}
int LeftHeight = Height(root->_left);
int RightHeight = Height(root->_right);
if (rightHeight - leftHeight != root->_bf)
{
cout << "平衡因子异常:" << root->_kv.first << endl;
}
return abs(leftHeight - rightHeight) < 2
&& _IsBalance(root->_left)
&& _IsBalance(root->_right);
}
bool isBalance()
{
return _isBalance(_root);
}
private:
Node* _root ;
}; | [
"815636627@qq.com"
] | 815636627@qq.com |
2b9d06d313419607135012e764cd0954b7c2ec81 | 6c3c18a201e121e17bdc6cc896c5f576d4a32062 | /test/vitrul1.cpp | bd1e4651572c5f28f272b88b353940e36130f4c1 | [] | no_license | BArlowwang/test | 0aa9d3aa0f855709f971c12c4abc45b737c22b9f | d2d553d9c555d42092e949df0d1525e27b1d789f | refs/heads/master | 2021-09-21T03:30:39.487494 | 2018-08-20T14:48:48 | 2018-08-20T14:48:48 | 107,693,015 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 364 | cpp | #include <iostream>
using namespace std;
class pos{
public:
pos(){};
~pos(){};
int x,y;
};
class Shape {
public:
Shape(){};
virtual ~Shape();
virtual void render();
void move(const pos&){};
virtual void resize();
protected:
pos center;
};
int main()
{
pos p;
Shape s;
cout<<sizeof(p)<<endl;
cout<<sizeof(s)<<endl;
return 0;
}
| [
"Barlowwang@users.noreply.github.com"
] | Barlowwang@users.noreply.github.com |
8771bb3141632eaed5e1c3e746c1fae17e9325ca | 8560b2fd31a45ee9bb05dfdf91289ecd631d5f49 | /DDR/Source.cpp | 9584cecc943b63ddf0c4a0f1ebc8281a3148e379 | [] | no_license | JaxonStout/Hackathon | 63f4e503ce384b2d8aa888cb0176cf48d2394ed2 | f217977762c99973b6cb16c1cb0593ecd848e13b | refs/heads/master | 2020-03-09T04:03:52.241500 | 2018-04-07T23:56:54 | 2018-04-07T23:56:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 265 | cpp | #include <iostream>
#include<windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
using namespace std;
int main()
{
PlaySound(TEXT("C:\\Users\\acurt\\OneDrive\\source\\DDR\\rick.wav"), NULL, SND_FILENAME | SND_ASYNC);
system("pause");
return 0;
} | [
"acurtis@carthage.edu"
] | acurtis@carthage.edu |
af4a3441b14551381e0c3b95f676fa1295f8989b | a4b723f7f6988b52f6ca51a000829580e943e536 | /Hmwrk/CodeE_Assignment_3/Gaddis_9th_Ch4_Prob14_Race/main.cpp | 36d4cf9521847e61f48918387e0842f789929167 | [] | no_license | KevinShih88/CIS5Winter2021 | 338691fb69312b5bf70f162901b1e221722c9fbe | 681f247bec8a436c37b8e88b915d496f29079f5b | refs/heads/master | 2023-02-24T08:00:28.660086 | 2021-01-25T21:50:49 | 2021-01-25T21:50:49 | 332,113,925 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,848 | cpp | /*
* File: main.cpp
* Author: Kevin Shih
* Created on January 17, 2021, 1935 hours
* Purpose: Gaddis_9th_ch4_Prob14_Race
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversions/Higher Dimensions - i.e. PI, e, etc...
//Function Prototypes
//Execution Begins Here!
int main(int argc, char** argv) {
//Set the random number seed
//Declare Variables
string rn1name, //name of runner 1
rn2name, //name of runner 2
rn3name, //name of runner 3
post1nm, //holder for first place name
post2nm, //holder for second place name
post3nm; //holder for third place name
unsigned short int rn1time, //runner 1 time
rn2time, //runner 2 time
rn3time, //runner 3 time
post1tm, //holder for first place time
post2tm, //holder for second place time
post3tm; //holder for third place time
//Initialize or input i.e. set variable values
cout << "Race Ranking Program" << endl;
cout << "Input 3 Runners" << endl;
cout << "Their names, then their times" << endl;
cin >> rn1name; //input name of runner 1
cin >> rn1time; //input time of runner 1
cin >> rn2name; //input name of runner 2
cin >> rn2time; //input time of runner 2
cin >> rn3name; //input name of runner 3
cin >> rn3time; //input time of runner 3
//Map inputs -> outputs
if((rn1time < rn2time) && (rn1time < rn3time)) //Determine position for runner 1
{
post1tm = rn1time;
post1nm = rn1name;
}
else if((rn1time < rn2time) && (rn3time < rn1time))
{
post2tm = rn1time;
post2nm = rn1name;
}
else if((rn1time > rn2time) && (rn3time > rn1time))
{
post2tm = rn1time;
post2nm = rn1name;
}
else
{
post3tm = rn1time;
post3nm = rn1name;
}
if((rn2time < rn1time) && (rn2time < rn3time)) //Determine position for runner 2
{
post1tm = rn2time;
post1nm = rn2name;
}
else if((rn2time < rn1time) && (rn3time < rn2time))
{
post2tm = rn2time;
post2nm = rn2name;
}
else if((rn2time > rn1time) && (rn3time > rn2time))
{
post2tm = rn2time;
post2nm = rn2name;
}
else
{
post3tm = rn2time;
post3nm = rn2name;
}
if((rn3time < rn2time) && (rn3time < rn1time)) //Determine position for runner 3
{
post1tm = rn3time;
post1nm = rn3name;
}
else if((rn3time < rn2time) && (rn1time < rn3time))
{
post2tm = rn3time;
post2nm = rn3name;
}
else if((rn3time > rn2time) && (rn1time > rn3time))
{
post2tm = rn3time;
post2nm = rn3name;
}
else
{
post3tm = rn3time;
post3nm = rn3name;
}
//Display the outputs
cout << post1nm << "\t" << setw(3) << post1tm << endl;
cout << post2nm << "\t" << setw(3) << post2tm <<endl;
cout << post3nm << "\t" << setw(3) << post3tm;
//Exit stage right or left!
return 0;
} | [
"kshih1@student.rccd.edu"
] | kshih1@student.rccd.edu |
f22f3c7ab1363183e4724f7070fe46cb4a491ea9 | 3c25475e4bd5a634d7980e291ae02ae62ab6e74a | /Source/ThirdParty/embree/common/algorithms/parallel_any_of.h | 248d5c65d7d70056312f1e57ddde380a8fd4c664 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSL-1.0",
"BSD-3-Clause",
"BSD-2-Clause",
"Zlib",
"LicenseRef-scancode-khronos"
] | permissive | eugeneko/rbfx | e1c8b41861093b5df03f616cd614f4a73795b16b | 379641ebfeb63a2ceba901eb06be4309d3973272 | refs/heads/master | 2023-03-19T05:06:32.714516 | 2022-09-26T12:14:05 | 2022-09-26T12:14:05 | 186,170,069 | 1 | 0 | MIT | 2019-05-11T18:45:46 | 2019-05-11T18:45:46 | null | UTF-8 | C++ | false | false | 1,178 | h | // Copyright 2009-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <functional>
#include "parallel_reduce.h"
namespace embree
{
template<typename Index, class UnaryPredicate>
__forceinline bool parallel_any_of (Index first, Index last, UnaryPredicate pred)
{
bool ret = false;
#if defined(TASKING_TBB)
tbb::parallel_for(tbb::blocked_range<size_t>{first, last}, [&ret,pred](const tbb::blocked_range<size_t>& r) {
if (tbb::task::self().is_cancelled()) return;
for (size_t i = r.begin(); i != r.end(); ++i) {
if (pred(i)) {
ret = true;
tbb::task::self().cancel_group_execution();
}
}
});
#else
ret = parallel_reduce (first, last, false,
[pred](const range<size_t>& r)->bool {
bool localret = false;
for (auto i=r.begin(); i<r.end(); ++i) {
localret |= pred(i);
}
return localret;
},
std::bit_or<bool>()
);
#endif
return ret;
}
} // end namespace
| [
"rokups@zoho.com"
] | rokups@zoho.com |
a08ac9ed8866b4aa0ee6637ddad05e638771ea46 | eddcd87c24939a0b9d35bfd52401a2ecd62c04de | /developing/yggdrasil/tools/dtl/include/update_iterator.h | 5ef374ed179af99ff8b76691ae82bf0697a5020a | [] | no_license | chinagdlex/yggdrasil | 121539b5f4d171598be2bb79d36f5d673ad11cb4 | 16f6192fd0011dc3f7c1a44f8d4d2a8ba9bc8520 | refs/heads/master | 2021-03-12T19:08:19.120204 | 2016-09-26T09:36:19 | 2016-09-26T09:36:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,601 | h | // -*- C++ -*-
/* Copyright � 2000
Michael Gradman and Corwin Joy
Permission to use, copy, modify, distribute and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that the above copyright notice appears in all copies and that both that
copyright notice and this permission notice appear in supporting documentation.
Corwin Joy and Michael Gradman make no representations about the suitability
of this software for any purpose.
It is provided "as is" without express or implied warranty.
*/
// abstraction for UPDATES
// nested class of DBView
// Initial: 9/8/2000 - MG
// Edited: 12/19/2000 - MG - added namespaces
#ifndef DTL_UPDATE_ITERATOR_H
#define DTL_UPDATE_ITERATOR_H
#include "DB_iterator.h"
#include "std_warn_off.h"
#include <string>
#include <vector>
#include "std_warn_on.h"
BEGIN_DTL_NAMESPACE
// abstraction for UPDATES
template<class DataObj, class ParamObj = DefaultParamObj<DataObj> >
class DB_update_iterator :
public DB_iterator_with_cols<DataObj, ParamObj>,
#ifndef __SGI_STL_PORT
public STD_::iterator<STD_::output_iterator_tag, DataObj, std::ptrdiff_t>
#else
// not sure why STLport not recognizing the standard iterator tag
// when used in algorithms like copy(_InputIter __first, _InputIter __last, _OutputIter __result)
// use STLport specific alternative
public STD_::forward_iterator<DataObj, std::ptrdiff_t>
#endif
{
#ifdef __GNUC__ // need to declare members used from base template
using DB_iterator<DataObj, ParamObj>::boundIOs;
using DB_iterator<DataObj, ParamObj>::bpa;
using DB_iterator<DataObj, ParamObj>::count;
using DB_iterator<DataObj, ParamObj>::io_handler;
using DB_iterator<DataObj, ParamObj>::lastCount;
using DB_iterator<DataObj, ParamObj>::pDBview;
using DB_iterator<DataObj, ParamObj>::pParambuf;
using DB_iterator<DataObj, ParamObj>::pRowbuf;
using DB_iterator<DataObj, ParamObj>::sqlQryType;
using DB_iterator<DataObj, ParamObj>::stmt;
#endif
private:
InsValWrap<DataObj> InsValidate;
bool validRowbuf; // was previous object valid?
// call this function to execute the update
// returns number of rows updated
// to perform another update, change the necessary data and parameter values
// and then make another call to ExecUpdate() to perform that update
// exception-safety questionable
int ExecUpdate()
{
if (!this->IsReady())
{
this->open();
}
if (this->bad())
{
DTL_THROW DBException(_TEXT("DBView::delete_iterator::ExecDelete()"),
_TEXT("iterator tested bad!"), NULL, NULL);
}
this->lastCount = 0;
int updatedRows = 0;
try
{
// must call InsValidate() here to fix bug with NULL's
// BoundIO columns get erased in this instance with open()
if (!InsValidate(this->boundIOs, *this->pRowbuf))
{
DTL_THROW DBException(_TEXT("DBView::update_iterator::ExecUpdate()"),
_TEXT("InsValidate() call failed on statement ") + this->stmt.GetQuery(), NULL, NULL);
}
validRowbuf = true;
// propagate STL strings to their strbufs for proper binding
// DO NOT EXECUTE THIS HERE
// It screws up previous validations.
// this->boundIOs.InsUserValidate();
this->boundIOs.PropagateToSQL(this->sqlQryType, this->stmt);
this->stmt.Execute();
this->boundIOs.PropagateToSQLAfterExec(this->sqlQryType, this->stmt);
}
catch (RootException &ex)
{
if (this->stmt.valid())
this->setstate(this->failbit);
else
this->setstate(this->badbit);
dtl_ios_base::MeansOfRecovery error_action =
io_handler(ex, *this, *(this->pRowbuf.get()), *this->pParambuf);
// what to do in case of REPERFORM_OPERATION???
switch (error_action)
{
case dtl_ios_base::THROW_EXCEPTION: throw;
case dtl_ios_base::SUPPRESS_ERROR: return (this->lastCount = 0);
}
}
// object becomes inconsistent if this line fails
try
{
updatedRows = this->stmt.RowCount();
}
catch (RootException &ex)
{
if (this->stmt.valid())
this->setstate(this->failbit);
else
this->setstate(this->badbit);
dtl_ios_base::MeansOfRecovery error_action =
io_handler(ex, *this, *(this->pRowbuf.get()), *this->pParambuf);
// what to do in case of REPERFORM_OPERATION???
switch (error_action)
{
case dtl_ios_base::THROW_EXCEPTION: throw;
case dtl_ios_base::SUPPRESS_ERROR: return (this->lastCount = 0);
}
}
// count member is *cumulative* number of rows updated so far
// do things this way in order to stay consistent with the other
// DB iterator classes
this->count += updatedRows;
this->clear();
return (this->lastCount = updatedRows);
}
public:
DB_update_iterator() : DB_iterator_with_cols<DataObj, ParamObj>(),
InsValidate(DefaultInsValidate<DataObj>()), validRowbuf(false)
{ }
DB_update_iterator(const DBView<DataObj, ParamObj> &view, bool bPrepare = true) :
DB_iterator_with_cols<DataObj, ParamObj>(view, UPDATE, bPrepare),
InsValidate(view.GetInsVal()), validRowbuf(false)
{ }
// copy constructor and assignment operator required for Assignable property
DB_update_iterator(const DB_update_iterator<DataObj, ParamObj> &up_it) :
DB_iterator_with_cols<DataObj, ParamObj>(up_it),
InsValidate(up_it.InsValidate), validRowbuf(up_it.validRowbuf)
{ }
// exception-safe swap()
void swap(DB_update_iterator<DataObj, ParamObj> &other)
{
DB_iterator_with_cols<DataObj, ParamObj>::swap(other);
STD_::swap(InsValidate, other.InsValidate);
STD_::swap(validRowbuf, other.validRowbuf);
}
// exception-safe assignment
DB_update_iterator<DataObj, ParamObj> &
operator=(const DB_update_iterator<DataObj, ParamObj> &other)
{
if (this != &other)
{
DB_update_iterator<DataObj, ParamObj> temp(other);
// Special performance case here for assignment to open iterator against same DBView
// Surprisingly, the code below is exception safe in the following sense
// As long as the hstmt is valid we should always be able to close an open cursor on
// it. If the iterator is not valid, then we do not lose anything by marking it as
// invalid & trying to rebuild it since we won't be able to perform any further operations
// against the invalid iterator anyway.
if (this->pDBview == other.pDBview && this->IsReady()) {
this->stmt.swap(temp.stmt); // move stmt to destination
swap(temp); // setup iterator
this->stmt.Reset(); // no-throw
}
else
swap(temp);
}
return *this;
}
// commit updates from this updater and clean up
virtual ~DB_update_iterator()
{ }
// return a proxy
// exception-safe
DB_update_iterator<DataObj, ParamObj> &
operator*()
{
return *this;
}
// proxy paradigm used to be able to perform InsValidate()
// on the rowbuf held by the iterator
// exception-safety dependent on GetRowbufPtr(), InsValidate(),
// and DataObj::operator=()
DB_update_iterator<DataObj, ParamObj> &
operator=(const DataObj &data)
{
CountedPtr<DataObj> pData = NULL;
try
{
pData = this->GetRowbufPtr();
//dtl_assign(data, *pData);
dtl_assign_t<DataObj> dtl_assign;
dtl_assign(data, *pData);
// if user specified a InsVal, apply it
if (!InsValidate(this->boundIOs, *pData))
{
validRowbuf = false;
if (this->stmt.valid())
this->setstate(this->failbit);
else
this->setstate(this->badbit);
throw DBException(_TEXT("DBView::update_iterator::operator=(const DataObj &)"),
_TEXT("InsValidate() failed on statement \"") +
this->stmt.GetQuery() + _TEXT("\"!"), NULL, NULL);
}
}
catch (RootException &ex)
{
dtl_ios_base::MeansOfRecovery error_action =
io_handler(ex, *this, *(this->pRowbuf.get()), *this->pParambuf);
// what to do for REPERFORM_OPERATION?
switch (error_action)
{
case dtl_ios_base::THROW_EXCEPTION: throw;
case dtl_ios_base::SUPPRESS_ERROR: return *this;
}
}
validRowbuf = true;
this->clear();
// commit on operator=()
ExecUpdate(); // ExecUpdate() will open() the iterator if necessary
return *this;
}
// execute the update for the referenced DataObj and preincrement
// IO handler logic is in ExecUpdate()
DB_update_iterator<DataObj, ParamObj> &operator++()
{
return *this;
}
// execute the update for the referenced DataObj and postincrement
inline DB_update_iterator<DataObj, ParamObj> operator++(int) //non-const return to allow output via old iterator
{
DB_update_iterator<DataObj, ParamObj> oldValue(*this);
++(*this);
return oldValue;
}
};
// builds the postfix clause for update of the fields listed in boundIOs
inline STD_::pair<tstring, STD_::vector<tstring> > PostfixForUpdate(const BoundIOs &boundIOs, tstring QuoteChar)
{
tstring postfix;
postfix.reserve(1024);
postfix += _TEXT("WHERE (");
STD_::vector<tstring> orderOfParams;
BoundIOs::const_iterator it = boundIOs.begin();
// First, check if its NULL
// note: do NOT add it to orderOfParams if null - no variable.
if ((*it).second.IsNull())
postfix += QuoteChar + (*it).first + QuoteChar + _TEXT(" IS NULL");
else
{
// Doubles cannot be compared exactly via equality, therefore, it's a bad
// idea to have them in a WHERE clause. Some databases such as MySQL are strict
// about this and will fail on SQL_DOUBLE or SQL_FLOAT comparisons.
// Here we try to do something sensible for these cases.
// Compare within an epsilon of accuracy.
if ((*it).second.GetTypeID() == C_DOUBLE || (*it).second.GetTypeID() == C_FLOAT)
postfix += _TEXT("ABS(") + QuoteChar + (*it).first + QuoteChar + _TEXT(" - (?)) <= ") +
_TEXT("ABS(") + QuoteChar + (*it).first + QuoteChar + _TEXT(")/1000000 ");
else
postfix += QuoteChar + (*it).first + QuoteChar + _TEXT(" = (?) ");
orderOfParams.push_back((*it).first);
}
it++;
while (it != boundIOs.end())
{
postfix += _TEXT(" AND ");
// First, check if its NULL
// note: do NOT add it to orderOfParams if null - no variable.
if ((*it).second.IsNull())
postfix += QuoteChar + (*it).first + QuoteChar + _TEXT(" IS NULL");
else
{
if ((*it).second.GetTypeID() == C_DOUBLE || (*it).second.GetTypeID() == C_FLOAT)
postfix += _TEXT("ABS(") + QuoteChar + (*it).first + QuoteChar + _TEXT(" - (?)) <= ") +
_TEXT("ABS(") + QuoteChar + (*it).first + QuoteChar + _TEXT(")/1000000 ");
else
postfix += QuoteChar + (*it).first + QuoteChar + _TEXT(" = (?) ");
orderOfParams.push_back((*it).first);
}
it++;
}
postfix += _TEXT(")");
return STD_::pair<tstring, STD_::vector<tstring> >(postfix, orderOfParams);
}
// builds the postfix clause for update of the fields listed in boundIOs
// (for static views, we must not attach quote chars as the field names may already be quoted in the view)
// (for dynamic views, we must attach quote chars to protect us from field names with spaces)
template<class DataObj> STD_::pair<tstring, STD_::vector<tstring> >
MakePostfixForUpdate(const BoundIOs &boundIOs, tstring DTL_DUMMY_PARAM_1, const DataObj * DTL_DUMMY_PARAM_2)
{
return PostfixForUpdate(boundIOs, _TEXT(""));
}
template<> inline STD_::pair<tstring, STD_::vector<tstring> >
MakePostfixForUpdate(const BoundIOs &boundIOs, tstring QuoteChar, const variant_row * DTL_DUMMY_PARAM_1)
{
return PostfixForUpdate(boundIOs, QuoteChar);
}
END_DTL_NAMESPACE
#endif
| [
"ffscbio@hotmail.com"
] | ffscbio@hotmail.com |
598b124272db2dedfecad1e1a62846dddc057c7e | 6ae031779bbfb728a58b09453a4e4298cd011f50 | /src/core/grabber/include/device_grabber.hpp | 696196ca916e3c125ba17ca94b3686a3791b30bd | [
"Unlicense"
] | permissive | d3v1anX/Karabiner-Elements | f8c6a957e26d3e60994bbd492170ba4c4a69943b | caf3cf1e6b6016b586ab5b012a1063342b721bdd | refs/heads/master | 2021-01-12T13:58:45.360773 | 2016-09-27T06:02:47 | 2016-09-27T06:02:47 | 69,258,072 | 0 | 0 | null | 2016-09-26T14:26:32 | 2016-09-26T14:22:53 | C++ | UTF-8 | C++ | false | false | 11,264 | hpp | #pragma once
#include "apple_hid_usage_tables.hpp"
#include "constants.hpp"
#include "event_manipulator.hpp"
#include "human_interface_device.hpp"
#include "iokit_utility.hpp"
#include "logger.hpp"
#include "manipulator.hpp"
#include "types.hpp"
#include <IOKit/hid/IOHIDManager.h>
#include <thread>
#include <time.h>
class device_grabber final {
public:
device_grabber(const device_grabber&) = delete;
device_grabber(manipulator::event_manipulator& event_manipulator) : event_manipulator_(event_manipulator),
queue_(dispatch_queue_create(nullptr, nullptr)),
grab_timer_(0),
grabbed_(false) {
manager_ = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
if (!manager_) {
logger::get_logger().error("{0}: failed to IOHIDManagerCreate", __PRETTY_FUNCTION__);
return;
}
auto device_matching_dictionaries = iokit_utility::create_device_matching_dictionaries({
std::make_pair(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard),
// std::make_pair(kHIDPage_Consumer, kHIDUsage_Csmr_ConsumerControl),
// std::make_pair(kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse),
});
if (device_matching_dictionaries) {
IOHIDManagerSetDeviceMatchingMultiple(manager_, device_matching_dictionaries);
CFRelease(device_matching_dictionaries);
IOHIDManagerRegisterDeviceMatchingCallback(manager_, static_device_matching_callback, this);
IOHIDManagerRegisterDeviceRemovalCallback(manager_, static_device_removal_callback, this);
IOHIDManagerScheduleWithRunLoop(manager_, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
}
}
~device_grabber(void) {
cancel_grab_timer();
if (manager_) {
IOHIDManagerUnscheduleFromRunLoop(manager_, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
CFRelease(manager_);
manager_ = nullptr;
}
dispatch_release(queue_);
}
void grab_devices(void) {
auto __block last_warning_message_time = ::time(nullptr) - 1;
cancel_grab_timer();
// ----------------------------------------
// setup grab_timer_
std::lock_guard<std::mutex> guard(grab_timer_mutex_);
grab_timer_ = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue_);
dispatch_source_set_timer(grab_timer_, dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), 0.1 * NSEC_PER_SEC, 0);
dispatch_source_set_event_handler(grab_timer_, ^{
if (grabbed_) {
return;
}
std::string warning_message;
if (!event_manipulator_.is_ready()) {
warning_message = "event_manipulator_ is not ready. Please wait for a while.";
}
if (auto product_name = get_key_pressed_device_product_name()) {
warning_message = std::string("There are pressed down keys in ") + *product_name + ". Please release them.";
}
if (!warning_message.empty()) {
auto time = ::time(nullptr);
if (last_warning_message_time != time) {
last_warning_message_time = time;
logger::get_logger().warn(warning_message);
}
return;
}
// ----------------------------------------
// grab devices
grabbed_ = true;
{
std::lock_guard<std::mutex> hids_guard(hids_mutex_);
for (auto&& it : hids_) {
unobserve(*(it.second));
grab(*(it.second));
}
}
event_manipulator_.reset();
event_manipulator_.grab_mouse_events();
logger::get_logger().info("devices are grabbed");
cancel_grab_timer();
});
dispatch_resume(grab_timer_);
}
void ungrab_devices(void) {
if (!grabbed_) {
return;
}
grabbed_ = false;
cancel_grab_timer();
{
std::lock_guard<std::mutex> guard(hids_mutex_);
for (auto&& it : hids_) {
ungrab(*(it.second));
observe(*(it.second));
}
}
event_manipulator_.ungrab_mouse_events();
event_manipulator_.reset();
logger::get_logger().info("devices are ungrabbed");
}
void set_caps_lock_led_state(krbn::led_state state) {
std::lock_guard<std::mutex> guard(hids_mutex_);
for (const auto& it : hids_) {
(it.second)->set_caps_lock_led_state(state);
}
}
private:
static void static_device_matching_callback(void* _Nullable context, IOReturn result, void* _Nullable sender, IOHIDDeviceRef _Nonnull device) {
if (result != kIOReturnSuccess) {
return;
}
auto self = static_cast<device_grabber*>(context);
if (!self) {
return;
}
self->device_matching_callback(device);
}
void device_matching_callback(IOHIDDeviceRef _Nonnull device) {
if (!device) {
return;
}
if (!is_target_device(device)) {
return;
}
auto dev = std::make_unique<human_interface_device>(logger::get_logger(), device);
logger::get_logger().info("matching device:");
if (auto manufacturer = dev->get_manufacturer()) {
logger::get_logger().info(" manufacturer: {0}", *manufacturer);
}
if (auto product = dev->get_product()) {
logger::get_logger().info(" product: {0}", *product);
}
if (auto vendor_id = dev->get_vendor_id()) {
logger::get_logger().info(" vendor_id: {0}", *vendor_id);
}
if (auto product_id = dev->get_product_id()) {
logger::get_logger().info(" product_id: {0}", *product_id);
}
if (auto location_id = dev->get_location_id()) {
logger::get_logger().info(" location_id: {0}", *location_id);
}
if (auto serial_number = dev->get_serial_number()) {
logger::get_logger().info(" serial_number: {0}", *serial_number);
}
logger::get_logger().info(" registry_entry_id: {0}", dev->get_registry_entry_id());
// ----------------------------------------
if (grabbed_) {
grab(*dev);
} else {
observe(*dev);
}
{
std::lock_guard<std::mutex> guard(hids_mutex_);
hids_[device] = std::move(dev);
}
}
static void static_device_removal_callback(void* _Nullable context, IOReturn result, void* _Nullable sender, IOHIDDeviceRef _Nonnull device) {
if (result != kIOReturnSuccess) {
return;
}
auto self = static_cast<device_grabber*>(context);
if (!self) {
return;
}
self->device_removal_callback(device);
}
void device_removal_callback(IOHIDDeviceRef _Nonnull device) {
if (!device) {
return;
}
if (!is_target_device(device)) {
return;
}
{
std::lock_guard<std::mutex> guard(hids_mutex_);
auto it = hids_.find(device);
if (it != hids_.end()) {
auto& dev = it->second;
if (dev) {
logger::get_logger().info("removal device:");
if (auto vendor_id = dev->get_vendor_id()) {
logger::get_logger().info(" vendor_id: {0}", *vendor_id);
}
if (auto product_id = dev->get_product_id()) {
logger::get_logger().info(" product_id: {0}", *product_id);
}
if (auto location_id = dev->get_location_id()) {
logger::get_logger().info(" location_id: {0}", *location_id);
}
hids_.erase(it);
}
}
}
event_manipulator_.stop_key_repeat();
}
bool is_target_device(IOHIDDeviceRef _Nonnull device) {
// Skip devices which have keyboard and mouse usage.
if (IOHIDDeviceConformsTo(device, kHIDPage_GenericDesktop, kHIDUsage_GD_Pointer) ||
IOHIDDeviceConformsTo(device, kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse)) {
return false;
}
return true;
}
void observe(human_interface_device& hid) {
human_interface_device::value_callback callback;
hid.observe(callback);
}
void unobserve(human_interface_device& hid) {
hid.unobserve();
}
void grab(human_interface_device& hid) {
auto manufacturer = hid.get_manufacturer();
if (manufacturer && *manufacturer == "pqrs.org") {
return;
}
// seize device
hid.grab(std::bind(&device_grabber::value_callback,
this,
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3,
std::placeholders::_4,
std::placeholders::_5,
std::placeholders::_6));
// set keyboard led
event_manipulator_.refresh_caps_lock_led();
}
void ungrab(human_interface_device& hid) {
auto manufacturer = hid.get_manufacturer();
if (manufacturer && *manufacturer == "pqrs.org") {
return;
}
hid.ungrab();
}
void value_callback(human_interface_device& device,
IOHIDValueRef _Nonnull value,
IOHIDElementRef _Nonnull element,
uint32_t usage_page,
uint32_t usage,
CFIndex integer_value) {
if (!grabbed_) {
return;
}
auto device_registry_entry_id = manipulator::device_registry_entry_id(device.get_registry_entry_id());
switch (usage_page) {
case kHIDPage_KeyboardOrKeypad:
if (kHIDUsage_KeyboardErrorUndefined < usage && usage < kHIDUsage_Keyboard_Reserved) {
bool pressed = integer_value;
event_manipulator_.handle_keyboard_event(device_registry_entry_id, krbn::key_code(usage), pressed);
}
break;
case kHIDPage_AppleVendorTopCase:
if (usage == kHIDUsage_AV_TopCase_KeyboardFn) {
bool pressed = integer_value;
event_manipulator_.handle_keyboard_event(device_registry_entry_id, krbn::key_code::vk_fn_modifier, pressed);
}
break;
default:
break;
}
// reset modifier_flags state if all keys are released.
if (get_all_devices_pressed_keys_count() == 0) {
event_manipulator_.reset_modifier_flag_state();
}
}
boost::optional<std::string> get_key_pressed_device_product_name(void) {
std::lock_guard<std::mutex> guard(hids_mutex_);
for (const auto& it : hids_) {
if ((it.second)->get_pressed_keys_count() > 0) {
if (auto product = (it.second)->get_product()) {
return *product;
} else {
return std::string("(no product name)");
}
}
}
return boost::none;
}
size_t get_all_devices_pressed_keys_count(void) {
std::lock_guard<std::mutex> guard(hids_mutex_);
size_t total = 0;
for (const auto& it : hids_) {
total += (it.second)->get_pressed_keys_count();
}
return total;
}
void cancel_grab_timer(void) {
std::lock_guard<std::mutex> guard(grab_timer_mutex_);
if (grab_timer_) {
dispatch_source_cancel(grab_timer_);
dispatch_release(grab_timer_);
grab_timer_ = 0;
}
}
manipulator::event_manipulator& event_manipulator_;
IOHIDManagerRef _Nullable manager_;
std::unordered_map<IOHIDDeviceRef, std::unique_ptr<human_interface_device>> hids_;
std::mutex hids_mutex_;
dispatch_queue_t _Nonnull queue_;
dispatch_source_t _Nullable grab_timer_;
std::mutex grab_timer_mutex_;
std::atomic<bool> grabbed_;
};
| [
"tekezo@pqrs.org"
] | tekezo@pqrs.org |
1ea1729e550e147cb31487ddf4d7d831e20f84f7 | e07e25bc29baf02b56f7397f7a174cbc2cfc5b6d | /src/cpp/array-to-bst/bst.cpp | a9576def73e69c0a88f46b0691dd2f8a205468f8 | [] | no_license | ANARCYPHER/coding-interview-solutions | a12848be333457725a45fe723551723776ef1d8f | 68452ab2bf7de438c3e4986dcd44502b1c0b69f6 | refs/heads/master | 2023-02-08T09:58:00.174509 | 2019-08-29T19:16:39 | 2019-08-29T19:16:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,107 | cpp | /*
* Construct a BST from a sorted array.
*
* Time complexity: O(N), where N is the number of nodes.
*
* Explanation: think about binary search. The principle of a binary search is
* to visualize an array as a BST. The secret is to get the middle element and
* insert as a root. Then, the middle element of the right part is the root of
* the right subtree and the middle element of the left part is the root of the
* left subtree.
*/
#include <iostream>
#include <queue>
#include "bst.h"
using namespace std;
TreeNode* _arrayToBst(vector<int> &a, int s, int e) {
if (s > e) return NULL;
int middle = (s + e) / 2;
TreeNode *n = new TreeNode(a[middle]);
n->left = _arrayToBst(a, s, middle - 1);
n->right = _arrayToBst(a, middle + 1, e);
return n;
}
TreeNode* arrayToBst(vector<int> &a) {
if (a.size() == 0) return NULL;
TreeNode *root = _arrayToBst(a, 0, a.size() - 1);
return root;
}
void insert(TreeNode **root, int val) {
if (*root == NULL) {
TreeNode *n = new TreeNode(val);
*root = n;
}
else if (val <= (*root)->val) {
insert(&((*root)->left), val);
}
else {
insert(&((*root)->right), val);
}
}
TreeNode* search(TreeNode *root, int val) {
if (root == NULL) return NULL;
else if (root->val == val) return root;
else if (val <= root->val) return search(root->left, val);
else return search(root->right, val);
}
TreeNode* findMin(TreeNode *root) {
if (root->left == NULL) return root;
else return findMin(root->left);
}
TreeNode* findMax(TreeNode *root) {
if (root->right == NULL) return root;
else return findMin(root->right);
}
void remove(TreeNode **root, int val) {
if (*root == NULL) return;
else if (val < (*root)->val) remove(&((*root)->left), val);
else if (val > (*root)->val) remove(&((*root)->right), val);
else {
if ((*root)->left == NULL && (*root)->right == NULL) {
delete *root;
*root = NULL;
}
else if ((*root)->left == NULL) {
TreeNode *temp = *root;
*root = (*root)->right;
delete temp;
}
else if ((*root)->right == NULL) {
TreeNode *temp = *root;
*root = (*root)->left;
delete temp;
}
else {
TreeNode *min = findMin((*root)->right);
(*root)->val = min->val;
remove(&((*root)->right), min->val);
}
}
}
/*
* Level order means we print all the nodes in one level, than all the nodes
* in the following level and so on. To do that just use a queue.
*/
void levelorder(TreeNode *root) {
if (root == NULL) return;
queue<TreeNode *> q;
q.push(root);
while (!q.empty()) {
TreeNode *t = q.front();
cout << t->val << " ";
if (t->left != NULL) q.push(t->left);
if (t->right != NULL) q.push(t->right);
q.pop();
}
}
/*
* root, left, right.
*/
void preorder(TreeNode *root) {
if (root == NULL) return;
cout << root->val << " ";
preorder(root->left);
preorder(root->right);
}
/*
* left, root, right. The result of this traversal is the nodes in sorted order.
*/
void inorder(TreeNode *root) {
if (root == NULL) return;
inorder(root->left);
cout << root->val << " ";
inorder(root->right);
}
/*
* left, right, root.
*/
void postorder(TreeNode *root) {
if (root == NULL) return;
postorder(root->left);
postorder(root->right);
cout << root->val << " ";
}
/*
* The height of a tree is the longest path from the root to one of the leaves.
* Just traverse the tree and return max(left, right) + 1 for each call. Notice,
* an empty tree (root == NULL) has height equal -1 per definition.
*
* And remember that a path consist of edges, so the height of a node is the
* number of edges from this node to the most distant leaf.
*/
int findHeight(TreeNode *root) {
if (root == NULL) return -1;
int left = findHeight(root->left);
int right = findHeight(root->right);
return max(left, right) + 1;
}
int main () {
TreeNode *root = NULL;
// Test array to BST
vector<int> a = {3, 6, 7, 10, 13, 15, 20};
root = arrayToBst(a);
cout << "Level order traversal:" << endl;
levelorder(root);
cout << endl;
return 0;
} | [
"f.o.thome@gmail.com"
] | f.o.thome@gmail.com |
4b86d375e6e04fdda0a48c831269f5a34a7c680f | 2421b5aa8558275f0b9f18bebcbc2018b7baab0a | /NCTU PCCA/Day12/E.cpp | eb281b9c418152d2d09dfe85013917ac718b49d3 | [] | no_license | CoyoteLeo/Cpp | bb4b61a52d7257dd11c6f756dc808ceef1f2575c | 09faac221908f6c66aa3a8bc07462f861f7e0fd3 | refs/heads/master | 2020-03-21T05:29:21.962543 | 2018-06-19T16:00:00 | 2018-06-21T11:47:35 | 133,779,105 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,043 | cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int graph[maxn][maxn] = {0};
int ans[maxn][maxn] = {0};
int main() {
int t;
scanf(" %d", &t);
while (t--) {
memset(graph, 0, sizeof(graph));
memset(ans, 0, sizeof(ans));
int n, m = 0;
scanf(" %d", &n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
scanf("%d", &graph[i][j]);
ans[i][j] += graph[i][j];
int x = i, y = j, flag_a = 0, flag_b = 0;
while (--x > 0 && --y > 0) {
flag_a = 1;
ans[i][j] += graph[i][j];
}
x = i, y = j;
while (flag_a && (++x) <= n && --y > 0) {
flag_b = 1;
ans[i][j] += graph[i][j];
}
if (!flag_a || !flag_b)
ans[i][j] = 0;
m = max(m, ans[i][j]);
}
}
printf("%d\n", m);
}
} | [
"karta09104@gmail.com"
] | karta09104@gmail.com |
8dff23f9a52e127140e3f689581dee8efe15be04 | 979e9b78ced2eef15020ab264ed4ca161d2b872e | /CalendarFull/Solar.h | 7ee51e6b9d3f2871f5bb9582722982d386e4bdfe | [] | no_license | cloversnake16/LunarCalendar | aec3e6c4cf3b3e31e2456c76f18e7d75057325fe | 81d6a8adcd7024d89006f29b745d46304de0ae6e | refs/heads/master | 2020-12-02T11:34:45.489919 | 2017-07-09T02:03:18 | 2017-07-09T02:03:18 | 96,654,233 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 110 | h | #pragma once
ref class Solar
{
public:
Solar(void);
int solarDay;
int solarMonth;
int solarYear;
};
| [
"cloversnake16@gmail.com"
] | cloversnake16@gmail.com |
85148543cc15b598c7c00c6f26171f7f83b0d7c1 | 2fa764b33e15edd3b53175456f7df61a594f0bb5 | /appseed/aura/filesystem/file/file_plain_text_stream_base.h | 4533d5c49803969e38daf6c05c0ada5165a30a93 | [] | no_license | PeterAlfonsLoch/app | 5f6ac8f92d7f468bc99e0811537380fcbd828f65 | 268d0c7083d9be366529e4049adedc71d90e516e | refs/heads/master | 2021-01-01T17:44:15.914503 | 2017-07-23T16:58:08 | 2017-07-23T16:58:08 | 98,142,329 | 1 | 0 | null | 2017-07-24T02:44:10 | 2017-07-24T02:44:10 | null | UTF-8 | C++ | false | false | 304 | h | #pragma once
namespace file
{
class plain_text_ostream;
class plain_text_istream;
class CLASS_DECL_AURA plain_text_stream_base :
virtual public stream_base
{
public:
plain_text_stream_base();
virtual ~plain_text_stream_base();
};
} // namespace file
| [
"camilo@ca2.email"
] | camilo@ca2.email |
c9ada13533b4203c3267672270f824904d92d318 | 761d84982b702f640e166e0a34fa278d6aee6a2b | /src/ast/int_constant.h | a07998b08949740d36860831eab73b791c23129a | [] | no_license | nitnelave/hopper | 8eab7de965210dceb32eabf3efd5c924392a6efa | 2d71fe2c9944b9cc8bc29ef8c4b9e068e7a54881 | refs/heads/master | 2021-07-07T03:53:27.228349 | 2021-05-16T21:20:03 | 2021-05-16T21:20:03 | 91,878,231 | 2 | 0 | null | 2017-08-25T15:06:28 | 2017-05-20T09:16:20 | C++ | UTF-8 | C++ | false | false | 465 | h | #pragma once
#include "ast/value.h"
#include "visitor/visitor.h"
namespace ast {
class IntConstant : public Value {
public:
IntConstant(lexer::Range location, int64_t value)
: Value(std::move(location), NodeType::INT_CONSTANT), value_(value) {}
~IntConstant() override = default;
int64_t value() const { return value_; }
private:
void accept_impl(ASTVisitor& visitor) override { visitor.visit(this); }
int64_t value_;
};
} // namespace ast
| [
"nitnelave1@gmail.com"
] | nitnelave1@gmail.com |
e670376ad841b723d3acd0a8cc8d87ed8a019206 | a1d94400c26dae4135cce196c89a09eb2470c4c8 | /Graphics/Program 2/BasicObject.cpp | d7db17d582874bd0ced77d7c1f70fbcfcc33dd27 | [] | no_license | cesarcamarena/tntech | 2ed7b61c48b806a89c7a5d2cc3b04b158b889b06 | e23bc604c5a758e66635cf5423e02194803fd20c | refs/heads/main | 2023-08-28T15:30:18.747673 | 2021-10-25T20:45:33 | 2021-10-25T20:45:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,162 | cpp | #include "BasicObject.h"
using CSC1310::ListArrayIterator;
BasicObject::BasicObject()
{
vertices = new ListArray<Vertex>();
faces = new ListArray<Face>();
sze = 0;
}
BasicObject::~BasicObject()
{
//clean up all of the basic object heap-allocated memory
ListArrayIterator<Face>* faceIter = faces->iterator();
while (faceIter->hasNext())
{
Face* face = faceIter->next();
delete face;
}
ListArrayIterator<Vertex>* vertexIter = vertices->iterator();
while(vertexIter->hasNext())
{
Vertex* vertex = vertexIter->next();
delete vertex;
}
delete faceIter;
delete faces;
delete vertexIter;
delete vertices;
}
void BasicObject::addVertex(Vertex* vertex)
{
vertices->add(vertex);
}
void BasicObject::addFace(Face* face)
{
faces->add(sze + 1, face);
sze++;
}
Face* BasicObject::getFace(int index)
{
return faces->get(index);
}
void BasicObject::render(Pixel* px, Matrix* transform)
{
ListArrayIterator<Face>* faceIter = faces->iterator();
while (faceIter->hasNext())
{
Face* face = faceIter->next();
face->render(px, transform);
}
delete faceIter;
}
| [
"itscesarcamarena@gmail.com"
] | itscesarcamarena@gmail.com |
cd8e62221c03d318f5398997f2002b4b8fd603ed | 8f125761c6a6e29d0f59cd2c430fa19bd7d81176 | /5.cpp | 6db12e504304ea8dc35b1dabaa984523dccc9337 | [] | no_license | XinnaPan/leetcode_exercise | 99bd44bf50e72304cdc667c7d9a5980162ab7718 | 95cff52c31a07cc8c7a8719135be79d3263f3a30 | refs/heads/master | 2023-06-15T19:20:42.770003 | 2021-07-12T03:50:48 | 2021-07-12T03:50:48 | 336,504,637 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,029 | cpp | #include<iostream>
using namespace std;
class Solution
{
public:
string longestPalindrome(string s)
{
int res[2];
res[0] = 0;
res[1] = 0;
bool bp[1000][1000];
int len = 0;
for (int i = 0; i < s.length(); i++)
{
bp[i][i] = true;
int j = i + 1;
if (j < s.length())
bp[i][j] = (s[i] == s[j]);
}
for (int dex = 2; dex < s.length(); dex++)
{
for (int i = 0; i < s.length(); i++)
{
int j = i + dex;
if (j < s.length())
bp[i][j] = bp[i + 1][j - 1] & (s[i] == s[j]);
}
}
for (int i = 0; i < s.length(); i++)
{
for (int j = i; j < s.length(); j++)
{
if (bp[i][j])
{
if (len < j - i + 1)
{
res[0] = i;
res[1] = j;
len = j - i + 1;
}
}
}
}
string resS(s, res[0], len);
return resS;
}
};
int main()
{
Solution a;
string s = "cbbd";
cout << a.longestPalindrome(s) << endl;
return 0;
} | [
"996386736@qq.com"
] | 996386736@qq.com |
7a2fa5d197c825220e1ff1137418032376bb2438 | 10bd274a45bb0c75212673a8456fb82e108beec5 | /gpu01/src/AIScene.cpp | 9d622bba1bd106327792498c6039c48351103090 | [] | no_license | StephenJohnsonGames/TerrainProject | 46a01ab385500051b50428e7d9bb6cc3240a2654 | cebafb79b01790140bf22f96a61c414a3837d025 | refs/heads/main | 2023-03-25T22:45:14.453299 | 2021-03-21T11:02:35 | 2021-03-21T11:02:35 | 348,490,434 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 693 | cpp | #include <pch.h>
#include "AIScene.hpp"
#include "AIMesh.hpp"
using namespace std;
AIScene::AIScene(const string& filename, unsigned int flags) {
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile(filename, flags);
numMeshes = scene->mNumMeshes;
meshArray = (AIMesh**)malloc(numMeshes * sizeof(AIMesh*));
for (unsigned int i = 0; i < numMeshes; ++i) {
meshArray[i] = new AIMesh(scene, i);
}
}
void AIScene::render(void) {
for (unsigned int i = 0; i < numMeshes; ++i) {
meshArray[i]->render();
}
}
void AIScene::renderInstanced(GLsizei numInstances) {
for (unsigned int i = 0; i < numMeshes; ++i) {
meshArray[i]->renderInstanced(numInstances);
}
}
| [
"stephenjohnsongames@gmail.com"
] | stephenjohnsongames@gmail.com |
c094b6f97ee34743c24d5a1301c692fc1ee41b9a | bbeeea25abd526a9f5b42269071b9d95164d2cef | /test/ut-memory/cases.h | 9b9b2f7cc462c3da31190871386fa6d937d7a4f8 | [
"MIT"
] | permissive | JaredYeDH/capo | 51949d10a48a8502552f4ff325a393d6846ffed4 | 949355e8a9c018d30dc5a932b0fbeb2a70f3700a | refs/heads/master | 2020-04-05T11:16:11.651792 | 2018-10-23T08:29:29 | 2018-10-23T08:29:29 | 156,829,888 | 1 | 0 | null | 2018-11-09T08:05:25 | 2018-11-09T08:05:25 | null | UTF-8 | C++ | false | false | 1,210 | h | #pragma once
TEST_METHOD(alloc_malloc_case)
{
using namespace ut_memory_;
start<ut_memory_::alloc_malloc>();
}
TEST_METHOD(fixed_pool_case)
{
using namespace ut_memory_;
using namespace capo;
start<fixed_pool<TestSMax, use::arithmetic<>, ut_memory_::alloc_malloc>>();
start<fixed_pool<TestSMax, use::geometric<> , ut_memory_::alloc_malloc>>();
start<fixed_pool<TestSMax, use::fibonacci , ut_memory_::alloc_malloc>>();
start<fixed_pool<TestSMax, use::arithmetic<>, scope_alloc<ut_memory_::alloc_malloc>>>();
start<fixed_pool<TestSMax, use::geometric<> , scope_alloc<ut_memory_::alloc_malloc>>>();
start<fixed_pool<TestSMax, use::fibonacci , scope_alloc<ut_memory_::alloc_malloc>>>();
start<fixed_pool<TestSMax, use::arithmetic<>, scope_alloc<ut_memory_::alloc_malloc, use::block_normal>>>();
start<fixed_pool<TestSMax, use::geometric<> , scope_alloc<ut_memory_::alloc_malloc, use::block_normal>>>();
start<fixed_pool<TestSMax, use::fibonacci , scope_alloc<ut_memory_::alloc_malloc, use::block_normal>>>();
}
TEST_METHOD(variable_pool_case)
{
ut_memory_::start<capo::variable_pool<CAPO_VARIABLE_POOL_CHUNKSIZE_, ut_memory_::alloc_malloc>>();
}
| [
"mark.lonr@tom.com"
] | mark.lonr@tom.com |
5f4dca0d30994e189595506cb4c627a2a49750d4 | 481c41e813ab6892c6d04e7cd265105ce9566fac | /lib/include/DataItem.h | de51d245733bb61006b784febc61221d6108dbb5 | [] | no_license | arrian/2d-engine | 6cc6a76f48d53a04562f85b6b17ae7d8886ef064 | 40993e2b72660955020c290e480a03fe5ea62580 | refs/heads/master | 2016-09-08T01:55:44.097735 | 2014-11-17T13:57:58 | 2014-11-17T13:57:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 659 | h | #pragma once
#include "ShapeType.h"
#include "DataType.h"
struct DataItem
{
int id;
std::string name;
ShapeType::Type shapeType;
DataType::Type dataType;//the most detailed type that can be found
std::vector<std::string> resources;
DataItem()
: id(-1),
name("default"),
shapeType(),
dataType(DataType::NONE),
resources()
{
}
DataItem(int id, std::string name, ShapeType::Type shapeType, DataType::Type dataType, std::vector<std::string> resources)
: id(id),
name(name),
shapeType(shapeType),
dataType(dataType),
resources(resources)
{
}
}; | [
"arrian.purcell@gmail.com"
] | arrian.purcell@gmail.com |
5f8cb99b8149c0b4762b766be8124297dee22926 | c4eaa3e6cdca0ef6eea9487735369fb4d215949f | /2DAE07_Geers_Pieter_digdug/DigDugGame/EntitySpawn.cpp | d1575ee7e7fe1bf70dbe7f0f9ca7c06f24fd6f44 | [] | no_license | PieterGeers/DigDug | 483fc09f6425501aea7e690831517d695c56bea2 | b69e05ca025558a089d1d10bda1ee01677292a54 | refs/heads/master | 2022-02-26T02:42:53.016532 | 2019-10-31T15:37:02 | 2019-10-31T15:37:02 | 175,878,736 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,074 | cpp | #include "pch.h"
#include "EntitySpawn.h"
#include "TextureRenderComponent.h"
#include "Animator.h"
#include "QuadCollisionComponent.h"
#include "AgentComponent.h"
#include "DigDugCharacterComp.h"
#include "DigDugLivesComp.h"
#include "DigDugWeaponComp.h"
#include "FygarCharacterComp.h"
std::shared_ptr<GameObject> EntitySpawn::SpawnPlayer(MVector2_INT pos, const std::string& textPath,
int index, bool healthRight, MVector2_INT healthPos)
{
const std::shared_ptr<Animation> left = CreateAnimation("Left", 1, 0, 0, 1);
const std::shared_ptr<Animation> leftDig = CreateAnimation("LeftDig", 1, 2, 0, 1);
const std::shared_ptr<Animation> right = CreateAnimation("Right", 0, 0, 0, 1);
const std::shared_ptr<Animation> rightDig = CreateAnimation("RightDig", 0, 2, 0, 1);
const std::shared_ptr<Animation> rightUp = CreateAnimation("RightUp", 5, 0, 0, 1);
const std::shared_ptr<Animation> leftUp = CreateAnimation("LeftUp", 4, 0, 0, 1);
const std::shared_ptr<Animation> rightUpDig = CreateAnimation("RightUpDig", 5, 2, 0, 1);
const std::shared_ptr<Animation> leftUpDig = CreateAnimation("LeftUpDig", 4, 2, 0, 1);
const std::shared_ptr<Animation> rightDown = CreateAnimation("RightDown", 2, 0, 0, 1);
const std::shared_ptr<Animation> leftDown = CreateAnimation("LeftDown", 3, 0, 0, 1);
const std::shared_ptr<Animation> rightDownDig = CreateAnimation("RightDownDig", 2, 2, 0, 1);
const std::shared_ptr<Animation> leftDownDig = CreateAnimation("LeftDownDig", 3, 2, 0, 1);
const std::shared_ptr<Animation> death = CreateAnimation("Dead", 6, 0, 0, 6);
std::shared_ptr<GameObject> m_DigDug = std::make_shared<GameObject>();
std::shared_ptr<TextureRenderComponent> DigDugTexture = std::make_shared<TextureRenderComponent>(textPath, 7, 7, 2);
std::shared_ptr<DigDugCharacterComp> character = std::make_shared<DigDugCharacterComp>(Boundaries{ 32, 32 * 17,0,32 * 13 }, index);
std::shared_ptr<Animator> animator = std::make_shared<Animator>();
std::shared_ptr<QuadCollisionComponent> collision = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 32, "Player" + std::to_string(index));
std::shared_ptr<DigDugLivesComp> lives = std::make_shared<DigDugLivesComp>("P" + std::to_string(index) + "Live.png", 3,pos, healthPos, healthRight);
animator->AddAnimation(std::vector<std::shared_ptr<Animation>>{left, leftDig, right, rightDig, leftUp, rightUp, leftUpDig, rightUpDig, rightDown, leftDown, rightDownDig, leftDownDig, death});
DigDugTexture->SetSpritePosition(0, 0, 6, 6);
character->SetGridSize(32);
m_DigDug->AddComponent(DigDugTexture);
m_DigDug->AddComponent(character);
m_DigDug->AddComponent(animator);
m_DigDug->AddComponent(collision);
m_DigDug->AddComponent(lives);
std::shared_ptr<GameObject> Weapon = std::make_shared<GameObject>();
std::shared_ptr<DigDugWeaponComp> weaponComp = std::make_shared<DigDugWeaponComp>("digdug_attack.png", 2);
std::shared_ptr<QuadCollisionComponent> weaponColl = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 32, "AttackP" + std::to_string(index));
weaponColl->SetIsActive(false);
Weapon->AddComponent(weaponComp);
Weapon->AddComponent(weaponColl);
m_DigDug->AddChild("Weapon", Weapon);
m_DigDug->SetPosition(static_cast<float>(pos.x), static_cast<float>(pos.y), 0.0f);
ServiceLocator::RegisterPlayer(index, m_DigDug);
return m_DigDug;
}
std::shared_ptr<GameObject> EntitySpawn::SpawnPlayableFygar(MVector2_INT pos,const std::string& tag, int index, bool healthRight, MVector2_INT healthPos)
{
std::shared_ptr<GameObject> Fygar = std::make_shared<GameObject>();
const std::shared_ptr<Animation> walk = CreateAnimation("Walk", 1, 0, 0, 1);
const std::shared_ptr<Animation> invis = CreateAnimation("Invisible", 1, 3, 0, 1);
const std::shared_ptr<Animation> dead = CreateAnimation("Explode", 1, 5, 0, 3);
const std::shared_ptr<Animation> flat = CreateAnimation("Flat", 1, 9, 0, 0);
std::shared_ptr<TextureRenderComponent> PookaTexture = std::make_shared<TextureRenderComponent>("digdug_spriteEnemies.png", 2, 10, 2);
std::shared_ptr<FygarCharacterComp> character = std::make_shared<FygarCharacterComp>(Boundaries{ 32, 32 * 17,0,32 * 13 }, index);
std::shared_ptr<Animator> animator = std::make_shared<Animator>();
std::shared_ptr<QuadCollisionComponent> collision = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 32, tag);
std::shared_ptr<DigDugLivesComp> lives = std::make_shared<DigDugLivesComp>("FygarLive.png", 4, pos, healthPos, healthRight, false);
animator->AddAnimation(std::vector<std::shared_ptr<Animation>>{walk, invis, dead, flat});
character->SetGridSize(32);
Fygar->AddComponent(PookaTexture);
Fygar->AddComponent(character);
Fygar->AddComponent(animator);
Fygar->AddComponent(collision);
Fygar->AddComponent(lives);
animator->SetActiveAnimation("Walk");
const std::shared_ptr<Animation> aLeft = CreateAnimation("Left", 1, 0, 0, 2);
const std::shared_ptr<Animation> aRight = CreateAnimation("Right", 0, 0, 0, 2);
std::shared_ptr<GameObject> Weapon = std::make_shared<GameObject>();
std::shared_ptr<DigDugWeaponComp> weaponComp = std::make_shared<DigDugWeaponComp>("digdug_spriteFire.png", 2, 3, 2);
std::shared_ptr<Animator> weaponAnimator = std::make_shared<Animator>();
std::shared_ptr<QuadCollisionComponent> weaponColl = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 96,32, tag+"Weapon");
weaponAnimator->AddAnimation(std::vector<std::shared_ptr<Animation>>{aLeft, aRight});
weaponColl->SetIsActive(false);
Weapon->AddComponent(weaponComp);
Weapon->AddComponent(weaponAnimator);
Weapon->AddComponent(weaponColl);
Fygar->AddChild("EnemyWeapon", Weapon);
Fygar->SetPosition(static_cast<float>(pos.x), static_cast<float>(pos.y), 0.0f);
ServiceLocator::RegisterPlayer(index, Fygar);
return Fygar;
}
std::shared_ptr<GameObject> EntitySpawn::SpawnPooka(MVector2_INT pos, const std::string& tag)
{
std::shared_ptr<GameObject> pooka = std::make_shared<GameObject>();
const std::shared_ptr<Animation> walk = CreateAnimation("Walk", 0, 0, 0, 1);
const std::shared_ptr<Animation> invis = CreateAnimation("Invisible", 0, 2, 0, 1);
const std::shared_ptr<Animation> stage1 = CreateAnimation("Stage1", 0, 4, 0, 0);
const std::shared_ptr<Animation> stage2 = CreateAnimation("Stage2", 0, 5, 0, 0);
const std::shared_ptr<Animation> stage3 = CreateAnimation("Stage3", 0, 6, 0, 0);
const std::shared_ptr<Animation> dead = CreateAnimation("Explode", 0, 7, 0, 0);
const std::shared_ptr<Animation> flat = CreateAnimation("Flat", 0, 8, 0, 0);
std::shared_ptr<TextureRenderComponent> PookaTexture = std::make_shared<TextureRenderComponent>("digdug_spriteEnemies.png", 2, 10, 2);
std::shared_ptr<Animator> pookaAnimator = std::make_shared<Animator>();
std::shared_ptr<QuadCollisionComponent> pookaCollision = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 32, tag);
pookaAnimator->AddAnimation({ walk, invis, stage1, stage2, stage3, dead, flat });
pooka->AddComponent(PookaTexture);
pooka->AddComponent(pookaAnimator);
pooka->AddComponent(pookaCollision);
pooka->SetPosition(static_cast<float>(pos.x), static_cast<float>(pos.y), 0.0f);
pookaAnimator->SetActiveAnimation("Walk");
const std::shared_ptr<AgentComponent> agent = std::make_shared<AgentComponent>(4, 32, 14);
pooka->AddComponent(agent);
ServiceLocator::RegisterAgent(AgentComponent::GetCount(), pooka);
pooka->GetComponent<AgentComponent>()->Initialize();
return pooka;
}
std::shared_ptr<GameObject> EntitySpawn::SpawnFygar(MVector2_INT pos, const std::string& tag)
{
std::shared_ptr<GameObject> Fygar = std::make_shared<GameObject>();
const std::shared_ptr<Animation> walk = CreateAnimation("Walk", 1, 0, 0, 1);
const std::shared_ptr<Animation> invis = CreateAnimation("Invisible", 1, 3, 0, 1);
const std::shared_ptr<Animation> stage1 = CreateAnimation("Stage1", 1, 5, 0, 0);
const std::shared_ptr<Animation> stage2 = CreateAnimation("Stage2", 1, 6, 0, 0);
const std::shared_ptr<Animation> stage3 = CreateAnimation("Stage3", 1, 7, 0, 0);
const std::shared_ptr<Animation> dead = CreateAnimation("Explode", 1, 8, 0, 0);
const std::shared_ptr<Animation> flat = CreateAnimation("Flat", 1, 9, 0, 0);
std::shared_ptr<TextureRenderComponent> PookaTexture = std::make_shared<TextureRenderComponent>("digdug_spriteEnemies.png", 2, 10, 2);
std::shared_ptr<Animator> pookaAnimator = std::make_shared<Animator>();
std::shared_ptr<QuadCollisionComponent> pookaCollision = std::make_shared<QuadCollisionComponent>(MVector2_INT(0, 0), 32, tag);
pookaAnimator->AddAnimation({ walk, invis, stage1, stage2, stage3, dead, flat });
Fygar->AddComponent(PookaTexture);
Fygar->AddComponent(pookaAnimator);
Fygar->AddComponent(pookaCollision);
Fygar->SetPosition(static_cast<float>(pos.x), static_cast<float>(pos.y), 0.0f);
pookaAnimator->SetActiveAnimation("Walk");
const std::shared_ptr<AgentComponent> agent = std::make_shared<AgentComponent>(4, 32, 14);
Fygar->AddComponent(agent);
ServiceLocator::RegisterAgent(AgentComponent::GetCount(), Fygar);
Fygar->GetComponent<AgentComponent>()->Initialize();
return Fygar;
}
| [
"48602601+PieterGeers@users.noreply.github.com"
] | 48602601+PieterGeers@users.noreply.github.com |
adb34e8d8931bb9b7847174bdac4c969cd8c480c | 8f9ea3f14bdf2187de759939b2bbc87fe68ccfc0 | /tensorflow/compiler/xla/service/cpu/external_constant_pool.h | 0677f5f0b58005079890052a426e5f48c5d09ed1 | [
"Apache-2.0"
] | permissive | davidstanke/bazel-mvn-demo | 4ea43f0ba293a28b916a27eab5f0812e9b753c2c | cff14dddce15ea7152988da576673bd15bab6c6e | refs/heads/master | 2022-10-20T07:52:29.651851 | 2018-11-22T13:17:51 | 2018-11-22T13:17:51 | 157,782,756 | 2 | 0 | Apache-2.0 | 2022-10-04T23:47:05 | 2018-11-15T22:54:09 | C++ | UTF-8 | C++ | false | false | 2,745 | h | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_CPU_EXTERNAL_CONSTANT_POOL_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_CPU_EXTERNAL_CONSTANT_POOL_H_
#include <memory>
#include "tensorflow/compiler/xla/literal_util.h"
#include "tensorflow/core/lib/gtl/flatmap.h"
#include "tensorflow/core/platform/mem.h"
namespace xla {
namespace cpu {
// An ExternalConstantPool maintains a set of constants kept external to
// generated LLVM IR. These constants are accessed from the IR via globals with
// extern linkage. This current incarnation of ExternalConstantPool only
// supports the JIT CPU backend; the AOT backend is not supported.
//
// Implementation-wise, this is a simple wrapper around a map of strings to byte
// buffers. This simply implementation works in a JIT scenario. This class
// will have to become smarter if we decide to support external constant pools
// on AOT compiles in the future.
class ExternalConstantPool {
public:
// Inserts a buffer with the contents of `literal` into the constant pool with
// the name `name`. It is an error to try to insert two constants with the
// same `name` into the same constant pool. The buffer for literal is aligned
// to `aligment` bytes, and `alignment` must be a power of 2.
//
// The constant pool copies out the contents of `literal` into a buffer it
// owns -- it does not keep pointers to `literal`, or to memory owned by
// `literal`.
void Insert(string name, const LiteralSlice& literal, int64 alignment);
// Find the constant with name `name` in this constant pool. If there isn't
// such constant, return nullptr.
const uint8* Find(const string& name);
private:
// We need to `AlignedFree` pointers allocated into `entries_` since we
// allocate them with `AlignedMalloc`.
struct FreeDeleter {
void operator()(void* ptr) { tensorflow::port::AlignedFree(ptr); }
};
tensorflow::gtl::FlatMap<string, std::unique_ptr<uint8, FreeDeleter>>
entries_;
};
} // namespace cpu
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_SERVICE_CPU_EXTERNAL_CONSTANT_POOL_H_
| [
"davidstanke@gmail.com"
] | davidstanke@gmail.com |
263b30e770e178ffc629a96b630357dbddbc89e2 | 61ffcf27c1bdecbae91eef0509c576adf0b99f38 | /scripts/testtools/cpplistener.cpp | dec1571b9b435abcc73dc518962e5fd32b95e5fc | [] | no_license | Rincce/zmqcore | d2692d1aec7bbbe279792c5ac6e243734980753a | e87ac13f9ac047e9dd766da47cfb62ef82e296d1 | refs/heads/master | 2021-01-01T05:03:38.850092 | 2016-05-16T15:32:22 | 2016-05-16T15:32:22 | 58,135,022 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,038 | cpp |
#include <zmq.hpp>
#include "zhelpers.hpp"
#include <iostream>
#include <sstream>
int main (int argc, char *argv[])
{
zmq::context_t context (1);
std::cout << "Registering subscription with zmqcore.\n";
zmq::socket_t requester(context, ZMQ_REQ);
requester.connect("tcp://localhost:5555");
// Send Multipart message
s_sendmore(requester, "/chatter");
s_sendmore(requester, "String");
s_send(requester, "std_msgs.msg");
std::string reply = s_recv(requester);
std::cout << reply << "\n";
// Socket to talk to server
std::cout << "Collecting updates from weather server…\n" << std::endl;
zmq::socket_t subscriber (context, ZMQ_SUB);
subscriber.connect("tcp://localhost:5556");
subscriber.setsockopt(ZMQ_SUBSCRIBE, "/chatter", strlen ("/chatter"));
while (true) {
// Receive multipart message.
std::string topic = s_recv(subscriber);
std::string msg = s_recv(subscriber);
std::cout << topic << " - " << msg << "\n";
}
return 0;
}
| [
"spulak@kth.se"
] | spulak@kth.se |
c8af13bbd1737992472f9b54b8ddad82cd000049 | 9556ebced20e46c57e9827f671d6026b180e02bd | /photonic/devices/multiring/pse2x2r3.h | b20272aff4d872da4547dc0d8f304ed225f9a757 | [] | no_license | lebiednik/PhoenixSim | fedb066194da5edb4a351608e34ac536ddfab228 | c4254118cbdb07c6ff91b5bc0da7b43bd0b84a2e | refs/heads/master | 2021-01-12T04:00:43.153824 | 2017-01-26T15:27:25 | 2017-01-26T15:27:25 | 77,463,750 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 2,195 | h | /*************************************************************************
* *
* POINTS - Photonic On-chip Interconnection Network Traffic Simulator *
* (c) Assaf Shacham 2006-7 *
* (c) Johnnie Chan 2008 *
* *
* file: PSE2x2.h *
* description: *
* *
* *
*************************************************************************/
#ifndef __PSE2X2R3_H__
#define __PSE2X2R3_H__
#include <omnetpp.h>
#include <vector>
#include "packetstat.h"
#include "sim_includes.h"
#include "messages_m.h"
#include "activemultiringelement.h"
class PSE2x2R3 : public ActiveMultiRingElement
{
private:
double PropagationLoss;
double PassByRingLoss;
double PassThroughRingLoss;
double CrossingLoss;
double BendingLoss;
double Crosstalk_Cross;
double RingOn_ER_2x2;
double RingOff_ER_2x2;
double CrossDelay_2x2;
double BarDelay_2x2;
vector< vector<double> > latencyMatrix;
//vector<PacketStat*> noiseVector;
virtual void Setup();
virtual double GetLatency(int indexIn, int indexOut);
virtual double GetPropagationLoss(int indexIn, int indexOut, double wavelength = 0);
virtual double GetCrossingLoss(int indexIn, int indexOut, double wavelength = 0);
virtual double GetDropIntoRingLoss(int indexIn, int indexOut, double wavelength = 0);
virtual double GetPassByRingLoss(int indexIn, int indexOut, double wavelength = 0);
virtual double GetBendingLoss(int indexIn, int indexOut, double wavelength = 0);
virtual double GetPowerLevel(int state);
virtual double GetEnergyDissipation(int stateBefore, int stateAfter);
void SetRoutingTable();
int GetMultiRingRoutingTable(int index, int ringSet);
double RingStaticDissipation;
double RingDynamicOffOn;
double RingDynamicOnOff;
public:
PSE2x2R3();
virtual ~PSE2x2R3();
};
#endif
| [
"brian.lebiednik@gmail.com"
] | brian.lebiednik@gmail.com |
889606691deff9eb1fbba3ba6931c03162811692 | 5c0cde9516179e199beda1104a329b252c7684b7 | /Graphics/Middleware/QT/include/QtPlatformSupport/5.0.2/QtPlatformSupport/private/constant_mappings_p.h | 7410f5f94ffcdd0312f418a174d25d04a27af2b2 | [] | no_license | herocrx/OpenGLMatrices | 3f8ff924e7160e76464d9480af7cf5652954622b | ca532ebba199945813a563fe2fbadc2f408e9f4b | refs/heads/master | 2021-05-07T08:28:21.614604 | 2017-12-17T19:45:40 | 2017-12-17T19:45:40 | 109,338,861 | 0 | 0 | null | 2017-12-17T19:45:41 | 2017-11-03T01:47:27 | HTML | UTF-8 | C++ | false | false | 5,545 | h | /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/*
* This file contains AT-SPI constants and mappings between QAccessible
* and AT-SPI constants such as 'role' and 'state' enumerations.
*/
#ifndef Q_SPI_CONSTANT_MAPPINGS_H
#define Q_SPI_CONSTANT_MAPPINGS_H
#include "struct_marshallers_p.h"
#include <QtGui/QAccessible>
#include <atspi/atspi-constants.h>
// interface names from at-spi2-core/atspi/atspi-misc-private.h
#define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
#define ATSPI_DBUS_PATH_REGISTRY "/org/a11y/atspi/registry"
#define ATSPI_DBUS_INTERFACE_REGISTRY "org.a11y.atspi.Registry"
#define ATSPI_DBUS_PATH_ROOT "/org/a11y/atspi/accessible/root"
#define ATSPI_DBUS_PATH_DEC "/org/a11y/atspi/registry/deviceeventcontroller"
#define ATSPI_DBUS_INTERFACE_DEC "org.a11y.atspi.DeviceEventController"
#define ATSPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.a11y.atspi.DeviceEventListener"
#define ATSPI_DBUS_INTERFACE_CACHE "org.a11y.atspi.Cache"
#define ATSPI_DBUS_INTERFACE_ACCESSIBLE "org.a11y.atspi.Accessible"
#define ATSPI_DBUS_INTERFACE_ACTION "org.a11y.atspi.Action"
#define ATSPI_DBUS_INTERFACE_APPLICATION "org.a11y.atspi.Application"
#define ATSPI_DBUS_INTERFACE_COLLECTION "org.a11y.atspi.Collection"
#define ATSPI_DBUS_INTERFACE_COMPONENT "org.a11y.atspi.Component"
#define ATSPI_DBUS_INTERFACE_DOCUMENT "org.a11y.atspi.Document"
#define ATSPI_DBUS_INTERFACE_EDITABLE_TEXT "org.a11y.atspi.EditableText"
#define ATSPI_DBUS_INTERFACE_EVENT_KEYBOARD "org.a11y.atspi.Event.Keyboard"
#define ATSPI_DBUS_INTERFACE_EVENT_MOUSE "org.a11y.atspi.Event.Mouse"
#define ATSPI_DBUS_INTERFACE_EVENT_OBJECT "org.a11y.atspi.Event.Object"
#define ATSPI_DBUS_INTERFACE_HYPERLINK "org.a11y.atspi.Hyperlink"
#define ATSPI_DBUS_INTERFACE_HYPERTEXT "org.a11y.atspi.Hypertext"
#define ATSPI_DBUS_INTERFACE_IMAGE "org.a11y.atspi.Image"
#define ATSPI_DBUS_INTERFACE_SELECTION "org.a11y.atspi.Selection"
#define ATSPI_DBUS_INTERFACE_TABLE "org.a11y.atspi.Table"
#define ATSPI_DBUS_INTERFACE_TEXT "org.a11y.atspi.Text"
#define ATSPI_DBUS_INTERFACE_VALUE "org.a11y.atspi.Value"
#define ATSPI_DBUS_INTERFACE_SOCKET "org.a11y.atspi.Socket"
// missing from at-spi2-core:
#define ATSPI_DBUS_INTERFACE_EVENT_WINDOW "org.a11y.atspi.Event.Window"
#define ATSPI_DBUS_INTERFACE_EVENT_FOCUS "org.a11y.atspi.Event.Focus"
#define QSPI_OBJECT_PATH_ACCESSIBLE "/org/a11y/atspi/accessible"
#define QSPI_OBJECT_PATH_PREFIX "/org/a11y/atspi/accessible/"
#define QSPI_OBJECT_PATH_ROOT QSPI_OBJECT_PATH_PREFIX "root"
#define QSPI_REGISTRY_NAME "org.a11y.atspi.Registry"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
struct RoleNames {
RoleNames() {}
RoleNames(AtspiRole r, const QString& n, const QString& ln)
:m_spiRole(r), m_name(n), m_localizedName(ln)
{}
AtspiRole spiRole() const {return m_spiRole;}
QString name() const {return m_name;}
QString localizedName() const {return m_localizedName;}
private:
AtspiRole m_spiRole;
QString m_name;
QString m_localizedName;
};
extern QHash <QAccessible::Role, RoleNames> qSpiRoleMapping;
extern QHash <int, AtspiStateType> qSpiStateMapping;
inline void setSpiStateBit(quint64* state, AtspiStateType spiState)
{
*state |= quint64(1) << spiState;
}
inline void unsetSpiStateBit(quint64* state, AtspiStateType spiState)
{
*state &= ~(quint64(1) << spiState);
}
quint64 spiStatesFromQState(QAccessible::State state);
QSpiUIntList spiStateSetFromSpiStates(quint64 states);
AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relation);
QT_END_NAMESPACE
QT_END_HEADER
#endif /* Q_SPI_CONSTANT_MAPPINGS_H */
| [
"hubertkuc13@gmail.com"
] | hubertkuc13@gmail.com |
beaf5261a8c768c0f2f6b17dd6ccef4d995378f8 | 0175a22cb094c72b66d059818f514633cf1331c6 | /DatabaseHandlingModule/ApisConvertionModule/ApiConvertKTHDBModule/impl/ApiConvertKTHDB.cpp | a3d2011fc8fc51e2f3fe76cae7adbcb3cd425838 | [] | no_license | marina-alberti/project-object-recognition | d4a979702c120e1de4c8e251ce7190d6c28a62f8 | 070fad62bae3c4ef1474c1c6c6725a307b39c7fb | refs/heads/master | 2016-09-10T19:59:08.930876 | 2014-04-14T12:44:02 | 2014-04-14T12:44:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,948 | cpp | /*
* ApiConvertKTHDB.cpp
*
* Created on: Nov 18, 2013
* Author: marina
*/
#include "ApiConvertKTHDB.hpp"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <pcl/common/transforms.h>
#include <pcl/common/eigen.h>
#include <iostream>
#define DEBUG 0
using namespace boost::property_tree;
static const std::string TAG_SCENARIO = "scenario";
static const std::string TAG_NAME = "name";
static const std::string TAG_OBJECT = "object";
static const std::string TAG_NOBJECTS = "numberOfObjects";
static const std::string TAG_ALLOBJECTS = "allObjects";
static const std::string TAG_POSE = "pose";
static const std::string TAG_DIMENSIONS = "dimensions";
static const std::string TAG_LENGTH = "length";
static const std::string TAG_WIDTH = "width";
static const std::string TAG_HEIGHT = "height";
static const std::string TAG_COLOR = "color";
static const std::string TAG_INDICES = "indices";
/*
Parses the XML file. Stores the data about the reference (table) and the other objects in the
scene into an object of class "SceneInformation", which is passed by reference as an argument.
*/
void ApiConvertKTHDB::parseFileXML(string fileNameXML, SceneInformation & mySceneInformation){
boost::property_tree::ptree root;
read_xml(fileNameXML, root);
std::string scenarioType = root.get<std::string>(TAG_SCENARIO + "." + "type");
mySceneInformation.setType(scenarioType);
if (DEBUG) {
std::cout << "From Api: scenario type = "<< scenarioType << endl;
std::cout << "From getType function: the scenario type is " << mySceneInformation.getType() << endl;
}
ptree& tableDimensions = root.get_child(TAG_SCENARIO + "." + TAG_DIMENSIONS);
float _deskLength = tableDimensions.get<float>(TAG_LENGTH);
float _deskWidth = tableDimensions.get<float>(TAG_WIDTH);
mySceneInformation.setReferenceLength(_deskLength);
mySceneInformation.setReferenceWidth(_deskWidth);
mySceneInformation.setReferenceCentroid();
if (DEBUG) {
cout << "Parsing the XML file. The Scene Desk parameters have been set to :" << endl
<< "Length = " << mySceneInformation.getReferenceLength() << endl
<< "Width = " << mySceneInformation.getReferenceWidth() << endl;
}
boost::property_tree::ptree& allObjects = root.get_child(TAG_SCENARIO + "." + TAG_ALLOBJECTS);
boost::property_tree::ptree::iterator it = allObjects.begin();
it++;
for(; it != allObjects.end(); it++){
if (DEBUG) { cout << "New object will be parsed" << endl; }
parseObject(it->second, mySceneInformation);
}
}
/*
Parses a single object in the scene. Adds the information about the object to
the object_instnace of class "SceneInformation" which is passed by reference
to the function as an argument.
*/
void ApiConvertKTHDB::parseObject(boost::property_tree::ptree & parent, SceneInformation & mySceneInformation){
Object newObject;
if (DEBUG) {
cout << "Inside the parseObject function" << endl;
}
float x, y, z, roll, pitch, yaw, length, width, height;
boost::property_tree::ptree& pose = parent.get_child(TAG_POSE);
x = pose.get<float>("x");
y = pose.get<float>("y");
z = pose.get<float>("z");
roll = pose.get<float>("roll");
pitch = pose.get<float>("pitch");
yaw = pose.get<float>("yaw");
boost::property_tree::ptree& dimensions = parent.get_child(TAG_DIMENSIONS);
length = dimensions.get<float>(TAG_LENGTH);
width = dimensions.get<float>(TAG_WIDTH);
height = dimensions.get<float>(TAG_HEIGHT);
if (DEBUG) {
cout << "The parameters are: " << x << " " << y << " " << z << " " <<
roll << " " << pitch << " " << yaw << " " << length << " " << width
<< " " << height << endl;
}
setmapKTHparameters(x, y, z, roll, pitch, yaw, length, width, height);
if (DEBUG) {
cout << "Inside the parseObject function: saved KTH parameters inside map." << endl;
}
vector<pcl::PointXYZ> myboundingBoxPoints = convertObjectParameters();
newObject.setBoundingBox(myboundingBoxPoints);
newObject.setCentroid();
newObject.setInstanceName(parent.get<std::string>(TAG_NAME));
// setting the name sets also the numeric object ID
newObject.setObjectName(parent.get<std::string>(TAG_NAME));
int currentnumber = mySceneInformation.getNumberOfObjects();
newObject.setInstanceID(currentnumber);
string currentName = parent.get<std::string>(TAG_NAME);
const char * currentNameChar = currentName.c_str();
if (newObject.getActualObjectID() != -1) {
mySceneInformation.addObject(newObject);
}
if (DEBUG) {
cout << "Inside the parseObject function: Added object " << parent.get<std::string>(TAG_NAME) << endl;
}
}
void ApiConvertKTHDB::setmapKTHparameters(float x, float y, float z, float roll, float pitch, float yaw, float length, float width, float height) {
mapKTHparameters["x"] = x;
mapKTHparameters["y"] = y;
mapKTHparameters["z"] = z;
mapKTHparameters["roll"] = roll;
mapKTHparameters["pitch"] = pitch;
mapKTHparameters["yaw"] = yaw;
mapKTHparameters["length"] = length;
mapKTHparameters["height"] = height;
mapKTHparameters["width"] = width;
}
vector<pcl::PointXYZ> ApiConvertKTHDB::convertObjectParameters(){
if (DEBUG) {
cout << "Inside the convertObjectParameters function" << endl;
}
float x = mapKTHparameters.find("x")->second;
float y = mapKTHparameters.find("y")->second;
float z = mapKTHparameters.find("z")->second;
float roll = mapKTHparameters.find("roll")->second;
float pitch = mapKTHparameters.find("pitch")->second;
float yaw = mapKTHparameters.find("yaw")->second;
float length = mapKTHparameters.find("length")->second;
float width = mapKTHparameters.find("width")->second;
float height = mapKTHparameters.find("height")->second;
// work on a point cloud
//pcl::PointCloud<pcl::PointXYZ> myBoundingBox;
Eigen::Affine3f myTransformation;
myTransformation = pcl::getTransformation(x,y,z,roll,pitch,yaw);
pcl::PointXYZ _FLDPoint, _FRDPoint, _BLDPoint, _BRDPoint, _FLUPoint, _FRUPoint, _BLUPoint, _BRUPoint;
// Lower face vertices
// Front face, left lower point
_FLDPoint.x = 0;
_FLDPoint.y = 0;
_FLDPoint.z = 0;
_FLDPoint = pcl::transformPoint(_FLDPoint, myTransformation);
// Front face, right lower point
_FRDPoint.x = length;
_FRDPoint.y = 0;
_FRDPoint.z = 0;
_FRDPoint = pcl::transformPoint(_FRDPoint, myTransformation);
// Back face, left lower point
_BLDPoint.x = length;
_BLDPoint.y = width;
_BLDPoint.z = 0;
_BLDPoint = pcl::transformPoint(_BLDPoint, myTransformation);
// Left face, right lower point
_BRDPoint.x = 0;
_BRDPoint.y = width;
_BRDPoint.z = 0;
_BRDPoint = pcl::transformPoint(_BRDPoint, myTransformation);
// Upper face vertices
// Front face, left upper point
_FLUPoint.x = 0;
_FLUPoint.y = 0;
_FLUPoint.z = height;
_FLUPoint = pcl::transformPoint(_FLUPoint, myTransformation);
// Front face, right upper point
_FRUPoint.x = length;
_FRUPoint.y = 0;
_FRUPoint.z = height;
_FRUPoint = pcl::transformPoint(_FRUPoint, myTransformation);
// Back face, left upper point
_BLUPoint.x = length;
_BLUPoint.y = width;
_BLUPoint.z = height;
_BLUPoint = pcl::transformPoint(_BLUPoint, myTransformation);
// Left face, right upper point
_BRUPoint.x = 0;
_BRUPoint.y = width;
_BRUPoint.z = height;
_BRUPoint = pcl::transformPoint(_BRUPoint, myTransformation);
// // myBoundingBox->points[0].x = 0.0; boundingBox->points[0].y = 0.0; boundingBox->points[0].z = 0.0;
// // myBoundingBox.push_back(_FLDPoint);
vector<pcl::PointXYZ> out;
out.push_back(_FLDPoint);
out.push_back(_FRDPoint);
out.push_back(_BLDPoint);
out.push_back(_BRDPoint);
out.push_back(_FLUPoint);
out.push_back(_FRUPoint);
out.push_back(_BLUPoint);
out.push_back(_BRUPoint);
if (DEBUG) {
cout << "Inside the convertObjectParameters function: after pushing back ALL points into the vector of points " << endl;
}
return out;
}
| [
"marina@marina-HP-ENVY-dv6.(none)"
] | marina@marina-HP-ENVY-dv6.(none) |
9a5b6e74910ce5c8d850449c14bd91707da72a39 | 2a7be1d97ce8f946dbfba0c17b2db26e9c6064cf | /Week11_Strings/task02.cpp | bab407af8b7aebcf00ebac0d9d65158920423ceb | [] | no_license | snikolova27/UP-2.0 | 0c400cddf50a23d4bcb64c5a2b19c7c8c6b3109c | 8411e58111d410f60c3058e1608c03e4961d30bb | refs/heads/master | 2023-07-11T01:09:31.903709 | 2021-08-18T08:01:15 | 2021-08-18T08:01:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,046 | cpp | #include <iostream>
const int MAX_WORD_LENGHT = 20;
void print(char str[], int len)
{
for (int i = 0; i < len; i++)
{
std::cout << str[i];
}
std::cout << std::endl;
}
int strlenS(const char str[])
{
int len = 0;
while (str[len])
{
len++;
}
return len;
}
void strcopy(char dest[], const char src[])
{
int pos = 0;
while (src[pos])
{
dest[pos] = src[pos];
pos++;
}
dest[pos] = '\0';
}
int main()
{
char string[20] = {};
char maxLenght[20] = {};
int currentLen = 0;
int maxLen = 0;
bool end = 1;
do
{
std::cin >> string;
currentLen = strlenS(string);
if (string[currentLen - 1] == '.')
{
string[currentLen - 1] = '\0';
end = 0;
currentLen--;
}
if (currentLen > maxLen)
{
maxLen = currentLen;
strcopy(maxLenght, string);
}
} while (end);
std::cout << maxLenght << std::endl;
return 0;
} | [
"snikolova27@gmail.com"
] | snikolova27@gmail.com |
36d2d16bc1f36af51b24edd557daab99003e5bec | 9d3055978db6533f55520f884f4d5692ed28168e | /archive/membus_fingerprint/functions/cpp/thrasher.cpp | 9c9d3041be1ec03dfabd0fe67ff373adcdf65e9f | [] | no_license | anilkyelam/columbus | 0d3ceee243782e68d5ad90c4931dbb55bcbd5a27 | ada1262b54a6e48079ebda4d110250ca0605521a | refs/heads/master | 2023-04-13T13:44:36.052005 | 2021-04-21T08:53:33 | 2021-04-21T08:53:33 | 222,168,678 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 6,054 | cpp | #include <aws/lambda-runtime/runtime.h>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <string>
#include <unistd.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <fstream>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <stdio.h>
#include <ifaddrs.h>
using namespace aws::lambda_runtime;
// Rdtsc blocks
unsigned cycles_low, cycles_high, cycles_low1, cycles_high1;
static __inline__ unsigned long long rdtsc(void)
{
__asm__ __volatile__ ("RDTSC\n\t"
"mov %%edx, %0\n\t"
"mov %%eax, %1\n\t": "=r" (cycles_high), "=r" (cycles_low)::
"%rax", "rbx", "rcx", "rdx");
}
static __inline__ unsigned long long rdtsc1(void)
{
__asm__ __volatile__ ("RDTSC\n\t"
"mov %%edx, %0\n\t"
"mov %%eax, %1\n\t": "=r" (cycles_high1), "=r" (cycles_low1)::
"%rax", "rbx", "rcx", "rdx");
}
/* Get comma-seperated MAC addresses of all interfaces */
void get_mac_addrs(char* mac)
{
sprintf(mac, "");
struct ifreq ifr;
int s;
if ((s = socket(AF_INET, SOCK_STREAM,0)) < 0) {
perror("socket");
return;
}
struct ifaddrs *addrs,*tmp;
getifaddrs(&addrs);
tmp = addrs;
while (tmp)
{
if (tmp->ifa_addr && tmp->ifa_addr->sa_family == AF_PACKET)
{
strcpy(ifr.ifr_name, tmp->ifa_name);
if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) {
perror("ioctl");
return;
}
unsigned char *hwaddr = (unsigned char *)ifr.ifr_hwaddr.sa_data;
sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", hwaddr[0], hwaddr[1], hwaddr[2],
hwaddr[3], hwaddr[4], hwaddr[5]);
}
tmp = tmp->ifa_next;
}
freeifaddrs(addrs);
close(s);
}
/* Get current date/time, format is YYYY-MM-DD.HH:mm:ss */
const std::string current_datetime() {
time_t now = time(0);
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
strftime(buf, sizeof(buf), "%Y-%m-%d %X", &tstruct);
return buf;
}
invocation_response my_handler(invocation_request const& request)
{
std::string start_time = current_datetime();
const std::string none = "none";
char result[500];
std::string role;
uint64_t start, end;
double time_taken=0.0;
int* arr;
int i, size = 4; /* 4 * 4B, give it few cache lines */
uint32_t *addr; /* Address that falls on two cache lines. */
/* Figure out last-level cache line size of this system */
long cacheline_sz = sysconf(_SC_LEVEL3_CACHE_LINESIZE);
//long cacheline_sz = sysconf(_SC_LEVEL2_CACHE_LINESIZE);
printf("Cache line size: %ld B\n", cacheline_sz);
/* Allocate an array that spans multiple cache lines */
size = 10 * cacheline_sz / sizeof(int);
arr = (int*)malloc(size*sizeof(int));
for (i = 0; i < size; i++ ) arr[i] = 1;
/* Find the first cacheline boundary */
for (i = 1; i < size; i++)
{
long address = (long)(arr + i);
if (address % cacheline_sz == 0) break;
}
if (i == size)
{
printf("ERROR! Could not find a cacheline boundary in the array.\n");
sprintf(result, "ERROR! Could not find a cacheline boundary in the array.\n");
}
else
{
addr = (uint32_t*)((uint8_t*)(arr+i-1) + 2);
printf("Found an address that falls on two cache lines: %p\n", (void*) addr);
try {
// Split the payload
std::istringstream ss(request.payload);
std::vector<std::string> params;
for(std::string s; ss >> s; ){
params.push_back(s);
}
int no_of_thrashers = stoi(params[0]);
int thrasher_id = stoi(params[1]);
int interval_length = stoi(params[2]);
//Sleep and wake pattern
std::vector<bool> vb(no_of_thrashers, false);
//Set the index corresponsing the the thrasher ID to true. This wakes up the thrasher
vb[thrasher_id] = true;
for (auto bit: vb){
if(bit){
time_t st_time = time(0);
while(1)
{
for (i = 1; i < 1000; i++){
/* atomic sum of cacheline boundary */
__atomic_fetch_add(addr, 1, __ATOMIC_SEQ_CST);
}
if (time(0) - st_time >= interval_length)
break;
}
}else{
sleep(interval_length);
}
}
}
catch(std::invalid_argument& e){
// if no conversion could be performed
role = none;
}
}
// clock_t start_time = clock();
// while(1)
// {
// if ((clock() - start_time) / CLOCKS_PER_SEC >= 2) // time in seconds
// break;
// }
/* Prepare response as JSON*/
char response[1000];
sprintf(response, "{ \"Role\" : \"%s\" ", role.c_str());
/* Add time to response */
sprintf(response, "%s, \"Start Time\": \"%s\"", response, start_time.c_str());
sprintf(response, "%s, \"End Time\": \"%s\"", response, current_datetime().c_str());
sprintf(response, "%s, \"Thread time\": \"%lf\"", response, time_taken);
sprintf(response, "%s, \"Request ID\": \"%s\"", response, request.request_id.c_str());
/* Get MAC addresses and add to the response */
char mac[50] = "";
get_mac_addrs(mac);
sprintf(response, "%s, \"MAC Address\": \"%s\"", response, mac);
/* Get boot id */
std::ifstream ifs("/proc/sys/kernel/random/boot_id");
std::string boot_id ( (std::istreambuf_iterator<char>(ifs) ), (std::istreambuf_iterator<char>()) );
sprintf(response, "%s, \"Boot ID\": \"%s\"", response, boot_id.c_str());
/* Close json */
sprintf(response, "%s }", response);
/* send response */
return invocation_response::success(response, "application/json");
}
int main()
{
run_handler(my_handler);
return 0;
}
| [
"shibanisubbareddy@shibanis-mbp.home"
] | shibanisubbareddy@shibanis-mbp.home |
4af97e878f4ab1613dbdda94171711984b9b1061 | ee99e51f0ca3bced1ee21f28b052f9b5533c15da | /src/registercontainerwidget.h | 2e5749bc4b8fa6a29fe94d21a74b954a208aff4c | [
"MIT"
] | permissive | mortbopet/Ripes | 33c8d99f6ffbbf195ef25edaeb888a9d117adca8 | 5f71819fc4e9edaf673c8691bb1cd1525fb13878 | refs/heads/master | 2023-09-05T04:34:04.412192 | 2023-08-14T05:19:36 | 2023-08-14T05:19:36 | 108,505,982 | 2,108 | 279 | MIT | 2023-09-01T20:50:26 | 2017-10-27T06:06:08 | C++ | UTF-8 | C++ | false | false | 378 | h | #pragma once
#include <QWidget>
namespace Ripes {
namespace Ui {
class RegisterContainerWidget;
}
class RegisterContainerWidget : public QWidget {
Q_OBJECT
public:
explicit RegisterContainerWidget(QWidget *parent = nullptr);
~RegisterContainerWidget();
private:
void initialize();
void updateView();
Ui::RegisterContainerWidget *m_ui;
};
} // namespace Ripes
| [
"morten_bp@live.dk"
] | morten_bp@live.dk |
b306a13767af8ba8a1544ebb6bddba2358b8d587 | f95da7eac679e4361d3d04aaa67b869ffa6e6fa3 | /5. Árboles/Otros/E24 - Árbol binario simétrico/E24/bintree_eda.h | 8e8a514da443668f9896228fc0e18024630845a6 | [] | no_license | Dashito14/Estructura-de-Datos | 6645044ebf87486dabecde5397102a22eb119df8 | b03525263ce770fd87e0e13d1ef71b7d36fc34b1 | refs/heads/master | 2021-01-14T20:34:50.525010 | 2020-06-17T15:20:28 | 2020-06-17T15:20:28 | 242,750,260 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 5,209 | h | //
// bintree_eda.h
//
// Implementación de árboles binarios (con compartición de nodos)
// con recorridos en profundidad y por niveles
// e iterador para recorrer en inorden (basado en una pila de
// antecesores pendientes)
//
// Estructuras de Datos y Algoritmos
// Facultad de Informática
// Universidad Complutense de Madrid
//
// Copyright (c) 2016-2019 Alberto Verdejo
//
#ifndef bintree_eda_h
#define bintree_eda_h
#include <memory> // shared_ptr, make_shared
#include <stdexcept>
#include <stack>
#include <vector>
#include <queue>
#include <iostream>
template <class T>
class bintree {
protected:
/*
Nodo que almacena internamente el elemento (de tipo T),
y punteros al hijo izquierdo y derecho, que pueden ser
nullptr si el hijo es vacío (no existe).
*/
struct TreeNode;
using Link = std::shared_ptr<TreeNode>;
struct TreeNode {
TreeNode(Link const& l, T const& e, Link const& r) : elem(e), left(l), right(r) {};
T elem;
Link left, right;
};
// puntero a la raíz del árbol
Link raiz;
// constructora privada
bintree(Link const& r) : raiz(r) {}
public:
// árbol vacío
bintree() : raiz(nullptr) {}
// árbol hoja
bintree(T const& e) :
raiz(std::make_shared<TreeNode>(nullptr, e, nullptr)) {}
// árbol con dos hijos
bintree(bintree<T> const& l, T const& e, bintree<T> const& r) :
raiz(std::make_shared<TreeNode>(l.raiz, e, r.raiz)) {}
// constructora por copia, operador de asignación y destructora por defecto
// consultar si el árbol está vacío
bool empty() const {
return raiz == nullptr;
}
// consultar la raíz
T const& root() const {
if (empty()) throw std::domain_error("El arbol vacio no tiene raiz.");
else return raiz->elem;
}
// consultar el hijo izquierdo
bintree<T> left() const {
if (empty()) throw std::domain_error("El arbol vacio no tiene hijo izquierdo.");
else return bintree<T>(raiz->left);
}
// consultar el hijo derecho
bintree<T> right() const {
if (empty()) throw std::domain_error("El arbol vacio no tiene hijo derecho.");
else return bintree(raiz->right);
}
// recorridos
std::vector<T> preorder() const {
std::vector<T> pre;
preorder(raiz, pre);
return pre;
}
std::vector<T> inorder() const {
std::vector<T> in;
inorder(raiz, in);
return in;
}
std::vector<T> postorder() const {
std::vector<T> post;
postorder(raiz, post);
return post;
}
std::vector<T> levelorder() const {
std::vector<T> levels;
if (!empty()) {
std::queue<Link> pendientes;
pendientes.push(raiz);
while (!pendientes.empty()) {
Link sig = pendientes.front();
pendientes.pop();
levels.push_back(sig->elem);
if (sig->left != nullptr)
pendientes.push(sig->left);
if (sig->right != nullptr)
pendientes.push(sig->right);
}
}
return levels;
}
protected:
static void preorder(Link a, std::vector<T> & pre) {
if (a != nullptr) {
pre.push_back(a->elem);
preorder(a->left, pre);
preorder(a->right, pre);
}
}
static void inorder(Link a, std::vector<T> & in) {
if (a != nullptr) {
inorder(a->left, in);
in.push_back(a->elem);
inorder(a->right, in);
}
}
static void postorder(Link a, std::vector<T> & post) {
if (a != nullptr) {
postorder(a->left, post);
postorder(a->right, post);
post.push_back(a->elem);
}
}
public:
// iterador que recorre el árbol en inorden
class const_iterator {
public:
T const& operator*() const {
if (ptr == nullptr) throw std::out_of_range("fuera del arbol");
return ptr->elem;
}
T const* operator->() const {
return &operator*();
}
bool operator==(const_iterator const& other) const {
return ptr == other.ptr;
}
bool operator!=(const_iterator const& other) const {
return !(*this == other);
}
const_iterator & operator++() { // ++ prefijo
next();
return *this;
}
private:
friend class bintree;
Link ptr;
std::stack<Link> ancestros;
// constructores privados
// construye el iterador al primero
const_iterator(Link raiz) { ptr = first(raiz); }
// construye el iterador al último
const_iterator() : ptr(nullptr) {}
Link first(Link act) {
if (act == nullptr) {
return nullptr;
}
else {
while (act->left != nullptr) {
ancestros.push(act);
act = act->left;
}
return act;
}
}
void next() {
if (ptr == nullptr) {
throw std::range_error("El iterador no puede avanzar");
}
else if (ptr->right != nullptr) { // primero del hijo derecho
ptr = first(ptr->right);
}
else if (ancestros.empty()) { // hemos llegado al final
ptr = nullptr;
}
else { // podemos retroceder
ptr = ancestros.top();
ancestros.pop();
}
}
};
const_iterator begin() const {
return const_iterator(raiz);
}
const_iterator end() const {
return const_iterator();
}
};
// lee un árbol binario de la entrada estándar
template <typename T>
inline bintree<T> leerArbol(T vacio) {
T raiz;
std::cin >> raiz;
if (raiz == vacio) { // es un árbol vacío
return {};
}
else { // leer recursivamente los hijos
auto iz = leerArbol(vacio);
auto dr = leerArbol(vacio);
return { iz, raiz, dr };
}
}
#endif // bintree_eda_h#pragma once
| [
"dipdnl14@gmail.com"
] | dipdnl14@gmail.com |
d73dde9df8ff0141be884b13963d73dc3f9bbeca | 7e8f173ba153f233ef00dd1696bf9c6d18dfa1da | /CP/hackerearth/Not from contest/Maximize the Earning.cpp | fe90e5f313eed0b76b318bddfdf6435bb028440e | [] | no_license | yash2322/COMPETITIVE_CODING | d11355cad63606f8cc685fe3baaa9ab8ed90c4b4 | 905b1469fbd886c17bb930e65999317d06966338 | refs/heads/master | 2020-04-12T04:19:06.890812 | 2020-01-31T11:23:05 | 2020-01-31T11:23:05 | 162,291,990 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 698 | cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long int s;
cin>>s;
for(long int i=0;i<s;i++)
{
long int number_of_buildings,rupee,visible_buildings=0,initial_visible=INT_MIN;
cin>>number_of_buildings>>rupee;
long int building_heights[number_of_buildings];
for(long int j=0;j<number_of_buildings;j++)
{
cin>>building_heights[number_of_buildings];
if(building_heights[number_of_buildings]>initial_visible)
{
visible_buildings++;
initial_visible=building_heights[number_of_buildings];
}
}
cout<<rupee*visible_buildings<<endl;
}
}
| [
"useryash2322@gmail.com"
] | useryash2322@gmail.com |
6a0e12afa25a13f975b1b4da08355c06d17ed8d6 | cdf92aa3a8a49dc044306c125356cca26910dbda | /src4/static/SDK1/IfSearch/ClothesMatchProperties.h | 9a4706ed5547075d723db977c24bf6ae2da9be45 | [
"MIT"
] | permissive | eirTony/INDI1 | b7c5d2ba0922a509b32d9d411938ecdc0f725109 | 07fe9eff4fb88c6c2d636c94267ea8734d295223 | refs/heads/master | 2020-01-23T21:22:49.833055 | 2016-11-26T07:43:06 | 2016-11-26T07:43:06 | 74,568,244 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,178 | h | #ifndef CLOTHESMATCHPROPERTIES_H
#define CLOTHESMATCHPROPERTIES_H
#include <QObject>
#include <QtGui/QColor>
class QRect;
#include <Eyes.h>
#include <QProperty.h>
class CharacteristicColor;
#define CLOTHESMATCH_QPROPERTIES(TND) \
TND(QString, UpperColor, QString()) \
TND(QString, LowerColor, QString()) \
TND(int, Shoulder, 0) \
TND(int, Waist, 0) \
TND(int, Ankle, 0) \
TND(int, Width, 0) \
TND(int, UnderCrop, 0) \
TND(int, UpperConfidence, 0) \
TND(int, LowerConfidence, 0) \
class ClothesMatchProperties : public QObject
{
Q_OBJECT
DECLARE_QPROPERTIES(CLOTHESMATCH_QPROPERTIES);
public:
explicit ClothesMatchProperties(QObject * parent=0);
qreal shoulder(void) const;
qreal waist(void) const;
qreal width(void) const;
qreal ankle(void) const;
qreal underCrop(void) const;
QRect upperRect(const Eyes eyes) const;
QRect lowerRect(const Eyes eyes) const;
CharacteristicColor upperCharacteristicColor(void) const;
CharacteristicColor lowerCharacteristicColor(void) const;
signals:
public slots:
private:
};
#endif // CLOTHESMATCHPROPERTIES_H
| [
"totto@eclipseir.com"
] | totto@eclipseir.com |
ba292e18f8737e0b55b259604ad0bc98dca71a87 | abf5ac21121e05c86edeaab4a28bc6a47312663b | /utils/datastream.h | a41821b52b712bc72498887c072e9cad1caede1c | [] | no_license | artthirt/videosmpl | a3bcdbe70ba6dc7cb85bd560c78d71b65d630b64 | 23f0e8d0c1f5f53718aa4fb95d45478961549817 | refs/heads/master | 2023-08-21T03:35:37.463421 | 2021-11-02T07:32:12 | 2021-11-02T07:32:12 | 352,923,627 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,884 | h | #ifndef DATASTREAM_H
#define DATASTREAM_H
#include <algorithm>
#include <vector>
#include <string>
#include <assert.h>
class basicstream{
public:
enum byteorder{bigendian, littleendian};
basicstream(): m_byteorder(bigendian){
}
virtual ~basicstream(){
}
/**
* @brief readRawData
* @param data
* @param len
* @return
*/
virtual int readRawData(char* data, int len) { return 0; }
/**
* @brief writeRawData
* @param data
* @param len
* @return
*/
virtual int writeRawData(char* data, int len) { return 0; }
virtual size_t size() const { return 0; }
/**
* @brief pos
* @return
*/
inline int pos() const {return m_pos;}
void set_byteorder(byteorder order){
m_byteorder = order;
}
byteorder order() const{
return m_byteorder;
}
protected:
/**
* @brief inc
* @param len
*/
inline void inc(int len){ m_pos += len; }
/**
* @brief set_pos
* @param pos
*/
inline void set_pos(int pos){ m_pos = pos; }
byteorder m_byteorder;
private:
int m_pos;
};
class inputstream: public basicstream{
public:
inputstream(std::vector< char >* source);
/**
* @brief write
* @param v
*/
template< typename T >
void write(const T& v){
int sizetype = sizeof(v);
allocate(sizetype);
switch (m_byteorder) {
case bigendian:
std::reverse_copy((char*)&v, (char*)&v + sizetype, &(*m_buffer)[pos()]);
break;
case littleendian:
default:
std::copy((char*)&v, (char*)&v + sizetype, &(*m_buffer)[pos()]);
break;
}
inc(sizetype);
}
/**
* @brief writeRawData
* @param data
* @param len
* @return
*/
virtual int writeRawData(char* data, int len);
virtual size_t size() const { return m_buffer? m_buffer->size() : 0; }
protected:
void allocate(size_t len);
private:
std::vector< char > *m_buffer;
};
class outputstream: public basicstream{
public:
outputstream(const std::vector< char > &source);
/**
* @brief read
* @return
*/
template< typename T >
T read(){
T v(0);
size_t sizetype = sizeof(v);
if(m_buffer.size() < pos() + sizetype)
return v;
switch (m_byteorder) {
case bigendian:
std::reverse_copy((char*)&m_buffer[pos()], (char*)&m_buffer[pos()] + sizetype, (char*)&v);
break;
case littleendian:
default:
std::copy((char*)&m_buffer[pos()], (char*)&m_buffer[pos()] + sizetype, (char*)&v);
break;
}
inc(sizetype);
return v;
}
/**
* @brief readRawData
* @param data
* @param len
* @return
*/
virtual int readRawData(char* data, int len);
virtual size_t size() const { return m_buffer.size(); }
private:
std::vector< char > m_buffer;
};
class datastream
{
public:
datastream(const std::vector< char > &source);
datastream(std::vector< char > *source);
~datastream();
void set_byteorder(basicstream::byteorder order){
if(m_stream){
m_stream->set_byteorder(order);
}
}
basicstream::byteorder order() const{
if(m_stream)
return m_stream->order();
return basicstream::bigendian;
}
/**
* @brief operator >>
* @param v
* @return
*/
template< typename T >
inline datastream& operator>> (T& v){
v = T();
outputstream* os = dynamic_cast< outputstream* >(m_stream);
assert(os != 0);
if(os)
v = os->read<T>();
return *this;
}
/**
* @brief operator <<
* @param v
* @return
*/
template< typename T >
inline datastream& operator<< (T v){
inputstream *is = dynamic_cast< inputstream* >(m_stream);
assert(is != 0);
if(is)
is->write(v);
return *this;
}
/**
* @brief readRawData
* @param data
* @param len
* @return
*/
int readRawData(char* data, int len);
/**
* @brief writeRawData
* @param data
* @param len
* @return
*/
int writeRawData(char* data, int len);
/**
* @brief size
* @return
*/
size_t size() const;
/**
* @brief pos
* @return
*/
size_t pos() const;
private:
basicstream *m_stream;
};
#endif // DATASTREAM_H
| [
"artthirt@gmail.com"
] | artthirt@gmail.com |
0ed76bf37838b05661a9d60405c2d3b3c424e333 | f1dcd8cf35663b3affd3e19d32ea27355ad93fd2 | /libthread_safe/include/thread_safe/gnu/c++/8/atomic | e7fa952cfa64d457cb04301a20f799e70a276950 | [] | no_license | mgood7123/greenThreads | eb65665b9403cfc51c68dfd95e1ebac87eed96cd | 891ac222fa6eb6bcbd44d51d370ac1d059d6a50d | refs/heads/master | 2020-08-28T21:59:45.993320 | 2019-11-27T12:31:56 | 2019-11-27T12:31:56 | 217,831,766 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 41,066 | // -*- C++ -*- header.
// Copyright (C) 2008-2018 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, 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 General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file include/atomic
* This is a Standard C++ Library header.
*/
// Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
#ifndef _GLIBCXX_ATOMIC
#define _GLIBCXX_ATOMIC 1
#pragma GCC system_header
#if __cplusplus < 201103L
# include "../bits/c++0x_warning.h"
#else
#include "../bits/atomic_base.h"
#include "../bits/move.h"
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* @addtogroup atomics
* @{
*/
#if __cplusplus > 201402L
# define __cpp_lib_atomic_is_always_lock_free 201603
#endif
template<typename _Tp>
struct atomic;
/// atomic<bool>
// NB: No operators or fetch-operations for this type.
template<>
struct atomic<bool>
{
private:
__atomic_base<bool> _M_base;
public:
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(bool __i) noexcept : _M_base(__i) { }
bool
operator=(bool __i) noexcept
{ return _M_base.operator=(__i); }
bool
operator=(bool __i) volatile noexcept
{ return _M_base.operator=(__i); }
operator bool() const noexcept
{ return _M_base.load(); }
operator bool() const volatile noexcept
{ return _M_base.load(); }
bool
is_lock_free() const noexcept { return _M_base.is_lock_free(); }
bool
is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_BOOL_LOCK_FREE == 2;
#endif
void
store(bool __i, memory_order __m = memory_order_seq_cst) noexcept
{ _M_base.store(__i, __m); }
void
store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept
{ _M_base.store(__i, __m); }
bool
load(memory_order __m = memory_order_seq_cst) const noexcept
{ return _M_base.load(__m); }
bool
load(memory_order __m = memory_order_seq_cst) const volatile noexcept
{ return _M_base.load(__m); }
bool
exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept
{ return _M_base.exchange(__i, __m); }
bool
exchange(bool __i,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_base.exchange(__i, __m); }
bool
compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
memory_order __m2) noexcept
{ return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
bool
compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
memory_order __m2) volatile noexcept
{ return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
bool
compare_exchange_weak(bool& __i1, bool __i2,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_base.compare_exchange_weak(__i1, __i2, __m); }
bool
compare_exchange_weak(bool& __i1, bool __i2,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_base.compare_exchange_weak(__i1, __i2, __m); }
bool
compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
memory_order __m2) noexcept
{ return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
bool
compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
memory_order __m2) volatile noexcept
{ return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
bool
compare_exchange_strong(bool& __i1, bool __i2,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_base.compare_exchange_strong(__i1, __i2, __m); }
bool
compare_exchange_strong(bool& __i1, bool __i2,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_base.compare_exchange_strong(__i1, __i2, __m); }
};
/**
* @brief Generic atomic type, primary class template.
*
* @tparam _Tp Type to be made atomic, must be trivally copyable.
*/
template<typename _Tp>
struct atomic
{
private:
// Align 1/2/4/8/16-byte types to at least their size.
static constexpr int _S_min_alignment
= (sizeof(_Tp) & (sizeof(_Tp) - 1)) || sizeof(_Tp) > 16
? 0 : sizeof(_Tp);
static constexpr int _S_alignment
= _S_min_alignment > alignof(_Tp) ? _S_min_alignment : alignof(_Tp);
alignas(_S_alignment) _Tp _M_i;
static_assert(__is_trivially_copyable(_Tp),
"std::atomic requires a trivially copyable type");
static_assert(sizeof(_Tp) > 0,
"Incomplete or zero-sized types are not supported");
public:
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(_Tp __i) noexcept : _M_i(__i) { }
operator _Tp() const noexcept
{ return load(); }
operator _Tp() const volatile noexcept
{ return load(); }
_Tp
operator=(_Tp __i) noexcept
{ store(__i); return __i; }
_Tp
operator=(_Tp __i) volatile noexcept
{ store(__i); return __i; }
bool
is_lock_free() const noexcept
{
// Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
}
bool
is_lock_free() const volatile noexcept
{
// Produce a fake, minimally aligned pointer.
return __atomic_is_lock_free(sizeof(_M_i),
reinterpret_cast<void *>(-__alignof(_M_i)));
}
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free
= __atomic_always_lock_free(sizeof(_M_i), 0);
#endif
void
store(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
{ __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
void
store(_Tp __i, memory_order __m = memory_order_seq_cst) volatile noexcept
{ __atomic_store(std::__addressof(_M_i), std::__addressof(__i), __m); }
_Tp
load(memory_order __m = memory_order_seq_cst) const noexcept
{
alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
__atomic_load(std::__addressof(_M_i), __ptr, __m);
return *__ptr;
}
_Tp
load(memory_order __m = memory_order_seq_cst) const volatile noexcept
{
alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
__atomic_load(std::__addressof(_M_i), __ptr, __m);
return *__ptr;
}
_Tp
exchange(_Tp __i, memory_order __m = memory_order_seq_cst) noexcept
{
alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
__atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
__ptr, __m);
return *__ptr;
}
_Tp
exchange(_Tp __i,
memory_order __m = memory_order_seq_cst) volatile noexcept
{
alignas(_Tp) unsigned char __buf[sizeof(_Tp)];
_Tp* __ptr = reinterpret_cast<_Tp*>(__buf);
__atomic_exchange(std::__addressof(_M_i), std::__addressof(__i),
__ptr, __m);
return *__ptr;
}
bool
compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
memory_order __f) noexcept
{
return __atomic_compare_exchange(std::__addressof(_M_i),
std::__addressof(__e),
std::__addressof(__i),
true, __s, __f);
}
bool
compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s,
memory_order __f) volatile noexcept
{
return __atomic_compare_exchange(std::__addressof(_M_i),
std::__addressof(__e),
std::__addressof(__i),
true, __s, __f);
}
bool
compare_exchange_weak(_Tp& __e, _Tp __i,
memory_order __m = memory_order_seq_cst) noexcept
{ return compare_exchange_weak(__e, __i, __m,
__cmpexch_failure_order(__m)); }
bool
compare_exchange_weak(_Tp& __e, _Tp __i,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return compare_exchange_weak(__e, __i, __m,
__cmpexch_failure_order(__m)); }
bool
compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
memory_order __f) noexcept
{
return __atomic_compare_exchange(std::__addressof(_M_i),
std::__addressof(__e),
std::__addressof(__i),
false, __s, __f);
}
bool
compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s,
memory_order __f) volatile noexcept
{
return __atomic_compare_exchange(std::__addressof(_M_i),
std::__addressof(__e),
std::__addressof(__i),
false, __s, __f);
}
bool
compare_exchange_strong(_Tp& __e, _Tp __i,
memory_order __m = memory_order_seq_cst) noexcept
{ return compare_exchange_strong(__e, __i, __m,
__cmpexch_failure_order(__m)); }
bool
compare_exchange_strong(_Tp& __e, _Tp __i,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return compare_exchange_strong(__e, __i, __m,
__cmpexch_failure_order(__m)); }
};
/// Partial specialization for pointer types.
template<typename _Tp>
struct atomic<_Tp*>
{
typedef _Tp* __pointer_type;
typedef __atomic_base<_Tp*> __base_type;
__base_type _M_b;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__pointer_type __p) noexcept : _M_b(__p) { }
operator __pointer_type() const noexcept
{ return __pointer_type(_M_b); }
operator __pointer_type() const volatile noexcept
{ return __pointer_type(_M_b); }
__pointer_type
operator=(__pointer_type __p) noexcept
{ return _M_b.operator=(__p); }
__pointer_type
operator=(__pointer_type __p) volatile noexcept
{ return _M_b.operator=(__p); }
__pointer_type
operator++(int) noexcept
{ return _M_b++; }
__pointer_type
operator++(int) volatile noexcept
{ return _M_b++; }
__pointer_type
operator--(int) noexcept
{ return _M_b--; }
__pointer_type
operator--(int) volatile noexcept
{ return _M_b--; }
__pointer_type
operator++() noexcept
{ return ++_M_b; }
__pointer_type
operator++() volatile noexcept
{ return ++_M_b; }
__pointer_type
operator--() noexcept
{ return --_M_b; }
__pointer_type
operator--() volatile noexcept
{ return --_M_b; }
__pointer_type
operator+=(ptrdiff_t __d) noexcept
{ return _M_b.operator+=(__d); }
__pointer_type
operator+=(ptrdiff_t __d) volatile noexcept
{ return _M_b.operator+=(__d); }
__pointer_type
operator-=(ptrdiff_t __d) noexcept
{ return _M_b.operator-=(__d); }
__pointer_type
operator-=(ptrdiff_t __d) volatile noexcept
{ return _M_b.operator-=(__d); }
bool
is_lock_free() const noexcept
{ return _M_b.is_lock_free(); }
bool
is_lock_free() const volatile noexcept
{ return _M_b.is_lock_free(); }
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_POINTER_LOCK_FREE == 2;
#endif
void
store(__pointer_type __p,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_b.store(__p, __m); }
void
store(__pointer_type __p,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_b.store(__p, __m); }
__pointer_type
load(memory_order __m = memory_order_seq_cst) const noexcept
{ return _M_b.load(__m); }
__pointer_type
load(memory_order __m = memory_order_seq_cst) const volatile noexcept
{ return _M_b.load(__m); }
__pointer_type
exchange(__pointer_type __p,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_b.exchange(__p, __m); }
__pointer_type
exchange(__pointer_type __p,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_b.exchange(__p, __m); }
bool
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
memory_order __m1, memory_order __m2) noexcept
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
bool
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
memory_order __m1,
memory_order __m2) volatile noexcept
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
bool
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
memory_order __m = memory_order_seq_cst) noexcept
{
return compare_exchange_weak(__p1, __p2, __m,
__cmpexch_failure_order(__m));
}
bool
compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
memory_order __m = memory_order_seq_cst) volatile noexcept
{
return compare_exchange_weak(__p1, __p2, __m,
__cmpexch_failure_order(__m));
}
bool
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
memory_order __m1, memory_order __m2) noexcept
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
bool
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
memory_order __m1,
memory_order __m2) volatile noexcept
{ return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
bool
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
memory_order __m = memory_order_seq_cst) noexcept
{
return _M_b.compare_exchange_strong(__p1, __p2, __m,
__cmpexch_failure_order(__m));
}
bool
compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
memory_order __m = memory_order_seq_cst) volatile noexcept
{
return _M_b.compare_exchange_strong(__p1, __p2, __m,
__cmpexch_failure_order(__m));
}
__pointer_type
fetch_add(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_b.fetch_add(__d, __m); }
__pointer_type
fetch_add(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_b.fetch_add(__d, __m); }
__pointer_type
fetch_sub(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) noexcept
{ return _M_b.fetch_sub(__d, __m); }
__pointer_type
fetch_sub(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) volatile noexcept
{ return _M_b.fetch_sub(__d, __m); }
};
/// Explicit specialization for char.
template<>
struct atomic<char> : __atomic_base<char>
{
typedef char __integral_type;
typedef __atomic_base<char> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for signed char.
template<>
struct atomic<signed char> : __atomic_base<signed char>
{
typedef signed char __integral_type;
typedef __atomic_base<signed char> __base_type;
atomic() noexcept= default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for unsigned char.
template<>
struct atomic<unsigned char> : __atomic_base<unsigned char>
{
typedef unsigned char __integral_type;
typedef __atomic_base<unsigned char> __base_type;
atomic() noexcept= default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for short.
template<>
struct atomic<short> : __atomic_base<short>
{
typedef short __integral_type;
typedef __atomic_base<short> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for unsigned short.
template<>
struct atomic<unsigned short> : __atomic_base<unsigned short>
{
typedef unsigned short __integral_type;
typedef __atomic_base<unsigned short> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for int.
template<>
struct atomic<int> : __atomic_base<int>
{
typedef int __integral_type;
typedef __atomic_base<int> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for unsigned int.
template<>
struct atomic<unsigned int> : __atomic_base<unsigned int>
{
typedef unsigned int __integral_type;
typedef __atomic_base<unsigned int> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for long.
template<>
struct atomic<long> : __atomic_base<long>
{
typedef long __integral_type;
typedef __atomic_base<long> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for unsigned long.
template<>
struct atomic<unsigned long> : __atomic_base<unsigned long>
{
typedef unsigned long __integral_type;
typedef __atomic_base<unsigned long> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for long long.
template<>
struct atomic<long long> : __atomic_base<long long>
{
typedef long long __integral_type;
typedef __atomic_base<long long> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for unsigned long long.
template<>
struct atomic<unsigned long long> : __atomic_base<unsigned long long>
{
typedef unsigned long long __integral_type;
typedef __atomic_base<unsigned long long> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for wchar_t.
template<>
struct atomic<wchar_t> : __atomic_base<wchar_t>
{
typedef wchar_t __integral_type;
typedef __atomic_base<wchar_t> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_WCHAR_T_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for char16_t.
template<>
struct atomic<char16_t> : __atomic_base<char16_t>
{
typedef char16_t __integral_type;
typedef __atomic_base<char16_t> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_CHAR16_T_LOCK_FREE == 2;
#endif
};
/// Explicit specialization for char32_t.
template<>
struct atomic<char32_t> : __atomic_base<char32_t>
{
typedef char32_t __integral_type;
typedef __atomic_base<char32_t> __base_type;
atomic() noexcept = default;
~atomic() noexcept = default;
atomic(const atomic&) = delete;
atomic& operator=(const atomic&) = delete;
atomic& operator=(const atomic&) volatile = delete;
constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
using __base_type::operator __integral_type;
using __base_type::operator=;
#if __cplusplus > 201402L
static constexpr bool is_always_lock_free = ATOMIC_CHAR32_T_LOCK_FREE == 2;
#endif
};
/// atomic_bool
typedef atomic<bool> atomic_bool;
/// atomic_char
typedef atomic<char> atomic_char;
/// atomic_schar
typedef atomic<signed char> atomic_schar;
/// atomic_uchar
typedef atomic<unsigned char> atomic_uchar;
/// atomic_short
typedef atomic<short> atomic_short;
/// atomic_ushort
typedef atomic<unsigned short> atomic_ushort;
/// atomic_int
typedef atomic<int> atomic_int;
/// atomic_uint
typedef atomic<unsigned int> atomic_uint;
/// atomic_long
typedef atomic<long> atomic_long;
/// atomic_ulong
typedef atomic<unsigned long> atomic_ulong;
/// atomic_llong
typedef atomic<long long> atomic_llong;
/// atomic_ullong
typedef atomic<unsigned long long> atomic_ullong;
/// atomic_wchar_t
typedef atomic<wchar_t> atomic_wchar_t;
/// atomic_char16_t
typedef atomic<char16_t> atomic_char16_t;
/// atomic_char32_t
typedef atomic<char32_t> atomic_char32_t;
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2441. Exact-width atomic typedefs should be provided
/// atomic_int8_t
typedef atomic<int8_t> atomic_int8_t;
/// atomic_uint8_t
typedef atomic<uint8_t> atomic_uint8_t;
/// atomic_int16_t
typedef atomic<int16_t> atomic_int16_t;
/// atomic_uint16_t
typedef atomic<uint16_t> atomic_uint16_t;
/// atomic_int32_t
typedef atomic<int32_t> atomic_int32_t;
/// atomic_uint32_t
typedef atomic<uint32_t> atomic_uint32_t;
/// atomic_int64_t
typedef atomic<int64_t> atomic_int64_t;
/// atomic_uint64_t
typedef atomic<uint64_t> atomic_uint64_t;
/// atomic_int_least8_t
typedef atomic<int_least8_t> atomic_int_least8_t;
/// atomic_uint_least8_t
typedef atomic<uint_least8_t> atomic_uint_least8_t;
/// atomic_int_least16_t
typedef atomic<int_least16_t> atomic_int_least16_t;
/// atomic_uint_least16_t
typedef atomic<uint_least16_t> atomic_uint_least16_t;
/// atomic_int_least32_t
typedef atomic<int_least32_t> atomic_int_least32_t;
/// atomic_uint_least32_t
typedef atomic<uint_least32_t> atomic_uint_least32_t;
/// atomic_int_least64_t
typedef atomic<int_least64_t> atomic_int_least64_t;
/// atomic_uint_least64_t
typedef atomic<uint_least64_t> atomic_uint_least64_t;
/// atomic_int_fast8_t
typedef atomic<int_fast8_t> atomic_int_fast8_t;
/// atomic_uint_fast8_t
typedef atomic<uint_fast8_t> atomic_uint_fast8_t;
/// atomic_int_fast16_t
typedef atomic<int_fast16_t> atomic_int_fast16_t;
/// atomic_uint_fast16_t
typedef atomic<uint_fast16_t> atomic_uint_fast16_t;
/// atomic_int_fast32_t
typedef atomic<int_fast32_t> atomic_int_fast32_t;
/// atomic_uint_fast32_t
typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
/// atomic_int_fast64_t
typedef atomic<int_fast64_t> atomic_int_fast64_t;
/// atomic_uint_fast64_t
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
#endif
/// atomic_intptr_t
typedef atomic<intptr_t> atomic_intptr_t;
/// atomic_uintptr_t
typedef atomic<uintptr_t> atomic_uintptr_t;
/// atomic_size_t
typedef atomic<size_t> atomic_size_t;
/// atomic_ptrdiff_t
typedef atomic<ptrdiff_t> atomic_ptrdiff_t;
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
/// atomic_intmax_t
typedef atomic<intmax_t> atomic_intmax_t;
/// atomic_uintmax_t
typedef atomic<uintmax_t> atomic_uintmax_t;
#endif
// Function definitions, atomic_flag operations.
inline bool
atomic_flag_test_and_set_explicit(atomic_flag* __a,
memory_order __m) noexcept
{ return __a->test_and_set(__m); }
inline bool
atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
memory_order __m) noexcept
{ return __a->test_and_set(__m); }
inline void
atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
{ __a->clear(__m); }
inline void
atomic_flag_clear_explicit(volatile atomic_flag* __a,
memory_order __m) noexcept
{ __a->clear(__m); }
inline bool
atomic_flag_test_and_set(atomic_flag* __a) noexcept
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
inline bool
atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
inline void
atomic_flag_clear(atomic_flag* __a) noexcept
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
inline void
atomic_flag_clear(volatile atomic_flag* __a) noexcept
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
// Function templates generally applicable to atomic types.
template<typename _ITp>
inline bool
atomic_is_lock_free(const atomic<_ITp>* __a) noexcept
{ return __a->is_lock_free(); }
template<typename _ITp>
inline bool
atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept
{ return __a->is_lock_free(); }
template<typename _ITp>
inline void
atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept
{ __a->store(__i, memory_order_relaxed); }
template<typename _ITp>
inline void
atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept
{ __a->store(__i, memory_order_relaxed); }
template<typename _ITp>
inline void
atomic_store_explicit(atomic<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ __a->store(__i, __m); }
template<typename _ITp>
inline void
atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ __a->store(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept
{ return __a->load(__m); }
template<typename _ITp>
inline _ITp
atomic_load_explicit(const volatile atomic<_ITp>* __a,
memory_order __m) noexcept
{ return __a->load(__m); }
template<typename _ITp>
inline _ITp
atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->exchange(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->exchange(__i, __m); }
template<typename _ITp>
inline bool
atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2,
memory_order __m1,
memory_order __m2) noexcept
{ return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
template<typename _ITp>
inline bool
atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2,
memory_order __m1,
memory_order __m2) noexcept
{ return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
template<typename _ITp>
inline bool
atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2,
memory_order __m1,
memory_order __m2) noexcept
{ return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
template<typename _ITp>
inline bool
atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2,
memory_order __m1,
memory_order __m2) noexcept
{ return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
template<typename _ITp>
inline void
atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept
{ atomic_store_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline void
atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept
{ atomic_store_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_load(const atomic<_ITp>* __a) noexcept
{ return atomic_load_explicit(__a, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_load(const volatile atomic<_ITp>* __a) noexcept
{ return atomic_load_explicit(__a, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept
{ return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept
{ return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline bool
atomic_compare_exchange_weak(atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2) noexcept
{
return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
memory_order_seq_cst,
memory_order_seq_cst);
}
template<typename _ITp>
inline bool
atomic_compare_exchange_weak(volatile atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2) noexcept
{
return atomic_compare_exchange_weak_explicit(__a, __i1, __i2,
memory_order_seq_cst,
memory_order_seq_cst);
}
template<typename _ITp>
inline bool
atomic_compare_exchange_strong(atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2) noexcept
{
return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
memory_order_seq_cst,
memory_order_seq_cst);
}
template<typename _ITp>
inline bool
atomic_compare_exchange_strong(volatile atomic<_ITp>* __a,
_ITp* __i1, _ITp __i2) noexcept
{
return atomic_compare_exchange_strong_explicit(__a, __i1, __i2,
memory_order_seq_cst,
memory_order_seq_cst);
}
// Function templates for atomic_integral operations only, using
// __atomic_base. Template argument should be constricted to
// intergral types as specified in the standard, excluding address
// types.
template<typename _ITp>
inline _ITp
atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_add(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_add(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_sub(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_sub(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_and(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_and(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_or(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_or(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_xor(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
memory_order __m) noexcept
{ return __a->fetch_xor(__i, __m); }
template<typename _ITp>
inline _ITp
atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
template<typename _ITp>
inline _ITp
atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
{ return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
// Partial specializations for pointers.
template<typename _ITp>
inline _ITp*
atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
memory_order __m) noexcept
{ return __a->fetch_add(__d, __m); }
template<typename _ITp>
inline _ITp*
atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d,
memory_order __m) noexcept
{ return __a->fetch_add(__d, __m); }
template<typename _ITp>
inline _ITp*
atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
{ return __a->fetch_add(__d); }
template<typename _ITp>
inline _ITp*
atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
{ return __a->fetch_add(__d); }
template<typename _ITp>
inline _ITp*
atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a,
ptrdiff_t __d, memory_order __m) noexcept
{ return __a->fetch_sub(__d, __m); }
template<typename _ITp>
inline _ITp*
atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
memory_order __m) noexcept
{ return __a->fetch_sub(__d, __m); }
template<typename _ITp>
inline _ITp*
atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
{ return __a->fetch_sub(__d); }
template<typename _ITp>
inline _ITp*
atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
{ return __a->fetch_sub(__d); }
// @} group atomics
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // C++11
#endif // _GLIBCXX_ATOMIC
| [
"smallville7123"
] | smallville7123 | |
a7479756ad61f0b131d55af973f463bd8f1ef987 | c68f791005359cfec81af712aae0276c70b512b0 | /0-unclassified/rum.cpp | 8aeb40f9ed8a091b767996131596a56d04baec05 | [] | no_license | luqmanarifin/cp | 83b3435ba2fdd7e4a9db33ab47c409adb088eb90 | 08c2d6b6dd8c4eb80278ec34dc64fd4db5878f9f | refs/heads/master | 2022-10-16T14:30:09.683632 | 2022-10-08T20:35:42 | 2022-10-08T20:35:42 | 51,346,488 | 106 | 46 | null | 2017-04-16T11:06:18 | 2016-02-09T04:26:58 | C++ | UTF-8 | C++ | false | false | 2,745 | cpp | #include <bits/stdc++.h>
typedef long long LL;
typedef double DB;
#define sf scanf
#define pf printf
#define mp make_pair
#define nl printf("\n")
#define FOR(i,a,b) for(i = a; i <= b; ++i)
#define FORD(i,a,b) for(i = a; i >= b; --i)
#define FORS(i,n) for(i = 0; i < n; ++i)
#define FORM(i,n) for(i = n - 1; i >= 0; --i)
#define reset(i,n) memset(i, n, sizeof(i))
#define open freopen("rumah.txt","r",stdin); freopen("out2.txt","w",stdout)
#define close fclose(stdin); fclose(stdout)
using namespace std;
const LL mod = 1e9 + 7;
const LL INF = 4e18;
const int inf = 2e9;
const int N = 1e5 + 5;
const int N6 = 1e6 + 5;
int gcd(int a, int b) { return b? gcd(b, a%b): a; }
int lcm(int a, int b) { return a/ gcd(a, b)*b; }
bool row[N], col[N];
int nrow, ncol;
map<LL, LL> cnt;
vector<pair<LL, LL> > ans;
int b[N6], a[N6];
LL w[N6], ten[20];
inline int dig(LL num, int sh) {
return (num/ten[sh]) % 10;
}
void radix_sort() {
queue<pair<LL, LL> > q[10];
int sz = (int) ans.size(), i, j;
FOR(i, 0, 18) {
FORS(j, sz) {
q[dig(ans[j].first, i)].push(ans[j]);
}
int t = 0;
FORS(j, 10) {
while(!q[j].empty()) {
ans[t++] = q[j].front();
q[j].pop();
}
}
}
FOR(i, 0, 10) {
FORS(j, sz) {
q[dig(ans[j].second, i)].push(ans[j]);
}
int t = 0;
FORM(j, 10) {
while(!q[j].empty()) {
ans[t++] = q[j].front();
q[j].pop();
}
}
}
}
inline bool cmp(pair<LL,LL> lef, pair<LL, LL> rig) {
if(lef.second != rig.second)
return lef.second > rig.second;
return lef.first < rig.first;
}
int main()
{
open;
clock_t t = clock();
int i, n, m, q;
ten[0] = 1;
FOR(i, 1, 19) ten[i] = ten[i-1]*10;
//FORS(i, 20) pf("%d %lld\n", i, ten[i]);
sf("%d %d %d", &n, &m, &q);
FORS(i, q) {
sf("%d %d %lld", &b[i], &a[i], &w[i]);
}
FORM(i, q) {
if(b[i] == 1) {
if(row[a[i]]) continue;
cnt[w[i]] += m - ncol;
nrow++;
row[a[i]] = 1;
} else {
if(col[a[i]]) continue;
cnt[w[i]] += n - nrow;
ncol++;
col[a[i]] = 1;
}
}
FORS(i, q) {
LL now = cnt[w[i]];
if(now == 0) continue;
ans.push_back(mp(w[i], now));
cnt[w[i]] = 0;
}
radix_sort();
int sz = (int) ans.size();
pf("%d\n", sz);
FORS(i, sz) {
pf("%lld %lld\n", ans[i].first, ans[i].second);
}
t = clock() - t;
printf ("It took me %lf ms.\n", ((double)t)*1000/CLOCKS_PER_SEC);
close;
return 0;
} | [
"l.arifin.siswanto@gmail.com"
] | l.arifin.siswanto@gmail.com |
4cb17384328b43337c1a56d53bb3a5d6e3764a69 | 024b485be357685c5f097ae5917397ed89a80916 | /week5/day33/exercise/v4_eventfdReactorThreadPool/eventLoop.cpp | 0c541ab5c0c07aa597b255a91b8b509a911cbd7f | [] | no_license | FGee/Cppgit | c87876e273cc5b4862f59d6a81c62bea7537ac4f | a32af5bd5c7178265a4edf6be2bcc6a07a9b2bff | refs/heads/master | 2020-05-15T23:13:47.988591 | 2019-06-22T14:32:43 | 2019-06-22T14:32:43 | 182,546,970 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,217 | cpp | #include "eventLoop.h"
#include "macro.h"
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <sys/eventfd.h>
#include <iostream>
using namespace std;
namespace wd
{
EventLoop::EventLoop(Acceptor& a)
: _epFd(epollCreate()), _acceptor(a),
_events(1024), _isLooping(false),
_evFd(createEventFd()) {}
int EventLoop::epollCreate()
{
int tmp = epoll_create(1);
if (-1 == tmp) { ERROR_EXIT("epoll_create"); }
return tmp;
}
void EventLoop::loop()
{
_isLooping = true;
addEventRead(_acceptor.listenFdGet()); // 先注册连接接收器的listenFd
addEventRead(_evFd);
while (_isLooping) {
epollWait();
}
}
void EventLoop::unloop()
{
if (_isLooping) {
_isLooping = false;
}
}
void EventLoop::epollWait()
{
int readyNum;
do {
readyNum = epoll_wait(_epFd, &*_events.begin(), _events.size(), 5000);
} while (readyNum == -1 && errno == EINTR);
if (-1 == readyNum) {
ERROR_EXIT("epoll_wait");
} else if (0 == readyNum) {
cout << "*****Time out*****" << endl;
} else {
if (readyNum == static_cast<int>(_events.size())) { _events.resize(readyNum * 2); }
for (int i = 0; i < readyNum; ++i) {
int fd = _events[i].data.fd;
if (fd == _acceptor.listenFdGet()) {
if (_events[i].events & EPOLLIN) {
handleNewConnect();
}
} else if (fd == _evFd) {
uint64_t number;
int ret = read(_evFd, &number, sizeof(number));
if (sizeof(uint64_t) != ret) { ERROR_EXIT("read"); }
doPendingFunc();
} else {
if (_events[i].events & EPOLLIN) {
handleMessage(fd);
}
}
}
}
}
void EventLoop::handleNewConnect()
{
int newfd = _acceptor.accept();
auto newConn = make_pair(newfd, make_shared<TcpConnection>(newfd, this));
_conns.insert(newConn);
addEventRead(newfd);
auto spNewConn = _conns[newfd];
spNewConn->setOnConnectCallBack(_onConnect);
spNewConn->setOnMessageCallBack(_onMessage);
spNewConn->setOnCloseCallBack(_onClose);
_conns[newfd]->doOnConnectCallBack();
}
void EventLoop::addEventRead(int newfd)
{
struct epoll_event tmp;
memset(&tmp, 0, sizeof(struct epoll_event));
tmp.events = EPOLLIN;
tmp.data.fd = newfd;
int ret = epoll_ctl(_epFd, EPOLL_CTL_ADD, newfd, &tmp);
if (ret == -1) { ERROR_EXIT("epoll_ctl"); }
}
void EventLoop::handleMessage(int fd)
{
bool closed = isConnectionClosed(fd);
auto retIter = _conns.find(fd);
assert(_conns.end() != retIter);
if (true == closed) {
handleConnectClose(fd);
} else {
auto spConn = _conns[fd];
spConn->doOnMessageCallBack();
}
}
bool EventLoop::isConnectionClosed(int fd)
{
int ret;
do {
char buf[1024];
ret = recv(fd, buf, sizeof(buf), MSG_PEEK);
} while (-1 == ret && errno == EINTR);
return 0 == ret;
}
void EventLoop::handleConnectClose(int fdClosed)
{
_conns[fdClosed]->doOnCloseCallBack();
// 这里一定要注意取消epoll和删除conn的先后顺序,删除其conn的时候,会调用Socket对象中的析构函数
// 里的close(fdClosed)方法;在这之后进行epoll_ctl(EPOLL_CTL_DEL) 会返回-1并将errno置位
//cout << ">> fd : " << fdClosed << endl;
deleteEventRead(fdClosed); // 取消对fdClosed的监控
auto retIter = _conns.find(fdClosed);
_conns.erase(retIter); // 从map中删除这个TcpConnection的对象
}
void EventLoop::deleteEventRead(int fd)
{
struct epoll_event tmp;
memset(&tmp, 0, sizeof(struct epoll_event));
tmp.data.fd = fd;
int ret = epoll_ctl(_epFd, EPOLL_CTL_DEL, fd, &tmp);
if (ret == -1) { ERROR_EXIT("epoll_ctl"); }
}
void EventLoop::setOnConnect(CallBackFunc&& cb)
{ _onConnect = move(cb); }
void EventLoop::setOnMessage(CallBackFunc&& cb)
{ _onMessage = move(cb); }
void EventLoop::setOnClose(CallBackFunc&& cb)
{ _onClose = move(cb); }
int EventLoop::createEventFd()
{
int evFd = eventfd(0, 0); // 如果为0的话,则第一次不会去执行
if (-1 == evFd) { ERROR_EXIT("eventfd"); }
return evFd;
}
void EventLoop::doInLoop(SendMsgCallBack&& sndCb)
{
{
MutexLockGuard lockGuard(_mutexLock);
_sendCbList.push_back(move(sndCb));
}
weak();
}
void EventLoop::doPendingFunc()
{
//{
// MutexLockGuard lockGuard(_mutexLock);
// for (auto & SendCb : _sendCbList) {
// SendCb();
// }
// vector<SendMsgCallBack>().swap(_sendCbList); // 采用这种方式清空容器的元素,效率极高
// 不单只是capcity和size均变为0
// 利用了临时对象的清空机制
//}
vector<SendMsgCallBack> tmp;
{
MutexLockGuard lockGuard(_mutexLock);
tmp.swap(_sendCbList);
}
for (auto & sendCbFunc : tmp) {
sendCbFunc();
}
}
void EventLoop::weak()
{
uint64_t number = 666;
int ret = write(_evFd, &number, sizeof(number));
if (sizeof(uint64_t) != ret) { ERROR_EXIT("write"); }
}
}
| [
"811806813@qq.com"
] | 811806813@qq.com |
60d9222336d064049960496b80379718549a59c8 | 5a60d60fca2c2b8b44d602aca7016afb625bc628 | /aws-cpp-sdk-kendra/source/model/AssociatePersonasToEntitiesResult.cpp | 76bf0a76ff8c623340fb5a288b633f34bf1284ab | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | yuatpocketgems/aws-sdk-cpp | afaa0bb91b75082b63236cfc0126225c12771ed0 | a0dcbc69c6000577ff0e8171de998ccdc2159c88 | refs/heads/master | 2023-01-23T10:03:50.077672 | 2023-01-04T22:42:53 | 2023-01-04T22:42:53 | 134,497,260 | 0 | 1 | null | 2018-05-23T01:47:14 | 2018-05-23T01:47:14 | null | UTF-8 | C++ | false | false | 1,331 | cpp | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/kendra/model/AssociatePersonasToEntitiesResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::kendra::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
AssociatePersonasToEntitiesResult::AssociatePersonasToEntitiesResult()
{
}
AssociatePersonasToEntitiesResult::AssociatePersonasToEntitiesResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
AssociatePersonasToEntitiesResult& AssociatePersonasToEntitiesResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("FailedEntityList"))
{
Aws::Utils::Array<JsonView> failedEntityListJsonList = jsonValue.GetArray("FailedEntityList");
for(unsigned failedEntityListIndex = 0; failedEntityListIndex < failedEntityListJsonList.GetLength(); ++failedEntityListIndex)
{
m_failedEntityList.push_back(failedEntityListJsonList[failedEntityListIndex].AsObject());
}
}
return *this;
}
| [
"aws-sdk-cpp-automation@github.com"
] | aws-sdk-cpp-automation@github.com |
4c232a03b84a21d911d6fed2f81a914f3b4b7c45 | 19194c2f2c07ab3537f994acfbf6b34ea9b55ae7 | /android-33/android/icu/util/Currency.def.hpp | 6eba02bd741b393d8c8323a0fa4baa48951f1410 | [
"GPL-3.0-only"
] | permissive | YJBeetle/QtAndroidAPI | e372609e9db0f96602da31b8417c9f5972315cae | ace3f0ea2678967393b5eb8e4edba7fa2ca6a50c | refs/heads/Qt6 | 2023-08-05T03:14:11.842336 | 2023-07-24T08:35:31 | 2023-07-24T08:35:31 | 249,539,770 | 19 | 4 | Apache-2.0 | 2022-03-14T12:15:32 | 2020-03-23T20:42:54 | C++ | UTF-8 | C++ | false | false | 2,836 | hpp | #pragma once
#include "./MeasureUnit.def.hpp"
class JArray;
class JArray;
class JArray;
class JBooleanArray;
namespace android::icu::util
{
class Currency_CurrencyUsage;
}
namespace android::icu::util
{
class ULocale;
}
class JString;
namespace java::util
{
class Currency;
}
namespace java::util
{
class Date;
}
namespace java::util
{
class Locale;
}
namespace android::icu::util
{
class Currency : public android::icu::util::MeasureUnit
{
public:
// Fields
static jint FORMAL_SYMBOL_NAME();
static jint LONG_NAME();
static jint NARROW_SYMBOL_NAME();
static jint PLURAL_LONG_NAME();
static jint SYMBOL_NAME();
static jint VARIANT_SYMBOL_NAME();
// QJniObject forward
template<typename ...Ts> explicit Currency(const char *className, const char *sig, Ts...agv) : android::icu::util::MeasureUnit(className, sig, std::forward<Ts>(agv)...) {}
Currency(QJniObject obj) : android::icu::util::MeasureUnit(obj) {}
// Constructors
// Methods
static android::icu::util::Currency fromJavaCurrency(java::util::Currency arg0);
static JObject getAvailableCurrencies();
static JArray getAvailableCurrencyCodes(android::icu::util::ULocale arg0, java::util::Date arg1);
static JArray getAvailableCurrencyCodes(java::util::Locale arg0, java::util::Date arg1);
static JArray getAvailableLocales();
static JArray getAvailableULocales();
static android::icu::util::Currency getInstance(android::icu::util::ULocale arg0);
static android::icu::util::Currency getInstance(JString arg0);
static android::icu::util::Currency getInstance(java::util::Locale arg0);
static JArray getKeywordValuesForLocale(JString arg0, android::icu::util::ULocale arg1, jboolean arg2);
static jboolean isAvailable(JString arg0, java::util::Date arg1, java::util::Date arg2);
JString getCurrencyCode() const;
jint getDefaultFractionDigits() const;
jint getDefaultFractionDigits(android::icu::util::Currency_CurrencyUsage arg0) const;
JString getDisplayName() const;
JString getDisplayName(java::util::Locale arg0) const;
JString getName(android::icu::util::ULocale arg0, jint arg1, JBooleanArray arg2) const;
JString getName(java::util::Locale arg0, jint arg1, JBooleanArray arg2) const;
JString getName(android::icu::util::ULocale arg0, jint arg1, JString arg2, JBooleanArray arg3) const;
JString getName(java::util::Locale arg0, jint arg1, JString arg2, JBooleanArray arg3) const;
jint getNumericCode() const;
jdouble getRoundingIncrement() const;
jdouble getRoundingIncrement(android::icu::util::Currency_CurrencyUsage arg0) const;
JString getSymbol() const;
JString getSymbol(android::icu::util::ULocale arg0) const;
JString getSymbol(java::util::Locale arg0) const;
java::util::Currency toJavaCurrency() const;
JString toString() const;
};
} // namespace android::icu::util
| [
"YJBeetle@gmail.com"
] | YJBeetle@gmail.com |
1b360323604acb6ffc188d54b0b72d94fcb484f8 | 24c3b6ee3e2b06288bed587e34751969b4a73e31 | /AtCoder/AtCoder Regular Contest/ARC012/C.cpp | d307a9813ab41c735051b0a17c694c098630e332 | [] | no_license | KatsuyaKikuchi/ProgrammingContest | 89afbda50d1cf59fc58d8a9e25e6660334f18a2a | d9254202eec56f96d8c5b508556464a3f87a0a4f | refs/heads/master | 2023-06-05T20:07:36.334182 | 2021-06-13T13:55:06 | 2021-06-13T13:55:06 | 318,641,671 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,143 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
const ll MAX = 19;
string S[20];
pll x[4] = {pll(-1, 0), pll(-1, -1), pll(0, -1), pll(1, -1)};
pll y[4] = {pll(1, 0), pll(1, 1), pll(0, 1), pll(-1, 1)};
ll check(pll g, char c) {
ll ret = 0;
REP(i, 4) {
ll m0 = 0;
{
ll nx = g.first, ny = g.second;
while (nx >= 0 && nx < MAX && ny >= 0 && ny < MAX && S[nx][ny] == c) {
m0++;
nx += x[i].first;
ny += x[i].second;
}
}
if (m0 > 5)
return INF;
ll m1 = 0;
{
ll nx = g.first, ny = g.second;
while (nx >= 0 && nx < MAX && ny >= 0 && ny < MAX && S[nx][ny] == c) {
m1++;
nx += y[i].first;
ny += y[i].second;
}
}
if (m1 > 5)
return INF;
if (m1 + m0 - 1 >= 5)
ret++;
}
return ret;
}
void calc(pll g, function<pll(pll a)> f, bool fin, ll &m, ll &bl, ll &bw, ll &wl, ll &ww) {
pll p = f(g);
if (S[g.first][g.second] == S[p.first][p.second])
m++;
if (S[g.first][g.second] != S[p.first][p.second] || fin) {
if (S[p.first][p.second] == 'o') {
bl = std::max(m, bl);
if (m >= 5)
bw++;
}
else if (S[p.first][p.second] == 'x') {
wl = std::max(m, wl);
if (m >= 5)
ww++;
}
m = 1;
}
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
REP(i, MAX) {
cin >> S[i];
}
ll bn = 0, wn = 0;
REP(i, MAX) {
REP(j, MAX) {
if (S[i][j] == 'o')
bn++;
if (S[i][j] == 'x')
wn++;
}
}
ll bw = 0, ww = 0, bl = 0, wl = 0;
REP(i, MAX) {
ll m = 1;
{
ll m = 1;
FOR(j, MAX, 1) {
calc(pll(i, j), [](pll a) { return pll(a.first, a.second - 1); },
j == MAX - 1, m, bl, bw, wl, ww);
}
}
{
ll m = 1;
FOR(j, MAX, 1) {
calc(pll(j, i), [](pll a) { return pll(a.first - 1, a.second); },
j == MAX - 1, m, bl, bw, wl, ww);
}
}
{
ll m = 1;
FOR(j, MAX, 1) {
if (i + j >= MAX)
break;
calc(pll(i + j, j), [](pll a) { return pll(a.first - 1, a.second - 1); },
j == MAX - 1 || i + j == MAX - 1, m, bl, bw, wl, ww);
}
}
if (i > 0) {
ll m = 1;
FOR(j, MAX, 1) {
if (i + j >= MAX)
break;
calc(pll(j, i + j), [](pll a) { return pll(a.first - 1, a.second - 1); },
j == MAX - 1 || i + j == MAX - 1, m, bl, bw, wl, ww);
}
}
{
ll m = 1;
FOR(j, MAX, 1) {
if (i - j < 0)
break;
calc(pll(i - j, j), [](pll a) { return pll(a.first + 1, a.second - 1); },
j == MAX - 1 || i - j == 0, m, bl, bw, wl, ww);
}
}
if (i > 0) {
ll m = 1;
FOR(j, MAX, 1) {
if (i + j >= MAX)
break;
calc(pll(MAX - 1 - j, i + j), [](pll a) { return pll(a.first + 1, a.second - 1); },
j == MAX - 1 || i + j == MAX - 1, m, bl, bw, wl, ww);
}
}
}
//cout << bl << " " << bw << "," << wl << " " << ww << endl;
if (bw > 0 && ww > 0) {
cout << "NO" << endl;
return 0;
}
if (bl >= 10 || wl >= 10) {
cout << "NO" << endl;
return 0;
}
ll n = bn - wn;
if (n < 0 || n > 1 || (ww > 0 && n != 0) || (bw > 0 && n != 1)) {
cout << "NO" << endl;
return 0;
}
if (bw > 0) {
bool e = false;
REP(i, MAX) {
REP(j, MAX) {
if (S[i][j] != 'o')
continue;
//! (i,j)に最後に置く
if (check(pll(i, j), S[i][j]) == bw) {
e = true;
}
}
}
if (!e) {
cout << "NO" << endl;
return 0;
}
}
else if (ww > 0) {
bool e = false;
REP(i, MAX) {
REP(j, MAX) {
if (S[i][j] != 'x')
continue;
//! (i,j)に最後に置く
ll ret = check(pll(i, j), S[i][j]);
//cout << ret << endl;
if (ret == ww) {
e = true;
}
}
}
if (!e) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
} | [
"k.kikuchi.ah@gmail.com"
] | k.kikuchi.ah@gmail.com |
855ca8aeb5a2d0871ba83f585ca350d5685f7e9d | 6e57dfee487814730c1316d23095d6e4ca8afbb2 | /src/algo.cpp | 6faf1423d4e73fea88d42a7650325321c85b0641 | [] | no_license | DingYu95/KinectObjectTracking | 340ffee8840505b59a9b6edc6a5c0643de0a4177 | 8d02735a6429d7465134bcbe79a0f9a375f4f3af | refs/heads/master | 2020-03-12T10:45:11.506492 | 2018-04-22T15:25:06 | 2018-04-22T15:25:06 | 130,580,235 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,056 | cpp | #include "algo.h"
using namespace std;
using namespace cv;
void BFS_Online(cv::Mat &InputMat, cv::Mat &LabelMat, cv::Point2i cur_SP, cv::Point3i &cCenter, int Thresh){
cCenter = cv::Point3i(-1, -1, -1);
UINT16* const InputArray = (UINT16* const)InputMat.data;
UINT8* LabelArray = LabelMat.data;
ushort cur_Label = 255;
//Return if already visited
if (LabelArray[cur_SP.y * LabelMat.cols + cur_SP.x])
{
return;
}
UINT BFS_Queue_Array[10000][2];
long sumX(0), sumY(0), sumZ(0);
int left_most(999), right_most(0), up_most(999), down_most(0);
const int width_max = 120;
const int height_max = 120;
//Start the BFS
long cur_Array_Index = 0;
long lst_Array_Index = 0;
++cur_Array_Index;
BFS_Queue_Array[lst_Array_Index][0] = cur_SP.x;
BFS_Queue_Array[lst_Array_Index][1] = cur_SP.y;
BFS_Queue_Array[cur_Array_Index][0] = cur_SP.x;
BFS_Queue_Array[cur_Array_Index][1] = cur_SP.y;
cv::Point2i this_Point;
while (cur_Array_Index< 9000 && lst_Array_Index < cur_Array_Index){
this_Point.x = BFS_Queue_Array[lst_Array_Index][0];
this_Point.y = BFS_Queue_Array[lst_Array_Index][1];
if (this_Point.x > right_most){ right_most = this_Point.x; }
if (this_Point.x < left_most){ left_most = this_Point.x; }
if (this_Point.y < up_most){ up_most = this_Point.y; }
if (this_Point.y > down_most){ down_most = this_Point.y; }
if (this_Point.y >1 && this_Point.y < (InputMat.rows - 2) && this_Point.x > 1 && this_Point.x < (InputMat.cols - 2)){
UINT16 this_Point_dep = InputArray[this_Point.y * InputMat.cols + this_Point.x];
if (!this_Point_dep)
{
++lst_Array_Index;
continue;
}
UINT16 temp_dep = 0;
//Left Point
if (!LabelArray[this_Point.y * LabelMat.cols + this_Point.x - 1]){
temp_dep = InputArray[this_Point.y * InputMat.cols + this_Point.x - 1];
if (std::abs(this_Point_dep - temp_dep) < Thresh){
++cur_Array_Index;
//left_most = this_Point.x - 1;
cv::Point2i left_Point(this_Point.x - 1, this_Point.y);
BFS_Queue_Array[cur_Array_Index][0] = left_Point.x;
BFS_Queue_Array[cur_Array_Index][1] = left_Point.y;
LabelArray[this_Point.y * LabelMat.cols + this_Point.x - 1] = cur_Label;
sumX += left_Point.x;
sumY += left_Point.y;
sumZ += temp_dep;
}
}
//Right Point
if (!LabelArray[this_Point.y * LabelMat.cols + this_Point.x + 1]){
temp_dep = InputArray[this_Point.y * InputMat.cols + this_Point.x + 1];
if (std::abs(this_Point_dep - temp_dep) < Thresh){
++cur_Array_Index;
//right_most = this_Point.x + 1;
cv::Point2i right_Point(this_Point.x + 1, this_Point.y);
BFS_Queue_Array[cur_Array_Index][0] = right_Point.x;
BFS_Queue_Array[cur_Array_Index][1] = right_Point.y;
LabelArray[this_Point.y * LabelMat.cols + this_Point.x + 1] = cur_Label;
sumX += right_Point.x;
sumY += right_Point.y;
sumZ += temp_dep;
}
}
//Up Point
if (!LabelArray[(this_Point.y - 1) * LabelMat.cols + this_Point.x]) {
temp_dep = InputArray[(this_Point.y - 1) * InputMat.cols + this_Point.x];
if (std::abs(this_Point_dep - temp_dep) < Thresh){
++cur_Array_Index;
//up_most = this_Point.y - 1;
cv::Point2i up_Point(this_Point.x, this_Point.y - 1);
BFS_Queue_Array[cur_Array_Index][0] = up_Point.x;
BFS_Queue_Array[cur_Array_Index][1] = up_Point.y;
LabelArray[(this_Point.y - 1) * LabelMat.cols + this_Point.x] = cur_Label;
sumX += up_Point.x;
sumY += up_Point.y;
sumZ += temp_dep;
}
}
//Down Point
if (!LabelArray[(this_Point.y + 1) * LabelMat.cols + this_Point.x]){
temp_dep = InputArray[(this_Point.y + 1) * InputMat.cols + this_Point.x];
if (std::abs(this_Point_dep - temp_dep) < Thresh){
++cur_Array_Index;
//down_most = this_Point.y + 1;
cv::Point2i down_Point(this_Point.x, this_Point.y + 1);
BFS_Queue_Array[cur_Array_Index][0] = down_Point.x;
BFS_Queue_Array[cur_Array_Index][1] = down_Point.y;
LabelArray[(this_Point.y + 1) * LabelMat.cols + this_Point.x] = cur_Label;
sumX += down_Point.x;
sumY += down_Point.y;
sumZ += temp_dep;
}
}
}
/*if ((down_most - right_most) > height_max)
{
return;
}
if ((right_most - left_most) > width_max)
{
return ;
}
if (abs(abs(down_most - up_most) - abs(right_most - left_most)) > 10)
{
return;
}*/
++lst_Array_Index;
}
if (cur_Array_Index <60 || (right_most - left_most) > width_max || (down_most - up_most) > height_max )
{
return;
}
cCenter.x = (int)sumX * 1.0 / cur_Array_Index;
cCenter.y = (int)sumY * 1.0 / cur_Array_Index;
cCenter.z = (int)sumZ * 1.0 / cur_Array_Index;
return;
}
void Gen_CoMat1(double CoeMat[4], double addTi, double addDi){
double Ti1 = addTi;
double Ti2 = Ti1* addTi;
CoeMat[0] = CoeMat[0] + 1; CoeMat[1] = CoeMat[1] + Ti1;
CoeMat[2] = CoeMat[2] + Ti1; CoeMat[3] = CoeMat[3] + Ti2;
CoeMat[4] = CoeMat[4] + addDi;
CoeMat[5] = CoeMat[5] + addDi * Ti1;
}
void Gen_CoMat2(double CoeMat[12], double addTi, double addDi){
double Ti1 = addTi;
double Ti2 = Ti1* addTi;
double Ti3 = Ti2*addTi;
double Ti4 = Ti3 * addTi;
CoeMat[0] = CoeMat[0] + 1; CoeMat[1] = CoeMat[1] + Ti1; CoeMat[2] = CoeMat[2] + Ti2;
CoeMat[3] = CoeMat[3] + Ti1; CoeMat[4] = CoeMat[4] + Ti2; CoeMat[5] = CoeMat[5] + Ti3;
CoeMat[6] = CoeMat[6] + Ti2; CoeMat[7] = CoeMat[7] + Ti3; CoeMat[8] = CoeMat[8] + Ti4;
CoeMat[9] = CoeMat[9] + addDi;
CoeMat[10] = CoeMat[10] + addDi * Ti1;
CoeMat[11] = CoeMat[11] + addDi* Ti2;
}
double forwardPred1(double timePoint, vector<double>&Input_CoMat){
vector<double>poly1Coe;
vector<double> adjuMat;
adjuMat.push_back(Input_CoMat[3]);
adjuMat.push_back(-Input_CoMat[2]);
adjuMat.push_back(-Input_CoMat[1]);
adjuMat.push_back(Input_CoMat[0]);
double detInput_Co = Input_CoMat[0] * Input_CoMat[3] - Input_CoMat[1] * Input_CoMat[2];
poly1Coe.push_back((adjuMat[0] * Input_CoMat[4] + adjuMat[2] * Input_CoMat[5]) / detInput_Co);
poly1Coe.push_back((adjuMat[1] * Input_CoMat[4] + adjuMat[3] * Input_CoMat[5]) / detInput_Co);
return poly1Coe[0] + poly1Coe[1] * timePoint;
}
double forwardPred2(double timePoint, vector<double>&Input_CoMat){
double adjuMat[12];
adjuMat[0] = (Input_CoMat[4] * Input_CoMat[8] - Input_CoMat[5] * Input_CoMat[7]);
adjuMat[1] = -(Input_CoMat[3] * Input_CoMat[8] - Input_CoMat[5] * Input_CoMat[6]);
adjuMat[2] = (Input_CoMat[3] * Input_CoMat[7] - Input_CoMat[4] * Input_CoMat[6]);
adjuMat[3] = -(Input_CoMat[1] * Input_CoMat[8] - Input_CoMat[2] * Input_CoMat[7]);
adjuMat[4] = (Input_CoMat[0] * Input_CoMat[8] - Input_CoMat[2] * Input_CoMat[6]);
adjuMat[5] = -(Input_CoMat[0] * Input_CoMat[7] - Input_CoMat[1] * Input_CoMat[6]);
adjuMat[6] = (Input_CoMat[1] * Input_CoMat[5] - Input_CoMat[2] * Input_CoMat[4]);
adjuMat[7] = -(Input_CoMat[0] * Input_CoMat[5] - Input_CoMat[2] * Input_CoMat[3]);
adjuMat[8] = (Input_CoMat[0] * Input_CoMat[4] - Input_CoMat[1] * Input_CoMat[3]);
//Obtain Determinant of Input_Coefficient Matrix
double det_InputCo;
det_InputCo = \
Input_CoMat[0] * (Input_CoMat[4] * Input_CoMat[8] - Input_CoMat[5] * Input_CoMat[7]) + \
Input_CoMat[1] * -(Input_CoMat[3] * Input_CoMat[8] - Input_CoMat[5] * Input_CoMat[6]) + \
Input_CoMat[2] * (Input_CoMat[3] * Input_CoMat[7] - Input_CoMat[4] * Input_CoMat[6]);
//Obtain Reverse
double poly2Coe[3];
poly2Coe[0] = (adjuMat[0] * Input_CoMat[9] + adjuMat[3] * Input_CoMat[10] + adjuMat[6] * Input_CoMat[11]) / det_InputCo;
poly2Coe[1] = (adjuMat[1] * Input_CoMat[9] + adjuMat[4] * Input_CoMat[10] + adjuMat[7] * Input_CoMat[11]) / det_InputCo;
poly2Coe[2] = (adjuMat[2] * Input_CoMat[9] + adjuMat[5] * Input_CoMat[10] + adjuMat[8] * Input_CoMat[11]) / det_InputCo;
return poly2Coe[0] + poly2Coe[1] * timePoint + poly2Coe[2] * timePoint*timePoint;
}
| [
"32300833+DingYu95@users.noreply.github.com"
] | 32300833+DingYu95@users.noreply.github.com |
ab89082f339fcdfc88c7381c5f0ca4b89db25562 | 097843e40064c6c823db3f90c13772db0117d0ff | /Code/National Park Builder/Source/views/StartScene.h | e4f7336907903e68fb7bda28f97c4beb69459353 | [] | no_license | kirillovmr/national-park-builder | b7c7a1297b2d7e856b66aa54a49416a2e09362b1 | 2f5515d3450e5023b5384b8d46393e6dd0735b51 | refs/heads/master | 2023-03-08T00:27:05.719083 | 2021-02-28T19:18:22 | 2021-02-28T19:18:22 | 343,192,322 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 239 | h | #pragma once
#include <CppFx/Scene.h>
#include <CppFx/Components/PushButton.h>
#include <CppFx/Components/TextField.h>
class StartScene: public Scene {
public:
PushButton button;
TextField textField;
public:
StartScene();
}; | [
"kirillovmr@gmail.com"
] | kirillovmr@gmail.com |
6ade437c1aac1a07625a8a9f6aa247ea4ef09c9a | 32f541dd6dcb2121f21b13071678a799eb293f10 | /libraries/uvm/simplechain/src/simplechain/transfer_evaluate.cpp | b73619f6860232919bc59d64810aa2ed254ee867 | [
"MIT"
] | permissive | Whitecoin-XWC/Whitecoin-core | b62de0b712ab8557ecd16dc1d0e4389c439eb3db | 8f15e0764fe60ff8d77228a2aca6bdff723439bd | refs/heads/develop | 2022-12-10T18:12:23.027195 | 2022-11-23T03:53:04 | 2022-11-23T03:53:04 | 397,646,406 | 0 | 3 | MIT | 2022-11-28T01:20:26 | 2021-08-18T15:17:39 | C++ | UTF-8 | C++ | false | false | 2,598 | cpp | #include <simplechain/transfer_evaluate.h>
#include <simplechain/blockchain.h>
#include <simplechain/address_helper.h>
namespace simplechain {
static void params_assert(bool cond, const std::string& msg = "") {
if (!cond) {
throw uvm::core::UvmException(msg.empty() ? "params invalid" : msg);
}
}
std::shared_ptr<register_account_operation_evaluator::operation_type::result_type> register_account_operation_evaluator::do_evaluate(const operation_type& op) {
return std::make_shared<void_evaluate_result>();
}
std::shared_ptr<register_account_operation_evaluator::operation_type::result_type> register_account_operation_evaluator::do_apply(const operation_type& op) {
auto result = do_evaluate(op);
get_chain()->register_account(op.account_address, op.pubkey_hex);
return result;
}
std::shared_ptr<min_operation_evaluator::operation_type::result_type> min_operation_evaluator::do_evaluate(const operation_type& op) {
auto asset_item = get_chain()->get_asset(op.asset_id);
params_assert(asset_item != nullptr);
params_assert(op.amount > 0);
params_assert(helper::is_valid_address(op.account_address));
return std::make_shared<void_evaluate_result>();
}
std::shared_ptr<min_operation_evaluator::operation_type::result_type> min_operation_evaluator::do_apply(const operation_type& op) {
auto result = do_evaluate(op);
get_chain()->update_account_asset_balance(op.account_address, op.asset_id, op.amount);
return result;
}
std::shared_ptr<transfer_operation_evaluator::operation_type::result_type> transfer_operation_evaluator::do_evaluate(const operation_type& op) {
auto asset_item = get_chain()->get_asset(op.asset_id);
params_assert(asset_item != nullptr);
params_assert(op.amount > 0);
params_assert(helper::is_valid_address(op.from_address) && !helper::is_valid_contract_address(op.from_address));
params_assert(helper::is_valid_address(op.to_address) && !helper::is_valid_contract_address(op.to_address));
params_assert(get_chain()->get_account_asset_balance(op.from_address, op.asset_id) >= op.amount);
return std::make_shared<void_evaluate_result>();
}
std::shared_ptr<transfer_operation_evaluator::operation_type::result_type> transfer_operation_evaluator::do_apply(const operation_type& op) {
auto result = do_evaluate(op);
params_assert(get_chain()->get_account_asset_balance(op.from_address, op.asset_id) >= op.amount);
get_chain()->update_account_asset_balance(op.to_address, op.asset_id, op.amount);
get_chain()->update_account_asset_balance(op.from_address, op.asset_id, - int64_t(op.amount));
return result;
}
}
| [
"WhitecoinFounder@gmail.com"
] | WhitecoinFounder@gmail.com |
69804020c76fc6a0cd0135b8ea98f71f6da244ab | 6d1af1bf49cfe2f95e6c9aa25ca8dd2df831b55a | /Source/ActionRPGGame/ARPlayerController.cpp | ca0d04b31c38e03982aaff5f07f7b3a324a29cb2 | [] | no_license | Pranavpaharia/ActionRPGGame | 0adcad8ca608ba0b87ee2ad86f2530c65779de97 | e0d326ba96e5049674b0364c746230bfaf1d77d6 | refs/heads/master | 2021-03-30T15:38:39.553259 | 2018-02-05T17:17:34 | 2018-02-05T17:17:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,545 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "ARPlayerController.h"
#include "ARUIComponent.h"
#include "AFAbilityComponent.h"
#include "AssetRegistryModule.h"
#include "Engine/AssetManager.h"
#include "ARAbilityBase.h"
#include "Weapons/ARWeaponManagerComponent.h"
#include "Abilities/ARAbilityManagerComponent.h"
AARPlayerController::AARPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
UIComponent = ObjectInitializer.CreateDefaultSubobject<UARUIComponent>(this, "UIComponent");
WeaponManager = ObjectInitializer.CreateDefaultSubobject<UARWeaponManagerComponent>(this, "WeaponManager");
AbilityManager = ObjectInitializer.CreateDefaultSubobject<UARAbilityManagerComponent>(this, "AbilityManager");
AbilityManager->ComponentTags.Add(TEXT("AbilityManager"));
}
void AARPlayerController::SetPawn(APawn* InPawn)
{
Super::SetPawn(InPawn);
ENetMode NetMode = GetNetMode();
if (NetMode == ENetMode::NM_Client
|| NetMode == ENetMode::NM_Standalone)
{
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
AbilityComp->BindAbilityToAction(InputComponent, InputNextWeapon);
AbilityComp->BindAbilityToAction(InputComponent, InputPreviousWeapon);
AbilityManager->BindInputs(InputComponent, AbilityComp);
WeaponManager->BindInputs(InputComponent, AbilityComp);
//doesn't matter. Internally ability component make sure abilities are instanced on server and replicated back.
FAFOnAbilityReady del1 = FAFOnAbilityReady::CreateUObject(this, &AARPlayerController::OnInputAbilityReady, AbilitytNextWeapon, InputNextWeapon);
AbilityComp->AddOnAbilityReadyDelegate(AbilitytNextWeapon, del1);
TArray<FGameplayTag> NextWeap;
NextWeap.Add(InputNextWeapon);
AbilityComp->NativeAddAbilityFromTag(AbilitytNextWeapon, nullptr, NextWeap);
FAFOnAbilityReady del2 = FAFOnAbilityReady::CreateUObject(this, &AARPlayerController::OnInputAbilityReady, AbilitytPreviousWeapon, InputPreviousWeapon);
AbilityComp->AddOnAbilityReadyDelegate(AbilitytPreviousWeapon, del2);
TArray<FGameplayTag> PrevWeap;
PrevWeap.Add(InputPreviousWeapon);
AbilityComp->NativeAddAbilityFromTag(AbilitytPreviousWeapon, nullptr, PrevWeap);
InputComponent->BindAction("InputAbilityManager", IE_Pressed, this, &AARPlayerController::InputShowHideAbilityManager);
InputComponent->BindAction("InputInventory", IE_Pressed, this, &AARPlayerController::InputShowHideInventory);
}
//UIAbilityManagerComponent->BindInputs();
}
void AARPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
InputComponent->BindAction("SwitchAbilitySet", IE_Pressed, this, &AARPlayerController::InputSwitchAbilitySet);
}
void AARPlayerController::InputSwitchAbilitySet()
{
}
void AARPlayerController::InputShowHideAbilityManager()
{
AbilityManager->ShowHideAbilityManager();
}
void AARPlayerController::InputShowHideInventory()
{
UIComponent->ShowHideInventory();
}
void AARPlayerController::OnInputAbilityReady(FGameplayTag InAbilityTag, FGameplayTag InInputTag)
{
IAFAbilityInterface* ABInt = Cast<IAFAbilityInterface>(GetPawn());
if (!ABInt)
return;
UAFAbilityComponent* AbilityComp = ABInt->GetAbilityComp();
if (!AbilityComp)
return;
UARAbilityBase* Ability = Cast<UARAbilityBase>(AbilityComp->BP_GetAbilityByTag(InAbilityTag));
AbilityComp->SetAbilityToAction(InAbilityTag, InInputTag, FAFOnAbilityReady());
}
| [
"xeavien@gmail.com"
] | xeavien@gmail.com |
3cbf4f3a4497b90b249029434f058310f28879e4 | f476a2940ac45acaf7103c496321a0487af436f8 | /src/lib/prov/bearssl/bearssl_ec.cpp | fe661f35708b743fe30acd3895eed896f81ca9df | [
"BSD-2-Clause"
] | permissive | TheCaster/botan | 8574e640fdf3fb39cc7900b1552f27f6474b8db2 | 91765f9fbc3e5af1df654695168ab965a2f1e06c | refs/heads/master | 2021-06-25T22:18:38.035036 | 2017-09-14T21:47:25 | 2017-09-14T21:47:25 | 103,656,346 | 1 | 0 | null | 2017-09-15T12:47:56 | 2017-09-15T12:47:56 | null | UTF-8 | C++ | false | false | 5,818 | cpp | /*
* ECDSA via BearSSL
* (C) 2015,2016 Jack Lloyd
* (C) 2017 Patrick Wildt
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/exceptn.h>
#include <botan/hash.h>
#include <botan/scan_name.h>
#include <botan/internal/bearssl.h>
#if defined(BOTAN_HAS_ECC_PUBLIC_KEY_CRYPTO)
#include <botan/der_enc.h>
#include <botan/pkcs8.h>
#include <botan/oids.h>
#include <botan/internal/pk_ops_impl.h>
#endif
#if defined(BOTAN_HAS_ECDSA)
#include <botan/ecdsa.h>
#endif
extern "C" {
#include <bearssl_hash.h>
#include <bearssl_ec.h>
}
namespace Botan {
#if defined(BOTAN_HAS_ECC_PUBLIC_KEY_CRYPTO)
namespace {
int BearSSL_EC_curve_for(const OID& oid)
{
if(oid.empty())
return -1;
const std::string name = OIDS::lookup(oid);
if(name == "secp256r1")
return BR_EC_secp256r1;
if(name == "secp384r1")
return BR_EC_secp384r1;
if(name == "secp521r1")
return BR_EC_secp521r1;
return -1;
}
const br_hash_class *BearSSL_hash_class_for(const std::string& emsa)
{
if (emsa == "EMSA1(SHA-1)")
return &br_sha1_vtable;
if (emsa == "EMSA1(SHA-224)")
return &br_sha224_vtable;
if (emsa == "EMSA1(SHA-256)")
return &br_sha256_vtable;
if (emsa == "EMSA1(SHA-384)")
return &br_sha384_vtable;
if (emsa == "EMSA1(SHA-512)")
return &br_sha512_vtable;
return nullptr;
}
}
#endif
#if defined(BOTAN_HAS_ECDSA)
namespace {
class BearSSL_ECDSA_Verification_Operation : public PK_Ops::Verification
{
public:
BearSSL_ECDSA_Verification_Operation(const ECDSA_PublicKey& ecdsa, const std::string& emsa) :
m_order_bits(ecdsa.domain().get_order().bits())
{
const int curve = BearSSL_EC_curve_for(ecdsa.domain().get_oid());
if (curve < 0)
throw Lookup_Error("BearSSL ECDSA does not support this curve");
m_hash = BearSSL_hash_class_for(emsa);
if (m_hash == nullptr)
throw Lookup_Error("BearSSL ECDSA does not support EMSA " + emsa);
const SCAN_Name req(emsa);
m_hf = make_bearssl_hash(req.arg(0));
if (m_hf == nullptr)
throw Lookup_Error("BearSSL ECDSA does not support hash " + req.arg(0));
const secure_vector<uint8_t> enc = EC2OSP(ecdsa.public_point(), PointGFp::UNCOMPRESSED);
m_key.qlen = enc.size();
m_key.q = new uint8_t[m_key.qlen];
memcpy(m_key.q, enc.data(), m_key.qlen);
m_key.curve = curve;
}
void update(const uint8_t msg[], size_t msg_len) override
{
m_hf->update(msg, msg_len);
}
bool is_valid_signature(const uint8_t sig[], size_t sig_len) override
{
const size_t order_bytes = (m_order_bits + 7) / 8;
if (sig_len != 2 * order_bytes)
return false;
secure_vector<uint8_t> msg = m_hf->final();
br_ecdsa_vrfy engine = br_ecdsa_vrfy_raw_get_default();
if (!engine(&br_ec_prime_i31, msg.data(), msg.size(), &m_key, sig, sig_len))
return false;
return true;
}
size_t max_input_bits() const { return m_order_bits; }
~BearSSL_ECDSA_Verification_Operation()
{
delete m_key.q;
}
private:
br_ec_public_key m_key;
std::unique_ptr<HashFunction> m_hf;
const br_hash_class *m_hash;
size_t m_order_bits;
};
class BearSSL_ECDSA_Signing_Operation : public PK_Ops::Signature
{
public:
BearSSL_ECDSA_Signing_Operation(const ECDSA_PrivateKey& ecdsa, const std::string& emsa) :
m_order_bits(ecdsa.domain().get_order().bits())
{
const int curve = BearSSL_EC_curve_for(ecdsa.domain().get_oid());
if(curve < 0)
throw Lookup_Error("BearSSL ECDSA does not support this curve");
m_hash = BearSSL_hash_class_for(emsa);
if (m_hash == nullptr)
throw Lookup_Error("BearSSL ECDSA does not support EMSA " + emsa);
const SCAN_Name req(emsa);
m_hf = make_bearssl_hash(req.arg(0));
if (m_hf == nullptr)
throw Lookup_Error("BearSSL ECDSA does not support hash " + req.arg(0));
m_key.xlen = ecdsa.private_value().bytes();
m_key.x = new uint8_t[m_key.xlen];
ecdsa.private_value().binary_encode(m_key.x);
m_key.curve = curve;
}
void update(const uint8_t msg[], size_t msg_len) override
{
m_hf->update(msg, msg_len);
}
secure_vector<uint8_t> sign(RandomNumberGenerator&) override
{
const size_t order_bytes = (m_order_bits + 7) / 8;
secure_vector<uint8_t> sigval(2*order_bytes);
br_ecdsa_sign engine = br_ecdsa_sign_raw_get_default();
size_t sign_len = engine(&br_ec_prime_i31, m_hash, m_hf->final().data(), &m_key, sigval.data());
if (sign_len == 0)
throw BearSSL_Error("br_ecdsa_sign");
sigval.resize(sign_len);
return sigval;
}
size_t max_input_bits() const { return m_order_bits; }
~BearSSL_ECDSA_Signing_Operation()
{
delete m_key.x;
}
private:
br_ec_private_key m_key;
std::unique_ptr<HashFunction> m_hf;
const br_hash_class *m_hash;
size_t m_order_bits;
};
}
std::unique_ptr<PK_Ops::Verification>
make_bearssl_ecdsa_ver_op(const ECDSA_PublicKey& key, const std::string& params)
{
return std::unique_ptr<PK_Ops::Verification>(new BearSSL_ECDSA_Verification_Operation(key, params));
}
std::unique_ptr<PK_Ops::Signature>
make_bearssl_ecdsa_sig_op(const ECDSA_PrivateKey& key, const std::string& params)
{
return std::unique_ptr<PK_Ops::Signature>(new BearSSL_ECDSA_Signing_Operation(key, params));
}
#endif
}
| [
"patrick@blueri.se"
] | patrick@blueri.se |
d07ed4b1f4537e33831d435f2918ff1b6a3bd959 | c35f4dda5bd5a0a81a43197820b432c2f76a77ac | /Laboratorio 02/CW-02.cpp | d0ad0bbe927163d65cacc82e6f053809818c8bc9 | [] | no_license | jaritinu/PED0319-OARP-00307714 | 77f648ab5ad08d35317237e3e5f1df06c30b7954 | 1978d04318f89414a4a06c09c9e608b986134daa | refs/heads/master | 2020-12-09T01:15:34.355881 | 2020-02-08T04:45:14 | 2020-02-08T04:45:14 | 233,149,088 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 377 | cpp | #include <iostream>
using namespace std;
int main(void){
int aux = 1;
int matrix[3][3];
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
matrix[i][j]=aux++;
}
}
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
cout<<matrix[i][j]<<"\t";
}
cout<<endl;
}
return 0;
} | [
"you@example.com"
] | you@example.com |
f5447a33d8bca3a6ef01a9f85912d6ef9f1d7a71 | 229e67debe5ed858540090391f045c4d19e46cd9 | /include/myhelper.h | 4e27ddd489837d8dd5dae49a6aa343284d597c56 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sdadia/OpenCV-Helper | 37a0bb3953d2d5e44a8844943de94a0b46959a40 | a846910856f4953685c36c1079ccf1ec573b6470 | refs/heads/master | 2021-01-24T21:08:05.754532 | 2016-11-23T07:12:06 | 2016-11-23T07:12:06 | 65,599,588 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,269 | h | /**
@author Sahil Dadia (dadiasahil94@yahoo.in)
@date 12th August 2016
@brief File containing helper functions for OpenCV
*/
#ifndef __MYHELPERFUNC_H__
#define __MYHELPERFUNC_H__
#include <iostream>
#include <opencv2/opencv.hpp> // Required for paramters of functions
#include <dirent.h>
/**
@namespace helperfunc
*/
namespace helperfunc {
/**
@brief Get data-type of OpenCV matrix object
@details The output of cv::Mat.type() is an integer which indicates the data type of the matrix,\n
such as (0,1,2,3,4,5,6), which corresponds to (8UC1 ... 32FC1).\n
It is not intuitive. This function converts it to string.Hence making it easier to read.
@details Useage :
@code
helperfunc::ImgTypeToStr(image_matrix.type()) >> input is an integer
"8UC1" >> Output
@endcode
@param[in] matrix_type (type = int) Output of cv::Mat.type()
@return String of the type
*/
std::string ImgTypeToStr(int matrix_type);
/**
@struct ImageHeaderStruct
@brief Data struct to store OpenCV matrix object headers
@details Used in conjunction with GetImageHeader(). So while using GetImageHeader(), you
need to declare ImageHeaderStruct variable as follows
@code
helperfunc::ImageHeaderStruct my_struct = helperfunc::GetImageHeader(image)
@endcode
It stores number of rows, columns, channels and the data type of image
@see GetImageHeader()
*/
struct ImageHeaderStruct {
unsigned int num_rows=0, num_cols=0, num_channels=0;
std::string data_type="None";
};
/**
@brief Get image para for OpenCV matrix object such as rows, cols etc.
@details Used in conjunction with a struct ImageHeaderStruct, which contains number of rows, columns, channels and data type of the image.\n
So while using GetImageHeader(), you need to declare ImageHeaderStruct variable as follow,
@code
helperfunc::ImageHeaderStruct my_img_header = helperfunc::GetImageHeader(image)
@endcode
@param[in] input_image (type = cv::Mat) OpenCV matrix object
@return image_data (type = ImageHeaderStruct) A structure containing the header information
@see ImageHeaderStruct
*/
ImageHeaderStruct GetImageHeader(const cv::Mat input_image);
/**
@brief Print the details of imageheader
@param[in] Imageheader struct object
@see ImageHeaderStruct
*/
void PrintImageHeader(const ImageHeaderStruct img_headstruct);
/**
@brief Returns a vector containing files of a particular directory
@param[in] dir_name (type = char[]) Directory to search
@param[out] file_lists (type = std::vector<std::string>) List containing all file names
@return -
*/
void ListFilesInDir(const char dir_name[], std::vector<std::string> &file_lists);
/**
@brief Prints the elements of vector
@param[in] vec (type = std::vector<any_type>) Vector for iterations
*/
template <class t>
void PrintVectorElements(const std::vector<t> vec){
// Note : `auto` keyword is of c++11 standard. So compile your program using c++11
for( auto i = vec.begin(); i != vec.end(); i++ ){
std::cout << *i << std::endl;
}
}
} // End of helperfunc namespace
#endif
| [
"dadiasahil94@yahoo.in"
] | dadiasahil94@yahoo.in |
d473a76e6d903ca61aeed44c111dbebc5bc014a3 | 4daac5587af65130699ab1b335decb316c422f7c | /CGCore/src/platform/window/WindowsWindow.cpp | bfb6195ebc48d47cbcbc0f355ee9f18d3a7ff926 | [
"MIT"
] | permissive | chen1180/CG-Sandbox | b49185dfd7ebd8143224e244046e63bbc239f52d | 59473fe44fb515f4e79479070c924de7e0e2c760 | refs/heads/master | 2023-02-02T15:29:09.404715 | 2020-09-26T03:41:36 | 2020-10-06T03:10:10 | 283,089,930 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,031 | cpp | #include "pch.h"
#include "WindowsWindow.h"
#include"event/ApplicationEvent.h"
#include"event/MouseEvent.h"
#include"event/KeyEvent.h"
namespace CGCore {
static bool s_GLFWInitialized = false;
Window* Window::Create(const WindowProperty& windowProps)
{
return new WindowsWindow(windowProps);
}
WindowsWindow::WindowsWindow(const WindowProperty& windowProps)
{
Init(windowProps);
}
WindowsWindow::~WindowsWindow()
{
ShutDown();
}
void WindowsWindow::Init(const WindowProperty& windowProp)
{
m_WindowProps.Height = windowProp.Height;
m_WindowProps.Width = windowProp.Width;
m_WindowProps.Title = windowProp.Title;
CG_CORE_INFO("Create a window: {0}x{1}, {2}", m_WindowProps.Width, m_WindowProps.Height, m_WindowProps.Title);
if (!s_GLFWInitialized) {
bool success = glfwInit();
CG_CORE_ASSERT(success, "GLFW failed to initialize!");
s_GLFWInitialized = true;
}
m_Window = glfwCreateWindow((int)m_WindowProps.Width, (int)m_WindowProps.Height, m_WindowProps.Title.c_str(), nullptr, nullptr);
m_OpenGLContext = new OpenGLRenderContext(m_Window);
m_OpenGLContext->Init();
//bind callback function
glfwSetWindowUserPointer(m_Window, &m_WindowProps);
SetVSync(true);
glfwSetWindowCloseCallback(m_Window, [](GLFWwindow* window)
{
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
WindowCloseEvent event;
data.EventCallback(event);
});
glfwSetWindowSizeCallback(m_Window, [](GLFWwindow* window, int width, int height)
{
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
data.Width = width;
data.Height = height;
WindowResizeEvent event(width, height);
data.EventCallback(event);
});
glfwSetMouseButtonCallback(m_Window, [](GLFWwindow* window, int button, int action, int mods) {
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
switch (action)
{
case GLFW_PRESS:
{
MousePressedEvent event(button);
data.EventCallback(event);
break;
}
case GLFW_RELEASE:
{
MouseReleasedEvent event(button);
data.EventCallback(event);
break;
}
}
});
glfwSetCursorPosCallback(m_Window, [](GLFWwindow* window, double x, double y) {
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
MouseMoveEvent event((uint32_t)x, (uint32_t)y);
data.EventCallback(event);
});
glfwSetScrollCallback(m_Window, [](GLFWwindow* window, double xOffset, double yOffset) {
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
MouseScrolledEvent event((float)xOffset, (float)yOffset);
data.EventCallback(event);
});
glfwSetKeyCallback(m_Window, [](GLFWwindow* window, int key, int scancode, int action, int mods) {
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
switch (action)
{
case GLFW_PRESS:
{
KeyPressedEvent event(key,0);
data.EventCallback(event);
break;
}
case GLFW_RELEASE:
{
KeyReleasedEvent event(key);
data.EventCallback(event);
break;
}
case GLFW_REPEAT:
{
KeyPressedEvent event(key, 1);
data.EventCallback(event);
break;
}
}
});
glfwSetCharCallback(m_Window, [](GLFWwindow* window, unsigned int keycode)
{
WindowData& data = *(WindowData*)glfwGetWindowUserPointer(window);
KeyTypedEvent event(keycode);
data.EventCallback(event);
});
}
void WindowsWindow::ShutDown()
{
glfwDestroyWindow(m_Window);
}
void WindowsWindow::OnUpdate()
{
glfwPollEvents();
m_OpenGLContext->SwapBuffer();
}
uint32_t WindowsWindow::GetWidth() const
{
return m_WindowProps.Width;
}
uint32_t WindowsWindow::GetHeight() const
{
return m_WindowProps.Height;
}
void* WindowsWindow::GetNativeWindow() const
{
return m_Window;
}
void WindowsWindow::SetVSync(bool enabled)
{
if (enabled)
glfwSwapInterval(1);
else
glfwSwapInterval(0);
m_WindowProps.VSync = enabled;
}
bool WindowsWindow::IsVSync() const
{
return m_WindowProps.VSync;
}
} | [
"35698504+chen1180@users.noreply.github.com"
] | 35698504+chen1180@users.noreply.github.com |
08472d948a483beb1b8d0ae874cb362ca61c26f5 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /services/network/public/cpp/cookie_manager_mojom_traits.h | 09175c0b824254a3bba49a61c732c09c61774fff | [
"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 | 8,582 | h | // Copyright 2017 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 SERVICES_NETWORK_PUBLIC_CPP_COOKIE_MANAGER_MOJOM_TRAITS_H_
#define SERVICES_NETWORK_PUBLIC_CPP_COOKIE_MANAGER_MOJOM_TRAITS_H_
#include "ipc/ipc_message_utils.h"
#include "mojo/public/cpp/bindings/enum_traits.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_options.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
namespace mojo {
template <>
struct EnumTraits<network::mojom::CookiePriority, net::CookiePriority> {
static network::mojom::CookiePriority ToMojom(net::CookiePriority input);
static bool FromMojom(network::mojom::CookiePriority input,
net::CookiePriority* output);
};
template <>
struct EnumTraits<network::mojom::CookieSameSite, net::CookieSameSite> {
static network::mojom::CookieSameSite ToMojom(net::CookieSameSite input);
static bool FromMojom(network::mojom::CookieSameSite input,
net::CookieSameSite* output);
};
template <>
struct EnumTraits<network::mojom::CookieEffectiveSameSite,
net::CookieEffectiveSameSite> {
static network::mojom::CookieEffectiveSameSite ToMojom(
net::CookieEffectiveSameSite input);
static bool FromMojom(network::mojom::CookieEffectiveSameSite input,
net::CookieEffectiveSameSite* output);
};
template <>
struct EnumTraits<network::mojom::CookieAccessSemantics,
net::CookieAccessSemantics> {
static network::mojom::CookieAccessSemantics ToMojom(
net::CookieAccessSemantics input);
static bool FromMojom(network::mojom::CookieAccessSemantics input,
net::CookieAccessSemantics* output);
};
template <>
struct EnumTraits<network::mojom::ContextType,
net::CookieOptions::SameSiteCookieContext::ContextType> {
static network::mojom::ContextType ToMojom(
net::CookieOptions::SameSiteCookieContext::ContextType input);
static bool FromMojom(
network::mojom::ContextType input,
net::CookieOptions::SameSiteCookieContext::ContextType* output);
};
template <>
struct EnumTraits<network::mojom::CookieSourceScheme, net::CookieSourceScheme> {
static network::mojom::CookieSourceScheme ToMojom(
net::CookieSourceScheme input);
static bool FromMojom(network::mojom::CookieSourceScheme input,
net::CookieSourceScheme* output);
};
template <>
struct EnumTraits<network::mojom::CookieChangeCause, net::CookieChangeCause> {
static network::mojom::CookieChangeCause ToMojom(
net::CookieChangeCause input);
static bool FromMojom(network::mojom::CookieChangeCause input,
net::CookieChangeCause* output);
};
template <>
struct StructTraits<network::mojom::CookieSameSiteContextDataView,
net::CookieOptions::SameSiteCookieContext> {
static net::CookieOptions::SameSiteCookieContext::ContextType context(
net::CookieOptions::SameSiteCookieContext& s) {
return s.context();
}
static net::CookieOptions::SameSiteCookieContext::ContextType
schemeful_context(net::CookieOptions::SameSiteCookieContext& s) {
return s.schemeful_context();
}
static bool Read(network::mojom::CookieSameSiteContextDataView mojo_options,
net::CookieOptions::SameSiteCookieContext* context);
};
template <>
struct StructTraits<network::mojom::CookieOptionsDataView, net::CookieOptions> {
static bool exclude_httponly(const net::CookieOptions& o) {
return o.exclude_httponly();
}
static net::CookieOptions::SameSiteCookieContext same_site_cookie_context(
const net::CookieOptions& o) {
return o.same_site_cookie_context();
}
static bool update_access_time(const net::CookieOptions& o) {
return o.update_access_time();
}
static bool return_excluded_cookies(const net::CookieOptions& o) {
return o.return_excluded_cookies();
}
static bool Read(network::mojom::CookieOptionsDataView mojo_options,
net::CookieOptions* cookie_options);
};
template <>
struct StructTraits<network::mojom::CanonicalCookieDataView,
net::CanonicalCookie> {
static const std::string& name(const net::CanonicalCookie& c) {
return c.Name();
}
static const std::string& value(const net::CanonicalCookie& c) {
return c.Value();
}
static const std::string& domain(const net::CanonicalCookie& c) {
return c.Domain();
}
static const std::string& path(const net::CanonicalCookie& c) {
return c.Path();
}
static base::Time creation(const net::CanonicalCookie& c) {
return c.CreationDate();
}
static base::Time expiry(const net::CanonicalCookie& c) {
return c.ExpiryDate();
}
static base::Time last_access(const net::CanonicalCookie& c) {
return c.LastAccessDate();
}
static bool secure(const net::CanonicalCookie& c) { return c.IsSecure(); }
static bool httponly(const net::CanonicalCookie& c) { return c.IsHttpOnly(); }
static net::CookieSameSite site_restrictions(const net::CanonicalCookie& c) {
return c.SameSite();
}
static net::CookiePriority priority(const net::CanonicalCookie& c) {
return c.Priority();
}
static net::CookieSourceScheme source_scheme(const net::CanonicalCookie& c) {
return c.SourceScheme();
}
static bool Read(network::mojom::CanonicalCookieDataView cookie,
net::CanonicalCookie* out);
};
template <>
struct StructTraits<network::mojom::CookieInclusionStatusDataView,
net::CookieInclusionStatus> {
static uint32_t exclusion_reasons(const net::CookieInclusionStatus& s) {
return s.exclusion_reasons();
}
static uint32_t warning_reasons(const net::CookieInclusionStatus& s) {
return s.warning_reasons();
}
static bool Read(network::mojom::CookieInclusionStatusDataView status,
net::CookieInclusionStatus* out);
};
template <>
struct StructTraits<network::mojom::CookieAndLineWithAccessResultDataView,
net::CookieAndLineWithAccessResult> {
static const base::Optional<net::CanonicalCookie>& cookie(
const net::CookieAndLineWithAccessResult& c) {
return c.cookie;
}
static const std::string& cookie_string(
const net::CookieAndLineWithAccessResult& c) {
return c.cookie_string;
}
static const net::CookieAccessResult& access_result(
const net::CookieAndLineWithAccessResult& c) {
return c.access_result;
}
static bool Read(network::mojom::CookieAndLineWithAccessResultDataView cookie,
net::CookieAndLineWithAccessResult* out);
};
template <>
struct StructTraits<network::mojom::CookieAccessResultDataView,
net::CookieAccessResult> {
static const net::CookieEffectiveSameSite& effective_same_site(
const net::CookieAccessResult& c) {
return c.effective_same_site;
}
static const net::CookieInclusionStatus& status(
const net::CookieAccessResult& c) {
return c.status;
}
static bool Read(network::mojom::CookieAccessResultDataView access_result,
net::CookieAccessResult* out);
};
template <>
struct StructTraits<network::mojom::CookieWithAccessResultDataView,
net::CookieWithAccessResult> {
static const net::CanonicalCookie& cookie(
const net::CookieWithAccessResult& c) {
return c.cookie;
}
static const net::CookieAccessResult& access_result(
const net::CookieWithAccessResult& c) {
return c.access_result;
}
static bool Read(network::mojom::CookieWithAccessResultDataView cookie,
net::CookieWithAccessResult* out);
};
template <>
struct StructTraits<network::mojom::CookieChangeInfoDataView,
net::CookieChangeInfo> {
static const net::CanonicalCookie& cookie(const net::CookieChangeInfo& c) {
return c.cookie;
}
static net::CookieAccessSemantics access_semantics(
const net::CookieChangeInfo& c) {
return c.access_semantics;
}
static net::CookieChangeCause cause(const net::CookieChangeInfo& c) {
return c.cause;
}
static bool Read(network::mojom::CookieChangeInfoDataView info,
net::CookieChangeInfo* out);
};
} // namespace mojo
#endif // SERVICES_NETWORK_PUBLIC_CPP_COOKIE_MANAGER_MOJOM_TRAITS_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
ab83f1987bfe4153fbdbd6f826b48651504fb75a | 4325e721c60a5ad6d0273782b2d9621a8c801c1e | /OpenGLTutorial/Mesh.cpp | b84d7ead22400d88979150a0649e12de4b5be187 | [] | no_license | arkus7/opengl-tutorial | 9236e3377c38a36addcc500c866cf33bc20c1e89 | 415dea1bd8b938af477d209f08b92c3557d7a610 | refs/heads/master | 2021-01-20T19:57:20.657733 | 2016-06-06T04:57:00 | 2016-06-06T04:57:00 | 60,374,224 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,874 | cpp | #include "Mesh.h"
#include <vector>
#include "obj_loader.h"
Mesh::Mesh(Vertex * vertices, unsigned int numVertices, unsigned int* indices, unsigned int numIndicies)
{
IndexedModel model;
for (unsigned int i = 0; i < numVertices; i++)
{
model.positions.push_back(*vertices[i].getPosition());
model.texCoords.push_back(*vertices[i].getTextureCoord());
}
for (unsigned int i = 0; i < numIndicies; i++) {
model.indices.push_back(indices[i]);
}
initMesh(model);
}
Mesh::Mesh(const std::string & fileName)
{
IndexedModel model = OBJModel(fileName).ToIndexedModel();
initMesh(model);
}
void Mesh::draw()
{
glBindVertexArray(vertexArrayObject);
glDrawElements(GL_TRIANGLES, drawCount, GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
}
Mesh::~Mesh()
{
glDeleteVertexArrays(1, &vertexArrayObject);
}
void Mesh::initMesh(const IndexedModel & model)
{
drawCount = model.indices.size();
glGenVertexArrays(1, &vertexArrayObject);
glBindVertexArray(vertexArrayObject);
glGenBuffers(NUM_BUFFERS, vertexArrayBuffers);
// POSITIONS
glBindBuffer(GL_ARRAY_BUFFER, vertexArrayBuffers[POSITION_VB]);
glBufferData(GL_ARRAY_BUFFER, model.positions.size() * sizeof(model.positions[0]), &model.positions[0], GL_STATIC_DRAW); // GL_STREAM_DRAW
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
// TEXTURE COORDS
glBindBuffer(GL_ARRAY_BUFFER, vertexArrayBuffers[TEXTURE_COORD_VB]);
glBufferData(GL_ARRAY_BUFFER, model.texCoords.size() * sizeof(model.texCoords[0]), &model.texCoords[0], GL_STATIC_DRAW);
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, 0);
// INDICES
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vertexArrayBuffers[INDEX_VB]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, model.indices.size() * sizeof(model.indices[0]), &model.indices[0], GL_STATIC_DRAW);
glBindVertexArray(0);
}
| [
"arkus777@gmail.com"
] | arkus777@gmail.com |
21209a26effbb3582e3abb4bf066dcad37c4cce3 | 3369fff405901eaef87533c0ad5440a539d07b22 | /myFFMPEGGui/videotypetransform_win.h | dc927fe51441b83f89afc83d5c080ad3dea78a61 | [] | no_license | ChocolateJin/ffmpeg_gui_developing | 28afd74d557a79d3feaabb4d050d3d6c63b104e8 | 4ecb2a68eea845fbb0665a58fbd14e2bc7e87a39 | refs/heads/master | 2022-12-05T23:14:03.047564 | 2020-09-02T10:06:36 | 2020-09-02T10:06:36 | 291,997,310 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 618 | h | #ifndef VIDEOTYPETRANSFORM_WIN_H
#define VIDEOTYPETRANSFORM_WIN_H
#include <QDialog>
namespace Ui {
class VideoTypeTransform_win;
}
class VideoTypeTransform_win : public QDialog
{
Q_OBJECT
public:
explicit VideoTypeTransform_win(QWidget *parent = nullptr);
~VideoTypeTransform_win();
private slots:
void on_step_1_button_clicked();
void on_step_2_button_clicked();
void on_step_3_button_clicked();
void on_step_4_button_clicked();
void on_step_5_button_clicked();
void showoutput();
private:
Ui::VideoTypeTransform_win *ui;
};
#endif // VIDEOTYPETRANSFORM_WIN_H
| [
"244487542@qq.com"
] | 244487542@qq.com |
de0727c862827a8f7fda0a31d084b522fa9c43c7 | f9a02ecc0ce0a36a3ec51f950a14539e990cc08f | /source/controls.cpp | b1f273631e34eecb8dd05fea93742a6a1647117c | [] | no_license | samuelburch/solvaminx | 32ffd30142c153bdabaa4331b7d7f80611e507d6 | 1b365f0029c31fc737216b6c3ceb1da4146a1dc5 | refs/heads/master | 2020-03-27T06:41:11.691091 | 2018-08-31T08:32:37 | 2018-08-31T08:32:37 | 146,127,062 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,660 | cpp | // Include GLFW
#include <GLFW/glfw3.h>
extern GLFWwindow
*window; // The "extern" keyword here is to access the variable "window"
// declared in tutorialXXX.cpp. This is a hack to keep the
// tutorials simple. Please avoid this.
// Include GLM
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
using namespace glm;
#include "controls.hpp"
glm::mat4 ViewMatrix;
glm::mat4 ProjectionMatrix;
glm::mat4 getViewMatrix() { return ViewMatrix; }
glm::mat4 getProjectionMatrix() { return ProjectionMatrix; }
// Initial position : on +Z
glm::vec3 position = glm::vec3(0, .75, 0);
// Initial horizontal angle : toward -Z
float horizontalAngle = 0.0f;
// Initial vertical angle : none
float verticalAngle = 0.0f;
// Initial Field of View
float initialFoV = 30.0f;
float speed = 3.0f; // 3 units / second
float mouseSpeed = 0.002f;
void computeMatricesFromInputs(int *currentface, vec3 *camerapos)
{
// glfwGetTime is called only once, the first time this function is called
// static double lastTime = glfwGetTime();
// Compute time difference between current and last frame
// double currentTime = glfwGetTime();
// float deltaTime = float(currentTime - lastTime);
// Get mouse position
double xpos, ypos;
glfwGetCursorPos(window, &xpos, &ypos);
// Reset mouse position for next frame
glfwSetCursorPos(window, 1024 / 2, 768 / 2);
// Compute new orientation
horizontalAngle += mouseSpeed * float(1024 / 2 - xpos);
verticalAngle -= mouseSpeed * float(768 / 2 - ypos);
if (verticalAngle > 1.57)
verticalAngle = 1.57;
if (verticalAngle < -1.57)
verticalAngle = -1.57;
// Direction : Spherical coordinates to Cartesian coordinates conversion
glm::vec3 direction(cos(verticalAngle) * sin(horizontalAngle),
sin(verticalAngle),
cos(verticalAngle) * cos(horizontalAngle));
// Right vector
glm::vec3 right = glm::vec3(sin(horizontalAngle - 3.14f / 2.0f), 0,
cos(horizontalAngle - 3.14f / 2.0f));
// Up vector
glm::vec3 up = glm::cross(right, direction);
float FoV =
initialFoV;
// Projection matrix : 45� Field of View, 4:3 ratio, display range : 0.1 unit
// <-> 100 units
ProjectionMatrix =
glm::perspective(glm::radians(FoV), 4.0f / 3.0f, 0.1f, 100.0f);
float distance = 10; // Straight line distance between the camera and look at point
float xangle = cos(verticalAngle) * sin(horizontalAngle);
float yangle = sin(verticalAngle);
float zangle = cos(verticalAngle) * cos(horizontalAngle);
float hangle = mod(horizontalAngle / 6.28f, 1.0f) * 360;
float vangle = sin(verticalAngle);
// Calculate the camera position using the distance and angles
float camX = 0.0001465 + distance * xangle;
float camY = 1.25846 + distance * yangle;
float camZ = 0.0004519 + distance * zangle;
*camerapos = {verticalAngle, vangle, zangle};
if (vangle < 0)
{
if (vangle > -.72)
{
*currentface = 4;
if (hangle > 72)
*currentface = 3;
if (hangle > 72 * 2)
*currentface = 2;
if (hangle > 72 * 3)
*currentface = 1;
if (hangle > 72 * 4)
*currentface = 0;
}
else
*currentface = 5;
}
else
{
if (vangle < .72)
{
hangle += 36;
*currentface = 8;
if (hangle > 72)
*currentface = 9;
if (hangle > 72 * 2)
*currentface = 10;
if (hangle > 72 * 3)
*currentface = 6;
if (hangle > 72 * 4)
*currentface = 7;
if (hangle > 72 * 5)
*currentface = 8;
}
else
*currentface = 11;
}
// Set the camera position and lookat point
ViewMatrix = glm::lookAt({camX, camY, camZ}, // Camera position
{0.0001465, 1.25846, 0.0004519}, // Look at point
up); // Up vector
// lastTime = currentTime;
} | [
"slbu244@uky.edu"
] | slbu244@uky.edu |
d501537957389fc7ecaef6de9df2724feb7c6e5f | 868e8628acaa0bf276134f9cc3ced379679eab10 | /squareDrop/0.286/alpha.water | 42a4c0df432c5dc8d36a3531cd5ceef6a850ee28 | [] | no_license | stigmn/droplet | 921af6851f88c0acf8b1cd84f5e2903f1d0cb87a | 1649ceb0a9ce5abb243fb77569211558c2f0dc96 | refs/heads/master | 2020-04-04T20:08:37.912624 | 2015-11-25T11:20:32 | 2015-11-25T11:20:32 | 45,102,907 | 0 | 0 | null | 2015-10-28T09:46:30 | 2015-10-28T09:46:29 | null | UTF-8 | C++ | false | false | 114,453 | water | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.286";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField nonuniform List<scalar>
10000
(
4.62164e-54
5.74897e-50
4.11131e-46
8.84175e-43
4.24906e-40
6.3131e-38
3.8814e-36
1.19508e-34
2.08808e-33
2.2803e-32
1.74071e-31
1.04274e-30
5.35208e-30
2.5971e-29
1.27476e-28
6.5682e-28
3.80513e-27
2.31276e-26
1.34274e-25
7.2874e-25
3.61103e-24
1.64303e-23
6.90901e-23
2.68899e-22
9.57205e-22
3.07585e-21
8.7916e-21
2.18719e-20
4.3988e-20
6.35602e-20
6.56846e-20
4.88074e-20
2.68323e-20
1.13447e-20
3.86989e-21
1.11979e-21
2.82835e-22
6.18271e-23
1.13425e-23
1.69713e-24
2.03978e-25
1.98663e-26
1.57815e-27
1.00092e-28
4.8323e-30
1.78979e-31
3.46027e-32
1.22927e-31
4.97396e-31
2.08984e-30
5.63466e-51
1.0503e-46
9.24235e-43
1.68029e-39
6.56391e-37
8.28411e-35
4.50222e-33
1.26218e-31
2.05043e-30
2.10907e-29
1.52838e-28
8.70767e-28
4.26303e-27
2.01959e-26
9.80835e-26
4.88672e-25
2.7008e-24
1.55077e-23
8.26831e-23
4.12001e-22
1.89623e-21
7.96003e-21
3.07773e-20
1.09849e-19
3.60921e-19
1.07192e-18
2.8163e-18
6.41913e-18
1.20315e-17
1.71811e-17
1.85142e-17
1.51187e-17
9.45272e-18
4.63861e-18
1.85963e-18
6.33714e-19
1.86831e-19
4.74642e-20
1.0203e-20
1.82303e-21
2.67682e-22
3.24447e-23
3.23147e-24
2.58379e-25
1.6106e-26
8.27386e-28
3.11386e-28
1.29307e-27
5.85742e-27
2.7178e-26
1.95854e-48
5.64811e-44
5.77536e-40
8.59345e-37
2.73872e-34
2.94674e-32
1.41927e-30
3.63291e-29
5.5079e-28
5.36192e-27
3.70215e-26
2.01087e-25
9.44258e-25
4.33818e-24
2.04502e-23
9.79951e-23
5.05057e-22
2.68606e-21
1.31088e-20
5.95808e-20
2.50799e-19
9.66852e-19
3.44174e-18
1.13257e-17
3.435e-17
9.51095e-17
2.34424e-16
5.00532e-16
8.95172e-16
1.26947e-15
1.40982e-15
1.22959e-15
8.43535e-16
4.62748e-16
2.10153e-16
8.15601e-17
2.74226e-17
7.96949e-18
1.97763e-18
4.13735e-19
7.22849e-20
1.05633e-20
1.26953e-21
1.22108e-22
9.20786e-24
6.51323e-25
6.71913e-25
3.4525e-24
1.87895e-23
1.16811e-22
3.34453e-46
1.56278e-41
1.71918e-37
2.01688e-34
5.24057e-32
4.82572e-30
2.06686e-28
4.846e-27
6.8791e-26
6.36045e-25
4.19934e-24
2.17248e-23
9.7731e-23
4.30936e-22
1.9512e-21
8.89084e-21
4.2455e-20
2.06954e-19
9.29933e-19
3.86024e-18
1.47704e-17
5.21111e-17
1.70357e-16
5.17928e-16
1.45916e-15
3.77194e-15
8.77331e-15
1.77985e-14
3.07202e-14
4.33495e-14
4.92802e-14
4.51158e-14
3.32196e-14
1.98557e-14
9.91691e-15
4.25327e-15
1.58772e-15
5.15951e-16
1.44545e-16
3.44688e-17
6.94504e-18
1.17637e-18
1.62503e-19
1.78228e-20
1.53293e-21
1.85039e-22
5.72317e-22
3.64203e-21
2.27134e-20
1.33274e-19
3.87108e-44
3.13326e-39
2.9601e-35
2.6767e-32
5.69027e-30
4.51042e-28
1.72573e-26
3.7199e-25
4.96198e-24
4.3736e-23
2.76917e-22
1.36639e-21
5.86836e-21
2.46265e-20
1.06066e-19
4.55188e-19
2.01258e-18
8.96633e-18
3.71356e-17
1.41287e-16
4.91043e-16
1.57905e-15
4.73473e-15
1.33107e-14
3.49087e-14
8.4549e-14
1.85907e-13
3.60991e-13
6.04143e-13
8.48649e-13
9.83965e-13
9.3702e-13
7.29096e-13
4.66085e-13
2.50753e-13
1.16498e-13
4.7401e-14
1.69192e-14
5.24351e-15
1.39012e-15
3.13551e-16
5.89448e-17
8.96618e-18
1.07581e-18
1.02091e-19
3.16447e-20
1.66228e-19
1.01197e-18
5.64965e-18
2.75746e-17
3.39692e-42
4.66298e-37
3.22186e-33
2.24127e-30
3.93379e-28
2.70258e-26
9.28337e-25
1.84625e-23
2.32237e-22
1.95836e-21
1.19255e-20
5.63013e-20
2.30145e-19
9.13964e-19
3.69984e-18
1.48598e-17
6.08397e-17
2.48402e-16
9.44886e-16
3.28961e-15
1.0419e-14
3.05616e-14
8.41206e-14
2.18531e-13
5.33994e-13
1.21365e-12
2.52566e-12
4.70326e-12
7.65436e-12
1.07035e-11
1.26322e-11
1.2451e-11
1.01409e-11
6.83679e-12
3.90364e-12
1.93776e-12
8.48755e-13
3.28456e-13
1.10924e-13
3.2188e-14
7.94661e-15
1.61725e-15
2.65096e-16
3.40184e-17
3.65176e-18
2.7725e-18
1.55998e-17
8.54803e-17
4.08608e-16
1.70203e-15
2.45329e-40
4.89072e-35
2.358e-31
1.27352e-28
1.86318e-26
1.11719e-24
3.46103e-23
6.37035e-22
7.57526e-21
6.13141e-20
3.60259e-19
1.63423e-18
6.34668e-18
2.37432e-17
8.95247e-17
3.33807e-16
1.26838e-15
4.73685e-15
1.65727e-14
5.27864e-14
1.52486e-13
4.08281e-13
1.03273e-12
2.48285e-12
5.65314e-12
1.2063e-11
2.37478e-11
4.23799e-11
6.71778e-11
9.34671e-11
1.12117e-10
1.14094e-10
9.66962e-11
6.80406e-11
4.08062e-11
2.14447e-11
1.002e-11
4.15954e-12
1.51451e-12
4.76953e-13
1.27494e-13
2.79737e-14
4.91566e-15
6.73438e-16
8.50918e-17
1.09667e-16
5.84104e-16
2.84042e-15
1.19914e-14
4.42421e-14
1.73146e-38
3.64279e-33
1.2191e-29
5.17166e-27
6.36213e-25
3.34931e-23
9.39492e-22
1.60448e-20
1.80709e-19
1.40752e-18
8.00417e-18
3.50673e-17
1.29435e-16
4.5454e-16
1.58605e-15
5.45701e-15
1.91666e-14
6.54811e-14
2.11207e-13
6.16056e-13
1.6235e-12
3.97264e-12
9.23879e-12
2.05875e-11
4.37627e-11
8.75803e-11
1.6284e-10
2.77903e-10
4.28804e-10
5.93296e-10
7.23295e-10
7.59559e-10
6.67215e-10
4.85318e-10
3.0301e-10
1.675e-10
8.30355e-11
3.67584e-11
1.43551e-11
4.87608e-12
1.40707e-12
3.34006e-13
6.3135e-14
9.29043e-15
1.35695e-15
2.15153e-15
1.06143e-14
4.68404e-14
1.79559e-13
6.01938e-13
1.33602e-36
1.97378e-31
4.63283e-28
1.55958e-25
1.62523e-23
7.55016e-22
1.9239e-20
3.05463e-19
3.26252e-18
2.44928e-17
1.35182e-16
5.75174e-16
2.02213e-15
6.65458e-15
2.13965e-14
6.75752e-14
2.17827e-13
6.82209e-13
2.03107e-12
5.43094e-12
1.30742e-11
2.92468e-11
6.2621e-11
1.29541e-10
2.5739e-10
4.83317e-10
8.47661e-10
1.37919e-09
2.06663e-09
2.84512e-09
3.53317e-09
3.83678e-09
3.48365e-09
2.5875e-09
1.66685e-09
9.64597e-10
5.05427e-10
2.38359e-10
9.98477e-11
3.65644e-11
1.14089e-11
2.94257e-12
6.05364e-13
9.66217e-14
1.5417e-14
2.39511e-14
1.0938e-13
4.47599e-13
1.59089e-12
4.95059e-12
9.42488e-35
7.99677e-30
1.33392e-26
3.59608e-24
3.19468e-22
1.31537e-20
3.05313e-19
4.51293e-18
4.57325e-17
3.31132e-16
1.77732e-15
7.3777e-15
2.48254e-14
7.66229e-14
2.26623e-13
6.53479e-13
1.92077e-12
5.50602e-12
1.51565e-11
3.7258e-11
8.20511e-11
1.6783e-10
3.31391e-10
6.3794e-10
1.18613e-09
2.09099e-09
3.45633e-09
5.35335e-09
7.785e-09
1.07331e-08
1.36864e-08
1.54753e-08
1.45019e-08
1.07598e-08
7.05538e-09
4.24776e-09
2.34796e-09
1.18112e-09
5.3244e-10
2.1116e-10
7.17239e-11
2.023e-11
4.5843e-12
8.05861e-13
1.3265e-13
1.68713e-13
7.17663e-13
2.77446e-12
9.30816e-12
2.73248e-11
5.40879e-33
2.48391e-28
2.98127e-25
6.48974e-23
4.94209e-21
1.81023e-19
3.83578e-18
5.28261e-17
5.07797e-16
3.54503e-15
1.85239e-14
7.5218e-14
2.43929e-13
7.07899e-13
1.92997e-12
5.05825e-12
1.34709e-11
3.52654e-11
8.98392e-11
2.03845e-10
4.11474e-10
7.70002e-10
1.40455e-09
2.51998e-09
4.38428e-09
7.26152e-09
1.13263e-08
1.6749e-08
2.38343e-08
3.35828e-08
4.46067e-08
5.31651e-08
5.19352e-08
3.66508e-08
2.40182e-08
1.48985e-08
8.64566e-09
4.63952e-09
2.25853e-09
9.74778e-10
3.62999e-10
1.12894e-10
2.83745e-11
5.55766e-12
9.36466e-13
8.32414e-13
3.27116e-12
1.21294e-11
3.89527e-11
1.09262e-10
2.45643e-31
6.04201e-27
5.28057e-24
9.34996e-22
6.13253e-20
2.00455e-18
3.88393e-17
4.98454e-16
4.54047e-15
3.05188e-14
1.55216e-13
6.1701e-13
1.9429e-12
5.3254e-12
1.34468e-11
3.20019e-11
7.67267e-11
1.83045e-10
4.31196e-10
9.06818e-10
1.68254e-09
2.88623e-09
4.87141e-09
8.13911e-09
1.32396e-08
2.05864e-08
3.02834e-08
4.28472e-08
6.05904e-08
9.01945e-08
1.26335e-07
1.66272e-07
1.84259e-07
1.0512e-07
6.79061e-08
4.32996e-08
2.62517e-08
1.49721e-08
7.8544e-09
3.69467e-09
1.51631e-09
5.23809e-10
1.47026e-10
3.22655e-11
5.72827e-12
3.18294e-12
1.10581e-11
3.98235e-11
1.2394e-10
3.35838e-10
8.8248e-30
1.17501e-25
7.56133e-23
1.09574e-20
6.21362e-19
1.81666e-17
3.22147e-16
3.85033e-15
3.31703e-14
2.14079e-13
1.0578e-12
4.11239e-12
1.26521e-11
3.29504e-11
7.76206e-11
1.68199e-10
3.61731e-10
7.81481e-10
1.70495e-09
3.33469e-09
5.70767e-09
8.99719e-09
1.40651e-08
2.18407e-08
3.31101e-08
4.78833e-08
6.53157e-08
8.65103e-08
1.24019e-07
2.13495e-07
3.30237e-07
5.75041e-07
8.14455e-07
2.73035e-07
1.60982e-07
1.07298e-07
6.8139e-08
4.10469e-08
2.29885e-08
1.17072e-08
5.28021e-09
2.03279e-09
6.42449e-10
1.58969e-10
3.07116e-11
1.06496e-11
2.92363e-11
1.03134e-10
3.14598e-10
8.31488e-10
2.55683e-28
1.87289e-24
8.95342e-22
1.06649e-19
5.24127e-18
1.372e-16
2.226e-15
2.47321e-14
2.00829e-13
1.23896e-12
5.92478e-12
2.24538e-11
6.77801e-11
1.68723e-10
3.73742e-10
7.43185e-10
1.43534e-09
2.78866e-09
5.65466e-09
1.03119e-08
1.62933e-08
2.36264e-08
3.43264e-08
4.94329e-08
6.92571e-08
9.24614e-08
1.17799e-07
1.50804e-07
2.18862e-07
4.14401e-07
9.61169e-07
2.16337e-06
3.11071e-06
1.17161e-06
5.42135e-07
2.89755e-07
1.68412e-07
1.00675e-07
5.81985e-08
3.14695e-08
1.54136e-08
6.57984e-09
2.34315e-09
6.61372e-10
1.4301e-10
3.54052e-11
6.3429e-11
2.18873e-10
6.61473e-10
1.72055e-09
6.13608e-27
2.52908e-23
9.02561e-21
8.85228e-19
3.77151e-17
8.8309e-16
1.3081e-14
1.34608e-13
1.02468e-12
6.00092e-12
2.75796e-11
1.01282e-10
2.99314e-10
7.19005e-10
1.50584e-09
2.78161e-09
4.86235e-09
8.44325e-09
1.60506e-08
2.74487e-08
3.96553e-08
5.29382e-08
7.19201e-08
9.53671e-08
1.2124e-07
1.46103e-07
1.70055e-07
2.15292e-07
3.85188e-07
9.44295e-07
2.48664e-06
1.30856e-05
1.51442e-05
2.07086e-06
9.17325e-07
4.98174e-07
2.7867e-07
1.77659e-07
1.12655e-07
6.7209e-08
3.6503e-08
1.74423e-08
7.03521e-09
2.28021e-09
5.66965e-10
1.23159e-10
1.19671e-10
3.92086e-10
1.18624e-09
3.06394e-09
1.24973e-25
2.99515e-22
8.00013e-20
6.46385e-18
2.38503e-16
4.98328e-15
6.71443e-14
6.36482e-13
4.50715e-12
2.48076e-11
1.08333e-10
3.8154e-10
1.09418e-09
2.55543e-09
5.0827e-09
8.82376e-09
1.4179e-08
2.19875e-08
4.00158e-08
6.52789e-08
8.29139e-08
1.03236e-07
1.31741e-07
1.58351e-07
1.79546e-07
1.96395e-07
2.2274e-07
3.06679e-07
5.5101e-07
1.06345e-06
1.23723e-05
1.58391e-05
1.58387e-05
1.2746e-05
1.01044e-06
6.37313e-07
3.10689e-07
2.17687e-07
1.58894e-07
1.09377e-07
6.82112e-08
3.73215e-08
1.72669e-08
6.47302e-09
1.87464e-09
4.23699e-10
2.15624e-10
6.07167e-10
1.85487e-09
4.80544e-09
2.15295e-24
3.13689e-21
6.33201e-19
4.2343e-17
1.35564e-15
2.52749e-14
3.09184e-13
2.68881e-12
1.75843e-11
8.99468e-11
3.67879e-10
1.22273e-09
3.3508e-09
7.5694e-09
1.43676e-08
2.36391e-08
3.54757e-08
4.95745e-08
5.52426e-08
1.37277e-07
1.47792e-07
1.67614e-07
1.82722e-07
2.27034e-07
2.18139e-07
1.9858e-07
2.40033e-07
2.73443e-07
4.13869e-07
9.28956e-07
2.62469e-06
1.35535e-05
1.55618e-05
2.62721e-06
1.13637e-06
6.82315e-07
3.4745e-07
2.47446e-07
1.96879e-07
1.52524e-07
1.08147e-07
6.75111e-08
3.57689e-08
1.54687e-08
5.22266e-09
1.3313e-09
4.23988e-10
8.32262e-10
2.57045e-09
6.75334e-09
2.9848e-23
2.80826e-20
4.37845e-18
2.45333e-16
6.87336e-15
1.15057e-13
1.28319e-12
1.02596e-11
6.19297e-11
2.92807e-10
1.10972e-09
3.42837e-09
8.79276e-09
1.88112e-08
3.40004e-08
5.32667e-08
7.56903e-08
6.98279e-08
1.8313e-07
2.40566e-07
2.08691e-07
2.36858e-07
1.90504e-07
2.98237e-07
3.05858e-07
4.66738e-07
2.44335e-07
2.71594e-07
2.96675e-07
4.08745e-07
8.93084e-07
2.14386e-06
2.90472e-06
1.45947e-06
6.26278e-07
4.40015e-07
3.11936e-07
2.61803e-07
2.3032e-07
1.96415e-07
1.54567e-07
1.08027e-07
6.47514e-08
3.2032e-08
1.25341e-08
3.70257e-09
9.72919e-10
1.05279e-09
3.19036e-09
8.61123e-09
3.16807e-22
2.05454e-19
2.54826e-17
1.21594e-15
3.01126e-14
4.55721e-13
4.65976e-12
3.44388e-11
1.92901e-10
8.46761e-10
2.97857e-09
8.53261e-09
2.02258e-08
4.02971e-08
6.87353e-08
1.01695e-07
1.37616e-07
1.36397e-07
2.61699e-07
3.04109e-07
2.41803e-07
3.21711e-07
5.60062e-07
3.1051e-07
3.50519e-07
3.56639e-07
6.76816e-07
2.76762e-07
2.95398e-07
3.1476e-07
4.02669e-07
7.50836e-07
1.13703e-06
6.20578e-07
3.7619e-07
2.96395e-07
2.86556e-07
2.74308e-07
2.631e-07
2.41089e-07
2.03456e-07
1.55641e-07
1.04137e-07
5.84208e-08
2.63724e-08
9.13083e-09
2.45716e-09
1.35283e-09
3.5766e-09
1.00395e-08
2.49399e-21
1.19546e-18
1.21738e-16
5.02917e-15
1.11175e-13
1.52977e-12
1.43907e-11
9.85339e-11
5.13193e-10
2.09759e-09
6.87471e-09
1.83571e-08
4.04989e-08
7.51391e-08
1.19715e-07
1.68029e-07
2.14652e-07
2.34277e-07
4.35374e-07
3.61793e-07
2.50763e-07
3.61714e-07
8.02955e-07
4.48638e-07
3.79026e-07
3.45408e-07
3.10533e-07
3.0412e-07
3.17075e-07
3.17154e-07
3.41356e-07
3.92239e-07
4.64675e-07
3.95654e-07
3.65751e-07
5.7633e-07
2.96645e-07
3.15838e-07
3.40943e-07
3.3209e-07
2.70586e-07
2.0872e-07
1.51054e-07
9.49713e-08
4.91275e-08
1.9905e-08
6.11646e-09
2.11477e-09
3.67626e-09
1.07295e-08
1.45045e-20
5.42093e-18
4.65967e-16
1.69478e-14
3.37822e-13
4.25415e-12
3.69675e-11
2.35111e-10
1.14056e-09
4.34681e-09
1.32915e-08
3.31377e-08
6.83799e-08
1.19332e-07
1.81793e-07
2.53934e-07
3.4795e-07
4.95505e-07
8.37948e-07
3.69196e-07
1.28868e-06
4.24094e-07
6.25047e-07
5.38459e-07
4.28361e-07
3.70764e-07
3.40012e-07
3.24104e-07
3.19849e-07
4.19179e-07
3.49781e-07
4.02553e-07
4.10264e-07
4.04863e-07
3.97279e-07
4.42869e-07
3.91475e-07
4.69481e-07
6.48569e-07
7.21445e-07
4.90076e-07
3.12876e-07
2.10896e-07
1.40655e-07
8.20494e-08
3.87303e-08
1.40292e-08
4.28296e-09
3.73795e-09
1.04992e-08
6.10749e-20
1.87711e-17
1.40201e-15
4.56982e-14
8.31675e-13
9.67342e-12
7.81944e-11
4.64441e-10
2.10811e-09
7.52278e-09
2.15478e-08
5.03736e-08
9.78488e-08
1.62526e-07
2.42245e-07
3.5065e-07
5.46052e-07
9.81467e-07
1.13292e-06
3.12247e-06
4.91856e-06
3.2236e-06
1.25491e-06
7.7284e-07
5.54888e-07
4.37558e-07
3.72841e-07
3.41511e-07
3.58836e-07
3.59627e-07
5.99177e-07
5.29876e-07
4.987e-07
4.90103e-07
4.93836e-07
5.19991e-07
5.7718e-07
6.9547e-07
8.01097e-07
1.92498e-06
7.11229e-07
6.27676e-07
3.60036e-07
2.12569e-07
1.279e-07
6.81355e-08
2.9104e-08
9.72961e-09
4.52561e-09
9.56073e-09
1.8663e-19
4.94873e-17
3.30917e-15
9.86727e-14
1.66468e-12
1.80946e-11
1.37323e-10
7.67819e-10
3.28439e-09
1.10449e-08
2.98044e-08
6.56668e-08
1.20545e-07
1.90496e-07
2.75916e-07
4.04419e-07
6.61944e-07
1.18818e-06
1.83205e-06
5.57261e-06
8.34376e-06
8.06572e-06
2.10178e-06
1.06341e-06
6.34421e-07
4.74666e-07
3.93186e-07
3.52837e-07
3.48478e-07
4.10553e-07
4.50898e-07
5.57613e-07
5.56221e-07
5.55363e-07
5.23232e-07
5.1698e-07
5.45517e-07
8.56349e-07
7.76261e-06
1.30711e-05
9.70445e-06
1.43521e-06
7.58388e-07
3.87723e-07
2.08998e-07
1.13945e-07
5.50279e-08
2.14224e-08
7.72147e-09
8.61841e-09
4.22776e-19
1.00977e-16
6.22207e-15
1.73275e-13
2.75217e-12
2.83109e-11
2.03989e-10
1.0847e-09
4.41499e-09
1.4123e-08
3.62389e-08
7.59992e-08
1.33607e-07
2.06618e-07
3.06686e-07
4.79327e-07
8.0988e-07
1.44123e-06
1.44305e-06
8.74441e-06
9.39026e-06
9.52728e-06
2.59272e-06
1.46524e-06
8.18944e-07
4.90437e-07
3.81611e-07
3.46363e-07
3.45154e-07
3.45595e-07
1.52989e-06
6.99433e-07
8.48148e-07
5.61504e-07
5.53337e-07
5.5387e-07
6.63081e-07
2.2201e-06
1.30585e-05
1.30704e-05
1.30717e-05
6.37685e-06
5.73289e-07
5.16204e-07
3.07194e-07
1.75149e-07
9.34788e-08
4.24832e-08
1.6069e-08
9.28067e-09
7.30136e-19
1.62765e-16
9.4802e-15
2.51527e-13
3.82336e-12
3.77333e-11
2.6124e-10
1.33591e-09
5.23052e-09
1.60953e-08
3.97464e-08
8.03963e-08
1.37092e-07
2.08396e-07
3.14343e-07
5.38559e-07
1.08773e-06
1.31805e-06
1.06948e-05
2.75802e-05
2.86114e-05
2.86114e-05
1.44831e-05
5.67788e-07
5.49322e-07
4.30137e-07
3.6188e-07
3.45076e-07
3.49014e-07
4.07107e-07
4.10952e-07
8.5992e-07
8.16516e-07
6.7755e-07
5.75572e-07
6.42002e-07
8.03106e-07
8.60405e-07
1.06407e-05
1.30722e-05
1.30726e-05
4.77117e-06
5.7115e-07
5.57306e-07
3.66633e-07
2.31477e-07
1.3921e-07
7.37938e-08
3.25089e-08
1.41522e-08
9.86102e-19
2.11208e-16
1.19037e-14
3.06445e-13
4.52747e-12
4.34437e-11
2.92465e-10
1.4542e-09
5.53767e-09
1.659e-08
3.9977e-08
7.92568e-08
1.33365e-07
2.01256e-07
3.01452e-07
5.11343e-07
1.00794e-06
8.88025e-07
1.9776e-05
2.86078e-05
2.86088e-05
2.86096e-05
2.62332e-05
2.92001e-06
4.07234e-07
4.00918e-07
3.45162e-07
5.90405e-07
3.55113e-07
4.24441e-07
6.05276e-07
7.24398e-07
2.1131e-06
9.92902e-07
5.79163e-07
5.41146e-07
6.21673e-07
1.03469e-06
1.43482e-06
7.15735e-06
4.75557e-06
1.80257e-06
2.52389e-06
9.60349e-07
5.2239e-07
3.27524e-07
2.05264e-07
1.19787e-07
6.072e-08
2.68578e-08
1.06471e-18
2.24751e-16
1.25044e-14
3.17988e-13
4.63707e-12
4.3871e-11
2.90906e-10
1.42438e-09
5.34454e-09
1.58025e-08
3.76969e-08
7.42816e-08
1.24611e-07
1.86895e-07
2.75301e-07
4.54635e-07
1.0882e-06
8.63769e-07
2.04538e-05
2.86081e-05
2.86072e-05
2.86071e-05
2.57506e-05
3.01029e-06
3.98261e-07
3.91618e-07
3.45186e-07
3.41162e-07
3.65275e-07
4.18952e-07
5.30167e-07
6.53395e-07
6.68463e-07
6.09777e-07
4.62453e-07
4.30953e-07
4.50872e-07
5.85157e-07
8.72657e-07
5.79031e-07
5.34669e-07
8.17347e-07
7.64238e-07
6.66276e-07
5.83203e-07
4.39233e-07
2.99849e-07
1.89427e-07
1.06975e-07
5.23949e-08
9.32971e-19
1.99034e-16
1.11561e-14
2.84735e-13
4.15725e-12
3.93302e-11
2.60541e-10
1.27348e-09
4.77119e-09
1.4109e-08
3.3755e-08
6.68894e-08
1.12725e-07
1.66878e-07
2.2704e-07
3.04464e-07
4.57674e-07
8.20479e-07
3.49077e-06
2.22775e-05
2.86084e-05
2.77598e-05
7.55448e-06
4.64493e-07
4.56512e-07
3.80236e-07
3.62319e-07
3.72804e-07
3.91996e-07
4.16869e-07
4.58884e-07
5.01904e-07
4.87769e-07
4.35477e-07
3.94964e-07
3.9496e-07
3.90472e-07
4.28381e-07
5.14926e-07
5.2825e-07
5.20559e-07
5.18909e-07
4.44311e-07
1.35731e-06
9.75106e-07
6.17928e-07
4.08459e-07
2.6389e-07
1.61095e-07
8.88602e-08
6.69351e-19
1.47811e-16
8.50174e-15
2.21568e-13
3.29267e-12
3.16116e-11
2.12043e-10
1.04864e-09
3.97597e-09
1.19126e-08
2.89344e-08
5.83781e-08
1.00413e-07
1.51393e-07
2.06183e-07
2.60795e-07
3.16437e-07
4.12348e-07
1.01738e-06
2.62049e-06
2.07322e-06
2.24908e-06
1.07323e-06
6.34384e-07
4.37986e-07
3.72291e-07
3.87523e-07
4.21777e-07
4.3607e-07
4.2299e-07
4.40565e-07
4.36964e-07
4.31041e-07
4.08273e-07
3.7922e-07
6.69074e-07
3.7708e-07
4.01666e-07
4.19294e-07
4.2584e-07
4.20848e-07
4.00682e-07
3.87067e-07
4.43935e-07
7.82578e-07
1.23079e-06
9.65749e-07
5.69015e-07
3.35484e-07
1.80932e-07
3.93152e-19
9.17556e-17
5.52067e-15
1.49521e-13
2.29616e-12
2.27002e-11
1.56493e-10
7.94283e-10
3.08871e-09
9.49353e-09
2.36808e-08
4.91368e-08
8.69106e-08
1.3406e-07
1.83494e-07
2.24771e-07
2.2828e-07
4.75357e-07
4.87769e-07
7.63173e-07
6.6944e-07
6.65159e-07
5.25703e-07
4.31941e-07
3.88279e-07
4.39694e-07
4.32504e-07
4.68566e-07
4.38813e-07
5.9906e-07
4.43863e-07
8.58527e-07
4.33876e-07
4.21828e-07
3.89498e-07
3.73046e-07
3.71889e-07
3.71511e-07
4.50157e-07
4.31516e-07
4.28659e-07
4.09587e-07
3.83632e-07
3.70678e-07
5.1287e-07
4.84155e-07
1.30219e-06
1.52698e-06
8.83251e-07
4.80296e-07
1.87021e-19
4.71899e-17
3.03724e-15
8.70245e-14
1.4036e-12
1.45078e-11
1.04334e-10
5.51864e-10
2.23602e-09
7.15985e-09
1.86007e-08
4.01777e-08
7.39095e-08
1.18491e-07
1.68671e-07
2.15816e-07
2.50517e-07
2.52414e-07
4.8601e-07
4.16499e-07
3.7054e-07
3.63866e-07
3.7322e-07
3.81259e-07
4.14487e-07
4.1996e-07
1.1496e-06
6.57249e-07
5.71637e-07
5.43883e-07
4.54164e-07
5.77461e-07
6.58139e-07
4.23276e-07
4.15173e-07
3.90529e-07
3.81492e-07
3.84467e-07
3.84588e-07
5.58441e-07
4.65766e-07
4.56684e-07
4.3557e-07
4.03396e-07
4.06631e-07
4.32033e-07
6.11878e-07
8.6482e-07
1.04068e-06
6.33773e-07
7.20008e-20
2.00947e-17
1.40683e-15
4.33825e-14
7.47929e-13
8.22679e-12
6.27988e-11
3.51991e-10
1.50921e-09
5.10657e-09
1.39944e-08
3.18161e-08
6.13733e-08
1.0257e-07
1.51244e-07
1.99826e-07
2.40045e-07
2.66206e-07
2.68913e-07
2.96728e-07
3.11019e-07
3.10456e-07
7.37113e-07
3.52783e-07
4.18073e-07
4.71808e-07
5.17162e-07
5.63828e-07
4.35861e-07
1.50442e-06
1.78524e-05
3.42947e-05
3.14824e-05
1.15996e-05
4.39463e-07
4.63285e-07
4.27308e-07
4.1902e-07
4.42427e-07
4.50681e-07
9.02779e-07
5.17276e-07
4.69668e-07
4.47638e-07
4.7944e-07
4.40131e-07
4.73447e-07
4.70706e-07
1.04031e-06
6.95032e-07
2.23648e-20
7.04613e-18
5.47452e-16
1.85172e-14
3.47258e-13
4.13291e-12
3.39802e-11
2.04442e-10
9.38995e-10
3.40017e-09
9.96411e-09
2.41566e-08
4.94278e-08
8.68658e-08
1.3303e-07
1.80128e-07
2.19772e-07
2.44123e-07
2.69792e-07
2.86345e-07
2.99675e-07
3.10198e-07
3.08838e-07
3.42292e-07
3.68372e-07
4.03269e-07
4.00247e-07
3.49203e-07
3.49325e-07
2.33153e-05
4.75273e-05
4.75095e-05
4.7515e-05
4.7509e-05
1.32394e-05
4.68502e-07
4.86862e-07
4.59124e-07
4.43218e-07
9.13936e-07
6.37794e-07
5.77073e-07
4.90374e-07
4.53815e-07
1.69674e-06
2.13722e-06
7.40392e-07
5.06777e-07
5.50786e-07
7.28564e-07
5.58747e-21
2.01686e-18
1.77283e-16
6.68588e-15
1.38469e-13
1.80669e-12
1.621e-11
1.06159e-10
5.29675e-10
2.07973e-09
6.58822e-09
1.71962e-08
3.76922e-08
7.04906e-08
1.13791e-07
1.60053e-07
1.93994e-07
1.96442e-07
7.97597e-07
2.75259e-07
2.84815e-07
2.99379e-07
3.06988e-07
3.06118e-07
7.32791e-07
3.22548e-07
3.36999e-07
3.29059e-07
1.08264e-06
4.31654e-05
4.75097e-05
4.75021e-05
4.75095e-05
4.75123e-05
3.52249e-05
1.64509e-06
4.90608e-07
4.90703e-07
4.58266e-07
4.62558e-07
5.13276e-07
4.88658e-07
4.90174e-07
1.37863e-05
4.3004e-05
4.64043e-05
2.87142e-05
2.69714e-06
5.5523e-07
5.86131e-07
1.10497e-21
4.71588e-19
4.78611e-17
2.04573e-15
4.73566e-14
6.84326e-13
6.76581e-12
4.87107e-11
2.66609e-10
1.14501e-09
3.95008e-09
1.11786e-08
2.648e-08
5.35153e-08
9.35205e-08
1.42135e-07
1.47841e-07
2.82943e-07
1.95142e-07
2.58799e-07
2.64464e-07
2.64611e-07
4.20078e-07
3.04518e-07
2.98883e-07
3.07258e-07
3.27323e-07
3.28671e-07
3.28669e-07
4.14944e-05
4.75131e-05
4.75021e-05
4.74959e-05
4.74999e-05
3.33745e-05
1.3872e-06
1.12668e-06
4.97663e-07
8.73482e-07
4.74415e-07
4.7135e-07
4.63946e-07
1.04735e-05
4.90842e-05
4.92184e-05
4.92082e-05
4.92785e-05
3.30012e-05
1.32521e-06
5.2908e-07
1.64417e-22
8.70277e-20
1.06221e-17
5.30579e-16
1.40493e-14
2.28924e-13
2.52448e-12
2.00471e-11
1.1987e-10
5.59569e-10
2.09454e-09
6.42732e-09
1.64985e-08
3.61564e-08
6.86807e-08
1.13734e-07
1.6418e-07
1.83362e-07
1.87201e-07
8.71965e-07
3.00431e-07
2.81518e-07
2.73594e-07
3.34264e-07
2.9744e-07
5.19534e-07
3.32416e-07
3.31632e-07
3.28672e-07
3.38033e-05
4.75131e-05
4.75074e-05
4.74938e-05
4.75192e-05
2.93531e-05
9.22698e-07
5.18829e-07
5.47896e-07
4.87885e-07
4.82405e-07
4.69436e-07
4.63945e-07
1.87611e-05
4.92697e-05
4.92325e-05
4.92174e-05
4.92218e-05
4.59621e-05
4.87803e-06
4.72787e-07
1.86452e-23
1.29996e-20
2.01061e-18
1.22855e-16
3.86438e-15
7.24642e-14
8.9216e-13
7.72117e-12
4.95434e-11
2.46743e-10
9.85619e-10
3.24199e-09
8.98779e-09
2.13662e-08
4.42441e-08
8.04525e-08
1.27895e-07
1.77457e-07
2.04981e-07
2.08665e-07
4.08044e-07
2.62352e-07
2.73066e-07
2.74056e-07
2.96133e-07
2.97907e-07
3.49432e-07
3.53445e-07
3.37695e-07
2.23933e-06
3.28471e-05
4.71412e-05
4.7495e-05
3.19557e-05
2.35109e-06
5.19074e-07
5.1452e-07
6.33105e-07
5.73054e-07
5.29671e-07
4.85872e-07
4.63955e-07
1.63658e-05
4.93142e-05
4.92822e-05
4.92292e-05
4.92254e-05
4.38733e-05
5.28673e-06
4.67159e-07
1.64111e-24
1.60798e-21
3.42149e-19
2.75541e-17
1.07284e-15
2.34494e-14
3.21634e-13
3.00444e-12
2.04089e-11
1.06237e-10
4.40871e-10
1.51327e-09
4.41173e-09
1.11364e-08
2.47774e-08
4.90612e-08
8.60762e-08
1.31977e-07
1.29678e-07
3.53737e-07
2.05831e-07
2.47995e-07
2.66473e-07
2.80287e-07
2.9488e-07
3.17705e-07
3.56519e-07
4.00369e-07
4.76464e-07
6.84269e-07
1.09847e-06
1.03496e-06
1.59834e-06
6.56772e-07
6.55847e-07
9.56553e-07
6.25689e-07
5.20708e-07
5.1012e-07
5.00417e-07
4.80664e-07
4.64251e-07
7.68065e-07
2.65045e-05
4.92756e-05
4.92428e-05
4.71177e-05
1.37967e-05
4.70918e-07
4.6158e-07
1.16067e-25
1.76109e-22
5.84083e-20
6.63131e-18
3.23009e-16
8.13581e-15
1.22256e-13
1.2149e-12
8.6135e-12
4.62219e-11
1.96623e-10
6.91072e-10
2.06853e-09
5.40596e-09
1.25546e-08
2.62687e-08
4.97618e-08
8.42835e-08
1.25457e-07
1.16578e-07
1.79171e-07
2.21181e-07
2.455e-07
2.68606e-07
2.82341e-07
3.00507e-07
3.35724e-07
3.85007e-07
4.51735e-07
7.15598e-07
9.82295e-07
1.03477e-06
1.0822e-06
7.6593e-07
6.5624e-07
5.28119e-07
4.75639e-07
4.53584e-07
4.59006e-07
4.68461e-07
5.41794e-07
4.82917e-07
4.86747e-07
1.05408e-06
7.29606e-06
8.12188e-06
2.86838e-06
4.71366e-07
4.67336e-07
4.61143e-07
6.95356e-27
1.74532e-23
1.02042e-20
1.66727e-18
9.97027e-17
2.82914e-15
4.562e-14
4.73087e-13
3.45003e-12
1.8914e-11
8.21015e-11
2.94591e-10
9.02563e-10
2.42448e-09
5.82289e-09
1.26824e-08
2.52955e-08
4.60811e-08
7.5746e-08
1.11964e-07
1.50427e-07
1.86837e-07
2.00909e-07
2.7187e-07
2.75366e-07
2.8085e-07
2.99252e-07
3.44277e-07
4.34475e-07
5.53004e-07
6.38884e-07
5.91045e-07
1.05965e-06
6.04396e-07
4.80919e-07
4.25387e-07
4.03037e-07
3.83253e-07
4.03085e-07
6.06596e-07
4.70769e-07
4.74237e-07
2.25193e-06
2.87044e-06
5.22984e-07
4.93163e-07
4.89156e-07
4.8592e-07
4.89149e-07
4.66094e-07
3.22603e-28
1.52467e-24
1.95398e-21
4.29091e-19
2.94047e-17
8.98927e-16
1.51639e-14
1.6213e-13
1.20882e-12
6.75794e-12
2.99435e-11
1.099e-10
3.45844e-10
9.58059e-10
2.38394e-09
5.40395e-09
1.12856e-08
2.17962e-08
3.87243e-08
6.2877e-08
9.33347e-08
1.27615e-07
1.04609e-07
5.00403e-07
2.96235e-07
2.60608e-07
2.6286e-07
2.8999e-07
3.35328e-07
3.84194e-07
4.19705e-07
4.33629e-07
3.81344e-07
3.93892e-07
3.90652e-07
3.85049e-07
3.80914e-07
3.77176e-07
3.76867e-07
3.75993e-07
3.7608e-07
3.07176e-06
1.09882e-05
1.09862e-05
5.08383e-06
5.031e-07
4.95772e-07
4.92487e-07
4.93026e-07
6.38061e-07
1.02813e-29
1.62581e-25
3.67329e-22
9.82356e-20
7.46959e-18
2.43853e-16
4.31107e-15
4.76631e-14
3.64043e-13
2.07243e-12
9.33731e-12
3.49528e-11
1.12815e-10
3.22626e-10
8.33994e-10
1.97545e-09
4.33252e-09
8.84992e-09
1.6836e-08
2.97046e-08
4.8443e-08
7.30256e-08
1.01832e-07
8.15761e-08
1.29582e-07
1.68902e-07
2.03261e-07
2.39116e-07
2.80564e-07
3.22206e-07
3.53801e-07
3.70967e-07
3.78431e-07
3.82723e-07
3.85764e-07
3.90205e-07
3.96179e-07
3.93398e-07
3.88922e-07
3.83331e-07
3.7913e-07
9.63942e-06
1.09443e-05
1.09916e-05
9.02856e-06
1.09307e-05
2.6131e-05
2.32778e-05
1.0247e-05
9.44872e-07
1.74716e-31
1.80976e-26
5.86841e-23
1.87108e-20
1.63257e-18
6.22041e-17
1.2739e-15
1.55872e-14
1.24669e-13
7.11525e-13
3.1322e-12
1.13384e-11
3.5499e-11
9.97563e-11
2.58013e-10
6.23634e-10
1.41923e-09
3.0495e-09
6.18345e-09
1.17893e-08
2.10318e-08
3.49787e-08
5.41501e-08
7.82798e-08
1.06212e-07
1.35907e-07
1.65955e-07
1.98248e-07
2.35226e-07
2.7381e-07
3.06937e-07
3.32422e-07
3.55501e-07
3.78522e-07
3.9641e-07
4.20152e-07
4.45848e-07
4.32724e-07
4.15047e-07
5.31825e-07
4.98516e-07
1.55411e-06
3.66314e-06
3.05949e-06
1.87243e-05
9.42694e-05
0.000120464
0.000120465
0.000109976
2.64112e-05
1.47098e-33
1.70626e-27
7.79883e-24
4.38353e-21
9.0995e-19
6.52123e-17
1.82297e-15
2.47436e-14
1.95195e-13
1.02306e-12
3.93076e-12
1.19244e-11
3.02957e-11
6.75704e-11
1.38522e-10
2.72405e-10
5.31458e-10
1.04599e-09
2.07114e-09
4.06074e-09
7.73035e-09
1.40553e-08
2.4137e-08
3.8942e-08
5.89535e-08
8.36904e-08
1.12048e-07
1.43908e-07
1.82129e-07
2.26064e-07
2.6946e-07
3.09998e-07
3.53395e-07
3.95231e-07
4.21564e-07
4.68088e-07
5.09864e-07
4.35733e-07
9.15191e-07
9.29061e-07
7.47447e-07
6.5513e-07
6.54283e-07
6.55094e-07
9.49436e-05
0.000120522
0.000120486
0.00012054
0.000120575
0.000105677
2.27019e-35
1.3898e-28
4.78108e-24
1.42488e-20
4.43671e-18
3.12496e-16
7.94356e-15
9.75565e-14
7.02809e-13
3.39621e-12
1.20981e-11
3.39949e-11
7.91841e-11
1.58155e-10
2.78823e-10
4.44979e-10
6.5902e-10
9.33514e-10
1.31784e-09
1.94599e-09
3.10736e-09
5.33092e-09
9.4503e-09
1.65917e-08
2.80109e-08
4.47042e-08
6.66911e-08
9.26689e-08
1.28402e-07
1.78077e-07
2.35294e-07
2.93306e-07
3.60173e-07
4.23177e-07
4.53266e-07
5.00928e-07
5.77282e-07
5.7663e-07
5.81678e-07
6.08721e-07
6.39181e-07
6.58462e-07
6.54635e-07
8.91068e-06
0.000120458
0.000120522
0.000120457
0.000120415
0.000120546
0.000120572
5.2764e-37
2.19298e-28
4.08156e-23
1.0161e-19
2.52973e-17
1.48654e-15
3.27299e-14
3.58806e-13
2.36333e-12
1.06413e-11
3.58523e-11
9.64021e-11
2.16811e-10
4.20799e-10
7.23118e-10
1.12213e-09
1.59512e-09
2.09951e-09
2.58434e-09
3.01717e-09
3.43003e-09
3.98931e-09
5.09649e-09
7.50542e-09
1.23935e-08
2.12855e-08
3.53698e-08
5.35545e-08
8.30876e-08
1.3254e-07
1.97055e-07
2.63145e-07
3.42822e-07
4.56476e-07
4.96397e-07
4.99726e-07
4.83954e-07
4.80501e-07
1.44235e-06
2.98861e-06
1.13575e-06
6.6603e-07
6.54963e-07
3.08481e-06
0.000102607
0.000120745
0.000120504
0.000120751
0.000120682
7.41633e-05
1.36624e-37
2.97275e-27
3.51167e-22
6.34385e-19
1.24686e-16
6.11328e-15
1.1693e-13
1.14858e-12
6.9432e-12
2.92304e-11
9.34237e-11
2.4106e-10
5.2516e-10
9.95495e-10
1.68309e-09
2.58672e-09
3.66284e-09
4.82214e-09
5.93591e-09
6.86042e-09
7.47354e-09
7.71685e-09
7.66892e-09
7.67374e-09
8.50201e-09
1.14884e-08
1.84256e-08
3.07502e-08
5.06171e-08
8.47514e-08
1.3454e-07
1.94955e-07
1.97247e-07
6.8394e-07
6.52373e-07
4.82362e-07
4.76033e-07
4.77891e-07
3.37997e-06
3.67884e-06
1.73994e-06
6.72102e-07
6.60413e-07
3.67962e-06
2.18105e-05
0.000102032
0.000119044
0.000116569
7.47169e-05
7.34508e-06
4.19171e-36
3.57216e-26
2.59789e-21
3.4098e-18
5.31062e-16
2.18311e-14
3.64686e-13
3.22647e-12
1.79812e-11
7.10295e-11
2.15895e-10
5.3535e-10
1.13023e-09
2.09206e-09
3.47711e-09
5.28548e-09
7.44622e-09
9.81089e-09
1.21544e-08
1.42154e-08
1.57483e-08
1.65355e-08
1.64224e-08
1.54328e-08
1.39433e-08
1.28801e-08
1.38721e-08
1.91002e-08
3.11389e-08
5.51108e-08
8.89632e-08
1.72265e-07
2.81939e-07
2.98824e-07
3.89483e-07
4.40244e-07
4.40732e-07
1.25815e-06
3.67221e-06
3.6804e-06
1.55856e-06
1.20774e-06
8.36914e-06
3.74989e-06
2.26858e-06
6.51739e-06
6.15942e-06
3.88632e-06
2.27852e-06
2.28745e-06
1.198e-34
3.69011e-25
1.65687e-20
1.58714e-17
1.97037e-15
6.83645e-14
1.00418e-12
8.05244e-12
4.15934e-11
1.54805e-10
4.48783e-10
1.07132e-09
2.19319e-09
3.96373e-09
6.47056e-09
9.70979e-09
1.35683e-08
1.78178e-08
2.20948e-08
2.59926e-08
2.9179e-08
3.13235e-08
3.20621e-08
3.11166e-08
2.8513e-08
2.4759e-08
2.10894e-08
1.96278e-08
2.32912e-08
3.45753e-08
6.29727e-08
1.29352e-07
2.22566e-07
3.7478e-07
4.17501e-07
4.43877e-07
4.46896e-07
2.10567e-06
3.65883e-06
1.43963e-06
1.45196e-06
1.48277e-05
2.08987e-05
9.41384e-06
2.25516e-06
2.25703e-06
2.26267e-06
2.26911e-06
2.27472e-06
2.27976e-06
2.93544e-33
3.2858e-24
9.15752e-20
6.44627e-17
6.42948e-15
1.89853e-13
2.47198e-12
1.8096e-11
8.71478e-11
3.06996e-10
8.51573e-10
1.96085e-09
3.89532e-09
6.87452e-09
1.10162e-08
1.62946e-08
2.25259e-08
2.93717e-08
3.62425e-08
4.25436e-08
4.79924e-08
5.22529e-08
5.4763e-08
5.4904e-08
5.24343e-08
4.73977e-08
4.04493e-08
3.32781e-08
2.87863e-08
3.03969e-08
3.75761e-08
6.50119e-08
7.77999e-08
2.88385e-07
6.59209e-07
4.46729e-07
1.34918e-06
2.12263e-06
2.04584e-06
1.30164e-06
4.33145e-06
2.08998e-05
2.09012e-05
1.35852e-05
2.25315e-06
2.25399e-06
2.51331e-06
2.27412e-06
2.27872e-06
2.29036e-06
9.6259e-30
5.36618e-29
3.52054e-28
2.46922e-27
1.72876e-26
1.13533e-25
6.80533e-25
3.61421e-24
1.63219e-23
6.39106e-23
2.28681e-22
7.61878e-22
2.38086e-21
7.31795e-21
2.30477e-20
7.7228e-20
2.63339e-19
8.65632e-19
2.56655e-18
6.55169e-18
1.40649e-17
2.50043e-17
3.72228e-17
4.70113e-17
5.09276e-17
4.7454e-17
3.79205e-17
2.55704e-17
1.42329e-17
6.36231e-18
2.22981e-18
5.98228e-19
1.25134e-19
2.00189e-20
2.45358e-21
2.30597e-22
1.66108e-23
9.17404e-25
3.87694e-26
1.25609e-27
3.1454e-29
6.16129e-31
9.39478e-33
1.0802e-34
9.01161e-37
5.13261e-39
1.83744e-41
3.63399e-44
3.28641e-47
1.02145e-50
1.39117e-25
8.10639e-25
5.03682e-24
3.14751e-23
1.87417e-22
1.00127e-21
4.79339e-21
2.0448e-20
7.61892e-20
2.50122e-19
7.40977e-19
2.06059e-18
5.47147e-18
1.39274e-17
3.44368e-17
8.38525e-17
1.99946e-16
4.58211e-16
9.81309e-16
1.92257e-15
3.3525e-15
5.12292e-15
6.85833e-15
8.05873e-15
8.32654e-15
7.57518e-15
6.01068e-15
4.08688e-15
2.31905e-15
1.07928e-15
4.02335e-16
1.17249e-16
2.72264e-17
4.92596e-18
6.93829e-19
7.59683e-20
6.42969e-21
4.19886e-22
2.11588e-23
8.25698e-25
2.52359e-26
6.11787e-28
1.15777e-29
1.66929e-31
1.7698e-33
1.30916e-35
6.25133e-38
1.70295e-40
2.11782e-43
7.15265e-47
7.4553e-22
4.36045e-21
2.28658e-20
1.07001e-19
4.52305e-19
1.72265e-18
5.89329e-18
1.80953e-17
5.02372e-17
1.26538e-16
2.92714e-16
6.37932e-16
1.34292e-15
2.76327e-15
5.55513e-15
1.09258e-14
2.1012e-14
3.93127e-14
7.0332e-14
1.18275e-13
1.82387e-13
2.53964e-13
3.1742e-13
3.54774e-13
3.54593e-13
3.1622e-13
2.49153e-13
1.70169e-13
9.84265e-14
4.75781e-14
1.87581e-14
5.86244e-15
1.49374e-15
3.00901e-16
4.77399e-17
5.94609e-18
5.76468e-19
4.32639e-20
2.4984e-21
1.11231e-22
3.84629e-24
1.05872e-25
2.2868e-27
3.77118e-29
4.59078e-31
3.9274e-33
2.19225e-35
7.07755e-38
1.06333e-40
4.44567e-44
6.94221e-19
3.18252e-18
1.28794e-17
4.62796e-17
1.48642e-16
4.30796e-16
1.14118e-15
2.76932e-15
6.17623e-15
1.27862e-14
2.4847e-14
4.61445e-14
8.35728e-14
1.49056e-13
2.6051e-13
4.45057e-13
7.45255e-13
1.2241e-12
1.9504e-12
2.9692e-12
4.22161e-12
5.51615e-12
6.55718e-12
7.05074e-12
6.85329e-12
6.00968e-12
4.711e-12
3.23328e-12
1.91207e-12
9.62474e-13
3.99061e-13
1.33893e-13
3.744e-14
8.39159e-15
1.49405e-15
2.09072e-16
2.28189e-17
1.93434e-18
1.25846e-19
6.24554e-21
2.37716e-22
7.08988e-24
1.66168e-25
2.97979e-27
3.9402e-29
3.65564e-31
2.21433e-33
7.79382e-36
1.28358e-38
5.86528e-42
1.1766e-16
4.4184e-16
1.47117e-15
4.37632e-15
1.17184e-14
2.84606e-14
6.32165e-14
1.30224e-13
2.50667e-13
4.54342e-13
7.85285e-13
1.31128e-12
2.14589e-12
3.4625e-12
5.47242e-12
8.45678e-12
1.28428e-11
1.9247e-11
2.82439e-11
4.00632e-11
5.3781e-11
6.70345e-11
7.65301e-11
7.95574e-11
7.54781e-11
6.52809e-11
5.09943e-11
3.52869e-11
2.1401e-11
1.1185e-11
4.8838e-12
1.76496e-12
5.426e-13
1.3584e-13
2.72943e-14
4.3317e-15
5.34799e-16
5.07481e-17
3.68319e-18
2.01962e-19
8.32771e-21
2.63372e-22
6.53418e-24
1.23979e-25
1.72319e-27
1.66904e-29
1.04945e-31
3.81226e-34
6.44298e-37
2.98185e-40
6.2206e-15
2.01015e-14
5.78955e-14
1.49836e-13
3.51333e-13
7.52532e-13
1.48495e-12
2.72587e-12
4.7292e-12
7.82006e-12
1.24545e-11
1.92931e-11
2.93364e-11
4.38966e-11
6.42704e-11
9.20604e-11
1.29959e-10
1.81737e-10
2.50713e-10
3.37307e-10
4.33421e-10
5.19274e-10
5.7169e-10
5.76813e-10
5.35599e-10
4.57995e-10
3.57113e-10
2.49862e-10
1.56069e-10
8.45409e-11
3.90051e-11
1.52239e-11
5.14203e-12
1.43627e-12
3.2653e-13
5.92735e-14
8.41487e-15
9.13532e-16
7.44988e-17
4.5097e-18
2.03069e-19
6.75005e-21
1.73243e-22
3.41697e-24
4.92289e-26
4.88612e-28
3.10237e-30
1.12372e-32
1.86967e-35
8.40727e-39
1.43609e-13
4.13636e-13
1.06662e-12
2.48399e-12
5.27131e-12
1.02835e-11
1.86133e-11
3.15666e-11
5.07738e-11
7.85988e-11
1.17911e-10
1.72611e-10
2.47957e-10
3.49633e-10
4.81411e-10
6.4926e-10
8.64797e-10
1.14475e-09
1.50346e-09
1.93902e-09
2.39952e-09
2.77414e-09
2.95534e-09
2.89904e-09
2.63927e-09
2.23543e-09
1.74436e-09
1.24196e-09
7.96949e-10
4.50084e-10
2.20703e-10
9.34148e-11
3.46406e-11
1.07659e-11
2.75892e-12
5.70901e-13
9.32895e-14
1.17573e-14
1.11417e-15
7.72347e-17
3.8392e-18
1.36528e-19
3.60717e-21
7.28473e-23
1.07578e-24
1.08411e-26
6.86475e-29
2.42632e-31
3.88063e-34
1.65983e-37
1.78011e-12
4.68691e-12
1.10937e-11
2.38263e-11
4.68643e-11
8.52117e-11
1.44613e-10
2.31367e-10
3.52607e-10
5.19128e-10
7.43532e-10
1.04029e-09
1.42649e-09
1.9153e-09
2.50561e-09
3.21399e-09
4.07452e-09
5.14674e-09
6.48909e-09
8.06103e-09
9.64046e-09
1.07813e-08
1.11237e-08
1.06212e-08
9.4926e-09
7.96941e-09
6.23284e-09
4.54087e-09
3.00085e-09
1.78322e-09
9.36694e-10
4.32127e-10
1.75877e-10
6.06391e-11
1.74489e-11
4.09838e-12
7.67354e-13
1.11748e-13
1.23377e-14
1.00409e-15
5.83691e-17
2.34537e-18
6.46258e-20
1.33277e-21
1.99945e-23
2.04481e-25
1.28472e-27
4.39556e-30
6.67216e-33
2.69436e-36
1.36134e-11
3.34095e-11
7.39186e-11
1.48951e-10
2.76122e-10
4.75531e-10
7.68315e-10
1.17611e-09
1.72222e-09
2.43629e-09
3.35983e-09
4.52428e-09
5.96215e-09
7.67708e-09
9.62083e-09
1.18097e-08
1.43296e-08
1.73507e-08
2.10266e-08
2.52311e-08
2.91882e-08
3.15638e-08
3.15576e-08
2.93524e-08
2.57485e-08
2.13883e-08
1.68124e-08
1.25804e-08
8.66153e-09
5.4795e-09
3.11026e-09
1.57213e-09
7.02372e-10
2.67787e-10
8.61601e-11
2.28653e-11
4.88208e-12
8.17576e-13
1.04648e-13
9.95945e-15
6.83524e-16
3.26079e-17
1.03338e-18
2.21297e-20
3.39367e-22
3.50799e-24
2.2062e-26
7.32145e-29
1.04832e-31
4.06582e-35
7.09095e-11
1.64459e-10
3.44742e-10
6.60346e-10
1.16855e-09
1.92937e-09
2.9995e-09
4.43222e-09
6.27997e-09
8.59823e-09
1.14708e-08
1.49292e-08
1.89877e-08
2.35692e-08
2.84743e-08
3.36151e-08
3.91496e-08
4.53865e-08
5.27673e-08
6.09785e-08
6.71226e-08
5.65042e-08
6.87856e-08
6.22051e-08
5.33083e-08
4.37171e-08
3.48686e-08
2.72345e-08
1.98611e-08
1.35242e-08
8.35121e-09
4.64319e-09
2.2788e-09
9.57475e-10
3.42921e-10
1.02326e-10
2.47911e-11
4.75044e-12
7.0144e-13
7.76663e-14
6.26019e-15
3.54443e-16
1.34293e-17
3.27095e-19
5.39131e-21
5.78498e-23
3.63239e-25
1.1818e-27
1.62549e-30
6.09433e-34
2.70763e-10
6.00116e-10
1.20453e-09
2.21665e-09
3.77543e-09
6.01267e-09
9.04504e-09
1.29671e-08
1.7853e-08
2.37508e-08
3.07253e-08
3.87465e-08
4.77098e-08
5.73714e-08
6.72155e-08
7.68413e-08
8.5948e-08
9.47711e-08
1.04275e-07
1.14497e-07
1.22614e-07
1.50727e-07
9.76217e-08
8.31396e-08
8.31746e-08
6.76812e-08
5.67296e-08
4.79055e-08
3.78089e-08
2.77711e-08
1.86532e-08
1.14053e-08
6.15951e-09
2.84256e-09
1.12798e-09
3.76558e-10
1.0299e-10
2.24662e-11
3.80739e-12
4.87903e-13
4.59173e-14
3.0647e-15
1.38408e-16
3.99933e-18
7.43386e-20
8.83327e-22
5.89265e-24
1.91237e-26
2.53233e-29
9.30956e-33
8.02577e-10
1.71522e-09
3.32478e-09
5.90559e-09
9.72293e-09
1.50062e-08
2.19207e-08
3.05614e-08
4.09441e-08
5.29948e-08
6.65546e-08
8.14614e-08
9.74219e-08
1.14227e-07
1.31139e-07
1.47132e-07
1.5955e-07
1.63688e-07
1.54407e-07
1.19151e-07
1.1916e-07
1.19297e-07
1.40457e-07
2.14859e-07
8.36105e-08
8.36533e-08
8.05008e-08
7.27187e-08
6.3129e-08
4.93162e-08
3.5611e-08
2.37466e-08
1.41538e-08
7.15266e-09
3.12991e-09
1.16299e-09
3.57201e-10
8.82405e-11
1.70737e-11
2.51832e-12
2.7503e-13
2.14866e-14
1.14777e-15
3.96078e-17
8.58964e-19
1.16547e-20
8.75856e-23
3.03558e-25
4.00225e-28
1.4363e-31
1.93172e-09
4.00991e-09
7.53527e-09
1.29672e-08
2.07087e-08
3.10355e-08
4.40664e-08
5.97482e-08
7.78544e-08
9.79979e-08
1.19679e-07
1.42647e-07
1.66906e-07
1.93172e-07
2.22466e-07
2.55802e-07
2.92972e-07
3.21827e-07
2.27446e-07
1.35955e-06
8.07424e-06
4.40611e-06
1.35907e-07
1.36722e-07
1.29884e-07
1.27861e-07
1.18224e-07
1.04483e-07
9.65067e-08
7.85474e-08
5.96976e-08
4.25586e-08
2.81256e-08
1.55258e-08
7.4564e-09
3.06779e-09
1.05247e-09
2.92854e-10
6.43399e-11
1.08593e-11
1.36738e-12
1.24153e-13
7.78384e-15
3.19211e-16
8.19423e-18
1.29797e-19
1.12629e-21
4.4081e-24
6.13904e-27
2.18502e-30
3.9135e-09
7.92798e-09
1.44939e-08
2.42358e-08
3.7595e-08
5.47272e-08
7.54791e-08
9.93999e-08
1.25798e-07
1.53854e-07
1.82795e-07
2.12232e-07
2.4245e-07
2.73887e-07
3.06623e-07
3.38803e-07
3.60419e-07
3.2919e-07
5.9942e-06
3.54764e-05
4.07309e-05
3.88066e-05
1.04132e-05
1.31197e-07
1.33163e-07
1.43104e-07
1.52853e-07
1.50549e-07
1.35301e-07
1.14542e-07
9.00244e-08
6.64901e-08
4.90751e-08
2.95374e-08
1.54951e-08
7.02138e-09
2.67587e-09
8.3397e-10
2.06825e-10
3.96945e-11
5.72395e-12
5.99686e-13
4.37978e-14
2.11894e-15
6.4517e-17
1.20586e-18
1.23013e-20
5.63517e-23
8.80239e-26
3.18181e-29
6.86746e-09
1.36351e-08
2.43384e-08
3.96228e-08
5.97435e-08
8.44529e-08
1.13039e-07
1.44438e-07
1.7742e-07
2.10837e-07
2.43828e-07
2.7572e-07
3.05795e-07
3.3234e-07
3.53488e-07
3.66929e-07
4.36003e-07
3.66317e-07
1.96477e-05
4.07257e-05
4.07286e-05
4.07273e-05
3.11395e-05
1.31197e-07
1.38646e-07
1.67865e-07
1.8827e-07
1.86035e-07
1.68542e-07
1.53248e-07
1.24591e-07
9.13579e-08
7.62623e-08
4.99888e-08
2.85093e-08
1.41488e-08
5.95573e-09
2.06674e-09
5.74943e-10
1.24634e-10
2.04363e-11
2.45265e-12
2.0712e-13
1.17308e-14
4.22966e-16
9.34632e-18
1.129e-19
6.17964e-22
1.12238e-24
4.34552e-28
1.06895e-08
2.0888e-08
3.65444e-08
5.80464e-08
8.51581e-08
1.16932e-07
1.51878e-07
1.88175e-07
2.23837e-07
2.56765e-07
2.84827e-07
3.06404e-07
3.21914e-07
3.35148e-07
3.4817e-07
7.40415e-07
4.27362e-07
7.10051e-07
2.73767e-05
4.07245e-05
4.0726e-05
4.07267e-05
3.9289e-05
8.6938e-07
1.42948e-07
1.97198e-07
2.18318e-07
2.06634e-07
1.7817e-07
1.87555e-07
1.62204e-07
1.10285e-07
1.0692e-07
7.63119e-08
4.71059e-08
2.54531e-08
1.17628e-08
4.51634e-09
1.39985e-09
3.40305e-10
6.29866e-11
8.5955e-12
8.32976e-13
5.47974e-14
2.32577e-15
6.06663e-17
8.70958e-19
5.73197e-21
1.25266e-23
5.50954e-27
1.5041e-08
2.90826e-08
5.00578e-08
7.78311e-08
1.11314e-07
1.48683e-07
1.87594e-07
2.25452e-07
2.5957e-07
2.87471e-07
3.07719e-07
3.21136e-07
3.30801e-07
3.34989e-07
6.71033e-07
5.24646e-07
5.39483e-07
3.55086e-07
5.6113e-06
3.95019e-05
4.07262e-05
4.07302e-05
5.39788e-06
2.39217e-07
2.36422e-07
2.47581e-07
2.56035e-07
2.46413e-07
2.52327e-07
2.04847e-07
5.3955e-07
1.12449e-07
1.36761e-07
1.06448e-07
7.08565e-08
4.14219e-08
2.08838e-08
8.8126e-09
3.0217e-09
8.17642e-10
1.69533e-10
2.61064e-11
2.88072e-12
2.18352e-13
1.08227e-14
3.31529e-16
5.65734e-18
4.48095e-20
1.20088e-22
6.29913e-26
1.94041e-08
3.74327e-08
6.35792e-08
9.72342e-08
1.36e-07
1.77164e-07
2.17575e-07
2.53886e-07
2.82959e-07
3.0333e-07
3.16823e-07
3.25765e-07
3.29091e-07
3.28471e-07
3.22639e-07
3.17587e-07
3.16817e-07
3.50362e-07
5.07874e-07
3.3463e-06
6.29509e-06
7.77083e-06
5.36449e-06
4.77785e-06
2.36501e-07
2.58757e-07
2.7518e-07
6.87079e-07
1.99041e-07
1.96773e-07
1.8095e-07
1.80399e-07
1.61131e-07
1.37321e-07
9.83139e-08
6.17674e-08
3.37468e-08
1.55417e-08
5.85144e-09
1.74876e-09
4.03004e-10
6.94727e-11
8.65852e-12
7.49884e-13
4.30162e-14
1.53768e-15
3.10652e-17
2.95415e-19
9.7819e-22
6.27945e-25
2.31797e-08
4.50521e-08
7.60227e-08
1.14799e-07
1.58082e-07
2.02546e-07
2.45625e-07
2.82966e-07
2.86483e-07
3.26645e-07
3.16138e-07
3.16141e-07
3.16163e-07
3.19885e-07
3.27948e-07
3.27532e-07
3.33657e-07
3.56764e-07
3.65576e-07
3.69592e-06
7.41568e-06
7.77707e-06
7.72474e-06
6.73823e-06
1.09006e-06
2.61012e-07
2.89073e-07
3.01496e-07
4.1489e-07
4.83289e-07
1.86244e-07
1.88162e-07
1.76172e-07
1.65724e-07
1.27498e-07
8.54675e-08
5.02397e-08
2.50661e-08
1.02835e-08
3.36743e-09
8.55495e-10
1.6373e-10
2.28547e-11
2.24181e-12
1.4741e-13
6.10061e-15
1.4474e-16
1.64555e-18
6.7272e-21
5.35787e-24
2.58101e-08
5.11003e-08
8.64992e-08
1.29427e-07
1.76534e-07
2.23577e-07
2.67212e-07
2.84089e-07
4.20017e-07
3.31502e-07
8.36032e-06
2.92318e-05
2.32641e-05
3.19816e-07
3.23732e-07
3.32885e-07
3.50982e-07
3.82833e-07
4.49202e-07
5.45006e-07
2.72548e-06
7.21268e-06
7.0723e-06
1.39943e-06
2.94591e-07
2.99561e-07
3.10776e-07
3.21561e-07
3.20446e-07
3.20407e-07
3.46437e-07
4.08903e-07
1.78566e-07
1.89431e-07
1.56542e-07
1.1109e-07
6.97167e-08
3.73956e-08
1.65871e-08
5.90336e-09
1.63949e-09
3.4538e-10
5.35298e-11
5.89212e-12
4.3969e-13
2.08807e-14
5.75977e-16
7.78366e-18
3.89602e-20
3.87301e-23
2.68033e-08
5.49413e-08
9.41466e-08
1.40852e-07
1.90738e-07
2.41027e-07
2.90009e-07
3.3598e-07
3.4335e-07
8.70647e-06
4.11924e-05
4.11855e-05
4.11684e-05
3.04299e-05
3.20435e-07
3.23414e-07
3.3962e-07
3.55248e-07
3.76342e-07
3.98145e-07
3.62907e-07
3.93111e-07
3.20289e-07
3.05513e-07
3.01141e-07
3.2178e-07
3.2224e-07
3.22754e-07
3.19533e-07
3.14912e-07
2.86433e-07
2.33148e-07
2.23081e-07
2.0728e-07
1.84174e-07
1.37213e-07
9.11804e-08
5.21622e-08
2.482e-08
9.52331e-09
2.86693e-09
6.59069e-10
1.12419e-10
1.37529e-11
1.1526e-12
6.21652e-14
1.97213e-15
3.14201e-17
1.90186e-19
2.35965e-22
2.5932e-08
5.59917e-08
9.85122e-08
1.4842e-07
2.00538e-07
2.52755e-07
3.05541e-07
3.61577e-07
3.63445e-07
1.62825e-05
4.11892e-05
4.11763e-05
4.11707e-05
3.61519e-05
3.20433e-07
3.21953e-07
3.3767e-07
3.49447e-07
3.58309e-07
3.63902e-07
3.50141e-07
3.43171e-07
3.18615e-07
3.07853e-07
3.77143e-07
3.14067e-07
3.148e-07
4.35172e-07
3.15477e-07
3.20859e-07
3.16941e-07
2.98394e-07
2.27573e-07
2.18662e-07
2.09857e-07
1.62795e-07
1.13558e-07
6.86976e-08
3.47937e-08
1.42803e-08
4.62214e-09
1.14982e-09
2.13922e-10
2.87964e-11
2.68033e-12
1.62351e-13
5.86195e-15
1.08743e-16
7.85708e-19
1.20954e-21
2.34051e-08
5.41147e-08
9.91502e-08
1.52122e-07
2.06188e-07
2.58823e-07
3.12635e-07
3.72248e-07
3.81162e-07
1.8622e-05
4.11767e-05
4.11735e-05
4.11649e-05
4.02964e-05
2.06563e-06
3.19478e-07
3.28472e-07
3.32611e-07
3.31553e-07
3.23964e-07
4.56282e-07
3.16401e-07
3.26359e-07
3.09072e-07
3.10758e-07
3.13859e-07
3.11036e-07
3.08282e-07
3.14202e-07
5.59703e-07
3.19598e-07
3.32992e-07
4.31144e-07
2.21885e-07
2.33922e-07
1.87425e-07
1.36005e-07
8.61792e-08
4.60961e-08
2.00885e-08
6.93848e-09
1.85276e-09
3.72562e-10
5.46052e-11
5.58106e-12
3.75511e-13
1.52748e-14
3.24842e-16
2.76134e-18
5.21627e-21
1.99666e-08
4.94635e-08
9.60361e-08
1.51815e-07
2.0801e-07
2.60715e-07
3.11933e-07
3.68224e-07
3.91503e-07
4.23663e-06
3.18033e-05
4.11654e-05
4.11709e-05
1.34142e-05
3.26029e-07
3.18574e-07
3.21851e-07
3.22542e-07
3.20959e-07
3.1897e-07
3.19119e-07
3.16017e-07
3.14203e-07
3.13341e-07
3.10739e-07
3.08063e-07
3.97835e-07
3.07805e-07
3.21386e-07
3.14038e-07
4.28656e-07
2.77982e-07
2.73917e-07
2.64344e-07
2.57406e-07
2.1147e-07
1.58236e-07
1.03842e-07
5.8168e-08
2.67282e-08
9.78356e-09
2.78254e-09
5.99133e-10
9.46386e-11
1.05146e-11
7.77266e-13
3.51626e-14
8.45062e-16
8.31675e-18
1.89032e-20
1.72579e-08
4.28438e-08
8.92539e-08
1.47561e-07
2.06433e-07
2.59825e-07
3.08394e-07
3.56543e-07
4.03143e-07
4.11636e-07
3.36506e-06
9.85131e-06
7.9642e-06
1.62001e-06
3.17484e-07
3.17965e-07
3.19283e-07
3.1927e-07
3.18458e-07
3.17857e-07
3.1802e-07
3.17829e-07
3.16195e-07
3.12806e-07
3.08611e-07
3.05456e-07
3.04221e-07
3.07334e-07
3.06749e-07
3.12427e-07
3.03892e-07
3.00059e-07
6.35759e-07
2.68804e-07
2.82321e-07
2.3609e-07
1.80856e-07
1.21302e-07
7.04397e-08
3.38727e-08
1.30516e-08
3.92445e-09
8.97449e-10
1.51399e-10
1.8099e-11
1.45327e-12
7.21453e-14
1.93012e-15
2.16502e-17
5.78603e-20
1.80766e-08
3.58749e-08
7.95016e-08
1.39429e-07
2.01555e-07
2.57042e-07
3.04675e-07
3.4722e-07
3.87056e-07
4.17221e-07
4.2354e-07
4.46471e-07
2.72036e-06
9.73658e-07
3.16927e-07
3.17041e-07
3.17399e-07
3.17727e-07
3.19139e-07
3.22624e-07
3.2717e-07
3.28044e-07
3.26547e-07
3.20319e-07
3.10258e-07
3.05294e-07
3.0412e-07
3.04641e-07
3.06363e-07
3.07125e-07
3.50578e-07
3.05959e-07
3.08374e-07
3.40203e-07
3.13478e-07
2.64128e-07
2.05737e-07
1.39108e-07
8.25814e-08
4.11688e-08
1.65853e-08
5.23836e-09
1.26323e-09
2.25656e-10
2.87485e-11
2.47814e-12
1.33142e-13
3.90483e-15
4.9081e-17
1.51334e-19
2.66251e-08
3.16125e-08
6.815e-08
1.27651e-07
1.93265e-07
2.52231e-07
3.01131e-07
3.41714e-07
3.76316e-07
4.02931e-07
4.18748e-07
7.10503e-07
4.25966e-07
4.36072e-07
3.25986e-07
3.19514e-07
3.19129e-07
3.22903e-07
3.30692e-07
3.42396e-07
3.52186e-07
3.69029e-07
3.49642e-07
3.46668e-07
3.14848e-07
3.05761e-07
3.0328e-07
3.01854e-07
3.02494e-07
3.05344e-07
3.08206e-07
4.84512e-07
3.17928e-07
3.89222e-07
3.69199e-07
3.0585e-07
2.37472e-07
1.60317e-07
9.50813e-08
4.84986e-08
2.02596e-08
6.68101e-09
1.68918e-09
3.17455e-10
4.27106e-11
3.90313e-12
2.23811e-13
7.09973e-15
9.86025e-17
3.44882e-19
4.52822e-08
3.37413e-08
5.80995e-08
1.13125e-07
1.81221e-07
2.44833e-07
2.96948e-07
3.38365e-07
3.71665e-07
3.97332e-07
4.14337e-07
4.19379e-07
4.18944e-07
3.44277e-07
3.30187e-07
3.24372e-07
3.28424e-07
3.41185e-07
3.6321e-07
3.81735e-07
3.53212e-07
3.54571e-07
3.74779e-07
4.13026e-07
3.22586e-07
3.06601e-07
3.03698e-07
3.00795e-07
2.99706e-07
3.01331e-07
3.07406e-07
3.08243e-07
3.50636e-07
4.65453e-07
5.13656e-07
4.02595e-07
2.89031e-07
1.96533e-07
1.10483e-07
5.65933e-08
2.42153e-08
8.28118e-09
2.18407e-09
4.29403e-10
6.05724e-11
5.82011e-12
3.52953e-13
1.1931e-14
1.79246e-16
6.95185e-19
8.86548e-08
4.82165e-08
5.3375e-08
9.81474e-08
1.65636e-07
2.34048e-07
2.90981e-07
3.34906e-07
3.67744e-07
3.75171e-07
3.80966e-07
6.47456e-07
3.65406e-07
3.40963e-07
3.33759e-07
3.3557e-07
3.55707e-07
4.13348e-07
5.25828e-07
1.17857e-06
5.94017e-06
6.7996e-06
1.52063e-06
4.24908e-07
3.25562e-07
3.07367e-07
3.04611e-07
3.01136e-07
2.98906e-07
2.9882e-07
3.05758e-07
3.26967e-07
1.11835e-06
4.70028e-07
6.24471e-07
4.11903e-07
4.06482e-07
2.93026e-07
1.35644e-07
6.80744e-08
2.92337e-08
1.02478e-08
2.80374e-09
5.75188e-10
8.48045e-11
8.51561e-12
5.39839e-13
1.91596e-14
3.04135e-16
1.26618e-18
2.33109e-07
1.05916e-07
6.58578e-08
8.79587e-08
1.4826e-07
2.19546e-07
2.82192e-07
3.30191e-07
3.53888e-07
4.62435e-07
3.89056e-07
3.60725e-07
3.55709e-07
3.43772e-07
3.40957e-07
3.55558e-07
3.9249e-07
3.99262e-07
1.82007e-06
8.73409e-06
8.73208e-06
8.72527e-06
7.78914e-06
3.12869e-07
3.12854e-07
3.09416e-07
3.05387e-07
3.02023e-07
2.9981e-07
2.98992e-07
3.08867e-07
3.32838e-07
9.24342e-07
5.54579e-06
4.62667e-05
3.73972e-05
7.15237e-07
6.09639e-07
1.84324e-07
8.85366e-08
3.71564e-08
1.31189e-08
3.68165e-09
7.82119e-10
1.19802e-10
1.24931e-11
8.21618e-13
3.02287e-14
4.98145e-16
2.16426e-18
3.99044e-07
2.07754e-07
1.07536e-07
9.09199e-08
1.33177e-07
2.02153e-07
2.69891e-07
3.23143e-07
3.5798e-07
3.99556e-07
3.78619e-07
3.66943e-07
3.53657e-07
3.46115e-07
3.51676e-07
3.74982e-07
4.1121e-07
4.24561e-07
5.28976e-06
8.73258e-06
8.73127e-06
8.72929e-06
3.08626e-06
3.17514e-07
3.34509e-07
3.16471e-07
3.0527e-07
3.02851e-07
3.01753e-07
3.01263e-07
3.163e-07
3.25097e-07
5.12476e-06
6.15168e-05
8.03012e-05
8.02937e-05
3.9331e-05
1.59734e-06
2.6088e-07
1.24989e-07
5.11891e-08
1.78206e-08
5.03685e-09
1.09505e-09
1.73274e-10
1.87455e-11
1.27712e-12
4.84245e-14
8.17294e-16
3.61941e-18
5.71219e-07
3.51178e-07
1.87076e-07
1.16891e-07
1.26966e-07
1.84526e-07
2.54108e-07
3.1289e-07
3.5418e-07
3.81347e-07
4.23672e-07
3.6846e-07
3.51853e-07
3.50466e-07
3.69332e-07
4.08331e-07
4.68267e-07
4.50521e-07
1.81666e-06
4.69052e-06
5.21216e-06
1.31241e-06
4.55299e-07
4.44468e-07
3.76257e-07
3.36422e-07
3.71078e-07
3.03107e-07
3.03885e-07
3.03594e-07
3.22233e-07
3.29367e-07
1.09072e-05
8.03084e-05
8.03048e-05
8.03014e-05
6.97021e-05
5.01885e-06
1.70758e-07
1.6308e-07
7.04856e-08
2.46868e-08
7.04886e-09
1.56329e-09
2.54548e-10
2.85109e-11
2.01567e-12
7.89897e-14
1.36143e-15
6.02663e-18
6.8731e-07
4.72848e-07
2.96359e-07
1.7338e-07
1.3841e-07
1.71896e-07
2.36294e-07
2.98917e-07
3.45366e-07
3.72808e-07
3.94602e-07
3.61883e-07
3.50809e-07
3.59128e-07
3.85717e-07
3.9441e-07
3.94646e-07
3.96522e-07
5.03809e-07
5.10721e-07
5.53873e-07
6.6105e-07
1.0617e-06
6.88191e-07
3.6565e-07
3.24703e-07
3.07431e-07
3.07197e-07
3.05202e-07
3.02804e-07
3.11652e-07
3.88081e-07
7.31689e-07
2.54982e-05
7.7933e-05
7.55461e-05
1.11207e-05
9.61512e-07
3.4166e-07
1.94431e-07
8.79095e-08
3.27011e-08
9.76528e-09
2.24487e-09
3.78382e-10
4.39291e-11
3.22373e-12
1.30874e-13
2.32359e-15
1.02969e-17
8.17143e-07
7.47021e-07
2.9489e-07
2.27833e-07
1.67137e-07
1.69762e-07
2.19631e-07
2.81679e-07
3.3223e-07
3.6269e-07
3.73098e-07
3.54099e-07
3.50222e-07
3.65007e-07
3.92249e-07
5.12677e-07
2.08545e-06
2.01916e-06
4.16979e-07
4.64126e-07
1.06886e-06
4.36332e-06
4.35879e-06
4.13585e-06
8.91341e-07
2.78906e-07
3.09022e-07
3.04896e-07
3.05474e-07
3.04977e-07
3.13293e-07
3.1006e-07
2.92136e-07
2.672e-07
4.73605e-06
3.578e-06
2.23157e-07
3.1757e-07
3.1327e-07
1.95849e-07
9.98879e-08
4.11668e-08
1.32634e-08
3.22613e-09
5.69289e-10
6.89097e-11
5.268e-12
2.22635e-13
4.10237e-15
1.86367e-17
8.08264e-07
8.99929e-07
8.99195e-07
2.23015e-07
1.93524e-07
1.79661e-07
2.08706e-07
2.63177e-07
3.15395e-07
3.49611e-07
3.58033e-07
3.48337e-07
3.50398e-07
3.67516e-07
3.69077e-07
2.56847e-06
2.57185e-06
2.26219e-06
3.87047e-07
6.10459e-07
4.1609e-06
4.36018e-06
4.3611e-06
4.35816e-06
2.87317e-06
2.7697e-07
2.96765e-07
2.99404e-07
3.03185e-07
3.08199e-07
3.41129e-07
3.32102e-07
3.15448e-07
2.67195e-07
2.22446e-07
2.2229e-07
2.22238e-07
2.23653e-07
2.17809e-07
1.72194e-07
1.05233e-07
4.93424e-08
1.74983e-08
4.58584e-09
8.58787e-10
1.09412e-10
8.75687e-12
3.86822e-13
7.4538e-15
3.54258e-17
4.67295e-07
5.45978e-07
5.1351e-07
3.72449e-07
2.92593e-07
2.26018e-07
2.14664e-07
2.48589e-07
2.96416e-07
3.33566e-07
3.34674e-07
3.41729e-07
3.51706e-07
3.53562e-07
2.06564e-06
2.62195e-06
2.30712e-06
4.89154e-07
3.82473e-07
4.21615e-07
3.18578e-06
4.36419e-06
4.36441e-06
3.29922e-06
2.96233e-07
2.76927e-07
2.81948e-07
3.77994e-07
3.00083e-07
3.1457e-07
4.06246e-07
3.39045e-07
3.63697e-07
3.16328e-07
2.79667e-07
2.58229e-07
2.43982e-07
2.29927e-07
2.09506e-07
1.68556e-07
1.10684e-07
5.67397e-08
2.2002e-08
6.25869e-09
1.26004e-09
1.7075e-10
1.44166e-11
6.69945e-13
1.35785e-14
6.80872e-17
4.61813e-07
4.64275e-07
7.5161e-07
4.49615e-07
2.46456e-07
2.41628e-07
2.24862e-07
2.39283e-07
2.77248e-07
2.95219e-07
4.08977e-07
3.3509e-07
2.80632e-07
6.24302e-07
2.62218e-06
2.62215e-06
5.8643e-07
3.7317e-07
3.67078e-07
4.03505e-07
5.30947e-07
9.30422e-07
1.40829e-06
2.65559e-07
2.62808e-07
2.76807e-07
2.97412e-07
2.97984e-07
3.03976e-07
3.24632e-07
7.67701e-07
1.42635e-06
5.50365e-07
3.75397e-07
3.17716e-07
2.93957e-07
2.75729e-07
2.54194e-07
2.23293e-07
1.76145e-07
1.17328e-07
6.28557e-08
2.59702e-08
7.94125e-09
1.71907e-09
2.49099e-10
2.23911e-11
1.10336e-12
2.36823e-14
1.2601e-16
4.59587e-07
7.5059e-07
7.56889e-07
3.26239e-07
2.98835e-07
2.63221e-07
2.32927e-07
2.31634e-07
2.33574e-07
3.69213e-07
4.09281e-07
3.29446e-07
2.3007e-07
1.46516e-06
2.59861e-06
8.18355e-07
3.06769e-07
3.58856e-07
3.55998e-07
3.61392e-07
3.59819e-07
3.23205e-07
2.74309e-07
2.73368e-07
2.6133e-07
2.76679e-07
3.10374e-07
3.22899e-07
3.22417e-07
3.30837e-07
1.73348e-06
2.75885e-06
2.76048e-06
5.88756e-07
3.53037e-07
3.18563e-07
2.99177e-07
2.78537e-07
2.45847e-07
1.95413e-07
1.31148e-07
7.10461e-08
3.00113e-08
9.51594e-09
2.1567e-09
3.29616e-10
3.13434e-11
1.63539e-12
3.7197e-14
2.10229e-16
4.59127e-07
5.1455e-07
7.55194e-07
4.51081e-07
2.28794e-07
2.22234e-07
2.14919e-07
2.13732e-07
2.49937e-07
2.31529e-07
2.74038e-07
2.81468e-07
2.24871e-07
8.48934e-07
9.54716e-07
2.99748e-07
3.02059e-07
3.64113e-07
4.20833e-07
4.20539e-07
5.7973e-07
5.38808e-07
3.50734e-07
3.15767e-07
2.55242e-07
2.79036e-07
3.65795e-07
4.20467e-07
3.86684e-07
3.6364e-07
5.36503e-07
2.32999e-06
2.75922e-06
2.47552e-06
4.03672e-07
3.34728e-07
2.9642e-07
2.8634e-07
2.58221e-07
2.10845e-07
1.46277e-07
8.13186e-08
3.49186e-08
1.12081e-08
2.58335e-09
4.04533e-10
3.97053e-11
2.15113e-12
5.10417e-14
3.02348e-16
5.18869e-07
4.18708e-07
3.96743e-07
3.5625e-07
4.93928e-07
2.92718e-07
2.14426e-07
2.13169e-07
2.14807e-07
2.23685e-07
2.36282e-07
2.24547e-07
2.23116e-07
2.27916e-07
2.3846e-07
2.93328e-07
2.91324e-07
3.41596e-07
3.44538e-07
3.59091e-07
4.21603e-07
4.62078e-07
5.72675e-07
2.70216e-07
2.48675e-07
2.89371e-07
5.33971e-07
7.75296e-07
5.26136e-07
4.07157e-07
3.02288e-07
2.77506e-07
2.09909e-06
2.33618e-06
5.13062e-07
3.38841e-07
6.67707e-07
2.67899e-07
2.58024e-07
2.16315e-07
1.54679e-07
8.89659e-08
3.93152e-08
1.28803e-08
3.0149e-09
4.78791e-10
4.77204e-11
2.63254e-12
6.38386e-14
3.88351e-16
5.22859e-07
3.78977e-07
3.50721e-07
3.48229e-07
3.48529e-07
1.43483e-06
1.4417e-06
3.69034e-07
2.18203e-07
2.16042e-07
2.09304e-07
3.16687e-07
2.23445e-07
2.2775e-07
2.32901e-07
2.56171e-07
2.67366e-07
2.84643e-07
3.00864e-07
2.86525e-07
2.7724e-07
2.72413e-07
2.54986e-07
2.44589e-07
2.46464e-07
2.78282e-07
4.79767e-07
7.19562e-07
7.31536e-07
5.15998e-07
3.05981e-07
2.77477e-07
2.58102e-07
3.63744e-07
3.90848e-07
4.54731e-07
2.84879e-07
2.85934e-07
2.66869e-07
2.26319e-07
1.64154e-07
9.60083e-08
4.32413e-08
1.44472e-08
3.43881e-09
5.53146e-10
5.56669e-11
3.09569e-12
7.5654e-14
4.64451e-16
4.54834e-07
3.66229e-07
3.53377e-07
1.05971e-06
2.57566e-06
2.68789e-06
2.67712e-06
1.68252e-06
2.19283e-07
2.08347e-07
2.04501e-07
1.70753e-06
1.49917e-06
4.03762e-07
2.41093e-07
2.44333e-07
2.46263e-07
3.28248e-07
2.75695e-07
2.69151e-07
2.58979e-07
2.50039e-07
2.46173e-07
2.45168e-07
2.4546e-07
2.4624e-07
2.65208e-07
2.65785e-07
4.24917e-07
5.90268e-07
3.02583e-07
2.72825e-07
2.58061e-07
2.59788e-07
3.23476e-07
2.6825e-07
2.8326e-07
2.8244e-07
2.63049e-07
2.2207e-07
1.61805e-07
9.6178e-08
4.43127e-08
1.51423e-08
3.67182e-09
5.98513e-10
6.07098e-11
3.38687e-12
8.26956e-14
5.05343e-16
3.99066e-07
3.74693e-07
1.98714e-06
2.68733e-06
2.68713e-06
2.68679e-06
2.12914e-06
1.34527e-06
2.23788e-07
2.07974e-07
2.0446e-07
1.98218e-06
3.78062e-06
1.14327e-06
2.6023e-07
2.45269e-07
2.48707e-07
3.53932e-07
2.70455e-07
2.75882e-07
2.66075e-07
2.59859e-07
2.54548e-07
2.5292e-07
2.52391e-07
2.5262e-07
3.12854e-07
2.76924e-07
2.4261e-07
2.36747e-07
2.758e-07
2.58287e-07
2.50772e-07
2.56363e-07
3.44222e-07
2.66855e-07
2.7777e-07
2.78484e-07
2.61313e-07
2.21006e-07
1.60677e-07
9.52943e-08
4.39377e-08
1.50505e-08
3.65537e-09
5.95048e-10
6.00173e-11
3.31164e-12
7.94762e-14
4.73536e-16
1.23782e-05
3.99207e-07
5.78261e-07
1.2771e-06
1.27981e-06
7.65266e-07
5.46769e-07
4.52333e-07
2.18042e-07
2.14168e-07
2.04483e-07
1.84537e-06
3.9817e-06
9.04868e-07
6.20603e-07
1.17965e-05
2.20538e-05
2.7257e-07
2.71111e-07
3.04084e-07
2.8249e-07
2.72409e-07
2.65985e-07
2.68217e-07
2.6772e-07
2.7324e-07
4.60484e-07
3.74179e-07
2.50649e-07
2.31426e-07
2.37425e-07
2.37219e-07
2.35593e-07
2.75282e-07
2.4699e-07
2.59694e-07
2.67087e-07
2.67273e-07
2.51634e-07
2.12818e-07
1.5346e-07
8.9991e-08
4.09776e-08
1.38499e-08
3.31278e-09
5.29313e-10
5.21409e-11
2.79081e-12
6.43793e-14
3.64023e-16
3.21756e-05
5.24567e-07
5.20252e-07
5.09843e-07
4.44486e-07
4.07571e-07
4.03093e-07
4.01067e-07
4.33808e-07
2.21746e-07
2.04727e-07
1.55988e-06
4.18187e-06
2.85821e-06
2.84922e-06
3.2296e-05
3.20747e-05
2.45677e-06
2.71341e-07
3.79511e-07
2.93489e-07
2.8825e-07
2.87476e-07
2.74545e-07
3.19518e-07
3.19108e-07
1.0877e-06
1.08908e-06
2.61406e-07
2.40626e-07
2.235e-07
2.24116e-07
2.32707e-07
2.3238e-07
2.46405e-07
2.53424e-07
2.57612e-07
2.55676e-07
2.38513e-07
1.98917e-07
1.40656e-07
8.05714e-08
3.57165e-08
1.17189e-08
2.71247e-09
4.17564e-10
3.93863e-11
2.00109e-12
4.32785e-14
2.2537e-16
2.98383e-05
5.17982e-06
7.01867e-06
7.62272e-06
4.34661e-06
4.08054e-07
4.01961e-07
4.01185e-07
7.95572e-07
5.1302e-07
2.07852e-07
1.0338e-06
4.26664e-06
5.13068e-06
4.97915e-06
3.22901e-05
3.23383e-05
6.73176e-06
2.73776e-07
5.00009e-07
3.13093e-07
3.05557e-07
3.34776e-07
2.87267e-06
5.7308e-07
3.50652e-07
1.01701e-06
6.73026e-07
2.90158e-07
2.5393e-07
2.25254e-07
2.18276e-07
2.22833e-07
2.31835e-07
2.40266e-07
2.46208e-07
2.48736e-07
2.43636e-07
2.22781e-07
1.80673e-07
1.2366e-07
6.81824e-08
2.89621e-08
9.07037e-09
1.99565e-09
2.90492e-10
2.57212e-11
1.21408e-12
2.40252e-14
1.11899e-16
2.30322e-06
6.04786e-06
1.0286e-05
2.8061e-05
4.4714e-05
3.64315e-05
2.27595e-05
5.82755e-06
2.41095e-07
2.2048e-07
2.13607e-07
2.2025e-07
3.90298e-06
1.92276e-06
8.66455e-06
3.22791e-05
3.24269e-05
1.04051e-05
4.11565e-07
3.42528e-07
3.31108e-07
3.0759e-07
8.64474e-06
2.08727e-05
8.09424e-06
3.12416e-07
2.99163e-07
2.97612e-07
3.42239e-07
2.68793e-07
2.25578e-07
2.11764e-07
2.12821e-07
2.20989e-07
2.30271e-07
2.36959e-07
2.38516e-07
2.29736e-07
2.03932e-07
1.58742e-07
1.0355e-07
5.40635e-08
2.16401e-08
6.35998e-09
1.30738e-09
1.7679e-10
1.44246e-11
6.19928e-13
1.09689e-14
4.4432e-17
2.29519e-06
2.30293e-06
2.31294e-06
1.78685e-05
5.34569e-05
5.32618e-05
5.29601e-05
1.73078e-05
2.44616e-07
2.22661e-07
2.18958e-07
2.22967e-07
1.30771e-06
2.92115e-07
1.47606e-05
3.24259e-05
3.24306e-05
1.08242e-05
6.81407e-07
3.4327e-07
3.34212e-07
2.36691e-06
1.78394e-05
2.08554e-05
1.37746e-05
6.8639e-07
3.32563e-07
3.31132e-07
5.15302e-07
2.82514e-07
2.20968e-07
2.0198e-07
2.00523e-07
2.08187e-07
2.18357e-07
2.25637e-07
2.25565e-07
2.12079e-07
1.80648e-07
1.32999e-07
8.13982e-08
3.96208e-08
1.47158e-08
3.9969e-09
7.55904e-10
9.34722e-11
6.91142e-12
2.655e-13
4.11118e-15
1.41172e-17
2.28817e-06
2.30232e-06
6.97209e-06
2.16637e-05
5.4798e-05
5.25698e-05
1.42165e-05
5.29692e-06
1.40914e-06
6.52327e-07
2.8576e-07
2.28761e-07
2.40578e-07
2.68034e-07
1.01126e-05
3.2423e-05
3.2425e-05
8.49821e-06
3.22532e-06
6.89957e-07
3.38229e-07
2.33259e-05
2.59255e-05
1.18527e-05
3.1488e-06
3.63619e-07
3.51284e-07
3.47435e-07
4.52434e-07
2.72012e-07
2.06401e-07
1.87346e-07
1.84636e-07
1.9182e-07
2.02566e-07
2.09772e-07
2.06656e-07
1.87638e-07
1.51491e-07
1.04421e-07
5.9266e-08
2.65517e-08
9.02614e-09
2.23349e-09
3.82927e-10
4.26354e-11
2.80909e-12
9.45836e-14
1.25169e-15
3.57012e-18
2.29822e-06
6.42621e-06
3.51647e-05
2.19045e-05
6.84236e-05
0.000101808
6.68419e-06
5.57345e-06
6.88789e-06
4.56718e-06
3.22423e-07
3.01085e-07
6.67359e-07
7.29733e-07
8.06431e-07
3.22858e-05
3.24228e-05
7.58097e-06
6.40841e-06
9.80842e-06
4.88383e-07
1.07922e-05
1.34102e-05
3.67712e-05
1.51897e-05
7.29293e-07
8.61035e-07
6.82721e-07
2.41603e-07
2.20874e-07
1.83438e-07
1.68912e-07
1.65295e-07
1.71132e-07
1.81376e-07
1.87148e-07
1.79977e-07
1.56422e-07
1.18418e-07
7.57757e-08
3.94552e-08
1.60712e-08
4.93345e-09
1.09619e-09
1.67759e-10
1.65443e-11
9.57146e-13
2.78986e-14
3.12761e-16
7.36051e-19
6.17179e-32
2.53146e-23
4.4149e-19
2.30492e-16
1.86502e-14
4.73278e-13
5.51208e-12
3.7123e-11
1.67727e-10
5.61891e-10
1.49628e-09
3.33007e-09
6.42302e-09
1.10699e-08
1.74067e-08
2.53497e-08
3.45954e-08
4.4653e-08
5.45114e-08
6.33255e-08
7.12567e-08
7.81014e-08
8.30188e-08
8.48705e-08
8.37529e-08
7.92954e-08
7.12341e-08
6.03447e-08
4.89754e-08
4.10142e-08
4.02216e-08
5.8024e-08
8.69101e-08
1.0229e-07
2.83458e-07
4.58484e-07
5.47896e-07
1.08078e-06
1.19998e-06
1.26631e-06
8.43963e-06
2.09037e-05
2.09005e-05
7.17932e-06
2.25273e-06
2.25624e-06
2.56129e-06
2.32811e-06
2.28416e-06
2.29085e-06
1.11523e-30
1.69559e-22
1.87093e-18
7.32692e-16
4.86445e-14
1.07238e-12
1.12793e-11
7.04465e-11
3.00503e-10
9.61909e-10
2.46697e-09
5.31673e-09
9.9581e-09
1.67559e-08
2.58431e-08
3.70275e-08
4.98144e-08
6.35061e-08
7.62511e-08
8.69416e-08
9.72242e-08
1.06899e-07
1.14374e-07
1.17021e-07
1.17679e-07
1.15531e-07
1.08973e-07
9.76767e-08
8.26665e-08
6.71e-08
5.59788e-08
5.79934e-08
8.1773e-08
1.25306e-07
1.53593e-07
3.64924e-07
4.16e-07
4.47951e-07
1.44812e-06
2.2511e-06
1.68631e-06
1.78975e-05
1.88929e-05
2.25297e-06
2.25195e-06
2.25757e-06
2.40922e-06
2.29822e-06
2.28883e-06
2.29542e-06
1.7357e-29
9.93211e-22
7.02941e-18
2.09225e-15
1.15406e-13
2.23537e-12
2.14404e-11
1.2517e-10
5.07255e-10
1.55869e-09
3.8613e-09
8.07195e-09
1.46726e-08
2.40777e-08
3.6399e-08
5.13041e-08
6.80125e-08
8.55522e-08
1.0037e-07
1.11435e-07
1.24396e-07
1.37635e-07
1.47711e-07
1.47265e-07
1.50212e-07
1.51241e-07
1.46948e-07
1.37555e-07
1.23455e-07
1.0513e-07
8.68561e-08
7.56549e-08
8.04699e-08
1.10031e-07
1.73561e-07
2.65121e-07
3.19023e-07
7.56245e-07
1.76417e-06
1.07401e-06
5.26878e-07
2.02498e-06
4.76066e-06
2.75399e-06
2.25385e-06
3.033e-06
4.82123e-06
2.30707e-06
2.29589e-06
2.31084e-06
2.33301e-28
5.1227e-21
2.36295e-17
5.42289e-15
2.51772e-13
4.33395e-12
3.82707e-11
2.10467e-10
8.15226e-10
2.41533e-09
5.79359e-09
1.17642e-08
2.07229e-08
3.30817e-08
4.89439e-08
6.79215e-08
8.88302e-08
1.10321e-07
1.25411e-07
1.34652e-07
1.53037e-07
1.71734e-07
1.84569e-07
1.71866e-07
1.90604e-07
1.9017e-07
1.83553e-07
1.72739e-07
1.61583e-07
1.44541e-07
1.25215e-07
1.08142e-07
9.87878e-08
1.06913e-07
1.457e-07
2.17787e-07
2.82246e-07
5.16636e-07
1.07822e-06
7.3429e-07
4.63199e-07
1.08257e-06
2.03981e-06
2.29711e-06
2.25538e-06
3.41747e-06
1.0636e-05
4.79314e-06
2.30453e-06
2.33056e-06
2.71742e-27
2.34401e-20
7.17196e-17
1.28828e-14
5.10058e-13
7.89036e-12
6.47455e-11
3.37938e-10
1.25839e-09
3.60943e-09
8.39662e-09
1.65814e-08
2.82386e-08
4.36568e-08
6.3e-08
8.62341e-08
1.11622e-07
1.37277e-07
1.49325e-07
1.54454e-07
1.87087e-07
2.126e-07
2.26419e-07
1.84333e-07
4.09004e-07
2.48962e-07
2.20582e-07
2.00572e-07
1.93218e-07
1.89235e-07
1.57129e-07
1.5359e-07
1.41033e-07
1.26181e-07
1.35566e-07
1.81893e-07
2.59276e-07
4.22434e-07
4.98774e-07
4.49109e-07
3.65553e-07
5.76664e-07
3.73537e-06
3.85873e-06
2.72664e-06
2.7427e-06
9.85213e-06
1.94502e-05
2.36642e-06
5.56312e-05
2.75464e-26
9.59029e-20
1.9826e-16
2.82961e-14
9.67686e-13
1.35997e-11
1.04634e-10
5.22044e-10
1.87875e-09
5.23511e-09
1.18164e-08
2.27256e-08
3.7308e-08
5.54852e-08
7.75868e-08
1.04916e-07
1.35071e-07
1.65475e-07
1.68346e-07
1.65995e-07
2.37876e-07
2.62455e-07
2.69792e-07
2.69037e-07
2.50636e-07
2.47186e-07
2.35436e-07
2.13852e-07
1.93558e-07
8.9809e-07
1.24623e-06
1.09214e-06
7.6264e-07
4.12092e-07
2.48276e-07
1.98128e-07
2.30173e-07
3.50499e-07
4.12994e-07
3.75696e-07
3.18137e-07
3.59119e-07
1.39076e-06
3.86049e-06
2.78177e-06
4.0875e-06
8.81399e-06
2.86489e-05
4.70736e-05
0.000133202
2.44315e-25
3.53569e-19
5.03087e-16
5.78996e-14
1.732e-12
2.23483e-11
1.62588e-10
7.80378e-10
2.7263e-09
7.3996e-09
1.61911e-08
3.03911e-08
4.79571e-08
6.80678e-08
9.12379e-08
1.21575e-07
1.56333e-07
1.92306e-07
1.72884e-07
3.78719e-07
3.35045e-07
3.15227e-07
3.06678e-07
2.99292e-07
2.90767e-07
2.81593e-07
2.67094e-07
2.41534e-07
2.08781e-07
2.01292e-07
4.69318e-06
8.07778e-06
8.01605e-06
2.52486e-06
2.25565e-07
2.17095e-07
2.16912e-07
2.84782e-07
3.41201e-07
3.30141e-07
2.97133e-07
3.41093e-07
6.40353e-07
3.5379e-06
2.26607e-06
1.28083e-05
1.45425e-05
3.22724e-05
0.000172062
0.000153878
1.90744e-24
1.1831e-18
1.17999e-15
1.11128e-13
2.94411e-12
3.52274e-11
2.44141e-10
1.13303e-09
3.85451e-09
1.02066e-08
2.16049e-08
3.97064e-08
6.00954e-08
8.08618e-08
1.02496e-07
1.32822e-07
1.70322e-07
2.11067e-07
2.6171e-07
3.03659e-07
3.24489e-07
3.32472e-07
3.32579e-07
3.24835e-07
3.15803e-07
3.07176e-07
2.96909e-07
2.81275e-07
2.47576e-07
2.01849e-07
2.08581e-06
8.08708e-06
8.951e-06
8.96747e-06
2.4599e-06
2.21889e-07
2.31357e-07
2.30476e-07
4.42238e-07
3.02153e-07
2.89881e-07
2.98957e-07
1.69914e-06
2.75137e-06
1.31893e-06
1.32436e-06
3.45529e-06
0.000182079
0.000310848
0.000339589
1.31966e-23
3.61671e-18
2.57484e-15
2.01389e-13
4.78222e-12
5.3525e-11
3.55361e-10
1.59972e-09
5.30772e-09
1.37191e-08
2.80193e-08
5.06158e-08
7.33813e-08
9.34682e-08
1.11009e-07
1.36565e-07
1.72951e-07
2.10689e-07
2.8581e-07
3.6498e-07
3.9289e-07
3.86744e-07
3.68705e-07
3.54738e-07
3.45078e-07
3.32864e-07
3.23043e-07
3.21961e-07
3.40832e-07
3.66272e-07
3.69602e-07
6.89964e-07
8.85505e-06
8.98117e-06
4.37391e-06
2.52814e-07
2.62111e-07
2.33571e-07
2.3646e-07
2.68658e-07
2.85481e-07
5.18746e-07
1.72521e-06
6.00762e-07
1.40899e-06
7.93816e-06
1.37335e-05
2.82086e-05
0.00013142
0.00160784
8.15902e-23
1.0163e-17
5.2616e-15
3.46893e-13
7.46293e-12
7.86426e-11
5.01795e-10
2.19371e-09
7.09886e-09
1.79028e-08
3.52037e-08
6.26846e-08
8.7022e-08
1.05758e-07
1.18602e-07
1.38471e-07
1.77981e-07
1.98214e-07
2.04172e-07
5.09718e-07
4.01734e-07
3.951e-07
4.11075e-07
3.77005e-07
4.17e-07
3.54775e-07
3.38787e-07
3.29435e-07
3.23777e-07
3.23402e-07
7.46764e-07
6.49297e-06
1.32503e-05
6.55141e-06
4.44106e-07
2.61611e-07
2.57099e-07
2.35783e-07
2.30987e-07
2.39536e-07
2.69911e-07
4.86894e-07
7.54913e-07
2.67021e-07
7.40977e-06
4.39882e-05
4.55033e-05
4.19344e-05
4.92175e-05
0.0936344
4.59534e-22
2.64252e-17
1.01419e-14
5.71579e-13
1.12333e-11
1.11857e-10
6.8651e-10
2.91286e-09
9.18243e-09
2.25666e-08
4.27119e-08
7.489e-08
9.97038e-08
1.17973e-07
1.29036e-07
1.58152e-07
2.58236e-07
2.02631e-07
9.29245e-06
1.99957e-05
1.41117e-05
1.42248e-06
3.90123e-07
3.86046e-07
3.65601e-07
3.54354e-07
3.43591e-07
3.33268e-07
3.25078e-07
3.23404e-07
8.92446e-06
1.36396e-05
1.36392e-05
1.36381e-05
1.25117e-05
1.69656e-06
2.49027e-07
2.44764e-07
2.30641e-07
2.27165e-07
2.47656e-07
2.61867e-07
2.33683e-07
2.33876e-07
3.55787e-06
2.02465e-05
1.95925e-05
1.51978e-05
6.17355e-05
0.187069
2.51482e-21
6.41435e-17
1.85868e-14
9.05803e-13
1.63425e-11
1.53909e-10
9.07663e-10
3.73125e-09
1.14358e-08
2.73373e-08
4.99405e-08
8.55853e-08
1.09935e-07
1.30876e-07
1.45848e-07
2.18878e-07
5.81991e-07
4.48954e-06
2.72587e-05
2.90059e-05
2.90216e-05
8.84382e-06
3.85786e-07
3.77807e-07
3.74626e-07
3.64109e-07
3.57343e-07
3.46865e-07
3.32862e-07
3.23464e-07
3.06672e-06
1.34158e-05
1.36384e-05
1.36384e-05
1.36383e-05
1.0864e-05
6.40167e-07
2.36976e-07
2.3376e-07
2.25338e-07
2.31778e-07
2.3147e-07
2.29063e-07
2.28035e-07
1.39851e-06
2.04022e-05
1.96912e-05
7.62671e-06
7.67934e-06
0.393589
1.50468e-20
1.47562e-16
3.26719e-14
1.38635e-12
2.29935e-11
2.04573e-10
1.15694e-09
4.59715e-09
1.36656e-08
3.17065e-08
5.62475e-08
9.29131e-08
1.16714e-07
1.45512e-07
1.68636e-07
3.03187e-07
7.91192e-07
1.44101e-05
2.9006e-05
2.9007e-05
2.90095e-05
2.51743e-05
2.54444e-06
3.80193e-07
3.80989e-07
3.72051e-07
3.65318e-07
3.5407e-07
3.41338e-07
3.30972e-07
3.32732e-07
4.44539e-07
9.94629e-06
1.36345e-05
6.81737e-06
1.41817e-06
2.48955e-07
2.40957e-07
2.32382e-07
2.25846e-07
2.25256e-07
2.24884e-07
2.24707e-07
2.25074e-07
2.26685e-07
9.66435e-06
8.09635e-06
2.29871e-07
-7.79982e-07
0.610692
8.79608e-20
3.29663e-16
5.56767e-14
2.0577e-12
3.13166e-11
2.6259e-10
1.42054e-09
5.4416e-09
1.56476e-08
3.51547e-08
6.10214e-08
9.5734e-08
1.19779e-07
1.62016e-07
1.84175e-07
2.73944e-07
3.29054e-07
2.64419e-05
2.90122e-05
2.90088e-05
2.9013e-05
2.90097e-05
6.66946e-06
3.56762e-07
3.77507e-07
3.75376e-07
4.45424e-07
1.39062e-06
1.70687e-06
8.75214e-07
3.42315e-07
3.44255e-07
3.38122e-07
3.34091e-07
3.25963e-07
3.12907e-07
3.0024e-07
2.50516e-07
2.30295e-07
2.24205e-07
2.21179e-07
2.22374e-07
2.70723e-07
2.73735e-07
4.98485e-07
8.79994e-07
2.30778e-07
2.2956e-07
0.0104615
0.823856
3.90895e-19
7.23815e-16
9.30065e-14
2.97681e-12
4.14035e-11
3.26119e-10
1.68221e-09
6.19198e-09
1.71719e-08
3.72809e-08
6.36562e-08
9.44966e-08
1.18892e-07
1.80288e-07
1.90493e-07
2.24923e-07
1.88398e-07
2.55671e-05
2.90157e-05
2.90123e-05
2.90139e-05
2.78047e-05
3.87184e-06
3.35116e-07
3.32816e-07
6.322e-07
2.43254e-06
2.48067e-06
2.47819e-06
2.14748e-06
3.8332e-07
3.46509e-07
3.716e-07
3.51183e-07
4.0994e-07
4.07983e-07
2.54466e-07
2.49668e-07
2.53298e-07
2.32355e-07
2.2192e-07
2.25225e-07
2.31364e-07
2.41323e-07
2.83239e-07
2.30555e-07
2.2825e-07
2.29528e-07
0.0784652
0.905859
1.42345e-18
1.52624e-15
1.51324e-13
4.19732e-12
5.321e-11
3.92371e-10
1.9225e-09
6.77347e-09
1.80599e-08
3.78681e-08
6.38579e-08
9.14005e-08
1.14617e-07
1.99385e-07
1.98269e-07
1.88136e-07
1.88318e-07
3.18615e-06
2.34209e-05
2.83259e-05
2.43357e-05
3.01238e-06
2.90262e-07
3.30739e-07
3.3092e-07
2.01895e-06
2.47226e-06
2.48159e-06
2.39088e-06
8.4685e-07
3.50293e-07
3.74353e-07
3.94855e-07
3.61076e-07
3.17404e-07
2.91409e-07
2.59992e-07
3.23964e-07
3.24492e-07
2.42317e-07
2.16955e-07
2.18166e-07
2.18626e-07
2.18795e-07
2.19219e-07
2.2015e-07
2.22511e-07
2.26509e-07
0.129009
0.950965
4.29477e-18
3.01625e-15
2.36479e-13
5.71237e-12
6.60424e-11
4.5526e-10
2.11384e-09
7.11553e-09
1.82443e-08
3.70781e-08
6.19273e-08
8.81284e-08
1.06333e-07
3.85721e-07
2.06567e-07
1.85355e-07
1.89487e-07
1.91408e-07
1.93647e-07
1.94061e-06
2.41192e-07
2.45479e-07
2.87222e-07
3.21989e-07
3.31344e-07
5.33275e-07
1.25418e-06
9.90395e-07
3.82961e-07
3.69547e-07
3.39204e-07
3.21837e-07
3.02258e-07
2.89571e-07
2.8198e-07
2.77114e-07
2.72978e-07
2.77288e-07
2.78577e-07
2.30396e-07
2.1565e-07
2.15126e-07
2.15287e-07
2.13138e-06
4.11625e-06
3.50812e-06
1.23642e-06
2.30005e-07
0.158015
0.944593
1.09633e-17
5.46831e-15
3.48533e-13
7.41135e-12
7.85082e-11
5.06673e-10
2.23029e-09
7.18154e-09
1.77707e-08
3.52465e-08
5.85363e-08
8.46327e-08
1.0951e-07
1.10494e-07
2.10459e-07
1.88774e-07
3.19324e-07
2.38611e-07
2.39075e-07
2.39098e-07
2.41052e-07
2.62376e-07
2.98149e-07
3.32648e-07
3.3785e-07
3.359e-07
3.35748e-07
3.40281e-07
7.34272e-07
1.66245e-06
1.14386e-06
3.04504e-07
2.96491e-07
2.8398e-07
2.77724e-07
2.74589e-07
2.71517e-07
2.55851e-07
2.27211e-07
2.25297e-07
1.57438e-06
7.12208e-06
8.47882e-06
8.38542e-06
8.29e-06
8.24751e-06
5.67068e-06
2.61429e-07
0.148087
0.934534
2.48446e-17
9.08658e-15
4.81297e-13
9.10798e-12
8.89012e-11
5.3893e-10
2.25583e-09
6.97674e-09
1.67639e-08
3.27251e-08
5.43761e-08
8.0271e-08
1.06326e-07
1.36084e-07
1.41986e-07
1.98342e-07
2.50029e-07
2.43164e-07
2.52584e-07
2.55635e-07
2.69984e-07
2.92975e-07
3.07286e-07
3.76847e-07
3.42011e-07
3.4026e-07
3.35937e-07
9.72463e-07
1.66738e-06
1.66326e-06
1.30444e-06
2.82932e-07
2.87237e-07
2.77922e-07
2.7519e-07
2.74745e-07
2.73528e-07
2.59975e-07
2.29426e-07
2.25252e-07
3.99675e-06
8.51295e-06
8.5114e-06
6.49127e-06
6.89802e-06
8.18607e-06
6.18636e-06
4.07329e-07
0.0998231
0.901879
5.17307e-17
1.39603e-14
6.23309e-13
1.05812e-11
9.56431e-11
5.46842e-10
2.18643e-09
6.53382e-09
1.53635e-08
2.97897e-08
4.98952e-08
7.51001e-08
1.02775e-07
1.23912e-07
1.72231e-07
1.97885e-07
2.61685e-07
2.52676e-07
2.73179e-07
2.7708e-07
2.97586e-07
3.17306e-07
3.28347e-07
3.29281e-07
3.31576e-07
3.68862e-07
3.3717e-07
1.55994e-06
1.66838e-06
1.16068e-06
2.65129e-07
2.71556e-07
2.69202e-07
2.66855e-07
2.70883e-07
2.73464e-07
2.79767e-07
2.78122e-07
2.37034e-07
2.32557e-07
2.615e-07
2.94378e-07
6.12893e-07
4.37448e-07
4.11247e-07
2.45041e-06
1.88986e-06
3.86556e-07
0.0438734
0.832118
9.57817e-17
1.96252e-14
7.51343e-13
1.15489e-11
9.72867e-11
5.27629e-10
2.02832e-09
5.9034e-09
1.37054e-08
2.66202e-08
4.52027e-08
6.9382e-08
9.75157e-08
1.2461e-07
1.61888e-07
1.89141e-07
2.68791e-07
2.59754e-07
2.92951e-07
2.93611e-07
3.15696e-07
3.29806e-07
3.30359e-07
3.32675e-07
3.32706e-07
3.23257e-07
3.71777e-07
2.7903e-07
2.7418e-07
2.61385e-07
2.6124e-07
2.59275e-07
2.57532e-07
2.59239e-07
2.68996e-07
2.70869e-07
2.76897e-07
2.94613e-07
8.26004e-07
1.15955e-06
6.6701e-07
2.32522e-07
2.7201e-07
2.88858e-07
2.91626e-07
2.96478e-07
3.24226e-07
3.76906e-07
3.88133e-07
0.693954
1.54856e-16
2.50123e-14
8.35689e-13
1.17532e-11
9.30205e-11
4.82394e-10
1.79865e-09
5.14628e-09
1.19068e-08
2.33305e-08
4.02868e-08
6.30042e-08
9.02877e-08
1.19068e-07
1.50055e-07
1.74438e-07
4.1496e-07
2.60747e-07
3.09515e-07
3.01788e-07
3.23719e-07
3.35525e-07
3.29586e-07
3.30096e-07
3.2584e-07
3.22668e-07
3.31039e-07
2.68277e-07
2.65361e-07
2.63765e-07
2.59454e-07
2.5417e-07
2.52174e-07
2.56835e-07
2.70893e-07
2.71007e-07
3.76834e-07
4.32289e-06
1.00005e-05
5.15766e-06
2.29699e-07
2.27611e-07
2.21549e-07
1.2985e-06
6.81174e-06
7.00366e-06
5.29028e-07
3.88147e-07
3.97983e-07
0.470708
2.18128e-16
2.87468e-14
8.52431e-13
1.10957e-11
8.33082e-11
4.16993e-10
1.52263e-09
4.3248e-09
1.00583e-08
1.99999e-08
3.51857e-08
5.60095e-08
8.15623e-08
1.09479e-07
1.37394e-07
1.61653e-07
1.6857e-07
2.54307e-07
3.29546e-07
3.02921e-07
3.25147e-07
3.41145e-07
3.27114e-07
3.25996e-07
3.16848e-07
3.07681e-07
2.75578e-07
2.73944e-07
2.68374e-07
2.61962e-07
2.55171e-07
2.4989e-07
2.49441e-07
2.57788e-07
2.77593e-07
2.72989e-07
2.80462e-06
1.06009e-05
1.06006e-05
3.56498e-06
2.11743e-07
2.2102e-07
2.21119e-07
7.94814e-06
2.28596e-05
2.28651e-05
1.52266e-05
4.0545e-07
7.89233e-07
0.241428
2.6636e-16
2.95708e-14
7.92742e-13
9.67866e-12
6.9715e-11
3.40353e-10
1.22935e-09
3.49796e-09
8.23507e-09
1.66836e-08
2.99533e-08
4.85681e-08
7.19063e-08
9.80868e-08
1.24727e-07
1.49313e-07
1.61681e-07
2.40206e-07
3.71173e-07
2.9806e-07
3.21651e-07
3.48902e-07
3.2374e-07
3.224e-07
3.08981e-07
2.98529e-07
2.84957e-07
2.76366e-07
2.6744e-07
2.58687e-07
2.51038e-07
2.46959e-07
2.49584e-07
2.62102e-07
2.88723e-07
2.86306e-07
4.2645e-06
1.05951e-05
1.01892e-05
2.85234e-07
2.03751e-07
2.1508e-07
2.74964e-07
2.81875e-07
6.964e-06
1.62208e-05
1.43328e-05
9.8166e-07
1.62908e-06
0.0786458
2.8051e-16
2.70928e-14
6.69958e-13
7.78368e-12
5.44318e-11
2.61987e-10
9.45187e-10
2.71609e-09
6.51024e-09
1.34835e-08
2.47542e-08
4.09745e-08
6.18702e-08
8.61825e-08
1.12294e-07
1.39077e-07
1.68301e-07
2.17427e-07
3.20347e-07
2.88376e-07
3.11562e-07
3.78373e-07
3.19728e-07
3.22511e-07
3.04146e-07
2.97144e-07
2.87364e-07
2.77078e-07
2.66093e-07
2.55975e-07
2.48046e-07
2.45323e-07
2.50651e-07
2.67038e-07
3.00996e-07
3.00124e-07
3.38224e-06
9.21312e-06
1.54244e-06
2.0104e-07
2.06688e-07
2.18458e-07
2.22249e-07
9.93047e-07
5.12171e-06
5.23637e-06
5.9293e-06
1.66401e-06
8.36174e-05
0.0372252
2.54736e-16
2.20827e-14
5.13551e-13
5.75949e-12
3.95734e-11
1.8977e-10
6.90066e-10
2.01697e-09
4.94678e-09
1.05093e-08
1.97865e-08
3.35507e-08
5.18907e-08
7.41666e-08
9.95019e-08
1.2758e-07
1.59459e-07
1.94768e-07
2.09463e-07
2.75996e-07
2.99149e-07
3.15255e-07
3.1624e-07
3.31598e-07
3.00263e-07
2.97376e-07
2.89111e-07
2.779e-07
2.65798e-07
2.54789e-07
2.46349e-07
2.44105e-07
2.50818e-07
2.68027e-07
2.73502e-07
1.77639e-06
1.06861e-05
1.21198e-05
2.05529e-07
2.01327e-07
2.08741e-07
2.23244e-07
2.27357e-07
3.14596e-07
2.0081e-05
3.33261e-05
1.89825e-05
1.41391e-05
0.000701409
0.00504171
1.9935e-16
1.5968e-14
3.55894e-13
3.90859e-12
2.67044e-11
1.28889e-10
4.76345e-10
1.42517e-09
3.59298e-09
7.85807e-09
1.52263e-08
2.6553e-08
4.22348e-08
6.21257e-08
8.58163e-08
1.13001e-07
1.43396e-07
1.75982e-07
2.10642e-07
2.57732e-07
2.83094e-07
2.95013e-07
3.03301e-07
3.64084e-07
2.94231e-07
2.97273e-07
2.91232e-07
2.79578e-07
2.67267e-07
2.55529e-07
2.45764e-07
2.42833e-07
2.49721e-07
2.49314e-07
5.12593e-07
9.85878e-06
1.39912e-05
1.39939e-05
1.89733e-06
2.01356e-07
2.10525e-07
2.28719e-07
2.33552e-07
2.4308e-07
1.10042e-05
4.89643e-05
9.99638e-05
0.000122786
0.000256718
0.000346035
1.34037e-16
1.01994e-14
2.21992e-13
2.42213e-12
1.66498e-11
8.16647e-11
3.0908e-10
9.52011e-10
2.47802e-09
5.60071e-09
1.12125e-08
2.01922e-08
3.31539e-08
5.03114e-08
7.15744e-08
9.67472e-08
1.25643e-07
1.58388e-07
1.95513e-07
2.34136e-07
2.64267e-07
2.85816e-07
2.9472e-07
2.74228e-07
2.93244e-07
2.95425e-07
2.92871e-07
2.81791e-07
2.707e-07
2.5841e-07
2.46084e-07
2.4054e-07
2.44199e-07
2.37572e-07
9.01411e-07
1.26338e-05
1.39874e-05
1.39907e-05
5.768e-06
2.01434e-07
2.13095e-07
2.18333e-07
5.45183e-07
6.48679e-07
5.75494e-07
1.29482e-05
5.37437e-05
8.98031e-05
0.000179792
0.000286811
7.7071e-17
5.72362e-15
1.23945e-13
1.36282e-12
9.53269e-12
4.79415e-11
1.87098e-10
5.96432e-10
1.60983e-09
3.77529e-09
7.84164e-09
1.46462e-08
2.49261e-08
3.91577e-08
5.75372e-08
8.00953e-08
1.06799e-07
1.37491e-07
1.71464e-07
2.06744e-07
2.40397e-07
2.67724e-07
2.77968e-07
2.73939e-07
2.86092e-07
2.88512e-07
3.32424e-07
2.82081e-07
2.75905e-07
2.6406e-07
2.47432e-07
2.37438e-07
2.35959e-07
2.32392e-07
2.31861e-07
5.48149e-06
1.39854e-05
1.39132e-05
3.4727e-06
2.01595e-07
2.10621e-07
2.15304e-07
3.17206e-07
5.15267e-07
4.49031e-07
2.45399e-07
1.82626e-05
5.25187e-05
5.3547e-05
0.000196706
3.76966e-17
2.80404e-15
6.15221e-14
6.91119e-13
4.97193e-12
2.58505e-11
1.04688e-10
3.47119e-10
9.75718e-10
2.38414e-09
5.16018e-09
1.00414e-08
1.77944e-08
2.90631e-08
4.42668e-08
6.35885e-08
8.69861e-08
1.14121e-07
1.44353e-07
1.7719e-07
2.11986e-07
2.4339e-07
2.59594e-07
2.62645e-07
2.72285e-07
2.73021e-07
3.23396e-07
2.84753e-07
2.82367e-07
2.75056e-07
2.50457e-07
2.34149e-07
2.25154e-07
2.25721e-07
2.18498e-07
5.21603e-07
6.82997e-06
7.50612e-06
2.03198e-07
2.0311e-07
2.02914e-07
2.68782e-07
1.62046e-06
2.2055e-06
1.51003e-06
1.64831e-07
1.91112e-07
9.68433e-06
5.9487e-05
0.000194807
1.5599e-17
1.19041e-15
2.69189e-14
3.12977e-13
2.33888e-12
1.26687e-11
5.35574e-11
1.85607e-10
5.45653e-10
1.39492e-09
3.15937e-09
6.43368e-09
1.19252e-08
2.03399e-08
3.22449e-08
4.7959e-08
6.74965e-08
9.05797e-08
1.16856e-07
1.46511e-07
1.80026e-07
2.13548e-07
2.3526e-07
2.43407e-07
2.55794e-07
2.61717e-07
2.57341e-07
3.34064e-07
2.90996e-07
2.9973e-07
2.56396e-07
2.34085e-07
2.17918e-07
2.14105e-07
2.14368e-07
1.96584e-07
1.95329e-07
1.95774e-07
3.36929e-07
2.09469e-07
1.954e-07
8.17722e-07
2.21127e-06
2.21392e-06
1.63422e-06
1.43917e-07
1.1106e-06
7.15766e-06
6.49501e-06
4.83084e-05
5.42841e-18
4.34012e-16
1.02749e-14
1.25149e-13
9.80726e-13
5.57508e-12
2.47465e-11
9.00623e-11
2.78068e-10
7.46665e-10
1.77667e-09
3.80146e-09
7.4012e-09
1.32425e-08
2.19632e-08
3.40303e-08
4.96198e-08
6.85843e-08
9.06506e-08
1.16064e-07
1.45857e-07
1.78417e-07
2.04621e-07
2.19552e-07
2.3494e-07
2.45934e-07
2.53038e-07
2.514e-07
3.10133e-07
3.42363e-07
2.68656e-07
2.38956e-07
2.11638e-07
2.00791e-07
1.98418e-07
1.96845e-07
1.95318e-07
1.96267e-07
1.97183e-07
1.95237e-07
1.88677e-07
2.4306e-07
8.19946e-07
8.97354e-07
1.31958e-07
1.417e-07
1.54516e-07
1.24514e-07
1.2576e-07
3.30157e-07
1.57674e-18
1.34409e-16
3.37935e-15
4.36191e-14
3.6174e-13
2.17377e-12
1.01894e-11
3.91276e-11
1.27398e-10
3.60685e-10
9.04991e-10
2.04218e-09
4.1928e-09
7.90504e-09
1.37918e-08
2.24147e-08
3.4144e-08
4.90567e-08
6.69989e-08
8.79981e-08
1.12757e-07
1.41331e-07
1.69445e-07
1.91304e-07
2.08857e-07
2.22318e-07
2.33848e-07
2.48674e-07
2.75726e-07
3.11221e-07
2.88838e-07
2.63977e-07
2.79519e-07
1.9162e-07
1.91048e-07
1.91745e-07
1.95308e-07
2.01078e-07
2.10559e-07
1.75714e-07
1.78925e-07
1.57666e-07
1.32461e-07
1.31013e-07
1.3058e-07
1.27265e-07
1.22e-07
1.23719e-07
1.45867e-07
1.33344e-07
3.78197e-19
3.49051e-17
9.44487e-16
1.30619e-14
1.15658e-13
7.3992e-13
3.68369e-12
1.49971e-11
5.17098e-11
1.54945e-10
4.11401e-10
9.82429e-10
2.13435e-09
4.25638e-09
7.84752e-09
1.3458e-08
2.15897e-08
3.25919e-08
4.6613e-08
6.36658e-08
8.381e-08
1.07152e-07
1.32792e-07
1.57202e-07
1.76732e-07
1.92002e-07
2.01926e-07
2.06121e-07
2.0587e-07
2.07551e-07
2.23388e-07
2.49026e-07
1.861e-07
2.20748e-07
1.80658e-07
1.80083e-07
1.79056e-07
1.77553e-07
1.69379e-07
1.74954e-07
1.70337e-07
1.65042e-07
1.56964e-07
1.44975e-07
1.31098e-07
1.18162e-07
1.06909e-07
9.65266e-08
8.48421e-08
7.4349e-08
7.3973e-20
7.49262e-18
2.20836e-16
3.30569e-15
3.15162e-14
2.16149e-13
1.14959e-12
4.98674e-12
1.82869e-11
5.82115e-11
1.64088e-10
4.15829e-10
9.58329e-10
2.02634e-09
3.95877e-09
7.18903e-09
1.22046e-08
1.94867e-08
2.94556e-08
4.24319e-08
5.85418e-08
7.74776e-08
9.82774e-08
1.19516e-07
1.39756e-07
1.57622e-07
1.71853e-07
1.81919e-07
1.88608e-07
1.93826e-07
1.92361e-07
3.46532e-07
1.75784e-07
1.72012e-07
2.02652e-07
1.6976e-07
1.69366e-07
1.66806e-07
1.65525e-07
1.63329e-07
1.59798e-07
1.55267e-07
1.4922e-07
1.4083e-07
1.30158e-07
1.17631e-07
1.0319e-07
8.73671e-08
7.31516e-08
6.69037e-08
1.16194e-20
1.30665e-18
4.2398e-17
6.93379e-16
7.17543e-15
5.31243e-14
3.03649e-13
1.41062e-12
5.52528e-12
1.87502e-11
5.6266e-11
1.51629e-10
3.71257e-10
8.33262e-10
1.7265e-09
3.32253e-09
5.97272e-09
1.00863e-08
1.60901e-08
2.43709e-08
3.51981e-08
4.86285e-08
6.44118e-08
8.19432e-08
1.00303e-07
1.18383e-07
1.35054e-07
1.49323e-07
1.60375e-07
1.67265e-07
1.67567e-07
1.49808e-07
2.68585e-07
1.66168e-07
1.70005e-07
1.7026e-07
1.61596e-07
1.56179e-07
1.53376e-07
1.51431e-07
1.49013e-07
1.45646e-07
1.41005e-07
1.34632e-07
1.2633e-07
1.16027e-07
1.03408e-07
8.86673e-08
7.34808e-08
6.07342e-08
1.44137e-21
1.81577e-19
6.54341e-18
1.17868e-16
1.33383e-15
1.07317e-14
6.63133e-14
3.31614e-13
1.3934e-12
5.05865e-12
1.62043e-11
4.65315e-11
1.21214e-10
2.89036e-10
6.35377e-10
1.2955e-09
2.46426e-09
4.39845e-09
7.40951e-09
1.18428e-08
1.80362e-08
2.62521e-08
3.65888e-08
4.89092e-08
6.28299e-08
7.77889e-08
9.31585e-08
1.08338e-07
1.22754e-07
1.35597e-07
1.44761e-07
1.44194e-07
1.21788e-07
1.64725e-07
1.62445e-07
1.56887e-07
1.50077e-07
1.44127e-07
1.40025e-07
1.37397e-07
1.35171e-07
1.32459e-07
1.28666e-07
1.23306e-07
1.16049e-07
1.06673e-07
9.48945e-08
8.08159e-08
6.57009e-08
5.17097e-08
1.3869e-22
1.96931e-20
7.93616e-19
1.58552e-17
1.97521e-16
1.73806e-15
1.16788e-14
6.31967e-14
2.86152e-13
1.11559e-12
3.82646e-12
1.17373e-11
3.25951e-11
8.27106e-11
1.93168e-10
4.17793e-10
8.41786e-10
1.58958e-09
2.8304e-09
4.77904e-09
7.68543e-09
1.18038e-08
1.73374e-08
2.43714e-08
3.2829e-08
4.24776e-08
5.29872e-08
6.40015e-08
7.51813e-08
8.62056e-08
9.67517e-08
1.06473e-07
1.14968e-07
1.21762e-07
1.26293e-07
1.28055e-07
1.27106e-07
1.24498e-07
1.21562e-07
1.1902e-07
1.1672e-07
1.14096e-07
1.10561e-07
1.05535e-07
9.85639e-08
8.93535e-08
7.77335e-08
6.41129e-08
4.98622e-08
3.6768e-08
1.01671e-23
1.63294e-21
7.39624e-20
1.64808e-18
2.27355e-17
2.20073e-16
1.61694e-15
9.51538e-15
4.66281e-14
1.95886e-13
7.21312e-13
2.36776e-12
7.01755e-12
1.89601e-11
4.7048e-11
1.07902e-10
2.30104e-10
4.59161e-10
8.62957e-10
1.537e-09
2.60683e-09
4.22182e-09
6.53386e-09
9.66091e-09
1.36491e-08
1.84551e-08
2.39607e-08
3.00098e-08
3.64402e-08
4.31022e-08
4.98887e-08
5.67989e-08
6.39688e-08
7.15243e-08
7.91991e-08
8.60801e-08
9.10133e-08
9.35658e-08
9.42072e-08
9.36147e-08
9.21909e-08
8.99354e-08
8.65676e-08
8.16802e-08
7.4883e-08
6.59205e-08
5.48338e-08
4.24465e-08
3.03831e-08
2.03299e-08
5.57635e-25
1.01474e-22
5.18555e-21
1.29474e-19
1.98796e-18
2.128e-17
1.7184e-16
1.10494e-15
5.88351e-15
2.67197e-14
1.05864e-13
3.72341e-13
1.17809e-12
3.38712e-12
8.91771e-12
2.16394e-11
4.86917e-11
1.02258e-10
2.01847e-10
3.77114e-10
6.70743e-10
1.13954e-09
1.85033e-09
2.86806e-09
4.23819e-09
5.9724e-09
8.0471e-09
1.04161e-08
1.3028e-08
1.58446e-08
1.88803e-08
2.22802e-08
2.63708e-08
3.15315e-08
3.78539e-08
4.48628e-08
5.155e-08
5.69425e-08
6.05706e-08
6.24069e-08
6.26538e-08
6.14433e-08
5.87455e-08
5.44626e-08
4.84526e-08
4.06526e-08
3.13499e-08
2.17975e-08
1.38213e-08
8.21229e-09
2.25506e-26
4.6454e-24
2.68647e-22
7.54584e-21
1.29538e-19
1.54081e-18
1.37413e-17
9.69872e-17
5.6346e-16
2.77549e-15
1.18598e-14
4.47507e-14
1.51174e-13
4.62022e-13
1.28779e-12
3.29484e-12
7.78402e-12
1.70881e-11
3.51113e-11
6.80604e-11
1.25385e-10
2.2066e-10
3.71573e-10
5.97792e-10
9.16338e-10
1.33632e-09
1.8569e-09
2.47085e-09
3.17238e-09
3.96793e-09
4.89778e-09
6.07536e-09
7.71297e-09
1.00649e-08
1.32977e-08
1.73902e-08
2.20047e-08
2.65268e-08
3.03356e-08
3.29687e-08
3.42134e-08
3.40227e-08
3.23967e-08
2.93755e-08
2.50326e-08
1.95227e-08
1.34492e-08
8.05385e-09
4.44734e-09
2.30952e-09
6.63705e-28
1.54382e-25
1.01336e-23
3.2148e-22
6.19804e-21
8.2318e-20
8.14818e-19
6.34397e-18
4.03994e-17
2.16732e-16
1.00217e-15
4.06648e-15
1.46844e-14
4.77054e-14
1.40586e-13
3.78233e-13
9.3406e-13
2.12894e-12
4.50742e-12
8.93504e-12
1.67301e-11
2.98285e-11
5.08953e-11
8.31604e-11
1.29749e-10
1.92648e-10
2.7212e-10
3.6765e-10
4.80803e-10
6.19859e-10
8.07398e-10
1.09136e-09
1.55036e-09
2.27934e-09
3.36979e-09
4.89926e-09
6.8729e-09
9.1133e-09
1.13109e-08
1.30875e-08
1.41611e-08
1.43507e-08
1.36024e-08
1.19675e-08
9.58503e-09
6.68615e-09
3.87665e-09
2.01005e-09
9.88438e-10
4.33059e-10
1.40979e-29
3.6797e-27
2.74983e-25
9.89817e-24
2.15414e-22
3.21176e-21
3.54853e-20
3.06541e-19
2.15235e-18
1.26479e-17
6.36262e-17
2.7894e-16
1.08084e-15
3.74268e-15
1.16801e-14
3.30616e-14
8.52969e-14
2.01426e-13
4.37383e-13
8.78498e-13
1.64491e-12
2.89816e-12
4.84931e-12
7.75605e-12
1.18791e-11
1.73828e-11
2.42503e-11
3.24101e-11
4.23054e-11
5.60863e-11
7.96226e-11
1.25085e-10
2.11933e-10
3.64646e-10
6.12746e-10
9.93305e-10
1.54551e-09
2.2574e-09
3.0466e-09
3.76346e-09
4.24885e-09
4.37885e-09
4.09797e-09
3.43844e-09
2.50354e-09
1.46356e-09
7.23916e-10
3.44072e-10
1.41721e-10
5.08174e-11
2.14652e-31
6.21373e-29
5.30347e-27
2.17882e-25
5.38653e-24
9.07413e-23
1.12662e-21
1.08756e-20
8.48337e-20
5.50401e-19
3.03711e-18
1.45045e-17
6.07876e-17
2.2601e-16
7.51805e-16
2.25159e-15
6.09902e-15
1.49915e-14
3.35299e-14
6.84443e-14
1.28057e-13
2.20963e-13
3.54586e-13
5.3453e-13
7.64479e-13
1.04446e-12
1.36694e-12
1.72291e-12
2.15185e-12
2.89108e-12
4.69296e-12
9.31836e-12
1.99953e-11
4.15877e-11
8.05226e-11
1.45512e-10
2.49549e-10
3.98974e-10
5.82118e-10
7.64378e-10
8.9451e-10
9.26541e-10
8.39978e-10
6.48973e-10
4.00067e-10
1.98311e-10
9.50035e-11
3.77447e-11
1.25612e-11
3.67802e-12
2.3508e-33
7.38503e-31
7.17527e-29
3.38823e-27
9.58733e-26
1.838e-24
2.58342e-23
2.80906e-22
2.45574e-21
1.77633e-20
1.08672e-19
5.71973e-19
2.6248e-18
1.06124e-17
3.81087e-17
1.22268e-16
3.51936e-16
9.1113e-16
2.12443e-15
4.4644e-15
8.46199e-15
1.44882e-14
2.24687e-14
3.17113e-14
4.10608e-14
4.94125e-14
5.61975e-14
6.15568e-14
6.78802e-14
8.83296e-14
1.73479e-13
4.72345e-13
1.33661e-12
3.43782e-12
7.77183e-12
1.56585e-11
2.91885e-11
5.02504e-11
7.82514e-11
1.07674e-10
1.28534e-10
1.30727e-10
1.10236e-10
7.34577e-11
4.08767e-11
2.02262e-11
8.06034e-12
2.52396e-12
6.58442e-13
1.56342e-13
1.9188e-35
6.19504e-33
6.724e-31
3.66461e-29
1.19646e-27
2.62948e-26
4.21408e-25
5.20182e-24
5.14226e-23
4.18984e-22
2.87563e-21
1.69046e-20
8.62176e-20
3.85296e-19
1.51995e-18
5.32125e-18
1.65898e-17
4.61351e-17
1.14448e-16
2.52933e-16
4.96902e-16
8.65525e-16
1.3332e-15
1.81107e-15
2.16392e-15
2.27415e-15
2.12363e-15
1.81684e-15
1.54195e-15
1.75832e-15
4.4317e-15
1.73455e-14
6.53961e-14
2.10683e-13
5.6507e-13
1.27868e-12
2.55236e-12
4.62804e-12
7.4741e-12
1.04766e-11
1.23399e-11
1.18093e-11
8.97436e-12
6.13177e-12
3.34483e-12
1.36595e-12
4.21519e-13
9.84863e-14
2.03755e-14
3.90459e-15
1.27383e-37
3.94477e-35
4.37868e-33
2.71681e-31
1.02999e-29
2.60821e-28
4.78701e-27
6.74384e-26
7.59156e-25
7.03105e-24
5.47534e-23
3.64427e-22
2.09886e-21
1.05568e-20
4.6682e-20
1.82306e-19
6.30368e-19
1.93125e-18
5.2364e-18
1.2527e-17
2.63118e-17
4.82063e-17
7.64476e-17
1.04021e-16
1.20137e-16
1.16077e-16
9.23709e-17
6.03287e-17
3.41566e-17
2.70084e-17
8.58022e-17
4.77801e-16
2.39165e-15
9.76446e-15
3.16925e-14
8.23084e-14
1.77806e-13
3.32364e-13
5.42301e-13
7.49801e-13
8.59733e-13
8.23456e-13
6.63061e-13
4.17653e-13
1.90065e-13
6.04348e-14
1.33656e-14
2.29196e-15
3.66822e-16
5.47426e-17
7.74406e-40
2.31141e-37
2.21212e-35
1.39933e-33
6.05591e-32
1.76404e-30
3.69523e-29
5.92945e-28
7.60807e-27
8.04492e-26
7.16515e-25
5.46205e-24
3.60614e-23
2.07958e-22
1.05354e-21
4.70473e-21
1.85438e-20
6.44722e-20
1.97223e-19
5.2838e-19
1.23095e-18
2.46866e-18
4.20627e-18
5.99417e-18
7.01629e-18
6.58986e-18
4.80237e-18
2.62034e-18
1.05002e-18
4.26137e-19
1.2593e-18
9.75443e-18
6.56638e-17
3.4737e-16
1.39895e-15
4.27921e-15
1.031e-14
2.0381e-14
3.3842e-14
4.73746e-14
5.53068e-14
5.24699e-14
3.87e-14
2.10943e-14
7.73807e-15
1.74832e-15
2.55607e-16
3.38929e-17
4.08949e-18
4.37887e-19
6.31768e-42
1.64324e-39
1.13766e-37
5.48881e-36
2.48977e-34
8.12176e-33
1.90772e-31
3.42657e-30
4.94261e-29
5.91779e-28
6.01507e-27
5.27186e-26
4.02791e-25
2.70324e-24
1.60122e-23
8.38898e-23
3.88588e-22
1.58698e-21
5.68552e-21
1.77438e-20
4.77977e-20
1.09761e-19
2.1099e-19
3.31391e-19
4.13705e-19
3.98505e-19
2.83473e-19
1.41474e-19
4.76588e-20
1.15364e-20
1.35083e-20
1.37788e-19
1.31522e-18
9.48121e-18
4.93103e-17
1.82347e-16
4.9945e-16
1.07032e-15
1.86011e-15
2.63617e-15
3.01611e-15
2.69644e-15
1.78828e-15
8.2112e-16
2.30848e-16
3.37435e-17
3.17344e-18
2.96081e-19
2.34337e-20
1.56877e-21
5.58379e-44
1.47204e-41
7.89192e-40
2.14948e-38
7.57681e-37
2.53155e-35
6.37114e-34
1.23874e-32
1.93676e-31
2.53162e-30
2.84652e-29
2.80653e-28
2.45291e-27
1.91262e-26
1.33461e-25
8.33442e-25
4.64933e-24
2.30766e-23
1.00969e-22
3.84516e-22
1.25463e-21
3.46339e-21
7.91754e-21
1.44978e-20
2.03945e-20
2.13233e-20
1.58179e-20
7.88339e-21
2.64973e-21
5.63279e-22
1.61825e-22
1.04646e-21
1.6714e-20
1.88154e-19
1.37798e-18
6.42559e-18
2.03742e-17
4.76467e-17
8.62562e-17
1.23231e-16
1.36945e-16
1.14204e-16
6.71604e-17
2.56673e-17
5.40457e-18
4.94088e-19
3.15692e-20
1.51759e-21
4.845e-23
1.20362e-24
2.30001e-06
1.20924e-05
3.80705e-05
8.53805e-05
0.000121344
9.31325e-05
7.64357e-06
2.85631e-06
3.37395e-06
1.66138e-06
3.09124e-07
3.0251e-07
4.4395e-07
3.43564e-07
3.40517e-07
9.18972e-06
1.87961e-05
3.81868e-06
3.26096e-05
1.03226e-05
2.84295e-06
9.43274e-05
4.0319e-05
5.96403e-05
5.16836e-05
1.26691e-05
3.19295e-07
3.06833e-07
2.17929e-07
1.86157e-07
1.64859e-07
1.51267e-07
1.45021e-07
1.47273e-07
1.54716e-07
1.57192e-07
1.4636e-07
1.20689e-07
8.49909e-08
5.00303e-08
2.36196e-08
8.62409e-09
2.35806e-09
4.65158e-10
6.30112e-11
5.4688e-12
2.75491e-13
6.86999e-15
6.41067e-17
1.20553e-19
2.30433e-06
1.02365e-05
8.86839e-05
0.000274613
0.000304462
0.000695656
4.02499e-05
4.97975e-07
3.84663e-07
3.15249e-07
3.11718e-07
3.07235e-07
3.12022e-07
3.20134e-07
3.28675e-07
3.37241e-07
8.04714e-07
1.54099e-06
1.78332e-06
1.80666e-06
2.5931e-05
0.000379162
0.000307826
0.000157234
8.61209e-05
3.8275e-05
1.43027e-06
2.09577e-07
2.05328e-07
1.75804e-07
1.54104e-07
1.37414e-07
1.27176e-07
1.23399e-07
1.24877e-07
1.22818e-07
1.09789e-07
8.50349e-08
5.5203e-08
2.94888e-08
1.2467e-08
4.04647e-09
9.78717e-10
1.70108e-10
2.02266e-11
1.53072e-12
6.62716e-14
1.38412e-15
1.03701e-17
1.46634e-20
2.32015e-06
1.87503e-05
0.000174099
0.000639057
0.00031062
0.000510101
0.00385247
0.00898719
0.0485292
0.144295
0.250026
0.337487
0.379514
0.365712
0.317194
0.222712
0.122524
0.0128182
2.31284e-07
2.25688e-05
0.000101897
0.000230653
0.000279025
0.000284177
0.00024832
0.000116965
4.82348e-05
1.07498e-06
1.72423e-07
1.67702e-07
1.43079e-07
1.26171e-07
1.13339e-07
1.03201e-07
9.64351e-08
8.94349e-08
7.54994e-08
5.40102e-08
3.20014e-08
1.53511e-08
5.75255e-09
1.643e-09
3.48535e-10
5.29551e-11
5.4723e-12
3.56327e-13
1.29839e-14
2.19137e-16
1.23091e-18
1.15734e-21
4.25732e-05
0.000113783
0.00013779
0.00020637
0.0052222
0.109912
0.262192
0.554069
0.788722
0.92132
0.979066
0.991721
0.990417
0.986322
0.980564
0.962806
0.906232
0.783574
0.508843
0.257638
0.0890811
0.019686
0.000217074
0.000148185
0.000142825
0.000136062
0.000106512
5.94915e-05
1.27404e-06
1.53059e-07
1.31019e-07
1.16625e-07
1.03289e-07
8.89309e-08
7.38005e-08
6.17581e-08
4.74881e-08
3.06723e-08
1.64525e-08
6.97509e-09
2.28578e-09
5.67691e-10
1.07088e-10
1.45633e-11
1.33867e-12
7.62811e-14
2.34068e-15
3.07673e-17
1.14268e-19
5.38682e-23
0.000143834
0.000134517
0.000134678
0.0146972
0.295543
0.588926
0.885647
0.996357
1
1
1
1
1
1
1
1
1
0.999977
0.99354
0.887611
0.625652
0.288744
0.0709494
0.000216933
0.000147727
0.000156705
0.000170295
0.000118247
4.16263e-05
1.27249e-07
1.22793e-07
1.09597e-07
9.64718e-08
8.03242e-08
5.85856e-08
4.14986e-08
2.75684e-08
1.5751e-08
7.40897e-09
2.71226e-09
7.97047e-10
1.81203e-10
3.15246e-11
4.1338e-12
4.03862e-13
2.72734e-14
9.78246e-16
1.13328e-17
2.015e-20
6.84936e-24
0.000146204
0.00014085
0.0110588
0.438667
0.835435
0.995729
0.999865
0.999984
1
1
1
1
1
1
1
1
1
1
0.99998
0.999752
0.997459
0.884789
0.539268
0.135676
0.000400196
0.000122289
0.00012994
0.000128176
9.52492e-05
1.24371e-07
1.10442e-07
1.04681e-07
9.29799e-08
7.48428e-08
4.88655e-08
2.76352e-08
1.45547e-08
7.15926e-09
2.93863e-09
1.00212e-09
2.8161e-10
6.969e-11
1.70029e-11
4.2303e-12
8.81237e-13
1.1277e-13
6.26807e-15
9.40929e-17
1.52041e-19
5.55533e-24
0.00014867
0.0223133
0.492736
0.954907
0.999774
0.999975
0.999993
0.999999
1
1
1
1
1
1
1
1
1
1
0.999999
0.999982
0.999944
0.999754
0.982405
0.709842
0.179276
0.000111594
0.000109676
0.000106824
8.09293e-05
2.24596e-07
1.81888e-06
9.77038e-08
9.17743e-08
7.04556e-08
3.90452e-08
1.67152e-08
7.0291e-09
3.17193e-09
1.3133e-09
5.18093e-10
2.17175e-10
1.0062e-10
4.5283e-11
1.67672e-11
4.37148e-12
6.63525e-13
4.4235e-14
8.2534e-16
1.79332e-18
2.75088e-23
0.0114334
0.429474
0.914646
0.999804
0.999984
0.999998
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.999994
0.99998
0.999921
0.999218
0.758314
0.173554
0.000111593
0.000108837
0.000159884
1.37176e-06
1.05746e-05
8.56715e-08
8.70311e-08
7.00055e-08
3.03409e-08
9.40564e-09
4.06554e-09
2.19437e-09
1.26306e-09
7.91503e-10
5.04069e-10
2.97514e-10
1.50165e-10
5.98821e-11
1.69747e-11
2.89559e-12
2.27161e-13
5.3325e-15
1.61591e-17
4.34276e-22
0.275675
0.740108
0.999804
0.999982
0.999998
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.999994
0.99995
0.998367
0.670666
0.145206
0.000151878
0.000295077
0.00051297
3.81097e-05
7.31035e-08
5.7107e-08
6.04306e-08
2.40458e-08
7.03703e-09
4.43325e-09
3.24602e-09
2.46876e-09
1.83763e-09
1.26857e-09
7.78212e-10
4.05767e-10
1.69201e-10
5.16719e-11
9.94024e-12
9.28305e-13
2.75221e-14
1.13999e-16
5.47026e-21
0.483261
0.967343
0.999981
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.999962
0.961654
0.469709
0.101654
0.000320065
0.00234953
0.000300883
2.3613e-07
3.50482e-08
2.67894e-08
1.93061e-08
8.94702e-09
7.343e-09
6.19999e-09
5.08788e-09
3.91897e-09
2.75826e-09
1.72939e-09
9.38604e-10
4.14742e-10
1.35977e-10
2.85648e-11
3.03987e-12
1.09292e-13
6.13504e-16
5.27951e-20
0.786748
0.999907
0.999997
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999962
0.832954
0.252672
0.0422601
0.000328119
2.6644e-05
1.41784e-06
4.95835e-08
2.28372e-08
1.736e-08
1.43089e-08
1.2989e-08
1.15103e-08
9.69619e-09
7.64893e-09
5.57638e-09
3.65144e-09
2.06302e-09
9.61555e-10
3.31396e-10
7.36865e-11
8.528e-12
3.55877e-13
2.58577e-15
3.86944e-19
0.958908
0.99999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.989794
0.568138
0.0787937
1.69412e-05
-4.58265e-07
-7.65127e-09
4.12254e-08
3.56204e-08
2.51833e-08
2.41711e-08
2.30161e-08
2.11513e-08
1.85545e-08
1.53172e-08
1.16553e-08
8.11119e-09
4.79823e-09
2.2469e-09
7.78049e-10
1.76197e-10
2.13649e-11
9.89509e-13
8.97929e-15
2.23789e-18
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
0.844554
0.206886
5.1423e-08
5.87984e-08
6.0926e-08
6.03525e-08
4.48304e-08
4.33054e-08
4.3788e-08
4.33163e-08
4.12787e-08
3.73971e-08
3.19071e-08
2.52965e-08
1.73274e-08
1.00828e-08
4.77012e-09
1.68992e-09
3.94593e-10
4.97776e-11
2.46101e-12
2.62111e-14
1.04216e-17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.995844
0.41602
3.13887e-08
1.23632e-08
7.84016e-08
8.17327e-08
7.89634e-08
8.06215e-08
8.20423e-08
8.13735e-08
7.77708e-08
7.12657e-08
6.07796e-08
4.65842e-08
3.20113e-08
1.90686e-08
9.31629e-09
3.43194e-09
8.38239e-10
1.11109e-10
5.81704e-12
6.84643e-14
3.95619e-17
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.690641
1.30099e-08
1.07612e-08
9.8465e-08
1.36604e-07
1.36934e-07
1.36542e-07
1.35605e-07
1.32282e-07
1.25526e-07
1.13033e-07
9.5595e-08
7.50586e-08
5.33237e-08
3.30498e-08
1.68862e-08
6.5374e-09
1.69322e-09
2.40215e-10
1.35073e-11
1.70697e-13
1.25864e-16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.858071
0.0473471
1.0761e-08
1.18608e-07
3.04146e-07
1.44862e-07
1.80036e-07
1.77719e-07
1.73556e-07
1.64155e-07
1.51221e-07
1.31937e-07
1.07547e-07
8.0088e-08
5.23805e-08
2.83182e-08
1.15805e-08
3.20498e-09
4.9438e-10
3.0803e-11
4.2975e-13
3.57113e-16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
1
0.933457
0.129495
1.0761e-08
2.48666e-07
3.72126e-07
1.91567e-07
1.82377e-07
1.8604e-07
1.86015e-07
1.71929e-07
1.77513e-07
1.61195e-07
1.37432e-07
1.0845e-07
7.57736e-08
4.39958e-08
1.90173e-08
5.62744e-09
9.48554e-10
6.68742e-11
1.09065e-12
9.94258e-16
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
1
0.962274
0.167291
1.33795e-08
1.93507e-07
3.72008e-07
2.12808e-07
1.82812e-07
1.93875e-07
1.98256e-07
2.80337e-07
1.82228e-07
1.79206e-07
1.60711e-07
1.34884e-07
1.00971e-07
6.37517e-08
2.90868e-08
9.17109e-09
1.68273e-09
1.3471e-10
2.67103e-12
2.96231e-15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
1
0.97664
0.203967
-2.54886e-06
1.53991e-07
3.72199e-07
1.89799e-07
1.91008e-07
2.05118e-07
2.22692e-07
3.0577e-07
2.23757e-07
1.83171e-07
1.80325e-07
1.59682e-07
1.28351e-07
8.69429e-08
4.18147e-08
1.39921e-08
2.77383e-09
2.49917e-10
6.06397e-12
9.37867e-15
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
1
0.97791
0.192828
9.34431e-08
1.50764e-07
2.67524e-07
1.89057e-07
1.90897e-07
1.97087e-07
7.4723e-07
1.28792e-06
1.24433e-06
3.30233e-07
1.82929e-07
1.82835e-07
1.63036e-07
1.12538e-07
5.7041e-08
2.0214e-08
4.30337e-09
4.30945e-10
1.25868e-11
2.88538e-14
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
1
1
1
0.965334
0.160158
1.42599e-07
1.50763e-07
1.5819e-07
1.87393e-07
1.91815e-07
2.02837e-07
9.34877e-07
1.29098e-06
1.29147e-06
1.27102e-06
1.92182e-07
2.02143e-07
2.02578e-07
1.39138e-07
7.43673e-08
2.7915e-08
6.36842e-09
7.02766e-10
2.41639e-11
8.02249e-14
0.998575
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
0.999999
0.999999
0.999999
1
1
1
0.906162
0.0726735
-1.76945e-07
1.50767e-07
1.66828e-07
3.01394e-07
1.9552e-07
2.00534e-07
2.10667e-07
9.28267e-07
1.29223e-06
1.28594e-06
6.48637e-07
2.02742e-07
2.27846e-07
1.65045e-07
9.30538e-08
3.704e-08
9.06469e-09
1.10017e-09
4.39556e-11
1.99527e-13
0.942852
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.757313
9.08038e-07
1.42133e-07
1.51302e-07
2.30805e-07
4.24129e-07
1.99342e-07
2.1199e-07
2.18758e-07
2.26624e-07
7.77759e-07
1.27451e-06
6.53369e-07
2.05009e-07
2.46657e-07
1.88533e-07
1.12008e-07
4.72808e-08
1.24266e-08
1.66129e-09
7.71233e-11
4.61731e-13
0.71838
0.999691
0.999989
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.990587
0.514891
1.76075e-07
1.5687e-07
1.54066e-07
3.24715e-07
4.23802e-07
3.49976e-07
3.56913e-07
2.31674e-07
2.40229e-07
3.76392e-07
1.26902e-06
2.21379e-07
2.14994e-07
2.58029e-07
2.08236e-07
1.29948e-07
5.80296e-08
1.6355e-08
2.40689e-09
1.30251e-10
1.03909e-12
0.392879
0.944695
0.999899
0.999991
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999999
1
1
1
1
1
1
1
0.908936
0.280246
9.06065e-08
1.62102e-07
1.60809e-07
2.94883e-07
3.46416e-07
3.66919e-07
3.64806e-07
2.56862e-07
2.58004e-07
5.40785e-07
1.25824e-06
2.3603e-07
3.80555e-07
2.59619e-07
2.23486e-07
1.45678e-07
6.84708e-08
2.0591e-08
3.31672e-09
2.0818e-10
2.25201e-12
0.181477
0.696723
0.998959
0.999954
0.999997
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.993181
0.67064
0.144512
4.52419e-05
1.76281e-07
2.38175e-07
2.85861e-07
2.89527e-07
2.77756e-07
2.74095e-07
2.73977e-07
2.72429e-07
4.02214e-07
4.86461e-07
3.07771e-07
3.91981e-07
2.75067e-07
2.34493e-07
1.58339e-07
7.77697e-08
2.47624e-08
4.32251e-09
3.09598e-10
4.45818e-12
0.036492
0.358019
0.89349
0.99986
0.999991
0.999999
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999998
1
1
1
0.999995
0.891559
0.354468
0.02473
0.00030531
2.61935e-06
6.01397e-07
2.9888e-07
2.889e-07
2.84662e-07
2.77934e-07
2.74696e-07
2.7393e-07
2.73326e-07
2.87066e-07
8.98259e-07
3.20325e-07
2.85887e-07
2.42124e-07
1.67421e-07
8.51724e-08
2.84101e-08
5.30763e-09
4.23599e-10
7.53986e-12
0.000129506
0.0734558
0.522367
0.994553
0.999914
0.999993
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999741
0.999694
0.999898
0.999994
0.999989
0.619218
0.0639124
0.000753684
0.000630543
6.48725e-05
1.37159e-06
3.13414e-07
2.90844e-07
2.84303e-07
2.79497e-07
2.75351e-07
2.73917e-07
2.73458e-07
1.02301e-06
1.29291e-06
3.56935e-07
2.92726e-07
2.46759e-07
1.72766e-07
8.99345e-08
3.10711e-08
6.10665e-09
5.27182e-10
1.08829e-11
0.000125335
7.91527e-05
0.0937394
0.612429
0.988438
0.999914
0.999994
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.999996
0.999996
0.999992
0.999992
0.773645
0.084585
0.00122559
0.000867168
1.29292e-05
1.6744e-05
5.87076e-07
2.93699e-07
2.91768e-07
2.87146e-07
2.82991e-07
2.80928e-07
2.78387e-07
2.74278e-07
9.3316e-07
1.33332e-06
3.32853e-07
2.92131e-07
2.48029e-07
1.74445e-07
9.16942e-08
3.22533e-08
6.5423e-09
5.96953e-10
1.365e-11
0.0001366
7.07646e-05
5.65267e-05
0.0970617
0.581882
0.903171
0.999723
0.999992
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0.998163
0.999164
0.74919
0.128116
0.00127799
0.000803418
0.000714069
9.45516e-07
3.38948e-07
3.16971e-07
3.18248e-07
2.98428e-07
2.89626e-07
1.1435e-06
1.72906e-06
4.18307e-07
2.77489e-07
6.28671e-07
1.41299e-06
3.38596e-07
2.81331e-07
2.44117e-07
1.72302e-07
9.04998e-08
3.1919e-08
6.54726e-09
6.13855e-10
1.49147e-11
9.8794e-05
7.85072e-05
5.49562e-05
4.84623e-05
0.0706455
0.422758
0.709671
0.936959
0.999991
1
1
1
1
1
1
1
1
1
1
1
1
0.973595
0.867124
0.594609
0.126432
0.00283729
0.00163662
0.00142755
9.06251e-05
1.17625e-05
1.48387e-05
8.5964e-07
3.21654e-07
3.3121e-07
6.65229e-07
5.81249e-06
5.81461e-06
2.53016e-06
2.97688e-07
6.29314e-07
1.41594e-06
7.61022e-07
2.42163e-07
2.34632e-07
1.6649e-07
8.65338e-08
3.01779e-08
6.14774e-09
5.77856e-10
1.43564e-11
1.23822e-05
2.08736e-05
5.21706e-05
4.51962e-05
4.84646e-05
0.0361726
0.235296
0.430228
0.718037
0.913243
0.999999
1
1
1
1
1
1
1
1
0.948461
0.801697
0.588031
0.305127
0.0449468
0.00721596
0.0115061
0.0044185
0.00074867
0.000190622
2.04552e-06
7.51624e-07
3.52904e-07
3.30502e-07
2.02295e-06
5.80577e-06
5.81431e-06
5.80489e-06
4.58726e-06
4.91591e-07
5.49157e-07
1.42597e-06
1.02803e-06
2.33666e-07
2.25053e-07
1.57555e-07
8.01418e-08
2.72684e-08
5.42607e-09
5.00414e-10
1.23197e-11
1.16482e-07
1.24429e-07
6.47172e-07
3.18484e-05
3.97363e-05
0.00013755
0.00916104
0.0697014
0.143222
0.288511
0.452713
0.659549
0.787569
0.845141
0.852095
0.839294
0.799542
0.720178
0.586566
0.376136
0.169874
0.0657655
0.00209774
0.00251165
0.00291044
0.00358601
0.00221668
0.000788051
0.000202701
4.59847e-06
4.08297e-07
3.39696e-07
3.22569e-07
3.59558e-07
5.23249e-06
5.80508e-06
5.80642e-06
4.24311e-06
5.87003e-07
7.19907e-07
1.43086e-06
1.12944e-06
2.23441e-07
2.14126e-07
1.46113e-07
7.18617e-08
2.35365e-08
4.50185e-09
3.99385e-10
9.4911e-12
1.16069e-07
5.87441e-07
3.94735e-07
9.47406e-06
0.000128409
0.000112962
0.00146493
0.000185947
4.33203e-06
1.43787e-08
1.23399e-08
0.000564019
0.0324669
0.0789132
0.0818225
0.0640258
0.0310932
0.0128625
0.00510075
4.11047e-05
0.000255152
0.00196969
0.000505328
0.00140913
0.000381795
7.63037e-05
0.000345204
0.000263893
0.000101389
1.98926e-05
1.31344e-06
3.24942e-07
3.12246e-07
3.09693e-07
9.4861e-07
5.76142e-06
5.80687e-06
1.96449e-06
5.26048e-07
1.20952e-06
1.43003e-06
1.00494e-06
2.10678e-07
2.02109e-07
1.32831e-07
6.23874e-08
1.94084e-08
3.51232e-09
2.94048e-10
6.58569e-12
7.47422e-08
6.41416e-08
6.03769e-08
9.02742e-06
2.84601e-05
5.60068e-05
4.68968e-06
1.14056e-05
1.30711e-08
1.44585e-08
1.19477e-08
1.32491e-08
3.67098e-08
4.6888e-07
6.04136e-07
4.7147e-07
4.63649e-07
4.66643e-07
4.56786e-06
3.75593e-06
0.000432039
0.000462997
0.00011335
0.000495214
5.70195e-05
1.69788e-05
4.06295e-06
2.46483e-06
3.37053e-06
5.7872e-06
2.80454e-06
4.84589e-07
3.10999e-07
3.07529e-07
3.08635e-07
4.51798e-06
4.66595e-06
6.66976e-07
5.12107e-07
1.32448e-06
1.42914e-06
6.34382e-07
2.00242e-07
1.92811e-07
1.18728e-07
5.24846e-08
1.53235e-08
2.58782e-09
2.00956e-10
4.14796e-12
5.45491e-08
6.01493e-08
4.50957e-08
3.61032e-07
9.83293e-07
1.53945e-07
2.37493e-07
4.6913e-07
1.87681e-08
1.53786e-08
1.19416e-08
2.49616e-08
1.54535e-06
6.85544e-07
5.54445e-07
4.69916e-07
4.57537e-07
4.95186e-07
9.84342e-07
1.42646e-06
7.27096e-05
8.22732e-06
1.24961e-05
4.45584e-06
1.12665e-05
7.33877e-06
9.87666e-07
6.10682e-07
3.68889e-07
3.25109e-07
4.29575e-07
3.4011e-07
3.06835e-07
3.07068e-07
3.66908e-07
1.41889e-06
1.15516e-06
3.28796e-07
4.92361e-07
1.31577e-06
1.18508e-06
2.54333e-07
2.39899e-07
1.78181e-07
1.02942e-07
4.26951e-08
1.16031e-08
1.8117e-09
1.29181e-10
2.42859e-12
4.09658e-08
3.49835e-08
3.43696e-08
2.21934e-08
3.39039e-08
2.29982e-08
2.64187e-08
1.9506e-08
2.67344e-08
1.31573e-08
7.3194e-09
1.01907e-08
2.31593e-06
8.77771e-06
8.99737e-06
8.65961e-07
4.42858e-07
4.2728e-07
1.55734e-06
1.88503e-06
6.16798e-06
3.02972e-06
1.66203e-06
8.64231e-07
5.09771e-07
3.89294e-07
3.54572e-07
3.25895e-07
3.12945e-07
3.09001e-07
3.0753e-07
3.06128e-07
3.06195e-07
3.06602e-07
3.10999e-07
3.07125e-07
3.05204e-07
3.07645e-07
1.64065e-06
8.71987e-07
2.76034e-07
2.83661e-07
2.35449e-07
1.62841e-07
8.73451e-08
3.35581e-08
8.40403e-09
1.20135e-09
7.78405e-11
1.31799e-12
2.6199e-08
1.86066e-08
1.40246e-08
1.44245e-08
2.07788e-08
1.85288e-08
1.51069e-08
6.91443e-09
6.78384e-09
1.4422e-09
6.06041e-09
9.35951e-09
5.51125e-07
9.06835e-06
9.06921e-06
6.08725e-07
4.55017e-07
3.67375e-07
4.71292e-07
1.07039e-06
6.96192e-07
5.48649e-07
4.17812e-07
3.52212e-07
3.25028e-07
3.15055e-07
3.1149e-07
3.09529e-07
3.07164e-07
3.06016e-07
3.05268e-07
3.05287e-07
3.05273e-07
3.0521e-07
3.0573e-07
3.0498e-07
3.05044e-07
1.66728e-06
2.81148e-06
5.59314e-07
2.63746e-07
2.70581e-07
2.15895e-07
1.41269e-07
7.08811e-08
2.52218e-08
5.79739e-09
7.53905e-10
4.40266e-11
6.64923e-13
1.28603e-08
7.85714e-09
4.53299e-09
2.71668e-09
2.88928e-09
7.07865e-09
9.5252e-09
5.76564e-10
8.79962e-11
4.98802e-10
6.5898e-09
1.8071e-08
5.54505e-07
9.05884e-06
9.0718e-06
2.18584e-06
3.71619e-07
3.49414e-07
3.32603e-07
3.31709e-07
3.29261e-07
3.21985e-07
3.16247e-07
3.13484e-07
3.1058e-07
3.08603e-07
3.07512e-07
3.06441e-07
3.05664e-07
3.05171e-07
3.05042e-07
3.04968e-07
3.04608e-07
3.04233e-07
3.0401e-07
3.041e-07
1.98376e-06
3.80497e-06
3.00625e-06
3.78074e-07
2.56046e-07
2.52195e-07
1.92906e-07
1.18648e-07
5.51518e-08
1.80283e-08
3.77993e-09
4.44902e-10
2.32916e-11
3.11654e-13
4.5086e-09
2.30742e-09
1.10953e-09
4.92505e-10
1.99935e-10
9.01456e-11
2.53417e-11
9.24154e-12
1.42145e-11
5.1973e-10
6.96179e-09
3.55425e-08
2.08088e-07
5.24712e-06
9.04166e-06
5.9312e-06
3.83084e-07
8.45267e-07
3.21407e-07
3.16744e-07
3.1274e-07
3.10356e-07
3.09709e-07
3.08626e-07
3.07457e-07
3.06773e-07
3.06019e-07
3.05545e-07
3.05163e-07
3.04983e-07
3.04668e-07
3.04235e-07
3.03945e-07
3.03948e-07
3.03951e-07
2.59754e-06
3.81114e-06
3.79856e-06
1.83748e-06
2.7484e-07
2.75451e-07
2.32795e-07
1.68079e-07
9.64264e-08
4.13182e-08
1.22925e-08
2.32593e-09
2.45587e-10
1.14457e-11
1.34933e-13
1.07764e-09
4.6454e-10
1.85378e-10
6.7513e-11
2.23948e-11
6.82315e-12
2.06697e-12
1.11818e-12
1.0299e-11
4.96119e-10
6.57414e-09
3.54929e-08
4.21444e-08
1.03337e-06
8.53424e-06
3.55102e-06
3.85155e-07
3.04639e-06
2.84798e-06
3.10351e-07
3.08602e-07
3.07753e-07
3.07579e-07
3.07239e-07
3.06712e-07
3.06302e-07
3.06002e-07
3.05802e-07
3.05093e-07
3.04348e-07
3.0395e-07
3.0392e-07
3.03931e-07
4.38461e-07
3.28486e-06
3.81046e-06
3.80361e-06
2.3404e-06
3.20012e-07
2.63321e-07
2.5957e-07
2.10965e-07
1.42363e-07
7.55582e-08
2.96279e-08
8.02167e-09
1.37023e-09
1.28876e-10
5.28912e-12
5.43572e-14
1.69079e-10
6.08914e-11
2.01432e-11
6.07261e-12
1.66649e-12
4.32372e-13
1.35416e-13
3.35522e-13
8.11912e-12
4.02187e-10
5.20858e-09
2.634e-08
3.5819e-08
5.43108e-07
1.15544e-06
1.22705e-07
3.30154e-07
3.77317e-06
4.30511e-06
2.76673e-06
3.07638e-07
3.07397e-07
3.07209e-07
3.07135e-07
3.07128e-07
3.06771e-07
3.06085e-07
3.0549e-07
3.04702e-07
3.03979e-07
3.03928e-07
3.03907e-07
1.6433e-06
3.75934e-06
3.77216e-06
3.7991e-06
1.60875e-06
2.92025e-07
2.79985e-07
2.76918e-07
2.43318e-07
1.85531e-07
1.16375e-07
5.68142e-08
2.03796e-08
5.00356e-09
7.67307e-10
6.43741e-11
2.32875e-12
2.07593e-14
1.66294e-11
4.99477e-12
1.36805e-12
3.41666e-13
7.85525e-14
1.75223e-14
1.65653e-14
1.44019e-13
5.68648e-12
2.68653e-10
3.5022e-09
1.74338e-08
4.03108e-08
4.07878e-08
4.16391e-08
7.70061e-08
1.11983e-07
8.34652e-07
4.29595e-06
4.30411e-06
3.84531e-06
1.53889e-06
3.07139e-07
3.07138e-07
3.07368e-07
3.08209e-07
3.06855e-07
3.0552e-07
3.0425e-07
3.0404e-07
9.94662e-07
3.24058e-06
3.76057e-06
3.75975e-06
3.11376e-06
7.33217e-07
2.83977e-07
2.88685e-07
2.8663e-07
2.648e-07
2.20707e-07
1.57698e-07
9.16402e-08
4.10721e-08
1.34084e-08
2.98268e-09
4.11464e-10
3.06527e-11
9.72451e-13
7.49127e-15
9.85828e-13
2.42649e-13
5.50613e-14
1.13671e-14
2.1307e-15
6.79899e-16
4.37465e-15
5.39521e-14
3.28775e-12
1.44662e-10
2.04894e-09
9.75599e-09
2.04379e-08
4.25831e-08
6.07792e-08
1.04424e-07
2.12494e-07
2.73908e-07
6.42334e-07
3.30911e-06
4.30662e-06
4.30835e-06
3.35103e-06
7.78658e-07
3.11638e-07
3.12405e-07
3.08785e-07
3.05868e-07
3.04349e-07
1.84471e-06
3.75346e-06
3.7582e-06
3.75282e-06
2.28322e-06
3.57822e-07
2.8192e-07
2.75525e-07
2.9021e-07
2.79939e-07
2.47964e-07
1.94549e-07
1.2925e-07
6.9287e-08
2.84826e-08
8.47817e-09
1.70452e-09
2.11235e-10
1.4e-11
3.89609e-13
2.58973e-15
3.4436e-14
6.98021e-15
1.28142e-15
2.11514e-16
3.42455e-17
7.27266e-17
1.05999e-15
1.59615e-14
1.46814e-12
6.15292e-11
9.95996e-10
5.6411e-09
1.7101e-08
3.61831e-08
6.27253e-08
9.89742e-08
1.42787e-07
4.95477e-07
2.7563e-07
3.33619e-07
1.40165e-06
2.27588e-06
1.81218e-06
1.43091e-06
3.26977e-07
3.18209e-07
3.1263e-07
3.06881e-07
3.04463e-07
1.17034e-06
3.28468e-06
3.16948e-06
1.37872e-06
2.84603e-07
2.71378e-07
2.70407e-07
2.7032e-07
2.72323e-07
2.61117e-07
2.23371e-07
1.64907e-07
1.01707e-07
5.02677e-08
1.8962e-08
5.15556e-09
9.40702e-10
1.04716e-10
6.19184e-12
1.51895e-13
8.78009e-16
6.87675e-16
1.09584e-16
1.56993e-17
2.01321e-18
6.1522e-19
9.94122e-18
1.83764e-16
3.53719e-15
4.6911e-13
1.96717e-11
3.47113e-10
2.29628e-09
8.82208e-09
2.3893e-08
4.99621e-08
8.44674e-08
1.21504e-07
1.58564e-07
2.58827e-07
2.883e-07
2.92726e-07
3.77135e-07
3.16997e-07
5.25486e-07
3.78902e-07
3.24454e-07
3.17996e-07
3.12669e-07
3.08131e-07
3.07721e-07
4.37808e-07
3.75044e-07
2.91706e-07
2.99719e-07
5.22799e-06
2.15614e-06
3.47548e-07
2.44749e-07
2.40573e-07
1.95335e-07
1.34663e-07
7.70076e-08
3.51241e-08
1.2179e-08
3.03137e-09
5.03936e-10
5.07971e-11
2.69347e-12
5.91143e-14
3.04206e-16
7.38383e-18
8.9311e-19
9.63586e-20
9.58114e-21
2.86169e-20
8.72941e-19
2.00118e-17
5.53081e-16
9.39025e-14
4.26722e-12
8.17432e-11
6.68816e-10
3.34564e-09
1.18546e-08
3.1669e-08
6.59641e-08
1.13543e-07
1.72113e-07
2.73268e-07
5.25201e-07
2.87975e-07
2.9189e-07
3.02192e-07
3.09626e-07
3.47268e-07
3.26287e-07
3.22718e-07
3.18455e-07
3.11444e-07
2.94157e-07
2.87682e-07
2.81959e-07
2.8542e-07
1.19835e-05
2.19738e-05
2.12906e-05
5.90325e-06
2.17731e-07
2.20812e-07
1.65535e-07
1.06201e-07
5.63653e-08
2.37734e-08
7.59673e-09
1.73709e-09
2.64556e-10
2.43736e-11
1.18137e-12
2.37975e-14
1.14581e-16
4.14397e-20
3.4771e-21
2.58574e-22
2.66985e-23
9.10893e-22
3.72598e-20
1.1158e-18
5.27446e-17
9.91206e-15
5.22834e-13
1.18721e-11
1.27007e-10
8.38306e-10
3.85759e-09
1.32525e-08
3.51727e-08
7.37638e-08
1.24834e-07
1.78197e-07
2.59228e-07
2.72692e-07
3.01269e-07
3.17978e-07
3.38345e-07
3.37386e-07
3.26963e-07
3.24673e-07
3.20961e-07
3.1326e-07
2.99372e-07
2.838e-07
2.80037e-07
1.25993e-05
2.19803e-05
2.1985e-05
2.19855e-05
9.6465e-06
1.94128e-07
1.90907e-07
1.35125e-07
8.1099e-08
4.00635e-08
1.56714e-08
4.63198e-09
9.78123e-10
1.37603e-10
1.17578e-11
5.34607e-13
1.03548e-14
5.06117e-17
9.07437e-23
4.5959e-24
2.04661e-25
6.24409e-26
7.37041e-24
4.51036e-22
2.00317e-20
1.86263e-18
3.60695e-16
2.32604e-14
6.80797e-13
1.0235e-11
9.65699e-11
6.31196e-10
3.02342e-09
1.09266e-08
3.06327e-08
6.88975e-08
1.26819e-07
1.89351e-07
2.41734e-07
2.76065e-07
3.00137e-07
3.24746e-07
3.27776e-07
3.23368e-07
3.22127e-07
3.19098e-07
3.12984e-07
3.02104e-07
2.85102e-07
2.80023e-07
1.19741e-05
2.19863e-05
2.19858e-05
2.19851e-05
6.22522e-06
1.646e-07
1.5862e-07
1.06937e-07
6.02202e-08
2.77773e-08
1.01149e-08
2.7788e-09
5.45658e-10
7.16686e-11
5.78157e-12
2.54518e-13
5.03289e-15
2.80712e-17
2.4943e-26
4.44096e-28
6.86299e-30
3.55363e-30
1.05962e-27
1.51451e-25
1.52802e-23
3.08105e-21
7.89638e-19
8.95821e-17
5.01508e-15
1.5114e-13
2.76683e-12
3.27846e-11
2.62503e-10
1.46196e-09
5.96191e-09
1.94381e-08
5.3934e-08
1.16385e-07
1.8623e-07
2.38311e-07
2.72558e-07
3.01313e-07
3.10616e-07
3.12983e-07
3.13538e-07
3.11693e-07
3.0732e-07
2.98265e-07
2.8176e-07
2.80262e-07
1.49626e-06
1.26377e-05
1.7961e-05
1.09143e-05
6.78299e-07
1.81597e-07
1.31393e-07
8.27297e-08
4.37077e-08
1.88818e-08
6.42987e-09
1.65184e-09
3.04051e-10
3.76913e-11
2.91452e-12
1.271e-13
2.67065e-15
1.85498e-17
)
;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value nonuniform List<scalar>
100
(
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5.3934e-08
1.16385e-07
1.8623e-07
2.38311e-07
2.72558e-07
3.01313e-07
3.10616e-07
3.12983e-07
3.13538e-07
3.11693e-07
3.0732e-07
2.98265e-07
2.8176e-07
2.80262e-07
1.49626e-06
1.26377e-05
1.7961e-05
1.09143e-05
6.78299e-07
1.81597e-07
1.31393e-07
8.27297e-08
4.37077e-08
1.88818e-08
6.42987e-09
1.65184e-09
3.04051e-10
3.76913e-11
2.91452e-12
1.271e-13
0
0
)
;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //
| [
"stig.m.nilsen@gmail.com"
] | stig.m.nilsen@gmail.com |
cf7e5b4b8a2c51a6a43dfb0889f5cb105572a788 | 0df1dfc4998d8964cae4917269f6be114b404de8 | /HW2/Practice/N-Queens_GeneticAlgorithm.cpp | 029cee717d54ad035263c933f5d3ffa878a37c71 | [
"MIT"
] | permissive | AliAlimohammadi/Artificial-Intelligence | fca373993861c6e7ec9a37f205ed625e4c1e1499 | 11450c7764ac656d86693814f13734ac290a7d4e | refs/heads/master | 2023-03-01T21:59:22.600828 | 2021-02-14T07:25:28 | 2021-02-14T07:25:28 | 315,286,087 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,900 | cpp | /*
Author: Ali Alimohammadi
Date: 11/11/2020
Task: Solving N-Queen using Genetic Algorithm
Comments: Hard-coded for 8x8 chess, can be modified for arbitrary size.
*/
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <map>
#include <vector>
#include <ctime>
using namespace std;
// An arrengement of Queens on the chess board
typedef struct
{
string arrangement;
int cost;
} individual;
typedef vector<individual*> population_type;
population_type population;
int N;
// Set how many initial chromosomes are generated
int initialPopulationCount = 10;
int fitnessValue(string arrangement)
{
// Initialize to a solution
int fitness = (N * (N - 1)) / 2;
// Removing pairs that lie on the same row and on the same diagonal
for (int i = 0; i < N; i++)
for (int j = i + 1; j < N; j++)
if ((arrangement[i] == arrangement[j])
|| (i - arrangement[i] == j - arrangement[j])
|| (i + arrangement[i] == j + arrangement[j]))
fitness--;
return fitness;
}
individual* createNode()
{
individual *newNode = new individual;
return newNode;
}
void populate()
{
string sampleArrangement = "";
individual *temp;
for (int i = 1; i <= N; i++)
{
ostringstream ostr;
ostr << i;
sampleArrangement += ostr.str();
}
// Adds entries to population list
for (int i = 0; i < initialPopulationCount; i++)
{
random_shuffle(sampleArrangement.begin(), sampleArrangement.end());
temp = createNode();
temp->arrangement = sampleArrangement;
temp->cost = fitnessValue(sampleArrangement);
population.push_back(temp);
}
}
individual* reproduce(individual *x, individual *y)
{
individual *child = createNode();
// Pick a random spliting point
int crossOver = rand() % N;
// Sequence the genome
child->arrangement = (x->arrangement).substr(0, crossOver) +
(y->arrangement).substr(crossOver, N - crossOver + 1);
child->cost = fitnessValue(child->arrangement);
return child;
}
individual* mutate(individual *child)
{
int randomQueen = rand() % N + 1;
int randomPosition = rand() % N + 1;
// Put a random Queen in a random position
// Add 48 to random postion to get ascii code
child->arrangement[randomQueen] = randomPosition + 48;
return child;
}
int randomSelection()
{
// Extra randomness
int randomPos = rand() % population.size() % 2;
return randomPos;
}
bool isFit(individual *test)
{
// Check if it acquired maximum fitness point
if (fitnessValue(test->arrangement) == ((N * (N - 1)) / 2))
return true;
return false;
}
bool compareCost(individual *x, individual *y)
{
return x->cost > y->cost;
}
individual* GeneticAlgorithm()
{
int randomNum1, randomNum2;
individual *individualX, *individualY, *child;
bool found = false;
child = NULL;
while (!found)
{
population_type new_population;
for (unsigned int i = 0; i < population.size(); i++)
{
sort(population.begin(), population.end(), compareCost);
randomNum1 = randomSelection();
individualX = population[randomNum1];
randomNum2 = randomSelection();
individualY = population[randomNum2];
child = reproduce(individualX, individualY);
// Random probability of mutation
if (!(rand() % 2))
child = mutate(child);
if (isFit(child))
{
found = true;
return child;
}
new_population.push_back(child);
}
population = new_population;
}
return child;
}
void initialize()
{
// Initialize randomness
srand((unsigned int)time(NULL));
// Set 'N'
N = 8;
}
int main()
{
initialize();
// Declare timestamp variables to keep a track of the time spent for computing
clock_t start_time, end_time;
// Keep track of soultions to check their uniqueness
map<string, bool> solutions;
// We already know that there are exactly 92 solutions for 8-Queens Problem.
const int maxSolutions = 92;
int found = 0;
// Start the timer
start_time = clock();
while (found != maxSolutions)
{
populate();
individual *solution = GeneticAlgorithm();
// Check if solution is already found
if (!solutions[solution->arrangement])
{
// Mark it as "FOUND"
solutions[solution->arrangement] = true;
// Print the solution
cout << "Solution #" << ++found << ":\t" << solution->arrangement << endl;
cout << "\n # ";
// Print column indices
for (int i = 0; i < N; i++)
cout << ' ' << i + 1 << ' ';
cout << endl;
for (int i = 0; i < N; i++)
{
// Print row index
cout << ' ' << i + 1 << ' ';
for (int j = 0; j < solution->arrangement[i] - '0' - 1; j++)
cout << " - ";
cout << " Q ";
for (int j = solution->arrangement[i] - '0'; j < N; j++)
cout << " - ";
cout << endl;
}
cout << endl;
}
}
// Stop the timer
end_time = clock();
// Report the execution time
cout << "\nExecution Time:\t" << 1000 * ((double)(end_time - start_time) / CLOCKS_PER_SEC) << " milliseconds" << endl;
return 0;
} | [
"alialimohammadi@aut.ac.ir"
] | alialimohammadi@aut.ac.ir |
91c18f207688cd5cddf97ed57dbc08d3373b6c7b | 0467f120d7a280b43e130d35afc7069bab594b65 | /include/rtt_typekit_generator/archive.h | 497b1c849d1b27f716e50f2ab49fb8d38fecfeb5 | [] | no_license | meyerj/rtt_typekit_generator | 8796252a7b7e22a47508a0ba55f5dd1265ccc6e6 | db9b5e148525d102079dda53c86ad5314291e9b1 | refs/heads/master | 2020-04-05T23:33:35.873600 | 2016-06-06T13:42:22 | 2016-06-06T13:43:24 | 54,195,170 | 0 | 1 | null | 2016-03-18T11:04:15 | 2016-03-18T11:04:14 | null | UTF-8 | C++ | false | false | 3,470 | h | /******************************************************************************
* Copyright (c) 2016, Intermodalics BVBA *
* All rights reserved. *
******************************************************************************/
#ifndef RTT_TYPEKIT_GENERATOR_ARCHIVE_H
#define RTT_TYPEKIT_GENERATOR_ARCHIVE_H
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/serialization.hpp>
namespace boost {
namespace serialization {
// default implementation - do nothing
template<class Archive, class T>
inline bool introspect(Archive& ar, const T&, const BOOST_PFTO unsigned int file_version) {
return false;
}
template <class Archive, class T>
bool introspect_adl(Archive& ar, const T& t, const BOOST_PFTO unsigned int file_version) {
// note usage of function overloading to delay final resolution
// until the point of instantiation. This works around the two-phase
// lookup "feature" which inhibits redefintion of a default function
// template implementation. Due to Robert Ramey
//
// Note that this trick generates problems for compiles which don't support
// PFTO, suppress it here. As far as we know, there are no compilers
// which fail to support PFTO while supporting two-phase lookup.
#if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
const version_type v(file_version);
return introspect(ar, t, v);
#else
return introspect(ar, t, file_version);
#endif
}
} // namespace serialization
} // namespace boost
namespace rtt_typekit_generator {
/**
* Implements the Boost serialization Loading Archive Concept
*/
template <class IntrospectorT>
class Archive {
public:
typedef typename IntrospectorT::type type;
Archive(IntrospectorT *introspector, const type &prototype)
: introspector_(introspector)
, prototype_(const_cast<type &>(prototype))
{}
typedef boost::mpl::bool_<true> is_loading;
typedef boost::mpl::bool_<false> is_saving;
unsigned int get_library_version() { return 0; }
void reset_object_address(const void *new_address, const void *old_address) {}
void delete_created_pointers() {}
template <class T> void register_type(T* = 0) { return 0; }
void operator()() {
boost::serialization::serialize_adl(*this, prototype_, get_library_version());
}
template <class T>
Archive &operator>>(T &t) {
introspect(t);
return *this;
}
template <class T>
Archive &operator&(T &t) {
introspect(t);
return *this;
}
template <class T>
void introspect(T &t) {
introspector_->introspect<T>(0, t, prototype_);
}
template <class T>
void introspect(T (type::*t)) {
introspector_->introspect<T>(0, t, prototype_);
}
template <class T>
void introspect(const char *name, T &t) {
introspector_->introspect<T>(name, t, prototype_);
}
template <class T>
void introspect(const char *name, T (type::*t)) {
introspector_->introspect<T>(name, t, prototype_);
}
template <typename T>
void introspect(const boost::serialization::nvp<T> &t) {
introspector_->introspect<T>(t.name(), t.value(), prototype_);
}
private:
IntrospectorT *introspector_;
type &prototype_;
};
} // namespace rtt_typekit_generator
#endif // RTT_TYPEKIT_GENERATOR_ARCHIVE_H
| [
"johannes@intermodalics.eu"
] | johannes@intermodalics.eu |
d6ebf8877a4338b56848fea3ae6cdde41e8ae03b | c74bb5cb747d86fbac6fc98efb61313c5a7e5fa2 | /Interview-Question-Practice/Remove_Duplicates_From_LL.cpp | c5e997288b3fdd64c81d0a5219f2114d158056ca | [] | no_license | myTeemous/Interview-Question-Practice | 6c56bf494fe1ca8e09faac79725ebbe94fc5fea8 | 547eaab2879b7d37f456521e5012c79ae2042b77 | refs/heads/master | 2020-04-17T17:20:01.720918 | 2019-01-28T08:38:36 | 2019-01-28T08:38:36 | 166,778,156 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,232 | cpp | #include <iostream>
#include <set>
#include <list>
using namespace std;
/*
Remove all duplicates from a Linked list
------------------------------------------
The solution below iterates through the list inserting each element into a hash set.
The set does not allow duplicates so if the insertion fails then that means that element
has already appeared in the list and needs to be removed.
------------------------------------------
O(n) time
O(n) space
*/
int main() {
set<char> charSet; //hash set of chars, no duplicates allowed
list<char> str({ 'a', 'a', 'b', 'b', 'b', 'c', 'd', 'e', 'e', 'f', 'g', 'h', 'h' }); //linked list of chars
auto listItr = str.begin(); //iterator pointing to the beginning of str
while (listItr != str.end()) {
auto setItr = charSet.insert(*listItr); //insert the current element into the set
if (setItr.second == false) { //if insertion fails delete the current node and increment the iterator
auto duplicate = listItr;
++listItr;
str.erase(duplicate);
}
else //insertion succeeded increment the iterator
++listItr;
}
for (auto itr = str.begin(); itr != str.end(); ++itr) //print the list
cout << *itr << " ";
cout << "\n\n";
cin.get();
return 0;
} | [
"kjhsfjk@yahoo.com"
] | kjhsfjk@yahoo.com |
ecfe38d485a780f7c23f284fb997875bb05cd260 | 8c7986f73d4c163e30166aa3000a1a6700d54b05 | /device/oneplus/sm8250-common/livedisplay/service.cpp | 437d7657c048ad1a426e46549bebb39f79f377ac | [] | no_license | tongchen126/pe_oneplus_lemonades | 5cc3867d6f34e533055c93e830715b0fa665f5b9 | 743740a1c5524bf0da9f6f60a61b3b589d24df80 | refs/heads/main | 2023-06-10T12:58:45.894019 | 2021-07-01T04:53:00 | 2021-07-01T04:53:00 | 381,913,093 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,009 | cpp | /*
* Copyright (C) 2019 The LineageOS Project
*
* 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.
*/
#define LOG_TAG "vendor.lineage.livedisplay@2.1-service.oneplus_kona"
#include <android-base/logging.h>
#include <binder/ProcessState.h>
#include <hidl/HidlTransportSupport.h>
#include <livedisplay/sdm/PictureAdjustment.h>
#include <vendor/lineage/livedisplay/2.1/IPictureAdjustment.h>
#include "AntiFlicker.h"
#include "SunlightEnhancement.h"
using android::OK;
using android::sp;
using android::status_t;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment;
using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
using ::vendor::lineage::livedisplay::V2_1::IAntiFlicker;
using ::vendor::lineage::livedisplay::V2_1::IPictureAdjustment;
using ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement;
using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker;
using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
int main() {
status_t status = OK;
android::ProcessState::initWithDriver("/dev/vndbinder");
LOG(INFO) << "LiveDisplay HAL service is starting.";
std::shared_ptr<SDMController> controller = std::make_shared<SDMController>();
sp<AntiFlicker> af = new AntiFlicker();
sp<PictureAdjustment> pa = new PictureAdjustment(controller);
sp<SunlightEnhancement> se = new SunlightEnhancement();
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = af->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL AntiFlicker Iface ("
<< status << ")";
goto shutdown;
}
status = pa->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL PictureAdjustment Iface ("
<< status << ")";
goto shutdown;
}
status = se->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "LiveDisplay HAL service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "LiveDisplay HAL service is shutting down.";
return 1;
}
| [
"374996900@qq.com"
] | 374996900@qq.com |
e753f835339bb745004ab064b202f015bd620d22 | 4612405d3c8fd20b6434c39ca0dc18ca98e48556 | /wordcount.cpp | 819bfd203e886228a36ec13d25fcc5af276ff602 | [] | no_license | pkoppise/CPP104USC | bda235a0554a91e5479f65cdd13a6736afc8ec76 | 9100ebb29673284001f0bde540444521d487d671 | refs/heads/master | 2021-08-24T05:56:49.607072 | 2017-12-08T09:23:14 | 2017-12-08T09:23:14 | 110,516,403 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 245 | cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
using namespace std;
/*
int main() {
string word;
int cnt = 0;
while(cin >> word) {
cnt++;
}
// print word count
cout << cnt << endl;
}*/
| [
"phanendra.koppisetti@soctronics.com"
] | phanendra.koppisetti@soctronics.com |
b1783edb1009d458b91793999924f7437666b1c4 | 5b120c8301d0041cdc22e1d6ca5cc189e97013dc | /C++/25.访问者模式/Monitor.h | e9cef7415d68cf62f2e3372f62ff88ed408ee3a7 | [] | no_license | skyformat99/DesignPattern-1 | e6d47865291772f4d2aed7e92f706843bb2d7b38 | abfd98c8d61bd7fd885b69ffaad1ae04bbcd4c5a | refs/heads/master | 2022-12-05T03:10:07.087734 | 2020-08-28T05:00:59 | 2020-08-28T05:00:59 | 291,940,605 | 1 | 0 | null | 2020-09-01T08:26:00 | 2020-09-01T08:25:59 | null | UTF-8 | C++ | false | false | 488 | h | /**
* @file Monitor.h
* @author {Layne} ({shu_huanglei@163.com})
* @brief
* @version 0.1
* @date 2019-11-29
*
* @copyright Copyright (c) 2019
*
*/
#ifndef MONITOR_H_
#define MONITOR_H_
#include "ComputerPart.h"
class Monitor : public ComputerPart, public std::enable_shared_from_this<Monitor> {
public:
Monitor() = default;
virtual ~Monitor() = default;
void Accept(std::shared_ptr<ComputerPartVisitor> computer_part_visitor) override;
};
#endif // MONITOR_H_
| [
"shu_huanglei@163.com"
] | shu_huanglei@163.com |
bfcbd1e461f629bf158ce2df788c20c09a967bba | c4692fbdc122876043a060756aa9ef61e563fca1 | /proper/abi/include/stdimpl/member_check.h | fa13b75b5bcb38debf77c96f5a628cb7cb8cad5d | [] | no_license | nahratzah/ilias_os | 837b8eabe3d638767d552206b5c2691a176069fa | a63c03a36e656cee1b897eb952a39bccc2616406 | refs/heads/master | 2021-01-23T13:43:55.103755 | 2015-06-11T07:37:01 | 2015-06-11T07:37:01 | 28,526,656 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,888 | h | #ifndef _STDIMPL_MEMBER_CHECK_H_
#define _STDIMPL_MEMBER_CHECK_H_
#include <cdecl.h>
#include <type_traits>
#include <utility>
_namespace_begin(std)
namespace impl {
template<typename... Args> struct _function_check_args;
#define _MEMBER_CHECK(member) \
template<typename T, typename = int> \
struct _member_check_##member##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename T> \
struct _member_check_##member##_impl< \
T, decltype(::_namespace(std)::declval<T>().member, 0)> \
: ::_namespace(std)::true_type {}; \
\
template<typename T> using member_check_##member = \
typename _member_check_##member##_impl<T>::type
#define _MEMBER_TYPE_CHECK(member) \
template<typename T, typename V = void> \
struct _member_type_check_##member##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename T> \
struct _member_type_check_##member##_impl<T, \
::_namespace(std)::conditional_t< \
::_namespace(std)::is_void<typename T::member>::value, \
void, void>> \
: ::_namespace(std)::true_type { \
}; \
\
template<typename T> using member_type_check_##member = \
typename _member_type_check_##member##_impl<T>::type
#define _STATIC_MEMBER_CHECK(member) \
template<typename T, typename = int> \
struct _static_member_check_##member##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename T> \
struct _static_member_check_##member##_impl< \
T, decltype(T::member, 0)> \
: ::_namespace(std)::true_type {}; \
\
template<typename T> using static_member_check_##member = \
typename _static_member_check_##member##_impl<T>::type
#define _FUNCTION_CHECK(function) \
template<typename Args, typename = int> \
struct _function_check_##function##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename... Args> \
struct _function_check_##function##_impl< \
::_namespace(std)::impl::_function_check_args<Args...>, \
decltype(function(declval<Args>()...), 0)> \
: ::_namespace(std)::true_type {}; \
\
template<typename... Args> using function_check_##function = \
typename _function_check_##function##_impl< \
::_namespace(std)::impl::_function_check_args<Args...>>::type
#define _MEMBER_FUNCTION_CHECK(function) \
template<typename T, typename Args, typename = int> \
struct _member_function_check_##function##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename T, typename... Args> \
struct _member_function_check_##function##_impl< \
T, \
::_namespace(std)::impl::_function_check_args<Args...>, \
decltype(::_namespace(std)::declval<T>().function( \
declval<Args>()...), 0)> \
: ::_namespace(std)::true_type {}; \
\
template<typename T, typename... Args> \
using member_function_check_##function = \
typename _member_function_check_##function##_impl< \
T, \
::_namespace(std)::impl::_function_check_args<Args...>>::type
#define _STATIC_MEMBER_FUNCTION_CHECK(function) \
template<typename T, typename Args, typename = int> \
struct _static_member_function_check_##function##_impl \
: ::_namespace(std)::false_type {}; \
\
template<typename T, typename... Args> \
struct _static_member_function_check_##function##_impl< \
T, \
::_namespace(std)::impl::_function_check_args<Args...>, \
decltype(T::function(declval<Args>()...), 0)> \
: ::_namespace(std)::true_type {}; \
\
template<typename T, typename... Args> \
using static_member_function_check_##function = \
typename _static_member_function_check_##function##_impl< \
T, \
::_namespace(std)::impl::_function_check_args<Args...>>::type
_MEMBER_CHECK(member);
_MEMBER_TYPE_CHECK(type);
_STATIC_MEMBER_CHECK(static_member);
_FUNCTION_CHECK(function);
_MEMBER_FUNCTION_CHECK(member_function);
_STATIC_MEMBER_FUNCTION_CHECK(static_member_function);
struct yes_t {
int member;
using type = int;
static int static_member;
int member_function();
static int static_member_function();
};
struct no_t {};
void function(yes_t);
static_assert(member_check_member<yes_t>::value,
"_MEMBER_CHECK macro failure");
static_assert(!member_check_member<no_t>::value,
"_MEMBER_CHECK macro failure");
static_assert(member_type_check_type<yes_t>::value,
"_MEMBER_TYPE_CHECK macro failure");
static_assert(!member_type_check_type<no_t>::value,
"_MEMBER_TYPE_CHECK macro failure");
static_assert(static_member_check_static_member<yes_t>::value,
"_STATIC_MEMBER_CHECK macro failure");
static_assert(!static_member_check_static_member<no_t>::value,
"_STATIC_MEMBER_CHECK macro failure");
static_assert(function_check_function<yes_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<no_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<yes_t*>::value,
"_FUNCTION_CHECK macro failure");
static_assert(function_check_function<const yes_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const no_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const yes_t*>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile yes_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile no_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile yes_t*>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile yes_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile no_t>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile yes_t*>::value,
"_FUNCTION_CHECK macro failure");
static_assert(function_check_function<yes_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<no_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<yes_t*&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(function_check_function<const yes_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const no_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const yes_t*&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile yes_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile no_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<volatile yes_t*&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile yes_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile no_t&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(!function_check_function<const volatile yes_t*&>::value,
"_FUNCTION_CHECK macro failure");
static_assert(member_function_check_member_function<yes_t>::value,
"_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!member_function_check_member_function<yes_t, int>::value,
"_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!member_function_check_member_function<yes_t, int, bool>::value,
"_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!member_function_check_member_function<no_t>::value,
"_MEMBER_FUNCTION_CHECK macro failure");
static_assert(static_member_function_check_static_member_function<yes_t>::value,
"_STATIC_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!static_member_function_check_static_member_function<yes_t, int>::value,
"_STATIC_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!static_member_function_check_static_member_function<yes_t, int,
bool>::value,
"_STATIC_MEMBER_FUNCTION_CHECK macro failure");
static_assert(!static_member_function_check_static_member_function<no_t>::value,
"_STATIC_MEMBER_FUNCTION_CHECK macro failure");
} /* namespace std::impl */
_namespace_end(std)
#endif /* _STDIMPL_MEMBER_CHECK_H_ */
| [
"ariane@stack.nl"
] | ariane@stack.nl |
e4f7f355e8affefc715da9e997d8116359721a7f | 853345c3ee9adeba2157b1805d77dd92049c7d3a | /new 3D/LabProjects/LabProject05/stdafx.h | 689afc5096b88af047ec3590e7259b7336fb291d | [] | no_license | SuperHong94/2020_1_ | 9aea61ae1d3c97201fa0800ecae0acd1179bf93e | 7799b5a3979b63818ba8acc3f23247796189f9c9 | refs/heads/master | 2021-03-17T20:01:14.226581 | 2020-08-20T08:35:36 | 2020-08-20T08:35:36 | 247,012,963 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,381 | h | // header.h: 표준 시스템 포함 파일
// 또는 프로젝트 특정 포함 파일이 들어 있는 포함 파일입니다.
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // 거의 사용되지 않는 내용을 Windows 헤더에서 제외합니다.
// Windows 헤더 파일
#include <windows.h>
// C 런타임 헤더 파일입니다.
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <string>
#include <wrl.h>
#include <shellapi.h>
#include <d3d12.h>
#include <dxgi1_4.h>
#include <d3Dcompiler.h>
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
#include <DirectXColors.h>
#include <DirectXCollision.h>
#include <dxgidebug.h>
#include <mmsystem.h>//시간
#include <iostream>
using namespace DirectX;
using namespace DirectX::PackedVector;
using Microsoft::WRL::ComPtr;
//임포트 라이브러리 추가
#pragma comment(lib,"d3dcompiler.lib")
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "winmm.lib") //시간
//#pragma comment(linker, "/entry:wWinMainCRTStartup /subsystem:console") //콘솔창에서 찍어보기위해서 설정
//윈도우 크기 설정
#define FRAME_BUFFER_WIDTH 800
#define FRAME_BUFFER_HEIGHT 600
//#define _WITH_SWAPCHAIN_FULLSCREEN_STATE //설정하면 처음부터 전체화면 | [
"50072558+SuperHong94@users.noreply.github.com"
] | 50072558+SuperHong94@users.noreply.github.com |
3f89a3f52769c410f82c3006ead5cd8ed6e34ed8 | ca32dbe9e01354dbab50e0c7c52ff046d0805078 | /PricerCpp/pricer/external/nr3.h | 2e5fa4423154ef2bfd16d241b990524846bb6de2 | [] | no_license | Squallhosika/pricerlib | fda0b331fa1db4f948df7b3b4b546c1bf86cd0dc | e8b68c416cbb558365c50c86172550bed25ec9a3 | refs/heads/master | 2020-06-19T19:49:42.672746 | 2017-11-25T09:23:43 | 2017-11-25T09:23:43 | 74,837,146 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,508 | h | #ifndef _NR3_H_
#define _NR3_H_
//#define _CHECKBOUNDS_ 1
//#define _USESTDVECTOR_ 1
//#define _USENRERRORCLASS_ 1
//#define _TURNONFPES_ 1
// all the system #include's we'll ever need
#include <fstream>
#include <cmath>
#include <complex>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
using namespace std;
// macro-like inline functions
template<class T>
inline T SQR(const T a) { return a*a; }
template<class T>
inline const T &MAX(const T &a, const T &b)
{
return b > a ? (b) : (a);
}
inline float MAX(const double &a, const float &b)
{
return b > a ? (b) : float(a);
}
inline float MAX(const float &a, const double &b)
{
return b > a ? float(b) : (a);
}
template<class T>
inline const T &MIN(const T &a, const T &b)
{
return b < a ? (b) : (a);
}
inline float MIN(const double &a, const float &b)
{
return b < a ? (b) : float(a);
}
inline float MIN(const float &a, const double &b)
{
return b < a ? float(b) : (a);
}
template<class T>
inline T SIGN(const T &a, const T &b)
{
return b >= 0 ? (a >= 0 ? a : -a) : (a >= 0 ? -a : a);
}
inline float SIGN(const float &a, const double &b)
{
return b >= 0 ? (a >= 0 ? a : -a) : (a >= 0 ? -a : a);
}
inline float SIGN(const double &a, const float &b)
{
return (float)(b >= 0 ? (a >= 0 ? a : -a) : (a >= 0 ? -a : a));
}
template<class T>
inline void SWAP(T &a, T &b)
{
T dum = a; a = b; b = dum;
}
// exception handling
#ifndef _USENRERRORCLASS_
#define throw(message) \
{printf("ERROR: %s\n in file %s at line %d\n", message, __FILE__, __LINE__); throw(1); }
#else
struct NRerror {
char *message;
char *file;
int line;
NRerror(char *m, char *f, int l) : message(m), file(f), line(l) {}
};
#define throw(message) throw(NRerror(message,__FILE__,__LINE__));
void NRcatch(NRerror err) {
printf("ERROR: %s\n in file %s at line %d\n",
err.message, err.file, err.line);
exit(1);
}
#endif
// usage example:
//
// try {
// somebadroutine();
// }
// catch(NRerror s) {NRcatch(s);}
//
// (You can of course substitute any other catch body for NRcatch(s).)
// Vector and Matrix Classes
#ifdef _USESTDVECTOR_
#define NRvector vector
#else
template <class T>
class NRvector {
private:
int nn; // size of array. upper index is nn-1
T *v;
public:
NRvector();
explicit NRvector(int n); // Zero-based array
NRvector(int n, const T &a); //initialize to constant value
NRvector(int n, const T *a); // Initialize to array
NRvector(const NRvector &rhs); // Copy constructor
NRvector & operator=(const NRvector &rhs); //assignment
typedef T value_type; // make T available externally
inline T & operator[](const int i); //i'th element
inline const T & operator[](const int i) const;
inline int size() const;
void resize(int newn); // resize (contents not preserved)
void assign(int newn, const T &a); // resize and assign a constant value
~NRvector();
};
// NRvector definitions
template <class T>
NRvector<T>::NRvector() : nn(0), v(NULL) {}
template <class T>
NRvector<T>::NRvector(int n) : nn(n), v(n>0 ? new T[n] : NULL) {}
template <class T>
NRvector<T>::NRvector(int n, const T& a) : nn(n), v(n>0 ? new T[n] : NULL)
{
for (int i = 0; i<n; i++) v[i] = a;
}
template <class T>
NRvector<T>::NRvector(int n, const T *a) : nn(n), v(n>0 ? new T[n] : NULL)
{
for (int i = 0; i<n; i++) v[i] = *a++;
}
template <class T>
NRvector<T>::NRvector(const NRvector<T> &rhs) : nn(rhs.nn), v(nn>0 ? new T[nn] : NULL)
{
for (int i = 0; i<nn; i++) v[i] = rhs[i];
}
template <class T>
NRvector<T> & NRvector<T>::operator=(const NRvector<T> &rhs)
// postcondition: normal assignment via copying has been performed;
// if vector and rhs were different sizes, vector
// has been resized to match the size of rhs
{
if (this != &rhs)
{
if (nn != rhs.nn) {
if (v != NULL) delete[](v);
nn = rhs.nn;
v = nn>0 ? new T[nn] : NULL;
}
for (int i = 0; i<nn; i++)
v[i] = rhs[i];
}
return *this;
}
template <class T>
inline T & NRvector<T>::operator[](const int i) //subscripting
{
#ifdef _CHECKBOUNDS_
if (i<0 || i >= nn) {
throw("NRvector subscript out of bounds");
}
#endif
return v[i];
}
template <class T>
inline const T & NRvector<T>::operator[](const int i) const //subscripting
{
#ifdef _CHECKBOUNDS_
if (i<0 || i >= nn) {
throw("NRvector subscript out of bounds");
}
#endif
return v[i];
}
template <class T>
inline int NRvector<T>::size() const
{
return nn;
}
template <class T>
void NRvector<T>::resize(int newn)
{
if (newn != nn) {
if (v != NULL) delete[](v);
nn = newn;
v = nn > 0 ? new T[nn] : NULL;
}
}
template <class T>
void NRvector<T>::assign(int newn, const T& a)
{
if (newn != nn) {
if (v != NULL) delete[](v);
nn = newn;
v = nn > 0 ? new T[nn] : NULL;
}
for (int i = 0; i<nn; i++) v[i] = a;
}
template <class T>
NRvector<T>::~NRvector()
{
if (v != NULL) delete[](v);
}
// end of NRvector definitions
#endif //ifdef _USESTDVECTOR_
template <class T>
class NRmatrix {
private:
int nn;
int mm;
T **v;
public:
NRmatrix();
NRmatrix(int n, int m); // Zero-based array
NRmatrix(int n, int m, const T &a); //Initialize to constant
NRmatrix(int n, int m, const T *a); // Initialize to array
NRmatrix(const NRmatrix &rhs); // Copy constructor
NRmatrix & operator=(const NRmatrix &rhs); //assignment
typedef T value_type; // make T available externally
inline T* operator[](const int i); //subscripting: pointer to row i
inline const T* operator[](const int i) const;
inline int nrows() const;
inline int ncols() const;
void resize(int newn, int newm); // resize (contents not preserved)
void assign(int newn, int newm, const T &a); // resize and assign a constant value
~NRmatrix();
};
template <class T>
NRmatrix<T>::NRmatrix() : nn(0), mm(0), v(NULL) {}
template <class T>
NRmatrix<T>::NRmatrix(int n, int m) : nn(n), mm(m), v(n>0 ? new T*[n] : NULL)
{
int i, nel = m*n;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i<n; i++) v[i] = v[i - 1] + m;
}
template <class T>
NRmatrix<T>::NRmatrix(int n, int m, const T &a) : nn(n), mm(m), v(n>0 ? new T*[n] : NULL)
{
int i, j, nel = m*n;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< n; i++) v[i] = v[i - 1] + m;
for (i = 0; i< n; i++) for (j = 0; j<m; j++) v[i][j] = a;
}
template <class T>
NRmatrix<T>::NRmatrix(int n, int m, const T *a) : nn(n), mm(m), v(n>0 ? new T*[n] : NULL)
{
int i, j, nel = m*n;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< n; i++) v[i] = v[i - 1] + m;
for (i = 0; i< n; i++) for (j = 0; j<m; j++) v[i][j] = *a++;
}
template <class T>
NRmatrix<T>::NRmatrix(const NRmatrix &rhs) : nn(rhs.nn), mm(rhs.mm), v(nn>0 ? new T*[nn] : NULL)
{
int i, j, nel = mm*nn;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< nn; i++) v[i] = v[i - 1] + mm;
for (i = 0; i< nn; i++) for (j = 0; j<mm; j++) v[i][j] = rhs[i][j];
}
template <class T>
NRmatrix<T> & NRmatrix<T>::operator=(const NRmatrix<T> &rhs)
// postcondition: normal assignment via copying has been performed;
// if matrix and rhs were different sizes, matrix
// has been resized to match the size of rhs
{
if (this != &rhs) {
int i, j, nel;
if (nn != rhs.nn || mm != rhs.mm) {
if (v != NULL) {
delete[](v[0]);
delete[](v);
}
nn = rhs.nn;
mm = rhs.mm;
v = nn>0 ? new T*[nn] : NULL;
nel = mm*nn;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< nn; i++) v[i] = v[i - 1] + mm;
}
for (i = 0; i< nn; i++) for (j = 0; j<mm; j++) v[i][j] = rhs[i][j];
}
return *this;
}
template <class T>
inline T* NRmatrix<T>::operator[](const int i) //subscripting: pointer to row i
{
#ifdef _CHECKBOUNDS_
if (i<0 || i >= nn) {
throw("NRmatrix subscript out of bounds");
}
#endif
return v[i];
}
template <class T>
inline const T* NRmatrix<T>::operator[](const int i) const
{
#ifdef _CHECKBOUNDS_
if (i<0 || i >= nn) {
throw("NRmatrix subscript out of bounds");
}
#endif
return v[i];
}
template <class T>
inline int NRmatrix<T>::nrows() const
{
return nn;
}
template <class T>
inline int NRmatrix<T>::ncols() const
{
return mm;
}
template <class T>
void NRmatrix<T>::resize(int newn, int newm)
{
int i, nel;
if (newn != nn || newm != mm) {
if (v != NULL) {
delete[](v[0]);
delete[](v);
}
nn = newn;
mm = newm;
v = nn>0 ? new T*[nn] : NULL;
nel = mm*nn;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< nn; i++) v[i] = v[i - 1] + mm;
}
}
template <class T>
void NRmatrix<T>::assign(int newn, int newm, const T& a)
{
int i, j, nel;
if (newn != nn || newm != mm) {
if (v != NULL) {
delete[](v[0]);
delete[](v);
}
nn = newn;
mm = newm;
v = nn>0 ? new T*[nn] : NULL;
nel = mm*nn;
if (v) v[0] = nel>0 ? new T[nel] : NULL;
for (i = 1; i< nn; i++) v[i] = v[i - 1] + mm;
}
for (i = 0; i< nn; i++) for (j = 0; j<mm; j++) v[i][j] = a;
}
template <class T>
NRmatrix<T>::~NRmatrix()
{
if (v != NULL) {
delete[](v[0]);
delete[](v);
}
}
template <class T>
class NRMat3d {
private:
int nn;
int mm;
int kk;
T ***v;
public:
NRMat3d();
NRMat3d(int n, int m, int k);
inline T** operator[](const int i); //subscripting: pointer to row i
inline const T* const * operator[](const int i) const;
inline int dim1() const;
inline int dim2() const;
inline int dim3() const;
~NRMat3d();
};
template <class T>
NRMat3d<T>::NRMat3d() : nn(0), mm(0), kk(0), v(NULL) {}
template <class T>
NRMat3d<T>::NRMat3d(int n, int m, int k) : nn(n), mm(m), kk(k), v(new T**[n])
{
int i, j;
v[0] = new T*[n*m];
v[0][0] = new T[n*m*k];
for (j = 1; j<m; j++) v[0][j] = v[0][j - 1] + k;
for (i = 1; i<n; i++) {
v[i] = v[i - 1] + m;
v[i][0] = v[i - 1][0] + m*k;
for (j = 1; j<m; j++) v[i][j] = v[i][j - 1] + k;
}
}
template <class T>
inline T** NRMat3d<T>::operator[](const int i) //subscripting: pointer to row i
{
return v[i];
}
template <class T>
inline const T* const * NRMat3d<T>::operator[](const int i) const
{
return v[i];
}
template <class T>
inline int NRMat3d<T>::dim1() const
{
return nn;
}
template <class T>
inline int NRMat3d<T>::dim2() const
{
return mm;
}
template <class T>
inline int NRMat3d<T>::dim3() const
{
return kk;
}
template <class T>
NRMat3d<T>::~NRMat3d()
{
if (v != NULL) {
delete[](v[0][0]);
delete[](v[0]);
delete[](v);
}
}
// basic type names (redefine if your bit lengths don't match)
typedef int Int; // 32 bit integer
typedef unsigned int Uint;
#ifdef _MSC_VER
typedef __int64 Llong; // 64 bit integer
typedef unsigned __int64 Ullong;
#else
typedef long long int Llong; // 64 bit integer
typedef unsigned long long int Ullong;
#endif
typedef char Char; // 8 bit integer
typedef unsigned char Uchar;
typedef double Doub; // default floating type
typedef long double Ldoub;
typedef complex<double> Complex; // default complex type
typedef bool Bool;
// NaN: uncomment one of the following 3 methods of defining a global NaN
// you can test by verifying that (NaN != NaN) is true
static const Doub NaN = numeric_limits<Doub>::quiet_NaN();
//Uint proto_nan[2]={0xffffffff, 0x7fffffff};
//double NaN = *( double* )proto_nan;
//Doub NaN = sqrt(-1.);
// vector types
typedef const NRvector<Int> VecInt_I;
typedef NRvector<Int> VecInt, VecInt_O, VecInt_IO;
typedef const NRvector<Uint> VecUint_I;
typedef NRvector<Uint> VecUint, VecUint_O, VecUint_IO;
typedef const NRvector<Llong> VecLlong_I;
typedef NRvector<Llong> VecLlong, VecLlong_O, VecLlong_IO;
typedef const NRvector<Ullong> VecUllong_I;
typedef NRvector<Ullong> VecUllong, VecUllong_O, VecUllong_IO;
typedef const NRvector<Char> VecChar_I;
typedef NRvector<Char> VecChar, VecChar_O, VecChar_IO;
typedef const NRvector<Char*> VecCharp_I;
typedef NRvector<Char*> VecCharp, VecCharp_O, VecCharp_IO;
typedef const NRvector<Uchar> VecUchar_I;
typedef NRvector<Uchar> VecUchar, VecUchar_O, VecUchar_IO;
typedef const NRvector<Doub> VecDoub_I;
typedef NRvector<Doub> VecDoub, VecDoub_O, VecDoub_IO;
typedef const NRvector<Doub*> VecDoubp_I;
typedef NRvector<Doub*> VecDoubp, VecDoubp_O, VecDoubp_IO;
typedef const NRvector<Complex> VecComplex_I;
typedef NRvector<Complex> VecComplex, VecComplex_O, VecComplex_IO;
typedef const NRvector<Bool> VecBool_I;
typedef NRvector<Bool> VecBool, VecBool_O, VecBool_IO;
// matrix types
typedef const NRmatrix<Int> MatInt_I;
typedef NRmatrix<Int> MatInt, MatInt_O, MatInt_IO;
typedef const NRmatrix<Uint> MatUint_I;
typedef NRmatrix<Uint> MatUint, MatUint_O, MatUint_IO;
typedef const NRmatrix<Llong> MatLlong_I;
typedef NRmatrix<Llong> MatLlong, MatLlong_O, MatLlong_IO;
typedef const NRmatrix<Ullong> MatUllong_I;
typedef NRmatrix<Ullong> MatUllong, MatUllong_O, MatUllong_IO;
typedef const NRmatrix<Char> MatChar_I;
typedef NRmatrix<Char> MatChar, MatChar_O, MatChar_IO;
typedef const NRmatrix<Uchar> MatUchar_I;
typedef NRmatrix<Uchar> MatUchar, MatUchar_O, MatUchar_IO;
typedef const NRmatrix<Doub> MatDoub_I;
typedef NRmatrix<Doub> MatDoub, MatDoub_O, MatDoub_IO;
typedef const NRmatrix<Bool> MatBool_I;
typedef NRmatrix<Bool> MatBool, MatBool_O, MatBool_IO;
// 3D matrix types
typedef const NRMat3d<Doub> Mat3DDoub_I;
typedef NRMat3d<Doub> Mat3DDoub, Mat3DDoub_O, Mat3DDoub_IO;
// Floating Point Exceptions for Microsoft compilers
#ifdef _TURNONFPES_
#ifdef _MSC_VER
struct turn_on_floating_exceptions {
turn_on_floating_exceptions() {
int cw = _controlfp(0, 0);
cw &= ~(EM_INVALID | EM_OVERFLOW | EM_ZERODIVIDE);
_controlfp(cw, MCW_EM);
}
};
turn_on_floating_exceptions yes_turn_on_floating_exceptions;
#endif /* _MSC_VER */
#endif /* _TURNONFPES */
#endif /* _NR3_H_ */
| [
"jonathan.lerch@gmail.com"
] | jonathan.lerch@gmail.com |
731f0d5fe51dff8f3a8789d798381c95d2e49ec4 | 791e5e75ffd4c0e1b7a894297391248aa421d16d | /BinaryTrees/iterative_preorder.cpp | 7c3e461858232e848fdbced9e2a905e24fd36769 | [] | no_license | ajayrajsrivastava/GeeksPractice | 079099e6b22ab1320cf7c8fd286bc9bfd9ccce1e | e577300f6bc8f0bde8ce55547ea4295e47538c73 | refs/heads/master | 2021-08-17T04:10:12.443079 | 2017-11-21T00:16:33 | 2017-11-21T00:16:33 | 111,455,832 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,035 | cpp | #include<iostream>
#include<stack>
using namespace std;
//Idea is to use an explicit stack
//Push right child then left child of popped item until stack is not empty
struct Node{
int data;
Node *left = NULL;
Node *right = NULL;
Node( int data ) {
this -> data = data;
}
};
void iterativePreorder( Node *root ) {
if( root == NULL )
return ;
stack < Node * > nodeStack;
nodeStack.push ( root ) ;
while( ! nodeStack.empty() ) {
Node *temp = nodeStack.top();
cout << temp -> data << " ";
nodeStack.pop();
if( temp -> right != NULL )
nodeStack.push ( temp -> right );
if( temp -> left != NULL )
nodeStack.push ( temp -> left );
}
}
int main() {
Node *root = new Node(10);
root->left = new Node(8);
root->right = new Node(2);
root->left->left = new Node(3);
root->left->right = new Node(5);
root->right->left = new Node(2);
iterativePreorder(root);
return 0;
}
| [
"ajayisready@gmail.com"
] | ajayisready@gmail.com |
c2b4136236805e563a4116eb9e9bd54c30659112 | d19d5f5f2f7e44884932aa087c63a549f53f0907 | /SwingEngine/SEGeometricTools/Distance/SEDistVector3Segment3.cpp | 1c9459a648d6313b50b7df394eafd4b1c2ef1933 | [] | no_license | jazzboysc/SwingEngine2 | d26c60f4cbf89f0d7207e5152cae69677a4d7b18 | d7dbd09a5e7748def0bd3fa6a547b1c734529f61 | refs/heads/master | 2021-03-27T11:05:20.543758 | 2018-07-13T09:42:22 | 2018-07-13T09:42:22 | 44,491,987 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,647 | cpp | // Swing Engine Version 2 Source Code
// Most of techniques in the engine are mainly based on David Eberly's
// Wild Magic 4 and 5 open-source game engine. The author of Swing Engine
// learned a lot from Eberly's experience of architecture and algorithm.
// Several subsystems are totally new, and others are reorganized or
// reimplimented based on Wild Magic's subsystems.
// Copyright (c) 2007-2011
//
// David Eberly's permission:
// Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
#include "SEGeometricToolsPCH.h"
#include "SEDistVector3Segment3.h"
using namespace Swing;
//----------------------------------------------------------------------------
SEDistVector3Segment3f::SEDistVector3Segment3f(const SEVector3f& rVector,
const SESegment3f& rSegment)
:
m_pVector(&rVector),
m_pSegment(&rSegment)
{
}
//----------------------------------------------------------------------------
const SEVector3f& SEDistVector3Segment3f::GetVector() const
{
return *m_pVector;
}
//----------------------------------------------------------------------------
const SESegment3f& SEDistVector3Segment3f::GetSegment() const
{
return *m_pSegment;
}
//----------------------------------------------------------------------------
float SEDistVector3Segment3f::Get()
{
float fSqrDist = GetSquared();
return SEMath<float>::Sqrt(fSqrDist);
}
//----------------------------------------------------------------------------
float SEDistVector3Segment3f::GetSquared()
{
SEVector3f vec3fDiff = *m_pVector - m_pSegment->Origin;
m_fSegmentParameter = m_pSegment->Direction.Dot(vec3fDiff);
if( -m_pSegment->Extent < m_fSegmentParameter )
{
if( m_fSegmentParameter < m_pSegment->Extent )
{
m_ClosestPoint1 = m_pSegment->Origin +
m_fSegmentParameter*m_pSegment->Direction;
}
else
{
m_ClosestPoint1 = m_pSegment->Origin +
m_pSegment->Extent*m_pSegment->Direction;
}
}
else
{
m_ClosestPoint1 = m_pSegment->Origin -
m_pSegment->Extent*m_pSegment->Direction;
}
m_ClosestPoint0 = *m_pVector;
vec3fDiff = m_ClosestPoint1 - m_ClosestPoint0;
return vec3fDiff.GetSquaredLength();
}
//----------------------------------------------------------------------------
float SEDistVector3Segment3f::Get(float fT, const SEVector3f& rVelocity0,
const SEVector3f& rVelocity1)
{
SEVector3f vec3fMVector = *m_pVector + fT*rVelocity0;
SEVector3f vec3fMOrigin = m_pSegment->Origin + fT*rVelocity1;
SESegment3f tempMSegment(vec3fMOrigin, m_pSegment->Direction,
m_pSegment->Extent);
return SEDistVector3Segment3f(vec3fMVector, tempMSegment).Get();
}
//----------------------------------------------------------------------------
float SEDistVector3Segment3f::GetSquared(float fT, const SEVector3f&
rVelocity0, const SEVector3f& rVelocity1)
{
SEVector3f vec3fMVector = *m_pVector + fT*rVelocity0;
SEVector3f vec3fMOrigin = m_pSegment->Origin + fT*rVelocity1;
SESegment3f tempMSegment(vec3fMOrigin, m_pSegment->Direction,
m_pSegment->Extent);
return SEDistVector3Segment3f(vec3fMVector, tempMSegment).GetSquared();
}
//----------------------------------------------------------------------------
float SEDistVector3Segment3f::GetSegmentParameter() const
{
return m_fSegmentParameter;
}
//----------------------------------------------------------------------------
| [
"S515380c"
] | S515380c |
ce656b88ffe84605889b026031a4da65c8a5553f | c424714fdd5bd34c4dcd1977cb6814cbdeba9a7a | /src/core/device.h | 1a7032d8ed7f9407399b0a2b89b3993c0b155684 | [] | no_license | johndpope/LuisaRender | ea5d1b3678ee4aaf4b1202101c2ce258eca1acda | 7d6bb74a2174c8975c1d0757098a605ba5f8a2d5 | refs/heads/master | 2020-09-04T05:38:48.322807 | 2019-11-04T17:45:34 | 2019-11-04T17:45:34 | 219,668,898 | 1 | 0 | null | 2019-11-05T05:58:45 | 2019-11-05T05:58:44 | null | UTF-8 | C++ | false | false | 2,843 | h | //
// Created by Mike Smith on 2019/10/24.
//
#pragma once
#include <memory>
#include <filesystem>
#include <unordered_map>
#include <functional>
#include <utility>
#include <iostream>
#include <util/exception.h>
#include <util/string_manipulation.h>
#include "mathematics.h"
#include "kernel.h"
#include "texture.h"
#include "acceleration_structure.h"
namespace luisa {
LUISA_MAKE_ERROR_TYPE(DeviceError);
#define THROW_DEVICE_ERROR(...) \
LUISA_THROW_ERROR(DeviceError, __VA_ARGS__)
class Device : util::Noncopyable {
public:
using DeviceCreator = std::function<std::shared_ptr<Device>()>;
private:
inline static std::unordered_map<std::string_view, DeviceCreator> _device_creators{};
protected:
static void _register_creator(std::string_view name, DeviceCreator creator) noexcept {
assert(_device_creators.find(name) == _device_creators.end());
_device_creators[name] = std::move(creator);
}
public:
~Device() noexcept = default;
[[nodiscard]] static std::shared_ptr<Device> create(std::string_view name) {
auto iter = _device_creators.find(name);
if (iter == _device_creators.end()) {
THROW_DEVICE_ERROR("unregistered device type \"", name, "\".");
}
return _device_creators.at(name)();
}
[[nodiscard]] virtual std::shared_ptr<Kernel> create_kernel(std::string_view function_name) = 0;
[[nodiscard]] virtual std::shared_ptr<Texture> create_texture(math::uint2 size, TextureFormatTag format_tag, TextureAccessTag access_tag) = 0;
[[nodiscard]] virtual std::shared_ptr<Buffer> create_buffer(size_t capacity, BufferStorageTag storage) = 0;
[[nodiscard]] virtual std::shared_ptr<AccelerationStructure> create_acceleration_structure(Buffer &position_buffer, size_t stride, size_t triangle_count) = 0;
virtual void launch(std::function<void(KernelDispatcher &)> dispatch) = 0;
virtual void launch_async(std::function<void(KernelDispatcher &)> dispatch, std::function<void()> callback) = 0;
void launch_async(std::function<void(KernelDispatcher &)> dispatch) { launch_async(std::move(dispatch), [] {}); }
};
}
#define DEVICE_CREATOR(name) \
static_assert(true); \
private: \
inline static struct _reg_helper_impl { \
_reg_helper_impl() noexcept { Device::_register_creator(name, create); } \
} _reg_helper{}; \
public: \
[[nodiscard]] static std::shared_ptr<Device> create()
| [
"mango@live.cn"
] | mango@live.cn |
3691f967b07463d7e8d250f21d31bf9c0f21cbc7 | b1c6fe68b890e3244e3dbbac337908006afd05c2 | /Array_main/Array_main/stdafx.h | c16895d9a06d4a103dc2908fc8622dcabc9cf18c | [] | no_license | AleksandrZhyts/SecondTerm | 6fe7d1d694568d220c80b2bb74cee0c70814d763 | f601383ae804e8d5ff224a39c980e9eef42d5459 | refs/heads/master | 2020-07-02T17:07:37.414840 | 2017-02-26T17:00:11 | 2017-02-26T17:00:11 | 74,293,805 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 256 | h | #pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
// TODO: Установите здесь ссылки на дополнительные заголовки, требующиеся для программы
| [
"alexzhits@bk.ru"
] | alexzhits@bk.ru |
a95d4dfa634f6ea47b324c367ec67cdb15fb615c | 4f18c52668176841beec579e5cea3e1918d3e60b | /main.ino | d1d7cc4f9d61dcb70508bccd335e9d08cc627908 | [] | no_license | yusufsall/SmartHomeArduino | dc43e21a881d5ea3c5f0785dc3ce56910d15d50c | 400f28ab874eef53010d755a15a6d4507ee695f2 | refs/heads/master | 2020-03-30T07:00:44.217948 | 2018-09-29T22:35:17 | 2018-09-29T22:35:17 | 150,908,028 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,008 | ino | #include <Servo.h>
#include <dht11.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#define DHT11PIN 2
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
EthernetUDP Udp;
dht11 Dht11;
Servo servo;
float nem,sicaklik = 0.0f;
bool checkDoor = false;
bool relays[16];
int basePin = 30;
unsigned int localPort = 8888;
char buf[500];
String buff = "";
bool loaded = false;
int index = 0;
bool data = false;
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];
int SizeOfPacket(){
return Udp.parsePacket();
}
String readPacket(int sizepacket)
{
Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
String message = packetBuffer;
return message.substring(0,sizepacket);
}
void sendChars(char* reply)
{
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
Udp.flush();
Udp.write(reply);
Udp.endPacket();
}
void checkRelays(){
for(int i = 0; i < 16; i++)
relays[i] = false;
}
void updateSensors(){
Dht11.read(DHT11PIN);
sicaklik = (float)Dht11.temperature;
nem = (float)Dht11.humidity;
checkDoor = digitalRead(7);
}
String sayStatus(){
updateSensors();
String buf = "";
for(int i = 0; i < 16; i++)
buf += (String(i) + ":" + relays[i] + ":");
buf += ("s:"+ String(sicaklik) + ":");
buf += ("n:"+ String(nem) + ":");
buf += ("d:"+ String(checkDoor) + ":");
return buf;
}
void openTheDoor(){
servo.write(120);
delay(15);
}
void closeTheDoor(){
servo.write(0);
delay(15);
}
void relayOn(){
for(int i = 0; i < 16; i++)
{
if(relays[i])
digitalWrite(basePin + i, LOW);
else
digitalWrite(basePin + i, HIGH);
}
if(relays[14])
openTheDoor();
else
closeTheDoor();
}
void setup() {
Ethernet.begin(mac, ip);
Udp.begin(localPort);
Serial.begin(9600);
servo.attach(3);
checkRelays();
for(int i = 0; i < 16; i++)
pinMode(i + basePin,OUTPUT);
}
void loop() {
int sizepacket = SizeOfPacket();
if (sizepacket != 0) {
String message = readPacket(sizepacket);
if(message == "a")
{
message = sayStatus();
char buf[500];
message.toCharArray(buf,500);
sendChars(buf);
}else{
Serial.println(message);
buff = "";
loaded = false;
index = 0;
data = false;
message.toCharArray(buf,500);
for(int i = 0; i < message.length(); i++)
{
if(buf[i] == ':')
{
if(loaded){
if(buff == "0")
data = false;
else
data = true;
relays[index] = data;
loaded = false;
}
else{
index = buff.toInt();
loaded = true;
}
buff = "";
}
else
{
buff += buf[i];
}
}
}
}else
relayOn();
}
| [
"contact@yusufsal.com"
] | contact@yusufsal.com |
55c20e0cd2145be4694c105888604bffd082c25d | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /chrome/common/extensions/manifest_tests/extension_manifests_ui_unittest.cc | 264eb9d8ce4d49c49037caacb7c11437e87e974d | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | C++ | false | false | 612 | cc | // Copyright (c) 2012 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 "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
class UIManifestTest : public ChromeManifestTest {
};
TEST_F(UIManifestTest, DisallowMultipleUISurfaces) {
LoadAndExpectError("multiple_ui_surfaces.json",
manifest_errors::kOneUISurfaceOnly);
}
} // namespace extensions
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
69497932cc513d4da03e687215fd4d7ea7a9147f | 8947812c9c0be1f0bb6c30d1bb225d4d6aafb488 | /01_Develop/libXMBullet/Source/BulletCollision/CollisionShapes/btBoxShape.cpp | 31b9ee62193419b8be94bf4039ab8f67ebddcf9f | [
"MIT"
] | permissive | alissastanderwick/OpenKODE-Framework | cbb298974e7464d736a21b760c22721281b9c7ec | d4382d781da7f488a0e7667362a89e8e389468dd | refs/heads/master | 2021-10-25T01:33:37.821493 | 2016-07-12T01:29:35 | 2016-07-12T01:29:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,934 | cpp | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "XMBullet/BulletCollision/CollisionShapes/btBoxShape.h"
btBoxShape::btBoxShape( const btVector3& boxHalfExtents)
: btPolyhedralConvexShape()
{
m_shapeType = BOX_SHAPE_PROXYTYPE;
setSafeMargin(boxHalfExtents);
btVector3 margin(getMargin(),getMargin(),getMargin());
m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
};
void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
{
btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
}
void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
{
//btScalar margin = btScalar(0.);
btVector3 halfExtents = getHalfExtentsWithMargin();
btScalar lx=btScalar(2.)*(halfExtents.x());
btScalar ly=btScalar(2.)*(halfExtents.y());
btScalar lz=btScalar(2.)*(halfExtents.z());
inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
mass/(btScalar(12.0)) * (lx*lx + lz*lz),
mass/(btScalar(12.0)) * (lx*lx + ly*ly));
}
| [
"mcodegeeks@gmail.com"
] | mcodegeeks@gmail.com |
2b937f84653d4148ace73de5ab0788cba99791b2 | 3470d71c4817fad946581943d629ac7df5b5702d | /test_examples/arduino/servomotor/servomotor.ino | d7ac907091c01263c2b5812c0edc0d65b92fa950 | [] | no_license | serman/watermachinecontrol | 066b64629a9337bfdcc5a55199ca0d4f993829c9 | 0cf7d9720bee580dd61992f1d09f40db99e67cf5 | refs/heads/master | 2021-01-20T18:28:48.132870 | 2016-07-13T23:20:48 | 2016-07-13T23:20:48 | 62,130,141 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 463 | ino | #include <Servo.h>
int i;
bool up;
Servo myservo; // create servo object to control a servo
void setup() {
// put your setup code here, to run once:
myservo.attach(9);
up=false;
i=0;
}
void loop() {
// put your main code here, to run repeatedly:
if(up==false)
myservo.write(40);
else
myservo.write(90);
if(up==true)
{ i++;
if(i>10) up=false;
}
else{
i--;
if(i<0) up=true;
}
delay(100);
}
| [
"sergio@tinkerista.com"
] | sergio@tinkerista.com |
4d5f98c021b9c125da444ce73ddbead0619ebe35 | ece42d77ca9f1d95f0dc3da06295ce6afddae0a2 | /dire/include/DirePlugins/mg5/Processes_sm/PY8MEs_R6_P99_sm_qq_wpa.cc | 074225e15cf30d50214674b5c89657238cb315f9 | [] | no_license | prestel/hadrotomte | 7d51b6a0cc40af2ddc58cfbe126e46023b416dc3 | c537e56fe4ca8b19413bc7dcc266c1cb9b570f47 | refs/heads/master | 2023-06-30T07:27:54.987000 | 2021-08-03T12:10:56 | 2021-08-03T12:10:56 | 386,714,081 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 31,558 | cc | //==========================================================================
// This file has been automatically generated for Pythia 8 by
// MadGraph5_aMC@NLO v. 2.6.0, 2017-08-16
// By the MadGraph5_aMC@NLO Development Team
// Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch
//==========================================================================
#include "PY8MEs_R6_P99_sm_qq_wpa.h"
#include "HelAmps_sm.h"
using namespace Pythia8_sm;
namespace PY8MEs_namespace
{
//==========================================================================
// Class member functions for calculating the matrix elements for
// Process: u d~ > w+ a WEIGHTED<=99 @6
// Process: c s~ > w+ a WEIGHTED<=99 @6
// Process: d u~ > w- a WEIGHTED<=99 @6
// Process: s c~ > w- a WEIGHTED<=99 @6
// Exception class
class PY8MEs_R6_P99_sm_qq_wpaException : public exception
{
virtual const char * what() const throw()
{
return "Exception in class 'PY8MEs_R6_P99_sm_qq_wpa'.";
}
}
PY8MEs_R6_P99_sm_qq_wpa_exception;
std::set<int> PY8MEs_R6_P99_sm_qq_wpa::s_channel_proc = std::set<int>
(createset<int> ());
int PY8MEs_R6_P99_sm_qq_wpa::helicities[ncomb][nexternal] = {{-1, -1, -1, -1},
{-1, -1, -1, 1}, {-1, -1, 0, -1}, {-1, -1, 0, 1}, {-1, -1, 1, -1}, {-1, -1,
1, 1}, {-1, 1, -1, -1}, {-1, 1, -1, 1}, {-1, 1, 0, -1}, {-1, 1, 0, 1}, {-1,
1, 1, -1}, {-1, 1, 1, 1}, {1, -1, -1, -1}, {1, -1, -1, 1}, {1, -1, 0, -1},
{1, -1, 0, 1}, {1, -1, 1, -1}, {1, -1, 1, 1}, {1, 1, -1, -1}, {1, 1, -1,
1}, {1, 1, 0, -1}, {1, 1, 0, 1}, {1, 1, 1, -1}, {1, 1, 1, 1}};
// Normalization factors the various processes
// Denominators: spins, colors and identical particles
int PY8MEs_R6_P99_sm_qq_wpa::denom_colors[nprocesses] = {9, 9};
int PY8MEs_R6_P99_sm_qq_wpa::denom_hels[nprocesses] = {4, 4};
int PY8MEs_R6_P99_sm_qq_wpa::denom_iden[nprocesses] = {1, 1};
//--------------------------------------------------------------------------
// Color config initialization
void PY8MEs_R6_P99_sm_qq_wpa::initColorConfigs()
{
color_configs = vector < vec_vec_int > ();
jamp_nc_relative_power = vector < vec_int > ();
// Color flows of process Process: u d~ > w+ a WEIGHTED<=99 @6
color_configs.push_back(vec_vec_int());
jamp_nc_relative_power.push_back(vec_int());
// JAMP #0
color_configs[0].push_back(vec_int(createvector<int>
(1)(0)(0)(1)(0)(0)(0)(0)));
jamp_nc_relative_power[0].push_back(0);
// Color flows of process Process: d u~ > w- a WEIGHTED<=99 @6
color_configs.push_back(vec_vec_int());
jamp_nc_relative_power.push_back(vec_int());
// JAMP #0
color_configs[1].push_back(vec_int(createvector<int>
(1)(0)(0)(1)(0)(0)(0)(0)));
jamp_nc_relative_power[1].push_back(0);
}
//--------------------------------------------------------------------------
// Destructor.
PY8MEs_R6_P99_sm_qq_wpa::~PY8MEs_R6_P99_sm_qq_wpa()
{
for(unsigned int i = 0; i < nexternal; i++ )
{
delete[] p[i];
p[i] = NULL;
}
}
//--------------------------------------------------------------------------
// Invert the permutation mapping
vector<int> PY8MEs_R6_P99_sm_qq_wpa::invert_mapping(vector<int> mapping)
{
vector<int> inverted_mapping;
for (unsigned int i = 0; i < mapping.size(); i++ )
{
for (unsigned int j = 0; j < mapping.size(); j++ )
{
if (mapping[j] == ((int)i))
{
inverted_mapping.push_back(j);
break;
}
}
}
return inverted_mapping;
}
//--------------------------------------------------------------------------
// Return the list of possible helicity configurations
vector < vec_int > PY8MEs_R6_P99_sm_qq_wpa::getHelicityConfigs(vector<int>
permutation)
{
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = perm;
}
else
{
chosenPerm = permutation;
}
vector < vec_int > res(ncomb, vector<int> (nexternal, 0));
for (unsigned int ihel = 0; ihel < ncomb; ihel++ )
{
for(unsigned int j = 0; j < nexternal; j++ )
{
res[ihel][chosenPerm[j]] = helicities[ihel][j];
}
}
return res;
}
//--------------------------------------------------------------------------
// Return the list of possible color configurations
vector < vec_int > PY8MEs_R6_P99_sm_qq_wpa::getColorConfigs(int
specify_proc_ID, vector<int> permutation)
{
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = perm;
}
else
{
chosenPerm = permutation;
}
vector < vec_int > res(color_configs[chosenProcID].size(), vector<int>
(nexternal * 2, 0));
for (unsigned int icol = 0; icol < color_configs[chosenProcID].size(); icol++
)
{
for(unsigned int j = 0; j < (2 * nexternal); j++ )
{
res[icol][chosenPerm[j/2] * 2 + j%2] =
color_configs[chosenProcID][icol][j];
}
}
return res;
}
//--------------------------------------------------------------------------
// Get JAMP relative N_c power
int PY8MEs_R6_P99_sm_qq_wpa::getColorFlowRelativeNCPower(int color_flow_ID, int
specify_proc_ID)
{
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
return jamp_nc_relative_power[chosenProcID][color_flow_ID];
}
//--------------------------------------------------------------------------
// Implements the map Helicity ID -> Helicity Config
vector<int> PY8MEs_R6_P99_sm_qq_wpa::getHelicityConfigForID(int hel_ID,
vector<int> permutation)
{
if (hel_ID < 0 || hel_ID >= ncomb)
{
cerr << "Error in function 'getHelicityConfigForID' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified helicity ID '" <<
hel_ID << "' cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = perm;
}
else
{
chosenPerm = permutation;
}
vector<int> res(nexternal, 0);
for (unsigned int j = 0; j < nexternal; j++ )
{
res[chosenPerm[j]] = helicities[hel_ID][j];
}
return res;
}
//--------------------------------------------------------------------------
// Implements the map Helicity Config -> Helicity ID
int PY8MEs_R6_P99_sm_qq_wpa::getHelicityIDForConfig(vector<int> hel_config,
vector<int> permutation)
{
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = invert_mapping(perm);
}
else
{
chosenPerm = invert_mapping(permutation);
}
int user_ihel = -1;
if (hel_config.size() > 0)
{
bool found = false;
for(unsigned int i = 0; i < ncomb; i++ )
{
found = true;
for (unsigned int j = 0; j < nexternal; j++ )
{
if (helicities[i][chosenPerm[j]] != hel_config[j])
{
found = false;
break;
}
}
if ( !found)
continue;
else
{
user_ihel = i;
break;
}
}
if (user_ihel == -1)
{
cerr << "Error in function 'getHelicityIDForConfig' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified helicity" <<
" configuration cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
}
return user_ihel;
}
//--------------------------------------------------------------------------
// Implements the map Color ID -> Color Config
vector<int> PY8MEs_R6_P99_sm_qq_wpa::getColorConfigForID(int color_ID, int
specify_proc_ID, vector<int> permutation)
{
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
if (color_ID < 0 || color_ID >= int(color_configs[chosenProcID].size()))
{
cerr << "Error in function 'getColorConfigForID' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified color ID '" <<
color_ID << "' cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = perm;
}
else
{
chosenPerm = permutation;
}
vector<int> res(color_configs[chosenProcID][color_ID].size(), 0);
for (unsigned int j = 0; j < (2 * nexternal); j++ )
{
res[chosenPerm[j/2] * 2 + j%2] = color_configs[chosenProcID][color_ID][j];
}
return res;
}
//--------------------------------------------------------------------------
// Implements the map Color Config -> Color ID
int PY8MEs_R6_P99_sm_qq_wpa::getColorIDForConfig(vector<int> color_config, int
specify_proc_ID, vector<int> permutation)
{
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
vector<int> chosenPerm;
if (permutation.size() == 0)
{
chosenPerm = invert_mapping(perm);
}
else
{
chosenPerm = invert_mapping(permutation);
}
// Find which color configuration is asked for
// -1 indicates one wants to sum over all color configurations
int user_icol = -1;
if (color_config.size() > 0)
{
bool found = false;
for(unsigned int i = 0; i < color_configs[chosenProcID].size(); i++ )
{
found = true;
for (unsigned int j = 0; j < (nexternal * 2); j++ )
{
// If colorless then make sure it matches
// The little arithmetics in the color index is just
// the permutation applies on the particle list which is
// twice smaller since each particle can have two color indices.
if (color_config[j] == 0)
{
if (color_configs[chosenProcID][i][chosenPerm[j/2] * 2 + j%2] != 0)
{
found = false;
break;
}
// Otherwise check that the color linked position matches
}
else
{
int color_linked_pos = -1;
// Find the other end of the line in the user color config
for (unsigned int k = 0; k < (nexternal * 2); k++ )
{
if (k == j)
continue;
if (color_config[j] == color_config[k])
{
color_linked_pos = k;
break;
}
}
if (color_linked_pos == -1)
{
cerr << "Error in function 'getColorIDForConfig' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': A color line could " <<
" not be closed." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
// Now check whether the color line matches
if (color_configs[chosenProcID][i][chosenPerm[j/2] * 2 + j%2] !=
color_configs[chosenProcID][i][chosenPerm[color_linked_pos/2] * 2
+ color_linked_pos%2])
{
found = false;
break;
}
}
}
if ( !found)
continue;
else
{
user_icol = i;
break;
}
}
if (user_icol == -1)
{
cerr << "Error in function 'getColorIDForConfig' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified color" <<
" configuration cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
}
return user_icol;
}
//--------------------------------------------------------------------------
// Returns all result previously computed in SigmaKin
vector < vec_double > PY8MEs_R6_P99_sm_qq_wpa::getAllResults(int
specify_proc_ID)
{
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
return all_results[chosenProcID];
}
//--------------------------------------------------------------------------
// Returns a result previously computed in SigmaKin for a specific helicity
// and color ID. -1 means avg and summed over that characteristic.
double PY8MEs_R6_P99_sm_qq_wpa::getResult(int helicity_ID, int color_ID, int
specify_proc_ID)
{
if (helicity_ID < - 1 || helicity_ID >= ncomb)
{
cerr << "Error in function 'getResult' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified helicity ID '" <<
helicity_ID << "' configuration cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
int chosenProcID = -1;
if (specify_proc_ID == -1)
{
chosenProcID = proc_ID;
}
else
{
chosenProcID = specify_proc_ID;
}
if (color_ID < - 1 || color_ID >= int(color_configs[chosenProcID].size()))
{
cerr << "Error in function 'getResult' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Specified color ID '" <<
color_ID << "' configuration cannot be found." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
return all_results[chosenProcID][helicity_ID + 1][color_ID + 1];
}
//--------------------------------------------------------------------------
// Check for the availability of the requested process and if available,
// If available, this returns the corresponding permutation and Proc_ID to use.
// If not available, this returns a negative Proc_ID.
pair < vector<int> , int > PY8MEs_R6_P99_sm_qq_wpa::static_getPY8ME(vector<int>
initial_pdgs, vector<int> final_pdgs, set<int> schannels)
{
// Not available return value
pair < vector<int> , int > NA(vector<int> (), -1);
// Check if s-channel requirements match
if (nreq_s_channels > 0)
{
if (schannels != s_channel_proc)
return NA;
}
else
{
if (schannels.size() != 0)
return NA;
}
// Check number of final state particles
if (final_pdgs.size() != (nexternal - ninitial))
return NA;
// Check number of initial state particles
if (initial_pdgs.size() != ninitial)
return NA;
// List of processes available in this class
const int nprocs = 8;
const int proc_IDS[nprocs] = {0, 0, 1, 1, 0, 0, 1, 1};
const int in_pdgs[nprocs][ninitial] = {{2, -1}, {4, -3}, {1, -2}, {3, -4},
{-1, 2}, {-3, 4}, {-2, 1}, {-4, 3}};
const int out_pdgs[nprocs][nexternal - ninitial] = {{24, 22}, {24, 22}, {-24,
22}, {-24, 22}, {24, 22}, {24, 22}, {-24, 22}, {-24, 22}};
bool in_pdgs_used[ninitial];
bool out_pdgs_used[nexternal - ninitial];
for(unsigned int i = 0; i < nprocs; i++ )
{
int permutations[nexternal];
// Reinitialize initial state look-up variables
for(unsigned int j = 0; j < ninitial; j++ )
{
in_pdgs_used[j] = false;
permutations[j] = -1;
}
// Look for initial state matches
for(unsigned int j = 0; j < ninitial; j++ )
{
for(unsigned int k = 0; k < ninitial; k++ )
{
// Make sure it has not been used already
if (in_pdgs_used[k])
continue;
if (initial_pdgs[k] == in_pdgs[i][j])
{
permutations[j] = k;
in_pdgs_used[k] = true;
break;
}
}
// If no match found for this particular initial state,
// proceed with the next process
if (permutations[j] == -1)
break;
}
// Proceed with next process if not match found
if (permutations[ninitial - 1] == -1)
continue;
// Reinitialize final state look-up variables
for(unsigned int j = 0; j < (nexternal - ninitial); j++ )
{
out_pdgs_used[j] = false;
permutations[ninitial + j] = -1;
}
// Look for final state matches
for(unsigned int j = 0; j < (nexternal - ninitial); j++ )
{
for(unsigned int k = 0; k < (nexternal - ninitial); k++ )
{
// Make sure it has not been used already
if (out_pdgs_used[k])
continue;
if (final_pdgs[k] == out_pdgs[i][j])
{
permutations[ninitial + j] = ninitial + k;
out_pdgs_used[k] = true;
break;
}
}
// If no match found for this particular initial state,
// proceed with the next process
if (permutations[ninitial + j] == -1)
break;
}
// Proceed with next process if not match found
if (permutations[nexternal - 1] == -1)
continue;
// Return process found
return pair < vector<int> , int > (vector<int> (permutations, permutations
+ nexternal), proc_IDS[i]);
}
// No process found
return NA;
}
//--------------------------------------------------------------------------
// Set momenta
void PY8MEs_R6_P99_sm_qq_wpa::setMomenta(vector < vec_double > momenta_picked)
{
if (momenta_picked.size() != nexternal)
{
cerr << "Error in function 'setMomenta' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number of" <<
" momenta specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
for(unsigned int i = 0; i < nexternal; i++ )
{
if (momenta_picked[i].size() != 4)
{
cerr << "Error in function 'setMomenta' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number of" <<
" momenta components specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
if (momenta_picked[i][0] < 0.0)
{
cerr << "Error in function 'setMomenta' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': A momentum was specified" <<
" with negative energy. Check conventions." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
for (unsigned int j = 0; j < 4; j++ )
{
p[i][j] = momenta_picked[i][j];
}
}
}
//--------------------------------------------------------------------------
// Set color configuration to use. An empty vector means sum over all.
void PY8MEs_R6_P99_sm_qq_wpa::setColors(vector<int> colors_picked)
{
if (colors_picked.size() == 0)
{
user_colors = vector<int> ();
return;
}
if (colors_picked.size() != (2 * nexternal))
{
cerr << "Error in function 'setColors' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number" <<
" of colors specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
user_colors = vector<int> ((2 * nexternal), 0);
for(unsigned int i = 0; i < (2 * nexternal); i++ )
{
user_colors[i] = colors_picked[i];
}
}
//--------------------------------------------------------------------------
// Set the helicity configuration to use. Am empty vector means sum over all.
void PY8MEs_R6_P99_sm_qq_wpa::setHelicities(vector<int> helicities_picked)
{
if (helicities_picked.size() != nexternal)
{
if (helicities_picked.size() == 0)
{
user_helicities = vector<int> ();
return;
}
cerr << "Error in function 'setHelicities' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number" <<
" of helicities specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
user_helicities = vector<int> (nexternal, 0);
for(unsigned int i = 0; i < nexternal; i++ )
{
user_helicities[i] = helicities_picked[i];
}
}
//--------------------------------------------------------------------------
// Set the permutation to use (will apply to momenta, colors and helicities)
void PY8MEs_R6_P99_sm_qq_wpa::setPermutation(vector<int> perm_picked)
{
if (perm_picked.size() != nexternal)
{
cerr << "Error in function 'setPermutations' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number" <<
" of permutations specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
for(unsigned int i = 0; i < nexternal; i++ )
{
perm[i] = perm_picked[i];
}
}
// Set the proc_ID to use
void PY8MEs_R6_P99_sm_qq_wpa::setProcID(int procID_picked)
{
proc_ID = procID_picked;
}
//--------------------------------------------------------------------------
// Initialize process.
void PY8MEs_R6_P99_sm_qq_wpa::initProc()
{
// Initialize flags
include_symmetry_factors = true;
include_helicity_averaging_factors = true;
include_color_averaging_factors = true;
// Initialize vectors.
perm = vector<int> (nexternal, 0);
user_colors = vector<int> (2 * nexternal, 0);
user_helicities = vector<int> (nexternal, 0);
p = vector < double * > ();
for (unsigned int i = 0; i < nexternal; i++ )
{
p.push_back(new double[4]);
}
initColorConfigs();
// Synchronize local variables dependent on the model with the active model.
mME = vector<double> (nexternal, 0.);
syncProcModelParams();
jamp2 = vector < vec_double > (2);
jamp2[0] = vector<double> (1, 0.);
jamp2[1] = vector<double> (1, 0.);
all_results = vector < vec_vec_double > (2);
// The first entry is always the color or helicity avg/summed matrix element.
all_results[0] = vector < vec_double > (ncomb + 1, vector<double> (1 + 1,
0.));
all_results[1] = vector < vec_double > (ncomb + 1, vector<double> (1 + 1,
0.));
}
// Synchronize local variables of the process that depend on the model
// parameters
void PY8MEs_R6_P99_sm_qq_wpa::syncProcModelParams()
{
// Instantiate the model class and set parameters that stay fixed during run
mME[0] = pars->ZERO;
mME[1] = pars->ZERO;
mME[2] = pars->mdl_MW;
mME[3] = pars->ZERO;
}
//--------------------------------------------------------------------------
// Setter allowing to force particular values for the external masses
void PY8MEs_R6_P99_sm_qq_wpa::setMasses(vec_double external_masses)
{
if (external_masses.size() != mME.size())
{
cerr << "Error in function 'setMasses' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect number of" <<
" masses specified." << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
for (unsigned int j = 0; j < mME.size(); j++ )
{
mME[j] = external_masses[perm[j]];
}
}
//--------------------------------------------------------------------------
// Getter accessing external masses with the correct ordering
vector<double> PY8MEs_R6_P99_sm_qq_wpa::getMasses()
{
vec_double external_masses;
vector<int> invertedPerm;
invertedPerm = invert_mapping(perm);
for (unsigned int i = 0; i < mME.size(); i++ )
{
external_masses.push_back(mME[invertedPerm[i]]);
}
return external_masses;
}
// Set all values of the external masses to float(-mode) where mode can be
// 0 : Mass taken from the model
// 1 : Mass taken from p_i^2 if not massless to begin with
// 2 : Mass always taken from p_i^2.
void PY8MEs_R6_P99_sm_qq_wpa::setExternalMassesMode(int mode)
{
if (mode != 0 && mode != 1 && mode != 2)
{
cerr << "Error in function 'setExternalMassesMode' of class" <<
" 'PY8MEs_R6_P99_sm_qq_wpa': Incorrect mode selected :" << mode <<
". It must be either 0, 1 or 2" << endl;
throw PY8MEs_R6_P99_sm_qq_wpa_exception;
}
if (mode == 0)
{
syncProcModelParams();
}
else if (mode == 1)
{
for (unsigned int j = 0; j < mME.size(); j++ )
{
if (mME[j] != pars->ZERO)
{
mME[j] = -1.0;
}
}
}
else if (mode == 2)
{
for (unsigned int j = 0; j < mME.size(); j++ )
{
mME[j] = -1.0;
}
}
}
//--------------------------------------------------------------------------
// Evaluate the squared matrix element.
double PY8MEs_R6_P99_sm_qq_wpa::sigmaKin()
{
// Set the parameters which change event by event
pars->setDependentParameters();
pars->setDependentCouplings();
// Reset color flows
for(int i = 0; i < 1; i++ )
jamp2[0][i] = 0.;
for(int i = 0; i < 1; i++ )
jamp2[1][i] = 0.;
// Save previous values of mME
vector<double> saved_mME(mME.size(), 0.0);
for (unsigned int i = 0; i < mME.size(); i++ )
{
if (mME[i] < 0.0)
{
saved_mME[i] = mME[i];
mME[i] = sqrt(abs(pow(p[perm[i]][0], 2) -
(pow(p[perm[i]][1], 2) + pow(p[perm[i]][2], 2) + pow(p[perm[i]][3],
2))));
}
}
// Local variables and constants
const int max_tries = 10;
vector < vec_bool > goodhel(nprocesses, vec_bool(ncomb, false));
vec_int ntry(nprocesses, 0);
double t = 0.;
double result = 0.;
if (ntry[proc_ID] <= max_tries)
ntry[proc_ID] = ntry[proc_ID] + 1;
// Find which helicity configuration is asked for
// -1 indicates one wants to sum over helicities
int user_ihel = getHelicityIDForConfig(user_helicities);
// Find which color configuration is asked for
// -1 indicates one wants to sum over all color configurations
int user_icol = getColorIDForConfig(user_colors);
// Reset the list of results that will be recomputed here
// Starts with -1 which are the summed results
for (int ihel = -1; ihel + 1 < ((int)all_results[proc_ID].size()); ihel++ )
{
// Only if it is the helicity picked
if (user_ihel != -1 && ihel != user_ihel)
continue;
for (int icolor = -1; icolor + 1 < ((int)all_results[proc_ID][ihel +
1].size()); icolor++ )
{
// Only if color picked
if (user_icol != -1 && icolor != user_icol)
continue;
all_results[proc_ID][ihel + 1][icolor + 1] = 0.;
}
}
// Calculate the matrix element for all helicities
// unless already detected as vanishing
for(int ihel = 0; ihel < ncomb; ihel++ )
{
// Skip helicity if already detected as vanishing
if ((ntry[proc_ID] >= max_tries) && !goodhel[proc_ID][ihel])
continue;
// Also skip helicity if user asks for a specific one
if ((ntry[proc_ID] >= max_tries) && user_ihel != -1 && user_ihel != ihel)
continue;
calculate_wavefunctions(helicities[ihel]);
// Reset locally computed color flows
for(int i = 0; i < 1; i++ )
jamp2[0][i] = 0.;
for(int i = 0; i < 1; i++ )
jamp2[1][i] = 0.;
if (proc_ID == 0)
t = matrix_6_udx_wpa();
if (proc_ID == 1)
t = matrix_6_dux_wma();
// Store which helicities give non-zero result
if ((ntry[proc_ID] < max_tries) && t != 0. && !goodhel[proc_ID][ihel])
goodhel[proc_ID][ihel] = true;
// Aggregate results
if (user_ihel == -1 || user_ihel == ihel)
{
if (user_icol == -1)
{
result = result + t;
if (user_ihel == -1)
{
all_results[proc_ID][0][0] += t;
for (unsigned int i = 0; i < jamp2[proc_ID].size(); i++ )
{
all_results[proc_ID][0][i + 1] += jamp2[proc_ID][i];
}
}
all_results[proc_ID][ihel + 1][0] += t;
for (unsigned int i = 0; i < jamp2[proc_ID].size(); i++ )
{
all_results[proc_ID][ihel + 1][i + 1] += jamp2[proc_ID][i];
}
}
else
{
result = result + jamp2[proc_ID][user_icol];
if (user_ihel == -1)
{
all_results[proc_ID][0][user_icol + 1] += jamp2[proc_ID][user_icol];
}
all_results[proc_ID][ihel + 1][user_icol + 1] +=
jamp2[proc_ID][user_icol];
}
}
}
// Normalize results with the identical particle factor
if (include_symmetry_factors)
{
result = result/denom_iden[proc_ID];
}
// Starts with -1 which are the summed results
for (int ihel = -1; ihel + 1 < ((int)all_results[proc_ID].size()); ihel++ )
{
// Only if it is the helicity picked
if (user_ihel != -1 && ihel != user_ihel)
continue;
for (int icolor = -1; icolor + 1 < ((int)all_results[proc_ID][ihel +
1].size()); icolor++ )
{
// Only if color picked
if (user_icol != -1 && icolor != user_icol)
continue;
if (include_symmetry_factors)
{
all_results[proc_ID][ihel + 1][icolor + 1] /= denom_iden[proc_ID];
}
}
}
// Normalize when when summing+averaging over helicity configurations
if (user_ihel == -1 && include_helicity_averaging_factors)
{
result /= denom_hels[proc_ID];
if (user_icol == -1)
{
all_results[proc_ID][0][0] /= denom_hels[proc_ID];
for (unsigned int i = 0; i < jamp2[proc_ID].size(); i++ )
{
all_results[proc_ID][0][i + 1] /= denom_hels[proc_ID];
}
}
else
{
all_results[proc_ID][0][user_icol + 1] /= denom_hels[proc_ID];
}
}
// Normalize when summing+averaging over color configurations
if (user_icol == -1 && include_color_averaging_factors)
{
result /= denom_colors[proc_ID];
if (user_ihel == -1)
{
all_results[proc_ID][0][0] /= denom_colors[proc_ID];
for (unsigned int i = 0; i < ncomb; i++ )
{
all_results[proc_ID][i + 1][0] /= denom_colors[proc_ID];
}
}
else
{
all_results[proc_ID][user_ihel + 1][0] /= denom_colors[proc_ID];
}
}
// Reinstate previous values of mME
for (unsigned int i = 0; i < mME.size(); i++ )
{
if (saved_mME[i] < 0.0)
{
mME[i] = saved_mME[i];
}
}
// Finally return it
return result;
}
//==========================================================================
// Private class member functions
//--------------------------------------------------------------------------
// Evaluate |M|^2 for each subprocess
void PY8MEs_R6_P99_sm_qq_wpa::calculate_wavefunctions(const int hel[])
{
// Calculate wavefunctions for all processes
// Calculate all wavefunctions
ixxxxx(p[perm[0]], mME[0], hel[0], +1, w[0]);
oxxxxx(p[perm[1]], mME[1], hel[1], -1, w[1]);
vxxxxx(p[perm[2]], mME[2], hel[2], +1, w[2]);
vxxxxx(p[perm[3]], mME[3], hel[3], +1, w[3]);
FFV2_3(w[0], w[1], pars->GC_100, pars->mdl_MW, pars->mdl_WW, w[4]);
FFV2_2(w[0], w[2], pars->GC_100, pars->ZERO, pars->ZERO, w[5]);
FFV1_2(w[0], w[3], pars->GC_2, pars->ZERO, pars->ZERO, w[6]);
FFV1_2(w[0], w[3], pars->GC_1, pars->ZERO, pars->ZERO, w[7]);
// Calculate all amplitudes
// Amplitude(s) for diagram number 0
VVV1_0(w[3], w[4], w[2], pars->GC_4, amp[0]);
FFV1_0(w[5], w[1], w[3], pars->GC_1, amp[1]);
FFV2_0(w[6], w[1], w[2], pars->GC_100, amp[2]);
FFV1_0(w[5], w[1], w[3], pars->GC_2, amp[3]);
FFV2_0(w[7], w[1], w[2], pars->GC_100, amp[4]);
}
double PY8MEs_R6_P99_sm_qq_wpa::matrix_6_udx_wpa()
{
int i, j;
// Local variables
// const int ngraphs = 3;
const int ncolor = 1;
Complex<double> ztemp;
Complex<double> jamp[ncolor];
// The color matrix;
static const double denom[ncolor] = {1};
static const double cf[ncolor][ncolor] = {{3}};
// Calculate color flows
jamp[0] = +amp[0] + amp[1] + amp[2];
// Sum and square the color flows to get the matrix element
double matrix = 0;
for(i = 0; i < ncolor; i++ )
{
ztemp = 0.;
for(j = 0; j < ncolor; j++ )
ztemp = ztemp + cf[i][j] * jamp[j];
matrix = matrix + real(ztemp * conj(jamp[i]))/denom[i];
}
// Store the leading color flows for choice of color
for(i = 0; i < ncolor; i++ )
jamp2[0][i] += real(jamp[i] * conj(jamp[i])) * (cf[i][i]/denom[i]);
return matrix;
}
double PY8MEs_R6_P99_sm_qq_wpa::matrix_6_dux_wma()
{
int i, j;
// Local variables
// const int ngraphs = 3;
const int ncolor = 1;
Complex<double> ztemp;
Complex<double> jamp[ncolor];
// The color matrix;
static const double denom[ncolor] = {1};
static const double cf[ncolor][ncolor] = {{3}};
// Calculate color flows
jamp[0] = +amp[0] + amp[3] + amp[4];
// Sum and square the color flows to get the matrix element
double matrix = 0;
for(i = 0; i < ncolor; i++ )
{
ztemp = 0.;
for(j = 0; j < ncolor; j++ )
ztemp = ztemp + cf[i][j] * jamp[j];
matrix = matrix + real(ztemp * conj(jamp[i]))/denom[i];
}
// Store the leading color flows for choice of color
for(i = 0; i < ncolor; i++ )
jamp2[1][i] += real(jamp[i] * conj(jamp[i])) * (cf[i][i]/denom[i]);
return matrix;
}
} // end namespace PY8MEs_namespace
| [
"stefan.prestel.work@gmail.com"
] | stefan.prestel.work@gmail.com |
866f31986b6f750c578b6679385c5ff6f5220e1b | 7c681c7e45487131963301bf1c09d13615318f24 | /msg.cpp | f65b02cd76b210e8c3f42b0202f9b50fb63f09f1 | [] | no_license | mincore/kxfs | b10a91f8894107608b6d7fe6c2c9478090d80ee0 | 22c17b2bf2ee88b13b9a4535031eb9a84dc9142d | refs/heads/master | 2020-03-23T12:41:07.212820 | 2019-02-13T16:31:59 | 2019-02-13T16:31:59 | 141,574,634 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 759 | cpp | #include "msg.h"
const char *strmsg(int type) {
switch (type) {
case Msg::HELLO: return "MSG_HELLO";
case Msg::KEEPALIVE: return "MSG_KEEPALIVE";
case Msg::GETATTR: return "MSG_GETATTR";
case Msg::MKDIR: return "MSG_MKDIR";
case Msg::SYMLINK: return "MSG_SYMLINK";
case Msg::UNLINK: return "MSG_UNLINK";
case Msg::RMDIR: return "MSG_RMDIR";
case Msg::RENAME: return "MSG_RENAME";
case Msg::CHMOD: return "MSG_CHMOD";
case Msg::TRUNCATE: return "MSG_TRUNCATE";
case Msg::UTIMENS: return "MSG_UTIMENS";
case Msg::READ: return "MSG_READ";
case Msg::WRITE: return "MSG_WRITE";
case Msg::CREATE: return "MSG_CREATE";
}
return "UNKNOWN";
}
| [
"a@a.com"
] | a@a.com |
42b0ce0aab9fcaafd2cf2f5e62a78da4b235268b | 7ac293b25a6bbc1cd8b26b51cf376a34f37ae79a | /考研机试/动态规划/最小路径和.cpp | a3d154ebcb51bbc55e32f212585b3bf5280c541d | [] | no_license | SwordHarry/LeetCode | 38382820d0ec2d3b3ba101a1219a4b8cec56fc06 | 1b8b328a1213ed0b6c8546511dcad73bdb4f57d3 | refs/heads/master | 2020-04-17T14:32:45.783929 | 2019-07-25T17:04:35 | 2019-07-25T17:04:35 | 166,660,880 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 765 | cpp |
#include <vector>
using namespace std;
class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
// m + n - 2
int row = grid.size();
int column = grid[0].size();
// grid[0][j] 和 grid[i][0]
for(int i = 1;i < row;i++) {
grid[i][0] += grid[i - 1][0];
}
for(int j = 1;j < column;j++) {
grid[0][j] += grid[0][j - 1];
}
for(int i = 1;i < row;i++) {
for(int j = 1;j < column;j++) {
grid[i][j] += min(grid[i - 1][j],grid[i][j - 1]);
}
}
return grid[row - 1][column - 1];
}
int min(int a,int b) {
return (a>b)?b:a;
}
}; | [
"2398960068@qq.com"
] | 2398960068@qq.com |
d9be6e6693c6aa393890e17b1a77ed867b4eb5a4 | 73cfd700522885a3fec41127e1f87e1b78acd4d3 | /_Include/boost/test/tree/test_case_counter.hpp | 20423f0ce4c2c4ede85161e96a2d269f3d8ed9db | [] | no_license | pu2oqa/muServerDeps | 88e8e92fa2053960671f9f57f4c85e062c188319 | 92fcbe082556e11587887ab9d2abc93ec40c41e4 | refs/heads/master | 2023-03-15T12:37:13.995934 | 2019-02-04T10:07:14 | 2019-02-04T10:07:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,136 | hpp | ////////////////////////////////////////////////////////////////////////////////
// test_case_counter.hpp
// (C) Copyright Gennadiy Rozental 2001-2014.
// 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/test for the library home page.
//
// File : $RCSfile$
//
// Version : $Revision: 74640 $
//
// Description : defines test_case_counter
// ***************************************************************************
#ifndef BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER
#define BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER
// Boost.Test
#include <boost/test/detail/config.hpp>
#include <boost/test/utils/class_properties.hpp>
#include <boost/test/tree/test_unit.hpp>
#include <boost/test/tree/visitor.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
//____________________________________________________________________________//
namespace boost {
namespace unit_test {
// ************************************************************************** //
// ************** test_case_counter ************** //
// ************************************************************************** //
class test_case_counter : public test_tree_visitor {
public:
// Constructor
test_case_counter() : p_count( 0 ) {}
BOOST_READONLY_PROPERTY( counter_t, (test_case_counter)) p_count;
private:
// test tree visitor interface
virtual void visit( test_case const& tc ) { if( tc.is_enabled() ) ++p_count.value; }
virtual bool test_suite_start( test_suite const& ts ) { return ts.is_enabled(); }
};
} // namespace unit_test
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_TREE_TEST_CASE_COUNTER_HPP_100211GER
/////////////////////////////////////////////////
// vnDev.Games - Trong.LIVE - DAO VAN TRONG //
////////////////////////////////////////////////////////////////////////////////
| [
"langley.joshua@gmail.com"
] | langley.joshua@gmail.com |
001f8e625de5e194df4df2520f92d0e84c5ddea4 | f907d12b4a223ef77d29d8e26483320b2a6e22df | /primeinarange.cpp | e7da77438adcf6f7a19f8d740196274b46abcfe5 | [] | no_license | AbiralBhattarai/random | 5cd1c37990ec4fd94d10a9919f1a55ce0b194518 | 6358076a1f4485e02a6a574466d33284a61315ef | refs/heads/master | 2023-05-03T20:10:11.081045 | 2021-05-21T09:53:07 | 2021-05-21T09:53:07 | 360,178,977 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 358 | cpp | #include<stdio.h>
#include<conio.h>
int c;
int main(){
int a,b,num,i;
printf("enter starting number for range; ");
scanf("%d",&a);
printf("enter ending number for range; ");
scanf("%d",&b);
for(a;a<=b;a++){
c = 0;
num = a;
for(i=1;i<=num;i++){
if(num % i == 0){
c = c+1;
}
}
if(c == 2){
printf("%d \t",a);
}
}
return 0;
}
| [
"abiralbhattarai101@gmail.com"
] | abiralbhattarai101@gmail.com |
2f444b09c7296f22296042ddf366a90f5ae9ce7e | c694da160d4365eb2d5aad404334c6ed1d41a75c | /src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_occ.H | e85e52afaa703d49d2a9881071b9efb451dec278 | [
"Apache-2.0"
] | permissive | 3mdeb/talos-hostboot | b00e00fa4613731c01338a73dcf39dededae971f | 8d49baa2180fc3cff78c393b19e39816dfa8606f | refs/heads/master | 2022-12-18T01:04:50.303567 | 2018-04-25T02:13:30 | 2018-05-20T06:31:19 | 299,345,985 | 1 | 0 | NOASSERTION | 2020-09-28T15:40:46 | 2020-09-28T15:06:58 | C++ | UTF-8 | C++ | false | false | 6,887 | h | /* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_occ.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* 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. */
/* */
/* IBM_PROLOG_END_TAG */
#ifndef __PM_RECOVERY_FFDC_OCC_
#define __PM_RECOVERY_FFDC_OCC_
///
/// @file p9_pm_recovery_ffdc_occ.H
/// @brief Models OCC platform for the FFDC collection of PM complex
///
/// *HWP HWP Owner: Greg Still <stillgs@us.ibm.com>
/// *HWP FW Owner: Amit Tendolkar <amit.tendolkar@in.ibm.com>
/// *HWP Team: PM
/// *HWP Level: 2
/// *HWP Consumed by: Hostboot
//
// *INDENT-OFF*
//--------------------------------------------------------------------------
// Includes
//--------------------------------------------------------------------------
#include <fapi2.H>
#include <stdint.h>
#include <p9_pm_recovery_ffdc_base.H>
namespace p9_stop_recov_ffdc
{
class PlatOcc : public PlatPmComplex
{
public:
/// @brief constructor
PlatOcc ( const fapi2::Target <fapi2::TARGET_TYPE_PROC_CHIP>
i_procChipTgt );
/// @brief destructor
virtual ~PlatOcc() { };
/// @brief Initializes the OCC FFDC Sub-Sections in HOMER with default header
/// @param[in] i_pHomerBuf points to base of P9 HOMER.
/// @return fapi2 return code
fapi2::ReturnCode init ( void* i_pHomerBuf );
/// @brief collects FFDC of the OCC 405, GPE0 and GPE1.
/// @param[in] i_pHomerBuf points to base of P9 HOMER.
/// @param[in] i_ffdcType indicates the content type to collect
/// @return fapi2 return code.
fapi2::ReturnCode collectFfdc ( void* i_pHomerBuf,
uint8_t i_ffdcType = ALL );
/// @brief generates summary of FFDC pertaining to a given platform.
/// @param[in] i_pHomer points to Homer base.
/// @return fapi2 return code
fapi2::ReturnCode generateSummary( void * i_pHomer );
private:
/// @brief collects trace info from a known region OCC SRAM
/// @param[in] i_pHomerBuf location in HOMER to write at
/// @param[in] i_occSramRegion See OccFfdcValidStatus,
/// Indicates OCC SRAM Region to read
/// @return fapi2 return code.
fapi2::ReturnCode collectTrace( uint8_t* i_pHomerBuf,
uint8_t i_occSramRegion );
/// @brief reads OCC SRAM to find out the region extent and
/// then collects info from that region
/// @param[in] i_pHomerBuf location in HOMER to write at
/// @param[in] i_occSramRegion See OccFfdcValidStatus.
/// Indicates OCC SRAM Region to read
/// @return fapi2 return code.
fapi2::ReturnCode readSramRegion ( uint8_t* i_pHomerBuf,
uint8_t i_occSramRegion );
/// @brief updates the OCC FFDC Header
/// @param[in] i_pHomerBuf points to a location in HOMER meant for
/// OCC FFDC Header
///@param[in] i_ffdcValid Indicates what fields in OCC FFDC are
/// valid. See OccFfdcValidStatus
///@return fapi2 return code.
fapi2::ReturnCode updateOccFfdcHeader ( uint8_t* i_pHomerBuf,
uint16_t i_ffdcValid );
/// @brief collects register info for a given OCC
/// @param[in] i_pHomerBuf points to location of HOMER meant for OCC internal register.
///@return fapi2 return code.
fapi2::ReturnCode collectOccReg( uint8_t * i_pHomerBuf);
///@brief initializes a list of register for generation of FFDC summary.
void initRegList();
};
//---------------------------------------------------------------------------------------------
// function pointer typedef definition for HWP call support
typedef fapi2::ReturnCode( *p9_pm_recovery_ffdc_occ_FP_t )
( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> & i_procChipTgt,
void* i_occFfdcBuf );
extern "C"
{
// -----------------------------------------------------------------------------
// Function prototypes
// -----------------------------------------------------------------------------
///
/// @brief Populates the OCC FFDC section with FFDC collected from OCC GPE0 and GPE1.
///
/// @param[in] i_procChipTarget Proc Chip target
/// @param[in] i_pHomerImage Pointer to the base of the chip HOMER region
///
/// @return FAPI2_RC_SUCCESS on success or error return code
///
fapi2::ReturnCode p9_pm_recovery_ffdc_occ
( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procChipTarget,
void* i_pHomerImage );
}
} //namespace p9_stop_recov_ffdc ends
#endif //__PM_RECOVERY_FFDC_OCC_
| [
"crgeddes@us.ibm.com"
] | crgeddes@us.ibm.com |
bb92cb2b251a4afa6901ecf1934fe90064757c62 | 3c0e92dc6bf91c6a6c1b8c73d5da0b038c58e436 | /proxies/Pelican/include/comm/session/cvg/DycsProtocol.h | f6f825c8c8d93524274b40ce026e6a923de346bb | [] | no_license | yebo92/mavwork | f9d47d84e952c9b9939216b09f50fa128131ab9e | a7bce5766874850528857f6fd96fce4152f5775a | refs/heads/master | 2022-06-10T18:27:52.428622 | 2013-06-06T16:25:14 | 2013-06-06T16:25:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 749 | h | /*
* DycsProtocol.h
*
* Created on: 15/05/2012
* Author: Ignacio Mellado-Bataller
*/
#ifndef DYCSPROTOCOL_H_
#define DYCSPROTOCOL_H_
namespace Comm { namespace Proto { namespace Dycs {
#ifndef __PACKED
#define __PACKED __attribute__((__packed__))
#endif
enum DycsAccessMode { COMMANDER = 0, LISTENER = 1, UNKNOWN_MODE = 2 };
struct DycsClientToServerHeader__ {
unsigned char requestedAccessMode : 3;
unsigned char requestedPriority : 5; // [0, 31] 0 is the highest priority
} __PACKED;
typedef DycsClientToServerHeader__ DycsClientToServerHeader;
struct DycsServertToClientHeader__ {
unsigned char grantedAccessMode;
} __PACKED;
typedef DycsServertToClientHeader__ DycsServertToClientHeader;
}}}
#endif /* DYCSPROTOCOL_H_ */
| [
"ignacio.mellado@gmail.com"
] | ignacio.mellado@gmail.com |
3e5a5c3919ea2ef337c26bad747276f841c0efbe | b4e410158a1378723927f7a9f084f3f86d60b00e | /Source/SFMLIntegration/CClock.cpp | 4240be52a27c378b2b77d57490ef9bc7ea575d59 | [
"MIT"
] | permissive | sizlo/TimGameLib | a4d642d4f10f08473a9cd252ed677efcf446c12f | b70605c4b043a928645f063a2bb3b267fa91f2c6 | refs/heads/master | 2020-05-26T20:40:28.510983 | 2017-06-05T14:02:51 | 2017-06-05T14:02:51 | 33,624,096 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,471 | cpp | //
// CClock.cpp
// TimGameLib
//
// Created by Tim Brier on 18/10/2014.
// Copyright (c) 2014 tbrier. All rights reserved.
//
// =============================================================================
// Include Files
// -----------------------------------------------------------------------------
#include "CClock.hpp"
// =============================================================================
// CClock constructor/destructor
// -----------------------------------------------------------------------------
CClock::CClock() : sf::Clock()
{
}
CClock::~CClock()
{
}
// =============================================================================
// CPauseableClock constructor/destructor
// -----------------------------------------------------------------------------
CPauseableClock::CPauseableClock() : CClock()
{
mAccumulatedTime = CTime::Zero;
mPaused = false;
}
CPauseableClock::~CPauseableClock()
{
}
// =============================================================================
// CPauseableClock::Restart
// -----------------------------------------------------------------------------
CTime CPauseableClock::Restart(CTime theStartTime /* = CTime::Zero */)
{
CTime elapsedTime = GetElapsedTime();
mPaused = false;
mAccumulatedTime = theStartTime;
restart();
return elapsedTime;
}
// =============================================================================
// CPauseableClock::Pause
// -----------------------------------------------------------------------------
CTime CPauseableClock::Pause()
{
if (!mPaused)
{
mPaused = true;
mAccumulatedTime += getElapsedTime();
}
return mAccumulatedTime;
}
// =============================================================================
// CPauseableClock::Resume
// -----------------------------------------------------------------------------
CTime CPauseableClock::Resume()
{
CTime elapsedTime = GetElapsedTime();
if (mPaused)
{
mPaused = false;
restart();
}
return elapsedTime;
}
// =============================================================================
// CPauseableClock::GetElapsedTime
// -----------------------------------------------------------------------------
CTime CPauseableClock::GetElapsedTime()
{
CTime elapsedTime = mAccumulatedTime;
if (!mPaused)
{
elapsedTime += getElapsedTime();
}
return elapsedTime;
} | [
"t.brier93@gmail.com"
] | t.brier93@gmail.com |
e5c54c1e8e155b0fb812e6c6dfe96188fc58188f | 639cdc6ce0e94a27b72ceede7a295ca621fae21a | /build/linux-build/Sources/src/nape/phys/InteractorIterator.cpp | e3de3d5026d0742cd181e9318357e729b841dc1c | [
"MIT"
] | permissive | HedgehogFog/TimeOfDeath | fb04bd6010115dc37b5d7777821f8fa53e1854a0 | b78abacf940e1a88c8b987d99764ebb6876c5dc6 | refs/heads/master | 2020-04-27T10:48:43.759612 | 2019-03-18T04:30:47 | 2019-03-18T04:30:47 | 174,270,248 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 11,450 | cpp | // Generated by Haxe 4.0.0-preview.5
#include <hxcpp.h>
#ifndef INCLUDED_nape_phys_Interactor
#include <hxinc/nape/phys/Interactor.h>
#endif
#ifndef INCLUDED_nape_phys_InteractorIterator
#include <hxinc/nape/phys/InteractorIterator.h>
#endif
#ifndef INCLUDED_nape_phys_InteractorList
#include <hxinc/nape/phys/InteractorList.h>
#endif
#ifndef INCLUDED_zpp_nape_util_ZNPList_ZPP_Interactor
#include <hxinc/zpp_nape/util/ZNPList_ZPP_Interactor.h>
#endif
#ifndef INCLUDED_zpp_nape_util_ZPP_InteractorList
#include <hxinc/zpp_nape/util/ZPP_InteractorList.h>
#endif
HX_DEFINE_STACK_FRAME(_hx_pos_b7b8b9ff903a3671_178_new,"nape.phys.InteractorIterator","new",0x705eac8f,"nape.phys.InteractorIterator.new","nape/phys/InteractorIterator.hx",178,0x5f4f6161)
HX_LOCAL_STACK_FRAME(_hx_pos_b7b8b9ff903a3671_240_hasNext,"nape.phys.InteractorIterator","hasNext",0x8cc4c51c,"nape.phys.InteractorIterator.hasNext","nape/phys/InteractorIterator.hx",240,0x5f4f6161)
HX_LOCAL_STACK_FRAME(_hx_pos_b7b8b9ff903a3671_264_next,"nape.phys.InteractorIterator","next",0xe27851e4,"nape.phys.InteractorIterator.next","nape/phys/InteractorIterator.hx",264,0x5f4f6161)
HX_LOCAL_STACK_FRAME(_hx_pos_b7b8b9ff903a3671_217_get,"nape.phys.InteractorIterator","get",0x70595cc5,"nape.phys.InteractorIterator.get","nape/phys/InteractorIterator.hx",217,0x5f4f6161)
HX_LOCAL_STACK_FRAME(_hx_pos_b7b8b9ff903a3671_194_boot,"nape.phys.InteractorIterator","boot",0xda915123,"nape.phys.InteractorIterator.boot","nape/phys/InteractorIterator.hx",194,0x5f4f6161)
namespace nape{
namespace phys{
void InteractorIterator_obj::__construct(){
HX_STACKFRAME(&_hx_pos_b7b8b9ff903a3671_178_new)
HXLINE( 198) this->zpp_next = null();
HXLINE( 190) this->zpp_critical = false;
HXLINE( 186) this->zpp_i = 0;
HXLINE( 182) this->zpp_inner = null();
HXLINE( 204) if (!(::zpp_nape::util::ZPP_InteractorList_obj::internal)) {
HXLINE( 204) HX_STACK_DO_THROW(((HX_("Error: Cannot instantiate ",c5,85,dd,08) + HX_("Interactor",79,ca,20,7c)) + HX_("Iterator derp!",30,02,d8,d7)));
}
}
Dynamic InteractorIterator_obj::__CreateEmpty() { return new InteractorIterator_obj; }
void *InteractorIterator_obj::_hx_vtable = 0;
Dynamic InteractorIterator_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< InteractorIterator_obj > _hx_result = new InteractorIterator_obj();
_hx_result->__construct();
return _hx_result;
}
bool InteractorIterator_obj::_hx_isInstanceOf(int inClassId) {
return inClassId==(int)0x00000001 || inClassId==(int)0x62678cc1;
}
bool InteractorIterator_obj::hasNext(){
HX_STACKFRAME(&_hx_pos_b7b8b9ff903a3671_240_hasNext)
HXLINE( 241) this->zpp_inner->zpp_inner->valmod();
HXLINE( 244) ::nape::phys::InteractorList _this = this->zpp_inner;
HXDLIN( 244) _this->zpp_inner->valmod();
HXDLIN( 244) if (_this->zpp_inner->zip_length) {
HXLINE( 244) _this->zpp_inner->zip_length = false;
HXDLIN( 244) _this->zpp_inner->user_length = _this->zpp_inner->inner->length;
}
HXDLIN( 244) int length = _this->zpp_inner->user_length;
HXLINE( 245) this->zpp_critical = true;
HXLINE( 246) if ((this->zpp_i < length)) {
HXLINE( 247) return true;
}
else {
HXLINE( 250) {
HXLINE( 251) this->zpp_next = ::nape::phys::InteractorIterator_obj::zpp_pool;
HXLINE( 252) ::nape::phys::InteractorIterator_obj::zpp_pool = hx::ObjectPtr<OBJ_>(this);
HXLINE( 253) this->zpp_inner = null();
}
HXLINE( 255) return false;
}
HXLINE( 246) return false;
}
HX_DEFINE_DYNAMIC_FUNC0(InteractorIterator_obj,hasNext,return )
::nape::phys::Interactor InteractorIterator_obj::next(){
HX_STACKFRAME(&_hx_pos_b7b8b9ff903a3671_264_next)
HXLINE( 265) this->zpp_critical = false;
HXLINE( 266) return this->zpp_inner->at(this->zpp_i++);
}
HX_DEFINE_DYNAMIC_FUNC0(InteractorIterator_obj,next,return )
::nape::phys::InteractorIterator InteractorIterator_obj::zpp_pool;
::nape::phys::InteractorIterator InteractorIterator_obj::get( ::nape::phys::InteractorList list){
HX_GC_STACKFRAME(&_hx_pos_b7b8b9ff903a3671_217_get)
HXLINE( 218) ::nape::phys::InteractorIterator ret;
HXDLIN( 218) if (hx::IsNull( ::nape::phys::InteractorIterator_obj::zpp_pool )) {
HXLINE( 219) ::zpp_nape::util::ZPP_InteractorList_obj::internal = true;
HXLINE( 220) ::nape::phys::InteractorIterator ret1 = ::nape::phys::InteractorIterator_obj::__alloc( HX_CTX );
HXLINE( 221) ::zpp_nape::util::ZPP_InteractorList_obj::internal = false;
HXLINE( 218) ret = ret1;
}
else {
HXLINE( 225) ::nape::phys::InteractorIterator r = ::nape::phys::InteractorIterator_obj::zpp_pool;
HXLINE( 226) ::nape::phys::InteractorIterator_obj::zpp_pool = r->zpp_next;
HXLINE( 218) ret = r;
}
HXLINE( 229) ret->zpp_i = 0;
HXLINE( 230) ret->zpp_inner = list;
HXLINE( 231) ret->zpp_critical = false;
HXLINE( 232) return ret;
}
STATIC_HX_DEFINE_DYNAMIC_FUNC1(InteractorIterator_obj,get,return )
hx::ObjectPtr< InteractorIterator_obj > InteractorIterator_obj::__new() {
hx::ObjectPtr< InteractorIterator_obj > __this = new InteractorIterator_obj();
__this->__construct();
return __this;
}
hx::ObjectPtr< InteractorIterator_obj > InteractorIterator_obj::__alloc(hx::Ctx *_hx_ctx) {
InteractorIterator_obj *__this = (InteractorIterator_obj*)(hx::Ctx::alloc(_hx_ctx, sizeof(InteractorIterator_obj), true, "nape.phys.InteractorIterator"));
*(void **)__this = InteractorIterator_obj::_hx_vtable;
__this->__construct();
return __this;
}
InteractorIterator_obj::InteractorIterator_obj()
{
}
void InteractorIterator_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(InteractorIterator);
HX_MARK_MEMBER_NAME(zpp_inner,"zpp_inner");
HX_MARK_MEMBER_NAME(zpp_i,"zpp_i");
HX_MARK_MEMBER_NAME(zpp_critical,"zpp_critical");
HX_MARK_MEMBER_NAME(zpp_next,"zpp_next");
HX_MARK_END_CLASS();
}
void InteractorIterator_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(zpp_inner,"zpp_inner");
HX_VISIT_MEMBER_NAME(zpp_i,"zpp_i");
HX_VISIT_MEMBER_NAME(zpp_critical,"zpp_critical");
HX_VISIT_MEMBER_NAME(zpp_next,"zpp_next");
}
hx::Val InteractorIterator_obj::__Field(const ::String &inName,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 4:
if (HX_FIELD_EQ(inName,"next") ) { return hx::Val( next_dyn() ); }
break;
case 5:
if (HX_FIELD_EQ(inName,"zpp_i") ) { return hx::Val( zpp_i ); }
break;
case 7:
if (HX_FIELD_EQ(inName,"hasNext") ) { return hx::Val( hasNext_dyn() ); }
break;
case 8:
if (HX_FIELD_EQ(inName,"zpp_next") ) { return hx::Val( zpp_next ); }
break;
case 9:
if (HX_FIELD_EQ(inName,"zpp_inner") ) { return hx::Val( zpp_inner ); }
break;
case 12:
if (HX_FIELD_EQ(inName,"zpp_critical") ) { return hx::Val( zpp_critical ); }
}
return super::__Field(inName,inCallProp);
}
bool InteractorIterator_obj::__GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 3:
if (HX_FIELD_EQ(inName,"get") ) { outValue = get_dyn(); return true; }
break;
case 8:
if (HX_FIELD_EQ(inName,"zpp_pool") ) { outValue = ( zpp_pool ); return true; }
}
return false;
}
hx::Val InteractorIterator_obj::__SetField(const ::String &inName,const hx::Val &inValue,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 5:
if (HX_FIELD_EQ(inName,"zpp_i") ) { zpp_i=inValue.Cast< int >(); return inValue; }
break;
case 8:
if (HX_FIELD_EQ(inName,"zpp_next") ) { zpp_next=inValue.Cast< ::nape::phys::InteractorIterator >(); return inValue; }
break;
case 9:
if (HX_FIELD_EQ(inName,"zpp_inner") ) { zpp_inner=inValue.Cast< ::nape::phys::InteractorList >(); return inValue; }
break;
case 12:
if (HX_FIELD_EQ(inName,"zpp_critical") ) { zpp_critical=inValue.Cast< bool >(); return inValue; }
}
return super::__SetField(inName,inValue,inCallProp);
}
bool InteractorIterator_obj::__SetStatic(const ::String &inName,Dynamic &ioValue,hx::PropertyAccess inCallProp)
{
switch(inName.length) {
case 8:
if (HX_FIELD_EQ(inName,"zpp_pool") ) { zpp_pool=ioValue.Cast< ::nape::phys::InteractorIterator >(); return true; }
}
return false;
}
void InteractorIterator_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_("zpp_inner",51,65,85,78));
outFields->push(HX_("zpp_i",a4,fa,3f,89));
outFields->push(HX_("zpp_critical",c4,9f,6b,cd));
outFields->push(HX_("zpp_next",98,61,7a,37));
super::__GetFields(outFields);
};
#ifdef HXCPP_SCRIPTABLE
static hx::StorageInfo InteractorIterator_obj_sMemberStorageInfo[] = {
{hx::fsObject /* ::nape::phys::InteractorList */ ,(int)offsetof(InteractorIterator_obj,zpp_inner),HX_("zpp_inner",51,65,85,78)},
{hx::fsInt,(int)offsetof(InteractorIterator_obj,zpp_i),HX_("zpp_i",a4,fa,3f,89)},
{hx::fsBool,(int)offsetof(InteractorIterator_obj,zpp_critical),HX_("zpp_critical",c4,9f,6b,cd)},
{hx::fsObject /* ::nape::phys::InteractorIterator */ ,(int)offsetof(InteractorIterator_obj,zpp_next),HX_("zpp_next",98,61,7a,37)},
{ hx::fsUnknown, 0, null()}
};
static hx::StaticInfo InteractorIterator_obj_sStaticStorageInfo[] = {
{hx::fsObject /* ::nape::phys::InteractorIterator */ ,(void *) &InteractorIterator_obj::zpp_pool,HX_("zpp_pool",81,5d,d4,38)},
{ hx::fsUnknown, 0, null()}
};
#endif
static ::String InteractorIterator_obj_sMemberFields[] = {
HX_("zpp_inner",51,65,85,78),
HX_("zpp_i",a4,fa,3f,89),
HX_("zpp_critical",c4,9f,6b,cd),
HX_("zpp_next",98,61,7a,37),
HX_("hasNext",6d,a5,46,18),
HX_("next",f3,84,02,49),
::String(null()) };
static void InteractorIterator_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(InteractorIterator_obj::zpp_pool,"zpp_pool");
};
#ifdef HXCPP_VISIT_ALLOCS
static void InteractorIterator_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(InteractorIterator_obj::zpp_pool,"zpp_pool");
};
#endif
hx::Class InteractorIterator_obj::__mClass;
static ::String InteractorIterator_obj_sStaticFields[] = {
HX_("zpp_pool",81,5d,d4,38),
HX_("get",96,80,4e,00),
::String(null())
};
void InteractorIterator_obj::__register()
{
InteractorIterator_obj _hx_dummy;
InteractorIterator_obj::_hx_vtable = *(void **)&_hx_dummy;
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_("nape.phys.InteractorIterator",1d,b9,33,e8);
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &InteractorIterator_obj::__GetStatic;
__mClass->mSetStaticField = &InteractorIterator_obj::__SetStatic;
__mClass->mMarkFunc = InteractorIterator_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(InteractorIterator_obj_sStaticFields);
__mClass->mMembers = hx::Class_obj::dupFunctions(InteractorIterator_obj_sMemberFields);
__mClass->mCanCast = hx::TCanCast< InteractorIterator_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = InteractorIterator_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = InteractorIterator_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = InteractorIterator_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
void InteractorIterator_obj::__boot()
{
{
HX_STACKFRAME(&_hx_pos_b7b8b9ff903a3671_194_boot)
HXDLIN( 194) zpp_pool = null();
}
}
} // end namespace nape
} // end namespace phys
| [
"hedgehog_fogs@mail.ru"
] | hedgehog_fogs@mail.ru |
28920896d70e029be1ef3b300f028c3f21a5ce92 | 6477f79d8dde7d6d5d7c2f7639c2bec9bb21bdc2 | /CSE 432/lab2.cpp | f3a1c9efbad37283a32799577227bd6b927bb28e | [] | no_license | atrimuhammad/Assignment | 9123682b2c2370e8076d94793b2ea6c08f7ad778 | d291c889311015cae032f432ed495cd165402f6b | refs/heads/master | 2020-09-08T07:47:59.313859 | 2015-11-23T16:33:40 | 2015-11-23T16:33:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,383 | cpp |
#include<graphics.h>
void drawLine(int x0, int y0, int x1, int y1)
{
int dx = abs(x1-x0), sx = x0<x1 ? 1 : -1;
int dy = abs(y1-y0), sy = y0<y1 ? 1 : -1;
int err = (dx>dy ? dx : -dy)/2, e2;
while(true)
{
putpixel(x0,y0,WHITE);
if (x0==x1 && y0==y1) break;
e2 = err;
if (e2 >-dx)
{
err -= dy;
x0 += sx;
}
if (e2 < dy)
{
err += dx;
y0 += sy;
}
}
}
void DrawCircle(int x0, int y0, int radius)
{
int x = radius;
int y = 0;
int radiusError = 1-x;
while(x >= y)
{
putpixel( x + x0, y + y0,WHITE);
putpixel( y + x0, x + y0,WHITE);
putpixel(-x + x0, y + y0,WHITE);
putpixel(-y + x0, x + y0,WHITE);
putpixel(-x + x0, -y + y0,WHITE);
putpixel(-y + x0, -x + y0,WHITE);
putpixel( x + x0, -y + y0,WHITE);
putpixel( y + x0, -x + y0,WHITE);
y++;
if (radiusError<0)
{
radiusError += 2 * y + 1;
}
else
{
x--;
radiusError += 2 * (y - x) + 1;
}
}
}
int main()
{
int w=400,H=400;
initwindow(400,400);
for(int i=0; i<400; i++)
{
putpixel(200,i,WHITE);
}
for(int i=0; i<400; i++)
{
putpixel(i,200,WHITE);
}
drawLine(w/2,H*3/4,w*3/4,H/2);
DrawCircle(300,300,100);
getch();
closegraph();
return 0;
}
| [
"tanvir002700@gmail.com"
] | tanvir002700@gmail.com |
93710c26af20a7ce26007b12d58d0d5d0ecda936 | a6134a7487b6efd81af9979b9c7540b4991fa643 | /include/parse/handparser.hpp | f30465857ca1c59f8a2731229835db1021cd951c | [
"Zlib"
] | permissive | jesmaz/numbat | ea26b5feeb1caf9a76c0f695f38fbe8675d39d3a | 1bf166d04c4782c6f80634f8eb0a6be6c4e30ce6 | refs/heads/master | 2020-04-12T09:42:51.173981 | 2016-10-03T14:35:32 | 2016-10-03T14:35:32 | 15,372,140 | 1 | 0 | null | 2016-10-03T14:35:33 | 2013-12-22T07:46:50 | C++ | UTF-8 | C++ | false | false | 405 | hpp | #pragma once
#include <lexer.hpp>
#include <parse/tree/base.hpp>
//Why have a complicated interface?
//These two functions should be sufficient
//Both take in an input program and build a parse tree, don't forget to delete it when you are finished with it
PTNode parse (const string & program);
PTNode parse (numbat::lexer::tkstring::const_iterator start, numbat::lexer::tkstring::const_iterator end); | [
"recursiveowl@gmail.com"
] | recursiveowl@gmail.com |
154bddfba5af57e9375471a43d04e53146a74d68 | 0742c6f0e72ee576562880aaf5489670c611636b | /ferro/src/crypto/hash.h | ce8ba4375a03a26d563e6f7d0c57ad2b9549daad | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Ferro-Crypto/Ferro-GUI | e816c8283343c9dd637a3bd46a0bf4c1c20a8a42 | b0bfcbcea360d68f9e30cdc75d1638c8c61c9c69 | refs/heads/master | 2020-03-18T09:29:31.767091 | 2018-05-23T12:35:37 | 2018-05-23T12:35:37 | 134,565,590 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,863 | h | // Copyright (c) 2014-2017, The Ferro Project
//
// 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 of the copyright holder 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 HOLDER 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.
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#pragma once
#include <stddef.h>
#include "common/pod-class.h"
#include "generic-ops.h"
namespace crypto {
extern "C" {
#include "hash-ops.h"
}
#pragma pack(push, 1)
POD_CLASS hash {
char data[HASH_SIZE];
};
POD_CLASS hash8 {
char data[8];
};
#pragma pack(pop)
static_assert(sizeof(hash) == HASH_SIZE, "Invalid structure size");
static_assert(sizeof(hash8) == 8, "Invalid structure size");
/*
Cryptonight hash functions
*/
inline void cn_fast_hash(const void *data, std::size_t length, hash &hash) {
cn_fast_hash(data, length, reinterpret_cast<char *>(&hash));
}
inline hash cn_fast_hash(const void *data, std::size_t length) {
hash h;
cn_fast_hash(data, length, reinterpret_cast<char *>(&h));
return h;
}
inline void cn_slow_hash(const void *data, std::size_t length, hash &hash) {
cn_slow_hash(data, length, reinterpret_cast<char *>(&hash));
}
inline void tree_hash(const hash *hashes, std::size_t count, hash &root_hash) {
tree_hash(reinterpret_cast<const char (*)[HASH_SIZE]>(hashes), count, reinterpret_cast<char *>(&root_hash));
}
}
CRYPTO_MAKE_HASHABLE(hash)
CRYPTO_MAKE_COMPARABLE(hash8)
| [
"support@ferro.cash"
] | support@ferro.cash |
3f21dd54fd18c96dbf80c41f74fe070ec15b4adf | 2a97852572aee0c7b767c87cd4f4124ba86fd2b2 | /grddata3.h | 240bb87f7e2a373fc45075813e436ed034454716 | [] | no_license | leduong92/C-Project | d6f80b0d68ae8365d83b65287e6a8f51d8e4ecc0 | c6e5a4c0c03bd697e3199151e98e8e5a27b35bde | refs/heads/master | 2020-09-03T11:26:46.274242 | 2019-11-04T08:28:50 | 2019-11-04T08:28:50 | 219,452,163 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 3,196 | h | #ifndef GRIDTDATA_H
#define GRIDTDATA_H
//========================================================================================
//
// FileName :GrdData3.h
// Class :TGridData
// :グリッドウインドウ・データクラスversion 3
// 修正 :2000.11.14 coba メモリ使用量の削減の為の大改造でバージョンアップ
// 列数無制限
// 修正 :2002.10.24 coba 行の挿入・削除機能を追加
// 修正 :2003.05.23 coba 行の削除時に、最終行が削除されないバグ取り
//========================================================================================
#include <windows.h>
#include <winuser.h>
#include <windef.h>
#include <winbase.h>
#define STRLEN_MAX 100
#define TITLELEN_MAX 40
#define ROW_DEFAULT 256
class TGridData
{
public:
TGridData(long rowblock,long totalcol,BOOL title=FALSE);
~TGridData();
// タイトル描画
BOOL SetTitle(int col,char* titleString);
BOOL GetTitle(int col,char* buf,int bufsize);
// データ代入
BOOL GetCel(char* buf, unsigned int bufsize,int col,int row );
char *GetCelEx(int col,int row);
long GetActiveRow(void);
// 行追加
long AddRow(long uTag=0);
long AddRow(char* colTitle, long uTag=0);
// タグ情報取得
long GetTag( long row){return(m_StrData[row].Tag);};
long GetCelTag(long col,long row){return( m_StrData[row].celTag[col]);}
BOOL SetCelTag(int col,int row, long data);
BOOL SearchCelTag(long* col,long* row,long searchVal,long satrtcol,long startrow,long direction);
// 現在の行の合計を返す
long GetTotalRows(void){return(m_LastRowNo+1);}
long GetTotalCols(void){return(m_TotalCols);}
long m_AllocBlock; // アロケートする単位
// 指定した行が有効かを判定
BOOL IsCelEnable( int col, int row);
protected:
// 行ヘッダのあるなし
BOOL m_RowTitleEnable;
// Viewより参照
BOOL SetCelData(int col,int row, char color,long cTag,char* data,char bkcolor);
long m_LastRowNo; // 保持している行の合計-1
long m_TotalCols;
// 見出し格納
// char m_Title[COL_LIMIT+1][TITLELEN_MAX+1]; // +1 はコピー用バッファ
char **m_Title;
// データ格納領域(列単位)
typedef struct{
char** d;
long *celTag;
long Tag; // ユーザ用
char colTitle[TITLELEN_MAX+1]; // 行題(名前と一致してない!!ごめんなさい)
char *color; // moji色 0=黒、1=赤 2= 青
char *bkcolor; // 背景色色 0=白、1=無効色
}LISTSTRDATA;
LISTSTRDATA *m_StrData;
long m_AllocRows; // アロケート済み行数
// 新規列の挿入
long AddCol(long targetCol);
// 列コピー,ペースト
BOOL ColCopy( long targetCol ,BOOL cut);
long ColPaste( long targetCol,BOOL insert);
BOOL m_CopyBufFull;
BOOL DataClear(void);
// セル背景色の変更
BOOL SetCelBkColor(int col,int row, char color);
// 行見出しの変更
BOOL ChangeRowTitle(long rowNo, char* newtitle);
// 行の挿入・削除
long RowDelete(long row);
long InsertNewRow(long row,long tag=0,char* title=NULL);
private:
// GetCelEx()用のバッファ
char *m_retBuf;
};
#endif
| [
"11810677@nok.com.vn"
] | 11810677@nok.com.vn |
9350603351c57920aefc458388caad5d88ba87c1 | a1fbf16243026331187b6df903ed4f69e5e8c110 | /cs/sdk/3d_sdk/3dsmax/ver-6.0/samples/modifiers/bonesdef/RayMeshIntersect/DllEntry.cpp | dca09722455a5d37b9131ecfc51a8b6e89abb893 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause"
] | permissive | OpenXRay/xray-15 | ca0031cf1893616e0c9795c670d5d9f57ca9beff | 1390dfb08ed20997d7e8c95147ea8e8cb71f5e86 | refs/heads/xd_dev | 2023-07-17T23:42:14.693841 | 2021-09-01T23:25:34 | 2021-09-01T23:25:34 | 23,224,089 | 64 | 23 | NOASSERTION | 2019-04-03T17:50:18 | 2014-08-22T12:09:41 | C++ | UTF-8 | C++ | false | false | 2,122 | cpp | /**********************************************************************
*<
FILE: DllEntry.cpp
DESCRIPTION: Contains the Dll Entry stuff
CREATED BY:
HISTORY:
*> Copyright (c) 2000, All Rights Reserved.
**********************************************************************/
#include "RayMeshIntersect.h"
extern ClassDesc2* GetRayMeshGridIntersectDesc();
HINSTANCE hInstance;
int controlsInit = FALSE;
// This function is called by Windows when the DLL is loaded. This
// function may also be called many times during time critical operations
// like rendering. Therefore developers need to be careful what they
// do inside this function. In the code below, note how after the DLL is
// loaded the first time only a few statements are executed.
BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
{
hInstance = hinstDLL; // Hang on to this DLL's instance handle.
if (!controlsInit) {
controlsInit = TRUE;
InitCustomControls(hInstance); // Initialize MAX's custom controls
InitCommonControls(); // Initialize Win95 controls
}
return (TRUE);
}
// This function returns a string that describes the DLL and where the user
// could purchase the DLL if they don't have it.
__declspec( dllexport ) const TCHAR* LibDescription()
{
return GetString(IDS_LIBDESCRIPTION);
}
// This function returns the number of plug-in classes this DLL
//TODO: Must change this number when adding a new class
__declspec( dllexport ) int LibNumberClasses()
{
return 1;
}
// This function returns the number of plug-in classes this DLL
__declspec( dllexport ) ClassDesc* LibClassDesc(int i)
{
switch(i) {
case 0: return GetRayMeshGridIntersectDesc();
default: return 0;
}
}
// This function returns a pre-defined constant indicating the version of
// the system under which it was compiled. It is used to allow the system
// to catch obsolete DLLs.
__declspec( dllexport ) ULONG LibVersion()
{
return VERSION_3DSMAX;
}
TCHAR *GetString(int id)
{
static TCHAR buf[256];
if (hInstance)
return LoadString(hInstance, id, buf, sizeof(buf)) ? buf : NULL;
return NULL;
}
| [
"paul-kv@yandex.ru"
] | paul-kv@yandex.ru |
90c4fcad1ef42fa85e87b56222e0f15bb611f8a5 | 465943c5ffac075cd5a617c47fd25adfe496b8b4 | /ATCSCREE.H | 2214f028e789e4c81f25be420371b6622d6abe4f | [] | no_license | paulanthonywilson/airtrafficcontrol | 7467f9eb577b24b77306709d7b2bad77f1b231b7 | 6c579362f30ed5f81cabda27033f06e219796427 | refs/heads/master | 2016-08-08T00:43:32.006519 | 2009-04-09T21:33:22 | 2009-04-09T21:33:22 | 172,292 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,143 | h | /*
Base class for ATC windows
Paul Wilson
ver 0.0
16/4/96
*/
# ifndef _ATCSCREE_H
# define _ATCSCREE_H
# include <conio.h>
# include "stdatc.h"
# include "landmark.h"
# define ATC_TEXT_MODE C4350
class ATCScreen {
protected:
const unsigned char winleft_c; /* left window coordinate */
const unsigned char wintop_c; /* top window coordinate */
const unsigned char winright_c; /* right window coordinate */
const unsigned char winbottom_c; /* bottom window coordinate */
const unsigned char currmode_c; /* current video mode:
BW40, BW80, C40, C80, or C4350 */
int TextColour_c; // Normal text foreground colour
int BackColour_c; // Normal background colour;
void SelectScreen();
public:
ATCScreen
(
const unsigned char winleft_i,
const unsigned char wintop_i,
const unsigned char winright_i,
const unsigned char winbottom_i,
const unsigned char currmode_i,
int TextColour_i,
int BackColour_i
);
virtual void Refresh() = DEFERRED;
void LandmarkDesc (char *Desc_o, Landmark *Land_i);
};
# endif | [
"paul.wilson@merecomplexities.com"
] | paul.wilson@merecomplexities.com |
1d7dc44661876145e1ee9256f5b21a4159b6fe79 | 8d19ab53401030209dd7e5e655bdb0e2952bfa7e | /toonz/sources/stdfx/ino_fog.cpp | 8ee88b48f25c42a35e63686543cb3f25917e7322 | [
"BSD-3-Clause"
] | permissive | deruji/opentoonz | 825a74af1dbc89c62991458a352650c4ef766fde | ad5f6141388f796c5146876916c812bf1b1f0ff9 | refs/heads/master | 2021-05-03T09:41:12.454051 | 2016-04-22T21:08:08 | 2016-04-22T21:08:08 | 54,891,799 | 0 | 0 | null | 2016-04-22T21:08:08 | 2016-03-28T12:49:04 | C++ | UTF-8 | C++ | false | false | 8,288 | cpp | #if defined _WIN32 && !defined NOMINMAX
#define NOMINMAX
#endif
#include <sstream> /* std::ostringstream */
#include "tfxparam.h"
#include "stdfx.h"
#include "ino_common.h"
#include "igs_fog.h"
//------------------------------------------------------------
class ino_fog : public TStandardRasterFx
{
FX_PLUGIN_DECLARATION(ino_fog)
TRasterFxPort m_input;
TDoubleParamP m_radius;
TDoubleParamP m_curve;
TDoubleParamP m_power;
TDoubleParamP m_threshold_min;
TDoubleParamP m_threshold_max;
TBoolParamP m_alpha_rendering;
public:
ino_fog()
: m_radius(1.0), m_curve(1.0 * ino::param_range()), m_power(1.0 * ino::param_range()), m_threshold_min(0.0 * ino::param_range()), m_threshold_max(0.0 * ino::param_range()), m_alpha_rendering(false)
{
this->m_radius->setMeasureName("fxLength");
addInputPort("Source", this->m_input);
bindParam(this, "radius", this->m_radius);
bindParam(this, "curve", this->m_curve);
bindParam(this, "power", this->m_power);
bindParam(this, "threshold_min", this->m_threshold_min);
bindParam(this, "threshold_max", this->m_threshold_max);
bindParam(this, "alpha_rendering", this->m_alpha_rendering);
this->m_radius->setValueRange(0.0, 100.0);
this->m_curve->setValueRange(
0.1 * ino::param_range(), 10.0 * ino::param_range()); /* gammaカーブ */
this->m_power->setValueRange(
-2.0 * ino::param_range(), 2.0 * ino::param_range());
this->m_threshold_min->setValueRange(
0.0 * ino::param_range(), 1.01 * ino::param_range());
this->m_threshold_max->setValueRange(
0.0 * ino::param_range(), 1.01 * ino::param_range());
}
//------------------------------------------------------------
double get_render_real_radius(
const double frame, const TAffine affine)
{
return this->m_radius->getValue(frame) * ino::pixel_per_mm() /* render用単位にする */
* sqrt(fabs(affine.det())) /* 拡大縮小のGeometryを反映 */
;
}
void get_render_enlarge(
const double frame, const TAffine affine, TRectD &bBox)
{
const int margin = static_cast<int>(ceil(
this->get_render_real_radius(frame, affine)));
if (0 < margin) {
bBox = bBox.enlarge(static_cast<double>(margin));
}
}
//------------------------------------------------------------
bool doGetBBox(
double frame, TRectD &bBox, const TRenderSettings &info)
{
if (false == this->m_input.isConnected()) {
bBox = TRectD();
return false;
}
const bool ret = this->m_input->doGetBBox(frame, bBox, info);
this->get_render_enlarge(frame, info.m_affine, bBox);
return ret;
}
int getMemoryRequirement(
const TRectD &rect, double frame, const TRenderSettings &info)
{
TRectD bBox(rect);
this->get_render_enlarge(frame, info.m_affine, bBox);
return TRasterFx::memorySize(bBox, info.m_bpp);
}
void transform(
double frame, int port, const TRectD &rectOnOutput, const TRenderSettings &infoOnOutput, TRectD &rectOnInput, TRenderSettings &infoOnInput)
{
rectOnInput = rectOnOutput;
infoOnInput = infoOnOutput;
this->get_render_enlarge(
frame, infoOnOutput.m_affine, rectOnInput);
}
bool canHandle(
const TRenderSettings &info, double frame)
{
return true;
}
void doCompute(
TTile &tile, double frame, const TRenderSettings &rend_sets);
};
FX_PLUGIN_IDENTIFIER(ino_fog, "inoFogFx");
//------------------------------------------------------------
namespace
{
void fx_(
const TRasterP in_ras // with margin
,
const int margin, TRasterP out_ras // no margin
,
const int nthread, const double radius, const double curve, const double power, const double threshold_min, const double threshold_max, const bool alp_rend_sw)
{
TRasterGR8P out_gr8(
in_ras->getLy(), in_ras->getLx() * ino::channels() *
((TRaster64P)in_ras ? sizeof(unsigned short) : sizeof(unsigned char)));
out_gr8->lock();
TRasterGR8P ref_gr8(
in_ras->getLy(), in_ras->getLx() * sizeof(double));
ref_gr8->lock();
igs::fog::convert(
in_ras->getRawData() // BGRA
,
out_gr8->getRawData(), reinterpret_cast<double *>(ref_gr8->getRawData())
,
in_ras->getLy(), in_ras->getLx(), ino::channels(), ino::bits(in_ras)
,
nthread
,
radius, curve, 2, 0.0, power, threshold_min, threshold_max, alp_rend_sw);
ref_gr8->unlock();
ino::arr_to_ras(
out_gr8->getRawData(), ino::channels(), out_ras, margin);
out_gr8->unlock();
}
}
//------------------------------------------------------------
void ino_fog::doCompute(
TTile &tile, double frame, const TRenderSettings &rend_sets)
{
/*------ 接続していなければ処理しない ----------------------*/
if (!this->m_input.isConnected()) {
tile.getRaster()->clear(); /* 塗りつぶしクリア */
return;
}
/*------ サポートしていないPixelタイプはエラーを投げる -----*/
if (!((TRaster32P)tile.getRaster()) &&
!((TRaster64P)tile.getRaster())) {
throw TRopException("unsupported input pixel type");
}
/*------ 動作パラメータを得る ------------------------------*/
const double radius = this->get_render_real_radius(
frame, rend_sets.m_affine);
const double curve = this->m_curve->getValue(frame) /
ino::param_range();
const double power = this->m_power->getValue(frame) /
ino::param_range();
const double threshold_min =
this->m_threshold_min->getValue(frame) / ino::param_range();
const double threshold_max =
this->m_threshold_max->getValue(frame) / ino::param_range();
const bool alp_rend_sw = this->m_alpha_rendering->getValue();
const int nthread = 1;
/*------ fogがからないパラメータ値のときはfog処理しない ----*/
if (!igs::fog::have_change(radius, power, threshold_min)) {
this->m_input->compute(tile, frame, rend_sets);
return;
}
/*------ 表示の範囲を得る ----------------------------------*/
TRectD bBox = TRectD(
tile.m_pos /* Render画像上(Pixel単位)の位置 */
,
TDimensionD(/* Render画像上(Pixel単位)のサイズ */
tile.getRaster()->getLx(), tile.getRaster()->getLy()));
/*------ fog半径(=マージン)分表示範囲を広げる --------------*/
const int int_radius = static_cast<int>(ceil(radius));
if (0 < int_radius) {
bBox = bBox.enlarge(static_cast<double>(int_radius));
}
TTile enlarge_tile;
this->m_input->allocateAndCompute(
enlarge_tile, bBox.getP00(), TDimensionI(/* Pixel単位に四捨五入 */
static_cast<int>(bBox.getLx() + 0.5), static_cast<int>(bBox.getLy() + 0.5)),
tile.getRaster(), frame, rend_sets);
/* ------ 保存すべき画像メモリを塗りつぶしクリア ---------- */
tile.getRaster()->clear(); /* 塗りつぶしクリア */
/* ------ (app_begin)log記憶 ------------------------------ */
const bool log_sw = ino::log_enable_sw();
if (log_sw) {
std::ostringstream os;
os << "params"
<< " nthread " << nthread
<< " usr_radius " << this->m_radius->getValue(frame)
<< " real_radius " << radius
<< " int_radius " << int_radius
<< " curve " << curve
<< " power " << power
<< " threshold_min " << threshold_min
<< " threshold_max " << threshold_max
<< " alp_rend_sw " << alp_rend_sw
<< " tile w " << tile.getRaster()->getLx()
<< " h " << tile.getRaster()->getLy()
<< " pixbits " << ino::pixel_bits(tile.getRaster())
<< " frame " << frame
<< " rand_sets affine_det " << rend_sets.m_affine.det()
<< " shrink x " << rend_sets.m_shrinkX
<< " y " << rend_sets.m_shrinkY;
}
/* ------ fx処理 ------------------------------------------ */
try {
tile.getRaster()->lock();
fx_(enlarge_tile.getRaster() // with margin
,
int_radius // margin
,
tile.getRaster() // no margin
,
nthread, radius, curve, power, threshold_min, threshold_max, alp_rend_sw);
tile.getRaster()->unlock();
}
/* ------ error処理 --------------------------------------- */
catch (std::bad_alloc &e) {
tile.getRaster()->unlock();
if (log_sw) {
std::string str("std::bad_alloc <");
str += e.what();
str += '>';
}
throw;
} catch (std::exception &e) {
tile.getRaster()->unlock();
if (log_sw) {
std::string str("exception <");
str += e.what();
str += '>';
}
throw;
} catch (...) {
tile.getRaster()->unlock();
if (log_sw) {
std::string str("other exception");
}
throw;
}
}
| [
"shimizu.toshihiro@gmail.com"
] | shimizu.toshihiro@gmail.com |
fb3c9f710630ca33b8d0b2b2370ac3254e995257 | a5a99f646e371b45974a6fb6ccc06b0a674818f2 | /SimG4CMS/Calo/interface/HcalTestNS.h | 11f564181b0e866a498aa8c046c3b0264623f64d | [
"Apache-2.0"
] | permissive | cms-sw/cmssw | 4ecd2c1105d59c66d385551230542c6615b9ab58 | 19c178740257eb48367778593da55dcad08b7a4f | refs/heads/master | 2023-08-23T21:57:42.491143 | 2023-08-22T20:22:40 | 2023-08-22T20:22:40 | 10,969,551 | 1,006 | 3,696 | Apache-2.0 | 2023-09-14T19:14:28 | 2013-06-26T14:09:07 | C++ | UTF-8 | C++ | false | false | 439 | h | #ifndef SimG4CMS_HcalTestNS_h
#define SimG4CMS_HcalTestNS_h
#include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h"
#include "Geometry/HcalCommonData/interface/HcalNumberingFromDDD.h"
class HcalTestNS {
public:
HcalTestNS(const HcalDDDRecConstants*);
~HcalTestNS() = default;
bool compare(HcalNumberingFromDDD::HcalID const&, uint32_t const&);
private:
const HcalDDDRecConstants* hcons_;
};
#endif // HcalTestNS_h
| [
"sunanda.banerjee@cern.ch"
] | sunanda.banerjee@cern.ch |
c6a4a45f52798c6324feac346ef5042d84f9ff60 | d3be9994b96cb89510ee89c034a4bc6979b18013 | /Lect5_MiniGameStarter/TrainingFramework/Player.cpp | 509615dd8d55789845fb34f29feb05e0c244c806 | [] | no_license | DatDat0801/InternProject | 43f41669360d92ad397e520d37e2a9fd26bdf63b | 248ba9686a555299bd7575fe35f5bfc7de9fae2e | refs/heads/main | 2023-08-07T09:15:39.056361 | 2021-09-13T13:11:18 | 2021-09-13T13:11:18 | 392,207,581 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,247 | cpp | #include "Player.h"
#include <GameConfig.h>
#include "Shader.h"
#include "Texture.h"
#include "Model.h"
#include "Camera.h"
#include "Font.h"
#include "Sprite2D.h"
#include "Sprite3D.h"
#include "Text.h"
#include "GameButton.h"
#include "GameManager/ResourceManagers.h"
Player::Player(){}
void Player::Init(){
m_x = 30;
m_y = Globals::screenHeight / 2;
m_dx = 5;
m_dy = 5;
m_up = m_down = false;
auto model = ResourceManagers::GetInstance()->GetModel("Sprite2D.nfg");
//auto texture = ResourceManagers::GetInstance()->GetTexture("bg_main_menu.tga");
auto shader = ResourceManagers::GetInstance()->GetShader("TextureShader");
auto texture = ResourceManagers::GetInstance()->GetTexture("btn_close2.tga");
//shader = ResourceManagers::GetInstance()->GetShader("AnimationShader");
//m_player = std::make_shared<AnimationSprite>(model, shader, texture, 3, 0.5f);
m_player = std::make_shared<Sprite2D>(model, shader, texture);
m_player->Set2DPosition(60, 700);//(float)Globals::screenWidth / 2 , (float)Globals::screenHeight / 2. y->700-100
m_player->SetSize(130, 80);
}
void Player::Update(float deltaTime) {
}
void Player :: HandleInput(){}
void Player::Render(){
std::shared_ptr<Sprite2D> m_player;
}
void Player::Dispose(){} | [
"43485440+DatDat0801@users.noreply.github.com"
] | 43485440+DatDat0801@users.noreply.github.com |
1b2a42311c62d2fb4d8f344b2a520a591cd6ec31 | 3ca7dd1e368194aa2f884139d01f802073cbbe0d | /Codeforces/solved/12A/12A.cpp | 7af6c448660bad32756c2ad8af2a330816ca2f55 | [] | no_license | callistusystan/Algorithms-and-Data-Structures | 07fd1a87ff3cfb07326f9f18513386a575359447 | 560e860ca1e546b7e7930d4e1bf2dd7c3acbcbc5 | refs/heads/master | 2023-02-17T17:29:21.678463 | 2023-02-11T09:12:40 | 2023-02-11T09:12:40 | 113,574,821 | 8 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 381 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
vector<string> A(3);
for (int i=0;i<3;i++) cin >> A[i];
if (A[0][0] == A[2][2] && A[0][1] == A[2][1] && A[0][2] == A[2][0] && A[1][2] == A[1][0]) cout << "YES\n";
else cout << "NO\n";
return 0;
}
| [
"callistusystan@gmail.com"
] | callistusystan@gmail.com |
b4e86b3dff54a00a5887a1b1dfe51d6bc72fddf2 | eb46dbb888d661f8577da2ef3fdc744ffac1e5e4 | /modules/core/opencv_perf_core_pch.cpp | 4b8e978ec2ae95c0c7b465a31d9943e5133c55e2 | [] | no_license | gzhangx/opencv.builds | 251d692767285d2dd9a84e934618fa348417a9fe | 760936d44450a6660efb750cf8ad5726c33a4504 | refs/heads/master | 2023-08-03T09:46:02.559701 | 2021-09-17T22:19:37 | 2021-09-17T22:19:37 | 406,840,538 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 67 | cpp | #include "D:/work/acccn/opencv/modules/core/perf/perf_precomp.hpp"
| [
"gzhangx@hotmail.com"
] | gzhangx@hotmail.com |
c61c8c7e79cd01c5a969613d0b652eccebd33537 | 36df51dfe5747ed3533f57e7936f7d202e320985 | /agc033/A/main.cpp | 64dd8bc5e8eb08b26deceecf50eaaf2daeace9ce | [] | no_license | na-o-ys/atcoder-workspace | 42c56f6ddfdcc21abf74e6f112217568eb41990e | 341d6c86f35c1c04a10adaf3cce4b1b7c331b5db | refs/heads/master | 2020-05-31T18:15:45.564544 | 2019-08-11T01:10:04 | 2019-08-11T01:10:04 | 190,428,632 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,317 | cpp | #include <bits/stdc++.h>
#define loop(n, i) for(int i=0;i<n;i++)
#define loop1(n, i) for(int i=1;i<=n;i++)
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
using P = pair<int, int>;
int vis[1010][1010] = {};
int dir[] = { -1, 0, 1, 0, -1 };
void solve(long long H, long long W, std::vector<std::string> A){
V<P> q;
loop (H, i) loop (W, j) {
if (A[i][j] == '#') {
q.push_back({ i, j });
vis[i][j] = 1;
}
}
int ans = 0;
while (1) {
V<P> nxt;
for (auto p : q) {
loop (4, di) {
int i = p.first + dir[di], j = p.second + dir[di + 1];
if (i < 0 || i >= H || j < 0 || j >= W) continue;
if (vis[i][j]) continue;
vis[i][j] = 1;
nxt.push_back({ i, j });
}
}
if (nxt.empty()) break;
q = nxt;
ans++;
}
cout << ans << endl;
}
int main(){
long long H;
scanf("%lld",&H);
long long W;
scanf("%lld",&W);
std::vector<std::string> A(H);
for(int i = 0 ; i < H ; i++){
std::cin >> A[i];
}
solve(H, W, std::move(A));
return 0;
}
| [
"naoyoshi0511@gmail.com"
] | naoyoshi0511@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.