blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
264
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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 941
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | 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] | gha_created_at
timestamp[us] | gha_language
stringclasses 142
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 121
values | content
stringlengths 3
10.4M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
158
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01c2069e09a18e0ec7a0fd463996ca33f287dabf | d54916fe57f229a05361b822a22b881d15819c7f | /CONTEST/RANDOM/kick20_a_b.cpp | a906407ba7188a68d1ae82c4f640cf9b22ef50c3 | [] | no_license | ksb451/Cpp_DSA | 73dc8773fc4b5d896b133410809efce97437b9aa | 10544373f3e6558cf57d2270a30550b4761b0715 | refs/heads/master | 2023-06-25T10:48:04.473323 | 2021-07-22T17:04:31 | 2021-07-22T17:04:31 | 168,570,132 | 0 | 1 | null | 2020-10-26T15:03:34 | 2019-01-31T17:53:57 | C++ | UTF-8 | C++ | false | false | 3,620 | cpp | //**sn0wrus**//
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC optimization("unroll-loops, no-stack-protector")
//#pragma GCC target("avx,avx2,fma")
#define fast \
ios_base::sync_with_stdio(false); \
cout.tie(NULL); \
cin.tie(NULL);
#define write(a) \
for (auto x : a) \
{ \
cout << x << " "; \
} \
cout << endl;
#define read(a) \
for (auto &x : a) \
{ \
cin >> x; \
}
#define for0(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=n-1;i>=0;i++)
#define IN cin >>
#define OUT cout <<
#define endl "\n"
#define all(a) (a).begin(), (a).end()
#define allr(a) (a).rbegin(), (a).rend()
#define pb push_back
#define fi first
#define se second
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x ;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}'<<endl;}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}"<<endl;}
template<typename T, typename... Args>
void __print(T t, Args... args) // recursive variadic function
{
cout << t <<" " ;
__print(args...) ;
}
void nl()
{
cout<<endl;
}
using ll = long long int;
using ld = long double;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using plll = pair<ll,pll>;
using vll = vector<ll>;
using vi = vector<int>;
const ll MOD = (ll)(1e9) + 7LL;
const ll MM = 998244353LL;
const ll INF = INT_MAX;
const int dir8[8][2]={{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}};
const int dir4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const ll MAXN = 200005;
/*
for(int i=0;i<n-1;i++)
{
int a,b;
cin>>a>>b;
a--,b--;
adj[a].push_back(b);
adj[b].push_back(a);
}
*/
ll dp[51][1505];
ll rec(ll curr, ll p, vector<vll>&arr)
{
ll n = arr.size();
ll k = arr[0].size();
if(p==0)
{
return 0;
}
if((curr >= n) && ( p > 0))
{
return INT_MIN;
}
if(dp[curr][p] == -1)
{
ll ans = 0;
ll sum= 0;
for(int i=0;i<=k;i++)
{
if(i>0)
sum+=arr[curr][i-1];
if(p-i >= 0)
{
ans = max(ans, sum+rec(curr+1, p-i,arr));
}
else{
break;
}
}
return dp[curr][p]=ans;
}
else{
return dp[curr][p];
}
}
void solve()
{
ll n,k,p;
cin>>n>>k>>p;
vector<vll>arr(n,vll(k));
for(int i=0;i<n;i++){
for(int j=0;j<k;j++)
{
cin>>arr[i][j];
}
}
memset(dp,-1,sizeof(dp));
cout<<rec(0,p, arr)<<endl;
}
/*
1.check for ll for all variables.
2.check brackets in all equation and order of conditions.
3.check custom compare funtions if any.
4.check logic carefully.
5.Dont get stuck on one approch.
*/
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
ll tc = 1;
IN tc;
for (int i = 1; i <= tc; i++)
{
cout << "Case #" << i << ": ";
solve();
}
return 0;
} | [
"[email protected]"
] | |
f4911b76417db0c1f71f1e5fb84876dd5b491828 | eaa2c36f67b9a2d4089a406d21a4edfbfffab958 | /WM/SIP/TodayPlugin/WMPStatusPlugin/WMPStatusPlugin.cpp | e6f18d5c6afafc869eb9b7ba725ec6050c42292e | [] | no_license | span999/span-winceframework | adbcda722fe3cb2d52e9b02d5f5455c93b4e1dbf | 0b608d2a9c70665b142be9f014badfb2895f5047 | refs/heads/master | 2021-01-22T03:39:35.119871 | 2016-03-19T13:58:47 | 2016-03-19T13:58:47 | 32,636,707 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,797 | cpp | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code and is
// provided AS-IS. If you did not accept the terms of the license agreement, you
// are not authorized to use this sample source code. For the terms of the
// license, please see the license agreement between you and Microsoft.
//
//
// ****************************************************************************
// FILE: WMPStatusPlugin.cpp
// ABTRACT: Main implementation file for the today plug-in
// ****************************************************************************
//
#include "stdafx.h"
#define STATUS_STRING_LEN 500 // buffer size
#define NOTIFY_CNT 4 // number of notifications
//global variables
HICON g_hIcon;
UINT g_plugInHeight;
HINSTANCE g_hInst;
HWND g_hWnd;
BOOL g_WMPStatusChanged = FALSE; // WMP data has changed flag
HREGNOTIFY g_hNotify[NOTIFY_CNT]; // Handles to notifications
// forward function declarations
static INT InitializeClasses();
HRESULT RegisterNotifications();
HRESULT UnregisterNotifications();
/*************************************************************************/
/* Entry point for the dll */
/*************************************************************************/
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
// The DLL is being loaded for the first time by a given process.
// Perform per-process initialization here. If the initialization
// is successful, return TRUE; if unsuccessful, return FALSE.
g_hInst = (HINSTANCE)hModule;
//load the icon
g_hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_WMPSTATUSICON), IMAGE_ICON, DRA::SCALEX(16), DRA::SCALEY(16) ,LR_DEFAULTCOLOR);
//initilize the application class, and set the global window handle
UnregisterClass((LPCTSTR)LoadString(g_hInst, IDS_WMPSTATUS_APPNAME,0,0), g_hInst);
InitializeClasses();
g_hWnd = 0;
break;
case DLL_PROCESS_DETACH:
// The DLL is being unloaded by a given process. Do any
// per-process clean up here, such as undoing what was done in
// DLL_PROCESS_ATTACH. The return value is ignored.
DestroyIcon(g_hIcon);
UnregisterNotifications();
UnregisterClass((LPCTSTR)LoadString(g_hInst, IDS_WMPSTATUS_APPNAME,0,0), g_hInst);
g_hInst = NULL;
break;
}
return TRUE;
}
/*************************************************************************/
/* Handle any messages that may be needed for the plugin */
/* Handled messages: */
/* WM_TODAYCUSTOM_QUERYREFRESHCACHE */
/* WM_LBUTTONUP */
/* WM_PAINT */
/* */
/* State and Notification Broker Messages: */
/* WM_CHANGE_TRACKARTIST: */
/* WM_CHANGE_ALBUMTITLE: */
/* WM_CHANGE_TRACKNUMBER: */
/* WM_CHANGE_TRACKTITLE: */
/* */
/*************************************************************************/
LRESULT CALLBACK WndProc (HWND hwnd, UINT uimessage, WPARAM wParam, LPARAM lParam)
{
switch (uimessage)
{
//check to see if a refresh is required
case WM_TODAYCUSTOM_QUERYREFRESHCACHE:
{
TODAYLISTITEM *ptliItem;
BOOL bReturn = FALSE;
// get the pointer to the item from the Today screen
ptliItem = (TODAYLISTITEM*)wParam;
// make sure we have a TODAYLISTITEM and that the shell is ready to go
if ((NULL == ptliItem) || (WaitForSingleObject(SHELL_API_READY_EVENT, 0) == WAIT_TIMEOUT))
{
return FALSE;
}
// check to see if our WMP data flag has been set, then reset it
bReturn = g_WMPStatusChanged;
g_WMPStatusChanged = FALSE;
// if this is the first time this is called, we should set our height
if (0 == ptliItem->cyp)
{
ptliItem->cyp = DRA::SCALEY(40);
bReturn = TRUE;
}
return bReturn;
}
case WM_CREATE:
break;
case WM_LBUTTONUP:
// toggle between play/pause if the WMP window is found
HWND hwndComm;
// find the handle to the plug-in window
// find this value each time in case WMP has been restarted by the user and the handle has changed
hwndComm = FindWindow(SZ_MEDIAPLAYERPLUGIN_COMMWINDOW_CLASSNAME, SZ_MEDIAPLAYERPLUGIN_COMMWINDOW_WINDOWNAME);
if (NULL != hwndComm)
{
// send a message to the WMP plug-in to toggle the play/pause state
PostMessage(hwndComm, WM_WMPTOGGLE, 0, 0);
}
break;
case WM_PAINT:
PAINTSTRUCT ps;
RECT rcWindBounds;
RECT rcMyBounds;
HDC hDC;
HFONT hFontOld;
TCHAR szTextBuffer[STATUS_STRING_LEN];
TCHAR szRegBuffer[STATUS_STRING_LEN];
COLORREF crText;
size_t nLen;
HRESULT hr;
GetWindowRect( hwnd, &rcWindBounds);
hDC = BeginPaint(hwnd, &ps);
// create a custom rectangle relative to the client area
rcMyBounds.left = 0;
rcMyBounds.top = DRA::SCALEY(2);
rcMyBounds.right = rcWindBounds.right - rcWindBounds.left;
rcMyBounds.bottom = rcWindBounds.bottom - rcWindBounds.top;
// draw the icon on the screen
SetBkMode(hDC, TRANSPARENT);
DrawIcon(hDC, DRA::SCALEY(2), 0, g_hIcon);
BOOL bIsFarEast;
LOGFONT lf;
HFONT hSysFont;
HFONT hFont;
//determine if this is a Far East platform
switch (PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())))
{
case LANG_CHINESE:
case LANG_KOREAN:
case LANG_JAPANESE:
bIsFarEast = TRUE;
break;
default:
bIsFarEast = FALSE;
break;
}
hSysFont = (HFONT) GetStockObject(SYSTEM_FONT);
GetObject(hSysFont, sizeof(LOGFONT), &lf);
// If it is far east, use a normal font at 9 points,
// otherwise use a bold font as 8 points
if (bIsFarEast)
{
lf.lfWeight = FW_NORMAL;
// Calculate the font size, making sure to round the result to the nearest integer
lf.lfHeight = (long) -((9.0 * (double)GetDeviceCaps(hDC, LOGPIXELSY) / 72.0)+.5);
}
else
{
lf.lfWeight = FW_BOLD;
// Calculate the font size, making sure to round the result to the nearest integer
lf.lfHeight = (long) -((8.0 * (double)GetDeviceCaps(hDC, LOGPIXELSY) / 72.0)+.5);
}
// create the font
hFont = CreateFontIndirect(&lf);
// Select the system font into the device context
hFontOld = (HFONT) SelectObject(hDC, hFont);
// determine the theme's current text color
// this color will change when the user picks a new theme,
// so get it each time the display needs to be painted
crText = SendMessage(GetParent(hwnd), TODAYM_GETCOLOR, (WPARAM) TODAYCOLOR_TEXT, NULL);
// set that color
SetTextColor(hDC, crText);
rcMyBounds.left = rcMyBounds.left + DRA::SCALEX(28);
// clear our strings
StringCchCopy(szRegBuffer, STATUS_STRING_LEN, L"");
StringCchCopy(szTextBuffer, STATUS_STRING_LEN, L"");
// Read the current data about the currently playing track
hr = RegistryGetString(SN_MEDIAPLAYERTRACKARTIST_ROOT, SN_MEDIAPLAYERTRACKARTIST_PATH, SN_MEDIAPLAYERTRACKARTIST_VALUE, szTextBuffer, STATUS_STRING_LEN);
hr = RegistryGetString(SN_MEDIAPLAYERALBUMTITLE_ROOT, SN_MEDIAPLAYERALBUMTITLE_PATH, SN_MEDIAPLAYERALBUMTITLE_VALUE, szRegBuffer, STATUS_STRING_LEN);
// form the first line of text and draw it
hr = StringCchLength(szTextBuffer, STATUS_STRING_LEN, &nLen);
if (nLen > 0)
{
StringCchCat(szTextBuffer, STATUS_STRING_LEN, L" : ");
}
StringCchCat(szTextBuffer, STATUS_STRING_LEN, szRegBuffer);
DrawText(hDC, szTextBuffer, -1, &rcMyBounds, DT_LEFT);
// start the 2nd line of text by clearing out our strings
StringCchCopy(szRegBuffer, STATUS_STRING_LEN, L"");
StringCchCopy(szTextBuffer, STATUS_STRING_LEN, L"");
// Read the current data about the currently playing track
hr = RegistryGetString(SN_MEDIAPLAYERTRACKNUMBER_ROOT, SN_MEDIAPLAYERTRACKNUMBER_PATH, SN_MEDIAPLAYERTRACKNUMBER_VALUE, szTextBuffer, STATUS_STRING_LEN);
hr = RegistryGetString(SN_MEDIAPLAYERTRACKTITLE_ROOT, SN_MEDIAPLAYERTRACKTITLE_PATH, SN_MEDIAPLAYERTRACKTITLE_VALUE, szRegBuffer, STATUS_STRING_LEN);
// form the 2nd line of text and draw it
hr = StringCchLength(szTextBuffer, STATUS_STRING_LEN, &nLen);
if (nLen > 0)
{
StringCchCat(szTextBuffer, STATUS_STRING_LEN, L" : ");
}
hr = StringCchLength(szTextBuffer, STATUS_STRING_LEN, &nLen);
if (nLen > 0)
{
StringCchCat(szTextBuffer, STATUS_STRING_LEN, szRegBuffer);
}
else
{
StringCchCat(szTextBuffer, STATUS_STRING_LEN, L"Windows Media Player Stopped");
}
//draw the program item text
rcMyBounds.top += DRA::SCALEX(20);
DrawText(hDC, szTextBuffer, -1, &rcMyBounds, DT_LEFT);
// Select the previous font back into the device context
SelectObject(hDC, hFontOld);
DeleteObject(hFont);
EndPaint(hwnd, &ps);
return 0;
case WM_DESTROY :
return 0;
// this fills in the background with the today screen image
case WM_ERASEBKGND:
TODAYDRAWWATERMARKINFO dwi;
dwi.hdc = (HDC)wParam;
GetClientRect(hwnd, &dwi.rc);
dwi.hwnd = hwnd;
SendMessage(GetParent(hwnd), TODAYM_DRAWWATERMARK, 0,(LPARAM)&dwi);
return TRUE;
// handle messages from the State and Notification Broker when WMP info has changed
case WM_CHANGE_TRACKARTIST:
case WM_CHANGE_ALBUMTITLE:
case WM_CHANGE_TRACKNUMBER:
case WM_CHANGE_TRACKTITLE:
g_WMPStatusChanged = TRUE;
break;
}
return DefWindowProc (hwnd, uimessage, wParam, lParam) ;
}
/*************************************************************************/
/* Create and register our window class for the today item */
/*************************************************************************/
INT InitializeClasses()
{
WNDCLASS wc;
memset(&wc, 0, sizeof(wc));
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.hInstance = g_hInst;
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszClassName = (LPCTSTR)LoadString(g_hInst, IDS_WMPSTATUS_APPNAME,0,0);
//register our window
if(!RegisterClass(&wc))
{
return 0 ;
}
return 1;
}
/*************************************************************************/
/* Initialize the DLL by creating a new window */
/*************************************************************************/
HWND InitializeCustomItem(TODAYLISTITEM *ptli, HWND hwndParent)
{
long lNotifyIndx;
LPCTSTR appName = (LPCTSTR)LoadString(g_hInst,IDS_WMPSTATUS_APPNAME,0,0);
//create a new window
g_hWnd = CreateWindow(appName,appName,WS_VISIBLE | WS_CHILD,
CW_USEDEFAULT,CW_USEDEFAULT,0,0,hwndParent, NULL, g_hInst, NULL) ;
//display the window
ShowWindow (g_hWnd, SW_SHOWNORMAL);
UpdateWindow (g_hWnd) ;
// clear out our notification handles
for (lNotifyIndx=0; lNotifyIndx < NOTIFY_CNT; lNotifyIndx++)
{
g_hNotify[lNotifyIndx] = NULL;
}
// register our State and Notification Broker notifications
RegisterNotifications();
return g_hWnd;
}
/*************************************************************************/
/* Register our State and Notification Broker notifications for */
/* changes in the Windows Media Player Mobile */
/*************************************************************************/
HRESULT RegisterNotifications()
{
HRESULT hr;
// Make sure we aren't already registered.
UnregisterNotifications();
// Register track artist change notification.
hr = RegistryNotifyWindow(
SN_MEDIAPLAYERTRACKARTIST_ROOT,
SN_MEDIAPLAYERTRACKARTIST_PATH,
SN_MEDIAPLAYERTRACKARTIST_VALUE,
g_hWnd,
WM_CHANGE_TRACKARTIST,
0,
NULL,
&g_hNotify[0]
);
if (SUCCEEDED(hr))
{
// Register album title change notification.
hr = RegistryNotifyWindow(
SN_MEDIAPLAYERALBUMTITLE_ROOT,
SN_MEDIAPLAYERALBUMTITLE_PATH,
SN_MEDIAPLAYERALBUMTITLE_VALUE,
g_hWnd,
WM_CHANGE_ALBUMTITLE,
0,
NULL,
&g_hNotify[1]
);
}
if (SUCCEEDED(hr))
{
// Register track number change notification.
hr = RegistryNotifyWindow(
SN_MEDIAPLAYERTRACKNUMBER_ROOT,
SN_MEDIAPLAYERTRACKNUMBER_PATH,
SN_MEDIAPLAYERTRACKNUMBER_VALUE,
g_hWnd,
WM_CHANGE_TRACKNUMBER,
0,
NULL,
&g_hNotify[2]
);
}
if (SUCCEEDED(hr))
{
// Register track title change notification.
hr = RegistryNotifyWindow(
SN_MEDIAPLAYERTRACKTITLE_ROOT,
SN_MEDIAPLAYERTRACKTITLE_PATH,
SN_MEDIAPLAYERTRACKTITLE_VALUE,
g_hWnd,
WM_CHANGE_TRACKTITLE,
0,
NULL,
&g_hNotify[3]
);
}
return hr;
}
/*************************************************************************/
/* Un-register our notifications */
/*************************************************************************/
HRESULT UnregisterNotifications()
{
long lNotifyIndx;
// For each notification handle:
for (lNotifyIndx=0; lNotifyIndx < NOTIFY_CNT; lNotifyIndx++)
{
if (g_hNotify[lNotifyIndx] != NULL)
{
// Close off the notification.
RegistryCloseNotification(g_hNotify[lNotifyIndx]);
}
g_hNotify[lNotifyIndx] = 0;
}
return S_OK;
}
| [
"[email protected]@73576caf-b2a5-d423-0eb8-556077f83d5b"
] | [email protected]@73576caf-b2a5-d423-0eb8-556077f83d5b |
e0dfb06425a0ff2e4dbbd398f385a0913b102f33 | 3b9b4049a8e7d38b49e07bb752780b2f1d792851 | /src/ui/compositor/transform_recorder.cc | 5867a54b57ba54d38eeb6e9cec6effd94ad8f507 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | webosce/chromium53 | f8e745e91363586aee9620c609aacf15b3261540 | 9171447efcf0bb393d41d1dc877c7c13c46d8e38 | refs/heads/webosce | 2020-03-26T23:08:14.416858 | 2018-08-23T08:35:17 | 2018-09-20T14:25:18 | 145,513,343 | 0 | 2 | Apache-2.0 | 2019-08-21T22:44:55 | 2018-08-21T05:52:31 | null | UTF-8 | C++ | false | false | 1,014 | cc | // Copyright 2015 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 "ui/compositor/transform_recorder.h"
#include "cc/playback/display_item_list.h"
#include "cc/playback/transform_display_item.h"
#include "ui/compositor/paint_context.h"
namespace ui {
TransformRecorder::TransformRecorder(const PaintContext& context)
: context_(context), transformed_(false) {}
TransformRecorder::~TransformRecorder() {
if (transformed_)
context_.list_->CreateAndAppendItem<cc::EndTransformDisplayItem>(
bounds_in_layer_);
}
void TransformRecorder::Transform(const gfx::Transform& transform,
const gfx::Size& size_in_context) {
DCHECK(!transformed_);
bounds_in_layer_ = context_.ToLayerSpaceBounds(size_in_context);
context_.list_->CreateAndAppendItem<cc::TransformDisplayItem>(
bounds_in_layer_, transform);
transformed_ = true;
}
} // namespace ui
| [
"[email protected]"
] | |
2f9614d1dff8f902f7ba86aa32dbf34cd915bc99 | 8f6f2f1c105b106f8b1b8309bb59630f5a166f05 | /property/qteditorfactory.cpp | e7ef7531ce36a866593675efe9585c7b49abfe0d | [] | no_license | lyl12345/LearnOpenGLQt | 230024ce813d512c72001401220fb1d66e8fbd15 | 7b1f7a62b8ed10de4c541ae8a3db4605f2fb5d54 | refs/heads/master | 2022-12-05T08:23:52.313521 | 2020-08-18T12:44:49 | 2020-08-18T12:44:49 | 276,817,848 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 89,001 | cpp | /****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Solutions component.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qteditorfactory.h"
#include "qtpropertybrowserutils_p.h"
#include <QSpinBox>
#include <QScrollBar>
#include <QComboBox>
#include <QAbstractItemView>
#include <QLineEdit>
#include <QDateTimeEdit>
#include <QHBoxLayout>
#include <QMenu>
#include <QKeyEvent>
#include <QApplication>
#include <QLabel>
#include <QToolButton>
#include <QColorDialog>
#include <QFontDialog>
#include <QSpacerItem>
#include <QStyleOption>
#include <QPainter>
#include <QMap>
#include "matrixeditor.h"
#if defined(Q_CC_MSVC)
# pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */
#endif
#if QT_VERSION >= 0x040400
QT_BEGIN_NAMESPACE
#endif
// Set a hard coded left margin to account for the indentation
// of the tree view icon when switching to an editor
static inline void setupTreeViewEditorMargin(QLayout *lt)
{
enum { DecorationMargin = 4 };
if (QApplication::layoutDirection() == Qt::LeftToRight)
lt->setContentsMargins(DecorationMargin, 0, 0, 0);
else
lt->setContentsMargins(0, 0, DecorationMargin, 0);
}
// ---------- EditorFactoryPrivate :
// Base class for editor factory private classes. Manages mapping of properties to editors and vice versa.
template <class Editor>
class EditorFactoryPrivate
{
public:
typedef QList<Editor *> EditorList;
typedef QMap<QtProperty *, EditorList> PropertyToEditorListMap;
typedef QMap<Editor *, QtProperty *> EditorToPropertyMap;
Editor *createEditor(QtProperty *property, QWidget *parent);
void initializeEditor(QtProperty *property, Editor *e);
void slotEditorDestroyed(QObject *object);
PropertyToEditorListMap m_createdEditors;
EditorToPropertyMap m_editorToProperty;
};
template <class Editor>
Editor *EditorFactoryPrivate<Editor>::createEditor(QtProperty *property, QWidget *parent)
{
Editor *editor = new Editor(parent);
initializeEditor(property, editor);
return editor;
}
template <class Editor>
void EditorFactoryPrivate<Editor>::initializeEditor(QtProperty *property, Editor *editor)
{
typename PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
if (it == m_createdEditors.end())
it = m_createdEditors.insert(property, EditorList());
it.value().append(editor);
m_editorToProperty.insert(editor, property);
}
template <class Editor>
void EditorFactoryPrivate<Editor>::slotEditorDestroyed(QObject *object)
{
const typename EditorToPropertyMap::iterator ecend = m_editorToProperty.end();
for (typename EditorToPropertyMap::iterator itEditor = m_editorToProperty.begin(); itEditor != ecend; ++itEditor) {
if (itEditor.key() == object) {
Editor *editor = itEditor.key();
QtProperty *property = itEditor.value();
const typename PropertyToEditorListMap::iterator pit = m_createdEditors.find(property);
if (pit != m_createdEditors.end()) {
pit.value().removeAll(editor);
if (pit.value().empty())
m_createdEditors.erase(pit);
}
m_editorToProperty.erase(itEditor);
return;
}
}
}
// ------------ QtSpinBoxFactory
class QtSpinBoxFactoryPrivate : public EditorFactoryPrivate<QSpinBox>
{
QtSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotReadOnlyChanged(QtProperty *property, bool readOnly);
void slotSetValue(int value);
};
void QtSpinBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSpinBox *editor = itEditor.next();
if (editor->value() != value) {
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
}
void QtSpinBoxFactoryPrivate::slotRangeChanged(QtProperty *property, int min, int max)
{
if (!m_createdEditors.contains(property))
return;
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setRange(min, max);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtSpinBoxFactoryPrivate::slotSingleStepChanged(QtProperty *property, int step)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setSingleStep(step);
editor->blockSignals(false);
}
}
void QtSpinBoxFactoryPrivate::slotReadOnlyChanged( QtProperty *property, bool readOnly)
{
if (!m_createdEditors.contains(property))
return;
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setReadOnly(readOnly);
editor->blockSignals(false);
}
}
void QtSpinBoxFactoryPrivate::slotSetValue(int value)
{
QObject *object = q_ptr->sender();
const QMap<QSpinBox *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QSpinBox *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor) {
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
}
/*!
\class QtSpinBoxFactory
\brief The QtSpinBoxFactory class provides QSpinBox widgets for
properties created by QtIntPropertyManager objects.
\sa QtAbstractEditorFactory, QtIntPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtSpinBoxFactory::QtSpinBoxFactory(QObject *parent)
: QtAbstractEditorFactory<QtIntPropertyManager>(parent)
{
d_ptr = new QtSpinBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtSpinBoxFactory::~QtSpinBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtSpinBoxFactory::connectPropertyManager(QtIntPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
connect(manager, SIGNAL(readOnlyChanged(QtProperty *, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtSpinBoxFactory::createEditor(QtIntPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QSpinBox *editor = d_ptr->createEditor(property, parent);
editor->setSingleStep(manager->singleStep(property));
editor->setRange(manager->minimum(property), manager->maximum(property));
editor->setValue(manager->value(property));
editor->setKeyboardTracking(false);
editor->setReadOnly(manager->isReadOnly(property));
connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtSpinBoxFactory::disconnectPropertyManager(QtIntPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(readOnlyChanged(QtProperty *, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
// QtSliderFactory
class QtSliderFactoryPrivate : public EditorFactoryPrivate<QSlider>
{
QtSliderFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSliderFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
void QtSliderFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QSlider *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSlider *editor = itEditor.next();
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
void QtSliderFactoryPrivate::slotRangeChanged(QtProperty *property, int min, int max)
{
if (!m_createdEditors.contains(property))
return;
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QSlider *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSlider *editor = itEditor.next();
editor->blockSignals(true);
editor->setRange(min, max);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtSliderFactoryPrivate::slotSingleStepChanged(QtProperty *property, int step)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QSlider *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QSlider *editor = itEditor.next();
editor->blockSignals(true);
editor->setSingleStep(step);
editor->blockSignals(false);
}
}
void QtSliderFactoryPrivate::slotSetValue(int value)
{
QObject *object = q_ptr->sender();
const QMap<QSlider *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QSlider *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor ) {
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
}
/*!
\class QtSliderFactory
\brief The QtSliderFactory class provides QSlider widgets for
properties created by QtIntPropertyManager objects.
\sa QtAbstractEditorFactory, QtIntPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtSliderFactory::QtSliderFactory(QObject *parent)
: QtAbstractEditorFactory<QtIntPropertyManager>(parent)
{
d_ptr = new QtSliderFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtSliderFactory::~QtSliderFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtSliderFactory::connectPropertyManager(QtIntPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtSliderFactory::createEditor(QtIntPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QSlider *editor = new QSlider(Qt::Horizontal, parent);
d_ptr->initializeEditor(property, editor);
editor->setSingleStep(manager->singleStep(property));
editor->setRange(manager->minimum(property), manager->maximum(property));
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtSliderFactory::disconnectPropertyManager(QtIntPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
}
// QtSliderFactory
class QtScrollBarFactoryPrivate : public EditorFactoryPrivate<QScrollBar>
{
QtScrollBarFactory *q_ptr;
Q_DECLARE_PUBLIC(QtScrollBarFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
void QtScrollBarFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QScrollBar *> itEditor( m_createdEditors[property]);
while (itEditor.hasNext()) {
QScrollBar *editor = itEditor.next();
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
void QtScrollBarFactoryPrivate::slotRangeChanged(QtProperty *property, int min, int max)
{
if (!m_createdEditors.contains(property))
return;
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QScrollBar *> itEditor( m_createdEditors[property]);
while (itEditor.hasNext()) {
QScrollBar *editor = itEditor.next();
editor->blockSignals(true);
editor->setRange(min, max);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtScrollBarFactoryPrivate::slotSingleStepChanged(QtProperty *property, int step)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QScrollBar *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QScrollBar *editor = itEditor.next();
editor->blockSignals(true);
editor->setSingleStep(step);
editor->blockSignals(false);
}
}
void QtScrollBarFactoryPrivate::slotSetValue(int value)
{
QObject *object = q_ptr->sender();
const QMap<QScrollBar *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QScrollBar *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtIntPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtScrollBarFactory
\brief The QtScrollBarFactory class provides QScrollBar widgets for
properties created by QtIntPropertyManager objects.
\sa QtAbstractEditorFactory, QtIntPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtScrollBarFactory::QtScrollBarFactory(QObject *parent)
: QtAbstractEditorFactory<QtIntPropertyManager>(parent)
{
d_ptr = new QtScrollBarFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtScrollBarFactory::~QtScrollBarFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtScrollBarFactory::connectPropertyManager(QtIntPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtScrollBarFactory::createEditor(QtIntPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QScrollBar *editor = new QScrollBar(Qt::Horizontal, parent);
d_ptr->initializeEditor(property, editor);
editor->setSingleStep(manager->singleStep(property));
editor->setRange(manager->minimum(property), manager->maximum(property));
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtScrollBarFactory::disconnectPropertyManager(QtIntPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)),
this, SLOT(slotRangeChanged(QtProperty *, int, int)));
disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)),
this, SLOT(slotSingleStepChanged(QtProperty *, int)));
}
// QtCheckBoxFactory
class QtCheckBoxFactoryPrivate : public EditorFactoryPrivate<QtBoolEdit>
{
QtCheckBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCheckBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, bool value);
void slotTextVisibleChanged(QtProperty *property, bool textVisible);
void slotSetValue(bool value);
};
void QtCheckBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, bool value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QtBoolEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QtBoolEdit *editor = itEditor.next();
editor->blockCheckBoxSignals(true);
editor->setChecked(value);
editor->blockCheckBoxSignals(false);
}
}
void QtCheckBoxFactoryPrivate::slotTextVisibleChanged(QtProperty *property, bool textVisible)
{
if (!m_createdEditors.contains(property))
return;
QtBoolPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QtBoolEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QtBoolEdit *editor = itEditor.next();
editor->setTextVisible(textVisible);
}
}
void QtCheckBoxFactoryPrivate::slotSetValue(bool value)
{
QObject *object = q_ptr->sender();
const QMap<QtBoolEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QtBoolEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtBoolPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtCheckBoxFactory
\brief The QtCheckBoxFactory class provides QCheckBox widgets for
properties created by QtBoolPropertyManager objects.
\sa QtAbstractEditorFactory, QtBoolPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtCheckBoxFactory::QtCheckBoxFactory(QObject *parent)
: QtAbstractEditorFactory<QtBoolPropertyManager>(parent)
{
d_ptr = new QtCheckBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtCheckBoxFactory::~QtCheckBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCheckBoxFactory::connectPropertyManager(QtBoolPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, bool)),
this, SLOT(slotPropertyChanged(QtProperty *, bool)));
connect(manager, SIGNAL(textVisibleChanged(QtProperty *, bool)),
this, SLOT(slotTextVisibleChanged(QtProperty *, bool)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtCheckBoxFactory::createEditor(QtBoolPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QtBoolEdit *editor = d_ptr->createEditor(property, parent);
editor->setChecked(manager->value(property));
editor->setTextVisible(manager->textVisible(property));
connect(editor, SIGNAL(toggled(bool)), this, SLOT(slotSetValue(bool)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCheckBoxFactory::disconnectPropertyManager(QtBoolPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, bool)),
this, SLOT(slotPropertyChanged(QtProperty *, bool)));
disconnect(manager, SIGNAL(textVisibleChanged(QtProperty *, bool)),
this, SLOT(slotTextVisibleChanged(QtProperty *, bool)));
}
// QtDoubleSpinBoxFactory
class QtDoubleSpinBoxFactoryPrivate : public EditorFactoryPrivate<QDoubleSpinBox>
{
QtDoubleSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, double value);
void slotRangeChanged(QtProperty *property, double min, double max);
void slotSingleStepChanged(QtProperty *property, double step);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotReadOnlyChanged(QtProperty *property, bool readOnly);
void slotSetValue(double value);
};
void QtDoubleSpinBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, double value)
{
QList<QDoubleSpinBox *> editors = m_createdEditors[property];
QListIterator<QDoubleSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QDoubleSpinBox *editor = itEditor.next();
if (editor->value() != value) {
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
}
void QtDoubleSpinBoxFactoryPrivate::slotRangeChanged(QtProperty *property,
double min, double max)
{
if (!m_createdEditors.contains(property))
return;
QtDoublePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QList<QDoubleSpinBox *> editors = m_createdEditors[property];
QListIterator<QDoubleSpinBox *> itEditor(editors);
while (itEditor.hasNext()) {
QDoubleSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setRange(min, max);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtDoubleSpinBoxFactoryPrivate::slotSingleStepChanged(QtProperty *property, double step)
{
if (!m_createdEditors.contains(property))
return;
QtDoublePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QList<QDoubleSpinBox *> editors = m_createdEditors[property];
QListIterator<QDoubleSpinBox *> itEditor(editors);
while (itEditor.hasNext()) {
QDoubleSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setSingleStep(step);
editor->blockSignals(false);
}
}
void QtDoubleSpinBoxFactoryPrivate::slotReadOnlyChanged( QtProperty *property, bool readOnly)
{
if (!m_createdEditors.contains(property))
return;
QtDoublePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QDoubleSpinBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QDoubleSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setReadOnly(readOnly);
editor->blockSignals(false);
}
}
void QtDoubleSpinBoxFactoryPrivate::slotDecimalsChanged(QtProperty *property, int prec)
{
if (!m_createdEditors.contains(property))
return;
QtDoublePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QList<QDoubleSpinBox *> editors = m_createdEditors[property];
QListIterator<QDoubleSpinBox *> itEditor(editors);
while (itEditor.hasNext()) {
QDoubleSpinBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setDecimals(prec);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtDoubleSpinBoxFactoryPrivate::slotSetValue(double value)
{
QObject *object = q_ptr->sender();
const QMap<QDoubleSpinBox *, QtProperty *>::ConstIterator itcend = m_editorToProperty.constEnd();
for (QMap<QDoubleSpinBox *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != itcend; ++itEditor) {
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtDoublePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
}
/*! \class QtDoubleSpinBoxFactory
\brief The QtDoubleSpinBoxFactory class provides QDoubleSpinBox
widgets for properties created by QtDoublePropertyManager objects.
\sa QtAbstractEditorFactory, QtDoublePropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory(QObject *parent)
: QtAbstractEditorFactory<QtDoublePropertyManager>(parent)
{
d_ptr = new QtDoubleSpinBoxFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtDoubleSpinBoxFactory::~QtDoubleSpinBoxFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDoubleSpinBoxFactory::connectPropertyManager(QtDoublePropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, double)),
this, SLOT(slotPropertyChanged(QtProperty *, double)));
connect(manager, SIGNAL(rangeChanged(QtProperty *, double, double)),
this, SLOT(slotRangeChanged(QtProperty *, double, double)));
connect(manager, SIGNAL(singleStepChanged(QtProperty *, double)),
this, SLOT(slotSingleStepChanged(QtProperty *, double)));
connect(manager, SIGNAL(decimalsChanged(QtProperty *, int)),
this, SLOT(slotDecimalsChanged(QtProperty *, int)));
connect(manager, SIGNAL(readOnlyChanged(QtProperty *, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtDoubleSpinBoxFactory::createEditor(QtDoublePropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
editor->setSingleStep(manager->singleStep(property));
editor->setDecimals(manager->decimals(property));
editor->setRange(manager->minimum(property), manager->maximum(property));
editor->setValue(manager->value(property));
editor->setKeyboardTracking(false);
editor->setReadOnly(manager->isReadOnly(property));
connect(editor, SIGNAL(valueChanged(double)), this, SLOT(slotSetValue(double)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDoubleSpinBoxFactory::disconnectPropertyManager(QtDoublePropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, double)),
this, SLOT(slotPropertyChanged(QtProperty *, double)));
disconnect(manager, SIGNAL(rangeChanged(QtProperty *, double, double)),
this, SLOT(slotRangeChanged(QtProperty *, double, double)));
disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, double)),
this, SLOT(slotSingleStepChanged(QtProperty *, double)));
disconnect(manager, SIGNAL(decimalsChanged(QtProperty *, int)),
this, SLOT(slotDecimalsChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(readOnlyChanged(QtProperty *, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
// QtLineEditFactory
class QtLineEditFactoryPrivate : public EditorFactoryPrivate<QLineEdit>
{
QtLineEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtLineEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QString &value);
void slotRegExpChanged(QtProperty *property, const QRegExp ®Exp);
void slotSetValue(const QString &value);
void slotEchoModeChanged(QtProperty *, int);
void slotReadOnlyChanged(QtProperty *, bool);
};
void QtLineEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QString &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QLineEdit *> itEditor( m_createdEditors[property]);
while (itEditor.hasNext()) {
QLineEdit *editor = itEditor.next();
if (editor->text() != value) {
editor->blockSignals(true);
editor->setText(value);
editor->blockSignals(false);
}
}
}
void QtLineEditFactoryPrivate::slotRegExpChanged(QtProperty *property,
const QRegExp ®Exp)
{
if (!m_createdEditors.contains(property))
return;
QtStringPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QLineEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QLineEdit *editor = itEditor.next();
editor->blockSignals(true);
const QValidator *oldValidator = editor->validator();
QValidator *newValidator = 0;
if (regExp.isValid()) {
newValidator = new QRegExpValidator(regExp, editor);
}
editor->setValidator(newValidator);
if (oldValidator)
delete oldValidator;
editor->blockSignals(false);
}
}
void QtLineEditFactoryPrivate::slotEchoModeChanged(QtProperty *property, int echoMode)
{
if (!m_createdEditors.contains(property))
return;
QtStringPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QLineEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QLineEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setEchoMode((EchoMode)echoMode);
editor->blockSignals(false);
}
}
void QtLineEditFactoryPrivate::slotReadOnlyChanged( QtProperty *property, bool readOnly)
{
if (!m_createdEditors.contains(property))
return;
QtStringPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QLineEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QLineEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setReadOnly(readOnly);
editor->blockSignals(false);
}
}
void QtLineEditFactoryPrivate::slotSetValue(const QString &value)
{
QObject *object = q_ptr->sender();
const QMap<QLineEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QLineEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtStringPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtLineEditFactory
\brief The QtLineEditFactory class provides QLineEdit widgets for
properties created by QtStringPropertyManager objects.
\sa QtAbstractEditorFactory, QtStringPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtLineEditFactory::QtLineEditFactory(QObject *parent)
: QtAbstractEditorFactory<QtStringPropertyManager>(parent)
{
d_ptr = new QtLineEditFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtLineEditFactory::~QtLineEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtLineEditFactory::connectPropertyManager(QtStringPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QString &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QString &)));
connect(manager, SIGNAL(regExpChanged(QtProperty *, const QRegExp &)),
this, SLOT(slotRegExpChanged(QtProperty *, const QRegExp &)));
connect(manager, SIGNAL(echoModeChanged(QtProperty*, int)),
this, SLOT(slotEchoModeChanged(QtProperty *, int)));
connect(manager, SIGNAL(readOnlyChanged(QtProperty*, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtLineEditFactory::createEditor(QtStringPropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QLineEdit *editor = d_ptr->createEditor(property, parent);
editor->setEchoMode((EchoMode)manager->echoMode(property));
editor->setReadOnly(manager->isReadOnly(property));
QRegExp regExp = manager->regExp(property);
if (regExp.isValid()) {
QValidator *validator = new QRegExpValidator(regExp, editor);
editor->setValidator(validator);
}
editor->setText(manager->value(property));
connect(editor, SIGNAL(textChanged(const QString &)),
this, SLOT(slotSetValue(const QString &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtLineEditFactory::disconnectPropertyManager(QtStringPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QString &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QString &)));
disconnect(manager, SIGNAL(regExpChanged(QtProperty *, const QRegExp &)),
this, SLOT(slotRegExpChanged(QtProperty *, const QRegExp &)));
disconnect(manager, SIGNAL(echoModeChanged(QtProperty*,int)),
this, SLOT(slotEchoModeChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(readOnlyChanged(QtProperty*, bool)),
this, SLOT(slotReadOnlyChanged(QtProperty *, bool)));
}
// QtDateEditFactory
class QtDateEditFactoryPrivate : public EditorFactoryPrivate<QDateEdit>
{
QtDateEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDate &value);
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max);
void slotSetValue(const QDate &value);
};
void QtDateEditFactoryPrivate::slotPropertyChanged(QtProperty *property, const QDate &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QDateEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QDateEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setDate(value);
editor->blockSignals(false);
}
}
void QtDateEditFactoryPrivate::slotRangeChanged(QtProperty *property,
const QDate &min, const QDate &max)
{
if (!m_createdEditors.contains(property))
return;
QtDatePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QListIterator<QDateEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QDateEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setDateRange(min, max);
editor->setDate(manager->value(property));
editor->blockSignals(false);
}
}
void QtDateEditFactoryPrivate::slotSetValue(const QDate &value)
{
QObject *object = q_ptr->sender();
const QMap<QDateEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QDateEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtDatePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtDateEditFactory
\brief The QtDateEditFactory class provides QDateEdit widgets for
properties created by QtDatePropertyManager objects.
\sa QtAbstractEditorFactory, QtDatePropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtDateEditFactory::QtDateEditFactory(QObject *parent)
: QtAbstractEditorFactory<QtDatePropertyManager>(parent)
{
d_ptr = new QtDateEditFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtDateEditFactory::~QtDateEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDateEditFactory::connectPropertyManager(QtDatePropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QDate &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QDate &)));
connect(manager, SIGNAL(rangeChanged(QtProperty *, const QDate &, const QDate &)),
this, SLOT(slotRangeChanged(QtProperty *, const QDate &, const QDate &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtDateEditFactory::createEditor(QtDatePropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QDateEdit *editor = d_ptr->createEditor(property, parent);
editor->setCalendarPopup(true);
editor->setDateRange(manager->minimum(property), manager->maximum(property));
editor->setDate(manager->value(property));
connect(editor, SIGNAL(dateChanged(const QDate &)),
this, SLOT(slotSetValue(const QDate &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDateEditFactory::disconnectPropertyManager(QtDatePropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QDate &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QDate &)));
disconnect(manager, SIGNAL(rangeChanged(QtProperty *, const QDate &, const QDate &)),
this, SLOT(slotRangeChanged(QtProperty *, const QDate &, const QDate &)));
}
// QtTimeEditFactory
class QtTimeEditFactoryPrivate : public EditorFactoryPrivate<QTimeEdit>
{
QtTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QTime &value);
void slotSetValue(const QTime &value);
};
void QtTimeEditFactoryPrivate::slotPropertyChanged(QtProperty *property, const QTime &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QTimeEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QTimeEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setTime(value);
editor->blockSignals(false);
}
}
void QtTimeEditFactoryPrivate::slotSetValue(const QTime &value)
{
QObject *object = q_ptr->sender();
const QMap<QTimeEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QTimeEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtTimePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtTimeEditFactory
\brief The QtTimeEditFactory class provides QTimeEdit widgets for
properties created by QtTimePropertyManager objects.
\sa QtAbstractEditorFactory, QtTimePropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtTimeEditFactory::QtTimeEditFactory(QObject *parent)
: QtAbstractEditorFactory<QtTimePropertyManager>(parent)
{
d_ptr = new QtTimeEditFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtTimeEditFactory::~QtTimeEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtTimeEditFactory::connectPropertyManager(QtTimePropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QTime &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QTime &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtTimeEditFactory::createEditor(QtTimePropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QTimeEdit *editor = d_ptr->createEditor(property, parent);
editor->setTime(manager->value(property));
connect(editor, SIGNAL(timeChanged(const QTime &)),
this, SLOT(slotSetValue(const QTime &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtTimeEditFactory::disconnectPropertyManager(QtTimePropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QTime &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QTime &)));
}
// QtDateTimeEditFactory
class QtDateTimeEditFactoryPrivate : public EditorFactoryPrivate<QDateTimeEdit>
{
QtDateTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDateTime &value);
void slotSetValue(const QDateTime &value);
};
void QtDateTimeEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QDateTime &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QDateTimeEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QDateTimeEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setDateTime(value);
editor->blockSignals(false);
}
}
void QtDateTimeEditFactoryPrivate::slotSetValue(const QDateTime &value)
{
QObject *object = q_ptr->sender();
const QMap<QDateTimeEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QDateTimeEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtDateTimePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtDateTimeEditFactory
\brief The QtDateTimeEditFactory class provides QDateTimeEdit
widgets for properties created by QtDateTimePropertyManager objects.
\sa QtAbstractEditorFactory, QtDateTimePropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent)
: QtAbstractEditorFactory<QtDateTimePropertyManager>(parent)
{
d_ptr = new QtDateTimeEditFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtDateTimeEditFactory::~QtDateTimeEditFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDateTimeEditFactory::connectPropertyManager(QtDateTimePropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QDateTime &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QDateTime &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtDateTimeEditFactory::createEditor(QtDateTimePropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
editor->setDateTime(manager->value(property));
connect(editor, SIGNAL(dateTimeChanged(const QDateTime &)),
this, SLOT(slotSetValue(const QDateTime &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtDateTimeEditFactory::disconnectPropertyManager(QtDateTimePropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QDateTime &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QDateTime &)));
}
// QtKeySequenceEditorFactory
class QtKeySequenceEditorFactoryPrivate : public EditorFactoryPrivate<QtKeySequenceEdit>
{
QtKeySequenceEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QKeySequence &value);
void slotSetValue(const QKeySequence &value);
};
void QtKeySequenceEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QKeySequence &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QtKeySequenceEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QtKeySequenceEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setKeySequence(value);
editor->blockSignals(false);
}
}
void QtKeySequenceEditorFactoryPrivate::slotSetValue(const QKeySequence &value)
{
QObject *object = q_ptr->sender();
const QMap<QtKeySequenceEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QtKeySequenceEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtKeySequencePropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtKeySequenceEditorFactory
\brief The QtKeySequenceEditorFactory class provides editor
widgets for properties created by QtKeySequencePropertyManager objects.
\sa QtAbstractEditorFactory
*/
/*!
Creates a factory with the given \a parent.
*/
QtKeySequenceEditorFactory::QtKeySequenceEditorFactory(QObject *parent)
: QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent)
{
d_ptr = new QtKeySequenceEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtKeySequenceEditorFactory::~QtKeySequenceEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtKeySequenceEditorFactory::connectPropertyManager(QtKeySequencePropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QKeySequence &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QKeySequence &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtKeySequenceEditorFactory::createEditor(QtKeySequencePropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QtKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
editor->setKeySequence(manager->value(property));
connect(editor, SIGNAL(keySequenceChanged(const QKeySequence &)),
this, SLOT(slotSetValue(const QKeySequence &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtKeySequenceEditorFactory::disconnectPropertyManager(QtKeySequencePropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QKeySequence &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QKeySequence &)));
}
// QtCharEdit
class QtCharEdit : public QWidget
{
Q_OBJECT
public:
QtCharEdit(QWidget *parent = 0);
QChar value() const;
bool eventFilter(QObject *o, QEvent *e);
public Q_SLOTS:
void setValue(const QChar &value);
Q_SIGNALS:
void valueChanged(const QChar &value);
protected:
void focusInEvent(QFocusEvent *e);
void focusOutEvent(QFocusEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);
void paintEvent(QPaintEvent *);
bool event(QEvent *e);
private slots:
void slotClearChar();
private:
void handleKeyEvent(QKeyEvent *e);
QChar m_value;
QLineEdit *m_lineEdit;
};
QtCharEdit::QtCharEdit(QWidget *parent)
: QWidget(parent), m_lineEdit(new QLineEdit(this))
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(m_lineEdit);
layout->setMargin(0);
m_lineEdit->installEventFilter(this);
m_lineEdit->setReadOnly(true);
m_lineEdit->setFocusProxy(this);
setFocusPolicy(m_lineEdit->focusPolicy());
setAttribute(Qt::WA_InputMethodEnabled);
}
bool QtCharEdit::eventFilter(QObject *o, QEvent *e)
{
if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
QContextMenuEvent *c = static_cast<QContextMenuEvent *>(e);
QMenu *menu = m_lineEdit->createStandardContextMenu();
QList<QAction *> actions = menu->actions();
QListIterator<QAction *> itAction(actions);
while (itAction.hasNext()) {
QAction *action = itAction.next();
action->setShortcut(QKeySequence());
QString actionString = action->text();
const int pos = actionString.lastIndexOf(QLatin1Char('\t'));
if (pos > 0)
actionString = actionString.remove(pos, actionString.length() - pos);
action->setText(actionString);
}
QAction *actionBefore = 0;
if (actions.count() > 0)
actionBefore = actions[0];
QAction *clearAction = new QAction(tr("Clear Char"), menu);
menu->insertAction(actionBefore, clearAction);
menu->insertSeparator(actionBefore);
clearAction->setEnabled(!m_value.isNull());
connect(clearAction, SIGNAL(triggered()), this, SLOT(slotClearChar()));
menu->exec(c->globalPos());
delete menu;
e->accept();
return true;
}
return QWidget::eventFilter(o, e);
}
void QtCharEdit::slotClearChar()
{
if (m_value.isNull())
return;
setValue(QChar());
emit valueChanged(m_value);
}
void QtCharEdit::handleKeyEvent(QKeyEvent *e)
{
const int key = e->key();
switch (key) {
case Qt::Key_Control:
case Qt::Key_Shift:
case Qt::Key_Meta:
case Qt::Key_Alt:
case Qt::Key_Super_L:
case Qt::Key_Return:
return;
default:
break;
}
const QString text = e->text();
if (text.count() != 1)
return;
const QChar c = text.at(0);
if (!c.isPrint())
return;
if (m_value == c)
return;
m_value = c;
const QString str = m_value.isNull() ? QString() : QString(m_value);
m_lineEdit->setText(str);
e->accept();
emit valueChanged(m_value);
}
void QtCharEdit::setValue(const QChar &value)
{
if (value == m_value)
return;
m_value = value;
QString str = value.isNull() ? QString() : QString(value);
m_lineEdit->setText(str);
}
QChar QtCharEdit::value() const
{
return m_value;
}
void QtCharEdit::focusInEvent(QFocusEvent *e)
{
m_lineEdit->event(e);
m_lineEdit->selectAll();
QWidget::focusInEvent(e);
}
void QtCharEdit::focusOutEvent(QFocusEvent *e)
{
m_lineEdit->event(e);
QWidget::focusOutEvent(e);
}
void QtCharEdit::keyPressEvent(QKeyEvent *e)
{
handleKeyEvent(e);
e->accept();
}
void QtCharEdit::keyReleaseEvent(QKeyEvent *e)
{
m_lineEdit->event(e);
}
void QtCharEdit::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
bool QtCharEdit::event(QEvent *e)
{
switch(e->type()) {
case QEvent::Shortcut:
case QEvent::ShortcutOverride:
case QEvent::KeyRelease:
e->accept();
return true;
default:
break;
}
return QWidget::event(e);
}
// QtCharEditorFactory
class QtCharEditorFactoryPrivate : public EditorFactoryPrivate<QtCharEdit>
{
QtCharEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCharEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QChar &value);
void slotSetValue(const QChar &value);
};
void QtCharEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QChar &value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QtCharEdit *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QtCharEdit *editor = itEditor.next();
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
void QtCharEditorFactoryPrivate::slotSetValue(const QChar &value)
{
QObject *object = q_ptr->sender();
const QMap<QtCharEdit *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QtCharEdit *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtCharPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtCharEditorFactory
\brief The QtCharEditorFactory class provides editor
widgets for properties created by QtCharPropertyManager objects.
\sa QtAbstractEditorFactory
*/
/*!
Creates a factory with the given \a parent.
*/
QtCharEditorFactory::QtCharEditorFactory(QObject *parent)
: QtAbstractEditorFactory<QtCharPropertyManager>(parent)
{
d_ptr = new QtCharEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtCharEditorFactory::~QtCharEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCharEditorFactory::connectPropertyManager(QtCharPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QChar &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QChar &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtCharEditorFactory::createEditor(QtCharPropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QtCharEdit *editor = d_ptr->createEditor(property, parent);
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(const QChar &)),
this, SLOT(slotSetValue(const QChar &)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCharEditorFactory::disconnectPropertyManager(QtCharPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QChar &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QChar &)));
}
// QtEnumEditorFactory
class QtEnumEditorFactoryPrivate : public EditorFactoryPrivate<QComboBox>
{
QtEnumEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtEnumEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotEnumNamesChanged(QtProperty *property, const QStringList &);
void slotEnumIconsChanged(QtProperty *property, const QMap<int, QIcon> &);
void slotSetValue(int value);
};
void QtEnumEditorFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<QComboBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QComboBox *editor = itEditor.next();
editor->blockSignals(true);
editor->setCurrentIndex(value);
editor->blockSignals(false);
}
}
void QtEnumEditorFactoryPrivate::slotEnumNamesChanged(QtProperty *property,
const QStringList &enumNames)
{
if (!m_createdEditors.contains(property))
return;
QtEnumPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QMap<int, QIcon> enumIcons = manager->enumIcons(property);
QListIterator<QComboBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QComboBox *editor = itEditor.next();
editor->blockSignals(true);
editor->clear();
editor->addItems(enumNames);
const int nameCount = enumNames.count();
for (int i = 0; i < nameCount; i++)
editor->setItemIcon(i, enumIcons.value(i));
editor->setCurrentIndex(manager->value(property));
editor->blockSignals(false);
}
}
void QtEnumEditorFactoryPrivate::slotEnumIconsChanged(QtProperty *property,
const QMap<int, QIcon> &enumIcons)
{
if (!m_createdEditors.contains(property))
return;
QtEnumPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
const QStringList enumNames = manager->enumNames(property);
QListIterator<QComboBox *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
QComboBox *editor = itEditor.next();
editor->blockSignals(true);
const int nameCount = enumNames.count();
for (int i = 0; i < nameCount; i++)
editor->setItemIcon(i, enumIcons.value(i));
editor->setCurrentIndex(manager->value(property));
editor->blockSignals(false);
}
}
void QtEnumEditorFactoryPrivate::slotSetValue(int value)
{
QObject *object = q_ptr->sender();
const QMap<QComboBox *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<QComboBox *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtEnumPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtEnumEditorFactory
\brief The QtEnumEditorFactory class provides QComboBox widgets for
properties created by QtEnumPropertyManager objects.
\sa QtAbstractEditorFactory, QtEnumPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtEnumEditorFactory::QtEnumEditorFactory(QObject *parent)
: QtAbstractEditorFactory<QtEnumPropertyManager>(parent)
{
d_ptr = new QtEnumEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtEnumEditorFactory::~QtEnumEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtEnumEditorFactory::connectPropertyManager(QtEnumPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
connect(manager, SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)),
this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtEnumEditorFactory::createEditor(QtEnumPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QComboBox *editor = d_ptr->createEditor(property, parent);
editor->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
editor->setMinimumContentsLength(1);
editor->view()->setTextElideMode(Qt::ElideRight);
QStringList enumNames = manager->enumNames(property);
editor->addItems(enumNames);
QMap<int, QIcon> enumIcons = manager->enumIcons(property);
const int enumNamesCount = enumNames.count();
for (int i = 0; i < enumNamesCount; i++)
editor->setItemIcon(i, enumIcons.value(i));
editor->setCurrentIndex(manager->value(property));
connect(editor, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetValue(int)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtEnumEditorFactory::disconnectPropertyManager(QtEnumPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotPropertyChanged(QtProperty *, int)));
disconnect(manager, SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)),
this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &)));
}
// QtCursorEditorFactory
Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase)
class QtCursorEditorFactoryPrivate
{
QtCursorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCursorEditorFactory)
public:
QtCursorEditorFactoryPrivate();
void slotPropertyChanged(QtProperty *property, const QCursor &cursor);
void slotEnumChanged(QtProperty *property, int value);
void slotEditorDestroyed(QObject *object);
QtEnumEditorFactory *m_enumEditorFactory;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<QtProperty *, QtProperty *> m_propertyToEnum;
QMap<QtProperty *, QtProperty *> m_enumToProperty;
QMap<QtProperty *, QList<QWidget *> > m_enumToEditors;
QMap<QWidget *, QtProperty *> m_editorToEnum;
bool m_updatingEnum;
};
QtCursorEditorFactoryPrivate::QtCursorEditorFactoryPrivate()
: m_updatingEnum(false)
{
}
void QtCursorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property, const QCursor &cursor)
{
// update enum property
QtProperty *enumProp = m_propertyToEnum.value(property);
if (!enumProp)
return;
m_updatingEnum = true;
m_enumPropertyManager->setValue(enumProp, cursorDatabase()->cursorToValue(cursor));
m_updatingEnum = false;
}
void QtCursorEditorFactoryPrivate::slotEnumChanged(QtProperty *property, int value)
{
if (m_updatingEnum)
return;
// update cursor property
QtProperty *prop = m_enumToProperty.value(property);
if (!prop)
return;
QtCursorPropertyManager *cursorManager = q_ptr->propertyManager(prop);
if (!cursorManager)
return;
#ifndef QT_NO_CURSOR
cursorManager->setValue(prop, QCursor(cursorDatabase()->valueToCursor(value)));
#endif
}
void QtCursorEditorFactoryPrivate::slotEditorDestroyed(QObject *object)
{
// remove from m_editorToEnum map;
// remove from m_enumToEditors map;
// if m_enumToEditors doesn't contains more editors delete enum property;
const QMap<QWidget *, QtProperty *>::ConstIterator ecend = m_editorToEnum.constEnd();
for (QMap<QWidget *, QtProperty *>::ConstIterator itEditor = m_editorToEnum.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QWidget *editor = itEditor.key();
QtProperty *enumProp = itEditor.value();
m_editorToEnum.remove(editor);
m_enumToEditors[enumProp].removeAll(editor);
if (m_enumToEditors[enumProp].isEmpty()) {
m_enumToEditors.remove(enumProp);
QtProperty *property = m_enumToProperty.value(enumProp);
m_enumToProperty.remove(enumProp);
m_propertyToEnum.remove(property);
delete enumProp;
}
return;
}
}
/*!
\class QtCursorEditorFactory
\brief The QtCursorEditorFactory class provides QComboBox widgets for
properties created by QtCursorPropertyManager objects.
\sa QtAbstractEditorFactory, QtCursorPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtCursorEditorFactory::QtCursorEditorFactory(QObject *parent)
: QtAbstractEditorFactory<QtCursorPropertyManager>(parent)
{
d_ptr = new QtCursorEditorFactoryPrivate();
d_ptr->q_ptr = this;
d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this);
d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this);
connect(d_ptr->m_enumPropertyManager, SIGNAL(valueChanged(QtProperty *, int)),
this, SLOT(slotEnumChanged(QtProperty *, int)));
d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtCursorEditorFactory::~QtCursorEditorFactory()
{
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCursorEditorFactory::connectPropertyManager(QtCursorPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QCursor &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QCursor &)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtCursorEditorFactory::createEditor(QtCursorPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
QtProperty *enumProp = 0;
if (d_ptr->m_propertyToEnum.contains(property)) {
enumProp = d_ptr->m_propertyToEnum[property];
} else {
enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cursorDatabase()->cursorShapeNames());
d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cursorDatabase()->cursorShapeIcons());
#ifndef QT_NO_CURSOR
d_ptr->m_enumPropertyManager->setValue(enumProp, cursorDatabase()->cursorToValue(manager->value(property)));
#endif
d_ptr->m_propertyToEnum[property] = enumProp;
d_ptr->m_enumToProperty[enumProp] = property;
}
QtAbstractEditorFactoryBase *af = d_ptr->m_enumEditorFactory;
QWidget *editor = af->createEditor(enumProp, parent);
d_ptr->m_enumToEditors[enumProp].append(editor);
d_ptr->m_editorToEnum[editor] = enumProp;
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtCursorEditorFactory::disconnectPropertyManager(QtCursorPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QCursor &)),
this, SLOT(slotPropertyChanged(QtProperty *, const QCursor &)));
}
// QtColorEditWidget
class QtColorEditWidget : public QWidget {
Q_OBJECT
public:
QtColorEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QColor &value);
Q_SIGNALS:
void valueChanged(const QColor &value);
protected:
void paintEvent(QPaintEvent *);
private Q_SLOTS:
void buttonClicked();
private:
QColor m_color;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
QtColorEditWidget::QtColorEditWidget(QWidget *parent) :
QWidget(parent),
m_pixmapLabel(new QLabel),
m_label(new QLabel),
m_button(new QToolButton)
{
QHBoxLayout *lt = new QHBoxLayout(this);
setupTreeViewEditorMargin(lt);
lt->setSpacing(0);
lt->addWidget(m_pixmapLabel);
lt->addWidget(m_label);
lt->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
m_button->setFixedWidth(20);
setFocusProxy(m_button);
setFocusPolicy(m_button->focusPolicy());
m_button->setText(tr("..."));
m_button->installEventFilter(this);
connect(m_button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
lt->addWidget(m_button);
m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color)));
m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
}
void QtColorEditWidget::setValue(const QColor &c)
{
if (m_color != c) {
m_color = c;
m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(c)));
m_label->setText(QtPropertyBrowserUtils::colorValueText(c));
}
}
void QtColorEditWidget::buttonClicked()
{
bool ok = false;
QRgb oldRgba = m_color.rgba();
QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this);
if (ok && newRgba != oldRgba) {
setValue(QColor::fromRgba(newRgba));
emit valueChanged(m_color);
}
}
bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
{
if (obj == m_button) {
switch (ev->type()) {
case QEvent::KeyPress:
case QEvent::KeyRelease: { // Prevent the QToolButton from handling Enter/Escape meant control the delegate
switch (static_cast<const QKeyEvent*>(ev)->key()) {
case Qt::Key_Escape:
case Qt::Key_Enter:
case Qt::Key_Return:
ev->ignore();
return true;
default:
break;
}
}
break;
default:
break;
}
}
return QWidget::eventFilter(obj, ev);
}
void QtColorEditWidget::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
// QtColorEditorFactoryPrivate
class QtColorEditorFactoryPrivate : public EditorFactoryPrivate<QtColorEditWidget>
{
QtColorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtColorEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QColor &value);
void slotSetValue(const QColor &value);
};
void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QColor &value)
{
const PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
if (it == m_createdEditors.end())
return;
QListIterator<QtColorEditWidget *> itEditor(it.value());
while (itEditor.hasNext())
itEditor.next()->setValue(value);
}
void QtColorEditorFactoryPrivate::slotSetValue(const QColor &value)
{
QObject *object = q_ptr->sender();
const EditorToPropertyMap::ConstIterator ecend = m_editorToProperty.constEnd();
for (EditorToPropertyMap::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtColorPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtColorEditorFactory
\brief The QtColorEditorFactory class provides color editing for
properties created by QtColorPropertyManager objects.
\sa QtAbstractEditorFactory, QtColorPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtColorEditorFactory::QtColorEditorFactory(QObject *parent) :
QtAbstractEditorFactory<QtColorPropertyManager>(parent),
d_ptr(new QtColorEditorFactoryPrivate())
{
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtColorEditorFactory::~QtColorEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtColorEditorFactory::connectPropertyManager(QtColorPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty*,QColor)),
this, SLOT(slotPropertyChanged(QtProperty*,QColor)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtColorEditorFactory::createEditor(QtColorPropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QtColorEditWidget *editor = d_ptr->createEditor(property, parent);
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(QColor)), this, SLOT(slotSetValue(QColor)));
connect(editor, SIGNAL(destroyed(QObject *)), this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtColorEditorFactory::disconnectPropertyManager(QtColorPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty*,QColor)), this, SLOT(slotPropertyChanged(QtProperty*,QColor)));
}
// QtFontEditWidget
class QtFontEditWidget : public QWidget {
Q_OBJECT
public:
QtFontEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QFont &value);
Q_SIGNALS:
void valueChanged(const QFont &value);
protected:
void paintEvent(QPaintEvent *);
private Q_SLOTS:
void buttonClicked();
private:
QFont m_font;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
QtFontEditWidget::QtFontEditWidget(QWidget *parent) :
QWidget(parent),
m_pixmapLabel(new QLabel),
m_label(new QLabel),
m_button(new QToolButton)
{
QHBoxLayout *lt = new QHBoxLayout(this);
setupTreeViewEditorMargin(lt);
lt->setSpacing(0);
lt->addWidget(m_pixmapLabel);
lt->addWidget(m_label);
lt->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
m_button->setFixedWidth(20);
setFocusProxy(m_button);
setFocusPolicy(m_button->focusPolicy());
m_button->setText(tr("..."));
m_button->installEventFilter(this);
connect(m_button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
lt->addWidget(m_button);
m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(m_font));
m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
}
void QtFontEditWidget::setValue(const QFont &f)
{
if (m_font != f) {
m_font = f;
m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(f));
m_label->setText(QtPropertyBrowserUtils::fontValueText(f));
}
}
void QtFontEditWidget::buttonClicked()
{
bool ok = false;
QFont newFont = QFontDialog::getFont(&ok, m_font, this, tr("Select Font"));
if (ok && newFont != m_font) {
QFont f = m_font;
// prevent mask for unchanged attributes, don't change other attributes (like kerning, etc...)
if (m_font.family() != newFont.family())
f.setFamily(newFont.family());
if (m_font.pointSize() != newFont.pointSize())
f.setPointSize(newFont.pointSize());
if (m_font.bold() != newFont.bold())
f.setBold(newFont.bold());
if (m_font.italic() != newFont.italic())
f.setItalic(newFont.italic());
if (m_font.underline() != newFont.underline())
f.setUnderline(newFont.underline());
if (m_font.strikeOut() != newFont.strikeOut())
f.setStrikeOut(newFont.strikeOut());
setValue(f);
emit valueChanged(m_font);
}
}
bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
{
if (obj == m_button) {
switch (ev->type()) {
case QEvent::KeyPress:
case QEvent::KeyRelease: { // Prevent the QToolButton from handling Enter/Escape meant control the delegate
switch (static_cast<const QKeyEvent*>(ev)->key()) {
case Qt::Key_Escape:
case Qt::Key_Enter:
case Qt::Key_Return:
ev->ignore();
return true;
default:
break;
}
}
break;
default:
break;
}
}
return QWidget::eventFilter(obj, ev);
}
void QtFontEditWidget::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
// QtFontEditorFactoryPrivate
class QtFontEditorFactoryPrivate : public EditorFactoryPrivate<QtFontEditWidget>
{
QtFontEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtFontEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QFont &value);
void slotSetValue(const QFont &value);
};
void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QFont &value)
{
const PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
if (it == m_createdEditors.end())
return;
QListIterator<QtFontEditWidget *> itEditor(it.value());
while (itEditor.hasNext())
itEditor.next()->setValue(value);
}
void QtFontEditorFactoryPrivate::slotSetValue(const QFont &value)
{
QObject *object = q_ptr->sender();
const EditorToPropertyMap::ConstIterator ecend = m_editorToProperty.constEnd();
for (EditorToPropertyMap::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtFontPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
/*!
\class QtFontEditorFactory
\brief The QtFontEditorFactory class provides font editing for
properties created by QtFontPropertyManager objects.
\sa QtAbstractEditorFactory, QtFontPropertyManager
*/
/*!
Creates a factory with the given \a parent.
*/
QtFontEditorFactory::QtFontEditorFactory(QObject *parent) :
QtAbstractEditorFactory<QtFontPropertyManager>(parent),
d_ptr(new QtFontEditorFactoryPrivate())
{
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtFontEditorFactory::~QtFontEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtFontEditorFactory::connectPropertyManager(QtFontPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty*,QFont)),
this, SLOT(slotPropertyChanged(QtProperty*,QFont)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtFontEditorFactory::createEditor(QtFontPropertyManager *manager,
QtProperty *property, QWidget *parent)
{
QtFontEditWidget *editor = d_ptr->createEditor(property, parent);
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(QFont)), this, SLOT(slotSetValue(QFont)));
connect(editor, SIGNAL(destroyed(QObject *)), this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtFontEditorFactory::disconnectPropertyManager(QtFontPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty*,QFont)), this, SLOT(slotPropertyChanged(QtProperty*,QFont)));
}
// QtMatrixFactoryPrivate
class QtMatrixEditorFactoryPrivate : public EditorFactoryPrivate<MatrixEditor>
{
QtMatrixEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtMatrixEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QMatrix4x4& value);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotSetValue(const QMatrix4x4& value);
};
void QtMatrixEditorFactoryPrivate::slotPropertyChanged(QtProperty *property, const QMatrix4x4& value)
{
if (!m_createdEditors.contains(property))
return;
QListIterator<MatrixEditor *> itEditor(m_createdEditors[property]);
while (itEditor.hasNext()) {
MatrixEditor *editor = itEditor.next();
if (editor->value() != value) {
editor->blockSignals(true);
editor->setValue(value);
editor->blockSignals(false);
}
}
}
void QtMatrixEditorFactoryPrivate::slotDecimalsChanged(QtProperty *property, int prec)
{
if (!m_createdEditors.contains(property))
return;
QtMatrixPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
QList<MatrixEditor *> editors = m_createdEditors[property];
QListIterator<MatrixEditor *> itEditor(editors);
while (itEditor.hasNext()) {
MatrixEditor *editor = itEditor.next();
editor->blockSignals(true);
editor->setDecimals(prec);
editor->setValue(manager->value(property));
editor->blockSignals(false);
}
}
void QtMatrixEditorFactoryPrivate::slotSetValue(const QMatrix4x4& value)
{
QObject *object = q_ptr->sender();
const QMap<MatrixEditor *, QtProperty *>::ConstIterator ecend = m_editorToProperty.constEnd();
for (QMap<MatrixEditor *, QtProperty *>::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor) {
if (itEditor.key() == object) {
QtProperty *property = itEditor.value();
QtMatrixPropertyManager *manager = q_ptr->propertyManager(property);
if (!manager)
return;
manager->setValue(property, value);
return;
}
}
}
/*!
Creates a factory with the given \a parent.
*/
QtMatrixEditorFactory::QtMatrixEditorFactory(QObject *parent)
: QtAbstractEditorFactory<QtMatrixPropertyManager>(parent)
{
d_ptr = new QtMatrixEditorFactoryPrivate();
d_ptr->q_ptr = this;
}
/*!
Destroys this factory, and all the widgets it has created.
*/
QtMatrixEditorFactory::~QtMatrixEditorFactory()
{
qDeleteAll(d_ptr->m_editorToProperty.keys());
delete d_ptr;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtMatrixEditorFactory::connectPropertyManager(QtMatrixPropertyManager *manager)
{
connect(manager, SIGNAL(valueChanged(QtProperty *, const QMatrix4x4&)),
this, SLOT(slotPropertyChanged(QtProperty *, const QMatrix4x4&)));
connect(manager, SIGNAL(decimalsChanged(QtProperty *, int)),
this, SLOT(slotDecimalsChanged(QtProperty *, int)));
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
QWidget *QtMatrixEditorFactory::createEditor(QtMatrixPropertyManager *manager, QtProperty *property,
QWidget *parent)
{
MatrixEditor *editor = d_ptr->createEditor(property, parent);
editor->setDecimals(manager->decimals(property));
editor->setValue(manager->value(property));
connect(editor, SIGNAL(valueChanged(const QMatrix4x4&)), this, SLOT(slotSetValue(const QMatrix4x4&)));
connect(editor, SIGNAL(destroyed(QObject *)),
this, SLOT(slotEditorDestroyed(QObject *)));
return editor;
}
/*!
\internal
Reimplemented from the QtAbstractEditorFactory class.
*/
void QtMatrixEditorFactory::disconnectPropertyManager(QtMatrixPropertyManager *manager)
{
disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QMatrix4x4&)),
this, SLOT(slotPropertyChanged(QtProperty *, const QMatrix4x4&)));
disconnect(manager, SIGNAL(decimalsChanged(QtProperty *, int)),
this, SLOT(slotDecimalsChanged(QtProperty *, int)));
}
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif
#include "moc_qteditorfactory.cpp"
#include "qteditorfactory.moc"
| [
"[email protected]"
] | |
5f8c6b891d2f04720bd0903c92d7d7db6070aa27 | a9ffc3e1824b1cf7bd3c50ef0ff40f58b1cde0e1 | /assignment linked lists/deleting duplicates.cpp | 3136b963f8edf8333cd6c81ff736994e692af092 | [] | no_license | Uma-Maheshwar-Reddy/Linear-Data-structures | 811153610d28ddf5fc8a52236a938848dc70db78 | b93bdf903f27839376a38eba2ad3aa78d59ca5f4 | refs/heads/master | 2021-01-13T10:19:34.085200 | 2016-12-16T07:27:25 | 2016-12-16T07:27:25 | 76,630,074 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,058 | cpp | #include<iostream>
using namespace std;
typedef
struct node
{
int data;
struct node *next;
} *lptr;
void addend(lptr l,int a)
{
lptr t=l;
while(t->next!=NULL)
{
t=t->next;
}
t->next=new node;
t=t->next;
t->data=a;
t->next=NULL;
}
lptr create()
{
lptr l;
int d;
cout<<"enter the elements -1 if you want to end ";
cin>>d;
if(d!=-1)
{
l=new node;
l->data=d;
l->next=NULL;
cout<<"enter element";
cin>>d;
while(d!=-1)
{
addend(l,d);
cout<<"enter element";
cin>>d;
}
}
return l;
}
void print(lptr l)
{
lptr t=l;
while(t!=NULL)
{
cout<<t->data<<" ";
t=t->next;
}
}
void delnode(lptr l,lptr t)
{
t->next=t->next->next;
}
lptr rem(lptr l)
{
lptr h,t;
h=l;
while(h->next!=NULL)
{
t=h;
while(t->next!=NULL)
{
if(t->next->data==h->data)
{
delnode(l,t);
if(t->next==NULL)
{
break;
}
}
else
t=t->next;
}
if(h->next==NULL)
break;
else
h=h->next;
}
return l;
}
int main()
{
lptr l,l1;
l=create();
print(l);
cout<<endl;
l1=rem(l);
print(l1);
return 0;
}
| [
"[email protected]"
] | |
82937e781689f7647ef88a0153fd184c53e205a5 | c348efe40b4afac1de31e1cf93b800510f9d52f6 | /Riverside Community College (RCC)/CIS-5/Data Files/Chapter 14/Source Code/Ch14_AddressOfOperator/testAdd.cpp | 0a4a9e079676239074d1ebb4f6a2b66f9d93241c | [] | no_license | acoustictime/CollegeCode | 5b57dc45459c35694e3df002a587bacc4f99f81a | a8ec647fa4b5a6a90f34f1c8715dfea88cefe6c6 | refs/heads/master | 2020-03-28T19:22:04.384018 | 2018-09-16T18:37:22 | 2018-09-16T18:37:22 | 148,968,472 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 268 | cpp | // Implementation file testAdd.cpp
#include <iostream>
#include "testAdd.h"
using namespace std;
void testAddress::setX(int inX)
{
x = inX;
}
void testAddress::printX() const
{
cout << x;
}
int& testAddress::addressOfX()
{
return x;
}
| [
"[email protected]"
] | |
923fa9f846c1e1778fdf6baa21fdddc029c2c4f2 | ab94a47e84d2005934f4d0d75bdc99bda904dc6d | /kovalenko.alexey/B8/Shape.hpp | d004373b7f591152ff0d3d4decc29aca9e76b405 | [] | no_license | alexmustdie/cpp-labs-2nd-sem | a997249df968d266381e8e4002b930685eb7cc93 | f15a33a091eaa99dcbba2e4a8e275fafa883c430 | refs/heads/master | 2020-03-21T18:07:24.801972 | 2018-11-22T14:03:17 | 2018-11-22T14:03:17 | 138,873,632 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 311 | hpp | #ifndef SHAPE_HPP
#define SHAPE_HPP
#include <iostream>
class Shape {
public:
Shape(int x, int y);
virtual ~Shape() = default;
bool isMoreLeft(const Shape &tmp) const;
bool isUpper(const Shape &tmp) const;
virtual void draw(std::ostream &stream) const = 0;
protected:
int x_, y_;
};
#endif
| [
"[email protected]"
] | |
dc5bb2c537d892666d82cf89378a774bacfc3ab4 | 8cf87b32ee554acecb889720fd26f1839b3f1652 | /echo_instance.h | 815ebe155739d60d0fff591873bdcc5c5288c219 | [] | no_license | ryan-becwar/StableMatching | 2383c9cd77d16037dd940b67e42f72426f6dbc8f | c3c035a1b187b30ecdebab8a91376214c8ba03db | refs/heads/master | 2021-04-30T16:06:00.588498 | 2017-04-27T17:00:41 | 2017-04-27T17:00:41 | 42,676,135 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,118 | h | #ifndef ECHO_INSTANCE__h
#define ECHO_INSTANCE__h
#include <vector>
#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
typedef map<string, double> msd;
struct Node {
int allocation;
int size;
msd attrs;
};
struct Edge {
int start;
int end;
int allocation;
int size;
double value;
msd attrs;
bool operator<(const Edge& rhs) const{
return value > rhs.value;
}
};
struct Instance {
vector<Node> lhsnodes;
vector<Node> rhsnodes;
vector<Edge> edges;
};
struct order_edge{
bool operator()(const Edge &left, const Edge &right){
if(left.start == right.start){
return(left.end < right.end);
}
return left.start < right.start;
}
};
Instance read_instance(void);
Instance read_csv_instance(string path);
void print_instance(Instance &I);
void print_instance_csv(Instance &I);
double get_value(Instance &I);
void order_edges(Instance &I);
vector<vector<double> > get_value_matrix(Instance &I);
vector<vector<unsigned int> > get_allocation_matrix(Instance& I);
void reset_allocation(Instance &I);
#endif
| [
"[email protected]"
] | |
9634ad6f870a109200ecbbe4984ab9e3d6be32ce | 8e39f4709bfe050a64d6496ca41d402750f91944 | /code/02947_나무 조각.cpp14.cpp | 03c80fec24ac8bf1c241819730ea80be0b64d643 | [] | no_license | LeeJehwan/Baekjoon-Online-Judge | 66fd0799087082988ff1a77fd1fda836bd0d6953 | 681a2c937be7a774edc1b21bfed3617e0ba1018b | refs/heads/master | 2020-04-16T17:48:32.470045 | 2019-08-03T17:57:01 | 2019-08-03T17:57:01 | 165,789,670 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 404 | cpp | #include <iostream>
using namespace std;
void print();
int arr[5];
void swap(int &a, int &b) {
int t = a;
a = b;
b = t;
print();
}
void print() {
for (auto x : arr)
cout << x << " ";
cout << '\n';
}
int main() {
for (int i = 0; i < 5; i++)
cin >> arr[i];
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 4 - i; j++) {
if (arr[j] > arr[j + 1])
swap(arr[j], arr[j + 1]);
}
}
} | [
"[email protected]"
] | |
d678fc1cc3790fc15b0c008a3f4cb759f56da259 | beab9eb3b2ca83252d40d04b9ea8dbec10006a7c | /include/mlib/ipow.h | 72a977d6c6f921c1aabad71b276ab205b98e6eeb | [
"MIT"
] | permissive | XNerv/mlib | 309008b1c2b38d40039291a420b5ca7c0d40e34f | aa133c8e4c8e5a94376229b2960f6a5670c327c1 | refs/heads/master | 2022-11-20T14:09:27.749349 | 2020-07-21T00:46:28 | 2020-07-21T00:46:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 398 | h | #pragma once
/*!
\file ipow.h Integer exponentiation function template
(c) Mircea Neacsu 2019
*/
#if __has_include ("defs.h")
#include "defs.h"
#endif
namespace mlib {
///integer exponentiation function
template <typename T>
T ipow (T base, int exp)
{
T result = 1;
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}
return result;
};
};
| [
"[email protected]"
] | |
6d4115c3f9f03942310bef7ba725d10d10ce3702 | f3a9174535cd7e76d1c1e0f0fa1a3929751fb48d | /SDK/PVR_AudioPlatformConfiguration_structs.hpp | 7595849dd1f5e699ca4cc06df0c14fd7e931aaaf | [] | no_license | hinnie123/PavlovVRSDK | 9fcdf97e7ed2ad6c5cb485af16652a4c83266a2b | 503f8d9a6770046cc23f935f2df1f1dede4022a8 | refs/heads/master | 2020-03-31T05:30:40.125042 | 2020-01-28T20:16:11 | 2020-01-28T20:16:11 | 151,949,019 | 5 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,852 | hpp | #pragma once
// PavlovVR (Dumped by Hinnie) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Enums
//---------------------------------------------------------------------------
// Enum AudioPlatformConfiguration.ESoundwaveSampleRateSettings
enum class ESoundwaveSampleRateSettings : uint8_t
{
Max = 0,
High = 1,
Medium = 2,
Low = 3,
Min = 4,
MatchDevice = 5
};
//---------------------------------------------------------------------------
//Script Structs
//---------------------------------------------------------------------------
// ScriptStruct AudioPlatformConfiguration.PlatformRuntimeAudioCompressionOverrides
// 0x0010
struct FPlatformRuntimeAudioCompressionOverrides
{
bool bOverrideCompressionTimes; // 0x0000(0x0001) (Edit, ZeroConstructor, IsPlainOldData)
unsigned char UnknownData00[0x3]; // 0x0001(0x0003) MISSED OFFSET
float DurationThreshold; // 0x0004(0x0004) (Edit, ZeroConstructor, IsPlainOldData)
int MaxNumRandomBranches; // 0x0008(0x0004) (Edit, ZeroConstructor, IsPlainOldData)
int SoundCueQualityIndex; // 0x000C(0x0004) (Edit, ZeroConstructor, IsPlainOldData)
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"[email protected]"
] | |
78e5d0945c3aceb55f68419607e5456ce460619f | 23ce4d52dbdd220456d8ac0882ddddc4e63d038c | /src/Word.h | a079b366252630f17523fa01fd29fc2815014340 | [] | no_license | galsasson/Logic | 2e29d6dcb28ea18236e433598b44eb397efda10c | bff7f13d1bd43ecd76d3ccf3912913e165d45a6e | refs/heads/master | 2021-01-22T11:37:20.697218 | 2013-05-07T16:48:15 | 2013-05-07T16:48:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 747 | h | //
// Word.h
// Logic
//
// Created by Ryan Bartley on 5/1/13.
//
//
#pragma once
#include "ofMain.h"
#include "Letter.h"
#include "Button.h"
class Word {
vector<Letter*> letters;
string word;
ofPoint position;
ofPoint transform;
ofTrueTypeFont font;
float depth;
string fontTitle;
int fontsize;
Button* button;
int zAnimation;
int animationAmount;
bool isButton;
public:
Word(ofPoint position, string font, string word, float depth, int fontsize, bool button);
~Word();
void animate();
void setup();
void draw();
string getWord();
bool getIsButton();
Button* getButton();
ofRectangle getBoundingBox();
};
| [
"[email protected]"
] | |
e3dfa45ec2f84f55c7bb6a5ecd8f71ca122b4285 | 43ceae15dc2c9fa776a743e8e95db4f93e037448 | /audio/AudioOutput.cpp | 5250e838afd5acd0cff84a6f52b4f8ed7d499c7d | [
"Unlicense"
] | permissive | ibrashon/libtgvoip | d14e74be77ac83870280dc477a5a235046224999 | 88d22e82cfdcba47553df882ee18089b12357f4b | refs/heads/public | 2021-01-19T13:44:03.574608 | 2017-04-09T16:19:52 | 2017-04-09T16:19:52 | 88,104,049 | 1 | 0 | null | 2017-04-12T23:04:13 | 2017-04-12T23:04:13 | null | UTF-8 | C++ | false | false | 1,091 | cpp | //
// libtgvoip is free and unencumbered public domain software.
// For more information, see http://unlicense.org or the UNLICENSE file
// you should have received with this source code distribution.
//
#include "AudioOutput.h"
#if defined(__ANDROID__)
#include "../os/android/AudioOutputOpenSLES.h"
#include "../os/android/AudioOutputAndroid.h"
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
#include "../os/darwin/AudioOutputAudioUnit.h"
#else
#include "../os/darwin/AudioOutputAudioUnitOSX.h"
#endif
#else
#error "Unsupported operating system"
#endif
#if defined(__ANDROID__)
int CAudioOutput::systemVersion;
#endif
CAudioOutput *CAudioOutput::Create(){
#if defined(__ANDROID__)
if(systemVersion<21)
return new CAudioOutputAndroid();
return new CAudioOutputOpenSLES();
#elif defined(__APPLE__)
return new CAudioOutputAudioUnit();
#endif
}
CAudioOutput::~CAudioOutput(){
}
int32_t CAudioOutput::GetEstimatedDelay(){
#if defined(__ANDROID__)
return systemVersion<21 ? 150 : 50;
#endif
return 0;
}
float CAudioOutput::GetLevel(){
return 0;
}
| [
"[email protected]"
] | |
61445b5c653ed50cd9de1078b1d3912c9321b53c | 5782b1f9a70f71b09018fd634f62f218df9c76a8 | /Functions.cpp | 209a77b914453d11db3a9c63d5b5f752f02c6afe | [] | no_license | RndmCodeGuy20/Competitive-Programming | e4e9ee8aad901127cbe525e9d4eb736e97f07d82 | 718979e838f7c4fd6c783b7bc75a095574c1cc9b | refs/heads/master | 2023-08-15T00:49:26.900414 | 2021-09-24T02:15:21 | 2021-09-24T02:15:21 | 392,888,120 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 494 | cpp | #include <bits/stdc++.h>
using namespace std;
int maxof(int a, int b, int c, int d)
{
int max;
if (a > b && a > c && a > d)
{
max = a;
}
else if (b > a && b > c && b > d)
{
max = b;
}
else if (c > a && c > b && c > d)
{
max = c;
}
else if (d > a && d > b && d > c)
{
max = d;
}
return max;
}
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << maxof(a, b, c, d);
return 0;
} | [
"[email protected]"
] | |
e61b0444a26a84f94d84b911cc7cfae1049a09d0 | b15e1f7d336ee67a69440c976225382de5de9407 | /FrameworkSocket/FrameworkCommon/WorkItemQueue.cpp | cdfa09c179886db3a5cae42299195ef17d45f555 | [] | no_license | heinsteinh/FtsEngine | 5ef66c1a1ef443aee59caf953a04c66b52937088 | ea275f26ae0ff897f696a6ea1f82df3bde459f8f | refs/heads/master | 2021-05-28T22:40:25.919833 | 2015-05-11T05:55:52 | 2015-05-11T05:55:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 103 | cpp |
#include "WorkItemQueue.h"
WorkItemQueue::WorkItemQueue()
{
}
WorkItemQueue::~WorkItemQueue()
{
}
| [
"[email protected]"
] | |
3e257966f0301f2e5694a3f777b6fe37a328c7c9 | c33c4b75cfbe4b3cfa819ccc487ac2aef7f1ca76 | /Code/BrainSerialandBehaviorsPlusHeartPlusAud/ColorFunctions.ino | 7f48f11ab4d2843c2d22e7d42309dc9de1064a95 | [] | no_license | quitmeyer/BrainCraft | ccace5767452edce87db26d8e64729d56cb4bdd5 | e354510607b4b9e83ab646f33a9561539d6c77a0 | refs/heads/master | 2021-01-21T22:06:35.110716 | 2017-06-24T16:24:24 | 2017-06-24T16:24:24 | 95,171,576 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,244 | ino |
//Mapped Out areas of the brain + add a bit randomness to their borders
void areasoftheBrainAnimated() {
for (int i = 0; i < NUMPIXELS; i++) {
char* type = LLobe[i];
//External Brain
if (type[0] == 'f') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(heartPWR, heartPWR, heartPWR));
}
//Internal Brain
else {
strip.setPixelColor(i, strip.Color(0, 100+random(30), 100+random(30)));
}
if (type[1] == 'v') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i+random(2), strip.Color(0, 150+random(40), random(10)));
}
//speech
if (type[1] == 's') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(10, 200+random(20), 0));
}
//auditory
if (type[1] == 'a') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(120, eegPWR, 200));
}
//thinking
if (type[1] == 't') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, eegPWR-100+random(10), eegPWR));
}
//moving
if (type[1] == 'm') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i+random(1), strip.Color(0, random(20), heartPWR));
}
//coordination
if (type[1] == 'c') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 200, 200));
}
}
//Finally turn on the whole strip with the values
strip.show(); // This sends the updated pixel color to the hardware.
}
//Mapped Out areas of the brain
void areasoftheBrain() {
for (int i = 0; i < NUMPIXELS; i++) {
char* type = LLobe[i];
//External Brain
if (type[0] == 'f') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(10, 10, 10));
}
//Internal Brain
else {
strip.setPixelColor(i, strip.Color(0, 100, 100));
}
/*
* Getting into the subtypes
*/
//Visual
if (type[1] == 'v') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 200, 0));
}
//speech
if (type[1] == 's') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(200, 200, 0));
}
//auditory
if (type[1] == 'a') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(200, 0, 200));
}
//thinking
if (type[1] == 't') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 00, 220));
}
//moving
if (type[1] == 'm') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 00, 200));
}
//coordination
if (type[1] == 'c') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 200, 200));
}
}
//Finally turn on the whole strip with the values
strip.show(); // This sends the updated pixel color to the hardware.
}
//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
for (int j = 0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q = 0; q < 3; q++) {
for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
strip.setPixelColor(i + q, Wheel( (i + j) % 255)); //turn every third pixel on
}
strip.show();
delay(wait);
for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
strip.setPixelColor(i + q, 0); //turn every third pixel off
}
}
}
}
void pixAllBlack() {
for (int i = 0; i < NUMPIXELS; i++) {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 0, 0));
}
strip.show(); // This sends the updated pixel color to the hardware.
}
void pixOnlyInside() {
for (int i = 0; i < NUMPIXELS; i++) {
char* type = LLobe[i];
if (type[0] == 'f') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 0, 0));
//Serial.println("foundoutsideepix ");
}
else {
strip.setPixelColor(i, strip.Color(0, 200, 200));
// Serial.println("foundinsidepix ");
}
strip.show(); // This sends the updated pixel color to the hardware.
}
}
void pixOnlyOutside() {
for (int i = 0; i < NUMPIXELS; i++) {
char* type = LLobe[i];
if (type[0] == 'f') {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(0, 200, 200));
//Serial.println("foundoutsideepix ");
}
else {
strip.setPixelColor(i, strip.Color(200, 0, 0));
//Serial.println("foundinsidepix ");
}
}
strip.show(); // This sends the updated pixel color to the hardware.
}
void pixAllRed() {
for (int i = 0; i < NUMPIXELS; i++) {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
strip.setPixelColor(i, strip.Color(10, 0, 0));
strip.show(); // This sends the updated pixel color to the hardware.
}
}
void pixAllSameColor(int r, int g, int b) {
for (int i = 0; i < NUMPIXELS; i++) {
strip.setPixelColor(i, strip.Color(r, g, b));
}
strip.show(); // This sends the updated pixel color to the hardware.
}
void pixAllSameColorWheel(uint32_t c) {
for (int i = 0; i < NUMPIXELS; i++) {
strip.setPixelColor(i, Wheel(c & 255));
strip.show(); // This sends the updated pixel color to the hardware.
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if (WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if (WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
| [
"[email protected]"
] | |
2d2d966269d7e5636f5a364bf43d356130e82478 | d215ec7816200beb150e8e5590d11188efffbd24 | /examples/CBuilder/Simple/GUIControls/TreeView/TreeViewExampleClasses.cpp | ee79faf202b144790e2ac516bbf3abdc8f97aa88 | [
"MIT"
] | permissive | Embarcadero/BoldForDelphi | 73d44498361a7628c911c2dd43f3333f632049e6 | 7ed023288af627140fe2907bb6309eab170bd454 | refs/heads/master | 2023-08-31T00:05:57.363773 | 2022-04-28T10:37:26 | 2022-04-28T10:37:26 | 297,292,443 | 139 | 54 | MIT | 2022-08-14T14:19:28 | 2020-09-21T09:32:27 | Pascal | UTF-8 | C++ | false | false | 15,151 | cpp | /*****************************************/
/* This file is autogenerated */
/* Any manual changes will be LOST! */
/*****************************************/
/* Generated 2001-12-07 15:10:52 */
/*****************************************/
/* This file should be stored in the */
/* same directory as the form/datamodule */
/* with the corresponding model */
/*****************************************/
/* Copyright notice: */
/* */
/*****************************************/
#include <vcl.h>
#pragma hdrstop
#include "TreeViewExampleClasses.hpp"
// interface uses
// interface dependancies
// attribute dependancies
#pragma link "BoldAttributes"
#pragma link "BoldDefs"
#pragma link "BoldSubscription"
#pragma link "BoldDeriver"
#pragma link "BoldElements"
#pragma link "BoldDomainElement"
#pragma link "BoldSystemRT"
#pragma link "BoldSystem"
#pragma link "BoldGeneratedCodeDictionary"
// implementation uses
// implementation dependancies
#include "BoldGeneratedCodeDictionary.hpp"
// Includefiles for methodimplementations
#define BoldMemberAssertInvalidObjectType = "Object of singlelink (%s.%s) is of wrong type (is %s, should be %s)";
// TBusinessClassesRoot
void __fastcall TBusinessClassesRootList::Add(TBusinessClassesRoot *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TBusinessClassesRootList::IndexOf(TBusinessClassesRoot *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TBusinessClassesRootList::Includes(TBusinessClassesRoot *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TBusinessClassesRoot* __fastcall TBusinessClassesRootList::AddNew()
{
TBusinessClassesRoot *result = dynamic_cast<TBusinessClassesRoot*>(InternalAddNew());
return result;
}
void __fastcall TBusinessClassesRootList::Insert(int index, TBusinessClassesRoot *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TBusinessClassesRoot* __fastcall TBusinessClassesRootList::GetBoldObject(int index)
{
TBusinessClassesRoot *result = dynamic_cast<TBusinessClassesRoot*>(GetElement(index));
return result;
}
void __fastcall TBusinessClassesRootList::SetBoldObject(int index, TBusinessClassesRoot *NewObject)
{
SetElement(index, NewObject);
}
// TBikeFrame
TBAString* __fastcall TBikeFrame::_Get_M_Name()
{
// assert(ValidateMember("TBikeFrame", "Name", 0, __classid(TBAString)));
TBAString *result = dynamic_cast<TBAString*>(BoldMembers[0]);
return result;
};
String __fastcall TBikeFrame::_GetName()
{
String result = M_Name->AsString;
return result;
}
void __fastcall TBikeFrame::_SetName(String NewValue)
{
M_Name->AsString = NewValue;
}
TBAInteger* __fastcall TBikeFrame::_Get_M_FrameSize()
{
// assert(ValidateMember("TBikeFrame", "FrameSize", 1, __classid(TBAInteger)));
TBAInteger *result = dynamic_cast<TBAInteger*>(BoldMembers[1]);
return result;
};
Integer __fastcall TBikeFrame::_GetFrameSize()
{
Integer result = M_FrameSize->AsInteger;
return result;
}
void __fastcall TBikeFrame::_SetFrameSize(Integer NewValue)
{
M_FrameSize->AsInteger = NewValue;
}
TMTBList* __fastcall TBikeFrame::_GetPartOf()
{
// assert(ValidateMember("TBikeFrame", "PartOf", 2, __classid(TMTBList)));
TMTBList *result = dynamic_cast<TMTBList*>(BoldMembers[2]);
return result;
}
void __fastcall TBikeFrameList::Add(TBikeFrame *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TBikeFrameList::IndexOf(TBikeFrame *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TBikeFrameList::Includes(TBikeFrame *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TBikeFrame* __fastcall TBikeFrameList::AddNew()
{
TBikeFrame *result = dynamic_cast<TBikeFrame*>(InternalAddNew());
return result;
}
void __fastcall TBikeFrameList::Insert(int index, TBikeFrame *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TBikeFrame* __fastcall TBikeFrameList::GetBoldObject(int index)
{
TBikeFrame *result = dynamic_cast<TBikeFrame*>(GetElement(index));
return result;
}
void __fastcall TBikeFrameList::SetBoldObject(int index, TBikeFrame *NewObject)
{
SetElement(index, NewObject);
}
// TMTB
TBAString* __fastcall TMTB::_Get_M_Name()
{
// assert(ValidateMember("TMTB", "Name", 0, __classid(TBAString)));
TBAString *result = dynamic_cast<TBAString*>(BoldMembers[0]);
return result;
};
String __fastcall TMTB::_GetName()
{
String result = M_Name->AsString;
return result;
}
void __fastcall TMTB::_SetName(String NewValue)
{
M_Name->AsString = NewValue;
}
TPartsList* __fastcall TMTB::_GetConsistsOf()
{
// assert(ValidateMember("TMTB", "ConsistsOf", 1, __classid(TPartsList)));
TPartsList *result = dynamic_cast<TPartsList*>(BoldMembers[1]);
return result;
}
TMTB_CompsList* __fastcall TMTB::_GetMTB_Comps()
{
// assert(ValidateMember("TMTB", "MTB_Comps", 2, __classid(TMTB_CompsList)));
TMTB_CompsList *result = dynamic_cast<TMTB_CompsList*>(BoldMembers[2]);
return result;
}
TBoldObjectReference* __fastcall TMTB::_Get_M_BuiltAround()
{
// assert(ValidateMember("TMTB", "BuiltAround", 3, __classid(TBoldObjectReference)));
TBoldObjectReference *result = dynamic_cast<TBoldObjectReference*>(BoldMembers[3]);
return result;
}
TBikeFrame* _fastcall TMTB::_GetBuiltAround()
{
// assert(not assigned(M_BuiltAround->BoldObject) or (M_BuiltAround->BoldObject is TBikeFrame), SysUtils.format(BoldMemberAssertInvalidObjectType, [ClassName, BuiltAround, M_BuiltAround->BoldObject->ClassName, __classid(TBikeFrame)]));
TBikeFrame *result = dynamic_cast<TBikeFrame*>(M_BuiltAround->BoldObject);
return result;
}
void __fastcall TMTB::_SetBuiltAround(TBikeFrame *value)
{
M_BuiltAround->BoldObject = value;
}
void __fastcall TMTBList::Add(TMTB *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TMTBList::IndexOf(TMTB *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TMTBList::Includes(TMTB *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TMTB* __fastcall TMTBList::AddNew()
{
TMTB *result = dynamic_cast<TMTB*>(InternalAddNew());
return result;
}
void __fastcall TMTBList::Insert(int index, TMTB *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TMTB* __fastcall TMTBList::GetBoldObject(int index)
{
TMTB *result = dynamic_cast<TMTB*>(GetElement(index));
return result;
}
void __fastcall TMTBList::SetBoldObject(int index, TMTB *NewObject)
{
SetElement(index, NewObject);
}
// TMTB_Comps
TBoldObjectReference* __fastcall TMTB_Comps::_Get_M_PartOf()
{
// assert(ValidateMember("TMTB_Comps", "PartOf", 0, __classid(TBoldObjectReference)));
TBoldObjectReference *result = dynamic_cast<TBoldObjectReference*>(BoldMembers[0]);
return result;
}
TMTB* _fastcall TMTB_Comps::_GetPartOf()
{
// assert(not assigned(M_PartOf->BoldObject) or (M_PartOf->BoldObject is TMTB), SysUtils.format(BoldMemberAssertInvalidObjectType, [ClassName, PartOf, M_PartOf->BoldObject->ClassName, __classid(TMTB)]));
TMTB *result = dynamic_cast<TMTB*>(M_PartOf->BoldObject);
return result;
}
TBoldObjectReference* __fastcall TMTB_Comps::_Get_M_ConsistsOf()
{
// assert(ValidateMember("TMTB_Comps", "ConsistsOf", 1, __classid(TBoldObjectReference)));
TBoldObjectReference *result = dynamic_cast<TBoldObjectReference*>(BoldMembers[1]);
return result;
}
TParts* _fastcall TMTB_Comps::_GetConsistsOf()
{
// assert(not assigned(M_ConsistsOf->BoldObject) or (M_ConsistsOf->BoldObject is TParts), SysUtils.format(BoldMemberAssertInvalidObjectType, [ClassName, ConsistsOf, M_ConsistsOf->BoldObject->ClassName, __classid(TParts)]));
TParts *result = dynamic_cast<TParts*>(M_ConsistsOf->BoldObject);
return result;
}
void __fastcall TMTB_CompsList::Add(TMTB_Comps *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TMTB_CompsList::IndexOf(TMTB_Comps *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TMTB_CompsList::Includes(TMTB_Comps *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TMTB_Comps* __fastcall TMTB_CompsList::AddNew()
{
TMTB_Comps *result = dynamic_cast<TMTB_Comps*>(InternalAddNew());
return result;
}
void __fastcall TMTB_CompsList::Insert(int index, TMTB_Comps *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TMTB_Comps* __fastcall TMTB_CompsList::GetBoldObject(int index)
{
TMTB_Comps *result = dynamic_cast<TMTB_Comps*>(GetElement(index));
return result;
}
void __fastcall TMTB_CompsList::SetBoldObject(int index, TMTB_Comps *NewObject)
{
SetElement(index, NewObject);
}
// TParts
TBAString* __fastcall TParts::_Get_M_Model()
{
// assert(ValidateMember("TParts", "Model", 0, __classid(TBAString)));
TBAString *result = dynamic_cast<TBAString*>(BoldMembers[0]);
return result;
};
String __fastcall TParts::_GetModel()
{
String result = M_Model->AsString;
return result;
}
void __fastcall TParts::_SetModel(String NewValue)
{
M_Model->AsString = NewValue;
}
TMTBList* __fastcall TParts::_GetPartOf()
{
// assert(ValidateMember("TParts", "PartOf", 1, __classid(TMTBList)));
TMTBList *result = dynamic_cast<TMTBList*>(BoldMembers[1]);
return result;
}
TMTB_CompsList* __fastcall TParts::_GetMTB_Comps()
{
// assert(ValidateMember("TParts", "MTB_Comps", 2, __classid(TMTB_CompsList)));
TMTB_CompsList *result = dynamic_cast<TMTB_CompsList*>(BoldMembers[2]);
return result;
}
void __fastcall TPartsList::Add(TParts *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TPartsList::IndexOf(TParts *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TPartsList::Includes(TParts *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TParts* __fastcall TPartsList::AddNew()
{
TParts *result = dynamic_cast<TParts*>(InternalAddNew());
return result;
}
void __fastcall TPartsList::Insert(int index, TParts *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TParts* __fastcall TPartsList::GetBoldObject(int index)
{
TParts *result = dynamic_cast<TParts*>(GetElement(index));
return result;
}
void __fastcall TPartsList::SetBoldObject(int index, TParts *NewObject)
{
SetElement(index, NewObject);
}
// TBrake
void __fastcall TBrakeList::Add(TBrake *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TBrakeList::IndexOf(TBrake *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TBrakeList::Includes(TBrake *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TBrake* __fastcall TBrakeList::AddNew()
{
TBrake *result = dynamic_cast<TBrake*>(InternalAddNew());
return result;
}
void __fastcall TBrakeList::Insert(int index, TBrake *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TBrake* __fastcall TBrakeList::GetBoldObject(int index)
{
TBrake *result = dynamic_cast<TBrake*>(GetElement(index));
return result;
}
void __fastcall TBrakeList::SetBoldObject(int index, TBrake *NewObject)
{
SetElement(index, NewObject);
}
// TGear
void __fastcall TGearList::Add(TGear *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TGearList::IndexOf(TGear *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TGearList::Includes(TGear *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TGear* __fastcall TGearList::AddNew()
{
TGear *result = dynamic_cast<TGear*>(InternalAddNew());
return result;
}
void __fastcall TGearList::Insert(int index, TGear *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TGear* __fastcall TGearList::GetBoldObject(int index)
{
TGear *result = dynamic_cast<TGear*>(GetElement(index));
return result;
}
void __fastcall TGearList::SetBoldObject(int index, TGear *NewObject)
{
SetElement(index, NewObject);
}
// TWheel
void __fastcall TWheelList::Add(TWheel *NewObject)
{
if (NewObject != NULL)
{
AddElement(NewObject);
}
}
int __fastcall TWheelList::IndexOf(TWheel *anObject)
{
int result = IndexOfElement(anObject);
return result;
}
int __fastcall TWheelList::Includes(TWheel *anObject) // boolean?
{
int result = IncludesElement(anObject);
return result;
}
TWheel* __fastcall TWheelList::AddNew()
{
TWheel *result = dynamic_cast<TWheel*>(InternalAddNew());
return result;
}
void __fastcall TWheelList::Insert(int index, TWheel *NewObject)
{
if (NewObject != NULL)
{
InsertElement(index, NewObject);
}
}
TWheel* __fastcall TWheelList::GetBoldObject(int index)
{
TWheel *result = dynamic_cast<TWheel*>(GetElement(index));
return result;
}
void __fastcall TWheelList::SetBoldObject(int index, TWheel *NewObject)
{
SetElement(index, NewObject);
}
char *GeneratedCodeCRC()
{
return "1108431894";
}
void __fastcall InstallObjectListClasses(TBoldGeneratedClassList *BoldObjectListClasses)
{
BoldObjectListClasses->AddObjectEntry("BusinessClassesRoot", __classid(TBusinessClassesRootList));
BoldObjectListClasses->AddObjectEntry("BikeFrame", __classid(TBikeFrameList));
BoldObjectListClasses->AddObjectEntry("MTB", __classid(TMTBList));
BoldObjectListClasses->AddObjectEntry("MTB_Comps", __classid(TMTB_CompsList));
BoldObjectListClasses->AddObjectEntry("Parts", __classid(TPartsList));
BoldObjectListClasses->AddObjectEntry("Brake", __classid(TBrakeList));
BoldObjectListClasses->AddObjectEntry("Gear", __classid(TGearList));
BoldObjectListClasses->AddObjectEntry("Wheel", __classid(TWheelList));
}
void __fastcall InstallBusinessClasses(TBoldGeneratedClassList *BoldObjectClasses)
{
BoldObjectClasses->AddObjectEntry("BusinessClassesRoot", __classid(TBusinessClassesRoot));
BoldObjectClasses->AddObjectEntry("BikeFrame", __classid(TBikeFrame));
BoldObjectClasses->AddObjectEntry("MTB", __classid(TMTB));
BoldObjectClasses->AddObjectEntry("MTB_Comps", __classid(TMTB_Comps));
BoldObjectClasses->AddObjectEntry("Parts", __classid(TParts));
BoldObjectClasses->AddObjectEntry("Brake", __classid(TBrake));
BoldObjectClasses->AddObjectEntry("Gear", __classid(TGear));
BoldObjectClasses->AddObjectEntry("Wheel", __classid(TWheel));
}
// the codedestricptor is initialized automatically
TBoldGeneratedCodeDescriptor *CodeDescriptor = GeneratedCodes()->AddGeneratedCodeDescriptorWithFunc("TreeViewExampleClasses", &InstallBusinessClasses, &InstallObjectListClasses, GeneratedCodeCRC());
// but should be unloaded manually when it is not needed anymore
void unregisterCode()
{
if (CodeDescriptor != NULL)
{
GeneratedCodes()->Remove(CodeDescriptor);
}
}
| [
"[email protected]"
] | |
7c306835d03f75bbcaccbea57568f0531ee00033 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_1482494_0/C++/Troy/b.cpp | 9b26d56ed7ff97755fcccda432047d0c11fdb791 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 2,721 | cpp | /*
* Author: Troy
* Created Time: 2012/4/28 10:05:51
* File Name: b.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <time.h>
#include <cctype>
#include <functional>
#include <deque>
#include <iomanip>
#include <bitset>
#include <assert.h>
#include <numeric>
#include <sstream>
#include <utility>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORD(i,a,b) for (int i=(a); i>=(b); i--)
#define REP(i,b) FOR(i,0,b)
#define sf scanf
#define pf printf
#define Maxn 1110
using namespace std;
const int maxint = -1u>>1;
const double pi = 3.14159265358979323;
const double eps = 1e-8;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<int>::iterator vit;
int n, now;
struct Level
{
int a, b, goal;
}d[Maxn];
int gettwo(int sum)
{
int mx = 0, ret = -1;
REP(i, n)
{
if (d[i].goal != 2 && d[i].b <= sum)
{
ret = i;
return ret;
}
}
return ret;
}
int getone(int sum)
{
int ret = -1, mx = 0;
REP(i, n)
if (d[i].goal == 0 && d[i].a <= sum)
{
//cout <<d[i].a <<" "<<mx <<" "<<ret <<endl;
if (d[i].b > mx)
{
ret = i;
mx = d[i].b;
}
}
return ret;
}
int main()
{
//freopen("B-small-attempt0.in", "r", stdin);
//freopen("B-small-attempt0.out", "w", stdout);
int T, ca = 0;
sf("%d", &T);
while (T--)
{
sf("%d", &n);
REP(i, n)
{
sf("%d%d", &d[i].a, &d[i].b);
d[i].goal = 0;
}
now = 0;
int ans = 0;
while (now < 2 * n)
{
int p1 = gettwo(now);
//cout <<p1 <<endl;
if (p1 != -1)
{
now += (d[p1].goal == 1 ? 1 : 2);
d[p1].goal = 2;
ans++;
continue;
}
int p2 = getone(now);
//cout <<p2 <<endl;
if (p2 == -1) break;
else
{
d[p2].goal = 1;
now++;
ans++;
continue;
}
}
if (now == 2 * n) pf("Case #%d: %d\n", ++ca, ans);
else pf("Case #%d: Too Bad\n", ++ca);
}
return 0;
}
| [
"[email protected]"
] | |
0484edd24607dd8b14fe9ac3b9a2e82d25893463 | 4c23be1a0ca76f68e7146f7d098e26c2bbfb2650 | /ic8h18/0.008/IC3H7CO | 6eae18ad0d984ed7b81710a57675f1724ff239a7 | [] | no_license | labsandy/OpenFOAM_workspace | a74b473903ddbd34b31dc93917e3719bc051e379 | 6e0193ad9dabd613acf40d6b3ec4c0536c90aed4 | refs/heads/master | 2022-02-25T02:36:04.164324 | 2019-08-23T02:27:16 | 2019-08-23T02:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 838 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.008";
object IC3H7CO;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1.0992e-23;
boundaryField
{
boundary
{
type empty;
}
}
// ************************************************************************* //
| [
"[email protected]"
] | ||
d2ac4479f2335fcb771f41646e48d1d70837edcc | 041dea11d127e81d6799976e5413600bba55e677 | /SimplyAUT_MotionController/SimplyAUT_MotionController/DialogFiles.cpp | 24de13ab1e41e27743656ef21bf7e40b44a1cc48 | [] | no_license | donkeithmitchell/SimplyAUT_MotionController | d5e5c7d3ca284fb28ac4c8db8a664dcb28e3ed7a | 43bc5fd8c45b2ae82931b83cc1f41e4b4ec3ea7c | refs/heads/master | 2022-09-06T17:31:08.183745 | 2020-05-25T18:33:24 | 2020-05-25T18:33:24 | 260,375,230 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,529 | cpp | // DialogStatus.cpp : implementation file
//
#include "pch.h"
#include "SimplyAUT_MotionController.h"
#include "DialogFiles.h"
#include "afxdialogex.h"
#include "resource.h"
const char* g_szTitle[] = { "#", "File", "Max Offset", "Avg Offset", NULL };
// CDialogFiles dialog
// this dialog is used to list the output files
IMPLEMENT_DYNAMIC(CDialogFiles, CDialogEx)
CDialogFiles::CDialogFiles(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DIALOG_FILES, pParent)
{
m_pParent = NULL; // used to pass messagews to its parent
m_nMsg = 0;
m_bInit = FALSE;
m_bCheck = FALSE;
}
CDialogFiles::~CDialogFiles()
{
}
void CDialogFiles::Init(CWnd* pParent, UINT nMsg)
{
m_pParent = pParent;
m_nMsg = nMsg;
}
void CDialogFiles::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST_FILES, m_listFiles);
}
BEGIN_MESSAGE_MAP(CDialogFiles, CDialogEx)
ON_WM_SIZE()
END_MESSAGE_MAP()
// CDialogFiles message handlers
// CDialogFiles message handlers
BOOL CDialogFiles::OnInitDialog()
{
char buffer[MAX_PATH];
CRect rect;
CDialogEx::OnInitDialog();
// TODO: Add extra initialization here
m_bInit = TRUE;
// create a list control, and insert colums for the statistics of the files
LV_COLUMN listColumn;
listColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM;
listColumn.cx = 0;
listColumn.pszText = buffer;
for (int i = 0; g_szTitle[i] != NULL; ++i)
{
strncpy_s(buffer, g_szTitle[i], sizeof(buffer));
listColumn.iSubItem = i;
listColumn.fmt = (i == 0) ? LVCFMT_CENTER : LVCFMT_LEFT;
m_listFiles.InsertColumn(i, &listColumn);
}
PostMessage(WM_SIZE);
return TRUE; // return TRUE unless you set the focus to a control
}
// CDialogMotors message handlers
// this dialog is sized to a tab, and not the size that designed into
// thus, must locate the controls on Size
void CDialogFiles::OnSize(UINT nFlag, int cx, int cy)
{
CRect rect;
CDialogEx::OnSize(nFlag, cx, cy);
if (!m_bInit)
return;
GetClientRect(&rect);
cx = rect.Width();
cy = rect.Height();
m_listFiles.MoveWindow(2, 2, cx - 4, cy - 4);
m_listFiles.GetClientRect(&rect);
cx = rect.Width();
cy = rect.Height();
CDC* pDC = GetDC();
CSize sz1 = pDC->GetTextExtent("8888"); // assume that never exceeds 4 digits
CSize sz2 = pDC->GetTextExtent("Max Offset");
ReleaseDC(pDC);
m_listFiles.SetColumnWidth(0, sz1.cx);
m_listFiles.SetColumnWidth(1, cx - sz1.cx - 2*sz2.cx);
m_listFiles.SetColumnWidth(2, sz2.cx);
m_listFiles.SetColumnWidth(3, sz2.cx);
}
void CDialogFiles::Create(CWnd* pParent)
{
CDialogEx::Create(IDD_DIALOG_FILES, pParent);
ShowWindow(SW_HIDE);
}
// the files are File_XX.txt
// sort by XX
static int SortFileList(const void* e1, const void* e2)
{
const CString* file1 = (CString*)e1;
const CString* file2 = (CString*)e2;
int ind1 = file1->Find("_");
int ind2 = file2->Find("_");
int N1 = (ind1 == -1) ? 0 : atoi(file1->Mid(ind1 + 1));
int N2 = (ind2 == -1) ? 0 : atoi(file2->Mid(ind2 + 1));
return N1 - N2;
}
// get a list of all File_XX.txt files, and sort by XX
int CDialogFiles::GetFileList(CArray<CString, CString>& fileList)
{
char buffer[MAX_PATH];
CString path;
fileList.SetSize(0);
if (::SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, buffer) != S_OK)
return 0;
CFileFind find;
path.Format("%s\\SimplyAUTFiles\\*.txt", buffer);
if (!find.FindFile(path))
return 0;
int ret = 1;
for (int i = 0, j = 0; ret != 0; ++i)
{
ret = find.FindNextFileA();
CString szFile = find.GetFileName();
int ind = szFile.Find("File_");
if (ind != -1 )
fileList.Add(find.GetFilePath());
}
qsort(fileList.GetData(), fileList.GetSize(), sizeof(CString), ::SortFileList);
return (int)fileList.GetSize();
}
// for njow this is cheap and dirty
// on every new entry, remove all entries and build again
void CDialogFiles::UpdateFileList()
{
char buffer[MAX_PATH];
LV_ITEM listItem;
listItem.mask = LVIF_TEXT;
listItem.iSubItem = 0;
listItem.pszText = buffer;
listItem.cchTextMax = sizeof(buffer);
if (!IsWindow(m_listFiles.m_hWnd))
return;
CString szFile;
CArray<CString, CString> fileList;
char drive[_MAX_DRIVE];
char path[_MAX_PATH];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
m_listFiles.DeleteAllItems();
int len = GetFileList(fileList);
if (len == 0)
return;
for( int i = 0, j=0; i < len; ++i)
{
::_splitpath_s(fileList[i], drive, _MAX_DRIVE, path, _MAX_PATH, fname, _MAX_FNAME, ext, _MAX_EXT);
szFile.Format("%s%s", fname, ext);
int ind = szFile.Find("File_");
if (ind == -1)
continue;
int nFileNum = atoi(szFile.Mid(ind + 5));
listItem.iItem = j;
sprintf_s(buffer, sizeof(buffer), "%d", nFileNum);
m_listFiles.InsertItem(&listItem);
strncpy_s(buffer, szFile, sizeof(buffer));
m_listFiles.SetItemText(j, 1, buffer);
FILE* fp = NULL;
if (fopen_s(&fp, fileList[i], "r") == 0 && fp != NULL)
{
int pos;
double capH, capW, HiLo, offset;
fgets(buffer, sizeof(buffer), fp);
double maxOff = 0;
double sum = 0;
int cnt = 0;
while (fgets(buffer, sizeof(buffer), fp))
{
sscanf_s(buffer, "%d\t%lf\t%lf\t%lf\t%lf\n", &pos, &capH, &capW, &HiLo, &offset);
maxOff = max(maxOff, fabs(offset));
sum += fabs(offset);
cnt++;
}
sprintf_s(buffer, sizeof(buffer), "%5.1f", maxOff);
m_listFiles.SetItemText(j, 2, buffer);
sprintf_s(buffer, sizeof(buffer), "%5.2f", cnt ? sum/cnt : 0);
m_listFiles.SetItemText(j, 3, buffer);
j++;
fclose(fp);
}
}
}
void CDialogFiles::EnableControls()
{
UpdateFileList();
}
| [
"dmitchell@TDEWS123"
] | dmitchell@TDEWS123 |
315b461a16fbe874b512c9ff6e2925a701085b3f | 5499e8b91353ef910d2514c8a57a80565ba6f05b | /src/ui/lib/escher/vk/impl/descriptor_set_allocator.cc | f1006762d85df36203b7fb1d45b54bc1a7723689 | [
"BSD-3-Clause"
] | permissive | winksaville/fuchsia | 410f451b8dfc671f6372cb3de6ff0165a2ef30ec | a0ec86f1d51ae8d2538ff3404dad46eb302f9b4f | refs/heads/master | 2022-11-01T11:57:38.343655 | 2019-11-01T17:06:19 | 2019-11-01T17:06:19 | 223,695,500 | 3 | 2 | BSD-3-Clause | 2022-10-13T13:47:02 | 2019-11-24T05:08:59 | C++ | UTF-8 | C++ | false | false | 6,815 | cc | // Copyright 2018 The Fuchsia 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 "src/ui/lib/escher/vk/impl/descriptor_set_allocator.h"
#include "src/ui/lib/escher/impl/vulkan_utils.h"
#include "src/ui/lib/escher/vk/vulkan_limits.h"
namespace escher {
namespace impl {
DescriptorSetAllocator::DescriptorSetAllocator(vk::Device device, DescriptorSetLayout layout,
const SamplerPtr& immutable_sampler)
: cache_(device, layout, immutable_sampler) {}
DescriptorSetAllocator::PoolPolicy::PoolPolicy(vk::Device device, DescriptorSetLayout layout,
const SamplerPtr& immutable_sampler)
: vk_device_(device), layout_(layout), immutable_sampler_(immutable_sampler) {
FXL_DCHECK(layout.IsValid());
std::array<vk::DescriptorSetLayoutBinding, VulkanLimits::kNumBindings> bindings;
size_t num_bindings = 0;
bool has_sampled_image = false;
for (uint32_t i = 0; i < VulkanLimits::kNumBindings; i++) {
uint32_t index_mask = 1u << i;
if (index_mask & layout.sampled_image_mask) {
has_sampled_image = true;
bindings[num_bindings++] = {i, vk::DescriptorType::eCombinedImageSampler, 1, layout.stages,
immutable_sampler ? &(immutable_sampler->vk()) : nullptr};
pool_sizes_.push_back({vk::DescriptorType::eCombinedImageSampler, 0});
continue;
}
if (index_mask & layout.sampled_buffer_mask) {
bindings[num_bindings++] = {i, vk::DescriptorType::eUniformTexelBuffer, 1, layout.stages,
nullptr};
pool_sizes_.push_back({vk::DescriptorType::eUniformTexelBuffer, 0});
continue;
}
if (index_mask & layout.storage_image_mask) {
bindings[num_bindings++] = {i, vk::DescriptorType::eStorageImage, 1, layout.stages, nullptr};
pool_sizes_.push_back({vk::DescriptorType::eStorageImage, 0});
continue;
}
// TODO(SCN-699): Consider allowing both static and dynamic offsets for
// uniform buffers.
if (index_mask & layout.uniform_buffer_mask) {
bindings[num_bindings++] = {i, vk::DescriptorType::eUniformBufferDynamic, 1, layout.stages,
nullptr};
pool_sizes_.push_back({vk::DescriptorType::eUniformBufferDynamic, 0});
continue;
}
// TODO(SCN-699): Consider allowing both static and dynamic offsets for
// storage buffers.
if (index_mask & layout.storage_buffer_mask) {
bindings[num_bindings++] = {i, vk::DescriptorType::eStorageBuffer, 1, layout.stages, nullptr};
pool_sizes_.push_back({vk::DescriptorType::eStorageBuffer, 0});
continue;
}
if (index_mask & layout.input_attachment_mask) {
bindings[num_bindings++] = {i, vk::DescriptorType::eInputAttachment, 1, layout.stages,
nullptr};
pool_sizes_.push_back({vk::DescriptorType::eInputAttachment, 0});
continue;
}
}
if (immutable_sampler && has_sampled_image) {
// TODO(ES-199): Leaving this log in for now, so we can detect when systems
// are OOMing due to ES-199. For most use cases, this log will trigger once.
FXL_LOG(INFO) << "Allocating immutable descriptor set layout, sampler = "
<< immutable_sampler->vk();
}
vk::DescriptorSetLayoutCreateInfo info;
if (num_bindings) {
info.bindingCount = num_bindings;
info.pBindings = bindings.data();
}
vk_layout_ = ESCHER_CHECKED_VK_RESULT(device.createDescriptorSetLayout(info));
}
DescriptorSetAllocator::PoolPolicy::~PoolPolicy() {
FXL_DCHECK(pools_.empty());
vk_device_.destroyDescriptorSetLayout(vk_layout_);
}
void DescriptorSetAllocator::PoolPolicy::InitializePoolObjectBlock(CacheItem* objects,
size_t block_index,
size_t num_objects) {
vk::DescriptorPool pool = CreatePool(block_index, num_objects);
AllocateDescriptorSetBlock(pool, objects, num_objects);
}
vk::DescriptorPool DescriptorSetAllocator::PoolPolicy::CreatePool(size_t block_index,
size_t num_objects) {
FXL_DCHECK(!pools_[block_index]);
for (auto& sz : pool_sizes_) {
sz.descriptorCount = num_objects;
}
vk::DescriptorPoolCreateInfo info;
info.maxSets = num_objects;
if (!pool_sizes_.empty()) {
info.poolSizeCount = pool_sizes_.size();
info.pPoolSizes = pool_sizes_.data();
}
auto pool = ESCHER_CHECKED_VK_RESULT(vk_device_.createDescriptorPool(info));
pools_[block_index] = pool;
return pool;
}
void DescriptorSetAllocator::PoolPolicy::AllocateDescriptorSetBlock(vk::DescriptorPool pool,
CacheItem* objects,
size_t num_objects) {
constexpr size_t kSetsPerAllocation = 64;
std::array<vk::DescriptorSetLayout, kSetsPerAllocation> layouts;
for (auto& layout : layouts) {
layout = vk_layout_;
}
std::array<vk::DescriptorSet, kSetsPerAllocation> allocated_sets;
size_t remaining = num_objects;
vk::DescriptorSetAllocateInfo alloc_info;
alloc_info.descriptorPool = pool;
alloc_info.pSetLayouts = layouts.data();
while (remaining) {
alloc_info.descriptorSetCount = std::min(remaining, kSetsPerAllocation);
vk::Result result = vk_device_.allocateDescriptorSets(&alloc_info, allocated_sets.data());
FXL_CHECK(result == vk::Result::eSuccess) << "DescriptorSetAllocator failed to allocate block.";
for (size_t i = 0; i < alloc_info.descriptorSetCount; ++i) {
new (objects + i) CacheItem();
objects[i].set = allocated_sets[i];
}
remaining -= alloc_info.descriptorSetCount;
objects += alloc_info.descriptorSetCount;
}
}
void DescriptorSetAllocator::PoolPolicy::DestroyPoolObjectBlock(CacheItem* objects,
size_t block_index,
size_t num_objects) {
auto it = pools_.find(block_index);
if (it == pools_.end()) {
FXL_DCHECK(false) << "DescriptorSetAllocator could not find pool to destroy.";
return;
}
vk::DescriptorPool pool = it->second;
pools_.erase(it);
FXL_DCHECK(pool);
vk_device_.resetDescriptorPool(pool);
vk_device_.destroyDescriptorPool(pool);
// This isn't necessary, but do it anyway in case CacheItem is someday changed
// to include values that require destruction.
for (size_t i = 0; i < num_objects; ++i) {
objects[i].~CacheItem();
}
}
} // namespace impl
} // namespace escher
| [
"[email protected]"
] | |
11c2d81fe4c17305f13a4843d4711c0cfa113cd4 | f598c1568d7e183beecf9b82ea331371bf97289e | /Hamlet/Source/BloodNight/Enemies/Ghost.hpp | d832d9ad6a2ba0a5649d30fd37063c34122a9df4 | [] | no_license | Elin4527/Hamlet-Game | ab270f679fb35d53c5d01d89389d6d24fa4b4067 | ed75623dbdc1d2c94e5b2cf293907851c51060ac | refs/heads/master | 2021-05-30T15:08:02.389719 | 2016-01-02T19:59:29 | 2016-01-02T19:59:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 397 | hpp |
#pragma once
#include "../../WildVEngine/WildVEngine.hpp"
class Ghost : public wv::Enemy
{
public:
Ghost(wv::TileMap* t, unsigned int r, unsigned int c);
Ghost();
virtual ~Ghost();
virtual void fixedUpdate() override;
virtual void collided(wv::Player& p) override;
// Inherited via Enemy
virtual std::shared_ptr<Enemy> spawn(wv::TileMap * t, unsigned int r, unsigned int c) override;
}; | [
"[email protected]"
] | |
2bdb772ef6f8afb61b7def7ebdbb2eeebc0b3eb6 | c1e54641a1e839f457783466cb5b66cab617d1b7 | /platformio/lib/MyWire/MyWire.h | e2c3e1fa255b61657445addfa191e9f85d576c1d | [] | no_license | iftachAvital/EasyCool | 2d00206aeed0de998c76b3ca6506c9240cc4e365 | 6a2cf7a3c450eddbf4902fe86b400c82dd2417c0 | refs/heads/master | 2021-05-11T14:03:50.115424 | 2018-01-16T14:28:28 | 2018-01-16T14:28:28 | 117,693,064 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,783 | h | #ifndef MyWire_h
#define MyWire_h
#include <inttypes.h>
#if defined(__AVR__)
#include <util/crc16.h>
#endif
#if ARDUINO >= 100
#include "Arduino.h" // for delayMicroseconds, digitalPinToBitMask, etc
#else
#include "WProgram.h" // for delayMicroseconds
#include "pins_arduino.h" // for digitalPinToBitMask, etc
#endif
// You can exclude certain features from OneWire. In theory, this
// might save some space. In practice, the compiler automatically
// removes unused code (technically, the linker, using -fdata-sections
// and -ffunction-sections when compiling, and Wl,--gc-sections
// when linking), so most of these will not result in any code size
// reduction. Well, unless you try to use the missing features
// and redesign your program to not need them! ONEWIRE_CRC8_TABLE
// is the exception, because it selects a fast but large algorithm
// or a small but slow algorithm.
// you can exclude onewire_search by defining that to 0
#ifndef ONEWIRE_SEARCH
#define ONEWIRE_SEARCH 1
#endif
// You can exclude CRC checks altogether by defining this to 0
#ifndef ONEWIRE_CRC
#define ONEWIRE_CRC 1
#endif
// Select the table-lookup method of computing the 8-bit CRC
// by setting this to 1. The lookup table enlarges code size by
// about 250 bytes. It does NOT consume RAM (but did in very
// old versions of OneWire). If you disable this, a slower
// but very compact algorithm is used.
#ifndef ONEWIRE_CRC8_TABLE
#define ONEWIRE_CRC8_TABLE 1
#endif
// You can allow 16-bit CRC checks by defining this to 1
// (Note that ONEWIRE_CRC must also be 1.)
#ifndef ONEWIRE_CRC16
#define ONEWIRE_CRC16 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
// Platform specific I/O definitions
#if defined(__AVR__)
#define PIN_TO_BASEREG(pin) (portInputRegister(digitalPinToPort(pin)))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint8_t
#define IO_REG_ASM asm("r30")
#define DIRECT_READ(base, mask) (((*(base)) & (mask)) ? 1 : 0)
#define DIRECT_MODE_INPUT(base, mask) ((*((base)+1)) &= ~(mask))
#define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+1)) |= (mask))
#define DIRECT_WRITE_LOW(base, mask) ((*((base)+2)) &= ~(mask))
#define DIRECT_WRITE_HIGH(base, mask) ((*((base)+2)) |= (mask))
#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__) || defined(__MK64FX512__)
#define PIN_TO_BASEREG(pin) (portOutputRegister(pin))
#define PIN_TO_BITMASK(pin) (1)
#define IO_REG_TYPE uint8_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (*((base)+512))
#define DIRECT_MODE_INPUT(base, mask) (*((base)+640) = 0)
#define DIRECT_MODE_OUTPUT(base, mask) (*((base)+640) = 1)
#define DIRECT_WRITE_LOW(base, mask) (*((base)+256) = 1)
#define DIRECT_WRITE_HIGH(base, mask) (*((base)+128) = 1)
#elif defined(__MKL26Z64__)
#define PIN_TO_BASEREG(pin) (portOutputRegister(pin))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint8_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) ((*((base)+16) & (mask)) ? 1 : 0)
#define DIRECT_MODE_INPUT(base, mask) (*((base)+20) &= ~(mask))
#define DIRECT_MODE_OUTPUT(base, mask) (*((base)+20) |= (mask))
#define DIRECT_WRITE_LOW(base, mask) (*((base)+8) = (mask))
#define DIRECT_WRITE_HIGH(base, mask) (*((base)+4) = (mask))
#elif defined(__SAM3X8E__) || defined(__SAM3A8C__) || defined(__SAM3A4C__)
// Arduino 1.5.1 may have a bug in delayMicroseconds() on Arduino Due.
// http://arduino.cc/forum/index.php/topic,141030.msg1076268.html#msg1076268
// If you have trouble with OneWire on Arduino Due, please check the
// status of delayMicroseconds() before reporting a bug in OneWire!
#define PIN_TO_BASEREG(pin) (&(digitalPinToPort(pin)->PIO_PER))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (((*((base)+15)) & (mask)) ? 1 : 0)
#define DIRECT_MODE_INPUT(base, mask) ((*((base)+5)) = (mask))
#define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+4)) = (mask))
#define DIRECT_WRITE_LOW(base, mask) ((*((base)+13)) = (mask))
#define DIRECT_WRITE_HIGH(base, mask) ((*((base)+12)) = (mask))
#ifndef PROGMEM
#define PROGMEM
#endif
#ifndef pgm_read_byte
#define pgm_read_byte(addr) (*(const uint8_t *)(addr))
#endif
#elif defined(__PIC32MX__)
#define PIN_TO_BASEREG(pin) (portModeRegister(digitalPinToPort(pin)))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (((*(base+4)) & (mask)) ? 1 : 0) //PORTX + 0x10
#define DIRECT_MODE_INPUT(base, mask) ((*(base+2)) = (mask)) //TRISXSET + 0x08
#define DIRECT_MODE_OUTPUT(base, mask) ((*(base+1)) = (mask)) //TRISXCLR + 0x04
#define DIRECT_WRITE_LOW(base, mask) ((*(base+8+1)) = (mask)) //LATXCLR + 0x24
#define DIRECT_WRITE_HIGH(base, mask) ((*(base+8+2)) = (mask)) //LATXSET + 0x28
#elif defined(ARDUINO_ARCH_ESP8266)
#define PIN_TO_BASEREG(pin) ((volatile uint32_t*) GPO)
#define PIN_TO_BITMASK(pin) (1 << pin)
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) ((GPI & (mask)) ? 1 : 0) //GPIO_IN_ADDRESS
#define DIRECT_MODE_INPUT(base, mask) (GPE &= ~(mask)) //GPIO_ENABLE_W1TC_ADDRESS
#define DIRECT_MODE_OUTPUT(base, mask) (GPE |= (mask)) //GPIO_ENABLE_W1TS_ADDRESS
#define DIRECT_WRITE_LOW(base, mask) (GPOC = (mask)) //GPIO_OUT_W1TC_ADDRESS
#define DIRECT_WRITE_HIGH(base, mask) (GPOS = (mask)) //GPIO_OUT_W1TS_ADDRESS
#elif defined(__SAMD21G18A__)
#define PIN_TO_BASEREG(pin) portModeRegister(digitalPinToPort(pin))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (((*((base)+8)) & (mask)) ? 1 : 0)
#define DIRECT_MODE_INPUT(base, mask) ((*((base)+1)) = (mask))
#define DIRECT_MODE_OUTPUT(base, mask) ((*((base)+2)) = (mask))
#define DIRECT_WRITE_LOW(base, mask) ((*((base)+5)) = (mask))
#define DIRECT_WRITE_HIGH(base, mask) ((*((base)+6)) = (mask))
#elif defined(RBL_NRF51822)
#define PIN_TO_BASEREG(pin) (0)
#define PIN_TO_BITMASK(pin) (pin)
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
#define DIRECT_READ(base, pin) nrf_gpio_pin_read(pin)
#define DIRECT_WRITE_LOW(base, pin) nrf_gpio_pin_clear(pin)
#define DIRECT_WRITE_HIGH(base, pin) nrf_gpio_pin_set(pin)
#define DIRECT_MODE_INPUT(base, pin) nrf_gpio_cfg_input(pin, NRF_GPIO_PIN_NOPULL)
#define DIRECT_MODE_OUTPUT(base, pin) nrf_gpio_cfg_output(pin)
#elif defined(__arc__) /* Arduino101/Genuino101 specifics */
#include "scss_registers.h"
#include "portable.h"
#include "avr/pgmspace.h"
#define GPIO_ID(pin) (g_APinDescription[pin].ulGPIOId)
#define GPIO_TYPE(pin) (g_APinDescription[pin].ulGPIOType)
#define GPIO_BASE(pin) (g_APinDescription[pin].ulGPIOBase)
#define DIR_OFFSET_SS 0x01
#define DIR_OFFSET_SOC 0x04
#define EXT_PORT_OFFSET_SS 0x0A
#define EXT_PORT_OFFSET_SOC 0x50
/* GPIO registers base address */
#define PIN_TO_BASEREG(pin) ((volatile uint32_t *)g_APinDescription[pin].ulGPIOBase)
#define PIN_TO_BITMASK(pin) pin
#define IO_REG_TYPE uint32_t
#define IO_REG_ASM
static inline __attribute__((always_inline))
IO_REG_TYPE directRead(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
{
IO_REG_TYPE ret;
if (SS_GPIO == GPIO_TYPE(pin)) {
ret = READ_ARC_REG(((IO_REG_TYPE)base + EXT_PORT_OFFSET_SS));
} else {
ret = MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, EXT_PORT_OFFSET_SOC);
}
return ((ret >> GPIO_ID(pin)) & 0x01);
}
static inline __attribute__((always_inline))
void directModeInput(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
{
if (SS_GPIO == GPIO_TYPE(pin)) {
WRITE_ARC_REG(READ_ARC_REG((((IO_REG_TYPE)base) + DIR_OFFSET_SS)) & ~(0x01 << GPIO_ID(pin)),
((IO_REG_TYPE)(base) + DIR_OFFSET_SS));
} else {
MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, DIR_OFFSET_SOC) &= ~(0x01 << GPIO_ID(pin));
}
}
static inline __attribute__((always_inline))
void directModeOutput(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
{
if (SS_GPIO == GPIO_TYPE(pin)) {
WRITE_ARC_REG(READ_ARC_REG(((IO_REG_TYPE)(base) + DIR_OFFSET_SS)) | (0x01 << GPIO_ID(pin)),
((IO_REG_TYPE)(base) + DIR_OFFSET_SS));
} else {
MMIO_REG_VAL_FROM_BASE((IO_REG_TYPE)base, DIR_OFFSET_SOC) |= (0x01 << GPIO_ID(pin));
}
}
static inline __attribute__((always_inline))
void directWriteLow(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
{
if (SS_GPIO == GPIO_TYPE(pin)) {
WRITE_ARC_REG(READ_ARC_REG(base) & ~(0x01 << GPIO_ID(pin)), base);
} else {
MMIO_REG_VAL(base) &= ~(0x01 << GPIO_ID(pin));
}
}
static inline __attribute__((always_inline))
void directWriteHigh(volatile IO_REG_TYPE *base, IO_REG_TYPE pin)
{
if (SS_GPIO == GPIO_TYPE(pin)) {
WRITE_ARC_REG(READ_ARC_REG(base) | (0x01 << GPIO_ID(pin)), base);
} else {
MMIO_REG_VAL(base) |= (0x01 << GPIO_ID(pin));
}
}
#define DIRECT_READ(base, pin) directRead(base, pin)
#define DIRECT_MODE_INPUT(base, pin) directModeInput(base, pin)
#define DIRECT_MODE_OUTPUT(base, pin) directModeOutput(base, pin)
#define DIRECT_WRITE_LOW(base, pin) directWriteLow(base, pin)
#define DIRECT_WRITE_HIGH(base, pin) directWriteHigh(base, pin)
#else
#define PIN_TO_BASEREG(pin) (0)
#define PIN_TO_BITMASK(pin) (pin)
#define IO_REG_TYPE unsigned int
#define IO_REG_ASM
#define DIRECT_READ(base, pin) digitalRead(pin)
#define DIRECT_WRITE_LOW(base, pin) digitalWrite(pin, LOW)
#define DIRECT_WRITE_HIGH(base, pin) digitalWrite(pin, HIGH)
#define DIRECT_MODE_INPUT(base, pin) pinMode(pin,INPUT)
#define DIRECT_MODE_OUTPUT(base, pin) pinMode(pin,OUTPUT)
#warning "OneWire. Fallback mode. Using API calls for pinMode,digitalRead and digitalWrite. Operation of this library is not guaranteed on this architecture."
#endif
class MyWire
{
private:
IO_REG_TYPE bitmask;
volatile IO_REG_TYPE *baseReg;
#if ONEWIRE_SEARCH
// global search state
unsigned char ROM_NO[8];
uint8_t LastDiscrepancy;
uint8_t LastFamilyDiscrepancy;
uint8_t LastDeviceFlag;
#endif
public:
MyWire( uint8_t pin);
// Perform a 1-Wire reset cycle. Returns 1 if a device responds
// with a presence pulse. Returns 0 if there is no device or the
// bus is shorted or otherwise held low for more than 250uS
uint8_t reset(void);
// Issue a 1-Wire rom select command, you do the reset first.
void select(const uint8_t rom[8]);
// Issue a 1-Wire rom skip command, to address all on bus.
void skip(void);
// Write a byte. If 'power' is one then the wire is held high at
// the end for parasitically powered devices. You are responsible
// for eventually depowering it by calling depower() or doing
// another read or write.
void write(uint8_t v, uint8_t power = 0);
void write_bytes(const uint8_t *buf, uint16_t count, bool power = 0);
// Read a byte.
uint8_t read(void);
void read_bytes(uint8_t *buf, uint16_t count);
// Write a bit. The bus is always left powered at the end, see
// note in write() about that.
void write_bit(uint8_t v);
// Read a bit.
uint8_t read_bit(void);
// Stop forcing power onto the bus. You only need to do this if
// you used the 'power' flag to write() or used a write_bit() call
// and aren't about to do another read or write. You would rather
// not leave this powered if you don't have to, just in case
// someone shorts your bus.
void depower(void);
#if ONEWIRE_SEARCH
// Clear the search state so that if will start from the beginning again.
void reset_search();
// Setup the search to find the device type 'family_code' on the next call
// to search(*newAddr) if it is present.
void target_search(uint8_t family_code);
// Look for the next device. Returns 1 if a new address has been
// returned. A zero might mean that the bus is shorted, there are
// no devices, or you have already retrieved all of them. It
// might be a good idea to check the CRC to make sure you didn't
// get garbage. The order is deterministic. You will always get
// the same devices in the same order.
uint8_t search(uint8_t *newAddr, bool search_mode = true);
#endif
#if ONEWIRE_CRC
// Compute a Dallas Semiconductor 8 bit CRC, these are used in the
// ROM and scratchpad registers.
static uint8_t crc8(const uint8_t *addr, uint8_t len);
#if ONEWIRE_CRC16
// Compute the 1-Wire CRC16 and compare it against the received CRC.
// Example usage (reading a DS2408):
// // Put everything in a buffer so we can compute the CRC easily.
// uint8_t buf[13];
// buf[0] = 0xF0; // Read PIO Registers
// buf[1] = 0x88; // LSB address
// buf[2] = 0x00; // MSB address
// WriteBytes(net, buf, 3); // Write 3 cmd bytes
// ReadBytes(net, buf+3, 10); // Read 6 data bytes, 2 0xFF, 2 CRC16
// if (!CheckCRC16(buf, 11, &buf[11])) {
// // Handle error.
// }
//
// @param input - Array of bytes to checksum.
// @param len - How many bytes to use.
// @param inverted_crc - The two CRC16 bytes in the received data.
// This should just point into the received data,
// *not* at a 16-bit integer.
// @param crc - The crc starting value (optional)
// @return True, iff the CRC matches.
static bool check_crc16(const uint8_t* input, uint16_t len, const uint8_t* inverted_crc, uint16_t crc = 0);
// Compute a Dallas Semiconductor 16 bit CRC. This is required to check
// the integrity of data received from many 1-Wire devices. Note that the
// CRC computed here is *not* what you'll get from the 1-Wire network,
// for two reasons:
// 1) The CRC is transmitted bitwise inverted.
// 2) Depending on the endian-ness of your processor, the binary
// representation of the two-byte return value may have a different
// byte order than the two bytes you get from 1-Wire.
// @param input - Array of bytes to checksum.
// @param len - How many bytes to use.
// @param crc - The crc starting value (optional)
// @return The CRC16, as defined by Dallas Semiconductor.
static uint16_t crc16(const uint8_t* input, uint16_t len, uint16_t crc = 0);
#endif
#endif
};
#endif
| [
"[email protected]"
] | |
a429e024b94c5f40a6e603f1790f881498fa66cd | 64cb5c0a368faf2b8d72b0d262137a3bedb7a814 | /test/test_buffer.cc | b1a2fbce5125f99bad50be767ca61d7188590e6c | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | fixdocker/kids | 2d9783268013ffc775b1c2ed53c061effeb5f265 | bee2a5fab27d90620910ab8c5a59e248688b4599 | refs/heads/master | 2022-11-20T12:49:05.071813 | 2020-07-22T13:41:32 | 2020-07-22T13:41:32 | 281,688,104 | 0 | 0 | NOASSERTION | 2020-07-22T13:40:35 | 2020-07-22T13:40:34 | null | UTF-8 | C++ | false | false | 3,502 | cc | #include <vector>
#include "gtest/gtest.h"
#include "buffer.h"
#include "util.h"
TEST(TestBuffer, TestConstruct) {
Buffer buf;
EXPECT_EQ(0, buf.size());
EXPECT_EQ(0, buf.capacity());
EXPECT_EQ(0, buf.blank_size());
Buffer *strs = new Buffer("abc def ghi");
EXPECT_TRUE(strs != NULL);
EXPECT_EQ(11, strs->size());
EXPECT_STREQ("abc def ghi", strs->data());
delete strs;
}
TEST(TestBuffer, TestAppend) {
Buffer buf;
buf.append("abc", 4);
EXPECT_EQ(4, buf.size());
EXPECT_STREQ("abc", buf.data());
EXPECT_EQ('b', buf[1]);
buf.append("def", 4);
EXPECT_EQ(8, buf.size());
EXPECT_EQ('a', buf[0]);
EXPECT_EQ('b', buf[1]);
EXPECT_EQ('c', buf[2]);
EXPECT_EQ('\0', buf[3]);
EXPECT_EQ('d', buf[4]);
EXPECT_EQ('e', buf[5]);
EXPECT_EQ('f', buf[6]);
EXPECT_EQ('\0', buf[7]);
}
TEST(TestBuffer, TestResize) {
Buffer buf;
buf.resize(10);
EXPECT_EQ(10, buf.capacity());
EXPECT_EQ('\0', buf.data()[10]);
}
TEST(TestBuffer, TestCopy) {
Buffer buf;
buf.resize(10);
EXPECT_EQ(10, buf.capacity());
Buffer buf2(buf);
EXPECT_EQ(0, buf2.size());
EXPECT_EQ(10, buf2.capacity());
buf2.append("abc", 4);
EXPECT_STREQ("abc", buf2.data());
EXPECT_EQ(10, buf2.capacity());
Buffer buf3(buf2);
EXPECT_EQ(4, buf3.size());
EXPECT_EQ(10, buf3.capacity());
EXPECT_STREQ("abc", buf3.data());
}
TEST(TestBuffer, TestPopFront) {
Buffer strs("abc def ghi");
EXPECT_STREQ("abc def ghi", strs.data());
Buffer *buf = strs.pop_front(4);
EXPECT_TRUE(buf != NULL);
EXPECT_STREQ("abc ", buf->data());
EXPECT_EQ(7, strs.size());
EXPECT_STREQ("def ghi", strs.data());
delete buf;
buf = strs.pop_front(strs.size());
EXPECT_EQ(0, strs.size());
EXPECT_STREQ("def ghi", buf->data());
}
TEST(TestBuffer, TestRemoveFront) {
Buffer strs("abc def ghi");
Buffer buf = strs.data();
EXPECT_STREQ("abc def ghi", buf.data());
buf.remove_front(4);
EXPECT_STREQ("def ghi", buf.data());
buf.remove_front(4);
EXPECT_STREQ("ghi", buf.data());
buf.remove_front(3);
EXPECT_STREQ("", buf.data());
}
TEST(TestBuffer, TestAssign) {
Buffer strs("abc def ghi");
strs = "jkl";
EXPECT_STREQ("jkl", strs.data());
std::vector<Buffer> v;
v.push_back(Buffer());
EXPECT_STREQ("", v.front().data());
}
TEST(TestBuffer, TestClear) {
Buffer strs("abc def ghi");
Buffer strs2 = strs;
EXPECT_EQ(2, strs.refcount());
strs2.clear();
EXPECT_EQ(11, strs.size());
EXPECT_EQ(1, strs.refcount());
EXPECT_EQ(1, strs2.refcount());
}
TEST(TestBuffer, TestHashset) {
std::unordered_set<Buffer, Buffer::Hasher> set;
Buffer buf("abc def ghi");
set.insert(buf);
EXPECT_EQ(1, set.size());
EXPECT_EQ(2, buf.refcount());
Buffer buf2("abc def ghi");
EXPECT_EQ(1, buf2.refcount());
std::unordered_set<Buffer, Buffer::Hasher>::iterator it = set.find(buf2);
EXPECT_EQ(2, it->refcount());
set.erase(it);
EXPECT_EQ(1, buf.refcount());
}
TEST(TestBuffer, TestHashmap) {
std::unordered_map<Buffer, int, Buffer::Hasher> int_by_topic;
std::unordered_set<Buffer, Buffer::Hasher> sub_topics;
Buffer *buf = new Buffer("abc");
EXPECT_EQ(1, buf->refcount());
Buffer& topic = *buf;
sub_topics.insert(topic);
EXPECT_EQ(2, topic.refcount());
int_by_topic[topic] = 1;
EXPECT_EQ(3, topic.refcount());
delete buf;
Buffer buf2("abc");
std::unordered_set<Buffer, Buffer::Hasher>::iterator it = sub_topics.find(buf2);
EXPECT_TRUE(it != sub_topics.end());
EXPECT_EQ(2, it->refcount());
//sub_topics.erase(it);
}
| [
"[email protected]"
] | |
a1ed06ca330d6dccf93b6a33e227a9ffd495e51c | 3b1c7561c8d3b9452fc0cdefe299b208e0db1853 | /include/core/SkColorFilter.h | c6441d64c62b82afcc89f7202104bdb11dce5a5b | [
"BSD-3-Clause"
] | permissive | NearTox/Skia | dee04fc980bd40c1861c424b5643e7873f656b01 | 4d0cd2b6deca44eb2255651c4f04396963688761 | refs/heads/master | 2022-12-24T02:01:41.138176 | 2022-08-27T14:32:37 | 2022-08-27T14:32:37 | 153,816,056 | 0 | 0 | BSD-3-Clause | 2022-12-13T23:42:44 | 2018-10-19T17:05:47 | C++ | UTF-8 | C++ | false | false | 3,175 | h | /*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkColorFilter_DEFINED
#define SkColorFilter_DEFINED
#include "include/core/SkBlendMode.h"
#include "include/core/SkColor.h"
#include "include/core/SkFlattenable.h"
class SkColorMatrix;
class SkColorSpace;
/**
* ColorFilters are optional objects in the drawing pipeline. When present in
* a paint, they are called with the "src" colors, and return new colors, which
* are then passed onto the next stage (either ImageFilter or Xfermode).
*
* All subclasses are required to be reentrant-safe : it must be legal to share
* the same instance between several threads.
*/
class SK_API SkColorFilter : public SkFlattenable {
public:
/** If the filter can be represented by a source color plus Mode, this
* returns true, and sets (if not NULL) the color and mode appropriately.
* If not, this returns false and ignores the parameters.
*/
bool asAColorMode(SkColor* color, SkBlendMode* mode) const;
/** If the filter can be represented by a 5x4 matrix, this
* returns true, and sets the matrix appropriately.
* If not, this returns false and ignores the parameter.
*/
bool asAColorMatrix(float matrix[20]) const;
// Returns true if the filter is guaranteed to never change the alpha of a color it filters.
bool isAlphaUnchanged() const;
SkColor filterColor(SkColor) const;
/**
* Converts the src color (in src colorspace), into the dst colorspace,
* then applies this filter to it, returning the filtered color in the dst colorspace.
*/
SkColor4f filterColor4f(
const SkColor4f& srcColor, SkColorSpace* srcCS, SkColorSpace* dstCS) const;
/** Construct a colorfilter whose effect is to first apply the inner filter and then apply
* this filter, applied to the output of the inner filter.
*
* result = this(inner(...))
*/
sk_sp<SkColorFilter> makeComposed(sk_sp<SkColorFilter> inner) const;
static sk_sp<SkColorFilter> Deserialize(
const void* data, size_t size, const SkDeserialProcs* procs = nullptr);
private:
SkColorFilter() = default;
friend class SkColorFilterBase;
using INHERITED = SkFlattenable;
};
class SK_API SkColorFilters {
public:
static sk_sp<SkColorFilter> Compose(sk_sp<SkColorFilter> outer, sk_sp<SkColorFilter> inner) {
return outer ? outer->makeComposed(inner) : inner;
}
static sk_sp<SkColorFilter> Blend(SkColor c, SkBlendMode mode);
static sk_sp<SkColorFilter> Matrix(const SkColorMatrix&);
static sk_sp<SkColorFilter> Matrix(const float rowMajor[20]);
// A version of Matrix which operates in HSLA space instead of RGBA.
// I.e. HSLA-to-RGBA(Matrix(RGBA-to-HSLA(input))).
static sk_sp<SkColorFilter> HSLAMatrix(const SkColorMatrix&);
static sk_sp<SkColorFilter> HSLAMatrix(const float rowMajor[20]);
static sk_sp<SkColorFilter> LinearToSRGBGamma();
static sk_sp<SkColorFilter> SRGBToLinearGamma();
static sk_sp<SkColorFilter> Lerp(float t, sk_sp<SkColorFilter> dst, sk_sp<SkColorFilter> src);
private:
SkColorFilters() = delete;
};
#endif
| [
"[email protected]"
] | |
bdd299cc29ec4ce8dd458d3fe6aac8ef8d5d1b1f | 38b075556c708bec24396fadb9e619f203f98809 | /src/Sound/timpani_samples.cpp | 12d09ce16820babbaa6ef647b69d62b857ba0441 | [] | no_license | quantograph/QG_Music | 78a0ca91ba50ea37d1b0f7e67f50efee9a780e7d | cdab6e285cc7548ce53881e3af5d5d7fde9c10b2 | refs/heads/master | 2023-04-18T19:29:39.651494 | 2021-04-28T02:55:10 | 2021-04-28T02:55:10 | 362,332,392 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 136,363 | cpp | #include <QG_Devices.h>
#include "timpani_samples.h"
const AudioSynthWavetable::sample_data timpani_samples[3] = {
{
(int16_t*)sample_0_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3398.74 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(2353.81 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_1_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(3198.73 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
{
(int16_t*)sample_2_timpani_timpani, // sample
true, // LOOP
13, // LENGTH_BITS
(1 << (32 - 13)) * WAVETABLE_CENTS_SHIFT(0) * 44100.0 / WAVETABLE_NOTE_TO_FREQUENCY(60) / AUDIO_SAMPLE_RATE_EXACT + 0.5, // PER_HERTZ_PHASE_INCREMENT
((uint32_t)7698 - 1) << (32 - 13), // MAX_PHASE
((uint32_t)7695 - 1) << (32 - 13), // LOOP_PHASE_END
(((uint32_t)7695 - 1) << (32 - 13)) - (((uint32_t)7079 - 1) << (32 - 13)), // LOOP_PHASE_LENGTH
uint16_t(UINT16_MAX * WAVETABLE_DECIBEL_SHIFT(-12.7)), // INITIAL_ATTENUATION_SCALAR
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DELAY_COUNT
uint32_t(6.20 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // ATTACK_COUNT
uint32_t(540.24 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // HOLD_COUNT
uint32_t(2599.68 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // DECAY_COUNT
uint32_t(918.06 * AudioSynthWavetable::SAMPLES_PER_MSEC / AudioSynthWavetable::ENVELOPE_PERIOD + 0.5), // RELEASE_COUNT
int32_t((1.0 - WAVETABLE_DECIBEL_SHIFT(-100.0)) * AudioSynthWavetable::UNITY_GAIN), // SUSTAIN_MULT
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // VIBRATO_DELAY
uint32_t(0.1 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // VIBRATO_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // VIBRATO_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // VIBRATO_COEFFICIENT_SECONDARY
uint32_t(0.00 * AudioSynthWavetable::SAMPLES_PER_MSEC / (2 * AudioSynthWavetable::LFO_PERIOD)), // MODULATION_DELAY
uint32_t(5.4 * AudioSynthWavetable::LFO_PERIOD * (UINT32_MAX / AUDIO_SAMPLE_RATE_EXACT)), // MODULATION_INCREMENT
(WAVETABLE_CENTS_SHIFT(0) - 1.0) * 4, // MODULATION_PITCH_COEFFICIENT_INITIAL
(1.0 - WAVETABLE_CENTS_SHIFT(0)) * 4, // MODULATION_PITCH_COEFFICIENT_SECOND
int32_t(UINT16_MAX * (WAVETABLE_DECIBEL_SHIFT(0) - 1.0)) * 4, // MODULATION_AMPLITUDE_INITIAL_GAIN
int32_t(UINT16_MAX * (1.0 - WAVETABLE_DECIBEL_SHIFT(0))) * 4, // MODULATION_AMPLITUDE_FINAL_GAIN
},
};
const uint32_t sample_0_timpani_timpani[3968] = {
0x00000000,0xfff9fff5,0xfff9fff5,0x0004fff5,0x004fffd7,0x010dff91,0x0f21fd95,0x4fbb460b,
0x598a625b,0x40225439,0x1dc43113,0xcebe1dfc,0xa00faa38,0x8dee95d9,0xa37e9a5c,0xc251ae3d,
0xce93bae0,0x0511d76d,0x3eb12a28,0x4c583de2,0x57c249d3,0x71fb4441,0x23dd71fb,0xe630f1b5,
0xe648e7ed,0xeec9ef46,0xcda5dd06,0xb7a1c669,0x8ede8dee,0x8dee8dee,0x8dee8dee,0xc0548ff3,
0x0a45edec,0x71fb5de5,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x63ea65a4,0x1d0f436b,
0xee5d0f5a,0xe57305f9,0xb625c17f,0x8deeaa98,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xc0a68dee,0xfbd5dff8,0x3d3529ab,0x55755d07,0x67ae6ddf,0x71fb71fb,0x4f7e71fb,0x13161b8c,
0x1d472442,0xfa441de7,0xcf52e857,0xd173e353,0xe3c8e00a,0x0295e5f9,0x0f271317,0x2b7b286d,
0x22d1246c,0xa55de909,0xd89caf6a,0x38f2130d,0x53b04e5a,0x3fcc54bc,0x0adb2513,0xf0652688,
0xd155e5e1,0xfba9dd25,0xf8551268,0x9d19b5bf,0x9acea20f,0xad5bb3e4,0xed96daf5,0xf3e2f0de,
0x10511045,0x4bf33ede,0x2b5b3d9b,0x29bb3343,0xffc50b15,0x0027ebe8,0xfec7f3a9,0x10b60585,
0x2b5f16fb,0x11ff1190,0xdf53f16d,0xeca9de8c,0xd533d6a4,0xcb59bbe0,0x0a3cd75a,0x2ffe10b0,
0x51a051c1,0x4d464a90,0x71fb558f,0x4c346c85,0xe693195c,0xc947d26b,0xb29bcfe6,0xd9cfc45b,
0x05d9e1d2,0xf35a17dc,0xe47fe2b5,0x9e06a4c7,0xc216b13e,0x004bdab5,0x14061d0b,0x00cafd35,
0xff13ef19,0x288f131d,0x3ce019c6,0x2b4f3101,0x04c10d54,0xc8fbea58,0xa9669f86,0x8deeb3ed,
0xc2fba7ce,0xf0a8ce3f,0x0d69f6ef,0x41e33da6,0x48ae4ae9,0x5d2c3a27,0x65f8634d,0x4b764493,
0x5810406f,0x4a9b649b,0x4343455f,0x2c0c4275,0xe114030a,0xb1e6cd24,0xc151b261,0xa540ac33,
0x8dee8fcc,0x8dee8dee,0x8dee8dee,0x91fb8dee,0xe178bead,0x15e3f073,0x063211a2,0x20a40606,
0x4ae02a5e,0x662c5d72,0x4da64ee4,0x3b7d34a9,0x29b54196,0x42eb351b,0x491b4bf0,0x599d6206,
0x2c094a20,0xed231a6f,0xcd85ea5b,0xe852d9a6,0xf8adfc73,0x1b280bb1,0x22ad224f,0x1562130a,
0x0ecc125f,0xf0b70311,0xbec9f2c8,0x909eaec4,0x8dee8dee,0x8dee8dee,0xc16f9eb2,0xa6ffb95f,
0xdb97b77b,0xf408db2f,0xf6abfaf8,0x058501cb,0xfbd80c9c,0x0ea10add,0x36792da4,0x67ac4ba2,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4ca36dc4,0x3e9f3f5b,0x067e1bcb,0x085afcfa,0x01461670,
0xe891fff2,0xe74aecef,0xfc92f08b,0xf4d7f80c,0x987dc84c,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xb84c9a36,0xbb70c776,0xc9b5cbaa,0xc9ebd25d,0xfaa7d65b,0x31b420a0,0x36262852,0x3a6e340e,
0x37cd3a0b,0x5a4b49e5,0x71fb6b6a,0x71fb71fb,0x71fb71fb,0x6bf96d27,0x34275100,0x2c1831b4,
0xeb3d2305,0xe341e747,0xd083cb12,0xe01dc9e5,0xea3adc7d,0xcc09dcd0,0xc3c9cab1,0x93e4a51c,
0x8dee8dee,0x8dee8dee,0x9c468dee,0xaef2a646,0xc838b98a,0x1a70ef95,0x11b4ffec,0x28fe19ea,
0x0a971634,0xff680f97,0xff8602d1,0x18930661,0x3bc82224,0x650c6590,0x5b8162af,0x66bf59b8,
0x71fb71fb,0x715f71fb,0x5a586b92,0x282e37d9,0x09631b2b,0x0930fe19,0x05541030,0xf2a0f255,
0xce93eefc,0x943d9f37,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xabd58ecb,
0xf6e2ccf0,0x14d40bb6,0x308c1fd4,0x3cc83642,0x4d1441cb,0x58a454ef,0x54f55933,0x6aab5d25,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4dff6b8e,0x273825fc,0x1d5131ad,0xe9ae0de2,0xcb9ddd3e,
0xc6e9c6dd,0x9e7eab38,0xcb85af2d,0xc1a3bb94,0xad7db412,0x9b3daf10,0x93f193cf,0x900b938e,
0x8dee8f27,0xb6319605,0x17e8f839,0x23232783,0x1f56235e,0xfdc91211,0x0a31f343,0x103f09a2,
0x23d41d97,0x1fcd26b7,0x43003222,0x603e588b,0x6e406635,0x6c526a3b,0x6ee871fb,0x613c68f3,
0x44e551be,0x1c9d290b,0x0b85134a,0x11270d1c,0x09ad1dc6,0xf4bb03c8,0xa06ecc52,0x8dee92a4,
0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xa2ac8dee,0xcb33c27f,0xdbfcd848,0xe91edd0b,
0x19bb024c,0x5a023657,0x627b61be,0x4ac44f22,0x71fb4e69,0x71fb71fb,0x71fb71fb,0x71fb71fb,
0x4bac646a,0x3460374a,0x15141ac5,0xf4c108e7,0xe3b6fd3b,0xdc99dba0,0xae51b249,0xb0cab142,
0xdc46c25a,0xe4b0e258,0xca7ddfcb,0xc81dc1bf,0xc85ed0b7,0x9c7e9bdf,0xa5719cdd,0xbcf2a722,
0xe7a6e365,0xf0c3fc49,0xf5cbf135,0xf9f7fb00,0xef710010,0xff91f2d9,0x054ef957,0x34e02252,
0x53354cae,0x5ad14d72,0x71fb71fb,0x71fb71fb,0x6f3871fb,0x39a058a2,0x29e3309e,0x121f1c60,
0x113b1e47,0x1d881a32,0x0f9a1928,0xfcd4febe,0xc87ce08b,0x8f00a429,0x98c38dee,0x8dee8dee,
0x8e178dee,0x8dee8dee,0x90c88dee,0xc201b78f,0xc9f5c20d,0xf88ae686,0xfb42f39e,0x17da1b73,
0x17ed1155,0x2a750ca7,0x71fb45f3,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4e0871fb,0x28a93e22,
0x0e341dfe,0x18280ebe,0x18301cc3,0x039015b6,0xdb97e75b,0xcb0fd9c7,0xcb33c14c,0xccafcb4f,
0xb0b8cb7a,0xb53eb409,0xafecb29b,0x91d6a409,0xcf3db0ae,0xe1d2ec38,0xdcedd1ca,0xd951e49f,
0xef96e106,0xfa88fb3c,0xea75e9f4,0xfda2f975,0x1a3a0203,0x35f92d77,0x2be02f48,0x4b9a3949,
0x58a151eb,0x71fb6f95,0x650667d0,0x42355a2f,0x40443b7b,0x40d134c8,0x2d564336,0x408939cf,
0x2d9a3875,0xef4106b1,0xc38edeea,0x95d7ab99,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0x8dee8dee,0xc804aa74,0xc589c984,0xe8f4dd31,0x0e73f788,0x01540a20,0x2de20e8f,0x4c283918,
0x67d35439,0x71fb7038,0x71fb71fb,0x71fb71fb,0x6ae471fb,0x2d433cae,0x10ed19eb,0x1c3e1a8e,
0x0a5d1401,0xe8b5fbd8,0xe63be7ac,0x093f02ae,0xdc35facc,0xc536ca7a,0xaab8c1b6,0xa2519cb2,
0xa7a4ad63,0xbdf7ad7f,0xcae8c7cb,0xd885ce7c,0xc219cc6c,0xf091d575,0xf232f7bf,0x099ef61e,
0xe0c5f447,0xe92ae38e,0x0a69f805,0x30071977,0x367133b3,0x64ee4ad7,0x71fb71fb,0x641971fb,
0x414e4b25,0x35e03489,0x374134ff,0x44c13c88,0x3bcf4669,0x31503829,0x16fa31d5,0xe45a02da,
0xcbfdd5b2,0xaa30c075,0x94f799c7,0x8dee8dee,0x8dee8dee,0x943e8dee,0xb4fba87b,0xb038b474,
0xbe6bb283,0xd2e6c6c9,0xff87e844,0x0a1406d0,0x258314c9,0x46db2963,0x4af25722,0x71fb5275,
0x71fb71fb,0x71fb71fb,0x53aa71fb,0x35ce396c,0x2ab23295,0x1eb02bfb,0xf9a80b3f,0xee36ee36,
0xf4a5f487,0xede9fc15,0xdee4e4f9,0xb698ca86,0xbf37bc59,0xb69db8ae,0xcdedb760,0xd733d7d2,
0xb98ac90f,0xd349c196,0xd264ceff,0xdb7cdd82,0xf2b5e40f,0xf686ee56,0xf633f816,0xf169ecdf,
0x0c40fbaa,0x0e940d16,0x30a21e62,0x3fd93ce0,0x6314519c,0x546361a1,0x513a4a63,0x64d15f52,
0x32355255,0x2206225d,0x16212090,0x2bc2229d,0x1b4b291c,0x059e10df,0xeed5059e,0xc3b7d989,
0x8dee9c7e,0x8dee8dee,0x95898dee,0xb1a1a4f8,0xaacba7a6,0xadc5aa68,0xc15ab142,0xd545cf62,
0xe7a0d904,0x0874f0dc,0x1e87151d,0x41592fff,0x4a2543f2,0x5f2954da,0x61266823,0x5f7b5e92,
0x71fb678b,0x592f6f74,0x25c142ce,0x03761141,0xffcbfc45,0x111b0957,0x190820b9,0xe699f7bf,
0xd2d1e2a0,0xc669c88e,0xaf97c3b8,0xc0edb1d2,0xc6febcf2,0xf229e9e2,0xe975e9b3,0xd2b9e13f,
0xb88fc0cb,0xd635c866,0xf8d9eac0,0xddd0ea3d,0xeceae827,0xf7aaef85,0x12570078,0x1c212356,
0x1b471658,0x26162538,0x2d6f2987,0x425f3122,0x525c4c83,0x60055e8f,0x40c559c2,0x34792cc5,
0x461a453d,0x1b8c3816,0xfe9d0a92,0xf5d6f1e0,0x02a30ace,0xe190ef72,0xb9cfcdd0,0x8dee93b8,
0x919992d7,0x9d4192ea,0xba17b0a6,0xb167b97a,0xb606af81,0xbe84be14,0xd530c5cc,0x02e0e7bc,
0x2aba15dd,0x2b263246,0x3f272f39,0x48373db3,0x580b52ee,0x63e45b8a,0x6ac16f06,0x3a8e552a,
0x1e9e264c,0x24e81ed6,0x1f9220d6,0x0afb1682,0x017d0468,0xe8c2fa63,0xe7dce3d8,0xecf8f513,
0xc975d71e,0xafd3b7e2,0xcf6fc276,0xde94d472,0xec44ea02,0xd37edb4a,0xe072dcc9,0xdce2dff7,
0xdd19e21f,0xbb50cbfe,0xcbcbc024,0xf84bdc24,0x116702c5,0x2d6127d3,0x2b5b30dc,0x240f2677,
0x18fb20a0,0x24ca1a9f,0x4f653cc0,0x41cb4bad,0x5d4a4c6d,0x50a861e9,0x37543d77,0x110e2ac1,
0x152d047c,0x20fb27b3,0xfbff0e5e,0xe0dbf390,0xa6d4bbcd,0xa911a405,0xb858b109,0xbe30bf04,
0xb988c035,0x9cb2ab27,0x96c5958b,0xbdeba69d,0xdd77cec4,0xf702e607,0x0ab20256,0x2c4d1632,
0x46433df5,0x53ed4692,0x4c4b5690,0x3df53c75,0x4b944548,0x54e756fe,0x3e0c4681,0x280c33b3,
0x23452400,0x083714ef,0x07930af7,0x04a30565,0xeb51fad6,0xd97cde70,0xd246d2d9,0xd354cce9,
0xdceadc22,0xcb65d743,0xc3e9c397,0xccc6c4d2,0xef84deea,0xe7f4f2e3,0xd610d7e5,0xd728ded1,
0xcefacdc1,0xe820dc15,0xf46cecaf,0x1aac04af,0x1b2820e8,0x24931f19,0x363b2eea,0x275f2c8d,
0x34352bc7,0x41203baa,0x442b463d,0x4e97491e,0x3d744977,0x3a183580,0x1f4a328a,0x108c14ed,
0xf0a7055a,0xeb5bea1b,0xd2dce595,0xa58cb79e,0xa207a039,0xaca4a6af,0xacc1abbf,0xbe40b236,
0xcbe1cc7f,0xc531c4b7,0xc8f9c807,0xd3cace23,0xf3a5e044,0x16a0061c,0x4cb3326d,0x45384e67,
0x54d04b49,0x47314f13,0x40cb4176,0x40154410,0x27e930de,0x38382ae8,0x3f344294,0x2883356d,
0x0c221c8f,0xed29f960,0xe20ce954,0xe488dcea,0xe888e7b5,0xd164e0ce,0xb9b4c228,0xce4ebf72,
0xe571d76d,0xed4df1f5,0xce6cdc2b,0xdc03d3df,0xe906e5bc,0xe5cfead2,0xcc97d669,0xdc7dce63,
0xfcbaedd7,0x080002c6,0x1f1c1582,0x0fd7192b,0x23f712b7,0x377f33d4,0x31013322,0x4af73cac,
0x3d104a01,0x47913bf6,0x47754bff,0x30984204,0x119e1993,0x07590cb8,0x08700777,0xf7bf0492,
0xd4a3e4d2,0xc7cecd00,0xb541bd13,0xb7fcb39b,0xa91fb346,0xadcca73a,0xc3b6b815,0xd998cc11,
0xdc40de8e,0xd8cedbfd,0xe06bd98a,0xfba5ef80,0x15db0768,0x3c052973,0x4ab0456e,0x62ef57c4,
0x4f375cae,0x3cb3453c,0x3f9d3722,0x32fc3fcb,0x1ab525ac,0x05330df9,0x0f4208cf,0x0f7514fd,
0xf5a80474,0xe879eb08,0xd86ce2d4,0xd442d332,0xd8eed47e,0xe3f4dfb8,0xe184e7ab,0xcdeed7e1,
0xce4ecbcf,0xe3c6d579,0xea00eb3d,0xdc34e195,0xdc8cdae0,0xee27e733,0xe5daebb2,0xebc0e330,
0x0787f802,0x298318b1,0x365331e8,0x39443988,0x262f314a,0x18641b15,0x33a62212,0x547148c5,
0x51c35433,0x34724abf,0x0c961b41,0x01f50611,0x07d30660,0x0068017b,0xf06efe32,0xdf89e428,
0xd4b4dd64,0xc04fc699,0xa856b55d,0x9fa7a0fd,0xb6dca861,0xcd8bc393,0xd0ccd3d0,0xd3c7cf43,
0xf571e246,0x09e70107,0x1b0614af,0x28421d76,0x394c34d1,0x326d32e0,0x43a13bb1,0x48ec46bd,
0x5234502a,0x31c7447a,0x1810243a,0x12a2120d,0x0f4e13d2,0x0ace0bbd,0x0370077a,0xf3b5fe97,
0xe75dede0,0xd6faddb1,0xe298dbe2,0xe49fe5a4,0xd830dfa0,0xd3ccd3f4,0xd28ed239,0xd29bd5b2,
0xd25dcf35,0xe48ddaf3,0x0096f46d,0xef40fdf9,0xe667e5b7,0xe8b0e6fb,0x0806f478,0x20491a21,
0x17e91d4e,0x1c4613c9,0x25942709,0x2b9725fa,0x34942fd2,0x338334ed,0x3bdd384a,0x3ccb39a3,
0x39313d65,0x2917344b,0x0b5219b3,0xee91fbb0,0xe780e8e3,0xd837dfac,0xda21d7ad,0xc3ddd376,
0xbb54b9dc,0xbea6bf22,0xc0f4bdcf,0xb41abd3c,0xbc8ab395,0xe1a9cd24,0xf2c7ed68,0x07b1fa6c,
0x16971272,0x1f9c1a66,0x1e961ebd,0x2341232c,0x34ad26e4,0x495141a9,0x432b49bd,0x2e3f3a18,
0x30e129af,0x2e2b34ba,0x20a52414,0x190f1e6b,0xfeff0ca5,0xeccaf9a3,0xce78da18,0xdb19cee3,
0xe260e2a1,0xeb8ce45b,0xe9abed09,0xdee9e38c,0xd54bdab3,0xce85d249,0xd3a6d031,0xe43adb17,
0xf74aeb81,0xf788fcba,0xe8c5ee92,0xf2b5ebac,0x01fcf8cb,0xfc2702a7,0x0951004a,0x1b6111b6,
0x2a8f25fb,0x26ef2b1f,0x2d20265b,0x3c2c3492,0x508046ff,0x425a501a,0x1fd02e4b,0x15a41956,
0x109812c0,0x036c0b94,0xf826fed7,0xdd74eb6e,0xc1eece9d,0xca5fc19c,0xdaced49d,0xdcb9de22,
0xc275d187,0xbb29b94b,0xc21fbec4,0xcf2ac65e,0xd61bd546,0xe747daee,0x0b00f851,0x1ec81883,
0x23a61f96,0x2b0d291a,0x364e2e2b,0x3ce03a4e,0x47744428,0x38244383,0x25fc2b12,0x1efa22ca,
0x282d227f,0x1ba02434,0x10211925,0xf71200e0,0xe01aee72,0xcdced15e,0xcfa7cf10,0xd901d200,
0xed86e2b1,0xfc5ef82b,0xf690fa8d,0xe370ed5f,0xd8e3dceb,0xcd47d44d,0xcf36c8bc,0xde51d9e0,
0xeac4e28f,0xfda9f1d0,0x0f330af0,0x091907e4,0x12911214,0x17291077,0x18281c7d,0x1c34172d,
0x33b62440,0x44b443b1,0x2318339c,0x23be206c,0x2f1d28e6,0x2ea030fa,0x24682c5b,0x01561436,
0xef77f566,0xec5cecf6,0xe8a7eca9,0xdcb0e10b,0xd9bbdbc1,0xc92dd25d,0xb80fbe7e,0xc384bbad,
0xccb5c9e2,0xc265c741,0xd26ec67c,0xee88e318,0xf9c1f2e9,0x161406dc,0x29eb2356,0x26ae2902,
0x2bdf26ae,0x367e3427,0x41c13b57,0x3dde4172,0x27203534,0x175d1a9c,0x1ed91ca0,0x1c901cd4,
0x0e161a10,0xf9e901ba,0xf708f54d,0xfca4fc1e,0xeab4f52e,0xd1c9dff6,0xc33cc406,0xde12ce31,
0xf53cebd2,0xf0a8f425,0xe02feb63,0xd6d9d66b,0xdd7ddc99,0xdfc5dc5f,0xe8ede71d,0xf136e75a,
0x0870000e,0x13840d02,0x1b491af8,0x0f6b15da,0x0d160cd6,0x17bf1244,0x169b1634,0x1a141814,
0x27fd2132,0x34ed2cb2,0x47144120,0x2f453e8a,0x1acb2305,0x0e2a1356,0x0b1f0beb,0x023b0a0e,
0xdb17f0f9,0xc9d6cc05,0xca00ca68,0xd1b3cd38,0xd32dd381,0xcfa2d390,0xc3bfc7d9,0xcbcdc7b8,
0xd261cd61,0xe365dafb,0xef5fe9a7,0x0eedfd0a,0x280c1ef7,0x1ea52580,0x18951a5b,0x27891c48,
0x36c432b9,0x30d53522,0x319c2f88,0x346933c0,0x27672f8f,0x1caf2368,0x09b80fe9,0x0e850ceb,
0x05a30a9a,0xf48efeda,0xd811e68e,0xcf1dcfdf,0xd6c9d292,0xdf40da38,0xe550e2ff,0xe543e629,
0xe26fe2af,0xedeae83f,0xf33ceef7,0xfa90fa11,0xe9c6f30b,0xe7c4e5ed,0xee36ea0c,0xfb28f63e,
0xff81fbc9,0x0a2d045b,0x18ea115a,0x24e520c2,0x1d4721e6,0x1adb1b6a,0x2a621fd9,0x36843451,
0x2a4a309c,0x2b3d2991,0x219d279c,0x16dc1c8b,0x0a301003,0xfcee054e,0xeca0f382,0xe181e590,
0xdd74e16f,0xc7f0d487,0xc49ec12a,0xd4cbccc2,0xdb17d96f,0xe06ade1b,0xd52cdced,0xc9d2cc0e,
0xdac7cffa,0xfc8beacf,0x14130a6d,0x18b21861,0x145c1579,0x2a0d1d9a,0x368d3163,0x3ad63a70,
0x38dd39b5,0x35e937ed,0x2e363237,0x20bd29f2,0x0cdf15e6,0x01a80653,0xf826fe0a,0xe5c3ed8d,
0xe7abe4da,0xe34ce713,0xded2e029,0xe817e1c7,0xef77ec13,0xed20f1c8,0xe008e571,0xe3dadfac,
0xe51ee609,0xe3f9e3a4,0xf03ae936,0xed69efd5,0xf903f1dd,0xfeb6fe32,0x015dfdb5,0x075305fb,
0x0ead09ea,0x12a91225,0x14061207,0x203d197d,0x33d22969,0x30ee3758,0x29302a13,0x21f92a31,
0x0fd115dd,0x08a40c9c,0x0dd807f1,0x107f1372,0x0dd80cd3,0xf8cd07db,0xe720ec13,0xd671e2e1,
0xc3dec87e,0xcde2c83f,0xccdbcebc,0xcd7dcbfe,0xc8b5cd24,0xcdc1c788,0xeab9da0d,0x035ffa2d,
0x0162046c,0x01c2ffd9,0x1c9a0b7d,0x359c2cbd,0x38cf381c,0x365e38cf,0x2ed7328a,0x2415291a,
0x21ad22e6,0x1e7e203d,0x1bae1d2f,0x10761825,0x026a07be,0xf9b5fd5b,0xef12f56d,0xe5f3ea3a,
0xdc6ee051,0xe660de9b,0xf1e9eee5,0xe5c3edcf,0xd3eadb45,0xdc9ed419,0xef1ce862,0xeccbef5f,
0xecbbeb29,0xf174ef0f,0xf709f353,0x08dfffc4,0x0d1c0d5f,0x09570ad5,0x07dc0927,0x04aa0472,
0x02e00502,0x0ce50472,0x173a14f9,0x21a319e0,0x39f92d17,0x429f443b,0x228e34fb,0x0a5e1247,
0x092d0926,0x0d1c0a24,0x01db0a9d,0xf908faf8,0xf951f9f8,0xf37ef6ee,0xd69fe9f0,0xbf60c61b,
0xb95cbc30,0xbad2b8f7,0xcdc2c10d,0xe3d4db37,0xec1be79a,0xfc9ef483,0x02c80107,0x0aa6057c,
0x184d12a5,0x10b315a1,0x14a20f6c,0x28f71e8d,0x32cb307a,0x347d32a8,0x36bc3774,0x284530a8,
0x1ebb21cb,0x115c1984,0x0a270c81,0xffe804e9,0xf26bfb7c,0xdd25e61f,0xd951d94a,0xdf5adb7a,
0xe43be28c,0xe1d0e3c6,0xe946e341,0xf071ee33,0xeefdf04e,0xed16ee3b,0xeb5deac0,0xf94cf08a,
0xfdb8ff50,0xf971f89b,0x03530013,0xfb43ffcf,0x01a2fc31,0x054004e6,0x0b970674,0x0c3f0f9a,
0x09880842,0x1c031091,0x3384294f,0x35a2385b,0x2f1d3130,0x25c02b66,0x1e8d2258,0x06f41555,
0xec47f767,0xeafae971,0xf518ef46,0xf38cf75a,0xe9cbede6,0xe239e584,0xdeeae1d2,0xcb4fd6fd,
0xbd3cc068,0xcc5fc254,0xda10d4f3,0xe65bdf57,0xf758ef95,0x05acfd42,0x150e0f75,0x148815a1,
0x19fa1551,0x2c84222a,0x321c337b,0x2dbd2e4a,0x33802ff5,0x30da34f6,0x220628c2,0x1ac91e4c,
0x0a1e1406,0xf3c7fea5,0xea50ed51,0xe5fce807,0xe393e2ff,0xe990e7bc,0xe126e65b,0xe405df2f,
0xf3d9ec9a,0xf58ff6eb,0xe84ef022,0xe45ae2c4,0xf353ebc6,0xfb0ef8f1,0xf4bdf8bb,0xedc2efd2,
0xfab5f238,0x07f40309,0xfdfb04b1,0x0328fd4f,0x0ca208f0,0x10c50ec5,0x13f51365,0x175f1447,
0x1a5e1a7d,0x21b81c2a,0x295d270a,0x26332939,0x17ed2037,0x04920d54,0x06b70317,0x0fdb0c6f,
0x023b0be2,0xef2ff7ac,0xe842ea8c,0xe39ee529,0xdef3e32b,0xcc6cd6bb,0xc0b1c2ef,0xce68c63e,
0xd69dd560,0xcf10d1fd,0xe491d530,0x02eaf42b,0x1ba1125a,0x1fae1f1b,0x1f0d1f74,0x231b1f99,
0x2d282883,0x2dfc2ed0,0x30ab2e3c,0x281c306a,0x13c11c8f,0x0f0a0eb0,0x161213a5,0x0b6712da,
0xfafb0207,0xf519f752,0xe722efce,0xd9c1df23,0xdba3d8c7,0xeca6e2aa,0xf5d8f3d0,0xedddf3ce,
0xe53de6dc,0xe7cae7af,0xe967e625,0xf5dbf0da,0xfb80f847,0x0196feb5,0x04e10397,0x03c50524,
0xfb23ffc5,0x0181fb09,0x0e0a0a82,0x0095088c,0x01c2fe8e,0x083105bd,0x126c0ba5,0x25411c16,
0x28d229a1,0x25b82764,0x1c9b2133,0x1b471b0f,0x19ba1b35,0x11f816e0,0xff540a0e,0xeeebf568,
0xefc9edd4,0xe71fee9c,0xd170dc92,0xc39ec8fd,0xc999c34c,0xda8ad2ce,0xda60dd6b,0xda24d75f,
0xeb64e0e6,0x00fbf753,0x024c04db,0x0449003d,0x10f90aa7,0x1ff7186c,0x2dc326df,0x37fe3417,
0x340e3846,0x25322da3,0x18a81d22,0x17fc1724,0x1320181f,0x05480b5c,0xff8e0216,0xfde6fd55,
0xf814fe57,0xe232ecd1,0xdbc8dc62,0xdc56dcde,0xd8d0da0a,0xe2ccdbf3,0xef18e936,0xfd49f5fc,
0xff100076,0xfd52fbc6,0x01660218,0xf7ccfae5,0xfaecf988,0xfc31faee,0xfddefddd,0xfeb5fd29,
0xfcdbff97,0xf6fdf944,0xfb08f739,0x1027044e,0x1a1317ed,0x1a0919c0,0x267e1e7e,0x301d2e1d,
0x232a2bdf,0x14791afd,0x111010ec,0x0ab50fc8,0x018904c6,0x001f00fe,0xf727fc1e,0xef0bf3b5,
0xdbb1e605,0xd65ed63e,0xd5dbd704,0xd1f7d3e4,0xcd72d03d,0xd0e4cc73,0xe63cd9bb,0xfe42f4ad,
0x027f015f,0x01cb0291,0x03760195,0x0fea08dc,0x2121175d,0x35c72c5c,0x3bb23acc,0x38f33ac5,
0x30933505,0x23b92b79,0x0ac3188d,0xf25afd0c,0xef34ecf1,0xfe07f794,0xf6bdfc92,0xe99bf0a8,
0xe393e346,0xeb3fe818,0xed63ec42,0xea0ced84,0xe374e5a2,0xe6ffe3b4,0xf94dee77,0x08e0030a,
0x068909b0,0xff5602d5,0xf7eafb40,0xf662f6a7,0xf26bf4ec,0xf4dcf20d,0xff90f9e6,0x06e5041d,
0x0b7b09d2,0x0c020b93,0x08000bd4,0x08d00478,0x1fa21495,0x266c25d2,0x19a12118,0x158b157d,
0x1ba617a4,0x1dde1f28,0x0c28165b,0xfc73028f,0xfe23fc27,0xf8a7fd03,0xef61f3c9,0xdd39e7e6,
0xcb6bd30d,0xc957c82a,0xd0b3cd30,0xd22dd1de,0xd788d381,0xe748de68,0xfe35f27c,0x0718055f,
0x0e730919,0x17d01455,0x21901be0,0x2a91262f,0x2c402d04,0x299529ec,0x2ce82b1f,0x2c312daa,
0x1b7026c3,0xfcb60ba8,0xef8af2e7,0xf587f1ea,0xf468f712,0xe87fed88,0xeec9ea30,0xf47af1bc,
0xf712f79c,0xe818f073,0xe246e2f7,0xe8dee4f9,0xee6beb8a,0xf8d1f379,0xfd18fc7c,0xfb6cfb49,
0x071e003a,0x10580cd9,0x098b101a,0xf13cfd69,0xf1a8ed29,0xf6c9f630,0xfb0ef801,0xff51fcf7,
0x07d40395,0x0f150b8d,0x1869131c,0x19441b9a,0x1af11708,0x2266205c,0x27ba249f,0x1b702510,
0x0ec812d6,0x08e20b7d,0x08fa08f6,0xfefb05af,0xe813f480,0xd4e2dcca,0xd36ed1c3,0xd920d7bb,
0xcefbd4c5,0xca49cb19,0xd8b2cf3f,0xe8abe120,0xf995f160,0x0521ffc3,0x0ea00a7c,0x0c3a0e75,
0x14500d53,0x25f51e47,0x2b31295d,0x28172b40,0x251c24ca,0x299f2859,0x1e892676,0x08b01300,
0x070a0589,0x0107060a,0xf881fbeb,0xeb88f343,0xdf40e3cf,0xe146ded7,0xe64ee3e8,0xef3aea63,
0xf260f1a6,0xf3b9f2c5,0xf561f4ec,0xf88ff658,0xffecfc2f,0x010401c6,0x03cd0113,0x05bb0678,
0xfc79014d,0xf95df9e5,0xf790f8a5,0xf808f76d,0xf737f823,0xfaa1f764,0xfb23fc80,0xff10fb4d,
0x0eb40572,0x23f71a3b,0x29c42965,0x236326fc,0x1f9920e0,0x1b1e1e6c,0x0df1145c,0x0eab0c9c,
0x0a890e96,0xfbe903f7,0xeb29f319,0xe6cce6d6,0xe76ae801,0xdabee334,0xc84ed028,0xcbdbc6e3,
0xdd74d454,0xe6eae418,0xe586e5ed,0xf359e9e7,0x060afdd6,0x0f910b65,0x16671389,0x1b8c18bb,
0x21a71ec6,0x2add24e3,0x37783244,0x316437a5,0x1bf126c3,0x0c0d1301,0x01c006f4,0xfac1fd35,
0xf3eef830,0xf046f0fa,0xebd6eefd,0xe85be955,0xe486e6e5,0xe6e3e455,0xee61ea2e,0xf674f314,
0xfeb0f98a,0x07ac0454,0x04c406f4,0xfea90288,0xf580f951,0xfba7f698,0x0001004b,0xf6f7fb28,
0xf50df5ed,0xf441f356,0x0084f9c1,0x05e60513,0x0004031b,0xfbe9fe5c,0xffd9fb2f,0x106d0882,
0x1adc1664,0x1e9e1d40,0x24262132,0x252b25c9,0x212f23bf,0x11d01b25,0x05bb0995,0x022d04bb,
0xf566fbd4,0xf3aef32c,0xeacff09e,0xddb8e4aa,0xd142d60c,0xd107d0e3,0xcc4ecea5,0xce7ccc11,
0xdee7d478,0xfa53ec91,0x08c903e6,0x0cdc0b00,0x12f20f15,0x1c69183e,0x20f61e4e,0x2a4d25c9,
0x2e862d1f,0x27df2cc4,0x1d6322bd,0x124e179a,0x07300cf7,0x007e02c0,0xf5c9fcf7,0xeb54ee95,
0xecb9eb4c,0xf2e3f01e,0xeed7f1c2,0xebf5ed08,0xec41eb00,0xf2fff054,0xf11cf25e,0xf798f277,
0x041bfebb,0x07be06d3,0x0724079c,0x0553069d,0xfe8702e0,0xef22f739,0xecacea64,0xfdb0f561,
0xfc5eff3d,0xfb53fabc,0xfa22fafe,0xfd1efa76,0x0681018f,0x0b1e09d1,0x0c440bba,0x103f0d4f,
0x1c7c159b,0x291d2393,0x2bb62c6e,0x22fd2731,0x1be7202e,0x0bc41542,0xf3a20038,0xe2f0e88f,
0xe649e3fa,0xe108e517,0xd72edbfa,0xd5bbd439,0xda85d9c8,0xd1cbd5e6,0xd948d350,0xebcbe19e,
0xfbcff577,0x06550044,0x183f0ee4,0x20441e9b,0x1c4c1ec0,0x1be51a40,0x27972221,0x254a27ba,
0x221e23cc,0x18a51deb,0x11301450,0x086d0de6,0xf8130076,0xf083f2b9,0xf244f0bf,0xf0ccf30b,
0xe884ec76,0xe51be5ba,0xea19e726,0xf136ed0b,0xfbb4f6eb,0xfea0fda7,0x035500ef,0x03340386,
0x05fb0435,0x04b5062c,0x01fd02ae,0x01c6024c,0xf7d1fe1a,0xedc6f1c7,0xe850eaa8,0xed8fe895,
0xfe2ff670,0xff7400cd,0xfed7fe1d,0x078601c4,0x16860f30,0x1b771ab9,0x184a19b6,0x1ab118fa,
0x1ec71c8b,0x226420e2,0x208d22b8,0x12ae1b29,0x017d08d7,0xfc30fe5c,0xeed0f737,0xda7fe509,
0xca49d070,0xd3b3cbe0,0xe184dc74,0xdef0e1ba,0xdabfdbf3,0xe2aedcab,0xf232eac2,0xfeb5f8b9,
0x093f0497,0x0def0bab,0x1c4513c5,0x286a233d,0x2d152c17,0x26fd2b2f,0x1d1821c1,0x1c211b73,
0x16141b16,0x06ef0ece,0xf7acfee0,0xf1d4f37b,0xf13af15a,0xf05af131,0xeb7bee16,0xea08e9fc,
0xee9febd2,0xf343f17d,0xf42cf3b0,0xfba1f6f9,0x04a10034,0x0ce208ff,0x0b5a0e08,0x03860737,
0xfd280050,0xf694f9f1,0xf43cf4bb,0xf0c3f2da,0xf437f0d9,0xf86ff7f5,0xf5eef6ee,0xf460f551,
0xf574f367,0x05affc21,0x16580f3f,0x175f18e1,0x159e1598,0x1a211732,0x247b1f0f,0x22d1265b,
0x16de1cd8,0x0fcb128a,0x0cf10e76,0x09b70b3d,0x00f40713,0xe488f4b7,0xd177d758,0xd834d2d2,
0xd95fdbaa,0xcc41d2bb,0xcd23c989,0xe3a3d6e3,0xf8b8ef61,0x01baff04,0x03860272,0x0bdc069c,
0x185d11fb,0x23681ee8,0x237f245a,0x22ff22f8,0x22c022dd,0x22a222e1,0x1d6a2147,0x06c714cb,
0xf1a1f901,0xf168f0b0,0xf43af20f,0xf808f758,0xf1fef56e,0xec41eefa,0xec96ead8,0xf57df0cb,
0xf8c2f889,0xf76df788,0xfdd5f9bb,0x0597024d,0x067706b5,0x07cc067a,0x09850936,0x00ac06ec,
0xf47af96c,0xef6bf1b6,0xeb5becd1,0xef2eec4a,0xf5f6f282,0xfc4ef9d6,0xfa0afbe5,0xfb6df9ac,
0x0189fe7b,0x09130490,0x1a5510c7,0x25ec222a,0x24a8264f,0x21082288,0x1cb61f72,0x172019ae,
0x100613f8,0x08520bdc,0xff8704b5,0xee8cf808,0xdc86e483,0xd9f2d8dc,0xdd07dcab,0xd1cbd8f8,
0xc9aacadf,0xdb89d05b,0xed68e641,0xf420f0ff,0x0376fa4b,0x15e70dd1,0x1a3319d4,0x1bf51a84,
0x1c821ce4,0x19d31b3c,0x1b1a1977,0x20241e1c,0x1e322029,0x14b01aa2,0x04d30cc4,0xfa3bfef3,
0xf1c2f5b0,0xec69eeea,0xe8f0ea2b,0xedb9ea1a,0xf3b0f136,0xf9a0f621,0xfca5fca1,0xf6d7f9da,
0xf806f5a5,0x0355fdcf,0x07f90674,0x0ac8099e,0x0a1a0b13,0x034f073a,0xf9ecff4b,0xf016f393,
0xf16df098,0xec0aef18,0xede6ebd3,0xf098efa2,0xf4acf204,0xfc4ef871,0x04cb000e,0x0f0c0a4e,
0x14071234,0x17df1592,0x1cdd1a82,0x252b1fa2,0x2e692c04,0x1e3628f9,0x0a391256,0x077e0755,
0x033406f5,0xf41ffc1d,0xe75ced6d,0xddc0e1af,0xddbddd08,0xdae0dd67,0xd2add676,0xd616d23a,
0xe46fdd21,0xeec0e9d8,0xf9a0f42f,0x03b8fe94,0x0f55093f,0x1d5515dd,0x2cb225f5,0x268d2d09,
0x17da1de7,0x16db15cf,0x1a411944,0x12811826,0x025e0a9e,0xfb3cfc83,0x01ebfe8d,0xfc64018f,
0xeb26f463,0xe048e388,0xe995e299,0xf93bf29a,0xf9c8fb16,0xfd6cf9d1,0x05650258,0x05dc05c8,
0x05c1064a,0x02a203b5,0x050f03d1,0x019903c5,0xfee70044,0xf93bfc7d,0xefeef489,0xedecede6,
0xeb30ece0,0xecb9eacf,0xf3caf012,0xf7eff646,0xff63fab3,0x08360417,0x0f270bc3,0x17141272,
0x23391d30,0x27fd270f,0x1f86256f,0x142018d1,0x14cc12d3,0x19d918b5,0x0cb215d4,0xf50800ea,
0xe891ec66,0xe90be863,0xe221e7c7,0xd0b7d926,0xcf5acd58,0xdb5cd4d9,0xe5c4e13a,0xea43e86c,
0xf121ecb5,0x0066f82f,0x0df007e2,0x17ed1332,0x1e6b1bcb,0x1efa1f43,0x1e791e79,0x21131f4a,
0x239a233f,0x13801ed3,0xfb3005a3,0xf88df72b,0xff74fc31,0xfa92ff38,0xeefdf3d3,0xf09eee23,
0xf66af3f0,0xf5abf718,0xf18af344,0xf18cf0c2,0xfcb6f58b,0x093d0400,0x0e760c62,0x0e620f3f,
0x08940bfd,0xff130405,0xf69efa4c,0xf449f4c1,0xf443f47a,0xf1dbf337,0xeffaf0cf,0xedbfeea1,
0xf32eef5e,0xf72cf667,0xf7a1f6cc,0xfe1dfa15,0x081502df,0x11640cfd,0x1c391619,0x29b023ed,
0x27852a67,0x22112468,0x1d3b1fd9,0x12e519b3,0x00d00972,0xf823faee,0xf928f811,0xf3bdf863,
0xe346ec34,0xd360da50,0xd2add099,0xdceed7c0,0xe12de011,0xe2a0e166,0xee3ce687,0x0026f7f3,
0x086c0558,0x0d840ad1,0x17431190,0x1f991cbf,0x1eb01fa5,0x1e9f1e29,0x1f4d1f78,0x18031d03,
0x0a361117,0x02700576,0xfbcefffe,0xefbcf5e4,0xec9bec1b,0xf650f0f1,0xf733f8d3,0xf1a9f392,
0xfa02f456,0x00ddfee7,0xfbfcff75,0xfa63f95f,0x02aafe60,0x099b066b,0x0bd70b7d,0x0a550b6d,
0x049207cc,0xfcc300df,0xf2c9f7b0,0xe618eca3,0xe296e1bb,0xeea4e7e6,0xf7adf463,0xf71bf840,
0xf7dff67f,0xff69fb51,0x05730324,0x095406ef,0x15870e6a,0x20491c33,0x236d2224,0x251c24b8,
0x238b24b8,0x1b3520c9,0x0b60139e,0xfe8e03e6,0xfa49fc15,0xedb8f5b0,0xdf4ee4fa,0xe18dde71,
0xe434e478,0xdb87e084,0xd6f4d7ba,0xddd6d960,0xe95ee321,0xf7ddf0a9,0x04fefe6c,0x10600b23,
0x16bf145c,0x185717d2,0x17691830,0x1b6a1823,0x21d71fe0,0x1ac01ffb,0x0d8313f0,0x05e50913,
0xffc502fc,0xf5edfb37,0xef8cf119,0xf2ecf0e8,0xf145f302,0xf1edf012,0xfb42f658,0x0087ff05,
0xfce8ffb5,0xfc97fb18,0x065c00cb,0x0e210b73,0x08700ca8,0xff990340,0xff81fe31,0x01fe015b,
0xfc2e001a,0xf1c6f700,0xe77cec56,0xe722e586,0xed0dea7d,0xf0c2eecc,0xf80df3d3,0x0019fc9b,
0x04c8025a,0x0c620867,0x11040f27,0x148b12b1,0x197d16b9,0x24651e68,0x27c0282a,0x1fe2246e,
0x14641a95,0x085a0dde,0xfebc03b5,0xf285f8d0,0xe4a9ebb2,0xda29de1f,0xda23d929,0xddfedbee,
0xe391e0ab,0xe7d3e611,0xe9bde91b,0xed8feab0,0xf938f2c8,0x0680ffdd,0x11330c9c,0x14fd13a4,
0x1a16170d,0x1df21ca3,0x1e8d1e9e,0x18831caf,0x0e2812e5,0x0bf00be8,0x08430bb6,0xf92f0178,
0xee6ef220,0xf176eeb0,0xf27cf31a,0xf14af0e0,0xf9f7f4d0,0xfe53fd98,0xfda9fd83,0x0195ff42,
0x050f03a1,0x05c605af,0x074a0611,0x08e40899,0x06370849,0xffa90305,0xf823fc4c,0xf0dcf3a5,
0xefa2f02b,0xe9f3ed48,0xeb83e8bc,0xf393f025,0xf399f4a5,0xf169f1d4,0xfac5f45a,0x0c22030e,
0x18691412,0x181618d3,0x1ab818cc,0x1f2c1cf9,0x217920f9,0x1b9a1fb7,0x11481655,0x0d210df7,
0x0ada0d16,0xfdf90576,0xed1df594,0xe096e5d1,0xdd0fdded,0xdededdbf,0xde1edf0e,0xdcf9dce2,
0xe32aded2,0xf2e8e9ee,0x0385fc46,0x05a5069c,0x03d103d5,0x0a6f062c,0x15620fa3,0x1dd91a8a,
0x1a841d97,0x17021788,0x188d1810,0x14181777,0x06e80e44,0xf8a6ff4a,0xf342f480,0xf4c6f3fb,
0xf2acf47a,0xee69eff4,0xf5eaf071,0x012ffc97,0xffa301df,0xfdb0fd44,0x043500e8,0x05e70594,
0x0a49073a,0x0df40d58,0x05560ad7,0xfd5e0050,0xfb49fbf9,0xf7aafa3a,0xececf2d0,0xe4e7e7ef,
0xe832e4cf,0xf424ee51,0xf774f737,0xf600f64f,0xfe67f8ad,0x081c0492,0x07130838,0x09510727,
0x139e0d58,0x23f11bb0,0x2c242a46,0x217f28db,0x10bf1883,0x0adb0c2b,0x0bff0ba2,0x04470a0b,
0xf226fb79,0xe793eb3a,0xe600e64e,0xe306e52d,0xdc5edfc4,0xd9c1d9f5,0xe05adc13,0xed4ae636,
0xf98bf46e,0xfda1fc11,0x05900082,0x14250c83,0x1ba619eb,0x140018e6,0x0e150fa0,0x112a0f2a,
0x15931313,0x15ea173a,0x0cc11165,0x074a09bf,0xfd6a034a,0xf1cff6f9,0xeb67eddf,0xec7aead3,
0xf62df07a,0x0086fc39,0x01bb0250,0xfedafff5,0x0478004d,0x0b2008f2,0x068a09f3,0x008f02e3,
0x00ccfff5,0x05350317,0x049905d7,0xfbb70151,0xee7cf4b6,0xe897ea64,0xec11e938,0xf02eef06,
0xef4ceff4,0xf0c7ef34,0xfb83f55a,0x04e900f4,0x076f0709,0x09940787,0x12fe0e0e,0x1bbf17aa,
0x20241ee0,0x1fb6200d,0x1ee01f72,0x19661d1d,0x0c7c135b,0x0066063b,0xf4c3fa6e,0xeb58efc6,
0xe6a5e80d,0xe774e6fb,0xe585e732,0xdf32e26c,0xdfd2ddd5,0xe918e46d,0xeff8ecb2,0xf763f3aa,
0x0159fb9c,0x0e53085c,0x15541253,0x183e179a,0x15f91708,0x14d415c4,0x0e21120d,0x0a0e0b6d,
0x07e20930,0x064306d1,0x05f70667,0x01380435,0xf9b2fd80,0xf335f664,0xeef3f072,0xf1b6ef67,
0xf7ccf4c6,0xfeddfb27,0x046c021a,0x08b7066c,0x0ad70a8f,0x092f0a0c,0x07550886,0x020f04ff,
0xff320002,0xfc77fe54,0xf5c2f960,0xedecf1a3,0xeaa2eb9a,0xea9bea77,0xeb12eab4,0xf034ec69,
0xfb8ef5c4,0x03bc0039,0x05db057e,0x078b062c,0x0e530a49,0x188313a4,0x1d4c1baa,0x1f321e73,
0x1d101f04,0x15aa198e,0x0f481231,0x097b0c66,0x00fd0629,0xf15df972,0xe690eac0,0xe5dce4e7,
0xe6d9e741,0xe2f1e4ba,0xe37fe284,0xea03e605,0xf1faee8a,0xf472f3be,0xf69ef540,0xfe4ef965,
0x0dfd0594,0x1a6f1548,0x1a831c30,0x127b1670,0x11241098,0x12f2125b,0x0fc5124d,0x03950a83,
0xfad4fdaa,0xfcf4fb37,0xfeb2fe7a,0xfa8dfd1d,0xf5dbf7fc,0xf577f4d0,0xf9ccf7cc,0xf910fa05,
0xfb8ef91a,0x0448ffcb,0x0bd70882,0x0e650e03,0x0a940d10,0x05210799,0x012f0331,0xfbbafed5,
0xf3a9f816,0xeca6ef90,0xebb2eb83,0xee33ecc7,0xf054ef96,0xf04ff058,0xf571f1d4,0xff79fa90,
0x03e302b0,0x054d0438,0x09f90735,0x12190dbb,0x19e81656,0x1da31c70,0x1ad31cd1,0x18121911,
0x16fd17d3,0x0eea1424,0x004b07db,0xf3a9f91f,0xf118f125,0xf1acf220,0xe8e4ee56,0xdf80e35a,
0xe096de62,0xe781e45b,0xec4be9b1,0xf215ef1c,0xf8cdf513,0x009cfcc0,0x07f4043f,0x0ef60bc6,
0x121c10b5,0x16bd1442,0x18321832,0x146e170a,0x0bab106c,0x04c207ac,0xff870251,0xfc00fd33,
0xfb11fbb0,0xf764f95f,0xf76bf65e,0xfe59fa77,0x01f50129,0xfe4e00ba,0xfb37fbd8,0xff38fc97,
0x01b9011b,0x019f017f,0x050d02f3,0x0a1707d0,0x09fb0b1a,0x034f071e,0xfc27ff8b,0xf40ef863,
0xeccbefc3,0xe94aeabe,0xe8efe895,0xebdee9f4,0xf52eef7d,0x00fefba3,0x03aa03bc,0x01b50222,
0x07d403c5,0x0ee60c13,0x11201030,0x161212fe,0x1d3919ea,0x1e341ec4,0x19df1c66,0x128a16dc,
0x06470cf1,0xfb2c003e,0xf3aef72f,0xed79f093,0xe78eea52,0xe4aae595,0xe75be534,0xebebea34,
0xea4beb92,0xeb59e9a1,0xf526ef7d,0xff63facc,0x058e02c2,0x0b740855,0x11090e96,0x11d6121d,
0x108b1141,0x0cfa0f28,0x0b8a0b5e,0x0df20cf4,0x0c200db8,0x024c0831,0xf9bffce7,0xf92cf8f5,
0xfb24fa11,0xf9a7fb24,0xf6a1f7d2,0xf9f0f742,0x0291fe60,0x057c0519,0x032a04d3,0x000a010f,
0x04170127,0x05db0629,0x01f103da,0x00c600eb,0x023b012f,0x005d025d,0xf74ffc65,0xee16f277,
0xe7edeaad,0xe6a9e673,0xec1ce8bc,0xf45af00e,0xfcc9f878,0x0613014d,0x0dd30a32,0x13351130,
0x112912f4,0x10700fe0,0x158f12a5,0x1984181a,0x185c1974,0x13c4168d,0x0bb9100e,0x02bf072e,
0xfa78fe90,0xf1e6f64f,0xebdaee25,0xe9b1ea7d,0xe84ee8e3,0xe7b2e7b7,0xebc6e912,0xf197eee5,
0xf4dcf39a,0xf48df4f1,0xf800f510,0x03ccfd4c,0x0edf0a0e,0x13951225,0x121d1325,0x11ce11ad,
0x104c1147,0x0cea0f0e,0x05a50995,0x01e702f3,0x00fe01b5,0xff04ffef,0xfca9fe79,0xf650f977,
0xf558f4be,0xfb11f7b3,0x0078fe42,0x01950176,0x001600b2,0x04e9012d,0x0c840952,0x0a920cea,
0xff8d057e,0xf9a9fafb,0xfd09fb35,0xfcc3fda2,0xf8fffb37,0xf47af66a,0xf2e3f392,0xf086f1c2,
0xee04ef4d,0xed9aed28,0xf260ef83,0xfd03f6e6,0x091103a7,0x0e2c0c53,0x119e0fde,0x15c913ab,
0x185c1775,0x155417a4,0x0fba123b,0x0ef40ede,0x0eff0f52,0x0a760d72,0x0234066e,0xfb2ffe53,
0xf508f86a,0xec31f093,0xe75ae8f7,0xe72ce6e0,0xe859e7c4,0xeb44e96b,0xef47ed6d,0xf307f0e6,
0xfb53f676,0x058b00ba,0x0ac008c8,0x0d160c0e,0x0e4e0dd6,0x0fec0f1e,0x107f109a,0x0dab0f5f,
0x09e70bf6,0x02f60699,0xffd4008f,0xfe1eff54,0xfc39fcab,0xfe39fd05,0xfd06fe47,0xfaf3fb8f,
0xfb8efb21,0xfdcffc70,0x00caff8e,0x03aa021b,0x074c05b8,0x06ae07a3,0x033a04e6,0x01b1024d,
0xfe91008d,0xf9f7fc52,0xf5f5f782,0xf58ff5ad,0xf3b7f4a9,0xf535f401,0xf679f614,0xf6c9f6c9,
0xf34bf556,0xf22cf1c6,0xf9f0f4bf,0x04a9ffec,0x0907076f,0x0fd70bb8,0x1a7c153d,0x20bb1ee2,
0x1b341f61,0x117715f2,0x0bc30e2f,0x06870920,0x018603de,0xfcc9ff26,0xf753fa38,0xf266f478,
0xeffaf12a,0xebecee3c,0xe8b7e9e7,0xe918e86e,0xee32ead5,0xf4dcf1f5,0xf6eff627,0xfc70f8d1,
0x04c700c1,0x0b490822,0x10ea0e41,0x104611c1,0x0a3f0d06,0x097208ed,0x0b5e0aa5,0x088d0ab9,
0x023b0551,0x01fe0104,0x03f303ba,0xfe5001c0,0xf8a5fb09,0xf89df7b8,0x0002fbd8,0x021402b9,
0xfa4cfe69,0xfa65f893,0x0317fea0,0x093906fd,0x087909bc,0x02fd0607,0xfdf9001c,0xfdd4fd3b,
0xffa0ff14,0xf9a6fdd6,0xefc3f458,0xee11ed4a,0xf51bf160,0xf5bff6a5,0xf331f406,0xf630f400,
0xfde2f9af,0x04e6020d,0x04210585,0x02ea0270,0x0eb90717,0x1d1616f6,0x1ec61f7b,0x181f1bd1,
0x12c714f4,0x0d4c1088,0x039808c8,0xf8ddfe59,0xf206f468,0xf3d0f238,0xf6dbf5d7,0xf3dcf64b,
0xeec3f0cf,0xef2fee6e,0xf07ef037,0xed9def83,0xecbfec36,0xf359ef25,0xff47f8b5,0x0a8305d7,
0x0bc40c31,0x0ae40ac0,0x0f550c76,0x13e0123b,0x0e151290,0x03a3084f,0x01290170,0x03a40230,
0x054804f3,0x0116040f,0xfa4bfd3a,0xfb9cf9c4,0xfefbfe0c,0xfb30fdde,0xf782f87e,0xfe31f975,
0x07c7039b,0x0830092b,0x03ef0605,0x025802ba,0x02df028c,0x016202d1,0xfb9cfeb8,0xf62df8d8,
0xf320f42b,0xf457f35c,0xf64ff576,0xf4bef626,0xf1faf320,0xf600f2f0,0xfe3dfa57,0x024000c1,
0x033a02d2,0x055803bc,0x0bdc0830,0x10bf0f0c,0x109110fb,0x12ab10f9,0x170a1530,0x16621780,
0x0fb913c2,0x05bb0a97,0xfd52018d,0xf3d3f896,0xee96f04f,0xed9cedf1,0xed54ed83,0xef3eedd5,
0xf400f193,0xf55bf53e,0xf2b5f456,0xf12bf155,0xf42bf222,0xfc6ef792,0x06f401f5,0x0c720a5c,
0x113c0e9a,0x14b713c9,0x0f8c1329,0x07a50b28,0x055405c8,0x045d0526,0x00060280,0xfc28fdb7,
0xfbcffb7d,0x0094fd80,0x05a10408,0xff9703b1,0xf948fb58,0xfc25f9c8,0x006efeca,0xffa90050,
0x01d4ffc9,0x072404ec,0x044906db,0xff320158,0xfc24fdb7,0xf95ffa92,0xf8ddf8e1,0xf8bff8dd,
0xf7fdf881,0xf589f6d9,0xf2eef40e,0xf3d9f2a9,0xf9e8f680,0xfe05fcca,0xfd86fdd2,0x01e7feec,
0x096f05e7,0x0d900c13,0x10450ecc,0x146d1259,0x160f15ed,0x11591460,0x0cfb0e78,0x0c200ca5,
0x06aa0a24,0xfd99025f,0xf4cff8d8,0xef9bf1db,0xeb58ed8a,0xe7fee946,0xea0ce802,0xf279edea,
0xf870f632,0xf9caf984,0xfb71fa54,0xfdc7fcfa,0xfe42fdfc,0x00f4ff56,0x04380271,0x0a6f06ca,
0x11760e4d,0x12a31319,0x0ca6102e,0x080009bf,0x053b06e2,0xfffd02d1,0xfc40fd95,0xfcb4fc1c,
0xff14fdda,0xffc3ffdd,0xfdbefeb5,0xfe98fdc3,0xfe84ff07,0xfd33fd84,0xfffbfe30,0x0236018e,
0x013801e0,0x01df0127,0x056c03b3,0x012d04ee,0xf764fbd5,0xf5dff587,0xf956f7aa,0xf965fa15,
0xf4a8f77c,0xf1f8f262,0xf59bf367,0xf98df7c1,0xfd73fb53,0x01b8ff75,0x0743044e,0x0cfa0a5d,
0x10c70f22,0x1185117a,0x107c1111,0x0f710fcf,0x0fb00f85,0x0db40f4d,0x070c0ad7,0x0074035b,
0xfd13fe98,0xf8a5fb55,0xf269f599,0xed23ef8c,0xeb52ebad,0xed0bebdf,0xeef8ee01,0xf0a8efb4,
0xf6e2f2d7,0x008ffc09,0x039a0327,0x02de0303,0x04b3039c,0x04e50507,0x0649050f,0x09bc07f9,
0x0dbd0ba6,0x10b50fa9,0x0f8510c8,0x09290cdf,0x002c04b1,0xf9b8fc55,0xf82df88a,0xf981f896,
0xfc60fb04,0xfd1dfd1c,0xfe34fd29,0x013dffc2,0x042c02e8,0x03530473,0x0056014d,0x00fd0071,
0x001f00e2,0xfcfefed5,0xf9dafb4c,0xfb4ef9db,0xfda2fd1e,0xf935fc45,0xf24df55a,0xf387f193,
0xf9f0f6d2,0xfb4afb97,0xf881f9cd,0xfbb3f910,0x0336ff7e,0x085e0637,0x0c160a4b,0x0f3c0df1,
0x0ff00ff3,0x0fd80fdb,0x0f880fde,0x0d100e95,0x09700b56,0x061c07ae,0x039e04e1,0xfee901ac,
0xf6a1fafc,0xef5ff26d,0xed54edcd,0xecdeed3b,0xea80ebcd,0xec72ea58,0xf3d9f00e,0xf815f65d,
0xfc4ef9b8,0x0403ffa9,0x0b650839,0x0ca70cf1,0x08b20b04,0x062f06b7,0x07ee06f1,0x095008d7,
0x08860948,0x078d079f,0x0a3908b2,0x09fb0afb,0x024706de,0xf80dfce1,0xf506f550,0xf8dff68e,
0xfca5fb2a,0xfe11fd8c,0x000efeca,0x043301ed,0x062905d4,0x036704ff,0xffbe0195,0xfb6cfd78,
0xfa2bfa54,0xfad6fa83,0xfb35faf9,0xfc5bfbae,0xfd6ffcfa,0xfce0fd7c,0xf8b1fb28,0xf33bf5c6,
0xf2d1f20c,0xf95af587,0x008dfd8f,0x0358027c,0x07b104e4,0x0ef10b70,0x1191110e,0x103a10f2,
0x0f9a0fc5,0x0ebf0f4c,0x0d3e0df9,0x0a360c0e,0x03bf071e,0xfe8200bd,0xfaa1fca7,0xf5edf871,
0xf086f32e,0xebf9ee20,0xeb03eab9,0xef3aeccc,0xf1bcf10f,0xf18af1aa,0xf602f2b9,0x01d4fb9e,
0x08870693,0x06e0082b,0x075f0654,0x0bc10999,0x0c810ce6,0x097a0b26,0x069e07c1,0x056105da,
0x063e0572,0x07ee077a,0x04cb06de,0x022802fd,0x017801eb,0xfdc90028,0xf6abfa7b,0xf17ff34b,
0xf4b1f1ea,0xfe39f947,0x05b80288,0x06ef0738,0x0458058b,0x03e603eb,0x01f10367,0xfd3dffe9,
0xf76afa47,0xf55cf586,0xf951f6f5,0xfc5efb6d,0xfaa8fc11,0xf89ff938,0xf9f5f90a,0xfa6ffa9e,
0xf7b9f956,0xf8aff702,0x031afd0c,0x0e080944,0x11b410de,0x110e1164,0x10ec1105,0x0ed1102e,
0x0b820d40,0x083809bc,0x06920718,0x04f8060a,0xffec02c8,0xf920fc9e,0xf28df5b4,0xeeeaf03a,
0xee85ee72,0xef4feed7,0xef0aef6a,0xeeb4ee7c,0xf39af079,0xfb35f76f,0x0057fe26,0x032101e9,
0x07d3050b,0x0d690ae6,0x0f4b0ed3,0x0d890eb9,0x0a0e0bba,0x08c8090e,0x08e608df,0x066e081d,
0x01ba0424,0xfe1affac,0xfe60fdbc,0xff22ff1f,0xfde6fe97,0xfc78fd67,0xf8edfabf,0xf7d1f7c8,
0xfabff8df,0xff7cfd33,0x03360186,0x062504a1,0x07610731,0x03550605,0xfd4e0019,0xfa24fb5e,
0xf78ef901,0xf659f69b,0xf75cf6cc,0xf8bbf808,0xf9dff94b,0xfc06fab8,0xfe3dfd46,0xfe99fea3,
0xfe8bfe7a,0x0086ff19,0x05c102b4,0x0cab092d,0x11b40f83,0x133e130b,0x10cc125c,0x0ddd0f70,
0x09320bb6,0x052b070a,0x01af0376,0xfd6affd7,0xf7d8fac0,0xf24df508,0xeebaf00b,0xede5ee1c,
0xecd3ed5a,0xecbbec84,0xf0a5edfa,0xf7fcf460,0xfc40faa5,0x0002fdd5,0x06770333,0x0b310949,
0x0cfd0c44,0x0f330e0a,0x0f350ff6,0x0abb0d38,0x079208a5,0x065006f8,0x027d04da,0xfdb8ffe3,
0xfcf9fcb9,0x0034fe53,0x00a00122,0xfba5fe67,0xf85ff975,0xfaf1f8e6,0xffe2fde0,0xfe48fff9,
0xfa38fbcc,0xfc5efa5f,0x0200ff47,0x05a30452,0x057f0619,0x02cd0445,0xff8d0127,0xfbd8fdb0,
0xf73ef9ae,0xf350f4e9,0xf2f4f294,0xf6bdf456,0xfc98f9b2,0xfed0fe72,0xfe17fe48,0x0172ff10,
0x081304e5,0x0aad0a31,0x09140a12,0x095408ac,0x0ed30b88,0x14731222,0x133714e5,0x0bbd0fc8,
0x060c0855,0x00e603da,0xf7dbfcb4,0xef85f329,0xed39ed78,0xf00bee6e,0xf130f13a,0xeed5f025,
0xef04ee48,0xf4fbf17d,0xfafef887,0xfce4fc34,0xfff9fdf9,0x05f802c5,0x0c380957,0x0ee70e34,
0x0e230eba,0x0ca60d5f,0x0cc40c62,0x0ce80d4c,0x06d50ac4,0xfe3101fe,0xfcabfc58,0xfea2fdce,
0xfce1fe2c,0xf960fb11,0xf8cdf87d,0xfc64fa4b,0xfebbfe14,0xfd44fe55,0xfc03fc28,0x0002fd80,
0x03a4027d,0x01a20316,0xff1d0013,0xff41fea5,0x02ba007d,0x063204ec,0x01b40526,0xf78ffcd3,
0xf14af377,0xf1ccf106,0xf42bf2d5,0xf670f55a,0xfa49f7ea,0x0264fddd,0x0aac0723,0x0c810c66,
0x0a9b0ba0,0x0a690a08,0x0cef0b85,0x0d830dcc,0x0abb0c38,0x0ad10a14,0x0e0a0c7b,0x0bae0e16,
0x01220703,0xf627fb3b,0xefeef27b,0xec42eddf,0xea94eb1e,0xebfeeadc,0xf0c6ee01,0xf614f3aa,
0xf875f7c1,0xf92ff8c4,0xfbc3fa1c,0x016afe44,0x08b2052f,0x0db40b9b,0x0ef00ed8,0x0f350ebf,
0x11fb1088,0x1055123b,0x07670c86,0xfe82024c,0xfd35fcc7,0xff1ffe6c,0xfc33fe4e,0xf7e6f9be,
0xf7fcf745,0xfb1cf968,0xfcfafc67,0xfd15fd02,0xfea9fd89,0x00e8ffe9,0x01df019f,0x02110215,
0x026a0233,0x01c6027d,0xff7000a2,0xfe8dfea2,0x001fff62,0xfee20019,0xfb41fcf3,0xf868f9b4,
0xf64bf745,0xf36cf4f6,0xf289f23e,0xf7e6f44a,0x019dfc8b,0x0a1e0672,0x0dfd0c9b,0x0f8b0eeb,
0x0f2f0fb5,0x0beb0dd1,0x09f90a70,0x0b9b0aa4,0x0c2d0c3f,0x09670b41,0x055f074e,0x016203a1,
0xf9f5fe23,0xf0dcf56b,0xe9f9ecde,0xe825e875,0xe925e863,0xed53ead3,0xf3e9f08c,0xfb4df771,
0x0211ff11,0x044103bc,0x0492044e,0x07050574,0x0b74093d,0x0ead0d65,0x10640fa1,0x10b410da,
0x0ca80f2c,0x074a09e3,0x020304d1,0xfc7dff50,0xf863fa35,0xf6e2f727,0xf8edf789,0xfb0cfa44,
0xfb0ffb28,0xfbf2fb42,0xfd83fca7,0x0028feb2,0x02ea0199,0x045f03c8,0x03550436,0x000f019d,
0xff27ff1e,0x01d80046,0x02e30309,0xfe910138,0xf953fb84,0xf91af87e,0xfa1cf9e8,0xf86cf981,
0xf55cf6fd,0xf37ff3f5,0xf7a7f4b8,0x000efbd8,0x06ae03b8,0x0be90954,0x11110ea0,0x142012ff,
0x13a41458,0x0f5811f6,0x09390c3f,0x05d206fd,0x0517055f,0x02bc0473,0xfb4cff92,0xf3acf6de,
0xf10df1fe,0xef77f03d,0xed65ee8a,0xeb10ebfd,0xed10eb5d,0xf273ef85,0xf932f5bd,0xffcffc97,
0x06ae0327,0x0ceb0a30,0x0dbb0e06,0x0cd30d16,0x0d960d2e,0x0d5d0dc4,0x0c0e0cc1,0x09f50b49,
0x06050815,0x014403b1,0xfc67febc,0xf8b5fa6f,0xf658f74f,0xf63df612,0xf758f6b7,0xf9c8f85c,
0xfcdcfb57,0xff4efe23,0x020c007a,0x051603a4,0x05c105e0,0x03a404db,0x028802b4,0x034302c4,
0x015102f6,0xfbe1fec1,0xfa1cfa3a,0xfc9ffb46,0xfb43fcc0,0xf568f870,0xf2b6f33e,0xf5d8f3cd,
0xfa69f848,0xfdb2fc2e,0x0164ff59,0x06c103ec,0x0c4109a7,0x0f670e26,0x110c1058,0x125611c1,
0x11bc1262,0x0e5f105e,0x089c0bb4,0x015f0504,0xfa9afdcc,0xf550f7d6,0xf1c4f323,0xeff9f0da,
0xee14eeeb,0xee8aedf6,0xf001ef58,0xf1b6f0c2,0xf3d3f2d4,0xf811f53d,0xffddfbdc,0x06610367,
0x0c530955,0x12460f67,0x15b11499,0x122f14e2,0x0b260e9a,0x079408ba,0x058e06d3,0x01410395,
0xfe17ff92,0xfbc0fcfa,0xf9aefab3,0xf833f8dd,0xf66ef776,0xf4bff54d,0xf7aaf587,0xfddefaa5,
0x028e0069,0x05ca0445,0x076306ef,0x06900741,0x04b5058b,0x03aa0417,0x00f502ac,0xfd1cfeff,
0xfb68fc06,0xfa47fb01,0xf920f989,0xf89af8e3,0xf813f85f,0xf763f7ca,0xf65df6c6,0xf78ef65d,
0xfdc9fa2f,0x04d10150,0x09c4078d,0x0d040b6f,0x0ffc0e8f,0x11841110,0x10b01155,0x0f780ffe,
0x0def0ee4,0x0a1a0c62,0x033e072b,0xf896fe60,0xee04f2e9,0xe9f9eaef,0xec63ead8,0xee7ced9d,
0xf04eef5c,0xf1e3f10b,0xf5ebf37b,0xfad3f8a3,0xfc4cfbfd,0xfd1cfc65,0x03e1ff68,0x0f8b09d2,
0x1523137e,0x143d1506,0x12fb1377,0x10881222,0x09890dba,0xfef3045b,0xf77dfa47,0xf792f6d7,
0xfa78f903,0xfc37fbce,0xf9fefb7c,0xf782f888,0xf81df768,0xfadff98d,0xfc1efbb3,0xfeeffcfe,
0x049901a6,0x08cf0700,0x0ac40a17,0x08e90a76,0x03970669,0xfece00de,0xfc00fd12,0xfa31fb16,
0xf81df914,0xf798f785,0xf813f80d,0xf60ff75e,0xf4d7f4ee,0xf8d6f646,0xfe8bfbcc,0x01780056,
0x02ec0214,0x08cb0511,0x11440d43,0x13db1393,0x10bb128d,0x0e580f33,0x0e0f0e19,0x0ca80dd9,
0x070e0a60,0xfe9e030f,0xf630fa1c,0xf108f34b,0xec7feee4,0xe7a4e9de,0xe766e699,0xee1dea0c,
0xf687f26b,0xfd1efa17,0xfef2fec1,0xfe6cfe60,0x02c0ffed,0x09e20662,0x0dfb0cb2,0x0e6a0e42,
0x117e0f63,0x14c913af,0x10f213db,0x07c30cb1,0xfed002e4,0xf916fb83,0xf613f75e,0xf4c1f531,
0xf4b7f49b,0xf69df549,0xfb1ff8af,0xfe1afd18,0xfe30fe5a,0xfe8dfe2c,0x0059ff4a,0x044e0221,
0x086e0690,0x09760951,0x07e208d2,0x059c06e0,0x01c80408,0xfb35fed0,0xf50df7b8,0xf2d1f36c,
0xf493f345,0xf7b1f640,0xf826f853,0xf76df797,0xf9baf823,0xfe7efc03,0x036a00dd,0x088005f9,
0x0cae0ac0,0x0ec80e0a,0x0f700f0a,0x112e102d,0x11171188,0x0e530fe4,0x09cb0c41,0x02850687,
0xf9bbfe2c,0xf35cf61c,0xef37f14c,0xeb07ed08,0xe912e9ba,0xeb12e992,0xf023ed70,0xf55af2d4,
0xfa77f7d0,0xff9ffd05,0x05a3025f,0x0b2808e8,0x0bfa0c08,0x0ceb0c26,0x100f0e71,0x122911a5,
0x0ffc11c3,0x0aca0da8,0x043a07b5,0xfd02007a,0xf8f1fa65,0xf7bff835,0xf5acf6ea,0xf2a9f420,
0xf226f1c2,0xf87df486,0x0028fce5,0x02a201f7,0x032202c9,0x059d041f,0x08380735,0x075f0843,
0x047805e0,0x037c03af,0x035a037e,0x01c002cc,0xfdd50028,0xf7b1fac1,0xf310f4f4,0xf219f20c,
0xf31af2a3,0xf3ebf345,0xf884f594,0xffb0fc2a,0x0449027d,0x0637054d,0x09a20799,0x0e0d0bcf,
0x11350fd5,0x114611d5,0x0df40fdb,0x0be50c66,0x0c930c32,0x09af0bf4,0x009005aa,0xf680fb1b,
0xf1b5f37b,0xeda1f00b,0xe7c9ea99,0xe699e647,0xecaee8e7,0xf510f122,0xf94cf7cb,0xfb3cfa2b,
0x003dfd37,0x08b5045a,0x0e6f0c65,0x0ec10eea,0x0fcb0efd,0x10e5109e,0x0fcb1097,0x0c0a0e67,
0x04c108b9,0xfe47011f,0xfbb6fc85,0xfa8bfb58,0xf709f925,0xf3f7f51d,0xf4c1f3ec,0xf73ff5e1,
0xf972f87b,0xfa8dfa0d,0xfe60fbce,0x06ae0229,0x0d310aa9,0x0cc70dc5,0x08690ab7,0x046e0636,
0x01e00329,0xfee3007d,0xfb33fcf6,0xf7eef943,0xf75df740,0xf7a8f7d0,0xf4b5f6b5,0xf0dcf273,
0xf257f0bf,0xf7c1f4e2,0xfd53fa93,0x0473008b,0x0c92089a,0x11500f8e,0x1091116d,0x0e600f5e,
0x0d4e0db7,0x0d780d41,0x0d650db3,0x09950c18,0x029c0629,0xfd54ffa8,0xf91bfb65,0xf264f61e,
0xeb78ee99,0xe9f7e9d0,0xedc0eb87,0xf1deeffc,0xf5a3f3b4,0xfa59f7b6,0x0157fd99,0x079904fc,
0x09670902,0x09530962,0x0b0009cb,0x0f0e0cdb,0x10691084,0x0af30e70,0x031806de,0xfe5c003a,
0xfbc6fcfb,0xf8abfa4e,0xf596f6ec,0xf4e0f4d6,0xf746f5c7,0xfa83f910,0xfbdffb68,0xfd75fc73,
0x01a3ff39,0x06ce043f,0x0a8908ed,0x0c9d0bb2,0x0dd10d5e,0x0ce10dcb,0x084c0b08,0x016204ed,
0xfb03fe09,0xf647f879,0xf35af47f,0xf2f4f2f0,0xf34ff331,0xf387f373,0xf3edf3a4,0xf568f47a,
0xf798f678,0xfb68f906,0x0299fea0,0x0a10068b,0x0ff00d29,0x1436125a,0x14dc1531,0x1017131b,
0x09b80cc6,0x065007a1,0x044d0567,0x012302e2,0xfd0bff45,0xf7defa90,0xf397f574,0xf186f256,
0xeff2f0c1,0xef4cef58,0xf2bff06a,0xf9ecf614,0x0072fd6f,0x051602f0,0x081b06d0,0x09bc0912,
0x0a580a24,0x0a020a41,0x08750966,0x05bd0741,0x029e0434,0xff46010a,0xfc2ffda7,0xf959fac5,
0xf6a6f7f3,0xf508f5a9,0xf519f4c4,0xf7ebf613,0xfd24fa76,0x00f6ff3c,0x0389023f,0x06d90500,
0x0b1a08f4,0x0df70cdf,0x0e2c0e5f,0x0d470dc2,0x0c080cc5,0x09230ae6,0x031806a6,0xf98bfeae,
0xf0b7f4ba,0xed43ee2f,0xeeceedc3,0xf039efa2,0xf1b1f0d3,0xf42af2c5,0xf849f606,0xfc74fa96,
0xfea3fdc9,0x00c2ff7f,0x069302fa,0x0fb40b2e,0x14971310,0x13d514a2,0x121912ee,0x0f611111,
0x08980ca2,0xfe71039b,0xf74af9ff,0xf6d5f674,0xf864f7ad,0xf875f8c0,0xf607f764,0xf451f4e4,
0xf578f48c,0xf8a7f709,0xfb09fa00,0xfe88fc58,0x04ca0174,0x09e807ac,0x0c370b65,0x0b140c21,
0x0756094e,0x03d9056b,0x00900229,0xfd18fed4,0xfa05fb61,0xf8c8f919,0xf851f8b5,0xf602f75c,
0xf4a9f4e5,0xf7b1f5af,0xfca0fa2c,0xffc8fe79,0x0190009f,0x06de0390,0x0e750ada,0x112d10ae,
0x0eeb104c,0x0d190db8,0x0d270d0d,0x0c0d0d15,0x06ae09ea,0xfe7502be,0xf6a4fa31,0xf223f416,
0xee01f039,0xe971eb89,0xe927e873,0xef43eb93,0xf6ebf335,0xfcf6fa25,0xff7dfec7,0x0033ffa7,
0x047401d7,0x0ac307ad,0x0e850d4b,0x0ed10ec8,0x10e20f68,0x13451281,0x0fcb1263,0x07790bff,
0xfee902e3,0xf8e1fb86,0xf541f6dd,0xf393f425,0xf3a0f372,0xf573f438,0xf997f758,0xfcb4fb8a,
0xfd72fd3c,0xfe5cfdc2,0x005cff34,0x0466022d,0x089e06af,0x0a1f09af,0x095909ea,0x0754088c,
0x035b05ac,0xfcdb005d,0xf6bdf974,0xf3f4f4e8,0xf4bef3f1,0xf736f602,0xf7b9f7cc,0xf74ef753,
0xf9acf819,0xfe1efbd4,0x029e0047,0x076d0502,0x0bae09ae,0x0e1d0d33,0x0efb0e85,0x10a70fb6,
0x109110fd,0x0de70f6c,0x09710be0,0x025a063e,0xf9e0fe2a,0xf3acf65e,0xef95f1a1,0xeb89ed75,
0xe9baea51,0xeb9fea37,0xf06eedda,0xf58ef30b,0xfabcf80c,0xffedfd54,0x05d102a5,0x0b490904,
0x0c580c43,0x0d470c90,0x10070e9e,0x11d51169,0x0fa81164,0x0a8c0d5e,0x0412077e,0xfcf10060,
0xf8d5fa53,0xf78af80c,0xf56ff6af,0xf267f3e2,0xf1d2f176,0xf81ff42b,0xffe9fc8e,0x028801cb,
0x031702bc,0x058e0410,0x0839072a,0x07860858,0x04b80614,0x03c703f6,0x03ab03cd,0x021b0323,
0xfe260082,0xf7e8fb07,0xf32df51d,0xf227f221,0xf31bf2ab,0xf3e0f340,0xf86df582,0xff92fc11,
0x042f0261,0x06210536,0x09830780,0x0de50bad,0x110d0fac,0x112a11b2,0x0dea0fc8,0x0be10c61,
0x0c8a0c2f,0x09a30be9,0x008b05a0,0xf684fb1b,0xf1b9f37f,0xedaaf00f,0xe7dceaa7,0xe6abe65b,
0xecb7e8f5,0xf514f128,0xf951f7ce,0xfb41fa2e,0x003ffd3a,0x08b6045b,0x0e710c67,0x0ec30eec,
0x0fcb0eff,0x10e3109e,0x0fcb1096,0x0c080e65,0x04bf08b6,0xfe46011e,0xfbb6fc84,0xfa8afb57,
0xf708f925,0xf3f7f51d,0xf4c0f3eb,0xf73ef5e0,0xf971f87a,0xfa8dfa0c,0xfe60fbcd,0x071e0229,
0x00000513,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
};
const uint32_t sample_1_timpani_timpani[3968] = {
0x00000000,0xfff9fff5,0xfff9fff5,0x0004fff5,0x004fffd7,0x010dff91,0x0f21fd95,0x4fbb460b,
0x598a625b,0x40225439,0x1dc43113,0xcebe1dfc,0xa00faa38,0x8dee95d9,0xa37e9a5c,0xc251ae3d,
0xce93bae0,0x0511d76d,0x3eb12a28,0x4c583de2,0x57c249d3,0x71fb4441,0x23dd71fb,0xe630f1b5,
0xe648e7ed,0xeec9ef46,0xcda5dd06,0xb7a1c669,0x8ede8dee,0x8dee8dee,0x8dee8dee,0xc0548ff3,
0x0a45edec,0x71fb5de5,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x63ea65a4,0x1d0f436b,
0xee5d0f5a,0xe57305f9,0xb625c17f,0x8deeaa98,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xc0a68dee,0xfbd5dff8,0x3d3529ab,0x55755d07,0x67ae6ddf,0x71fb71fb,0x4f7e71fb,0x13161b8c,
0x1d472442,0xfa441de7,0xcf52e857,0xd173e353,0xe3c8e00a,0x0295e5f9,0x0f271317,0x2b7b286d,
0x22d1246c,0xa55de909,0xd89caf6a,0x38f2130d,0x53b04e5a,0x3fcc54bc,0x0adb2513,0xf0652688,
0xd155e5e1,0xfba9dd25,0xf8551268,0x9d19b5bf,0x9acea20f,0xad5bb3e4,0xed96daf5,0xf3e2f0de,
0x10511045,0x4bf33ede,0x2b5b3d9b,0x29bb3343,0xffc50b15,0x0027ebe8,0xfec7f3a9,0x10b60585,
0x2b5f16fb,0x11ff1190,0xdf53f16d,0xeca9de8c,0xd533d6a4,0xcb59bbe0,0x0a3cd75a,0x2ffe10b0,
0x51a051c1,0x4d464a90,0x71fb558f,0x4c346c85,0xe693195c,0xc947d26b,0xb29bcfe6,0xd9cfc45b,
0x05d9e1d2,0xf35a17dc,0xe47fe2b5,0x9e06a4c7,0xc216b13e,0x004bdab5,0x14061d0b,0x00cafd35,
0xff13ef19,0x288f131d,0x3ce019c6,0x2b4f3101,0x04c10d54,0xc8fbea58,0xa9669f86,0x8deeb3ed,
0xc2fba7ce,0xf0a8ce3f,0x0d69f6ef,0x41e33da6,0x48ae4ae9,0x5d2c3a27,0x65f8634d,0x4b764493,
0x5810406f,0x4a9b649b,0x4343455f,0x2c0c4275,0xe114030a,0xb1e6cd24,0xc151b261,0xa540ac33,
0x8dee8fcc,0x8dee8dee,0x8dee8dee,0x91fb8dee,0xe178bead,0x15e3f073,0x063211a2,0x20a40606,
0x4ae02a5e,0x662c5d72,0x4da64ee4,0x3b7d34a9,0x29b54196,0x42eb351b,0x491b4bf0,0x599d6206,
0x2c094a20,0xed231a6f,0xcd85ea5b,0xe852d9a6,0xf8adfc73,0x1b280bb1,0x22ad224f,0x1562130a,
0x0ecc125f,0xf0b70311,0xbec9f2c8,0x909eaec4,0x8dee8dee,0x8dee8dee,0xc16f9eb2,0xa6ffb95f,
0xdb97b77b,0xf408db2f,0xf6abfaf8,0x058501cb,0xfbd80c9c,0x0ea10add,0x36792da4,0x67ac4ba2,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4ca36dc4,0x3e9f3f5b,0x067e1bcb,0x085afcfa,0x01461670,
0xe891fff2,0xe74aecef,0xfc92f08b,0xf4d7f80c,0x987dc84c,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xb84c9a36,0xbb70c776,0xc9b5cbaa,0xc9ebd25d,0xfaa7d65b,0x31b420a0,0x36262852,0x3a6e340e,
0x37cd3a0b,0x5a4b49e5,0x71fb6b6a,0x71fb71fb,0x71fb71fb,0x6bf96d27,0x34275100,0x2c1831b4,
0xeb3d2305,0xe341e747,0xd083cb12,0xe01dc9e5,0xea3adc7d,0xcc09dcd0,0xc3c9cab1,0x93e4a51c,
0x8dee8dee,0x8dee8dee,0x9c468dee,0xaef2a646,0xc838b98a,0x1a70ef95,0x11b4ffec,0x28fe19ea,
0x0a971634,0xff680f97,0xff8602d1,0x18930661,0x3bc82224,0x650c6590,0x5b8162af,0x66bf59b8,
0x71fb71fb,0x715f71fb,0x5a586b92,0x282e37d9,0x09631b2b,0x0930fe19,0x05541030,0xf2a0f255,
0xce93eefc,0x943d9f37,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xabd58ecb,
0xf6e2ccf0,0x14d40bb6,0x308c1fd4,0x3cc83642,0x4d1441cb,0x58a454ef,0x54f55933,0x6aab5d25,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4dff6b8e,0x273825fc,0x1d5131ad,0xe9ae0de2,0xcb9ddd3e,
0xc6e9c6dd,0x9e7eab38,0xcb85af2d,0xc1a3bb94,0xad7db412,0x9b3daf10,0x93f193cf,0x900b938e,
0x8dee8f27,0xb6319605,0x17e8f839,0x23232783,0x1f56235e,0xfdc91211,0x0a31f343,0x103f09a2,
0x23d41d97,0x1fcd26b7,0x43003222,0x603e588b,0x6e406635,0x6c526a3b,0x6ee871fb,0x613c68f3,
0x44e551be,0x1c9d290b,0x0b85134a,0x11270d1c,0x09ad1dc6,0xf4bb03c8,0xa06ecc52,0x8dee92a4,
0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xa2ac8dee,0xcb33c27f,0xdbfcd848,0xe91edd0b,
0x19bb024c,0x5a023657,0x627b61be,0x4ac44f22,0x71fb4e69,0x71fb71fb,0x71fb71fb,0x71fb71fb,
0x4bac646a,0x3460374a,0x15141ac5,0xf4c108e7,0xe3b6fd3b,0xdc99dba0,0xae51b249,0xb0cab142,
0xdc46c25a,0xe4b0e258,0xca7ddfcb,0xc81dc1bf,0xc85ed0b7,0x9c7e9bdf,0xa5719cdd,0xbcf2a722,
0xe7a6e365,0xf0c3fc49,0xf5cbf135,0xf9f7fb00,0xef710010,0xff91f2d9,0x054ef957,0x34e02252,
0x53354cae,0x5ad14d72,0x71fb71fb,0x71fb71fb,0x6f3871fb,0x39a058a2,0x29e3309e,0x121f1c60,
0x113b1e47,0x1d881a32,0x0f9a1928,0xfcd4febe,0xc87ce08b,0x8f00a429,0x98c38dee,0x8dee8dee,
0x8e178dee,0x8dee8dee,0x90c88dee,0xc201b78f,0xc9f5c20d,0xf88ae686,0xfb42f39e,0x17da1b73,
0x17ed1155,0x2a750ca7,0x71fb45f3,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4e0871fb,0x28a93e22,
0x0e341dfe,0x18280ebe,0x18301cc3,0x039015b6,0xdb97e75b,0xcb0fd9c7,0xcb33c14c,0xccafcb4f,
0xb0b8cb7a,0xb53eb409,0xafecb29b,0x91d6a409,0xcf3db0ae,0xe1d2ec38,0xdcedd1ca,0xd951e49f,
0xef96e106,0xfa88fb3c,0xea75e9f4,0xfda2f975,0x1a3a0203,0x35f92d77,0x2be02f48,0x4b9a3949,
0x58a151eb,0x71fb6f95,0x650667d0,0x42355a2f,0x40443b7b,0x40d134c8,0x2d564336,0x408939cf,
0x2d9a3875,0xef4106b1,0xc38edeea,0x95d7ab99,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0x8dee8dee,0xc804aa74,0xc589c984,0xe8f4dd31,0x0e73f788,0x01540a20,0x2de20e8f,0x4c283918,
0x67d35439,0x71fb7038,0x71fb71fb,0x71fb71fb,0x6ae471fb,0x2d433cae,0x10ed19eb,0x1c3e1a8e,
0x0a5d1401,0xe8b5fbd8,0xe63be7ac,0x093f02ae,0xdc35facc,0xc536ca7a,0xaab8c1b6,0xa2519cb2,
0xa7a4ad63,0xbdf7ad7f,0xcae8c7cb,0xd885ce7c,0xc219cc6c,0xf091d575,0xf232f7bf,0x099ef61e,
0xe0c5f447,0xe92ae38e,0x0a69f805,0x30071977,0x367133b3,0x64ee4ad7,0x71fb71fb,0x641971fb,
0x414e4b25,0x35e03489,0x374134ff,0x44c13c88,0x3bcf4669,0x31503829,0x16fa31d5,0xe45a02da,
0xcbfdd5b2,0xaa30c075,0x94f799c7,0x8dee8dee,0x8dee8dee,0x943e8dee,0xb4fba87b,0xb038b474,
0xbe6bb283,0xd2e6c6c9,0xff87e844,0x0a1406d0,0x258314c9,0x46db2963,0x4af25722,0x71fb5275,
0x71fb71fb,0x71fb71fb,0x53aa71fb,0x35ce396c,0x2ab23295,0x1eb02bfb,0xf9a80b3f,0xee36ee36,
0xf4a5f487,0xede9fc15,0xdee4e4f9,0xb698ca86,0xbf37bc59,0xb69db8ae,0xcdedb760,0xd733d7d2,
0xb98ac90f,0xd349c196,0xd264ceff,0xdb7cdd82,0xf2b5e40f,0xf686ee56,0xf633f816,0xf169ecdf,
0x0c40fbaa,0x0e940d16,0x30a21e62,0x3fd93ce0,0x6314519c,0x546361a1,0x513a4a63,0x64d15f52,
0x32355255,0x2206225d,0x16212090,0x2bc2229d,0x1b4b291c,0x059e10df,0xeed5059e,0xc3b7d989,
0x8dee9c7e,0x8dee8dee,0x95898dee,0xb1a1a4f8,0xaacba7a6,0xadc5aa68,0xc15ab142,0xd545cf62,
0xe7a0d904,0x0874f0dc,0x1e87151d,0x41592fff,0x4a2543f2,0x5f2954da,0x61266823,0x5f7b5e92,
0x71fb678b,0x592f6f74,0x25c142ce,0x03761141,0xffcbfc45,0x111b0957,0x190820b9,0xe699f7bf,
0xd2d1e2a0,0xc669c88e,0xaf97c3b8,0xc0edb1d2,0xc6febcf2,0xf229e9e2,0xe975e9b3,0xd2b9e13f,
0xb88fc0cb,0xd635c866,0xf8d9eac0,0xddd0ea3d,0xeceae827,0xf7aaef85,0x12570078,0x1c212356,
0x1b471658,0x26162538,0x2d6f2987,0x425f3122,0x525c4c83,0x60055e8f,0x40c559c2,0x34792cc5,
0x461a453d,0x1b8c3816,0xfe9d0a92,0xf5d6f1e0,0x02a30ace,0xe190ef72,0xb9cfcdd0,0x8dee93b8,
0x919992d7,0x9d4192ea,0xba17b0a6,0xb167b97a,0xb606af81,0xbe84be14,0xd530c5cc,0x02e0e7bc,
0x2aba15dd,0x2b263246,0x3f272f39,0x48373db3,0x580b52ee,0x63e45b8a,0x6ac16f06,0x3a8e552a,
0x1e9e264c,0x24e81ed6,0x1f9220d6,0x0afb1682,0x017d0468,0xe8c2fa63,0xe7dce3d8,0xecf8f513,
0xc975d71e,0xafd3b7e2,0xcf6fc276,0xde94d472,0xec44ea02,0xd37edb4a,0xe072dcc9,0xdce2dff7,
0xdd19e21f,0xbb50cbfe,0xcbcbc024,0xf84bdc24,0x116702c5,0x2d6127d3,0x2b5b30dc,0x240f2677,
0x18fb20a0,0x24ca1a9f,0x4f653cc0,0x41cb4bad,0x5d4a4c6d,0x50a861e9,0x37543d77,0x110e2ac1,
0x152d047c,0x20fb27b3,0xfbff0e5e,0xe0dbf390,0xa6d4bbcd,0xa911a405,0xb858b109,0xbe30bf04,
0xb988c035,0x9cb2ab27,0x96c5958b,0xbdeba69d,0xdd77cec4,0xf702e607,0x0ab20256,0x2c4d1632,
0x46433df5,0x53ed4692,0x4c4b5690,0x3df53c75,0x4b944548,0x54e756fe,0x3e0c4681,0x280c33b3,
0x23452400,0x083714ef,0x07930af7,0x04a30565,0xeb51fad6,0xd97cde70,0xd246d2d9,0xd354cce9,
0xdceadc22,0xcb65d743,0xc3e9c397,0xccc6c4d2,0xef84deea,0xe7f4f2e3,0xd610d7e5,0xd728ded1,
0xcefacdc1,0xe820dc15,0xf46cecaf,0x1aac04af,0x1b2820e8,0x24931f19,0x363b2eea,0x275f2c8d,
0x34352bc7,0x41203baa,0x442b463d,0x4e97491e,0x3d744977,0x3a183580,0x1f4a328a,0x108c14ed,
0xf0a7055a,0xeb5bea1b,0xd2dce595,0xa58cb79e,0xa207a039,0xaca4a6af,0xacc1abbf,0xbe40b236,
0xcbe1cc7f,0xc531c4b7,0xc8f9c807,0xd3cace23,0xf3a5e044,0x16a0061c,0x4cb3326d,0x45384e67,
0x54d04b49,0x47314f13,0x40cb4176,0x40154410,0x27e930de,0x38382ae8,0x3f344294,0x2883356d,
0x0c221c8f,0xed29f960,0xe20ce954,0xe488dcea,0xe888e7b5,0xd164e0ce,0xb9b4c228,0xce4ebf72,
0xe571d76d,0xed4df1f5,0xce6cdc2b,0xdc03d3df,0xe906e5bc,0xe5cfead2,0xcc97d669,0xdc7dce63,
0xfcbaedd7,0x080002c6,0x1f1c1582,0x0fd7192b,0x23f712b7,0x377f33d4,0x31013322,0x4af73cac,
0x3d104a01,0x47913bf6,0x47754bff,0x30984204,0x119e1993,0x07590cb8,0x08700777,0xf7bf0492,
0xd4a3e4d2,0xc7cecd00,0xb541bd13,0xb7fcb39b,0xa91fb346,0xadcca73a,0xc3b6b815,0xd998cc11,
0xdc40de8e,0xd8cedbfd,0xe06bd98a,0xfba5ef80,0x15db0768,0x3c052973,0x4ab0456e,0x62ef57c4,
0x4f375cae,0x3cb3453c,0x3f9d3722,0x32fc3fcb,0x1ab525ac,0x05330df9,0x0f4208cf,0x0f7514fd,
0xf5a80474,0xe879eb08,0xd86ce2d4,0xd442d332,0xd8eed47e,0xe3f4dfb8,0xe184e7ab,0xcdeed7e1,
0xce4ecbcf,0xe3c6d579,0xea00eb3d,0xdc34e195,0xdc8cdae0,0xee27e733,0xe5daebb2,0xebc0e330,
0x0787f802,0x298318b1,0x365331e8,0x39443988,0x262f314a,0x18641b15,0x33a62212,0x547148c5,
0x51c35433,0x34724abf,0x0c961b41,0x01f50611,0x07d30660,0x0068017b,0xf06efe32,0xdf89e428,
0xd4b4dd64,0xc04fc699,0xa856b55d,0x9fa7a0fd,0xb6dca861,0xcd8bc393,0xd0ccd3d0,0xd3c7cf43,
0xf571e246,0x09e70107,0x1b0614af,0x28421d76,0x394c34d1,0x326d32e0,0x43a13bb1,0x48ec46bd,
0x5234502a,0x31c7447a,0x1810243a,0x12a2120d,0x0f4e13d2,0x0ace0bbd,0x0370077a,0xf3b5fe97,
0xe75dede0,0xd6faddb1,0xe298dbe2,0xe49fe5a4,0xd830dfa0,0xd3ccd3f4,0xd28ed239,0xd29bd5b2,
0xd25dcf35,0xe48ddaf3,0x0096f46d,0xef40fdf9,0xe667e5b7,0xe8b0e6fb,0x0806f478,0x20491a21,
0x17e91d4e,0x1c4613c9,0x25942709,0x2b9725fa,0x34942fd2,0x338334ed,0x3bdd384a,0x3ccb39a3,
0x39313d65,0x2917344b,0x0b5219b3,0xee91fbb0,0xe780e8e3,0xd837dfac,0xda21d7ad,0xc3ddd376,
0xbb54b9dc,0xbea6bf22,0xc0f4bdcf,0xb41abd3c,0xbc8ab395,0xe1a9cd24,0xf2c7ed68,0x07b1fa6c,
0x16971272,0x1f9c1a66,0x1e961ebd,0x2341232c,0x34ad26e4,0x495141a9,0x432b49bd,0x2e3f3a18,
0x30e129af,0x2e2b34ba,0x20a52414,0x190f1e6b,0xfeff0ca5,0xeccaf9a3,0xce78da18,0xdb19cee3,
0xe260e2a1,0xeb8ce45b,0xe9abed09,0xdee9e38c,0xd54bdab3,0xce85d249,0xd3a6d031,0xe43adb17,
0xf74aeb81,0xf788fcba,0xe8c5ee92,0xf2b5ebac,0x01fcf8cb,0xfc2702a7,0x0951004a,0x1b6111b6,
0x2a8f25fb,0x26ef2b1f,0x2d20265b,0x3c2c3492,0x508046ff,0x425a501a,0x1fd02e4b,0x15a41956,
0x109812c0,0x036c0b94,0xf826fed7,0xdd74eb6e,0xc1eece9d,0xca5fc19c,0xdaced49d,0xdcb9de22,
0xc275d187,0xbb29b94b,0xc21fbec4,0xcf2ac65e,0xd61bd546,0xe747daee,0x0b00f851,0x1ec81883,
0x23a61f96,0x2b0d291a,0x364e2e2b,0x3ce03a4e,0x47744428,0x38244383,0x25fc2b12,0x1efa22ca,
0x282d227f,0x1ba02434,0x10211925,0xf71200e0,0xe01aee72,0xcdced15e,0xcfa7cf10,0xd901d200,
0xed86e2b1,0xfc5ef82b,0xf690fa8d,0xe370ed5f,0xd8e3dceb,0xcd47d44d,0xcf36c8bc,0xde51d9e0,
0xeac4e28f,0xfda9f1d0,0x0f330af0,0x091907e4,0x12911214,0x17291077,0x18281c7d,0x1c34172d,
0x33b62440,0x44b443b1,0x2318339c,0x23be206c,0x2f1d28e6,0x2ea030fa,0x24682c5b,0x01561436,
0xef77f566,0xec5cecf6,0xe8a7eca9,0xdcb0e10b,0xd9bbdbc1,0xc92dd25d,0xb80fbe7e,0xc384bbad,
0xccb5c9e2,0xc265c741,0xd26ec67c,0xee88e318,0xf9c1f2e9,0x161406dc,0x29eb2356,0x26ae2902,
0x2bdf26ae,0x367e3427,0x41c13b57,0x3dde4172,0x27203534,0x175d1a9c,0x1ed91ca0,0x1c901cd4,
0x0e161a10,0xf9e901ba,0xf708f54d,0xfca4fc1e,0xeab4f52e,0xd1c9dff6,0xc33cc406,0xde12ce31,
0xf53cebd2,0xf0a8f425,0xe02feb63,0xd6d9d66b,0xdd7ddc99,0xdfc5dc5f,0xe8ede71d,0xf136e75a,
0x0870000e,0x13840d02,0x1b491af8,0x0f6b15da,0x0d160cd6,0x17bf1244,0x169b1634,0x1a141814,
0x27fd2132,0x34ed2cb2,0x47144120,0x2f453e8a,0x1acb2305,0x0e2a1356,0x0b1f0beb,0x023b0a0e,
0xdb17f0f9,0xc9d6cc05,0xca00ca68,0xd1b3cd38,0xd32dd381,0xcfa2d390,0xc3bfc7d9,0xcbcdc7b8,
0xd261cd61,0xe365dafb,0xef5fe9a7,0x0eedfd0a,0x280c1ef7,0x1ea52580,0x18951a5b,0x27891c48,
0x36c432b9,0x30d53522,0x319c2f88,0x346933c0,0x27672f8f,0x1caf2368,0x09b80fe9,0x0e850ceb,
0x05a30a9a,0xf48efeda,0xd811e68e,0xcf1dcfdf,0xd6c9d292,0xdf40da38,0xe550e2ff,0xe543e629,
0xe26fe2af,0xedeae83f,0xf33ceef7,0xfa90fa11,0xe9c6f30b,0xe7c4e5ed,0xee36ea0c,0xfb28f63e,
0xff81fbc9,0x0a2d045b,0x18ea115a,0x24e520c2,0x1d4721e6,0x1adb1b6a,0x2a621fd9,0x36843451,
0x2a4a309c,0x2b3d2991,0x219d279c,0x16dc1c8b,0x0a301003,0xfcee054e,0xeca0f382,0xe181e590,
0xdd74e16f,0xc7f0d487,0xc49ec12a,0xd4cbccc2,0xdb17d96f,0xe06ade1b,0xd52cdced,0xc9d2cc0e,
0xdac7cffa,0xfc8beacf,0x14130a6d,0x18b21861,0x145c1579,0x2a0d1d9a,0x368d3163,0x3ad63a70,
0x38dd39b5,0x35e937ed,0x2e363237,0x20bd29f2,0x0cdf15e6,0x01a80653,0xf826fe0a,0xe5c3ed8d,
0xe7abe4da,0xe34ce713,0xded2e029,0xe817e1c7,0xef77ec13,0xed20f1c8,0xe008e571,0xe3dadfac,
0xe51ee609,0xe3f9e3a4,0xf03ae936,0xed69efd5,0xf903f1dd,0xfeb6fe32,0x015dfdb5,0x075305fb,
0x0ead09ea,0x12a91225,0x14061207,0x203d197d,0x33d22969,0x30ee3758,0x29302a13,0x21f92a31,
0x0fd115dd,0x08a40c9c,0x0dd807f1,0x107f1372,0x0dd80cd3,0xf8cd07db,0xe720ec13,0xd671e2e1,
0xc3dec87e,0xcde2c83f,0xccdbcebc,0xcd7dcbfe,0xc8b5cd24,0xcdc1c788,0xeab9da0d,0x035ffa2d,
0x0162046c,0x01c2ffd9,0x1c9a0b7d,0x359c2cbd,0x38cf381c,0x365e38cf,0x2ed7328a,0x2415291a,
0x21ad22e6,0x1e7e203d,0x1bae1d2f,0x10761825,0x026a07be,0xf9b5fd5b,0xef12f56d,0xe5f3ea3a,
0xdc6ee051,0xe660de9b,0xf1e9eee5,0xe5c3edcf,0xd3eadb45,0xdc9ed419,0xef1ce862,0xeccbef5f,
0xecbbeb29,0xf174ef0f,0xf709f353,0x08dfffc4,0x0d1c0d5f,0x09570ad5,0x07dc0927,0x04aa0472,
0x02e00502,0x0ce50472,0x173a14f9,0x21a319e0,0x39f92d17,0x429f443b,0x228e34fb,0x0a5e1247,
0x092d0926,0x0d1c0a24,0x01db0a9d,0xf908faf8,0xf951f9f8,0xf37ef6ee,0xd69fe9f0,0xbf60c61b,
0xb95cbc30,0xbad2b8f7,0xcdc2c10d,0xe3d4db37,0xec1be79a,0xfc9ef483,0x02c80107,0x0aa6057c,
0x184d12a5,0x10b315a1,0x14a20f6c,0x28f71e8d,0x32cb307a,0x347d32a8,0x36bc3774,0x284530a8,
0x1ebb21cb,0x115c1984,0x0a270c81,0xffe804e9,0xf26bfb7c,0xdd25e61f,0xd951d94a,0xdf5adb7a,
0xe43be28c,0xe1d0e3c6,0xe946e341,0xf071ee33,0xeefdf04e,0xed16ee3b,0xeb5deac0,0xf94cf08a,
0xfdb8ff50,0xf971f89b,0x03530013,0xfb43ffcf,0x01a2fc31,0x054004e6,0x0b970674,0x0c3f0f9a,
0x09880842,0x1c031091,0x3384294f,0x35a2385b,0x2f1d3130,0x25c02b66,0x1e8d2258,0x06f41555,
0xec47f767,0xeafae971,0xf518ef46,0xf38cf75a,0xe9cbede6,0xe239e584,0xdeeae1d2,0xcb4fd6fd,
0xbd3cc068,0xcc5fc254,0xda10d4f3,0xe65bdf57,0xf758ef95,0x05acfd42,0x150e0f75,0x148815a1,
0x19fa1551,0x2c84222a,0x321c337b,0x2dbd2e4a,0x33802ff5,0x30da34f6,0x220628c2,0x1ac91e4c,
0x0a1e1406,0xf3c7fea5,0xea50ed51,0xe5fce807,0xe393e2ff,0xe990e7bc,0xe126e65b,0xe405df2f,
0xf3d9ec9a,0xf58ff6eb,0xe84ef022,0xe45ae2c4,0xf353ebc6,0xfb0ef8f1,0xf4bdf8bb,0xedc2efd2,
0xfab5f238,0x07f40309,0xfdfb04b1,0x0328fd4f,0x0ca208f0,0x10c50ec5,0x13f51365,0x175f1447,
0x1a5e1a7d,0x21b81c2a,0x295d270a,0x26332939,0x17ed2037,0x04920d54,0x06b70317,0x0fdb0c6f,
0x023b0be2,0xef2ff7ac,0xe842ea8c,0xe39ee529,0xdef3e32b,0xcc6cd6bb,0xc0b1c2ef,0xce68c63e,
0xd69dd560,0xcf10d1fd,0xe491d530,0x02eaf42b,0x1ba1125a,0x1fae1f1b,0x1f0d1f74,0x231b1f99,
0x2d282883,0x2dfc2ed0,0x30ab2e3c,0x281c306a,0x13c11c8f,0x0f0a0eb0,0x161213a5,0x0b6712da,
0xfafb0207,0xf519f752,0xe722efce,0xd9c1df23,0xdba3d8c7,0xeca6e2aa,0xf5d8f3d0,0xedddf3ce,
0xe53de6dc,0xe7cae7af,0xe967e625,0xf5dbf0da,0xfb80f847,0x0196feb5,0x04e10397,0x03c50524,
0xfb23ffc5,0x0181fb09,0x0e0a0a82,0x0095088c,0x01c2fe8e,0x083105bd,0x126c0ba5,0x25411c16,
0x28d229a1,0x25b82764,0x1c9b2133,0x1b471b0f,0x19ba1b35,0x11f816e0,0xff540a0e,0xeeebf568,
0xefc9edd4,0xe71fee9c,0xd170dc92,0xc39ec8fd,0xc999c34c,0xda8ad2ce,0xda60dd6b,0xda24d75f,
0xeb64e0e6,0x00fbf753,0x024c04db,0x0449003d,0x10f90aa7,0x1ff7186c,0x2dc326df,0x37fe3417,
0x340e3846,0x25322da3,0x18a81d22,0x17fc1724,0x1320181f,0x05480b5c,0xff8e0216,0xfde6fd55,
0xf814fe57,0xe232ecd1,0xdbc8dc62,0xdc56dcde,0xd8d0da0a,0xe2ccdbf3,0xef18e936,0xfd49f5fc,
0xff100076,0xfd52fbc6,0x01660218,0xf7ccfae5,0xfaecf988,0xfc31faee,0xfddefddd,0xfeb5fd29,
0xfcdbff97,0xf6fdf944,0xfb08f739,0x1027044e,0x1a1317ed,0x1a0919c0,0x267e1e7e,0x301d2e1d,
0x232a2bdf,0x14791afd,0x111010ec,0x0ab50fc8,0x018904c6,0x001f00fe,0xf727fc1e,0xef0bf3b5,
0xdbb1e605,0xd65ed63e,0xd5dbd704,0xd1f7d3e4,0xcd72d03d,0xd0e4cc73,0xe63cd9bb,0xfe42f4ad,
0x027f015f,0x01cb0291,0x03760195,0x0fea08dc,0x2121175d,0x35c72c5c,0x3bb23acc,0x38f33ac5,
0x30933505,0x23b92b79,0x0ac3188d,0xf25afd0c,0xef34ecf1,0xfe07f794,0xf6bdfc92,0xe99bf0a8,
0xe393e346,0xeb3fe818,0xed63ec42,0xea0ced84,0xe374e5a2,0xe6ffe3b4,0xf94dee77,0x08e0030a,
0x068909b0,0xff5602d5,0xf7eafb40,0xf662f6a7,0xf26bf4ec,0xf4dcf20d,0xff90f9e6,0x06e5041d,
0x0b7b09d2,0x0c020b93,0x08000bd4,0x08d00478,0x1fa21495,0x266c25d2,0x19a12118,0x158b157d,
0x1ba617a4,0x1dde1f28,0x0c28165b,0xfc73028f,0xfe23fc27,0xf8a7fd03,0xef61f3c9,0xdd39e7e6,
0xcb6bd30d,0xc957c82a,0xd0b3cd30,0xd22dd1de,0xd788d381,0xe748de68,0xfe35f27c,0x0718055f,
0x0e730919,0x17d01455,0x21901be0,0x2a91262f,0x2c402d04,0x299529ec,0x2ce82b1f,0x2c312daa,
0x1b7026c3,0xfcb60ba8,0xef8af2e7,0xf587f1ea,0xf468f712,0xe87fed88,0xeec9ea30,0xf47af1bc,
0xf712f79c,0xe818f073,0xe246e2f7,0xe8dee4f9,0xee6beb8a,0xf8d1f379,0xfd18fc7c,0xfb6cfb49,
0x071e003a,0x10580cd9,0x098b101a,0xf13cfd69,0xf1a8ed29,0xf6c9f630,0xfb0ef801,0xff51fcf7,
0x07d40395,0x0f150b8d,0x1869131c,0x19441b9a,0x1af11708,0x2266205c,0x27ba249f,0x1b702510,
0x0ec812d6,0x08e20b7d,0x08fa08f6,0xfefb05af,0xe813f480,0xd4e2dcca,0xd36ed1c3,0xd920d7bb,
0xcefbd4c5,0xca49cb19,0xd8b2cf3f,0xe8abe120,0xf995f160,0x0521ffc3,0x0ea00a7c,0x0c3a0e75,
0x14500d53,0x25f51e47,0x2b31295d,0x28172b40,0x251c24ca,0x299f2859,0x1e892676,0x08b01300,
0x070a0589,0x0107060a,0xf881fbeb,0xeb88f343,0xdf40e3cf,0xe146ded7,0xe64ee3e8,0xef3aea63,
0xf260f1a6,0xf3b9f2c5,0xf561f4ec,0xf88ff658,0xffecfc2f,0x010401c6,0x03cd0113,0x05bb0678,
0xfc79014d,0xf95df9e5,0xf790f8a5,0xf808f76d,0xf737f823,0xfaa1f764,0xfb23fc80,0xff10fb4d,
0x0eb40572,0x23f71a3b,0x29c42965,0x236326fc,0x1f9920e0,0x1b1e1e6c,0x0df1145c,0x0eab0c9c,
0x0a890e96,0xfbe903f7,0xeb29f319,0xe6cce6d6,0xe76ae801,0xdabee334,0xc84ed028,0xcbdbc6e3,
0xdd74d454,0xe6eae418,0xe586e5ed,0xf359e9e7,0x060afdd6,0x0f910b65,0x16671389,0x1b8c18bb,
0x21a71ec6,0x2add24e3,0x37783244,0x316437a5,0x1bf126c3,0x0c0d1301,0x01c006f4,0xfac1fd35,
0xf3eef830,0xf046f0fa,0xebd6eefd,0xe85be955,0xe486e6e5,0xe6e3e455,0xee61ea2e,0xf674f314,
0xfeb0f98a,0x07ac0454,0x04c406f4,0xfea90288,0xf580f951,0xfba7f698,0x0001004b,0xf6f7fb28,
0xf50df5ed,0xf441f356,0x0084f9c1,0x05e60513,0x0004031b,0xfbe9fe5c,0xffd9fb2f,0x106d0882,
0x1adc1664,0x1e9e1d40,0x24262132,0x252b25c9,0x212f23bf,0x11d01b25,0x05bb0995,0x022d04bb,
0xf566fbd4,0xf3aef32c,0xeacff09e,0xddb8e4aa,0xd142d60c,0xd107d0e3,0xcc4ecea5,0xce7ccc11,
0xdee7d478,0xfa53ec91,0x08c903e6,0x0cdc0b00,0x12f20f15,0x1c69183e,0x20f61e4e,0x2a4d25c9,
0x2e862d1f,0x27df2cc4,0x1d6322bd,0x124e179a,0x07300cf7,0x007e02c0,0xf5c9fcf7,0xeb54ee95,
0xecb9eb4c,0xf2e3f01e,0xeed7f1c2,0xebf5ed08,0xec41eb00,0xf2fff054,0xf11cf25e,0xf798f277,
0x041bfebb,0x07be06d3,0x0724079c,0x0553069d,0xfe8702e0,0xef22f739,0xecacea64,0xfdb0f561,
0xfc5eff3d,0xfb53fabc,0xfa22fafe,0xfd1efa76,0x0681018f,0x0b1e09d1,0x0c440bba,0x103f0d4f,
0x1c7c159b,0x291d2393,0x2bb62c6e,0x22fd2731,0x1be7202e,0x0bc41542,0xf3a20038,0xe2f0e88f,
0xe649e3fa,0xe108e517,0xd72edbfa,0xd5bbd439,0xda85d9c8,0xd1cbd5e6,0xd948d350,0xebcbe19e,
0xfbcff577,0x06550044,0x183f0ee4,0x20441e9b,0x1c4c1ec0,0x1be51a40,0x27972221,0x254a27ba,
0x221e23cc,0x18a51deb,0x11301450,0x086d0de6,0xf8130076,0xf083f2b9,0xf244f0bf,0xf0ccf30b,
0xe884ec76,0xe51be5ba,0xea19e726,0xf136ed0b,0xfbb4f6eb,0xfea0fda7,0x035500ef,0x03340386,
0x05fb0435,0x04b5062c,0x01fd02ae,0x01c6024c,0xf7d1fe1a,0xedc6f1c7,0xe850eaa8,0xed8fe895,
0xfe2ff670,0xff7400cd,0xfed7fe1d,0x078601c4,0x16860f30,0x1b771ab9,0x184a19b6,0x1ab118fa,
0x1ec71c8b,0x226420e2,0x208d22b8,0x12ae1b29,0x017d08d7,0xfc30fe5c,0xeed0f737,0xda7fe509,
0xca49d070,0xd3b3cbe0,0xe184dc74,0xdef0e1ba,0xdabfdbf3,0xe2aedcab,0xf232eac2,0xfeb5f8b9,
0x093f0497,0x0def0bab,0x1c4513c5,0x286a233d,0x2d152c17,0x26fd2b2f,0x1d1821c1,0x1c211b73,
0x16141b16,0x06ef0ece,0xf7acfee0,0xf1d4f37b,0xf13af15a,0xf05af131,0xeb7bee16,0xea08e9fc,
0xee9febd2,0xf343f17d,0xf42cf3b0,0xfba1f6f9,0x04a10034,0x0ce208ff,0x0b5a0e08,0x03860737,
0xfd280050,0xf694f9f1,0xf43cf4bb,0xf0c3f2da,0xf437f0d9,0xf86ff7f5,0xf5eef6ee,0xf460f551,
0xf574f367,0x05affc21,0x16580f3f,0x175f18e1,0x159e1598,0x1a211732,0x247b1f0f,0x22d1265b,
0x16de1cd8,0x0fcb128a,0x0cf10e76,0x09b70b3d,0x00f40713,0xe488f4b7,0xd177d758,0xd834d2d2,
0xd95fdbaa,0xcc41d2bb,0xcd23c989,0xe3a3d6e3,0xf8b8ef61,0x01baff04,0x03860272,0x0bdc069c,
0x185d11fb,0x23681ee8,0x237f245a,0x22ff22f8,0x22c022dd,0x22a222e1,0x1d6a2147,0x06c714cb,
0xf1a1f901,0xf168f0b0,0xf43af20f,0xf808f758,0xf1fef56e,0xec41eefa,0xec96ead8,0xf57df0cb,
0xf8c2f889,0xf76df788,0xfdd5f9bb,0x0597024d,0x067706b5,0x07cc067a,0x09850936,0x00ac06ec,
0xf47af96c,0xef6bf1b6,0xeb5becd1,0xef2eec4a,0xf5f6f282,0xfc4ef9d6,0xfa0afbe5,0xfb6df9ac,
0x0189fe7b,0x09130490,0x1a5510c7,0x25ec222a,0x24a8264f,0x21082288,0x1cb61f72,0x172019ae,
0x100613f8,0x08520bdc,0xff8704b5,0xee8cf808,0xdc86e483,0xd9f2d8dc,0xdd07dcab,0xd1cbd8f8,
0xc9aacadf,0xdb89d05b,0xed68e641,0xf420f0ff,0x0376fa4b,0x15e70dd1,0x1a3319d4,0x1bf51a84,
0x1c821ce4,0x19d31b3c,0x1b1a1977,0x20241e1c,0x1e322029,0x14b01aa2,0x04d30cc4,0xfa3bfef3,
0xf1c2f5b0,0xec69eeea,0xe8f0ea2b,0xedb9ea1a,0xf3b0f136,0xf9a0f621,0xfca5fca1,0xf6d7f9da,
0xf806f5a5,0x0355fdcf,0x07f90674,0x0ac8099e,0x0a1a0b13,0x034f073a,0xf9ecff4b,0xf016f393,
0xf16df098,0xec0aef18,0xede6ebd3,0xf098efa2,0xf4acf204,0xfc4ef871,0x04cb000e,0x0f0c0a4e,
0x14071234,0x17df1592,0x1cdd1a82,0x252b1fa2,0x2e692c04,0x1e3628f9,0x0a391256,0x077e0755,
0x033406f5,0xf41ffc1d,0xe75ced6d,0xddc0e1af,0xddbddd08,0xdae0dd67,0xd2add676,0xd616d23a,
0xe46fdd21,0xeec0e9d8,0xf9a0f42f,0x03b8fe94,0x0f55093f,0x1d5515dd,0x2cb225f5,0x268d2d09,
0x17da1de7,0x16db15cf,0x1a411944,0x12811826,0x025e0a9e,0xfb3cfc83,0x01ebfe8d,0xfc64018f,
0xeb26f463,0xe048e388,0xe995e299,0xf93bf29a,0xf9c8fb16,0xfd6cf9d1,0x05650258,0x05dc05c8,
0x05c1064a,0x02a203b5,0x050f03d1,0x019903c5,0xfee70044,0xf93bfc7d,0xefeef489,0xedecede6,
0xeb30ece0,0xecb9eacf,0xf3caf012,0xf7eff646,0xff63fab3,0x08360417,0x0f270bc3,0x17141272,
0x23391d30,0x27fd270f,0x1f86256f,0x142018d1,0x14cc12d3,0x19d918b5,0x0cb215d4,0xf50800ea,
0xe891ec66,0xe90be863,0xe221e7c7,0xd0b7d926,0xcf5acd58,0xdb5cd4d9,0xe5c4e13a,0xea43e86c,
0xf121ecb5,0x0066f82f,0x0df007e2,0x17ed1332,0x1e6b1bcb,0x1efa1f43,0x1e791e79,0x21131f4a,
0x239a233f,0x13801ed3,0xfb3005a3,0xf88df72b,0xff74fc31,0xfa92ff38,0xeefdf3d3,0xf09eee23,
0xf66af3f0,0xf5abf718,0xf18af344,0xf18cf0c2,0xfcb6f58b,0x093d0400,0x0e760c62,0x0e620f3f,
0x08940bfd,0xff130405,0xf69efa4c,0xf449f4c1,0xf443f47a,0xf1dbf337,0xeffaf0cf,0xedbfeea1,
0xf32eef5e,0xf72cf667,0xf7a1f6cc,0xfe1dfa15,0x081502df,0x11640cfd,0x1c391619,0x29b023ed,
0x27852a67,0x22112468,0x1d3b1fd9,0x12e519b3,0x00d00972,0xf823faee,0xf928f811,0xf3bdf863,
0xe346ec34,0xd360da50,0xd2add099,0xdceed7c0,0xe12de011,0xe2a0e166,0xee3ce687,0x0026f7f3,
0x086c0558,0x0d840ad1,0x17431190,0x1f991cbf,0x1eb01fa5,0x1e9f1e29,0x1f4d1f78,0x18031d03,
0x0a361117,0x02700576,0xfbcefffe,0xefbcf5e4,0xec9bec1b,0xf650f0f1,0xf733f8d3,0xf1a9f392,
0xfa02f456,0x00ddfee7,0xfbfcff75,0xfa63f95f,0x02aafe60,0x099b066b,0x0bd70b7d,0x0a550b6d,
0x049207cc,0xfcc300df,0xf2c9f7b0,0xe618eca3,0xe296e1bb,0xeea4e7e6,0xf7adf463,0xf71bf840,
0xf7dff67f,0xff69fb51,0x05730324,0x095406ef,0x15870e6a,0x20491c33,0x236d2224,0x251c24b8,
0x238b24b8,0x1b3520c9,0x0b60139e,0xfe8e03e6,0xfa49fc15,0xedb8f5b0,0xdf4ee4fa,0xe18dde71,
0xe434e478,0xdb87e084,0xd6f4d7ba,0xddd6d960,0xe95ee321,0xf7ddf0a9,0x04fefe6c,0x10600b23,
0x16bf145c,0x185717d2,0x17691830,0x1b6a1823,0x21d71fe0,0x1ac01ffb,0x0d8313f0,0x05e50913,
0xffc502fc,0xf5edfb37,0xef8cf119,0xf2ecf0e8,0xf145f302,0xf1edf012,0xfb42f658,0x0087ff05,
0xfce8ffb5,0xfc97fb18,0x065c00cb,0x0e210b73,0x08700ca8,0xff990340,0xff81fe31,0x01fe015b,
0xfc2e001a,0xf1c6f700,0xe77cec56,0xe722e586,0xed0dea7d,0xf0c2eecc,0xf80df3d3,0x0019fc9b,
0x04c8025a,0x0c620867,0x11040f27,0x148b12b1,0x197d16b9,0x24651e68,0x27c0282a,0x1fe2246e,
0x14641a95,0x085a0dde,0xfebc03b5,0xf285f8d0,0xe4a9ebb2,0xda29de1f,0xda23d929,0xddfedbee,
0xe391e0ab,0xe7d3e611,0xe9bde91b,0xed8feab0,0xf938f2c8,0x0680ffdd,0x11330c9c,0x14fd13a4,
0x1a16170d,0x1df21ca3,0x1e8d1e9e,0x18831caf,0x0e2812e5,0x0bf00be8,0x08430bb6,0xf92f0178,
0xee6ef220,0xf176eeb0,0xf27cf31a,0xf14af0e0,0xf9f7f4d0,0xfe53fd98,0xfda9fd83,0x0195ff42,
0x050f03a1,0x05c605af,0x074a0611,0x08e40899,0x06370849,0xffa90305,0xf823fc4c,0xf0dcf3a5,
0xefa2f02b,0xe9f3ed48,0xeb83e8bc,0xf393f025,0xf399f4a5,0xf169f1d4,0xfac5f45a,0x0c22030e,
0x18691412,0x181618d3,0x1ab818cc,0x1f2c1cf9,0x217920f9,0x1b9a1fb7,0x11481655,0x0d210df7,
0x0ada0d16,0xfdf90576,0xed1df594,0xe096e5d1,0xdd0fdded,0xdededdbf,0xde1edf0e,0xdcf9dce2,
0xe32aded2,0xf2e8e9ee,0x0385fc46,0x05a5069c,0x03d103d5,0x0a6f062c,0x15620fa3,0x1dd91a8a,
0x1a841d97,0x17021788,0x188d1810,0x14181777,0x06e80e44,0xf8a6ff4a,0xf342f480,0xf4c6f3fb,
0xf2acf47a,0xee69eff4,0xf5eaf071,0x012ffc97,0xffa301df,0xfdb0fd44,0x043500e8,0x05e70594,
0x0a49073a,0x0df40d58,0x05560ad7,0xfd5e0050,0xfb49fbf9,0xf7aafa3a,0xececf2d0,0xe4e7e7ef,
0xe832e4cf,0xf424ee51,0xf774f737,0xf600f64f,0xfe67f8ad,0x081c0492,0x07130838,0x09510727,
0x139e0d58,0x23f11bb0,0x2c242a46,0x217f28db,0x10bf1883,0x0adb0c2b,0x0bff0ba2,0x04470a0b,
0xf226fb79,0xe793eb3a,0xe600e64e,0xe306e52d,0xdc5edfc4,0xd9c1d9f5,0xe05adc13,0xed4ae636,
0xf98bf46e,0xfda1fc11,0x05900082,0x14250c83,0x1ba619eb,0x140018e6,0x0e150fa0,0x112a0f2a,
0x15931313,0x15ea173a,0x0cc11165,0x074a09bf,0xfd6a034a,0xf1cff6f9,0xeb67eddf,0xec7aead3,
0xf62df07a,0x0086fc39,0x01bb0250,0xfedafff5,0x0478004d,0x0b2008f2,0x068a09f3,0x008f02e3,
0x00ccfff5,0x05350317,0x049905d7,0xfbb70151,0xee7cf4b6,0xe897ea64,0xec11e938,0xf02eef06,
0xef4ceff4,0xf0c7ef34,0xfb83f55a,0x04e900f4,0x076f0709,0x09940787,0x12fe0e0e,0x1bbf17aa,
0x20241ee0,0x1fb6200d,0x1ee01f72,0x19661d1d,0x0c7c135b,0x0066063b,0xf4c3fa6e,0xeb58efc6,
0xe6a5e80d,0xe774e6fb,0xe585e732,0xdf32e26c,0xdfd2ddd5,0xe918e46d,0xeff8ecb2,0xf763f3aa,
0x0159fb9c,0x0e53085c,0x15541253,0x183e179a,0x15f91708,0x14d415c4,0x0e21120d,0x0a0e0b6d,
0x07e20930,0x064306d1,0x05f70667,0x01380435,0xf9b2fd80,0xf335f664,0xeef3f072,0xf1b6ef67,
0xf7ccf4c6,0xfeddfb27,0x046c021a,0x08b7066c,0x0ad70a8f,0x092f0a0c,0x07550886,0x020f04ff,
0xff320002,0xfc77fe54,0xf5c2f960,0xedecf1a3,0xeaa2eb9a,0xea9bea77,0xeb12eab4,0xf034ec69,
0xfb8ef5c4,0x03bc0039,0x05db057e,0x078b062c,0x0e530a49,0x188313a4,0x1d4c1baa,0x1f321e73,
0x1d101f04,0x15aa198e,0x0f481231,0x097b0c66,0x00fd0629,0xf15df972,0xe690eac0,0xe5dce4e7,
0xe6d9e741,0xe2f1e4ba,0xe37fe284,0xea03e605,0xf1faee8a,0xf472f3be,0xf69ef540,0xfe4ef965,
0x0dfd0594,0x1a6f1548,0x1a831c30,0x127b1670,0x11241098,0x12f2125b,0x0fc5124d,0x03950a83,
0xfad4fdaa,0xfcf4fb37,0xfeb2fe7a,0xfa8dfd1d,0xf5dbf7fc,0xf577f4d0,0xf9ccf7cc,0xf910fa05,
0xfb8ef91a,0x0448ffcb,0x0bd70882,0x0e650e03,0x0a940d10,0x05210799,0x012f0331,0xfbbafed5,
0xf3a9f816,0xeca6ef90,0xebb2eb83,0xee33ecc7,0xf054ef96,0xf04ff058,0xf571f1d4,0xff79fa90,
0x03e302b0,0x054d0438,0x09f90735,0x12190dbb,0x19e81656,0x1da31c70,0x1ad31cd1,0x18121911,
0x16fd17d3,0x0eea1424,0x004b07db,0xf3a9f91f,0xf118f125,0xf1acf220,0xe8e4ee56,0xdf80e35a,
0xe096de62,0xe781e45b,0xec4be9b1,0xf215ef1c,0xf8cdf513,0x009cfcc0,0x07f4043f,0x0ef60bc6,
0x121c10b5,0x16bd1442,0x18321832,0x146e170a,0x0bab106c,0x04c207ac,0xff870251,0xfc00fd33,
0xfb11fbb0,0xf764f95f,0xf76bf65e,0xfe59fa77,0x01f50129,0xfe4e00ba,0xfb37fbd8,0xff38fc97,
0x01b9011b,0x019f017f,0x050d02f3,0x0a1707d0,0x09fb0b1a,0x034f071e,0xfc27ff8b,0xf40ef863,
0xeccbefc3,0xe94aeabe,0xe8efe895,0xebdee9f4,0xf52eef7d,0x00fefba3,0x03aa03bc,0x01b50222,
0x07d403c5,0x0ee60c13,0x11201030,0x161212fe,0x1d3919ea,0x1e341ec4,0x19df1c66,0x128a16dc,
0x06470cf1,0xfb2c003e,0xf3aef72f,0xed79f093,0xe78eea52,0xe4aae595,0xe75be534,0xebebea34,
0xea4beb92,0xeb59e9a1,0xf526ef7d,0xff63facc,0x058e02c2,0x0b740855,0x11090e96,0x11d6121d,
0x108b1141,0x0cfa0f28,0x0b8a0b5e,0x0df20cf4,0x0c200db8,0x024c0831,0xf9bffce7,0xf92cf8f5,
0xfb24fa11,0xf9a7fb24,0xf6a1f7d2,0xf9f0f742,0x0291fe60,0x057c0519,0x032a04d3,0x000a010f,
0x04170127,0x05db0629,0x01f103da,0x00c600eb,0x023b012f,0x005d025d,0xf74ffc65,0xee16f277,
0xe7edeaad,0xe6a9e673,0xec1ce8bc,0xf45af00e,0xfcc9f878,0x0613014d,0x0dd30a32,0x13351130,
0x112912f4,0x10700fe0,0x158f12a5,0x1984181a,0x185c1974,0x13c4168d,0x0bb9100e,0x02bf072e,
0xfa78fe90,0xf1e6f64f,0xebdaee25,0xe9b1ea7d,0xe84ee8e3,0xe7b2e7b7,0xebc6e912,0xf197eee5,
0xf4dcf39a,0xf48df4f1,0xf800f510,0x03ccfd4c,0x0edf0a0e,0x13951225,0x121d1325,0x11ce11ad,
0x104c1147,0x0cea0f0e,0x05a50995,0x01e702f3,0x00fe01b5,0xff04ffef,0xfca9fe79,0xf650f977,
0xf558f4be,0xfb11f7b3,0x0078fe42,0x01950176,0x001600b2,0x04e9012d,0x0c840952,0x0a920cea,
0xff8d057e,0xf9a9fafb,0xfd09fb35,0xfcc3fda2,0xf8fffb37,0xf47af66a,0xf2e3f392,0xf086f1c2,
0xee04ef4d,0xed9aed28,0xf260ef83,0xfd03f6e6,0x091103a7,0x0e2c0c53,0x119e0fde,0x15c913ab,
0x185c1775,0x155417a4,0x0fba123b,0x0ef40ede,0x0eff0f52,0x0a760d72,0x0234066e,0xfb2ffe53,
0xf508f86a,0xec31f093,0xe75ae8f7,0xe72ce6e0,0xe859e7c4,0xeb44e96b,0xef47ed6d,0xf307f0e6,
0xfb53f676,0x058b00ba,0x0ac008c8,0x0d160c0e,0x0e4e0dd6,0x0fec0f1e,0x107f109a,0x0dab0f5f,
0x09e70bf6,0x02f60699,0xffd4008f,0xfe1eff54,0xfc39fcab,0xfe39fd05,0xfd06fe47,0xfaf3fb8f,
0xfb8efb21,0xfdcffc70,0x00caff8e,0x03aa021b,0x074c05b8,0x06ae07a3,0x033a04e6,0x01b1024d,
0xfe91008d,0xf9f7fc52,0xf5f5f782,0xf58ff5ad,0xf3b7f4a9,0xf535f401,0xf679f614,0xf6c9f6c9,
0xf34bf556,0xf22cf1c6,0xf9f0f4bf,0x04a9ffec,0x0907076f,0x0fd70bb8,0x1a7c153d,0x20bb1ee2,
0x1b341f61,0x117715f2,0x0bc30e2f,0x06870920,0x018603de,0xfcc9ff26,0xf753fa38,0xf266f478,
0xeffaf12a,0xebecee3c,0xe8b7e9e7,0xe918e86e,0xee32ead5,0xf4dcf1f5,0xf6eff627,0xfc70f8d1,
0x04c700c1,0x0b490822,0x10ea0e41,0x104611c1,0x0a3f0d06,0x097208ed,0x0b5e0aa5,0x088d0ab9,
0x023b0551,0x01fe0104,0x03f303ba,0xfe5001c0,0xf8a5fb09,0xf89df7b8,0x0002fbd8,0x021402b9,
0xfa4cfe69,0xfa65f893,0x0317fea0,0x093906fd,0x087909bc,0x02fd0607,0xfdf9001c,0xfdd4fd3b,
0xffa0ff14,0xf9a6fdd6,0xefc3f458,0xee11ed4a,0xf51bf160,0xf5bff6a5,0xf331f406,0xf630f400,
0xfde2f9af,0x04e6020d,0x04210585,0x02ea0270,0x0eb90717,0x1d1616f6,0x1ec61f7b,0x181f1bd1,
0x12c714f4,0x0d4c1088,0x039808c8,0xf8ddfe59,0xf206f468,0xf3d0f238,0xf6dbf5d7,0xf3dcf64b,
0xeec3f0cf,0xef2fee6e,0xf07ef037,0xed9def83,0xecbfec36,0xf359ef25,0xff47f8b5,0x0a8305d7,
0x0bc40c31,0x0ae40ac0,0x0f550c76,0x13e0123b,0x0e151290,0x03a3084f,0x01290170,0x03a40230,
0x054804f3,0x0116040f,0xfa4bfd3a,0xfb9cf9c4,0xfefbfe0c,0xfb30fdde,0xf782f87e,0xfe31f975,
0x07c7039b,0x0830092b,0x03ef0605,0x025802ba,0x02df028c,0x016202d1,0xfb9cfeb8,0xf62df8d8,
0xf320f42b,0xf457f35c,0xf64ff576,0xf4bef626,0xf1faf320,0xf600f2f0,0xfe3dfa57,0x024000c1,
0x033a02d2,0x055803bc,0x0bdc0830,0x10bf0f0c,0x109110fb,0x12ab10f9,0x170a1530,0x16621780,
0x0fb913c2,0x05bb0a97,0xfd52018d,0xf3d3f896,0xee96f04f,0xed9cedf1,0xed54ed83,0xef3eedd5,
0xf400f193,0xf55bf53e,0xf2b5f456,0xf12bf155,0xf42bf222,0xfc6ef792,0x06f401f5,0x0c720a5c,
0x113c0e9a,0x14b713c9,0x0f8c1329,0x07a50b28,0x055405c8,0x045d0526,0x00060280,0xfc28fdb7,
0xfbcffb7d,0x0094fd80,0x05a10408,0xff9703b1,0xf948fb58,0xfc25f9c8,0x006efeca,0xffa90050,
0x01d4ffc9,0x072404ec,0x044906db,0xff320158,0xfc24fdb7,0xf95ffa92,0xf8ddf8e1,0xf8bff8dd,
0xf7fdf881,0xf589f6d9,0xf2eef40e,0xf3d9f2a9,0xf9e8f680,0xfe05fcca,0xfd86fdd2,0x01e7feec,
0x096f05e7,0x0d900c13,0x10450ecc,0x146d1259,0x160f15ed,0x11591460,0x0cfb0e78,0x0c200ca5,
0x06aa0a24,0xfd99025f,0xf4cff8d8,0xef9bf1db,0xeb58ed8a,0xe7fee946,0xea0ce802,0xf279edea,
0xf870f632,0xf9caf984,0xfb71fa54,0xfdc7fcfa,0xfe42fdfc,0x00f4ff56,0x04380271,0x0a6f06ca,
0x11760e4d,0x12a31319,0x0ca6102e,0x080009bf,0x053b06e2,0xfffd02d1,0xfc40fd95,0xfcb4fc1c,
0xff14fdda,0xffc3ffdd,0xfdbefeb5,0xfe98fdc3,0xfe84ff07,0xfd33fd84,0xfffbfe30,0x0236018e,
0x013801e0,0x01df0127,0x056c03b3,0x012d04ee,0xf764fbd5,0xf5dff587,0xf956f7aa,0xf965fa15,
0xf4a8f77c,0xf1f8f262,0xf59bf367,0xf98df7c1,0xfd73fb53,0x01b8ff75,0x0743044e,0x0cfa0a5d,
0x10c70f22,0x1185117a,0x107c1111,0x0f710fcf,0x0fb00f85,0x0db40f4d,0x070c0ad7,0x0074035b,
0xfd13fe98,0xf8a5fb55,0xf269f599,0xed23ef8c,0xeb52ebad,0xed0bebdf,0xeef8ee01,0xf0a8efb4,
0xf6e2f2d7,0x008ffc09,0x039a0327,0x02de0303,0x04b3039c,0x04e50507,0x0649050f,0x09bc07f9,
0x0dbd0ba6,0x10b50fa9,0x0f8510c8,0x09290cdf,0x002c04b1,0xf9b8fc55,0xf82df88a,0xf981f896,
0xfc60fb04,0xfd1dfd1c,0xfe34fd29,0x013dffc2,0x042c02e8,0x03530473,0x0056014d,0x00fd0071,
0x001f00e2,0xfcfefed5,0xf9dafb4c,0xfb4ef9db,0xfda2fd1e,0xf935fc45,0xf24df55a,0xf387f193,
0xf9f0f6d2,0xfb4afb97,0xf881f9cd,0xfbb3f910,0x0336ff7e,0x085e0637,0x0c160a4b,0x0f3c0df1,
0x0ff00ff3,0x0fd80fdb,0x0f880fde,0x0d100e95,0x09700b56,0x061c07ae,0x039e04e1,0xfee901ac,
0xf6a1fafc,0xef5ff26d,0xed54edcd,0xecdeed3b,0xea80ebcd,0xec72ea58,0xf3d9f00e,0xf815f65d,
0xfc4ef9b8,0x0403ffa9,0x0b650839,0x0ca70cf1,0x08b20b04,0x062f06b7,0x07ee06f1,0x095008d7,
0x08860948,0x078d079f,0x0a3908b2,0x09fb0afb,0x024706de,0xf80dfce1,0xf506f550,0xf8dff68e,
0xfca5fb2a,0xfe11fd8c,0x000efeca,0x043301ed,0x062905d4,0x036704ff,0xffbe0195,0xfb6cfd78,
0xfa2bfa54,0xfad6fa83,0xfb35faf9,0xfc5bfbae,0xfd6ffcfa,0xfce0fd7c,0xf8b1fb28,0xf33bf5c6,
0xf2d1f20c,0xf95af587,0x008dfd8f,0x0358027c,0x07b104e4,0x0ef10b70,0x1191110e,0x103a10f2,
0x0f9a0fc5,0x0ebf0f4c,0x0d3e0df9,0x0a360c0e,0x03bf071e,0xfe8200bd,0xfaa1fca7,0xf5edf871,
0xf086f32e,0xebf9ee20,0xeb03eab9,0xef3aeccc,0xf1bcf10f,0xf18af1aa,0xf602f2b9,0x01d4fb9e,
0x08870693,0x06e0082b,0x075f0654,0x0bc10999,0x0c810ce6,0x097a0b26,0x069e07c1,0x056105da,
0x063e0572,0x07ee077a,0x04cb06de,0x022802fd,0x017801eb,0xfdc90028,0xf6abfa7b,0xf17ff34b,
0xf4b1f1ea,0xfe39f947,0x05b80288,0x06ef0738,0x0458058b,0x03e603eb,0x01f10367,0xfd3dffe9,
0xf76afa47,0xf55cf586,0xf951f6f5,0xfc5efb6d,0xfaa8fc11,0xf89ff938,0xf9f5f90a,0xfa6ffa9e,
0xf7b9f956,0xf8aff702,0x031afd0c,0x0e080944,0x11b410de,0x110e1164,0x10ec1105,0x0ed1102e,
0x0b820d40,0x083809bc,0x06920718,0x04f8060a,0xffec02c8,0xf920fc9e,0xf28df5b4,0xeeeaf03a,
0xee85ee72,0xef4feed7,0xef0aef6a,0xeeb4ee7c,0xf39af079,0xfb35f76f,0x0057fe26,0x032101e9,
0x07d3050b,0x0d690ae6,0x0f4b0ed3,0x0d890eb9,0x0a0e0bba,0x08c8090e,0x08e608df,0x066e081d,
0x01ba0424,0xfe1affac,0xfe60fdbc,0xff22ff1f,0xfde6fe97,0xfc78fd67,0xf8edfabf,0xf7d1f7c8,
0xfabff8df,0xff7cfd33,0x03360186,0x062504a1,0x07610731,0x03550605,0xfd4e0019,0xfa24fb5e,
0xf78ef901,0xf659f69b,0xf75cf6cc,0xf8bbf808,0xf9dff94b,0xfc06fab8,0xfe3dfd46,0xfe99fea3,
0xfe8bfe7a,0x0086ff19,0x05c102b4,0x0cab092d,0x11b40f83,0x133e130b,0x10cc125c,0x0ddd0f70,
0x09320bb6,0x052b070a,0x01af0376,0xfd6affd7,0xf7d8fac0,0xf24df508,0xeebaf00b,0xede5ee1c,
0xecd3ed5a,0xecbbec84,0xf0a5edfa,0xf7fcf460,0xfc40faa5,0x0002fdd5,0x06770333,0x0b310949,
0x0cfd0c44,0x0f330e0a,0x0f350ff6,0x0abb0d38,0x079208a5,0x065006f8,0x027d04da,0xfdb8ffe3,
0xfcf9fcb9,0x0034fe53,0x00a00122,0xfba5fe67,0xf85ff975,0xfaf1f8e6,0xffe2fde0,0xfe48fff9,
0xfa38fbcc,0xfc5efa5f,0x0200ff47,0x05a30452,0x057f0619,0x02cd0445,0xff8d0127,0xfbd8fdb0,
0xf73ef9ae,0xf350f4e9,0xf2f4f294,0xf6bdf456,0xfc98f9b2,0xfed0fe72,0xfe17fe48,0x0172ff10,
0x081304e5,0x0aad0a31,0x09140a12,0x095408ac,0x0ed30b88,0x14731222,0x133714e5,0x0bbd0fc8,
0x060c0855,0x00e603da,0xf7dbfcb4,0xef85f329,0xed39ed78,0xf00bee6e,0xf130f13a,0xeed5f025,
0xef04ee48,0xf4fbf17d,0xfafef887,0xfce4fc34,0xfff9fdf9,0x05f802c5,0x0c380957,0x0ee70e34,
0x0e230eba,0x0ca60d5f,0x0cc40c62,0x0ce80d4c,0x06d50ac4,0xfe3101fe,0xfcabfc58,0xfea2fdce,
0xfce1fe2c,0xf960fb11,0xf8cdf87d,0xfc64fa4b,0xfebbfe14,0xfd44fe55,0xfc03fc28,0x0002fd80,
0x03a4027d,0x01a20316,0xff1d0013,0xff41fea5,0x02ba007d,0x063204ec,0x01b40526,0xf78ffcd3,
0xf14af377,0xf1ccf106,0xf42bf2d5,0xf670f55a,0xfa49f7ea,0x0264fddd,0x0aac0723,0x0c810c66,
0x0a9b0ba0,0x0a690a08,0x0cef0b85,0x0d830dcc,0x0abb0c38,0x0ad10a14,0x0e0a0c7b,0x0bae0e16,
0x01220703,0xf627fb3b,0xefeef27b,0xec42eddf,0xea94eb1e,0xebfeeadc,0xf0c6ee01,0xf614f3aa,
0xf875f7c1,0xf92ff8c4,0xfbc3fa1c,0x016afe44,0x08b2052f,0x0db40b9b,0x0ef00ed8,0x0f350ebf,
0x11fb1088,0x1055123b,0x07670c86,0xfe82024c,0xfd35fcc7,0xff1ffe6c,0xfc33fe4e,0xf7e6f9be,
0xf7fcf745,0xfb1cf968,0xfcfafc67,0xfd15fd02,0xfea9fd89,0x00e8ffe9,0x01df019f,0x02110215,
0x026a0233,0x01c6027d,0xff7000a2,0xfe8dfea2,0x001fff62,0xfee20019,0xfb41fcf3,0xf868f9b4,
0xf64bf745,0xf36cf4f6,0xf289f23e,0xf7e6f44a,0x019dfc8b,0x0a1e0672,0x0dfd0c9b,0x0f8b0eeb,
0x0f2f0fb5,0x0beb0dd1,0x09f90a70,0x0b9b0aa4,0x0c2d0c3f,0x09670b41,0x055f074e,0x016203a1,
0xf9f5fe23,0xf0dcf56b,0xe9f9ecde,0xe825e875,0xe925e863,0xed53ead3,0xf3e9f08c,0xfb4df771,
0x0211ff11,0x044103bc,0x0492044e,0x07050574,0x0b74093d,0x0ead0d65,0x10640fa1,0x10b410da,
0x0ca80f2c,0x074a09e3,0x020304d1,0xfc7dff50,0xf863fa35,0xf6e2f727,0xf8edf789,0xfb0cfa44,
0xfb0ffb28,0xfbf2fb42,0xfd83fca7,0x0028feb2,0x02ea0199,0x045f03c8,0x03550436,0x000f019d,
0xff27ff1e,0x01d80046,0x02e30309,0xfe910138,0xf953fb84,0xf91af87e,0xfa1cf9e8,0xf86cf981,
0xf55cf6fd,0xf37ff3f5,0xf7a7f4b8,0x000efbd8,0x06ae03b8,0x0be90954,0x11110ea0,0x142012ff,
0x13a41458,0x0f5811f6,0x09390c3f,0x05d206fd,0x0517055f,0x02bc0473,0xfb4cff92,0xf3acf6de,
0xf10df1fe,0xef77f03d,0xed65ee8a,0xeb10ebfd,0xed10eb5d,0xf273ef85,0xf932f5bd,0xffcffc97,
0x06ae0327,0x0ceb0a30,0x0dbb0e06,0x0cd30d16,0x0d960d2e,0x0d5d0dc4,0x0c0e0cc1,0x09f50b49,
0x06050815,0x014403b1,0xfc67febc,0xf8b5fa6f,0xf658f74f,0xf63df612,0xf758f6b7,0xf9c8f85c,
0xfcdcfb57,0xff4efe23,0x020c007a,0x051603a4,0x05c105e0,0x03a404db,0x028802b4,0x034302c4,
0x015102f6,0xfbe1fec1,0xfa1cfa3a,0xfc9ffb46,0xfb43fcc0,0xf568f870,0xf2b6f33e,0xf5d8f3cd,
0xfa69f848,0xfdb2fc2e,0x0164ff59,0x06c103ec,0x0c4109a7,0x0f670e26,0x110c1058,0x125611c1,
0x11bc1262,0x0e5f105e,0x089c0bb4,0x015f0504,0xfa9afdcc,0xf550f7d6,0xf1c4f323,0xeff9f0da,
0xee14eeeb,0xee8aedf6,0xf001ef58,0xf1b6f0c2,0xf3d3f2d4,0xf811f53d,0xffddfbdc,0x06610367,
0x0c530955,0x12460f67,0x15b11499,0x122f14e2,0x0b260e9a,0x079408ba,0x058e06d3,0x01410395,
0xfe17ff92,0xfbc0fcfa,0xf9aefab3,0xf833f8dd,0xf66ef776,0xf4bff54d,0xf7aaf587,0xfddefaa5,
0x028e0069,0x05ca0445,0x076306ef,0x06900741,0x04b5058b,0x03aa0417,0x00f502ac,0xfd1cfeff,
0xfb68fc06,0xfa47fb01,0xf920f989,0xf89af8e3,0xf813f85f,0xf763f7ca,0xf65df6c6,0xf78ef65d,
0xfdc9fa2f,0x04d10150,0x09c4078d,0x0d040b6f,0x0ffc0e8f,0x11841110,0x10b01155,0x0f780ffe,
0x0def0ee4,0x0a1a0c62,0x033e072b,0xf896fe60,0xee04f2e9,0xe9f9eaef,0xec63ead8,0xee7ced9d,
0xf04eef5c,0xf1e3f10b,0xf5ebf37b,0xfad3f8a3,0xfc4cfbfd,0xfd1cfc65,0x03e1ff68,0x0f8b09d2,
0x1523137e,0x143d1506,0x12fb1377,0x10881222,0x09890dba,0xfef3045b,0xf77dfa47,0xf792f6d7,
0xfa78f903,0xfc37fbce,0xf9fefb7c,0xf782f888,0xf81df768,0xfadff98d,0xfc1efbb3,0xfeeffcfe,
0x049901a6,0x08cf0700,0x0ac40a17,0x08e90a76,0x03970669,0xfece00de,0xfc00fd12,0xfa31fb16,
0xf81df914,0xf798f785,0xf813f80d,0xf60ff75e,0xf4d7f4ee,0xf8d6f646,0xfe8bfbcc,0x01780056,
0x02ec0214,0x08cb0511,0x11440d43,0x13db1393,0x10bb128d,0x0e580f33,0x0e0f0e19,0x0ca80dd9,
0x070e0a60,0xfe9e030f,0xf630fa1c,0xf108f34b,0xec7feee4,0xe7a4e9de,0xe766e699,0xee1dea0c,
0xf687f26b,0xfd1efa17,0xfef2fec1,0xfe6cfe60,0x02c0ffed,0x09e20662,0x0dfb0cb2,0x0e6a0e42,
0x117e0f63,0x14c913af,0x10f213db,0x07c30cb1,0xfed002e4,0xf916fb83,0xf613f75e,0xf4c1f531,
0xf4b7f49b,0xf69df549,0xfb1ff8af,0xfe1afd18,0xfe30fe5a,0xfe8dfe2c,0x0059ff4a,0x044e0221,
0x086e0690,0x09760951,0x07e208d2,0x059c06e0,0x01c80408,0xfb35fed0,0xf50df7b8,0xf2d1f36c,
0xf493f345,0xf7b1f640,0xf826f853,0xf76df797,0xf9baf823,0xfe7efc03,0x036a00dd,0x088005f9,
0x0cae0ac0,0x0ec80e0a,0x0f700f0a,0x112e102d,0x11171188,0x0e530fe4,0x09cb0c41,0x02850687,
0xf9bbfe2c,0xf35cf61c,0xef37f14c,0xeb07ed08,0xe912e9ba,0xeb12e992,0xf023ed70,0xf55af2d4,
0xfa77f7d0,0xff9ffd05,0x05a3025f,0x0b2808e8,0x0bfa0c08,0x0ceb0c26,0x100f0e71,0x122911a5,
0x0ffc11c3,0x0aca0da8,0x043a07b5,0xfd02007a,0xf8f1fa65,0xf7bff835,0xf5acf6ea,0xf2a9f420,
0xf226f1c2,0xf87df486,0x0028fce5,0x02a201f7,0x032202c9,0x059d041f,0x08380735,0x075f0843,
0x047805e0,0x037c03af,0x035a037e,0x01c002cc,0xfdd50028,0xf7b1fac1,0xf310f4f4,0xf219f20c,
0xf31af2a3,0xf3ebf345,0xf884f594,0xffb0fc2a,0x0449027d,0x0637054d,0x09a20799,0x0e0d0bcf,
0x11350fd5,0x114611d5,0x0df40fdb,0x0be50c66,0x0c930c32,0x09af0bf4,0x009005aa,0xf680fb1b,
0xf1b5f37b,0xeda1f00b,0xe7c9ea99,0xe699e647,0xecaee8e7,0xf510f122,0xf94cf7cb,0xfb3cfa2b,
0x003dfd37,0x08b5045a,0x0e6f0c65,0x0ec10eea,0x0fcb0efd,0x10e5109e,0x0fcb1097,0x0c0a0e67,
0x04c108b9,0xfe47011f,0xfbb6fc85,0xfa8bfb58,0xf709f925,0xf3f7f51d,0xf4c1f3ec,0xf73ff5e1,
0xf972f87b,0xfa8dfa0d,0xfe60fbce,0x06ae0229,0x0d310aa9,0x0cc70dc5,0x08690ab7,0x046e0636,
0x01e00329,0xfee3007d,0xfb33fcf6,0xf7eef943,0xf75df740,0xf7a8f7d0,0xf4b5f6b5,0xf0dcf273,
0xf257f0bf,0xf7c1f4e2,0xfd53fa93,0x0473008b,0x0c92089a,0x11500f8e,0x1091116d,0x0e600f5e,
0x0d4e0db7,0x0d780d41,0x0d650db3,0x09950c18,0x029c0629,0xfd54ffa8,0xf91bfb65,0xf264f61e,
0xeb78ee99,0xe9f7e9d0,0xedc0eb87,0xf1deeffc,0xf5a3f3b4,0xfa59f7b6,0x0157fd99,0x079904fc,
0x09670902,0x09530962,0x0b0009cb,0x0f0e0cdb,0x10691084,0x0af30e70,0x031806de,0xfe5c003a,
0xfbc6fcfb,0xf8abfa4e,0xf596f6ec,0xf4e0f4d6,0xf746f5c7,0xfa83f910,0xfbdffb68,0xfd75fc73,
0x01a3ff39,0x06ce043f,0x0a8908ed,0x0c9d0bb2,0x0dd10d5e,0x0ce10dcb,0x084c0b08,0x016204ed,
0xfb03fe09,0xf647f879,0xf35af47f,0xf2f4f2f0,0xf34ff331,0xf387f373,0xf3edf3a4,0xf568f47a,
0xf798f678,0xfb68f906,0x0299fea0,0x0a10068b,0x0ff00d29,0x1436125a,0x14dc1531,0x1017131b,
0x09b80cc6,0x065007a1,0x044d0567,0x012302e2,0xfd0bff45,0xf7defa90,0xf397f574,0xf186f256,
0xeff2f0c1,0xef4cef58,0xf2bff06a,0xf9ecf614,0x0072fd6f,0x051602f0,0x081b06d0,0x09bc0912,
0x0a580a24,0x0a020a41,0x08750966,0x05bd0741,0x029e0434,0xff46010a,0xfc2ffda7,0xf959fac5,
0xf6a6f7f3,0xf508f5a9,0xf519f4c4,0xf7ebf613,0xfd24fa76,0x00f6ff3c,0x0389023f,0x06d90500,
0x0b1a08f4,0x0df70cdf,0x0e2c0e5f,0x0d470dc2,0x0c080cc5,0x09230ae6,0x031806a6,0xf98bfeae,
0xf0b7f4ba,0xed43ee2f,0xeeceedc3,0xf039efa2,0xf1b1f0d3,0xf42af2c5,0xf849f606,0xfc74fa96,
0xfea3fdc9,0x00c2ff7f,0x069302fa,0x0fb40b2e,0x14971310,0x13d514a2,0x121912ee,0x0f611111,
0x08980ca2,0xfe71039b,0xf74af9ff,0xf6d5f674,0xf864f7ad,0xf875f8c0,0xf607f764,0xf451f4e4,
0xf578f48c,0xf8a7f709,0xfb09fa00,0xfe88fc58,0x04ca0174,0x09e807ac,0x0c370b65,0x0b140c21,
0x0756094e,0x03d9056b,0x00900229,0xfd18fed4,0xfa05fb61,0xf8c8f919,0xf851f8b5,0xf602f75c,
0xf4a9f4e5,0xf7b1f5af,0xfca0fa2c,0xffc8fe79,0x0190009f,0x06de0390,0x0e750ada,0x112d10ae,
0x0eeb104c,0x0d190db8,0x0d270d0d,0x0c0d0d15,0x06ae09ea,0xfe7502be,0xf6a4fa31,0xf223f416,
0xee01f039,0xe971eb89,0xe927e873,0xef43eb93,0xf6ebf335,0xfcf6fa25,0xff7dfec7,0x0033ffa7,
0x047401d7,0x0ac307ad,0x0e850d4b,0x0ed10ec8,0x10e20f68,0x13451281,0x0fcb1263,0x07790bff,
0xfee902e3,0xf8e1fb86,0xf541f6dd,0xf393f425,0xf3a0f372,0xf573f438,0xf997f758,0xfcb4fb8a,
0xfd72fd3c,0xfe5cfdc2,0x005cff34,0x0466022d,0x089e06af,0x0a1f09af,0x095909ea,0x0754088c,
0x035b05ac,0xfcdb005d,0xf6bdf974,0xf3f4f4e8,0xf4bef3f1,0xf736f602,0xf7b9f7cc,0xf74ef753,
0xf9acf819,0xfe1efbd4,0x029e0047,0x076d0502,0x0bae09ae,0x0e1d0d33,0x0efb0e85,0x10a70fb6,
0x109110fd,0x0de70f6c,0x09710be0,0x025a063e,0xf9e0fe2a,0xf3acf65e,0xef95f1a1,0xeb89ed75,
0xe9baea51,0xeb9fea37,0xf06eedda,0xf58ef30b,0xfabcf80c,0xffedfd54,0x05d102a5,0x0b490904,
0x0c580c43,0x0d470c90,0x10070e9e,0x11d51169,0x0fa81164,0x0a8c0d5e,0x0412077e,0xfcf10060,
0xf8d5fa53,0xf78af80c,0xf56ff6af,0xf267f3e2,0xf1d2f176,0xf81ff42b,0xffe9fc8e,0x028801cb,
0x031702bc,0x058e0410,0x0839072a,0x07860858,0x04b80614,0x03c703f6,0x03ab03cd,0x021b0323,
0xfe260082,0xf7e8fb07,0xf32df51d,0xf227f221,0xf31bf2ab,0xf3e0f340,0xf86df582,0xff92fc11,
0x042f0261,0x06210536,0x09830780,0x0de50bad,0x110d0fac,0x112a11b2,0x0dea0fc8,0x0be10c61,
0x0c8a0c2f,0x09a30be9,0x008b05a0,0xf684fb1b,0xf1b9f37f,0xedaaf00f,0xe7dceaa7,0xe6abe65b,
0xecb7e8f5,0xf514f128,0xf951f7ce,0xfb41fa2e,0x003ffd3a,0x08b6045b,0x0e710c67,0x0ec30eec,
0x0fcb0eff,0x10e3109e,0x0fcb1096,0x0c080e65,0x04bf08b6,0xfe46011e,0xfbb6fc84,0xfa8afb57,
0xf708f925,0xf3f7f51d,0xf4c0f3eb,0xf73ef5e0,0xf971f87a,0xfa8dfa0c,0xfe60fbcd,0x071e0229,
0x00000513,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
};
const uint32_t sample_2_timpani_timpani[3968] = {
0x00000000,0xfff9fff5,0xfff9fff5,0x0004fff5,0x004fffd7,0x010dff91,0x0f21fd95,0x4fbb460b,
0x598a625b,0x40225439,0x1dc43113,0xcebe1dfc,0xa00faa38,0x8dee95d9,0xa37e9a5c,0xc251ae3d,
0xce93bae0,0x0511d76d,0x3eb12a28,0x4c583de2,0x57c249d3,0x71fb4441,0x23dd71fb,0xe630f1b5,
0xe648e7ed,0xeec9ef46,0xcda5dd06,0xb7a1c669,0x8ede8dee,0x8dee8dee,0x8dee8dee,0xc0548ff3,
0x0a45edec,0x71fb5de5,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x63ea65a4,0x1d0f436b,
0xee5d0f5a,0xe57305f9,0xb625c17f,0x8deeaa98,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xc0a68dee,0xfbd5dff8,0x3d3529ab,0x55755d07,0x67ae6ddf,0x71fb71fb,0x4f7e71fb,0x13161b8c,
0x1d472442,0xfa441de7,0xcf52e857,0xd173e353,0xe3c8e00a,0x0295e5f9,0x0f271317,0x2b7b286d,
0x22d1246c,0xa55de909,0xd89caf6a,0x38f2130d,0x53b04e5a,0x3fcc54bc,0x0adb2513,0xf0652688,
0xd155e5e1,0xfba9dd25,0xf8551268,0x9d19b5bf,0x9acea20f,0xad5bb3e4,0xed96daf5,0xf3e2f0de,
0x10511045,0x4bf33ede,0x2b5b3d9b,0x29bb3343,0xffc50b15,0x0027ebe8,0xfec7f3a9,0x10b60585,
0x2b5f16fb,0x11ff1190,0xdf53f16d,0xeca9de8c,0xd533d6a4,0xcb59bbe0,0x0a3cd75a,0x2ffe10b0,
0x51a051c1,0x4d464a90,0x71fb558f,0x4c346c85,0xe693195c,0xc947d26b,0xb29bcfe6,0xd9cfc45b,
0x05d9e1d2,0xf35a17dc,0xe47fe2b5,0x9e06a4c7,0xc216b13e,0x004bdab5,0x14061d0b,0x00cafd35,
0xff13ef19,0x288f131d,0x3ce019c6,0x2b4f3101,0x04c10d54,0xc8fbea58,0xa9669f86,0x8deeb3ed,
0xc2fba7ce,0xf0a8ce3f,0x0d69f6ef,0x41e33da6,0x48ae4ae9,0x5d2c3a27,0x65f8634d,0x4b764493,
0x5810406f,0x4a9b649b,0x4343455f,0x2c0c4275,0xe114030a,0xb1e6cd24,0xc151b261,0xa540ac33,
0x8dee8fcc,0x8dee8dee,0x8dee8dee,0x91fb8dee,0xe178bead,0x15e3f073,0x063211a2,0x20a40606,
0x4ae02a5e,0x662c5d72,0x4da64ee4,0x3b7d34a9,0x29b54196,0x42eb351b,0x491b4bf0,0x599d6206,
0x2c094a20,0xed231a6f,0xcd85ea5b,0xe852d9a6,0xf8adfc73,0x1b280bb1,0x22ad224f,0x1562130a,
0x0ecc125f,0xf0b70311,0xbec9f2c8,0x909eaec4,0x8dee8dee,0x8dee8dee,0xc16f9eb2,0xa6ffb95f,
0xdb97b77b,0xf408db2f,0xf6abfaf8,0x058501cb,0xfbd80c9c,0x0ea10add,0x36792da4,0x67ac4ba2,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4ca36dc4,0x3e9f3f5b,0x067e1bcb,0x085afcfa,0x01461670,
0xe891fff2,0xe74aecef,0xfc92f08b,0xf4d7f80c,0x987dc84c,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0xb84c9a36,0xbb70c776,0xc9b5cbaa,0xc9ebd25d,0xfaa7d65b,0x31b420a0,0x36262852,0x3a6e340e,
0x37cd3a0b,0x5a4b49e5,0x71fb6b6a,0x71fb71fb,0x71fb71fb,0x6bf96d27,0x34275100,0x2c1831b4,
0xeb3d2305,0xe341e747,0xd083cb12,0xe01dc9e5,0xea3adc7d,0xcc09dcd0,0xc3c9cab1,0x93e4a51c,
0x8dee8dee,0x8dee8dee,0x9c468dee,0xaef2a646,0xc838b98a,0x1a70ef95,0x11b4ffec,0x28fe19ea,
0x0a971634,0xff680f97,0xff8602d1,0x18930661,0x3bc82224,0x650c6590,0x5b8162af,0x66bf59b8,
0x71fb71fb,0x715f71fb,0x5a586b92,0x282e37d9,0x09631b2b,0x0930fe19,0x05541030,0xf2a0f255,
0xce93eefc,0x943d9f37,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xabd58ecb,
0xf6e2ccf0,0x14d40bb6,0x308c1fd4,0x3cc83642,0x4d1441cb,0x58a454ef,0x54f55933,0x6aab5d25,
0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4dff6b8e,0x273825fc,0x1d5131ad,0xe9ae0de2,0xcb9ddd3e,
0xc6e9c6dd,0x9e7eab38,0xcb85af2d,0xc1a3bb94,0xad7db412,0x9b3daf10,0x93f193cf,0x900b938e,
0x8dee8f27,0xb6319605,0x17e8f839,0x23232783,0x1f56235e,0xfdc91211,0x0a31f343,0x103f09a2,
0x23d41d97,0x1fcd26b7,0x43003222,0x603e588b,0x6e406635,0x6c526a3b,0x6ee871fb,0x613c68f3,
0x44e551be,0x1c9d290b,0x0b85134a,0x11270d1c,0x09ad1dc6,0xf4bb03c8,0xa06ecc52,0x8dee92a4,
0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,0xa2ac8dee,0xcb33c27f,0xdbfcd848,0xe91edd0b,
0x19bb024c,0x5a023657,0x627b61be,0x4ac44f22,0x71fb4e69,0x71fb71fb,0x71fb71fb,0x71fb71fb,
0x4bac646a,0x3460374a,0x15141ac5,0xf4c108e7,0xe3b6fd3b,0xdc99dba0,0xae51b249,0xb0cab142,
0xdc46c25a,0xe4b0e258,0xca7ddfcb,0xc81dc1bf,0xc85ed0b7,0x9c7e9bdf,0xa5719cdd,0xbcf2a722,
0xe7a6e365,0xf0c3fc49,0xf5cbf135,0xf9f7fb00,0xef710010,0xff91f2d9,0x054ef957,0x34e02252,
0x53354cae,0x5ad14d72,0x71fb71fb,0x71fb71fb,0x6f3871fb,0x39a058a2,0x29e3309e,0x121f1c60,
0x113b1e47,0x1d881a32,0x0f9a1928,0xfcd4febe,0xc87ce08b,0x8f00a429,0x98c38dee,0x8dee8dee,
0x8e178dee,0x8dee8dee,0x90c88dee,0xc201b78f,0xc9f5c20d,0xf88ae686,0xfb42f39e,0x17da1b73,
0x17ed1155,0x2a750ca7,0x71fb45f3,0x71fb71fb,0x71fb71fb,0x71fb71fb,0x4e0871fb,0x28a93e22,
0x0e341dfe,0x18280ebe,0x18301cc3,0x039015b6,0xdb97e75b,0xcb0fd9c7,0xcb33c14c,0xccafcb4f,
0xb0b8cb7a,0xb53eb409,0xafecb29b,0x91d6a409,0xcf3db0ae,0xe1d2ec38,0xdcedd1ca,0xd951e49f,
0xef96e106,0xfa88fb3c,0xea75e9f4,0xfda2f975,0x1a3a0203,0x35f92d77,0x2be02f48,0x4b9a3949,
0x58a151eb,0x71fb6f95,0x650667d0,0x42355a2f,0x40443b7b,0x40d134c8,0x2d564336,0x408939cf,
0x2d9a3875,0xef4106b1,0xc38edeea,0x95d7ab99,0x8dee8dee,0x8dee8dee,0x8dee8dee,0x8dee8dee,
0x8dee8dee,0xc804aa74,0xc589c984,0xe8f4dd31,0x0e73f788,0x01540a20,0x2de20e8f,0x4c283918,
0x67d35439,0x71fb7038,0x71fb71fb,0x71fb71fb,0x6ae471fb,0x2d433cae,0x10ed19eb,0x1c3e1a8e,
0x0a5d1401,0xe8b5fbd8,0xe63be7ac,0x093f02ae,0xdc35facc,0xc536ca7a,0xaab8c1b6,0xa2519cb2,
0xa7a4ad63,0xbdf7ad7f,0xcae8c7cb,0xd885ce7c,0xc219cc6c,0xf091d575,0xf232f7bf,0x099ef61e,
0xe0c5f447,0xe92ae38e,0x0a69f805,0x30071977,0x367133b3,0x64ee4ad7,0x71fb71fb,0x641971fb,
0x414e4b25,0x35e03489,0x374134ff,0x44c13c88,0x3bcf4669,0x31503829,0x16fa31d5,0xe45a02da,
0xcbfdd5b2,0xaa30c075,0x94f799c7,0x8dee8dee,0x8dee8dee,0x943e8dee,0xb4fba87b,0xb038b474,
0xbe6bb283,0xd2e6c6c9,0xff87e844,0x0a1406d0,0x258314c9,0x46db2963,0x4af25722,0x71fb5275,
0x71fb71fb,0x71fb71fb,0x53aa71fb,0x35ce396c,0x2ab23295,0x1eb02bfb,0xf9a80b3f,0xee36ee36,
0xf4a5f487,0xede9fc15,0xdee4e4f9,0xb698ca86,0xbf37bc59,0xb69db8ae,0xcdedb760,0xd733d7d2,
0xb98ac90f,0xd349c196,0xd264ceff,0xdb7cdd82,0xf2b5e40f,0xf686ee56,0xf633f816,0xf169ecdf,
0x0c40fbaa,0x0e940d16,0x30a21e62,0x3fd93ce0,0x6314519c,0x546361a1,0x513a4a63,0x64d15f52,
0x32355255,0x2206225d,0x16212090,0x2bc2229d,0x1b4b291c,0x059e10df,0xeed5059e,0xc3b7d989,
0x8dee9c7e,0x8dee8dee,0x95898dee,0xb1a1a4f8,0xaacba7a6,0xadc5aa68,0xc15ab142,0xd545cf62,
0xe7a0d904,0x0874f0dc,0x1e87151d,0x41592fff,0x4a2543f2,0x5f2954da,0x61266823,0x5f7b5e92,
0x71fb678b,0x592f6f74,0x25c142ce,0x03761141,0xffcbfc45,0x111b0957,0x190820b9,0xe699f7bf,
0xd2d1e2a0,0xc669c88e,0xaf97c3b8,0xc0edb1d2,0xc6febcf2,0xf229e9e2,0xe975e9b3,0xd2b9e13f,
0xb88fc0cb,0xd635c866,0xf8d9eac0,0xddd0ea3d,0xeceae827,0xf7aaef85,0x12570078,0x1c212356,
0x1b471658,0x26162538,0x2d6f2987,0x425f3122,0x525c4c83,0x60055e8f,0x40c559c2,0x34792cc5,
0x461a453d,0x1b8c3816,0xfe9d0a92,0xf5d6f1e0,0x02a30ace,0xe190ef72,0xb9cfcdd0,0x8dee93b8,
0x919992d7,0x9d4192ea,0xba17b0a6,0xb167b97a,0xb606af81,0xbe84be14,0xd530c5cc,0x02e0e7bc,
0x2aba15dd,0x2b263246,0x3f272f39,0x48373db3,0x580b52ee,0x63e45b8a,0x6ac16f06,0x3a8e552a,
0x1e9e264c,0x24e81ed6,0x1f9220d6,0x0afb1682,0x017d0468,0xe8c2fa63,0xe7dce3d8,0xecf8f513,
0xc975d71e,0xafd3b7e2,0xcf6fc276,0xde94d472,0xec44ea02,0xd37edb4a,0xe072dcc9,0xdce2dff7,
0xdd19e21f,0xbb50cbfe,0xcbcbc024,0xf84bdc24,0x116702c5,0x2d6127d3,0x2b5b30dc,0x240f2677,
0x18fb20a0,0x24ca1a9f,0x4f653cc0,0x41cb4bad,0x5d4a4c6d,0x50a861e9,0x37543d77,0x110e2ac1,
0x152d047c,0x20fb27b3,0xfbff0e5e,0xe0dbf390,0xa6d4bbcd,0xa911a405,0xb858b109,0xbe30bf04,
0xb988c035,0x9cb2ab27,0x96c5958b,0xbdeba69d,0xdd77cec4,0xf702e607,0x0ab20256,0x2c4d1632,
0x46433df5,0x53ed4692,0x4c4b5690,0x3df53c75,0x4b944548,0x54e756fe,0x3e0c4681,0x280c33b3,
0x23452400,0x083714ef,0x07930af7,0x04a30565,0xeb51fad6,0xd97cde70,0xd246d2d9,0xd354cce9,
0xdceadc22,0xcb65d743,0xc3e9c397,0xccc6c4d2,0xef84deea,0xe7f4f2e3,0xd610d7e5,0xd728ded1,
0xcefacdc1,0xe820dc15,0xf46cecaf,0x1aac04af,0x1b2820e8,0x24931f19,0x363b2eea,0x275f2c8d,
0x34352bc7,0x41203baa,0x442b463d,0x4e97491e,0x3d744977,0x3a183580,0x1f4a328a,0x108c14ed,
0xf0a7055a,0xeb5bea1b,0xd2dce595,0xa58cb79e,0xa207a039,0xaca4a6af,0xacc1abbf,0xbe40b236,
0xcbe1cc7f,0xc531c4b7,0xc8f9c807,0xd3cace23,0xf3a5e044,0x16a0061c,0x4cb3326d,0x45384e67,
0x54d04b49,0x47314f13,0x40cb4176,0x40154410,0x27e930de,0x38382ae8,0x3f344294,0x2883356d,
0x0c221c8f,0xed29f960,0xe20ce954,0xe488dcea,0xe888e7b5,0xd164e0ce,0xb9b4c228,0xce4ebf72,
0xe571d76d,0xed4df1f5,0xce6cdc2b,0xdc03d3df,0xe906e5bc,0xe5cfead2,0xcc97d669,0xdc7dce63,
0xfcbaedd7,0x080002c6,0x1f1c1582,0x0fd7192b,0x23f712b7,0x377f33d4,0x31013322,0x4af73cac,
0x3d104a01,0x47913bf6,0x47754bff,0x30984204,0x119e1993,0x07590cb8,0x08700777,0xf7bf0492,
0xd4a3e4d2,0xc7cecd00,0xb541bd13,0xb7fcb39b,0xa91fb346,0xadcca73a,0xc3b6b815,0xd998cc11,
0xdc40de8e,0xd8cedbfd,0xe06bd98a,0xfba5ef80,0x15db0768,0x3c052973,0x4ab0456e,0x62ef57c4,
0x4f375cae,0x3cb3453c,0x3f9d3722,0x32fc3fcb,0x1ab525ac,0x05330df9,0x0f4208cf,0x0f7514fd,
0xf5a80474,0xe879eb08,0xd86ce2d4,0xd442d332,0xd8eed47e,0xe3f4dfb8,0xe184e7ab,0xcdeed7e1,
0xce4ecbcf,0xe3c6d579,0xea00eb3d,0xdc34e195,0xdc8cdae0,0xee27e733,0xe5daebb2,0xebc0e330,
0x0787f802,0x298318b1,0x365331e8,0x39443988,0x262f314a,0x18641b15,0x33a62212,0x547148c5,
0x51c35433,0x34724abf,0x0c961b41,0x01f50611,0x07d30660,0x0068017b,0xf06efe32,0xdf89e428,
0xd4b4dd64,0xc04fc699,0xa856b55d,0x9fa7a0fd,0xb6dca861,0xcd8bc393,0xd0ccd3d0,0xd3c7cf43,
0xf571e246,0x09e70107,0x1b0614af,0x28421d76,0x394c34d1,0x326d32e0,0x43a13bb1,0x48ec46bd,
0x5234502a,0x31c7447a,0x1810243a,0x12a2120d,0x0f4e13d2,0x0ace0bbd,0x0370077a,0xf3b5fe97,
0xe75dede0,0xd6faddb1,0xe298dbe2,0xe49fe5a4,0xd830dfa0,0xd3ccd3f4,0xd28ed239,0xd29bd5b2,
0xd25dcf35,0xe48ddaf3,0x0096f46d,0xef40fdf9,0xe667e5b7,0xe8b0e6fb,0x0806f478,0x20491a21,
0x17e91d4e,0x1c4613c9,0x25942709,0x2b9725fa,0x34942fd2,0x338334ed,0x3bdd384a,0x3ccb39a3,
0x39313d65,0x2917344b,0x0b5219b3,0xee91fbb0,0xe780e8e3,0xd837dfac,0xda21d7ad,0xc3ddd376,
0xbb54b9dc,0xbea6bf22,0xc0f4bdcf,0xb41abd3c,0xbc8ab395,0xe1a9cd24,0xf2c7ed68,0x07b1fa6c,
0x16971272,0x1f9c1a66,0x1e961ebd,0x2341232c,0x34ad26e4,0x495141a9,0x432b49bd,0x2e3f3a18,
0x30e129af,0x2e2b34ba,0x20a52414,0x190f1e6b,0xfeff0ca5,0xeccaf9a3,0xce78da18,0xdb19cee3,
0xe260e2a1,0xeb8ce45b,0xe9abed09,0xdee9e38c,0xd54bdab3,0xce85d249,0xd3a6d031,0xe43adb17,
0xf74aeb81,0xf788fcba,0xe8c5ee92,0xf2b5ebac,0x01fcf8cb,0xfc2702a7,0x0951004a,0x1b6111b6,
0x2a8f25fb,0x26ef2b1f,0x2d20265b,0x3c2c3492,0x508046ff,0x425a501a,0x1fd02e4b,0x15a41956,
0x109812c0,0x036c0b94,0xf826fed7,0xdd74eb6e,0xc1eece9d,0xca5fc19c,0xdaced49d,0xdcb9de22,
0xc275d187,0xbb29b94b,0xc21fbec4,0xcf2ac65e,0xd61bd546,0xe747daee,0x0b00f851,0x1ec81883,
0x23a61f96,0x2b0d291a,0x364e2e2b,0x3ce03a4e,0x47744428,0x38244383,0x25fc2b12,0x1efa22ca,
0x282d227f,0x1ba02434,0x10211925,0xf71200e0,0xe01aee72,0xcdced15e,0xcfa7cf10,0xd901d200,
0xed86e2b1,0xfc5ef82b,0xf690fa8d,0xe370ed5f,0xd8e3dceb,0xcd47d44d,0xcf36c8bc,0xde51d9e0,
0xeac4e28f,0xfda9f1d0,0x0f330af0,0x091907e4,0x12911214,0x17291077,0x18281c7d,0x1c34172d,
0x33b62440,0x44b443b1,0x2318339c,0x23be206c,0x2f1d28e6,0x2ea030fa,0x24682c5b,0x01561436,
0xef77f566,0xec5cecf6,0xe8a7eca9,0xdcb0e10b,0xd9bbdbc1,0xc92dd25d,0xb80fbe7e,0xc384bbad,
0xccb5c9e2,0xc265c741,0xd26ec67c,0xee88e318,0xf9c1f2e9,0x161406dc,0x29eb2356,0x26ae2902,
0x2bdf26ae,0x367e3427,0x41c13b57,0x3dde4172,0x27203534,0x175d1a9c,0x1ed91ca0,0x1c901cd4,
0x0e161a10,0xf9e901ba,0xf708f54d,0xfca4fc1e,0xeab4f52e,0xd1c9dff6,0xc33cc406,0xde12ce31,
0xf53cebd2,0xf0a8f425,0xe02feb63,0xd6d9d66b,0xdd7ddc99,0xdfc5dc5f,0xe8ede71d,0xf136e75a,
0x0870000e,0x13840d02,0x1b491af8,0x0f6b15da,0x0d160cd6,0x17bf1244,0x169b1634,0x1a141814,
0x27fd2132,0x34ed2cb2,0x47144120,0x2f453e8a,0x1acb2305,0x0e2a1356,0x0b1f0beb,0x023b0a0e,
0xdb17f0f9,0xc9d6cc05,0xca00ca68,0xd1b3cd38,0xd32dd381,0xcfa2d390,0xc3bfc7d9,0xcbcdc7b8,
0xd261cd61,0xe365dafb,0xef5fe9a7,0x0eedfd0a,0x280c1ef7,0x1ea52580,0x18951a5b,0x27891c48,
0x36c432b9,0x30d53522,0x319c2f88,0x346933c0,0x27672f8f,0x1caf2368,0x09b80fe9,0x0e850ceb,
0x05a30a9a,0xf48efeda,0xd811e68e,0xcf1dcfdf,0xd6c9d292,0xdf40da38,0xe550e2ff,0xe543e629,
0xe26fe2af,0xedeae83f,0xf33ceef7,0xfa90fa11,0xe9c6f30b,0xe7c4e5ed,0xee36ea0c,0xfb28f63e,
0xff81fbc9,0x0a2d045b,0x18ea115a,0x24e520c2,0x1d4721e6,0x1adb1b6a,0x2a621fd9,0x36843451,
0x2a4a309c,0x2b3d2991,0x219d279c,0x16dc1c8b,0x0a301003,0xfcee054e,0xeca0f382,0xe181e590,
0xdd74e16f,0xc7f0d487,0xc49ec12a,0xd4cbccc2,0xdb17d96f,0xe06ade1b,0xd52cdced,0xc9d2cc0e,
0xdac7cffa,0xfc8beacf,0x14130a6d,0x18b21861,0x145c1579,0x2a0d1d9a,0x368d3163,0x3ad63a70,
0x38dd39b5,0x35e937ed,0x2e363237,0x20bd29f2,0x0cdf15e6,0x01a80653,0xf826fe0a,0xe5c3ed8d,
0xe7abe4da,0xe34ce713,0xded2e029,0xe817e1c7,0xef77ec13,0xed20f1c8,0xe008e571,0xe3dadfac,
0xe51ee609,0xe3f9e3a4,0xf03ae936,0xed69efd5,0xf903f1dd,0xfeb6fe32,0x015dfdb5,0x075305fb,
0x0ead09ea,0x12a91225,0x14061207,0x203d197d,0x33d22969,0x30ee3758,0x29302a13,0x21f92a31,
0x0fd115dd,0x08a40c9c,0x0dd807f1,0x107f1372,0x0dd80cd3,0xf8cd07db,0xe720ec13,0xd671e2e1,
0xc3dec87e,0xcde2c83f,0xccdbcebc,0xcd7dcbfe,0xc8b5cd24,0xcdc1c788,0xeab9da0d,0x035ffa2d,
0x0162046c,0x01c2ffd9,0x1c9a0b7d,0x359c2cbd,0x38cf381c,0x365e38cf,0x2ed7328a,0x2415291a,
0x21ad22e6,0x1e7e203d,0x1bae1d2f,0x10761825,0x026a07be,0xf9b5fd5b,0xef12f56d,0xe5f3ea3a,
0xdc6ee051,0xe660de9b,0xf1e9eee5,0xe5c3edcf,0xd3eadb45,0xdc9ed419,0xef1ce862,0xeccbef5f,
0xecbbeb29,0xf174ef0f,0xf709f353,0x08dfffc4,0x0d1c0d5f,0x09570ad5,0x07dc0927,0x04aa0472,
0x02e00502,0x0ce50472,0x173a14f9,0x21a319e0,0x39f92d17,0x429f443b,0x228e34fb,0x0a5e1247,
0x092d0926,0x0d1c0a24,0x01db0a9d,0xf908faf8,0xf951f9f8,0xf37ef6ee,0xd69fe9f0,0xbf60c61b,
0xb95cbc30,0xbad2b8f7,0xcdc2c10d,0xe3d4db37,0xec1be79a,0xfc9ef483,0x02c80107,0x0aa6057c,
0x184d12a5,0x10b315a1,0x14a20f6c,0x28f71e8d,0x32cb307a,0x347d32a8,0x36bc3774,0x284530a8,
0x1ebb21cb,0x115c1984,0x0a270c81,0xffe804e9,0xf26bfb7c,0xdd25e61f,0xd951d94a,0xdf5adb7a,
0xe43be28c,0xe1d0e3c6,0xe946e341,0xf071ee33,0xeefdf04e,0xed16ee3b,0xeb5deac0,0xf94cf08a,
0xfdb8ff50,0xf971f89b,0x03530013,0xfb43ffcf,0x01a2fc31,0x054004e6,0x0b970674,0x0c3f0f9a,
0x09880842,0x1c031091,0x3384294f,0x35a2385b,0x2f1d3130,0x25c02b66,0x1e8d2258,0x06f41555,
0xec47f767,0xeafae971,0xf518ef46,0xf38cf75a,0xe9cbede6,0xe239e584,0xdeeae1d2,0xcb4fd6fd,
0xbd3cc068,0xcc5fc254,0xda10d4f3,0xe65bdf57,0xf758ef95,0x05acfd42,0x150e0f75,0x148815a1,
0x19fa1551,0x2c84222a,0x321c337b,0x2dbd2e4a,0x33802ff5,0x30da34f6,0x220628c2,0x1ac91e4c,
0x0a1e1406,0xf3c7fea5,0xea50ed51,0xe5fce807,0xe393e2ff,0xe990e7bc,0xe126e65b,0xe405df2f,
0xf3d9ec9a,0xf58ff6eb,0xe84ef022,0xe45ae2c4,0xf353ebc6,0xfb0ef8f1,0xf4bdf8bb,0xedc2efd2,
0xfab5f238,0x07f40309,0xfdfb04b1,0x0328fd4f,0x0ca208f0,0x10c50ec5,0x13f51365,0x175f1447,
0x1a5e1a7d,0x21b81c2a,0x295d270a,0x26332939,0x17ed2037,0x04920d54,0x06b70317,0x0fdb0c6f,
0x023b0be2,0xef2ff7ac,0xe842ea8c,0xe39ee529,0xdef3e32b,0xcc6cd6bb,0xc0b1c2ef,0xce68c63e,
0xd69dd560,0xcf10d1fd,0xe491d530,0x02eaf42b,0x1ba1125a,0x1fae1f1b,0x1f0d1f74,0x231b1f99,
0x2d282883,0x2dfc2ed0,0x30ab2e3c,0x281c306a,0x13c11c8f,0x0f0a0eb0,0x161213a5,0x0b6712da,
0xfafb0207,0xf519f752,0xe722efce,0xd9c1df23,0xdba3d8c7,0xeca6e2aa,0xf5d8f3d0,0xedddf3ce,
0xe53de6dc,0xe7cae7af,0xe967e625,0xf5dbf0da,0xfb80f847,0x0196feb5,0x04e10397,0x03c50524,
0xfb23ffc5,0x0181fb09,0x0e0a0a82,0x0095088c,0x01c2fe8e,0x083105bd,0x126c0ba5,0x25411c16,
0x28d229a1,0x25b82764,0x1c9b2133,0x1b471b0f,0x19ba1b35,0x11f816e0,0xff540a0e,0xeeebf568,
0xefc9edd4,0xe71fee9c,0xd170dc92,0xc39ec8fd,0xc999c34c,0xda8ad2ce,0xda60dd6b,0xda24d75f,
0xeb64e0e6,0x00fbf753,0x024c04db,0x0449003d,0x10f90aa7,0x1ff7186c,0x2dc326df,0x37fe3417,
0x340e3846,0x25322da3,0x18a81d22,0x17fc1724,0x1320181f,0x05480b5c,0xff8e0216,0xfde6fd55,
0xf814fe57,0xe232ecd1,0xdbc8dc62,0xdc56dcde,0xd8d0da0a,0xe2ccdbf3,0xef18e936,0xfd49f5fc,
0xff100076,0xfd52fbc6,0x01660218,0xf7ccfae5,0xfaecf988,0xfc31faee,0xfddefddd,0xfeb5fd29,
0xfcdbff97,0xf6fdf944,0xfb08f739,0x1027044e,0x1a1317ed,0x1a0919c0,0x267e1e7e,0x301d2e1d,
0x232a2bdf,0x14791afd,0x111010ec,0x0ab50fc8,0x018904c6,0x001f00fe,0xf727fc1e,0xef0bf3b5,
0xdbb1e605,0xd65ed63e,0xd5dbd704,0xd1f7d3e4,0xcd72d03d,0xd0e4cc73,0xe63cd9bb,0xfe42f4ad,
0x027f015f,0x01cb0291,0x03760195,0x0fea08dc,0x2121175d,0x35c72c5c,0x3bb23acc,0x38f33ac5,
0x30933505,0x23b92b79,0x0ac3188d,0xf25afd0c,0xef34ecf1,0xfe07f794,0xf6bdfc92,0xe99bf0a8,
0xe393e346,0xeb3fe818,0xed63ec42,0xea0ced84,0xe374e5a2,0xe6ffe3b4,0xf94dee77,0x08e0030a,
0x068909b0,0xff5602d5,0xf7eafb40,0xf662f6a7,0xf26bf4ec,0xf4dcf20d,0xff90f9e6,0x06e5041d,
0x0b7b09d2,0x0c020b93,0x08000bd4,0x08d00478,0x1fa21495,0x266c25d2,0x19a12118,0x158b157d,
0x1ba617a4,0x1dde1f28,0x0c28165b,0xfc73028f,0xfe23fc27,0xf8a7fd03,0xef61f3c9,0xdd39e7e6,
0xcb6bd30d,0xc957c82a,0xd0b3cd30,0xd22dd1de,0xd788d381,0xe748de68,0xfe35f27c,0x0718055f,
0x0e730919,0x17d01455,0x21901be0,0x2a91262f,0x2c402d04,0x299529ec,0x2ce82b1f,0x2c312daa,
0x1b7026c3,0xfcb60ba8,0xef8af2e7,0xf587f1ea,0xf468f712,0xe87fed88,0xeec9ea30,0xf47af1bc,
0xf712f79c,0xe818f073,0xe246e2f7,0xe8dee4f9,0xee6beb8a,0xf8d1f379,0xfd18fc7c,0xfb6cfb49,
0x071e003a,0x10580cd9,0x098b101a,0xf13cfd69,0xf1a8ed29,0xf6c9f630,0xfb0ef801,0xff51fcf7,
0x07d40395,0x0f150b8d,0x1869131c,0x19441b9a,0x1af11708,0x2266205c,0x27ba249f,0x1b702510,
0x0ec812d6,0x08e20b7d,0x08fa08f6,0xfefb05af,0xe813f480,0xd4e2dcca,0xd36ed1c3,0xd920d7bb,
0xcefbd4c5,0xca49cb19,0xd8b2cf3f,0xe8abe120,0xf995f160,0x0521ffc3,0x0ea00a7c,0x0c3a0e75,
0x14500d53,0x25f51e47,0x2b31295d,0x28172b40,0x251c24ca,0x299f2859,0x1e892676,0x08b01300,
0x070a0589,0x0107060a,0xf881fbeb,0xeb88f343,0xdf40e3cf,0xe146ded7,0xe64ee3e8,0xef3aea63,
0xf260f1a6,0xf3b9f2c5,0xf561f4ec,0xf88ff658,0xffecfc2f,0x010401c6,0x03cd0113,0x05bb0678,
0xfc79014d,0xf95df9e5,0xf790f8a5,0xf808f76d,0xf737f823,0xfaa1f764,0xfb23fc80,0xff10fb4d,
0x0eb40572,0x23f71a3b,0x29c42965,0x236326fc,0x1f9920e0,0x1b1e1e6c,0x0df1145c,0x0eab0c9c,
0x0a890e96,0xfbe903f7,0xeb29f319,0xe6cce6d6,0xe76ae801,0xdabee334,0xc84ed028,0xcbdbc6e3,
0xdd74d454,0xe6eae418,0xe586e5ed,0xf359e9e7,0x060afdd6,0x0f910b65,0x16671389,0x1b8c18bb,
0x21a71ec6,0x2add24e3,0x37783244,0x316437a5,0x1bf126c3,0x0c0d1301,0x01c006f4,0xfac1fd35,
0xf3eef830,0xf046f0fa,0xebd6eefd,0xe85be955,0xe486e6e5,0xe6e3e455,0xee61ea2e,0xf674f314,
0xfeb0f98a,0x07ac0454,0x04c406f4,0xfea90288,0xf580f951,0xfba7f698,0x0001004b,0xf6f7fb28,
0xf50df5ed,0xf441f356,0x0084f9c1,0x05e60513,0x0004031b,0xfbe9fe5c,0xffd9fb2f,0x106d0882,
0x1adc1664,0x1e9e1d40,0x24262132,0x252b25c9,0x212f23bf,0x11d01b25,0x05bb0995,0x022d04bb,
0xf566fbd4,0xf3aef32c,0xeacff09e,0xddb8e4aa,0xd142d60c,0xd107d0e3,0xcc4ecea5,0xce7ccc11,
0xdee7d478,0xfa53ec91,0x08c903e6,0x0cdc0b00,0x12f20f15,0x1c69183e,0x20f61e4e,0x2a4d25c9,
0x2e862d1f,0x27df2cc4,0x1d6322bd,0x124e179a,0x07300cf7,0x007e02c0,0xf5c9fcf7,0xeb54ee95,
0xecb9eb4c,0xf2e3f01e,0xeed7f1c2,0xebf5ed08,0xec41eb00,0xf2fff054,0xf11cf25e,0xf798f277,
0x041bfebb,0x07be06d3,0x0724079c,0x0553069d,0xfe8702e0,0xef22f739,0xecacea64,0xfdb0f561,
0xfc5eff3d,0xfb53fabc,0xfa22fafe,0xfd1efa76,0x0681018f,0x0b1e09d1,0x0c440bba,0x103f0d4f,
0x1c7c159b,0x291d2393,0x2bb62c6e,0x22fd2731,0x1be7202e,0x0bc41542,0xf3a20038,0xe2f0e88f,
0xe649e3fa,0xe108e517,0xd72edbfa,0xd5bbd439,0xda85d9c8,0xd1cbd5e6,0xd948d350,0xebcbe19e,
0xfbcff577,0x06550044,0x183f0ee4,0x20441e9b,0x1c4c1ec0,0x1be51a40,0x27972221,0x254a27ba,
0x221e23cc,0x18a51deb,0x11301450,0x086d0de6,0xf8130076,0xf083f2b9,0xf244f0bf,0xf0ccf30b,
0xe884ec76,0xe51be5ba,0xea19e726,0xf136ed0b,0xfbb4f6eb,0xfea0fda7,0x035500ef,0x03340386,
0x05fb0435,0x04b5062c,0x01fd02ae,0x01c6024c,0xf7d1fe1a,0xedc6f1c7,0xe850eaa8,0xed8fe895,
0xfe2ff670,0xff7400cd,0xfed7fe1d,0x078601c4,0x16860f30,0x1b771ab9,0x184a19b6,0x1ab118fa,
0x1ec71c8b,0x226420e2,0x208d22b8,0x12ae1b29,0x017d08d7,0xfc30fe5c,0xeed0f737,0xda7fe509,
0xca49d070,0xd3b3cbe0,0xe184dc74,0xdef0e1ba,0xdabfdbf3,0xe2aedcab,0xf232eac2,0xfeb5f8b9,
0x093f0497,0x0def0bab,0x1c4513c5,0x286a233d,0x2d152c17,0x26fd2b2f,0x1d1821c1,0x1c211b73,
0x16141b16,0x06ef0ece,0xf7acfee0,0xf1d4f37b,0xf13af15a,0xf05af131,0xeb7bee16,0xea08e9fc,
0xee9febd2,0xf343f17d,0xf42cf3b0,0xfba1f6f9,0x04a10034,0x0ce208ff,0x0b5a0e08,0x03860737,
0xfd280050,0xf694f9f1,0xf43cf4bb,0xf0c3f2da,0xf437f0d9,0xf86ff7f5,0xf5eef6ee,0xf460f551,
0xf574f367,0x05affc21,0x16580f3f,0x175f18e1,0x159e1598,0x1a211732,0x247b1f0f,0x22d1265b,
0x16de1cd8,0x0fcb128a,0x0cf10e76,0x09b70b3d,0x00f40713,0xe488f4b7,0xd177d758,0xd834d2d2,
0xd95fdbaa,0xcc41d2bb,0xcd23c989,0xe3a3d6e3,0xf8b8ef61,0x01baff04,0x03860272,0x0bdc069c,
0x185d11fb,0x23681ee8,0x237f245a,0x22ff22f8,0x22c022dd,0x22a222e1,0x1d6a2147,0x06c714cb,
0xf1a1f901,0xf168f0b0,0xf43af20f,0xf808f758,0xf1fef56e,0xec41eefa,0xec96ead8,0xf57df0cb,
0xf8c2f889,0xf76df788,0xfdd5f9bb,0x0597024d,0x067706b5,0x07cc067a,0x09850936,0x00ac06ec,
0xf47af96c,0xef6bf1b6,0xeb5becd1,0xef2eec4a,0xf5f6f282,0xfc4ef9d6,0xfa0afbe5,0xfb6df9ac,
0x0189fe7b,0x09130490,0x1a5510c7,0x25ec222a,0x24a8264f,0x21082288,0x1cb61f72,0x172019ae,
0x100613f8,0x08520bdc,0xff8704b5,0xee8cf808,0xdc86e483,0xd9f2d8dc,0xdd07dcab,0xd1cbd8f8,
0xc9aacadf,0xdb89d05b,0xed68e641,0xf420f0ff,0x0376fa4b,0x15e70dd1,0x1a3319d4,0x1bf51a84,
0x1c821ce4,0x19d31b3c,0x1b1a1977,0x20241e1c,0x1e322029,0x14b01aa2,0x04d30cc4,0xfa3bfef3,
0xf1c2f5b0,0xec69eeea,0xe8f0ea2b,0xedb9ea1a,0xf3b0f136,0xf9a0f621,0xfca5fca1,0xf6d7f9da,
0xf806f5a5,0x0355fdcf,0x07f90674,0x0ac8099e,0x0a1a0b13,0x034f073a,0xf9ecff4b,0xf016f393,
0xf16df098,0xec0aef18,0xede6ebd3,0xf098efa2,0xf4acf204,0xfc4ef871,0x04cb000e,0x0f0c0a4e,
0x14071234,0x17df1592,0x1cdd1a82,0x252b1fa2,0x2e692c04,0x1e3628f9,0x0a391256,0x077e0755,
0x033406f5,0xf41ffc1d,0xe75ced6d,0xddc0e1af,0xddbddd08,0xdae0dd67,0xd2add676,0xd616d23a,
0xe46fdd21,0xeec0e9d8,0xf9a0f42f,0x03b8fe94,0x0f55093f,0x1d5515dd,0x2cb225f5,0x268d2d09,
0x17da1de7,0x16db15cf,0x1a411944,0x12811826,0x025e0a9e,0xfb3cfc83,0x01ebfe8d,0xfc64018f,
0xeb26f463,0xe048e388,0xe995e299,0xf93bf29a,0xf9c8fb16,0xfd6cf9d1,0x05650258,0x05dc05c8,
0x05c1064a,0x02a203b5,0x050f03d1,0x019903c5,0xfee70044,0xf93bfc7d,0xefeef489,0xedecede6,
0xeb30ece0,0xecb9eacf,0xf3caf012,0xf7eff646,0xff63fab3,0x08360417,0x0f270bc3,0x17141272,
0x23391d30,0x27fd270f,0x1f86256f,0x142018d1,0x14cc12d3,0x19d918b5,0x0cb215d4,0xf50800ea,
0xe891ec66,0xe90be863,0xe221e7c7,0xd0b7d926,0xcf5acd58,0xdb5cd4d9,0xe5c4e13a,0xea43e86c,
0xf121ecb5,0x0066f82f,0x0df007e2,0x17ed1332,0x1e6b1bcb,0x1efa1f43,0x1e791e79,0x21131f4a,
0x239a233f,0x13801ed3,0xfb3005a3,0xf88df72b,0xff74fc31,0xfa92ff38,0xeefdf3d3,0xf09eee23,
0xf66af3f0,0xf5abf718,0xf18af344,0xf18cf0c2,0xfcb6f58b,0x093d0400,0x0e760c62,0x0e620f3f,
0x08940bfd,0xff130405,0xf69efa4c,0xf449f4c1,0xf443f47a,0xf1dbf337,0xeffaf0cf,0xedbfeea1,
0xf32eef5e,0xf72cf667,0xf7a1f6cc,0xfe1dfa15,0x081502df,0x11640cfd,0x1c391619,0x29b023ed,
0x27852a67,0x22112468,0x1d3b1fd9,0x12e519b3,0x00d00972,0xf823faee,0xf928f811,0xf3bdf863,
0xe346ec34,0xd360da50,0xd2add099,0xdceed7c0,0xe12de011,0xe2a0e166,0xee3ce687,0x0026f7f3,
0x086c0558,0x0d840ad1,0x17431190,0x1f991cbf,0x1eb01fa5,0x1e9f1e29,0x1f4d1f78,0x18031d03,
0x0a361117,0x02700576,0xfbcefffe,0xefbcf5e4,0xec9bec1b,0xf650f0f1,0xf733f8d3,0xf1a9f392,
0xfa02f456,0x00ddfee7,0xfbfcff75,0xfa63f95f,0x02aafe60,0x099b066b,0x0bd70b7d,0x0a550b6d,
0x049207cc,0xfcc300df,0xf2c9f7b0,0xe618eca3,0xe296e1bb,0xeea4e7e6,0xf7adf463,0xf71bf840,
0xf7dff67f,0xff69fb51,0x05730324,0x095406ef,0x15870e6a,0x20491c33,0x236d2224,0x251c24b8,
0x238b24b8,0x1b3520c9,0x0b60139e,0xfe8e03e6,0xfa49fc15,0xedb8f5b0,0xdf4ee4fa,0xe18dde71,
0xe434e478,0xdb87e084,0xd6f4d7ba,0xddd6d960,0xe95ee321,0xf7ddf0a9,0x04fefe6c,0x10600b23,
0x16bf145c,0x185717d2,0x17691830,0x1b6a1823,0x21d71fe0,0x1ac01ffb,0x0d8313f0,0x05e50913,
0xffc502fc,0xf5edfb37,0xef8cf119,0xf2ecf0e8,0xf145f302,0xf1edf012,0xfb42f658,0x0087ff05,
0xfce8ffb5,0xfc97fb18,0x065c00cb,0x0e210b73,0x08700ca8,0xff990340,0xff81fe31,0x01fe015b,
0xfc2e001a,0xf1c6f700,0xe77cec56,0xe722e586,0xed0dea7d,0xf0c2eecc,0xf80df3d3,0x0019fc9b,
0x04c8025a,0x0c620867,0x11040f27,0x148b12b1,0x197d16b9,0x24651e68,0x27c0282a,0x1fe2246e,
0x14641a95,0x085a0dde,0xfebc03b5,0xf285f8d0,0xe4a9ebb2,0xda29de1f,0xda23d929,0xddfedbee,
0xe391e0ab,0xe7d3e611,0xe9bde91b,0xed8feab0,0xf938f2c8,0x0680ffdd,0x11330c9c,0x14fd13a4,
0x1a16170d,0x1df21ca3,0x1e8d1e9e,0x18831caf,0x0e2812e5,0x0bf00be8,0x08430bb6,0xf92f0178,
0xee6ef220,0xf176eeb0,0xf27cf31a,0xf14af0e0,0xf9f7f4d0,0xfe53fd98,0xfda9fd83,0x0195ff42,
0x050f03a1,0x05c605af,0x074a0611,0x08e40899,0x06370849,0xffa90305,0xf823fc4c,0xf0dcf3a5,
0xefa2f02b,0xe9f3ed48,0xeb83e8bc,0xf393f025,0xf399f4a5,0xf169f1d4,0xfac5f45a,0x0c22030e,
0x18691412,0x181618d3,0x1ab818cc,0x1f2c1cf9,0x217920f9,0x1b9a1fb7,0x11481655,0x0d210df7,
0x0ada0d16,0xfdf90576,0xed1df594,0xe096e5d1,0xdd0fdded,0xdededdbf,0xde1edf0e,0xdcf9dce2,
0xe32aded2,0xf2e8e9ee,0x0385fc46,0x05a5069c,0x03d103d5,0x0a6f062c,0x15620fa3,0x1dd91a8a,
0x1a841d97,0x17021788,0x188d1810,0x14181777,0x06e80e44,0xf8a6ff4a,0xf342f480,0xf4c6f3fb,
0xf2acf47a,0xee69eff4,0xf5eaf071,0x012ffc97,0xffa301df,0xfdb0fd44,0x043500e8,0x05e70594,
0x0a49073a,0x0df40d58,0x05560ad7,0xfd5e0050,0xfb49fbf9,0xf7aafa3a,0xececf2d0,0xe4e7e7ef,
0xe832e4cf,0xf424ee51,0xf774f737,0xf600f64f,0xfe67f8ad,0x081c0492,0x07130838,0x09510727,
0x139e0d58,0x23f11bb0,0x2c242a46,0x217f28db,0x10bf1883,0x0adb0c2b,0x0bff0ba2,0x04470a0b,
0xf226fb79,0xe793eb3a,0xe600e64e,0xe306e52d,0xdc5edfc4,0xd9c1d9f5,0xe05adc13,0xed4ae636,
0xf98bf46e,0xfda1fc11,0x05900082,0x14250c83,0x1ba619eb,0x140018e6,0x0e150fa0,0x112a0f2a,
0x15931313,0x15ea173a,0x0cc11165,0x074a09bf,0xfd6a034a,0xf1cff6f9,0xeb67eddf,0xec7aead3,
0xf62df07a,0x0086fc39,0x01bb0250,0xfedafff5,0x0478004d,0x0b2008f2,0x068a09f3,0x008f02e3,
0x00ccfff5,0x05350317,0x049905d7,0xfbb70151,0xee7cf4b6,0xe897ea64,0xec11e938,0xf02eef06,
0xef4ceff4,0xf0c7ef34,0xfb83f55a,0x04e900f4,0x076f0709,0x09940787,0x12fe0e0e,0x1bbf17aa,
0x20241ee0,0x1fb6200d,0x1ee01f72,0x19661d1d,0x0c7c135b,0x0066063b,0xf4c3fa6e,0xeb58efc6,
0xe6a5e80d,0xe774e6fb,0xe585e732,0xdf32e26c,0xdfd2ddd5,0xe918e46d,0xeff8ecb2,0xf763f3aa,
0x0159fb9c,0x0e53085c,0x15541253,0x183e179a,0x15f91708,0x14d415c4,0x0e21120d,0x0a0e0b6d,
0x07e20930,0x064306d1,0x05f70667,0x01380435,0xf9b2fd80,0xf335f664,0xeef3f072,0xf1b6ef67,
0xf7ccf4c6,0xfeddfb27,0x046c021a,0x08b7066c,0x0ad70a8f,0x092f0a0c,0x07550886,0x020f04ff,
0xff320002,0xfc77fe54,0xf5c2f960,0xedecf1a3,0xeaa2eb9a,0xea9bea77,0xeb12eab4,0xf034ec69,
0xfb8ef5c4,0x03bc0039,0x05db057e,0x078b062c,0x0e530a49,0x188313a4,0x1d4c1baa,0x1f321e73,
0x1d101f04,0x15aa198e,0x0f481231,0x097b0c66,0x00fd0629,0xf15df972,0xe690eac0,0xe5dce4e7,
0xe6d9e741,0xe2f1e4ba,0xe37fe284,0xea03e605,0xf1faee8a,0xf472f3be,0xf69ef540,0xfe4ef965,
0x0dfd0594,0x1a6f1548,0x1a831c30,0x127b1670,0x11241098,0x12f2125b,0x0fc5124d,0x03950a83,
0xfad4fdaa,0xfcf4fb37,0xfeb2fe7a,0xfa8dfd1d,0xf5dbf7fc,0xf577f4d0,0xf9ccf7cc,0xf910fa05,
0xfb8ef91a,0x0448ffcb,0x0bd70882,0x0e650e03,0x0a940d10,0x05210799,0x012f0331,0xfbbafed5,
0xf3a9f816,0xeca6ef90,0xebb2eb83,0xee33ecc7,0xf054ef96,0xf04ff058,0xf571f1d4,0xff79fa90,
0x03e302b0,0x054d0438,0x09f90735,0x12190dbb,0x19e81656,0x1da31c70,0x1ad31cd1,0x18121911,
0x16fd17d3,0x0eea1424,0x004b07db,0xf3a9f91f,0xf118f125,0xf1acf220,0xe8e4ee56,0xdf80e35a,
0xe096de62,0xe781e45b,0xec4be9b1,0xf215ef1c,0xf8cdf513,0x009cfcc0,0x07f4043f,0x0ef60bc6,
0x121c10b5,0x16bd1442,0x18321832,0x146e170a,0x0bab106c,0x04c207ac,0xff870251,0xfc00fd33,
0xfb11fbb0,0xf764f95f,0xf76bf65e,0xfe59fa77,0x01f50129,0xfe4e00ba,0xfb37fbd8,0xff38fc97,
0x01b9011b,0x019f017f,0x050d02f3,0x0a1707d0,0x09fb0b1a,0x034f071e,0xfc27ff8b,0xf40ef863,
0xeccbefc3,0xe94aeabe,0xe8efe895,0xebdee9f4,0xf52eef7d,0x00fefba3,0x03aa03bc,0x01b50222,
0x07d403c5,0x0ee60c13,0x11201030,0x161212fe,0x1d3919ea,0x1e341ec4,0x19df1c66,0x128a16dc,
0x06470cf1,0xfb2c003e,0xf3aef72f,0xed79f093,0xe78eea52,0xe4aae595,0xe75be534,0xebebea34,
0xea4beb92,0xeb59e9a1,0xf526ef7d,0xff63facc,0x058e02c2,0x0b740855,0x11090e96,0x11d6121d,
0x108b1141,0x0cfa0f28,0x0b8a0b5e,0x0df20cf4,0x0c200db8,0x024c0831,0xf9bffce7,0xf92cf8f5,
0xfb24fa11,0xf9a7fb24,0xf6a1f7d2,0xf9f0f742,0x0291fe60,0x057c0519,0x032a04d3,0x000a010f,
0x04170127,0x05db0629,0x01f103da,0x00c600eb,0x023b012f,0x005d025d,0xf74ffc65,0xee16f277,
0xe7edeaad,0xe6a9e673,0xec1ce8bc,0xf45af00e,0xfcc9f878,0x0613014d,0x0dd30a32,0x13351130,
0x112912f4,0x10700fe0,0x158f12a5,0x1984181a,0x185c1974,0x13c4168d,0x0bb9100e,0x02bf072e,
0xfa78fe90,0xf1e6f64f,0xebdaee25,0xe9b1ea7d,0xe84ee8e3,0xe7b2e7b7,0xebc6e912,0xf197eee5,
0xf4dcf39a,0xf48df4f1,0xf800f510,0x03ccfd4c,0x0edf0a0e,0x13951225,0x121d1325,0x11ce11ad,
0x104c1147,0x0cea0f0e,0x05a50995,0x01e702f3,0x00fe01b5,0xff04ffef,0xfca9fe79,0xf650f977,
0xf558f4be,0xfb11f7b3,0x0078fe42,0x01950176,0x001600b2,0x04e9012d,0x0c840952,0x0a920cea,
0xff8d057e,0xf9a9fafb,0xfd09fb35,0xfcc3fda2,0xf8fffb37,0xf47af66a,0xf2e3f392,0xf086f1c2,
0xee04ef4d,0xed9aed28,0xf260ef83,0xfd03f6e6,0x091103a7,0x0e2c0c53,0x119e0fde,0x15c913ab,
0x185c1775,0x155417a4,0x0fba123b,0x0ef40ede,0x0eff0f52,0x0a760d72,0x0234066e,0xfb2ffe53,
0xf508f86a,0xec31f093,0xe75ae8f7,0xe72ce6e0,0xe859e7c4,0xeb44e96b,0xef47ed6d,0xf307f0e6,
0xfb53f676,0x058b00ba,0x0ac008c8,0x0d160c0e,0x0e4e0dd6,0x0fec0f1e,0x107f109a,0x0dab0f5f,
0x09e70bf6,0x02f60699,0xffd4008f,0xfe1eff54,0xfc39fcab,0xfe39fd05,0xfd06fe47,0xfaf3fb8f,
0xfb8efb21,0xfdcffc70,0x00caff8e,0x03aa021b,0x074c05b8,0x06ae07a3,0x033a04e6,0x01b1024d,
0xfe91008d,0xf9f7fc52,0xf5f5f782,0xf58ff5ad,0xf3b7f4a9,0xf535f401,0xf679f614,0xf6c9f6c9,
0xf34bf556,0xf22cf1c6,0xf9f0f4bf,0x04a9ffec,0x0907076f,0x0fd70bb8,0x1a7c153d,0x20bb1ee2,
0x1b341f61,0x117715f2,0x0bc30e2f,0x06870920,0x018603de,0xfcc9ff26,0xf753fa38,0xf266f478,
0xeffaf12a,0xebecee3c,0xe8b7e9e7,0xe918e86e,0xee32ead5,0xf4dcf1f5,0xf6eff627,0xfc70f8d1,
0x04c700c1,0x0b490822,0x10ea0e41,0x104611c1,0x0a3f0d06,0x097208ed,0x0b5e0aa5,0x088d0ab9,
0x023b0551,0x01fe0104,0x03f303ba,0xfe5001c0,0xf8a5fb09,0xf89df7b8,0x0002fbd8,0x021402b9,
0xfa4cfe69,0xfa65f893,0x0317fea0,0x093906fd,0x087909bc,0x02fd0607,0xfdf9001c,0xfdd4fd3b,
0xffa0ff14,0xf9a6fdd6,0xefc3f458,0xee11ed4a,0xf51bf160,0xf5bff6a5,0xf331f406,0xf630f400,
0xfde2f9af,0x04e6020d,0x04210585,0x02ea0270,0x0eb90717,0x1d1616f6,0x1ec61f7b,0x181f1bd1,
0x12c714f4,0x0d4c1088,0x039808c8,0xf8ddfe59,0xf206f468,0xf3d0f238,0xf6dbf5d7,0xf3dcf64b,
0xeec3f0cf,0xef2fee6e,0xf07ef037,0xed9def83,0xecbfec36,0xf359ef25,0xff47f8b5,0x0a8305d7,
0x0bc40c31,0x0ae40ac0,0x0f550c76,0x13e0123b,0x0e151290,0x03a3084f,0x01290170,0x03a40230,
0x054804f3,0x0116040f,0xfa4bfd3a,0xfb9cf9c4,0xfefbfe0c,0xfb30fdde,0xf782f87e,0xfe31f975,
0x07c7039b,0x0830092b,0x03ef0605,0x025802ba,0x02df028c,0x016202d1,0xfb9cfeb8,0xf62df8d8,
0xf320f42b,0xf457f35c,0xf64ff576,0xf4bef626,0xf1faf320,0xf600f2f0,0xfe3dfa57,0x024000c1,
0x033a02d2,0x055803bc,0x0bdc0830,0x10bf0f0c,0x109110fb,0x12ab10f9,0x170a1530,0x16621780,
0x0fb913c2,0x05bb0a97,0xfd52018d,0xf3d3f896,0xee96f04f,0xed9cedf1,0xed54ed83,0xef3eedd5,
0xf400f193,0xf55bf53e,0xf2b5f456,0xf12bf155,0xf42bf222,0xfc6ef792,0x06f401f5,0x0c720a5c,
0x113c0e9a,0x14b713c9,0x0f8c1329,0x07a50b28,0x055405c8,0x045d0526,0x00060280,0xfc28fdb7,
0xfbcffb7d,0x0094fd80,0x05a10408,0xff9703b1,0xf948fb58,0xfc25f9c8,0x006efeca,0xffa90050,
0x01d4ffc9,0x072404ec,0x044906db,0xff320158,0xfc24fdb7,0xf95ffa92,0xf8ddf8e1,0xf8bff8dd,
0xf7fdf881,0xf589f6d9,0xf2eef40e,0xf3d9f2a9,0xf9e8f680,0xfe05fcca,0xfd86fdd2,0x01e7feec,
0x096f05e7,0x0d900c13,0x10450ecc,0x146d1259,0x160f15ed,0x11591460,0x0cfb0e78,0x0c200ca5,
0x06aa0a24,0xfd99025f,0xf4cff8d8,0xef9bf1db,0xeb58ed8a,0xe7fee946,0xea0ce802,0xf279edea,
0xf870f632,0xf9caf984,0xfb71fa54,0xfdc7fcfa,0xfe42fdfc,0x00f4ff56,0x04380271,0x0a6f06ca,
0x11760e4d,0x12a31319,0x0ca6102e,0x080009bf,0x053b06e2,0xfffd02d1,0xfc40fd95,0xfcb4fc1c,
0xff14fdda,0xffc3ffdd,0xfdbefeb5,0xfe98fdc3,0xfe84ff07,0xfd33fd84,0xfffbfe30,0x0236018e,
0x013801e0,0x01df0127,0x056c03b3,0x012d04ee,0xf764fbd5,0xf5dff587,0xf956f7aa,0xf965fa15,
0xf4a8f77c,0xf1f8f262,0xf59bf367,0xf98df7c1,0xfd73fb53,0x01b8ff75,0x0743044e,0x0cfa0a5d,
0x10c70f22,0x1185117a,0x107c1111,0x0f710fcf,0x0fb00f85,0x0db40f4d,0x070c0ad7,0x0074035b,
0xfd13fe98,0xf8a5fb55,0xf269f599,0xed23ef8c,0xeb52ebad,0xed0bebdf,0xeef8ee01,0xf0a8efb4,
0xf6e2f2d7,0x008ffc09,0x039a0327,0x02de0303,0x04b3039c,0x04e50507,0x0649050f,0x09bc07f9,
0x0dbd0ba6,0x10b50fa9,0x0f8510c8,0x09290cdf,0x002c04b1,0xf9b8fc55,0xf82df88a,0xf981f896,
0xfc60fb04,0xfd1dfd1c,0xfe34fd29,0x013dffc2,0x042c02e8,0x03530473,0x0056014d,0x00fd0071,
0x001f00e2,0xfcfefed5,0xf9dafb4c,0xfb4ef9db,0xfda2fd1e,0xf935fc45,0xf24df55a,0xf387f193,
0xf9f0f6d2,0xfb4afb97,0xf881f9cd,0xfbb3f910,0x0336ff7e,0x085e0637,0x0c160a4b,0x0f3c0df1,
0x0ff00ff3,0x0fd80fdb,0x0f880fde,0x0d100e95,0x09700b56,0x061c07ae,0x039e04e1,0xfee901ac,
0xf6a1fafc,0xef5ff26d,0xed54edcd,0xecdeed3b,0xea80ebcd,0xec72ea58,0xf3d9f00e,0xf815f65d,
0xfc4ef9b8,0x0403ffa9,0x0b650839,0x0ca70cf1,0x08b20b04,0x062f06b7,0x07ee06f1,0x095008d7,
0x08860948,0x078d079f,0x0a3908b2,0x09fb0afb,0x024706de,0xf80dfce1,0xf506f550,0xf8dff68e,
0xfca5fb2a,0xfe11fd8c,0x000efeca,0x043301ed,0x062905d4,0x036704ff,0xffbe0195,0xfb6cfd78,
0xfa2bfa54,0xfad6fa83,0xfb35faf9,0xfc5bfbae,0xfd6ffcfa,0xfce0fd7c,0xf8b1fb28,0xf33bf5c6,
0xf2d1f20c,0xf95af587,0x008dfd8f,0x0358027c,0x07b104e4,0x0ef10b70,0x1191110e,0x103a10f2,
0x0f9a0fc5,0x0ebf0f4c,0x0d3e0df9,0x0a360c0e,0x03bf071e,0xfe8200bd,0xfaa1fca7,0xf5edf871,
0xf086f32e,0xebf9ee20,0xeb03eab9,0xef3aeccc,0xf1bcf10f,0xf18af1aa,0xf602f2b9,0x01d4fb9e,
0x08870693,0x06e0082b,0x075f0654,0x0bc10999,0x0c810ce6,0x097a0b26,0x069e07c1,0x056105da,
0x063e0572,0x07ee077a,0x04cb06de,0x022802fd,0x017801eb,0xfdc90028,0xf6abfa7b,0xf17ff34b,
0xf4b1f1ea,0xfe39f947,0x05b80288,0x06ef0738,0x0458058b,0x03e603eb,0x01f10367,0xfd3dffe9,
0xf76afa47,0xf55cf586,0xf951f6f5,0xfc5efb6d,0xfaa8fc11,0xf89ff938,0xf9f5f90a,0xfa6ffa9e,
0xf7b9f956,0xf8aff702,0x031afd0c,0x0e080944,0x11b410de,0x110e1164,0x10ec1105,0x0ed1102e,
0x0b820d40,0x083809bc,0x06920718,0x04f8060a,0xffec02c8,0xf920fc9e,0xf28df5b4,0xeeeaf03a,
0xee85ee72,0xef4feed7,0xef0aef6a,0xeeb4ee7c,0xf39af079,0xfb35f76f,0x0057fe26,0x032101e9,
0x07d3050b,0x0d690ae6,0x0f4b0ed3,0x0d890eb9,0x0a0e0bba,0x08c8090e,0x08e608df,0x066e081d,
0x01ba0424,0xfe1affac,0xfe60fdbc,0xff22ff1f,0xfde6fe97,0xfc78fd67,0xf8edfabf,0xf7d1f7c8,
0xfabff8df,0xff7cfd33,0x03360186,0x062504a1,0x07610731,0x03550605,0xfd4e0019,0xfa24fb5e,
0xf78ef901,0xf659f69b,0xf75cf6cc,0xf8bbf808,0xf9dff94b,0xfc06fab8,0xfe3dfd46,0xfe99fea3,
0xfe8bfe7a,0x0086ff19,0x05c102b4,0x0cab092d,0x11b40f83,0x133e130b,0x10cc125c,0x0ddd0f70,
0x09320bb6,0x052b070a,0x01af0376,0xfd6affd7,0xf7d8fac0,0xf24df508,0xeebaf00b,0xede5ee1c,
0xecd3ed5a,0xecbbec84,0xf0a5edfa,0xf7fcf460,0xfc40faa5,0x0002fdd5,0x06770333,0x0b310949,
0x0cfd0c44,0x0f330e0a,0x0f350ff6,0x0abb0d38,0x079208a5,0x065006f8,0x027d04da,0xfdb8ffe3,
0xfcf9fcb9,0x0034fe53,0x00a00122,0xfba5fe67,0xf85ff975,0xfaf1f8e6,0xffe2fde0,0xfe48fff9,
0xfa38fbcc,0xfc5efa5f,0x0200ff47,0x05a30452,0x057f0619,0x02cd0445,0xff8d0127,0xfbd8fdb0,
0xf73ef9ae,0xf350f4e9,0xf2f4f294,0xf6bdf456,0xfc98f9b2,0xfed0fe72,0xfe17fe48,0x0172ff10,
0x081304e5,0x0aad0a31,0x09140a12,0x095408ac,0x0ed30b88,0x14731222,0x133714e5,0x0bbd0fc8,
0x060c0855,0x00e603da,0xf7dbfcb4,0xef85f329,0xed39ed78,0xf00bee6e,0xf130f13a,0xeed5f025,
0xef04ee48,0xf4fbf17d,0xfafef887,0xfce4fc34,0xfff9fdf9,0x05f802c5,0x0c380957,0x0ee70e34,
0x0e230eba,0x0ca60d5f,0x0cc40c62,0x0ce80d4c,0x06d50ac4,0xfe3101fe,0xfcabfc58,0xfea2fdce,
0xfce1fe2c,0xf960fb11,0xf8cdf87d,0xfc64fa4b,0xfebbfe14,0xfd44fe55,0xfc03fc28,0x0002fd80,
0x03a4027d,0x01a20316,0xff1d0013,0xff41fea5,0x02ba007d,0x063204ec,0x01b40526,0xf78ffcd3,
0xf14af377,0xf1ccf106,0xf42bf2d5,0xf670f55a,0xfa49f7ea,0x0264fddd,0x0aac0723,0x0c810c66,
0x0a9b0ba0,0x0a690a08,0x0cef0b85,0x0d830dcc,0x0abb0c38,0x0ad10a14,0x0e0a0c7b,0x0bae0e16,
0x01220703,0xf627fb3b,0xefeef27b,0xec42eddf,0xea94eb1e,0xebfeeadc,0xf0c6ee01,0xf614f3aa,
0xf875f7c1,0xf92ff8c4,0xfbc3fa1c,0x016afe44,0x08b2052f,0x0db40b9b,0x0ef00ed8,0x0f350ebf,
0x11fb1088,0x1055123b,0x07670c86,0xfe82024c,0xfd35fcc7,0xff1ffe6c,0xfc33fe4e,0xf7e6f9be,
0xf7fcf745,0xfb1cf968,0xfcfafc67,0xfd15fd02,0xfea9fd89,0x00e8ffe9,0x01df019f,0x02110215,
0x026a0233,0x01c6027d,0xff7000a2,0xfe8dfea2,0x001fff62,0xfee20019,0xfb41fcf3,0xf868f9b4,
0xf64bf745,0xf36cf4f6,0xf289f23e,0xf7e6f44a,0x019dfc8b,0x0a1e0672,0x0dfd0c9b,0x0f8b0eeb,
0x0f2f0fb5,0x0beb0dd1,0x09f90a70,0x0b9b0aa4,0x0c2d0c3f,0x09670b41,0x055f074e,0x016203a1,
0xf9f5fe23,0xf0dcf56b,0xe9f9ecde,0xe825e875,0xe925e863,0xed53ead3,0xf3e9f08c,0xfb4df771,
0x0211ff11,0x044103bc,0x0492044e,0x07050574,0x0b74093d,0x0ead0d65,0x10640fa1,0x10b410da,
0x0ca80f2c,0x074a09e3,0x020304d1,0xfc7dff50,0xf863fa35,0xf6e2f727,0xf8edf789,0xfb0cfa44,
0xfb0ffb28,0xfbf2fb42,0xfd83fca7,0x0028feb2,0x02ea0199,0x045f03c8,0x03550436,0x000f019d,
0xff27ff1e,0x01d80046,0x02e30309,0xfe910138,0xf953fb84,0xf91af87e,0xfa1cf9e8,0xf86cf981,
0xf55cf6fd,0xf37ff3f5,0xf7a7f4b8,0x000efbd8,0x06ae03b8,0x0be90954,0x11110ea0,0x142012ff,
0x13a41458,0x0f5811f6,0x09390c3f,0x05d206fd,0x0517055f,0x02bc0473,0xfb4cff92,0xf3acf6de,
0xf10df1fe,0xef77f03d,0xed65ee8a,0xeb10ebfd,0xed10eb5d,0xf273ef85,0xf932f5bd,0xffcffc97,
0x06ae0327,0x0ceb0a30,0x0dbb0e06,0x0cd30d16,0x0d960d2e,0x0d5d0dc4,0x0c0e0cc1,0x09f50b49,
0x06050815,0x014403b1,0xfc67febc,0xf8b5fa6f,0xf658f74f,0xf63df612,0xf758f6b7,0xf9c8f85c,
0xfcdcfb57,0xff4efe23,0x020c007a,0x051603a4,0x05c105e0,0x03a404db,0x028802b4,0x034302c4,
0x015102f6,0xfbe1fec1,0xfa1cfa3a,0xfc9ffb46,0xfb43fcc0,0xf568f870,0xf2b6f33e,0xf5d8f3cd,
0xfa69f848,0xfdb2fc2e,0x0164ff59,0x06c103ec,0x0c4109a7,0x0f670e26,0x110c1058,0x125611c1,
0x11bc1262,0x0e5f105e,0x089c0bb4,0x015f0504,0xfa9afdcc,0xf550f7d6,0xf1c4f323,0xeff9f0da,
0xee14eeeb,0xee8aedf6,0xf001ef58,0xf1b6f0c2,0xf3d3f2d4,0xf811f53d,0xffddfbdc,0x06610367,
0x0c530955,0x12460f67,0x15b11499,0x122f14e2,0x0b260e9a,0x079408ba,0x058e06d3,0x01410395,
0xfe17ff92,0xfbc0fcfa,0xf9aefab3,0xf833f8dd,0xf66ef776,0xf4bff54d,0xf7aaf587,0xfddefaa5,
0x028e0069,0x05ca0445,0x076306ef,0x06900741,0x04b5058b,0x03aa0417,0x00f502ac,0xfd1cfeff,
0xfb68fc06,0xfa47fb01,0xf920f989,0xf89af8e3,0xf813f85f,0xf763f7ca,0xf65df6c6,0xf78ef65d,
0xfdc9fa2f,0x04d10150,0x09c4078d,0x0d040b6f,0x0ffc0e8f,0x11841110,0x10b01155,0x0f780ffe,
0x0def0ee4,0x0a1a0c62,0x033e072b,0xf896fe60,0xee04f2e9,0xe9f9eaef,0xec63ead8,0xee7ced9d,
0xf04eef5c,0xf1e3f10b,0xf5ebf37b,0xfad3f8a3,0xfc4cfbfd,0xfd1cfc65,0x03e1ff68,0x0f8b09d2,
0x1523137e,0x143d1506,0x12fb1377,0x10881222,0x09890dba,0xfef3045b,0xf77dfa47,0xf792f6d7,
0xfa78f903,0xfc37fbce,0xf9fefb7c,0xf782f888,0xf81df768,0xfadff98d,0xfc1efbb3,0xfeeffcfe,
0x049901a6,0x08cf0700,0x0ac40a17,0x08e90a76,0x03970669,0xfece00de,0xfc00fd12,0xfa31fb16,
0xf81df914,0xf798f785,0xf813f80d,0xf60ff75e,0xf4d7f4ee,0xf8d6f646,0xfe8bfbcc,0x01780056,
0x02ec0214,0x08cb0511,0x11440d43,0x13db1393,0x10bb128d,0x0e580f33,0x0e0f0e19,0x0ca80dd9,
0x070e0a60,0xfe9e030f,0xf630fa1c,0xf108f34b,0xec7feee4,0xe7a4e9de,0xe766e699,0xee1dea0c,
0xf687f26b,0xfd1efa17,0xfef2fec1,0xfe6cfe60,0x02c0ffed,0x09e20662,0x0dfb0cb2,0x0e6a0e42,
0x117e0f63,0x14c913af,0x10f213db,0x07c30cb1,0xfed002e4,0xf916fb83,0xf613f75e,0xf4c1f531,
0xf4b7f49b,0xf69df549,0xfb1ff8af,0xfe1afd18,0xfe30fe5a,0xfe8dfe2c,0x0059ff4a,0x044e0221,
0x086e0690,0x09760951,0x07e208d2,0x059c06e0,0x01c80408,0xfb35fed0,0xf50df7b8,0xf2d1f36c,
0xf493f345,0xf7b1f640,0xf826f853,0xf76df797,0xf9baf823,0xfe7efc03,0x036a00dd,0x088005f9,
0x0cae0ac0,0x0ec80e0a,0x0f700f0a,0x112e102d,0x11171188,0x0e530fe4,0x09cb0c41,0x02850687,
0xf9bbfe2c,0xf35cf61c,0xef37f14c,0xeb07ed08,0xe912e9ba,0xeb12e992,0xf023ed70,0xf55af2d4,
0xfa77f7d0,0xff9ffd05,0x05a3025f,0x0b2808e8,0x0bfa0c08,0x0ceb0c26,0x100f0e71,0x122911a5,
0x0ffc11c3,0x0aca0da8,0x043a07b5,0xfd02007a,0xf8f1fa65,0xf7bff835,0xf5acf6ea,0xf2a9f420,
0xf226f1c2,0xf87df486,0x0028fce5,0x02a201f7,0x032202c9,0x059d041f,0x08380735,0x075f0843,
0x047805e0,0x037c03af,0x035a037e,0x01c002cc,0xfdd50028,0xf7b1fac1,0xf310f4f4,0xf219f20c,
0xf31af2a3,0xf3ebf345,0xf884f594,0xffb0fc2a,0x0449027d,0x0637054d,0x09a20799,0x0e0d0bcf,
0x11350fd5,0x114611d5,0x0df40fdb,0x0be50c66,0x0c930c32,0x09af0bf4,0x009005aa,0xf680fb1b,
0xf1b5f37b,0xeda1f00b,0xe7c9ea99,0xe699e647,0xecaee8e7,0xf510f122,0xf94cf7cb,0xfb3cfa2b,
0x003dfd37,0x08b5045a,0x0e6f0c65,0x0ec10eea,0x0fcb0efd,0x10e5109e,0x0fcb1097,0x0c0a0e67,
0x04c108b9,0xfe47011f,0xfbb6fc85,0xfa8bfb58,0xf709f925,0xf3f7f51d,0xf4c1f3ec,0xf73ff5e1,
0xf972f87b,0xfa8dfa0d,0xfe60fbce,0x06ae0229,0x0d310aa9,0x0cc70dc5,0x08690ab7,0x046e0636,
0x01e00329,0xfee3007d,0xfb33fcf6,0xf7eef943,0xf75df740,0xf7a8f7d0,0xf4b5f6b5,0xf0dcf273,
0xf257f0bf,0xf7c1f4e2,0xfd53fa93,0x0473008b,0x0c92089a,0x11500f8e,0x1091116d,0x0e600f5e,
0x0d4e0db7,0x0d780d41,0x0d650db3,0x09950c18,0x029c0629,0xfd54ffa8,0xf91bfb65,0xf264f61e,
0xeb78ee99,0xe9f7e9d0,0xedc0eb87,0xf1deeffc,0xf5a3f3b4,0xfa59f7b6,0x0157fd99,0x079904fc,
0x09670902,0x09530962,0x0b0009cb,0x0f0e0cdb,0x10691084,0x0af30e70,0x031806de,0xfe5c003a,
0xfbc6fcfb,0xf8abfa4e,0xf596f6ec,0xf4e0f4d6,0xf746f5c7,0xfa83f910,0xfbdffb68,0xfd75fc73,
0x01a3ff39,0x06ce043f,0x0a8908ed,0x0c9d0bb2,0x0dd10d5e,0x0ce10dcb,0x084c0b08,0x016204ed,
0xfb03fe09,0xf647f879,0xf35af47f,0xf2f4f2f0,0xf34ff331,0xf387f373,0xf3edf3a4,0xf568f47a,
0xf798f678,0xfb68f906,0x0299fea0,0x0a10068b,0x0ff00d29,0x1436125a,0x14dc1531,0x1017131b,
0x09b80cc6,0x065007a1,0x044d0567,0x012302e2,0xfd0bff45,0xf7defa90,0xf397f574,0xf186f256,
0xeff2f0c1,0xef4cef58,0xf2bff06a,0xf9ecf614,0x0072fd6f,0x051602f0,0x081b06d0,0x09bc0912,
0x0a580a24,0x0a020a41,0x08750966,0x05bd0741,0x029e0434,0xff46010a,0xfc2ffda7,0xf959fac5,
0xf6a6f7f3,0xf508f5a9,0xf519f4c4,0xf7ebf613,0xfd24fa76,0x00f6ff3c,0x0389023f,0x06d90500,
0x0b1a08f4,0x0df70cdf,0x0e2c0e5f,0x0d470dc2,0x0c080cc5,0x09230ae6,0x031806a6,0xf98bfeae,
0xf0b7f4ba,0xed43ee2f,0xeeceedc3,0xf039efa2,0xf1b1f0d3,0xf42af2c5,0xf849f606,0xfc74fa96,
0xfea3fdc9,0x00c2ff7f,0x069302fa,0x0fb40b2e,0x14971310,0x13d514a2,0x121912ee,0x0f611111,
0x08980ca2,0xfe71039b,0xf74af9ff,0xf6d5f674,0xf864f7ad,0xf875f8c0,0xf607f764,0xf451f4e4,
0xf578f48c,0xf8a7f709,0xfb09fa00,0xfe88fc58,0x04ca0174,0x09e807ac,0x0c370b65,0x0b140c21,
0x0756094e,0x03d9056b,0x00900229,0xfd18fed4,0xfa05fb61,0xf8c8f919,0xf851f8b5,0xf602f75c,
0xf4a9f4e5,0xf7b1f5af,0xfca0fa2c,0xffc8fe79,0x0190009f,0x06de0390,0x0e750ada,0x112d10ae,
0x0eeb104c,0x0d190db8,0x0d270d0d,0x0c0d0d15,0x06ae09ea,0xfe7502be,0xf6a4fa31,0xf223f416,
0xee01f039,0xe971eb89,0xe927e873,0xef43eb93,0xf6ebf335,0xfcf6fa25,0xff7dfec7,0x0033ffa7,
0x047401d7,0x0ac307ad,0x0e850d4b,0x0ed10ec8,0x10e20f68,0x13451281,0x0fcb1263,0x07790bff,
0xfee902e3,0xf8e1fb86,0xf541f6dd,0xf393f425,0xf3a0f372,0xf573f438,0xf997f758,0xfcb4fb8a,
0xfd72fd3c,0xfe5cfdc2,0x005cff34,0x0466022d,0x089e06af,0x0a1f09af,0x095909ea,0x0754088c,
0x035b05ac,0xfcdb005d,0xf6bdf974,0xf3f4f4e8,0xf4bef3f1,0xf736f602,0xf7b9f7cc,0xf74ef753,
0xf9acf819,0xfe1efbd4,0x029e0047,0x076d0502,0x0bae09ae,0x0e1d0d33,0x0efb0e85,0x10a70fb6,
0x109110fd,0x0de70f6c,0x09710be0,0x025a063e,0xf9e0fe2a,0xf3acf65e,0xef95f1a1,0xeb89ed75,
0xe9baea51,0xeb9fea37,0xf06eedda,0xf58ef30b,0xfabcf80c,0xffedfd54,0x05d102a5,0x0b490904,
0x0c580c43,0x0d470c90,0x10070e9e,0x11d51169,0x0fa81164,0x0a8c0d5e,0x0412077e,0xfcf10060,
0xf8d5fa53,0xf78af80c,0xf56ff6af,0xf267f3e2,0xf1d2f176,0xf81ff42b,0xffe9fc8e,0x028801cb,
0x031702bc,0x058e0410,0x0839072a,0x07860858,0x04b80614,0x03c703f6,0x03ab03cd,0x021b0323,
0xfe260082,0xf7e8fb07,0xf32df51d,0xf227f221,0xf31bf2ab,0xf3e0f340,0xf86df582,0xff92fc11,
0x042f0261,0x06210536,0x09830780,0x0de50bad,0x110d0fac,0x112a11b2,0x0dea0fc8,0x0be10c61,
0x0c8a0c2f,0x09a30be9,0x008b05a0,0xf684fb1b,0xf1b9f37f,0xedaaf00f,0xe7dceaa7,0xe6abe65b,
0xecb7e8f5,0xf514f128,0xf951f7ce,0xfb41fa2e,0x003ffd3a,0x08b6045b,0x0e710c67,0x0ec30eec,
0x0fcb0eff,0x10e3109e,0x0fcb1096,0x0c080e65,0x04bf08b6,0xfe46011e,0xfbb6fc84,0xfa8afb57,
0xf708f925,0xf3f7f51d,0xf4c0f3eb,0xf73ef5e0,0xf971f87a,0xfa8dfa0c,0xfe60fbcd,0x071e0229,
0x00000513,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
};
| [
"[email protected]"
] | |
550db07c30c2215144d455b9c7305ecbf8684616 | 0b431412de715f7ee9000e46d40c337422ab9d0c | /src/game/entities/components/powerupcomponent.h | cdee08fe68a8558adc25d320f586882ef9f086ca | [] | no_license | gered/MonsterDefense | 66f53c7459e96acab4d194919fe92657dd23e7ac | 4960df2ea152049a2348fc48c0821977a6606c1c | refs/heads/master | 2020-04-26T07:24:29.793861 | 2019-03-02T02:17:33 | 2019-03-02T02:23:29 | 173,393,236 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 773 | h | #ifndef __GAME_ENTITIES_COMPONENTS_POWERUPCOMPONENT_H_INCLUDED__
#define __GAME_ENTITIES_COMPONENTS_POWERUPCOMPONENT_H_INCLUDED__
#include "../../../framework/common.h"
#include "../../../entities/component.h"
#include "../powerups/powerup.h"
#include <stl/string.h>
class PowerUpComponent : public Component
{
public:
static COMPONENT_TYPE GetType()
{
static COMPONENT_TYPE typeName = "PowerUpComponent";
return typeName;
}
COMPONENT_TYPE GetTypeOf() const { return GetType(); }
PowerUpComponent();
void Reset();
PowerUp *powerUp;
BOOL shouldRaisePowerUpOnCollect;
};
inline PowerUpComponent::PowerUpComponent()
{
Reset();
}
inline void PowerUpComponent::Reset()
{
powerUp = NULL;
shouldRaisePowerUpOnCollect = FALSE;
}
#endif
| [
"[email protected]"
] | |
9a5750ab9c339204e0012444f1f658d640d29396 | 0dbdf1fc2b207072da5887466f5da1a258722506 | /Laboratoriniai/S1 laborai/L1antra-22/L1antra-2/L1antra-2/L1antra-2.cpp | 9fd9eddc8cc273ca69c3a9a2443e210d3cc9d974 | [] | no_license | petkus09/KTU-Cplusplus | ff483c256c2a244fb04a75662e5023da634ce09b | 2a5b24d800a107c95d69285b1bcfedacfe82c3b3 | refs/heads/master | 2016-09-06T15:12:44.945986 | 2013-08-20T19:07:30 | 2013-08-20T19:07:30 | null | 0 | 0 | null | null | null | null | ISO-8859-13 | C++ | false | false | 423 | cpp | #include <iostream>
using namespace std;
int main()
{
setlocale (LC_ALL, "Lithuanian");
double pi = 3.1415;
double H;
double R, r;
double V;
cout << "Įveskite kūgio aukštinės reikšmę:" << endl;
cin >> H;
cout << "Įveskite kūgio pagrindų spindulių reikšmes:" << endl;
cin >> R >> r;
V = (1.0 / 3) * pi * H * (R * R + R * r + r * r);
cout << "Kūgio tūris = " << V << endl;
return 0;
} | [
"[email protected]#"
] | |
3c5b26c205fd6ffa9bdcfc63390dda04829496e8 | 1994f421b057f39b9cfcfadda403a3bd9ae1fe8c | /poseidon/socket/abstract_socket.cpp | 92c82506f80ba887117bc80dbd63d941f3bfb9e7 | [
"BSD-3-Clause"
] | permissive | david123sw/poseidon | 29731c6e049b6fb0f026b3a53f8a52d834d61643 | 5edfe30ec99e373e11d76fc4386e564253edc587 | refs/heads/master | 2023-04-13T04:42:30.473976 | 2023-02-07T16:26:18 | 2023-02-07T16:28:21 | 70,473,560 | 1 | 0 | null | 2016-10-10T09:35:24 | 2016-10-10T09:35:24 | null | UTF-8 | C++ | false | false | 3,188 | cpp | // This file is part of Poseidon.
// Copyleft 2022 - 2023, LH_Mouse. All wrongs reserved.
#include "../precompiled.ipp"
#include "abstract_socket.hpp"
#include "../utils.hpp"
#include <sys/socket.h>
#include <fcntl.h>
namespace poseidon {
Abstract_Socket::
Abstract_Socket(unique_posix_fd&& fd)
{
// Take ownership the socket handle.
this->m_fd = ::std::move(fd);
if(!this->m_fd)
POSEIDON_THROW(("Null socket handle not valid"));
// Get the local address and address family.
::sockaddr_in6 addr;
::socklen_t addrlen = sizeof(addr);
if(::getsockname(this->fd(), (::sockaddr*) &addr, &addrlen) != 0)
POSEIDON_THROW((
"Could not get socket local address",
"[`getsockname()` failed: $1]"),
format_errno());
if((addr.sin6_family != AF_INET6) || (addrlen != sizeof(addr)))
POSEIDON_THROW((
"Addresss family unimplemented: family `$1`, addrlen `$2`"),
addr.sin6_family, addrlen);
this->m_sockname.set_addr(addr.sin6_addr);
this->m_sockname.set_port(be16toh(addr.sin6_port));
this->m_sockname_ready.store(true);
// Turn on non-blocking mode if it hasn't been enabled.
int fl_old = ::fcntl(this->fd(), F_GETFL);
if(fl_old == -1)
POSEIDON_THROW((
"Could not get socket flags",
"[`fcntl()` failed: $1]"),
format_errno());
int fl_new = fl_old | O_NONBLOCK;
if(fl_new != fl_old)
::fcntl(this->fd(), F_SETFL, fl_new);
this->m_state.store(socket_state_established);
}
Abstract_Socket::
Abstract_Socket(int type, int protocol)
{
// Create a non-blocking socket.
this->m_fd.reset(::socket(AF_INET6, type | SOCK_NONBLOCK, protocol));
if(!this->m_fd)
POSEIDON_THROW((
"Could not create IPv6 socket: type `$2`, protocol `$3`",
"[`socket()` failed: $1]"),
format_errno(), type, protocol);
this->m_state.store(socket_state_connecting);
}
Abstract_Socket::
~Abstract_Socket()
{
}
const Socket_Address&
Abstract_Socket::
local_address() const noexcept
{
if(this->m_sockname_ready.load())
return this->m_sockname;
// Try getting the address now.
static plain_mutex s_mutex;
plain_mutex::unique_lock lock(s_mutex);
if(this->m_sockname_ready.load())
return this->m_sockname;
::sockaddr_in6 addr;
::socklen_t addrlen = sizeof(addr);
if(::getsockname(this->fd(), (::sockaddr*) &addr, &addrlen) != 0)
return ipv6_unspecified;
ROCKET_ASSERT(addr.sin6_family == AF_INET6);
ROCKET_ASSERT(addrlen == sizeof(addr));
// Cache the address.
this->m_sockname.set_addr(addr.sin6_addr);
this->m_sockname.set_port(be16toh(addr.sin6_port));
this->m_sockname_ready.store(true);
return this->m_sockname;
}
bool
Abstract_Socket::
quick_shut_down() noexcept
{
this->m_state.store(socket_state_closed);
// Enable linger to request that any pending data be discarded.
::linger lng;
lng.l_onoff = 1;
lng.l_linger = 0;
::setsockopt(this->fd(), SOL_SOCKET, SO_LINGER, &lng, sizeof(lng));
return ::shutdown(this->fd(), SHUT_RDWR) == 0;
}
} // namespace poseidon
| [
"[email protected]"
] | |
a9e2dd352646413730507b538e22e5d83f1368a7 | 78f48025d3eea984744557704349ca3a2bc5c34b | /Week8_BinarySearch/Powxn.cpp | 748c8734df398157ab98a199252f75b4986d8b1b | [] | no_license | yyhe/CodingPractise | 33b7da5aa664837cb55e9aa92de2c1e47d3b889b | 0db49a85933e80b6215f494993a6994d82846d1a | refs/heads/master | 2020-09-12T12:48:15.326299 | 2020-01-06T16:18:48 | 2020-01-06T16:18:48 | 222,430,848 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 589 | cpp | class Solution {
public:
double myPow(double x, int n) {
if (n < 0)
{
return 1.0 / myPow(x, -(n + 1)) / x;
}
else if (n == 0)
{
return 1;
}
else if (n == 1)
{
return x;
}
else if (n == -1)
{
return 1 / x;
}
else if (n & 1)
{
double mid = myPow(x, n / 2);
return mid * mid * x;
}
else
{
double mid = myPow(x, n / 2);
return mid * mid;
}
}
};
| [
"[email protected]"
] | |
d9c4aa457a56ed59764fc446a62bc6363d5ae2b3 | 8141ef14afe62f0d9d992726ef35b0cd713c47f4 | /boost-graph/boost-graph/Kruskal.h | 85c211e1b82434386a7d999d694352c0248c2df9 | [] | no_license | YBelikov/boost-graph | 05966c91c3e2e3f635aebf141f1da8781957dfdc | 42b24fc9fbacf5d96aea71739588ba363c4c5002 | refs/heads/master | 2023-08-03T09:12:27.949561 | 2023-07-21T15:27:52 | 2023-07-21T15:27:52 | 240,084,966 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 190 | h | #pragma once
template<typename Graph, typename OutputEdgeIterator, typename WeightMap>
void kruskalSpanningTree(const Graph& graph, OutputEdgeIterator outputIterator, WeightMap weights) {
} | [
"[email protected]"
] | |
02e89b92f7ea9806316170ee159113cd90cf3af2 | 4c5786fbbd690250feb5372072f3341bcb39a49d | /NewPlatform/ServerModule/GameServer/InitParameter.cpp | 496df14dd50d033816866a5ff90b770cd4391918 | [] | no_license | toowind/CyzGitRepository | d96244139865ccc6fbf0db359ebf85f5d86a80e9 | bcdc1f69d7ac3e714771ae67aad37e780ef2dfc3 | refs/heads/master | 2021-01-21T12:20:44.205211 | 2017-04-01T03:55:41 | 2017-04-01T03:55:41 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,416 | cpp | #include "StdAfx.h"
#include "InitParameter.h"
//////////////////////////////////////////////////////////////////////////////////
//时间定义
#define TIME_CONNECT 30 //重连时间
#define TIME_COLLECT 30 //统计时间
//客户时间
#define TIME_INTERMIT 0 //中断时间
#define TIME_ONLINE_COUNT 600 //人数时间
//////////////////////////////////////////////////////////////////////////////////
//构造函数
CInitParameter::CInitParameter()
{
InitParameter();
}
//析构函数
CInitParameter::~CInitParameter()
{
}
//初始化
VOID CInitParameter::InitParameter()
{
//时间定义
m_wConnectTime=TIME_CONNECT;
m_wCollectTime=TIME_COLLECT;
//协调信息
m_wCorrespondPort=PORT_CENTER;
ZeroMemory(&m_CorrespondAddress,sizeof(m_CorrespondAddress));
//配置信息
ZeroMemory(m_szServerName,sizeof(m_szServerName));
ZeroMemory(&m_ServiceAddress,sizeof(m_ServiceAddress));
ZeroMemory(&m_TreasureDBParameter,sizeof(m_TreasureDBParameter));
ZeroMemory(&m_PlatformDBParameter,sizeof(m_PlatformDBParameter));
return;
}
//加载配置
VOID CInitParameter::LoadInitParameter()
{
//重置参数
InitParameter();
//获取路径
TCHAR szWorkDir[MAX_PATH]=TEXT("");
CWHService::GetWorkDirectory(szWorkDir,CountArray(szWorkDir));
//构造路径
TCHAR szIniFile[MAX_PATH]=TEXT("");
_sntprintf(szIniFile,CountArray(szIniFile),TEXT("%s\\ServerParameter.ini"),szWorkDir);
//读取配置
CWHIniData IniData;
IniData.SetIniFilePath(szIniFile);
//读取配置
IniData.ReadEncryptString(TEXT("ServerInfo"),TEXT("ServiceName"),NULL,m_szServerName,CountArray(m_szServerName));
IniData.ReadEncryptString(TEXT("ServerInfo"),TEXT("ServiceAddr"),NULL,m_ServiceAddress.szAddress,CountArray(m_ServiceAddress.szAddress));
//协调信息
m_wCorrespondPort=IniData.ReadInt(TEXT("Correspond"),TEXT("ServicePort"),m_wCorrespondPort);
IniData.ReadEncryptString(TEXT("ServerInfo"),TEXT("CorrespondAddr"),NULL,m_CorrespondAddress.szAddress,CountArray(m_CorrespondAddress.szAddress));
//连接信息
m_TreasureDBParameter.wDataBasePort=(WORD)IniData.ReadInt(TEXT("TreasureDB"),TEXT("DBPort"),1433);
IniData.ReadEncryptString(TEXT("TreasureDB"),TEXT("DBAddr"),NULL,m_TreasureDBParameter.szDataBaseAddr,CountArray(m_TreasureDBParameter.szDataBaseAddr));
IniData.ReadEncryptString(TEXT("TreasureDB"),TEXT("DBUser"),NULL,m_TreasureDBParameter.szDataBaseUser,CountArray(m_TreasureDBParameter.szDataBaseUser));
IniData.ReadEncryptString(TEXT("TreasureDB"),TEXT("DBPass"),NULL,m_TreasureDBParameter.szDataBasePass,CountArray(m_TreasureDBParameter.szDataBasePass));
IniData.ReadEncryptString(TEXT("TreasureDB"),TEXT("DBName"),szTreasureDB,m_TreasureDBParameter.szDataBaseName,CountArray(m_TreasureDBParameter.szDataBaseName));
//连接信息
m_PlatformDBParameter.wDataBasePort=(WORD)IniData.ReadInt(TEXT("PlatformDB"),TEXT("DBPort"),1433);
IniData.ReadEncryptString(TEXT("PlatformDB"),TEXT("DBAddr"),NULL,m_PlatformDBParameter.szDataBaseAddr,CountArray(m_PlatformDBParameter.szDataBaseAddr));
IniData.ReadEncryptString(TEXT("PlatformDB"),TEXT("DBUser"),NULL,m_PlatformDBParameter.szDataBaseUser,CountArray(m_PlatformDBParameter.szDataBaseUser));
IniData.ReadEncryptString(TEXT("PlatformDB"),TEXT("DBPass"),NULL,m_PlatformDBParameter.szDataBasePass,CountArray(m_PlatformDBParameter.szDataBasePass));
IniData.ReadEncryptString(TEXT("PlatformDB"),TEXT("DBName"),szPlatformDB,m_PlatformDBParameter.szDataBaseName,CountArray(m_PlatformDBParameter.szDataBaseName));
//连接信息
m_UserCustomDBParameter.wDataBasePort = (WORD)IniData.ReadInt(TEXT("UserCustomDB"), TEXT("DBPort"), 1433);
IniData.ReadEncryptString(TEXT("UserCustomDB"), TEXT("DBAddr"), NULL, m_UserCustomDBParameter.szDataBaseAddr, CountArray(m_UserCustomDBParameter.szDataBaseAddr));
IniData.ReadEncryptString(TEXT("UserCustomDB"), TEXT("DBUser"), NULL, m_UserCustomDBParameter.szDataBaseUser, CountArray(m_UserCustomDBParameter.szDataBaseUser));
IniData.ReadEncryptString(TEXT("UserCustomDB"), TEXT("DBPass"), NULL, m_UserCustomDBParameter.szDataBasePass, CountArray(m_UserCustomDBParameter.szDataBasePass));
IniData.ReadEncryptString(TEXT("UserCustomDB"), TEXT("DBName"), szUserCustomDB, m_UserCustomDBParameter.szDataBaseName, CountArray(m_UserCustomDBParameter.szDataBaseName));
return;
}
//////////////////////////////////////////////////////////////////////////////////
| [
"[email protected]"
] | |
81138c45e49df92ff57b148a9d565eef982f0801 | 72a3ce4880c23aa92f875f9f5cb4964dabb1cc96 | /stack/739.cpp | e8d52a5458b6216b3e3fbab66e88d09f589aa32e | [] | no_license | wzppengpeng/leetcode_solution | a06d9894b94c3598297ae8044cfe310fd30ce748 | 7c4b37b4bd224fea1ad42908592e8b2a01675d9a | refs/heads/master | 2021-06-06T01:11:36.165530 | 2019-12-08T15:37:28 | 2019-12-08T15:37:28 | 103,827,304 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,135 | cpp | /**
* Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If there is no future day for which this is possible, put 0 instead.
For example, given the list temperatures = [73, 74, 75, 71, 69, 72, 76, 73], your output should be [1, 1, 4, 2, 1, 1, 0, 0].
Note: The length of temperatures will be in the range [1, 30000]. Each temperature will be an integer in the range [30, 100].
*/
/**
* 使用栈来保存目前最大的值,遍历到某个数时首先跟栈顶的元素比对,并更新结果
*/
class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
vector<int> res(temperatures.size(), 0);
stack<pair<int, size_t>> st;
for(size_t i = 0; i < temperatures.size(); ++i) {
while(!st.empty() && temperatures[i] > st.top().first) {
auto& latest = st.top();
res[latest.second] = i - latest.second;
st.pop();
}
st.push({temperatures[i], i});
}
return res;
}
}; | [
"[email protected]"
] | |
e2c9a43ed8ddea520edb2b8d3bd7835d4f383cc0 | 187b9278a8122bd7ac0a26932e476b2cf7171492 | /TFMEngine/src/GPU/texture/GPUTexture1D.cpp | 70bac61ba1d33b200edaf94c071b2b0c6acc1c18 | [] | no_license | Graphics-Physics-Libraries/RenderLibrary | b0b7a1fe23b7d1553886d1a8783f49a2d83ed593 | 83cb99f269853f8311111c011face5c101eb6cd3 | refs/heads/master | 2020-07-14T16:53:18.939002 | 2019-01-31T09:12:23 | 2019-01-31T09:12:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 869 | cpp | #include "GPU/texture/GPUTexture1D.h"
namespace RenderLib
{
namespace GPU
{
namespace Texture
{
GPUTexture1D::GPUTexture1D() : GPUTexture()
{
}
GPUTexture1D::~GPUTexture1D()
{
}
GLenum
GPUTexture1D::getTexturType()
{
return GL_TEXTURE_1D;
}
void
GPUTexture1D::uploadMutable(void * data)
{
glTexImage1D(GL_TEXTURE_1D, 0, config.internalFormat, width, 0,
config.format, config.pixelType, data);
}
void
GPUTexture1D::uploadInmutable(void * data)
{
glTexStorage1D(GL_TEXTURE_1D, 1, config.internalFormat, width);
glTexSubImage1D(GL_TEXTURE_1D, 0, 0, width, config.format,
config.pixelType, data);
}
} // namespace Texture
} // namespace GPU
} // namespace RenderLib | [
"[email protected]"
] | |
52522928f3947ece5af6e7451c504ed357d79d09 | 710f7d2951c7af722d8e8ea896c5e6733e155860 | /zGameServer_X/GameServer/MuLua.h | d060c039fbe2c22842d021002cb69c24142575fc | [] | no_license | lnsurgent/X-MU_Community_Server | 5cda542a5cbd6d73ade156ca8354eeab2909da91 | e576e30a0222789b2d02506569e5b435dd696e2f | refs/heads/master | 2016-09-06T07:50:10.870481 | 2016-02-11T06:56:20 | 2016-02-11T06:56:20 | 29,187,243 | 12 | 8 | null | 2015-01-18T15:23:14 | 2015-01-13T11:40:29 | C++ | UTF-8 | C++ | false | false | 579 | h | // ------------------------------
// Decompiled by Hybrid
// 1.01.00
// ------------------------------
#pragma once
#include "../Lua/include/lua.hpp"
class MULua
{
public:
MULua(void);
~MULua(void);
private:
bool Create();
public:
void Release();
bool DoFile(const char* szFileName);
bool DoFile(lua_State* L, const char* szFileName);
bool DoString(std::string kString);
lua_State* GetLua();
void Register(void* pLua);
void CreateWinConsole(HINSTANCE hInstance);
void DestroyWinConsole();
private:
lua_State* m_luaState;
};
extern MULua g_MuLuaQuestExp; | [
"[email protected]"
] | |
b3c7366f546352f87b197079a3a2ea3c8e83f984 | 2ba94892764a44d9c07f0f549f79f9f9dc272151 | /Engine/Plugins/Experimental/Phya/Source/Phya/Private/PhyaLib/include/Signal/paBlock.hpp | caa0f90a6255150f6735213e6b0bc5d0a65be22d | [
"Zlib",
"BSD-2-Clause",
"LicenseRef-scancode-proprietary-license"
] | permissive | PopCap/GameIdea | 934769eeb91f9637f5bf205d88b13ff1fc9ae8fd | 201e1df50b2bc99afc079ce326aa0a44b178a391 | refs/heads/master | 2021-01-25T00:11:38.709772 | 2018-09-11T03:38:56 | 2018-09-11T03:38:56 | 37,818,708 | 0 | 0 | BSD-2-Clause | 2018-09-11T03:39:05 | 2015-06-21T17:36:44 | null | UTF-8 | C++ | false | false | 2,862 | hpp | //
// paBlock.hpp
//
// Container class for audio blocks used in signal processing.
//
// This provides a friendly extra layer of indirection to the sample data,
// which is neccessary if we wish to establish signal connections between objects once,
// and later page-switch samples in the output paBlock of an object.
// The price of the extra indirection is not important since it is only incurred
// once per block operation.
#if !defined(__paBlock_hpp)
#define __paBlock_hpp
#include "Scene/paAudio.hpp"
#include "Utility/paObjectPool.hpp"
class PHYA_API paBlock;
//template class PHYA_API paObjectPool<paBlock>; // For dll interface only.
class PHYA_API paBlock {
private:
paFloat* m_samples; // Location of this block's own samples.
paFloat* m_start; // Start of sample block, initially this block, but can point to other blocks.
// bool m_zeroState; // Experimental flag for reducing arithmetic operations. Probably more hassle than its worth.
public:
static paObjectPool<paBlock> pool;
static paBlock* newBlock();
static int deleteBlock(paBlock*);
static int nFrames; // Working sample space can change size.
static int nMaxFrames; // Changing this during execution could cause confusion.
static int setnMaxFrames(int n);
static int setnFrames(int n);
int m_poolHandle; // Used for freeing a block to the pool.
paBlock();
~paBlock();
void zero();
// void setZeroState(void) { m_zeroState = true; } // Makes efficient buffer filling easy: If m_zeroState is set 'addWithMultiply' interpreted as 'copyWithMultiply' so 'zero' is avoided.
// void clearZeroState(void) { m_zeroState = false; } // Makes efficient buffer filling easy: If m_zeroState is set 'addWithMultiply' interpreted as 'copyWithMultiply' so 'zero' is avoided.
// bool isZero() { return m_zeroState; }
void copy(paBlock* input); // Useful for creating extra 'buffer' blocks, when minimizing block memory usage.
void multiplyBy(paFloat multfactor); // Multiply block by a factor.
void add(paBlock* toadd); // Multiply toadd by multfactor then add to current value of this audio block.
void addWithMultiply(paBlock* toadd, paFloat multfactor); // Multiply toadd by multfactor then add to current value of this audio block.
void copyWithMultiply(paBlock* tocopy, paFloat multfactor); // Multiply 'tocopy' by 'multfactor' then copy to this audio block.
void multiplyByNoise();
paFloat* getStart() { return m_start; }
void square();
paFloat sum(); // Sum the samples in the block.
void fadeout();
void fillWithNoise();
void fillWithNoise(paFloat amp);
paFloat getLastSample() { return m_start[nFrames-1]; }
void setStart(paFloat* s) { m_start = s; }
void resetStart(void) { m_start = m_samples; }
void limit(); // Ultra simple limiter. Better to use paLimiter
void plot();
void plot(paFloat scale);
};
#endif
| [
"[email protected]"
] | |
e9d284d700603ffe8a0a6661613b29a450160751 | 8a1a7363c96b7f96b7be641d86f783cbb1571d7d | /CW2_Album_database/Duration.hpp | 6e97838601b74260bc02f2247256973917351b54 | [] | no_license | G-Marshall-Dutton/Album-Database | fbaf2cb6da2e8e6bc501c19839405d8f3ded5814 | 7eac3ab849f10ec99a75fb1674ed054adcabcd6c | refs/heads/master | 2021-06-13T02:29:48.002322 | 2020-04-09T15:49:11 | 2020-04-09T15:49:11 | 254,414,089 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,163 | hpp | //
// Duration.hpp
// CW2_Album_database
//
// Copyright © 2019 George Marshall-Dutton. All rights reserved.
//
#ifndef Duration_hpp
#define Duration_hpp
#include <stdio.h>
#include <iomanip>
#include <ostream>
#include <iostream>
class Duration{
private:
int hours, minutes, seconds;
public:
Duration();
Duration(int seconds);
Duration(int hrs, int mins, int secs);
int getHours() const;
int getMinutes() const;
int getSeconds() const;
operator int() const;
};
// CONSTRUCTORS ----------------------
inline Duration::Duration(){
this->hours = 0;
this->minutes = 0;
this->seconds = 0;
}
inline Duration::Duration(int totalSeconds){
this->hours = totalSeconds / 3600;
totalSeconds %= 3600;
this->minutes = totalSeconds / 60;
totalSeconds %= 60;
this->seconds = totalSeconds;
}
inline Duration::Duration(int hrs, int mins, int secs){
// ADD ERROR CHECKING (values cant be < 0)
// Convert to totalSeconds
int totalSeconds = hrs * 3600;
totalSeconds += mins * 60;
totalSeconds += secs;
*this = Duration(totalSeconds);
}
// ACCESSOR METHODS ------------------
inline int Duration::getHours() const{
return hours;
}
inline int Duration::getMinutes() const{
return minutes;
}
inline int Duration::getSeconds() const{
return seconds;
}
// OVERLOADED OPERATORS ---------------
// Duration - Duration
inline int operator-(const Duration& d1, const Duration& d2){
return static_cast<int>(d1) - static_cast<int>(d2);
}
// Duration + Duration
inline int operator+(const Duration& d1, const Duration d2){
return static_cast<int>(d1) + static_cast<int>(d2);
}
// Duration += Duration
inline void operator+=(Duration& d1, const Duration d2){
d1 = Duration(static_cast<int>(d1) + static_cast<int>(d2));
}
// Duration += Duration
inline void operator-=(Duration& d1, const Duration d2){
d1 = Duration(static_cast<int>(d1) - static_cast<int>(d2));
}
// Duration > Duration
inline bool operator>(const Duration& d1, const Duration& d2){
return static_cast<int>(d1) > static_cast<int>(d2);
}
// Duration < Duration
inline bool operator<(const Duration& d1, const Duration& d2){
return static_cast<int>(d1) < static_cast<int>(d2);
}
// Duration == Duration
inline bool operator==(const Duration& d1, const Duration& d2){
return static_cast<int>(d1) == static_cast<int>(d2);
}
// Duration != Duration
inline bool operator!=(const Duration& d1, const Duration& d2){
return !(d1==d2);
}
// Duration >= Duration
inline bool operator>=(const Duration& d1, const Duration& d2){
return !(d1<d2);
}
// Duration <= Duration
inline bool operator<=(const Duration& d1, const Duration& d2){
return !(d1>d2);
}
// os << Duration
inline std::ostream& operator<<(std::ostream& os, const Duration& d){
return os << std::setfill('0')
<< std::setw(1)<< d.getHours() << ':'
<< std::setw(2) << d.getMinutes() << ':'
<< std::setw(2) << d.getSeconds() ;
}
// is >> Duration
std::istream& operator>>(std::istream& is, Duration& d);
#endif /* Duration_hpp */
| [
"[email protected]"
] | |
599d3a0e31f91763e742898b074d4ca14a53bfa4 | 1abb4677cbf73b8d40c8ba64b9d78c1386fc5b8e | /Stafra/App/DisplayRenderer.hpp | b667862a24e2c92b07011765c6ceda8e4aa35e22 | [] | no_license | Sixshaman/Stafra | e89a2dea3141208843ed6e6ab1dab1161be2eed3 | 7187aca318db58f300883b1dafa43bd14cd10e38 | refs/heads/master | 2021-07-08T10:05:04.787779 | 2020-09-14T18:42:46 | 2020-09-14T18:42:46 | 191,761,229 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,013 | hpp | #pragma once
#include <d3d11.h>
#include <wrl/client.h>
#include <cstdint>
#include "Renderer.hpp"
class DisplayRenderer final: public Renderer
{
struct CBParamsClickRuleStruct
{
uint32_t Flags;
};
public:
DisplayRenderer(int gpuIndex, HWND previewWnd, HWND clickRuleWnd);
~DisplayRenderer();
void ResizePreviewArea(uint32_t newWidth, uint32_t newHeight) override;
bool GetClickRuleGridVisible() const override;
void SetClickRuleGridVisible(bool bVisible) override;
void DrawPreview() override; //Only to be called from the background thread
void DrawClickRule() override; //Only to be called from the background thread
void SetCurrentBoard(ID3D11ShaderResourceView* srv) override;
void SetCurrentClickRule(ID3D11ShaderResourceView* srv) override;
private:
void CreateSwapChains(HWND previewWnd, HWND clickRuleWnd);
void LoadShaders();
void CreateSwapChain(IDXGIFactory* factory, HWND hwnd, uint32_t width, uint32_t height, IDXGISwapChain** outSwapChain);
void InitRenderAreaSize(IDXGISwapChain* swapChain, uint32_t width, uint32_t height, ID3D11RenderTargetView** outRTV, D3D11_VIEWPORT* outViewport);
private:
Microsoft::WRL::ComPtr<IDXGISwapChain> mPreviewSwapChain;
Microsoft::WRL::ComPtr<IDXGISwapChain> mClickRuleSwapChain;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> mPreviewRTV;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> mClickRuleRTV;
D3D11_VIEWPORT mPreviewViewport;
D3D11_VIEWPORT mClickRuleViewport;
Microsoft::WRL::ComPtr<ID3D11SamplerState> mBoardSampler;
Microsoft::WRL::ComPtr<ID3D11VertexShader> mRenderVertexShader;
Microsoft::WRL::ComPtr<ID3D11PixelShader> mRenderPixelShader;
Microsoft::WRL::ComPtr<ID3D11PixelShader> mRenderClickRulePixelShader;
Microsoft::WRL::ComPtr<ID3D11Buffer> mCBufferParamsClickRule;
CBParamsClickRuleStruct mCBufferParamsClickRuleCopy;
ID3D11ShaderResourceView* mCurrentBoardSRV; //Non-owning observer pointer
ID3D11ShaderResourceView* mCurrentClickRuleSRV; //Non-owning observer pointer
}; | [
"[email protected]"
] | |
d70e2388de032a044709fc225d3ddb3aa120f034 | b81424733ba7aa22971017a2b723cebdb79e2ff9 | /B1005/B1005.cpp | f768d052f13d76fdcd92f6b3532975144d9be2cb | [] | no_license | tongnamuu/Algorithm-PS | 1d8ee70c60da9bafdae7c820872e685fdf2b28fa | 464b68c34bb07f9e1e00e4b5475c6f0240cd20d4 | refs/heads/master | 2022-06-04T01:57:29.432141 | 2022-04-08T11:52:01 | 2022-04-08T11:52:01 | 164,219,701 | 0 | 1 | null | 2019-03-28T03:43:13 | 2019-01-05T13:58:05 | C++ | UTF-8 | C++ | false | false | 1,289 | cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct NodeTimeInfo {
int now, time;
bool operator<(const NodeTimeInfo& a) const {
return time > a.time;
}
};
#define N 1001
int indegree[N];
int a[N];
vector<int>adj[N];
signed main() {
ios_base::sync_with_stdio(false), cin.tie(0);
int T; cin >> T;
while (T--) {
int n, k; cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
adj[i].clear();
indegree[i] = 0;
}
for (int i = 0, u, v; i < k; ++i) {
cin >> u >> v;
indegree[v] += 1;
adj[u].push_back(v);
}
int w; cin >> w;
priority_queue<NodeTimeInfo>q;
for (int i = 1; i <= n; ++i) {
if (!indegree[i]) q.push({ i,a[i] });
}
while (!q.empty()) {
int now = q.top().now;
int time = q.top().time;
if (now == w) {
cout << time << '\n';
break;
}
q.pop();
for (int next : adj[now]) {
indegree[next]--;
if (indegree[next] == 0) {
q.push({ next, a[next] + time });
}
}
}
}
}
| [
"[email protected]"
] | |
6ef27bdb63581208e25b3c2564507481df2d5641 | b832bc78ebdc57f127ecc58c1ad1479a2244a603 | /include/core/Config.hpp | 18144a8dd0d2e5d98ca73d0048277bfc315135de | [
"MIT"
] | permissive | TerensTare/tnt | a25d3bda795b1693cae66ecc2ee785ae1aa9d541 | 916067a9bf697101afb1d0785112aa34014e8126 | refs/heads/master | 2023-04-08T23:06:53.972084 | 2021-04-20T12:56:23 | 2021-04-20T12:56:23 | 238,545,192 | 35 | 9 | MIT | 2020-09-03T03:14:33 | 2020-02-05T20:46:22 | C++ | UTF-8 | C++ | false | false | 718 | hpp | #ifndef CONFIG_HPP
#define CONFIG_HPP
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// clang-format off
# if defined(_MSC_VER) && !defined(__clang__)
# ifdef TNT_BUILD
# define TNT_API __declspec(dllexport)
# define TNT_EXPORT
# else
//disable warnings on extern before template instantiation
# define TNT_API __declspec(dllimport)
# define TNT_EXPORT extern
# endif //!TNT_BUILD_DLL
# elif defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER))
# ifdef TNT_BUILD
# define TNT_API __attribute__((visibility("default")))
# define TNT_EXPORT
# else
# define TNT_API
# define TNT_EXPORT
# endif
# endif //!_MSC_VER
// clang-format on
#endif
#endif //!CONFIG_HPP | [
"[email protected]"
] | |
75fa7f28abd67166ce58a1e05fa532cae050a9f2 | bdcd0020d1159e23894a2e0f0fbb679ec14736d6 | /src/graphs/dijkstra-III.cpp | f6f2e227e1e6777b9045e54989288465b0e7e222 | [] | no_license | joseraulperezrodriguez/algorithms-and-datastructures | 6e9f8c1233c3e38477d92c6b615c0e7231a007b7 | e69503dcd41e2d82139726ea4e5bf974f0f6227b | refs/heads/master | 2020-03-26T20:13:08.506668 | 2019-09-14T21:58:28 | 2019-09-14T21:58:28 | 145,311,346 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,420 | cpp | /*
koder : melkor
TASK : Dijkstra's Single-Source Shortst-Paths Algorithm
Running time: O(E log V)
*/
#include <cstdio>
#include <set>
#include <bits/stdc++.h>
using namespace std;
#define MAXV 50000
#define MAXE 100000
#define oo 1000000000
typedef pair< int, int > pii;
struct edge {
int v, w, next;
} edges[MAXE];
int V, edge_count, source;
int u, v, w, dist;
int p[MAXV], d[MAXV];
int main() {
freopen( "in.txt", "r", stdin );
freopen( "out.txt", "w", stdout );
memset( p, -1, sizeof( p ) );
scanf( "%d %d %d", &V, &edge_count, &source );
for ( int i = 0; i < edge_count; i++ ) {
scanf( "%d %d %d", &u, &v, &w );
u--; v--;
edges[i] = ( edge ) { v, w, p[u] };
p[u] = i;
}
/* Dijkstra's Algorithm */
set< pii > S;
for ( int i = 0; i < V; i++ )
d[i] = oo;
d[ --source ] = 0;
S.insert( make_pair( 0, source ) );
for ( int i = 0; i < V; i++ ) {
pii top = *S.begin();
S.erase( S.begin() );
u = top.second;
dist = top.first;
for ( int i = p[u]; i != -1; i = edges[i].next ) {
v = edges[i].v; w = edges[i].w;
if ( d[u] + w < d[v] ) {
if ( d[v] != oo )
S.erase( S.find( make_pair( d[v], v ) ) );
d[v] = d[u] + w;
S.insert( make_pair( d[v], v ) );
}
}
}
return 0;
}//melkor
| [
"[email protected]"
] | |
57118a63620da7ba4d1f9884855da442c4fe41ad | ac372e2fdc9352414169b4791e58f43ec56b8922 | /Export/linux/obj/include/lime/math/_BGRA/BGRA_Impl_.h | 92a5579c050704ad4694c8da76f459d8591c66fc | [] | no_license | JavaDeva/HAXE_TPE | 4c7023811b153061038fe0effe913f055f531e22 | a201e718b73658bff943c268b097a86f858d3817 | refs/heads/master | 2022-08-15T21:33:14.010205 | 2020-05-28T15:34:32 | 2020-05-28T15:34:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 3,384 | h | // Generated by Haxe 4.1.1
#ifndef INCLUDED_lime_math__BGRA_BGRA_Impl_
#define INCLUDED_lime_math__BGRA_BGRA_Impl_
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
HX_DECLARE_CLASS3(lime,math,_BGRA,BGRA_Impl_)
HX_DECLARE_CLASS2(lime,utils,ArrayBufferView)
namespace lime{
namespace math{
namespace _BGRA{
class HXCPP_CLASS_ATTRIBUTES BGRA_Impl__obj : public ::hx::Object
{
public:
typedef ::hx::Object super;
typedef BGRA_Impl__obj OBJ_;
BGRA_Impl__obj();
public:
enum { _hx_ClassId = 0x7ecac4f2 };
void __construct();
inline void *operator new(size_t inSize, bool inContainer=false,const char *inName="lime.math._BGRA.BGRA_Impl_")
{ return ::hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return ::hx::Object::operator new(inSize+extra,false,"lime.math._BGRA.BGRA_Impl_"); }
inline static ::hx::ObjectPtr< BGRA_Impl__obj > __new() {
::hx::ObjectPtr< BGRA_Impl__obj > __this = new BGRA_Impl__obj();
__this->__construct();
return __this;
}
inline static ::hx::ObjectPtr< BGRA_Impl__obj > __alloc(::hx::Ctx *_hx_ctx) {
BGRA_Impl__obj *__this = (BGRA_Impl__obj*)(::hx::Ctx::alloc(_hx_ctx, sizeof(BGRA_Impl__obj), false, "lime.math._BGRA.BGRA_Impl_"));
*(void **)__this = BGRA_Impl__obj::_hx_vtable;
return __this;
}
static void * _hx_vtable;
static Dynamic __CreateEmpty();
static Dynamic __Create(::hx::DynamicArray inArgs);
//~BGRA_Impl__obj();
HX_DO_RTTI_ALL;
static bool __GetStatic(const ::String &inString, Dynamic &outValue, ::hx::PropertyAccess inCallProp);
static void __register();
bool _hx_isInstanceOf(int inClassId);
::String __ToString() const { return HX_("BGRA_Impl_",54,f8,cb,41); }
static int a16;
static Float unmult;
static int _new(::hx::Null< int > bgra);
static ::Dynamic _new_dyn();
static int create(int b,int g,int r,int a);
static ::Dynamic create_dyn();
static void multiplyAlpha(int this1);
static ::Dynamic multiplyAlpha_dyn();
static void readUInt8(int this1, ::lime::utils::ArrayBufferView data,int offset,::hx::Null< int > format,::hx::Null< bool > premultiplied);
static ::Dynamic readUInt8_dyn();
static void set(int this1,int b,int g,int r,int a);
static ::Dynamic set_dyn();
static void unmultiplyAlpha(int this1);
static ::Dynamic unmultiplyAlpha_dyn();
static void writeUInt8(int this1, ::lime::utils::ArrayBufferView data,int offset,::hx::Null< int > format,::hx::Null< bool > premultiplied);
static ::Dynamic writeUInt8_dyn();
static int _hx___fromARGB(int argb);
static ::Dynamic _hx___fromARGB_dyn();
static int _hx___fromRGBA(int rgba);
static ::Dynamic _hx___fromRGBA_dyn();
static int get_a(int this1);
static ::Dynamic get_a_dyn();
static int set_a(int this1,int value);
static ::Dynamic set_a_dyn();
static int get_b(int this1);
static ::Dynamic get_b_dyn();
static int set_b(int this1,int value);
static ::Dynamic set_b_dyn();
static int get_g(int this1);
static ::Dynamic get_g_dyn();
static int set_g(int this1,int value);
static ::Dynamic set_g_dyn();
static int get_r(int this1);
static ::Dynamic get_r_dyn();
static int set_r(int this1,int value);
static ::Dynamic set_r_dyn();
};
} // end namespace lime
} // end namespace math
} // end namespace _BGRA
#endif /* INCLUDED_lime_math__BGRA_BGRA_Impl_ */
| [
"[email protected]"
] | |
1ae3a5272cb4ce56afbab00c8deee65962916adf | b4fe6f4a6e4059563d4e158eca4e2da46aca36ed | /Project_C/Project_C/Project_C.cpp | c548a9512af9a4c196c23ac89f0bda39737e78ac | [] | no_license | aliyazdi75/Cells_Life | 71da1b9591337238805783d8d04afda707f88f24 | 195eafe0d65410d60e9935a6547f7f75aefeab7e | refs/heads/master | 2021-01-11T19:29:46.158535 | 2017-01-18T20:02:51 | 2017-01-18T20:02:51 | 79,379,542 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,075 | cpp | unsigned char Energy_Cell_harif[100][100];
int psn_of_Cell_harif[15][15];
#include "Cells.h"
#include "Multi_Player.h"
void clrscr();
void gotoxy(int x, int y);
int randn(int m, int n);
void print_square(int x, int y, int k);
int Print_Screen(void);
int Update_Screen();
int Load_map();
int move_cell(int d, int b, int c);
int save_game();
int Allowed_block();
int split_cell();
int boost_energy();
int show_MoveMenu();
int show_MainMenu();
int select_cell();
int show_Menu();
int Load_menu_map();
int New_Game();
int Map_Editor();
int move_cell_harif(int d, int xm, int ym);
int boost_energy_in_multi();
int show_MoveMenu_in_multi();
int show_MainMenu_in_multi();
int select_cell_in_multi();
int show_Menu_in_multi();
int paly_multi_player();
int main(void) {
//Final Project
a: srand(time(NULL));
int i, j, k;
char c;
clrscr();
gotoxy(0, 0);
for (j = 0;j < 4 * fs.height + 6;j++) {
for (i = 0;i < 60;i++)
printf(" ");
printf("\n");
}
gotoxy(0, 0);
printf("[1] Load\n[2] New single player game\n[3] New Multiplayer game\n[4] Map Editor\n[5] Exit\n");
b: c = getch();
if (c == 49) { //Load
clrscr();
k = Load_menu_map();
clrscr();
if (k == -1)
goto a;
}
else if (c == 50) { //New single player game
clrscr();
printf("Enter cells number: ");
scanf("%d", &xn);
clrscr();
k = New_Game();
if (k == -1)
goto a;
}
else if (c == 51) { //New Multiplayer game
clrscr();
q++;
k = paly_multi_player();
clrscr();
if (k == -1)
goto a;
}
else if (c == 52) { //Map Editor
k = Map_Editor();
clrscr();
if (k == -1)
goto a;
}
else if (c == 53) {//Exit
exit(0);
}
else {
goto b;
}
return 0;
}
int Load_map() {
int i, j, k, a, b;
char c, inname[30];
FILE *fp;
clrscr();
gotoxy(0, 0);
printf("How:\n[1] Text\n[2] Binary");
a: c = getch();
if (c == 49) { //Text
clrscr();
gotoxy(0, 0);
printf("Enter Your Map Name To Open (WITH NO FORMAT): ");
scanf("%s", inname);
strcat(inname, ".txt");
fp = fopen(inname, "r+");
if (fp == NULL) {
clrscr();
printf("Cannot open file, Try again with Enter!\n");
getch();
return -1;
}
clrscr();
fgets(arr, 50, fp);
fscanf(fp, "[%d*%d]", &fs.width, &fs.height);
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell[j][i] = -1;
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell_harif[j][i] = -1;
fgets(arr, 50, fp);
fgets(arr, 50, fp);
fgets(arr, 50, fp);
for (i = 0;i < fs.width;i++) {
for (j = fs.height - 1;j >= 0;j--) {
for (k = 0;k < 10;k++)
arr2[k] = 0;
a = fs.height - j - 1;
fscanf(fp, "[(%d,%d) = %d, %s", &i, &j, &Energy_Cell[a][i * 4], arr2);
if (strcmp(arr2, "Source]") == 0)
Block_Cell[a][i] = '1';
else if (strcmp(arr2, "Split]") == 0)
Block_Cell[a][i] = '2';
else if (strcmp(arr2, "Wall]") == 0)
Block_Cell[a][i] = '3';
else if (strcmp(arr2, "Normal]") == 0)
Block_Cell[a][i] = '4';
fgets(arr, 50, fp);
}
}
fgets(arr, 50, fp);
fscanf(fp, "%d", &x1);
fgets(arr, 50, fp);
fgets(arr, 60, fp);
for (k = 0;k < x1;k++) {
fscanf(fp, "[(%d,%d", &i, &j);
fscanf(fp, ") = %d]", &psn_of_Cell[j][i]);
fgets(arr, 50, fp);
}
fclose(fp);
}
else if (c == 50) { //Binary
clrscr();
gotoxy(0, 0);
printf("Enter Your Map Name To Open (WITH NO FORMAT): ");
scanf("%s", inname);
strcat(inname, ".bin");
fp = fopen(inname, "r+b");
if (fp == NULL) {
clrscr();
printf("Cannot open file, Try again with Enter!\n");
getch();
return -1;
}
clrscr();
fread(&fs, sizeof(fs), 1, fp);
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell[j][i] = -1;
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell_harif[j][i] = -1;
for (i = 0;i < fs.width;i++) {
for (j = fs.height - 1;j >= 0;j--) {
a = fs.height - 1 - j;
fread(&Energy_Cell[a][i * 4], 4, 1, fp);
fread(&Block_Cell[a][i], 1, 1, fp);
}
}
fread(&x1, sizeof(int), 1, fp);
for (i = 0;i < fs.width;i++) {
for (j = fs.height - 1;j >= 0;j--) {
fread(&psn_of_Cell[j][i], sizeof(int), 1, fp);
}
}
fclose(fp);
}
else {
goto a;
}
if (xn < x1 && xn != 0) {
return -2;
}
if (x1 > 1 && xn == 0 && q == 1)
return 0;
Update_Screen();
return 0;
}
int show_Menu() {
a: char c;
int i, j;
gotoxy(0, fs.height * 4 + 4);
printf("[1] Select a cell\n[2] Save\n[3] Return\n");
b: c = getch();
if (c == 49) { //Select a cell
select_cell();
goto a;
}
else if (c == 50) { //Save
save_game();
goto a;
}
else if (c == 51) { //Return
return -1;
}
else {
goto b;
}
return 0;
}
int Load_menu_map() {
int k;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
k = Load_map();
if (k == -1)
return -1;
SetConsoleTextAttribute(hConsole, 15);
gotoxy(0, fs.height * 4 + 4);
k = show_Menu();
if (k == -1)
return -1;
return 0;
}
int New_Game() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
int i, j, k, a, b;
char c;
clrscr();
gotoxy(0, 0);
printf("Which Map:\n[1] Defult Map\n[2] My Selction Map");
a: c = getch();
if (c == 49) {
fs.width = 4;
fs.height = 4;
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell[j][i] = -1;
Energy_Cell[0][0] = 30;
Energy_Cell[1][4] = 60;
Energy_Cell[2][8] = 90;
Energy_Cell[3][8] = 45;
Energy_Cell[3][12] = 20;
Block_Cell[0][0] = '1';
Block_Cell[0][1] = '4';
Block_Cell[0][2] = '4';
Block_Cell[0][3] = '2';
Block_Cell[1][0] = '2';
Block_Cell[1][1] = '1';
Block_Cell[1][2] = '4';
Block_Cell[1][3] = '2';
Block_Cell[2][0] = '2';
Block_Cell[2][1] = '2';
Block_Cell[2][2] = '1';
Block_Cell[2][3] = '4';
Block_Cell[3][0] = '3';
Block_Cell[3][1] = '3';
Block_Cell[3][2] = '1';
Block_Cell[3][3] = '1';
for (j = fs.height - 1;j >= 0;j--)
for (i = fs.width - 1;i >= 0;i--)
psn_of_Cell_harif[j][i] = -1;
}
else if (c == 50) {
k = Load_map();
if (k == -1)
return -1;
if (k == -2) {
clrscr();
printf("Your cell number is less than your selection map's cells, Try again with more cell number by Enter!");
getch();
return -1;
}
}
else {
goto a;
}
if (xn < fs.height*fs.width - cnt_wall) {
for (k = x1;k < xn;k++) {
b: a = fs.height - randn(0, fs.height) - 1;
b = randn(0, fs.width);
if (Block_Cell[a][b] == '3' || psn_of_Cell[fs.height - 1 - a][b] == 0)
goto b;
else {
psn_of_Cell[fs.height - 1 - a][b] = 0;
if (b % 2 == 0) {
SetConsoleTextAttribute(hConsole, 14);
gotoxy(b * 7 + 3, a * 4 + 2);
printf("X");
}
else {
SetConsoleTextAttribute(hConsole, 14);
gotoxy(b * 7 + 3, a * 4 + 4);
printf("X");
}
}
}
Update_Screen();
SetConsoleTextAttribute(hConsole, 15);
gotoxy(0, fs.height * 4 + 4);
k = show_Menu();
if (k == -1)
return -1;
}
else {
SetConsoleTextAttribute(hConsole, 15);
clrscr();
printf("Please select a correct number!");
return -1;
}
return 0;
}
//What to do :
| [
"[email protected]"
] | |
28887d0027842d64e89670153dbcaafca7649c30 | 3802c1706af3287ace2351bee0d49689f1f3e362 | /AshIDE/SettingsWindow.h | dce5c76f4c1234066f1b145d76fd67ff0f2a1b4a | [] | no_license | bjackson/LC3Tools | 6114560fc3421184151e5ea25c6b41dbee38dc97 | ecf35b883e82891460d45264cdb3a1e4996c72d0 | refs/heads/master | 2021-01-16T20:55:56.899035 | 2016-04-22T21:28:00 | 2016-04-22T21:28:00 | 56,454,202 | 0 | 0 | null | 2016-04-17T19:25:35 | 2016-04-17T19:25:35 | null | UTF-8 | C++ | false | false | 3,206 | h | // Copyright 2003 Ashley Wise
// University Of Illinois Urbana-Champaign
// [email protected]
#ifndef SETTINGSWINDOW_H
#define SETTINGSWINDOW_H
#pragma warning (disable:4786)
#include <FL/Fl_Group.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
#include "../Assembler/Base.h"
#include "Project.h"
using namespace std;
using namespace JMT;
namespace AshIDE
{
class SettingsWindow : public Fl_Group
{
protected:
friend class MainWindow;
//Widgets for the project settings
Fl_Group *pSettings;
Fl_Group *pProjectSettings;
Fl_Check_Button *pProjectSetting[NUM_PROJECT_SETTINGS];
Fl_Group *pFileSettings;
Fl_Button *pDefineAddDlg, *pDefineRemove;
Fl_Choice *pDefines;
Fl_Button *pAssemble, *pBuild, *pSimulate;
//Widgets for the file settings
Fl_Check_Button *pFileSetting[NUM_PROJECT_FILE_SETTINGS];
Fl_Choice *pLanguage;
Fl_Choice *pSourceType;
Fl_Button *pAssembleFile;
//Widgets for the pre-processor define dialog
Fl_Window *pDefineDlg;
Fl_Input *pDefineIdentifier, *pDefineValue;
Fl_Return_Button *pDefineAdd;
Fl_Button *pDefineCancel;
public:
/**********************************************************************\
SettingsWindow( [in] x, [in] y, [in] width, [in] height )
Constructs the message window.
This window only displays text, there is no editing.
\******/
SettingsWindow(int, int, int, int);
/**********************************************************************\
~SettingsWindow( )
Destructor
\******/
virtual ~SettingsWindow();
//*** Project Settings Management Functions ***//
/**********************************************************************\
InitProjectSettings( )
Initializes the project settings based on the current project.
\******/
bool InitProjectSettings();
static void ProjectSettingCB(Fl_Widget *pW, void *pV) { TheProject.SetSetting((Project::SettingEnum)(unsigned int)pV, ((Fl_Button *)pW)->value() != 0); }
static void DefineAddDlgCB(Fl_Widget *pW, void *pV);
bool DefineAddDlg();
static void DefineRemoveCB(Fl_Widget *pW, void *pV) { ((SettingsWindow *)pV)->DefineRemove(); }
bool DefineRemove();
static void DefineAddCB(Fl_Widget *pW, void *pV) { ((SettingsWindow *)pV)->DefineAdd(); }
bool DefineAdd();
static void DefineCancelCB(Fl_Widget *pW, void *pV) { ((SettingsWindow *)pV)->DefineCancel(); }
bool DefineCancel();
//*** File Settings Management Functions ***//
/**********************************************************************\
InitFileSettings( )
Initializes the file settings based on the current file in the current project.
\******/
bool InitFileSettings();
static void FileSettingCB(Fl_Widget *pW, void *pV) { if(TheProject.pFile) TheProject.pFile->SetSetting((Project::FileData::FileSettingEnum)(unsigned int)pV, ((Fl_Button *)pW)->value() != 0); }
static void LanguageCB(Fl_Widget *pW, void *pV) { ((SettingsWindow *)pV)->Language(); }
bool Language();
static void SourceTypeCB(Fl_Widget *pW, void *pV) { ((SettingsWindow *)pV)->SourceType(); }
bool SourceType();
};
}
#endif
| [
"[email protected]"
] | |
baba375399a6aeaf496fdc28e53fc55b6400e143 | fd42310229173b2e1c64fb5c27d7729664f3be2e | /Homeworks/Hw3/src/patron.cpp | ffe8632af5425510bd8d3467fc2ddd9786a21e8c | [] | no_license | quantumlycharmed/UNT | 29d7842b9331a10cced25d1ba574fb057a43f504 | efafa40e0f73b680042e4c481a1ec5573ac86264 | refs/heads/main | 2023-04-05T13:44:56.395719 | 2021-03-31T18:03:37 | 2021-03-31T18:03:37 | 353,447,484 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19 | cpp | #include "patron.h" | [
"[email protected]"
] | |
c57a23757a0041e67185c40ca383d3a1fb62215e | 0f281a124dc184d3facac4320e568188d027089a | /sp5/Queue.cpp | dcd4f3824f8143f7449fe3ddab87ded494f8dde5 | [] | no_license | tonussi/so | b0feb8b050b3c65f0b3e6a1c532cd122721504e0 | 8b66193c4988d04636a1c2a11f528288004d2496 | refs/heads/master | 2021-01-17T02:31:20.450476 | 2016-10-11T11:25:41 | 2016-10-11T11:25:41 | 54,274,846 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 332 | cpp | /*
* File: Queue.cpp
* Author: <preencher>
*
* Created on September 27, 2015, 11:28 AM
*/
#include "Queue.h"
template <class T> Queue<T>::Queue() : std::list<T>() {
}
template <class T> Queue<T>::Queue(const Queue& orig) : std::list<T>(orig) {
}
template <class T> Queue<T>::~Queue() {
}
// INSERT YOUR CODE HERE
// ...
| [
"[email protected]"
] | |
5f7477d21db4620b2933830c9415d51fac77a649 | e8ae83f378a3f373ab3a7ebb058da5c8a91e13ff | /Roguelike/Code/Game/Inventory.cpp | 4a440a9da667eb6d5ea132820cdc2c9a425efa6d | [
"MIT"
] | permissive | cugone/Roguelike | 417cea31ddbb650ab72d55d0a90e5336ee4362bd | a62e83df50fda7311f8c89828cd68789de88d9e6 | refs/heads/master | 2023-01-27T20:36:48.213029 | 2023-01-24T16:01:06 | 2023-01-24T16:01:06 | 181,536,221 | 0 | 2 | MIT | 2023-01-20T02:00:30 | 2019-04-15T17:38:06 | C++ | UTF-8 | C++ | false | false | 6,543 | cpp | #include "Game/Inventory.hpp"
#include "Engine/Core/ErrorWarningAssert.hpp"
#include "Game/GameCommon.hpp"
#include "Game/Item.hpp"
#include "Game/Layer.hpp"
#include <utility>
Inventory::Inventory(const XMLElement& elem) noexcept
{
LoadFromXml(elem);
}
Item* Inventory::HasItem(const Item* item) const noexcept {
if(!item) {
return nullptr;
}
auto found_iter = std::find(std::begin(_items), std::end(_items), item);
if(found_iter != std::end(_items)) {
return *found_iter;
}
return nullptr;
}
Item* Inventory::HasItem(const std::string& name) const noexcept {
auto found_iter = std::find_if(std::begin(_items), std::end(_items), [&name](const Item* item) { return StringUtils::ToLowerCase(item->GetName()) == StringUtils::ToLowerCase(name); });
if(found_iter != std::end(_items)) {
return *found_iter;
}
return nullptr;
}
void Inventory::AddStack(Item* item, std::size_t count) noexcept {
if(auto* i = HasItem(item)) {
i->AdjustCount(count);
} else {
i = AddItem(item);
i->SetCount(count);
}
}
void Inventory::AddStack(const std::string& name, std::size_t count) noexcept {
if(auto* item = HasItem(name)) {
item->AdjustCount(count);
} else {
if((item = AddItem(name)) != nullptr) {
item->SetCount(count);
}
}
}
Item* Inventory::AddItem(Item* item) noexcept {
if(item) {
if(auto i = HasItem(item)) {
i->IncrementCount();
return i;
} else {
_items.push_back(item);
_items.back()->IncrementCount();
return _items.back();
}
}
return nullptr;
}
Item* Inventory::AddItem(const std::string& name) noexcept {
if(auto* item_in_inventory = HasItem(name)) {
item_in_inventory->IncrementCount();
return item_in_inventory;
} else {
if(auto* item_in_registry = Item::GetItem(name)) {
_items.push_back(item_in_registry);
_items.back()->IncrementCount();
return _items.back();
}
}
return nullptr;
}
void Inventory::RemoveItem(Item* item) noexcept {
if(item) {
if(auto i = HasItem(item)) {
if(!i->DecrementCount()) {
auto found_iter = std::find(std::begin(_items), std::end(_items), i);
if(found_iter != std::end(_items)) {
_items.erase(found_iter);
}
}
}
}
}
void Inventory::RemoveItem(Item* item, std::size_t count) noexcept {
if(item) {
if(auto i = HasItem(item)) {
if(count < i->GetCount()) {
i->AdjustCount(-static_cast<long long>(count));
} else {
RemoveItem(i);
}
}
}
}
void Inventory::RemoveItem(const std::string& name) noexcept {
if(auto i = HasItem(name)) {
if(!i->DecrementCount()) {
auto found_iter = std::find(std::begin(_items), std::end(_items), i);
if(found_iter != std::end(_items)) {
_items.erase(found_iter);
}
}
}
}
const Item* Inventory::GetItem(const std::string& name) const noexcept {
auto found_iter = std::find_if(std::begin(_items), std::end(_items), [&name](const Item* item)->bool { return item->GetName() == name; });
if(found_iter == std::end(_items)) {
return nullptr;
}
return *found_iter;
}
const Item* Inventory::GetItem(std::size_t idx) const noexcept {
if(_items.size() < idx) {
return nullptr;
}
return _items[idx];
}
Item* Inventory::GetItem(const std::string& name) noexcept {
return const_cast<Item*>(static_cast<const Inventory&>(*this).GetItem(name));
}
Item* Inventory::GetItem(std::size_t idx) noexcept {
return const_cast<Item*>(static_cast<const Inventory&>(*this).GetItem(idx));
}
bool Inventory::TransferItem(Inventory& source, Inventory& dest, Item* item) noexcept {
source.RemoveItem(item);
return dest.AddItem(item) != nullptr;
}
bool Inventory::TransferItem(Inventory& dest, Item* item) noexcept {
return Inventory::TransferItem(*this, dest, item);
}
bool Inventory::TransferItem(Inventory& source, Inventory& dest, const std::string& name) noexcept {
auto item = source.GetItem(name);
source.RemoveItem(item);
return dest.AddItem(item) != nullptr;
}
bool Inventory::TransferItem(Inventory& dest, const std::string& name) noexcept {
return Inventory::TransferItem(*this, dest, name);
}
void Inventory::TransferAll(Inventory& source, Inventory& dest) noexcept {
for(const auto& item : source) {
dest.AddItem(item);
}
source.clear();
}
void Inventory::TransferAll(Inventory& dest) noexcept {
return Inventory::TransferAll(*this, dest);
}
std::size_t Inventory::size() const noexcept {
return _items.size();
}
bool Inventory::empty() const noexcept {
return _items.empty();
}
void Inventory::clear() noexcept {
_items.clear();
}
Inventory::iterator Inventory::begin() noexcept {
return _items.begin();
}
Inventory::iterator Inventory::end() noexcept {
return _items.end();
}
Inventory::const_iterator Inventory::begin() const noexcept {
return _items.begin();
}
Inventory::const_iterator Inventory::end() const noexcept {
return _items.end();
}
Inventory::const_iterator Inventory::cbegin() const noexcept {
return _items.cbegin();
}
Inventory::const_iterator Inventory::cend() const noexcept {
return _items.cend();
}
Inventory::reverse_iterator Inventory::rbegin() noexcept {
return _items.rbegin();
}
Inventory::reverse_iterator Inventory::rend() noexcept {
return _items.rend();
}
Inventory::const_reverse_iterator Inventory::rbegin() const noexcept {
return _items.rbegin();
}
Inventory::const_reverse_iterator Inventory::rend() const noexcept {
return _items.rend();
}
Inventory::const_reverse_iterator Inventory::crbegin() const noexcept {
return _items.crbegin();
}
Inventory::const_reverse_iterator Inventory::crend() const noexcept {
return _items.crend();
}
void Inventory::LoadFromXml(const XMLElement& elem) {
DataUtils::ValidateXmlElement(elem, "inventory", "item", "");
DataUtils::ForEachChildElement(elem, "item",
[this](const XMLElement& elem) {
auto item_name = DataUtils::ParseXmlAttribute(elem, "name", std::string{});
if(auto item = Item::GetItem(item_name)) {
_items.emplace_back(item);
}
});
}
| [
"[email protected]"
] | |
ee4bd505cadbda86e99115efd4662cd31acda0c7 | 60bb67415a192d0c421719de7822c1819d5ba7ac | /blazetest/src/mathtest/dmatsmatschur/DDbMIb.cpp | 84bbdd5742aa28e7a0b26a792ff2fcff0cf67cd1 | [
"BSD-3-Clause"
] | permissive | rtohid/blaze | 48decd51395d912730add9bc0d19e617ecae8624 | 7852d9e22aeb89b907cb878c28d6ca75e5528431 | refs/heads/master | 2020-04-16T16:48:03.915504 | 2018-12-19T20:29:42 | 2018-12-19T20:29:42 | 165,750,036 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,994 | cpp | //=================================================================================================
/*!
// \file src/mathtest/dmatsmatschur/DDbMIb.cpp
// \brief Source file for the DDbMIb dense matrix/sparse matrix Schur product math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. 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 names of the Blaze development group 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.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/DiagonalMatrix.h>
#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/IdentityMatrix.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/dmatsmatschur/OperationTest.h>
#include <blazetest/system/MathTest.h>
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running 'DDbMIb'..." << std::endl;
using blazetest::mathtest::TypeB;
try
{
// Matrix type definitions
using DDb = blaze::DiagonalMatrix< blaze::DynamicMatrix<TypeB> >;
using MIb = blaze::IdentityMatrix<TypeB>;
// Creator type definitions
using CDDb = blazetest::Creator<DDb>;
using CMIb = blazetest::Creator<MIb>;
// Running tests with small matrices
for( size_t i=0UL; i<=6UL; ++i ) {
RUN_DMATSMATSCHUR_OPERATION_TEST( CDDb( i ), CMIb( i ) );
}
// Running tests with large matrices
RUN_DMATSMATSCHUR_OPERATION_TEST( CDDb( 67UL ), CMIb( 67UL ) );
RUN_DMATSMATSCHUR_OPERATION_TEST( CDDb( 128UL ), CMIb( 128UL ) );
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during dense matrix/sparse matrix Schur product:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| [
"[email protected]"
] | |
0e83d6cd153da2e65fda496d18562963a2eab688 | 5aaa3824fe15e80c7ee5a5150a7a14d15d8d3089 | /engine/include/PerformanceTest.h | 8ca59a0f0d0e3d3485d9363baf5de4babda45869 | [
"MIT"
] | permissive | Vbif/geometric-diversity | a7314d5eb2c4182925e8cb901ba054a6d39e1933 | 6e9d5a923db68acb14a0a603bd2859f4772db201 | refs/heads/master | 2021-09-04T02:15:33.285195 | 2018-01-14T13:56:50 | 2018-01-14T13:56:50 | 115,753,012 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 748 | h | #ifndef __PerformanceTest_h__
#define __PerformanceTest_h__
#if defined(_MSC_VER) && (_MSC_VER > 1300)
#pragma once
#endif
namespace Render {
class Target;
class Texture;
}
///
/// Измеряет производительность видеосистемы
///
class PerformanceTest {
public:
static const int kTargetSize, kTextureSize, kLoopSize, kEstimateCount;
PerformanceTest();
~PerformanceTest();
float Estimate(int loopSize = kLoopSize, int estimateCount = kEstimateCount) const;
private:
float Run(int loopSize) const;
PerformanceTest(const PerformanceTest&);
const PerformanceTest& operator=(const PerformanceTest&);
private:
Render::Target* _target;
Render::Texture* _texture;
};
#endif // __PerformanceTest_h__
| [
"[email protected]"
] | |
05cd2cf9a7b84136e265a663367451ac5f7f61ba | c88a1c6623b40dca33d80d8be89a35b451bfe28b | /MQ2Main/ArrayClass.h | 9f3a933b96b6d12c8bcf2d55dd0806d5480984d5 | [] | no_license | thepluralevan/macroquest2 | de941d6fdea91094689af1f9f277ccb4f93ed603 | d5d72d9ac297067ea4f93e30d66efda3ac765398 | refs/heads/master | 2020-08-03T08:41:51.443441 | 2019-09-18T22:21:08 | 2019-09-18T22:21:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,957 | h | /*****************************************************************************
MQ2Main.dll: MacroQuest2's extension DLL for EverQuest
Copyright (C) 2002-2003 Plazmic, 2003-2005 Lax
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
******************************************************************************/
#pragma once
#include <cstdint>
#pragma pack(push)
#pragma pack(4)
struct CStrPtr
{
int RefCount;
long MaxLength;
long Length;
int Encoding;
void *Buff;
union
{
char Ansi[1000];
wchar_t Unicode[500];
CStrPtr* pNext;
};
};
class CCXStr
{
public:
EQLIB_OBJECT CCXStr& operator= (char const *str);
CStrPtr* Ptr;
};
//----------------------------------------------------------------------------
class CDynamicArrayBase;
struct CEQException {};
struct CExceptionApplication : CEQException {};
struct CExceptionMemoryAllocation : public CEQException {
int size;
CExceptionMemoryAllocation(int size_) : size(size_) {}
};
// inherits from CExceptionApplication and CEQException
struct CDynamicArrayException : public CExceptionApplication {
const CDynamicArrayBase* obj;
CDynamicArrayException(const CDynamicArrayBase* obj_) : obj(obj_) {}
};
// base class for the dynamic array types
class CDynamicArrayBase
{
protected:
/*0x00*/ int m_length;
/*0x04*/
public:
// two names for the same thing
int GetLength() const { return m_length; }
// a microsoft extension - lets us get away with changing the implementation
__declspec(property(get = GetLength)) int Count;
protected:
void ThrowArrayClassException() const
{
throw CDynamicArrayException(this);
}
};
// split into two types - one that is read-only and does not allocate or modify
// memory, and one that can. Be careful using the ones that can modify memory,
// as you can't memcpy, memset, etc on them.
template <typename T>
class ArrayClass2_RO : public CDynamicArrayBase
{
#define GET_BIN_INDEX(x) (x >> static_cast<uint8_t>(m_binShift))
#define GET_SLOT_INDEX(x) (m_slotMask & index)
public:
inline T& operator[](int index) { return Get(index); }
inline const T& operator[](int index) const { return Get(index); }
T& Get(int index) { return m_array[GET_BIN_INDEX(index)][GET_SLOT_INDEX(index)]; }
inline const T& Get(int index) const { return m_array[GET_BIN_INDEX(index)][GET_SLOT_INDEX(index)]; }
// try to get an element by index, returns pointer to the element.
// if the index is out of bounds, returns null.
T* SafeGet(int index)
{
if (index < m_length)
{
int bin = GET_BIN_INDEX(index);
if (bin < m_binCount)
{
int slot = GET_SLOT_INDEX(index);
if (slot < m_maxPerBin)
{
return &m_array[bin][slot];
}
}
}
return nullptr;
}
bool IsMember(const T& element) const
{
if (m_length <= 0)
return false;
for (int i = 0; i < m_length; ++i) {
if (Get(i) == element)
return true;
}
return false;
}
protected:
/*0x04*/ int m_maxPerBin;
/*0x08*/ int m_slotMask;
/*0x0c*/ int m_binShift;
/*0x10*/ T** m_array;
/*0x14*/ int m_binCount;
#if !defined(TEST) && !defined(LIVE)
/*0x18*/ bool m_valid;
#endif
/*0x1c*/
};
#undef GET_BIN_INDEX
#undef GET_SLOT_INDEX
//----------------------------------------------------------------------------
// ArrayClass2 is a dynamic array implementation that makes use of bins
// to reduce the overhead of reallocation. This allows for faster resize
// operations as existing bins do not need to be relocated, just the
// list of bins. See Assure() for more information.
template <typename T>
class ArrayClass2 : public ArrayClass2_RO<T>
{
public:
// constructs the array
ArrayClass2()
{
m_maxPerBin = 1;
m_binShift = 0;
do {
m_maxPerBin <<= 1;
m_binShift++;
} while (m_maxPerBin < 32);
m_slotMask = m_maxPerBin - 1;
m_array = nullptr;
m_length = 0;
m_binCount = 0;
#if !defined(TEST) && !defined(LIVE)
m_valid = true;
#endif
}
ArrayClass2(const ArrayClass2& rhs) : ArrayClass2()
{
this->operator=(rhs);
}
~ArrayClass2()
{
Reset();
}
ArrayClass2& operator=(const ArrayClass2& rhs)
{
if (this != &rhs)
{
if (m_array)
m_length = 0;
if (rhs.m_length) {
Assure(rhs.m_length);
#if !defined(TEST) && !defined(LIVE)
if (m_valid)
#endif
{
for (int i = 0; i < rhs.m_length; ++i)
Get(i) = rhs.Get(i);
}
m_length = rhs.m_length;
}
}
return *this;
}
// clear the contents of the array and make it empty
void Reset()
{
for (int i = 0; i < m_binCount; ++i)
delete[] m_array[i];
delete[] m_array;
m_array = nullptr;
m_binCount = 0;
m_length = 0;
}
void Add(const T& value)
{
SetElementIdx(m_length, value);
}
void InsertElement(int index, const T& value)
{
if (index >= 0) {
if (index < m_length) {
Assure(m_length + 1);
for (int idx = m_length; idx > index; --idx)
Get(idx) = Get(idx - 1);
Get(index) = value;
++m_length;
}
else {
SetElementIdx(index, value);
}
}
}
void SetElementIdx(int index, const T& value)
{
if (index >= 0) {
if (index >= m_length) {
Assure(index + 1);
#if !defined(TEST) && !defined(LIVE)
if (m_valid) {
#else
{
#endif
m_length = index + 1;
}
}
#if !defined(TEST) && !defined(LIVE)
if (m_valid) {
#else
{
#endif
Get(index) = value;
}
}
}
void DeleteElement(int index)
{
if (index >= 0 && index < m_length && m_array) {
for (; index < m_length - 1; ++index)
Get(index) = Get(index + 1);
--m_length;
}
}
private:
// Assure() makes sure that there is enough allocated space for
// the requested size. This is the primary function used for allocating
// memory in ArrayClass2. Because the full array is broken down into
// a set of bins, it is more efficient at growing than ArrayClass.
// When the array needs to be resized, it only needs to reallocate the
// list of bins and create more bins. Existing bins do not need to be
// reallocated, they can just be copied to the new list of bins.
void Assure(int requestedSize)
{
#if !defined(TEST) && !defined(LIVE)
if (m_valid && requestedSize > 0) {
#else
//if (m_binCount && requestedSize > 0) {
if (requestedSize > 0) {
#endif
int newBinCount = ((requestedSize - 1) >> static_cast<int8_t>(m_binShift)) + 1;
if (newBinCount > m_binCount) {
T** newArray = new T*[newBinCount];
if (newArray) {
for (int i = 0; i < m_binCount; ++i)
newArray[i] = m_array[i];
for (int curBin = m_binCount; curBin < newBinCount; ++curBin) {
T* newBin = new T[m_maxPerBin];
newArray[curBin] = newBin;
if (!newBin) {
#if !defined(TEST) && !defined(LIVE)
m_valid = false;
#else
//m_binCount = 0;
#endif
break;
}
}
#if !defined(TEST) && !defined(LIVE)
if (m_valid)
#endif
{
delete[] m_array;
m_array = newArray;
m_binCount = newBinCount;
}
} else {
#if !defined(TEST) && !defined(LIVE)
m_valid = false;
#else
//m_binCount = 0;
#endif
}
}
// special note about this exception: the eq function was written this way,
// but its worth noting that new will throw if it can't allocate, which means
// this will never be hit anyways. The behavior would not change if we removed
// all of the checks for null returns values from new in this function.
#if !defined(TEST) && !defined(LIVE)
if (!m_valid) {
Reset();
ThrowArrayClassException();
}
#endif
}
}
};
//----------------------------------------------------------------------------
// simpler than ArrayClass2, ArrayClass is a simple wrapper around a dynamically
// allocated array. To grow this array requires reallocating the entire array and
// copying objects into the new array.
template <typename T>
class ArrayClass_RO : public CDynamicArrayBase
{
public:
T& Get(int index)
{
if (index >= m_length || index < 0 || m_array == nullptr)
ThrowArrayClassException();
return m_array[index];
}
const T& Get(int index) const
{
if (index >= m_length || index < 0 || m_array == nullptr)
ThrowArrayClassException();
return m_array[index];
}
//0090C580
EQLIB_OBJECT void DeleteElement(int index);
T& operator[](int index) { return Get(index); }
const T& operator[](int index) const { return Get(index); }
// const function that returns the element at the index *by value*
T GetElementIdx(int index) const { return Get(index); }
protected:
/*0x04*/ T* m_array;
/*0x08*/ int m_alloc;
/*0x0c*/ bool m_isValid;
/*0x10*/
};
template <typename T>
class ArrayClass : public ArrayClass_RO<T>
{
public:
ArrayClass()
{
m_length = 0;
m_array = nullptr;
m_alloc = 0;
m_isValid = true;
}
ArrayClass(int reserve) : ArrayClass()
{
m_array = new T[reserve];
m_alloc = reserve;
}
ArrayClass(const ArrayClass& rhs) : ArrayClass()
{
if (rhs.m_length) {
AssureExact(rhs.m_length);
if (m_array) {
for (int i = 0; i < rhs.m_length; ++i)
m_array[i] = rhs.m_array[i];
}
m_length = rhs.m_length;
}
}
~ArrayClass()
{
Reset();
}
ArrayClass& operator=(const ArrayClass& rhs)
{
if (this == &rhs)
return *this;
Reset();
if (rhs.m_length) {
AssureExact(rhs.m_length);
if (m_array) {
for (int i = 0; i < rhs.m_length; ++i)
m_array[i] = rhs.m_array[i];
}
m_length = rhs.m_length;
}
return *this;
}
void Reset()
{
if (m_array) {
delete[] m_array;
}
m_array = nullptr;
m_alloc = 0;
m_length = 0;
}
void Add(const T& element)
{
SetElementIdx(m_length, element);
}
T *GetBuffPtr()
{
return m_array;
}
void SetElementIdx(int index, const T& element)
{
if (index >= 0) {
if (index >= m_length) {
Assure(index + 1);
if (m_array) {
m_length = index + 1;
}
}
if (m_array) {
m_array[index] = element;
}
}
}
void InsertElement(int index, const T& element)
{
if (index >= 0) {
if (index < m_length) {
Assure(m_length + 1);
if (m_array) {
for (int idx = m_length; idx > index; --idx)
m_array[idx] = m_array[idx - 1];
m_array[index] = element;
m_length++;
}
} else {
SetElementIdx(index, element);
}
}
}
void DeleteElement(int index)
{
if (index >= 0 && index < m_length && m_array) {
for (; index < m_length - 1; ++index)
m_array[index] = m_array[index + 1];
m_length--;
}
}
void SetLength(int size)
{
AssureExact(size);
if (this->m_array)
this->m_length = size;
}
private:
// this function will ensure that there is enough space allocated for the
// requested size. the underlying array is one contiguous block of memory.
// In order to grow it, we will need to allocate a new array and move
// everything over.
// this function will allocate 2x the amount of memory requested as an
// optimization aimed at reducing the number of allocations that occur.
void Assure(int requestedSize)
{
if (requestedSize && (requestedSize > m_alloc || !m_array)) {
int allocatedSize = (requestedSize + 4) << 1;
T* newArray = new T[allocatedSize];
if (!newArray) {
delete[] m_array;
m_array = nullptr;
m_alloc = 0;
m_isValid = false;
throw CExceptionMemoryAllocation{ allocatedSize };
}
if (m_array) {
for (int i = 0; i < m_length; ++i)
newArray[i] = m_array[i];
delete[] m_array;
}
m_array = newArray;
m_alloc = allocatedSize;
}
}
// this behaves the same as Assure, except for its allocation of memory
// is exactly how much is requested.
void AssureExact(int requestedSize)
{
if (requestedSize && (requestedSize > m_alloc || !m_array)) {
T* newArray = new T[requestedSize];
if (!newArray) {
delete[] m_array;
m_array = nullptr;
m_alloc = 0;
m_isValid = false;
throw CExceptionMemoryAllocation(requestedSize);
}
if (m_array) {
for (int i = 0; i < m_length; ++i)
newArray[i] = m_array[i];
delete[] m_array;
}
m_array = newArray;
m_alloc = requestedSize;
}
}
};
struct HashTableStatistics
{
int TableSize;
int UsedSlots;
int TotalEntries;
};
struct ResizePolicyNoShrink
{
template <typename Hash>
static void ResizeOnAdd(Hash& hash)
{
HashTableStatistics hashStats;
hash.GetStatistics(&hashStats);
if (hashStats.TotalEntries * 100 / hashStats.TableSize > 70)
{
hash.Resize(hashStats.TableSize * 2);
}
}
};
struct ResizePolicyNoResize {};
template <typename T, typename Key = int, typename ResizePolicy = ResizePolicyNoResize>
class HashTable
{
public:
struct HashEntry
{
T Obj;
Key Key;
HashEntry *NextEntry;
};
template <typename K>
static unsigned HashValue(const K& key)
{
return key;
}
T* FindFirst(const Key& key) const;
int GetTotalEntries() const;
T* WalkFirst() const;
T* WalkNext(const T* prevRes) const;
void GetStatistics(HashTableStatistics* stats) const;
void Resize(int hashSize);
void Insert(const T& obj, const Key& key);
/*0x00*/ HashEntry **Table;
/*0x04*/ int TableSize;
/*0x08*/ int EntryCount;
/*0x0c*/ int StatUsedSlots;
/*0x10*/
};
template <typename T, typename Key, typename ResizePolicy>
void HashTable<T, Key, ResizePolicy>::GetStatistics(HashTableStatistics *stats) const
{
stats->TotalEntries = EntryCount;
stats->UsedSlots = StatUsedSlots;
stats->TableSize = TableSize;
}
inline bool IsPrime(int value)
{
for (int i = 2; i <= value / 2; ++i) {
if (value % i == 0)
return false;
}
return true;
}
inline int NextPrime(int value)
{
if (value % 2 == 0)
value++;
while (!IsPrime(value))
value += 2;
return(value);
}
template <typename T, typename Key, typename ResizePolicy>
void HashTable<T, Key, ResizePolicy>::Resize(int hashSize)
{
HashEntry** oldTable = Table;
int oldSize = TableSize;
TableSize = NextPrime(hashSize);
if (TableSize != oldSize)
{
Table = new HashEntry*[TableSize];
memset(Table, 0, sizeof(HashEntry*) * TableSize);
StatUsedSlots = 0;
if (EntryCount > 0)
{
for (int i = 0; i < oldSize; i++)
{
HashEntry* next = oldTable[i];
while (next != NULL)
{
HashEntry* hold = next;
next = next->NextEntry;
int spot = HashValue<Key>(hold->Key) % TableSize;
if (Table[spot] == NULL)
{
hold->NextEntry = NULL;
Table[spot] = hold;
StatUsedSlots++;
}
else
{
hold->NextEntry = Table[spot];
Table[spot] = hold;
}
}
}
}
delete[] oldTable;
}
}
template <typename T, typename Key, typename ResizePolicy>
T* HashTable<T, Key, ResizePolicy>::WalkFirst() const
{
for (int i = 0; i < TableSize; i++)
{
HashEntry *entry = Table[i];
if (entry != NULL)
return(&entry->Obj);
}
return NULL;
}
template <typename T, typename Key, typename ResizePolicy>
T* HashTable<T, Key, ResizePolicy>::WalkNext(const T* prevRes) const
{
HashEntry *entry = (HashEntry *)(((char *)prevRes) - offsetof(HashEntry, Obj));
int i = (HashValue<Key>(entry->Key)) % TableSize;
entry = entry->NextEntry;
if (entry != NULL)
return(&entry->Obj);
i++;
for (; i < TableSize; i++)
{
HashEntry *entry = Table[i];
if (entry != NULL)
return(&entry->Obj);
}
return NULL;
}
template <typename T, typename Key, typename ResizePolicy>
int HashTable<T, Key, ResizePolicy>::GetTotalEntries() const
{
return EntryCount;
}
template <typename T, typename Key, typename ResizePolicy>
T* HashTable<T, Key, ResizePolicy>::FindFirst(const Key& key) const
{
if (Table == NULL)
return NULL;
HashEntry* entry = Table[(HashValue<Key>(key)) % TableSize];
while (entry != NULL)
{
if (entry->Key == key)
return(&entry->Obj);
entry = entry->NextEntry;
}
return NULL;
}
template <typename T, typename Key, typename ResizePolicy>
void HashTable<T, Key, ResizePolicy>::Insert(const T& obj, const Key& key)
{
HashEntry *entry = new HashEntry;
entry->Obj = obj;
entry->Key = key;
int spot = HashValue<Key>(key) % TableSize;
if (Table[spot] == NULL)
{
entry->NextEntry = NULL;
Table[spot] = entry;
StatUsedSlots++;
}
else
{
entry->NextEntry = Table[spot];
Table[spot] = entry;
}
EntryCount++;
ResizePolicy::ResizeOnAdd(*this);
}
// lists
template <typename T, int _cnt>
class EQList;
template <typename T>
class EQList<T, -1>
{
public:
struct Node
{
T Value;
Node* pNext;
Node* pPrev;
};
/*0x00*/ void* vfTable;
/*0x04*/ Node* pFirst;
/*0x08*/ Node* pLast;
/*0x0c*/ int Count;
/*0x10*/
};
template <typename T, int _cnt = -1>
class EQList : public EQList<T, -1>
{};
// strings
template <typename TheType, unsigned int _Size>
class TSafeArrayStatic
{
public:
inline TheType& operator[](uint32_t index)
{
return Data[index];
}
TheType Data[_Size];
};
template <uint32_t _Len>
class TString : public TSafeArrayStatic<char, _Len>
{};
template <uint32_t _Len>
class TSafeString : public TString<_Len>
{};
class VePointerBase
{
public:
intptr_t Address;
};
template <class T>
class VePointer// : public VePointerBase
{
public:
VePointer();
~VePointer();
T* pObject;
};
template <class T>
VePointer<T>::VePointer()
{
//absolutely not do this here
//pObject = new T;
pObject = 0;
}
template <class T>
VePointer<T>::~VePointer()
{
//absolutely not do this here
//delete pObject;
}
template <typename T>
class VeArray
{
public:
T& operator[](uint32_t);
const T& operator[](uint32_t) const;
/*0x00*/ T* Begin;
/*0x04*/ uint32_t Size;
/*0x08*/ uint32_t Capacity;
/*0x0c*/
};
template <typename T>
const T& VeArray<T>::operator[](uint32_t i) const
{
return Begin[i];
}
template <typename T>
T& VeArray<T>::operator[](uint32_t i)
{
return Begin[i];
}
// LinkedLists
template <class T>
class LinkedListNode
{
public:
/*0x00*/ T Object;
/*0x04*/ LinkedListNode* pNext;
/*0x08*/ LinkedListNode* pPrev;
/*0x0c*/
};
template <class T>
class DoublyLinkedList
{
public:
/*0x00*/ void* vfTable;
/*0x04*/ LinkedListNode<T>* pHead;
/*0x08*/ LinkedListNode<T>* pTail;
/*0x0c*/ LinkedListNode<T>* pCurObject;
/*0x10*/ LinkedListNode<T>* pCurObjectNext;
/*0x14*/ LinkedListNode<T>* pCurObjectPrev;
/*0x18*/ int NumObjects;
/*0x1c*/ int RefCount;
/*0x20*/
};
template <typename KeyType, typename T, int _Size, int _Cnt>
class HashListMap;
template <typename KeyType, typename T, int _Size>
class HashListMap<KeyType, T, _Size, -1>
{
public:
struct Node
{
T Value;
Node* pNext;
Node* pPrev;
KeyType Key;
Node *pHashNext;
};
Node* NodeGet(const T* cur) const
{
return (Node *)((byte *)cur - (size_t)((byte *)(&((Node*)1)->Value) - (byte *)1));
}
enum { TheSize = ((_Size == 0) ? 1 : _Size) };
void* vfTable;
int DynSize;
int MaxDynSize;
Node* pHead;
Node* pTail;
int Count;
union
{
Node *Table[TheSize];
Node **DynTable;
};
};
template <typename T_KEY, typename T, int _Size, int _Cnt = -1>
class HashListMap : public HashListMap<T_KEY, T, _Size, -1>
{
};
template <typename T, int _Size, int _Cnt = -1>
class HashList : public HashListMap<int, T, _Size, _Cnt>
{
};
template <typename T, int _Size, int _Cnt>
class HashListSet;
template <typename T, int _Size>
class HashListSet<T, _Size, -1>
{
public:
using ValueType = T;
struct Node
{
T Value;
Node* pNext;
Node* pPrev;
Node* pNextHash;
};
enum { TheSize = ((_Size == 0) ? 1 : _Size) };
/*0x00*/ PVOID vfTable;
/*0x04*/ int DynSize;
/*0x08*/ int MaxDynSize;
/*0x0c*/ int Count;
/*0x10*/
union
{
Node *Table[TheSize];
Node **DynTable;
};
};
template <typename T, int _Size, int _Cnt = -1>
class HashListSet : public HashListSet<T, _Size, -1>
{};
template <typename T, int _Size>
class HashListSet<T, _Size, -2> : public HashListSet<T, _Size, -1>
{
// todo: change to whatever stl replacement this it, for now we just void* it...
void* MemPool;
};
template <typename T, int _Size, bool _bGrow>
class EQArray;
template <typename T, int _Size, bool _bGrow>
class EQArray2;
template <typename T>
class EQArray<T, 0, true>
{
public:
/*0x00*/ void* pvfTable;
/*0x04*/ T* m_array;
/*0x08*/ int m_length;
/*0x0c*/ int m_space;
/*0x10*/
};
template <typename T>
class EQArray2<T, 0, true>
{
public:
/*0x00*/ void* pvfTable;
/*0x04*/ void* pvfTable2;
/*0x08*/ T* m_array;
/*0x0c*/ int m_length;
/*0x10*/ int m_space;
/*0x14*/
};
template <typename T>
class IString
{
public:
/*0x00*/ void* vfTable;
/*0x04*/ T* String;
/*0x08*/ int Len;
/*0x0c*/ int Space;
/*0x10*/ //0x14? not sure.
};
class IString2
{
public:
EQLIB_OBJECT void Append(char* c);
/*0x00*/ void* vfTable;
/*0x04*/ char* String;
/*0x08*/ int Len;
/*0x0c*/ int Space;
/*0x10*/
};
class AtomicInt
{
public:
volatile int Value;
};
template <typename T, int T_SIZE>
class IStringFixed : public IString<T>
{
public:
BYTE FixedData[(T_SIZE * sizeof(T)) + sizeof(AtomicInt)];
};
template <int T_SIZE>
class StringFixed : public IStringFixed<char, T_SIZE>
{
public:
};
template <typename T, int _Size = 0, bool _bGrow = true>
class EQArray : public EQArray<T, 0, true>
{
public:
enum { cTCount = _Size };
static const bool cTGrow = _bGrow;
};
template <typename T, int _Size = 0, bool _bGrow = true>
class EQArray2 : public EQArray2<T, 0, true>
{
public:
enum { cTCount = _Size };
static const bool cTGrow = _bGrow;
};
template <typename ET>
class CircularArrayClass2 : public CDynamicArrayBase
{
public:
int HeadIndex;
int WrapIndex;
int ArraySize;
int ChunkSize;
int ChunkMask;
int ChunkShift;
ET** Chunks;
int ChunkAlloc;
#if !defined(TEST) && !defined(LIVE)
bool bValid;
#endif
};
template <typename TNumBitsType, typename TElementType>
class DynamicBitField
{
using NumBitsType = TNumBitsType;
using ElementType = TElementType;
NumBitsType NumBits;
ElementType Element;
ElementType* Elements;
};
#pragma pack(pop)
| [
"[email protected]"
] | |
875300cf96fb5ef57da0ec35ace5ef9314d17944 | e22b3d1db6dc9e33374a80b82441795fe43d5daf | /backend/status/SystemStatus.cc | ef189f5822c80aba2b194733ecbe6d13a096bdf8 | [
"Apache-2.0",
"CC0-1.0"
] | permissive | paulamma/primarysources | 8bfd6f3d4a10b3ddf461cdfd381f3b1ac86bc29a | d5d38d890bc4e10b2b2dedd158d6ae21f3303159 | refs/heads/master | 2021-01-18T04:36:26.469737 | 2016-03-28T20:25:36 | 2016-03-28T20:25:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,202 | cc | // Copyright 2015 Google Inc. All Rights Reserved.
// Author: Sebastian Schaffert <[email protected]>
#include <util/MemStat.h>
#include <status/Version.h>
#include <ctime>
#include "SystemStatus.h"
using wikidata::primarysources::model::ApprovalState;
namespace wikidata {
namespace primarysources {
namespace status {
namespace {
// format a time_t using ISO8601 GMT time
inline std::string formatGMT(time_t* time) {
char result[128];
std::strftime(result, 128, "%Y-%m-%dT%H:%M:%SZ", gmtime(time));
return std::string(result);
}
} // namespace
StatusService::StatusService(const std::string& connstr)
: connstr_(connstr), dirty_(true) {
// set system startup time
time_t startupTime = std::time(nullptr);
status_.mutable_system()->set_startup(formatGMT(&startupTime));
status_.mutable_system()->set_version(std::string(GIT_SHA1));
}
void StatusService::AddCacheHit() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_system()->set_cache_hits(
status_.system().cache_hits() + 1);
}
void StatusService::AddCacheMiss() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_system()->set_cache_misses(
status_.system().cache_misses() + 1);
}
void StatusService::AddGetEntityRequest() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_requests()->set_get_entity(
status_.requests().get_entity() + 1);
}
void StatusService::AddGetRandomRequest() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_requests()->set_get_random(
status_.requests().get_random() + 1);
}
void StatusService::AddGetStatementRequest() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_requests()->set_get_statement(
status_.requests().get_statement() + 1);
}
void StatusService::AddUpdateStatementRequest() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_requests()->set_update_statement(
status_.requests().update_statement() + 1);
}
void StatusService::AddGetStatusRequest() {
std::lock_guard<std::mutex> lock(status_mutex_);
status_.mutable_requests()->set_get_status(
status_.requests().get_status() + 1);
}
// Update the system status and return a constant reference.
model::Status StatusService::Status(const std::string& dataset) {
std::lock_guard<std::mutex> lock(status_mutex_);
MemStat memstat;
status_.mutable_system()->set_shared_memory(memstat.getSharedMem());
status_.mutable_system()->set_private_memory(memstat.getPrivateMem());
status_.mutable_system()->set_resident_set_size(memstat.getRSS());
model::Status copy;
model::Status* work;
// work directly on the status in case we do not request a specific
// dataset, otherwise make a copy.
if (dataset == "") {
work = &status_;
} else {
copy = status_;
work = ©
}
if (dirty_) {
cppdb::session sql(connstr_); // released when sql is destroyed
Persistence p(sql, true);
sql.begin();
work->mutable_statements()->set_statements(p.countStatements(dataset));
work->mutable_statements()->set_approved(p.countStatements(ApprovalState::APPROVED, dataset));
work->mutable_statements()->set_unapproved(p.countStatements(ApprovalState::UNAPPROVED, dataset));
work->mutable_statements()->set_duplicate(p.countStatements(ApprovalState::DUPLICATE, dataset));
work->mutable_statements()->set_blacklisted(p.countStatements(ApprovalState::BLACKLISTED, dataset));
work->mutable_statements()->set_wrong(p.countStatements(ApprovalState::WRONG, dataset));
work->set_total_users(p.countUsers());
work->clear_top_users();
for (model::UserStatus &st : p.getTopUsers(10)) {
work->add_top_users()->Swap(&st);
}
if (dataset == "") {
dirty_ = false;
}
sql.commit();
}
return *work;
}
std::string StatusService::Version() {
return std::string(GIT_SHA1);
}
} // namespace status
} // namespace primarysources
} // namespace wikidata
| [
"[email protected]"
] | |
15a11b592960f01ca1c1a73f797789f8af79d0cd | 44f35ba1e2332d24c8a5c4837c29ddf6a40397f8 | /test/test_lsd.cpp | 41e54b76b9997425e8d64111aee61f076d066fe0 | [] | no_license | chongyc/libtorrent | 8a65406254844d525d02cb0c5bbfe0f8210dc07c | 73b4af0eeb0937e571e22ba30742210fb8187371 | refs/heads/master | 2016-09-06T20:10:46.200474 | 2008-08-25T22:32:50 | 2008-08-25T22:32:50 | 27,843 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 4,631 | cpp | /*
Copyright (c) 2008, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/session.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/hasher.hpp"
#include <boost/thread.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/filesystem/operations.hpp>
#include "test.hpp"
#include "setup_transfer.hpp"
using boost::filesystem::remove_all;
void test_lsd()
{
using namespace libtorrent;
session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48100, 49000));
session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49100, 50000));
session ses3(fingerprint("LT", 0, 1, 0, 0), std::make_pair(50100, 51000));
// this is to avoid everything finish from a single peer
// immediately. To make the swarm actually connect all
// three peers before finishing.
float rate_limit = 180000;
ses1.set_upload_rate_limit(int(rate_limit));
ses2.set_download_rate_limit(int(rate_limit));
ses3.set_download_rate_limit(int(rate_limit));
ses2.set_upload_rate_limit(int(rate_limit / 2));
ses3.set_upload_rate_limit(int(rate_limit / 2));
session_settings settings;
settings.allow_multiple_connections_per_ip = true;
settings.ignore_limits_on_local_network = false;
ses1.set_settings(settings);
ses2.set_settings(settings);
ses3.set_settings(settings);
ses1.start_lsd();
ses2.start_lsd();
ses3.start_lsd();
#ifndef TORRENT_DISABLE_ENCRYPTION
pe_settings pes;
pes.out_enc_policy = pe_settings::forced;
pes.in_enc_policy = pe_settings::forced;
ses1.set_pe_settings(pes);
ses2.set_pe_settings(pes);
ses3.set_pe_settings(pes);
#endif
torrent_handle tor1;
torrent_handle tor2;
torrent_handle tor3;
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, false, "_lsd");
for (int i = 0; i < 30; ++i)
{
print_alerts(ses1, "ses1", true);
print_alerts(ses2, "ses2", true);
print_alerts(ses3, "ses3", true);
torrent_status st1 = tor1.status();
torrent_status st2 = tor2.status();
torrent_status st3 = tor3.status();
std::cerr
<< "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s "
<< st1.num_peers << ": "
<< "\033[32m" << int(st2.download_payload_rate / 1000.f) << "kB/s "
<< "\033[31m" << int(st2.upload_payload_rate / 1000.f) << "kB/s "
<< "\033[0m" << int(st2.progress * 100) << "% "
<< st2.num_peers << " - "
<< "\033[32m" << int(st3.download_payload_rate / 1000.f) << "kB/s "
<< "\033[31m" << int(st3.upload_payload_rate / 1000.f) << "kB/s "
<< "\033[0m" << int(st3.progress * 100) << "% "
<< st3.num_peers
<< std::endl;
if (tor2.is_seed() && tor3.is_seed()) break;
test_sleep(1000);
}
TEST_CHECK(tor2.is_seed());
TEST_CHECK(tor3.is_seed());
if (tor2.is_seed() && tor3.is_seed()) std::cerr << "done\n";
}
int test_main()
{
using namespace libtorrent;
using namespace boost::filesystem;
// in case the previous run was terminated
try { remove_all("./tmp1_lsd"); } catch (std::exception&) {}
try { remove_all("./tmp2_lsd"); } catch (std::exception&) {}
try { remove_all("./tmp3_lsd"); } catch (std::exception&) {}
test_lsd();
remove_all("./tmp1_lsd");
remove_all("./tmp2_lsd");
remove_all("./tmp3_lsd");
return 0;
}
| [
"arvidn@a83610d8-ad2a-0410-a6ab-fc0612d85776"
] | arvidn@a83610d8-ad2a-0410-a6ab-fc0612d85776 |
9e70fb57a20d1083b0e7822308d8f9661f4a41dd | 7b6dfaa5015385a3ed0c98471c382eb3e8586b72 | /mp7/dsets.h | 4a2b7b48ea32b8576dd95a5d9996100eae8940d8 | [] | no_license | wsun26/cs225 | d33106d3cab4a77f693bdd4ff9e084058421fcfe | a097a8751a6522ff864794af2da059d3127f4a69 | refs/heads/master | 2020-05-14T12:08:23.679514 | 2019-04-17T00:42:18 | 2019-04-17T00:42:18 | 181,788,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 280 | h | /* Your code here! */
#ifndef DSETS
#define DSETS
#include <vector>
using namespace std;
class DisjointSets
{
public:
void addelements(int num);
int find(int elem);
void setunion(int a, int b);
int operator[](int elem);
private:
vector<int> nodes;
};
#endif
| [
"[email protected]"
] | |
561c1c31f5ecf0a5ec3c17f83b46afbc5a458671 | 1cf02ad632e9c15e9ec6be4886cb4aa75eef4049 | /Bohge_Engine/Framework/TextureMetadata.h | 2e0b66f52578280726d23e43185e71a903f7e07b | [
"MIT"
] | permissive | xywwf/Bohge_Engine | 5b92152468fdfb19062d8f5b607c728bb503987e | 7695a8633260652035e56842ea75c9013258c5a1 | refs/heads/master | 2020-05-24T08:44:16.355433 | 2017-08-04T07:54:43 | 2017-08-04T07:55:57 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,731 | h | //////////////////////////////////////////////////////////////////////////////////////
//
// The Bohge Engine License (BEL)
//
// Copyright (c) 2011-2014 Peng Zhao
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software. And the logo of
// Bohge Engine shall be displayed full screen for more than 3 seconds
// when the software is started. Copyright holders are allowed to develop
// game edit based on Bohge Engine, The edit must be released under the MIT
// open source license if it is going to be published. In no event shall
// copyright holders be prohibited from using any code of Bohge Engine
// to develop any other analogous game engines.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//
//////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "TextureProperty.h"
#include "IMetadata.h"
namespace BohgeEngine
{
class BOHGE_FRAMEWORK TextureFileMetadata : public IMetadata
{
RTTI_DRIVER_TYPE_DECLEAR( TextureFileMetadata, IMetadata );
private:
eastl::string m_Path;
TextureProperty::TextureUseage m_eUsage;
TextureProperty::PixelFormat m_ePixelFormat;
TextureProperty::TextureWarp m_eSWarp;
TextureProperty::TextureWarp m_eTWarp;
TextureProperty::TextureFilter m_eMagFilter;
TextureProperty::TextureFilter m_eMinFilter;
uint m_uAnisotropic;
bool m_isMipMap;
TextureProperty::TextrueSourceData* m_pTextureData;
public:
TextureFileMetadata(
TextureProperty::TextureUseage mu, TextureProperty::PixelFormat pf,
uint x, bool mip,
TextureProperty::TextureWarp s, TextureProperty::TextureWarp t,
TextureProperty::TextureFilter mag, TextureProperty::TextureFilter min,
const eastl::string& path );
virtual ~TextureFileMetadata();
private:
virtual void* _ReturnMetadata( );
public:
virtual void GetIdentifier( eastl::vector<byte>& bytes ) const;//在str中推入表示符号
virtual void ProcessMetadata();//处理原始资源
virtual void ReleaseMetadate();
};
//本地数据生成纹理
class BOHGE_FRAMEWORK TextureBufferMetadata : public IMetadata
{
RTTI_DRIVER_TYPE_DECLEAR( TextureBufferMetadata, IMetadata );
private:
byte* m_pData;
TextureProperty::TextrueSourceData* m_pTextureData;
TextureProperty::TextureType m_eType;
TextureProperty::TextureUseage m_Usage;
TextureProperty::PixelFormat m_ePixelFormat;
TextureProperty::TextureWarp m_eSWarp;
TextureProperty::TextureWarp m_eTWarp;
TextureProperty::TextureFilter m_eMagFilter;
TextureProperty::TextureFilter m_eMinFilter;
uint m_uAnisotropic;
bool m_isMipMap;
byte m_Channel;
vector2d m_Size;
public:
//TextureBufferMetadata(
// const vector2d& size, TextureProperty::TextureType type,
// TextureProperty::PixelFormat pf, uint anisotropic,
// TextureProperty::TextureWarp s, TextureProperty::TextureWarp t,
// TextureProperty::TextureFilter mag, TextureProperty::TextureFilter min,
// byte pixelsize, byte* buf );//数据可以为空,这样会生成一张白色纹理
TextureBufferMetadata(
const vector2d& size, TextureProperty::TextureType type,
TextureProperty::TextureUseage mu, TextureProperty::PixelFormat pf,
uint anisotropic, bool mip,
TextureProperty::TextureWarp s, TextureProperty::TextureWarp t,
TextureProperty::TextureFilter mag, TextureProperty::TextureFilter min,
byte* buf );//数据可以为空,这样会生成一张白色纹理
virtual ~TextureBufferMetadata();
private:
virtual void* _ReturnMetadata( );
public:
virtual void GetIdentifier( eastl::vector<byte>& bytes ) const;//在str中推入表示符号
virtual void ProcessMetadata();//处理原始资源
virtual void ReleaseMetadate();
};
} | [
"[email protected]"
] | |
42f53044302167c6c9309e3c7085d45724ae04a7 | c4165e745412ade20a59bbaad5755ed8f1f54c6a | /Code/IO/test/mapIOHeaderTest.cpp | 6eeead0716c1457283be902e0eff739f75e82426 | [] | no_license | MIC-DKFZ/MatchPoint | e0e3fb45a274a6de4b6c49397ea1e9b5bbed4620 | a45efdf977418305039df6a4f98efe6e7ed1f578 | refs/heads/master | 2023-06-22T07:52:46.870768 | 2023-06-17T07:43:48 | 2023-06-17T07:43:48 | 186,114,444 | 0 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,617 | cpp | // -----------------------------------------------------------------------
// MatchPoint - DKFZ translational registration framework
//
// Copyright (c) German Cancer Research Center (DKFZ),
// Software development for Integrated Diagnostics and Therapy (SIDT).
// ALL RIGHTS RESERVED.
// See mapCopyright.txt or
// http://www.dkfz.de/en/sidt/projects/MatchPoint/copyright.html
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notices for more information.
//
//------------------------------------------------------------------------
/*!
// @file
// @version $Revision$ (last changed revision)
// @date $Date$ (last change date)
// @author $Author$ (last changed by)
// Subversion HeadURL: $HeadURL$
*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <iostream>
#include "mapExpandingFieldKernelLoader.h"
#include "mapExpandingFieldKernelWriter.h"
#include "mapKernelLoaderLoadPolicy.h"
#include "mapKernelWriterLoadPolicy.h"
#include "mapMatrixModelBasedKernelLoader.h"
#include "mapMatrixModelBasedKernelWriter.h"
#include "mapNullRegistrationKernelLoader.h"
#include "mapNullRegistrationKernelWriter.h"
#include "mapRegistrationFileReader.h"
#include "mapRegistrationFileTags.h"
#include "mapRegistrationFileWriter.h"
#include "mapRegistrationKernelLoaderBase.h"
#include "mapRegistrationKernelLoadRequest.h"
#include "mapRegistrationKernelWriterBase.h"
#include "mapRegistrationKernelWriteRequest.h"
int main(int , char**)
{
return EXIT_SUCCESS;
}
| [
"[email protected]"
] | |
8d8937853b8340849a32a9e081799ce1ffdd3f64 | c68f791005359cfec81af712aae0276c70b512b0 | /0-unclassified/segment.cpp | 5a72fb734ac618199935a7b6b94c402d03a25d1b | [] | 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 | 1,292 | cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstdio>
#include <climits>
#include <vector>
#include <map>
#include <list>
#include <deque>
#include <stack>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <utility>
#include <functional>
using namespace std;
#define LL long long
#define PI acos(-1.0)
#define sf scanf
#define pf printf
#define nl printf("\n")
#define FOR(i,a,b) for( i=a; i<=b; i++)
#define FORD(i,a,b) for( i=b; i>=a; i--)
#define FORS(i,n) FOR(i, 0, n-1)
#define FORM(i,n) FORD(i, 0, n-1)
#define mp make_pair
#define open freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define close fclose(stdin); fclose(stdout)
#define db double
const int N = 1e5 + 7;
int gcd(int a, int b) { return b? gcd(b,a%b): a; }
int lcm(int a, int b) { return a*b / gcd(a,b); }
int a[N];
int main(void)
{
int n, i, j, ans = 0, temp;
sf("%d", &n);
FOR(i,1,n) sf("%d", &a[i]);
if(n <= 2) { pf("%d\n", n); nl; return 0; }
i = 1;
while(i <= n-2) {
temp = 2;
FOR(j,i+2,n) {
if(a[j-2] + a[j-1] == a[j])
temp++;
else break;
}
if(temp >= ans) {
ans = temp;
if(n-i <= ans) break;
}
if(temp > 2) i = j - 1;
else i++;
}
cout << ans << endl;
return 0;
} | [
"[email protected]"
] | |
c3d62b9d663aa3d0d5ea3adcd9bdc2a0707691a5 | 501f8e21ce973c6e2e6417dee665b712af7f8101 | /src/maplab_dependencies/3rdparty/opengv/python/pyopengv.cpp | d6fc7a87f800b6657cad7613c1a7698f7a3ba158 | [
"Apache-2.0"
] | permissive | Abdob/maplab_ws | b5bd5393faf382290acc48a3a0d049f32b79ee0f | fbd198179329dc1522cdfb70d057c137f608d069 | refs/heads/master | 2022-07-27T06:28:08.286116 | 2020-05-17T19:09:22 | 2020-05-17T19:09:22 | 262,687,071 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 17,114 | cpp | #include <boost/python.hpp>
#include <iostream>
#include <vector>
#include <opengv/absolute_pose/AbsoluteAdapterBase.hpp>
#include <opengv/absolute_pose/methods.hpp>
#include <opengv/relative_pose/RelativeAdapterBase.hpp>
#include <opengv/relative_pose/methods.hpp>
#include <opengv/sac/Ransac.hpp>
#include <opengv/sac_problems/absolute_pose/AbsolutePoseSacProblem.hpp>
#include <opengv/sac_problems/relative_pose/CentralRelativePoseSacProblem.hpp>
#include <opengv/sac_problems/relative_pose/RotationOnlySacProblem.hpp>
#include <opengv/triangulation/methods.hpp>
#include "types.hpp"
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/ndarrayobject.h>
#if (PY_VERSION_HEX < 0x03000000)
static void numpy_import_array_wrapper()
#else
static int* numpy_import_array_wrapper()
#endif
{
/* Initialise numpy API and use 2/3 compatible return */
import_array();
}
namespace pyopengv {
namespace bp = boost::python;
namespace bpn = boost::python::numeric;
typedef PyArrayContiguousView<double> pyarray_t;
opengv::bearingVector_t bearingVectorFromArray(
const pyarray_t &array,
size_t index )
{
opengv::bearingVector_t v;
v[0] = array.get(index, 0);
v[1] = array.get(index, 1);
v[2] = array.get(index, 2);
return v;
}
opengv::point_t pointFromArray(
const pyarray_t &array,
size_t index )
{
opengv::point_t p;
p[0] = array.get(index, 0);
p[1] = array.get(index, 1);
p[2] = array.get(index, 2);
return p;
}
bp::object arrayFromPoints( const opengv::points_t &points )
{
std::vector<double> data(points.size() * 3);
for (size_t i = 0; i < points.size(); ++i) {
data[3 * i + 0] = points[i][0];
data[3 * i + 1] = points[i][1];
data[3 * i + 2] = points[i][2];
}
npy_intp shape[2] = {(npy_intp)points.size(), 3};
return bpn_array_from_data(2, shape, &data[0]);
}
bp::object arrayFromTranslation( const opengv::translation_t &t )
{
npy_intp shape[1] = {3};
return bpn_array_from_data(1, shape, t.data());
}
bp::object arrayFromRotation( const opengv::rotation_t &R )
{
Eigen::Matrix<double, 3, 3, Eigen::RowMajor> R_row_major = R;
npy_intp shape[2] = {3, 3};
return bpn_array_from_data(2, shape, R_row_major.data());
}
bp::list listFromRotations( const opengv::rotations_t &Rs )
{
bp::list retn;
for (size_t i = 0; i < Rs.size(); ++i) {
retn.append(arrayFromRotation(Rs[i]));
}
return retn;
}
bp::object arrayFromEssential( const opengv::essential_t &E )
{
Eigen::Matrix<double, 3, 3, Eigen::RowMajor> E_row_major = E;
npy_intp shape[2] = {3, 3};
return bpn_array_from_data(2, shape, E_row_major.data());
}
bp::list listFromEssentials( const opengv::essentials_t &Es )
{
bp::list retn;
for (size_t i = 0; i < Es.size(); ++i) {
retn.append(arrayFromEssential(Es[i]));
}
return retn;
}
bp::object arrayFromTransformation( const opengv::transformation_t &t )
{
Eigen::Matrix<double, 3, 4, Eigen::RowMajor> t_row_major = t;
npy_intp shape[2] = {3, 4};
return bpn_array_from_data(2, shape, t_row_major.data());
}
bp::list listFromTransformations( const opengv::transformations_t &t )
{
bp::list retn;
for (size_t i = 0; i < t.size(); ++i) {
retn.append(arrayFromTransformation(t[i]));
}
return retn;
}
std::vector<int> getNindices( int n )
{
std::vector<int> indices;
for(int i = 0; i < n; i++)
indices.push_back(i);
return indices;
}
namespace absolute_pose {
class CentralAbsoluteAdapter : public opengv::absolute_pose::AbsoluteAdapterBase
{
protected:
using AbsoluteAdapterBase::_t;
using AbsoluteAdapterBase::_R;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
CentralAbsoluteAdapter(
bpn::array & bearingVectors,
bpn::array & points )
: _bearingVectors(bearingVectors)
, _points(points)
{}
CentralAbsoluteAdapter(
bpn::array & bearingVectors,
bpn::array & points,
bpn::array & R )
: _bearingVectors(bearingVectors)
, _points(points)
{
pyarray_t R_view(R);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
_R(i, j) = R_view.get(i, j);
}
}
}
CentralAbsoluteAdapter(
bpn::array & bearingVectors,
bpn::array & points,
bpn::array & t,
bpn::array & R )
: _bearingVectors(bearingVectors)
, _points(points)
{
pyarray_t t_view(t);
for (int i = 0; i < 3; ++i) {
_t(i) = t_view.get(i);
}
pyarray_t R_view(R);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
_R(i, j) = R_view.get(i, j);
}
}
}
virtual ~CentralAbsoluteAdapter() {}
//Access of correspondences
virtual opengv::bearingVector_t getBearingVector( size_t index ) const {
return bearingVectorFromArray(_bearingVectors, index);
}
virtual double getWeight( size_t index ) const {
return 1.0;
}
virtual opengv::translation_t getCamOffset( size_t index ) const {
return Eigen::Vector3d::Zero();
}
virtual opengv::rotation_t getCamRotation( size_t index ) const {
return opengv::rotation_t::Identity();
}
virtual opengv::point_t getPoint( size_t index ) const {
return pointFromArray(_points, index);
}
virtual size_t getNumberCorrespondences() const {
return _bearingVectors.shape(0);
}
protected:
pyarray_t _bearingVectors;
pyarray_t _points;
};
bp::object p2p( bpn::array &v, bpn::array &p, bpn::array &R )
{
CentralAbsoluteAdapter adapter(v, p, R);
return arrayFromTranslation(
opengv::absolute_pose::p2p(adapter, 0, 1));
}
bp::object p3p_kneip( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return listFromTransformations(
opengv::absolute_pose::p3p_kneip(adapter, 0, 1, 2));
}
bp::object p3p_gao( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return listFromTransformations(
opengv::absolute_pose::p3p_gao(adapter, 0, 1, 2));
}
bp::object gp3p( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return listFromTransformations(
opengv::absolute_pose::gp3p(adapter, 0, 1, 2));
}
bp::object epnp( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return arrayFromTransformation(
opengv::absolute_pose::epnp(adapter));
}
bp::object gpnp( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return arrayFromTransformation(
opengv::absolute_pose::gpnp(adapter));
}
bp::object upnp( bpn::array &v, bpn::array &p )
{
CentralAbsoluteAdapter adapter(v, p);
return listFromTransformations(
opengv::absolute_pose::upnp(adapter));
}
bp::object optimize_nonlinear( bpn::array &v,
bpn::array &p,
bpn::array &t,
bpn::array &R )
{
CentralAbsoluteAdapter adapter(v, p, t, R);
return arrayFromTransformation(
opengv::absolute_pose::optimize_nonlinear(adapter));
}
bp::object ransac(
bpn::array &v,
bpn::array &p,
std::string algo_name,
double threshold,
int max_iterations )
{
using namespace opengv::sac_problems::absolute_pose;
CentralAbsoluteAdapter adapter(v, p);
// Create a ransac problem
AbsolutePoseSacProblem::algorithm_t algorithm = AbsolutePoseSacProblem::KNEIP;
if (algo_name == "TWOPT") algorithm = AbsolutePoseSacProblem::TWOPT;
else if (algo_name == "KNEIP") algorithm = AbsolutePoseSacProblem::KNEIP;
else if (algo_name == "GAO") algorithm = AbsolutePoseSacProblem::GAO;
else if (algo_name == "EPNP") algorithm = AbsolutePoseSacProblem::EPNP;
else if (algo_name == "GP3P") algorithm = AbsolutePoseSacProblem::GP3P;
std::shared_ptr<AbsolutePoseSacProblem>
absposeproblem_ptr(
new AbsolutePoseSacProblem(adapter, algorithm));
// Create a ransac solver for the problem
opengv::sac::Ransac<AbsolutePoseSacProblem> ransac;
ransac.sac_model_ = absposeproblem_ptr;
ransac.threshold_ = threshold;
ransac.max_iterations_ = max_iterations;
// Solve
ransac.computeModel();
return arrayFromTransformation(ransac.model_coefficients_);
}
} // namespace absolute_pose
namespace relative_pose
{
class CentralRelativeAdapter : public opengv::relative_pose::RelativeAdapterBase
{
protected:
using RelativeAdapterBase::_t12;
using RelativeAdapterBase::_R12;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
CentralRelativeAdapter(
bpn::array & bearingVectors1,
bpn::array & bearingVectors2 )
: _bearingVectors1(bearingVectors1)
, _bearingVectors2(bearingVectors2)
{}
CentralRelativeAdapter(
bpn::array & bearingVectors1,
bpn::array & bearingVectors2,
bpn::array & R12 )
: _bearingVectors1(bearingVectors1)
, _bearingVectors2(bearingVectors2)
{
pyarray_t R12_view(R12);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
_R12(i, j) = R12_view.get(i, j);
}
}
}
CentralRelativeAdapter(
bpn::array & bearingVectors1,
bpn::array & bearingVectors2,
bpn::array & t12,
bpn::array & R12 )
: _bearingVectors1(bearingVectors1)
, _bearingVectors2(bearingVectors2)
{
pyarray_t t12_view(t12);
for (int i = 0; i < 3; ++i) {
_t12(i) = t12_view.get(i);
}
pyarray_t R12_view(R12);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
_R12(i, j) = R12_view.get(i, j);
}
}
}
virtual ~CentralRelativeAdapter() {}
virtual opengv::bearingVector_t getBearingVector1( size_t index ) const {
return bearingVectorFromArray(_bearingVectors1, index);
}
virtual opengv::bearingVector_t getBearingVector2( size_t index ) const {
return bearingVectorFromArray(_bearingVectors2, index);
}
virtual double getWeight( size_t index ) const {
return 1.0;
}
virtual opengv::translation_t getCamOffset1( size_t index ) const {
return Eigen::Vector3d::Zero();
}
virtual opengv::rotation_t getCamRotation1( size_t index ) const {
return opengv::rotation_t::Identity();
}
virtual opengv::translation_t getCamOffset2( size_t index ) const {
return Eigen::Vector3d::Zero();
}
virtual opengv::rotation_t getCamRotation2( size_t index ) const {
return opengv::rotation_t::Identity();
}
virtual size_t getNumberCorrespondences() const {
return _bearingVectors1.shape(0);
}
protected:
pyarray_t _bearingVectors1;
pyarray_t _bearingVectors2;
};
bp::object twopt( bpn::array &b1, bpn::array &b2, bpn::array &R )
{
CentralRelativeAdapter adapter(b1, b2, R);
return arrayFromTranslation(
opengv::relative_pose::twopt(adapter, true, 0, 1));
}
bp::object twopt_rotationOnly( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return arrayFromRotation(
opengv::relative_pose::twopt_rotationOnly(adapter, 0, 1));
}
bp::object rotationOnly( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return arrayFromRotation(
opengv::relative_pose::rotationOnly(adapter));
}
bp::object fivept_nister( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return listFromEssentials(
opengv::relative_pose::fivept_nister(adapter));
}
bp::object fivept_kneip( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return listFromRotations(
opengv::relative_pose::fivept_kneip(adapter, getNindices(5)));
}
bp::object sevenpt( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return listFromEssentials(
opengv::relative_pose::sevenpt(adapter));
}
bp::object eightpt( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return arrayFromEssential(
opengv::relative_pose::eightpt(adapter));
}
bp::object eigensolver( bpn::array &b1, bpn::array &b2, bpn::array &R )
{
CentralRelativeAdapter adapter(b1, b2, R);
return arrayFromRotation(
opengv::relative_pose::eigensolver(adapter));
}
bp::object sixpt( bpn::array &b1, bpn::array &b2 )
{
CentralRelativeAdapter adapter(b1, b2);
return listFromRotations(
opengv::relative_pose::sixpt(adapter));
}
bp::object optimize_nonlinear( bpn::array &b1,
bpn::array &b2,
bpn::array &t12,
bpn::array &R12 )
{
CentralRelativeAdapter adapter(b1, b2, t12, R12);
return arrayFromTransformation(
opengv::relative_pose::optimize_nonlinear(adapter));
}
bp::object ransac(
bpn::array &b1,
bpn::array &b2,
std::string algo_name,
double threshold,
int max_iterations )
{
using namespace opengv::sac_problems::relative_pose;
CentralRelativeAdapter adapter(b1, b2);
// Create a ransac problem
CentralRelativePoseSacProblem::algorithm_t algorithm = CentralRelativePoseSacProblem::NISTER;
if (algo_name == "STEWENIUS") algorithm = CentralRelativePoseSacProblem::STEWENIUS;
else if (algo_name == "NISTER") algorithm = CentralRelativePoseSacProblem::NISTER;
else if (algo_name == "SEVENPT") algorithm = CentralRelativePoseSacProblem::SEVENPT;
else if (algo_name == "EIGHTPT") algorithm = CentralRelativePoseSacProblem::EIGHTPT;
std::shared_ptr<CentralRelativePoseSacProblem>
relposeproblem_ptr(
new CentralRelativePoseSacProblem(adapter, algorithm));
// Create a ransac solver for the problem
opengv::sac::Ransac<CentralRelativePoseSacProblem> ransac;
ransac.sac_model_ = relposeproblem_ptr;
ransac.threshold_ = threshold;
ransac.max_iterations_ = max_iterations;
// Solve
ransac.computeModel();
return arrayFromTransformation(ransac.model_coefficients_);
}
bp::object ransac_rotationOnly(
bpn::array &b1,
bpn::array &b2,
double threshold,
int max_iterations )
{
using namespace opengv::sac_problems::relative_pose;
CentralRelativeAdapter adapter(b1, b2);
std::shared_ptr<RotationOnlySacProblem>
relposeproblem_ptr(
new RotationOnlySacProblem(adapter));
// Create a ransac solver for the problem
opengv::sac::Ransac<RotationOnlySacProblem> ransac;
ransac.sac_model_ = relposeproblem_ptr;
ransac.threshold_ = threshold;
ransac.max_iterations_ = max_iterations;
// Solve
ransac.computeModel();
return arrayFromRotation(ransac.model_coefficients_);
}
} // namespace relative_pose
namespace triangulation
{
bp::object triangulate( bpn::array &b1,
bpn::array &b2,
bpn::array &t12,
bpn::array &R12 )
{
pyopengv::relative_pose::CentralRelativeAdapter adapter(b1, b2, t12, R12);
opengv::points_t points;
for (size_t i = 0; i < adapter.getNumberCorrespondences(); ++i)
{
opengv::point_t p = opengv::triangulation::triangulate(adapter, i);
points.push_back(p);
}
return arrayFromPoints(points);
}
bp::object triangulate2( bpn::array &b1,
bpn::array &b2,
bpn::array &t12,
bpn::array &R12 )
{
pyopengv::relative_pose::CentralRelativeAdapter adapter(b1, b2, t12, R12);
opengv::points_t points;
for (size_t i = 0; i < adapter.getNumberCorrespondences(); ++i)
{
opengv::point_t p = opengv::triangulation::triangulate2(adapter, i);
points.push_back(p);
}
return arrayFromPoints(points);
}
} // namespace triangulation
} // namespace pyopengv
BOOST_PYTHON_MODULE(pyopengv) {
using namespace boost::python;
boost::python::numeric::array::set_module_and_type("numpy", "ndarray");
numpy_import_array_wrapper();
def("absolute_pose_p2p", pyopengv::absolute_pose::p2p);
def("absolute_pose_p3p_kneip", pyopengv::absolute_pose::p3p_kneip);
def("absolute_pose_p3p_gao", pyopengv::absolute_pose::p3p_gao);
def("absolute_pose_gp3p", pyopengv::absolute_pose::gp3p);
def("absolute_pose_epnp", pyopengv::absolute_pose::epnp);
def("absolute_pose_gpnp", pyopengv::absolute_pose::gpnp);
def("absolute_pose_upnp", pyopengv::absolute_pose::upnp);
def("absolute_pose_optimize_nonlinear", pyopengv::absolute_pose::optimize_nonlinear);
def("absolute_pose_ransac", pyopengv::absolute_pose::ransac);
def("relative_pose_twopt", pyopengv::relative_pose::twopt);
def("relative_pose_twopt_rotation_only", pyopengv::relative_pose::twopt_rotationOnly);
def("relative_pose_rotation_only", pyopengv::relative_pose::rotationOnly);
def("relative_pose_fivept_nister", pyopengv::relative_pose::fivept_nister);
def("relative_pose_fivept_kneip", pyopengv::relative_pose::fivept_kneip);
def("relative_pose_sevenpt", pyopengv::relative_pose::sevenpt);
def("relative_pose_eightpt", pyopengv::relative_pose::eightpt);
def("relative_pose_eigensolver", pyopengv::relative_pose::eigensolver);
def("relative_pose_sixpt", pyopengv::relative_pose::sixpt);
def("relative_pose_optimize_nonlinear", pyopengv::relative_pose::optimize_nonlinear);
def("relative_pose_ransac", pyopengv::relative_pose::ransac);
def("relative_pose_ransac_rotation_only", pyopengv::relative_pose::ransac_rotationOnly);
def("triangulation_triangulate", pyopengv::triangulation::triangulate);
def("triangulation_triangulate2", pyopengv::triangulation::triangulate2);
}
| [
"[email protected]"
] | |
479c5960c89f168af08f652fc60ed74c98e1411e | 5a02bb2008b94df952d980d411a6295c9cbedbed | /index_join/src/query0_main.cpp | 14b4bff93d9f76586eac9db4e4e01d871f71b09d | [] | no_license | qingzma/IndexSampling | ef10cbb38fee1bd351b349c2256180451562a33d | 31442e2c883e6655dfe563815bcf67a4ca81f782 | refs/heads/master | 2020-07-07T14:16:06.692581 | 2019-09-17T07:28:38 | 2019-09-17T07:28:38 | 203,372,343 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 30,559 | cpp | // This implemented the different algorithms for query0
// Programmer: Robert Christensen
// email: [email protected]
// SELECT r_name, n_regionkey, s_nationkey, ps_suppkey
// FROM region, nation, supplier, partsupp
// WHERE r_name = 'ASIA'
// AND r_regionkey = n_regionkey
// AND n_nationkey = s_nationkey
// AND s_suppkey = ps_suppkey;
#include <iostream>
#include <fstream>
#include <memory>
#include <random>
#include <map>
#include <vector>
#include <thread>
#include <future>
#include "util/Timer.h"
#include "util/FileSizeTable.h"
#include "util/FileKeyValue.h"
#include "util/accumulator.h"
#include "util/joinSettings.h"
#include "database/TableRegion.h"
#include "database/TableNation.h"
#include "database/TableSupplier.h"
#include "database/TablePartsupp.h"
#include "database/Table.h"
#include "database/jefastIndex.h"
#include "database/jefastBuilder.h"
#include "database/pseudoIndex.h"
#include "database/JoinOutputColumnContainer.h"
#include "database/PathIndexBuilder.h"
#include "database/JoinPath.h"
#include "database/pseudoIndexAdvanced.h"
static std::shared_ptr<Table> region_table;
static std::shared_ptr<Table> nation_table;
static std::shared_ptr<Table> supplier_table;
static std::shared_ptr<Table> partssupp_table;
static std::shared_ptr<jefastIndexLinear> jefastIndex;
static std::shared_ptr<FileKeyValue> data_map;
static global_settings query0Settings;
// Note, we will require a filter for each column. It can just be an empty filter (an everything filter)
// we will be doing a linear scan of the data to implement this algorithm for now.
int64_t exactJoinNoIndex(std::string outfile, std::vector<std::shared_ptr<jefastFilter> > filters) {
// implements a straightforward implementation of a join which
// does not require an index.
std::ofstream output_file(outfile, std::ios::out);
int64_t count = 0;
auto Table_1 = region_table;
auto Table_2 = nation_table;
auto Table_3 = supplier_table;
auto Table_4 = partssupp_table;
int table1Index2 = Table_Region::R_REGIONKEY;
int table2Index1 = Table_Nation::N_REGIONKEY;
int table2Index2 = Table_Nation::N_NATIONKEY;
int table3Index1 = Table_Supplier::S_NATIONKEY;
int table3Index2 = Table_Supplier::S_SUPPKEY;
int table4Index1 = Table_Partsupp::PS_SUPPKEY;
// build the hash for table 1
std::map<jfkey_t, std::vector<int64_t> > Table1_hash;
//int64_t Table_1_count = Table_1->row_count();
//for (int64_t i = 0; i < Table_1_count; ++i) {
for (auto f1_enu = filters.at(0)->getEnumerator(); f1_enu->Step();) {
Table1_hash[Table_1->get_int64(f1_enu->getValue(), table1Index2)].push_back(f1_enu->getValue());
}
// for (auto elem : Table1_hash){
// for (auto item_in_vector: elem.second){
// std::cout<<elem.first<<", "<<item_in_vector<<std::endl;
// }
//
// }
// build the hash for table 2. All matched elements from table 1 hash will be emitted
// the tuple has the form <index from table 1, index for table 2> for all matching tuple
std::map<jfkey_t, std::vector<std::tuple<int64_t, int64_t> > > Table2_hash;
//int64_t Table_2_count = Table_2->row_count();
//for (int64_t i = 0; i < Table_2_count; ++i) {
for (auto f2_enu = filters.at(1)->getEnumerator(); f2_enu->Step();) {
jfkey_t value = Table_2->get_int64(f2_enu->getValue(), table2Index1);
for (auto matching_indexes : Table1_hash[value]) {
Table2_hash[Table_2->get_int64(f2_enu->getValue(), table2Index2)].emplace_back(matching_indexes, f2_enu->getValue());
}
}
// for (auto elem : Table2_hash){
// std::cout<<elem.first<<", <";
// for (auto item_in_vector: elem.second){
// std::cout<<"("<<std::get<0>(item_in_vector)<<","<<std::get<1>(item_in_vector)<<"), ";
// }
// std::cout<<">"<<std::endl;
//
// }
// build the hash for table 3. All matched elements from table 2 hash will be emitted.
std::map<jfkey_t, std::vector<std::tuple<int64_t, int64_t, int64_t> > > Table3_hash;
//int64_t Table_3_count = Table_3->row_count();
//for (int64_t i = 0; i < Table_3_count; ++i) {
for (auto f3_enu = filters.at(2)->getEnumerator(); f3_enu->Step();) {
jfkey_t value = Table_3->get_int64(f3_enu->getValue(), table3Index1);
for (auto matching_indexes : Table2_hash[value]) {
Table3_hash[Table_3->get_int64(f3_enu->getValue(), table3Index2)].emplace_back(std::get<0>(matching_indexes), std::get<1>(matching_indexes), f3_enu->getValue());
}
}
// for (auto elem : Table3_hash){
// std::cout<<elem.first<<", <";
// for (auto item_in_vector: elem.second){
// std::cout<<"("<<std::get<0>(item_in_vector)<<","<<std::get<1>(item_in_vector)<<","<<std::get<2>(item_in_vector)<<"), ";
// }
// std::cout<<">"<<std::endl;
//
// }
// build the hash for table 4? No, we can just emit when we find a match in this case.
//int64_t Table_4_count = Table_4->row_count();
//for (int64_t i = 0; i < Table_5_count; ++i) {
for (auto f4_enu = filters.at(3)->getEnumerator(); f4_enu->Step();) {
int64_t value = Table_4->get_int64(f4_enu->getValue(), table4Index1);
for (auto matching_indexes : Table3_hash[value]) {
// emit the join results here.
output_file << count << ' '
<< std::to_string(Table_1->get_int64(std::get<0>(matching_indexes), table1Index2)) << ' '
<< std::to_string(Table_2->get_int64(std::get<1>(matching_indexes), table2Index2)) << ' '
<< std::to_string(Table_3->get_int64(std::get<2>(matching_indexes), table3Index2)) << ' '
<< std::to_string(Table_4->get_int64(f4_enu->getValue(), 1)) << '\n';
++count;
}
}
output_file.close();
return count;
}
int64_t randomjefastJoin(std::ofstream & output_file, int64_t output_count, std::shared_ptr<jefastIndexLinear> jefast) {
std::vector<int64_t> results;
auto Table_1 = region_table;
auto Table_2 = nation_table;
auto Table_3 = supplier_table;
auto Table_4 = partssupp_table;
int table1Index2 = Table_Region::R_REGIONKEY;
int table2Index2 = Table_Nation::N_NATIONKEY;
int table3Index2 = Table_Supplier::S_SUPPKEY;
int64_t max = jefast->GetTotal();
std::vector<weight_t> random_values;
std::uniform_int_distribution<weight_t> distribution(0, max-1);
random_values.resize(output_count);
static std::default_random_engine generator;
std::generate(random_values.begin(), random_values.end(), [&]() {return distribution(generator);});
std::sort(random_values.begin(), random_values.end());
int counter = 0;
for (int i : random_values) {
jefast->GetJoinNumber(i, results);
output_file << counter << ' '
<< std::to_string(Table_1->get_int64(results[0], table1Index2)) << ' '
<< std::to_string(Table_2->get_int64(results[1], table2Index2)) << ' '
<< std::to_string(Table_3->get_int64(results[2], table3Index2)) << ' '
<< std::to_string(Table_4->get_int64(results[3], 1)) << '\n';
}
return output_count;
}
int64_t randomjefastJoin(std::string outfile, int64_t output_count, std::shared_ptr<jefastIndexLinear> jefast) {
// this will do a full table join using the jefast datastructure
// NOTE, jefast is not optimized for scanning right now. It is
// optimized for point queries
std::ofstream output_file(outfile, std::ios::out);
int64_t count = randomjefastJoin(output_file, output_count, jefast);
output_file.close();
return count;
}
int64_t randomjefastJoinT(std::string outfile, int64_t output_count, std::shared_ptr<jefastIndexLinear> jefast) {
return randomjefastJoin(outfile, output_count, jefast);
}
int64_t baselineJoin(std::ofstream & output_file, int output_count, const std::vector<weight_t> &max_cardinality) {
//std::ofstream output_file(outfile, std::ios::out);
auto Table_1 = region_table;
auto Table_2 = nation_table;
auto Table_3 = supplier_table;
auto Table_4 = partssupp_table;
int table1Index2 = Table_Region::R_REGIONKEY;
int table2Index1 = Table_Nation::N_REGIONKEY;
int table2Index2 = Table_Nation::N_NATIONKEY;
int table3Index1 = Table_Supplier::S_NATIONKEY;
int table3Index2 = Table_Supplier::S_SUPPKEY;
int table4Index1 = Table_Partsupp::PS_SUPPKEY;
int64_t count = 0;
int64_t rejected = 0;
int64_t max_possible_path = 0;
std::default_random_engine generator;
int64_t Table1_size = Table_1->row_count();
std::uniform_int_distribution<int64_t> region_dist(0, Table1_size - 1);
int64_t M_value = 1;
for (weight_t x : max_cardinality)
M_value *= x;
std::uniform_int_distribution<int64_t> rejection_filter(1, M_value);
while (count < output_count)
{
// do random selection of Table 1
int64_t Table1_idx = region_dist(generator);
int64_t Table1_v = Table_1->get_int64(Table1_idx, table1Index2);
// do random selection of Table 2
auto Table2_range = Table_2->get_key_index(table2Index1)->equal_range(Table1_v);
int64_t Table2_count = Table_2->get_key_index(table2Index1)->count(Table1_v);
if (Table2_count == 0)
continue;
std::uniform_int_distribution<int64_t> Table2_dist(0, Table2_count - 1);
int64_t selection_count_2 = Table2_dist(generator);
auto Table2_i = Table2_range.first;
while (selection_count_2 > 0) {
Table2_i++;
--selection_count_2;
}
int64_t Table2_v = Table_2->get_int64(Table2_i->second, table2Index2);
// do random selection of Table3
auto Table3_range = Table_3->get_key_index(table3Index1)->equal_range(Table2_v);
int64_t Table3_count = Table_3->get_key_index(table3Index1)->count(Table2_v);
if (Table3_count == 0)
continue;
std::uniform_int_distribution<int64_t> Table3_dist(0, Table3_count - 1);
int64_t selection_count_3 = Table3_dist(generator);
auto Table3_i = Table3_range.first;
while (selection_count_3 > 0) {
Table3_i++;
--selection_count_3;
}
int64_t Table3_v = Table_3->get_int64(Table3_i->second, table3Index2);
// do random selection of Table4
auto Table4_range = Table_4->get_key_index(table4Index1)->equal_range(Table3_v);
int64_t Table4_count = Table_4->get_key_index(table4Index1)->count(Table3_v);
if (Table4_count == 0)
continue;
std::uniform_int_distribution<int64_t> Table4_dist(0, Table4_count - 1);
int64_t selection_count_4 = Table4_dist(generator);
auto Table4_i = Table4_range.first;
while (selection_count_4 > 0) {
Table4_i++;
--selection_count_4;
}
int64_t Table4_v = Table_4->get_int64(Table4_i->second, 1);
//// do random selection of Table5
//auto Table5_range = Table_5->get_key_index(table5Index1)->equal_range(Table4_v);
//int64_t Table5_count = Table_5->get_key_index(table5Index1)->count(Table4_v);
//if (Table5_count == 0)
// continue;
//std::uniform_int_distribution<int64_t> Table5_dist(0, Table5_count - 1);
//int64_t selection_count_5 = Table5_dist(generator);
//auto Table5_i = Table5_range.first;
//while (selection_count_5 > 0) {
// Table5_i++;
// --selection_count_5;
//}
//int64_t Table5_v = Table_5->get_int64(Table5_i->second, 1);
// decide if we should reject
int64_t possible_paths = Table2_count * Table3_count * Table4_count;
max_possible_path = std::max(possible_paths, max_possible_path);
// if true, accept
if (rejection_filter(generator) < possible_paths) {
output_file << count << ' '
<< std::to_string(Table1_v) << ' '
//<< regionName << ' '
<< std::to_string(Table2_v) << ' '
//<< nationName << ' '
<< std::to_string(Table3_v) << ' '
<< std::to_string(Table4_v) << '\n';
count++;
}
else {
rejected++;
}
}
output_file.close();
return rejected;
}
int64_t baselineJoin(std::string outfile, int output_count, const std::vector<weight_t> &max_cardinality) {
// the exact join will combine between the four tables
std::ofstream output_file(outfile, std::ios::out);
int count = baselineJoin(output_file, output_count, max_cardinality);
output_file.close();
return count;
}
// Note, we will require a filter for each column. It can just be an empty filter (an everything filter)
// we will be doing a linear scan of the data to implement this algorithm for now.
int64_t pseudoIndexJoin(std::string outfile, std::vector<std::shared_ptr<jefastFilter> > filters) {
// implements a straightforward implementation of a join which
// does not require an index.
std::ofstream output_file(outfile, std::ios::out);
int64_t count = 0;
auto Table_1 = region_table;
auto Table_2 = nation_table;
auto Table_3 = supplier_table;
auto Table_4 = partssupp_table;
int table1Index2 = Table_Region::R_REGIONKEY;
int table2Index1 = Table_Nation::N_REGIONKEY;
int table2Index2 = Table_Nation::N_NATIONKEY;
int table3Index1 = Table_Supplier::S_NATIONKEY;
int table3Index2 = Table_Supplier::S_SUPPKEY;
int table4Index1 = Table_Partsupp::PS_SUPPKEY;
// build the hash for table 1
std::map<jfkey_t, std::vector<int64_t> > Table1_hash;
//int64_t Table_1_count = Table_1->row_count();
//for (int64_t i = 0; i < Table_1_count; ++i) {
for (auto f1_enu = filters.at(0)->getEnumerator(); f1_enu->Step();) {
Table1_hash[Table_1->get_int64(f1_enu->getValue(), table1Index2)].push_back(f1_enu->getValue());
}
// for (auto elem : Table1_hash){
// for (auto item_in_vector: elem.second){
// std::cout<<elem.first<<", "<<item_in_vector<<std::endl;
// }
//
// }
// build the hash for table 2. All matched elements from table 1 hash will be emitted
// the tuple has the form <index from table 1, index for table 2> for all matching tuple
std::map<jfkey_t, std::vector<std::tuple<int64_t, int64_t> > > Table2_hash;
//int64_t Table_2_count = Table_2->row_count();
//for (int64_t i = 0; i < Table_2_count; ++i) {
for (auto f2_enu = filters.at(1)->getEnumerator(); f2_enu->Step();) {
jfkey_t value = Table_2->get_int64(f2_enu->getValue(), table2Index1);
for (auto matching_indexes : Table1_hash[value]) {
Table2_hash[Table_2->get_int64(f2_enu->getValue(), table2Index2)].emplace_back(matching_indexes, f2_enu->getValue());
}
}
// for (auto elem : Table2_hash){
// std::cout<<elem.first<<", <";
// for (auto item_in_vector: elem.second){
// std::cout<<"("<<std::get<0>(item_in_vector)<<","<<std::get<1>(item_in_vector)<<"), ";
// }
// std::cout<<">"<<std::endl;
// }
// build the hash for table 3. All matched elements from table 2 hash will be emitted.
std::map<jfkey_t, std::vector<std::tuple<int64_t, int64_t, int64_t> > > Table3_hash;
//int64_t Table_3_count = Table_3->row_count();
//for (int64_t i = 0; i < Table_3_count; ++i) {
for (auto f3_enu = filters.at(2)->getEnumerator(); f3_enu->Step();) {
jfkey_t value = Table_3->get_int64(f3_enu->getValue(), table3Index1);
for (auto matching_indexes : Table2_hash[value]) {
Table3_hash[Table_3->get_int64(f3_enu->getValue(), table3Index2)].emplace_back(std::get<0>(matching_indexes), std::get<1>(matching_indexes), f3_enu->getValue());
}
}
// for (auto elem : Table3_hash){
// std::cout<<elem.first<<", <";
// for (auto item_in_vector: elem.second){
// std::cout<<"("<<std::get<0>(item_in_vector)<<","<<std::get<1>(item_in_vector)<<","<<std::get<2>(item_in_vector)<<"), ";
// }
// std::cout<<">"<<std::endl;
//
// }
// build the hash for table 4? No, we can just emit when we find a match in this case.
//int64_t Table_4_count = Table_4->row_count();
//for (int64_t i = 0; i < Table_5_count; ++i) {
for (auto f4_enu = filters.at(3)->getEnumerator(); f4_enu->Step();) {
int64_t value = Table_4->get_int64(f4_enu->getValue(), table4Index1);
for (auto matching_indexes : Table3_hash[value]) {
// emit the join results here.
output_file << count << ' '
<< std::to_string(Table_1->get_int64(std::get<0>(matching_indexes), table1Index2)) << ' '
<< std::to_string(Table_2->get_int64(std::get<1>(matching_indexes), table2Index2)) << ' '
<< std::to_string(Table_3->get_int64(std::get<2>(matching_indexes), table3Index2)) << ' '
<< std::to_string(Table_4->get_int64(f4_enu->getValue(), 1)) << '\n';
++count;
}
}
output_file.close();
return count;
}
void setup_data() {
// load the tables into memory
FileSizeTable table_sizes("fileInfo.txt");
data_map.reset(new FileKeyValue("query0_timings.txt"));
Timer timer;
std::cout << "opening tables" << std::endl;
timer.reset();
timer.start();
region_table.reset(new Table_Region("region.tbl", table_sizes.get_lines("region.tbl")));
nation_table.reset(new Table_Nation("nation.tbl", table_sizes.get_lines("nation.tbl")));
supplier_table.reset(new Table_Supplier("supplier.tbl", table_sizes.get_lines("supplier.tbl")));
partssupp_table.reset(new Table_Partsupp("partsupp.tbl", table_sizes.get_lines("partsupp.tbl")));
timer.stop();
std::cout << "opening tables took " << timer.getSeconds() << " seconds" << std::endl;
data_map->appendArray("opening_tables", long(timer.getMilliseconds()));
// build the indexes which might be used in the experiment
std::cout << "building indexes" << std::endl;
timer.reset();
timer.start();
// join indexes
if (query0Settings.buildIndex) {
region_table->get_key_index(Table_Region::R_REGIONKEY);
nation_table->get_key_index(Table_Nation::N_REGIONKEY);
nation_table->get_key_index(Table_Nation::N_NATIONKEY);
supplier_table->get_key_index(Table_Supplier::S_NATIONKEY);
supplier_table->get_key_index(Table_Supplier::S_SUPPKEY);
partssupp_table->get_key_index(Table_Partsupp::PS_SUPPKEY);
nation_table->get_composite_key_index(Table_Nation::N_REGIONKEY,Table_Nation::N_NATIONKEY);
supplier_table->get_composite_key_index(Table_Supplier::S_NATIONKEY, Table_Supplier::S_SUPPKEY);
}
// filtering conditions
// we do not currently have plans to do selection conditions on query 0
timer.stop();
std::cout << "done building indexes took " << timer.getMilliseconds() << " milliseconds" << std::endl;
data_map->appendArray("building_indexes", long(timer.getMilliseconds()));
// find max outdegree of each join?
}
int main(int argc, char** argv) {
query0Settings = parse_args(argc, argv);
setup_data();
Timer timer;
// do hash join
if(query0Settings.hashJoin)
{
std::vector<std::shared_ptr<jefastFilter> > filters(4);
filters.at(0) = std::shared_ptr<jefastFilter>(new all_jefastFilter(region_table, Table_Region::R_REGIONKEY));
filters.at(1) = std::shared_ptr<jefastFilter>(new all_jefastFilter(nation_table, Table_Nation::N_NATIONKEY));
filters.at(2) = std::shared_ptr<jefastFilter>(new all_jefastFilter(supplier_table, Table_Supplier::S_SUPPKEY));
filters.at(3) = std::shared_ptr<jefastFilter>(new all_jefastFilter(partssupp_table, Table_Partsupp::PS_PARTKEY));
timer.reset();
timer.start();
auto count = exactJoinNoIndex("query0_full.txt", filters);
timer.stop();
std::cout << "full join took " << timer.getMilliseconds() << " milliseconds with cardinality " << count << std::endl;
data_map->appendArray("full_join", long(timer.getMilliseconds()));
data_map->appendArray("full_join_cadinality", count);
}
// building jefast
if(query0Settings.buildJefast)
{
timer.reset();
timer.start();
JefastBuilder jefast_index_builder;
jefast_index_builder.AppendTable(region_table, -1, Table_Region::R_REGIONKEY, 0);
jefast_index_builder.AppendTable(nation_table, Table_Nation::N_REGIONKEY, Table_Nation::N_NATIONKEY, 1);
jefast_index_builder.AppendTable(supplier_table, Table_Supplier::S_NATIONKEY, Table_Supplier::S_SUPPKEY, 2);
jefast_index_builder.AppendTable(partssupp_table, Table_Partsupp::PS_SUPPKEY, -1, 3);
jefastIndex = jefast_index_builder.Build();
timer.stop();
std::cout << "building jefast took " << timer.getMilliseconds() << " milliseconds with cardinality " << jefastIndex->GetTotal() << std::endl;
data_map->appendArray("jefast_build", long(timer.getMilliseconds()));
}
// do a 10% sample using jefast
if(query0Settings.jefastSample)
{
timer.reset();
timer.start();
auto toRequest = jefastIndex->GetTotal() / 32;
auto count = randomjefastJoin("query0_sample.txt", toRequest, jefastIndex);
timer.stop();
std::cout << "sampling 10% took " << timer.getMilliseconds() << " milliseconds with cardinality " << count << std::endl;
data_map->appendArray("jefast_10p", long(timer.getMilliseconds()));
}
if (query0Settings.jefastModify)
{
// do random modifications for supplier, table 2
int table_id = 2;
data_map->appendArray("modifyCount", query0Settings.modifyCount);
// generate random ids to remove/insert
std::vector<jfkey_t> modify_records = generate_unique_random_numbers(query0Settings.modifyCount, 0, supplier_table->row_count());
// do delete
timer.reset();
timer.start();
for (auto record_id : modify_records) {
//std::cout << "removing " << record_id << std::endl;
jefastIndex->Delete(table_id, record_id);
}
timer.stop();
data_map->appendArray("DeleteTime", long(timer.getMilliseconds()));
std::cout << "delete of " << query0Settings.modifyCount << " took " << timer.getMilliseconds() << "ms. The cardinality is now " << jefastIndex->GetTotal() << std::endl;
// do insert
timer.reset();
timer.start();
for (auto record_id : modify_records) {
jefastIndex->Insert(table_id, record_id);
}
timer.stop();
std::cout << "insert of " << query0Settings.modifyCount << " took " << timer.getMilliseconds() << "ms. The cardinality is now " << jefastIndex->GetTotal() << std::endl;
}
// do a 10% baseline olkin join
if(query0Settings.olkenSample)
{
auto max_outdegree = jefastIndex->MaxOutdegree();
timer.reset();
timer.start();
auto toRequest = 100000;//jefastIndex->GetTotal() / 10;
auto rejected = baselineJoin("query0_samples.txt", toRequest, max_outdegree);
timer.stop();
std::cout << "baseline sample for 10% took " << timer.getMilliseconds() << " milliseconds accepted=" << toRequest << " rejected=" << rejected << std::endl;
data_map->appendArray("baseline_100000p", long(timer.getMilliseconds()));
data_map->appendArray("baseline_100000pRejected", rejected);
}
// do threading experiment for jefast
if (query0Settings.threading)
{
int64_t max_threads = 8;
int64_t requests = jefastIndex->GetTotal();
std::vector<std::string> output_file_names;
std::vector<std::future<int64_t> > results;
// open all the files
for (int i = 0; i < max_threads; ++i)
{
std::string filename = "query_";
filename += "0123456789"[i];
output_file_names.push_back(filename);
}
// do the trials.
for (int64_t i = 1; i <= max_threads; i *= 2) {
timer.reset();
timer.start();
// start the threads
for (int t = 0; t < i; ++t) {
results.emplace_back(std::async(randomjefastJoinT, query0Settings.null_file_name, requests / i, jefastIndex));
}
// wait for all the joins to finish
for (int t = 0; t < i; ++t) {
results[t].wait();
}
// all results are in!
timer.stop();
std::string results_string = "jefast_thread_";
results_string += "0123456789"[i];
std::cout << "finished test with " << i << " threads, taking " << timer.getMilliseconds() << " milliseconds" << std::endl;
data_map->appendArray(results_string, long(timer.getMilliseconds()));
}
}
if(query0Settings.jefastRate)
{
// do the sample rate test for jefast
Timer total_time;
double last_ms = 0;
int per_sample_request = 8000;
int total_samples = 0;
std::ofstream output_file("query0_sample.txt", std::ios::out);
std::ofstream results_file("query0_jefast_sample_rate.txt", std::ios::out);
total_time.reset();
do {
total_samples += randomjefastJoin(output_file, per_sample_request, jefastIndex);
total_time.update_accumulator();
total_time.update_accumulator();
results_file << total_time.getMilliseconds() << '\t' << total_samples << '\t' << per_sample_request << '\t' << (total_time.getMicroseconds() / 1000 - last_ms) << '\n';
last_ms = total_time.getMicroseconds() / 1000;
} while (total_time.getSeconds() < 4);
results_file.close();
}
if(query0Settings.OlkenRate)
{
// do the sample rate test for olkin join
Timer total_time;
double last_ms = 0;
int per_sample_request = 2000;
int total_samples = 0;
std::ofstream output_file("query0_sample.txt", std::ios::out);
std::ofstream results_file("query0_olkin_sample_rate.txt", std::ios::out);
auto max_outdegree = jefastIndex->MaxOutdegree();
total_time.reset();
do {
total_samples += baselineJoin(output_file, per_sample_request, max_outdegree);
total_time.update_accumulator();
total_time.update_accumulator();
results_file << total_time.getMilliseconds() << '\t' << total_samples << '\t' << per_sample_request << '\t' << (total_time.getMicroseconds() / 1000 - last_ms) << '\n';
last_ms = total_time.getMicroseconds() / 1000;
} while (total_time.getSeconds() < 4);
results_file.close();
}
// do index join
PseudoIndexBuilder pseudoIndexBuilder;
if (query0Settings.buildPseudoIndex){
std::cout<<"Start building pseudo index ..."<<std::endl;
timer.reset();
timer.start();
nation_table->get_join_attribute_relation_index(Table_Nation::N_REGIONKEY, Table_Nation::N_NATIONKEY);
supplier_table->get_join_attribute_relation_index( Table_Supplier::S_NATIONKEY, Table_Supplier::S_SUPPKEY);
pseudoIndexBuilder.AppendTable(region_table, -1, Table_Region::R_REGIONKEY, 0);
pseudoIndexBuilder.AppendTable(nation_table, Table_Nation::N_REGIONKEY, Table_Nation::N_NATIONKEY, 1);
pseudoIndexBuilder.AppendTable(supplier_table, Table_Supplier::S_NATIONKEY, -1,2);//Table_Supplier::S_SUPPKEY, 2);
// pseudoIndexBuilder.AppendTable(partssupp_table, Table_Partsupp::PS_SUPPKEY, -1, 3);
pseudoIndexBuilder.Build();
timer.stop();
std::cout << "building pseudo index took " << timer.getMilliseconds() << " milliseconds with cardinality " << pseudoIndexBuilder.getCardinality() << std::endl;
data_map->appendArray("pseudo index built ", long(timer.getMilliseconds()));
}
// do a 10% sample using pseudoIndex
if(query0Settings.indexJoin)
{
timer.reset();
timer.start();
JoinOutputColumnContainer joinOutputColumnContainer;
joinOutputColumnContainer.addColumn(0,Table_Region::R_NAME);
joinOutputColumnContainer.addColumn(1,Table_Nation::N_REGIONKEY);
joinOutputColumnContainer.addColumn(2,Table_Supplier::S_NATIONKEY);
joinOutputColumnContainer.addColumn(3,Table_Partsupp::PS_SUPPKEY);
// pseudoIndexBuilder.Sample(1000000);
pseudoIndexBuilder.Sample(1000000,joinOutputColumnContainer);
timer.stop();
std::cout << "sampling 100 took " << timer.getMilliseconds() << " milliseconds with cardinality " << "NEED FIXED" << std::endl;
data_map->appendArray("pseudo index took ", long(timer.getMilliseconds()));
}
PseudoIndexAdvancedBuilder pseudoIndexAdvancedBuilder;
if (query0Settings.buildPseudoIndexA){
std::cout<<"Start building advanced pseudo index ..."<<std::endl;
timer.reset();
timer.start();
nation_table->get_join_attribute_relation_index(Table_Nation::N_REGIONKEY, Table_Nation::N_NATIONKEY);
supplier_table->get_join_attribute_relation_index( Table_Supplier::S_NATIONKEY, Table_Supplier::S_SUPPKEY);
/*JoinPath joinPath;
joinPath.addNode("key",DATABASE_DATA_TYPES::STRING);
joinPath.addNode("12",DATABASE_DATA_TYPES::INT64);
std::cout<<joinPath.toString()<<std::endl;*/
// PathIndex pathIndex("joinPath",0);
pseudoIndexAdvancedBuilder.AppendTable(region_table, -1, Table_Region::R_REGIONKEY, 0);
pseudoIndexAdvancedBuilder.AppendTable(nation_table, Table_Nation::N_REGIONKEY, Table_Nation::N_NATIONKEY, 1);
pseudoIndexAdvancedBuilder.AppendTable(supplier_table, Table_Supplier::S_NATIONKEY, Table_Supplier::S_SUPPKEY, 2);
pseudoIndexAdvancedBuilder.AppendTable(partssupp_table, Table_Partsupp::PS_SUPPKEY, -1, 3);
pseudoIndexAdvancedBuilder.Build();
timer.stop();
std::cout << "building pseudo index took " << timer.getMilliseconds() << " milliseconds with cardinality " << pseudoIndexAdvancedBuilder.getCardinality() << std::endl;
data_map->appendArray("pseudo index built ", long(timer.getMilliseconds()));
}
data_map->flush();
std::cout << "done" << std::endl;
} | [
"[email protected]"
] | |
3c5a5b67066e8217dbf08b37ec94c1c62f8e68a1 | cb2ec9ec2366d8bf5e279eae2cb33ec28f93760a | /ProgramEncryptoAndDecrypto.cpp | 983bedc2c1de5c5a2ccfdb66513c8d01a8d0b794 | [] | no_license | trungliennd/Elliptic25519 | 8949d34836e4f93a24ad2c251a2dd9ff57cd5c53 | c70e51d1688dd8c90d49db5f574889a9f05e988e | refs/heads/master | 2020-05-25T20:19:29.396976 | 2017-03-14T15:38:10 | 2017-03-14T15:38:10 | 84,964,394 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,901 | cpp | #include <stdio.h>
#include <sodium.h>
#include <string>
#include <string.h>
#include <iostream>
#include <fstream>
#define MESSAGE_LEN 10240 // 1024 bytes
#define CIPHERTEXT_LEN_MESSAGE (MESSAGE_LEN + crypto_aead_aes256gcm_ABYTES) // 10240 + 16 bytes
#define NONCE_LEN crypto_secretbox_NONCEBYTES
#define BASE64_LEN 44
using namespace std;
unsigned char publicKey25519[crypto_scalarmult_curve25519_BYTES]; // use 32 bytes
unsigned char secretKey25519[crypto_scalarmult_curve25519_BYTES]; // use 32 bytes
unsigned char sharesKey25519[crypto_scalarmult_curve25519_BYTES]; // user 32 bytes
unsigned char nonce[crypto_secretbox_NONCEBYTES];
unsigned char MESSAGES[MESSAGE_LEN];
unsigned char CIPHERTEXT[MESSAGE_LEN + crypto_aead_aes256gcm_ABYTES];
void createPublicKeyAndSecretKey(char secretKey[],char publicKey[]);
void encrypto_messages(char file_message[],char file_ciphertext[]);
void decrypto_messages(char file_ciphertext[],char file_message[]);
string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len);
string base64_decode(std::string const& encoded_string);
inline bool is_base64(unsigned char c);
static const std::string base64_chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
void createPublicKeyAndSecretKey(char secretKey[],char publicKey[]) {
unsigned char publicKeyEd25519[crypto_sign_ed25519_PUBLICKEYBYTES];
unsigned char secretKeyEd25519[crypto_sign_ed25519_SECRETKEYBYTES];
/*
* convert ed25519 to curver295519
*/
crypto_sign_ed25519_keypair(publicKeyEd25519,secretKeyEd25519);
if(crypto_sign_ed25519_pk_to_curve25519(publicKey25519, publicKeyEd25519) == 0
&& crypto_sign_ed25519_sk_to_curve25519(secretKey25519,secretKeyEd25519) == 0){
printf("\nCreate Key Successfully!!!\n");
}
/*
* write public key and secret key
*/
FILE *out = fopen(secretKey,"w");
if(out == NULL) {
printf("\nWrite secretKey Fail");
exit(EXIT_FAILURE);
}else {
string secret = base64_encode(secretKey25519,crypto_scalarmult_curve25519_BYTES);
int len = secret.length();
fprintf(out,"---------------- SECERT KEY ----------------\n");
fwrite(secret.c_str(),1,len,out);
fprintf(out,"\n--------------------------------------------");
}
fclose(out);
FILE *inp = fopen(publicKey,"w");
if(inp == NULL) {
printf("\nWrite publicKey Fail");
exit(EXIT_FAILURE);
}else {
string pub = base64_encode(publicKey25519,crypto_scalarmult_curve25519_BYTES);
int len = pub.length();
fprintf(inp,"---------------- PUBLIC KEY ----------------\n");
fwrite(pub.c_str(),1,len,inp);
fprintf(inp,"\n--------------------------------------------");
/*
* printf public key
*/
printf("\n---------------- PUBLIC KEY ----------------\n");
printf("%s",pub.c_str());
printf("\n--------------------------------------------\n");
}
fclose(inp);
}
void copyKey(unsigned char *a,const char* b,int len) {
for(int i =0 ;i < len;i++) {
a[i] = b[i];
}
}
void loadPublicKeyOfPartnerAndMySecretKey(char publickey[],char secretkey[]) {
/*
* read publicKeyOfPartner
*/
FILE *inp = fopen(publickey,"r");
if(inp == NULL) {
printf("\nCan't read publicKey");
exit(EXIT_FAILURE);
}else {
unsigned char pub[BASE64_LEN];
fread(pub,1,BASE64_LEN,inp);
fscanf(inp,"%c",&pub[BASE64_LEN - 1]);
fread(pub,1,BASE64_LEN,inp);
pub[BASE64_LEN] = '\0';
string s((char*)pub);
copyKey(publicKey25519,base64_decode(s).c_str(),crypto_scalarmult_curve25519_BYTES);
}
publicKey25519[crypto_scalarmult_curve25519_BYTES] = '\0';
fclose(inp);
/*
* write MysecretKey
*/
FILE *out = fopen(secretkey,"r");
if(out == NULL) {
printf("\nCan't read secretKey");
exit(EXIT_FAILURE);
}else {
unsigned char secret[BASE64_LEN];
fread(secret,1,BASE64_LEN,out);
fscanf(out,"%c",&secret[BASE64_LEN - 1]);
fread(secret,1,BASE64_LEN,out);
secret[BASE64_LEN] = '\0';
string s((char*)secret);
copyKey(secretKey25519,base64_decode(s).c_str(),crypto_scalarmult_curve25519_BYTES);
}
secretKey25519[crypto_scalarmult_curve25519_BYTES] = '\0';
fclose(out);
// read successfully
}
inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
}
string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
string ret;
int i = 0;
int j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];
while (in_len--) {
char_array_3[i++] = *(bytes_to_encode++);
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for(i = 0; (i <4) ; i++)
ret += base64_chars[char_array_4[i]];
i = 0;
}
}
if (i)
{
for(j = i; j < 3; j++)
char_array_3[j] = '\0';
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (j = 0; (j < i + 1); j++)
ret += base64_chars[char_array_4[j]];
while((i++ < 3))
ret += '=';
}
return ret;
}
string base64_decode(std::string const& encoded_string) {
int in_len = encoded_string.size();
int i = 0;
int j = 0;
int in_ = 0;
unsigned char char_array_4[4], char_array_3[3];
string ret;
while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
char_array_4[i++] = encoded_string[in_]; in_++;
if (i ==4) {
for (i = 0; i <4; i++)
char_array_4[i] = base64_chars.find(char_array_4[i]);
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (i = 0; (i < 3); i++)
ret += char_array_3[i];
i = 0;
}
}
if (i) {
for (j = i; j <4; j++)
char_array_4[j] = 0;
for (j = 0; j <4; j++)
char_array_4[j] = base64_chars.find(char_array_4[j]);
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
}
return ret;
}
/*
void loadAndWriteNonce(char non[],char checked) {
if(checked == 'r') {
FILE *inp = fopen(non,"r");
if(inp == NULL) {
printf("\nCan't read Nonce");
exit(EXIT_FAILURE);
}else {
for(int i = 0;i < crypto_secretbox_NONCEBYTES;i++) {
fscanf(inp,"%c",&nonce[i]);
}
}
}else {
randombytes_buf(nonce, sizeof nonce);
FILE *inp = fopen(non,"w");
if(inp == NULL) {
printf("\nCan't write Nonce");
exit(EXIT_FAILURE);
}else {
for(int i = 0;i < crypto_secretbox_NONCEBYTES;i++) {
fprintf(inp,"%c",nonce[i]);
}
}
}
}
*/
void WriteFile(char non[],unsigned char key[],int len) {
FILE *inp = fopen(non,"wb");
if(inp == NULL) {
printf("\nCan't write Nonce");
exit(EXIT_FAILURE);
}else {
fwrite(CIPHERTEXT,1,len,inp);
}
}
void clearMESSAGES() {
for(int i = 0;i < MESSAGE_LEN;i++) {
MESSAGES[i] = '\0';
}
}
void encrypto_messages(char file_message[],char file_ciphertext[]) {
randombytes_buf(nonce, sizeof nonce);
//loadAndWriteNonce((char*)"nonce.txt",'w');
FILE *inp = fopen(file_message,"rb");
FILE *out = fopen(file_ciphertext,"wb");
if(inp == NULL || out == NULL) {
printf("\nCan't not encrypto");
exit(EXIT_FAILURE);
}
fwrite(nonce,1,NONCE_LEN,out);
//printf("\nnonce is: %d",(int)NONCE_LEN);
if (crypto_aead_aes256gcm_is_available() == 0) {
abort(); /* Not available on this CPU */
}
if(crypto_scalarmult(sharesKey25519,secretKey25519,publicKey25519) != 0) {
printf("\nCan't caculation share key");
exit(EXIT_FAILURE);
}
unsigned long long CIPHERTEXT_LEN;
int index = 0;
while(index = fread(MESSAGES,1,MESSAGE_LEN,inp) != 0){
if(crypto_aead_aes256gcm_encrypt(CIPHERTEXT,&CIPHERTEXT_LEN,MESSAGES,
MESSAGE_LEN, NULL,0,NULL,nonce,sharesKey25519) != 0){
printf("\nEncrypto Fail");
exit(EXIT_FAILURE);
}
fwrite(CIPHERTEXT,1,CIPHERTEXT_LEN,out);
clearMESSAGES();
}
fclose(inp);
fclose(out);
}
void decrypto_messages(char file_ciphertext[],char file_message[]) {
FILE *inp = fopen(file_ciphertext,"rb");
FILE *out = fopen(file_message,"w");
if(inp == NULL || out == NULL) {
printf("\nCan't decrypto ciphertext");
exit(EXIT_FAILURE);
}
if (crypto_aead_aes256gcm_is_available() == 0) {
abort(); /* Not available on this CPU */
}
if(crypto_scalarmult(sharesKey25519,secretKey25519,publicKey25519) != 0) {
printf("\nCan't caculation share key");
exit(EXIT_FAILURE);
}
char c;
int index = 0;
unsigned long long len;
/*
* read nonce into file cipher_text
*/
int size = fread(nonce,1,NONCE_LEN,inp);
if(size != (int)NONCE_LEN) {
printf("\nNonce not correct, size is: %d",size);
exit(EXIT_FAILURE);
}
while(fread(CIPHERTEXT,1,CIPHERTEXT_LEN_MESSAGE,inp) == (int)CIPHERTEXT_LEN_MESSAGE) {
if(crypto_aead_aes256gcm_decrypt(MESSAGES,&len,
NULL,CIPHERTEXT,CIPHERTEXT_LEN_MESSAGE,NULL,0,nonce,sharesKey25519)!=0
|| CIPHERTEXT_LEN_MESSAGE < crypto_aead_aes256gcm_KEYBYTES) {
printf("\nMessages is forged???");
}else {
for(int i = 0;i < MESSAGE_LEN;i++) {
if(MESSAGES[i] != '\0')
fprintf(out,"%c",MESSAGES[i]);
}
}
}
fclose(inp);
fclose(out);
}
int main(int argc,char **argv) {
if(sodium_init() == -1) {
return 1;
}
/*char file_one[] = "Alice";
char file_two[] = "Alice.pub";
char file_three[] = "Bob";
char file_four[] = "Bob.pub";
char out[] = "out.txt";*/
//createPublicKeyAndSecretKey(file_three ,file_four);
//loadPublicKeyOfPartnerAndMySecretKey(file_two,file_three);
//loadPublicKeyOfPartnerAndMySecretKey(file_four,file_one);
//decrypto_messages(out,(char*)"mess.txt");
//encrypto_messages((char*)"messages.txt",(char*)"out.txt");
//char file_mess[] = "mess.txt";
// char filename[] ="messages.txt";
//char fileout[] = "out.txt";
//loadPublicKeyOfPartnerAndMySecretKey((char*)"Bob.pub",(char*)"Alice");
//encrypto_messages(filename,fileout);
//decrypto_messages(fileout,file_mess);*/
if(strcmp(argv[1],"-genkey") == 0) {
printf("\n-genkey");
if(argv[2] == 0 || argv[3] == 0){
//printf("\ncase genkey\n");
createPublicKeyAndSecretKey((char*)"secretKey",(char*)"publicKey.pub");
}else {
createPublicKeyAndSecretKey(argv[2],argv[3]);
}
}else if(strcmp(argv[1],"-en") == 0) {
printf("\n-encrypto");
if(argv[2] == 0){
printf("\nPlease enter message need encryption");
}else {
if(argv[3] != 0) {
if(argv[4] == 0) {
loadPublicKeyOfPartnerAndMySecretKey(argv[3],(char*)"secretKey");
encrypto_messages(argv[2],(char*)"ciphertext.txt");
}else {
loadPublicKeyOfPartnerAndMySecretKey(argv[3],argv[4]);
if(argv[5] != 0) {
encrypto_messages(argv[2],argv[5]);
}else {
encrypto_messages(argv[2],(char*)"ciphertext.txt");
}
}
}else {
printf("\nPlease enter file contain secretkey and publickey of partner");
}
}
}else if(strcmp(argv[1],"-de") == 0) {
printf("\n-decrypto");
if(argv[2] == 0){
printf("\nPlease enter ciphertex need decryption");
}else {
if(argv[3] != 0) {
if(argv[4] == 0) {
loadPublicKeyOfPartnerAndMySecretKey(argv[3],(char*)"secretKey");
decrypto_messages(argv[2],(char*)"messages_text.txt");
}else {
loadPublicKeyOfPartnerAndMySecretKey(argv[3],argv[4]);
if(argv[5] != 0) {
decrypto_messages(argv[2],argv[5]);
}else {
decrypto_messages(argv[2],(char*)"messages_text.txt");
}
}
}else {
printf("\nPlease enter file contain secretkey and publickey of partner");
}
}
}else {
printf("\nNo Have Option %s",argv[1]);
printf("\nPlease choose a into -options: -genkey, -en, -de");
}
}
| [
"[email protected]"
] | |
21e612cfdee3b2f3d10efa2233eb5886bdb65bf7 | 4509f3721d6ebea8fd7f4cb23450d2fe56060c77 | /src/engine/graphics/source/TextureFactory.cpp | 091d58a8432fcfabccba56224e0c0beb62fbe731 | [] | no_license | Kadowns/RIFE-Engine | 54fa0199a4ba6856f3d925cbcf035f60eb53a75f | 975373ef1e4104edbfcf5fddc5a065dd9e5b05a7 | refs/heads/master | 2020-03-28T02:50:08.366865 | 2019-05-24T15:55:00 | 2019-05-24T15:55:00 | 147,600,758 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,782 | cpp | #include <TextureFactory.h>
#include <VulkanTools.h>
#include <VulkanData.h>
#include <RifePath.h>
//#define STB_IMAGE_IMPLEMENTATION
//#include <stb_image.h>
#include <gli/gli.hpp>
#include <Buffer.h>
namespace Rife::Graphics {
Texture* TextureFactory::loadTexture(const std::string& path) {
TextureInfo textureInfo = {};
createTexture2DImage(path, textureInfo);
return new Texture(textureInfo);
}
Texture* TextureFactory::defaultTexture() {
TextureInfo textureInfo = {};
createTexture2DImage("",textureInfo);
return new Texture(textureInfo);
}
Texture* TextureFactory::loadCubemap(const std::string& path) {
TextureInfo textureInfo = {};
createCubemapImage(path, textureInfo);
return new Texture(textureInfo);
}
void TextureFactory::createTexture2DImage(const std::string& path, TextureInfo& texture) {
gli::texture tex(gli::load(TEXTURE_FOLDER + path));
if (tex.empty()) {
gli::texture tex = gli::load(TEXTURE_FOLDER + std::string("default_texture.ktx"));
}
texture.extent.width = tex.extent().x;
texture.extent.height = tex.extent().y;
texture.mipLevels = tex.levels();
texture.layerCount = tex.layers();
Buffer stagingBuffer;
BufferInfo info = {};
info.memoryPropertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
info.usageFlags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
VulkanTools::createBuffer(
tex.size(),
info,
stagingBuffer,
tex.data()
);
VkFormat format;
VkPhysicalDeviceFeatures deviceFeatures = Vulkan::physicalDeviceFeatures;
if (deviceFeatures.textureCompressionBC) {
format = VK_FORMAT_BC3_UNORM_BLOCK;
}
else if (deviceFeatures.textureCompressionASTC_LDR) {
format = VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
}
else if (deviceFeatures.textureCompressionETC2) {
format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
}
else {
throw std::runtime_error("Failed to find a supported texture format!");
}
VulkanTools::createImage(
texture.extent.width, texture.extent.height, texture.mipLevels, 1,
format, VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
texture.image,
texture.memory,
0
);
VkImageSubresourceRange subresourceRange = {};
subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
subresourceRange.baseMipLevel = 0;
subresourceRange.levelCount = 1;
subresourceRange.baseArrayLayer = 0;
subresourceRange.layerCount = 1;
VulkanTools::transitionImageLayout(texture.image, format, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange);
copyBufferToImage(stagingBuffer.buffer, texture.image, texture.extent.width, texture.extent.height);
VulkanTools::transitionImageLayout(texture.image, format, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange);
stagingBuffer.destroy();
texture.imageView = VulkanTools::createImageView(texture.image, format, VK_IMAGE_VIEW_TYPE_2D, subresourceRange);
createTextureSampler(texture);
}
void TextureFactory::createCubemapImage(const std::string& path, TextureInfo& texture) {
gli::texture_cube texCube(gli::load(TEXTURE_FOLDER + path));
assert(!texCube.empty());
texture.extent.width = texCube.extent().x;
texture.extent.height = texCube.extent().y;
texture.mipLevels = texCube.levels();
texture.layerCount = texCube.layers();
Buffer stagingBuffer;
BufferInfo info = {};
info.memoryPropertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
info.usageFlags = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
VulkanTools::createBuffer(
texCube.size(),
info,
stagingBuffer,
texCube.data()
);
VkFormat format;
VkPhysicalDeviceFeatures deviceFeatures = Vulkan::physicalDeviceFeatures;
if (deviceFeatures.textureCompressionBC) {
format = VK_FORMAT_BC3_UNORM_BLOCK;
}
else if (deviceFeatures.textureCompressionASTC_LDR) {
format = VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
}
else if (deviceFeatures.textureCompressionETC2) {
format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
}
else {
throw std::runtime_error("Failed to find a supported texture format!");
}
VulkanTools::createImage(
texture.extent.width, texture.extent.height, texture.mipLevels, 6,
format, VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT,
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
texture.image,
texture.memory,
VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT
);
VkImageSubresourceRange subresourceRange = {};
subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
subresourceRange.baseMipLevel = 0;
subresourceRange.levelCount = texture.mipLevels;
subresourceRange.layerCount = 6;
VulkanTools::transitionImageLayout(
texture.image, format, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, subresourceRange
);
copyBufferToCubemap(stagingBuffer.buffer, texture.image, texCube);
VulkanTools::transitionImageLayout(
texture.image, format, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, subresourceRange
);
stagingBuffer.destroy();
texture.imageView = VulkanTools::createImageView(texture.image, format, VK_IMAGE_VIEW_TYPE_CUBE, subresourceRange);
createTextureSampler(texture);
}
void TextureFactory::createTextureSampler(TextureInfo& texture) {
VkSamplerCreateInfo samplerInfo = {};
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.magFilter = VK_FILTER_LINEAR;
samplerInfo.minFilter = VK_FILTER_LINEAR;
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
samplerInfo.anisotropyEnable = VK_TRUE;
samplerInfo.maxAnisotropy = 16;
samplerInfo.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK;
samplerInfo.unnormalizedCoordinates = VK_FALSE;
samplerInfo.compareEnable = VK_FALSE;
samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
samplerInfo.mipLodBias = 0.0f;
samplerInfo.minLod = 0.0f;
samplerInfo.maxLod = texture.mipLevels;
if (vkCreateSampler(Vulkan::device, &samplerInfo, nullptr, &texture.sampler) != VK_SUCCESS) {
throw std::runtime_error("failed to create texture sampler!");
}
}
void TextureFactory::copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) {
VkCommandBuffer commandBuffer = VulkanTools::beginSingleTimeCommands();
VkBufferImageCopy region = {};
region.bufferOffset = 0;
region.bufferRowLength = 0;
region.bufferImageHeight = 0;
region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
region.imageSubresource.mipLevel = 0;
region.imageSubresource.baseArrayLayer = 0;
region.imageSubresource.layerCount = 1;
region.imageOffset = { 0, 0, 0 };
region.imageExtent = {
width,
height,
1
};
vkCmdCopyBufferToImage(
commandBuffer,
buffer,
image,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
1,
®ion
);
VulkanTools::endSingleTimeCommands(commandBuffer);
}
void TextureFactory::copyBufferToCubemap(VkBuffer buffer, VkImage image, gli::texture_cube& cube) {
VkCommandBuffer commandBuffer = VulkanTools::beginSingleTimeCommands();
std::vector<VkBufferImageCopy> bufferCopyRegions;
uint32_t offset = 0;
for (uint32_t face = 0; face < 6; face++) {
for (uint32_t level = 0; level < cube.levels(); level++) {
VkBufferImageCopy bufferCopyRegion = {};
bufferCopyRegion.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
bufferCopyRegion.imageSubresource.mipLevel = level;
bufferCopyRegion.imageSubresource.baseArrayLayer = face;
bufferCopyRegion.imageSubresource.layerCount = 1;
bufferCopyRegion.imageExtent.width = cube[face][level].extent().x;
bufferCopyRegion.imageExtent.height = cube[face][level].extent().y;
bufferCopyRegion.imageExtent.depth = 1;
bufferCopyRegion.bufferOffset = offset;
bufferCopyRegions.push_back(bufferCopyRegion);
// Increase offset into staging buffer for next level / face
offset += cube[face][level].size();
}
}
vkCmdCopyBufferToImage(
commandBuffer,
buffer,
image,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
static_cast<uint32_t>(bufferCopyRegions.size()),
bufferCopyRegions.data()
);
VulkanTools::endSingleTimeCommands(commandBuffer);
}
}
| [
"[email protected]"
] | |
814d9d012dd866e0a33e6c927731ca93088cb2f8 | c9ef7415e544524d6e0733c82b839f6e4a3fa6f1 | /src/entrydialog.cpp | 6bb79db78d1a1921071807cc39b328adc9d978b9 | [
"MIT"
] | permissive | vladyslavmakartet/recipe_planner_qt | e0adda722b67cc8087d37ae0952029bc1b46d7b4 | 84a5af03d11674cb426b37ec52016a3a2781c800 | refs/heads/master | 2023-04-12T22:44:52.972786 | 2021-04-23T21:49:47 | 2021-04-23T21:49:47 | 355,707,111 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,230 | cpp | #include "entrydialog.h"
EntryDialog::EntryDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::EntryDialog)
{
ui->setupUi(this);
model = new ingredientTableModel();
ui->IngredientsTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->IngredientsTableView->setCornerButtonEnabled(false);
ui->IngredientsTableView->setStyleSheet("QHeaderView::section{"
"border-top:0px solid #D8D8D8;"
"border-left:0px solid #D8D8D8;"
"border-right:1px solid #D8D8D8;"
"border-bottom: 1px solid #D8D8D8;"
"background-color:white;"
"padding:4px;"
"}");
ui->IngredientsTableView->setStyleSheet("QTableCornerButton::section{"
"border-top:0px solid #D8D8D8;"
"border-left:0px solid #D8D8D8;"
"border-right:1px solid #D8D8D8;"
"border-bottom: 1px solid #D8D8D8;"
"background-color:white;"
"}");
ui->IngredientsTableView->setModel(model);
ui->IngredientsTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); //To disable editing
ui->addButton->setEnabled(false);
ui->modifyButton->setEnabled(false);
ui->deleteButton->setEnabled(false);
ui->applyButton->setEnabled(false);
ui->IngredientsTableView->setSelectionMode(QAbstractItemView::SingleSelection);
ui->IngredientsTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
connect(ui->ingredientNameLine, &QLineEdit::textChanged, this, &EntryDialog::allLinesFilled);
connect(ui->QuantityLine, &QLineEdit::textChanged, this, &EntryDialog::allLinesFilled);
connect(ui->UnitLine, &QLineEdit::textChanged, this, &EntryDialog::allLinesFilled);
connect(ui->RecipeNameLine, &QLineEdit::textChanged, this, &EntryDialog::allFieldsFilled);
connect(ui->RecipeTextEdit, &QTextEdit::textChanged, this, &EntryDialog::allFieldsFilled);
connect(this, &EntryDialog::FieldsFilled, this, &EntryDialog::allFieldsFilled);
connect(ui->IngredientsTableView, &QAbstractItemView::clicked,this, &EntryDialog::enableButtons);
connect(this, &EntryDialog::clearLineEdits,ui->ingredientNameLine, &QLineEdit::clear);
connect(this, &EntryDialog::clearLineEdits,ui->QuantityLine, &QLineEdit::clear);
connect(this, &EntryDialog::clearLineEdits,ui->UnitLine, &QLineEdit::clear);
}
EntryDialog::~EntryDialog()
{
delete ui;
}
void EntryDialog::allLinesFilled()
{
ui->QuantityLine->setValidator(new QDoubleValidator(0,1000,2,this));
bool ok = !ui->ingredientNameLine->text().isEmpty()
&& !ui->UnitLine->text().isEmpty()
&& !ui->QuantityLine->text().isEmpty();
ui->addButton->setEnabled(ok);
}
void EntryDialog::allFieldsFilled()
{
bool ok = model->rowCount() != 0
&& !ui->RecipeNameLine->text().isEmpty()
&& !ui->RecipeTextEdit->document()->isEmpty();
ui->applyButton->setEnabled(ok);
}
void EntryDialog::on_modifyButton_clicked()
{
QModelIndex selected = model->index(ui->IngredientsTableView->selectionModel()->currentIndex().row(),0, QModelIndex());
int selectedRow = ui->IngredientsTableView->selectionModel()->currentIndex().row();
if (selected.isValid()){
if(ui->ingredientNameLine->text() != ingredientVector[selectedRow].getIngredientName()\
|| ui->QuantityLine->text().toFloat() != ingredientVector[selectedRow].getIngredientQuantity()
|| ui->UnitLine->text() != ingredientVector[selectedRow].getIngredientUnit()){
if(!ui->ingredientNameLine->text().isEmpty() && ui->ingredientNameLine->text() != ingredientVector[selectedRow].getIngredientName()){
model->setData(selected,ui->ingredientNameLine->text(),Qt::EditRole);
ingredientVector[selectedRow].setIngredientName(ui->ingredientNameLine->text());
}
if(!ui->QuantityLine->text().isEmpty() && ui->QuantityLine->text().toFloat() != ingredientVector[selectedRow].getIngredientQuantity()){
if(ui->QuantityLine->text().toFloat()!=0)
{
selected = model->index(ui->IngredientsTableView->selectionModel()->currentIndex().row(),1, QModelIndex());
model->setData(selected,ui->QuantityLine->text().toFloat(),Qt::EditRole);
ingredientVector[selectedRow].setIngredientQuantity(ui->QuantityLine->text().toFloat());
}
}
if(!ui->UnitLine->text().isEmpty() && ui->UnitLine->text() != ingredientVector[selectedRow].getIngredientUnit()){
selected = model->index(ui->IngredientsTableView->selectionModel()->currentIndex().row(),2, QModelIndex());
model->setData(selected,ui->UnitLine->text(),Qt::EditRole);
ingredientVector[selectedRow].setIngredientUnit(ui->UnitLine->text());
}
ui->IngredientsTableView->setModel(model);
ui->modifyButton->setEnabled(false);
ui->deleteButton->setEnabled(false);
emit clearLineEdits();
}
}
}
void EntryDialog::on_addButton_clicked()
{
if(!(ui->ingredientNameLine->text().isEmpty() || ui->QuantityLine->text().isEmpty() || ui->UnitLine->text().isEmpty())){
if(ui->QuantityLine->text().toFloat()!=0){
ingredient.setIngredientName(ui->ingredientNameLine->text());
ingredient.setIngredientQuantity(ui->QuantityLine->text().toFloat());
ingredient.setIngredientUnit(ui->UnitLine->text());
bool sameItem = false;
if(!ingredientVector.isEmpty()){
for(int i=0; i<ingredientVector.size(); i++){
if(ingredientVector[i].getIngredientName() == ingredient.getIngredientName()
&& ingredientVector[i].getIngredientUnit() == ingredient.getIngredientUnit())
sameItem = true;
}
}
if(!sameItem){
model->insertRow(model->rowCount());
QModelIndex index = model->index(model->rowCount()-1,0, QModelIndex());
model->setData(index,ui->ingredientNameLine->text(),Qt::EditRole);
index = model->index(model->rowCount()-1,1, QModelIndex());
model->setData(index,ui->QuantityLine->text().toFloat(),Qt::EditRole);
index = model->index(model->rowCount()-1,2, QModelIndex());
model->setData(index,ui->UnitLine->text(),Qt::EditRole);
ui->IngredientsTableView->setModel(model);
ui->modifyButton->setEnabled(false);
ui->deleteButton->setEnabled(false);
ingredientVector.append(ingredient);
ui->IngredientsTableView->resizeRowsToContents();
emit clearLineEdits();
emit FieldsFilled();
}
}
}
}
void EntryDialog::enableButtons()
{
if(!ui->ingredientNameLine->text().isEmpty() || !ui->QuantityLine->text().isEmpty() || !ui->UnitLine->text().isEmpty())
ui->modifyButton->setEnabled(true);
ui->deleteButton->setEnabled(true);
}
void EntryDialog::on_deleteButton_clicked()
{
QModelIndexList selected = ui->IngredientsTableView->selectionModel()->selectedIndexes();
if (!selected.isEmpty())
{
ingredientVector.removeAt(selected.first().row());
ui->IngredientsTableView->model()->removeRow(selected.first().row());
if (ingredientVector.isEmpty())
{
ui->modifyButton->setEnabled(false);
ui->deleteButton->setEnabled(false);
emit FieldsFilled();
}
}
}
void EntryDialog::on_okButton_clicked()
{
done(Accepted);
}
void EntryDialog::on_applyButton_clicked()
{
Recipe *recipe = new Recipe(ui->RecipeNameLine->text(),ui->RecipeTextEdit->toPlainText(),ingredientVector);
emit applyPressed(*recipe);
delete recipe;
setResult(Accepted);
}
void EntryDialog::on_cancelButton_clicked()
{
done(Rejected);
}
| [
"[email protected]"
] | |
4bf03faa4649d419b57a8badc14ab4c4c9d9fe1d | e036d5f3991cb93fbe0baea82f250c6f79dc1493 | /moreAlgorithms/MinNumberInRotatedArray.cpp | c9f3c34d3e49ee16b3a315539674b043582bba09 | [] | no_license | aibbgiser/leetcode | ad2dc77756b5e6623337fc5172457a31f2e95f2b | 6eef6693eb0659b448310e8cde444775a330d7c6 | refs/heads/master | 2020-07-04T21:18:45.162433 | 2016-12-30T10:04:55 | 2016-12-30T10:04:55 | 74,137,061 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,310 | cpp | #include<exception>
#include <iostream>
using std::cout;
using std::endl;
using std::exception;
int MinInOrder( int* numbers, int index1, int index2 ){
int result = numbers[index1];
for ( int i=index1+1; i<=index2 ;++i ){
if ( result>numbers[i] ){
result = numbers[i];
}
}
return result;
}
int min( int* numbers, int length ){
if ( numbers==NULL || length<=0 ){
throw new exception("Invalid parameters");
}
int index1 = 0;
int index2 = length - 1;
int indexMid = index1; //最后返回这个
while( numbers[index1]>=numbers[index2] ){
if ( index2-index1 == 1 ){
indexMid = index2;
break;
}
indexMid = (index1 + index2) / 2;
if ( numbers[index1]==numbers[index2] && numbers[index1]==numbers[indexMid] ){
return MinInOrder(numbers, index1, index2);
}
if(numbers[indexMid] >= numbers[index1]){
index1 = indexMid;
}else{
if(numbers[indexMid] <= numbers[index2])
index2 = indexMid;
}
}
return numbers[indexMid];
}
void Test(int* numbers, int length, int expected){
int result;
try{
result = min(numbers,length);
for ( int i=0; i<length; ++i ){
cout<<numbers[i]<<" ";
}
if(result==expected)
cout<<"test passed."<<endl;
else
cout<<"test failed."<<endl;
}
catch(...){
if(numbers==NULL)
cout<<"test passed."<<endl;
else
cout<<"test failed."<<endl;
}
}
int main(){
// 典型输入,单调升序的数组的一个旋转
int array1[] = {3, 4, 5, 1, 2};
Test(array1, sizeof(array1) / sizeof(int), 1);
// 有重复数字,并且重复的数字刚好的最小的数字
int array2[] = {3, 4, 5, 1, 1, 2};
Test(array2, sizeof(array2) / sizeof(int), 1);
// 有重复数字,但重复的数字不是第一个数字和最后一个数字
int array3[] = {3, 4, 5, 1, 2, 2};
Test(array3, sizeof(array3) / sizeof(int), 1);
// 有重复的数字,并且重复的数字刚好是第一个数字和最后一个数字
int array4[] = {1, 0, 1, 1, 1};
Test(array4, sizeof(array4) / sizeof(int), 0);
// 单调升序数组,旋转0个元素,也就是单调升序数组本身
int array5[] = {1, 2, 3, 4, 5};
Test(array5, sizeof(array5) / sizeof(int), 1);
// 数组中只有一个数字
int array6[] = {2};
Test(array6, sizeof(array6) / sizeof(int), 2);
// 输入NULL
Test(NULL, 0, 0);
system("pause");
return 0;
} | [
"[email protected]"
] | |
86a85560961b6d6a17f74dba0936b063b5eb0427 | 73ee941896043f9b3e2ab40028d24ddd202f695f | /external/chromium_org/content/renderer/media/video_capture_message_filter_unittest.cc | 222600ad830fc7020c6334dcc9113928740f1826 | [
"BSD-3-Clause"
] | permissive | CyFI-Lab-Public/RetroScope | d441ea28b33aceeb9888c330a54b033cd7d48b05 | 276b5b03d63f49235db74f2c501057abb9e79d89 | refs/heads/master | 2022-04-08T23:11:44.482107 | 2016-09-22T20:15:43 | 2016-09-22T20:15:43 | 58,890,600 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 7,135 | 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 "base/memory/shared_memory.h"
#include "base/message_loop/message_loop.h"
#include "content/common/media/video_capture_messages.h"
#include "content/renderer/media/video_capture_message_filter.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
class MockVideoCaptureDelegate : public VideoCaptureMessageFilter::Delegate {
public:
MockVideoCaptureDelegate() {
Reset();
device_id_received_ = false;
device_id_ = 0;
}
virtual void OnBufferCreated(base::SharedMemoryHandle handle,
int length, int buffer_id) OVERRIDE {
buffer_created_ = true;
handle_ = handle;
}
// Called when a video frame buffer is received from the browser process.
virtual void OnBufferReceived(int buffer_id, base::Time timestamp) OVERRIDE {
buffer_received_ = true;
buffer_id_ = buffer_id;
timestamp_ = timestamp;
}
virtual void OnStateChanged(VideoCaptureState state) OVERRIDE {
state_changed_received_ = true;
state_ = state;
}
virtual void OnDeviceInfoReceived(
const media::VideoCaptureParams& params) OVERRIDE {
device_info_received_ = true;
params_.width = params.width;
params_.height = params.height;
params_.frame_per_second = params.frame_per_second;
}
virtual void OnDelegateAdded(int32 device_id) OVERRIDE {
device_id_received_ = true;
device_id_ = device_id;
}
void Reset() {
buffer_created_ = false;
handle_ = base::SharedMemory::NULLHandle();
buffer_received_ = false;
buffer_id_ = -1;
timestamp_ = base::Time();
state_changed_received_ = false;
state_ = VIDEO_CAPTURE_STATE_ERROR;
device_info_received_ = false;
params_.width = 0;
params_.height = 0;
params_.frame_per_second = 0;
}
bool buffer_created() { return buffer_created_; }
base::SharedMemoryHandle received_buffer_handle() { return handle_; }
bool buffer_received() { return buffer_received_; }
int received_buffer_id() { return buffer_id_; }
base::Time received_buffer_ts() { return timestamp_; }
bool state_changed_received() { return state_changed_received_; }
VideoCaptureState state() { return state_; }
bool device_info_receive() { return device_info_received_; }
const media::VideoCaptureParams& received_device_info() { return params_; }
int32 device_id() { return device_id_; }
private:
bool buffer_created_;
base::SharedMemoryHandle handle_;
bool buffer_received_;
int buffer_id_;
base::Time timestamp_;
bool state_changed_received_;
VideoCaptureState state_;
bool device_info_received_;
media::VideoCaptureParams params_;
bool device_id_received_;
int32 device_id_;
DISALLOW_COPY_AND_ASSIGN(MockVideoCaptureDelegate);
};
} // namespace
TEST(VideoCaptureMessageFilterTest, Basic) {
base::MessageLoop message_loop(base::MessageLoop::TYPE_IO);
scoped_refptr<VideoCaptureMessageFilter> filter(
new VideoCaptureMessageFilter());
filter->channel_ = reinterpret_cast<IPC::Channel*>(1);
MockVideoCaptureDelegate delegate;
filter->AddDelegate(&delegate);
// VideoCaptureMsg_StateChanged
EXPECT_FALSE(delegate.state_changed_received());
filter->OnMessageReceived(
VideoCaptureMsg_StateChanged(delegate.device_id(),
VIDEO_CAPTURE_STATE_STARTED));
EXPECT_TRUE(delegate.state_changed_received());
EXPECT_TRUE(VIDEO_CAPTURE_STATE_STARTED == delegate.state());
delegate.Reset();
// VideoCaptureMsg_NewBuffer
const base::SharedMemoryHandle handle =
#if defined(OS_WIN)
reinterpret_cast<base::SharedMemoryHandle>(10);
#else
base::SharedMemoryHandle(10, true);
#endif
EXPECT_FALSE(delegate.buffer_created());
filter->OnMessageReceived(VideoCaptureMsg_NewBuffer(
delegate.device_id(), handle, 1, 1));
EXPECT_TRUE(delegate.buffer_created());
EXPECT_EQ(handle, delegate.received_buffer_handle());
delegate.Reset();
// VideoCaptureMsg_BufferReady
int buffer_id = 1;
base::Time timestamp = base::Time::FromInternalValue(1);
EXPECT_FALSE(delegate.buffer_received());
filter->OnMessageReceived(VideoCaptureMsg_BufferReady(
delegate.device_id(), buffer_id, timestamp));
EXPECT_TRUE(delegate.buffer_received());
EXPECT_EQ(buffer_id, delegate.received_buffer_id());
EXPECT_TRUE(timestamp == delegate.received_buffer_ts());
delegate.Reset();
// VideoCaptureMsg_DeviceInfo
media::VideoCaptureParams params;
params.width = 320;
params.height = 240;
params.frame_per_second = 30;
EXPECT_FALSE(delegate.device_info_receive());
filter->OnMessageReceived(VideoCaptureMsg_DeviceInfo(
delegate.device_id(), params));
EXPECT_TRUE(delegate.device_info_receive());
EXPECT_EQ(params.width, delegate.received_device_info().width);
EXPECT_EQ(params.height, delegate.received_device_info().height);
EXPECT_EQ(params.frame_per_second,
delegate.received_device_info().frame_per_second);
delegate.Reset();
message_loop.RunUntilIdle();
}
TEST(VideoCaptureMessageFilterTest, Delegates) {
base::MessageLoop message_loop(base::MessageLoop::TYPE_IO);
scoped_refptr<VideoCaptureMessageFilter> filter(
new VideoCaptureMessageFilter());
filter->channel_ = reinterpret_cast<IPC::Channel*>(1);
MockVideoCaptureDelegate delegate1;
MockVideoCaptureDelegate delegate2;
filter->AddDelegate(&delegate1);
filter->AddDelegate(&delegate2);
// Send an IPC message. Make sure the correct delegate gets called.
EXPECT_FALSE(delegate1.state_changed_received());
EXPECT_FALSE(delegate2.state_changed_received());
filter->OnMessageReceived(
VideoCaptureMsg_StateChanged(delegate1.device_id(),
VIDEO_CAPTURE_STATE_STARTED));
EXPECT_TRUE(delegate1.state_changed_received());
EXPECT_FALSE(delegate2.state_changed_received());
delegate1.Reset();
EXPECT_FALSE(delegate1.state_changed_received());
EXPECT_FALSE(delegate2.state_changed_received());
filter->OnMessageReceived(
VideoCaptureMsg_StateChanged(delegate2.device_id(),
VIDEO_CAPTURE_STATE_STARTED));
EXPECT_FALSE(delegate1.state_changed_received());
EXPECT_TRUE(delegate2.state_changed_received());
delegate2.Reset();
// Remove the delegates. Make sure they won't get called.
filter->RemoveDelegate(&delegate1);
EXPECT_FALSE(delegate1.state_changed_received());
filter->OnMessageReceived(
VideoCaptureMsg_StateChanged(delegate1.device_id(),
VIDEO_CAPTURE_STATE_STARTED));
EXPECT_FALSE(delegate1.state_changed_received());
filter->RemoveDelegate(&delegate2);
EXPECT_FALSE(delegate2.state_changed_received());
filter->OnMessageReceived(
VideoCaptureMsg_StateChanged(delegate2.device_id(),
VIDEO_CAPTURE_STATE_STARTED));
EXPECT_FALSE(delegate2.state_changed_received());
message_loop.RunUntilIdle();
}
} // namespace content
| [
"[email protected]"
] | |
0c68c67acd5dd4c5d7f7b51077ad5b573efa954e | 0019f0af5518efe2144b6c0e63a89e3bd2bdb597 | /antares/src/apps/screenshot/Screenshot.cpp | 35bdbba1e93cbc05535b726674c984e31755adb4 | [] | no_license | mmanley/Antares | 5ededcbdf09ef725e6800c45bafd982b269137b1 | d35f39c12a0a62336040efad7540c8c5bce9678a | refs/heads/master | 2020-06-02T22:28:26.722064 | 2010-03-08T21:51:31 | 2010-03-08T21:51:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,727 | cpp | /*
* Copyright Karsten Heimrich, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Karsten Heimrich
* Fredrik Modéen
*/
#include "Screenshot.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Catalog.h>
#include <Locale.h>
#include <TranslatorFormats.h>
#include "ScreenshotWindow.h"
Screenshot::Screenshot()
:
BApplication("application/x-vnd.Antares-Screenshot"),
fArgvReceived(false),
fRefsReceived(false),
fImageFileType(B_PNG_FORMAT),
fTranslator(8)
{
be_locale->GetAppCatalog(&fCatalog);
}
Screenshot::~Screenshot()
{
}
void
Screenshot::ReadyToRun()
{
if (!fArgvReceived && !fRefsReceived)
new ScreenshotWindow();
fArgvReceived = false;
fRefsReceived = false;
}
void
Screenshot::RefsReceived(BMessage* message)
{
int32 delay = 0;
message->FindInt32("delay", &delay);
bool includeBorder = false;
message->FindBool("border", &includeBorder);
bool includeMouse = false;
message->FindBool("border", &includeMouse);
bool grabActiveWindow = false;
message->FindBool("window", &grabActiveWindow);
bool saveScreenshotSilent = false;
message->FindBool("silent", &saveScreenshotSilent);
bool showConfigureWindow = false;
message->FindBool("configure", &showConfigureWindow);
new ScreenshotWindow(delay * 1000000, includeBorder, includeMouse,
grabActiveWindow, showConfigureWindow, saveScreenshotSilent);
fRefsReceived = true;
}
void
Screenshot::ArgvReceived(int32 argc, char** argv)
{
bigtime_t delay = 0;
bool includeBorder = false;
bool includeMouse = false;
bool grabActiveWindow = false;
bool showConfigureWindow = false;
bool saveScreenshotSilent = false;
for (int32 i = 0; i < argc; i++) {
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
_ShowHelp();
else if (strcmp(argv[i], "-b") == 0
|| strcmp(argv[i], "--border") == 0)
includeBorder = true;
else if (strcmp(argv[i], "-m") == 0
|| strcmp(argv[i], "--mouse-pointer") == 0)
includeMouse = true;
else if (strcmp(argv[i], "-w") == 0
|| strcmp(argv[i], "--window") == 0)
grabActiveWindow = true;
else if (strcmp(argv[i], "-s") == 0
|| strcmp(argv[i], "--silent") == 0)
saveScreenshotSilent = true;
else if (strcmp(argv[i], "-o") == 0
|| strcmp(argv[i], "--options") == 0)
showConfigureWindow = true;
else if (strcmp(argv[i], "-f") == 0
|| strncmp(argv[i], "--format", 6) == 0
|| strncmp(argv[i], "--format=", 7) == 0) {
_SetImageTypeSilence(argv[i + 1]);
} else if (strcmp(argv[i], "-d") == 0
|| strncmp(argv[i], "--delay", 7) == 0
|| strncmp(argv[i], "--delay=", 8) == 0) {
int32 seconds = -1;
if (argc > i + 1)
seconds = atoi(argv[i + 1]);
if (seconds >= 0) {
delay = seconds * 1000000;
i++;
} else {
printf("Screenshot: option requires an argument -- %s\n"
, argv[i]);
exit(0);
}
}
}
fArgvReceived = true;
new ScreenshotWindow(delay, includeBorder, includeMouse, grabActiveWindow,
showConfigureWindow, saveScreenshotSilent, fImageFileType,
fTranslator);
}
void
Screenshot::_ShowHelp() const
{
printf("Screenshot [OPTION]... Creates a bitmap of the current screen\n\n");
printf("OPTION\n");
printf(" -o, --options Show options window first\n");
printf(" -m, --mouse-pointer Include the mouse pointer\n");
printf(" -b, --border Include the window border\n");
printf(" -w, --window Capture the active window instead of the entire screen\n");
printf(" -d, --delay=seconds Take screenshot after specified delay [in seconds]\n");
printf(" -s, --silent Saves the screenshot without showing the app window\n");
printf(" overrides --options\n");
printf(" -f, --format=image Write the image format you like to save as\n");
printf(" [bmp], [gif], [jpg], [png], [ppm], [targa], [tiff]\n");
printf("\n");
printf("Note: OPTION -b, --border takes only effect when used with -w, --window\n");
exit(0);
}
void
Screenshot::_SetImageTypeSilence(const char* name)
{
if (strcmp(name, "bmp") == 0) {
fImageFileType = B_BMP_FORMAT;
fTranslator = 1;
} else if (strcmp(name, "gif") == 0) {
fImageFileType = B_GIF_FORMAT;
fTranslator = 3;
} else if (strcmp(name, "jpg") == 0) {
fImageFileType = B_JPEG_FORMAT;
fTranslator = 6;
} else if (strcmp(name, "ppm") == 0) {
fImageFileType = B_PPM_FORMAT;
fTranslator = 9;
} else if (strcmp(name, "targa") == 0) {
fImageFileType = B_TGA_FORMAT;
fTranslator = 14;
} else if (strcmp(name, "tif") == 0) {
fImageFileType = B_TIFF_FORMAT;
fTranslator = 15;
} else { //png
fImageFileType = B_PNG_FORMAT;
fTranslator = 8;
}
}
| [
"michael@Inferno.(none)"
] | michael@Inferno.(none) |
df44645df08452e52dd8e6c60e49e68413285594 | 00e42b9c61d911f12bb66294b98ee2bf8c3109d9 | /TextView/TextViewKeyNav.cpp | a6b44b477935cc6f7b8442637234e58b90404a5f | [
"MIT"
] | permissive | kxkx5150/TextEditor | 0eccb913235c345f7e8efabf1dd5adab82b9300c | e5a8876372d141d08341a35773cc8636bfc54e4b | refs/heads/main | 2023-08-10T22:21:33.385634 | 2021-09-08T03:45:39 | 2021-09-08T03:45:39 | 403,313,471 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,171 | cpp | //
// MODULE: TextViewKeyNav.cpp
//
// PURPOSE: Keyboard navigation for TextView
//
// NOTES: www.catch22.net
//
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include "TextView_def.h"
#include "TextView.h"
/*struct SCRIPT_LOGATTR
{
BYTE fSoftBreak :1;
BYTE fWhiteSpace :1;
BYTE fCharStop :1;
BYTE fWordStop :1;
BYTE fInvalid :1;
BYTE fReserved :3;
};*/
bool IsKeyPressed(UINT nVirtKey)
{
return GetKeyState(nVirtKey) < 0 ? true : false;
}
//
// Get the UspCache and logical attributes for specified line
//
bool TextView::GetLogAttr(ULONG nLineNo, USPCACHE **puspCache, CSCRIPT_LOGATTR **plogAttr, ULONG *pnOffset)
{
if((*puspCache = GetUspCache(0, nLineNo, pnOffset)) == 0)
return false;
if(plogAttr && (*plogAttr = UspGetLogAttr((*puspCache)->uspData)) == 0)
return false;
return true;
}
//
// Move caret up specified number of lines
//
VOID TextView::MoveLineUp(int numLines)
{
USPDATA * uspData;
ULONG lineOffset;
int charPos;
BOOL trailing;
m_nCurrentLine -= min(m_nCurrentLine, (unsigned)numLines);
// get Uniscribe data for prev line
uspData = GetUspData(0, m_nCurrentLine, &lineOffset);
// move up to character nearest the caret-anchor positions
UspXToOffset(uspData, m_nAnchorPosX, &charPos, &trailing, 0);
m_nCursorOffset = lineOffset + charPos + trailing;
}
//
// Move caret down specified number of lines
//
VOID TextView::MoveLineDown(int numLines)
{
USPDATA * uspData;
ULONG lineOffset;
int charPos;
BOOL trailing;
m_nCurrentLine += min(m_nLineCount-m_nCurrentLine-1, (unsigned)numLines);
// get Uniscribe data for prev line
uspData = GetUspData(0, m_nCurrentLine, &lineOffset);
// move down to character nearest the caret-anchor position
UspXToOffset(uspData, m_nAnchorPosX, &charPos, &trailing, 0);
m_nCursorOffset = lineOffset + charPos + trailing;
}
//
// Move to start of previous word (to the left)
//
VOID TextView::MoveWordPrev()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
// move 1 character to left
charPos = m_nCursorOffset - lineOffset - 1;
// skip to end of *previous* line if necessary
if(charPos < 0)
{
charPos = 0;
if(m_nCurrentLine > 0)
{
MoveLineEnd(m_nCurrentLine-1);
return;
}
}
// skip preceding whitespace
while(charPos > 0 && logAttr[charPos].fWhiteSpace)
charPos--;
// skip whole characters until we hit a word-break/more whitespace
for( ; charPos > 0 ; charPos--)
{
if(logAttr[charPos].fWordStop || logAttr[charPos-1].fWhiteSpace)
break;
}
m_nCursorOffset = lineOffset + charPos;
}
//
// Move to start of next word
//
VOID TextView::MoveWordNext()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
// if already at end-of-line, skip to next line
if(charPos == uspCache->length_CRLF)
{
if(m_nCurrentLine + 1 < m_nLineCount)
MoveLineStart(m_nCurrentLine+1);
return;
}
// if already on a word-break, go to next char
if(logAttr[charPos].fWordStop)
charPos++;
// skip whole characters until we hit a word-break/more whitespace
for( ; charPos < uspCache->length_CRLF; charPos++)
{
if(logAttr[charPos].fWordStop || logAttr[charPos].fWhiteSpace)
break;
}
// skip trailing whitespace
while(charPos < uspCache->length_CRLF && logAttr[charPos].fWhiteSpace)
charPos++;
m_nCursorOffset = lineOffset + charPos;
}
//
// Move to start of current word
//
VOID TextView::MoveWordStart()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
while(charPos > 0 && !logAttr[charPos-1].fWhiteSpace)
charPos--;
m_nCursorOffset = lineOffset + charPos;
}
//
// Move to end of current word
//
VOID TextView::MoveWordEnd()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
while(charPos < uspCache->length_CRLF && !logAttr[charPos].fWhiteSpace)
charPos++;
m_nCursorOffset = lineOffset + charPos;
}
//
// Move to previous character
//
VOID TextView::MoveCharPrev()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
// find the previous valid character-position
for( --charPos; charPos >= 0; charPos--)
{
if(logAttr[charPos].fCharStop)
break;
}
// move up to end-of-last line if necessary
if(charPos < 0)
{
charPos = 0;
if(m_nCurrentLine > 0)
{
MoveLineEnd(m_nCurrentLine-1);
return;
}
}
// update cursor position
m_nCursorOffset = lineOffset + charPos;
}
//
// Move to next character
//
VOID TextView::MoveCharNext()
{
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
ULONG lineOffset;
int charPos;
// get Uniscribe data for specified line
if(!GetLogAttr(m_nCurrentLine, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
// find the next valid character-position
for( ++charPos; charPos <= uspCache->length_CRLF; charPos++)
{
if(logAttr[charPos].fCharStop)
break;
}
// skip to beginning of next line if we hit the CR/LF
if(charPos > uspCache->length_CRLF)
{
if(m_nCurrentLine + 1 < m_nLineCount)
MoveLineStart(m_nCurrentLine+1);
}
// otherwise advance the character-position
else
{
m_nCursorOffset = lineOffset + charPos;
}
}
//
// Move to start of specified line
//
VOID TextView::MoveLineStart(ULONG lineNo)
{
ULONG lineOffset;
USPCACHE * uspCache;
CSCRIPT_LOGATTR * logAttr;
int charPos;
// get Uniscribe data for current line
if(!GetLogAttr(lineNo, &uspCache, &logAttr, &lineOffset))
return;
charPos = m_nCursorOffset - lineOffset;
// if already at start of line, skip *forwards* past any whitespace
if(m_nCursorOffset == lineOffset)
{
// skip whitespace
while(logAttr[m_nCursorOffset - lineOffset].fWhiteSpace)
m_nCursorOffset++;
}
// if not at start, goto start
else
{
m_nCursorOffset = lineOffset;
}
}
//
// Move to end of specified line
//
VOID TextView::MoveLineEnd(ULONG lineNo)
{
USPCACHE *uspCache;
if((uspCache = GetUspCache(0, lineNo)) == 0)
return;
m_nCursorOffset = uspCache->offset + uspCache->length_CRLF;
}
//
// Move to start of file
//
VOID TextView::MoveFileStart()
{
m_nCursorOffset = 0;
}
//
// Move to end of file
//
VOID TextView::MoveFileEnd()
{
m_nCursorOffset = m_pTextDoc->size();
}
//
// Process keyboard-navigation keys
//
LONG TextView::OnKeyDown(UINT nKeyCode, UINT nFlags)
{
bool fCtrlDown = IsKeyPressed(VK_CONTROL);
bool fShiftDown = IsKeyPressed(VK_SHIFT);
BOOL fAdvancing = FALSE;
//
// Process the key-press. Cursor movement is different depending
// on if <ctrl> is held down or not, so act accordingly
//
switch(nKeyCode)
{
case VK_SHIFT: case VK_CONTROL:
return 0;
// CTRL+Z undo
case 'z': case 'Z':
if(fCtrlDown && Undo())
NotifyParent(TVN_CHANGED);
return 0;
// CTRL+Y redo
case 'y': case 'Y':
if(fCtrlDown && Redo())
NotifyParent(TVN_CHANGED);
return 0;
// Change insert mode / clipboard copy&paste
case VK_INSERT:
if(fCtrlDown)
{
OnCopy();
NotifyParent(TVN_CHANGED);
}
else if(fShiftDown)
{
OnPaste();
NotifyParent(TVN_CHANGED);
}
else
{
if(m_nEditMode == MODE_INSERT)
m_nEditMode = MODE_OVERWRITE;
else if(m_nEditMode == MODE_OVERWRITE)
m_nEditMode = MODE_INSERT;
NotifyParent(TVN_EDITMODE_CHANGE);
}
return 0;
case VK_DELETE:
if(m_nEditMode != MODE_READONLY)
{
if(fShiftDown)
OnCut();
else
ForwardDelete();
NotifyParent(TVN_CHANGED);
}
return 0;
case VK_BACK:
if(m_nEditMode != MODE_READONLY)
{
BackDelete();
fAdvancing = FALSE;
NotifyParent(TVN_CHANGED);
}
return 0;
case VK_LEFT:
if(fCtrlDown) MoveWordPrev();
else MoveCharPrev();
fAdvancing = FALSE;
break;
case VK_RIGHT:
if(fCtrlDown) MoveWordNext();
else MoveCharNext();
fAdvancing = TRUE;
break;
case VK_UP:
if(fCtrlDown) Scroll(0, -1);
else MoveLineUp(1);
break;
case VK_DOWN:
if(fCtrlDown) Scroll(0, 1);
else MoveLineDown(1);
break;
case VK_PRIOR:
if(!fCtrlDown) MoveLineUp(m_nWindowLines);
break;
case VK_NEXT:
if(!fCtrlDown) MoveLineDown(m_nWindowLines);
break;
case VK_HOME:
if(fCtrlDown) MoveFileStart();
else MoveLineStart(m_nCurrentLine);
break;
case VK_END:
if(fCtrlDown) MoveFileEnd();
else MoveLineEnd(m_nCurrentLine);
break;
default:
return 0;
}
// Extend selection if <shift> is down
if(fShiftDown)
{
InvalidateRange(m_nSelectionEnd, m_nCursorOffset);
m_nSelectionEnd = m_nCursorOffset;
}
// Otherwise clear the selection
else
{
if(m_nSelectionStart != m_nSelectionEnd)
InvalidateRange(m_nSelectionStart, m_nSelectionEnd);
m_nSelectionEnd = m_nCursorOffset;
m_nSelectionStart = m_nCursorOffset;
}
// update caret-location (xpos, line#) from the offset
UpdateCaretOffset(m_nCursorOffset, fAdvancing, &m_nCaretPosX, &m_nCurrentLine);
// maintain the caret 'anchor' position *except* for up/down actions
if(nKeyCode != VK_UP && nKeyCode != VK_DOWN)
{
m_nAnchorPosX = m_nCaretPosX;
// scroll as necessary to keep caret within viewport
ScrollToPosition(m_nCaretPosX, m_nCurrentLine);
}
else
{
// scroll as necessary to keep caret within viewport
if(!fCtrlDown)
ScrollToPosition(m_nCaretPosX, m_nCurrentLine);
}
NotifyParent(TVN_CURSOR_CHANGE);
return 0;
}
| [
"[email protected]"
] | |
9f92f4c7171814b541bfc3ce14bbdfb7b9f58df4 | a460b51188e5126092379b927ff26141bf21f25f | /src/ob/readline.cc | a01f439e86475c6ef44207a2239282b8e3327361 | [
"MIT"
] | permissive | octobanana/nyble | 14722021dbcef4978312bbe5c5131de9f276819a | 122fcfd38b2f2cc414452087d99c3f60e29d3f7f | refs/heads/master | 2020-09-12T22:31:28.269349 | 2020-01-04T05:19:43 | 2020-01-04T05:19:43 | 222,580,485 | 21 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 27,305 | cc | /*
88888888
888888888888
88888888888888
8888888888888888
888888888888888888
888888 8888 888888
88888 88 88888
888888 8888 888888
88888888888888888888
88888888888888888888
8888888888888888888888
8888888888888888888888888888
88888888888888888888888888888888
88888888888888888888
888888888888888888888888
888888 8888888888 888888
888 8888 8888 888
888 888
OCTOBANANA
Licensed under the MIT License
Copyright (c) 2019 Brett Robinson <https://octobanana.com/>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "ob/readline.hh"
#include "ob/string.hh"
#include "ob/text.hh"
#include "ob/term.hh"
#include <cstdio>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <chrono>
#include <thread>
#include <algorithm>
#include <filesystem>
namespace OB
{
namespace aec = OB::Term::ANSI_Escape_Codes;
namespace fs = std::filesystem;
void Readline::autocomplete(std::function<std::vector<std::string>()> const& val_)
{
_autocomplete._update = val_;
}
void Readline::boundaries(std::string const& val_)
{
_boundaries = val_;
}
std::string Readline::word_under_cursor(std::string const& delimiters_)
{
auto const word = std::string(_input.str.prev_word(_input.off + _input.idx - 1, OB::Text::View(delimiters_)));
return word.size() == 1 && word.find_first_of(_boundaries) != std::string::npos ? "" : word;
}
Readline& Readline::style(std::string const& style_)
{
_style.input = style_;
_autocomplete._style.normal = style_;
return *this;
}
Readline& Readline::prompt(std::string const& str_, std::string const& style_)
{
_prompt.str = str_;
_style.prompt = style_;
_autocomplete._style.prompt = style_;
_prompt.fmt = aec::wrap(str_, style_);
return *this;
}
std::string Readline::render() const
{
std::ostringstream ss;
// -------------------------------------------------------------
switch (_mode)
{
case Mode::autocomplete_init:
case Mode::autocomplete:
{
ss
// << aec::cursor_hide
<< aec::cr
<< _autocomplete
<< aec::clear;
break;
}
default:
{
ss
// << aec::cursor_hide
<< aec::cr
<< _style.input
<< OB::String::repeat(_width, " ")
<< aec::cr
<< _prompt.lhs
<< _style.input
<< _input.fmt
<< aec::clear
<< _prompt.rhs
<< aec::cr
<< aec::cursor_right(_input.cur + 1);
if (_input.cur + 2 == _width) {
if (_prompt.rhs.size()) {
ss
<< aec::reverse
<< _prompt.rhs;
}
else {
ss
<< _style.input
<< aec::reverse
<< " ";
}
}
else {
ss
<< _style.input
<< aec::reverse;
auto const c = _input.fmt.colstr(_input.fmt.byte_to_char(_input.cur), 1);
if (c.size())
{
ss << c;
}
else
{
ss << " ";
}
}
ss << aec::clear;
// << aec::cursor_right(_input.cur + 1)
// << aec::cursor_show;
break;
}
}
// -------------------------------------------------------------
// ss
// << aec::cursor_hide
// << aec::cr
// << _style.input
// << OB::String::repeat(_width, " ")
// << aec::cr
// << _prompt.lhs
// << _style.input
// << _input.fmt
// << aec::clear
// << _prompt.rhs;
// switch (_mode)
// {
// case Mode::autocomplete_init:
// case Mode::autocomplete:
// {
// ss
// << aec::nl
// << _autocomplete
// << aec::cursor_up(1);
// break;
// }
// default:
// {
// if (_mode_prev == Mode::autocomplete_init || _mode_prev == Mode::autocomplete)
// {
// ss
// << aec::nl
// << aec::erase_line
// << aec::cursor_up(1);
// }
// break;
// }
// }
// ss
// << aec::cr
// << aec::cursor_right(_input.cur + 1)
// << aec::cursor_show;
return ss.str();
}
Readline& Readline::refresh()
{
_prompt.lhs = ">";
_prompt.rhs = " ";
if (_input.str.cols() + 2 > _width)
{
std::size_t pos {_input.off + _input.idx - 1};
std::size_t cols {0};
for (; pos != OB::Text::String::npos && cols < _width - 2; --pos)
{
cols += _input.str.at(pos).cols;
}
if (pos == OB::Text::String::npos)
{
pos = 0;
}
std::size_t end {_input.off + _input.idx - pos};
_input.fmt.str(_input.str.substr(pos, end));
if (_input.fmt.cols() > _width - 2)
{
while (_input.fmt.cols() > _width - 2)
{
_input.fmt.erase(0, 1);
}
_input.cur = _input.fmt.cols();
if (_input.cur == OB::Text::String::npos)
{
_input.cur = 0;
}
_prompt.lhs = "<";
}
else
{
_input.cur = _input.fmt.cols();
if (_input.cur == OB::Text::String::npos)
{
_input.cur = 0;
}
while (_input.fmt.cols() <= _width - 2)
{
_input.fmt.append(std::string(_input.str.at(end++).str));
}
_input.fmt.erase(_input.fmt.size() - 1, 1);
}
if (_input.off + _input.idx < _input.str.size())
{
_prompt.rhs = ">";
}
}
else
{
_input.fmt = _input.str;
_input.cur = _input.fmt.cols(0, _input.idx);
if (_input.cur == OB::Text::String::npos)
{
_input.cur = 0;
}
}
return *this;
}
// Readline& Readline::refresh()
// {
// _prompt.lhs = _prompt.fmt;
// _prompt.rhs.clear();
// if (_input.str.cols() + 2 > _width)
// {
// std::size_t pos {_input.off + _input.idx - 1};
// std::size_t cols {0};
// for (; pos != OB::Text::String::npos && cols < _width - 2; --pos)
// {
// cols += _input.str.at(pos).cols;
// }
// if (pos == OB::Text::String::npos)
// {
// pos = 0;
// }
// std::size_t end {_input.off + _input.idx - pos};
// _input.fmt.str(_input.str.substr(pos, end));
// if (_input.fmt.cols() > _width - 2)
// {
// while (_input.fmt.cols() > _width - 2)
// {
// _input.fmt.erase(0, 1);
// }
// _input.cur = _input.fmt.cols();
// if (_input.cur == OB::Text::String::npos)
// {
// _input.cur = 0;
// }
// _prompt.lhs = aec::wrap("<", _style.prompt);
// }
// else
// {
// _input.cur = _input.fmt.cols();
// if (_input.cur == OB::Text::String::npos)
// {
// _input.cur = 0;
// }
// while (_input.fmt.cols() <= _width - 2)
// {
// _input.fmt.append(std::string(_input.str.at(end++).str));
// }
// _input.fmt.erase(_input.fmt.size() - 1, 1);
// }
// if (_input.off + _input.idx < _input.str.size())
// {
// _prompt.rhs = aec::wrap(
// OB::String::repeat(_width - _input.fmt.cols() - 2, " ") + ">",
// _style.prompt);
// }
// }
// else
// {
// _input.fmt = _input.str;
// _input.cur = _input.fmt.cols(0, _input.idx);
// if (_input.cur == OB::Text::String::npos)
// {
// _input.cur = 0;
// }
// }
// return *this;
// }
Readline& Readline::size(std::size_t const width_, std::size_t const height_)
{
_width = width_;
_height = height_;
_autocomplete.width(width_);
return *this;
}
Readline& Readline::clear()
{
mode(Mode::normal);
_input = {};
return *this;
}
std::string Readline::get()
{
return _res;
}
Readline& Readline::normal()
{
mode(Mode::normal);
_input.off = _input.offp;
_input.idx = _input.idxp;
_input.str = _input.buf;
hist_reset();
refresh();
return *this;
}
bool Readline::operator()(OB::Text::Char32 input)
{
bool loop {true};
switch (input.ch())
{
case OB::Term::Key::escape:
{
if (_mode != Mode::normal)
{
normal();
break;
}
loop = false;
_input.save_file = false;
_input.clear_input = true;
break;
}
case OB::Term::ctrl_key('r'):
case OB::Term::Key::tab:
{
if (_mode != Mode::autocomplete_init && _mode != Mode::autocomplete)
{
ac_init();
}
else
{
mode(Mode::autocomplete);
ac_next();
}
break;
}
case OB::Term::ctrl_key('c'):
{
// exit the command prompt
mode(Mode::normal);
loop = false;
_input.save_file = false;
_input.save_local = false;
_input.clear_input = true;
break;
}
// TODO impl copy/paste like shell
case OB::Term::ctrl_key('u'):
{
mode(Mode::normal);
_input.clipboard = _input.str;
edit_clear();
refresh();
hist_reset();
break;
}
case OB::Term::ctrl_key('y'):
{
mode(Mode::normal);
edit_insert(_input.clipboard);
refresh();
hist_reset();
break;
}
case OB::Term::Key::newline:
{
switch (_mode)
{
case Mode::autocomplete_init:
case Mode::autocomplete:
{
mode(Mode::normal);
break;
}
default:
{
// submit the input string
loop = false;
break;
}
}
break;
}
case OB::Term::Key::up:
case OB::Term::ctrl_key('p'):
{
switch (_mode)
{
case Mode::normal:
{
mode(Mode::history_init);
hist_next();
break;
}
case Mode::history_init:
{
mode(Mode::history);
hist_next();
break;
}
case Mode::history:
{
hist_next();
break;
}
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_prev_section();
break;
}
case Mode::autocomplete:
{
ac_prev_section();
break;
}
}
break;
}
case OB::Term::Key::down:
case OB::Term::ctrl_key('n'):
{
switch (_mode)
{
case Mode::normal:
{
mode(Mode::history_init);
hist_prev();
break;
}
case Mode::history_init:
{
mode(Mode::history);
hist_prev();
break;
}
case Mode::history:
{
hist_prev();
break;
}
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_next_section();
break;
}
case Mode::autocomplete:
{
ac_next_section();
break;
}
}
break;
}
case OB::Term::Key::right:
case OB::Term::ctrl_key('f'):
{
switch (_mode)
{
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_next();
break;
}
case Mode::autocomplete:
{
ac_next();
break;
}
default:
{
curs_right();
break;
}
}
break;
}
case OB::Term::Key::left:
case OB::Term::ctrl_key('b'):
{
switch (_mode)
{
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_prev();
break;
}
case Mode::autocomplete:
{
ac_prev();
break;
}
default:
{
curs_left();
break;
}
}
break;
}
case OB::Term::Key::end:
case OB::Term::ctrl_key('e'):
{
switch (_mode)
{
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_end();
break;
}
case Mode::autocomplete:
{
ac_end();
break;
}
default:
{
curs_end();
break;
}
}
break;
}
case OB::Term::Key::home:
case OB::Term::ctrl_key('a'):
{
switch (_mode)
{
case Mode::autocomplete_init:
{
mode(Mode::autocomplete);
ac_begin();
break;
}
case Mode::autocomplete:
{
ac_begin();
break;
}
default:
{
curs_begin();
break;
}
}
break;
}
case OB::Term::Key::delete_:
case OB::Term::ctrl_key('d'):
{
mode(Mode::normal);
edit_delete();
refresh();
hist_reset();
break;
}
case OB::Term::Key::backspace:
case OB::Term::ctrl_key('h'):
{
mode(Mode::normal);
edit_backspace_autopair();
refresh();
hist_reset();
break;
}
default:
{
mode(Mode::normal);
if (input.ch() < 0xF0000 &&
(input.ch() == OB::Term::Key::space ||
OB::Text::is_graph(static_cast<std::int32_t>(input.ch()))))
{
edit_insert_autopair(input);
refresh();
hist_reset();
}
break;
}
}
if (loop)
{
return false;
}
_res = normalize(_input.str);
if (! _res.empty())
{
if (_input.save_local)
{
hist_push(_res);
}
if (_input.save_file && _input.str.str().front() != ' ')
{
hist_save(_res);
}
}
hist_reset();
if (_input.clear_input)
{
_res.clear();
}
return true;
}
void Readline::curs_begin()
{
// move cursor to start of line
if (_input.idx || _input.off)
{
_input.idx = 0;
_input.off = 0;
refresh();
}
}
void Readline::curs_end()
{
// move cursor to end of line
if (_input.str.empty())
{
return;
}
if (_input.off + _input.idx < _input.str.size())
{
if (_input.str.cols() + 2 > _width)
{
_input.off = _input.str.size() - _width + 2;
_input.idx = _width - 2;
}
else
{
_input.idx = _input.str.size();
}
refresh();
}
}
void Readline::curs_left()
{
// move cursor left
if (_input.off || _input.idx)
{
if (_input.off)
{
--_input.off;
}
else
{
--_input.idx;
}
refresh();
}
}
void Readline::curs_right()
{
// move cursor right
if (_input.off + _input.idx < _input.str.size())
{
if (_input.idx + 2 < _width)
{
++_input.idx;
}
else
{
++_input.off;
}
refresh();
}
}
void Readline::edit_insert(std::string const& str)
{
// insert or append char to input buffer
auto size {_input.str.size()};
_input.str.insert(_input.off + _input.idx, str);
if (size != _input.str.size())
{
size = _input.str.size() - size;
if (_input.idx + size + 1 < _width)
{
_input.idx += size;
}
else
{
_input.off += _input.idx + size - _width + 1;
_input.idx = _width - 1;
}
}
}
void Readline::edit_clear()
{
// clear line
_input.idx = 0;
_input.off = 0;
_input.str.clear();
}
bool Readline::edit_delete()
{
// erase char under cursor
if (_input.str.empty())
{
_input.str.clear();
return false;
}
if (_input.off + _input.idx < _input.str.size())
{
if (_input.idx + 2 < _width)
{
_input.str.erase(_input.off + _input.idx, 1);
}
else
{
_input.str.erase(_input.idx, 1);
}
return true;
}
else if (_input.off || _input.idx)
{
if (_input.off)
{
_input.str.erase(_input.off + _input.idx - 1, 1);
--_input.off;
}
else
{
--_input.idx;
_input.str.erase(_input.idx, 1);
}
return true;
}
return false;
}
bool Readline::edit_backspace()
{
// erase char behind cursor
if (_input.str.empty())
{
_input.str.clear();
return false;
}
_input.str.erase(_input.off + _input.idx - 1, 1);
if (_input.off || _input.idx)
{
if (_input.off)
{
--_input.off;
}
else if (_input.idx)
{
--_input.idx;
}
return true;
}
return false;
}
void Readline::hist_next()
{
// cycle backwards in history
if (_history().empty() && _history.search().empty())
{
return;
}
bool bounds {_history.search().empty() ?
(_history.idx < _history().size() - 1) :
(_history.idx < _history.search().size() - 1)};
if (bounds || _history.idx == History::npos)
{
if (_history.idx == History::npos)
{
_input.buf = _input.str;
if (! _input.buf.empty())
{
hist_search(_input.buf);
}
}
++_history.idx;
if (_history.search().empty())
{
// normal search
_input.str = _history().at(_history.idx);
}
else
{
// fuzzy search
_input.str = _history().at(_history.search().at(_history.idx).idx);
}
if (_input.str.size() + 1 >= _width)
{
_input.off = _input.str.size() - _width + 2;
_input.idx = _width - 2;
}
else
{
_input.off = 0;
_input.idx = _input.str.size();
}
refresh();
}
}
void Readline::hist_prev()
{
// cycle forwards in history
if (_history.idx != History::npos)
{
--_history.idx;
if (_history.idx == History::npos)
{
_input.str = _input.buf;
}
else if (_history.search().empty())
{
// normal search
_input.str = _history().at(_history.idx);
}
else
{
// fuzzy search
_input.str = _history().at(_history.search().at(_history.idx).idx);
}
if (_input.str.size() + 1 >= _width)
{
_input.off = _input.str.size() - _width + 2;
_input.idx = _width - 2;
}
else
{
_input.off = 0;
_input.idx = _input.str.size();
}
refresh();
}
}
void Readline::hist_reset()
{
_history.search.clear();
_history.idx = History::npos;
}
void Readline::hist_search(std::string const& str)
{
_history.search.clear();
OB::Text::String input {OB::Text::normalize_foldcase(
std::regex_replace(OB::Text::trim(str), std::regex("\\s+"),
" ", std::regex_constants::match_not_null))};
if (input.empty())
{
return;
}
std::size_t idx {0};
std::size_t count {0};
std::size_t weight {0};
std::string prev_hist {" "};
std::string prev_input {" "};
OB::Text::String hist;
for (std::size_t i = 0; i < _history().size(); ++i)
{
hist.str(OB::Text::normalize_foldcase(_history().at(i)));
if (hist.size() <= input.size())
{
continue;
}
idx = 0;
count = 0;
weight = 0;
prev_hist = " ";
prev_input = " ";
for (std::size_t j = 0, seq = 0; j < hist.size(); ++j)
{
if (idx < input.size() &&
hist.at(j).str == input.at(idx).str)
{
++seq;
count += 1;
if (seq > 1)
{
count += 1;
}
if (prev_hist == " " && prev_input == " ")
{
count += 1;
}
prev_input = input.at(idx).str;
++idx;
// short circuit to keep history order
// comment out to search according to closest match
if (idx == input.size())
{
break;
}
}
else
{
seq = 0;
weight += 2;
if (prev_input == " ")
{
weight += 1;
}
}
prev_hist = hist.at(j).str;
}
if (idx != input.size())
{
continue;
}
while (count && weight)
{
--count;
--weight;
}
_history.search().emplace_back(weight, i);
}
std::sort(_history.search().begin(), _history.search().end(),
[](auto const& lhs, auto const& rhs)
{
// default to history order if score is equal
return lhs.score == rhs.score ? lhs.idx < rhs.idx : lhs.score < rhs.score;
});
}
void Readline::hist_push(std::string const& str)
{
if (_history().empty())
{
_history().emplace_front(str);
}
else if (_history().back() != str)
{
if (auto pos = std::find(_history().begin(), _history().end(), str);
pos != _history().end())
{
_history().erase(pos);
}
_history().emplace_front(str);
}
}
void Readline::hist_load(fs::path const& path)
{
if (! path.empty())
{
std::ifstream ifile {path};
if (ifile && ifile.is_open())
{
std::string line;
while (std::getline(ifile, line))
{
hist_push(line);
}
}
hist_open(path);
}
}
void Readline::hist_save(std::string const& str)
{
if (_history.file.is_open())
{
_history.file
<< str << "\n"
<< std::flush;
}
}
void Readline::hist_open(fs::path const& path)
{
_history.file.open(path, std::ios::app);
if (! _history.file.is_open())
{
throw std::runtime_error("could not open file '" + path.string() + "'");
}
}
void Readline::ac_init()
{
mode(Mode::autocomplete_init);
_input.offp = _input.off;
_input.idxp = _input.idx;
_input.buf = _input.str;
_autocomplete.word(word_under_cursor(_boundaries));
_autocomplete.generate().refresh();
ac_sync();
}
void Readline::ac_sync()
{
_input.str = _input.buf;
auto const word = _autocomplete._match.at(_autocomplete._off + _autocomplete._idx);
_input.str.replace(_input.offp + _input.idxp - _autocomplete.word().size(), _autocomplete.word().size(), word);
// place cursor at end of new word
std::size_t const pos {_input.offp + _input.idxp - _autocomplete.word().size() + word.size()};
if (pos + 1 >= _width)
{
_input.off = pos - _width + 2;
_input.idx = _width - 2;
}
else
{
_input.idx = pos;
}
refresh();
}
void Readline::ac_begin()
{
_autocomplete.begin().refresh();
ac_sync();
}
void Readline::ac_end()
{
_autocomplete.end().refresh();
ac_sync();
}
void Readline::ac_prev()
{
_autocomplete.prev().refresh();
ac_sync();
}
void Readline::ac_next()
{
_autocomplete.next().refresh();
ac_sync();
}
void Readline::ac_prev_section()
{
_autocomplete.prev_section().refresh();
ac_sync();
}
void Readline::ac_next_section()
{
_autocomplete.next_section().refresh();
ac_sync();
}
void Readline::edit_insert_autopair(OB::Text::Char32 const& val)
{
auto const i = _input.off + _input.idx;
auto const lhs = val.ch();
auto const rhs = i < _input.str.size() ? OB::Text::Char32(std::string(_input.str.at(i))).ch() : '\0';
auto const prv = i > 0 ? OB::Text::Char32(std::string(_input.str.at(i - 1))).ch() : '\0';
switch (lhs)
{
case '"':
{
if (rhs == '"')
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
curs_right();
}
}
else if (prv != '\\')
{
edit_insert(val.str());
edit_insert("\"");
curs_left();
}
else
{
edit_insert(val.str());
}
break;
}
case '(':
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
edit_insert(val.str());
edit_insert(")");
curs_left();
}
break;
}
case ')':
{
if (rhs == ')')
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
curs_right();
}
}
else
{
edit_insert(val.str());
}
break;
}
case '[':
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
edit_insert(val.str());
edit_insert("]");
curs_left();
}
break;
}
case ']':
{
if (rhs == ']')
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
curs_right();
}
}
else
{
edit_insert(val.str());
}
break;
}
case '{':
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
edit_insert(val.str());
edit_insert("}");
curs_left();
}
break;
}
case '}':
{
if (rhs == '}')
{
if (prv == '\\')
{
edit_insert(val.str());
}
else
{
curs_right();
}
}
else
{
edit_insert(val.str());
}
break;
}
default:
{
edit_insert(val.str());
break;
}
}
}
void Readline::edit_backspace_autopair()
{
auto const i = _input.off + _input.idx;
if (i < 1 || i >= _input.str.size())
{
edit_backspace();
return;
}
auto const lhs = OB::Text::Char32(std::string(_input.str.at(i - 1))).ch();
auto const rhs = OB::Text::Char32(std::string(_input.str.at(i))).ch();
auto const prv = i > 1 ? OB::Text::Char32(std::string(_input.str.at(i - 2))).ch() : '\0';
switch (lhs)
{
case '"':
{
if (rhs == '"' && prv != '\\')
{
edit_delete();
}
break;
}
case '(':
{
if (rhs == ')' && prv != '\\')
{
edit_delete();
}
break;
}
case '[':
{
if (rhs == ']' && prv != '\\')
{
edit_delete();
}
break;
}
case '{':
{
if (rhs == '}' && prv != '\\')
{
edit_delete();
}
break;
}
default:
{
break;
}
}
edit_backspace();
}
std::string Readline::normalize(std::string const& str) const
{
// trim leading and trailing whitespace
// collapse sequential whitespace
// return std::regex_replace(OB::Text::trim(str), std::regex("\\s+"),
// " ", std::regex_constants::match_not_null);
return str;
}
void Readline::mode(Readline::Mode const mode_)
{
_mode_prev = _mode;
_mode = mode_;
}
std::ostream& operator<<(std::ostream& os, Readline const& obj)
{
os << obj.render();
return os;
}
} // namespace OB
| [
"[email protected]"
] | |
77fe90a6777c19b3017f00e95fa9f1f1e8e4c522 | 674396d0c086b9ae0618248ad0b298c16e38a85d | /Algorithms/ConvexPartitionCharacteristics.cpp | 59cab844e37733f3e3e5cf56046cba170331605a | [] | no_license | HannaZhuravskaya/PolygonPartition-Diploma | fd7ef9e6a56feed8a3802e0b0f191586163b078b | 2528a0137da48ead9059c89996a17284ccd1ff46 | refs/heads/master | 2022-08-28T05:10:25.499268 | 2020-05-28T10:35:23 | 2020-05-28T10:35:23 | 249,015,157 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,231 | cpp | #include "pch.h"
#include "ConvexPartitionCharacteristics.h"
namespace algo {
ConvexPartitionCharacteristics::ConvexPartitionCharacteristics() {}
ConvexPartitionCharacteristics::ConvexPartitionCharacteristics(double areaOfNotSplittedParts, double percentageOfNotSplittedParts, double optimizationFuncValue) {
this->areaOfNotSplittedParts = areaOfNotSplittedParts;
this->percentageOfNotSplittedParts = percentageOfNotSplittedParts;
this->optimizationFuncValue = optimizationFuncValue;
}
double ConvexPartitionCharacteristics::getAreaOfNotSplittedParts(int prec) {
return getDoubleWithPrecision(areaOfNotSplittedParts, prec);
}
double ConvexPartitionCharacteristics::getPercentageOfNotSplittedParts(int prec) {
return getDoubleWithPrecision(percentageOfNotSplittedParts, prec);
}
double ConvexPartitionCharacteristics::getOptimizationFuncValue(int prec) {
return getDoubleWithPrecision(optimizationFuncValue, prec);
}
double ConvexPartitionCharacteristics::getDoubleWithPrecision(double number, int prec) {
int count = prec;
while (count > 0) {
number *= 10;
count--;
}
number = (int)number;
count = prec;
while (count > 0) {
number /= 10;
count--;
}
return number;
}
} | [
"[email protected]"
] | |
92aad1168c268b4f1a9452a9b7adfc9cea09f934 | 071d41f458b7b1f2a9879744ba5b09fc2972ff65 | /src/util/unix.h | d6a2839f7d62e400269373cb85067a7842af28ad | [
"BSL-1.0"
] | permissive | 9Skrip/pd-visualization | e57a55b56400bc83f89cd83b6a8a28c0a0a26985 | b303c457298be2642c4a131315109996b3da8d8d | refs/heads/master | 2022-01-24T20:27:47.129206 | 2019-07-26T19:29:02 | 2019-07-26T19:29:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 470 | h | #pragma once
#include "util/unix_fd.h"
#include "util/unix_sock.h"
#if !defined(_WIN32) || _WIN32_WINNT >= 0x600
int poll1(SOCKET fd, int timeout, int events);
#endif
int select1(SOCKET readfd, SOCKET writefd, SOCKET exceptfd, struct timeval *timeout);
int socksetblocking(SOCKET fd, bool block);
template <class F, class... A> auto posix_retry(const F &f, A &&... args);
template <class F, class... A> auto socket_retry(const F &f, A &&... args);
#include "unix.tcc"
| [
"[email protected]"
] | |
7b910e3a235974c7261279c439e4565c4737c49d | 5ec0229926c9fb692ee7dbd8495e5434080b4944 | /src/core/mesh_box.cpp | e8e529332ec783218d67c944d2556054ac560813 | [] | no_license | LenyKholodov/CoolWork | 3ed314ad8efeb6a82158035a13342ad5a3ecfc42 | 45c0d7cf6e034b44511e5482caee522572a4f5dc | refs/heads/master | 2020-04-14T02:14:36.840572 | 2018-12-30T10:27:32 | 2018-12-30T10:27:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,274 | cpp | #include <mesh.h>
struct Build
{
DrawVertex* vert;
Triangle* face;
int vpos;
inline void push_face (const vec3f& n) {
vec3f s1 = vec3f (1.0f) - abs (n),
s2 = rotatef ((float)M_PI/2.0f,n) * s1;
vert [0].pos = n + s1;
vert [1].pos = n + s2;
vert [2].pos = n - s1;
vert [3].pos = n - s2;
for (int i=0;i<4;i++)
{
vert [i].n = n;
vert [i].color = 0.0f;
}
face [0].v [0] = vpos+3;
face [0].v [1] = vpos+2;
face [0].v [2] = vpos;
face [1].v [0] = vpos+2;
face [1].v [1] = vpos+1;
face [1].v [2] = vpos;
vert += 4;
vpos += 4;
face += 2;
}
};
Surface* Primitives::CreateBox (float width,float height,float depth)
{
Surface* surface = Surface::create (24,12);
Build build = {surface->GetVertexes (),surface->GetTriangles (),0};
build.push_face (vec3f (1,0,0));
build.push_face (vec3f (-1,0,0));
build.push_face (vec3f (0,1,0));
build.push_face (vec3f (0,-1,0));
build.push_face (vec3f (0,0,1));
build.push_face (vec3f (0,0,-1));
DrawVertex* verts = surface->GetVertexes ();
vec3f size (width*0.5f,height*0.5f,depth*0.5f);
for (int i=0;i<24;i++)
verts [i].pos *= size;
return surface;
}
| [
"[email protected]"
] | |
8f88a23e0687a8688a32730f189ee7b88fa88cc1 | 682dd1e591a9be6dbc7c0970752a882a8a553a7c | /src/lib/qrc_lib.cpp | 9ffb737828cc9cc8c3121f89e8d8425b86c34b8b | [] | no_license | heiheshang/ananas-labs-qt4 | e3f9977857aea80fa23f6cb3939fd3572005c682 | cc5edc868cefbed8c6a3c4fdf9a2d502e934399f | refs/heads/master | 2021-01-16T19:53:27.799927 | 2009-08-19T12:36:36 | 2009-08-19T12:36:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,476 | cpp | /****************************************************************************
** Resource object code
**
** Created: Thu Jul 30 22:49:29 2009
** by: The Resource Compiler for Qt version 4.5.3
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include <QtCore/qglobal.h>
static const unsigned char qt_resource_data[] = {
// /home/oper/Documents/ananas/ananas-qt4/src/lib/images/print.png
0x0,0x0,0x3,0x21,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,
0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,
0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,
0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,
0xd4,0x4,0x13,0x12,0x17,0x30,0xce,0xaf,0x69,0xc,0x0,0x0,0x2,0x9e,0x49,0x44,
0x41,0x54,0x78,0xda,0x8d,0x94,0xaf,0x6f,0x14,0x41,0x14,0xc7,0x3f,0xd7,0x9c,0x78,
0x93,0x20,0x76,0xdd,0x5e,0x82,0xe8,0x39,0xce,0x75,0xab,0xe0,0x5c,0x71,0x5c,0x52,
0xd3,0x2a,0xda,0x60,0x68,0xc0,0xf0,0x2f,0x5c,0x25,0x12,0x45,0x90,0x75,0x5,0x4,
0x1,0x43,0x52,0x1c,0x8,0xd2,0xab,0x21,0x3d,0x4,0xb9,0xad,0x20,0x99,0x13,0x4d,
0x76,0xdd,0x8e,0xdb,0xe7,0xe,0xb1,0xbb,0xd3,0xdb,0xfb,0x41,0xfb,0xcc,0xec,0xce,
0xbc,0xf9,0xce,0x77,0xbe,0xef,0xfb,0xa6,0x75,0x3e,0x3a,0x67,0x55,0xe4,0x2e,0x9f,
0x19,0x31,0x4,0x41,0xd0,0x98,0x57,0xd5,0xc6,0x98,0xbb,0x9c,0x30,0x8,0x11,0x91,
0xd6,0x7c,0x5e,0x9b,0x35,0x61,0xc4,0x10,0x6f,0xc5,0x1e,0x60,0x3e,0x44,0xc4,0x7f,
0x3b,0xe7,0xb0,0x53,0xbb,0x94,0xb3,0x16,0x18,0x20,0xb9,0x4a,0x96,0xc0,0x16,0xf,
0x52,0xd5,0xc6,0x41,0xb7,0x2,0x17,0x5a,0x2c,0x1,0x14,0x5a,0x60,0xc4,0x34,0xd6,
0x55,0xb5,0x96,0xa2,0x91,0xbf,0xb1,0x6,0x77,0x36,0xcf,0x44,0x44,0x10,0x11,0xc2,
0x20,0x6c,0x48,0x55,0x3,0x2e,0xea,0xbb,0x96,0x71,0xcd,0x22,0x77,0x39,0x46,0xcc,
0xad,0x3a,0xaf,0x8a,0x8d,0xff,0x49,0x31,0xcf,0x70,0x11,0x74,0xd1,0x1d,0x77,0x62,
0xbc,0xae,0x50,0xab,0x2c,0xb7,0x8e,0xf9,0x4a,0xe0,0x34,0x4b,0xe9,0x6e,0x76,0xe9,
0x44,0x9d,0xb5,0xe0,0x75,0x21,0x47,0x17,0x23,0x5c,0xee,0x66,0x62,0x2,0x3a,0x51,
0xd8,0x5a,0x9,0xac,0xaa,0x33,0x6b,0x2d,0xc9,0xaf,0x4,0xd9,0x15,0x7f,0xe5,0x55,
0x63,0xed,0xe,0x97,0x39,0x46,0x3f,0x47,0xa4,0x2e,0xa5,0xd7,0xeb,0xcd,0x6,0xbb,
0x3,0xc2,0x20,0x6c,0xb5,0xea,0xce,0x53,0xd5,0x59,0x92,0x58,0xf2,0xeb,0x94,0x92,
0xa4,0xae,0x2d,0x8c,0x48,0x80,0x60,0xe0,0x1e,0xd8,0x6b,0xcb,0x78,0x7c,0x49,0x9a,
0x65,0xa8,0x16,0xf4,0x1e,0x74,0x39,0x7a,0x71,0x54,0x32,0xae,0x99,0xe,0x76,0x1e,
0x23,0x41,0x50,0x5e,0x5f,0x95,0x62,0x49,0xdc,0x2,0x30,0x5c,0x30,0xe2,0x3b,0x67,
0xf4,0xb5,0x4f,0x3f,0x89,0x49,0x92,0x4b,0xd0,0x2,0x1,0x92,0xdf,0x9,0xef,0xde,
0x9e,0xd0,0x2e,0x41,0x53,0xf6,0x9e,0xec,0x11,0x76,0x42,0x6e,0x8b,0x9,0x13,0xde,
0xf0,0x1a,0x8b,0x65,0xcc,0x98,0x53,0x39,0x65,0xf0,0x77,0x9f,0xf,0xee,0x84,0x34,
0xcb,0x51,0x94,0x74,0x6a,0x69,0xe7,0x69,0xce,0xc1,0xd3,0x3d,0x8c,0x31,0xdc,0x25,
0x42,0x42,0x76,0x78,0x84,0x20,0xc,0x18,0xb0,0x1d,0x6f,0x13,0x4a,0x7,0xa7,0x29,
0x27,0x1f,0xdf,0xe3,0x9c,0x23,0x88,0x2,0xda,0xa,0xd8,0x69,0xa9,0xf,0xaa,0x20,
0x42,0xe9,0x20,0x53,0x75,0x18,0x8,0x52,0x2a,0x5e,0xad,0xbf,0xd2,0x21,0xfb,0x58,
0x22,0x8d,0xb8,0x64,0x2,0xaa,0x4,0xf7,0x3b,0x50,0xdb,0x10,0x68,0xbb,0x2c,0xc3,
0x5e,0x4d,0xca,0x8d,0x85,0xe2,0xeb,0x26,0x15,0x10,0x95,0x4f,0x45,0x41,0xc5,0x2f,
0xa,0x60,0x35,0x45,0x51,0xa,0x55,0xec,0x9f,0x89,0x2f,0xb7,0xd4,0x76,0x53,0x6f,
0xb7,0x1a,0x47,0xfd,0xa4,0xa2,0x37,0x67,0xdc,0x64,0xfa,0x7f,0x29,0xf9,0x34,0x6b,
0x8c,0xd2,0x46,0x40,0xf3,0xe6,0x6,0x59,0x30,0x5b,0x79,0xe0,0x3c,0x63,0x6f,0x3c,
0x54,0x1d,0xb5,0x7f,0xea,0x1e,0xdc,0xde,0xea,0xb3,0xc1,0x3c,0x4b,0x4f,0xb6,0x62,
0xac,0xd5,0xb8,0x20,0x43,0x9d,0xad,0xea,0x28,0xea,0x19,0x31,0x28,0x10,0x45,0x11,
0xcf,0x5f,0x1e,0x94,0x8c,0xed,0xd4,0x56,0xe9,0x6,0xa4,0x0,0x67,0x80,0x1c,0xc4,
0x54,0x74,0x8b,0xf2,0x1b,0x30,0x15,0x3f,0xe3,0x39,0x6a,0xf9,0xa7,0x5,0x22,0x30,
0x3c,0x1e,0xd2,0x89,0x3a,0xad,0xf6,0x66,0x77,0x13,0xfb,0xf5,0x7,0x9f,0xbf,0x9d,
0xa1,0xd5,0x22,0x18,0x4c,0xb3,0xd5,0xfc,0x35,0xa9,0xdf,0x68,0x2f,0xde,0x8d,0x5b,
0x86,0xc7,0x43,0xe2,0x38,0x6e,0x1,0xf8,0x96,0x4e,0xb3,0x74,0xf6,0xe5,0xd3,0x19,
0xa9,0xb5,0xbe,0x0,0x8b,0xad,0x5d,0x3f,0x48,0x85,0x82,0x6a,0x5e,0xce,0x39,0x25,
0x7e,0x18,0x73,0xf8,0xec,0x90,0x5e,0xaf,0xe7,0x1f,0xa1,0x7f,0xe5,0xe2,0x7c,0x96,
0xcb,0x42,0x73,0x6b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
// /home/oper/Documents/ananas/ananas-qt4/src/lib/images/lib_database.png
0x0,0x0,0x4,0xf,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32,
0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,
0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64,
0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x3,0xa1,0x49,0x44,0x41,0x54,0x48,0xc7,0x95,
0x95,0x5f,0x4c,0x5b,0x65,0x18,0xc6,0x8f,0x5b,0x2f,0xd0,0x9c,0x45,0xec,0x66,0x33,
0xb8,0xd0,0x42,0x52,0x58,0x24,0x24,0xb8,0x79,0x21,0xd0,0xd0,0x92,0x5a,0x9b,0xb6,
0x38,0xd7,0xd3,0x8d,0x55,0xd7,0xc0,0xa0,0xed,0x2a,0x83,0x4e,0x62,0x58,0x99,0x56,
0x8a,0x2b,0x41,0x5b,0x50,0xc7,0x40,0xea,0x26,0x8b,0x5b,0x93,0x5d,0x34,0x6a,0x64,
0x23,0xc6,0x66,0x31,0x1b,0x93,0x2d,0x33,0x23,0xdc,0x2c,0xc3,0xfd,0x89,0x22,0x48,
0x56,0x8d,0xc6,0xab,0x5d,0x19,0x6f,0x1e,0xdf,0xf7,0x5b,0x3b,0xbb,0x84,0xd2,0x7a,
0x92,0x27,0xdf,0x77,0xde,0xef,0x7d,0x7e,0x27,0x7d,0xce,0xdb,0x1c,0x9,0x80,0xc4,
0xa2,0xcb,0x44,0xfa,0x80,0x34,0x4d,0x5a,0x20,0xa5,0x49,0x7f,0x67,0x94,0xce,0xd4,
0xa6,0x33,0x3d,0xa6,0xac,0x2f,0x9f,0xf8,0x7a,0x96,0x14,0xad,0x7c,0xce,0xa,0xbd,
0x3d,0x82,0x9d,0xed,0x9,0xb8,0xdf,0x4c,0xe1,0x8d,0xd0,0x3c,0x7a,0x87,0xef,0x8,
0xf1,0x9e,0x6b,0x7c,0xd6,0x68,0x3b,0xa,0xed,0x36,0x2b,0x3b,0xa3,0xec,0x5d,0xf,
0x1c,0x35,0xbe,0x32,0x4,0x6f,0xf0,0x7b,0xbc,0x15,0x5d,0x2a,0x4a,0xdc,0x6b,0x20,
0xf,0x7b,0xd7,0x3,0x2f,0x1f,0x38,0x72,0xad,0x68,0x68,0x56,0xec,0x61,0xef,0x7a,
0xe0,0x39,0xc5,0x3b,0x8d,0x40,0xf8,0x1a,0xc2,0xc7,0x97,0x31,0x38,0xbe,0x8c,0x77,
0x8f,0x2d,0xa3,0x7f,0xf4,0x17,0xf4,0xc5,0x96,0x84,0x78,0xcf,0x35,0x3e,0xe3,0x1e,
0xee,0x75,0x90,0x87,0xbc,0x57,0xd6,0x3,0xc3,0x79,0xe8,0x16,0xec,0x9e,0x59,0xec,
0xf6,0xcf,0xe0,0xc0,0xe1,0x14,0xc2,0x1f,0xfe,0x80,0xb1,0xcf,0x6f,0xe3,0xd4,0x17,
0xf7,0x84,0x78,0xcf,0x35,0x3e,0x73,0x78,0xcf,0xe1,0xe5,0xfd,0x97,0xb0,0xf3,0xe0,
0x8f,0xec,0x46,0x41,0x30,0x37,0x9a,0x3d,0x37,0x61,0xda,0xbf,0x80,0xe6,0x7d,0x73,
0x30,0xb8,0x2e,0x42,0xbf,0x27,0x85,0xc6,0xdd,0xdf,0x88,0xf5,0x79,0x73,0x1c,0xcf,
0xd4,0xec,0x83,0x5c,0xaa,0x83,0xac,0xae,0x82,0x6e,0xbb,0xaf,0x20,0xf8,0x7e,0xd5,
0x76,0xf,0x4c,0xaf,0xa7,0xf2,0x82,0xb7,0xd5,0xbf,0x83,0x3a,0xab,0x82,0xce,0x4f,
0x92,0x78,0x7f,0x3e,0x8d,0xc8,0xf5,0x34,0x5c,0x63,0x49,0x54,0xbf,0xa4,0x30,0xc1,
0x93,0x37,0xe3,0xd6,0xd6,0x56,0x94,0x6a,0x6a,0xa1,0xad,0xed,0x40,0x4d,0xd3,0x10,
0x76,0x58,0x3f,0x43,0xfd,0xae,0x2f,0xd1,0xe8,0x9c,0x41,0x6d,0xf3,0x8,0x6a,0x2d,
0xa,0xfa,0x2e,0x2c,0x22,0xf6,0x33,0x30,0x74,0x17,0x18,0xb8,0x5,0x9c,0x5e,0x1,
0x7c,0xe7,0x17,0xb3,0x70,0xe3,0x9a,0x51,0xc4,0xe3,0x71,0xf4,0xf7,0xf7,0xa3,0xad,
0xad,0xd,0x2d,0x2d,0x2d,0x68,0x68,0x68,0x40,0x65,0x65,0x25,0x64,0x59,0x86,0x4a,
0xa5,0xc2,0xde,0x8f,0x93,0x18,0xfb,0x9,0x38,0x49,0x33,0x90,0x20,0xe0,0xd7,0xf7,
0x80,0xd9,0x3f,0x81,0x23,0x8b,0xc0,0xab,0xa3,0x49,0xa6,0x9c,0xcc,0xb,0x1e,0x1f,
0x1f,0xc7,0xc8,0xc8,0x8,0x22,0x91,0x88,0x78,0x48,0x6f,0x6f,0x2f,0xba,0xba,0xba,
0xa0,0x56,0xab,0xf1,0xe9,0x42,0x1a,0x5f,0x11,0xec,0x7c,0x1a,0xf8,0xf6,0x77,0xe0,
0xbb,0x3f,0xfe,0x3,0x7,0x66,0xd3,0x4c,0x59,0x59,0x33,0x63,0xb3,0xd9,0x8c,0x81,
0x81,0x81,0xa2,0xc1,0xe7,0x68,0x9d,0x5c,0x2a,0xc,0x9e,0x73,0xbb,0xdd,0xd0,0x6a,
0xb5,0x30,0x1a,0x8d,0x70,0x3a,0x9d,0x68,0x6f,0x6f,0x87,0xcf,0xe7,0x83,0xdf,0xef,
0x47,0x5d,0x5d,0x1d,0x7a,0xe8,0xa5,0x9d,0x59,0x79,0x10,0xc5,0x71,0xce,0xf9,0xe,
0x45,0xf2,0x6b,0x11,0x51,0x24,0x12,0x9,0xc,0xe,0xe,0xc2,0xeb,0xf5,0xc2,0xe1,
0x70,0xa0,0xa9,0xa9,0x9,0x3a,0x9d,0x4e,0x64,0x5c,0x52,0x52,0x82,0x1a,0xb3,0x82,
0xb7,0x53,0x8b,0x38,0x45,0xe0,0xb3,0xab,0xc0,0xcc,0x6f,0xc0,0xd5,0xbf,0x1e,0x79,
0x79,0x1f,0x91,0xca,0x49,0x1b,0x48,0x8f,0x3d,0x2,0x9e,0x9a,0x9a,0xc2,0xc4,0xc4,
0x4,0x62,0xb1,0x98,0x78,0x48,0x30,0x18,0x14,0x71,0x4,0x2,0x1,0xd8,0xed,0x76,
0xd4,0xdb,0x14,0x4,0x4f,0x24,0x91,0xbc,0x41,0xb1,0xdc,0x4c,0xe3,0xe8,0xd4,0xc3,
0x71,0xbb,0xfc,0x9a,0x45,0x87,0xad,0xea,0xd,0xbc,0x3f,0x4c,0x7a,0x3c,0xf3,0x0,
0xe9,0xbe,0xcd,0x66,0xc3,0xf0,0xf0,0x70,0x5e,0x30,0xaf,0x3c,0x31,0x7a,0xbd,0x1e,
0x65,0x65,0x65,0xd0,0x68,0x34,0x62,0x6a,0xc8,0xfb,0x8f,0xdb,0x56,0x85,0xb,0x63,
0xcd,0x98,0xf0,0xcb,0xd0,0x3c,0x29,0x71,0x2d,0x4c,0x92,0x1f,0x66,0x5c,0x51,0x51,
0x1,0x93,0xc9,0x4,0x97,0xcb,0x25,0xf2,0xed,0xe9,0xe9,0x11,0xd0,0xee,0xee,0x6e,
0x71,0xcf,0x60,0x45,0x51,0x60,0x30,0x18,0xc4,0xfb,0x60,0xf,0x79,0xe7,0xcb,0x37,
0xab,0x30,0xda,0x29,0xe3,0xcc,0x21,0x15,0xa2,0x6e,0x9,0x65,0x6a,0x1,0x7f,0xaf,
0x60,0xc6,0x2c,0xde,0x73,0x8d,0xcf,0x3a,0x3a,0x3a,0x10,0xa,0x85,0x44,0x74,0xec,
0x25,0x5,0xb7,0x96,0x4a,0x8,0xed,0x91,0x70,0xcc,0x23,0xa1,0x6f,0x97,0x84,0xcd,
0x9b,0x44,0xbd,0x70,0xc6,0xbc,0xf2,0x3d,0xd7,0xf9,0x9c,0xfb,0x72,0xc0,0x4f,0xf0,
0xcf,0x7f,0x9a,0x62,0xe8,0xb2,0x4a,0x70,0xe9,0x25,0xe8,0xca,0x1f,0x80,0xe3,0xc5,
0x64,0x9c,0xb,0xe,0x87,0xc3,0xb0,0x58,0x2c,0x6c,0x8e,0x93,0x36,0x92,0x36,0xf1,
0xcf,0x2f,0x95,0x25,0x54,0x68,0x4,0x34,0x95,0x9d,0xb9,0x83,0xff,0x37,0x63,0xf6,
0xe4,0xcc,0x6c,0x16,0xfe,0x62,0xe6,0x9b,0xf8,0x42,0xee,0x40,0x57,0x93,0x3a,0x49,
0x93,0x3c,0x42,0xa4,0xd5,0x9c,0x8f,0xe9,0x6a,0xa6,0x36,0x99,0xe9,0xa9,0x5e,0xe3,
0xf,0xb1,0x31,0x13,0xcb,0x53,0xa4,0x2d,0xff,0x2,0x66,0x27,0xf,0x70,0x4,0xd8,
0x4f,0x2b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
// /home/oper/Documents/ananas/ananas-qt4/src/lib/images/lib_dbgroup.png
0x0,0x0,0x2,0xa9,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x0,0x0,0x16,0x0,0x0,0x0,0x16,0x8,0x6,0x0,0x0,0x0,0xc4,0xb4,0x6c,0x3b,
0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32,
0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65,
0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64,
0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x3b,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5,
0x95,0xcb,0x6f,0x12,0x51,0x1c,0x85,0xfb,0xc7,0xb5,0x58,0xeb,0x8b,0x18,0xe2,0xc2,
0xb6,0x20,0x26,0x46,0x91,0xd2,0x62,0xb1,0xb4,0x5,0x86,0x3e,0x98,0x96,0xe,0xb4,
0x86,0x88,0xd0,0x8,0x4a,0xa,0x55,0x1a,0xc4,0x27,0x3e,0x62,0xc2,0x96,0x2d,0x61,
0x63,0x60,0xc1,0x2,0x12,0x16,0x10,0x36,0xc0,0x2,0x36,0x34,0x39,0x32,0xb7,0xcc,
0x95,0xc9,0x5c,0xa0,0x86,0x74,0x71,0x12,0x2e,0x73,0xf9,0xbe,0xdf,0x3d,0x30,0xc3,
0x14,0x80,0xa9,0xab,0x88,0x7c,0xd1,0x5b,0xf6,0xa3,0xe9,0x87,0xae,0x27,0x6,0x27,
0x93,0x49,0x9,0x86,0xd3,0x3f,0x27,0x30,0xbd,0x30,0x82,0x25,0x18,0x27,0x53,0x80,
0xcf,0xcf,0xcf,0xd1,0xed,0x76,0x91,0x48,0x24,0x46,0xa,0xc6,0x9d,0x46,0x1,0xee,
0x74,0x3a,0x68,0xb7,0xdb,0x24,0xe2,0xeb,0x78,0x3c,0xce,0x14,0x8c,0x3a,0x4d,0x9f,
0x25,0xb3,0x23,0x16,0x8b,0xa1,0xd1,0x68,0xd0,0x34,0x9b,0x4d,0xb4,0x5a,0x2d,0xf2,
0xfe,0xa0,0x60,0x30,0x2c,0x1,0x99,0x52,0xe7,0xd0,0x42,0xef,0xd4,0xd1,0x8b,0xe1,
0x70,0x18,0xd5,0x6a,0x55,0x96,0x5a,0xad,0x86,0x7a,0xbd,0x8e,0x48,0x24,0x42,0xf7,
0x89,0x40,0x96,0x80,0x82,0x17,0xd6,0xe7,0xe1,0xfd,0x29,0xe0,0xe8,0xb7,0x17,0x7a,
0xee,0x9f,0x20,0x18,0xc,0xa2,0x54,0x2a,0xc9,0x52,0x2e,0x97,0x51,0xa9,0x54,0x10,
0xa,0x85,0x98,0x82,0x41,0x30,0xa9,0x62,0xff,0x33,0x8f,0x83,0x6f,0xfb,0xf0,0xfc,
0x38,0xe8,0x9,0x3c,0x78,0x30,0x20,0xf0,0xf9,0x7c,0xc8,0xe7,0xf3,0xb2,0x14,0xa,
0x5,0x14,0x8b,0x45,0x4,0x2,0x1,0x59,0x45,0x14,0x2c,0x7d,0x69,0xf7,0xcc,0x1a,
0xb8,0x3e,0x6c,0x63,0xef,0x93,0xb,0xee,0xaf,0x7b,0xf0,0x7c,0x77,0xe3,0xf0,0x97,
0x87,0xd4,0x24,0x7d,0x50,0x10,0x4,0x64,0xb3,0x59,0x59,0x72,0xb9,0x1c,0xd2,0xe9,
0xf4,0x50,0x30,0x99,0x9a,0x8b,0xd9,0xb0,0xf5,0x9e,0xc3,0x6e,0x62,0xb,0xfc,0xc7,
0x5d,0xb8,0xbf,0xf0,0x10,0x52,0x6e,0x52,0x93,0xce,0xbe,0x48,0x5,0x2e,0x97,0xb,
0x99,0x4c,0x86,0x26,0x1a,0x8d,0xb2,0xc1,0xd2,0xd4,0x77,0x1e,0xdf,0xc6,0xe6,0x5b,
0x2b,0x1c,0x51,0x1b,0x9c,0xef,0x1c,0xd8,0x39,0x73,0xf6,0x4e,0xb1,0x23,0xab,0x69,
0x50,0xc0,0x71,0x1c,0x99,0x56,0xea,0x7b,0x18,0x98,0x4c,0x6d,0x9,0x98,0x61,0x7d,
0x6d,0xc1,0xc6,0x1b,0x2b,0xec,0x27,0x9b,0xe0,0x4e,0xed,0xd8,0x3e,0xe3,0x14,0x35,
0x69,0x6d,0x17,0x82,0x54,0x2a,0x5,0xbf,0xdf,0x3f,0x1c,0x2c,0x4d,0x3d,0xab,0xbb,
0x86,0x15,0x9f,0x9,0xab,0xaf,0xcc,0x58,0x3b,0xb6,0x60,0x3d,0xbc,0x6,0x5b,0x64,
0x83,0x59,0x93,0xb8,0x5f,0xbc,0x43,0xbd,0x5e,0xef,0x58,0x30,0xbd,0x59,0x66,0xb5,
0x2a,0x2c,0xf7,0x4,0xcf,0xfc,0x2b,0xb0,0x1c,0xaf,0xc2,0x1a,0x7a,0xae,0xa8,0x49,
0xdc,0x67,0x34,0x1a,0xc1,0xf3,0xfc,0x68,0x30,0x53,0xb0,0xa8,0x22,0xbf,0x53,0xf3,
0xcb,0x65,0x45,0x4d,0x1a,0xd3,0x5d,0xda,0xf5,0xa5,0xc0,0x2c,0x81,0x6a,0x41,0x85,
0xa5,0xa3,0xa7,0x8a,0x9a,0xc4,0x6b,0x6a,0xb5,0xfa,0xff,0xc0,0x4c,0xc1,0xfc,0xc,
0x96,0xe,0xd,0xb4,0xa6,0x5b,0x8f,0x6e,0xe,0xbf,0x41,0x2e,0xfd,0xf0,0x96,0x9,
0xa6,0x61,0xf4,0x18,0x48,0x4d,0x37,0x1e,0xce,0x4d,0x6,0x66,0x9,0x66,0xee,0x4f,
0xc3,0x20,0x3c,0x21,0x35,0xcd,0xe9,0xaf,0x4f,0x6,0x66,0x9,0x14,0x8f,0xcd,0xab,
0xfa,0x33,0xfd,0xb,0x6b,0x4c,0x83,0xb2,0x3e,0x78,0xa,0x5d,0x0,0x0,0x0,0x0,
0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
};
static const unsigned char qt_resource_name[] = {
// images
0x0,0x6,
0x7,0x3,0x7d,0xc3,
0x0,0x69,
0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
// print.png
0x0,0x9,
0x0,0x57,0xb8,0x67,
0x0,0x70,
0x0,0x72,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
// lib_database.png
0x0,0x10,
0x3,0xdd,0xa6,0x47,
0x0,0x6c,
0x0,0x69,0x0,0x62,0x0,0x5f,0x0,0x64,0x0,0x61,0x0,0x74,0x0,0x61,0x0,0x62,0x0,0x61,0x0,0x73,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
// lib_dbgroup.png
0x0,0xf,
0x6,0x77,0x81,0x87,
0x0,0x6c,
0x0,0x69,0x0,0x62,0x0,0x5f,0x0,0x64,0x0,0x62,0x0,0x67,0x0,0x72,0x0,0x6f,0x0,0x75,0x0,0x70,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
};
static const unsigned char qt_resource_struct[] = {
// :
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
// :/images
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
// :/images/print.png
0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
// :/images/lib_database.png
0x0,0x0,0x0,0x2a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3,0x25,
// :/images/lib_dbgroup.png
0x0,0x0,0x0,0x50,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x7,0x38,
};
QT_BEGIN_NAMESPACE
extern bool qRegisterResourceData
(int, const unsigned char *, const unsigned char *, const unsigned char *);
extern bool qUnregisterResourceData
(int, const unsigned char *, const unsigned char *, const unsigned char *);
QT_END_NAMESPACE
int QT_MANGLE_NAMESPACE(qInitResources_lib)()
{
QT_PREPEND_NAMESPACE(qRegisterResourceData)
(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_lib))
int QT_MANGLE_NAMESPACE(qCleanupResources_lib)()
{
QT_PREPEND_NAMESPACE(qUnregisterResourceData)
(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_lib))
| [
"[email protected]"
] | |
4e7d8676f0dc817afdd5ee2434b88203dbb3d201 | c512a9b075f6c5ca0b34bc1e1073c301cf9692d5 | /src/main.cpp | a329fe102b3f60943e77d30409b0ada70ac6c199 | [] | no_license | DerZwergGimli/HeatMeterInterface | dd0f80d6b145fc23aea9ff4aa946702161c0b7c3 | 17b61d3f77772a2cc17f0a479688f0e081951637 | refs/heads/master | 2022-04-17T16:35:31.589906 | 2020-03-04T15:20:57 | 2020-03-04T15:20:57 | 255,759,453 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 9,615 | cpp | #include <Wire.h>
#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "ShiftRegisterIO.h"
#include "ConfigInterface.h"
#include "TemperatureInterface.h"
#include "DisplayInterface.h"
#include <Adafruit_MAX31865.h>
#include <Esp.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
//Scheduled Task setup
//#define _TASK_ESP32_DLY_THRESHOLD 40L
#define _TASK_SLEEP_ON_IDLE_RUN
#include <TaskScheduler.h>
//Delegates for platform.io
void displayTask_Callback();
void measureTask_Callback();
void sendDataTask_Callback();
void readyLED(bool state);
WiFiEventHandler connectedWIFIEventHandler, disconnectedWIFIEventHandler;
Scheduler runner;
Task displayTask(1100, TASK_FOREVER, &displayTask_Callback, &runner, true);
Task measureTask(700, TASK_FOREVER, &measureTask_Callback, &runner, true);
//Task sendDataTask(10000, TASK_FOREVER, &sendDataTask_Callback, &runner, false);
// Display Configuration
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
DisplayInterface displayInterface;
//PT100 Configurartion
Adafruit_MAX31865 thermo = Adafruit_MAX31865(D8, D7, D6, D5);
TemperatureInterface temperatureInterface;
//#define RREF 430.0 old Version
#define RREF 240.0
#define RNOMINAL 100.0
// ShiftRegister Configuration
ShiftRegisterIO shiftRegisterIO;
SR_IO sr_io;
#define RMUX_IN A0
//Configuration
ConfigInterface configInterface;
Configuratrion config;
MeterData meterData[4];
int displayState = 0;
void setup()
{
Serial.begin(115200);
Serial.print("Starting...");
delay(100);
shiftRegisterIO.init();
shiftRegisterIO.write(&sr_io);
shiftRegisterIO.write(&sr_io);
//pinMode(RMUX_IN, INPUT);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C))
{
Serial.println(F("SSD1306 allocation failed"));
for (;;)
Serial.print("Error while connecting to Display"); // Don't proceed, loop forever
}
displayInterface.boot(&display);
configInterface.init();
configInterface.loadConfig(&config, meterData);
temperatureInterface.init(thermo);
//runner.init();
//runner.addTask(displayTask);
//runner.addTask(measureTask);
// connectedWIFIEventHandler = WiFi.onStationModeGotIP([](const WiFiEventStationModeGotIP &event) {
// Serial.print("Station connected, IP: ");
// Serial.println(WiFi.localIP());
// sendDataTask.enable();
// });
// disconnectedWIFIEventHandler = WiFi.onStationModeDisconnected([](const WiFiEventStationModeDisconnected &event) {
// Serial.println("Station disconnected");
// sendDataTask.disable();
// });
// WiFi.begin(config.wifi_SSID, config.wifi_Password);
delay(1000);
//displayTask.enable();
//measureTask.enable();
//shiftRegisterIO.led_READY(&shiftRegisterIO, &sr_io, true);
runner.startNow();
//shiftRegisterIO.ledBlink(1000);
}
void loop()
{
//shiftRegisterIO.led_READY(&shiftRegisterIO, &sr_io, true);
runner.execute();
//1. Display
//displayInterface.displayMeter(&display, &meterData[0]);
//2.1 Take Measurements
//2.2 Calculate
//3. Send Measuremnts
//4. check user input
// do all over again
//display.clearDisplay();
//display.setCursor(10, 10);
// int analogValue = analogRead(RMUX_IN);
// Serial.print("Analaog: ");
// Serial.println(String(analogValue));
// //display.println(analogValue);
// channel_RJ1.temperature_up_Celcius = temperatureInterface.readTemperature(thermo, RNOMINAL, config.RREF_RJ1_T1, true);
// sr_io = shiftRegisterIO.t_MuxSelect(sr_io, 7);
// shiftRegisterIO.write(sr_io);
// channel_RJ1.temperature_down_Celcius = temperatureInterface.readTemperature(&thermo, RNOMINAL, config.RREF_RJ1_T2, true);
// meterData[0].mux_up = 5;
// meterData[0].mux_down = 7;
// Serial.print(meterData[0].RREF_up);
// //meterData[0].RREF_up = 240;
//meterData[0].RREF_down = 240;
//temperatureInterface.readTemperature(thermo, &sr_io, &meterData[0]);
// Serial.print("UP ");
// Serial.println(String(meterData[0].temperature_up_Celcius));
// Serial.print("DOWN ");
// Serial.println(String(meterData[0].temperature_down_Celcius));
//readTemperature(0, 0, true);
//sr_io = shiftRegisterIO.t_MuxSelect(sr_io, -1);
//shiftRegisterIO.write(sr_io);
//display.display();
//delay(1000);
}
void displayTask_Callback()
{
shiftRegisterIO.led_READY(&shiftRegisterIO, &sr_io, false);
switch (displayState)
{
case 0:
displayInterface.boot(&display);
displayState++;
break;
case 1: //Show Meter 1
displayInterface.displayMeter(&display, &meterData[0]);
//displayState++;
break;
case 2: //Show Meter 2
displayInterface.displayMeter(&display, &meterData[1]);
displayState++;
break;
case 3: //Show Meter 3
displayInterface.displayMeter(&display, &meterData[2]);
displayState++;
break;
case 4: //Show Meter 4
displayInterface.displayMeter(&display, &meterData[3]);
displayState = 1;
break;
default:
break;
}
}
void measureTask_Callback()
{
shiftRegisterIO.led_READY(&shiftRegisterIO, &sr_io, false);
unsigned long start = millis();
shiftRegisterIO.led_RJ1(&shiftRegisterIO, &sr_io, true);
temperatureInterface.readTemperature(thermo, &sr_io, &meterData[0]);
shiftRegisterIO.checkMeterResistance(&shiftRegisterIO, &sr_io, &meterData[0]);
if (meterData[0].waterMeterState)
{
shiftRegisterIO.led_statusRJ1(&shiftRegisterIO, &sr_io, true);
}
else
{
shiftRegisterIO.led_statusRJ1(&shiftRegisterIO, &sr_io, false);
}
if (meterData[0].mux_resistance_edgeDetect)
{
meterData->water_CounterValue_m3 += 5;
meterData->delta_HeatEnergy_J += 4200 * 5 * (meterData->temperature_up_Celcius_mean - meterData->temperature_down_Celcius_mean);
meterData->absolute_HeatEnergy_MWh = meterData->delta_HeatEnergy_J * 0.000000000277778;
Serial.println(meterData->absolute_HeatEnergy_MWh);
}
shiftRegisterIO.led_RJ1(&shiftRegisterIO, &sr_io, false);
//shiftRegisterIO.led_RJ2(&shiftRegisterIO, &sr_io, true);
//temperatureInterface.readTemperature(thermo, &sr_io, &meterData[1]);
//shiftRegisterIO.led_RJ2(&shiftRegisterIO, &sr_io, false);
//shiftRegisterIO.led_RJ3(&shiftRegisterIO, &sr_io, true);
//temperatureInterface.readTemperature(thermo, &sr_io, &meterData[2]);
//shiftRegisterIO.led_RJ3(&shiftRegisterIO, &sr_io, false);
//shiftRegisterIO.led_RJ4(&shiftRegisterIO, &sr_io, true);
//temperatureInterface.readTemperature(thermo, &sr_io, &meterData[3]);
//shiftRegisterIO.led_RJ4(&shiftRegisterIO, &sr_io, false);
unsigned long end = millis();
unsigned long duration = end - start;
Serial.print("Duration:");
Serial.println(duration);
}
void sendDataTask_Callback()
{
measureTask.disable();
WiFiClient espClient;
PubSubClient client(espClient);
// WiFi.forceSleepWake();
// WiFi.mode(WIFI_STA);
// WiFi.begin(config.wifi_SSID, config.wifi_Password);
// Serial.print("Connecting to WIFI");
// while (WiFi.status() != WL_CONNECTED)
// {
// shiftRegisterIO.led_WIFI(&shiftRegisterIO, &sr_io, true);
// unsigned long timestamp = millis();
// //while (millis() <= timestamp + 500)
// //{
// // ;
// //}
// //delay(100);
// delay(500);
// Serial.print(".");
// shiftRegisterIO.led_WIFI(&shiftRegisterIO, &sr_io, false);
// //system_soft_wdt_feed();
// //ESP.wdtFeed();
// //system_soft_wdt_feed();
// //wdt_reset();
// //ESP.wdtFeed();
// }
//Serial.println("Connected to the WiFi network");
shiftRegisterIO.led_WIFI(&shiftRegisterIO, &sr_io, true);
client.setServer(config.mqtt_ServerAddress, config.mqtt_Port);
//client.setCallback(callback
while (!client.connected())
{
Serial.println("Connecting to MQTT...");
if (client.connect(config.name))
{
Serial.println("connected");
}
else
{
Serial.print("failed with state ");
Serial.print(client.state());
shiftRegisterIO.led_ERROR(&shiftRegisterIO, &sr_io, true);
//delay(2000);
}
client.publish("esp/test", "Hello from ESP8266");
//char *s = ""; // initialized properly
//char *s;
//sprintf(char *s, "%s/temperature_down_Celcius", config.name);
//Serial.print(s);
char topic[100];
char message[100];
sprintf(topic, "%s/%d/water_CounterValue_m3", config.name, meterData[0].meterID);
sprintf(message, "%f", meterData[0].water_CounterValue_m3);
client.publish(topic, message);
sprintf(topic, "%s/%d/absolute_HeatEnergy_MWh", config.name, meterData[0].meterID);
sprintf(message, "%f", meterData[0].absolute_HeatEnergy_MWh);
client.publish(topic, message);
sprintf(topic, "%s/%d/temperature_up_Celcius", config.name, meterData[0].meterID);
sprintf(message, "%0.2f", meterData[0].temperature_up_Celcius);
client.publish(topic, message);
sprintf(topic, "%s/%d/temperature_down_Celcius", config.name, meterData[0].meterID);
sprintf(message, "%0.2f", meterData[0].temperature_down_Celcius);
client.publish(topic, message);
}
client.disconnect();
//wifi_set_sleep_type(LIGHT_SLEEP_T);
//WiFi.disconnect();
//WiFi.mode(WIFI_OFF);
//WiFi.disconnect();
//WiFi.forceSleepBegin();
measureTask.enable();
shiftRegisterIO.led_WIFI(&shiftRegisterIO, &sr_io, false);
shiftRegisterIO.led_ERROR(&shiftRegisterIO, &sr_io, false);
}
void readyLED(bool state)
{
sr_io.LED_Ready = state;
shiftRegisterIO.write(&sr_io);
} | [
"[email protected]"
] | |
0db02ba94854e8a65b743cf696fe52c258d8711b | d0c44dd3da2ef8c0ff835982a437946cbf4d2940 | /cmake-build-debug/programs_tiling/function14452/function14452_schedule_25/function14452_schedule_25.cpp | 00cf7549a91d645f223ed864b6b00395c4a67d3e | [] | no_license | IsraMekki/tiramisu_code_generator | 8b3f1d63cff62ba9f5242c019058d5a3119184a3 | 5a259d8e244af452e5301126683fa4320c2047a3 | refs/heads/master | 2020-04-29T17:27:57.987172 | 2019-04-23T16:50:32 | 2019-04-23T16:50:32 | 176,297,755 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,247 | cpp | #include <tiramisu/tiramisu.h>
using namespace tiramisu;
int main(int argc, char **argv){
tiramisu::init("function14452_schedule_25");
constant c0("c0", 128), c1("c1", 64), c2("c2", 64), c3("c3", 64);
var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i3("i3", 0, c3), i01("i01"), i02("i02"), i03("i03"), i04("i04"), i05("i05"), i06("i06");
input input00("input00", {i0, i3}, p_int32);
input input01("input01", {i1, i3}, p_int32);
input input02("input02", {i0, i3, i2}, p_int32);
computation comp0("comp0", {i0, i1, i2, i3}, input00(i0, i3) * input01(i1, i3) * input02(i0, i3, i2));
comp0.tile(i1, i2, i3, 64, 32, 64, i01, i02, i03, i04, i05, i06);
comp0.parallelize(i0);
buffer buf00("buf00", {128, 64}, p_int32, a_input);
buffer buf01("buf01", {64, 64}, p_int32, a_input);
buffer buf02("buf02", {128, 64, 64}, p_int32, a_input);
buffer buf0("buf0", {128, 64, 64, 64}, p_int32, a_output);
input00.store_in(&buf00);
input01.store_in(&buf01);
input02.store_in(&buf02);
comp0.store_in(&buf0);
tiramisu::codegen({&buf00, &buf01, &buf02, &buf0}, "../data/programs/function14452/function14452_schedule_25/function14452_schedule_25.o");
return 0;
} | [
"[email protected]"
] | |
709f2a88c3fd33bef9db1fd138a394cbda1df3cd | 73c236437958c9fde595609a0ce8d24823e46071 | /auto_read/work_thread.cpp | ed51652e8ab101924ea7abc23a23ab76d8fbd57e | [] | no_license | blacksjt/autobots | f7f4bd4e870066a44ad83f86020aeb3e580a523c | 0b92d832afa6b3afcbc49b677c1489029227fae0 | refs/heads/master | 2020-04-16T02:11:56.871238 | 2017-06-27T12:01:18 | 2017-06-27T12:01:18 | 63,883,688 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,055 | cpp |
#include "work_thread.h"
void network::OnAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator)
{
}
void network::OnSsllErrors(QNetworkReply* reply, const QList<QSslError>& errors)
{
}
void network::ProcessReplyData(QNetworkReply* reply)
{
}
network::network(QObject* parent /*= 0*/)
: HttpBase(parent)
{
}
network::~network()
{
}
WorkThread::WorkThread(QObject *parent /*= 0*/)
: QThread(parent)
{
}
WorkThread::~WorkThread()
{
}
//void WorkThread::run()
// {
//
// QString msg = QStringLiteral("运行中");
// int count = 0;
//
// while( /*control_status*/ true)
// {
// QString temp = msg;
//
// work_run();
//
// count ++;
//
// QString temp2;
// temp2.setNum(count);
//
// // 发送消息
// QString msg = temp +temp2;
// emitMsg(msg);
// //ui.lineEdit_msg->setText(temp + temp2);
//
// sleep(2);
//
// }
// }
// void WorkThread::work_run()
// {
// QNetworkCookieJar* cookie = new QNetworkCookieJar(this);
// m_manager.setCookieJar(cookie);
//
// foreach(QString str, m_comment_list)
// {
// QString str_url1 = m_url;
// QNetworkRequest req;
//
// req.setUrl(QUrl(str_url1));
//
// //HttpParamList header_list;
// req.setRawHeader("Referer", m_referer.toUtf8());
// req.setRawHeader("Cache-Control","no-cache");
// req.setRawHeader("Connection","Keep-Alive");
// req.setRawHeader("Accept-Encoding","gzip, deflate");
// req.setRawHeader("Accept-Language","zh-CN");
// req.setRawHeader("Host", "comment8.mydrivers.com");
// req.setRawHeader("Origin", "http://comment8.mydrivers.com");
// req.setRawHeader("User-Agent","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
//
// //HttpParamList post_data;
// QString post_data = QString("act=support&rid=%1&tid=%2").arg(str,m_news_id);
// QByteArray request_params = post_data.toUtf8();
//
// // post_data.push_back(HttpParamItem("act","support"));
// // post_data.push_back(HttpParamItem("rid",str));
// // post_data.push_back(HttpParamItem("tid", m_news_id));
//
// QNetworkReply* reply = m_manager.post(req, request_params);
//
// //#ifdef _DEBUG
// QTime _t;
// _t.start();
//
// bool _timeout = false;
//
// while (reply && !reply->isFinished())
// {
// QCoreApplication::processEvents();
// if (_t.elapsed() >= 10*1000) {
// _timeout = true;
// break;
// }
// }
//
// QString msg;
// if (reply->error() != QNetworkReply::NoError)
// {
// msg = reply->errorString();
// }
//
// QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
//
// int n = statusCodeV.toInt();
//
// msg = reply->readAll();
// //#endif
//
// reply->deleteLater();
//
// msleep(100);
//
// }
//
// cookie->deleteLater();
// } | [
"[email protected]"
] | |
d531430023f98dd2a20cc2d9d66455b6b28c059c | 9c41914aaa17a090cadb7cf843510ebe15805ca5 | /src/gl/debug.cpp | 61b8ed9bf363f513dcb0686ce4d28ebf4f809945 | [] | no_license | Netdex/renden | 16ed7c9d1e1b89ebed2e6ef017ad1ffa6d91e65c | ccd53062ee9da797132cc60192a67bf702510aa0 | refs/heads/master | 2021-08-16T14:23:39.630577 | 2020-04-30T18:51:44 | 2020-04-30T18:51:44 | 171,771,075 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,788 | cpp | #include "gl/debug.hpp"
#include <sstream>
#include <spdlog/spdlog.h>
void APIENTRY debug_callback(GLenum source, GLenum type, GLuint /*id*/,
GLenum severity, GLsizei /*length*/, const GLchar* message, const void* /*userParam*/)
{
std::stringstream output;
output << "OGL:";
switch (type)
{
case GL_DEBUG_TYPE_ERROR:
output << "Error";
break;
case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
output << "Deprecated Behaviour";
break;
case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
output << "Undefined Behaviour";
break;
case GL_DEBUG_TYPE_PORTABILITY:
output << "Portability";
break;
case GL_DEBUG_TYPE_PERFORMANCE:
output << "Performance";
break;
case GL_DEBUG_TYPE_MARKER:
output << "Marker";
break;
case GL_DEBUG_TYPE_PUSH_GROUP:
output << "Push Group";
break;
case GL_DEBUG_TYPE_POP_GROUP:
output << "Pop Group";
break;
case GL_DEBUG_TYPE_OTHER:
output << "Other";
break;
default: break;
}
output << ":";
switch (source)
{
case GL_DEBUG_SOURCE_API:
output << "API";
break;
case GL_DEBUG_SOURCE_WINDOW_SYSTEM:
output << "Window System";
break;
case GL_DEBUG_SOURCE_SHADER_COMPILER:
output << "Shader Compiler";
break;
case GL_DEBUG_SOURCE_THIRD_PARTY:
output << "Third Party";
break;
case GL_DEBUG_SOURCE_APPLICATION:
output << "Application";
break;
case GL_DEBUG_SOURCE_OTHER:
output << "Other";
break;
default: break;
}
output << " - " << message;
switch (severity)
{
case GL_DEBUG_SEVERITY_HIGH:
spdlog::error(output.str());
break;
case GL_DEBUG_SEVERITY_MEDIUM:
spdlog::warn(output.str());
break;
case GL_DEBUG_SEVERITY_LOW:
spdlog::info(output.str());
break;
case GL_DEBUG_SEVERITY_NOTIFICATION:
spdlog::trace(output.str());
break;
default: break;
}
}
| [
"[email protected]"
] | |
8e8aa914eab7e27ac76714855b30da01f7cbb782 | f0a26ec6b779e86a62deaf3f405b7a83868bc743 | /Engine/Source/Editor/UnrealEd/Classes/Commandlets/FixupRedirectsCommandlet.h | 444dcf6958352733935ac523d26cc308acd35fcb | [] | no_license | Tigrouzen/UnrealEngine-4 | 0f15a56176439aef787b29d7c80e13bfe5c89237 | f81fe535e53ac69602bb62c5857bcdd6e9a245ed | refs/heads/master | 2021-01-15T13:29:57.883294 | 2014-03-20T15:12:46 | 2014-03-20T15:12:46 | 18,375,899 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 399 | h | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "FixupRedirectsCommandlet.generated.h"
UCLASS()
class UFixupRedirectsCommandlet : public UCommandlet
{
GENERATED_UCLASS_BODY()
// Begin UCommandlet Interface
virtual void CreateCustomEngine(const FString& Params) OVERRIDE;
virtual int32 Main(const FString& Params) OVERRIDE;
// End UCommandlet Interface
};
| [
"[email protected]"
] | |
efe2023385d50437ac5b55bb091fe6388188d1af | a9985e489ca004af650fcdf6a5667ae93ecee29f | /11/src/include/oop11v2.h | afb94f6cbaff69ed8e0c54aaf843288a5d9f610f | [] | no_license | dazzlemon/diit_121-ipz_y2_oop | 8d47cca7ee1924826b43a97e3f509644b6f61f6b | f8ece4aaacd9fbe0e77124349a8ba72d4851be66 | refs/heads/main | 2023-03-23T04:37:27.052661 | 2021-03-03T11:12:42 | 2021-03-03T11:12:42 | 332,752,873 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,202 | h | /// @file oop11v2.h
#ifndef OOP11V2_H
#define OOP11V2_H
#include <concepts>
#include <functional>
#include <list>
namespace v2 {
/**
* @brief Returns intersections of f and g on range_.
* @param[in] f y(x) function on 2d plane which exists for all xs in range_
* @param[in] g y(x) function on 2d plane which exists for all xs in range_
* @param[in] range_ Range on which intersections between f and g will be searched
* @tparam N Floating point Numeric Type orderable with int
* @return list<N> of xs in which f and g intersect
*/
template<class N>
requires std::floating_point<N> && std::totally_ordered_with<N, int>
auto intersections(std::function<N(N)> f, std::function<N(N)> g, std::pair<N, N> range_) -> std::list<N>;
/**
* @brief Returns num evenly spaced samples, calculate over the interval [start, stop].
* @param[in] start The starting value of the sequence
* @param[in] stop The end value of the sequence
* @param[in] num Number of samples to generate
* @tparam N Floating point Numeric Type orderable with int
* @return num equally spaced samples in the closed interval [start, stop]
*/
template<class N>
requires std::floating_point<N> && std::totally_ordered_with<N, int>
auto linspace(N start, N stop, size_t num) -> std::list<N>;
template<class N>
requires std::floating_point<N> && std::totally_ordered_with<N, int>
auto intersections(std::function<N(N)> f, std::function<N(N)> g, std::pair<N, N> range_) -> std::list<N> {
const size_t NUMS = 1000;
auto xs = linspace(range_.first, range_.second, NUMS);
std::list<int> signs(NUMS);
for (auto x = xs.begin(), s = signs.begin(); x != xs.end(); x++, s++) {
*s = sign(f(*x) - g(*x));
}
auto res = std::list<N>();
for (auto x = xs.begin(), s1 = signs.begin(), s2 = ++signs.begin(); s2 != signs.end(); x++, s1++, s2++) {
if (*s1 - *s2 != 0) {
res.push_back(*x);
}
}
return res;
}
template<class N>
requires std::floating_point<N> && std::totally_ordered_with<N, int>
auto linspace(N start, N stop, size_t num) -> std::list<N> {
std::list<N> l(num);
N step = (stop -start) / (num - 1);
N val = start;
for (auto& i : l) {
i = val;
val += step;
}
return l;
}
}//namespace v2
#endif
| [
"[email protected]"
] | |
d172eb7a5f9323c5ea4f74d39fa3d2eb26304f81 | b9c61c27a363ac866ac2d9d6a085e7e2db29f5db | /src/Utils/Utils/GeometryOptimization/IRCOptimizer.h | d62baa81b564bb2c162074451f855d196a2ba801 | [
"BSD-3-Clause"
] | permissive | ehermes/utilities | e2d6eb8221e0a992701cc42bd719cb9f4d12e372 | 052452fcc3a4f7cc81740086d837c5d03652c030 | refs/heads/master | 2020-06-04T10:20:30.232921 | 2019-06-12T12:36:36 | 2019-06-12T12:36:36 | 191,976,830 | 0 | 0 | BSD-3-Clause | 2019-06-14T16:44:19 | 2019-06-14T16:44:19 | null | UTF-8 | C++ | false | false | 11,076 | h | /**
* @file
* @copyright This code is licensed under the 3-clause BSD license.\n
* Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.\n
* See LICENSE.txt for details.
*/
#ifndef UTILS_IRCOPTIMIZER_H_
#define UTILS_IRCOPTIMIZER_H_
#include "Utils/CalculatorBasics/PropertyList.h"
#include "Utils/CalculatorBasics/Results.h"
#include "Utils/Geometry/AtomCollection.h"
#include "Utils/Geometry/ElementInfo.h"
#include "Utils/GeometryOptimization/GeometryOptimizer.h"
#include "Utils/Optimizer/GradientBased/GradientBasedCheck.h"
#include <Core/Interfaces/Calculator.h>
#include <Eigen/Core>
namespace Scine {
namespace Utils {
/**
* @brief The base class for all IRC optimizers.
*
* The main purpose of this base class is to hide the template parameter(s)
* of the derived class(es).
*/
class IRCOptimizerBase {
public:
static constexpr const char* ircInitialStepSizeKey = "irc_initial_step_size";
static constexpr const char* ircTransfromCoordinatesKey = "irc_transfrom_coordinates";
/// @brief Default constructor.
IRCOptimizerBase() = default;
/// @brief Virtual default destructor.
virtual ~IRCOptimizerBase() = default;
/**
* @brief The main functionality of the IRC optimizer.
*
* This function wraps the optimize functions of the underlying optimizer.
*
* @param atoms The AtomCollection (Geometry) to be optimized.
* @return int The final number of optimization cycles carried out.
*/
virtual int optimize(AtomCollection& atoms, const Eigen::VectorXd& mode, bool forward = true) = 0;
/**
* @brief Function to apply the given settings to underlying classes.
* @param settings The new settings.
*/
virtual void setSettings(const Settings& settings) = 0;
/**
* @brief Get the public settings as a Utils::Settings object.
* @return Settings A settings object with the current settings.
*/
virtual Settings getSettings() const = 0;
/**
* @brief Add an observer function that will be triggered in each iteration.
*
* @param function A function to be executed in every loop of the optimization.
* The function will have access to the current cycle count,
* the current value and to a const reference of the current
* parameters.
*/
virtual void addObserver(std::function<void(const int&, const double&, const Eigen::VectorXd&)> function) = 0;
/**
* @brief Clear all existing observer functions.
*
* For optimization problems with very fast evaluations of the underlying function
* the removal of all observers can increase performance as the observers are given
* as std::functions and can not be added via templates.
*/
virtual void clearObservers() = 0;
/// @brief The size of the initial step along the chosen mode.
double initialStepSize = 0.01;
/**
* @brief Switch to transform the coordinates from Cartesian into an internal space.
*
* The optimization will be carried out in the internal coordinate space possibly
* accellerating convergence.
*/
bool transformCoordinates = true;
};
/**
* @brief Settings for an IRCOptimizer.
*
* Uses template arguments in order to automatically include the
* settings of underlying objects into the given settings.
*
* @tparam OptimizerType The underlying Optimizer class.
* @tparam ConvergenceCheckType The underlying ConvergenceCheck class.
*/
template<class OptimizerType, class ConvergenceCheckType>
class IRCOptimizerSettings : public Settings {
public:
/**
* @brief Construct a new IRCOptimizerSettings object.
*
* Sets the default values of the settings to the current values set in the objects
* given to the constructor.
*
* @param ircBase The IRC optimizer.
* @param optimizer The optimizer.
* @param check The convergence check criteria.
*/
IRCOptimizerSettings(const IRCOptimizerBase& ircBase, const OptimizerType& optimizer, const ConvergenceCheckType& check)
: Settings("IRCOptimizerSettings") {
optimizer.addSettingsDescriptors(this->_fields);
check.addSettingsDescriptors(this->_fields);
UniversalSettings::BoolDescriptor irc_initial_step_size("The size of the initial step along the chosen mode.");
irc_initial_step_size.setDefaultValue(ircBase.initialStepSize);
this->_fields.push_back(IRCOptimizerBase::ircInitialStepSizeKey, irc_initial_step_size);
UniversalSettings::BoolDescriptor irc_transfrom_coordinates(
"Switch to transform the coordinates from Cartesian into an internal space.");
irc_transfrom_coordinates.setDefaultValue(ircBase.transformCoordinates);
this->_fields.push_back(IRCOptimizerBase::ircTransfromCoordinatesKey, irc_transfrom_coordinates);
this->resetToDefaults();
}
};
/**
* @brief A version of the GeometryOptimizer that optimizes along an internal reaction coordinate (IRC).
*
* This optimizer mass-weights the actual gradient in order to optimize in the mass-weighted
* coordinate system.
*
* @tparam OptimizerType Expects any of the Optimizer classes. Note that some special optimizers
* may not yet be supported or may need additional specialization.
*/
template<class OptimizerType>
class IRCOptimizer : public IRCOptimizerBase {
public:
/**
* @brief Construct a new IRCOptimizer object.
* @param calculator The calculator to be used for the single point/gradient calculations.
*/
IRCOptimizer(Core::Calculator& calculator) : _calculator(calculator){};
/**
* @brief See IRCOptimizerBase::optimize().
*
* @param atoms The AtomCollection (Geometry) to be optimized.
* @param mode The mode to follow in the IRC.
* @param forward A boolean signaling to follow the mode forwards (true, current positions + mode)
* or backwards (false, current positions - mode)
* @return int The final number of optimization cycles carried out.
*/
virtual int optimize(AtomCollection& atoms, const Eigen::VectorXd& mode, bool forward = true) final {
// Configure Calculator
_calculator.setStructure(atoms);
_calculator.setRequiredProperties(Utils::Property::Energy | Utils::Property::Gradients);
// Collect masses
Eigen::VectorXd masses = Eigen::VectorXd::Zero(atoms.size());
const auto& elements = atoms.getElements();
for (unsigned int i = 0; i < atoms.size(); i++) {
masses[i] = ElementInfo::mass(elements[i]);
}
masses.array() /= masses.sum();
// Transformation into internal basis
Eigen::MatrixXd transformation;
if (this->transformCoordinates) {
transformation = Geometry::calculateRotTransFreeTransformMatrix(atoms.getPositions(), atoms.getElements());
}
// Define update function
const unsigned int nAtoms = atoms.size();
auto const update = [&](const Eigen::VectorXd& parameters, double& value, Eigen::VectorXd& gradients) {
Utils::PositionCollection coordinates;
if (this->transformCoordinates) {
auto tmp = (transformation * parameters).eval();
coordinates = Eigen::Map<const Utils::PositionCollection>(tmp.data(), nAtoms, 3);
}
else {
coordinates = Eigen::Map<const Utils::PositionCollection>(parameters.data(), nAtoms, 3);
}
_calculator.modifyPositions(coordinates);
Utils::Results results = _calculator.calculate("Geometry Optimization Cycle");
value = results.getEnergy();
auto gradientMatrix = results.getGradients();
gradientMatrix.col(0).array() *= masses.array();
gradientMatrix.col(1).array() *= masses.array();
gradientMatrix.col(2).array() *= masses.array();
if (this->transformCoordinates) {
auto tmp = Eigen::Map<const Eigen::VectorXd>(gradientMatrix.data(), nAtoms * 3);
gradients = (transformation.transpose() * tmp).eval();
}
else {
gradients = Eigen::Map<const Eigen::VectorXd>(gradientMatrix.data(), nAtoms * 3);
}
};
// Move initial positions along mode
Eigen::VectorXd positions;
if (this->transformCoordinates) {
Eigen::VectorXd tmp = Eigen::Map<const Eigen::VectorXd>(atoms.getPositions().data(), nAtoms * 3);
tmp += (forward ? this->initialStepSize : -1.0 * this->initialStepSize) * (mode / mode.norm());
positions = (transformation.transpose() * tmp).eval();
}
else {
positions = Eigen::Map<const Eigen::VectorXd>(atoms.getPositions().data(), nAtoms * 3);
positions += (forward ? this->initialStepSize : -1.0 * this->initialStepSize) * (mode / mode.norm());
}
// Optimize
auto cycles = optimizer.optimize(positions, update, check);
// Update Atom collection and return
Utils::PositionCollection coordinates;
if (this->transformCoordinates) {
auto tmp = (transformation * positions).eval();
coordinates = Eigen::Map<const Utils::PositionCollection>(tmp.data(), nAtoms, 3);
}
else {
coordinates = Eigen::Map<const Utils::PositionCollection>(positions.data(), nAtoms, 3);
}
atoms.setPositions(coordinates);
return cycles;
}
/**
* @brief Function to apply the given settings to underlying classes.
* @param settings The new settings.
*/
virtual void setSettings(const Settings& settings) override {
check.applySettings(settings);
optimizer.applySettings(settings);
this->initialStepSize = settings.getBool(IRCOptimizerBase::ircInitialStepSizeKey);
this->transformCoordinates = settings.getBool(IRCOptimizerBase::ircTransfromCoordinatesKey);
};
/**
* @brief Get the public settings as a Utils::Settings object.
* @return Settings A settings object with the current settings.
*/
virtual Settings getSettings() const override {
return IRCOptimizerSettings<OptimizerType, GradientBasedCheck>(*this, optimizer, check);
};
/**
* @brief Add an observer function that will be triggered in each iteration.
*
* @param function A function to be executed in every loop of the optimization.
* The function will have access to the current cycle count
* the current value and to a const reference of the current
* parameters.
*/
virtual void addObserver(std::function<void(const int&, const double&, const Eigen::VectorXd&)> function) final {
optimizer.addObserver(function);
}
/**
* @brief Clear all existing observer functions.
*
* For optimization problems with very fast evaluations of the underlying function
* the removal of all observers can increase performance as the observers are given
* as std::functions and can not be added via templates.
*/
virtual void clearObservers() final {
optimizer.clearObservers();
}
/// @brief The underlying optimizer, public in order to change it's settings.
OptimizerType optimizer;
/// @brief The underlying convergence check, public in order to change it's settings.
GradientBasedCheck check;
private:
Core::Calculator& _calculator;
};
} // namespace Utils
} // namespace Scine
#endif // UTILS_GEOMETRYOPTIMIZER_H_
| [
"[email protected]"
] | |
8f3c4da9bcd39b1b9b3f9a2e2661182af2879157 | 447f792edcfd464bc6e99c80754986f84f1c5bb5 | /practice/1015C.cpp | a8b626931db864cfb394ce4b9ed7a9010ca69a87 | [] | no_license | srajang123/Competitive-Programming | 5e0a42b0c500bf43cad0106cf9bc30d3849babc3 | f3f3973dd700236f2ce722f425f118a5a13ed41d | refs/heads/master | 2021-01-16T09:29:52.269639 | 2020-11-22T08:48:17 | 2020-11-22T08:48:17 | 243,060,688 | 2 | 1 | null | 2020-11-22T08:48:18 | 2020-02-25T17:37:54 | C++ | UTF-8 | C++ | false | false | 2,849 | cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define N 1000005
#define M 1000000007
/*
*********************************************************************
* Code By *
* *
* Srajan Gupta *
* srajang_123 *
* *
*********************************************************************
*/
//Prime Numbers
vector<bool>prime(N+1,true);
void sieve()
{
ll i,j,k;
prime[0]=prime[1]=false;
for(i=2;i*i<=N;i++)
{
if(prime[i])
{
for(j=i*i;j<=N;j+=i)
{
prime[j]=false;
}
}
}
}
//Exponentiation
ll power(ll a,ll b)
{
ll r=1;
while(b)
{
if(b%2==1)
r=r*a;
b/=2;
a*=a;
}
return r;
}
ll power(ll a,ll b,ll m)
{
a=a%m;
ll r=1;
while(b)
{
if(b%2==1)
r=(r*a)%m;
b/=2;
a=(a*a)%m;
}
return r;
}
//Prime Factors
vector<ll> factors(ll n)
{
vector<ll>r;
ll i,j;
for(i=1;i*i<=n;i++)
{
if(n%i==0)
{
r.push_back(i);
if(n/i!=i)
r.push_back(n/i);
}
}
return r;
}
//GCD
ll gcd(ll a,ll b)
{
if(b>a)
{
ll t=a;
a=b;
b=t;
}
if(b==0)return a;
return gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
return (a*b)/gcd(a,b);
}
//Graphs
vector<bool>bvisited(N,false);
vector<vector<ll>>G(N);
vector<ll> bfs(ll s)
{
vector<ll>order;
queue<ll>q;
bvisited[s]=true;
q.push(s);
while(!q.empty())
{
s=q.front();
q.pop();
order.push_back(s);
for(auto x:G[s])
{
if(!bvisited[x])
{
bvisited[x]=true;
q.push(x);
}
}
}
return order;
}
vector<bool>dvisited(N,false);
vector<ll> dfs(ll s)
{
vector<ll>order;
stack<ll>q;
q.push(s);
while(!q.empty())
{
ll v=q.top();
q.pop();
if(!dvisited[v])
{
order.push_back(v);
dvisited[v]=true;
}
for(ll i=0;i<G[v].size();i++)
{
if(!dvisited[G[v][i]])
{
q.push(G[v][i]);
}
}
}
return order;
}
//My Functions
void print(pair<ll,ll>a)
{
cout<<a.first<<" "<<a.second;
}
void print(vector<ll>a)
{
for(auto x:a)
cout<<x<<" ";
}
bool sortbysec(const pair<ll,ll>&a,const pair<ll,ll>&b)
{
return a.second<b.second;
}
//Main Solution
bool compress(const pair<ll,ll>&a,const pair<ll,ll>&b)
{
return (a.first-a.second)>(b.first-b.second);
}
void solve()
{
ll n,m,i,j,k,l=0,u=0;
cin>>n>>m;
vector<pair<ll,ll>>a(n);
for(i=0;i<n;i++)
{
cin>>j>>k;
l+=j;
a[i]={j,k};
}
sort(a.begin(),a.end(),compress);
i=0;
while(l>m && i<n)
{
l-=a[i].first-a[i].second;
i++;
u++;
}
if(l>m)
cout<<"-1";
else
cout<<u;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t=1;
//cin>>t;
while(t--)
{
solve();
}
}
| [
"[email protected]"
] | |
7e8a8c9a98926d971dc735503a59ddaa1517a85e | 4bd4cd8725113cf6172005e36c1d22d2c04df769 | /code2/include/general.h | 44648c22febc682da1714238ac8a241884f6b081 | [] | no_license | gjwei1999/PandaX-4T_sdu | 0389999da02334e1201efb8a7e534421401e7cdc | 7134cd5cd37e5be788d962ea7ee49ade0e9e660f | refs/heads/master | 2023-06-26T00:59:44.196253 | 2021-07-22T14:04:40 | 2021-07-22T14:04:40 | 318,829,423 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 155 | h | #pragma once
namespace pandax {
enum class EnergyType { NR = 1, GAMMA, ELECTRON, ALPHA, NRX, ERX };
constexpr double kW = 13.7 / 1000; // work function
}
| [
"[email protected]"
] | |
1d63cfff83fa2f9ba0e925b28cb953e3059f63d7 | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/squid/old_hunk_6534.cpp | 3e5a075e5441a82113bf36049fe7a7dc1a913696 | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 623 | cpp | xfree(fi);
}
static void
fileIteratorAdvance(FileIterator *fi)
{
int res;
assert(fi);
do {
time_t last_time = fi->inner_time;
res = fi->reader(fi);
fi->line_count++;
if (res == frError)
fi->bad_line_count++;
else
if (res == frEof)
fi->inner_time = -1;
else
if (fi->inner_time < last_time) {
assert(last_time >= 0);
fi->time_warp_count++;
fi->inner_time = last_time;
}
/* report progress */
if (!(fi->line_count % 50000))
fprintf(stderr, "%s scanned %d K entries (%d bad)\n",
fi->fname, fi->line_count / 1000, fi->bad_line_count);
} while (res < 0);
}
| [
"[email protected]"
] | |
91d0dcfe49e4fae6e7cadef42c878c41decb38c4 | 4ad2ec9e00f59c0e47d0de95110775a8a987cec2 | /_zFTP-backup/_Surse/BR_lic/BR_9_lic/BR_9_016/BR_9_0161.cpp | e6d2241fa5fc067af325bb66e2415b9af94c0b86 | [] | no_license | atatomir/work | 2f13cfd328e00275672e077bba1e84328fccf42f | e8444d2e48325476cfbf0d4cfe5a5aa1efbedce9 | refs/heads/master | 2021-01-23T10:03:44.821372 | 2021-01-17T18:07:15 | 2021-01-17T18:07:15 | 33,084,680 | 2 | 1 | null | 2015-08-02T20:16:02 | 2015-03-29T18:54:24 | C++ | UTF-8 | C++ | false | false | 1,025 | cpp | #include <fstream>
using namespace std;
void ord(int test[5001], int k) {
int i,aux;
for(int j=1;j<=k;j++)
for(i=1;i<k;i++)
if(test[i]>test[i+1]) {
aux=test[i];
test[i]=test[i+1];
test[i+1]=aux;
}
}
int cool(int test[5001], int k) {
int i;
bool ok=false;
for(i=1;i<k&&ok==false;i++)
if(test[i]+1!=test[i+1])
ok=true;
return ok;
}
int main()
{
ifstream in("cool.in");
ofstream out("cool.out");
int p,n,k,i;
in>>p>>n>>k;
if(p==1) {
int test[k+1];
//Punctul 1
//Citire
for(i=1;i<=k;i++) {
in>>test[i];
}
//Ordonare test
ord(test, k);
//Verificare cool
bool ok;
ok=cool(test, k);
if(!ok)
out<<test[k]<<endl;
else {
int j,nrv=0;
for(j=1;j<=k;j++) {
for(i=1;i<=k;i++)
if(test[i]==test[j]&&i!=j)
nrv++;
}
out<<k-nrv<<endl;
}
}
in.close();
out.close();
return 0;
}
| [
"[email protected]"
] | |
793d9855d433ae3fb347aa58b62d6da0febb5010 | 6ee567fc3836fce02cc2b4c9c87f107e85164b1e | /owreader/onewire.cpp | f2cba38914f6d01ccf7870d57bfce8bc04d9fb09 | [] | no_license | kamilmmach/projects | 761f65ea73427786ce5a67f7fcfdb3b78b61dcaa | a73708af576c93e282cd31b10a9446b7bda63891 | refs/heads/master | 2023-01-07T17:07:06.442548 | 2020-11-10T15:00:02 | 2020-11-10T15:00:02 | 311,422,090 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,348 | cpp | #include <iostream>
#include <cstring>
#include "onewire.hpp"
#include "utils.hpp"
bool OneWire::IsUnique()
{
if (device_length_ == 0)
return true;
// Compare rom buffer with every rom in found devices list
for (int i = 0; i < device_length_; i++)
{
if (memcmp(rom_buffer_, devices_[i].rom_num, 8) == 0)
{
return false;
}
}
return true;
}
uint8_t OneWire::Discover()
{
device_length_ = 0;
ResetSearch();
while (DeviceSearch())
{
// Sometimes, because of bad wiring, a device may report itself multiple times
// This is a temporary fix, so that every device found is unique
if (!IsUnique())
{
device_length_ = 0;
ResetSearch();
continue;
}
// Copy ROM number from buffer
memcpy(devices_[device_length_].rom_num, rom_buffer_, 8);
device_length_++;
}
return device_length_;
}
void OneWire::SendCommand(Command command)
{
WriteByte(static_cast<uint8_t>(command));
}
bool OneWire::SelectDevice(uint8_t device_id)
{
if (device_id >= device_length_)
return false;
SendCommand(Command::match_rom);
for (int i = 0; i < 8; i++)
WriteByte(devices_[device_id].rom_num[i]);
return true;
}
bool OneWire::DeviceSearch()
{
if (last_device_flag_)
{
ResetSearch();
return false;
}
if (!ResetAndPresence())
{
ResetSearch();
return false;
}
// Send Search ROM command
//WriteByte(0xF0);
SendCommand(Command::search_rom);
bool rom_bit = false, rom_bit_cmp = false;
bool search_direction = false;
uint8_t rom_bit_number = 1, rom_byte_mask = 1, last_bit_zero = 0, rom_byte_number = 0;
do
{
rom_bit = ReadBit();
rom_bit_cmp = ReadBit();
if (rom_bit == true && rom_bit_cmp == true)
{
return false;
}
// 0 && 1
if (rom_bit != rom_bit_cmp)
search_direction = rom_bit;
else
{
if (rom_bit_number < last_discrepancy_)
search_direction = ((rom_buffer_[rom_byte_number] & rom_byte_mask) > 0);
else
search_direction = (rom_bit_number == last_discrepancy_);
if (search_direction == false)
{
last_bit_zero = rom_bit_number;
if (last_bit_zero < 9)
last_family_discrepancy_ = last_bit_zero;
}
}
if (search_direction == true)
rom_buffer_[rom_byte_number] |= rom_byte_mask;
else
rom_buffer_[rom_byte_number] &= ~rom_byte_mask;
// Tell devices which direction we take so that
// other devices shut down
WriteBit(search_direction);
rom_bit_number++;
rom_byte_mask <<= 1;
// Whole byte has been read
if (rom_byte_mask == 0)
{
rom_byte_number++;
rom_byte_mask = 1;
}
} while (rom_byte_number < 8);
if (!((rom_bit_number < 65) || Utils::crc8(rom_buffer_, 8) != 0))
{
last_discrepancy_ = last_bit_zero;
if (last_discrepancy_ == 0)
last_device_flag_ = true;
return true;
}
if (!rom_buffer_[0])
ResetSearch();
return false;
}
void OneWire::ResetSearch()
{
last_device_flag_ = false;
last_discrepancy_ = 0;
last_family_discrepancy_ = 0;
}
bool OneWire::ResetAndPresence()
{
// Reset
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_write(pin_, LOW);
bcm2835_delayMicroseconds(480);
// Read presence
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_INPT);
bcm2835_delayMicroseconds(70);
uint8_t b = bcm2835_gpio_lev(pin_);
bcm2835_delayMicroseconds(410);
return !b;
}
void OneWire::WriteBit(bool value)
{
int delay1 = 6, delay2 = 64;
if (value == false)
{
delay1 = 80;
delay2 = 10;
}
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_write(pin_, LOW);
bcm2835_delayMicroseconds(delay1);
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_INPT);
bcm2835_delayMicroseconds(delay2);
}
void OneWire::WriteByte(uint8_t value)
{
for (int i = 0; i < 8; ++i)
{
WriteBit(value & 1);
value = value >> 1;
}
}
bool OneWire::ReadBit()
{
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_OUTP);
bcm2835_gpio_write(pin_, LOW);
bcm2835_delayMicroseconds(6);
bcm2835_gpio_fsel(pin_, BCM2835_GPIO_FSEL_INPT);
bcm2835_delayMicroseconds(8);
uint8_t b = bcm2835_gpio_lev(pin_);
bcm2835_delayMicroseconds(55);
return b;
}
uint8_t OneWire::ReadByte()
{
uint8_t rbyte = 0;
for (int i = 0; i < 8; ++i)
{
rbyte = rbyte | (ReadBit() << i);
}
return rbyte;
}
void OneWire::SkipROM()
{
SendCommand(Command::skip_rom);
}
uint8_t *OneWire::GetROM64(uint8_t device_id)
{
return devices_[device_id].rom_num;
}
uint8_t OneWireDevice::GetFamilyCode()
{
return rom_num[0];
}
| [
"[email protected]"
] | |
4101ded7e9b24cd5f25e8111f0d4ecff4496d3a4 | 4e032b7e98626e42c385f9b5b5d9acff1aa18ff0 | /aten/src/ATen/native/quantized/QTensor.cpp | ef4c7eb686d7a0d85f958a311b31fc1b450fc27b | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | hermeshephaestus/pytorch | aafd0c69efa8561dfd277985e7e84497623aec18 | 71260b98e2b215b166d5515b496ceee4a36dd86d | refs/heads/master | 2020-05-25T06:18:42.956613 | 2019-05-20T15:01:47 | 2019-05-20T15:08:28 | 187,665,394 | 1 | 0 | NOASSERTION | 2019-05-20T15:16:52 | 2019-05-20T15:16:52 | null | UTF-8 | C++ | false | false | 1,455 | cpp | #include <ATen/ATen.h>
#include <ATen/NativeFunctions.h>
#include <ATen/quantized/Quantizer.h>
#include <ATen/quantized/QTensorImpl.h>
namespace at {
namespace native {
Tensor quantize_linear_cpu(const Tensor& self, double scale, int64_t zero_point, ScalarType dtype) {
auto quantizer = make_per_tensor_affine_quantizer(scale, zero_point, dtype);
return quantizer->quantize(self);
}
Tensor dequantize_quant(const Tensor& self) {
return get_qtensorimpl(self)->quantizer()->dequantize(self);
}
Scalar q_scale_quant(const Tensor& self) {
auto quantizer = get_qtensorimpl(self)->quantizer();
AT_ASSERT(quantizer->qscheme() == kPerTensorAffine);
return Scalar(static_cast<PerTensorAffineQuantizer*>(quantizer.get())->scale());
}
Scalar q_zero_point_quant(const Tensor& self) {
auto quantizer = get_qtensorimpl(self)->quantizer();
AT_ASSERT(quantizer->qscheme() == kPerTensorAffine);
return Scalar(static_cast<PerTensorAffineQuantizer*>(quantizer.get())->zero_point());
}
Quantizer* quantizer(const Tensor& self) {
return get_qtensorimpl(self)->quantizer().get();
}
Tensor int_repr_quant(const Tensor& self) {
Tensor dst = at::empty(self.sizes(), self.options().dtype(at::kByte));
uint8_t* self_data = reinterpret_cast<uint8_t *>(self.data<quint8>());
uint8_t* dst_data = dst.data<uint8_t>();
if (self.numel() > 0) {
memcpy(dst_data, self_data, self.numel());
}
return dst;
}
} // namespace native
} // namespace at
| [
"[email protected]"
] | |
406bfec0c8ae220c4aef03c400ded6fd20b89a7b | 3dae85df94e05bb1f3527bca0d7ad413352e49d0 | /ml/nn/runtime/test/generated/examples/conv_quant8_overflow.example.cpp | 3fd52820f5e7f1008caf1ce1c03ee252df2c22b4 | [
"Apache-2.0"
] | permissive | Wenzhao-Xiang/webml-wasm | e48f4cde4cb986eaf389edabe78aa32c2e267cb9 | 0019b062bce220096c248b1fced09b90129b19f9 | refs/heads/master | 2020-04-08T11:57:07.170110 | 2018-11-29T07:21:37 | 2018-11-29T07:21:37 | 159,327,152 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 772 | cpp | // clang-format off
// Generated file (from: conv_quant8_overflow.mod.py). Do not edit
std::vector<MixedTypedExample> examples = {
// Begin of an example
{
.operands = {
//Input(s)
{ // See tools/test_generator/include/TestHarness.h:MixedTyped
// int -> FLOAT32 map
{},
// int -> INT32 map
{},
// int -> QUANT8_ASYMM map
{{0, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}}},
// int -> QUANT16_ASYMM map
{}
},
//Output(s)
{ // See tools/test_generator/include/TestHarness.h:MixedTyped
// int -> FLOAT32 map
{},
// int -> INT32 map
{},
// int -> QUANT8_ASYMM map
{{0, {75, 90, 105, 165, 203, 240, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}}},
// int -> QUANT16_ASYMM map
{}
}
},
}, // End of an example
};
| [
"[email protected]"
] | |
76fd64b10cc5a455ba7f7aa8102e55e679c8dbb6 | 732e78bc08828027257a8495e6759e6a03e5eb55 | /王道/chapter4/特殊乘法.cpp | a21a5d52b74874ecee106fae86e16bc856139825 | [] | no_license | soleil0510/Algorithm | dd80bd8bc41301874eb2b2dba3cad55613b15199 | ab688af0f7f62462d3bf6759e7133cd2ab6276f3 | refs/heads/master | 2020-07-14T17:39:59.595116 | 2019-09-15T14:54:54 | 2019-09-15T14:54:54 | 205,365,040 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 829 | cpp | //ÌØÊâ³Ë·¨£º123*45=1*4+1*5+2*4+2*5+3*4+3*5
//#include<iostream>
//#include<cstring>
//#define N 20
//using namespace std;
//
//int a[N],b[N];
//
//int main(){
// int A,B;
//
// while(cin>>A>>B){
// int i=0,j=0;
// while(A/10!=0){
// a[i]=A%10;
// A=A/10;
// i++;
// }
// a[i]=A;
// while(B/10!=0){
// b[j]=B%10;
// B=B/10;
// j++;
// }
// b[j]=B;
//
// int sum=0;
// for(int m=0;m<=i;m++){
// for(int n=0;n<=j;n++){
// sum+=a[m]*b[n];
// }
//
// }
// cout<<sum<<endl;
//
// }
//
//
// return 0;
//}
#include<iostream>
#include<cstring>
using namespace std;
int main(){
char s1[20],s2[20];
while(scanf("%s%s",s1,s2)!=EOF){
int ans=0;
for(int i=0;i<strlen(s1);i++){
for(int j=0;j<strlen(s2);j++){
ans+=(s1[i]-'0')*(s2[j]-'0');
}
}
cout<<ans<<endl;
}
}
| [
"[email protected]"
] | |
7a3ba6476a0a783290686eb439996215953a97b0 | 070277d0b4cffd2fdf1e4f7821e9fd9027930bbf | /source/all/testcore/zprog.all.cpp | 11b969c1f128ef49c2e229125cec364bae91093a | [
"LicenseRef-scancode-other-permissive"
] | permissive | waterlink/Cursov2011 | af6c8e95b037be4b42df089b751c1adf83a7015d | e458646b394fb0d3b1fcce0c41fabb83c2d95af0 | refs/heads/master | 2016-08-04T18:24:53.793823 | 2012-03-17T12:10:05 | 2012-03-17T12:10:05 | 1,543,450 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,088 | cpp | //
// Author: Fedorov Alexey
// Type: Open-Source Project
// Platform: Linux and Windows
// Codename: Project Santiago
//
// Designer of the robot behavior
//
// sharp-end must not to be deleted
//
//
// source file
// emulator class for z0rch's module
//
#include "zprog.all.hpp"
#include <cmath>
#include <ctime>
#include "../utilcore/mather.all.hpp"
zprog::zprog(btexecutor * btexec, robot * robo){
this->btexec = btexec;
this->robo = robo;
}
zprog::~zprog(){}
void zprog::passstartcoords(int sx, int sy, int lx, int ly){
pos = make_pair(1.0 * sx, 1.0 * sy);
look = make_pair(1.0 * lx, 1.0 * ly);
}
void zprog::moverel(int dx, int dy){
moverelcommands.push_back(make_pair(dx, dy));
}
void zprog::beep(){
withbeep.push_back(moverelcommands.size() - 1);
}
void zprog::setlight(bool fLight){
if (fLight)
withlighton.push_back(moverelcommands.size() - 1);
else withlightoff.push_back(moverelcommands.size() - 1);
}
void zprog::run(){
// TODO: code this up
int withbeepPos = 0;
int withlightonPos = 0;
int withlightoffPos = 0;
int commandsPos = -1;
do {
if (commandsPos > 0){
realrelmove(moverelcommands[commandsPos].first, moverelcommands[commandsPos].first);
if (btexec->getTouchSensorState())
break;
}
if (withbeep.size() > 0)
if (withbeep[withbeepPos] == commandsPos)
robo->beep();
if (withlighton.size() > 0)
if (withlighton[withlightonPos] == commandsPos)
robo->slight(true);
if (withlightoff.size() > 0)
if (withlightoff[withlightoffPos] == commandsPos)
robo->slight(false);
} while (++commandsPos < moverelcommands.size());
}
/*
P0:
_______________________________________________
look
/ targ
/ R-dist *
/ b-angle
* a-angle -> x
sp
_______________________________________________
P1:
_______________________________________________
look,targ
R --------*
a=b ----------
*-----
sp
_______________________________________________
P2:
_______________________________________________
targ -------- look
*-----
sp
_______________________________________________
*/
void zprog::realrelmove(int dx, int dy){
double mullifier = 100.0;
double rotspeed = 0.3;
double gospeed = 0.5;
double maxspeed = robo->getmaxspeed();
double rspeed = maxspeed * rotspeed;
double gspeed = 2.0 * maxspeed * gospeed;
double sizex = robo->getsize().first;
pair < double, double > xylxy = make_pair(look.first - pos.first, look.second - pos.second);
xylxy = mather::normalize(xylxy, 1.0);
double a = acos(xylxy.first);
if (xylxy.second < 0.0)
a = 2.0 * mather::pi() - a;
pair < double, double > xyt = make_pair(1.0 * dx, 1.0 * dy);
xyt = mather::normalize(xyt, 1.0);
double b = acos(xyt.first);
if (xyt.second < 0.0)
b = 2.0 * mather::pi() - b;
a -= b;
//a = -a;
printf("a-angle: %.3lf\n", a);
double R = sizex;
double l = R * fabs(a);
double ndt = l / rspeed;
int counter = 0;
double t = 1.0 * clock() / CLOCKS_PER_SEC;
double dt = 0.0;
if (a < -mather::epsilon()){
btexec->setRD0power(rotspeed * mullifier);
btexec->setRD1power(0.0);
}
else if (a > mather::epsilon()){
btexec->setRD1power(rotspeed * mullifier);
btexec->setRD0power(0.0);
}
if (a < 0.0) a = -a;
if (a > mather::epsilon()){
while (1){
if (counter == 100){
dt = 1.0 * clock() / CLOCKS_PER_SEC - t;
if (dt >= ndt){
btexec->setRD0power(0.0);
btexec->setRD1power(0.0);
break;
}
counter = 0;
}
++counter;
}
}
l = mather::dist(make_pair(1.0 * dx, 1.0 * dy));
ndt = l / gspeed;
counter = 0;
t = 1.0 * clock() / CLOCKS_PER_SEC;
btexec->setRD0power(gospeed * mullifier);
btexec->setRD1power(gospeed * mullifier);
while (1){
if (counter == 100){
dt = 1.0 * clock() / CLOCKS_PER_SEC - t;
if (dt >= ndt){
btexec->setRD0power(0.0);
btexec->setRD1power(0.0);
break;
}
counter = 0;
}
++counter;
}
pos.first += 1.0 * dx;
pos.second += 1.0 * dy;
look.first = pos.first + 1.0 * dx;
look.second = pos.second + 1.0 * dy;
}
//#end
| [
"[email protected]"
] | |
204aa20350216df5df95f471f78cd5225fd0cb49 | 70f5e9fffef678a25596dfbbacbc20fb7130be76 | /src/game_object/cube.h | 7217edbc982dde0cd2b8547d75c8fe395d40e192 | [] | no_license | yxyxnrh/CG_Group14 | 69c9064d49c0d0859f614939fe8949b53abd9d5c | 9e1dda46e09d346ea594ad3e873c064364324a49 | refs/heads/master | 2022-01-25T14:28:10.474900 | 2019-07-19T16:23:26 | 2019-07-19T16:23:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,401 | h | #ifndef CUBE_H
#define CUBE_H
#include "./entity.h"
#include "../stb_image/stb_image.h"
#include "../renderers/RendererManager.h"
class Cube : public Entity {
public:
float cubeVertices[36 * 8] = {
// positions // normals // texcoords
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
-0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f,
-0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,0.0f, 0.0f
};
unsigned int cubeVAO, texture;
void initCubeVAO();
Cube();
void draw(Shader* shader = nullptr) const;
glm::mat4 getModelMat() const;
void initTexture();
};
#endif
| [
"[email protected]"
] | |
7ed24c9cc09a19d3a6420d54e41f18e8c187f09a | 1a17167c38dc9a12c1f72dd0f3ae7288f5cd7da0 | /Source/ThirdParty/angle/third_party/SwiftShader/src/Common/Debug.cpp | acf469e5ab58ac5f8701160d4a6e55d72225522a | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"Zlib",
"LicenseRef-scancode-khronos",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | elix22/Urho3D | c57c7ecb58975f51fabb95bcc4330bc5b0812de7 | 99902ae2a867be0d6dbe4c575f9c8c318805ec64 | refs/heads/master | 2023-06-01T01:19:57.155566 | 2021-12-07T16:47:20 | 2021-12-07T17:46:58 | 165,504,739 | 21 | 4 | MIT | 2021-11-05T01:02:08 | 2019-01-13T12:51:17 | C++ | UTF-8 | C++ | false | false | 938 | cpp | // Copyright 2016 The SwiftShader 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.
#include "Debug.hpp"
#include <stdio.h>
#include <stdarg.h>
namespace sw
{
void trace(const char *format, ...)
{
if(false)
{
FILE *file = fopen("debug.txt", "a");
if(file)
{
va_list vararg;
va_start(vararg, format);
vfprintf(file, format, vararg);
va_end(vararg);
fclose(file);
}
}
}
}
| [
"[email protected]"
] | |
6acfcf4264da1e212f73d77ffce2660207862436 | 00c5a83bf2d267ff96b8041d75fadfa95af1891e | /RtosWrapper/MyTasks/Led3Task.hpp | 558a32cb14599a8a91d6f602340399b570c0259e | [
"MIT"
] | permissive | katyachalykh/Kursovaya | 7afca3b304deccbde64fdf69fcffcea7c3fdf9b7 | 1d0220dac6676c7210d082a217b6919fa72aa85d | refs/heads/main | 2023-04-28T21:21:32.928751 | 2021-05-28T07:21:10 | 2021-05-28T07:21:10 | 371,413,489 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 158 | hpp | /* #pragma once
#include "thread.hpp"
using namespace OsWrapper;
class Led3Task : public Thread<128U>
{
public:
void Execute() override;
};*/ | [
"[email protected]"
] | |
4af229f96c87280ca0656b3c50ff34849f9090bb | f3c8d78b4f8af9a5a0d047fbae32a5c2fca0edab | /Qt/lib2/Box2D/win/Box2D/Dynamics/Contacts/b2EdgeCircleContact.cpp | fb919f92c3088992b96b3b6cdcca6605b3727c1d | [] | no_license | RinatB2017/mega_GIT | 7ddaa3ff258afee1a89503e42b6719fb57a3cc32 | f322e460a1a5029385843646ead7d6874479861e | refs/heads/master | 2023-09-02T03:44:33.869767 | 2023-08-21T08:20:14 | 2023-08-21T08:20:14 | 97,226,298 | 5 | 2 | null | 2022-12-09T10:31:43 | 2017-07-14T11:17:39 | C++ | UTF-8 | C++ | false | false | 2,185 | cpp | // MIT License
// Copyright (c) 2019 Erin Catto
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <b2EdgeCircleContact.h>
#include <b2BlockAllocator.h>
#include <b2Fixture.h>
#include <new>
b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int, b2Fixture* fixtureB, int, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact));
return new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB);
}
void b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)
{
((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact();
allocator->Free(contact, sizeof(b2EdgeAndCircleContact));
}
b2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB)
: b2Contact(fixtureA, 0, fixtureB, 0)
{
b2Assert(m_fixtureA->GetType() == b2Shape::e_edge);
b2Assert(m_fixtureB->GetType() == b2Shape::e_circle);
}
void b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)
{
b2CollideEdgeAndCircle( manifold,
(b2EdgeShape*)m_fixtureA->GetShape(), xfA,
(b2CircleShape*)m_fixtureB->GetShape(), xfB);
}
| [
"[email protected]"
] | |
1e34bda912a843045c5e16ff3036eaefcddbe589 | c3d7ad47f0a31ba23dc88b53500e4148713656a0 | /团体程序设计天梯赛-练习集/L1-013.cpp | 716e6ffb8dd4956b93b71c29a9325b219aa6e5d9 | [] | no_license | xs172595372/C_Practise | a6a29d2655bd8110e788a8e08c3a8c584120e81d | 028007ce639feced24427efd4587f44593f278f9 | refs/heads/master | 2020-04-12T23:19:28.699559 | 2018-12-22T14:02:09 | 2018-12-22T14:02:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 152 | cpp | #include<stdio.h>
int main(){
int num,sum=1,i,x=1;
scanf("%d",&num);
for(i=1;i<num;i++){
x=x*(i+1);
sum=sum+x;
}
printf("%d",sum);
return 0;
} | [
"[email protected]"
] | |
3ddc2aedf3dd8c9c211da48d4154b686dee9ca18 | e414c59e690b8fa17507a2d41748bdd5b37e9d1a | /91.cpp | 58c1278d119e2113e89d25a0d9122f170dfae5fe | [] | no_license | asimali246/Spoj-solutions | ab3890ad77a2410bf76c76c48b60eafa1596737e | 056e8e31f39355d56c9090742c9080e9c6445324 | refs/heads/master | 2020-06-03T01:09:56.532294 | 2015-05-11T12:26:17 | 2015-05-11T12:26:17 | 17,375,799 | 4 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,454 | cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <set>
#include <cstring>
#include <iomanip>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <string>
#include <vector>
#include <new>
#include <bitset>
#include <ctime>
#include <stdint.h>
#include <unistd.h>
using namespace std;
#define ll long long int
#define INF 1000000000
#define PI acos(-1.0)
#define EPS 1e-9
template <typename X> X gcd(X a, X b){if(!b)return a; else return gcd(b, a%b);}
typedef vector<int> vi;
typedef pair<int, int> ii;
int t, flag, c, prime[100100], l, j;
ll n, i, x;
bitset<1000010> bs;
int main(){
bs.reset();
l=1;
for(i=3;i<=1000000;++i){
if(!bs[i]){
prime[l++]=i;
for(j=i+i;j<=1000000;j+=i)
bs[j]=1;
}
}
--l;
scanf("%d", &t);
while(t--){
flag=0;
scanf("%lld", &n);
while(n%2==0 && n)
n/=2;
for(i=1;i<=l;++i){
if(prime[i]>n)
break;
c=0;
while(n%prime[i]==0)
n/=prime[i], c++;
if(prime[i]%4==3 && c%2!=0){
printf("No\n");
flag=1;
break;
}
}
if(n>1 && n%4==3 && !flag){
printf("No\n");
continue;
}
if(!flag)
printf("Yes\n");
}
return 0;
}
| [
"[email protected]"
] | |
7369047d90954733107e9671263b61c19334d870 | ffcb4a1ac26b61cce1298ba1b2d01d0599755311 | /Cubitos.h | 0b28bd26cb739e5dc8f4a5ed13f85e2f41ca2440 | [] | no_license | eulalie/AErubik | 3928c4adf35a0726f082851f33c72769c1083508 | f988a2448c9d5e538f1c72dc45fad1f417bcb9dc | refs/heads/master | 2020-12-24T15:40:18.855811 | 2014-05-21T01:26:46 | 2014-05-21T01:26:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,820 | h | //***********************************************************************
//
//
//
//***********************************************************************
#ifndef __CUBITOS_H__
#define __CUBITOS_H__
// ======================================================================
// Libraries
// ======================================================================
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <vector>
#include <time.h>
// ======================================================================
// Project Files
// ======================================================================
// ======================================================================
// Class declarations
// ======================================================================
using namespace std;
class Cubitos
{
// ======================================================================
// Friend Class
// ======================================================================
public :
// ==================================================================
// Enums
// ==================================================================
// ==================================================================
// Constructors
// ==================================================================
Cubitos(int* pos,string colors);
// ==================================================================
// Destructor
// ==================================================================
virtual ~Cubitos(void);
// ==================================================================
// Accessors: getters
// ==================================================================
inline int get_x(void)const;
inline int get_y(void)const;
inline int get_z(void)const;
inline string get_colors(void)const;
// ==================================================================
// Accessors: setters
// ==================================================================
// ==================================================================
// Operators
// ==================================================================
// ==================================================================
// Public Methods
// ==================================================================
void print_cubito(void);
// ==================================================================
// Public Attributes
// ==================================================================
protected :
// ==================================================================
// Forbidden Constructors
// ==================================================================
Cubitos( void )
{
printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ );
exit( EXIT_FAILURE );
};
Cubitos( const Cubitos &model )
{
printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ );
exit( EXIT_FAILURE );
};
// ==================================================================
// Protected Methods
// ==================================================================
// ==================================================================
// Protected Attributes
// ==================================================================
int x;
int y;
int z;
string colors;
};
// ======================================================================
// Getters' definitions
// ======================================================================
int Cubitos::get_x(void)const
{
return x;
}
int Cubitos::get_y(void)const
{
return y;
}
int Cubitos::get_z(void)const
{
return z;
}
string Cubitos::get_colors(void)const
{
return colors;
}
// ======================================================================
// Operators' definitions
// ======================================================================
// ======================================================================
// Inline functions' definition
// ======================================================================
#endif // __CUBITOS_H__
| [
"[email protected]"
] | |
925b9b8c6eaf887be9a85bc87eab4adc8aa8d204 | b4126e320f6f9e9e05c8ca855426ece11b478d49 | /Arduino/Main_Arduino_Loop/Main_Arduino_Loop.ino | 4893aee2eb7f33a4a4723fa0a7e39a589dd956d3 | [] | no_license | brad6459/rasp | c7692c95a012d89a6f1de3f74d33bab8442cca9b | e1f32ee12af90b9cac2359b4b43fa3b22087ded5 | refs/heads/master | 2020-03-20T08:48:17.149963 | 2019-02-09T09:27:07 | 2019-02-09T09:27:07 | 137,319,082 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,896 | ino | /*------------------------------------------------------------------
Author: Brindan Adhikari
Pupose: This will be the main arduino loop
Included:
1) 2x Ultrasonic
2) 1x single beam
Future Work:
1) Motor controller
2) Linear-mass controller
3) Encoders
-------------------------------------------------------------------*/
//Define all constants from every mode
const int semi_aut_mod_pin = 12; //Semi-autonomous-mode
//Define the Single Beam Pins
const int trigPin_lidar1 = 2;
const int monitorPin_lidar1 = 3;
unsigned long pulseWidth;
const int discont_mod_pin = 13; //Discontinuity-mode
//Define the ultrasonic Sensors pins
const int trigPin_ultra1 = 9; //ultrasonic#1
const int echoPin_ultra1 = 10;
const int trigPin_ultra2 = 4; //ultrasonic#2
const int echoPin_ultra2 = 5;
long duration;
float distance;
//Start all modes at false
int semi_aut_mod = 0;
int discont_mod =0;
//Define mode
int MODE;
int lastMODE;
/*-------------------------------------------------------------------
Setup:setup all the pins as either inputs or outputs &set all
modes to LOW*/
void setup()
{ //MODES set to low
pinMode(semi_aut_mod_pin, INPUT);
digitalWrite(semi_aut_mod_pin,LOW);
pinMode(discont_mod_pin, INPUT);
digitalWrite(discont_mod_pin,LOW);
//Single Beam Setup
pinMode(trigPin_lidar1,OUTPUT);
digitalWrite(trigPin_lidar1,LOW);
pinMode(monitorPin_lidar1,INPUT);
//Ultrasonic Setup
pinMode(trigPin_ultra1, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin_ultra1, INPUT); // Sets the echoPin as an Input
pinMode(trigPin_ultra2, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin_ultra2, INPUT); // Sets the echoPin as an Input
}
/*___________________________________________________________________
---------------------------MAIN LOOP---------------------------------
_____________________________________________________________________*/
void loop()
{
//Set all modes to reading the respective pins to verify current mode
semi_aut_mod = digitalRead(semi_aut_mod_pin);
discont_mod = digitalRead(discont_mod_pin);
//Select the mode
if (semi_aut_mod == HIGH)
{
MODE = 3;
Serial.print("Semi-Autonomous-Mode Activated");
}
else if (discont_mod == HIGH)
{
MODE = 4;
Serial.print("Discontinuity-Mode Activated");
}
else
{
Serial.print("No Modes Detected");
}
//See if MODES have switched
if(MODE !=lastMODE)
{
// Enter Swtich cases for the modes
switch(MODE)
{
//------------------------Discontinuity MODE------------------------
case 4:
Serial.begin(9600); //Starts the serial communication
// Ultrasonics #1
// Clears the trigPin
digitalWrite(trigPin_ultra1, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin_ultra1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin_ultra1, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin_ultra1, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance#1: ");
Serial.println(distance);
// Ultrasonic #2
// Clears the trigPin
digitalWrite(trigPin_ultra2, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin_ultra2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin_ultra2, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin_ultra2, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance#2: ");
Serial.println(distance);
break;
//-----------------------Semi-autonomous-Mode--------------------
case 3:
Serial.begin(115200); //Start Serial communications
//Single-Beam#1
pulseWidth = pulseIn(monitorPin_lidar1, HIGH); // Count how long the pulse is high in microseconds
if(pulseWidth != 0) //If reading isn't 0
{
pulseWidth = pulseWidth / 10; // 10usec = 1 cm of distance
Serial.println(pulseWidth); // Print the distance
}
break;
}
lastMODE = MODE;
}
}
| [
"[email protected]"
] | |
25c91dd33c7e833516a488dccef881b845505cd7 | 89b7e4a17ae14a43433b512146364b3656827261 | /testcases/CWE78_OS_Command_Injection/s07/CWE78_OS_Command_Injection__wchar_t_environment_system_81.h | a6a8be4db9f376126afcbf87b5f64a8149c279c7 | [] | no_license | tuyen1998/Juliet_test_Suite | 7f50a3a39ecf0afbb2edfd9f444ee017d94f99ee | 4f968ac0376304f4b1b369a615f25977be5430ac | refs/heads/master | 2020-08-31T23:40:45.070918 | 2019-11-01T07:43:59 | 2019-11-01T07:43:59 | 218,817,337 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,408 | h | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__wchar_t_environment_system_81.h
Label Definition File: CWE78_OS_Command_Injection.one_string.label.xml
Template File: sources-sink-81.tmpl.h
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: environment Read input from an environment variable
* GoodSource: Fixed string
* Sinks: system
* BadSink : Execute command in data using system()
* Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifdef _WIN32
#define FULL_COMMAND L"dir "
#else
#include <unistd.h>
#define FULL_COMMAND L"ls "
#endif
namespace CWE78_OS_Command_Injection__wchar_t_environment_system_81
{
class CWE78_OS_Command_Injection__wchar_t_environment_system_81_base
{
public:
/* pure virtual function */
virtual void action(wchar_t * data) const = 0;
};
#ifndef OMITBAD
class CWE78_OS_Command_Injection__wchar_t_environment_system_81_bad : public CWE78_OS_Command_Injection__wchar_t_environment_system_81_base
{
public:
void action(wchar_t * data) const;
};
#endif /* OMITBAD */
#ifndef OMITGOOD
class CWE78_OS_Command_Injection__wchar_t_environment_system_81_goodG2B : public CWE78_OS_Command_Injection__wchar_t_environment_system_81_base
{
public:
void action(wchar_t * data) const;
};
#endif /* OMITGOOD */
}
| [
"[email protected]"
] | |
f2d8d83850bb0e038335a3320b19d27fc41d4cf1 | 4ff6383d4318a33b6217ffc84a849eeef68b898a | /src/qt/openuridialog.cpp | 96fe72aa4922b093254841aa80725afd04761de5 | [
"MIT"
] | permissive | PayQ/QpayCoin | 31863c2bd8e1073f67bfa4bc852e664b1464cd55 | 6c346fc83ca9b9c91171ee3866cf597e22ad075e | refs/heads/master | 2020-05-07T09:04:43.835417 | 2019-04-09T12:32:23 | 2019-04-09T12:32:23 | 180,361,388 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,411 | cpp | // Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018 The QpayCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "openuridialog.h"
#include "ui_openuridialog.h"
#include "guiutil.h"
#include "walletmodel.h"
#include <QUrl>
OpenURIDialog::OpenURIDialog(QWidget* parent) : QDialog(parent),
ui(new Ui::OpenURIDialog)
{
ui->setupUi(this);
#if QT_VERSION >= 0x040700
ui->uriEdit->setPlaceholderText("qpaycoin:");
#endif
}
OpenURIDialog::~OpenURIDialog()
{
delete ui;
}
QString OpenURIDialog::getURI()
{
return ui->uriEdit->text();
}
void OpenURIDialog::accept()
{
SendCoinsRecipient rcp;
if (GUIUtil::parseBitcoinURI(getURI(), &rcp)) {
/* Only accept value URIs */
QDialog::accept();
} else {
ui->uriEdit->setValid(false);
}
}
void OpenURIDialog::on_selectFileButton_clicked()
{
QString filename = GUIUtil::getOpenFileName(this, tr("Select payment request file to open"), "", "", NULL);
if (filename.isEmpty())
return;
QUrl fileUri = QUrl::fromLocalFile(filename);
ui->uriEdit->setText("qpaycoin:?r=" + QUrl::toPercentEncoding(fileUri.toString()));
}
| [
"[email protected]"
] | |
d83effed37e560149c6d74876999da7e0255e873 | 64539fcb220fcdd37435956a60f38040beb2b8ca | /MegaDataProject/Model/Timer.cpp | 209551844735d041ab09d26ef367f955b83878a6 | [] | no_license | isaach0011/MegaDataProject | 6dc7f2aedf4b8ef2c5eca26db138faadf660be91 | 8663271954c2366486b451c02b5d7c03ecfa86ca | refs/heads/master | 2021-01-22T03:23:47.815751 | 2017-05-19T19:40:35 | 2017-05-19T19:40:35 | 81,123,580 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 742 | cpp | //
// Timer.cpp
// FirstCPlusPlusProject
//
// Created by Hill, Isaac on 1/31/17.
// Copyright © 2017 Hill, Isaac. All rights reserved.
//
#include "Timer.hpp"
#include <iostream>
using namespace std;
Timer :: Timer()
{
executionTime = 0;
}
void Timer :: resetTimer()
{
executionTime = 0;
}
void Timer :: startTimer()
{
executionTime = clock();
}
void Timer :: stopTimer()
{
executionTime = clock() - executionTime;
}
long Timer :: getExecutionTimeInMicroseconds()
{
return executionTime;
}
void Timer :: displayTimerInformation()
{
cout << "It took this long to execute: " << executionTime << " microseconds." << endl;
cout << "That is this many seconds: " << executionTime/CLOCKS_PER_SEC << endl;
}
| [
"[email protected]"
] | |
af963f36231eaaaa91bb0a75c67a3af172d0f23a | 3ec5c47c6d2907bbe94daab2eacb0a04320d43f8 | /entities/point.h | b790d28695fae4b44e94c7c97572300686ef5ec2 | [] | no_license | NEDJIMAbelgacem/vectorization-tool | 7a61c5e6a38e55aae9705fbaf764858b8b599442 | 0463e28bae17bc892e0a955d393f437e173102e3 | refs/heads/master | 2021-01-06T16:41:22.870145 | 2020-03-19T10:59:13 | 2020-03-19T10:59:13 | 241,402,181 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,657 | h | #pragma once
#include "entity.h"
#include "mainwindow.h"
#include "entitiesmanager.h"
#include "drawingconfig.h"
class PointEntity;
#include <QRect>
#include <QGraphicsEllipseItem>
class PointEntity : public Entity {
DrawingConfig config;
private:
void applyConfig();
QPen getPen();
QGraphicsEllipseItem* selection_item = nullptr;
public:
PointEntity();
PointEntity(QDomElement& element);
void setPosition(QPointF pos);
void setWidth(qreal w) override { this->config.setConfig("width", w); applyConfig(); }
qreal getWidth() override { return config.getConfig<qreal>("width"); }
void setColor(QColor color) override { this->config.setConfig("color", color); applyConfig(); }
QColor getColor() override { return config.getConfig<QColor>("color"); }
QPointF getPoint();
void setConfig(DrawingConfig config);
bool isNeighboursWith(PointEntity* point, qreal threshold);
bool isNeighboursWith(LineEntity* line, qreal threshold);
bool isNeighboursWith(PolygonEntity* polygon, qreal threshold);
bool isNeighboursWith(PolylineEntity* polyline, qreal threshold);
QGraphicsEllipseItem* getItem();
void selectedEvent() override;
void deselectedEvent() override;
TopologyCheckResult checkTopologyCondition(LineEntity* entity) override;
TopologyCheckResult checkTopologyCondition(PolygonEntity* entity) override;
TopologyCheckResult checkTopologyCondition(PointEntity* entity) override;
TopologyCheckResult checkTopologyCondition(PolylineEntity* entity) override;
void moveBy(QPointF dp) override;
QDomElement toDomElement(QDomDocument &doc) override;
};
| [
"[email protected]"
] | |
89c8b3d2c5754ef8d65a02bc7f03d55bafef89b5 | 56649046304376279d71bf6fd82562f7efa293ca | /sims/arproctest_sim.cpp | af1a2e89f8e90e835f586afb28e1a88a664d20ea | [] | no_license | zwm152/WirelessCommSystemSimuC-Model | b9b3de73956caa8e872c3d36580ec863962d8ef2 | 7be3562b5a516c73f06c4090b5806ffe7319fe8a | refs/heads/master | 2021-09-23T15:41:08.088030 | 2018-09-25T12:04:04 | 2018-09-25T12:04:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,710 | cpp | //
// File = arproctest_sim.cpp
//
#define SIM_NAME "ArProcTest\0"
#define SIM_TITLE "Autoregressive Noise Testbed\0"
#include "global_stuff.h"
#include "rayleigh_theory.h"
#include "level_gen.h"
#include "disc_auto_cov.h"
#include "histogram.h"
#include "ogive.h"
#include "siganchr.h"
#include "ar_proc_gen.h"
#include "spec_analyzer.h"
#include "ar_spec.h"
main()
{
#include "sim_preamble.cpp"
//=========================================================================
// Misc special processing
double a_coeffs[3];
a_coeffs[0] = 1.0;
a_coeffs[1] = -0.6;
a_coeffs[2] = 0.8;
ArSpectrum *ar_spectrum = new ArSpectrum( 2,//true_ar_order,
a_coeffs,
0.0009765625,
0.32,
512,
0.5);//true_ar_drv_var );
ar_spectrum->DumpSpectrum( "ar_true_spec.txt\0",
true);
//=========================================================================
// Allocate signals
FLOAT_SIGNAL(noisy_sig);
//============================================================
// Construct, initialize and connect models
ArProcessGenerator<float>* noise_source = new ArProcessGenerator<float>(
"noise_source\0",
CommSystem,
noisy_sig);
SignalAnchor* sig_anchr = new SignalAnchor( "sig_anchr\0",
CommSystem,
noisy_sig );
// DiscreteAutoCovar* disc_autocovar = new DiscreteAutoCovar( "disc_autocovar\0",
// CommSystem,
// bit_seq);
HistogramBuilder<float>* histogram = new HistogramBuilder<float>( "histogram\0",
CommSystem,
noisy_sig);
// OgiveBuilder<float>* ogive = new OgiveBuilder<float>( "ogive\0",
// CommSystem,
// noisy_sig);
SpectrumAnalyzer<float>* spec_analyzer =
new SpectrumAnalyzer<float>( "spec_analyzer\0",
CommSystem,
noisy_sig );
//=============================================================
#include "sim_postamble.cpp"
return 0;
}
| [
"[email protected]"
] | |
001e62dd7a098d73d5dda5a16ae05e8dfb056ae2 | 1959f7f7014ebfcad68bffb4b81bbcae332c73bb | /Tests/QtAutogen/same_name/bbb/item.hpp | eda84a2e8fb0e2a9d8f8610c1306fd7ef47595ef | [
"BSD-3-Clause"
] | permissive | mutual-ai/CMake | 6d6f3ff1bde0259c46687d18b8f90f1b3e145fd4 | d08281094948eaefb495040f4a7bb45cba17a5a7 | refs/heads/master | 2020-04-06T06:29:37.461188 | 2016-05-16T14:11:43 | 2016-05-16T14:11:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 159 | hpp | #ifndef SDB_ITEM_HPP
#define SDB_ITEM_HPP
#include <QObject>
namespace bbb {
class Item : public QObject
{
Q_OBJECT
Q_SLOT
void go ( );
};
}
#endif
| [
"[email protected]"
] |
Subsets and Splits